(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_Speechify Chrome Extension"]="13.4.1"}catch(l){}})();
import{a as E}from"./chunk-MQ7TS7IC.js";import"./chunk-6XO4FK4F.js";import{A as s,B as c,J as u,gc as l,h as a,kc as m,oc as d,pc as p}from"./chunk-XMRXO6YU.js";import"./chunk-ODCFEFOB.js";import"./chunk-24ZZP5UQ.js";import"./chunk-GQY3J744.js";import"./chunk-NWEJW7RD.js";import"./chunk-ASZMUWWE.js";import"./chunk-4XRFE7WB.js";import"./chunk-6I7EUWRH.js";import{g as n,n as o}from"./chunk-CLPINNGF.js";o();n();function P(){return u.on("subscriptionupdate",async e=>{!e||s(e)||c(e)||e.productId!=="none"&&E()})}var S=async()=>{let e=null,t=[],f=await m("PLAYABLE_CONTENT_UPDATED",async({changed:r})=>{e?.id!==r.id&&(e=r,e.metadata.source!==r.metadata.source&&(t.length=0))}),g=a(1),T=await l.registerHook("PLAYBACK_STATE_CHANGED",r=>g(async({state:i})=>{e&&(i==="playing"&&!t.includes("extension_usage_widget_listened_to_page")?(t.push("extension_usage_widget_listened_to_page"),p({triggeredFrom:e.metadata.source,isSelection:e.metadata.source==="Selection Player"})):i==="playing"&&t.includes("extension_usage_widget_listened_to_page")&&t.includes("ended")?(t.push("extension_usage_widget_relistened_to_page"),d({triggeredFrom:e.metadata.source,isSelection:e.metadata.source==="Selection Player"})):i==="ended"&&t.push("ended"))},r));return()=>{T(),f()}};async function y(){let e=[P(),await S()];return()=>{e.forEach(t=>t())}}export{y as default};
//# sourceMappingURL=init-SUUYEDUB.js.map
