(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 v}from"./chunk-RAYHJIUZ.js";import{a as Y}from"./chunk-QGWVBTAL.js";import{Ab as U,Cb as M,Df as q,Ec as k,Ef as B,Fc as G,Kf as b,Sf as X,Tc as V,Uc as $,Vc as N,Wf as z,Zf as j,gc as W,hc as C,id as w,lc as T,qd as K,rc as y,yc as l,yg as p,zg as h}from"./chunk-XMRXO6YU.js";import{i as s,n as c,s as a,v as F}from"./chunk-24ZZP5UQ.js";import{g as E}from"./chunk-GQY3J744.js";import{d as g,g as e,i as o,n}from"./chunk-CLPINNGF.js";n();e();n();e();var J=g(E());n();e();var Z=()=>{let t=C.useCurrentContent(),r=C.useTime();return{noTextDetected:!!t&&r.isLoading===!1&&r.totalEstimatedDuration<=0}};var Q=()=>{let t=N(L=>L.isPDF),{noTextDetected:r}=Z(),{docTitle:i}=Y(),f=C.useTime(),d=C.usePlayingState(),P=d==="playing"||d==="buffering";return(0,J.useMemo)(()=>t||z()?!0:j()?!1:!(f.totalEstimatedDuration>0)&&(!i||r&&!P),[f,r,i,t,P])};var ao=["chatgpt","docs-support","google-drive-support","individual-posts-player","kindle-support","gmail-support"],po=()=>{let t=U();return ao.some(r=>{let i=t[r];return i&&i.status==="active"})},H=()=>{let{screenshotMode:t}=M();return{isScreenshotModeOnly:Q()&&!po(),isInScreenshotMode:!!t?.isDraggable}};n();e();var R=g(E()),lo=()=>{let{updateAvailable:t}=B();return o(l,{width:230,title:"New Version Available",onClose:()=>{p("new-version-popup")}},o(a,{font:"body-5",style:{marginTop:"8px"}},"Update to get the latest features and improvements."),o(y,{size:"small",onClick:()=>{t&&(T("extension_update_clicked",{version:t.version,critical:t.critical}),q())},style:{width:"100%",marginTop:"12px"}},"Update"))},Ho=()=>{let t=(0,R.useRef)(!1),{isInScreenshotMode:r}=H(),{updateAvailable:i,isLoading:f}=B(),d=!f&&i&&!r;(0,R.useEffect)(()=>{!d||t.current||(t.current=!0,h({id:"new-version-popup",priority:151,duration:0,showOnMobile:!0,timeSensitive:!0,redesigned:!0,render:()=>o(lo,null)}))},[d])};n();e();var to=g(E()),co=()=>o(l,{width:220,title:"Can’t Play Audio",onClose:()=>p("player-error")},o(a,{font:"body-5",style:{marginTop:"8px"}},"The audio couldn’t load.",o("br",null),"Please refresh to try again."),o(y,{size:"small",onClick:()=>{window.location.reload()},style:{width:"100%",marginTop:"12px"}},"Refresh")),lt=()=>{let t=C.usePlayingState();(0,to.useEffect)(()=>{if(t!=="errored"&&p("player-error"),!["stopped","paused"].includes(t))return()=>{C.getPlayingState()==="errored"&&h({id:"player-error",priority:151,duration:0,showOnMobile:!0,timeSensitive:!0,redesigned:!0,render:()=>o(co,null)})}},[t])};n();e();n();e();var eo=g(E()),uo=s.div`
  display: flex;
  align-items: center;
`,mo=s.img`
  padding: 2px;
  border-radius: 4px;
  width: 12px;
  height: 12px;
`,A=({suffix:t})=>{let r=N(f=>f.hostIcon),i=(0,eo.useMemo)(()=>X(),[window.location.host]);return o(uo,null,r&&o(mo,{src:r})," ",i,t)};n();e();var fo=s.div`
  display: flex;
  gap: 8px;
  margin-top: 12px;
`,yo=s.div`
  display: flex;
  flex-direction: column;
  gap: 8px;
`,ho=()=>{let t=()=>{p("enable-back-popup")};return o(G,{position:"top-right"},o(l,{width:288,onClose:t},o(yo,null,o(a,{font:"subheading-5"},o("div",null,"The extension is now turned off for"),o(A,null)),o(a,{font:"body-6",color:"icn-txt-sec"},"Speechify will stay disabled on this site until you enable it from the toolbar or use a shortcut.")),o(fo,null,o(y,{onClick:async()=>{t(),b.showExtension()}},"Enable Now"),o(v,{onClick:t},"Got It"))))},D=async()=>{await p("enable-back-popup"),h({id:"enable-back-popup",priority:151,showOnMobile:!1,timeSensitive:!1,redesigned:!0,render:()=>o(ho,null),global:!0})};var Po=s.div`
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
`,Co=()=>{let t=()=>{p("hide-extension-popup")};return o(l,{width:240,onClose:t},o(a,{font:"subheading-5"},o("div",null,"Turn off Speechify for"),o(A,{suffix:"?"})),o(Po,null,o(k,{onClick:()=>{b.hideExtension(!0),D()}},"Yes, for this session"),o(k,{onClick:async()=>{let f=window.location.hostname,d=window.location.pathname;b.hideExtension(),T("extension_pill_player_dismissed",{type:"domain",domain:f,pathname:d}),D()}},"Yes, from now on"),o(k,{onClick:t},"No, don’t turn it off")))},Kt=async()=>{await p(),h({id:"hide-extension-popup",priority:151,showOnMobile:!1,timeSensitive:!1,redesigned:!0,render:()=>o(Co,null),horizontalAdjustment:0,alwaysOnTop:!0})};n();e();var no=()=>{let t=()=>{w("SKIP_CHATS_POPUP",!0),p("introduce-ai-button")};return o(l,{width:272,onClose:t,title:"Listen to Responses"},o(a,{font:"body-5",style:{marginTop:"8px"}},"Play and Pause any response in your chat by clicking the button."),o(y,{style:{marginTop:"12px",width:"100%"},size:"small",onClick:t},"OK, Got it"))};n();e();var go=s.div`
  display: flex;
  gap: 8px;
  margin-top: 12px;
`,he=()=>{let t=P=>{p("introduce-ai-autoplay"),T("extension_usage_new_user_education_prompt_interacted",{prompt:"introduce-ai-autoplay",action:P})},r=()=>{t("close")},i=P=>{w("SHOULD_SHOW_AUTOPLAY",P)};return o(l,{width:272,onClose:r,title:"Autoplay Responses"},o(a,{font:"body-5",style:{marginTop:"8px"}},"Speechify can automatically read out chat responses as soon as they’re generated."),o(go,null,o(y,{onClick:()=>{i(!0),setTimeout(()=>{W.play(),t("turn-on")},500)}},"Turn On Autoplay"),o(v,{onClick:async()=>{i(!1),!1||await h({component:!0,duration:0,id:"introduce-ai-button",priority:101,showOnMobile:!1,timeSensitive:!0,redesigned:!0,render:()=>o(no,null)}),t("keep-off")}},"Keep Off")))};n();e();var ro=g(E());var Se=()=>{let t=(0,ro.useMemo)(()=>V(),[]);if(!t)return null;let{description:r,videoSrc:i}=t;return o(l,{width:312,onClose:$,showDismiss:!0},o(a,{font:"body-5"},r),o(K,{src:i,style:{marginTop:"8px"},autoPlay:!0,muted:!0,replayDelay:2e3}))};n();e();var I=g(E());n();e();n();e();var S=g(E()),io=t=>S.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"10",viewBox:"0 0 13 10",fill:"none",...t},S.default.createElement("path",{d:"M5.65269 8.81335C5.30602 9.16001 4.74602 9.16001 4.39935 8.81335L1.20824 5.62223C0.861576 5.27557 0.861576 4.71557 1.20824 4.3689C1.55491 4.02223 2.11491 4.02223 2.46158 4.3689L5.02158 6.9289L11.1371 0.813345C11.4838 0.466678 12.0438 0.466678 12.3905 0.813345C12.7371 1.16001 12.7371 1.72001 12.3905 2.06668L5.65269 8.81335Z",fill:"currentColor"})),so=t=>S.default.createElement("svg",{width:"11",height:"3",viewBox:"0 0 11 3",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},S.default.createElement("path",{d:"M1.5 1.5H9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}));var Eo=s.div`
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
`,To=s.input`
  ${F};
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;

  background-color: transparent;
  border: 1.5px solid ${c["brdr-tert-40-50"]};

  outline: none;

  &:hover {
    border-color: ${c["brdr-blue"]};
    background-color: ${c["bg-accent"]};
  }

  &:checked {
    background-color: ${c["sf-act-electric-blue"]};
    border-color: ${c["sf-act-electric-blue"]};
  }

  &:checked:hover {
    background-color: ${c["sf-act-electric-blue"]};
  }

  &:focus-visible {
    box-shadow: none;
  }

  ${({subchecked:t})=>t&&`
      background-color: ${c["sf-act-electric-blue"]};
      border-color: ${c["sf-act-electric-blue"]};

      &:hover {
        background-color: ${c["sf-act-electric-blue"]};
      }

      &:focus-visible {
        background-color: ${c["sf-act-electric-blue"]};
      }
    `}

  &:disabled {
    opacity: 0.5;
  }
`,bo=s(io)`
  position: absolute;
  top: 4px;
  left: 1px;
  height: 9px;
  pointer-events: none;
  color: ${c["icn-txt-prim-inv"]};
`,xo=s(so)`
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%']};
  pointer-events: none;
  color: ${c["icn-txt-prim-inv"]};
`,O={CheckboxWrapper:Eo,CheckboxInput:To,Tick:bo,Strike:xo};var We=({checked:t,onChange:r,subchecked:i,"data-testid":f,...d})=>I.default.createElement(O.CheckboxWrapper,null,I.default.createElement(O.CheckboxInput,{"data-testid":f,type:"checkbox",checked:t,subchecked:i,onClick:P=>P.stopPropagation(),onChange:r,...d}),t?I.default.createElement(O.Tick,null):i?I.default.createElement(O.Strike,null):null);export{no as a,he as b,Se as c,Q as d,H as e,lo as f,Ho as g,co as h,lt as i,D as j,Kt as k,We as l};
//# sourceMappingURL=chunk-55RJ7LVF.js.map
