PageSourceSearch

https://www.listening.com/assets/api-contract-CCE5gx-b.js

js listening.com collected 2026-10-01 10:24:00 UTC 143,422 bytes, 4 lines download raw bytes

vendor: 1,262 bytes, line 1
1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`798154dfe6f02312abe2ebb46dcac5b55267091e`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:listening-web":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`86c96a31-74a8-453c-ac02-78def245a148`,e._sentryDebugIdIdentifier=`sentry-dbid-86c96a31-74a8-453c-ac02-78def245a148`)}catch{}})();import{a as e,n as t,t as n}from"./jsx-runtime-HLTtilDO.js";import{$ as r,$i as i,$n as a,$r as o,$t as s,A as c,Aa as l,Ao as u,Ba as d,Bo as ee,Br as te,Cn as ne,Co as re,Ct as ie,D as ae,Dn as oe,En as se,Eo as ce,Er as le,F as ue,Fa as de,Fo as fe,Ft as pe,Ga as me,Gt as f,Hn as he,Ho as ge,Ia as _e,In as ve,It as ye,Ji as be,Jo as xe,Jr as Se,Jt as Ce,K as we,Ka as Te,Ki as Ee,Kn as De,Ko as Oe,Kr as ke,L as p,Lo as Ae,Lr as je,Lt as Me,M as Ne,Ma as Pe,Mi as Fe,Mn as Ie,Mo as Le,Mr as Re,Na as ze,No as Be,
1Nr as Ve,Nt as He,O as Ue,Oo as We,P as m,Pa as Ge,Pn as Ke,Po as qe,Pt as Je,Q as h,Qa as Ye,Qi as Xe,Qr as Ze,Ra as Qe,Ro as $e,Rr as et,Rt as tt,S as nt,Sa as rt,So as it,Sr as g,St as at,Tn as ot,To as st,Tr as _,Ui as ct,Ut as lt,V as v,Va as ut,Vo as dt,Vt as ft,Wa as pt,Wo as mt,Wt as ht,Xn as gt,Xr as _t,Ya as vt,Yn as yt,Yo as y,Yr as bt,Yt as b,Z as xt,Za as St,Zn as Ct,Zo as wt,_ as Tt,_a as Et,_t as Dt,a as Ot,ai as kt,an as At,ao as jt,at as Mt,b as x,bn as Nt,bo as S,bt as Pt,c as Ft,ca as It,ci as Lt,co as C,cr as Rt,d as w,da as zt,di as Bt,do as Vt,dt as Ht,ea as Ut,eo as Wt,et as Gt,f as T,fi as Kt,ft as qt,g as E,ga as Jt,gi as Yt,gt as D,ha as Xt,hn as Zt,ho as Qt,ht as O,is as k,it as $t,j as A,jo as en,jr as tn,jt as nn,kn as rn,ko as an,l as j,li as on,ln as sn,lr as cn,ls as ln,lt as M,ma as un,mn as dn,mo as fn,mr as pn,n as N,ni as mn,ns as hn,nt as gn,oa as _n,oi as vn,on as yn,os as P,p as F,pa as bn,pt as xn,qa as Sn,qi as Cn,qo as wn,qr as Tn,qt as En,ri as Dn,rn as On,rs as kn,si as An,sn as jn,so as Mn,ss as Nn,st as Pn,t as I,to as Fn,tr as In,tt as Ln,u as L,ua as Rn,ui as zn,ur as Bn,ut as Vn,va as Hn,vi as Un,vt as Wn,wo as Gn,wr as Kn,x as R,xi as qn,xn as z,xo as Jn,xt as Yn,yi as Xn,yn as Zn,yo as Qn,yt as $n,za as er,zo as tr}from"./Schema-BiKO9Vds.js";import{i as nr,o as rr,r as ir}from"./Fiber-CrRAfIeK.js";import{A as ar,B as or,C as sr,D as cr,E as lr,F as ur,I as dr,L as fr,M as pr,N as mr,O as hr,P as gr,T as _r,V as vr,_ as B,a as yr,d as V,f as H,g as br,h as xr,i as U,j as Sr,k as Cr,l as wr,m as Tr,n as Er,o as Dr,p as Or,r as kr,s as Ar,u as jr,v as Mr,w as Nr,y as Pr,z as Fr}from"./errors-BnQcWde3.js";var W=e(t(),1),Ir=e(n(),1),Lr=e=>e>0?Math.floor(e):0,Rr=BigInt(1),zr=BigInt(1e3),Br=BigInt(1024),Vr=[{symbol:`B`,factor:Rr,names:[`B`,`byte`,`bytes`]},{symbol:`kB`,factor:zr,names:[`kB`,`kilobyte`,`kilobytes`]},{symbol:`MB`,factor:zr**BigInt(2),names:[`MB`,`megabyte`,`megabytes`]},{symbol:`GB`,factor:zr**BigInt(3),names:[`GB`,`gigabyte`,`gigabytes`]},{symbol:`TB`,factor:zr**BigInt(4),names:[`TB`,`terabyte`,`terabytes`]},{symbol:`PB`,factor:zr**BigInt(5),names:[`PB`,`petabyte`,`petabytes`]},{symbol:`EB`,factor:zr**BigInt(6),names:[`EB`,`exabyte`,`exabytes`]},{symbol:`ZB`,factor:zr**BigInt(7),names:[`ZB`,`zettabyte`,`zettabytes`]},{symbol:`YB`,factor:zr**BigInt(8),names:[`YB`,`yottabyte`,`yottabytes`]},{symbol:`RB`,factor:zr**BigInt(9),names:[`RB`,`ronnabyte`,`ronnabytes`]},{symbol:`QB`,factor:zr**BigInt(10),names:[`QB`,`quettabyte`,`quettabytes`]}],Hr=[Vr[0],{symbol:`KiB`,factor:Br,names:[`KiB`,`kibibyte`,`kibibytes`]},{symbol:`MiB`,factor:Br**BigInt(2),names:[`MiB`,`mebibyte`,`mebibytes`]},{symbol:`GiB`,factor:Br**BigInt(3),names:[`GiB`,`gibibyte`,`gibibytes`]},{symbol:`TiB`,factor:Br**BigInt(4),names:[`TiB`,`tebibyte`,`tebibytes`]},{symbol:`PiB`,factor:Br**BigInt(5),names:[`PiB`,`pebibyte`,`pebibytes`]},{symbol:`EiB`,factor:Br**BigInt(6),names:[`EiB`,`exbibyte`,`exbibytes`]},{symbol:`ZiB`,factor:Br**BigInt(7),names:[`ZiB`,`zebibyte`,`zebibytes`]},{symbol:`YiB`,factor:Br**BigInt(8),names:[`YiB`,`yobibyte`,`yobibytes`]}];[...Vr,...Hr.slice(1)];var Ur=Rn,Wr=`~effect/MutableRef`,Gr={[Wr]:Wr,...re,toJSON(){return{_id:`MutableRef`,current:qe(this.current)}}},Kr=e=>{let t=Object.create(Gr);return t.current=e,t},qr=k(2,(e,t)=>(e.current=t,e)),Jr=Symbol.for(`effect/MutableList/Empty`),Yr=()=>({head:void 0,tail:void 0,length:0}),Xr=()=>({array:[],mutable:!0,offset:0,next:void 0}),Zr=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Xr(),e.tail=e.tail.next):e.head=e.tail=Xr(),e.tail.array.push(t),e.length++},Qr=e=>{e.head=e.tail=void 0,e.length=0},$r=(e,t)=>{if(t=Lr(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return Qr(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&Qr(e),n;i=i.next}return Qr(e),n},ei=e=>$r(e,e.length),ti=e=>{if(!e.head)return Jr;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:Qr(e)),t},ni=(e,t)=>{let n=[],r=e.head;for(;r;){for(let e=r.offset;e<r.array.length;e++)t(r.array[e],e)&&n.push(r.array[e]);r=r.next}if(n.length===0){Qr(e);return}
1e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length},ri=(e,t)=>ni(e,e=>e!==t),ii=`~effect/PubSub/Subscription`,ai=k(2,(e,t)=>e.shutdownFlag.current?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),oi=e=>Ve(Zt(t=>{let n=_e(t,vn),r=zn(e.scope),i=ui(e.pubsub,e.subscribers,e.strategy);return An(r,si(i)).pipe(On(Lt(n,e=>on(r,e))),At(i))})),si=e=>Ve(te(t=>(qr(e.shutdownFlag,!0),se(ei(e.pollers),e=>Un(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(le(()=>_(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),et(e.shutdownHook.open),yn)))),ci=e=>Kn(function t(n){if(e.shutdownFlag.current)return Ke;let r=e.pollers.length===0?e.subscription.pollUpTo(1/0):[];return n&&(r=n.concat(r)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?g(e.replayWindow.takeAll().concat(r)):Sn(r)?g(r):z(li(e),e=>t([e]))}),li=e=>{let t=Xn(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),Zr(e.pollers,t),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),Ct(Yt(t),()=>(ri(e.pollers,t),je))},ui=(e,t,n)=>new di(e,t,e.subscribe(),Yr(),Ur(!1),Kr(!1),n,e.replayWindow()),di=class{[ii]={_A:P};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;constructor(e,t,n,r,i,a,o,s){this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s}pipe(){return ln(this,arguments)}},fi=`~effect/Queue`,pi=`~effect/Queue/Enqueue`,mi=`~effect/Queue/Dequeue`,hi={_A:P,_E:P},gi={[fi]:hi,[pi]:hi,[mi]:hi,...re,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:ki(this)}}},_i=e=>We(t=>{let n=Object.create(gi);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=Yr(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},bn(n)}),vi=e=>_i({capacity:e}),yi=()=>_i(),bi=(e,t)=>Xt(()=>{if(e.state._tag!==`Open`)return Ai;if(e.messages.length>=e.capacity)switch(e.strategy){case`dropping`:return Ai;case`suspend`:return e.capacity<=0&&e.state.takers.size>0?(Zr(e.messages,t),Pi(e),ji):Li(e,t);case`sliding`:return ti(e.messages),Zr(e.messages,t),ji}return Zr(e.messages,t),Fi(e),ji}),xi=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(ti(e.messages),Zr(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(Zr(e.messages,t),Pi(e),!0):(Zr(e.messages,t),Fi(e),!0):!1,Si=k(2,(e,t)=>Jt(()=>Ci(e,t))),Ci=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=st(t),r=Ut(n,Mi);return e.state.offers.size===0&&e.messages.length===0?(Vi(e,r),!0):(e.state={...e.state,_tag:`Closing`,exit:r},!0)},wi=e=>Jt(()=>{if(e.state._tag===`Done`)return!0;Qr(e.messages);let t=e.state.offers;if(Vi(e,e.state._tag===`Open`?Ni:e.state.exit),t.size>0){for(let e of t)e._tag===`Single`?e.resume(Ai):e.resume(ce(e.remaining.slice(e.offset)));t.clear()}return!0}),Ti=e=>Ei(e,1,1/0),Ei=(e,t,n)=>(t=Lr(t),n=Lr(n),Xt(()=>Ii(e,t,n)??Ee(Bi(e),Ei(e,1,n)))),Di=e=>Xt(()=>Oi(e)??Ee(Bi(e),Di(e))),Oi=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=ti(e.messages);return zi(e),ce(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=Ri(e.state.offers);return zi(e),ce(t)}},ki=e=>e.state._tag===`Done`?0:e.messages.length,Ai=ce(!1),ji=ce(!0),Mi=Gn(it()),Ni=Xe(),Pi=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(e.state.takers.delete(t),t(i),e.messages.length===0)break}},Fi=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,Pi(e)},0))},Ii=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return ce([]);if(e.capacity<=0&&e.messages.length===0&&e.state.offers.size>0){let t=[Ri(e.state.offers)];return zi(e),ce(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=$r(e.messages,n);return zi(e),ce(t)}},Li=(e,t)=>be(n=>{if(e.state._tag!==`Open`)return n(Ai);let r={_tag:`Single`,message:t,resume:n};return e.state.offers.add(r),Jt(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),Ri=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(ji),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(ce([]))),n},zi=e=>{if(e.state._tag===`Done`)return Se(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Vi(e,e.state.exit),Se(e.state.exit.cause));for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag===`Single`)Zr(e.messages,t.message),e.state.offers.delete(t),t.resume(ji);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;Zr(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(ce([]))}}return!1},Bi=e=>be(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),Jt(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),Vi=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},Hi=e=>new Wi(e),Ui=(e,t,n)=>be(r=>{if(e.free>=t)return r(n);let i=()=>{e.free<t||(e.waiters.delete(i),r(n))};return e.waiters.add(i),Jt(()=>{e.waiters.delete(i)})}),Wi=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=Xt(()=>this.free<e?Ui(this,e,t):(this.taken+=e,bn(e)));return t}takeIfAvailable(e){return Xt(()=>this.free<e?bn(!1):(this.taken+=e,bn(!0)))}releaseUnsafe(e,t){return this.taken-=t,this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{for(let e of this.waiters){if(this.free<=0)break;e()}},0),this.free}resize(e){return We(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),Hn))}release(e){return We(t=>bn(this.releaseUnsafe(t,e)))}get releaseAll(){return We(e=>bn(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>Et(n=>{let r=Xt(()=>{if(this.free<e){let t=Ui(this,e,Hn);return _n(n(t),()=>r)}return this.taken+=e,zt(n(t),()=>{this.releaseUnsafe(It(),e)},!0)});return r})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Et(n=>this.free<e?un:(this.taken+=e,zt(n(Cn(t)),()=>{this.releaseUnsafe(It(),e)},!0)))}},Gi=`~effect/Channel`,Ki=e=>xe(e,Gi),qi={[Gi]:{_Env:P,_InErr:P,_InElem:P,_OutErr:P,_OutElem:P},pipe(){return ln(this,arguments)}},Ji=e=>{let t=Object.create(qi);return t.transform=(t,n)=>sn(e(t,n),e=>g(Nt(e))),t},Yi=(e,t)=>Ji((n,r)=>z(Qi(e)(n,r),e=>t(e,r))),Xi=e=>Ji((t,n)=>e),Zi=e=>Ji(ot(function*(t,n){let r=zn(n),i=e=>on(r,Tn(e)),a=yield*yt(e(t,n,r),i);return yt(a,i)})),Qi=e=>e.transform,$i=(e,t,n)=>_i({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(le(t=>An(e,wi(t))),le(n=>rn(Kt(t(n),e),e))),ea=(e,t)=>Ji((n,r)=>he($i(r,e,t),Ti)),ta=e=>Ji((t,n)=>Kn(()=>Qi(e())(t,n))),na=Xi(g(Fe())),ra=e=>Xi(g(Zn(e))),ia=e=>Xi(g(Ti(e))),aa=e=>Xi(g(Ct(ci(e),()=>Fe()))),oa=e=>_a(he(oi(e),aa)),sa=e=>Ji((t,n)=>ca({scope:n,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd})),ca=e=>{let t=e.readable.getReader(),n=e.exit??Kr(void 0),r=Kn(()=>n.current?n.current:De(tn({try:()=>t.read(),catch:e.onError}),{onFailure:e=>n.current??Nt(e),onSuccess:({done:e,value:t})=>n.current?n.current:e?Fe():g(Ye(t))}));return At(An(e.scope,e.releaseLockOnEnd?_(()=>t.releaseLock()):a(()=>t.cancel().catch(hn))),r)},la=k(2,(e,t)=>
1Yi(e,e=>_(()=>{let n=0;return he(e,e=>t(e,n++))}))),ua=e=>e===void 0||e!==`unbounded`&&e<=1,da=k(e=>Ki(e[0]),(e,t,n)=>ua(n?.concurrency)?fa(e,t):pa(e,t,n)),fa=(e,t)=>Ji((n,r)=>{let i=0;return he(Qi(e)(n,r),z(e=>t(e,i++)))}),pa=(e,t,n)=>Zi(ot(function*(r,i,a){let o=0,s=yield*Qi(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:n.concurrency,l=yield*vi(0);yield*An(a,wi(l));let u=cn(yield*dn()),d=rr(a);if(n.unordered){let e=Hi(c),n=kn(e.release(1)),r=De({onFailure:e=>z(Si(l,e),n),onSuccess:e=>z(bi(l,e),n)});yield*e.take(1).pipe(z(()=>s),z(e=>(d(u(r(t(e,o++)))),je)),oe({disableYield:!0}),sn(t=>e.withPermits(c-1)(Si(l,t))),rn(a))}else{let e=yield*vi(c-2);yield*An(a,wi(e)),yield*Di(e).pipe(ne,z(e=>bi(l,e)),oe({disableYield:!0}),sn(e=>Si(l,e)),rn(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,Ci(l,e.cause))};yield*s.pipe(z(i=>{if(n)return Nt(n);let a=u(t(i,o++));return d(a),a.addObserver(r),bi(e,nr(a))}),oe({disableYield:!0}),sn(t=>bi(e,qn(t)).pipe(On(Si(e,t)))),rn(a))}return Di(l)})),ma=e=>Yi(e,e=>{let t,n=0,r=Kn(function r(){if(t===void 0)return z(e,e=>{switch(e.length){case 0:return r();case 1:return g(e[0]);default:return t=e,g(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),g(i)});return g(r)}),ha=k(2,(e,t)=>Yi(e,e=>g(z(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return vt(i)?g(i):z(e,n)})))),ga=k(2,(e,t)=>Ji((n,r)=>z(Qi(e)(n,r),e=>Qi(t)(e,r)))),_a=e=>Ji((t,n)=>{let r;return g(Kn(()=>r||e.pipe(Kt(n),z(e=>Qi(e)(t,n)),z(e=>r=e))))}),va=k(2,(e,t)=>Zi((n,r,i)=>Lt(i,t).pipe(On(Qi(e)(n,r))))),ya=k(2,(e,t)=>va(e,e=>t)),ba=(e,t,n)=>Kn(()=>{let r=Bt(),i=Qi(e)(Fe(),r);return ke(z(i,t),n||g).pipe(gt(e=>on(r,e)))}),xa=k(2,(e,t)=>Ji((n,r)=>he(In(Qi(e)(n,r),t),In(t)))),Sa=k(2,(e,t)=>ba(e,e=>oe(z(e,t),{disableYield:!0}))),Ca=ot(function*(e){let t=Hi(1),n=yield*dn(),r=_e(n,vn);return(yield*Qi(e)(Fe(),r)).pipe(In(n),t.withPermits(1))},sn(e=>g(Nt(e)))),wa=(e,t)=>Qi(e)(Fe(),t),Ta=new WeakMap,Ea=`~effect/Redacted`,Da=e=>xe(e,Ea),Oa=(e,t)=>{let n=Object.create(ka);return t?.label&&(n.label=t.label),Ta.set(n,e),n},ka={[Ea]:{_A:e=>e},label:void 0,...re,toJSON(){return this.toString()},toString(){return`<redacted${wt(this.label)?`:`+this.label:``}>`},[wn](){return mt(Ta.get(this))},[ge](e){return Da(e)&&dt(Ta.get(this),Ta.get(e))}},Aa=Symbol.for(`~effect/http/Headers`),ja=Object.defineProperties(Object.create(null),{[Aa]:{value:Aa},[$e]:{value(e){return Va(this,_e(e,Ua))}},toJSON:{value(){return Ae(this)}},[ge]:{value(e){return Na(this,e)}},[wn]:{value(){return Oe(this)}},toString:{value:en.toString},[Be]:{value:en[Be]}}),Ma=e=>Object.assign(Object.create(ja),e),Na=Wt(ee()),Pa=Object.create(ja),Fa=e=>{if(e===void 0)return Pa;if(Symbol.iterator in e){let t=Object.create(ja);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(ja);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},Ia=e=>Object.setPrototypeOf(e,ja),La=k(3,(e,t,n)=>{let r=Ma(e);return r[t.toLowerCase()]=n,r}),Ra=k(2,(e,t)=>Ma({...e,...Fa(t)})),za=k(2,(e,t)=>{let n=Ma(e);return Object.assign(n,t),n}),Ba=k(2,(e,t)=>{let n=Ma(e);return delete n[t.toLowerCase()],n}),Va=k(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=Oa(e[r]))}else for(let r in e)r.search(t)!==-1&&(n[r]=Oa(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),Ha=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(typeof r==`string`){if(r.toLowerCase()===e.toLowerCase())return!0}else if(e.search(r)!==-1)return!0}return!1},Ua=Pe(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]}),Wa=`~effect/Stream`,Ga={_R:P,_E:P,_A:P},Ka=function(e){this.channel=e};Ka.prototype={[Wa]:Ga,pipe(){return ln(this,arguments)}};var qa=e=>new Ka(e),Ja=`~effect/Stream`,Ya=e=>xe(e,Ja),G=qa,Xa=(e,t)=>G(Ji((n,r)=>z(wa(e.channel,r),e=>t(e,r)))),Za=e=>e.channel,Qa=(e,t)=>G(ea(e,t)),$a=G(na),eo=e=>G(ta(()=>e().channel)),to=e=>G(ra(e)),no=e=>G(ia(e)),ro=e=>G(oa(e)),io=e=>G(sa(e)),ao=e=>G(_a(he(e,Za))),oo=k(2,(e,t)=>eo(()=>{let n=0;return G(la(e.channel,St(e=>t(e,n++))))})),so=k(e=>Ya(e[0]),(e,t,n)=>e.channel.pipe(ma,da(t,n),la(Ye),G)),co=k(2,(e,t)=>G(ha(Za(e),t))),lo=k(2,(e,t)=>G(ga(e.channel,t))),uo=k(e=>Ya(e[0]),(e,t)=>eo(()=>{let n=new TextDecoder(t?.encoding);return oo(e,e=>n.decode(e,{stream:!0}))})),fo=k(2,(e,t)=>G(ya(e.channel,t))),po=k(2,(e,t)=>
1G(xa(e.channel,t))),mo=k(2,(e,t)=>Sa(e.channel,t)),ho=e=>Ca(e.channel),go=k(e=>Ya(e[0]),(e,t,n)=>{let r,i,a=Ur(!1);return new ReadableStream({start(n){i=Rt(In(mo(e,e=>a.whenOpen(_(()=>{a.closeUnsafe();for(let t=0;t<e.length;t++)n.enqueue(e[t]);r(),r=void 0}))),t)),i.addObserver(e=>{e._tag===`Failure`?n.error(ct(e.cause)):n.close()})},pull(){return new Promise(e=>{r=e,a.openUnsafe()})},cancel(){if(i)return Bn(yn(ir(i)))}},n?.strategy)}),_o=k(e=>Ya(e[0]),(e,t)=>he(dn(),n=>go(e,n,t))),vo=`~effect/ErrorReporter/ignore`,yo=`~effect/http/HttpBody`,bo=e=>xe(e,yo),xo=class{[yo];constructor(){this[yo]=yo}[Be](){return this.toJSON()}toString(){return fe(this,{ignoreToString:!0})}},So=new class extends xo{_tag=`Empty`;toJSON(){return{_id:`effect/HttpBody`,_tag:`Empty`}}},Co=class extends xo{_tag=`Uint8Array`;contentType;contentLength;text;_body;constructor(e,t,n,r){super(),this._body=e,this.text=r,this.contentType=t,this.contentLength=n}get body(){return this._body??=Do(this.text)}toJSON(){return{_id:`effect/HttpBody`,_tag:`Uint8Array`,body:this.contentType.startsWith(`text/`)||this.contentType.endsWith(`json`)?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}},wo=(e,t)=>new Co(e,t??`application/octet-stream`,e.length),To=new TextEncoder,Eo=globalThis.Buffer,Do=Eo===void 0?e=>To.encode(e):e=>Eo.from(e,`utf8`),Oo=(e,t)=>{if(typeof e!=`string`&&(e=e===void 0?``:String(e)),Eo!==void 0)return new Co(void 0,t??`text/plain`,Eo.byteLength(e,`utf8`),e);let n=To.encode(e);return new Co(n,t??`text/plain`,n.length,e)},ko=(e,t)=>Oo(Yn($n(e)),t??`application/x-www-form-urlencoded`),Ao=class extends xo{_tag=`FormData`;contentType=void 0;contentLength=void 0;formData;constructor(e){super(),this.formData=e}toJSON(){return{_id:`effect/HttpBody`,_tag:`FormData`,formData:this.formData}}},jo=e=>new Ao(e),Mo=e=>e!==`GET`&&e!==`HEAD`&&e!==`OPTIONS`&&e!==`TRACE`,No=[[`GET`,`get`],[`POST`,`post`],[`PUT`,`put`],[`DELETE`,`del`],[`PATCH`,`patch`],[`HEAD`,`head`],[`OPTIONS`,`options`],[`TRACE`,`trace`]],Po=(e,t)=>t._tag===`Empty`||t._tag===`FormData`?Ba(Ba(e,`content-type`),`content-length`):(e=t.contentType===void 0?Ba(e,`content-type`):La(e,`content-type`,t.contentType),t.contentLength===void 0?Ba(e,`content-length`):La(e,`content-length`,t.contentLength.toString())),Fo=class extends rt(`UrlError`){},Io=(e,t,n)=>Mn({try:()=>{let r=new URL(e,Lo());for(let e=0;e<t.params.length;e++){let[n,i]=t.params[e];i!==void 0&&r.searchParams.append(n,i)}return n!==void 0&&(r.hash=n),r},catch:e=>new Fo({cause:e})}),Lo=()=>{if(`location`in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Ro=`~effect/http/HttpClientRequest`,zo={[Ro]:Ro,...en,toJSON(){return{_id:`HttpClientRequest`,method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:Ae(this.headers),body:this.body.toJSON()}},pipe(){return ln(this,arguments)}};function Bo(e,t,n,r,i,a){let o=Object.create(zo);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}var Vo=Bo(`GET`,``,Wn,Qn(),Pa,So),Ho=e=>(t,n)=>Uo(Vo,{method:e,url:t,...n??void 0}),Uo=k(2,(e,t)=>{let n=e;return t.method&&(n=Wo(n,t.method)),t.url&&(n=Yo(n,t.url)),t.headers&&(n=Ko(n,t.headers)),t.urlParams&&(n=Qo(n,t.urlParams)),t.hash&&(n=es(n,t.hash)),t.body&&(n=ts(n,t.body)),t.accept&&(n=qo(n,t.accept)),t.acceptJson&&(n=Jo(n)),n}),Wo=k(2,(e,t)=>Bo(t,e.url,e.urlParams,e.hash,e.headers,e.body)),Go=k(3,(e,t,n)=>Bo(e.method,e.url,e.urlParams,e.hash,La(e.headers,t,n),e.body)),Ko=k(2,(e,t)=>Bo(e.method,e.url,e.urlParams,e.hash,Ra(e.headers,t),e.body)),qo=k(2,(e,t)=>Go(e,`Accept`,t)),Jo=qo(`application/json`),Yo=k(2,(e,t)=>{if(typeof t==`string`)return Bo(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=$n(n.searchParams),i=Vt(n.hash===``?void 0:n.hash.slice(1));return n.search=``,n.hash=``,Bo(e.method,n.toString(),r,i,e.headers,e.body)}),Xo=k(2,(e,t)=>t===``?e:Bo(e.method,Zo(t,e.url),e.urlParams,e.hash,e.headers,e.body)),Zo=(e,t)=>{let n=e.endsWith(`/`),r=t.startsWith(`/`);
1return n&&r?e+t.slice(1):!n&&!r?e+`/`+t:e+t},Qo=k(2,(e,t)=>Bo(e.method,e.url,Pt(e.urlParams,t),e.hash,e.headers,e.body)),$o=k(2,(e,t)=>Bo(e.method,e.url,Dt(e.urlParams,t),e.hash,e.headers,e.body)),es=k(2,(e,t)=>Bo(e.method,e.url,e.urlParams,Jn(t),e.headers,e.body)),ts=k(2,(e,t)=>Bo(e.method,e.url,e.urlParams,e.hash,Po(e.headers,t),t)),ns=k(2,(e,t)=>ts(e,jo(t)));function rs(e){let t=Io(e.url,e.urlParams,fn(e.hash));return jt(t)?Jn(t.success):Qn()}var is=`~effect/http/HttpIncomingMessage`,as=(e,t)=>{let n=e.headers[`content-type`]??``,r;if(n.includes(`application/json`))try{r=pn(e.json)}catch{}else if(n.includes(`text/`)||n.includes(`urlencoded`))try{r=pn(e.text)}catch{}let i={...t,headers:Ae(e.headers),remoteAddress:e.remoteAddress};return r!==void 0&&(i.body=r),i},os=`~effect/http/HttpClientResponse`,ss=(e,t)=>new cs(e,t),cs=class extends Le{[is];[os];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[is]=is,this[os]=os}toJSON(){return as(this,{_id:`HttpClientResponse`,request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get url(){if(this.source.url)return this.source.url.split(`#`)[0];let e=rs(this.request);return Qt(e)?``:(e.value.hash=``,e.value.href)}get headers(){return Fa(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=ie(this.source.headers.getSetCookie())}get remoteAddress(){return Qn()}get stream(){return this.source.body?io({evaluate:()=>this.source.body,onError:e=>new vr({reason:new Fr({request:this.request,response:this,cause:e})})}):to(new vr({reason:new or({request:this.request,response:this,description:`can not create stream from empty body`})}))}get json(){return z(this.text,e=>Re({try:()=>e===``?null:JSON.parse(e),catch:e=>new vr({reason:new Fr({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody??=he(this.arrayBuffer,e=>new TextDecoder().decode(e))}get urlParamsBody(){return z(this.text,e=>Re({try:()=>$n(new URLSearchParams(e)),catch:e=>new vr({reason:new Fr({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=tn({try:()=>this.source.formData(),catch:e=>new vr({reason:new Fr({request:this.request,response:this,cause:e})})}).pipe(jn,pn)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody||=tn({try:()=>this.source.arrayBuffer(),catch:e=>new vr({reason:new Fr({request:this.request,response:this,cause:e})})}).pipe(jn,pn),this.arrayBufferBody}pipe(){return ln(this,arguments)}},ls=Object.getPrototypeOf(Pa),us=()=>Object.create(ls),ds=`~effect/http/HttpServerResponse`,fs=e=>ms({status:e?.status??204,statusText:e?.statusText,headers:e?.headers?Fa(e.headers):void 0,cookies:e?.cookies}),ps={...re,[ds]:ds,[vo]:!0,toJSON(){return{_id:`HttpServerResponse`,status:this.status,statusText:this.statusText,headers:Ae(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},ms=(e,t)=>{let n=Object.create(ps);if(n.status=e.status,n.statusText=e.statusText,n.cookies=e.cookies??at,n.body=e.body??So,n.body._tag!==`Empty`&&(n.body.contentType||n.body.contentLength!==void 0)){let r=t!==void 0,i=r?t:e.headers===void 0||e.headers===Pa?us():Ia({...e.headers});n.body.contentType&&(!r||i[`content-type`]===void 0)&&(i[`content-type`]=n.body.contentType),n.body.contentLength!==void 0&&(!r||i[`content-length`]===void 0)&&(i[`content-length`]=n.body.contentLength.toString()),n.headers=i}else n.headers=t??e.headers??Pa;return n},hs=`~effect/http/HttpServerRespondable`,gs=new Uint8Array(256);for(let e of"!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")gs[e.charCodeAt(0)]=1;var _s=new Uint8Array(256);_s[9]=1;for(let e=32;e<=126;e++)_s[e]=1;for(let e=128;e<=255;e++)_s[e]=1;var vs=ze(`effect/http/HttpServerRequest`),ys=new WeakSet,bs=e=>te(t=>{let n=er(t.context,vs);return ys.add(n.source),e}),xs=ze(`effect/http/HttpRouter`),Ss=e=>e.endsWith(`/`)?e.slice(0,-1):e,Cs=k(2,(e,t)=>(t=Ss(t),e===`*`?`${t}/*`:e===`/`?t:t+e)),ws=`~effect/http/HttpRouter/Middleware`,Ts=function(){return arguments.length===0?Es:Es(arguments[0],arguments[1])},Es=(e,t)=>t?.global?o(Ie(function*(){let t=yield*xs,n=ve(e)?yield*e:e;yield*t.addGlobalMiddleware(n)})):new ks(ve(e)?Ze(he(e,e=>d(new Map([[Os,e]])))):kt(d(new Map([[Os,e]])))),Ds=0,Os=`effect/http/HttpRouter/MiddlewareFn`,ks=class e{[ws]={};layerFn;dependencies;constructor(e,t){this.layerFn=e,this.dependencies=t;let n=`effect/http/HttpRouter/Middleware-${++Ds}`;this.layer=Ze(Ie({self:this},function*(){let e=yield*dn(),t=[Qe(e,Os)];if(this.dependencies){let n=yield*bt,r=_e(e,vn),i=yield*_t(this.dependencies,n,r);t.push(...js(i))}return d(new Map([[n,t]]))})).pipe(mn(this.layerFn))}layer;combine(t){return new e(this.layerFn,this.dependencies?Dn(this.dependencies,t.layer):t.layer)}},As=new WeakMap,js=e=>{let t=As.get(e);if(t)return t;let n=pt(),r=0;for(let[t,i]of e.mapUnsafe)t.startsWith(`effect/http/HttpRouter/Middleware-`)&&(n.push(i),i.length>r&&(r=i.length));if(n.length===0)t=[];else{let e=new Set;for(let t=r-1;t>=0;t--)for(let r of n)t<r.length&&e.add(r[t]);t=Te(e).reverse()}return As.set(e,t),t};Ts(bs).layer;var Ms={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,OK:200,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,Re
1setContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511},Ns=e=>Ms[e],Ps=W.createContext(void 0),Fs=e=>{let t=W.useContext(Ps);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Is=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Ir.jsx)(Ps.Provider,{value:e,children:t})),Ls={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Rs=new class{#e=Ls;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function zs(e){setTimeout(e,0)}var Bs=typeof window>`u`||`Deno`in globalThis;function Vs(){}function Hs(e,t){return typeof e==`function`?e(t):e}function Us(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ws(e,t){return Math.max(e+(t||0)-Date.now(),0)}function K(e,t){return typeof e==`function`?e(t):e}function Gs(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==qs(o,t.options))return!1}else if(!Ys(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ks(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Js(t.options.mutationKey)!==Js(a))return!1}else if(!Ys(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qs(e,t){return(t?.queryKeyHashFn||Js)(e)}function Js(e){return JSON.stringify(e,(e,t)=>ec(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ys(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Ys(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Ys(e[r],t[r]))return!1;return!0}return!1}var Xs=Object.prototype.hasOwnProperty;function Zs(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=$s(e)&&$s(t);if(!r&&!(ec(e)&&ec(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Xs.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let ee=Zs(u,d,n+1);s[o]=ee,ee===u&&c++}return i===o&&c===i?e:s}function Qs(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function $s(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ec(e){if(!tc(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!tc(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function tc(e){return Object.prototype.toString.call(e)===`[object Object]`}function nc(e){return new Promise(t=>{Rs.setTimeout(t,e)})}
1function rc(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Zs(e,t)}function ic(e){return e}function ac(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sc=Symbol();function cc(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===sc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lc(e,t){return typeof e==`function`?e(...t):!!e}function uc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var dc=()=>Bs,fc=()=>dc(),pc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mc=new class extends pc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},hc=zs;function gc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=hc,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var _c=gc(),vc=new class extends pc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function yc(e){return Math.min(1e3*2**e,3e4)}function bc(e){return(e??`online`)!==`online`||vc.isOnline()}var xc=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Sc(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Vs);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new xc(t);re(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},ee=()=>mc.isFocused()&&(e.networkMode===`always`||vc.isOnline())&&e.canRun(),te=()=>bc(e.networkMode)&&e.canRun(),ne=e=>{c()||(r?.(),i=`resolved`,a(e))},re=e=>{c()||(r?.(),i=`rejected`,o(e))},ie=()=>new Promise(t=>{r=e=>{(c()||ee())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),ae=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(ne).catch(r=>{if(c())return;let i=e.retry??(fc()?0:3),a=e.retryDelay??yc,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){re(r);return}n++,e.onFail?.(n,r),nc(o).then(()=>ee()?void 0:ie()).then(()=>{t?re(r):ae()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:te,start:()=>(te()?ae():ie().then(ae),s)}}var Cc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Us(this.gcTime)&&(this.#e=Rs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Rs.clearTimeout(this.#e),this.#e=void 0)}};function wc(e){return{onFetch:(t,n)=>
1{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{uc(e,()=>t.signal,()=>n=!0)},u=cc(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oc:ac;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ec:Tc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Tc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Tc(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ec(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Dc(e,t){return t?Tc(e,t)!=null:!1}function Oc(e,t){return!t||!e.getPreviousPageParam?!1:Ec(e,t)!=null}var kc=class extends Cc{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Mc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Mc(this.options);e.data!==void 0&&(this.setState(jc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=rc(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Vs).catch(Vs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>K(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>K(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ws(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)}
1)},i=()=>{let e=cc(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?wc(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Sc({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof xc&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof xc){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ac(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...jc(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),_c.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ac(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function jc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Mc(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Nc=class extends pc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Fc(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ic(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ic(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof K(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Qs(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Lc(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||K(this.options.enabled,this.#t)!==K(t.enabled,this.#t)||K(this.options.staleTime,this.#t)!==K(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||K(this.options.enabled,this.#t)!==K(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Qs(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Vs)),t}#h(e){return!fc()&&K(this.options.enabled,this.#t)!==!1&&Us(e)}#g(){this.#b();let e=K(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Ws(this.#r.dataUpdatedAt,e)+1;this.#u=Rs.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return K(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Rs.setInterval(()=>
1{(this.options.refetchIntervalInBackground||mc.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Rs.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Rs.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Fc(e,t),o=i&&Lc(e,n,t,r);(a||o)&&(l={...l,...Ac(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:ee,errorUpdatedAt:te,status:ne}=l;d=l.data;let re=!1;if(t.placeholderData!==void 0&&d===void 0&&ne===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,re=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(ne=`success`,d=rc(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!re){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=rc(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(ee=this.#o,d=this.#c,te=Date.now(),ne=`error`,u=!1);let ie=l.fetchStatus===`fetching`,ae=ne===`pending`,oe=ne===`error`,se=ae&&ie,ce=d!==void 0;return{status:ne,fetchStatus:l.fetchStatus,isPending:ae,isSuccess:ne===`success`,isError:oe,isInitialLoading:se,isLoading:se,data:d,dataUpdatedAt:l.dataUpdatedAt,error:ee,errorUpdatedAt:te,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:ie,isRefetching:ie&&!ae,isLoadingError:oe&&!ce,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:oe&&ce,isStale:Rc(e,t),refetch:this.refetch,isEnabled:K(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Qs(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();_c.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Pc(e,t){return K(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||K(t.retryOnMount,e)!==!1)}function Fc(e,t){return Pc(e,t)||e.state.data!==void 0&&Ic(e,t,t.refetchOnMount)}function Ic(e,t,n){if(K(t.enabled,e)!==!1&&K(t.staleTime,e)!==`static`){let r=K(n,e);return r===`always`||r!==!1&&Rc(e,t)}return!1}function Lc(e,t,n,r){return(e!==t||K(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Rc(e,n)}function Rc(e,t){return K(t.enabled,e)!==!1&&e.isStaleByTime(K(t.staleTime,e))}var zc=W.createContext(!1),Bc=()=>W.useContext(zc);zc.Provider;function Vc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hc=W.createContext(Vc()),Uc=()=>W.useContext(Hc),Wc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?lc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Gc=e=>{W.useEffect(()=>{e.clearReset()},[e])},Kc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||lc(n,[e.error,r])),qc=(e,t)=>t.state.data===void 0,Jc=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Yc=(e,t)=>e?.suspense&&t.isPending,Xc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zc(e,t,n){let r=Bc(),i=Uc(),a=Fs(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Jc(o),Wc(o,i,s),Gc(i);let[l]=W.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(W.useSyncExternalStore(W.useCallback(e=>{let t=d?l.subscribe(_c.batchCalls(e)):Vs;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),W.useEffect(()=>{l.setOptions(o)},[o,l]),Yc(o,u))throw Xc(o,l,i);if(Kc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Qc(e,t){return Zc(e,Nc,t)}var $c=`~effect/httpapi/HttpApiSchema/Stream`;function q(e){let t=typeof e==`string`?Ns(e):e;return e=>e.annotate({httpApiStatus:t})}var el=e=>m.pipe(q(e)),tl=el(204);function nl(e){return t=>m.pipe(v(O(t),ft({decode:e.decode,encode:hn})))}var rl=e=>Mt(e)&&xe(e,$c),il=e=>rl(e)&&e._tag===`StreamSse`,al=e=>rl(e)&&e._tag===`StreamUint8Array`,ol=`~effect/httpapi/HttpApiSchema/WithHeaders`,sl=`~effect/httpapi/HttpApiSchema/WithHeadersValue`,cl=e=>({[sl]:sl,body:e.body,headers:e.headers}),ll=e=>Mt(e)&&xe(e,`~effect/httpapi/HttpApiSchema/WithHeaders`);function ul(e,t,n){return Pn(e.ast,{[ol]:ol,schema:t,headers:n})}function dl(e,t){return e.annotate({"~httpApiEncoding":{_tag:t._tag,contentType:t.contentType??fl(t._tag)}})}function fl(e){switch(e){case`Multipart`:return`multipart/form-data`;case`Json`:return`application/json`;case`FormUrlEncoded`:return`application/x-www-form-urlencoded`;case`Uint8Array`:return`application/octet-stream`;case`Text`:return`text/plain`}}function pl(e){return t=>dl(t,{_tag:`FormUrlEncoded`,...e})}function ml(e){return t=>dl(t,{_tag:`Uint8Array`,...e})}var hl=e=>{if(ye(e))return!0;let t=tt(e);if(ye(t))return!0;let n=e.encoding?.[0].to;return n!==void 0&&ye(n)},gl=Me(`~httpApiEncoding`),_l=Me(`~httpApiWithHeaders`),vl=Me(`httpApiStatus`),yl={_tag:`Json`,contentType:`application/json`},bl={_tag:`FormUrlEncoded`,contentType:`application/x-www-form-urlencoded`};function xl(e){return gl(e)??yl}function Sl(e,t){return gl(e)||(Mo(t)?yl:bl)}function Cl(e){let t=xl(e);if(t._tag===`Multipart`)throw Error(`Multipart is not supported in response`);return t}function wl(e){return vl(e)??200}function Tl(e){return ll(e)?vl(e.ast)??wl(e.schema.ast):wl(e.ast)}function El(e){return ll(e)&&gl(e.ast)===void 0?Cl(e.schema.ast):Cl(e.ast)}function Dl(e){return vl(e)??500}function Ol(e){return ll(e)?vl(e.ast)??Dl(e.schema.ast):Dl(e.ast)}function kl(e){let t=e.toLowerCase().trim(),n=t.indexOf(`;`);return n===-1?t:t.slice(0,n).trim()}var Al=`~effect/httpapi/HttpApiEndpoint`;function jl(e){let t=[];for(let{schemas:n}of e.payload.values())t.push(...n);return t}function Ml(e){let t=Array.from(e.success);return Sn(t)?t:[tl]}function Nl(e){let t=new Set(e.error),n=e.disableCodecs?P:Hl;for(let r of e.middlewares){let e=r;
1for(let r of e.error)t.add(n(r))}return Array.from(t)}var Pl={[Al]:Al,pipe(){return ln(this,arguments)},prefix(e){return Il({...Fl(this),path:Cs(this.path,e)})},middleware(e){return Il({...Fl(this),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Il({...Fl(this),annotations:Ge(this.annotations,e,t)})},annotateMerge(e){return Il({...Fl(this),annotations:ut(this.annotations,e)})}},Fl=e=>({identifier:e.identifier,path:e.path,method:e.method,params:e.params,query:e.query,headers:e.headers,payload:e.payload,success:e.success,error:e.error,annotations:e.annotations,middlewares:e.middlewares,disableCodecs:e.disableCodecs});function Il(e){function t(){}return Object.setPrototypeOf(t,Pl),Object.assign(t,e)}var Ll=e=>(t,n,r)=>{let i=r?.disableCodecs??!1,a=i?P:qt;return Il({identifier:t,path:n,method:e,params:Rl(r?.params,a),query:Rl(r?.query,a),headers:Rl(r?.headers,a),payload:zl(r?.payload,e,i),success:Vl(r?.success,e,i),error:Ul(r?.error,i),annotations:de(),middlewares:new Set,disableCodecs:i})};function Rl(e,t){if(e!==void 0)return Mt(e)?t(e):t(R(e))}function zl(e,t,n){let r=new Map;if(e===void 0)return r;let i=Array.isArray(e)?e:Mt(e)?[e]:[R(e).pipe(pl())],a=n?P:$l;for(let e of i){let n=Sl(e.ast,t),i=kl(n.contentType),o=r.get(i);if(o){if(o.encoding._tag!==n._tag)throw Error(`Multiple payload encodings for content-type: ${n.contentType}`);if(o.encoding._tag===`Multipart`)throw Error(`Multiple multipart payloads for content-type: ${n.contentType}`);o.schemas.push(a(e,t))}else r.set(i,{encoding:n,schemas:[a(e,t)]})}return r}var Bl=`effect/httpapi/stream/failure`;function Vl(e,t,n){if(e===void 0)return new Set;let r=me(e);return Wl(r,t),new Set(n?r:r.map(Hl))}var Hl=Nn(e=>rl(e)?e:ll(e)?ul(e,rl(e.schema)?e.schema:Ql(e.schema,El(e)),qt(e.headers)):Zl(e));function Ul(e,t){if(e===void 0)return new Set;let n=me(e);for(let e of n)if(rl(ll(e)?e.schema:e))throw Error(`Streaming schemas are not supported in error responses`);return Kl(n,Ol),new Set(t?n:n.map(Hl))}function Wl(e,t){let n=!1,r=new Map;for(let i of e){let e=ll(i)?i.schema:i,a=Tl(i);if(rl(e)){if(ql(e,t),n)throw Error(`Multiple streaming success responses are not supported`);n=!0;let i=Gl(r,a);if(i.noContent)throw Error(`Cannot combine no-content and streaming success responses for status: ${a}`);if(i.bufferedContentTypes.has(kl(e.contentType)))throw Error(`Cannot combine buffered and streaming success responses for status ${a} and content-type: ${e.contentType}`);r.set(a,{...i,stream:e})}else{let t=Gl(r,a),n=hl(e.ast);if(t.stream!==void 0){if(n)throw Error(`Cannot combine no-content and streaming success responses for status: ${a}`);let e=El(i);if(kl(e.contentType)===kl(t.stream.contentType))throw Error(`Cannot combine buffered and streaming success responses for status ${a} and content-type: ${e.contentType}`)}n||t.bufferedContentTypes.add(kl(El(i).contentType)),t.noContent=t.noContent||n}}Kl(e,Tl)}function Gl(e,t){let n=e.get(t);return n===void 0&&(n={bufferedContentTypes:new Set,noContent:!1},e.set(t,n)),n}function Kl(e,t){let n=new Map;for(let r of e){let e=t(r),i=_l(r.ast),a=ll(r)?r.schema:i?.body??r,o=hl(a.ast)?``:kl(rl(a)?a.contentType:El(r).contentType),s=n.get(e);s===void 0&&(s={headerContentType:void 0,plainContentTypes:new Set},n.set(e,s));let c=()=>Error(`Cannot combine a response with headers with another response for status ${e} and content-type: ${o||`<no content>`}`);if(ll(r)||i!==void 0){if(s.headerContentType!==void 0)throw Error(`Cannot declare multiple responses with headers for status ${e}`);if(s.plainContentTypes.has(o))throw c();s.headerContentType=o}else{if(s.headerContentType===o)throw c();s.plainContentTypes.add(o)}}}function ql(e,t){if(t===`HEAD`)throw Error(`HEAD endpoints cannot declare streaming success responses`);if(il(e)&&Jl(e.events.ast))throw Error(`SSE event name is reserved: ${Bl}`)}function Jl(e){return Yl(tt(e),new Set)}function Yl(e,t){if(t.has(e))return!1;if(t.add(e),pe(e))return e.types.some(e=>Yl(e,t));if(Je(e))return Yl(e.thunk(),t);if(!He(e))return!1;let n=e.propertySignatures.find(e=>e.name===`event`);return n!==void 0&&Xl(n.type,t)}function Xl(e,t){if(t.has(e))return!1;t.add(e);let n=tt(e);return n===e?nn(e)?e.literal===Bl:pe(e)?e.types.some(e=>Xl(e,t)):Je(e)?Xl(e.thunk(),t):!1:Xl(n,t)}function Zl(e){let t=Cl(e.ast),n=_l(e.ast);if(n===void 0)return Ql(e,t);let r=xn(n.headers);return R({body:Ql(xn(n.body),t),headers:r}).pipe(v(e)).annotate({"~httpApiWithHeaders":{...n,headersCodec:qt(r)}})}function Ql(e,t){switch(t._tag){case`Json`:return Ht(e);case`FormUrlEncoded`:return qt(e);case`Text`:case`Uint8Array`:return e}}function $l(e,t){switch(Sl(e.ast,t)._tag){case`Json`:return Ht(e);case`FormUrlEncoded`:return qt(e);case`Text`:case`Uint8Array`:case`Multipart`:return e}}var J=Ll(`GET`),Y=Ll(`POST`),eu=Ll(`PUT`),tu=Ll(`PATCH`),nu=Ll(`DELET
1E`),ru=`~effect/httpapi/HttpApi`,iu={[ru]:ru,pipe(){return ln(this,arguments)},add(...e){let t={...this.groups};for(let n of e)tr(t,n.identifier,n);return ou({...au(this),groups:t})},addHttpApi(e){let t={...this.groups};for(let n of Object.keys(e.groups)){let r=e.groups[n];tr(t,n,r.annotateMerge(ut(e.annotations,r.annotations)))}return ou({...au(this),groups:t})},prefix(e){return ou({...au(this),groups:Fn(this.groups,t=>t.prefix(e))})},middleware(e){return ou({...au(this),groups:Fn(this.groups,t=>t.middleware(e))})},annotate(e,t){return ou({...au(this),annotations:Ge(this.annotations,e,t)})},annotateMerge(e){return ou({...au(this),annotations:ut(this.annotations,e)})}},au=e=>({identifier:e.identifier,groups:e.groups,annotations:e.annotations}),ou=e=>{function t(){}return Object.setPrototypeOf(t,iu),Object.assign(t,e)},su=e=>ou({identifier:e,groups:{},annotations:de()}),cu=(e,t)=>{let n=Object.values(e.groups);for(let r of n){let n=ut(e.annotations,r.annotations);t.onGroup({group:r,mergedAnnotations:n});let i=Object.values(r.endpoints);for(let e of i)(!t.predicate||t.predicate({endpoint:e,group:r}))&&t.onEndpoint({group:r,endpoint:e,middleware:e.middlewares,mergedAnnotations:ut(n,e.annotations),successes:lu(Ml(e),Tl),errors:lu(Nl(e),Ol)})}},lu=(e,t)=>{let n=new Map;return e.forEach(r),n;function r(e){if(rl(ll(e)?e.schema:e))return;let r=t(e),i=n.get(r);i===void 0?n.set(r,[e]):i.push(e)}},uu=fs({status:401}),du=class extends Ft(`effect/HttpApiError/Unauthorized`)({_tag:Vn(`Unauthorized`)},{description:`Unauthorized`,httpApiStatus:401}){[vo]=!0;[hs](){return g(uu)}},fu=du.pipe(nl({decode:()=>new du({})})),pu=`~effect/httpapi/HttpApiMiddleware`,mu=`~effect/httpapi/HttpApiMiddleware/Security`,hu=()=>(e,t)=>{let n=an(),r;n!==0&&(u(2),r=new globalThis.Error,u(n));class i extends ze()(e){}let a=i;if(Object.defineProperty(i,"stack",{get(){return r?.stack}}),a[pu]=pu,a.error=gu(t?.error),a.requiredForClient=t?.requiredForClient??!1,t?.security!==void 0){if(Object.keys(t.security).length===0)throw Error(`HttpApiMiddleware.Service: security object must not be empty`);a[mu]=mu,a.security=t.security}return a};function gu(e){return e===void 0?new Set:new Set(Array.isArray(e)?e:[e])}var X=class extends ze()(`effect/httpapi/OpenApi/Description`){},Z=class extends ze()(`effect/httpapi/OpenApi/Summary`){},_u=class extends ze()(`effect/httpapi/OpenApi/Deprecated`){},vu=class extends ze()(`effect/httpapi/OpenApi/Transform`){},yu=`~effect/httpapi/HttpApiGroup`,bu={[yu]:yu,add(...e){let t={...this.endpoints};for(let n of e)tr(t,n.identifier,n);return Su({...xu(this),endpoints:t})},prefix(e){return Su({...xu(this),endpoints:Fn(this.endpoints,t=>t.prefix(e))})},middleware(e){return Su({...xu(this),endpoints:Fn(this.endpoints,t=>t.middleware(e))})},annotateMerge(e){return Su({...xu(this),annotations:ut(this.annotations,e)})},annotate(e,t){return Su({...xu(this),annotations:Ge(this.annotations,e,t)})},annotateEndpointsMerge(e){return Su({...xu(this),endpoints:Fn(this.endpoints,t=>t.annotateMerge(e))})},annotateEndpoints(e,t){return Su({...xu(this),endpoints:Fn(this.endpoints,n=>n.annotate(e,t))})},pipe(){return ln(this,arguments)}},xu=e=>({identifier:e.identifier,topLevel:e.topLevel,endpoints:e.endpoints,annotations:e.annotations}),Su=e=>{function t(){}return Object.setPrototypeOf(t,bu),t.key=`effect/httpapi/HttpApiGroup/${e.identifier}`,Object.assign(t,e)},Q=(e,t)=>Su({identifier:e,topLevel:t?.topLevel??!1,endpoints:{},annotations:de()}),Cu=`~effect/httpapi/HttpApiSecurity`,wu={[Cu]:Cu,pipe(){return ln(this,arguments)}},Tu=e=>Object.assign(Object.create(wu),{_tag:`ApiKey`,key:e.key,in:e.in??`header`,annotations:de()}),Eu=k(3,(e,t,n)=>Object.assign(Object.create(wu),{...e,annotations:Ge(e.annotations,t,n)})),Du=[`stripe`,`revenue_cat`,`referral`,`system`],Ou=[`webhook`,`sync`,`signup`,`manual`,`checkout_intent`];ze()(`CurrentSession`);var ku=[fu,V],Au=Tu({key:`authorization`,in:`header`}).pipe(Eu(X,`Bearer token or raw Firebase token for authentication`)),$=class extends hu()(`UserAuthMiddleware`,{error:ku,security:{Authorization:Au}}){},ju=class extends hu()(`AdminAuthMiddleware`,{error:ku,security:{Authorization:Au}}){},Mu=class extends hu()(`OptionalUserAuthMiddleware`,{error:ku,security:{Authorization:Au}}){},Nu=class extends hu()(`RequestDecodeErrorMiddleware`,{error:jr}){},Pu=R({stripeCustomerId:E(x),stripeSubscriptionId:E(x),stripeSubscriptionStatus:E(x),stripeCurrentPeriodEnd:E(x),stripeCancelAtPeriodEnd:E(N),stripeTrialEnd:E(x),rcSubscriptionStatus:E(x),rcCurrentPeriodEnd:E(x),rcTrialEnd:E(x),referralStartAt:E(x),referralEndAt:E(x),referredByUserId:E(x),hasEverPaid:N,lastSyncedStripeAt:E(x),lastSyncedRevenueCatAt:E(x)}),Fu=R({pageIndex:L.pipe(p(r()),p(h(0)),D(g(0))),pageSize:L.pipe(p(r()),p(h(1)),p(Gt(100)),D(g(20))),sortField:F([`name`,`email`,`createdAt`,`role`,`subscriptionStatus`]).pipe(D(_(()=>`createdAt`))),sortOrder:F([`asc`,`desc`]).pipe(D(_(()=>`desc`))),search:M(x),role:M(F([`admin`,`user`])),banned:M(F([`true`,`false`])),subscriptionStatus:M(F([`active`,`trialing`,`canceled`,`none`]))}),Iu=R({id:x,name:x,email:x,emailVerified:N,role:E(x),banned:E(N),createdAt:x,lastSignedInAt:E(x),subscriptionStatus:E(x),subscriptionPlatform:E(x),hasEverPaid:N}),Lu=J(`ListUsers`,`/users`,{query:Fu,success:R({users:I(Iu),total:w}),error:V}).middleware(ju).annotate(Z,`List users with filtering, sorting, pagination`),Ru=R({id:x,name:x,email:x,emailVerified:N,image:E(x),role:E(x),banned:E(N),banReason:E(x),banExpires:E(x),createdAt:x,updatedAt:x,referralCode:E(x),deletedAt:E(x),billing:E(Pu),preferences:E(R({voice:x})),marketingSurvey:E(R({acquisitionSource:x,details:E(x)}))}),zu=J(`GetUserDetail`,`/users/:userId`,{params:R({userId:x}),success:Ru,error:[H,V]}).middleware(ju).annotate(Z,`Get detailed user info including billing`),Bu=R({billing:Pu,stripeSynced:N,revenueCatSynced:N,errors:I(x)}),Vu=Y(`SyncUserBilling`,`/users/:userId/sync-billing`,{params:R({userId:x}),success:Bu,error:[H,V]}).middleware(ju).annotate(Z,`Refresh billing data from Stripe/RevenueCat for a user`),Hu=R({id:x,provider:F([...Du]),eventType:x,eventSource:F([...Ou]),previousState:E(Ne),newState:E(Ne),peri
1odEndAt:E(x),providerEventId:E(x),metadata:E(Ne),createdAt:x}),Uu=R({pageIndex:L.pipe(p(r()),p(h(0)),D(g(0))),pageSize:L.pipe(p(r()),p(h(1)),p(Gt(200)),D(g(50)))}),Wu=R({events:I(Hu),total:w}),Gu=J(`GetUserSubscriptionHistory`,`/users/:userId/subscription-history`,{params:R({userId:x}),query:Uu,success:Wu,error:V}).middleware(ju).annotate(Z,`List subscription_history audit rows for a user (newest first)`),Ku=Q(`Admin`).add(Lu).add(zu).add(Vu).add(Gu).prefix(`/admin`),qu=A([x,N]),Ju=J(`Bootstrap`,`/bootstrap`,{success:R({distinctId:x,featureFlags:Tt(x,qu),isIdentifiedID:N,newDistinctIdGenerated:N.pipe(D(g(!1)))}).pipe(q(200)),error:V}).annotate(Z,`Analytics Bootstrap`).annotate(X,`Evaluate PostHog feature flags server-side for SSR bootstrap. Reads the PostHog cookie from the forwarded cookie header to identify the user.`),Yu=Q(`Analytics`).add(Ju).prefix(`/analytics`),Xu=F([`html`,`pdf`,`doc`,`docx`,`ppt`,`pptx`,`txt`,`md`,`rtf`,`epub`,`mobi`,`email`,`email_attachment`]),Zu={pdf:`pdf`,doc:`doc`,docx:`docx`,ppt:`ppt`,pptx:`pptx`,txt:`txt`,md:`md`,markdown:`md`,mdx:`md`,rtf:`rtf`,epub:`epub`,mobi:`mobi`,html:`html`,htm:`html`,eml:`email`},Qu={"application/pdf":`pdf`,"application/msword":`doc`,"application/vnd.openxmlformats-officedocument.wordprocessingml.document":`docx`,"application/vnd.ms-powerpoint":`ppt`,"application/vnd.openxmlformats-officedocument.presentationml.presentation":`pptx`,"text/plain":`txt`,"text/markdown":`md`,"text/x-markdown":`md`,"text/mdx":`md`,"application/rtf":`rtf`,"text/rtf":`rtf`,"application/epub+zip":`epub`,"application/x-mobipocket-ebook":`mobi`,"text/html":`html`,"application/xhtml+xml":`html`,"message/rfc822":`email`};function $u(e){if(e)return Zu[e.toLowerCase()]}function ed(e){let t=e?.split(`;`)[0]?.trim().toLowerCase();if(t)return Qu[t]}function td(e,t){return $u(e.split(`.`).pop())??ed(t)}var nd=F([`initializing`,`processingPDF`,`completedExtraction`,`complete`,`deleted`,`Error`]),rd=F([`pending`,`scheduled`,`inProgress`,`completed`,`failed`]),id=F([`private`,`public`,`selective_share`]),ad=F([`HTML`,`PDF`,`DOC`,`DOCX`,`PPT`,`PPTX`,`TXT`,`MD`,`RTF`,`EPUB`,`MOBI`,`EMAIL`,`EMAIL_ATTACHMENT`]),od=F([`en`,`es`,`fr`,`hi`,`it`,`ja`,`pt`,`zh`]),sd=od.literals,cd=new Set(od.literals),ld=R({label:x,color:x}),ud=R({emails:M(E(I(x))).pipe(v(M(O(I(x))),{decode:b(e=>e.pipe(C(y))),encode:lt()})),user_ids:M(E(I(x))).pipe(v(M(O(I(x))),{decode:b(e=>e.pipe(C(y))),encode:lt()}))}),dd=R({visibility:M(E(id)).pipe(v(c(O(id)),{decode:b(e=>e.pipe(C(y),S(()=>`private`))),encode:f()})),unshareable_reason:E(x).pipe(D(g(null))),shared_with:E(ud)}),fd=R({voice:x.pipe(ue(`VoiceDisplayName`)),status:M(E(F([`pending`,`processing`,`completed`,`failed`]))).pipe(v(c(O(F([`pending`,`processing`,`completed`,`failed`]))),{decode:b(e=>e.pipe(C(y),S(()=>`pending`))),encode:f()})),url:E(x).pipe(D(g(null))),started_at_ms:w,finished_at_ms:E(w).pipe(D(g(null))),version:M(E(w)).pipe(v(c(O(w)),{decode:b(e=>e.pipe(C(y),S(()=>1413))),encode:f()}))}),pd=R({chapter_details_s3_url:E(x).pipe(D(g(null))),tts_finalized_details:M(E(I(fd))).pipe(v(M(O(I(fd))),{decode:b(e=>e.pipe(C(y))),encode:lt()}))}),md=R({chapter_id:E(x),chapter_title:E(x),estimated_percent_complete:j,timestamp_ms:w,tts_batch_version:E(w),tts_id:E(x),doc_pack_page:E(w).pipe(D(g(null))),doc_pack_char_start:E(w).pipe(D(g(null))),doc_pack_char_end:E(w).pipe(D(g(null))),updated_at_ms:E(w)}),hd=R({url:x,content_version:w}),gd=R({id:x,legacy_id:E(x).pipe(D(g(null))),archived_at_ms:E(w).pipe(D(g(null))),conversion_status:nd,cover_img_url:E(x),created_at_ms:w,document_type:E(ad).pipe(D(g(null))),document_url:E(x),doc_pack:E(hd).pipe(D(g(null))),error:E(x),finalized_metadata:E(pd).pipe(D(g(null))),folder_id:E(x).pipe(D(g(null))),folder_path:I(x),language:E(od),owner_id:E(x),page_count:E(w),progress:E(md),sharing:M(E(dd)).pipe(v(M(O(dd)),{decode:b(e=>e.pipe(C(y))),encode:lt()})),tags:I(ld),title:E(x),url_slug:E(x),publishing_author:E(x).pipe(D(g(null))),publishing_year:E(w).pipe(D(g(null))),description:E(x).pipe(D(g(null))),category:E(x).pipe(D(g(null))),conversion_pipeline_version:E(F([`v1`,`v2`])).pipe(D(g(null)))}),_d=R({start:w,end:w}),vd=R({page:w,bbox:ae([j,j,j,j])}),yd=R({text:x,bboxes:I(vd),timestamp_ms:E(_d),tts_hash_id:E(x)}),bd=R({words:I(yd),bboxes:I(vd),timestamp_ms:E(_d)}),xd=R({sentences:I(bd),bboxes:I(vd),timestamp_ms:E(_d)}),Sd=R({id:x,legacy_id:E(x).pipe(D(g(null))),title:x,index:w,audio_url:E(x),audio_url_status:rd,avg_estimated_tts_chunk_duration_ms:j,avg_paragraph_word_length:j,bbox_pages:I(w),num_paragraphs:w,tts_batch_version:w,tts_ids:I(x).annotate({de
1scription:`DEPRECATED: legacy stored TTS chunk IDs. New readers should key playback, progress, notes, and highlights by doc-pack page/char ranges.`,jsonSchema:{deprecated:!0}})}),Cd=R({id:x,legacy_id:E(x).pipe(D(g(null))),title:x,index:w,audio_url:E(x),audio_url_status:rd,avg_estimated_tts_chunk_duration_ms:j,avg_paragraph_word_length:j,bbox_pages:I(w),num_paragraphs:w,paragraphs:I(xd),timestamp_ms:E(_d),tts_batch_version:w,tts_ids:I(x).annotate({description:`DEPRECATED: legacy stored TTS chunk IDs. New readers should key playback, progress, notes, and highlights by doc-pack page/char ranges.`,jsonSchema:{deprecated:!0}})});R({id:x,text:x,url:E(x),format:T(`mp3`),duration_ms:w,url_expires_at_ms:w.annotate({description:`DEPRECATED: always a far-future constant; URLs are permanent public S3 URLs, not expiring. Do not rely on this field.`,jsonSchema:{type:`number`,deprecated:!0}}),alignment_timestamps:I(_d),voice_data_version:w,voice:x});var wd=gd.pipe(we({summary:M(E(x)),key_points:M(E(x)),chapters:I(Sd),voice:x})),Td=R({audio_conversions:I(gd),cursor:E(x),tts_finalized_version:w,voice_data_version:w}),Ed=R({audio_conversion:gd}),Dd=R({audio_conversion:wd}),Od=R({service:x,engine:E(x),duration_ms:E(w),estimated_cost_microdollars:j,usage_metrics:E(Tt(x,Ne)),created_at_ms:w}),kd=R({conversion_pipeline_version:E(F([`v1`,`v2`])),steps:I(Od)}),Ad=R({pipeline_version:F([`v1`,`v2`]),vision_v2_enabled:N,ocr_provider:F([`azure`,`paddle-modal`]),paddle_mode:F([`minimal`,`full`]),label_general_model:E(x),update_mode:F([`finetune`,`general`,`deterministic`]),word_enrichment_enabled:N}),jd=R({audio_conversion:gd}),Md=R({chapters:I(Cd),cursor:E(x)}),Nd=R({chapter:Cd}),Pd=[{name:`Monica`,lang:`en`,model_id:`af_sky`},{name:`Rupert`,lang:`en`,model_id:`am_michael`},{name:`Liv`,lang:`en`,model_id:`af_bella`},{name:`Scarlett`,lang:`en`,model_id:`af_heart`,is_free:!0},{name:`Will`,lang:`en`,model_id:`am_liam`,is_free:!0},{name:`Amy`,lang:`en`,model_id:`bf_emma`,softness:`soft`},{name:`Leslie`,lang:`en`,model_id:`af_aoede`},{name:`Beatrix`,lang:`en`,model_id:`af_kore`},{name:`Allison`,lang:`en`,model_id:`af_sarah`},{name:`Valerie`,lang:`en`,model_id:`af_alloy`},{name:`Elizabeth`,lang:`en`,model_id:`af_nova`},{name:`Tyler`,lang:`en`,model_id:`am_puck`},{name:`Zachary`,lang:`en`,model_id:`bm_fable`},{name:`Justin`,lang:`en`,model_id:`bm_george`},{name:`Hugh`,lang:`en`,model_id:`bm_lewis`,softness:`deep`},{name:`Dan`,lang:`en`,model_id:`am_echo`},{name:`Millie`,lang:`en`,model_id:`bf_v0isabella`,softness:`soft`},{name:`Harvey`,lang:`en`,model_id:`am_eric`},{name:`Aaron`,lang:`en`,model_id:`am_fenrir`},{name:`Claire`,lang:`en`,model_id:`af_nicole`},{name:`Lewis`,lang:`en`,model_id:`bm_v0lewis`},{name:`Jessica`,lang:`en`,model_id:`af_jessica`},{name:`Sky`,lang:`en`,model_id:`af_v0sky`},{name:`Santa`,lang:`en`,model_id:`am_santa`},{name:`Daniel`,lang:`en`,model_id:`bm_daniel`},{name:`River`,lang:`en`,model_id:`af_river`},{name:`Michael`,lang:`en`,model_id:`am_v0michael`},{name:`Alice`,lang:`en`,model_id:`bf_alice`},{name:`Aria`,lang:`en`,model_id:`af_v0`},{name:`Adam`,lang:`en`,model_id:`am_adam`},{name:`Lily`,lang:`en`,model_id:`bf_lily`},{name:`Irulan`,lang:`en`,model_id:`af_v0irulan`,hidden:!0},{name:`Emma`,lang:`en`,model_id:`bf_v0emma`},{name:`Bella`,lang:`en`,model_id:`af_v0bella`},{name:`Sarah`,lang:`en`,model_id:`af_v0sarah`},{name:`Nicole`,lang:`en`,model_id:`af_v0nicole`},{name:`Onyx`,lang:`en`,model_id:`am_onyx`},{name:`Marcus`,lang:`en`,model_id:`am_v0adam`},{name:`Gurney`,lang:`en`,model_id:`am_v0gurney`},{name:`Jadzia`,lang:`en`,model_id:`af_jadzia`},{name:`George`,lang:`en`,model_id:`bm_v0george`},{name:`Carmen`,lang:`es`,model_id:`ef_dora`,is_free:!0},{name:`Diego`,lang:`es`,model_id:`em_alex`,is_free:!0},{name:`Pablo`,lang:`es`,model_id:`em_santa`},{name:`Siwis`,lang:`fr`,model_id:`ff_siwis`,is_free:!0},{name:`Priya`,lang:`hi`,model_id:`hf_alpha`,is_free:!0},{name:`Beta`,lang:`hi`,model_id:`hf_beta`},{name:`Omega`,lang:`hi`,model_id:`hm_omega`,is_free:!0},{name:`Psi`,lang:`hi`,model_id:`hm_psi`},{name:`Sara`,lang:`it`,model_id:`if_sara`,is_free:!0},{name:`Nicola`,lang:`it`,model_id:`im_nicola`,is_free:!0},{name:`Yuki`,lang:`ja`,model_id:`jf_alpha`,is_free:!0},{name:`Gongitsune`,lang:`ja`,model_id:`jf_gongitsune`},{name:`Nezumi`,lang:`ja`,model_id:`jf_nezumi`},{name:`Tebukuro`,lang:`ja`,model_id:`jf_tebukuro`},{name:`Kumo`,lang:`ja`,model_id:`jm_kumo`,is_free:!0},{name:`Isabel`,lang:`pt`,model_id:`pf_dora`,is_free:!0},{name:`Carlos`,lang:`pt`,model_id:`pm_alex`,is_free:!0},{name:`Natalia`,lang:`pt`,model_id:`pm_santa`},{name:`Xiaobei`,lang:`zh`,model_id:`zf_xiaobei`,is_free:!0},{name:`Xiaoni`,lang:`zh`,model_id:`zf_xiaoni`},{name:`Xiaoxiao`,lang:`zh`,model_id:`zf_xiaoxiao`},{name:`Xiaoyi`,lang:`zh`,model_id:`zf_xiaoyi`},{name:`Yunjian`,lang:`zh`,model_id:`zm_yunjian`,is_free:!0},{name:`Yunxi`,lang:`zh`,model_id:`zm_yunxi`},{name:`Yunxia`,lang:`zh`,model_id:`zm_yunxia`},{name:`Yunyang`,lang:`zh`,model_id:`zm_yunyang`}],Fd=Pd.filter(e=>!(`hidden`in e&&e.hidden)),Id=new Set(Pd.filter(e=>`hidden`in e&&e.hidden).flatMap(e=>[e.name.toLowerCase(),e.model_id.toLowerCase()]));function Ld(e){return Id.has(e.toLowerCase())}var Rd=x.pipe(ue(`VoiceModelId`)),zd=x.pipe(ue(`VoiceDisplayName`));function Bd(e){return Rd.make(e)}function Vd(e){return zd.make(e)}new Map(Pd.map(e=>[e.name,Rd.make(e.model_id)]));var Hd=new Map(Pd.flatMap(e=>[[e.name.toLowerCase(),e.name],[e.model_id.toLowerCase(),e.name]])),Ud=new Map(Pd.flatMap(e=>[[e.name.toLowerCase(),Rd.make(e.model_id)],[e.model_id.toLowerCase(),Rd.make(e.model_id)]]));function Wd(e){return Hd.get(e.toLowerCase())??e}function Gd(e){return Ud.get(e.toLowerCase())}var Kd=x.pipe(v(Rd,{decode:Ce(e=>{let t=Ud.get(e.toLowerCase());return t?g(t):Zn(new s({message:`Unknown voice: ${e}`},e))}),encode:lt()})),qd=R({gender:F([`male`,`female`]),image_url:x,is_free:E(N).pipe(v(O(N),{decode:En(e=>e??!1),encode:ht()}),D(g(!1))),lang:od,model_id:Rd,name:zd,sample_url:x,softness:E(F([`soft`,`moderate`,`deep`])).pipe(v(O(F([`soft`,`moderate`,`deep`])),{decode:En(e=>e??`moderate`),encode:ht()}),D(_(()=>`moderate`)))}).annotate({identifier:`VoiceSummary`}),Jd=R({voices:I(qd)}
1),Yd=R({cursor:M(x).annotate({description:`Pagination cursor for the next page`}),limit:M(L).annotate({description:`Number of chapters to return (1-16, default 16)`})}),Xd=x.pipe(v(N,ft({decode:e=>e===`true`,encode:e=>e?`true`:`false`}))),Zd={doc_pack_progress:M(Xd)},Qd=R(Zd),$d=R({...Zd,cursor:M(x).annotate({description:`Pagination cursor for the next page`}),limit:M(L).annotate({description:`Number of audio items to return (default 20)`}),status:M(A([nd,I(nd)])).annotate({description:`Filter by conversion status`}),except_status:M(A([nd,I(nd)])).annotate({description:`Exclude by conversion status`}),sort_by:M(F([`created_at`,`played_at`,`title`])).annotate({description:"Sort by `created_at` (default, descending), `played_at` (descending, unplayed last) or `title` (ascending, untitled last)"}),sort_dir:M(F([`asc`,`desc`])).annotate({description:"Sort direction. Defaults to descending for `created_at` and `played_at` and ascending for `title`; rows without the sort key stay last either way"}),folder_id:M(x).annotate({description:`Return only conversions in this folder (not recursive). Use "root" for top-level conversions.`}
1),title_query:M(x).annotate({description:"Return only conversions whose title contains this text, case- and surrounding-whitespace-insensitive (the same folding `sort_by=title` orders on, so untitled conversions never match). Empty or whitespace-only applies no filter."}),if_modified_since_ms:M(L).annotate({description:`Only include conversions updated after this timestamp (ms since epoch)`})}),ef=Y(`UnarchiveAudio`,`/unarchive`,{payload:R({audioId:x}),success:m.pipe(q(200)),error:V}).middleware($).annotate(Z,`Unarchive Audio`).annotate(X,`Unarchive an audio conversion for the current user`),tf=J(`ListAudio`,`/`,{query:$d,success:Td.pipe(q(200)),error:[H,V]}).middleware($).annotate(Z,`List Audio`).annotate(X,`List all audio conversions for the current user`),nf=R({document_url:x.annotate({description:`URL of the document to convert`})}),rf=R({integration_source:R({provider:T(`zotero`),file_id:x.annotate({description:`Provider-specific file/attachment ID (Zotero: itemKey)`})})}),af=R({document_type:M(Xu).annotate({description:`Document type. If not provided, will be auto-detected from URL or Content-Type.`}
1),title:M(x).annotate({description:`Optional title for the audio. If not provided, will be extracted from document.`}),folder_id:M(E(x)).annotate({description:`Optional ID of the folder to add this conversion to`}),conversion_pipeline_version:M(F([`v1`,`v2`])).annotate({description:`Conversion pipeline version to use (v1 or v2). Defaults to the server-configured pipeline if omitted.`}),conversion_vision_off:M(N).annotate({description:`Run the conversion without the vision layout model (dev/staging only). Defaults to false.`}),conversion_ocr_provider:M(F([`azure`,`paddle-modal`,`paddleocr-vl-modal`])).annotate({description:`OCR provider for the v2 pipeline (dev/staging only). Defaults to the server-configured provider.`}),conversion_label_model:M(F([`finetune`,`general`])).annotate({description:`Label step model for the v2 pipeline (dev/staging only): the fine-tuned 8B or the configured general LLM.`}),conversion_update_mode:M(F([`finetune`,`general`,`deterministic`])).annotate({description:`Update step mode for the v2 pipeline (dev/staging only): fine-tuned 8B, configured general LLM, or the deterministic normalizer.`}
1),conversion_word_enrichment:M(N).annotate({description:`Force the v2 word-geometry enrichment stage on (true) or off (false) (dev/staging only). Defaults to the server config.`})}),of=Y(`CreateAudio`,`/`,{payload:A([nf.pipe(we(af.fields)),rf.pipe(we(af.fields))]),success:jd.pipe(q(201)),error:[U,wr,Ar,Pr,Mr,B,V]}).middleware($).annotate(Z,`Create Audio`).annotate(X,`Start a new audio conversion from a document URL or integration source`),sf=J(`GetAudio`,`/:audioOrSlug`,{params:R({audioOrSlug:x.annotate({description:`Audio ID or URL slug`})}),query:Qd,success:Ed.pipe(q(200)),error:[H,B,V]}).middleware(Mu).annotate(Z,`Get Audio`).annotate(X,`Get a single audio conversion by ID or URL slug. Public audios can be accessed without authentication.`),cf=J(`GetAudioDetailed`,`/:audioOrSlug/detailed`,{params:R({audioOrSlug:x.annotate({description:`Audio ID or URL slug`})}),query:Qd,success:Dd.pipe(q(200)),error:[H,B,Er,V]}).middleware(Mu).annotate(Z,`Get Audio (Detailed)`).annotate(X,`Get a single audio conversion with chapter summaries and voice info. Public audios can be accessed without authentication.`),lf=J(`GetConversionDiagnostics`,`/:audioId/conversion-diagnostics`,{params:R({audioId:x.annotate({de
1scription:`Audio ID`})}),success:kd.pipe(q(200)),error:[H,B,V]}).middleware($).annotate(Z,`Get Conversion Diagnostics (dev/staging)`).annotate(X,`Dev/staging-only per-step conversion cost/timing rows for an audio. Returns 404 in production.`),uf=J(`GetConversionDefaults`,`/conversion-defaults`,{success:Ad.pipe(q(200)),error:[H,B,V]}).middleware($).annotate(Z,`Get Conversion Defaults (dev/staging)`).annotate(X,`Dev/staging-only resolved server-side conversion config defaults. Returns 404 in production.`),df=R({url:x,page:w,width:M(w),height:M(w),format:F([`webp`,`png`]),cache_status:F([`hit`,`miss`])}),ff=J(`GetAudioPageImage`,`/:audioOrSlug/page-image/:page`,{params:R({audioOrSlug:x.annotate({description:`Audio ID or URL slug`}),page:L.annotate({description:`1-based PDF page number`})}),success:df.pipe(q(200)),error:[H,B,U,V]}).middleware(Mu).annotate(Z,`Get Audio Page Image`).annotate(X,`Get or lazily render a cached page image for a PDF-backed audio conversion.`),pf=R({title:M(E(x)),description:M(E(x)),tags:M(E(I(R({label:x,color:x})))),visibility:M(E(id)),shared_with_emails:M(E(I(x))),shared_with_user_ids:M(E(I(x))),doc_pack_progress:M(N)}),mf=R({audio_conversion:gd}),hf=tu(`UpdateAudio`,`/:audioId`,{params:R({audioId:x.annotate({de
1scription:`Audio ID`})}),payload:pf,success:mf.pipe(q(200)),error:[H,U,V]}).middleware($).annotate(Z,`Update Audio`).annotate(X,`Update properties of an audio conversion`),gf=R({progress_age_ms:M(w.check(h(0))),timestamp_ms:w.annotate({description:`Current playback position in milliseconds`}),chapter_id:E(x).pipe(D(g(null))).annotate({description:`Compatibility chapter anchor. doc-pack-backed clients may omit this.`}),tts_id:E(x).pipe(D(g(null))).annotate({description:`Legacy TTS chunk id, when progress is anchored to a chunk`}),doc_pack_page:E(w).pipe(D(g(null))),doc_pack_char_start:E(w).pipe(D(g(null))),doc_pack_char_end:E(w).pipe(D(g(null)))}),_f=eu(`UpdateAudioProgress`,`/:audioId/progress`,{params:R({audioId:x.annotate({description:`Audio ID`})}),payload:gf,success:m.pipe(q(204)),error:[H,U,V]}).middleware($).annotate(Z,`Update Audio Progress`).annotate(X,`Set the current audio position. Supports doc-pack page/char anchors for the new reader path.`),vf=R({audio_conversion:gd}),yf=Y(`FinalizeAudio`,`/:audioId/finalize`,{params:R({audioId:x.annotate({de
1scription:`Audio ID`})}),payload:R({voice:Kd.annotate({description:`Voice ID to synthesize with (accepts display name or model_id, any case)`}),doc_pack_progress:M(N),rebuild:M(N).annotate({description:`Build a new archive even if a completed one exists, e.g. when the completed archive does not cover the chapters the client has`})}),success:vf.pipe(q(200)),error:[H,U,V]}).middleware($).annotate(Z,`Finalize Audio`).annotate(X,`Pre-generate all TTS audio for offline mobile listening`),bf=Y(`GetFinalizationStatus`,`/finalization-status`,{payload:R({audio_ids:I(x).pipe(p(Ln(100)))}),success:R({items:I(R({id:x,finalized_metadata:E(pd)}))}).pipe(q(200)),error:V}).middleware($).annotate(Z,`Get Finalization Status`).annotate(X,`Finalization status of the caller's audio conversions, without chapters. Ids the caller cannot see are omitted.`),xf=nu(`DeleteAudio`,`/:audioId`,{params:R({audioId:x.annotate({description:`Audio ID`})}),success:m.pipe(q(204)),error:[H,V]}).middleware($).annotate(Z,`Delete Audio`).annotate(X,`Soft-delete an audio conversion for the current user`),Sf=J(`ListChapters`,`/:audioOrSlug/chapters`,{params:R({audioOrSlug:x.annotate({de
1scription:`Audio ID or URL slug`})}),query:Yd,success:Md.pipe(q(200)),error:[H,B,Er,V]}).middleware(Mu).annotate(Z,`List Chapters (legacy)`).annotate(_u,!0).annotate(X,`Legacy chapter transport with paragraph/sentence/word details and stored TTS ids. New readers should use GetAudioDetailed for metadata plus the doc-pack/page-image projections.`),Cf=J(`GetSavedDocumentInsights`,`/:audioId/insights/saved`,{params:R({audioId:x}),query:ur,success:E(fr),error:[H,B,V]}).middleware($),wf=Y(`EnsureDocumentInsights`,`/:audioId/insights/saved`,{params:R({audioId:x}),payload:dr,success:fr,error:[H,B,U,V,Tr]}).middleware($),Tf=Q(`Audio`).add(Cf).add(wf).add(ef).add(tf).add(of).add(hf).add(_f).add(yf).add(bf).add(xf).add(sf).add(cf).add(ff).add(Sf).add(lf).add(uf).prefix(`/v2/audio`),Ef=R({plan_id:gr,interval:Sr,amount_cents:mr}),Df=F([`comp`,`active_stripe`,`active_revenue_cat`,`needs_support`]),Of=F([`paywall`,`offer`]),kf=R({plans:I(Ef),trial_days:w.pipe(p(h(0))),paywall_copy:x,promo:E(Ef),stripe_publishable_key:x,blocked_reason:E(Df)}),Af=R({status:pr,amount_usd:E(j.pipe(p(xt(0)))),currency:E(x),trial_started:N,purchase_event_id:M(E(x))}),jf=R({google_click_id:M(E(x)),google_wbraid:M(E(x)),google_gbraid:M(E(x)),facebook_click_id:M(E(x)),facebook_click_cookie:M(E(x)),facebook_pixel_cookie:M(E(x))}),Mf=[`google_click_id`,`google_wbraid`],Nf=[...Mf,`google_gbraid`],Pf=R({plan_id:gr,promo_code:M(E(x)),attribution:M(jf),uncancel_only:M(N)}),Ff=F([`payment`,`setup`]),If=R({client_secret:E(x),confirmation_type:E(Ff),subscription_id:x}),Lf=x.check(Ln(200),$t(/^[\w.:$-]+$/)),Rf=R({distinct_id:M(Lf)}),zf=R({plan_id:gr,expected_amount_cents:mr,cf_turnstile_token:x,attribution:M(jf)}),Bf=R({client_secret:x}),Vf=R({brand:x,last4:x}),Hf=F([`none`,`awaiting_card`,`card_saved`]),Uf=R({state:Hf,setup_intent_id:E(x),plan_id:E(gr),interval:E(Sr),amount_cents:E(mr),trial_days:E(w),card:E(Vf)}),Wf=F([`created`,`already_subscribed`,`offer_unavailable`,`no_pending_checkout`]),Gf=R({outcome:Wf,setup_intent_id:E(x),subscription_id:E(x),client_secret:E(x),confirmation_type:E(Ff)}),Kf=J(`GetBillingStatus`,`/status`,{success:pr,error:V}).middleware($).annotate(Z,`Get billing status`).annotate(X,`Entitlement, billing relationship and free-tier eligibility for the current user. Capability booleans (can_cancel_in_app, can_change_plan_in_app, manage_url) are the contract — clients must not branch on the provider. The Stripe portal URL is deliberately absent; it is minted on click.`),qf=Y(`Subscribe`,`/subscribe`,{payload:Pf,headers:R({"idempotency-key":M(x)}),success:If,error:[U,V]}).middleware($).annotate(Z,`Create a subscription`).annotate(X,`Creates (or uncancels) the caller's subscription for a plan. The price, the trial and the confirmation type are all decided server-side: the request carries a plan key, never a price id and never a trial length. Send an "Idempotency-Key" header to make a retry safe; without one the server derives a key from the actor, the plan and a short rolling window.`),Jf=J(`GetCheckoutConfig`,`/checkout-config`,{query:R({promo_code:M(x),surface:M(Of)}),success:kf,error:V}).middleware($).annotate(Z,`Get checkout configuration`).annotate(X,`Resolved plans, trial length, paywall copy variant and publishable key for the current user, plus blocked_reason when a subscription elsewhere means they must not be sold one here. Carries no price ids, lookup keys or variant names. Send surface=paywall only when a paywall is rendered: that request records the experiment exposures and prices plans at the checkout arm; without it nothing is exposed and a Stripe subscriber's plans are priced at the arm a plan change would charge.`),Yf=Y(`Confirm`,`/confirm`,{success:Af,error:[U,V]}).middleware($).annotate(Z,`Confirm a checkout`).annotate(X,`Syncs the caller's subscription from Stripe eagerly, so a client that returns before the webhook lands still sees the truth. Stores a card collected by a SetupIntent as the customer's default, marks the user as having paid, and returns the resolved status alongside the conversion-pixel fields /post-purchase reads.`),Xf=Y(`PortalSession`,`/portal-session`,{payload:hr,success:Cr,error:[U,V]}).middleware($).annotate(Z,`Mint a billing-portal session`).annotate(X,`Creates a Stripe billing-portal session against the least-privilege configuration and returns its URL. Money mechanics only: cards and invoices. Cancel and plan change are not portal flows — they are separate endpoints, so the exit survey and save offer cannot be bypassed. The URL is a full redirect (the portal cannot be framed), expires five minutes after minting and must never be cached. Refused for a user with no Stripe customer: a store-billed subscriber gets manage_url from /billing/status instead.`),Zf=Y(`Cancel`,`/cancel`,{payload:sr,success:Nr,error:[U,V]}).middleware($).annotate(Z,`Cancel a subscription`).annotate(X,`Ends the caller's subscription at the end of the peri
1od they have paid for, and returns the instant access actually ends. A schedule-bearing subscriber — an owed-time resubscriber or one of the legacy multi-year prepaid cohort — is cancelled through the schedule instead, because Stripe refuses a deferred cancel on a schedule-managed subscription and an immediate one would destroy prepaid years.`),Qf=Y(`PreviewPlanChange`,`/change-plan/preview`,{payload:ar,success:cr,error:[U,V]}).middleware($).annotate(Z,`Preview a plan change`).annotate(X,`Computes what moving the caller's subscription to the named plan would cost, from Stripe's invoice preview under exactly the terms the change itself will state: the amount due today, any credit booked to the customer balance, the previewed lines, the next charge and its date, and the instant the prorations were computed at. The client sends that instant and the amount back on /billing/change-plan, which refuses if the recomputed amount differs. Applies the same refusals as /billing/change-plan.`),$f=Y(`ChangePlan`,`/change-plan`,{payload:_r,headers:R({"idempotency-key":M(x)}),success:lr,error:[U,V,Or]}).middleware($).annotate(Z,`Change plan`).annotate(X,`Moves the caller's subscription to another catalog plan, named by plan key — never by price id, and only against a preview the caller has seen: the request carries the preview's proration instant and amount due today, and the server refuses with a 409 carrying a fresh preview when the recomputed amount differs. Refused for a subscriber whose current price is not a catalog entry (the old plan could not be named as a target to switch back to), for a schedule-bearing subscription, where the update could release the schedule and destroy prepaid time, and for a subscription that has already ended — there is nothing to move, and the paywall is that user's route. Every refusal is one can_change_plan_in_app already advertises on /billing/status.`),ep=J(`GetPendingCheckoutQuote`,`/pending-checkout/quote`,{query:Rf,success:kf,error:V}).annotate(Z,`Get the pre-signup paywall quote`).annotate(X,`The paywall a visitor with no account is shown: plans priced at the arm their lis_bucket cookie resolves to, and that arm's trial. Needs no session. Records the pricing exposure under distinct_id when one is sent. blocked_reason is always null — nothing about an account is known yet.`),tp=Y(`CreatePendingCheckout`,`/pending-checkout`,{payload:zf,success:Bf,error:[U,yr,Tr,V]}).annotate(Z,`Save a card before signup`).annotate(X,`Starts a pre-signup checkout: verifies the Turnstile token, snapshots the quote for plan_id server-side, and returns the client secret of a SetupIntent that belongs to no Stripe customer. Sets the pending-checkout cookie. Nothing is charged and no subscription exists until an account finishes it.`),np=J(`GetPendingCheckout`,`/pending-checkout`,{success:Uf,error:V}).annotate(Z,`Read the pending checkout`).annotate(X,`The pre-signup checkout this browser's cookie names, read live from Stripe: whether a card has been saved, which card, and the quoted plan and trial. state is none when there is no live pending checkout.`),rp=Y(`FinishPendingCheckout`,`/pending-checkout/finish`,{success:Gf,error:[U,V]}).middleware($).annotate(Z,`Finish a pre-signup checkout`).annotate(X,`Creates the signed-in account's subscription on the card saved before signup, at exactly the quoted plan, price and trial. An account that cannot take that offer — already subscribed, trial used, a different pinned price, owed time, a live subscription — is refused with nothing charged and the card left unattached. Idempotent: a retry answers with the subscription the first call created.`),ip=Q(`Billing`).add(Kf).add(qf).add(Jf).add(Yf).add(Xf).add(Zf).add(Qf).add($f).add(ep).add(tp).add(np).add(rp).prefix(`/billing`),ap=R({metadata:R({title:x,abstract:x,authors:x,publication_date:x,citation_count:w,category:M(x),copyright_text:x,g_drive_link:x,listing_url:x,source:x}),audioConversion:R({id:x,publicId:M(x),status:x,cover_img:M(x),visibility:M(x)})}),op=R({slug:x,isSticky:N,author:x,authorImage:E(x),heroImage:E(x),heroImageAlt:E(x),pubDate:x,tags:I(x),description:x,title:x,excerpt:x,seoDescription:x}),sp=R({detailPage:R({htmlParts:I(x),banners:I(x),oldPostFormat:op}),randomPosts:I(op),randomDocs:I(ap)}),cp=J(`GetPost`,`/posts/:slug`,{params:R({slug:x}),success:sp.pipe(q(200)),error:[H,V,xr]}).annotate(Z,`Get Blog Post`).annotate(X,`Fetch a single blog post by slug with processed HTML, related posts, and doc promotions`),lp=J(`ListPosts`,`/posts`,{query:R({page:L.pipe(p(r()),p(h(1)),D(g(1))),size:L.pipe(p(r()),p(h(1)),D(g(15)))}),success:R({posts:I(op),pageInfo:R({hasNextPage:N,hasPreviousPage:N,totalPages:w,currentPage:w,nextPage:E(w),previousPage:E(w),total:w})}).pipe(q(200)),error:[V,xr]}).annotate(Z,`List Blog Posts`).annotate(X,`Fetch paginated blog posts with offset pagination`),up=Q(`Blog`).add(cp).add(lp).prefix(`/blog`),dp=R({end_date_ms:w,start_date_ms:w}).annotate({identifier:`ReferralSubscriptionView`}),fp=class extends F([`day`,`week`,`month`,`year`]){},pp=R({default_amount_cents:w,default_interval:fp,default_interval_count:w,id:x}).annotate({identifier:`RevenueCatProductView`}),mp=class extends F([`incomplete`,`incomplete_expired`,`trialing`,`active`,`past_due`,`canceled`,`unpaid`]){},hp=R({canceled_date:E(x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`))))),management_url:E(x),next_payment_date:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`)))),product:pp,status:mp}).annotate({identifier:`RevenueCatSubscriptionView`}),gp=R({end_date:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`)))),is_trial:N,start_date:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`))))}).annotate({identifier:`StripeCurrentPaymentPhaseView`}),_p=class extends F([`day`,`week`,`month`,`year`]){},vp=R({amount_cents:w,end_date:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`)))),start_date:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`))))}).annotate({identifier:`StripeNextPaymentPhaseView`}),yp=R({brand:x,exp_month:w,exp_year:w,last_4:x}).annotate({identifier:`StripePaymentMethodCardView`}),bp=R({card:E(yp),created:x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`)))),type:T(`card`)}).annotate({identifier:`StripePaymentMethodView`}),xp=class extends F([`incomplete`,`incomplete_expired`,`trialing`,`active`,`past_due`,`canceled`,`unpaid`,`paused`]){},Sp=R({cancel_at_period_end:N.pipe(D(_(()=>!1))),canceled_date:E(x.pipe(p($t(RegExp(`\\d{4}-\\d{2}-\\d{2}`))))),current_payment_phase:gp,default_amount_cents:w,default_interval:_p,default_interval_count:w,has_active_schedule:N,latest_invoice_payment_intent_client_secret:E(x),next_payment_phase:E(vp),payment_method:E(bp),price_id:x,status:xp}).annotate({identifier:`StripeSubscriptionView`});R({referral_subscription:E(dp).pipe(D(_(()=>null))),revenue_cat_subscription:E(hp),stripe_subscription:E(Sp)});var Cp=class extends F([`en`,`es`,`fr`,`hi`,`it`,`ja`,`pt`,`zh`]){};R({lang:Cp,text:x,voice:M(E(x)).pipe(v(c(O(x)),{decode:b(e=>e.pipe(C(y),S(()=>`Will`))),encode:f()}))}).annotate({identifier:`PostTextToPhonemesRequest`}),R({phonemes:x}),R({email:x,fcm_token:E(x).pipe(D(_(()=>null))),password:x}).annotate({identifier:`PostLoginRequest`}),R({Authorization:x,_id:x,country_code:E(x).pipe(D(_(()=>null))),email:x,fcm_token:E(x).pipe(D(_(()=>null))),firebase_custom_token:x,onboardingStatus:E(x),referral_code:x,status:x});var wp=R({email:x,first_name:E(x),last_name:E(x)}).annotate({identifier:`ReferralListItem`});R({referrals:I(wp)}),R({random_password:M(E(N)).pipe(v(c(O(N)),{decode:b(e=>e.pipe(C(y),S(()=>!1))),encode:f()}))}),R({email:x,facebook_click_cookie:E(x).pipe(D(_(()=>null))),facebook_click_id:E(x).pipe(D(_(()=>null))),facebook_pixel_cookie:E(x).pipe(D(_(()=>null))),fcm_token:E(x).pipe(D(_(()=>null))),firebase_id_token:E(x).pipe(D(_(()=>null))),google_click_id:E(x).pipe(D(_(()=>null))),password:E(x).pipe(D(_(()=>null))),price_id:E(x).pipe(D(_(()=>null))),promo_code:E(x).pipe(D(_(()=>null))),trial_period_days:E(w).pipe(D(_(()=>null))),utm_campaign:E(x).pipe(D(_(()=>null))),utm_content:E(x).pipe(D(_(()=>null))),utm_medium:E(x).pipe(D(_(()=>null))),utm_source:E(x).pipe(D(_(()=>null))),utm_term:E(x).pipe(D(_(()=>null)))}).annotate({identifier:`PostRegisterRequest`}),R({Authorization:x,_id:x,client_secret:E(x).pipe(D(_(()=>null))),country_code:E(x).pipe(D(_(()=>null))),customer_id:E(x).pipe(D(_(()=>null))),email:x,fcm_token:E(x).pipe(D(_(()=>null))),firebase_custom_token:x,random_password:E(x).pipe(D(_(()=>null))),referral_code:x,status:x}),R({message:x,status:x}),R({fcm_token:x}).annotate({identifier:`PostSetFcmTokenRequest`}),R({referral_code:x}).annotate({identifier:`PostSetReferredByCodeRequest`});var Tp=R({has_active_referral_subscription:N,has_active_stripe_subscription:N,is_active_subscription:N}).annotate({identifier:`UserMetering`}),Ep=R({is_complete:N}).annotate({identifier:`UserOnboarding`}),Dp=R({voice:x}).annotate({identifier:`UserPreferences`}),Op=R({first_name:E(x),last_name:E(x)}).annotate({identifier:`UserProfile`});R({country_code:E(x).pipe(D(_(()=>null))),email:x,firebase_custom_token:E(x).pipe(D(_(()=>null))),firebase_uid:E(x).pipe(D(_(()=>null))),id:x,metering:Tp,onboarding:Ep,preferences:Dp,profile:Op,referral_code:E(x).pipe(D(_(()=>null))),referred_by:E(x).pipe(D(_(()=>null)))});var kp=class extends F([`created_at`,`played_at`]){},Ap=class extends F([`initializing`,`processingPDF`,`completedExtraction`,`complete`,`deleted`,`Error`]){},jp=class extends F([`initializing`,`processingPDF`,`completedExtraction`,`complete`,`deleted`,`Error`]){};R({cursor:M(E(x)).pipe(v(c(O(x)),{decode:b(e=>e.pipe(C(y),S(()=>``))),encode:f()})),sort_by:M(E(kp)).pipe(v(c(O(kp)),{decode:b(e=>e.pipe(C(y),S(()=>`created_at`))),encode:f()})),status:E(A([I(Ap),Ap])).pipe(D(_(()=>null))),except_status:M(E(A([I(jp),jp]))).pipe(v(M(O(A([I(jp),jp]))),{decode:b(e=>e.pipe(C(y))),encode:lt()})),folder_id:E(A([x,T(`root`)])).pipe(D(_(()=>null))),if_modified_since_ms:E(w).pipe(D(_(()=>null))),limit:M(E(w.pipe(p(h(1)),p(Gt(20))))).pipe(v(c(O(w.pipe(p(h(1)),p(Gt(20))))),{decode:b(e=>e.pipe(C(y),S(()=>20))),encode:f()}))});var Mp=class extends F([`initializing`,`processingPDF`,`completedExtraction`,`complete`,`deleted`,`Error`]){},Np=class extends F([`HTML`,`PDF`,`DOC`,`DOCX`,`PPT`,`PPTX`,`TXT`,`MD`,`RTF`,`EPUB`,`MOBI`,`EMAIL`,`EMAIL_ATTACHMENT`]){},Pp=class extends F([`pending`,`processing`,`completed`,`failed`]){}
1,Fp=R({finished_at_ms:E(w).pipe(D(_(()=>null))),started_at_ms:w,status:M(E(Pp)).pipe(v(c(O(Pp)),{decode:b(e=>e.pipe(C(y),S(()=>`pending`))),encode:f()})),url:E(x).pipe(D(_(()=>null))),version:M(E(w)).pipe(v(c(O(w)),{decode:b(e=>e.pipe(C(y),S(()=>1413))),encode:f()})),voice:x}).annotate({identifier:`TtsCacheVoicesData`}),Ip=R({chapter_details_s3_url:E(x).pipe(D(_(()=>null))),tts_finalized_details:M(E(I(Fp))).pipe(v(M(O(I(Fp))),{decode:b(e=>e.pipe(C(y))),encode:lt()}))}).annotate({identifier:`AudioConversionFinalizedMetadata`}),Lp=class extends F([`en`,`es`,`fr`,`hi`,`it`,`ja`,`pt`,`zh`]){},Rp=R({chapter_id:x,chapter_title:x,estimated_percent_complete:w,timestamp_ms:w,tts_batch_version:w,tts_id:E(x),updated_at_ms:E(w)}).annotate({identifier:`AudioConversionProgress`}),zp=R({emails:M(E(I(x))).pipe(v(M(O(I(x))),{decode:b(e=>e.pipe(C(y))),encode:lt()})),user_ids:M(E(I(x))).pipe(v(M(O(I(x))),{decode:b(e=>e.pipe(C(y))),encode:lt()}))}).annotate({identifier:`SharedWith`}),Bp=class extends F([`default_conversion`,`copyright_risk`]){},Vp=class extends F([`private`,`public`,`selective_share`]){},Hp=R({shared_with:M(E(zp)).pipe(v(M(O(zp)),{decode:b(e=>e.pipe(C(y))),encode:lt()})),unshareable_reason:E(Bp).pipe(D(_(()=>null))),visibility:M(E(Vp)).pipe(v(c(O(Vp)),{decode:b(e=>e.pipe(C(y),S(()=>`private`))),encode:f()}))}).annotate({identifier:`SharingInfo`}),Up=R({color:x,label:x}).annotate({identifier:`AudioConversionTag`}),Wp=R({archived_at_ms:E(w).pipe(D(_(()=>null))),conversion_status:Mp,cover_img_url:E(x),created_at_ms:w,document_type:E(Np).pipe(D(_(()=>null))),document_url:E(x),error:E(x),finalized_metadata:E(Ip).pipe(D(_(()=>null))),folder_id:E(x).pipe(D(_(()=>null))),folder_path:I(x),id:x,language:E(Lp),owner_id:x,page_count:E(w),progress:E(Rp),sharing:M(E(Hp)).pipe(v(M(O(Hp)),{decode:b(e=>e.pipe(C(y))),encode:lt()})),tags:I(Up),title:E(x),url_slug:E(x).pipe(D(_(()=>null)))}).annotate({identifier:`AudioConversionSummary`});R({audio_conversions:I(Wp),cursor:E(x),tts_finalized_version:w,voice_data_version:w}),R({document_url:x,title:M(x),folder_id:E(x).pipe(D(_(()=>null)))}).annotate({identifier:`PostCreateAudioV2Request`}),R({audio_conversion:Wp});var Gp=class extends F([`private`,`public`,`selective_share`]){};R({shared_with_emails:E(I(x)).pipe(D(_(()=>null))),shared_with_links:E(I(x)).pipe(D(_(()=>null))),shared_with_user_ids:E(I(x)).pipe(D(_(()=>null))),tags:E(I(Up)).pipe(D(_(()=>null))),description:E(x).pipe(D(_(()=>null))),title:E(x).pipe(D(_(()=>null))),visibility:E(Gp).pipe(D(_(()=>null)))}).annotate({identifier:`PatchUpdateAudioV2Request`}),R({audio_conversion:Wp}),R({voice:x}).annotate({identifier:`PostFinalizeAudioV2Request`}),R({audio_conversion:Wp}),R({audio_conversion:Wp}),R({cursor:M(E(x)).pipe(v(c(O(x)),{decode:b(e=>e.pipe(C(y),S(()=>``))),encode:f()})),limit:M(E(w.pipe(p(h(1)),p(Gt(4))))).pipe(v(c(O(w.pipe(p(h(1)),p(Gt(4))))),{decode:b(e=>e.pipe(C(y),S(()=>4))),encode:f()}))});var Kp=class extends F([`pending`,`scheduled`,`inProgress`,`completed`,`failed`]){},qp=R({page:w}).annotate({identifier:`ChapterBbox`}),Jp=R({end:w,start:w}).annotate({identifier:`ChapterTimestampMs`}),Yp=R({bboxes:I(qp),text:x,timestamp_ms:E(Jp),tts_hash_id:E(x)}).annotate({identifier:`ChapterWord`}),Xp=R({bboxes:I(qp),timestamp_ms:E(Jp),words:I(Yp)}).annotate({identifier:`ChapterSentence`}),Zp=R({bboxes:I(qp),sentences:I(Xp),timestamp_ms:E(Jp)}).annotate({identifier:`ChapterParagraph`}),Qp=R({audio_url:E(x),audio_url_status:Kp,avg_estimated_tts_chunk_duration_ms:w,avg_paragraph_word_length:w,bbox_pages:I(w),id:x,index:w,num_paragraphs:w,paragraphs:I(Zp),timestamp_ms:E(Jp),title:x,tts_batch_version:w,tts_ids:I(x)}).annotate({identifier:`ChapterDetail`});R({chapters:I(Qp),cursor:E(x)});var $p=class extends F([`pending`,`scheduled`,`inProgress`,`completed`,`failed`]){},em=R({audio_url:E(x),audio_url_status:$p,avg_estimated_tts_chunk_duration_ms:w,avg_paragraph_word_length:w,bbox_pages:I(w),id:x,index:w,num_paragraphs:w,title:x,tts_batch_version:w,tts_ids:I(x)}).annotate({identifier:`ChapterSummary`}),tm=class extends F([`initializing`,`processingPDF`,`completedExtraction`,`complete`,`deleted`,`Error`]){},nm=class extends F([`HTML`,`PDF`,`DOC`,`DOCX`,`PPT`,`PPTX`,`TXT`,`MD`,`RTF`,`EPUB`,`MOBI`,`EMAIL`,`EMAIL_ATTACHMENT`]){},rm=class extends F([`en`,`es`,`fr`,`hi`,`it`,`ja`,`pt`,`zh`]){},im=R({archived_at_ms:E(w).pipe(D(_(()=>null))),chapters:E(I(em)),conversion_status:tm,cover_img_url:E(x),created_at_ms:w,document_type:E(nm).pipe(D(_(()=>null))),document_url:E(x),error:E(x),finalized_metadata:E(Ip).pipe(D(_(()=>null))),folder_id:E(x).pipe(D(_(()=>null))),folder_path:I(x),id:x,language:E(rm),owner_id:x,page_count:E(w),progress:E(Rp),sharing:M(E(Hp)).pipe(v(M(O(Hp)),{decode:b(e=>e.pipe(C(y))),encode:lt()})),tags:I(Up),title:E(x),url_slug:E(x).pipe(D(_(()=>null))),voice:x}).annotate({identifier:`AudioConversionDetail`});R({audio_conversion:im}),R({chapter:Qp});var am=R({timestamp_ms:w,tts_id:E(x).pipe(D(_(()=>null)))}).annotate({identifier:`PutUpdateChapterProgressV2Request`});R({voice:E(x).pipe(D(_(()=>null)))});var om=R({end:w,start:w}).annotate({identifier:`TtsTimestampMs`}),sm=R({alignment_timestamps:I(A([om,Tt(x,Ne)])),duration_ms:w,format:T(`mp3`),id:x,text:x,url:x,url_expires_at_ms:w,voice:x,voice_data_version:w}).annotate({identifier:`TtsDetail`});R({tts:sm});var cm=R({id:x,legacy_id:E(x).pipe(D(_(()=>null))),num_items:w,path:I(x),thumbnail_urls:I(x)}).annotate({identifier:`FolderSummary`}),lm=class extends R({folders:I(cm)}){},um=R({audio_conversion_ids:E(I(x)).pipe(D(_(()=>null))),path:I(x)}).annotate({identifier:`PostCreateFolderRequest`}),dm=R({audio_conversion_ids:I(x),child_folder_ids:I(x),id:x,num_items:w,path:I(x),thumbnail_urls:I(x)}).annotate({identifier:`FolderDetail`}),fm=class extends R({folder:dm}){},pm=class extends R({folder:dm}){};R({recursive:M(E(N)).pipe(v(c(O(N)),{decode:b(e=>e.pipe(C(y),S(()=>!1))),encode:f()}))});var mm=class extends R({deleted_conversion_ids:I(x),deleted_folder_ids:I(x)}){},hm=R({audio_conversion_ids:E(I(x)).pipe(D(_(()=>null))),path:E(I(x)).pipe(D(_(()=>null)))}).annotate({identifier:`PatchUpdateFolderRequest`}),gm=class extends R({folder:dm}){};R({text:x}).annotate({identifier:`PostCreateTtsBatchesFromTextRequest`});var _m=R({text:x,tts_id:x}).annotate({identifier:`CreateTtsBatchTextResponseItem`});R({batches:I(_m)}),R({text:x,voice:M(E(x)).pipe(v(c(O(x)),{decode:b(e=>e.pipe(C(y),S(()=>`Will`))),encode:f()}))}).annotate({identifier:`PostDemoTtsBatchesFromTextRequest`}),R({tts:sm}),R({voice:E(x).pipe(D(_(()=>null)))}),R({tts:sm});var vm=class extends F([`male`,`female`]){},ym=class extends F([`en`,`es`,`fr`,`hi`,`it`,`ja`,`pt`,`zh`]){},bm=class extends F(`af_alloy.af_aoede.af_bella.af_heart.af_jadzia.af_jessica.af_kore.af_nicole.af_nova.af_river.af_sarah.af_sky.af_v0.af_v0bella.af_v0irulan.af_v0nicole.af_v0sarah.af_v0sky.am_adam.am_echo.am_eric.am_fenrir.am_liam.am_michael.am_onyx.am_puck.am_santa.am_v0adam.am_v0gurney.am_v0michael.bf_alice.bf_emma.bf_lily.bf_v0emma.bf_v0isabella.bm_daniel.bm_fable.bm_george.bm_lewis.bm_v0george.bm_v0lewis.ef_dora.em_alex.em_santa.ff_siwis.hf_alpha.hf_beta.hm_omega.hm_psi.if_sara.im_nicola.jf_alpha.jf_gongitsune.jf_nezumi.jf_tebukuro.jm_kumo.pf_dora.pm_alex.pm_santa.zf_xiaobei.zf_xiaoni.zf_xiaoxiao.zf_xiaoyi.zm_yunjian.zm_yunxi.zm_yunxia.zm_yunyang`.split(`.`)){},xm=class extends F([`soft`,`moderate`,`deep`]){},Sm=R({gender:vm,image_url:x,is_free:M(E(N)).pipe(v(c(O(N)),{decode:b(e=>e.pipe(C(y),S(()=>!1))),encode:f()})),lang:ym,model_id:bm,name:x,sample_url:x,softness:M(E(xm)).pipe(v(c(O(xm)),{decode:b(e=>e.pipe(C(y),S(()=>`moderate`))),encode:f()}))}).annotate({identifier:`VoiceSummary`});R({voices:I(Sm)});
1var Cm=R({chapterId:x.annotate({description:`Chapter ID`})}),wm=J(`GetChapter`,`/:chapterId`,{params:Cm,success:Nd.pipe(q(200)),error:[H,B,Er,V]}).middleware(Mu).annotate(Z,`Get Chapter`).annotate(X,`Get a single chapter by ID with full paragraph/sentence/word details.`),Tm=eu(`UpdateChapterProgress`,`/:chapterId/progress`,{params:Cm,payload:R({...am.fields,progress_age_ms:M(w.check(h(0)))}),success:m.pipe(q(204)),error:[H,V]}).middleware($).annotate(Z,`Update Chapter Progress`).annotate(X,`Set the user's current audio position within this chapter (in milliseconds).`),Em=Q(`Chapter`).add(wm).add(Tm).prefix(`/v2/chapter`),Dm=x.pipe(v(N,ft({decode:e=>e===`true`,encode:e=>e?`true`:`false`}))),Om=R({recursive:M(Dm)}),km=R({...hm.fields,audio_conversion_ids:E(I(x).pipe(p(Ln(500)))).pipe(D(g(null)))}).annotate({identifier:`UpdateFolderRequest`}),Am=J(`ListFolders`,`/`,{success:lm,error:V}).middleware($).annotate(Z,`List all folders`).annotate(X,`List all folders for the current user. Not paginated since users have a folder limit.`),jm=Y(`CreateFolder`,`/`,{payload:um,success:fm,error:[U,Dr,V]}).middleware($).annotate(Z,`Create a new folder`).annotate(X,`Create a new folder at the specified path. Parent folders must already exist. Optionally move audio items to the new folder.`),Mm=J(`GetFolder`,`/:folderId`,{params:R({folderId:x}),success:pm,error:[U,H,V]}).middleware($).annotate(Z,`Get folder details`).annotate(X,`Get details for a single folder including child folders and audio items. Use "root" as folderId to get the root folder.`),Nm=tu(`UpdateFolder`,`/:folderId`,{params:R({folderId:x}),payload:km,success:gm,error:[U,Dr,H,V]}).middleware($).annotate(Z,`Update a folder`).annotate(X,`Update folder path (rename/move) or move audio items to this folder. Use "root" as folderId to move items to the root folder.`),Pm=nu(`DeleteFolder`,`/:folderId`,{params:R({folderId:x}),query:Om,success:mm,error:[U,H,V]}).middleware($).annotate(Z,`Delete a folder`).annotate(X,`Delete a folder. By default moves contents to parent folder. Use ?recursive=true to delete the folder and all its contents.`),Fm=Q(`Folder`).add(Am).add(jm).add(Mm).add(Nm).add(Pm).prefix(`/v2/folders`),Im=R({id:x,legacy_id:E(x).pipe(D(g(null))),title:x,body:x,audio_conversion_id:x,user_id:x,created_at_ms:w,updated_at_ms:w,chapter_id:E(x).annotate({de
1scription:`DEPRECATED: legacy chapter note anchor. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),chapter_audio_offset_ms:E(w).annotate({description:`DEPRECATED: legacy chunk-relative note offset. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),chapter_word_offset:E(w).annotate({description:`DEPRECATED: legacy chapter word offset. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),tts_id:E(x).annotate({description:`DEPRECATED: legacy stored TTS chunk ID. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),doc_pack_page:E(w).pipe(D(g(null))),doc_pack_char_start:E(w).pipe(D(g(null))),doc_pack_char_end:E(w).pipe(D(g(null))),deleted_at_ms:E(w)}),Lm=R({id:M(x),title:x,body:x,audio_conversion_id:x,created_at_ms:M(w),chapter_id:M(E(x)).annotate({description:`DEPRECATED: legacy chapter note anchor. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),chapter_audio_offset_ms:M(E(w)).annotate({de
1scription:`DEPRECATED: legacy chunk-relative note offset. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),chapter_word_offset:M(E(w)).annotate({description:`DEPRECATED: legacy chapter word offset. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),tts_id:M(E(x)).annotate({description:`DEPRECATED: legacy stored TTS chunk ID. New notes should use doc-pack page/char fields.`,jsonSchema:{deprecated:!0}}),doc_pack_page:M(E(w)),doc_pack_char_start:M(E(w)),doc_pack_char_end:M(E(w))}),Rm=x.pipe(v(N,ft({decode:e=>e===`true`,encode:e=>e?`true`:`false`}))),zm=R({audio_conversion_id:M(x),cursor_id:M(x),limit:M(L),include_deleted:M(Rm)}),Bm=R({notes:I(Im),cursor_id:E(x)}),Vm=J(`ListNotes`,`/`,{query:zm,success:R({status:T(`success`),data:Bm}),error:[U,V]}).middleware($).annotate(Z,`List notes`).annotate(X,`List notes for the current user. Supports filtering by audio_conversion_id and cursor-based pagination.`),Hm=Y(`UpsertManyNotes`,`/upsert-many`,{payload:R({notes:I(Lm)}),success:R({data:I(Im)}),error:[U,H,V]}).middleware($).annotate(Z,`Upsert notes`).annotate(X,`Batch create or update notes. Notes with an id field are updated; notes without are created. Max 50 notes per request, max 5KB per note.`),Um=nu(`DeleteNote`,`/:noteId`,{params:R({noteId:x}),success:m.pipe(q(204)),error:[H,V]}).middleware($).annotate(Z,`Delete a note`).annotate(X,`Soft-delete a note by setting deleted_at.`),Wm=Q(`Note`).add(Vm).add(Hm).add(Um).prefix(`/notes`),Gm=R({text:x,box:ae([j,j,j,j]).annotate({de
1scription:`Pixel-space box [x1, y1, x2, y2], top-left origin.`}),char_start:w,char_end:w,confidence:j}).annotate({identifier:`OcrWordBox`,description:`A recognized word with its pixel-space box and char span into the page text.`}),Km=R({text:x,words:I(Gm),width:w,height:w}).annotate({identifier:`OcrExtractResponse`,description:`Recognized page text plus per-word pixel-space boxes.`}),qm=l(20),Jm=Pe(`listening/api-contract/RequestTimeout`,{defaultValue:()=>qm}),Ym=Y(`Extract`,`/ocr`,{payload:Ue.pipe(ml({contentType:`image/png`})),success:Km,error:[U,wr,B,Tr]}).middleware($).annotate(Z,`OCR a page image`).annotate(Jm,l(90)).annotate(X,`Synchronously OCR a single page image (PNG) into text plus pixel-space per-word boxes. Persists nothing.`),Xm=Q(`Ocr`).add(Ym).prefix(`/v2`),Zm=Y(`GetUploadUrl`,`/get-upload-url`,{payload:R({filename:x.annotate({description:`The filename with extension (e.g., "my-document.pdf"). Extension determines Content-Type.`})}),success:R({status:T(`success`),signed_upload_url:x.annotate({description:`The presigned URL to POST the file to`}
1),fields:nt(R({key:x.annotate({description:`The S3 object key (path) where the file will be stored`}),"Content-Type":x.annotate({description:`MIME type of the file`}),"Content-Disposition":x.annotate({description:`Attachment disposition with original filename`})}),[Tt(x,x)])}).pipe(q(200)),error:[U,V]}).middleware($).annotate(Z,`Get Upload URL`).annotate(X,`Get a presigned URL for uploading a document to S3. After uploading, use the S3 URL with CreateAudio to start conversion.`),Qm=Q(`Pdf`).add(Zm).prefix(`/pdf`),$m=Y(`MailgunWebhook`,`/mailgun-webhook`,{success:m.pipe(q(204)),error:V}).annotate(Z,`Mailgun email webhook`).annotate(X,`Receives forwarded emails from Mailgun. Verifies HMAC signature, extracts attachments or email body, and triggers audio conversion.`),eh=Q(`Email`).add($m).prefix(`/v2/email`),th=Y(`MobileAppleCallback`,`/apple-callback`,{success:el(303),error:V}).annotate(Z,`Android Apple Sign-In relay`).annotate(X,`Receives Apple's form_post callback for Android and redirects (303) to an intent:// URL that the sign_in_with_apple Flutter plugin's callback Activity listens for. Package ID in the intent URL switches on deploy mode: production maps to io.listening.main, all other modes map to io.listening.main.dev. No auth — the payload is already authenticated by Apple.`),nh=Q(`MobileAuth`).add(th).prefix(`/mobile-auth`),rh=F([`staging`,`production`]),ih=F([`ios`,`android`]),ah=x.pipe(p($t(/^\d+(?:\.\d+){0,3}$/))).annotate({identifier:`DottedVersion`,description:`One to four dot-separated numbers, e.g. 6.1.1.`}),oh=R({minimumVersion:E(ah)}).annotate({identifier:`MobileMinimumVersionResponse`,title:`Mobile minimum supported version`}),sh=J(`GetMinimumVersion`,`/minimum-version`,{query:R({channel:rh,platform:ih}),success:oh.pipe(q(200))}).annotate(Z,`Mobile minimum supported version`).annotate(X,[`The lowest NATIVE app version allowed to run, for one (channel, platform) pair.`,`The mobile client replaces itself with an "Update required" screen when its`,"installed binary version is below this. `null` never blocks.",``,"This replaces reading the `[:mav:]` (App Store) / `[Minimum supported app","version:]` (Play) tags out of the store listings. The App Store description is",`only editable as part of a new version submission, so that tag could never be`,`changed during an incident, and the Play tag was being sliced out of`,`undocumented HTML that fails open whenever Google reshuffles the page.`,``,`The floors are a hardcoded table in the api`,"(`@listening/backend/mobile-release/minimum-version`); changing one is a deploy.",`Nothing here governs OTA updates — an OTA does not move the version compared`,"here, and a bad OTA payload is rolled back with `publish-ota repoint` instead.",``,`Public and unauthenticated (a blocked install may have no session) and global`,`rather than per-user, so unlike Analytics.Bootstrap it is CDN-cacheable.`,`It cannot fail: the answer is a constant lookup.`].join(`
2`)),ch=Q(`MobileRelease`).add(sh).prefix(`/mobile-release`),lh=J(`GetExpoManifest`,`/manifest`,{success:Ue.pipe(ml({contentType:`multipart/mixed`}),q(200)),error:V}).annotate(Z,`Expo Updates manifest`).annotate(X,[`Serves the OTA update manifest for a single (channel, platform, runtimeVersion)`,`triple, per the Expo Updates protocol v1.`,``,"**Request headers** (set by the `expo-updates` client, not by hand):","`expo-protocol-version` (must be `1`), `expo-platform` (`ios` | `android`),","`expo-channel-name` (`staging` | `production`), `expo-runtime-version`","(an `@expo/fingerprint` hash), and optionally `expo-current-update-id`,","`expo-expect-signature`, and `eas-client-id` (the sticky key for staged rollout).",``,"**Response** is always `multipart/mixed` with a single part:","a `manifest` part carrying an `ExpoManifest` body when an update applies, or a","`directive` part carrying an `ExpoDirective` body (`noUpdateAvailable`) when the",`device is already on the pointer head, no pointer exists, or a staged rollout put`,"this device in the holdback bucket. When the client sends `expo-expect-signature`,","the part carries an `expo-signature` header (RSA PKCS#1 v1.5 over the exact part bytes).",``,"Errors: `400` unsupported/invalid protocol headers, `406` the client cannot accept","`multipart/mixed`, `500` signing is required but no signing key is configured."].join(`
3`)).annotate(vu,e=>({...e,responses:{...e.responses,200:{...e.responses?.[`200`],description:"multipart/mixed with a single part — `manifest` when an update applies, `directive` otherwise. Signed via the part-level `expo-signature` header when the client sends `expo-expect-signature`."}}})),uh=Q(`MobileUpdates`).add(lh).prefix(`/mobile-updates`),dh=Sp.pipe(we({pricing_variant:M(E(x))})),fh=R({variant:x,enrolled:N}),ph=J(`GetSubscriptions`,`/subscriptions`,{success:R({referral_subscription:E(dp).pipe(D(g(null))),revenue_cat_subscription:E(hp),stripe_subscription:E(dh),pricing_arm:M(E(fh))}),error:V}).middleware($).annotate(Z,`Get user subscriptions`).annotate(X,`Returns the current user subscription status across all payment platforms including Stripe, RevenueCat, and referral subscriptions, plus the pricing-test arm this account is currently quoted at.`),mh=Q(`Payments`).add(ph).prefix(`/payment`),hh=J(`GetPaymentDetails`,`/getPaymentDetails`,{success:A([R({status:T(`success`),nextPaymentDate:x}),R({status:T(`failed`)})]),error:V}).middleware($).annotate(Z,`Get payment details (legacy)`).annotate(X,`Returns the next payment date for the user. Legacy DTO shape for web client compat.`),gh=Q(`Money`).add(hh).prefix(`/money`),_h=Y(`StripeWebhook`,`/webhook`,{success:m.pipe(q(204)),error:[U,V]}).annotate(Z,`Stripe webhook`).annotate(X,`Handles Stripe webhook events (customer.subscription.updated, invoice.paid). Verified via Stripe signature.`),vh=Q(`Stripe`).add(_h).prefix(`/stripe`),yh=Y(`RevenueCatWebhook`,`/revenutCat`,{success:m.pipe(q(204)),error:V}).annotate(Z,`RevenueCat webhook`).annotate(X,`Handles RevenueCat webhook events (INITIAL_PURCHASE, RENEWAL, CANCELLATION, PRODUCT_CHANGE, TRANSFER).`),bh=Q(`Webhooks`).add(yh).prefix(`/webhooks`),xh=R({start:w.annotate({de
3scription:`Start time in milliseconds, counting from 0`}),end:w.annotate({description:`End time in milliseconds, counting from 0`})}).annotate({identifier:`TtsTimestampMs`,description:`Start and end timestamp for a word in a TTS chunk.`}),Sh=R({id:x,text:x,url:x,url_expires_at_ms:w.annotate({description:`DEPRECATED: always a far-future constant; URLs are permanent public S3 URLs, not expiring. Do not rely on this field.`,jsonSchema:{type:`integer`,deprecated:!0}}),duration_ms:w,format:T(`mp3`),voice:x,voice_data_version:w,alignment_timestamps:I(xh).annotate({description:`Start and end timestamps for each word in the text, in milliseconds`})}).annotate({identifier:`TtsDetail`,description:`Text-to-speech data for a given chunk of text.`}),Ch=R({text:x,tts_id:x.annotate({description:`DEPRECATED: legacy stored TTS chunk ID. New clients should use stateless synthesize responses directly.`,jsonSchema:{deprecated:!0}})}).annotate({identifier:`CreateTtsBatchTextResponseItem`,description:`DEPRECATED: legacy streamable chunk of text-to-speech content. Use POST /v2/synthesize for new clients.`}),wh=ae([w,w,w]).annotate({identifier:`SynthesizeDocPackRange`,description:`doc-pack range tuple: [page, charStart, charEnd].`}),Th=A([R({mode:T(`reference`).pipe(D(_(()=>`reference`))),doc:x,docPackVersion:w,ranges:I(wh).pipe(p(Ln(256))),voice:M(Kd)}),R({mode:T(`raw-text`),text:x.pipe(p(Ln(1e4))),voice:M(Kd)})]).annotate({identifier:`SynthesizePayload`,description:`Stateless synthesis request. Reference mode resolves text from an doc-pack; raw-text mode is a fallback/testing path.`}),Eh=R({start_ms:w,end_ms:w,page:E(w),char_start:w,char_end:w}).annotate({identifier:`SynthesizeWordTiming`,description:`Word timing keyed to doc-pack page/char offsets in reference mode, or submitted-text offsets in raw-text mode.`}),Dh=R({tts:Sh,words:I(Eh)}).annotate({identifier:`SynthesizeResponse`,description:`Stateless TTS response with audio details and offset timings.`}),Oh=l(90),kh=R({voice:M(Kd)}),Ah=R({tts:Sh}).annotate({identifier:`TtsDetailResponse`,description:`Response envelope carrying a single TTS chunk.`}),jh=R({text:x}).annotate({identifier:`CreateTtsBatchTextRequest`,description:`Request body for batching text into streamable TTS chunks.`}),Mh=R({batches:I(Ch)}).annotate({identifier:`CreateTtsBatchTextResponse`,description:`A list of streamable text-to-speech batches.`}),Nh=R({text:x,voice:M(Kd)}),Ph=J(`GetChapterTts`,`/chapter/:chapterId/tts/:ttsId`,{params:R({chapterId:x.annotate({de
3scription:`Chapter ID`}),ttsId:x.annotate({description:`TTS chunk ID`})}),query:kh,success:Ah.pipe(q(200)),error:[H,B,Tr,V]}).middleware(Mu).annotate(Z,`Get Chapter TTS Chunk (legacy)`).annotate(_u,!0).annotate(X,`Legacy chunk-id based TTS endpoint. New readers should synthesize from doc-pack page/char ranges through POST /v2/synthesize.`).annotate(Jm,Oh),Fh=Y(`BatchText`,`/tts/batch-text`,{payload:jh,success:Mh.pipe(q(200)),error:V}).middleware($).annotate(Z,`Batch Text for TTS (legacy)`).annotate(_u,!0).annotate(X,`Legacy server-owned text chunking endpoint. New clients should use POST /v2/synthesize with reference ranges, or raw-text mode only for fallback/testing.`),Ih=J(`GetTts`,`/tts/:ttsId`,{params:R({ttsId:x.annotate({description:`TTS chunk ID`})}),query:kh,success:Ah.pipe(q(200)),error:[H,Tr,V]}).middleware($).annotate(Z,`Get TTS Chunk (legacy)`).annotate(_u,!0).annotate(X,`Legacy stored-TTS-id endpoint. New readers should synthesize stateless audio through POST /v2/synthesize.`).annotate(Jm,Oh),Lh=Y(`Synthesize`,`/synthesize`,{payload:Th,success:Dh.pipe(q(200)),error:[U,H,B,Tr,V]}).middleware(Mu).annotate(Z,`Synthesize stateless audio`).annotate(X,`Synthesize audio from doc-pack page/char ranges or raw text without stored TTS chunk IDs.`).annotate(Jm,Oh),Rh=Y(`DemoText`,`/tts/demo-text`,{payload:Nh,success:Ah.pipe(q(200)),error:[U,Tr,V]}).annotate(Z,`Demo TTS`).annotate(X,`Unauthenticated demo TTS for homepage. 500 character max.`).annotate(Jm,Oh),zh=Q(`Tts`).add(Ph).add(Fh).add(Ih).add(Lh).add(Rh).prefix(`/v2`),Bh=[`pronunciation`,`citation`,`other`],Vh=R({email:x,password:x,fcm_token:M(E(x))}),Hh=R({email:x,password:M(E(x)),signup_language:M(F([`en`,`es`])),fcm_token:M(E(x)),firebase_id_token:M(E(x)),price_id:M(E(x)),promo_code:M(E(x)),trial_period_days:M(E(w)),facebook_click_cookie:M(E(x)),facebook_click_id:M(E(x)),facebook_pixel_cookie:M(E(x)),google_click_id:M(E(x)),utm_campaign:M(E(x)),utm_content:M(E(x)),utm_medium:M(E(x)),utm_source:M(E(x)),utm_term:M(E(x))}),Uh=R({Authorization:x,id:x,email:x,status:x,firebase_custom_token:x,referral_code:x,onboardingStatus:E(x),country_code:E(x).pipe(D(g(null))),fcm_token:E(x).pipe(D(g(null)))}),Wh=R({Authorization:x,id:x,email:x,status:x,firebase_custom_token:x,referral_code:x,country_code:E(x).pipe(D(g(null))),fcm_token:E(x).pipe(D(g(null))),client_secret:E(x).pipe(D(g(null))),customer_id:E(x).pipe(D(g(null))),random_password:E(x).pipe(D(g(null)))}),Gh=R({has_active_referral_subscription:N,has_active_stripe_subscription:N,has_active_rc_subscription:N.pipe(D(g(!1))),is_active_subscription:N}),Kh=R({is_complete:N}),qh=R({voice:x,most_recent_language:M(F([`en`,`es`]))}),Jh=R({first_name:E(x),last_name:E(x)}),Yh=R({id:x,email:x,created_at:E(Ot).pipe(D(g(null))),metering:Gh,onboarding:Kh,preferences:qh,profile:Jh,country_code:E(x).pipe(D(g(null))),firebase_custom_token:E(x).pipe(D(g(null))),firebase_uid:E(x).pipe(D(g(null))),referral_code:E(x).pipe(D(g(null))),referred_by:E(x).pipe(D(g(null)))}),Xh=x.pipe(v(N,ft({decode:e=>e===`true`,encode:e=>e?`true`:`false`}))),Zh=R({random_password:M(Xh)}),Qh=R({first_name:E(x),last_name:E(x),dob:M(E(x))}),$h=R({status:x,data:Qh}),eg=R({updates:R({first_name:M(x),last_name:M(x)})}),tg=R({voice:x,most_recent_language:M(F([`en`,`es`]))}),ng=R({updates:R({voice:M(x),most_recent_language:M(F([`en`,`es`]))})}),rg=Y(`Login`,`/login`,{payload:Vh,success:Uh,error:[B,V]}).annotate(Z,`Login with email and password`).annotate(X,`Authenticate a user with email and password. Returns a JWT token for subsequent requests.`),ig=Y(`Register`,`/register`,{query:Zh,payload:Hh,success:Wh,error:[Dr,U,V]}).annotate(Z,`Register a new user`).annotate(X,`Create a new user account. Returns a JWT token and user info. Returns 409 if email already exists, 400 for validation errors.`),ag=J(`Summary`,`/summary`,{success:Yh.pipe(we({customer_id:E(x)})),error:V}).middleware($).annotate(Z,`Get current user summary`).annotate(X,`Returns the current authenticated user info including metering, preferences, profile, and Stripe customer_id.`),og=Y(`ResyncBilling`,`/billing/resync`,{success:m.pipe(q(204)),error:V}).middleware($).annotate(Z,`Re-sync the current user billing state now`),sg=J(`GetProfile`,`/profile`,{success:$h,error:V}).middleware($).annotate(Z,`Get user profile`),cg=tu(`UpdateProfile`,`/profile`,{payload:eg,success:$h,error:V}).middleware($).annotate(Z,`Update user profile`),lg=J(`GetPreferences`,`/preferences`,{success:tg,error:V}).middleware($).annotate(Z,`Get user preferences`),ug=Y(`UpdatePreferences`,`/preferences`,{payload:ng,success:m.pipe(q(204)),error:[U,V]}).middleware($).annotate(Z,`Update user preferences`),dg=Y(`SetFcmToken`,`/set-fcm-token`,{payload:R({fcm_token:x}),success:m.pipe(q(204)),error:[Dr,V]}).middleware($).annotate(Z,`Set FCM push notification token`),fg=F([`INFLUENCER`,`PODCAST`,`INSTAGRAM_OR_FACEBOOK`,`YOUTUBE_AD`,`SEARCH_ENGINE`,`WORD_OF_MOUTH`,`OTHER`]),pg=Y(`PostPurchaseSurvey`,`/post-purchase-survey`,{payload:R({data:R({acquisition_source:fg,details:M(x)})}),success:m.pipe(q(204)),error:[Dr,V]}).middleware($).annotate(Z,`Submit post-purchase survey`),mg=J(`ReferralList`,`/referral-list`,{success:R({referrals:I(R({email:x,first_name:E(x),last_name:E(x)}))}),error:V}).middleware($).annotate(Z,`List users referred by the current user`),hg=Y(`Feedback`,`/feedback`,{payload:R({user_message:x,report_type:M(F(Bh)),audio_conversion_id:M(x),paragraph_index:M(w),audio_url:M(x),chapter_id:M(x),raw_text:M(x),timecode:M(j)}),success:R({status:x}),error:V}).middleware($).annotate(Z,`Submit feedback or report`),gg=Y(`PostCancelSurvey`,`/post-cancel-survey`,{payload:R({data:R({is_user_deleted:N,user_cancel_reason:x,user_liked_features:x})}),success:m.pipe(q(204)),error:V}).middleware($).annotate(Z,`Submit post-cancel survey`),_g=Y(`SetReferredBy`,`/set-referred-by`,{payload:R({referral_code:x}),success:m.pipe(q(204)),error:[U,H,Dr,V]}).middleware($).annotate(Z,`Set referral code for current user`),vg=Y(`ForgotPassword`,`/forgotPassword`,{payload:R({email:x}),success:R({status:x}),error:V}).annotate(Z,`Request password reset code`),yg=Y(`ForgotPasswordVerifyCode`,`/forgotPasswordVerifyCode`,{payload:R({email:x,code:x,password:x}),success:Uh,error:[U,H,V]}).annotate(Z,`Verify reset code and set new password`),bg=Y(`UpdatePassword`,`/update-password`,{payload:R({data:R({old_password:x,new_password:x})}),success:m.pipe(q(204)),error:[B,U,V]}).middleware($).annotate(Z,`Update password (authenticated)`),xg=Y(`DeleteUser`,`/deleteUser`,{success:m.pipe(q(204)),error:V}).middleware($).annotate(Z,`Delete current user account`),Sg=Q(`User`).add(rg).add(ig).add(ag).add(og).add(sg).add(cg).add(lg).add(ug).add(dg).add(pg).add(hg).add(gg).add(mg).add(_g).add(vg).add(yg).add(bg).add(xg).prefix(`/user`),Cg=J(`ListVoices`,`/voices`,{success:Jd.pipe(q(200)),error:V}).annotate(Z,`List Available Voices`).annotate(X,`Get all available voices for text-to-speech synthesis.`),wg=Q(`Voices`).add(Cg).prefix(`/v2`),Tg=R({publicId:x,slug:x,title:E(x),description:E(x),language:E(x),category:E(x),c
3overImageUrl:E(x),publishingAuthor:E(x),publishingYear:E(w),createdAtMs:w}),Eg=R({category:x}),Dg=R({items:I(Tg),cursor:E(x),page:w.pipe(D(g(1))),limit:w.pipe(D(g(50))),totalItems:w.pipe(D(g(0))),totalPages:w.pipe(D(g(1))),hasPreviousPage:N.pipe(D(g(!1))),hasNextPage:N.pipe(D(g(!1))),categoryFacets:I(Eg).pipe(D(_(()=>[])))}),Og=J(`ListPublicDocs`,`/`,{query:R({cursor:M(x).annotate({description:`Pagination cursor for the next page`}),page:L.pipe(p(r()),p(h(1)),D(g(1))).annotate({description:`Page number for traditional pagination`}),limit:L.pipe(p(r()),p(h(1)),p(Gt(100)),D(g(50))).annotate({description:`Number of documents to return (1-100, default 50)`}),category:M(x).annotate({description:`Filter by category`}),search:M(x).annotate({description:`Search documents by title`})}),success:Dg.pipe(q(200)),error:[H,V]}).annotate(Z,`List Public Docs`).annotate(X,`List publicly available documents with traditional page pagination. Cursor pagination remains supported for compatibility.`),kg=R({publicId:x,slug:x,title:E(x),description:E(x),summary:E(x),keyPoints:E(x),category:E(x),coverImageUrl:E(x),publishingAuthor:E(x),publishingYear:E(w)}),Ag=J(`GetPublicDoc`,`/:publicId`,{params:R({publicId:x}),success:kg.pipe(q(200)),error:[H,V]}).annotate(Z,`Get Public Doc`).annotate(X,`Get a single public document by its public ID`),jg=R({audioId:x,doc:E(ap)}),Mg=J(`GetDocMetadata`,`/metadata/:slug`,{params:R({slug:x}),success:jg.pipe(q(200)),error:V}).annotate(Z,`Get Doc Metadata`).annotate(X,`Look up curated public document metadata from the static metadata catalog by slug`),Ng=Q(`PublicDoc`).add(Og).add(Ag).add(Mg).prefix(`/v2/public-docs`),Pg=1e4,Fg=26214400,Ig=25e3,Lg=x,Rg=R({text:x,voice:M(Kd),cf_turnstile_token:Lg}),zg=R({document_url:x,fileName:M(x),voice:M(Kd),fileSizeBytes:M(w),cf_turnstile_token:Lg}),Bg=R({filename:x,fileSizeBytes:M(w),cf_turnstile_token:Lg}),Vg=R({status:T(`success`),document_url:x,signed_upload_url:x,fields:nt(R({key:x,"Content-Type":x,"Content-Disposition":x}),[Tt(x,x)])}),Hg=R({url:x,voice:M(Kd),cf_turnstile_token:Lg}),Ug=R({url:x,title:E(x),byline:E(x),site_name:E(x),char_count:w}),Wg=R({text:x,start_ms:w,end_ms:w}),Gg=R({expires_at_ms:w,title:x,source_label:M(x),document_url:M(x),source_url:M(x),text:x,words:I(Wg)}),Kg=R({tool:T(`text-to-audio`),audio_id:M(x),tts:Sh,read_along:M(Gg)}),qg=R({tool:T(`pdf-to-audio`),tts:Sh,audio_id:M(x),source_document_url:M(x),read_along:M(Gg)}),Jg=R({tool:T(`web-to-audio`),audio_id:M(x),article:Ug,tts:Sh,read_along:M(Gg)}),Yg=A([Kg,qg,Jg]),Xg=R({job_id:x,tool:F([`text-to-audio`,`pdf-to-audio`,`web-to-audio`]),status:T(`pending`)}),Zg=R({tool:F([`text-to-audio`,`pdf-to-audio`,`web-to-audio`]),audio_id:x,title:M(x),expires_at_ms:M(w)}),Qg=R({job_id:x,tool:F([`text-to-audio`,`pdf-to-audio`,`web-to-audio`]),status:F([`pending`,`processing`,`completed`,`failed`]),result:E(Yg),partial:M(E(Zg)),error_message:E(x)}),$g=Y(`TextToAudio`,`/text-to-audio`,{payload:Rg,success:Xg.pipe(q(202)),error:[U,yr,Tr,V]}).annotate(Z,`Convert text to audio`).annotate(X,`Unauthenticated text-to-audio endpoint for public SEO tools. Supports up to ${Pg.toString()} characters.`),e_=Y(`PdfToAudio`,`/pdf-to-audio`,{payload:zg,success:Xg.pipe(q(202)),error:[U,yr,Tr,V]}).annotate(Z,`Convert a PDF or Markdown document to audio`).annotate(X,`Unauthenticated document-to-audio endpoint for public SEO tools. Uploaded PDFs and Markdown files are processed through the same document conversion pipeline as the core product.`),t_=Y(`PdfUploadUrl`,`/pdf-upload-url`,{payload:Bg,success:Vg.pipe(q(200)),error:[U,yr,Tr,V]}).annotate(Z,`Get public document upload URL`).annotate(X,`Get a presigned upload URL for the public PDF-to-audio tool. Supports PDF and Markdown files up to ${Fg.toString()} bytes.`),n_=Y(`WebToAudio`,`/web-to-audio`,{payload:Hg,success:Xg.pipe(q(202)),error:[U,yr,Tr,V]}).annotate(Z,`Convert a web article to audio`).annotate(X,`Unauthenticated web-to-audio endpoint for public SEO tools. Supports up to ${Ig.toString()} extracted characters.`),r_=J(`GetJob`,`/jobs/:jobId`,{params:R({jobId:x}),success:Qg.pipe(q(200)),error:[U,H,V]}).annotate(Z,`Get public tool job status`),i_=Q(`PublicTools`).add($g).add(t_).add(e_).add(n_).add(r_).prefix(`/v2/public-tools`),a_=R({configured:T(!0),identifier:x,email:x,name:x,identifierHash:x}),o_=R({configured:T(!1)}),s_=J(`GetIdentity`,`/identity`,{success:A([a_,o_]).pipe(q(200)),error:V}).middleware($).annotate(Z,`Get Support Chat Identity`).annotate(X,`HMAC-signed helpdesk identity for the current user, used by the mobile support chat widget for identity validation. Returns configured: false when the server-side HMAC secret is not set, in which case clients fall back to anonymous chat.`),c_=Q(`SupportChat`).add(s_).prefix(`/support-chat`),l_=x.pipe(p($t(/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+.-]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9-]*\.)+[A-Za-z]{2,}$/,{message:`Must be a valid email address`,identifier:`Email`}))),u_=x.pipe(p($t(/^\+[1-9]\d{1,14}$/,{message:`Must be an E.164 phone number, e.g. +15551234567`,identifier:`E164Phone`}))),d_=A([N,x.pipe(v(N,ft({decode:e=>e===`true`,encode:e=>e?`true`:`false`})))]),f_=A([j,L]),p_=A([I(x),x.pipe(v(I(x),ft({decode:e=>
3e.split(`,`).filter(Boolean),encode:e=>e.join(`,`)})))]),m_=(...e)=>{let t=new Set(e);return x.pipe(v(c(F([...e])),ft({decode:e=>t.has(e)?e:void 0,encode:e=>e??``})))},h_=e=>{let t=[];for(let[n,r]of Object.entries(e.fields))__(r)&&t.push(n);return t},g_=e=>e._tag===`Boolean`||e._tag===`Union`&&e.types.some(g_),__=e=>g_(O(e).ast),v_={Email:l_,E164Phone:u_,BooleanOrBooleanFromString:d_,NumberOrNumberFromString:f_,StringArrayOrStringArrayFromCsv:p_,LiteralOrUndefined:m_,getBooleanEnvKeys:h_,schemaInstanceToPlain:e=>({...e})},y_=Y(`Submit`,`/`,{payload:R({email:v_.Email,phone:M(v_.E164Phone)}),success:R({submitted:N}).pipe(q(200)),error:[U,V]}).annotate(Z,`Submit Business Contact`).annotate(X,`Submit a business lead inquiry to the support helpdesk`),b_=Q(`BusinessContact`).add(y_).prefix(`/business-contact`),x_=Y(`SubmitContact`,`/contact`,{payload:R({email:v_.Email,phone:x.pipe(p(gn(7)))}),success:R({ticketId:w}).pipe(q(200)),error:[U,V]}).annotate(Z,`Submit Business Contact (deprecated)`).annotate(X,`DEPRECATED — use POST /api/business-contact. Submits a business lead inquiry as a Zendesk support ticket.`).annotate(_u,!0),S_=Q(`Zendesk`).add(x_).prefix(`/zendesk`),C_=new Set([`application/pdf`,`application/epub+zip`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`,`application/msword`,`application/vnd.ms-powerpoint`,`text/plain`,`text/markdown`,`text/x-markdown`,`text/mdx`,`application/rtf`]),w_=new Set([`imported_file`,`imported_url`]);function T_(e){return e.item_type===`attachment`&&e.link_mode!==null&&w_.has(e.link_mode)&&e.md5!==null&&e.content_type!==null&&C_.has(e.content_type)}function E_(e){if(e.item_type===`attachment`)return T_(e)?{importable:!0}:{importable:!1,reason:e.link_mode!==null&&w_.has(e.link_mode)&&e.md5!==null?`unsupported_type`:`no_file`};if(e.best_attachment===void 0)return e.num_children>0?{importable:!0}:{importable:!1,reason:`no_file`};if(e.best_attachment===null)return{importable:!1,reason:`no_file`};let t=e.best_attachment.content_type;return t!==null&&C_.has(t)?{importable:!0}:{importable:!1,reason:`unsupported_type`}}var D_=A([R({connected:T(!1)}),R({connected:T(!0),display_name:E(x),provider_user_id:x,connected_at:x})]),O_=R({key:x,name:x,parent_collection:E(x),num_items:w,num_collections:w}),k_=R({collections:I(O_),total_results:w,next_start:E(w)}),A_=R({name:x}),j_=R({key:x,item_type:x,title:x,filename:E(x),content_type:E(x),link_mode:E(x),md5:M(E(x)),best_attachment:M(E(R({content_type:E(x),size:E(w)}))),creators:I(A_),date:E(x),num_children:w}),M_=R({items:I(j_),total_results:w,next_start:E(w)}),N_=R({children:I(j_)}),P_=F([`titleCreatorYear`,`everything`]),F_=R({ticket:x}),I_=J(`GetZoteroStatus`,`/status`,{success:D_.pipe(q(200)),error:V}).middleware($).annotate(Z,`Get Zotero connection status`),L_=Y(`CreateZoteroConnectTicket`,`/connect-ticket`,{success:F_.pipe(q(201)),error:V}).middleware($).annotate(Z,`Mint a short-lived Zotero connect ticket`).annotate(X,`Returns a short-lived signed ticket the mobile app passes to /connect (in the system browser, which lacks the app session cookie) to identify the connecting user.`),R_=J(`ConnectZotero`,`/connect`,{query:R({ticket:M(x)}),success:el(302),error:V}).middleware(Mu).annotate(Z,`Initiate Zotero OAuth connection`).annotate(X,`Redirects the user to Zotero to authorize the integration`),z_=J(`ZoteroCallback`,`/callback`,{query:R({oauth_token:M(x),oauth_verifier:M(x),return_to:M(x)}),success:el(302),error:V}).middleware(Mu).annotate(Z,`Zotero OAuth callback`).annotate(X,`Target of the Zotero OAuth redirect; exchanges the token and redirects to settings`),B_=nu(`DisconnectZotero`,`/disconnect`,{success:m.pipe(q(204)),error:V}).middleware($).annotate(Z,`Disconnect Zotero integration`),V_=J(`ListZoteroCollections`,`/collections`,{query:R({start:M(L),limit:M(L)}),success:k_.pipe(q(200)),error:[H,br,kr,V]}).middleware($).annotate(Z,`List a page of the user's Zotero collections`).annotate(X,`Mirrors Zotero's /collections — one paginated page of the full flat collection set, each item carrying its parent's key. The browse dialog loops this endpoint (matching the official Zotero web-library) to assemble the tree client-side, so expand/collapse is instant after first load. Each call is 1:1 with a single Zotero request.`),H_=J(`ListZoteroTopItems`,`/items/top`,{query:R({start:M(L),limit:M(L),q:M(x),qmode:M(P_)}),success:M_.pipe(q(200)),error:[H,br,kr,V]}).middleware($).annotate(Z,`List top-level Zotero items library-wide`).annotate(X,"Mirrors Zotero's /items/top: every top-level item across the library, with optional server-side quick search (`q`/`qmode`). Items are filtered to those importable for audio conversion (no notes; supported standalone attachments only; childless references dropped)."),U_=J(`ListZoteroCollectionTopItems`,`/collections/:collection_key/items/top`,{params:R({collection_key:x}),query:R({start:M(L),limit:M(L),q:M(x),qmode:M(P_)}),success:M_.pipe(q(200)),error:[H,br,kr,V]}).middleware($).annotate(Z,`List top-level items directly in a collection`).annotate(X,`Mirrors Zotero's /collections/:key/items/top: items filed directly in the given collection only. Does NOT recurse into subcollections — that matches the canonical Zotero client UX (browse the tree to reach subfolder contents, or use library-wide search).`),W_=J(`ListZoteroItemChildren`,`/items/:item_key/children`,{params:R({item_
3key:x}),success:N_.pipe(q(200)),error:[H,br,kr,V]}).middleware($).annotate(Z,`List child items of a Zotero item`).annotate(X,"Mirrors Zotero's /items/:key/children. Returns the raw child set (attachments + notes). The import path filters these client-side to supported attachments using `item_type`/`content_type`/`link_mode` on each child."),G_=Q(`Zotero`).add(I_).add(L_).add(R_).add(z_).add(B_).add(V_).add(H_).add(U_).add(W_).prefix(`/v2/integrations/zotero`),K_={"Health and Medicine":[`General Medicine`,`Public Health`,`Global Health`,`Epidemiology`,`Internal Medicine`,`Neurology`,`Oncology`,`Pediatrics`,`Cardiology`,`Mental Health`,`Infectious Diseases`,`Virology`,`Nutrition`,`Healthcare Management`,`Obstetrics and Gynecology`,`Medical Research`,`Health Policy`,`Health Informatics`,`Health Sociology`,`Health Economics`,`Biostatistics`,`Bioinformatics`,`Epigenetics`,`COVID-19 Research`],"Biology and Natural Sciences":[`Biology`,`Natural Sciences`,`Genetics`,`Microbiology`,`Ecology`,`Evolutionary Biology`,`Neuroscience`,`Cognitive Science`,`Biodiversity`,`Conservation Biology`,`Science Metrics`,`Science Communication`],Psychology:[`Clinical Psychology`,`Cognitive Psychology`,`Social Psychology`,`Behavioral Psychology`,`Developmental Psychology`,`Health Psychology`,`Organizational Psychology`],"Social Sciences":[`Sociology`,`Economics`,`Political Science`,`Anthropology`,`Gender Studies`,`Linguistics`,`Sociolinguistics`,`Social Theory`,`Cultural Sociology`,`Sociology of Education`],"Environmental Studies":[`Climate Science`,`Climate Change`,`Sustainability`],Humanities:[`History`,`Ancient History`,`Philosophy`,`Ethics`,`Literature`,`Religion and Spirituality`,`Arts and Culture`],"Technology and Engineering":[`Computer Science`,`Artificial Intelligence`,`Software Engineering`,`Data Science`,`Information Technology`,`Information Science`,`Cybersecurity`],"Business and Finance":[`Management`,`Marketing`,`Entrepreneurship`,`Accounting`,`Investment`,`Corporate Strategy`],"Law and Legal Studies":[`Constitutional Law`,`Criminal Law`,`International Law`,`Intellectual Property`,`Contracts and Regulation`],Education:[`Pedagogy`,`Higher Education`,`Online Learning`,`Curriculum Design`],"Mathematics and Statistics":[`Mathematics`,`Applied Mathematics`,`Statistics`],"Physical Sciences":[`Physics`,`Chemistry`,`Astronomy`,`Earth Sciences`],"Communication and Media":[`Journalism`,`Media Studies`],"Self-Help and Personal Development":[`Productivity`,`Wellness`,`Motivation`],"Fiction and Creative Writing":[`Novel`,`Short Story`,`Poetry`,`Drama`],"Government and Policy":[`Public Policy`,`International Relations`,`Public Administration`],"Interdisciplinary Studies":[],Other:[]},q_=Object.keys(K_);new Map(q_.map(e=>[e.toLowerCase(),e]));var J_=new Map;for(let[e,t]of Object.entries(K_))for(let n of t)J_.set(n,e);function Y_(e){if(!e)return`Other`;let t=e.split(`,`).map(e=>e.trim());for(let e of t)if(e in K_)return e;for(let e of t){let t=J_.get(e);if(t)return t}return`Other`}var X_=`/api`,Z_=Sg.add(Y(`ArchiveUser`,`/archive`,{success:m.pipe(q(200)),error:V}).middleware($).annotate(Z,`Archive User`).annotate(X,`Archive a user. This will archive all audios in a users account.`)),Q_=su(`api`).annotate(X,`Listening API`).add(Ku).add(Yu).add(Tf).add(ip).add(up).add(b_).add(Em).add(eh).add(Fm).add(nh).add(ch).add(uh).add(gh).add(Wm).add(Xm).add(mh).add(Qm).add(Ng).add(i_).add(vh).add(c_).add(zh).add(wg).add(Z_).add(bh).add(S_).add(G_).middleware(Nu).prefix(X_);export{Oc as $,_o as $t,Cl as A,Yo as At,Zc as B,$a as Bt,cd as C,is as Ct,jl as D,Xo as Dt,cu as E,Ho as Et,rl as F,Oo as Ft,Wc as G,Ya as Gt,Jc as H,co as Ht,al as I,wo as It,Uc as J,lo as Jt,Kc as K,oo as Kt,ll as L,ko as Lt,Tl as M,No as Mt,_l as N,Mo as Nt,kl as O,ts as Ot,hl as P,bo as Pt,Dc as Q,ho as Qt,cl as R,Qa as Rt,sd as S,ss as St,du as T,ns as Tt,Xc as U,ro as Ut,qc as V,fo as Vt,Yc as W,no as Wt,Nc as X,mo as Xt,Bc as Y,po as Yt,kc as Z,eo as Zt,Vd as _,yi as _n,lc as _t,E_ as a,Ha as an,pc as at,Gd as b,qr as bn,Fs as bt,Pg as c,Ji as cn,qs as ct,Wf as d,Hi as dn,Gs as dt,Xa as en,Cc as et,Nf as f,Ci as fn,Vs as ft,Ld as g,Di as gn,Qs as gt,qd as h,xi as hn,K as ht,T_ as i,Ia as in,mc as it,El as j,Io as jt,Sl as k,Ko as kt,Ig as l,ga as ln,ic as lt,Fd as m,bi as mn,Zs as mt,K_ as n,Ua as nn,vc as nt,v_ as o,za as on,Hs as ot,Mf as p,_i as pn,Ys as pt,Gc as q,so as qt,Y_ as r,Fa as rn,_c as rt,Fg as s,Ba as sn,Js as st,Q_ as t,ao as tn,Sc as tt,Lf as u,wa as un,Ks as ut,Bd as v,ai as vn,sc as vt,td as w,$o as wt,gd as x,Ur as xn,os as xt,Wd as y,Kr as yn,Is as yt,Qc as z,uo as zt};
4//# sourceMappingURL=api-contract-CCE5gx-b.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.