1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Landing-DX8HZN4T.js","assets/vendor-ui-CmKBJFmb.js","assets/vendor-react-DmLZEbX8.js","assets/clock-B-ZZpgIz.js","assets/headphones-CFwB9h1L.js","assets/vendor-query-X56ZNOSG.js","assets/vendor-supabase-CUHO7gZf.js","assets/Dashboard-Cr77yRNp.js","assets/BookCard-h5jpTlQt.js","assets/badge-DPfDi_e3.js","assets/star-D6g-fh5F.js","assets/zap-CbJpeq1C.js","assets/Library-BzIPnZ1D.js","assets/AchievementBadges-Jr6oMnbk.js","assets/progress-DYEo4jwQ.js","assets/target-CG39nI7z.js","assets/book-CHBxtDsh.js","assets/Search-DNC8tXGF.js","assets/select-BUmNjIUi.js","assets/chevron-down-BN6oqfKy.js","assets/Profile-Cv-KDg0k.js","assets/avatar-cRmDSApN.js","assets/alert-DBuGL0ob.js","assets/credit-card-BmrkxyxQ.js","assets/external-link-gh4X9kwT.js","assets/shield-Bs8mjtjp.js","assets/trash-2-jqBCUT78.js","assets/settings-C7q9zjEL.js","assets/BookDetails-DjNpjIDR.js","assets/shopping-cart-BXUtBYQy.js","assets/Onboarding-ewLBSpl0.js","assets/chevron-left-nI82Gr6A.js","assets/NotFound-cIh3cDPH.js","assets/Subscription-DCTPCCWv.js","assets/index-DzAmrokj.js","assets/shield-check-DAjHRw1A.js","assets/PaymentComingSoon-DcLumCy3.js","assets/Settings-BZh3BEZ5.js","assets/SettingsLayout-D4UKAEGy.js","assets/switch-B-gQBMTU.js","assets/AccountSettings-u4_gaYzG.js","assets/Help-coz0vVax.js","assets/TermsAndConditions-AdrNtvjz.js","assets/RefundPolicy-DGi4hVor.js","assets/PrivacyPolicy-BkZLRPXc.js","assets/ShippingPolicy-D4f8vWyi.js","assets/DeleteAccount-BBVkDyIy.js","assets/OAuthConsent-CEnvww9U.js","assets/AdminDashboard-C3DZzasv.js","assets/AdminLayout-jplVEiGJ.js","assets/AdminBooks-BZCtlod4.js","assets/AdminUsers-CELrv94p.js","assets/copy-Bzp5eEcu.js","assets/AdminSubscriptions--CYhYZWH.js"])))=>i.map(i=>d[i]); 2var Xi=Object.defineProperty;var Ji=(t,e,r)=>e in t?Xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ge=(t,e,r)=>Ji(t,typeof e!="symbol"?e+"":e,r);import{c as Ys,b as ir,u as Se,j as a,B as el,P as we,V as Ks,d as Nn,e as qt,f as He,g as ue,R as tl,h as rl,i as Qs,k as nl,C as Gs,l as sl,S as al,m as Xs,n as Js,o as ol,p as ea,I as ta,q as ra,r as na,s as sa,L as aa,t as oa,v as il,T as ll,w as ia,x as la,O as Tn,y as Cn,z as En,A as Pn,D as An,E as ca,F as da,G as ua,H as fa,W as cl,J as dl}from"./vendor-ui-CmKBJFmb.js";import{a as ma,g as Rn,R as k,r as u,v as ul,L as Ne,u as jt,N as fl,c as Ur,d as In,B as ml,e as hl,f as le}from"./vendor-react-DmLZEbX8.js";import{u as Re,a as Ye,b as rt,Q as pl,c as gl}from"./vendor-query-X56ZNOSG.js";import{c as yl}from"./vendor-supabase-CUHO7gZf.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var ha,ss=ma;ha=ss.createRoot,ss.hydrateRoot;var vl=typeof Element<"u",xl=typeof Map=="function",bl=typeof Set=="function",wl=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function br(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,s;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!br(t[n],e[n]))return!1;return!0}var o;if(xl&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(n=o.next()).done;)if(!e.has(n.value[0]))return!1;for(o=t.entries();!(n=o.next()).done;)if(!br(n.value[1],e.get(n.value[0])))return!1;return!0}if(bl&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(n=o.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(wl&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[n]))return!1;if(vl&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&t.$$typeof)&&!br(t[s[n]],e[s[n]]))return!1;return!0}return t!==t&&e!==e}var _l=function(e,r){try{return br(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const kl=Rn(_l);var Sl=function(t,e,r,n,s,o,i,l){if(!t){var d;if(e===void 0)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,s,o,i,l],f=0;d=new Error(e.replace(/%s/g,function(){return c[f++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}},jl=Sl;const as=Rn(jl);var Nl=function(e,r,n,s){var o=n?n.call(s,e,r):void 0;if(o!==void 0)return!!o;if(e===r)return!0;
2if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var i=Object.keys(e),l=Object.keys(r);if(i.length!==l.length)return!1;for(var d=Object.prototype.hasOwnProperty.bind(r),c=0;c<i.length;c++){var f=i[c];if(!d(f))return!1;var h=e[f],p=r[f];if(o=n?n.call(s,h,p,f):void 0,o===!1||o===void 0&&h!==p)return!1}return!0};const Tl=Rn(Nl);var pa=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(pa||{}),Hr={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},os=Object.values(pa),Ir={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},ga=Object.entries(Ir).reduce((t,[e,r])=>(t[r]=e,t),{}),We="data-rh",Rt={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},It=(t,e)=>{for(let r=t.length-1;r>=0;r-=1){const n=t[r];if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}return null},Cl=t=>{let e=It(t,"title");const r=It(t,Rt.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),r&&e)return r.replace(/%s/g,()=>e);const n=It(t,Rt.DEFAULT_TITLE);return e||n||void 0},El=t=>It(t,Rt.ON_CHANGE_CLIENT_STATE)||(()=>{}),Wr=(t,e)=>e.filter(r=>typeof r[t]<"u").map(r=>r[t]).reduce((r,n)=>({...r,...n}),{}),Pl=(t,e)=>e.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let o=0;o<s.length;o+=1){const l=s[o].toLowerCase();if(t.indexOf(l)!==-1&&n[l])return r.concat(n)}}return r},[]),Al=t=>console&&typeof console.warn=="function"&&console.warn(t),Wt=(t,e,r)=>{const n={};return r.filter(s=>Array.isArray(s[t])?!0:(typeof s[t]<"u"&&Al(`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`),!1)).map(s=>s[t]).reverse().reduce((s,o)=>{const i={};o.filter(d=>{let c;const f=Object.keys(d);for(let p=0;p<f.length;p+=1){const m=f[p],x=m.toLowerCase();e.indexOf(x)!==-1&&!(c==="rel"&&d[c].toLowerCase()==="canonical")&&!(x==="rel"&&d[x].toLowerCase()==="stylesheet")&&(c=x),e.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(c=m)}if(!c||!d[c])return!1;const h=d[c].toLowerCase();return n[c]||(n[c]={}),i[c]||(i[c]={}),n[c][h]?!1:(i[c][h]=!0,!0)}).reverse().forEach(d=>s.push(d));const l=Object.keys(i);for(let d=0;d<l.length;d+=1){const c=l[d],f={...n[c],...i[c]};n[c]=f}return s},[]).reverse()},Rl=(t,e)=>{if(Array.isArray(t)&&t.length){for(let r=0;r<t.length;r+=1)if(t[r][e])return!0}return!1},Il=t=>({baseTag:Pl(["href"],t),bodyAttributes:Wr("bodyAttributes",t),defer:It(t,Rt.DEFER),encode:It(t,Rt.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Wr("htmlAttributes",t),linkTags:Wt("link",["rel","href"],t),metaTags:Wt("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:Wt("noscript",["innerHTML"],t),onChangeClientState:El(t),scriptTags:Wt("script",["src","innerHTML"],t),styleTags:Wt("style",["cssText"],t),title:Cl(t),titleAttributes:Wr("titleAttributes",t),prioritizeSeoTags:Rl(t,Rt.PRIORITIZE_SEO_TAGS)}),ya=t=>Array.isArray(t)?t.join(""):t,Ml=(t,e)=>{const r=Object.keys(t);for(let n=0;n<r.length;n+=1)if(e[r[n]]&&e[r[n]].includes(t[r[n]]))return!0;return!1},Zr=(t,e)=>Array.isArray(t)?t.reduce((r,n)=>(Ml(n,e)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:t,priority:[]},is=(t,e)=>({...t,[e]:void 0}),Ll=["noscript","script","style"],nn=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),va=t=>Object.keys(t).reduce((e,r)=>{const n=typeof t[r]<"u"?`${r}="${t[r]}"`:`${r}`;return e?`${e} ${n}`:n},""),Ol=(t,e,r,n)=>{const s=va(r),o=ya(e);return s?`<${t} ${We}="true" ${s}>${nn(o,n)}</${t}>`:`<${t} ${We}="true">${nn(o,n)}</${t}>`},Dl=(t,e,r=!0)=>e.reduce((n,s)=>{const o=s,i=Object.keys(o).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,f)=>{const h=typeof o[f]>"u"?f:`${f}="${nn(o[f],r)}"`;return c?`${c} ${h}`:h},""),l=o.innerHTML||o.cssText||"",d=Ll.indexOf(t)===-1;return`${n}<${t} ${We}="true" ${i}${d?"/>":`>${l}</${t}>`}`},""),xa=(t,e={})=>Object.keys(t).reduce((r,n)=>{const s=Ir[n];return r[s||n]=t[n],r},e),$l=(t,e,r)=>{const n={key:e,[We]:!0},s=xa(r,n);return[k.createElement("title",s,e)]},wr=(t,e)=>e.map((r,n)=>{const s={key:n,[We]:!0};return Object.keys(r).forEach(o=>{const l=Ir[o]||o;if(l==="innerHTML"||l==="cssText"){const d=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:d}}else s[l]=r[o]}),k.createElement(t,s)}),Oe=(t,e,r=!0)=>{switch(t){case"title":return{toComponent:()=>$l(t,e.title,e.titleAttributes),toString:()=>Ol(t,e.title,e.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>xa(e),toString:()=>va(e)};default:return{toComponent:()=>wr(t,e),toString:()=>Dl(t,e,r)}}},zl=({metaTags:t,linkTags:e,scriptTags:r,encode:n})=>{const s=Zr(t,Hr.meta),o=Zr(e,Hr.link),i=Zr(r,Hr.script);return{priorityMethods:{toComponent:()=>[...wr("meta",s.priority),...wr("link",o.priority),...wr("script",i.priority)],toString:()=>`${Oe("meta",s.priority,n)} ${Oe("link",o.priority,n)} ${Oe("script",i.priority,n)}`},metaTags:s.default,linkTags:o.default,scriptTags:i.default}},Bl=t=>{const{baseTag:e,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:o,styleTags:i,title:l="",titleAttributes:d,prioritizeSeoTags:c}=t;let{linkTags:f,metaTags:h,scriptTags:p}=t,m={toComponent:()=>[],toString:()=>""};return c&&({priorityMethods:m,linkTags:f,metaTags:h,scriptTags:p}=zl(t)),{priority:m,base:Oe("base",e,n),bodyAttributes:Oe("bodyAttributes",r,n),htmlAttributes:Oe("htmlAttributes",s,n),link:Oe("link",f,n),meta:Oe("meta",h,n),noscript:Oe("noscript",o,n),script:Oe("script",p,n),style:Oe("style",i,n),title:Oe("title",{title:l,titleAttributes:d},n)}},sn=Bl,mr=[],Mn=!!(typeof window<"u"&&window.document&&window.document.createElement),an=class{constructor(t,e){Ge(this,"instances",[]);
2Ge(this,"canUseDOM",Mn);Ge(this,"context");Ge(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?mr:this.instances,add:t=>{(this.canUseDOM?mr:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?mr:this.instances).indexOf(t);(this.canUseDOM?mr:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=sn({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Fl=parseInt(k.version.split(".")[0],10),on=Fl>=19,Vl={},ba=k.createContext(Vl),wt,wa=(wt=class extends u.Component{constructor(r){super(r);Ge(this,"helmetData");on?this.helmetData=null:this.helmetData=new an(this.props.context||{},wt.canUseDOM)}render(){return on?k.createElement(k.Fragment,null,this.props.children):k.createElement(ba.Provider,{value:this.helmetData.value},this.props.children)}},Ge(wt,"canUseDOM",Mn),wt),Pt=(t,e)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${t}[${We}]`),s=[].slice.call(n),o=[];let i;return e&&e.length&&e.forEach(l=>{const d=document.createElement(t);for(const c in l)if(Object.prototype.hasOwnProperty.call(l,c))if(c==="innerHTML")d.innerHTML=l.innerHTML;else if(c==="cssText"){const f=l.cssText;d.appendChild(document.createTextNode(f))}else{const f=c,h=typeof l[f]>"u"?"":l[f];d.setAttribute(c,h)}d.setAttribute(We,"true"),s.some((c,f)=>(i=f,d.isEqualNode(c)))?s.splice(i,1):o.push(d)}),s.forEach(l=>{var d;return(d=l.parentNode)==null?void 0:d.removeChild(l)}),o.forEach(l=>r.appendChild(l)),{oldTags:s,newTags:o}},ln=(t,e)=>{const r=document.getElementsByTagName(t)[0];if(!r)return;const n=r.getAttribute(We),s=n?n.split(","):[],o=[...s],i=Object.keys(e);for(const l of i){const d=e[l]||"";r.getAttribute(l)!==d&&r.setAttribute(l,d),s.indexOf(l)===-1&&s.push(l);const c=o.indexOf(l);c!==-1&&o.splice(c,1)}for(let l=o.length-1;l>=0;l-=1)r.removeAttribute(o[l]);s.length===o.length?r.removeAttribute(We):r.getAttribute(We)!==i.join(",")&&r.setAttribute(We,i.join(","))},ql=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=ya(t)),ln("title",e)},ls=(t,e)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:o,metaTags:i,noscriptTags:l,onChangeClientState:d,scriptTags:c,styleTags:f,title:h,titleAttributes:p}=t;ln("body",n),ln("html",s),ql(h,p);const m={baseTag:Pt("base",r),linkTags:Pt("link",o),metaTags:Pt("meta",i),noscriptTags:Pt("noscript",l),scriptTags:Pt("script",c),styleTags:Pt("style",f)},x={},y={};Object.keys(m).forEach(v=>{const{newTags:w,oldTags:_}=m[v];w.length&&(x[v]=w),_.length&&(y[v]=m[v].oldTags)}),e&&e(),d(t,x,y)},Zt=null,Ul=t=>{Zt&&cancelAnimationFrame(Zt),t.defer?Zt=requestAnimationFrame(()=>{ls(t,()=>{Zt=null})}):(ls(t),Zt=null)},Hl=Ul,cs=class extends u.Component{constructor(){super(...arguments);Ge(this,"rendered",!1)}shouldComponentUpdate(e){return!Tl(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:r}=this.props.context;let n=null;const s=Il(e.get().map(o=>{const{context:i,...l}=o.props;return l}));wa.canUseDOM?Hl(s):sn&&(n=sn(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},_r=[],ds=t=>{const e={};for(const r of Object.keys(t))e[ga[r]||r]=t[r];return e},bt=t=>{const e={};for(const r of Object.keys(t)){const n=Ir[r];e[n||r]=t[r]}return e},us=(t,e)=>{if(!Mn)return;const r=document.getElementsByTagName(t)[0];if(!r)return;const n="data-rh-managed",s=r.getAttribute(n),o=s?s.split(","):[],i=Object.keys(e);for(const l of o)i.includes(l)||r.removeAttribute(l);for(const l of i){const d=e[l];d==null||d===!1?r.removeAttribute(l):d===!0?r.setAttribute(l,""):r.setAttribute(l,String(d))}i.length>0?r.setAttribute(n,i.join(",")):r.removeAttribute(n)},Yr=()=>{const t={},e={};for(const r of _r){const{htmlAttributes:n,bodyAttributes:s}=r.props;n&&Object.assign(t,ds(n)),s&&Object.assign(e,ds(s))}us("html",t),us("body",e)},Wl=class extends u.Component{componentDidMount(){_r.push(this),Yr()}componentDidUpdate(){Yr()}componentWillUnmount(){const t=_r.indexOf(this);t!==-1&&_r.splice(t,1),Yr()}resolveTitle(){const{title:t,titleTemplate:e,defaultTitle:r}=this.props;return t&&e?e.replace(/%s/g,()=>Array.isArray(t)?t.join(""):t):t||r||void 0}renderTitle(){const t=this.resolveTitle();if(t===void 0)return null;const e=this.props.titleAttributes||{};return k.createElement("title",bt(e),t)}renderBase(){const{base:t}=this.props;return t?k.createElement("base",bt(t)):null}renderMeta(){const{meta:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>k.createElement("meta",{key:r,...bt(e)}))}renderLink(){const{link:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>k.createElement("link",{key:r,...bt(e)}))}renderScript(){const{script:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...s}=e,o=bt(s);return n&&(o.dangerouslySetInnerHTML={__html:n}),k.createElement("script",{key:r,...o}
2)})}renderStyle(){const{style:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{cssText:n,...s}=e,o=bt(s);return n&&(o.dangerouslySetInnerHTML={__html:n}),k.createElement("style",{key:r,...o})})}renderNoscript(){const{noscript:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...s}=e,o=bt(s);return n&&(o.dangerouslySetInnerHTML={__html:n}),k.createElement("noscript",{key:r,...o})})}render(){return k.createElement(k.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},rn,Zl=(rn=class extends u.Component{shouldComponentUpdate(t){return!kl(is(this.props,"helmetData"),is(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,r,n){return{...e,[t.type]:[...e[t.type]||[],{...r,...this.mapNestedChildrenToProps(t,n)}]}}mapObjectTypeChildren(t,e,r,n){switch(t.type){case"title":return{...e,[t.type]:n,titleAttributes:{...r}};case"body":return{...e,bodyAttributes:{...r}};case"html":return{...e,htmlAttributes:{...r}};default:return{...e,[t.type]:{...r}}}}mapArrayTypeChildrenToProps(t,e){let r={...e};return Object.keys(t).forEach(n=>{r={...r,[n]:t[n]}}),r}warnOnInvalidChildren(t,e){return as(os.some(r=>t.type===r),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${os.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),as(!e||typeof e=="string"||Array.isArray(e)&&!e.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let r={};return k.Children.forEach(t,n=>{if(!n||!n.props)return;const{children:s,...o}=n.props,i=Object.keys(o).reduce((d,c)=>(d[ga[c]||c]=o[c],d),{});let{type:l}=n;
2switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,s),l){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,i,s);break;default:e=this.mapObjectTypeChildren(n,e,i,s);break}}),this.mapArrayTypeChildrenToProps(r,e)}render(){const{children:t,...e}=this.props;let r={...e},{helmetData:n}=e;if(t&&(r=this.mapChildrenToProps(t,r)),n&&!(n instanceof an)){const s=n;n=new an(s.context,!0),delete r.helmetData}return on?k.createElement(Wl,{...r}):n?k.createElement(cs,{...r,context:n.value}):k.createElement(ba.Consumer,null,s=>k.createElement(cs,{...r,context:s}))}},Ge(rn,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),rn);const Yl="modulepreload",Kl=function(t){return"/"+t},fs={},he=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(r.map(d=>{if(d=Kl(d),d in fs)return;fs[d]=!0;const c=d.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Yl,c||(h.as="script"),h.crossOrigin="",h.href=d,l&&h.setAttribute("nonce",l),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return e().catch(o)})},hr="chunk-reload-attempted",Ql=t=>new Promise(e=>setTimeout(e,t));function ve(t){return u.lazy(async()=>{try{const e=await t();return sessionStorage.removeItem(hr),e}catch(e){try{await Ql(600);const s=await t();return sessionStorage.removeItem(hr),s}catch{}if(typeof navigator<"u"&&navigator.onLine===!1)throw e;if(!sessionStorage.getItem(hr)){sessionStorage.setItem(hr,"1");try{if("caches"in window){const o=(await caches.keys()).filter(i=>/(^|-)precache-v\d+-|(^|-)runtime-|^workbox-/.test(i));await Promise.all(o.map(i=>caches.delete(i)))}}catch{}return window.location.reload(),new Promise(()=>{})}throw e}})}const Gl=1,Xl=1e6;let Kr=0;function Jl(){return Kr=(Kr+1)%Number.MAX_SAFE_INTEGER,Kr.toString()}const Qr=new Map,ms=t=>{if(Qr.has(t))return;const e=setTimeout(()=>{Qr.delete(t),sr({type:"REMOVE_TOAST",toastId:t})},Xl);Qr.set(t,e)},ec=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Gl)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?ms(r):t.toasts.forEach(n=>{ms(n.id)}),{...t,toasts:t.toasts.map(n=>
2n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},kr=[];let Sr={toasts:[]};function sr(t){Sr=ec(Sr,t),kr.forEach(e=>{e(Sr)})}function tc({...t}){const e=Jl(),r=s=>sr({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>sr({type:"DISMISS_TOAST",toastId:e});return sr({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function lr(){const[t,e]=u.useState(Sr);return u.useEffect(()=>(kr.push(e),()=>{const r=kr.indexOf(e);r>-1&&kr.splice(r,1)}),[t]),{...t,toast:tc,dismiss:r=>sr({type:"DISMISS_TOAST",toastId:r})}}var Ln="ToastProvider",[On,rc,nc]=Ys("Toast"),[_a,_p]=ir("Toast",[nc]),[sc,Mr]=_a(Ln),ka=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=t,[l,d]=u.useState(null),[c,f]=u.useState(0),h=u.useRef(!1),p=u.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ln}\`. Expected non-empty \`string\`.`),a.jsx(On.Provider,{scope:e,children:a.jsx(sc,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:l,onViewportChange:d,onToastAdd:u.useCallback(()=>f(m=>m+1),[]),onToastRemove:u.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:i})})};ka.displayName=Ln;var Sa="ToastViewport",ac=["F8"],cn="toast.viewportPause",dn="toast.viewportResume",ja=u.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=ac,label:s="Notifications ({hotkey})",...o}=t,i=Mr(Sa,r),l=rc(r),d=u.useRef(null),c=u.useRef(null),f=u.useRef(null),h=u.useRef(null),p=Se(e,h,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;u.useEffect(()=>{const v=w=>{var S;n.length!==0&&n.every(N=>w[N]||w.code===N)&&((S=h.current)==null||S.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),u.useEffect(()=>{const v=d.current,w=h.current;if(x&&v&&w){const _=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(cn);w.dispatchEvent(E),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(dn);w.dispatchEvent(E),i.isClosePausedRef.current=!1}},N=E=>{!v.contains(E.relatedTarget)&&S()},D=()=>{v.contains(document.activeElement)||S()};return v.addEventListener("focusin",_),v.addEventListener("focusout",N),v.addEventListener("pointermove",_),v.addEventListener("pointerleave",D),window.addEventListener("blur",_),window.addEventListener("focus",S),()=>{v.removeEventListener("focusin",_),v.removeEventListener("focusout",N),v.removeEventListener("pointermove",_),v.removeEventListener("pointerleave",D),window.removeEventListener("blur",_),window.removeEventListener("focus",S)}}},[x,i.isClosePausedRef]);const y=u.useCallback(({tabbingDirection:v})=>{const _=l().map(S=>{const N=S.ref.current,D=[N,...vc(N)];return v==="forwards"?D:D.reverse()});return(v==="forwards"?_.reverse():_).flat()},[l]);return u.useEffect(()=>{const v=h.current;if(v){const w=_=>{var D,E,T;const S=_.altKey||_.ctrlKey||_.metaKey;if(_.key==="Tab"&&!S){const P=document.activeElement,C=_.shiftKey;if(_.target===v&&C){(D=c.current)==null||D.focus();return}const M=y({tabbingDirection:C?"backwards":"forwards"}),ae=M.findIndex(B=>B===P);Gr(M.slice(ae+1))?_.preventDefault():C?(E=c.current)==null||E.focus():(T=f.current)==null||T.focus()}};return v.addEventListener("keydown",w),()=>v.removeEventListener("keydown",w)}},[l,y]),a.jsxs(el,{ref:d,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&a.jsx(un,{ref:c,onFocusFromOutsideViewport:()=>{const v=y({tabbingDirection:"forwards"});Gr(v)}}),a.jsx(On.Slot,{scope:r,children:a.jsx(we.ol,{tabIndex:-1,...o,ref:p})}),x&&a.jsx(un,{ref:f,onFocusFromOutsideViewport:()=>{const v=y({tabbingDirection:"backwards"});Gr(v)}})]})});ja.displayName=Sa;var Na="ToastFocusProxy",un=u.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,o=Mr(Na,r);return a.jsx(Ks,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:i=>{var c;const l=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(l))&&n()}})});un.displayName=Na;var cr="Toast",oc="toast.swipeStart",ic="toast.swipeMove",lc="toast.swipeCancel",cc="toast.swipeEnd",Ta=u.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=t,[l,d]=Nn({prop:n,defaultProp:s??!0,onChange:o,caller:cr});return a.jsx(qt,{present:r||l,children:a.jsx(fc,{open:l,...i,ref:e,onClose:()=>d(!1),onPause:He(t.onPause),onResume:He(t.onResume),onSwipeStart:ue(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(t.onSwipeMove,c=>{const{x:f,y:h}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ue(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(t.onSwipeEnd,c=>{const{x:f,y:h}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),d(!1)})})})});Ta.displayName=cr;var[dc,uc]=_a(cr,{onClose(){}}),fc=u.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:l,onPause:d,onResume:c,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:m,...x}=t,y=Mr(cr,r),[v,w]=u.useState(null),_=Se(e,B=>w(B)),S=u.useRef(null),N=u.useRef(null),D=s||y.duration,E=u.useRef(0),T=u.useRef(D),P=u.useRef(0),{onToastAdd:C,onToastRemove:V}=y,U=He(()=>{var q;(v==null?void 0:v.contains(document.activeElement))&&((q=y.viewport)==null||q.focus()),i()}),M=u.useCallback(B=>
2{!B||B===1/0||(window.clearTimeout(P.current),E.current=new Date().getTime(),P.current=window.setTimeout(U,B))},[U]);u.useEffect(()=>{const B=y.viewport;if(B){const q=()=>{M(T.current),c==null||c()},re=()=>{const K=new Date().getTime()-E.current;T.current=T.current-K,window.clearTimeout(P.current),d==null||d()};return B.addEventListener(cn,re),B.addEventListener(dn,q),()=>{B.removeEventListener(cn,re),B.removeEventListener(dn,q)}}},[y.viewport,D,d,c,M]),u.useEffect(()=>{o&&!y.isClosePausedRef.current&&M(D)},[o,D,y.isClosePausedRef,M]),u.useEffect(()=>(C(),()=>V()),[C,V]);const ae=u.useMemo(()=>v?Ma(v):null,[v]);return y.viewport?a.jsxs(a.Fragment,{children:[ae&&a.jsx(mc,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:ae}),a.jsx(dc,{scope:r,onClose:U,children:ma.createPortal(a.jsx(On.ItemSlot,{scope:r,children:a.jsx(tl,{asChild:!0,onEscapeKeyDown:ue(l,()=>{y.isFocusedToastEscapeKeyDownRef.current||U(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":y.swipeDirection,...x,ref:_,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ue(t.onKeyDown,B=>{B.key==="Escape"&&(l==null||l(B.nativeEvent),B.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:ue(t.onPointerDown,B=>{B.button===0&&(S.current={x:B.clientX,y:B.clientY})}),onPointerMove:ue(t.onPointerMove,B=>{if(!S.current)return;const q=B.clientX-S.current.x,re=B.clientY-S.current.y,K=!!N.current,ie=["left","right"].includes(y.swipeDirection),$=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,pe=ie?$(0,q):0,ee=ie?0:$(0,re),Q=B.pointerType==="touch"?10:2,ne={x:pe,y:ee},ce={originalEvent:B,delta:ne};K?(N.current=ne,pr(ic,h,ce,{discrete:!1})):hs(ne,y.swipeDirection,Q)?(N.current=ne,pr(oc,f,ce,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(q)>Q||Math.abs(re)>Q)&&(S.current=null)}),onPointerUp:ue(t.onPointerUp,B=>{const q=N.current,re=B.target;if(re.hasPointerCapture(B.pointerId)&&re.releasePointerCapture(B.pointerId),N.current=null,S.current=null,q){const K=B.currentTarget,ie={originalEvent:B,delta:q};hs(q,y.swipeDirection,y.swipeThreshold)?pr(cc,m,ie,{discrete:!0}):pr(lc,p,ie,{discrete:!0}),K.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),mc=t=>{const{__scopeToast:e,children:r,...n}=t,s=Mr(cr,e),[o,i]=u.useState(!1),[l,d]=u.useState(!1);return gc(()=>i(!0)),u.useEffect(()=>{const c=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:a.jsx(rl,{asChild:!0,children:a.jsx(Ks,{...n,children:o&&a.jsxs(a.Fragment,{children:[s.label," ",r]})})})},hc="ToastTitle",Ca=u.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return a.jsx(we.div,{...n,ref:e})});Ca.displayName=hc;var pc="ToastDescription",Ea=u.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return a.jsx(we.div,{...n,ref:e})});Ea.displayName=pc;var Pa="ToastAction",Aa=u.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?a.jsx(Ia,{altText:r,asChild:!0,children:a.jsx(Dn,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Pa}\`. Expected non-empty \`string\`.`),null)});Aa.displayName=Pa;var Ra="ToastClose",Dn=u.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=uc(Ra,r);return a.jsx(Ia,{asChild:!0,children:a.jsx(we.button,{type:"button",...n,ref:e,onClick:ue(t.onClick,s.onClose)})})});Dn.displayName=Ra;var Ia=u.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return a.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function Ma(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),yc(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&e.push(i)}else e.push(...Ma(n))}}),e}function pr(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?nl(s,o):s.dispatchEvent(o)}var hs=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),o=n>s;return e==="left"||e==="right"?o&&n>r:!o&&s>r};function gc(t=()=>{}){const e=He(t);Qs(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function yc(t){return t.nodeType===t.ELEMENT_NODE}function vc(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Gr(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var xc=ka,La=ja,Oa=Ta,Da=Ca,$a=Ea,za=Aa,Ba=Dn;function Fa(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Fa(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Va(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Fa(t))&&(n&&(n+=" "),n+=e);return n}const ps=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,gs=Va,Lr=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return gs(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=e,i=Object.keys(s).map(c=>{const f=r==null?void 0:r[c],h=o==null?void 0:o[c];if(f===null)return null;const p=ps(f)||ps(h);return s[c][p]}),l=r&&Object.entries(r).reduce((c,f)=>{let[h,p]=f;return p===void 0||(c[h]=p),c},{}),d=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(x=>{let[y,v]=x;return Array.isArray(v)?v.includes({...o,...l}[y]):{...o,...l}[y]===v})?[...c,h,p]:c},[]);return gs(t,i,d,r==null?void 0:r.class,r==null?void 0:r.className)};/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const bc=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qa=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** 8 * @license lucide-react v0.462.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */var wc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 13 * @license lucide-react v0.462.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const _c=u.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...l},d)=>u.createElement("svg",{ref:d,...wc,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:qa("lucide",s),...l},[...i.map(([c,f])=>u.createElement(c,f)),...Array.isArray(o)?o:[o]]));/** 18 * @license lucide-react v0.462.0 - ISC 19 * 20 * This source code is licensed under the ISC license. 21 * See the LICENSE file in the root directory of this source tree. 22 */const X=(t,e)=>{const r=u.forwardRef(({className:n,...s},o)=>u.createElement(_c,{ref:o,iconNode:e,className:qa(`lucide-${bc(t)}`,n),...s}));return r.displayName=`${t}`,r};/** 23 * @license lucide-react v0.462.0 - ISC 24 * 25 * This source code is licensed under the ISC license. 26 * See the LICENSE file in the root directory of this source tree. 27 */const Ua=X("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 28 * @license lucide-react v0.462.0 - ISC 29 * 30 * This source code is licensed under the ISC license. 31 * See the LICENSE file in the root directory of this source tree. 32 */const kc=X("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 33 * @license lucide-react v0.462.0 - ISC 34 * 35 * This source code is licensed under the ISC license. 36 * See the LICENSE file in the root directory of this source tree. 37 */const Sc=X("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 38 * @license lucide-react v0.462.0 - ISC 39 * 40 * This source code is licensed under the ISC license. 41 * See the LICENSE file in the root directory of this source tree. 42 */const jc=X("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 43 * @license lucide-react v0.462.0 - ISC 44 * 45 * This source code is licensed under the ISC license. 46 * See the LICENSE file in the root directory of this source tree. 47 */const Ha=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 48 * @license lucide-react v0.462.0 - ISC 49 * 50 * This source code is licensed under the ISC license. 51 * See the LICENSE file in the root directory of this source tree. 52 */const Nc=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 53 * @license lucide-react v0.462.0 - ISC 54 * 55 * This source code is licensed under the ISC license. 56 * See the LICENSE file in the root directory of this source tree. 57 */const Tc=X("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 58 * @license lucide-react v0.462.0 - ISC 59 * 60 * This source code is licensed under the ISC license. 61 * See the LICENSE file in the root directory of this source tree. 62 */const Cc=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 63 * @license lucide-react v0.462.0 - ISC 64 * 65 * This source code is licensed under the ISC license. 66 * See the LICENSE file in the root directory of this source tree. 67 */const Ec=X("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 68 * @license lucide-react v0.462.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const Pc=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 73 * @license lucide-react v0.462.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */const Wa=X("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 78 * @license lucide-react v0.462.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const Za=X("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 83 * @license lucide-react v0.462.0 - ISC 84 * 85 * This source code is licensed under the ISC license. 86 * See the LICENSE file in the root directory of this source tree. 87 */const Ac=X("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** 88 * @license lucide-react v0.462.0 - ISC 89 * 90 * This source code is licensed under the ISC license. 91 * See the LICENSE file in the root directory of this source tree. 92 */const Rc=X("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 93 * @license lucide-react v0.462.0 - ISC 94 * 95 * This source code is licensed under the ISC license. 96 * See the LICENSE file in the root directory of this source tree. 97 */const Ic=X("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 98 * @license lucide-react v0.462.0 - ISC 99 * 100 * This source code is licensed under the ISC license. 101 * See the LICENSE file in the root directory of this source tree. 102 */const Mc=X("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 103 * @license lucide-react v0.462.0 - ISC 104 * 105 * This source code is licensed under the ISC license. 106 * See the LICENSE file in the root directory of this source tree. 107 */const Lc=X("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** 108 * @license lucide-react v0.462.0 - ISC 109 * 110 * This source code is licensed under the ISC license. 111 * See the LICENSE file in the root directory of this source tree. 112 */const Oc=X("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}
112],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** 113 * @license lucide-react v0.462.0 - ISC 114 * 115 * This source code is licensed under the ISC license. 116 * See the LICENSE file in the root directory of this source tree. 117 */const Dc=X("ListMusic",[["path",{d:"M21 15V6",key:"h1cx4g"}],["path",{d:"M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",key:"8saifv"}],["path",{d:"M12 12H3",key:"18klou"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M12 18H3",key:"11ftsu"}]]);/** 118 * @license lucide-react v0.462.0 - ISC 119 * 120 * This source code is licensed under the ISC license. 121 * See the LICENSE file in the root directory of this source tree. 122 */const fn=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 123 * @license lucide-react v0.462.0 - ISC 124 * 125 * This source code is licensed under the ISC license. 126 * See the LICENSE file in the root directory of this source tree. 127 */const mn=X("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 128 * @license lucide-react v0.462.0 - ISC 129 * 130 * This source code is licensed under the ISC license. 131 * See the LICENSE file in the root directory of this source tree. 132 */const $c=X("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);/** 133 * @license lucide-react v0.462.0 - ISC 134 * 135 * This source code is licensed under the ISC license. 136 * See the LICENSE file in the root directory of this source tree. 137 */const $n=X("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 138 * @license lucide-react v0.462.0 - ISC 139 * 140 * This source code is licensed under the ISC license. 141 * See the LICENSE file in the root directory of this source tree. 142 */const Ya=X("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 143 * @license lucide-react v0.462.0 - ISC 144 * 145 * This source code is licensed under the ISC license. 146 * See the LICENSE file in the root directory of this source tree. 147 */const Ka=X("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 148 * @license lucide-react v0.462.0 - ISC 149 * 150 * This source code is licensed under the ISC license. 151 * See the LICENSE file in the root directory of this source tree. 152 */const zc=X("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 153 * @license lucide-react v0.462.0 - ISC 154 * 155 * This source code is licensed under the ISC license. 156 * See the LICENSE file in the root directory of this source tree. 157 */const Qa=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 158 * @license lucide-react v0.462.0 - ISC 159 * 160 * This source code is licensed under the ISC license. 161 * See the LICENSE file in the root directory of this source tree. 162 */const Bc=X("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 163 * @license lucide-react v0.462.0 - ISC 164 * 165 * This source code is licensed under the ISC license. 166 * See the LICENSE file in the root directory of this source tree. 167 */const Fc=X("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 168 * @license lucide-react v0.462.0 - ISC 169 * 170 * This source code is licensed under the ISC license. 171 * See the LICENSE file in the root directory of this source tree. 172 */const Vc=X("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** 173 * @license lucide-react v0.462.0 - ISC 174 * 175 * This source code is licensed under the ISC license. 176 * See the LICENSE file in the root directory of this source tree. 177 */const Ga=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 178 * @license lucide-react v0.462.0 - ISC 179 * 180 * This source code is licensed under the ISC license. 181 * See the LICENSE file in the root directory of this source tree. 182 */const qc=X("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 183 * @license lucide-react v0.462.0 - ISC 184 * 185 * This source code is licensed under the ISC license. 186 * See the LICENSE file in the root directory of this source tree. 187 */const Uc=X("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/** 188 * @license lucide-react v0.462.0 - ISC 189 * 190 * This source code is licensed under the ISC license. 191 * See the LICENSE file in the root directory of this source tree. 192 */const Hc=X("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** 193 * @license lucide-react v0.462.0 - ISC 194 * 195 * This source code is licensed under the ISC license. 196 * See the LICENSE file in the root directory of this source tree. 197 */const Wc=X("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 198 * @license lucide-react v0.462.0 - ISC 199 * 200 * This source code is licensed under the ISC license. 201 * See the LICENSE file in the root directory of this source tree. 202 */const Xa=X("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 203 * @license lucide-react v0.462.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */const Zc=X("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 208 * @license lucide-react v0.462.0 - ISC 209 * 210 * This source code is licensed under the ISC license. 211 * See the LICENSE file in the root directory of this source tree. 212 */const Yc=X("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** 213 * @license lucide-react v0.462.0 - ISC 214 * 215 * This source code is licensed under the ISC license. 216 * See the LICENSE file in the root directory of this source tree. 217 */const Ot=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 11,047 bytes, line 217
217],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),zn="-",Kc=t=>{const e=Gc(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:i=>{const l=i.split(zn);return l[0]===""&&l.length!==1&&l.shift(),Ja(l,e)||Qc(i)},getConflictingClassGroupIds:(i,l)=>{const d=r[i]||[];return l&&n[i]?[...d,...n[i]]:d}}},Ja=(t,e)=>{var i;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?Ja(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const o=t.join(zn);return(i=e.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId},ys=/^\[(.+)\]$/,Qc=t=>{if(ys.test(t)){const e=ys.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},Gc=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return Jc(Object.entries(t.classGroups),r).forEach(([o,i])=>{hn(i,n,o,e)}),n},hn=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const o=s===""?e:vs(e,s);o.classGroupId=r;return}if(typeof s=="function"){if(Xc(s)){hn(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{hn(i,vs(e,o),r,n)})})},vs=(t,e)=>{let r=t;return e.split(zn).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Xc=t=>t.isThemeGetter,Jc=(t,e)=>e?t.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[e+i,l])):o);return[r,s]}):t,ed=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const s=(o,i)=>{r.set(o,i),e++,e>t&&(e=0,n=r,r=new Map)};return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}},eo="!",td=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,s=e[0],o=e.length,i=l=>{const d=[];let c=0,f=0,h;for(let v=0;v<l.length;v++){let w=l[v];if(c===0){if(w===s&&(n||l.slice(v,v+o)===e)){d.push(l.slice(f,v)),f=v+o;continue}if(w==="/"){h=v;continue}}w==="["?c++:w==="]"&&c--}const p=d.length===0?l:l.substring(f),m=p.startsWith(eo),x=m?p.substring(1):p,y=h&&h>f?h-f:void 0;return{modifiers:d,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:y}};return r?l=>r({className:l,parseClassName:i}):i},rd=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},nd=t=>({cache:ed(t.cacheSize),parseClassName:td(t),...Kc(t)}),sd=/\s+/,ad=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,o=[],i=t.trim().split(sd);let l="";for(let d=i.length-1;d>=0;d-=1){const c=i[d],{modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=r(c);let x=!!m,y=n(x?p.substring(0,m):p);if(!y){if(!x){l=c+(l.length>0?" "+l:l);continue}if(y=n(p),!y){l=c+(l.length>0?" "+l:l);continue}x=!1}const v=rd(f).join(":"),w=h?v+eo:v,_=w+y;if(o.includes(_))continue;o.push(_);const S=s(y,x);for(let N=0;N<S.length;++N){const D=S[N];o.push(w+D)}l=c+(l.length>0?" "+l:l)}return l};function od(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=to(e))&&(n&&(n+=" "),n+=r);return n}const to=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=to(t[n]))&&(r&&(r+=" "),r+=e);return r};function id(t,...e){let r,n,s,o=i;function i(d){const c=e.reduce((f,h)=>h(f),t());return r=nd(c),n=r.cache.get,s=r.cache.set,o=l,l(d)}function l(d){const c=n(d);if(c)return c;const f=ad(d,r);return s(d,f),f}return function(){return o(od.apply(null,arguments))}}const me=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},ro=/^\[(?:([a-z-]+):)?(.+)\]$/i,ld=/^\d+\/\d+$/,cd=new Set(["px","full","screen"]),dd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ud=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,md=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xe=t=>Mt(t)||cd.has(t)||ld.test(t),it=t=>Ut(t,"length",_d),Mt=t=>!!t&&!Number.isNaN(Number(t)),Xr=t=>Ut(t,"number",Mt),Yt=t=>!!t&&Number.isInteger(Number(t)),pd=t=>t.endsWith("%")&&Mt(t.slice(0,-1)),G=t=>ro.test(t),lt=t=>dd.test(t),gd=new Set(["length","size","percentage"]),yd=t=>Ut(t,gd,no),vd=t=>Ut(t,"position",no),xd=new Set(["image","url"]),bd=t=>Ut(t,xd,Sd),wd=t=>Ut(t,"",kd),Kt=()=>!0,Ut=(t,e,r)=>{const n=ro.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},_d=t=>ud.test(t)&&!fd.test(t),no=()=>!1,kd=t=>md.test(t),Sd=t=>hd.test(t),jd=()=>{const t=me("colors"),e=me("spacing"),r=me("blur"),n=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),l=me("borderWidth"),d=me("contrast"),c=me("grayscale"),f=me("hueRotate"),h=me("invert"),p=me("gap"),m=me("gradientColorStops"),x=me("gradientColorStopPositions"),y=me("inset"),v=me("margin"),w=me("opacity"),_=me("padding"),S=me("saturate"),N=me("scale"),D=me("sepia"),E=me("skew"),T=me("space"),P=me("translate"),C=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",G,e],M=()=>[G,e],ae=()=>["",Xe,it],B=()=>["auto",Mt,G],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",G],pe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[Mt,G];return{cacheSize:500,separator:":",theme:{colors:[Kt],spacing:[Xe,it],blur:["none","",lt,G],brightness:ee(),borderColor:[t],borderRadius:["none","","full",lt,G],borderSpacing:M(),borderWidth:ae(),contrast:ee(),grayscale:$(),hueRotate:ee(),invert:$(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[pd,it],inset:U(),margin:U(),opacity:ee(),padding:M(),saturate:ee(),scale:ee(),sepia:$(),skew:ee(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[lt]}],"break-after":[{"break-after":pe()}],"break-before":[{"break-before":pe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),G]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yt,G]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Yt,G]}],"grid-cols":[{"grid-cols":[Kt]}],"col-start-end":[{col:["auto",{span:["full",Yt,G]},G]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Kt]}],"row-start-end":[{row:["auto",{span:[Yt,G]},G]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",G,e]}],"min-w":[{"min-w":[G,e,"min","max","fit"]}],"max-w":[{"max-w":[G,e,"none","full","min","max","fit","prose",{screen:[lt]},lt]}],h:[{h:[G,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,e,"auto","min","max","fit"]}],"font-size":[{text:["base",lt,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xr]}],"font-family":[{font:[Kt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",G]}],"line-clamp":[{"line-clamp":["none",Mt,Xr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xe,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"w
217avy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xe,it]}],"underline-offset":[{"underline-offset":["auto",Xe,G]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),vd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yd]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bd]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:re()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[Xe,G]}],"outline-w":[{outline:[Xe,it]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Xe,it]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",lt,wd]}],"shadow-color":[{shadow:[Kt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",lt,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[S]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:ee()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:ee()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Yt,G]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","
217none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Xe,it,Xr]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nd=id(jd);function F(...t){return Nd(Va(t))}const Td=xc,so=u.forwardRef(({className:t,...e},r)=>a.jsx(La,{ref:r,className:F("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));so.displayName=La.displayName;const Cd=Lr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ao=u.forwardRef(({className:t,variant:e,...r},n)=>
217a.jsx(Oa,{ref:n,className:F(Cd({variant:e}),t),...r}));ao.displayName=Oa.displayName;const Ed=u.forwardRef(({className:t,...e},r)=>a.jsx(za,{ref:r,className:F("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));Ed.displayName=za.displayName;const oo=u.forwardRef(({className:t,...e},r)=>a.jsx(Ba,{ref:r,className:F("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:a.jsx(Ot,{className:"h-4 w-4"})}));oo.displayName=Ba.displayName;const io=u.forwardRef(({className:t,...e},r)=>a.jsx(Da,{ref:r,className:F("text-sm font-semibold",t),...e}));io.displayName=Da.displayName;const lo=u.forwardRef(({className:t,...e},r)=>a.jsx($a,{ref:r,className:F("text-sm opacity-90",t),...e}));lo.displayName=$a.displayName;function Pd(){const{toasts:t}=lr();return a.jsxs(Td,{children:[t.map(function({id:e,title:r,description:n,action:s,...o}){return a.jsxs(ao,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(io,{children:r}),n&&a.jsx(lo,{children:n})]}),s,a.jsx(oo,{})]},e)}),a.jsx(so,{})]})}var xs=["light","dark"],Ad="(prefers-color-scheme: dark)",Rd=u.createContext(void 0),Id={setTheme:t=>{},themes:[]},Md=()=>{var t;return(t=u.useContext(Rd))!=null?t:Id};u.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:i,attrs:l,nonce:d})=>{let c=o==="system",f=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?xs.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(x,y=!1,v=!0)=>{let w=i?i[x]:x,_=y?x+"|| ''":`'${w}'`,S="";return s&&v&&!y&&xs.includes(x)&&(S+=`d.style.colorScheme = '${x}';`),r==="class"?y||w?S+=`c.add(${_})`:S+="null":w&&(S+=`d[s](n,${_})`),S},m=t?`!function(){${f}${p(t)}}()`:n?`!function(){try{${f}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${Ad}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${p(i?"x[e]":"e",!0)}}${c?"":"else{"+p(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${e}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${p(i?"x[e]":"e",!0)}}else{${p(o,!1,!1)};}${h}}catch(t){}}();`;return u.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:m}})});var Ld=t=>{switch(t){case"success":return $d;case"info":return Bd;case"warning":return zd;case"error":return Fd;default:return null}},Od=Array(12).fill(0),Dd=({visible:t,className:e})=>k.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},k.createElement("div",{className:"sonner-spinner"},Od.map((r,n)=>k.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),$d=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zd=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Bd=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Fd=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vd=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},k.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),k.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qd=()=>{let[t,e]=k.useState(document.hidden);return k.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},pn=1,Ud=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>
217{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...n}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:pn++,o=this.toasts.find(l=>l.id===s),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:i,title:r}):l):this.addToast({title:r,...n,dismissible:i,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),s=r!==void 0,o,i=n.then(async d=>{if(o=["resolve",d],k.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(Wd(d)&&!d.ok){s=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${d.status}`):e.error,f=typeof e.description=="function"?await e.description(`HTTP error! status: ${d.status}`):e.description;this.create({id:r,type:"error",message:c,description:f})}else if(e.success!==void 0){s=!1;let c=typeof e.success=="function"?await e.success(d):e.success,f=typeof e.description=="function"?await e.description(d):e.description;this.create({id:r,type:"success",message:c,description:f})}}).catch(async d=>{if(o=["reject",d],e.error!==void 0){s=!1;let c=typeof e.error=="function"?await e.error(d):e.error,f=typeof e.description=="function"?await e.description(d):e.description;this.create({id:r,type:"error",message:c,description:f})}}).finally(()=>{var d;s&&(this.dismiss(r),r=void 0),(d=e.finally)==null||d.call(e)}),l=()=>new Promise((d,c)=>i.then(()=>o[0]==="reject"?c(o[1]):d(o[1])).catch(c));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||pn++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ae=new Ud,Hd=(t,e)=>{let r=(e==null?void 0:e.id)||pn++;return Ae.addToast({title:t,...e,id:r}),r},Wd=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Zd=Hd,Yd=()=>Ae.toasts,Kd=()=>Ae.getActiveToasts(),ye=Object.assign(Zd,{success:Ae.success,info:Ae.info,warning:Ae.warning,error:Ae.error,custom:Ae.custom,message:Ae.message,promise:Ae.promise,dismiss:Ae.dismiss,loading:Ae.loading},{getHistory:Yd,getToasts:Kd});function Qd(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Qd(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
217left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
217:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
217--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 218`);function gr(t){return t.label!==void 0}var Gd=3,Xd="32px",Jd="16px",bs=4e3,eu=356,tu=14,ru=20,nu=200;function qe(...t){return t.filter(Boolean).join(" ")}function su(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var au=t=>{var e,r,n,s,o,i,l,d,c,f,h;let{invert:p,toast:m,unstyled:x,interacting:y,setHeights:v,visibleToasts:w,heights:_,index:S,toasts:N,expanded:D,removeToast:E,defaultRichColors:T,closeButton:P,style:C,cancelButtonStyle:V,actionButtonStyle:U,className:M="",descriptionClassName:ae="",duration:B,position:q,gap:re,loadingIcon:K,expandByDefault:ie,classNames:$,icons:pe,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:
218Q}=t,[ne,ce]=k.useState(null),[je,Qe]=k.useState(null),[fe,g]=k.useState(!1),[b,A]=k.useState(!1),[R,te]=k.useState(!1),[xe,Ie]=k.useState(!1),[Ce,Ee]=k.useState(!1),[ur,Nt]=k.useState(0),[yt,Fr]=k.useState(0),ze=k.useRef(m.duration||B||bs),Jn=k.useRef(null),vt=k.useRef(null),qi=S===0,Ui=S+1<=w,Le=m.type,Tt=m.dismissible!==!1,Hi=m.className||"",Wi=m.descriptionClassName||"",fr=k.useMemo(()=>_.findIndex(Z=>Z.toastId===m.id)||0,[_,m.id]),Zi=k.useMemo(()=>{var Z;return(Z=m.closeButton)!=null?Z:P},[m.closeButton,P]),es=k.useMemo(()=>m.duration||B||bs,[m.duration,B]),Vr=k.useRef(0),Ct=k.useRef(0),ts=k.useRef(0),Et=k.useRef(null),[Yi,Ki]=q.split("-"),rs=k.useMemo(()=>_.reduce((Z,de,ge)=>ge>=fr?Z:Z+de.height,0),[_,fr]),ns=qd(),Qi=m.invert||p,qr=Le==="loading";Ct.current=k.useMemo(()=>fr*re+rs,[fr,rs]),k.useEffect(()=>{ze.current=es},[es]),k.useEffect(()=>{g(!0)},[]),k.useEffect(()=>{let Z=vt.current;if(Z){let de=Z.getBoundingClientRect().height;return Fr(de),v(ge=>[{toastId:m.id,height:de,position:m.position},...ge]),()=>v(ge=>ge.filter(Be=>Be.toastId!==m.id))}},[v,m.id]),k.useLayoutEffect(()=>{if(!fe)return;let Z=vt.current,de=Z.style.height;Z.style.height="auto";let ge=Z.getBoundingClientRect().height;Z.style.height=de,Fr(ge),v(Be=>Be.find(Fe=>Fe.toastId===m.id)?Be.map(Fe=>Fe.toastId===m.id?{...Fe,height:ge}:Fe):[{toastId:m.id,height:ge,position:m.position},...Be])},[fe,m.title,m.description,v,m.id]);let st=k.useCallback(()=>{A(!0),Nt(Ct.current),v(Z=>Z.filter(de=>de.toastId!==m.id)),setTimeout(()=>{E(m)},nu)},[m,E,v,Ct]);k.useEffect(()=>{if(m.promise&&Le==="loading"||m.duration===1/0||m.type==="loading")return;let Z;return D||y||Q&&ns?(()=>{if(ts.current<Vr.current){let de=new Date().getTime()-Vr.current;ze.current=ze.current-de}ts.current=new Date().getTime()})():ze.current!==1/0&&(Vr.current=new Date().getTime(),Z=setTimeout(()=>{var de;(de=m.onAutoClose)==null||de.call(m,m),st()},ze.current)),()=>clearTimeout(Z)},[D,y,m,Le,Q,ns,st]),k.useEffect(()=>{m.delete&&st()},[st,m.delete]);function Gi(){var Z,de,ge;return pe!=null&&pe.loading?k.createElement("div",{className:qe($==null?void 0:$.loader,(Z=m==null?void 0:m.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":Le==="loading"},pe.loading):K?k.createElement("div",{className:qe($==null?void 0:$.loader,(de=m==null?void 0:m.classNames)==null?void 0:de.loader,"sonner-loader"),"data-visible":Le==="loading"},K):k.createElement(Dd,{className:qe($==null?void 0:$.loader,(ge=m==null?void 0:m.classNames)==null?void 0:ge.loader),visible:Le==="loading"})}return k.createElement("li",{tabIndex:0,ref:vt,className:qe(M,Hi,$==null?void 0:$.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,$==null?void 0:$.default,$==null?void 0:$[Le],(r=m==null?void 0:m.classNames)==null?void 0:r[Le]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:T,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":fe,"data-promise":!!m.promise,"data-swiped":Ce,"data-removed":b,"data-visible":Ui,"data-y-position":Yi,"data-x-position":Ki,"data-index":S,"data-front":qi,"data-swiping":R,"data-dismissible":Tt,"data-type":Le,"data-invert":Qi,"data-swipe-out":xe,"data-swipe-direction":je,"data-expanded":!!(D||ie&&fe),style:{"--index":S,"--toasts-before":S,"--z-index":N.length-S,"--offset":`${b?ur:Ct.current}px`,"--initial-height":ie?"auto":`${yt}px`,...C,...m.style},onDragEnd:()=>{te(!1),ce(null),Et.current=null},onPointerDown:Z=>{qr||!Tt||(Jn.current=new Date,Nt(Ct.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(te(!0),Et.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,de,ge,Be;if(xe||!Tt)return;Et.current=null;let Fe=Number(((Z=vt.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),at=Number(((de=vt.current)==null?void 0:de.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xt=new Date().getTime()-((ge=Jn.current)==null?void 0:ge.getTime()),Ve=ne==="x"?Fe:at,ot=Math.abs(Ve)/xt;if(Math.abs(Ve)>=ru||ot>.11){Nt(Ct.current),(Be=m.onDismiss)==null||Be.call(m,m),Qe(ne==="x"?Fe>0?"right":"left":at>0?"down":"up"),st(),Ie(!0),Ee(!1);return}te(!1),ce(null)},onPointerMove:Z=>{var de,ge,Be,Fe;if(!Et.current||!Tt||((de=window.getSelection())==null?void 0:de.toString().length)>0)return;let at=Z.clientY-Et.current.y,xt=Z.clientX-Et.current.x,Ve=(ge=t.swipeDirections)!=null?ge:su(q);!ne&&(Math.abs(xt)>1||Math.abs(at)>1)&&ce(Math.abs(xt)>Math.abs(at)?"x":"y");let ot={x:0,y:0};ne==="y"?(Ve.includes("top")||Ve.includes("bottom"))&&(Ve.includes("top")&&at<0||Ve.includes("bottom")&&at>0)&&(ot.y=at):ne==="x"&&(Ve.includes("left")||Ve.includes("right"))&&(Ve.includes("left")&&xt<0||Ve.includes("right")&&xt>0)&&(ot.x=xt),(Math.abs(ot.x)>0||Math.abs(ot.y)>0)&&Ee(!0),(Be=vt.current)==null||Be.style.setProperty("--swipe-amount-x",`${ot.x}px`),(Fe=vt.current)==null||Fe.style.setProperty("--swipe-amount-y",`${ot.y}px`)}},Zi&&!m.jsx?k.createElement("button",{"aria-label":ee,"data-disabled":qr,"data-close-button":!0,onClick:qr||!Tt?()=>{}:()=>{var Z;
218st(),(Z=m.onDismiss)==null||Z.call(m,m)},className:qe($==null?void 0:$.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(o=pe==null?void 0:pe.close)!=null?o:Vd):null,m.jsx||u.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:k.createElement(k.Fragment,null,Le||m.icon||m.promise?k.createElement("div",{"data-icon":"",className:qe($==null?void 0:$.icon,(i=m==null?void 0:m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Gi():null,m.type!=="loading"?m.icon||(pe==null?void 0:pe[Le])||Ld(Le):null):null,k.createElement("div",{"data-content":"",className:qe($==null?void 0:$.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},k.createElement("div",{"data-title":"",className:qe($==null?void 0:$.title,(d=m==null?void 0:m.classNames)==null?void 0:d.title)},typeof m.title=="function"?m.title():m.title),m.description?k.createElement("div",{"data-description":"",className:qe(ae,Wi,$==null?void 0:$.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),u.isValidElement(m.cancel)?m.cancel:m.cancel&&gr(m.cancel)?k.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||V,onClick:Z=>{var de,ge;gr(m.cancel)&&Tt&&((ge=(de=m.cancel).onClick)==null||ge.call(de,Z),st())},className:qe($==null?void 0:$.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,u.isValidElement(m.action)?m.action:m.action&&gr(m.action)?k.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||U,onClick:Z=>{var de,ge;gr(m.action)&&((ge=(de=m.action).onClick)==null||ge.call(de,Z),!Z.defaultPrevented&&st())},className:qe($==null?void 0:$.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function ws(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function ou(t,e){let r={};return[t,e].forEach((n,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",l=o?Jd:Xd;function d(c){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?r[`${i}-${c}`]=l:r[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):d(l)}),r}var iu=u.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:l,offset:d,mobileOffset:c,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:x=Gd,toastOptions:y,dir:v=ws(),gap:w=tu,loadingIcon:_,icons:S,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:D}=t,[E,T]=k.useState([]),P=k.useMemo(()=>Array.from(new Set([n].concat(E.filter(Q=>Q.position).map(Q=>Q.position)))),[E,n]),[C,V]=k.useState([]),[U,M]=k.useState(!1),[ae,B]=k.useState(!1),[q,re]=k.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=k.useRef(null),ie=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=k.useRef(null),pe=k.useRef(!1),ee=k.useCallback(Q=>{T(ne=>{var ce;return(ce=ne.find(je=>je.id===Q.id))!=null&&ce.delete||Ae.dismiss(Q.id),ne.filter(({id:je})=>je!==Q.id)})},[]);return k.useEffect(()=>Ae.subscribe(Q=>{if(Q.dismiss){T(ne=>ne.map(ce=>ce.id===Q.id?{...ce,delete:!0}:ce));return}setTimeout(()=>{ul.flushSync(()=>{T(ne=>{let ce=ne.findIndex(je=>je.id===Q.id);return ce!==-1?[...ne.slice(0,ce),{...ne[ce],...Q},...ne.slice(ce+1)]:[Q,...ne]})})})}),[]),k.useEffect(()=>{if(f!=="system"){re(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:ne})=>{re(ne?"dark":"light")})}catch{Q.addListener(({matches:ce})=>{try{re(ce?"dark":"light")}catch(je){console.error(je)}})}},[f]),k.useEffect(()=>{E.length<=1&&M(!1)},[E]),k.useEffect(()=>{let Q=ne=>{var ce,je;s.every(Qe=>ne[Qe]||ne.code===Qe)&&(M(!0),(ce=K.current)==null||ce.focus()),ne.code==="Escape"&&(document.activeElement===K.current||(je=K.current)!=null&&je.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[s]),k.useEffect(()=>{if(K.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,pe.current=!1)}},[K.current]),k.createElement("section",{ref:e,"aria-label":`${N} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((Q,ne)=>{var ce;let[je,Qe]=Q.split("-");return E.length?k.createElement("ol",{key:Q,dir:v==="auto"?ws():v,tabIndex:-1,ref:K,className:l,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":je,"data-lifted":U&&E.length>1&&!o,"data-x-position":Qe,style:{"--front-toast-height":`${((ce=C[0])==null?void 0:ce.height)||0}px`,"--width":`${eu}px`,"--gap":`${w}px`,...m,...ou(d,c)},onBlur:fe=>{pe.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(pe.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||pe.current||(pe.current=!0,$.current=fe.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{ae||M(!1)},onDragEnd:()=>M(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},E.filter(fe=>!fe.position&&ne===0||fe.position===Q).map((fe,g)=>{var b,A;return k.createElement(au,{key:fe.id,icons:S,index:g,toast:fe,defaultRichColors:h,duration:(b=y==null?void 0:y.duration)!=null?b:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:x,closeButton:(A=y==null?void 0:y.closeButton)!=null?A:i,interacting:ae,position:Q,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:ee,toasts:E.filter(R=>R.position==fe.position),heights:C.filter(R=>R.position==fe.position),setHeights:V,expandByDefault:o,gap:w,loadingIcon:_,expanded:U,pauseWhenPageIsHidden:D,swipeDirections:t.swipeDirections})})):null}))});const lu=({...t})=>{const{theme:e="system"}=Md();return a.jsx(iu,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})},cu=sl,du=u.forwardRef(({className:t,sideOffset:e=4,...r},n)=>
218a.jsx(Gs,{ref:n,sideOffset:e,className:F("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));du.displayName=Gs.displayName;const co=u.createContext(void 0);function uu({children:t,defaultTheme:e="system",storageKey:r="bookcast-theme"}){const[n,s]=u.useState(()=>localStorage.getItem(r)||e),[o,i]=u.useState("light");u.useEffect(()=>{const d=window.document.documentElement;d.classList.remove("light","dark");let c;n==="system"?c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c=n,d.classList.add(c),i(c);const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{if(n==="system"){const p=f.matches?"dark":"light";d.classList.remove("light","dark"),d.classList.add(p),i(p)}};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[n]);const l={theme:n,setTheme:d=>{localStorage.setItem(r,d),s(d)},resolvedTheme:o};return a.jsx(co.Provider,{value:l,children:t})}const fu=()=>{const t=u.useContext(co);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},mu={"nav.home":{en:"Home",hi:"हà¥à¤®",both:"Home"},"nav.library":{en:"Library",hi:"लाà¤à¤¬à¥à¤°à¥à¤°à¥",both:"Library"},"nav.search":{en:"Search",hi:"à¤à¥à¤à¥à¤",both:"Search"},"nav.profile":{en:"Profile",hi:"पà¥à¤°à¥à¤«à¤¾à¤à¤²",both:"Profile"},"common.continue_listening":{en:"Continue Listening",hi:"सà¥à¤¨à¤¨à¤¾ à¤à¤¾à¤°à¥ रà¤à¥à¤",both:"Continue Listening"},"common.recommended":{en:"Recommended for You",hi:"à¤à¤ªà¤à¥ लिठà¤
नà¥à¤¶à¤à¤¸à¤¿à¤¤",both:"Recommended for You"},"common.trending":{en:"Trending Now",hi:"à¤
à¤à¥ à¤à¥à¤°à¥à¤à¤¡à¤¿à¤à¤",both:"Trending Now"},"common.recently_added":{en:"Recently Added",hi:"हाल हॠमà¥à¤ à¤à¥à¤¡à¤¼à¤¾ à¤à¤¯à¤¾",both:"Recently Added"},"common.play":{en:"Play",hi:"à¤à¤²à¤¾à¤à¤",both:"Play"},"common.download":{en:"Download",hi:"डाà¤à¤¨à¤²à¥à¤¡",both:"Download"},"common.favorites":{en:"Favorites",hi:"पसà¤à¤¦à¥à¤¦à¤¾",both:"Favorites"},"common.all":{en:"All",hi:"सà¤à¥",both:"All"},"common.in_progress":{en:"In Progress",hi:"à¤à¤¾à¤°à¥",both:"In Progress"},"common.completed":{en:"Completed",hi:"पà¥à¤°à¥à¤£",both:"Completed"},"common.downloaded":{en:"Downloaded",hi:"डाà¤à¤¨à¤²à¥à¤¡ à¤à¤¿à¤¯à¤¾ à¤à¤¯à¤¾",both:"Downloaded"},"auth.login":{en:"Login",hi:"लà¥à¤à¤¿à¤¨",both:"Login"},"auth.signup":{en:"Sign Up",hi:"साà¤à¤¨ à¤
प",both:"Sign Up"},"auth.logout":{en:"Logout",hi:"लà¥à¤à¤à¤à¤",both:"Logout"}},uo=u.createContext(void 0);function hu({children:t}){const[e,r]=u.useState(()=>localStorage.getItem("bookcast-language")||"en"),n=o=>{localStorage.setItem("bookcast-language",o),r(o)},s=o=>{const i=mu[o];return i&&(i[e]||i.en)||o};return a.jsx(uo.Provider,{value:{language:e,setLanguage:n,t:s},children:t})}const fo=()=>{const t=u.useContext(uo);if(t===void 0)throw new Error("useLanguage must be used within a LanguageProvider");return t};function pu(){var v,w;if(typeof window>"u")return;const t=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(_=>t===_||t.endsWith("."+_)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=r?((v=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((w=t.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:w[1]):void 0,o=window.parent&&window.parent!==window;if(!s||!o)return localStorage;const i=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),l=i?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,d=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),c=d&&l.test(d)?[d]:i?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],f="lovable-preview-auth:result",h=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),m=(_,S,N)=>new Promise(D=>{const E=p();let T=!1,P;const C=M=>{T||(T=!0,clearTimeout(P),window.removeEventListener("message",V),D(M))},V=M=>{if(c.indexOf(M.origin)<0)return;const ae=M.data;ae&&ae.type===f&&ae.requestId===E&&C(ae)};window.addEventListener("message",V);const U={type:_,requestId:E,projectId:s,key:S};N!==void 0&&(U.value=N);for(const M of c)window.parent.postMessage(U,M);P=setTimeout(()=>C(null),h)});let x=!0;const y=250;return{getItem:async _=>{let S=await m("lovable-preview-auth:get",_);return!S&&x&&(await new Promise(N=>setTimeout(N,y)),S=await m("lovable-preview-auth:get",_)),x=!1,S&&S.ok&&typeof S.value=="string"?S.value===""?(localStorage.removeItem(_),null):S.value:localStorage.getItem(_)},setItem:(_,S)=>(localStorage.setItem(_,S),m("lovable-preview-auth:set",_,S).then(()=>{})),removeItem:_=>(localStorage.removeItem(_),m("lovable-preview-auth:remove",_).then(()=>{}))}}const gu="https://zsdwelonhnsrefdffjwx.supabase.co",yu="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpzZHdlbG9uaG5zcmVmZGZmand4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzAyMTAyODcsImV4cCI6MjA4NTc4NjI4N30.Qf-jl4SyRQa77xF_7pr6hQjY3En7OBPXHx3uCFZd_GY",z=yl(gu,yu,{auth:{storage:pu(),persistSession:!0,autoRefreshToken:!0}}),mo=u.createContext(void 0),ho=[.5,.75,1,1.25,1.5,1.75,2];function vu({children:t}){var je,Qe,fe;const e=u.useRef(null),r=u.useRef(null),[n,s]=u.useState({currentBook:null,isPlaying:!1,
218currentTime:0,duration:0,playbackSpeed:1,volume:1,isMuted:!1,isLoading:!1,isBuffering:!1,bufferedPercent:0,sleepTimer:null,isPlayerVisible:!1,isPlayerExpanded:!1,audioLanguage:"en",queue:[],currentQueueIndex:-1}),o=u.useCallback(g=>{g&&g!==e.current&&(e.current=g,g.addEventListener("loadedmetadata",()=>{s(b=>({...b,duration:g.duration,isLoading:!1}))}),g.addEventListener("timeupdate",()=>{s(b=>({...b,currentTime:g.currentTime}))}),g.addEventListener("ended",()=>{s(b=>b.currentQueueIndex<b.queue.length-1?{...b,isPlaying:!1,currentTime:0}:{...b,isPlaying:!1,currentTime:0})}),g.addEventListener("waiting",()=>{s(b=>({...b,isLoading:!0,isBuffering:!0}))}),g.addEventListener("canplay",()=>{s(b=>({...b,isLoading:!1,isBuffering:!1}))}),g.addEventListener("canplaythrough",()=>{s(b=>({...b,isLoading:!1,isBuffering:!1}))}),g.addEventListener("progress",()=>{if(g.buffered.length>0&&g.duration>0){const A=g.buffered.end(g.buffered.length-1)/g.duration*100;s(R=>({...R,bufferedPercent:A}))}}),g.addEventListener("stalled",()=>{s(b=>({...b,isBuffering:!0}))}),g.addEventListener("playing",()=>{s(b=>({...b,isBuffering:!1,isLoading:!1}))}),g.addEventListener("error",()=>{console.error("Audio error:",g.error),s(b=>({...b,isLoading:!1,isBuffering:!1,isPlaying:!1}))}))},[]),i=u.useRef(!1);u.useEffect(()=>{if(n.currentTime===0&&!n.isPlaying&&n.currentBook&&!n.isLoading&&i.current){i.current=!1;return}},[n.currentTime,n.isPlaying,n.currentBook,n.isLoading]),u.useEffect(()=>{const g=e.current;if(!g)return;const b=()=>{s(A=>{if(A.currentQueueIndex<A.queue.length-1){const R=A.currentQueueIndex+1;return A.queue[R],setTimeout(()=>K(R),100),{...A,isPlaying:!1,currentTime:0}}return{...A,isPlaying:!1,currentTime:0}})};return g.removeEventListener("ended",b),g.addEventListener("ended",b),()=>{g.removeEventListener("ended",b)}},[n.queue,n.currentQueueIndex,n.audioLanguage]),u.useEffect(()=>(n.sleepTimer!==null&&n.sleepTimer>0&&n.isPlaying&&(r.current=setInterval(()=>{s(g=>{var b;return g.sleepTimer!==null&&g.sleepTimer<=1?((b=e.current)==null||b.pause(),{...g,sleepTimer:null,isPlaying:!1}):{...g,sleepTimer:g.sleepTimer?g.sleepTimer-1:null}})},1e3)),()=>{r.current&&clearInterval(r.current)}),[n.sleepTimer,n.isPlaying]),u.useEffect(()=>{"mediaSession"in navigator&&n.currentBook&&(navigator.mediaSession.playbackState=n.isPlaying?"playing":"paused",navigator.mediaSession.metadata=new MediaMetadata({title:n.currentBook.title,artist:n.currentBook.author,album:"BookPod: 15 Min Summaries",artwork:[{src:n.currentBook.cover,sizes:"96x96",type:"image/png"},{src:n.currentBook.cover,sizes:"128x128",type:"image/png"},{src:n.currentBook.cover,sizes:"192x192",type:"image/png"},{src:n.currentBook.cover,sizes:"256x256",type:"image/png"},{src:n.currentBook.cover,sizes:"384x384",type:"image/png"},{src:n.currentBook.cover,sizes:"512x512",type:"image/png"}]}),navigator.mediaSession.setActionHandler("play",()=>{var g;(g=e.current)==null||g.play(),s(b=>({...b,isPlaying:!0}))}),navigator.mediaSession.setActionHandler("pause",()=>{var g;(g=e.current)==null||g.pause(),s(b=>({...b,isPlaying:!1}))}),navigator.mediaSession.setActionHandler("seekbackward",()=>{e.current&&(e.current.currentTime=Math.max(0,e.current.currentTime-15))}),navigator.mediaSession.setActionHandler("seekforward",()=>{e.current&&(e.current.currentTime=Math.min(e.current.duration,e.current.currentTime+15))}),navigator.mediaSession.setActionHandler("previoustrack",()=>{pe()}),navigator.mediaSession.setActionHandler("nexttrack",()=>{$()}),navigator.mediaSession.setActionHandler("seekto",g=>{e.current&&g.seekTime!=null&&(e.current.currentTime=g.seekTime,s(b=>({...b,currentTime:g.seekTime})))}))},[n.currentBook,n.isPlaying,n.queue,n.currentQueueIndex]),u.useEffect(()=>{"mediaSession"in navigator&&n.currentBook&&n.duration>0&&navigator.mediaSession.setPositionState({duration:n.duration,playbackRate:n.playbackSpeed,position:Math.min(n.currentTime,n.duration)})},[n.currentTime,n.duration,n.playbackSpeed,n.currentBook]);const l=u.useRef(null),d=u.useRef(null);u.useEffect(()=>{let g=!1,b;return(async()=>{var A;try{const{Capacitor:R}=await he(async()=>{const{Capacitor:Ce}=await import("./index-DzAmrokj.js");return{Capacitor:Ce}},[]);if(!R.isNativePlatform())return;const te=await he(()=>import("./index-D1oYp6VL.js").then(Ce=>Ce.i),[]),xe=te.CapacitorMusicControls??te.default??te;if(g||!xe)return;l.current=xe;const Ie=Ce=>{var Ee,ur,Nt;try{const yt=typeof Ce=="string"?JSON.parse(Ce):Ce;switch(yt==null?void 0:yt.message){case"music-controls-play":(Ee=e.current)==null||Ee.play().catch(()=>{}),s(ze=>({...ze,isPlaying:!0}));break;case"music-controls-pause":case"music-controls-headset-unplugged":(ur=e.current)==null||ur.pause(),s(ze=>({...ze,isPlaying:!1}));break;case"music-controls-next":$();break;case"music-controls-previous":pe();break;case"music-controls-seek-forward":e.current&&(e.current.currentTime=Math.min(e.current.duration,e.current.currentTime+15));break;case"music-controls-seek-backward":e.current&&(e.current.currentTime=Math.max(0,e.current.currentTime-15));break;case"music-controls-destroy":case"music-controls-stop":(Nt=e.current)==null||Nt.pause(),s(ze=>({...ze,isPlaying:!1}));break;default:break}}catch(yt){console.warn("MusicControls handler error",yt)}};if(typeof xe.addListener=="function"){const Ce=await xe.addListener("controlsNotification",Ee=>Ie(Ee!=null&&Ee.message?JSON.stringify(Ee):Ee));b=()=>{var Ee;try{(Ee=Ce.remove)==null||Ee.call(Ce)}catch{}}}else typeof xe.subscribe=="function"&&(xe.subscribe(Ie),(A=xe.listen)==null||A.call(xe))}catch(R){console.warn("MusicControls unavailable:",R)}})(),()=>{var A,R;g=!0,b==null||b();try{(R=(A=l.current)==null?void 0:A.destroy)==null||R.call(A)}catch{}}},[]),u.useEffect(()=>{var R,te,xe,Ie,Ce;const g=l.current;if(!g)return;const b=n.currentBook;if(!b){try{(R=g.destroy)==null||R.call(g)}catch{}d.current=null;return}
218if(d.current!==b.id){try{(te=g.destroy)==null||te.call(g)}catch{}try{(xe=g.create)==null||xe.call(g,{track:b.title,artist:b.author,cover:b.cover,isPlaying:n.isPlaying,dismissable:!1,hasPrev:n.currentQueueIndex>0,hasNext:n.currentQueueIndex<n.queue.length-1,hasClose:!0,hasScrubbing:!0,album:"BookPod: 15 Min Summaries",duration:Math.floor(n.duration||0),elapsed:Math.floor(n.currentTime||0),notificationIcon:"notification"}),d.current=b.id}catch(Ee){console.warn("MusicControls.create failed",Ee)}}else{try{(Ie=g.updateIsPlaying)==null||Ie.call(g,{isPlaying:n.isPlaying})}catch{}try{(Ce=g.updateElapsed)==null||Ce.call(g,{elapsed:Math.floor(n.currentTime||0),isPlaying:n.isPlaying})}catch{}}},[n.currentBook,n.isPlaying,n.queue.length,n.currentQueueIndex,n.duration,n.currentTime]);const c=u.useRef(null),f=u.useCallback(async()=>{if("wakeLock"in navigator)try{c.current=await navigator.wakeLock.request("screen"),c.current.addEventListener("release",()=>{c.current=null})}catch(g){console.warn("Wake Lock request failed:",g)}},[]),h=u.useCallback(()=>{c.current&&(c.current.release().catch(()=>{}),c.current=null)},[]);u.useEffect(()=>(n.isPlaying?f():h(),()=>h()),[n.isPlaying,f,h]),u.useEffect(()=>{const g=()=>{document.visibilityState==="visible"&&n.isPlaying&&f()};return document.addEventListener("visibilitychange",g),()=>document.removeEventListener("visibilitychange",g)},[n.isPlaying,f]),u.useEffect(()=>{if(!n.isPlaying||!e.current)return;const g=e.current;let b=0;const A=3,R=setInterval(()=>
218{g.paused&&!g.ended&&n.isPlaying&&g.src?(b++,b<=A?(console.warn(`Background playback interrupted, recovery attempt ${b}`),g.play().catch(te=>{console.warn("Recovery play failed:",te)})):(s(te=>({...te,isPlaying:!1})),clearInterval(R))):b=0},3e3);return()=>clearInterval(R)},[n.isPlaying]);const p=u.useCallback((g,b)=>b==="hi"&&g.audioUrlHindi?g.audioUrlHindi:b==="en"&&g.audioUrlEnglish?g.audioUrlEnglish:g.audioUrl||g.audioUrlEnglish||g.audioUrlHindi,[]),m=u.useCallback(g=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(g),[]),x=u.useCallback(async(g,b)=>{if(!m(g))return{url:null};try{const{data:A,error:R}=await z.functions.invoke("get-audio-url",{body:{bookId:g,language:b}});if(R){console.error("Failed to get signed audio URL:",R);let te=null;const xe=R.context;if(xe instanceof Response&&(te=await xe.clone().json().catch(()=>null)),(te==null?void 0:te.code)==="TRIAL_LIMIT_REACHED")return{url:null,trialLimitReached:!0};if((te==null?void 0:te.code)==="SUBSCRIPTION_REQUIRED")return{url:null,subscriptionRequired:!0};const Ie=R.message||"";return(te==null?void 0:te.error)==="Unauthorized"||Ie.includes("401")||Ie.includes("Unauthorized")||Ie.includes("Auth")?{url:null,authError:!0}:{url:null}}return A!=null&&A.error?A.code==="TRIAL_LIMIT_REACHED"?{url:null,trialLimitReached:!0}:A.code==="SUBSCRIPTION_REQUIRED"?{url:null,subscriptionRequired:!0}:A.error==="Unauthorized"?{url:null,authError:!0}:{url:null}:{url:(A==null?void 0:A.signedUrl)||null}}catch(A){return console.error("Error fetching signed audio URL:",A),{url:null}}},[m]),y=u.useCallback(async(g,b)=>{if(!e.current)return;s(R=>({...R,currentBook:g,currentTime:0,isLoading:!0,isPlayerVisible:!0}));const A=await x(g.id,b);if(A.authError){ye.error("Session expired. Please log in again to play audio."),s(R=>({...R,isLoading:!1,isPlayerVisible:!1}));return}if(A.subscriptionRequired){ye.error("Premium subscription required to play audio.",{action:{label:"Subscribe",onClick:()=>{window.location.href="/subscription"}}}),s(R=>({...R,isLoading:!1,isPlayerVisible:!1}));return}if(A.trialLimitReached){ye.error("You've reached your 10-book trial limit. Continue your subscription for full access to the complete catalogue.",{action:{label:"View plans",onClick:()=>{window.location.href="/subscription"}}}),s(R=>({...R,isLoading:!1,isPlayerVisible:!1}));return}if(A.url)e.current.src=A.url,e.current.load();else{const R=p(g,b);if(R)e.current.src=R,e.current.load();else{console.warn("No audio URL available for this book"),s(te=>({...te,isLoading:!1}));return}}e.current.play().catch(R=>{console.error("Failed to play audio:",R),s(te=>({...te,isPlaying:!1,isLoading:!1}))}),s(R=>({...R,isPlaying:!0,isPlayerVisible:!0}))},[x,p]),v=u.useCallback(async g=>{var b;if(g&&e.current&&(s(A=>{const R=A.queue.findIndex(Ie=>Ie.id===g.id);if(R>=0)return{...A,currentQueueIndex:R};const te=A.queue.length===0?[g]:[...A.queue,g],xe=A.queue.length===0?0:te.length-1;return{...A,queue:te,currentQueueIndex:xe}}),s(A=>({...A,currentBook:g,currentTime:0,isLoading:!0,isPlayerVisible:!0})),!n.currentBook||n.currentBook.id!==g.id)){const A=await x(g.id,n.audioLanguage);if(A.authError){ye.error("Session expired. Please log in again to play audio."),s(R=>({...R,isLoading:!1,isPlayerVisible:!1}));return}if(A.subscriptionRequired){ye.error("Premium subscription required to play audio.",{action:{label:"Subscribe",onClick:()=>{window.location.href="/subscription"}}}),s(R=>({...R,isLoading:!1,isPlayerVisible:!1}));return}if(A.url)e.current.src=A.url,e.current.load();else{const R=p(g,n.audioLanguage);if(R)e.current.src=R,e.current.load();else{console.warn("No audio URL available for this book"),s(te=>({...te,isLoading:!1}));return}}}(b=e.current)!=null&&b.src&&(e.current.play().catch(A=>{console.error("Failed to play audio:",A),s(R=>({...R,isPlaying:!1,isLoading:!1}))}),s(A=>({...A,isPlaying:!0,isPlayerVisible:!0})))},[n.currentBook,n.audioLanguage,x,p]),w=u.useCallback(()=>{var g;(g=e.current)==null||g.pause(),s(b=>({...b,isPlaying:!1}))},[]),_=u.useCallback(()=>{n.isPlaying?w():v()},[n.isPlaying,w,v]),S=u.useCallback(g=>{e.current&&(e.current.currentTime=g,s(b=>({...b,currentTime:g})))},[]),N=u.useCallback((g=15)=>{if(e.current){const b=Math.min(e.current.duration,e.current.currentTime+g);e.current.currentTime=b}},[]),D=u.useCallback((g=15)=>{if(e.current){const b=Math.max(0,e.current.currentTime-g);e.current.currentTime=b}},[]),E=u.useCallback(g=>{e.current&&ho.includes(g)&&(e.current.playbackRate=g,s(b=>({...b,playbackSpeed:g}
218)))},[]),T=u.useCallback(g=>{e.current&&(e.current.volume=g,s(b=>({...b,volume:g,isMuted:g===0})))},[]),P=u.useCallback(()=>{if(e.current){const g=!n.isMuted;e.current.muted=g,s(b=>({...b,isMuted:g}))}},[n.isMuted]),C=u.useCallback(g=>{s(b=>({...b,sleepTimer:g?g*60:null}))},[]),V=u.useCallback(()=>{s(g=>({...g,isPlayerExpanded:!0}))},[]),U=u.useCallback(()=>{s(g=>({...g,isPlayerExpanded:!1}))},[]),M=u.useCallback(()=>{var g;(g=e.current)==null||g.pause(),e.current&&(e.current.src=""),s(b=>({...b,currentBook:null,isPlaying:!1,currentTime:0,duration:0,isPlayerVisible:!1,isPlayerExpanded:!1,sleepTimer:null,queue:[],currentQueueIndex:-1}))},[]),ae=u.useCallback(async g=>{if(!n.currentBook||!e.current){s(R=>({...R,audioLanguage:g}));return}const b=n.isPlaying;s(R=>({...R,audioLanguage:g,isLoading:!0,currentTime:0}));const A=await x(n.currentBook.id,g);if(A.authError){ye.error("Session expired. Please log in again."),s(R=>({...R,isLoading:!1}));return}if(A.url)e.current.src=A.url;else{const R=p(n.currentBook,g);if(!R){console.warn(`No ${g==="en"?"English":"Hindi"} audio available`),s(te=>({...te,isLoading:!1}));return}e.current.src=R}e.current.load(),e.current.currentTime=0,b&&e.current.play().catch(R=>{console.error("Failed to resume after language switch:",R)})},[n.currentBook,n.isPlaying,x,p]),B=u.useCallback(g=>{s(b=>{if(b.queue.some(R=>R.id===g.id))return b;const A=[...b.queue,g];return b.currentBook?{...b,queue:A}:{...b,queue:A,currentQueueIndex:0,currentBook:g}})},[]),q=u.useCallback(g=>{s(b=>{const A=b.queue.filter((te,xe)=>xe!==g);let R=b.currentQueueIndex;return g<b.currentQueueIndex?R--:g===b.currentQueueIndex&&(R=Math.min(R,A.length-1)),{...b,queue:A,currentQueueIndex:R}})},[]),re=u.useCallback(()=>{s(g=>g.currentBook?{...g,queue:[g.currentBook],currentQueueIndex:0}:{...g,queue:[],currentQueueIndex:-1})},[]),K=u.useCallback(async g=>{s(b=>g<0||g>=b.queue.length?b:{...b,currentQueueIndex:g}),s(b=>{const A=b.queue[g];return A&&y(A,b.audioLanguage),b})},[y]),ie=u.useCallback(g=>{K(g)},[K]),$=u.useCallback(()=>{s(g=>{if(g.currentQueueIndex<g.queue.length-1){const b=g.currentQueueIndex+1;return K(b),g}return g})},[K]),pe=u.useCallback(()=>{s(g=>{if(g.currentQueueIndex>0){const b=g.currentQueueIndex-1;return K(b),g}return g})},[K]),ee=!!((je=n.currentBook)!=null&&je.audioUrlEnglish||(Qe=n.currentBook)!=null&&Qe.audioUrl),Q=!!((fe=n.currentBook)!=null&&fe.audioUrlHindi),ne=n.currentQueueIndex<n.queue.length-1,ce=n.currentQueueIndex>0;return a.jsxs(mo.Provider,{value:{...n,play:v,pause:w,togglePlay:_,seek:S,skipForward:N,skipBackward:D,setPlaybackSpeed:E,setVolume:T,toggleMute:P,setSleepTimer:C,setAudioLanguage:ae,expandPlayer:V,minimizePlayer:U,closePlayer:M,addToQueue:B,removeFromQueue:q,clearQueue:re,playNext:$,playPrevious:pe,playFromQueue:ie,hasEnglishAudio:ee,hasHindiAudio:Q,hasNext:ne,hasPrevious:ce},children:[a.jsx("audio",{ref:o,preload:"auto",playsInline:!0,style:{display:"none"}}),t]})}const _e=()=>{},xu={currentBook:null,isPlaying:!1,currentTime:0,duration:0,playbackSpeed:1,volume:1,isMuted:!1,isLoading:!1,isBuffering:!1,bufferedPercent:0,sleepTimer:null,isPlayerVisible:!1,isPlayerExpanded:!1,audioLanguage:"en",queue:[],currentQueueIndex:-1,play:_e,pause:_e,togglePlay:_e,seek:_e,skipForward:_e,skipBackward:_e,setPlaybackSpeed:_e,setVolume:_e,toggleMute:_e,setSleepTimer:_e,setAudioLanguage:_e,expandPlayer:_e,minimizePlayer:_e,closePlayer:_e,addToQueue:_e,removeFromQueue:_e,clearQueue:_e,playNext:_e,playPrevious:_e,playFromQueue:_e,hasEnglishAudio:!1,hasHindiAudio:!1,hasNext:!1,hasPrevious:!1};function Bn(){const t=u.useContext(mo);return t===void 0?xu:t}const bu="https://jagannathpuriculture.com";function _s(t="/"){const e=t.startsWith("/")?t:`/${t}`;return`${bu}${e}`}const po=u.createContext(void 0),Pe=()=>{const t=u.useContext(po);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},wu=()=>`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,ks=()=>{let t=localStorage.getItem("device_session_id");return t||(t=wu(),localStorage.setItem("device_session_id",t)),t},_u=({children:t})=>{const[e,r]=u.useState(null),[n,s]=u.useState(null),[o,i]=u.useState(null),[l,d]=u.useState(!0),c=u.useRef(null),f=u.useRef(!1),h=async T=>{const{data:P,error:C}=await z.from("profiles").select("*").eq("user_id",T).single();return C?(console.error("Error fetching profile:",C),null):P},p=async()=>
218{if(e){const T=await h(e.id);i(T)}},m=u.useCallback(async T=>{const P=ks();await z.from("profiles").update({active_session_id:P}).eq("user_id",T)},[]),x=u.useCallback(async T=>{const P=ks(),{data:C}=await z.from("profiles").select("active_session_id").eq("user_id",T).single();return!(C&&C.active_session_id&&C.active_session_id!==P)},[]),y=u.useCallback(async()=>{f.current||(f.current=!0,ye.error("Session ended: Your account was signed in on another device.",{duration:6e3}),c.current&&(clearInterval(c.current),c.current=null),await z.auth.signOut(),r(null),s(null),i(null),localStorage.removeItem("device_session_id"),f.current=!1)},[]),v=u.useCallback(T=>{c.current&&clearInterval(c.current),c.current=setInterval(async()=>{await x(T)||y()},3e4)},[x,y]);u.useEffect(()=>{const{data:{subscription:T}}=z.auth.onAuthStateChange((P,C)=>{s(C),r((C==null?void 0:C.user)??null),C!=null&&C.user?(setTimeout(()=>{h(C.user.id).then(i)},0),(P==="SIGNED_IN"||P==="TOKEN_REFRESHED")&&setTimeout(()=>{m(C.user.id),v(C.user.id)},100)):i(null),P==="SIGNED_OUT"&&(i(null),c.current&&(clearInterval(c.current),c.current=null))});return z.auth.getSession().then(({data:{session:P}})=>{s(P),r((P==null?void 0:P.user)??null),P!=null&&P.user?h(P.user.id).then(async C=>{i(C),await x(P.user.id)?v(P.user.id):y(),d(!1)}):d(!1)}),()=>{T.unsubscribe(),c.current&&clearInterval(c.current)}},[]);const E={user:e,session:n,profile:o,loading:l,signUp:async(T,P,C,V)=>{const U=_s("/"),{error:M}=await z.auth.signUp({email:T,password:P,options:{emailRedirectTo:U,data:{full_name:C,...V!=null&&V.phone?{phone:V.phone}:{},...V!=null&&V.language_preference?{language_preference:V.language_preference}:{}}}});return M||z.functions.invoke("send-welcome-email",{body:{user_email:T,user_name:C}}).catch(ae=>console.error("Welcome email failed:",ae)),{error:M}},signIn:async(T,P)=>{const{data:C,error:V}=await z.auth.signInWithPassword({email:T,password:P});return!V&&C.user&&(await z.auth.signOut({scope:"others"}),await m(C.user.id),v(C.user.id)),{error:V}},signOut:async()=>{f.current=!0,c.current&&(clearInterval(c.current),c.current=null),e&&await z.from("profiles").update({active_session_id:null}).eq("user_id",e.id),await z.auth.signOut(),r(null),s(null),i(null),localStorage.removeItem("device_session_id"),f.current=!1},resetPassword:async T=>{const{error:P}=await z.auth.resetPasswordForEmail(T,{redirectTo:_s("/reset-password")});return{error:P}},updateProfile:async T=>{if(!e)return{error:new Error("No user logged in")};const{error:P}=await z.from("profiles").update(T).eq("user_id",e.id);return P||await p(),{error:P}},refreshProfile:p};return a.jsx(po.Provider,{value:E,children:t})},Fn=Lr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Y=u.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},o)=>{const i=n?al:"button";return a.jsx(i,{className:F(Fn({variant:e,size:r,className:t})),ref:o,...s})});Y.displayName="Button";const go=il,yo=ll,ku=u.forwardRef(({className:t,inset:e,children:r,...n},s)=>a.jsxs(Xs,{ref:s,className:F("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...n,children:[r,a.jsx(Nc,{className:"ml-auto h-4 w-4"})]}));ku.displayName=Xs.displayName;const Su=u.forwardRef(({className:t,...e},r)=>a.jsx(Js,{ref:r,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
218de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));Su.displayName=Js.displayName;const Vn=u.forwardRef(({className:t,sideOffset:e=4,...r},n)=>a.jsx(ol,{children:a.jsx(ea,{ref:n,sideOffset:e,className:F("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Vn.displayName=ea.displayName;const ar=u.forwardRef(({className:t,inset:e,...r},n)=>a.jsx(ta,{ref:n,className:F("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...r}));ar.displayName=ta.displayName;const ju=u.forwardRef(({className:t,children:e,checked:r,...n},s)=>a.jsxs(ra,{ref:s,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(na,{children:a.jsx(Ha,{className:"h-4 w-4"})})}),e]}));ju.displayName=ra.displayName;const Nu=u.forwardRef(({className:t,children:e,...r},n)=>a.jsxs(sa,{ref:n,className:F("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(na,{children:a.jsx(Cc,{className:"h-2 w-2 fill-current"})})}),e]}));Nu.displayName=sa.displayName;const Tu=u.forwardRef(({className:t,inset:e,...r},n)=>a.jsx(aa,{ref:n,className:F("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));Tu.displayName=aa.displayName;const gn=u.forwardRef(({className:t,...e},r)=>a.jsx(oa,{ref:r,className:F("-mx-1 my-1 h-px bg-muted",t),...e}));gn.displayName=oa.displayName;function kp(t){return Re({queryKey:["books",t],queryFn:async()=>{let e=z.from("books").select("*").order("rating_average",{ascending:!1});if(t!=null&&t.language&&t.language!=="both"&&(e=e.eq("language",t.language)),t!=null&&t.genre&&(e=e.eq("genre",t.genre)),t!=null&&t.featured&&(e=e.eq("is_featured",!0)),t!=null&&t.isNew&&(e=e.eq("is_new",!0)),t!=null&&t.search){const o=(i=>i.slice(0,100).replace(/[%_\\]/g,"\\$&"))(t.search);e=e.or(`title.ilike.%${o}%,author.ilike.%${o}%`)}const{data:r,error:n}=await e;if(n)throw n;return r}})}function Sp(t){return Re({queryKey:["book",t],queryFn:async()=>{if(!t)return null;const{data:e,error:r}=await z.from("books").select("*").eq("id",t).maybeSingle();if(r)throw r;return e},enabled:!!t})}function Cu(){return Re({queryKey:["books","new"],queryFn:async()=>{const{data:t,error:e}=await z.from("books").select("*").eq("is_new",!0).order("created_at",{ascending:!1}).limit(10);if(e)throw e;return t}})}const Eu={"self-help":"self_help","self help":"self_help",selfhelp:"self_help"};function Pu(t){if(!(t!=null&&t.length))return[];const e=["self_help","business","psychology","science","history","biography","fiction","philosophy","health","technology","finance","spirituality"],r=new Set;for(const n of t){const s=n.trim().toLowerCase(),o=Eu[s]??s.replace(/[\s-]+/g,"_");e.includes(o)&&r.add(o)}return Array.from(r)}function jp(){const{user:t,profile:e}=Pe(),r=(e==null?void 0:e.language_preference)??"both",n=Pu(e==null?void 0:e.favorite_genres);return Re({queryKey:["books","recommended",t==null?void 0:t.id,r,n.join(",")],queryFn:async()=>{let s=[];if(t){const{data:l}=await z.from("user_progress").select("book_id").eq("user_id",t.id).eq("completed",!0);s=(l??[]).map(d=>d.book_id)}const o=async(l,d)=>{let c=z.from("books").select("*");d&&r!=="both"&&(c=c.eq("language",r)),l&&n.length&&(c=c.in("genre",n)),s.length&&(c=c.not("id","in",`(${s.join(",")})`));const{data:f,error:h}=await c.order("is_featured",{ascending:!1}).order("rating_average",{ascending:!1}).limit(12);if(h)throw h;return f};let i=await o(n.length>0,r!=="both");return!(i!=null&&i.length)&&n.length&&(i=await o(!1,r!=="both")),i!=null&&i.length||(i=await o(!1,!1)),i??[]},enabled:!!t})}function Np(){const{user:t}=Pe();return Re({queryKey:["continue-listening",t==null?void 0:t.id],queryFn:async()=>
218{if(!t)return[];const{data:e,error:r}=await z.from("user_progress").select(` 219 *, 220 book:books(*) 221 `).eq("user_id",t.id).eq("completed",!1).gt("current_position",0).order("last_played_at",{ascending:!1}).limit(5);if(r)throw r;return e},enabled:!!t})}function Tp(){const t=Ye(),{user:e}=Pe();return rt({mutationFn:async({bookId:r,isFavorite:n})=>{if(!e)throw new Error("Not authenticated");if(n){const{error:s}=await z.from("user_favorites").delete().eq("user_id",e.id).eq("book_id",r);if(s)throw s}else{const{error:s}=await z.from("user_favorites").insert({user_id:e.id,book_id:r});if(s)throw s}},onSuccess:()=>{t.invalidateQueries({queryKey:["user-favorites"]})}})}function Cp(t){return Re({queryKey:["book-reviews",t],queryFn:async()=>{if(!t)return[];const{data:e,error:r}=await z.rpc("get_book_reviews",{p_book_id:t});if(r)throw r;return(e||[]).map(n=>({...n,profiles:{full_name:n.reviewer_name}}))},enabled:!!t})}function Ep(){const t=Ye(),{user:e}=Pe();return rt({mutationFn:async({bookId:r,rating:n,reviewText:s})=>{if(!e)throw new Error("Not authenticated");const{data:o,error:i}=await z.from("user_reviews").upsert({user_id:e.id,book_id:r,rating:n,review_text:s||null},{onConflict:"user_id,book_id"}).select().single();if(i)throw i;return o},onSuccess:(r,n)=>{t.invalidateQueries({queryKey:["book-reviews",n.bookId]}),t.invalidateQueries({queryKey:["book",n.bookId]})}})}function Pp(t){const{user:e}=Pe();return Re({queryKey:["user-review",e==null?void 0:e.id,t],queryFn:async()=>{if(!e||!t)return null;const{data:r,error:n}=await z.from("user_reviews").select("*").eq("user_id",e.id).eq("book_id",t).maybeSingle();if(n)throw n;return r},enabled:!!e&&!!t})}function Ap(t){const{user:e}=Pe();return Re({queryKey:["is-favorite",e==null?void 0:e.id,t],queryFn:async()=>{if(!e||!t)return!1;const{data:r,error:n}=await z.from("user_favorites").select("id").eq("user_id",e.id).eq("book_id",t).maybeSingle();if(n)throw n;return!!r},enabled:!!e&&!!t})}function Au(){const{user:t}=Pe(),{data:e,isLoading:r,refetch:n}=Re({queryKey:["stripe-subscription",t==null?void 0:t.id],queryFn:async()=>{if(!t)return{subscribed:!1,plan:"free",subscription_end:null,status:"trial",in_trial:!1};const{data:x,error:y}=await z.functions.invoke("check-subscription");return y?(console.error("Error checking subscription:",y),{subscribed:!1,plan:"free",subscription_end:null,status:"trial"}):x},enabled:!!t,staleTime:1e3*60,refetchInterval:1e3*60}),s=(e==null?void 0:e.subscribed)||!1,o=s&&(e==null?void 0:e.plan)||"free",i=e==null?void 0:e.subscription_end,l=(e==null?void 0:e.status)||"trial",d=(e==null?void 0:e.provider)||"google_play",c=(e==null?void 0:e.in_trial)===!0,f=(e==null?void 0:e.books_used)??null,h=(e==null?void 0:e.books_remaining)??null,p=(e==null?void 0:e.trial_book_limit)??10,m=(e==null?void 0:e.trial_ends_at)??null;return{subscription:e,isPremium:s,currentPlan:o,subscriptionEnd:i,status:l,currentProvider:d,inTrial:c,booksUsed:f,booksRemaining:h,trialBookLimit:p,trialEndsAt:m,isLoading:r,refetch:n,openBillingPortal:()=>{window.open("https://play.google.com/store/account/subscriptions","_blank")},isOpeningPortal:!1}}function Te(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Ru(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const yr=43200,Ss=1440;let Iu={};function Mu(){return Iu}function js(t){const e=Te(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function jr(t,e){const r=Te(t),n=Te(e),s=r.getTime()-n.getTime();return s<0?-1:s>0?1:s}function Lu(t){return Ru(t,Date.now())}function Ou(t,e){const r=Te(t),n=Te(e),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function Du(t){return e=>{const n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function $u(t,e){return+Te(t)-+Te(e)}function zu(t){const e=Te(t);return e.setHours(23,59,59,999),e}function Bu(t){const e=Te(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function Fu(t){const e=Te(t);return+zu(e)==+Bu(e)}function Vu(t,e){const r=Te(t),n=Te(e),s=jr(r,n),o=Math.abs(Ou(r,n));let i;if(o<1)i=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-s*o);let l=jr(r,n)===-s;Fu(Te(t))&&o===1&&jr(t,n)===1&&(l=!1),i=s*(o-Number(l))}return i===0?0:i}function qu(t,e,r){const n=$u(t,e)/1e3;return Du(r==null?void 0:r.roundingMethod)(n)}const Uu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hu=(t,e,r)=>{let n;const s=Uu[t];return typeof s=="string"?n=s:e===1?n=s.one:n=s.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Jr(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const Wu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Yu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ku={date:Jr({formats:Wu,defaultWidth:"full"}),time:Jr({formats:Zu,defaultWidth:"full"}),dateTime:Jr({formats:Yu,defaultWidth:"full"})},Qu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gu=(t,e,r,n)=>Qu[t];function Qt(t){return(e,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=r!=null&&r.width?String(r.width):i;s=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=r!=null&&r.width?String(r.width):t.defaultWidth;s=t.values[l]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}const Xu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ju={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ef={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
221ay","Saturday"]},rf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sf=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},af={ordinalNumber:sf,era:Qt({values:Xu,defaultWidth:"wide"}),quarter:Qt({values:Ju,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Qt({values:ef,defaultWidth:"wide"}),day:Qt({values:tf,defaultWidth:"wide"}),dayPeriod:Qt({values:rf,defaultWidth:"wide",formattingValues:nf,defaultFormattingWidth:"wide"})};function Gt(t){return(e,r={})=>{const n=r.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const i=o[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(l)?lf(l,h=>h.test(i)):of(l,h=>h.test(i));let c;c=t.valueCallback?t.valueCallback(d):d,c=r.valueCallback?r.valueCallback(c):c;const f=e.slice(i.length);return{value:c,rest:f}}}function of(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function lf(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function cf(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const s=n[0],o=e.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;const l=e.slice(s.length);return{value:i,rest:l}}}const df=/^(\d+)(th|st|nd|rd)?/i,uf=/\d+/i,ff={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mf={any:[/^b/i,/^(a|c)/i]},hf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pf={any:[/1/i,/2/i,/3/i,/4/i]},gf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yf={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_f={ordinalNumber:cf({matchPattern:df,parsePattern:uf,valueCallback:t=>parseInt(t,10)}),era:Gt({matchPatterns:ff,defaultMatchWidth:"wide",parsePatterns:mf,defaultParseWidth:"any"}),quarter:Gt({matchPatterns:hf,defaultMatchWidth:"wide",parsePatterns:pf,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Gt({matchPatterns:gf,defaultMatchWidth:"wide",parsePatterns:yf,defaultParseWidth:"any"}),day:Gt({matchPatterns:vf,defaultMatchWidth:"wide",parsePatterns:xf,defaultParseWidth:"any"}),dayPeriod:Gt({matchPatterns:bf,defaultMatchWidth:"any",parsePatterns:wf,defaultParseWidth:"any"})},kf={code:"en-US",formatDistance:Hu,formatLong:Ku,formatRelative:Gu,localize:af,match:_f,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Sf(t,e,r){const n=Mu(),s=(r==null?void 0:r.locale)??n.locale??kf,o=2520,i=jr(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:i});let d,c;i>0?(d=Te(e),c=Te(t)):(d=Te(t),c=Te(e));const f=qu(c,d),h=(js(c)-js(d))/1e3,p=Math.round((f-h)/60);let m;if(p<2)return r!=null&&r.includeSeconds?f<5?s.formatDistance("lessThanXSeconds",5,l):f<10?s.formatDistance("lessThanXSeconds",10,l):f<20?s.formatDistance("lessThanXSeconds",20,l):f<40?s.formatDistance("halfAMinute",0,l):f<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):p===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",p,l);if(p<45)return s.formatDistance("xMinutes",p,l);if(p<90)return s.formatDistance("aboutXHours",1,l);if(p<Ss){const x=Math.round(p/60);return s.formatDistance("aboutXHours",x,l)}else{if(p<o)return s.formatDistance("xDays",1,l);if(p<yr){const x=Math.round(p/Ss);return s.formatDistance("xDays",x,l)}else if(p<yr*2)return m=Math.round(p/yr),s.formatDistance("aboutXMonths",m,l)}if(m=Vu(c,d),m<12){const x=Math.round(p/yr);return s.formatDistance("xMonths",x,l)}else{const x=m%12,y=Math.trunc(m/12);return x<3?s.formatDistance("aboutXYears",y,l):x<9?s.formatDistance("overXYears",y,l):s.formatDistance("almostXYears",y+1,l)}}function jf(t,e){return Sf(t,Lu(t),e)}const vo="bookcast-read-notifications";function Nf(){try{return JSON.parse(localStorage.getItem(vo)||"[]")}catch{return[]}}function Tf(t){localStorage.setItem(vo,JSON.stringify(t))}function Cf(){const{data:t}=Cu(),{isPremium:e,currentPlan:r,subscriptionEnd:n,status:s}=Au(),[o,i]=u.useState(Nf),[l,d]=u.useState(!1),c=u.useMemo(()=>(t||[]).slice(0,8),[t]),f=u.useMemo(()=>c.filter(x=>!o.includes(x.id)).length,[c,o]);u.useEffect(()=>{if(l&&c.length>
2210){const x=c.map(v=>v.id),y=Array.from(new Set([...o,...x]));i(y),Tf(y)}},[l]);const p=(()=>{if(!n)return null;const x=new Date(n),y=new Date;return Math.max(0,Math.ceil((x.getTime()-y.getTime())/(1e3*60*60*24)))})(),m=()=>{switch(r){case"yearly":return"Yearly Premium";case"monthly":return"Monthly Premium";default:return"Free Plan"}};return a.jsxs(go,{open:l,onOpenChange:d,children:[a.jsx(yo,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"icon",className:"touch-target relative",children:[a.jsx(kc,{className:"h-5 w-5"}),f>0&&a.jsx("span",{className:"absolute top-1.5 right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-secondary text-[10px] font-bold text-secondary-foreground",children:f>9?"9+":f}),a.jsx("span",{className:"sr-only",children:"Notifications"})]})}),a.jsxs(Vn,{align:"end",className:"w-80 max-h-[28rem] overflow-y-auto",children:[a.jsx("div",{className:"px-3 py-2 font-heading font-semibold text-sm",children:"Notifications"}),a.jsx(gn,{}),a.jsxs("div",{className:"px-3 py-3 bg-muted/50 mx-1 my-1 rounded-md",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx(Ec,{className:"h-4 w-4 text-secondary"}),a.jsx("span",{className:"text-sm font-semibold",children:m()}),e&&a.jsx("span",{className:"ml-auto text-[10px] font-medium bg-secondary/20 text-secondary px-1.5 py-0.5 rounded-full uppercase",children:"Active"}),!e&&s==="trial"&&a.jsx("span",{className:"ml-auto text-[10px] font-medium bg-primary/20 text-primary px-1.5 py-0.5 rounded-full uppercase",children:"Trial"})]}),e&&p!==null&&a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx(jc,{className:"h-3 w-3"}),a.jsx("span",{children:p<=7?a.jsxs("span",{className:"text-destructive font-medium",children:["Expires in ",p," day",p!==1?"s":""," â renew soon!"]}):a.jsxs(a.Fragment,{children:["Renews in ",p," day",p!==1?"s":""," (",new Date(n).toLocaleDateString(),")"]})})]}),!e&&a.jsx(Ne,{to:"/subscription",className:"text-xs text-secondary hover:underline font-medium",onClick:()=>d(!1),children:"Upgrade to Premium â"})]}),a.jsx(gn,{}),c.length===0?a.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No new notifications"}):c.map(x=>{const y=!o.includes(x.id);return a.jsx(ar,{asChild:!0,className:"cursor-pointer",children:a.jsxs(Ne,{to:`/book/${x.id}`,className:"flex items-start gap-3 p-3",children:[x.cover_url?a.jsx("img",{src:x.cover_url,alt:"",className:"w-10 h-14 rounded object-cover flex-shrink-0"}):a.jsx("div",{className:"w-10 h-14 rounded bg-muted flex items-center justify-center flex-shrink-0",children:a.jsx(Sc,{className:"h-5 w-5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("p",{className:"text-sm font-medium leading-tight truncate",children:[y&&a.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-secondary mr-1.5 align-middle"}),"New: ",x.title]}),a.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["by ",x.author]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:jf(new Date(x.created_at),{addSuffix:!0})})]})]})},x.id)})]})]})}function Ef(){const t=jt(),{theme:e,setTheme:r,resolvedTheme:n}=fu(),{language:s,setLanguage:o}=fo();return["/login","/signup","/forgot-password","/onboarding","/player"].some(d=>t.pathname.startsWith(d))?null:a.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 glass border-b border-border",style:{paddingTop:"max(env(safe-area-inset-top, 0px), 12px)"},children:a.jsxs("div",{className:"flex items-center justify-between h-14 px-4 max-w-lg mx-auto",children:[a.jsxs(Ne,{to:"/",className:"flex items-center gap-2 min-w-0",children:[a.jsx("img",{src:"/logo.webp",alt:"BookPod: 15 Min Summaries",width:"32",height:"32",className:"w-8 h-8 rounded-full object-cover shrink-0"}),a.jsxs("span",{className:"font-heading font-semibold text-sm sm:text-lg leading-tight flex flex-col sm:flex-row sm:gap-1 min-w-0",children:[a.jsx("span",{className:"text-foreground",children:"BookPod:"}),a.jsx("span",{className:"text-[#3d9a8b]",children:"15 Min Summaries"})]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Y,{variant:"ghost",size:"icon",asChild:!0,className:"touch-target",children:a.jsxs(Ne,{to:"/search",children:[a.jsx(Ga,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Search"})]})}),a.jsxs(go,{children:[a.jsx(yo,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"icon",className:"touch-target",children:[a.jsx(Rc,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Change language"})]})}),a.jsxs(Vn,{align:"end",children:[a.jsx(ar,{onClick:()=>o("en"),className:F(s==="en"&&"bg-accent"),children:"ð¬ð§ English"}),a.jsx(ar,{onClick:()=>o("hi"),className:F(s==="hi"&&"bg-accent"),children:"ð®ð³ हिà¤à¤¦à¥"}),a.jsx(ar,{onClick:()=>o("both"),className:F(s==="both"&&"bg-accent"),children:"ð Both"})]})]}),a.jsxs(Y,{variant:"ghost",size:"icon",className:"touch-target",onClick:()=>r(n==="dark"?"light":"dark"),children:[n==="dark"?a.jsx(Wc,{className:"h-5 w-5"}):a.jsx(Ya,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]}),a.jsx(Cf,{})]})]})})}const Pf=[{path:"/",icon:Mc,labelKey:"nav.home"},{path:"/library",icon:Oc,labelKey:"nav.library"},{path:"/search",icon:Ga,labelKey:"nav.search"},{path:"/profile",icon:Xa,labelKey:"nav.profile"}];function Af(){const t=jt(),{t:e}=fo();return["/login","/signup","/forgot-password","/onboarding","/player"].some(s=>t.pathname.startsWith(s))?null:a.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 glass border-t border-border pb-safe",role:"navigation","aria-label":"Main navigation",children:a.jsx("div",{className:"flex items-center justify-around h-16 max-w-lg mx-auto",children:Pf.map(({path:s,icon:o,labelKey:i})=>{const l=s==="/"?t.pathname==="/":t.pathname.startsWith(s);return a.jsxs(fl,{to:s,className:F("flex flex-col items-center justify-center w-full h-full touch-target transition-colors",l?"text-primary":"text-muted-foreground hover:text-foreground"),"aria-current":l?"page":void 0,"aria-label":e(i),children:[a.jsx(o,{className:F("h-6 w-6 mb-1 transition-transform",l&&"scale-110"),strokeWidth:l?2.5:2}),a.jsx("span",{className:F("text-xs font-medium",l&&"font-semibold"),children:e(i)})]},s)})})})}function Rf(){const[t,e]=u.useState(!1),r=()=>{const n=document.getElementById("main-content");n&&(n.focus(),n.scrollIntoView({behavior:"smooth"}))};
221return a.jsx(Y,{onClick:r,onFocus:()=>e(!0),onBlur:()=>e(!1),className:` 222 fixed top-2 left-2 z-[100] transition-transform duration-200 223 ${t?"translate-y-0":"-translate-y-20"} 224 `,variant:"default",children:"Skip to main content"})}function Xt({children:t}){let e=!1,r=!1;try{const o=Bn();e=o.isPlayerVisible,r=o.isPlayerExpanded}catch{}const n=jt(),s=e&&!r?"pb-36":"pb-20";return u.useEffect(()=>{const i={"/":"Dashboard","/library":"My Library","/search":"Search","/profile":"Profile"}[n.pathname]||"Page";document.title=`${i} | BookPod: 15 Min Summaries`;const l=document.getElementById("route-announcement");l&&(l.textContent=`Navigated to ${i}`)},[n.pathname]),a.jsxs("div",{className:"min-h-screen bg-background",role:"application","aria-label":"BookPod: 15 Min Summaries",children:[a.jsx(Rf,{}),a.jsx("div",{id:"route-announcement",className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true"}),a.jsx(Ef,{}),a.jsx("main",{id:"main-content",className:`pt-14 ${s} px-4 max-w-lg mx-auto`,tabIndex:-1,role:"main","aria-label":"Main content",children:t}),a.jsx(Af,{})]})}function If(){let t;try{t=Bn()}catch{return null}const{currentBook:e,isPlaying:r,currentTime:n,duration:s,isPlayerVisible:o,isPlayerExpanded:i,togglePlay:l,expandPlayer:d,closePlayer:c}=t;if(!o||i||!e)return null;const f=s>0?n/s*100:0;return a.jsxs("div",{className:"fixed bottom-16 left-0 right-0 z-40 bg-card border-t shadow-lg animate-slide-up",onClick:d,children:[a.jsx("div",{className:"h-1 bg-muted",children:a.jsx("div",{className:"h-full bg-secondary transition-all duration-300",style:{width:`${f}%`}})}),a.jsxs("div",{className:"flex items-center gap-3 p-3 max-w-lg mx-auto",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden",children:a.jsx("img",{src:e.cover,alt:e.title,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"font-medium text-sm truncate",children:e.title}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.author})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Y,{variant:"ghost",size:"icon",className:"h-10 w-10",onClick:h=>{h.stopPropagation(),l()},children:r?a.jsx(Ka,{className:"h-5 w-5"}):a.jsx(Qa,{className:"h-5 w-5"})}),a.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:h=>{h.stopPropagation(),c()},children:a.jsx(Ot,{className:"h-4 w-4"})})]})]})]})}function qn(t,[e,r]){return Math.min(r,Math.max(e,t))}function xo(t){const e=u.useRef({value:t,previous:t});return u.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var bo=["PageUp","PageDown"],wo=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_o={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ht="Slider",[yn,Mf,Lf]=Ys(Ht),[ko,Rp]=ir(Ht,[Lf]),[Of,Or]=ko(Ht),So=u.forwardRef((t,e)=>{const{name:r,min:n=0,max:s=100,step:o=1,orientation:i="horizontal",disabled:l=!1,minStepsBetweenThumbs:d=0,defaultValue:c=[n],value:f,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:x,...y}=t,v=u.useRef(new Set),w=u.useRef(0),S=i==="horizontal"?Df:$f,[N=[],D]=Nn({prop:f,defaultProp:c,onChange:U=>{var ae;(ae=[...v.current][w.current])==null||ae.focus(),h(U)}}),E=u.useRef(N);function T(U){const M=qf(N,U);V(U,M)}function P(U){V(U,w.current)}function C(){const U=E.current[w.current];N[w.current]!==U&&p(N)}function V(U,M,{commit:ae}={commit:!1}){const B=Zf(o),q=Yf(Math.round((U-n)/o)*o+n,B),re=qn(q,[n,s]);D((K=[])=>{const ie=Ff(K,re,M);if(Wf(ie,d*o)){w.current=ie.indexOf(re);const $=String(ie)!==String(K);return $&&ae&&p(ie),$?ie:K}else return K})}return a.jsx(Of,{scope:t.__scopeSlider,name:r,disabled:l,min:n,max:s,valueIndexToChangeRef:w,thumbs:v.current,values:N,orientation:i,form:x,children:a.jsx(yn.Provider,{scope:t.__scopeSlider,children:a.jsx(yn.Slot,{scope:t.__scopeSlider,children:a.jsx(S,{"aria-disabled":l,"data-disabled":l?"":void 0,...y,ref:e,onPointerDown:ue(y.onPointerDown,()=>{l||(E.current=N)}),min:n,max:s,inverted:m,onSlideStart:l?void 0:T,onSlideMove:l?void 0:P,onSlideEnd:l?void 0:C,onHomeKeyDown:()=>!l&&V(n,0,{commit:!0}),onEndKeyDown:()=>!l&&V(s,N.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:M})=>{if(!l){const q=bo.includes(U.key)||U.shiftKey&&wo.includes(U.key)?10:1,re=w.current,K=N[re],ie=o*q*M;V(K+ie,re,{commit:!0})}}})})})})});So.displayName=Ht;var[jo,No]=ko(Ht,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Df=u.forwardRef((t,e)=>{const{min:r,max:n,dir:s,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:d,onStepKeyDown:c,...f}=t,[h,p]=u.useState(null),m=Se(e,S=>p(S)),x=u.useRef(void 0),y=ia(s),v=y==="ltr",w=v&&!o||!v&&o;function _(S){const N=x.current||h.getBoundingClientRect(),D=[0,N.width],T=Un(D,w?[r,n]:[n,r]);return x.current=N,T(S-N.left)}return a.jsx(jo,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:a.jsx(To,{dir:y,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const N=_(S.clientX);i==null||i(N)},onSlideMove:S=>{const N=_(S.clientX);l==null||l(N)},onSlideEnd:()=>{x.current=void 0,d==null||d()},onStepKeyDown:S=>{const D=_o[w?"from-left":"from-right"].includes(S.key);c==null||c({event:S,direction:D?-1:1})}})})}),$f=u.forwardRef((t,e)=>{const{min:r,max:n,inverted:s,onSlideStart:o,onSlideMove:i,onSlideEnd:l,onStepKeyDown:d,...c}=t,f=u.useRef(null),h=Se(e,f),p=u.useRef(void 0),m=!s;function x(y){const v=p.current||f.current.getBoundingClientRect(),w=[0,v.height],S=Un(w,m?[n,r]:[r,n]);return p.current=v,S(y-v.top)}return a.jsx(jo,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:a.jsx(To,{"data-orientation":"vertical",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>
224{const v=x(y.clientY);o==null||o(v)},onSlideMove:y=>{const v=x(y.clientY);i==null||i(v)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:y=>{const w=_o[m?"from-bottom":"from-top"].includes(y.key);d==null||d({event:y,direction:w?-1:1})}})})}),To=u.forwardRef((t,e)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:s,onSlideEnd:o,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:d,...c}=t,f=Or(Ht,r);return a.jsx(we.span,{...c,ref:e,onKeyDown:ue(t.onKeyDown,h=>{h.key==="Home"?(i(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):bo.concat(wo).includes(h.key)&&(d(h),h.preventDefault())}),onPointerDown:ue(t.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(p)?p.focus():n(h)}),onPointerMove:ue(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:ue(t.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),o(h))})})}),Co="SliderTrack",Eo=u.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,s=Or(Co,r);return a.jsx(we.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:e})});Eo.displayName=Co;var vn="SliderRange",Po=u.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,s=Or(vn,r),o=No(vn,r),i=u.useRef(null),l=Se(e,i),d=s.values.length,c=s.values.map(p=>Io(p,s.min,s.max)),f=d>1?Math.min(...c):0,h=100-Math.max(...c);return a.jsx(we.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:l,style:{...t.style,[o.startEdge]:f+"%",[o.endEdge]:h+"%"}})});Po.displayName=vn;var xn="SliderThumb",Ao=u.forwardRef((t,e)=>{const r=Mf(t.__scopeSlider),[n,s]=u.useState(null),o=Se(e,l=>s(l)),i=u.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return a.jsx(zf,{...t,ref:o,index:i})}),zf=u.forwardRef((t,e)=>{const{__scopeSlider:r,index:n,name:s,...o}=t,i=Or(xn,r),l=No(xn,r),[d,c]=u.useState(null),f=Se(e,_=>c(_)),h=d?i.form||!!d.closest("form"):!0,p=la(d),m=i.values[n],x=m===void 0?0:Io(m,i.min,i.max),y=Vf(n,i.values.length),v=p==null?void 0:p[l.size],w=v?Uf(v,x,l.direction):0;return u.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${w}px)`},children:[a.jsx(yn.ItemSlot,{scope:t.__scopeSlider,children:a.jsx(we.span,{role:"slider","aria-label":t["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":m,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...o,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:ue(t.onFocus,()=>{i.valueIndexToChangeRef.current=n})})}),h&&a.jsx(Ro,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},n)]})});Ao.displayName=xn;var Bf="RadioBubbleInput",Ro=u.forwardRef(({__scopeSlider:t,value:e,...r},n)=>{const s=u.useRef(null),o=Se(s,n),i=xo(e);return u.useEffect(()=>{const l=s.current;if(!l)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==e&&f){const h=new Event("input",{bubbles:!0});f.call(l,e),l.dispatchEvent(h)}},[i,e]),a.jsx(we.input,{style:{display:"none"},...r,ref:o,defaultValue:e})});Ro.displayName=Bf;function Ff(t=[],e,r){const n=[...t];return n[r]=e,n.sort((s,o)=>s-o)}function Io(t,e,r){const o=100/(r-e)*(t-e);return qn(o,[0,100])}function Vf(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function qf(t,e){if(t.length===1)return 0;const r=t.map(s=>Math.abs(s-e)),n=Math.min(...r);return r.indexOf(n)}function Uf(t,e,r){const n=t/2,o=Un([0,50],[0,n]);return(n-o(e)*r)*r}function Hf(t){return t.slice(0,-1).map((e,r)=>t[r+1]-e)}function Wf(t,e){if(e>0){const r=Hf(t);return Math.min(...r)>=e}return!0}function Un(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function Zf(t){return(String(t).split(".")[1]||"").length}function Yf(t,e){const r=Math.pow(10,e);return Math.round(t*r)/r}var Mo=So,Kf=Eo,Qf=Po,Gf=Ao;const Lo=u.forwardRef(({className:t,...e},r)=>a.jsxs(Mo,{ref:r,className:F("relative flex w-full touch-none select-none items-center",t),...e,children:[a.jsx(Kf,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(Qf,{className:"absolute h-full bg-primary"})}),a.jsx(Gf,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Lo.displayName=Mo.displayName;const vr=da,xr=ua,Xf=ca,Oo=u.forwardRef(({className:t,...e},r)=>a.jsx(Tn,{className:F("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));Oo.displayName=Tn.displayName;const Jf=Lr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Jt=u.forwardRef(({side:t="right",className:e,children:r,...n},s)=>a.jsxs(Xf,{children:[a.jsx(Oo,{}),a.jsxs(Cn,{ref:s,className:F(Jf({side:t}),e),...n,children:[r,a.jsxs(En,{className:"absolute right-4 top-4 roun
224ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(Ot,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jt.displayName=Cn.displayName;const er=({className:t,...e})=>a.jsx("div",{className:F("flex flex-col space-y-2 text-center sm:text-left",t),...e});er.displayName="SheetHeader";const em=({className:t,...e})=>a.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});em.displayName="SheetFooter";const tr=u.forwardRef(({className:t,...e},r)=>a.jsx(Pn,{ref:r,className:F("text-lg font-semibold text-foreground",t),...e}));tr.displayName=Pn.displayName;const tm=u.forwardRef(({className:t,...e},r)=>a.jsx(An,{ref:r,className:F("text-sm text-muted-foreground",t),...e}));tm.displayName=An.displayName;function rm(t,e){return u.useReducer((r,n)=>e[r][n]??r,t)}var Hn="ScrollArea",[Do,Ip]=ir(Hn),[nm,De]=Do(Hn),$o=u.forwardRef((t,e)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=t,[l,d]=u.useState(null),[c,f]=u.useState(null),[h,p]=u.useState(null),[m,x]=u.useState(null),[y,v]=u.useState(null),[w,_]=u.useState(0),[S,N]=u.useState(0),[D,E]=u.useState(!1),[T,P]=u.useState(!1),C=Se(e,U=>d(U)),V=ia(s);return a.jsx(nm,{scope:r,type:n,dir:V,scrollHideDelay:o,scrollArea:l,viewport:c,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:D,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:_,onCornerHeightChange:N,children:a.jsx(we.div,{dir:V,...i,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...t.style}})})});$o.displayName=Hn;var zo="ScrollAreaViewport",Bo=u.forwardRef((t,e)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=t,i=De(zo,r),l=u.useRef(null),d=Se(e,l,i.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(we.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:a.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Bo.displayName=zo;var Ke="ScrollAreaScrollbar",Wn=u.forwardRef((t,e)=>{const{forceMount:r,...n}=t,s=De(Ke,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,l=t.orientation==="horizontal";return u.useEffect(()=>(l?o(!0):i(!0),()=>{l?o(!1):i(!1)}),[l,o,i]),s.type==="hover"?a.jsx(sm,{...n,ref:e,forceMount:r}):s.type==="scroll"?a.jsx(am,{...n,ref:e,forceMount:r}):s.type==="auto"?a.jsx(Fo,{...n,ref:e,forceMount:r}):s.type==="always"?a.jsx(Zn,{...n,ref:e}):null});Wn.displayName=Ke;var sm=u.forwardRef((t,e)=>{const{forceMount:r,...n}=t,s=De(Ke,t.__scopeScrollArea),[o,i]=u.useState(!1);return u.useEffect(()=>{const l=s.scrollArea;let d=0;if(l){const c=()=>{window.clearTimeout(d),i(!0)},f=()=>{d=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",f),()=>{window.clearTimeout(d),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(qt,{present:r||o,children:a.jsx(Fo,{"data-state":o?"visible":"hidden",...n,ref:e})})}),am=u.forwardRef((t,e)=>{const{forceMount:r,...n}=t,s=De(Ke,t.__scopeScrollArea),o=t.orientation==="horizontal",i=$r(()=>d("SCROLL_END"),100),[l,d]=rm("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return u.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,s.scrollHideDelay,d]),u.useEffect(()=>{const c=s.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const p=()=>{const m=c[f];h!==m&&(d("SCROLL"),i()),h=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[s.viewport,o,d,i]),a.jsx(qt,{present:r||l!=="hidden",children:a.jsx(Zn,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:e,onPointerEnter:ue(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:ue(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Fo=u.forwardRef((t,e)=>{const r=De(Ke,t.__scopeScrollArea),{forceMount:n,...s}=t,[o,i]=u.useState(!1),l=t.orientation==="horizontal",d=$r(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,f=r.viewport.offsetHeight<r.viewport.scrollHeight;i(l?c:f)}},10);return Dt(r.viewport,d),Dt(r.content,d),a.jsx(qt,{present:n||o,children:a.jsx(Zn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),Zn=u.forwardRef((t,e)=>{const{orientation:r="vertical",...n}=t,s=De(Ke,t.__scopeScrollArea),o=u.useRef(null),i=u.useRef(0),[l,d]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Wo(l.viewport,l.content),f={...n,sizes:l,onSizesChange:d,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function h(p,m){return um(p,i.current,l,m)}return r==="horizontal"?a.jsx(om,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,m=Ns(p,l,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}}
vendor: 4,176 bytes, line 224
224,onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=h(p,s.dir))}}):r==="vertical"?a.jsx(im,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,m=Ns(p,l);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=h(p))}}):null}),om=u.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...s}=t,o=De(Ke,t.__scopeScrollArea),[i,l]=u.useState(),d=u.useRef(null),c=Se(e,d,o.onScrollbarXChange);return u.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),a.jsx(qo,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Dr(r)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;t.onWheelScroll(p),Yo(p,h)&&f.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Tr(i.paddingLeft),paddingEnd:Tr(i.paddingRight)}})}})}),im=u.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...s}=t,o=De(Ke,t.__scopeScrollArea),[i,l]=u.useState(),d=u.useRef(null),c=Se(e,d,o.onScrollbarYChange);return u.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),a.jsx(qo,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Dr(r)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;t.onWheelScroll(p),Yo(p,h)&&f.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Tr(i.paddingTop),paddingEnd:Tr(i.paddingBottom)}})}})}),[lm,Vo]=Do(Ke),qo=u.forwardRef((t,e)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:c,onWheelScroll:f,onResize:h,...p}=t,m=De(Ke,r),[x,y]=u.useState(null),v=Se(e,C=>y(C)),w=u.useRef(null),_=u.useRef(""),S=m.viewport,N=n.content-n.viewport,D=He(f),E=He(d),T=$r(h,10);function P(C){if(w.current){const V=C.clientX-w.current.left,U=C.clientY-w.current.top;c({x:V,y:U})}}return u.useEffect(()=>{const C=V=>{const U=V.target;(x==null?void 0:x.contains(U))&&D(V,N)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[S,x,N,D]),u.useEffect(E,[n,E]),Dt(x,T),Dt(m.content,T),a.jsx(lm,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:He(o),onThumbPointerUp:He(i),onThumbPositionChange:E,onThumbPointerDown:He(l),children:a.jsx(we.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:ue(t.onPointerDown,C=>{C.button===0&&(C.target.setPointerCapture(C.pointerId),w.current=x.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),P(C))}),onPointerMove:ue(t.onPointerMove,P),onPointerUp:ue(t.onPointerUp,C=>{const V=C.target;V.hasPointerCapture(C.pointerId)&&V.releasePointerCapture(C.pointerId),document.body.style.webkitUserSelect=_.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),Nr="ScrollAreaThumb",Uo=u.forwardRef((t,e)=>{const{forceMount:r,...n}=t,s=Vo(Nr,t.__scopeScrollArea);return a.jsx(qt,{present:r||s.hasThumb,children:a.jsx(cm,{ref:e,...n})})}),cm=u.forwardRef((t,e)=>{const{__scopeScrollArea:r,style:n,...s}=t,o=De(Nr,r),i=Vo(Nr,r),{onThumbPositionChange:l}=i,d=Se(e,h=>i.onThumbChange(h)),c=u.useRef(void 0),f=$r(()=>{c.current&&(c.current(),c.current=void 0)},100);return u.useEffect(()=>{const h=o.viewport;if(h){const p=()=>
224{if(f(),!c.current){const m=fm(h,l);c.current=m,l()}};return l(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,f,l]),a.jsx(we.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(t.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),x=h.clientX-m.left,y=h.clientY-m.top;i.onThumbPointerDown({x,y})}),onPointerUp:ue(t.onPointerUp,i.onThumbPointerUp)})});Uo.displayName=Nr;var Yn="ScrollAreaCorner",Ho=u.forwardRef((t,e)=>{const r=De(Yn,t.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?a.jsx(dm,{...t,ref:e}):null});Ho.displayName=Yn;var dm=u.forwardRef((t,e)=>{const{__scopeScrollArea:r,...n}=t,s=De(Yn,r),[o,i]=u.useState(0),[l,d]=u.useState(0),c=!!(o&&l);return Dt(s.scrollbarX,()=>{var h;const f=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(f),d(f)}),Dt(s.scrollbarY,()=>{var h;const f=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(f),i(f)}),c?a.jsx(we.div,{...n,ref:e,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Tr(t){return t?parseInt(t,10):0}function Wo(t,e){const r=t/e;return isNaN(r)?0:r}function Dr(t){const e=Wo(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=(t.scrollbar.size-r)*e;return Math.max(n,18)}function um(t,e,r,n="ltr"){const s=Dr(r),o=s/2,i=e||o,l=s-i,d=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-l,f=r.content-r.viewport,h=n==="ltr"?[0,f]:[f*-1,0];return Zo([d,c],h)(t)}function Ns(t,e,r="ltr"){const n=Dr(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,l=o-n,d=r==="ltr"?[0,i]:[i*-1,0],c=qn(t,d);return Zo([0,i],[0,l])(c)}function Zo(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function Yo(t,e){return t>0&&t<e}var fm=(t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},n=0;return function s(){const o={left:t.scrollLeft,top:t.scrollTop},i=r.left!==o.left,l=r.top!==o.top;(i||l)&&e(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function $r(t,e){const r=He(t),n=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(n.current),[]),u.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,e)},[r,e])}function Dt(t,e){const r=He(e);Qs(()=>{let n=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(t),()=>{window.cancelAnimationFrame(n),s.unobserve(t)}}},[t,r])}var Ko=$o,mm=Bo,hm=Ho;const Qo=u.forwardRef(({className:t,children:e,...r},n)=>a.jsxs(Ko,{ref:n,className:F("relative overflow-hidden",t),...r,children:[a.jsx(mm,{className:"h-full w-full rounded-[inherit]",children:e}),a.jsx(Go,{}),a.jsx(hm,{})]}));Qo.displayName=Ko.displayName;const Go=u.forwardRef(({className:t,orientation:e="vertical",...r},n)=>a.jsx(Wn,{ref:n,orientation:e,className:F("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:a.jsx(Uo,{className:"relative flex-1 rounded-full bg-border"})}));Go.displayName=Wn.displayName;function pm(){const t=typeof navigator<"u"&&!!navigator.share,e=async n=>{const s=n.url||window.location.href,o={title:n.title,text:n.text||`Check out "${n.title}" on BookPod: 15 Min Summaries!`,url:s};if(t)try{return await navigator.share(o),!0}catch(i){return i.name!=="AbortError"&&console.error("Share failed:",i),!1}else try{return await navigator.clipboard.writeText(s),ye.success("Link copied to clipboard!"),!0}catch{const l=document.createElement("textarea");l.value=s,l.style.position="fixed",l.style.left="-999999px",document.body.appendChild(l),l.select();try{return document.execCommand("copy"),ye.success("Link copied to clipboard!"),!0}catch{return ye.error("Failed to copy link"),!1}finally{document.body.removeChild(l)}}};return{share:e,shareBook:async n=>{const s=`${window.location.origin}/book/${n.id}`;return e({title:n.title,text:`Listen to "${n.title}" by ${n.author} on BookPod: 15 Min Summaries - 15 min summaries of bestselling books!`,url:s})},canShare:t}}function en(t){if(!t||isNaN(t))return"0:00";const e=Math.floor(t/60),r=Math.floor(t%60);return`${e}:${r.toString().padStart(2,"0")}`}const gm=[{label:"Off",value:null},{label:"5 min",value:5},{label:"15 min",value:15},{label:"30 min",value:30},{label:"45 min",value:45},{label:"1 hour",value:60}];function ym(){let t;try{t=Bn()}catch{return null}const{currentBook:e,isPlaying:r,currentTime:n,duration:s,playbackSpeed:o,volume:i,isMuted:l,sleepTimer:d,audioLanguage:c,isPlayerExpanded:f,hasEnglishAudio:h,hasHindiAudio:p,hasNext:m,hasPrevious:x,queue:y,currentQueueIndex:v,togglePlay:w,seek:_,skipForward:S,skipBackward:N,setPlaybackSpeed:D,setVolume:E,toggleMute:T,setSleepTimer:P,setAudioLanguage:C,minimizePlayer:V,playNext:U,playPrevious:M,playFromQueue:ae,removeFromQueue:B,clearQueue:q}=t,[re,K]=u.useState(!1),{share:ie}=pm();if(!f||!e)return null;const $=()=>{ie({title:e.title,text:`I'm listening to "${e.title}" by ${e.author} on BookPod: 15 Min Summaries!`,url:`${window.location.origin}/book/${e.id}`})},pe=s-n;return a.jsxs("div",{className:"fixed inset-0 z-50 bg-background flex flex-col animate-slide-up",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 flex-shrink-0",children:[a.jsx(Y,{variant:"ghost",size:"icon",onClick:V,"aria-label":"Back",children:a.jsx(Ua,{className:"h-5 w-5"})}),a.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["Now Playing",y.length>1&&a.jsxs("span",{className:"ml-1",children:["(",v+1,"/",y.length,")"]})]}),a.jsx(Y,{variant:"ghost",size:"icon",onClick:$,"aria-label":"Share this book",children:a.jsx(qc,{className:"h-5 w-5"})})]}),a.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[a.jsx("div",{className:"flex items-center justify-center px-6 py-2",children:a.jsx("div",{className:"w-full max-w-[220px] aspect-[3/4] rounded-2xl bg-muted overflow-hidden shadow-2xl flex items-center justify-center",children:a.jsx("img",{src:e.cover,alt:e.title,className:"w-full h-full object-contain"})})}),a.jsxs("div",{className:"px-6 text-center py-1",children:[a.jsx("h2",{className:"font-heading text-lg font-bold truncate",children:e.title}),a.jsx("p",{className:"text-sm text-muted-foreground truncate",children:e.author}),e.narrator&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Narrated by ",e.narrator]})]})]}),a.jsxs("div",{className:"flex-shrink-0",children:[a.jsxs("div",{className:"px-6 pt-2 pb-1 space-y-1",children:[a.jsx(Lo,{value:[n],max:s||100,step:1,onValueChange:([ee])=>_(ee),className:"cursor-pointer"}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:en(n)}),a.jsxs("span",{children:["-",en(pe)]})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-3 py-2",children:[a.jsx(Y,{variant:"ghost",size:"icon",className:"h-10 w-10",onClick:()=>N(15),"aria-label":"Skip backward 15 seconds",children:a.jsxs("div",{className:"relative",children:[a.jsx(Fc,{className:"h-5 w-5"}),a.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[9px] font-bold",children:"15"})]})}),a.jsx(Y,{variant:"ghost",size:"icon",className:F("h-12 w-12",!x&&"opacity-40"),onClick:M,disabled:!x,"aria-label":"Previous track",children:a.jsx(Uc,{className:"h-6 w-6 fill-current"})}
224),a.jsx(Y,{size:"icon",className:"h-14 w-14 rounded-full bg-secondary hover:bg-secondary/90",onClick:w,"aria-label":r?"Pause":"Play",children:r?a.jsx(Ka,{className:"h-7 w-7"}):a.jsx(Qa,{className:"h-7 w-7 ml-1"})}),a.jsx(Y,{variant:"ghost",size:"icon",className:F("h-12 w-12",!m&&"opacity-40"),onClick:U,disabled:!m,"aria-label":"Next track",children:a.jsx(Hc,{className:"h-6 w-6 fill-current"})}),a.jsx(Y,{variant:"ghost",size:"icon",className:"h-10 w-10",onClick:()=>S(15),"aria-label":"Skip forward 15 seconds",children:a.jsxs("div",{className:"relative",children:[a.jsx(Vc,{className:"h-5 w-5"}),a.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[9px] font-bold",children:"15"})]})})]}),a.jsxs("div",{className:"flex items-center justify-around px-4 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] border-t",children:[a.jsx(Y,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:T,"aria-label":l?"Unmute":"Mute",children:l||i===0?a.jsx(Yc,{className:"h-5 w-5"}):a.jsx(Zc,{className:"h-5 w-5"})}),a.jsxs(vr,{children:[a.jsx(xr,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"icon",className:"h-9 w-9 relative",children:[a.jsx(Dc,{className:"h-5 w-5"}),y.length>1&&a.jsx("span",{className:"absolute -top-1 -right-1 bg-secondary text-secondary-foreground text-[10px] rounded-full h-4 w-4 flex items-center justify-center",children:y.length})]})}),a.jsxs(Jt,{side:"bottom",className:"h-[60vh]",children:[a.jsx(er,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(tr,{children:["Queue (",y.length,")"]}),y.length>1&&a.jsx(Y,{variant:"ghost",size:"sm",onClick:q,className:"text-xs",children:"Clear"})]})}),a.jsx(Qo,{className:"h-full py-4",children:a.jsxs("div",{className:"space-y-2",children:[y.map((ee,Q)=>a.jsxs("div",{className:F("flex items-center gap-3 p-2 rounded-lg cursor-pointer transition-colors",Q===v?"bg-secondary/10 border border-secondary/30":"hover:bg-muted"),onClick:()=>ae(Q),children:[a.jsx("div",{className:"w-10 h-10 rounded-md bg-muted flex-shrink-0 overflow-hidden",children:a.jsx("img",{src:ee.cover,alt:ee.title,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("p",{className:F("text-sm font-medium truncate",Q===v&&"text-secondary"),children:[Q===v&&"â¶ ",ee.title]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.author})]}),Q!==v&&a.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:ne=>{ne.stopPropagation(),B(Q)},children:a.jsx(Ot,{className:"h-3.5 w-3.5"})})]},`${ee.id}-${Q}`)),y.length===0&&a.jsx("p",{className:"text-center text-sm text-muted-foreground py-8",children:"Queue is empty. Add books to play them continuously."})]})})]})]}),(h||p)&&a.jsxs(vr,{children:[a.jsx(xr,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"sm",className:"h-9 px-2",children:[a.jsx(Lc,{className:"h-4 w-4 mr-1"}),c==="en"?"EN":"HI"]})}),a.jsxs(Jt,{side:"bottom",className:"h-auto",children:[a.jsx(er,{children:a.jsx(tr,{children:"Audio Language"})}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 py-4",children:[a.jsx(Y,{variant:c==="en"?"default":"outline",onClick:()=>C("en"),disabled:!h,className:"h-12",children:a.jsxs("span",{className:"flex flex-col items-center",children:[a.jsx("span",{className:"font-semibold",children:"English"}),!h&&a.jsx("span",{className:"text-xs opacity-60",children:"Not available"})]})}),a.jsx(Y,{variant:c==="hi"?"default":"outline",onClick:()=>C("hi"),disabled:!p,className:"h-12",children:a.jsxs("span",{className:"flex flex-col items-center",children:[a.jsx("span",{className:"font-semibold",children:"हिà¤à¤¦à¥ (Hindi)"}),!p&&a.jsx("span",{className:"text-xs opacity-60",children:"Not available"})]})})]})]})]}),a.jsx(Y,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>K(!re),"aria-label":re?"Remove from favorites":"Add to favorites",children:a.jsx(Ic,{className:F("h-5 w-5",re&&"fill-destructive text-destructive")}
224)}),a.jsxs(vr,{children:[a.jsx(xr,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"sm",className:"h-9 px-2 font-mono text-xs",children:[a.jsx(Ac,{className:"h-4 w-4 mr-0.5"}),o,"x"]})}),a.jsxs(Jt,{side:"bottom",className:"h-auto",children:[a.jsx(er,{children:a.jsx(tr,{children:"Playback Speed"})}),a.jsx("div",{className:"grid grid-cols-4 gap-2 py-4",children:ho.map(ee=>a.jsxs(Y,{variant:o===ee?"default":"outline",onClick:()=>D(ee),className:"font-mono",children:[ee,"x"]},ee))})]})]}),a.jsxs(vr,{children:[a.jsx(xr,{asChild:!0,children:a.jsxs(Y,{variant:"ghost",size:"icon",className:"h-9 w-9 relative",children:[a.jsx(Ya,{className:"h-5 w-5"}),d&&a.jsx("span",{className:"absolute -top-1 -right-1 bg-secondary text-secondary-foreground text-[10px] rounded-full h-4 w-4 flex items-center justify-center",children:Math.ceil(d/60)})]})}),a.jsxs(Jt,{side:"bottom",className:"h-auto",children:[a.jsx(er,{children:a.jsx(tr,{children:"Sleep Timer"})}),a.jsx("div",{className:"grid grid-cols-3 gap-2 py-4",children:gm.map(ee=>a.jsx(Y,{variant:d===null&&ee.value===null||d&&ee.value&&Math.abs(d/60-ee.value)<1?"default":"outline",onClick:()=>P(ee.value),children:ee.label},ee.label))}),d&&a.jsxs("p",{className:"text-center text-sm text-muted-foreground pb-4",children:["Stops in ",en(d)]})]})]})]})]})]})}function dr(){const{user:t}=Pe();return Re({queryKey:["is-admin",t==null?void 0:t.id],queryFn:async()=>{if(!t)return!1;const{data:e,error:r}=await z.rpc("has_role",{_user_id:t.id,_role:"admin"});return r?(console.error("Error checking admin status:",r),!1):e},enabled:!!t,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0})}function Mp(){const{data:t}=dr();return Re({queryKey:["admin-stats"],queryFn:async()=>{const[e,r,n,s]=await Promise.all([z.from("profiles").select("id",{count:"exact",head:!0}),z.from("books").select("id",{count:"exact",head:!0}),z.from("user_subscriptions").select("id",{count:"exact",head:!0}).eq("status","active"),z.from("user_stats").select("total_listening_seconds")]),o=(s.data||[]).reduce((i,l)=>i+(l.total_listening_seconds||0),0);return{totalUsers:e.count||0,totalBooks:r.count||0,activeSubscribers:n.count||0,totalListeningHours:Math.round(o/3600)}},enabled:t===!0})}function Lp(){const{data:t}=dr();return Re({queryKey:["admin-users"],queryFn:async()=>{const{data:e,error:r}=await z.from("profiles").select("id, user_id, full_name, avatar_url, phone, created_at").order("created_at",{ascending:!1});if(r)throw r;return await Promise.all((e||[]).map(async s=>{const[{data:o},{data:i}]=await Promise.all([z.rpc("get_user_role",{_user_id:s.user_id}),z.rpc("get_user_email",{_user_id:s.user_id})]);return{id:s.id,user_id:s.user_id,full_name:s.full_name,email:i||void 0,avatar_url:s.avatar_url,phone:s.phone??null,created_at:s.created_at,role:o||"user"}}))},enabled:t===!0})}function Op(){const{data:t}=dr();return Re({queryKey:["admin-subscriptions"],queryFn:async()=>{const{data:e,error:r}=await z.from("user_subscriptions").select("*").order("created_at",{ascending:!1});if(r)throw r;return await Promise.all((e||[]).map(async s=>{const[{data:o},{data:i}]=await Promise.all([z.from("profiles").select("full_name, avatar_url").eq("user_id",s.user_id
224).maybeSingle(),z.rpc("get_user_email",{_user_id:s.user_id})]);return{...s,profile:o,email:i||void 0}}))},enabled:t===!0})}function Dp(){const t=Ye();return rt({mutationFn:async({userId:e,role:r})=>{const{data:n}=await z.from("user_roles").select("id").eq("user_id",e).maybeSingle();if(n){const{error:s}=await z.from("user_roles").update({role:r}).eq("user_id",e);if(s)throw s}else{const{error:s}=await z.from("user_roles").insert({user_id:e,role:r});if(s)throw s}},onSuccess:()=>{ye.success("User role updated"),t.invalidateQueries({queryKey:["admin-users"]})},onError:e=>{ye.error(`Failed to update role: ${e.message}`)}})}function $p(){const t=Ye();return rt({mutationFn:async({userId:e,updates:r})=>{const{error:n}=await z.from("user_subscriptions").update(r).eq("user_id",e);if(n)throw n},onSuccess:()=>{ye.success("Subscription updated"),t.invalidateQueries({queryKey:["admin-subscriptions"]})},onError:e=>{ye.error(`Failed to update subscription: ${e.message}`)}})}function zp(){const{data:t}=dr();return Re({queryKey:["admin-books"],queryFn:async()=>{const{data:e,error:r}=await z.from("books").select("*").order("created_at",{ascending:!1});if(r)throw r;return e},enabled:t===!0})}function Bp(){const t=Ye();return rt({mutationFn:async e=>{const{data:r,error:n}=await z.from("books").insert(e).select().single();if(n)throw n;return r},onSuccess:()=>{ye.success("Book created successfully"),t.invalidateQueries({queryKey:["admin-books"]}),t.invalidateQueries({queryKey:["books"]})},onError:e=>{ye.error(`Failed to create book: ${e.message}`)}})}function Fp(){const t=Ye();return rt({mutationFn:async({id:e,updates:r})=>{const{error:n}=await z.from("books").update(r).eq("id",e);if(n)throw n},onSuccess:()=>{ye.success("Book updated successfully"),t.invalidateQueries({queryKey:["admin-books"]}),t.invalidateQueries({queryKey:["books"]})},onError:e=>{ye.error(`Failed to update book: ${e.message}`)}})}function Vp(){const t=Ye();return rt({mutationFn:async e=>{const{error:r}=await z.from("books").delete().eq("id",e);if(r)throw r},onSuccess:()=>{ye.success("Book deleted successfully"),t.invalidateQueries({queryKey:["admin-books"]}),t.invalidateQueries({queryKey:["books"]})},onError:e=>{ye.error(`Failed to delete book: ${e.message}`)}})}function qp(){const t=Ye();return rt({mutationFn:async e=>{const{data:r,error:n}=await z.functions.invoke("delete-user",{body:{user_id:e}});if(n)throw n;if(r!=null&&r.error)throw new Error(r.error);return r},onSuccess:()=>{ye.success("User deleted successfully"),t.invalidateQueries({queryKey:["admin-users"]}),t.invalidateQueries({queryKey:["admin-stats"]})},onError:e=>{ye.error(`Failed to delete user: ${e.message}`)}})}function Up(){return rt({mutationFn:async({bucket:t,file:e,path:r,label:n="File"})=>{const{data:s,error:o}=await z.storage.from(t).upload(r,e);if(o)throw new Error(`${n} upload failed: ${o.message}`);const{data:i}=z.storage.from(t).getPublicUrl(s.path);return i.publicUrl},onError:t=>{ye.error(`Upload failed: ${t.message}`)}})}const ke=({children:t,requireOnboarding:e=!0,requireAdmin:r=!1})=>{const{user:n,profile:s,loading:o}=Pe(),i=jt(),{data:l,isLoading:d}=dr();if(o)return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx(fn,{className:"h-8 w-8 animate-spin text-primary"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})});if(!n)return a.jsx(Ur,{to:"/login",state:{from:i},replace:!0});if(e&&s&&!s.onboarding_completed)return a.jsx(Ur,{to:"/onboarding",replace:!0});if(r){if(d)return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx(fn,{className:"h-8 w-8 animate-spin text-primary"}),a.jsx("p",{className:"text-muted-foreground",children:"Checking access..."})]})});if(!l)return a.jsx(Ur,{to:"/",replace:!0})}return a.jsx(a.Fragment,{children:t})},mt=u.forwardRef(({className:t,...e},r)=>a.jsx("div",{ref:r,className:F("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
224mt.displayName="Card";const vm=u.forwardRef(({className:t,...e},r)=>a.jsx("div",{ref:r,className:F("flex flex-col space-y-1.5 p-6",t),...e}));vm.displayName="CardHeader";const xm=u.forwardRef(({className:t,...e},r)=>a.jsx("h3",{ref:r,className:F("text-2xl font-semibold leading-none tracking-tight",t),...e}));xm.displayName="CardTitle";const bm=u.forwardRef(({className:t,...e},r)=>a.jsx("p",{ref:r,className:F("text-sm text-muted-foreground",t),...e}));bm.displayName="CardDescription";const ht=u.forwardRef(({className:t,...e},r)=>a.jsx("div",{ref:r,className:F("p-6 pt-0",t),...e}));ht.displayName="CardContent";const wm=u.forwardRef(({className:t,...e},r)=>a.jsx("div",{ref:r,className:F("flex items-center p-6 pt-0",t),...e}));wm.displayName="CardFooter";function _m(){const[t,e]=u.useState(null),[r,n]=u.useState(!1),[s,o]=u.useState(!1),[i,l]=u.useState(!1),[d,c]=u.useState(null);u.useEffect(()=>{const p=window.matchMedia("(display-mode: standalone)").matches,m=window.navigator.standalone===!0;o(p||m);const x=v=>{v.preventDefault(),e(v),n(!0)},y=()=>{o(!0),n(!1),e(null)};return window.addEventListener("beforeinstallprompt",x),window.addEventListener("appinstalled",y),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(v=>{c(v),v.addEventListener("updatefound",()=>{const w=v.installing;w&&w.addEventListener("statechange",()=>{w.state==="installed"&&navigator.serviceWorker.controller&&l(!0)})})}).catch(v=>{console.error("[PWA] Service Worker registration failed:",v)}),()=>{window.removeEventListener("beforeinstallprompt",x),window.removeEventListener("appinstalled",y)}},[]);const f=u.useCallback(async()=>{if(!t)return!1;try{await t.prompt();const{outcome:p}=await t.userChoice;return p==="accepted"?(n(!1),e(null),!0):!1}catch(p){return console.error("[PWA] Install error:",p),!1}},[t]),h=u.useCallback(()=>{d!=null&&d.waiting&&(d.waiting.postMessage({type:"SKIP_WAITING"}),window.location.reload())},[d]);return{canInstall:r,isInstalled:s,hasUpdate:i,install:f,update:h}}function km(){const{canInstall:t,isInstalled:e,hasUpdate:r,install:n,update:s}=_m(),[o,i]=u.useState(!1),[l,d]=u.useState(!1);u.useEffect(()=>{const h=localStorage.getItem("pwa-install-dismissed");if(h){const p=new Date(h),m=(Date.now()-p.getTime())/(1e3*60*60*24);i(m<7)}},[]),u.useEffect(()=>{r&&d(!0)},[r]);const c=()=>{localStorage.setItem("pwa-install-dismissed",new Date().toISOString()),i(!0)},f=async()=>{await n()&&localStorage.removeItem("pwa-install-dismissed")};return l?a.jsx("div",{className:"fixed bottom-20 left-4 right-4 z-50 animate-slide-up md:left-auto md:right-4 md:max-w-sm",children:a.jsx(mt,{className:"border-primary/50 bg-primary/5 shadow-lg",children:a.jsx(ht,{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Bc,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-sm",children:"Update Available"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"A new version is ready to install"})]}),a.jsx(Y,{size:"sm",onClick:s,children:"Update"}),a.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>d(!1),children:a.jsx(Ot,{className:"h-4 w-4"})})]})})})}):!t||e||o?null:a.jsx("div",{className:"fixed bottom-20 left-4 right-4 z-50 animate-slide-up md:left-auto md:right-4 md:max-w-sm",children:a.jsx(mt,{className:"border-secondary/50 bg-secondary/5 shadow-lg",children:a.jsx(ht,{className:"p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-secondary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Pc,{className:"h-5 w-5 text-secondary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-sm",children:"Install BookPod: 15 Min Summaries"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Get the full app experience"})]}),a.jsx(Y,{size:"sm",className:"bg-secondary hover:bg-secondary/90",onClick:f,children:"Install"}),a.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:c,children:a.jsx(Ot,{className:"h-4 w-4"})})]})})})})}var Xo="AlertDialog",[Sm,Hp]=ir(Xo,[fa]),nt=fa(),Jo=t=>{const{__scopeAlertDialog:e,...r}=t,n=nt(e);return a.jsx(da,{...n,...r,modal:!0})};Jo.displayName=Xo;var jm="AlertDialogTrigger",ei=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,s=nt(r);return a.jsx(ua,{...s,...n,ref:e})});ei.displayName=jm;var Nm="AlertDialogPortal",ti=t=>{const{__scopeAlertDialog:e,...r}=t,n=nt(e);return a.jsx(ca,{...n,...r})};ti.displayName=Nm;var Tm="AlertDialogOverlay",ri=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,s=nt(r);return a.jsx(Tn,{...s,...n,ref:e})});ri.displayName=Tm;var Lt="AlertDialogContent",[Cm,Em]=Sm(Lt),Pm=dl("AlertDialogContent"),ni=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,children:n,...s}
224=t,o=nt(r),i=u.useRef(null),l=Se(e,i),d=u.useRef(null);return a.jsx(cl,{contentName:Lt,titleName:si,docsSlug:"alert-dialog",children:a.jsx(Cm,{scope:r,cancelRef:d,children:a.jsxs(Cn,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:ue(s.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=d.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[a.jsx(Pm,{children:n}),a.jsx(Rm,{contentRef:i})]})})})});ni.displayName=Lt;var si="AlertDialogTitle",ai=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,s=nt(r);return a.jsx(Pn,{...s,...n,ref:e})});ai.displayName=si;var oi="AlertDialogDescription",ii=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,s=nt(r);return a.jsx(An,{...s,...n,ref:e})});ii.displayName=oi;var Am="AlertDialogAction",li=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,s=nt(r);return a.jsx(En,{...s,...n,ref:e})});li.displayName=Am;var ci="AlertDialogCancel",di=u.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,{cancelRef:s}=Em(ci,r),o=nt(r),i=Se(e,s);return a.jsx(En,{...o,...n,ref:i})});di.displayName=ci;var Rm=({contentRef:t})=>{const e=`\`${Lt}\` requires a description for the component to be accessible for screen reader users. 225 226You can add a description to the \`${Lt}\` by passing a \`${oi}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 227 228Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Lt}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 229 230For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return u.useEffect(()=>{var n;document.getElementById((n=t.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Im=Jo,Mm=ei,Lm=ti,ui=ri,fi=ni,mi=li,hi=di,pi=ai,gi=ii;const Om=Im,Wp=Mm,Dm=Lm,yi=u.forwardRef(({className:t,...e},r)=>a.jsx(ui,{className:F("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));yi.displayName=ui.displayName;const vi=u.forwardRef(({className:t,...e},r)=>a.jsxs(Dm,{children:[a.jsx(yi,{}),a.jsx(fi,{ref:r,className:F("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));vi.displayName=fi.displayName;const xi=({className:t,...e})=>a.jsx("div",{className:F("flex flex-col space-y-2 text-center sm:text-left",t),...e});xi.displayName="AlertDialogHeader";const bi=({className:t,...e})=>a.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bi.displayName="AlertDialogFooter";const wi=u.forwardRef(({className:t,...e},r)=>a.jsx(pi,{ref:r,className:F("text-lg font-semibold",t),...e}));wi.displayName=pi.displayName;const _i=u.forwardRef(({className:t,...e},r)=>a.jsx(gi,{ref:r,className:F("text-sm text-muted-foreground",t),...e}));_i.displayName=gi.displayName;const ki=u.forwardRef(({className:t,...e},r)=>a.jsx(mi,{ref:r,className:F(Fn(),t),...e}));ki.displayName=mi.displayName;const Si=u.forwardRef(({className:t,...e},r)=>a.jsx(hi,{ref:r,className:F(Fn({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Si.displayName=hi.displayName;function $m(){const[t,e]=u.useState(!1),r=u.useCallback(o=>{window.history.pushState(null,"",window.location.href),e(!0)},[]);u.useEffect(()=>{window.history.pushState(null,"",window.location.href),window.addEventListener("popstate",r);const o=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",o),()=>{window.removeEventListener("popstate",r),window.removeEventListener("beforeunload",o)}},[r]);const n=()=>{e(!1),window.removeEventListener("popstate",r),window.history.back()},s=()=>{e(!1)};return a.jsx(Om,{open:t,onOpenChange:e,children:a.jsxs(vi,{children:[a.jsxs(xi,{children:[a.jsx(wi,{children:"Exit App?"}),a.jsx(_i,{children:"Are you sure you want to exit BookPod: 15 Min Summaries?"})]}),a.jsxs(bi,{children:[a.jsx(Si,{onClick:s,children:"Stay"}),a.jsx(ki,{onClick:n,children:"Exit"})]})]})})}function zm(){const{user:t}=Pe(),e=Ye(),r=u.useRef(null);return u.useEffect(()=>{if(t)return r.current=z.channel(`user-progress-${t.id}`).on("postgres_changes",{event:"*",schema:"public",table:"user_progress",filter:`user_id=eq.${t.id}`},n=>
230{e.invalidateQueries({queryKey:["user-progress"]}),e.invalidateQueries({queryKey:["continue-listening"]}),n.new&&typeof n.new=="object"&&"book_id"in n.new&&e.invalidateQueries({queryKey:["book-progress",t.id,n.new.book_id]})}).subscribe(),()=>{r.current&&z.removeChannel(r.current)}},[t,e]),null}function Bm(){const{user:t}=Pe(),e=Ye(),r=u.useRef(null);return u.useEffect(()=>{if(t)return r.current=z.channel(`user-stats-${t.id}`).on("postgres_changes",{event:"*",schema:"public",table:"user_stats",filter:`user_id=eq.${t.id}`},()=>{e.invalidateQueries({queryKey:["user-stats"]})}).subscribe(),()=>{r.current&&z.removeChannel(r.current)}},[t,e]),null}var Fm={name:"@lovable.dev/cloud-auth-js",version:"1.1.2",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}},Vm="authorization_response",qm="/~oauth/initiate",Um=["https://oauth.lovable.app","https://lovable.dev"],Hm="lovable://oauth-callback",Wm="http://127.0.0.1/iframe-oauth/callback",Zm=500,Ym=12e4;function Km(t){let e;const r=new Promise(o=>{e=o}),n=o=>{if(!t.some(d=>o.origin===d))return;const l=o.data;!l||typeof l!="object"||l.type===Vm&&e(l.response)},s=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:s,messagePromise:r}}function Qm(t){const e=window.screenX!==0||window.screenY!==0||!t,r=e?window.outerWidth*.5:window.screen.width*.5,n=e?window.outerHeight*.5:window.screen.height*.5,s=e?window.screenX+(window.outerWidth-r)/2:(window.screen.width-r)/2,o=e?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:r,height:n,left:s,top:o}}function Ts(t,e){return t.state!==e?{error:new Error("State is invalid")}:t.error?t.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(t.error_description??"Sign in failed")}:!t.access_token||!t.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:t.access_token,refresh_token:t.refresh_token},error:null}}function Gm(){const t=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(t)||/Macintosh/i.test(t)&&navigator.maxTouchPoints>1)}function Xm(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(t=>t.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function Jm(t={}){const e=t.oauthBrokerUrl??qm,r=t.supportedOAuthOrigins??Um;async function n(s,o={}){let i=!1;try{i=window.self!==window.top}catch{i=!0}const l=navigator.userAgent,d=/LovableApp\//.test(l),c=!d&&/lovable/i.test(l),f=Xm();let h=o.redirect_uri??window.location.origin;d&&i?h=Hm:c&&i&&(h=Wm);const p=new URLSearchParams({...o.extraParams,provider:s,redirect_uri:h,state:f});if(!i)return window.location.href=`${e}?${p.toString()}`,{error:null,redirected:!0};!d&&!c&&p.set("response_mode","web_message");const m=`${e}?${p.toString()}`,x=c?[...r,window.location.origin]:r,{messagePromise:y,cleanup:v}=Km(x);let w;if(Gm())w=window.open(m,"_blank");else{const{width:N,height:D,left:E,top:T}=Qm(i);w=window.open(m,"oauth",`width=${N},height=${D},left=${E},top=${T}`)}if(!w&&(d||c)){let N;const D=new Promise((E,T)=>{N=setTimeout(()=>{T(new Error("OAuth timed out waiting for response"))},Ym)});try{const E=await Promise.race([y,D]);return Ts(E,f)}catch(E){return{error:E instanceof Error?E:new Error(String(E))}}finally{N&&clearTimeout(N),v()}}if(!w)return v(),{error:new Error("Popup was blocked")};let _;const S=new Promise((N,D)=>{_=setInterval(()=>{w.closed&&(clearInterval(_),D(new Error("Sign in was cancelled")))},Zm)});try{const N=await Promise.race([y,S]);return Ts(N,f)}catch(N){return{error:N instanceof Error?N:new Error(String(N))}}finally{clearInterval(_),v(),w==null||w.close()}}return{signInWithOAuth:n}}typeof window<"u"&&(window.__lovable_cloud_auth_js_version=Fm.version);function eh(t={}){return Jm(t)}const th=eh(),ji={auth:{signInWithOAuth:async(t,e)=>{const r=await th.signInWithOAuth(t,{redirect_uri:e==null?void 0:e.redirect_uri,extraParams:{...e==null?void 0:e.extraParams}});if(r.redirected||r.error)return r;try{await z.auth.setSession(r.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return r}}},Je=u.forwardRef(({className:t,type:e,...r},n)=>
230a.jsx("input",{type:e,className:F("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...r}));Je.displayName="Input";var rh="Label",Ni=u.forwardRef((t,e)=>a.jsx(we.label,{...t,ref:e,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ni.displayName=rh;var Ti=Ni;const nh=Lr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ue=u.forwardRef(({className:t,...e},r)=>a.jsx(Ti,{ref:r,className:F(nh(),t),...e}));Ue.displayName=Ti.displayName;var sh="Separator",Cs="horizontal",ah=["horizontal","vertical"],Ci=u.forwardRef((t,e)=>{const{decorative:r,orientation:n=Cs,...s}=t,o=oh(n)?n:Cs,l=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return a.jsx(we.div,{"data-orientation":o,...l,...s,ref:e})});Ci.displayName=sh;function oh(t){return ah.includes(t)}var Ei=Ci;const Kn=u.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},s)=>a.jsx(Ei,{ref:s,decorative:r,orientation:e,className:F("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...n}));Kn.displayName=Ei.displayName;const Es="https://fifteenminbookpod.lovable.app";function zr({title:t,description:e,path:r,image:n=`${Es}/logo.png`,type:s="website",jsonLd:o}){const i=`${Es}${r}`,l=o?Array.isArray(o)?o:[o]:[];return a.jsxs(Zl,{children:[a.jsx("title",{children:t}),a.jsx("meta",{name:"description",content:e}),a.jsx("link",{rel:"canonical",href:i}),a.jsx("meta",{property:"og:type",content:s}),a.jsx("meta",{property:"og:title",content:t}),a.jsx("meta",{property:"og:description",content:e}),a.jsx("meta",{property:"og:url",content:i}),a.jsx("meta",{property:"og:image",content:n}),a.jsx("meta",{name:"twitter:title",content:t}),a.jsx("meta",{name:"twitter:description",content:e}),a.jsx("meta",{name:"twitter:url",content:i}),a.jsx("meta",{name:"twitter:image",content:n}),l.map((d,c)=>a.jsx("script",{type:"application/ld+json",children:JSON.stringify(d)},c))]})}function ih(t){return!t||!t.startsWith("/")||t.startsWith("//")||/[\s\0]/.test(t)?null:t}function rr(t){const e=new URLSearchParams(t);return ih(e.get("next"))}var oe;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),i={};for(const l of o)i[l]=s[l];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(oe||(oe={}));var Ps;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ps||(Ps={}));const L=oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ct=t=>{switch(typeof t){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(t)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":return Array.isArray(t)?L.array:t===null?L.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?L.promise:typeof Map<"u"&&t instanceof Map?L.map:typeof Set<"u"&&t instanceof Set?L.set:typeof Date<"u"&&t instanceof Date?L.date:L.object;default:return L.unknown}}
vendor: 6,011 bytes, line 230
230,j=oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class tt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let l=n,d=0;for(;d<i.path.length;){const c=i.path[d];d===i.path.length-1?(l[c]=l[c]||{_errors:[]},l[c]._errors.push(r(i))):l[c]=l[c]||{_errors:[]},l=l[c],d++}}};return s(this),n}static assert(e){if(!(e instanceof tt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}tt.create=t=>new tt(t);const bn=(t,e)=>{let r;switch(t.code){case j.invalid_type:t.received===L.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case j.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,oe.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:r=`Unrecognized key(s) in object: ${oe.joinValues(t.keys,", ")}`;break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${oe.joinValues(t.options)}`;break;case j.invalid_enum_value:r=`Invalid enum value. Expected ${oe.joinValues(t.options)}, received '${t.received}'`;break;case j.invalid_arguments:r="Invalid function arguments";break;case j.invalid_return_type:r="Invalid function return type";break;case j.invalid_date:r="Invalid date";break;case j.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case j.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case j.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case j.custom:r="Invalid input";break;case j.invalid_intersection_types:r="Intersection results could not be merged";break;case j.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case j.not_finite:r="Number must be finite";break;default:r=e.defaultError,oe.assertNever(t)}return{message:r}};let lh=bn;function ch(){return lh}const dh=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let l="";const d=n.filter(c=>!!c).slice().reverse();for(const c of d)l=c(i,{data:e,defaultError:l}).message;return{...s,path:o,message:l}};function I(t,e){const r=ch(),n=dh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===bn?void 0:bn].filter(s=>!!s)});t.common.issues.push(n)}class Me{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return H;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return Me.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return H;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:e.value,value:n}}}const H=Object.freeze({status:"aborted"}),nr=t=>({status:"dirty",value:t}),$e=t=>
vendor: 27,698 bytes, line 230
230({status:"valid",value:t}),As=t=>t.status==="aborted",Rs=t=>t.status==="dirty",$t=t=>t.status==="valid",Cr=t=>typeof Promise<"u"&&t instanceof Promise;var O;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(O||(O={}));class pt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Is=(t,e)=>{if($t(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new tt(t.common.issues);return this._error=r,this._error}}};function J(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,l)=>{const{message:d}=t;return i.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:d??n??l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:d??r??l.defaultError}},description:s}}class se{get description(){return this._def.description}_getType(e){return ct(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Me,ctx:{common:e.parent.common,data:e.data,parsedType:ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Cr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ct(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Is(n,s)}"~validate"(e){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ct(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:r});return $t(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(o=>$t(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ct(e)},s=this._parse({data:e,path:n.path,parent:n}),o=await(Cr(s)?s:Promise.resolve(s));return Is(n,o)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=e(s),l=()=>o.addIssue({code:j.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(l(),!1)):i?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new Ft({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ut.create(this,this._def)}nullable(){return Vt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ze.create(this)}promise(){return Rr.create(this,this._def)}or(e){return Pr.create([this,e],this._def)}and(e){return Ar.create(this,e,this._def)}transform(e){return new Ft({...J(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new kn({...J(this._def),innerType:this,defaultValue:r,typeName:W.ZodDefault})}brand(){return new Ih({typeName:W.ZodBranded,type:this,...J(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Sn({...J(this._def),innerType:this,catchValue:r,typeName:W.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Qn.create(this,e)}readonly(){return jn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uh=/^c[^\s-]{8,}$/i,fh=/^[0-9a-z]+$/,mh=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hh=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ph=/^[a-z0-9_-]{21}$/i,gh=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,yh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let tn;const bh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_h=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,kh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sh=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jh=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Pi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Nh=new RegExp(`^${Pi}$`);function Ai(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Th(t){return new RegExp(`^${Ai(t)}$`)}function Ch(t){let e=`${Pi}T${Ai(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Eh(t,e){return!!((e==="v4"||!e)&&bh.test(t)||(e==="v6"||!e)&&_h.test(t))}function Ph(t,e){if(!gh.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Ah(t,e){return!!((e==="v4"||!e)&&wh.test(t)||(e==="v6"||!e)&&kh.test(t))}class et extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.string){const o=this._getOrReturnCtx(e);return I(o,{code:j.invalid_type,expected:L.string,received:o.parsedType}),H}const n=new Me;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),I(s,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),I(s,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=e.data.length>o.value,l=e.data.length<o.value;(i||l)&&(s=this._getOrReturnCtx(e,s),i?I(s,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&I(s,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")vh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"email",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")tn||(tn=new RegExp(xh,"u")),tn.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"emoji",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")hh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"uuid",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")ph.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"nanoid",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")uh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"cuid",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")fh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"cuid2",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")mh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"ulid",code:j.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),I(s,{validation:"url",code:j.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"regex",code:j.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ch(o).test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Nh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Th(o).test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{code:j.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?yh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"duration",code:j.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Eh(e.data,o.version)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"ip",code:j.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Ph(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"jwt",code:j.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Ah(e.data,o.version)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"cidr",code:j.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Sh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"base64",code:j.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?jh.test(e.data)||(s=this._getOrReturnCtx(e,s),I(s,{validation:"base64url",code:j.invalid_string,message:o.message}),n.dirty()):oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:j.invalid_string,...O.errToObj(n)})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...O.errToObj(e)})}url(e){return this._addCheck({kind:"url",...O.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...O.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...O.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...O.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...O.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...O.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...O.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...O.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...O.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...O.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...O.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...O.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...O.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...O.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...O.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...O.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...O.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...O.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...O.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...O.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...O.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...O.errToObj(r)})}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new et({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new et({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new et({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}et.create=t=>new et({checks:[],typeName:W.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...J(t)});function Rh(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return o%i/10**s}class _t extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.number){const o=this._getOrReturnCtx(e);return I(o,{code:j.invalid_type,expected:L.number,received:o.parsedType}),H}let n;const s=new Me;for(const o of this._def.checks)o.kind==="int"?oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{code:j.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Rh(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{code:j.not_finite,message:o.message}),s.dirty()):oe.assertNever(o);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,s){return new _t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(s)}]})}_addCheck(e){return new _t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}_t.create=t=>new _t({checks:[],typeName:W.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...J(t)});class kt extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.bigint)return this._getInvalidInput(e);let n;const s=new Me;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),I(n,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):oe.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return I(r,{code:j.invalid_type,expected:L.bigint,received:r.parsedType}),H}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,s){return new kt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(s)}]})}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}kt.create=t=>new kt({checks:[],typeName:W.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...J(t)});class Er extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.boolean){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.boolean,received:n.parsedType}),H}return $e(e.data)}}Er.create=t=>new Er({typeName:W.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...J(t)});class zt extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.date){const o=this._getOrReturnCtx(e);return I(o,{code:j.invalid_type,expected:L.date,received:o.parsedType}),H}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return I(o,{code:j.invalid_date}),H}const n=new Me;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),I(s,{code:j.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),I(s,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}zt.create=t=>new zt({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:W.ZodDate,...J(t)});class Ms extends se{_parse(e){if(this._getType(e)!==L.symbol){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.symbol,received:n.parsedType}),H}return $e(e.data)}}Ms.create=t=>new Ms({typeName:W.ZodSymbol,...J(t)});class Ls extends se{_parse(e){if(this._getType(e)!==L.undefined){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.undefined,received:n.parsedType}),H}return $e(e.data)}}Ls.create=t=>new Ls({typeName:W.ZodUndefined,...J(t)});class Os extends se{_parse(e){if(this._getType(e)!==L.null){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.null,received:n.parsedType}),H}return $e(e.data)}}Os.create=t=>new Os({typeName:W.ZodNull,...J(t)});class Ds extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return $e(e.data)}}Ds.create=t=>new Ds({typeName:W.ZodAny,...J(t)});class $s extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $e(e.data)}}$s.create=t=>new $s({typeName:W.ZodUnknown,...J(t)});class gt extends se{_parse(e){const r=this._getOrReturnCtx(e);return I(r,{code:j.invalid_type,expected:L.never,received:r.parsedType}),H}}gt.create=t=>new gt({typeName:W.ZodNever,...J(t)});class zs extends se{_parse(e){if(this._getType(e)!==L.undefined){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.void,received:n.parsedType}),H}return $e(e.data)}}zs.create=t=>new zs({typeName:W.ZodVoid,...J(t)});class Ze extends se{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==L.array)return I(r,{code:j.invalid_type,expected:L.array,received:r.parsedType}),H;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(i||l)&&(I(r,{code:i?j.too_big:j.too_small,minimum:l?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(I(r,{code:j.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(I(r,{code:j.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,l)=>s.type._parseAsync(new pt(r,i,r.path,l)))).then(i=>Me.mergeArray(n,i));const o=[...r.data].map((i,l)=>s.type._parseSync(new pt(r,i,r.path,l)));return Me.mergeArray(n,o)}
vendor: 4,433 bytes, line 230
230get element(){return this._def.type}min(e,r){return new Ze({...this._def,minLength:{value:e,message:O.toString(r)}})}max(e,r){return new Ze({...this._def,maxLength:{value:e,message:O.toString(r)}})}length(e,r){return new Ze({...this._def,exactLength:{value:e,message:O.toString(r)}})}nonempty(e){return this.min(1,e)}}Ze.create=(t,e)=>new Ze({type:t,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...J(e)});function At(t){if(t instanceof be){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=ut.create(At(n))}return new be({...t._def,shape:()=>e})}else return t instanceof Ze?new Ze({...t._def,type:At(t.element)}):t instanceof ut?ut.create(At(t.unwrap())):t instanceof Vt?Vt.create(At(t.unwrap())):t instanceof St?St.create(t.items.map(e=>At(e))):t}class be extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=oe.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.object){const c=this._getOrReturnCtx(e);return I(c,{code:j.invalid_type,expected:L.object,received:c.parsedType}),H}const{status:n,ctx:s}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||l.push(c);const d=[];for(const c of i){const f=o[c],h=s.data[c];d.push({key:{status:"valid",value:c},value:f._parse(new pt(s,h,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof gt){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of l)d.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(c==="strict")l.length>0&&(I(s,{code:j.unrecognized_keys,keys:l}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of l){const h=s.data[f];d.push({key:{status:"valid",value:f},value:c._parse(new pt(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of d){const h=await f.key,p=await f.value;c.push({key:h,value:p,alwaysSet:f.alwaysSet})}return c}).then(c=>Me.mergeObjectSync(n,c)):Me.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,i;const s=((i=(o=this._def).errorMap)==null?void 0:i.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:O.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new be({...this._def,unknownKeys:"strip"})}passthrough(){return new be({...this._def,unknownKeys:"passthrough"})}extend(e){return new be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new be({...this._def,catchall:e})}pick(e){const r={};for(const n of oe.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new be({...this._def,shape:()=>r})}omit(e){const r={};for(const n of oe.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new be({...this._def,shape:()=>r})}deepPartial(){return At(this)}partial(e){const r={};for(const n of oe.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new be({...this._def,shape:()=>r})}required(e){const r={};for(const n of oe.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ut;)o=o._def.innerType;r[n]=o}return new be({...this._def,shape:()=>r})}keyof(){return Ri(oe.objectKeys(this.shape))}}be.create=(t,e)=>new be({shape:()=>t,unknownKeys:"strip",catchall:gt.create(),typeName:W.ZodObject,...J(e)});be.strictCreate=(t,e)=>new be({shape:()=>t,unknownKeys:"strict",catchall:gt.create(),typeName:W.ZodObject,...J(e)});be.lazycreate=(t,e)=>new be({shape:t,unknownKeys:"strip",catchall:gt.create(),typeName:W.ZodObject,...J(e)});class Pr extends se{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(o){for(const l of o)if(l.result.status==="valid")return l.result;for(const l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;
vendor: 4,753 bytes, line 230
230const i=o.map(l=>new tt(l.ctx.common.issues));return I(r,{code:j.invalid_union,unionErrors:i}),H}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const d of n){const c={...r,common:{...r.common,issues:[]},parent:null},f=d._parseSync({data:r.data,path:r.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const l=i.map(d=>new tt(d));return I(r,{code:j.invalid_union,unionErrors:l}),H}}get options(){return this._def.options}}Pr.create=(t,e)=>new Pr({options:t,typeName:W.ZodUnion,...J(e)});function wn(t,e){const r=ct(t),n=ct(e);if(t===e)return{valid:!0,data:t};if(r===L.object&&n===L.object){const s=oe.objectKeys(e),o=oe.objectKeys(t).filter(l=>s.indexOf(l)!==-1),i={...t,...e};for(const l of o){const d=wn(t[l],e[l]);if(!d.valid)return{valid:!1};i[l]=d.data}return{valid:!0,data:i}}else if(r===L.array&&n===L.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const i=t[o],l=e[o],d=wn(i,l);if(!d.valid)return{valid:!1};s.push(d.data)}return{valid:!0,data:s}}else return r===L.date&&n===L.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ar extends se{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(o,i)=>{if(As(o)||As(i))return H;const l=wn(o.value,i.value);return l.valid?((Rs(o)||Rs(i))&&r.dirty(),{status:r.value,value:l.data}):(I(n,{code:j.invalid_intersection_types}),H)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ar.create=(t,e,r)=>new Ar({left:t,right:e,typeName:W.ZodIntersection,...J(r)});class St extends se{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.array)return I(n,{code:j.invalid_type,expected:L.array,received:n.parsedType}),H;if(n.data.length<this._def.items.length)return I(n,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;!this._def.rest&&n.data.length>this._def.items.length&&(I(n,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,l)=>{const d=this._def.items[l]||this._def.rest;return d?d._parse(new pt(n,i,n.path,l)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>Me.mergeArray(r,i)):Me.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new St({...this._def,rest:e})}}St.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new St({items:t,typeName:W.ZodTuple,rest:null,...J(e)})};class Bs extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.map)return I(n,{code:j.invalid_type,expected:L.map,received:n.parsedType}),H;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([l,d],c)=>({key:s._parse(new pt(n,l,n.path,[c,"key"])),value:o._parse(new pt(n,d,n.path,[c,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const d of i){const c=await d.key,f=await d.value;if(c.status==="aborted"||f.status==="aborted")return H;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(c.value,f.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const d of i){const c=d.key,f=d.value;if(c.status==="aborted"||f.status==="aborted")return H;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(c.value,f.value)}return{status:r.value,value:l}}}}Bs.create=(t,e,r)=>new Bs({valueType:e,keyType:t,typeName:W.ZodMap,...J(r)});class or extends se{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.set)return I(n,{code:j.invalid_type,expected:L.set,received:n.parsedType}),H;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(I(n,{code:j.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(I(n,{code:j.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(d){const c=new Set;for(const f of d){if(f.status==="aborted")return H;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}
vendor: 6,199 bytes, line 230
230const l=[...n.data.values()].map((d,c)=>o._parse(new pt(n,d,n.path,c)));return n.common.async?Promise.all(l).then(d=>i(d)):i(l)}min(e,r){return new or({...this._def,minSize:{value:e,message:O.toString(r)}})}max(e,r){return new or({...this._def,maxSize:{value:e,message:O.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}or.create=(t,e)=>new or({valueType:t,minSize:null,maxSize:null,typeName:W.ZodSet,...J(e)});class Fs extends se{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Fs.create=(t,e)=>new Fs({getter:t,typeName:W.ZodLazy,...J(e)});class _n extends se{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return I(r,{received:r.data,code:j.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:e.data}}get value(){return this._def.value}}_n.create=(t,e)=>new _n({value:t,typeName:W.ZodLiteral,...J(e)});function Ri(t,e){return new Bt({values:t,typeName:W.ZodEnum,...J(e)})}class Bt extends se{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return I(r,{expected:oe.joinValues(n),received:r.parsedType,code:j.invalid_type}),H}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return I(r,{received:r.data,code:j.invalid_enum_value,options:n}),H}return $e(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Bt.create(e,{...this._def,...r})}exclude(e,r=this._def){return Bt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Bt.create=Ri;class Vs extends se{_parse(e){const r=oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.string&&n.parsedType!==L.number){const s=oe.objectValues(r);return I(n,{expected:oe.joinValues(s),received:n.parsedType,code:j.invalid_type}),H}if(this._cache||(this._cache=new Set(oe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=oe.objectValues(r);return I(n,{received:n.data,code:j.invalid_enum_value,options:s}),H}return $e(e.data)}get enum(){return this._def.values}}Vs.create=(t,e)=>new Vs({values:t,typeName:W.ZodNativeEnum,...J(e)});class Rr extends se{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.promise&&r.common.async===!1)return I(r,{code:j.invalid_type,expected:L.promise,received:r.parsedType}),H;const n=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return $e(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Rr.create=(t,e)=>new Rr({type:t,typeName:W.ZodPromise,...J(e)});class Ft extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:i=>{I(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async l=>{if(r.value==="aborted")return H;const d=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return d.status==="aborted"?H:d.status==="dirty"||r.value==="dirty"?nr(d.value):d});{if(r.value==="aborted")return H;const l=this._def.schema._parseSync({data:i,path:n.path,parent:n});return l.status==="aborted"?H:l.status==="dirty"||r.value==="dirty"?nr(l.value):l}}if(s.type==="refinement"){const i=l=>{const d=s.refinement(l,o);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?H:(l.status==="dirty"&&r.dirty(),i(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?H:(l.status==="dirty"&&r.dirty(),i(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$t(i))return H;const l=s.transform(i.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>$t(i)?Promise.resolve(s.transform(i.value,o)).then(l=>({status:r.value,value:l})):H);oe.assertNever(s)}}Ft.create=(t,e,r)=>new Ft({schema:t,typeName:W.ZodEffects,effect:e,...J(r)});Ft.createWithPreprocess=(t,e,r)=>new Ft({schema:e,effect:{type:"preprocess",transform:t},typeName:W.ZodEffects,...J(r)});class ut extends se{_parse(e){return this._getType(e)===L.undefined?$e(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ut.create=(t,e)=>new ut({innerType:t,typeName:W.ZodOptional,...J(e)});class Vt extends se{_parse(e){return this._getType(e)===L.null?$e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vt.create=(t,e)=>new Vt({innerType:t,typeName:W.ZodNullable,...J(e)});class kn extends se{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===L.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}kn.create=(t,e)=>new kn({innerType:t,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...J(e)});class Sn extends se{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cr(s)?s.then(o=>
230({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new tt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...J(e)});class qs extends se{_parse(e){if(this._getType(e)!==L.nan){const n=this._getOrReturnCtx(e);return I(n,{code:j.invalid_type,expected:L.nan,received:n.parsedType}),H}return{status:"valid",value:e.data}}}qs.create=t=>new qs({typeName:W.ZodNaN,...J(t)});class Ih extends se{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Qn extends se{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?H:o.status==="dirty"?(r.dirty(),nr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?H:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Qn({in:e,out:r,typeName:W.ZodPipeline})}}class jn extends se{_parse(e){const r=this._def.innerType._parse(e),n=s=>($t(s)&&(s.value=Object.freeze(s.value)),s);return Cr(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}jn.create=(t,e)=>new jn({innerType:t,typeName:W.ZodReadonly,...J(e)});be.lazycreate;var W;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(W||(W={}));const dt=et.create;_t.create;kt.create;const Zp=Er.create;zt.create;gt.create;Ze.create;const Ii=be.create;be.strictCreate;Pr.create;Ar.create;St.create;const Us=_n.create,Mh=Bt.create;Rr.create;ut.create;Vt.create;const Yp={string:t=>et.create({...t,coerce:!0}),number:t=>_t.create({...t,coerce:!0}),boolean:t=>Er.create({...t,coerce:!0}),bigint:t=>kt.create({...t,coerce:!0}),date:t=>zt.create({...t,coerce:!0})},Lh=Ii({email:dt().email("Please enter a valid email address"),password:dt().min(8,"Password must be at least 8 characters")});function Oh(){const[t,e]=u.useState(!1),[r,n]=u.useState(""),[s,o]=u.useState(""),[i,l]=u.useState(!1),[d,c]=u.useState({}),[f,h]=u.useState(!1),[p,m]=u.useState(0),x=In(),y=jt(),{signIn:v,user:w,profile:_}=Pe(),{toast:S}=lr();u.useEffect(()=>{if(p>0){const E=setTimeout(()=>m(p-1),1e3);return()=>clearTimeout(E)}},[p]);const N=async()=>{if(!(!r||p>0)){l(!0);try{const{error:E}=await z.auth.resend({type:"signup",email:r});E?S({title:"Failed to resend",description:E.message,variant:"destructive"}):(m(60),S({title:"Verification email sent",description:`Check your inbox at ${r}.`}))}finally{l(!1)}}};u.useEffect(()=>{var E,T;if(w){const P=rr(y.search);if(_&&!_.onboarding_completed)x("/onboarding");else if(P)x(P,{replace:!0});else{const C=((T=(E=y.state)==null?void 0:E.from)==null?void 0:T.pathname)||"/";x(C)}}},[w,_,x,y]);const D=async E=>{E.preventDefault(),c({});const T=Lh.safeParse({email:r,password:s});if(!T.success){const P={};
230T.error.errors.forEach(C=>{C.path[0]==="email"&&(P.email=C.message),C.path[0]==="password"&&(P.password=C.message)}),c(P);return}l(!0);try{const{error:P}=await v(r,s);P&&(P.message.includes("Invalid login credentials")?S({title:"Login failed",description:"Invalid email or password. Please try again.",variant:"destructive"}):P.message.includes("Email not confirmed")?(h(!0),S({title:"Email not verified",description:"Please verify your email. You can resend the verification email below.",variant:"destructive"})):S({title:"Login failed",description:P.message,variant:"destructive"}))}catch{S({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{l(!1)}};return a.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-b from-primary/5 to-background",children:[a.jsx(zr,{title:"Sign In | BookPod: 15 Min Summaries",description:"Sign in to BookPod: 15 Min Summaries and continue listening to 15-minute summaries of bestselling books in Hindi and English.",path:"/login"}),a.jsxs("main",{className:"w-full max-w-sm animate-scale-in",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("img",{src:"/logo.webp",alt:"BookPod: 15 Min Summaries",width:"64",height:"64",className:"w-16 h-16 rounded-2xl mx-auto mb-3 object-cover",fetchPriority:"high"}),a.jsxs("div",{className:"font-heading font-bold text-2xl",children:[a.jsx("span",{className:"text-foreground",children:"BookPod:"})," ",a.jsx("span",{className:"text-[#3d9a8b]",children:"15 Min Summaries"})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Listen a book in 15 min"}),a.jsx("h1",{className:"font-heading text-xl font-semibold mt-5",children:"Welcome Back"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to continue learning"})]}),a.jsx(mt,{children:a.jsxs(ht,{className:"pt-6",children:[a.jsxs("form",{onSubmit:D,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"email",children:"Email"}),a.jsxs("div",{className:"relative",children:[a.jsx($n,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"email",type:"email",placeholder:"[email protected]",value:r,onChange:E=>n(E.target.value),className:"pl-10",required:!0})]}),d.email&&a.jsx("p",{className:"text-sm text-destructive",children:d.email})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ue,{htmlFor:"password",children:"Password"}),a.jsx(Ne,{to:"/forgot-password",className:"text-sm text-primary hover:underline",children:"Forgot password?"})]}),a.jsxs("div",{className:"relative",children:[a.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"password",type:t?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:s,onChange:E=>o(E.target.value),className:"pl-10 pr-10",required:!0}),a.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>e(!t),"aria-label":t?"Hide password":"Show password",children:t?a.jsx(Wa,{className:"h-4 w-4"}):a.jsx(Za,{className:"h-4 w-4"})})]}),d.password&&a.jsx("p",{className:"text-sm text-destructive",children:d.password})]}),a.jsx(Y,{type:"submit",className:"w-full",size:"lg",disabled:i,children:i?"Signing in...":"Sign In"}),f&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-center space-y-2",children:[a.jsxs("p",{className:"text-sm text-foreground",children:["Your email ",a.jsx("span",{className:"font-medium",children:r})," is not verified yet."]}),a.jsx(Y,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:N,disabled:i||p>0||!r,children:p>0?`Resend verification email in ${p}s`:"Resend verification email"})]})]}),a.jsxs("div",{className:"relative my-6",children:[a.jsx(Kn,{}),a.jsx("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-card px-2 text-xs text-muted-foreground",children:"or continue with"})]}),a.jsxs(Y,{variant:"outline",className:"w-full",disabled:i,onClick:async()=>
230{l(!0);try{const E=rr(y.search),T=await ji.auth.signInWithOAuth("google",{redirect_uri:E?`${window.location.origin}${E}`:window.location.origin});T.error&&S({title:"Google Sign In failed",description:T.error.message,variant:"destructive"})}catch{S({title:"Error",description:"An unexpected error occurred.",variant:"destructive"})}finally{l(!1)}},children:[a.jsxs("svg",{className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[a.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),a.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),a.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),a.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]}),a.jsx("p",{className:"text-xs text-center text-muted-foreground mt-3",children:"You'll be redirected to Google to sign in to BookPod: 15 Min Summaries."})]})}),a.jsxs("div",{className:"text-center mt-6 flex items-center justify-center gap-3 flex-wrap",children:[a.jsx(Ne,{to:"/terms",className:"text-xs text-muted-foreground hover:text-primary hover:underline",children:"Terms & Conditions"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsx(Ne,{to:"/refund-policy",className:"text-xs text-muted-foreground hover:text-primary hover:underline",children:"Cancellation & Refund Policy"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsx(Ne,{to:"/privacy-policy",className:"text-xs text-muted-foreground hover:text-primary hover:underline",children:"Privacy Policy"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsx(Ne,{to:"/shipping-policy",className:"text-xs text-muted-foreground hover:text-primary hover:underline",children:"Shipping & Delivery"})]}),a.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-3 mb-8",children:["Don't have an account?"," ",a.jsx(Ne,{to:rr(y.search)?`/signup?next=${encodeURIComponent(rr(y.search))}`:"/signup",className:"text-primary font-medium hover:underline",children:"Sign Up"})]})]})]})}var Br="Checkbox",[Dh,Kp]=ir(Br),[$h,Gn]=Dh(Br);function zh(t){const{__scopeCheckbox:e,checked:r,children:n,defaultChecked:s,disabled:o,form:i,name:l,onCheckedChange:d,required:c,value:f="on",internal_do_not_use_render:h}=t,[p,m]=Nn({prop:r,defaultProp:s??!1,onChange:d,caller:Br}),[x,y]=u.useState(null),[v,w]=u.useState(null),_=u.useRef(!1),S=x?!!i||!!x.closest("form"):!0,N={checked:p,disabled:o,setChecked:m,control:x,setControl:y,name:l,form:i,value:f,hasConsumerStoppedPropagationRef:_,required:c,defaultChecked:ft(s)?!1:s,isFormControl:S,bubbleInput:v,setBubbleInput:w};return a.jsx($h,{scope:e,...N,children:Bh(h)?h(N):n})}var Mi="CheckboxTrigger",Li=u.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...n},s)=>{const{control:o,value:i,disabled:l,checked:d,required:c,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:x}=Gn(Mi,t),y=Se(s,f),v=u.useRef(d);return u.useEffect(()=>{const w=o==null?void 0:o.form;if(w){const _=()=>h(v.current);return w.addEventListener("reset",_),()=>w.removeEventListener("reset",_)}},[o,h]),a.jsx(we.button,{type:"button",role:"checkbox","aria-checked":ft(d)?"mixed":d,"aria-required":c,"data-state":Bi(d),"data-disabled":l?"":void 0,disabled:l,value:i,...n,ref:y,onKeyDown:ue(e,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:ue(r,w=>{h(_=>ft(_)?!0:!_),x&&m&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})})});Li.displayName=Mi;var Xn=u.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:i,disabled:l,value:d,onCheckedChange:c,form:f,...h}=t;return a.jsx(zh,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:l,required:i,onCheckedChange:c,name:n,form:f,value:d,internal_do_not_use_render:({isFormControl:p})=>a.jsxs(a.Fragment,{children:[a.jsx(Li,{...h,ref:e,__scopeCheckbox:r}),p&&a.jsx(zi,{__scopeCheckbox:r})]})})});Xn.displayName=Br;var Oi="CheckboxIndicator",Di=u.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...s}=t,o=Gn(Oi,r);return a.jsx(qt,{present:n||ft(o.checked)||o.checked===!0,children:a.jsx(we.span,{"data-state":Bi(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});Di.displayName=Oi;var $i="CheckboxBubbleInput",zi=u.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:l,disabled:d,name:c,value:f,form:h,bubbleInput:p,setBubbleInput:m}=Gn($i,t),x=Se(r,m),y=xo(o),v=la(n);u.useEffect(()=>{const _=p;if(!_)return;const S=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(S,"checked").set,E=!s.current;if(y!==o&&D){const T=new Event("click",{bubbles:E});_.indeterminate=ft(o),D.call(_,ft(o)?!1:o),_.dispatchEvent(T)}},[p,y,o,s]);const w=u.useRef(ft(o)?!1:o);return a.jsx(we.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??w.current,required:l,disabled:d,name:c,value:f,form:h,...e,tabIndex:-1,ref:x,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});zi.displayName=$i;function Bh(t){return typeof t=="function"}function ft(t){return t==="indeterminate"}function Bi(t){return ft(t)?"indeterminate":t?"checked":"unchecked"}const Fi=u.forwardRef(({className:t,...e},r)=>a.jsx(Xn,{ref:r,className:F("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:a.jsx(Di,{className:F("flex items-center justify-center text-current"),children:a.jsx(Ha,{className:"h-4 w-4"})})}));Fi.displayName=Xn.displayName;const Fh=new Set(["mailinator.com","guerrillamail.com","10minutemail.com","tempmail.com","throwaway.email","yopmail.com","trashmail.com","fakeinbox.com","getnada.com","dispostable.com","maildrop.cc","sharklasers.com"]),Vh=Ii({fullName:dt().trim().min(2,"Please enter your full name").max(80),email:dt().trim().email("Please enter a valid email").max(255).refine(t=>{var e;return!Fh.has(((e=t.split("@")[1])==null?void 0:e.toLowerCase())??"")},{message:"Disposable email addresses are not allowed"}
230),phone:dt().trim().max(20).optional().or(Us("")).refine(t=>!t||/^[+0-9 ()-]{6,20}$/.test(t),{message:"Enter a valid phone number"}),language:Mh(["english","hindi"]),password:dt().min(8,"Password must be at least 8 characters").max(72,"Password is too long"),confirmPassword:dt(),acceptTerms:Us(!0,{errorMap:()=>({message:"You must accept the Terms and Privacy Policy"})})}).refine(t=>t.password===t.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});function qh(){const t=In(),{user:e,signUp:r}=Pe(),{toast:n}=lr(),s=jt(),o=rr(s.search),i=o?`/login?next=${encodeURIComponent(o)}`:"/login",[l,d]=u.useState(""),[c,f]=u.useState(""),[h,p]=u.useState(""),[m,x]=u.useState("english"),[y,v]=u.useState(""),[w,_]=u.useState(""),[S,N]=u.useState(!1),[D,E]=u.useState(!1),[T,P]=u.useState({}),[C,V]=u.useState(!1),[U,M]=u.useState(!1);u.useEffect(()=>{e&&t(o??"/")},[e,t,o]);const ae=async q=>{q.preventDefault(),P({});const re=Vh.safeParse({fullName:l,email:c,phone:h,language:m,password:y,confirmPassword:w,acceptTerms:S});if(!re.success){const K={};re.error.errors.forEach(ie=>{const $=ie.path[0];$&&!K[$]&&(K[$]=ie.message)}),P(K);return}V(!0);try{const{error:K}=await r(c,y,l,{phone:h||void 0,language_preference:m});K?n({title:"Sign up failed",description:K.message,variant:"destructive"}):(n({title:"Account created",description:"We've sent an activation link to your email."}),t("/verify-email",{state:{email:c}}))}catch{n({title:"Error",description:"Unexpected error. Please try again.",variant:"destructive"})}finally{V(!1)}},B=async()=>{M(!0);try{const q=await ji.auth.signInWithOAuth("google",{redirect_uri:o?`${window.location.origin}${o}`:window.location.origin});q.error&&n({title:"Google Sign Up failed",description:q.error.message,variant:"destructive"})}catch{n({title:"Error",description:"Unexpected error. Please try again.",variant:"destructive"})}finally{M(!1)}};return a.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-b from-primary/5 to-background",children:[a.jsx(zr,{title:"Create Account | BookPod: 15 Min Summaries",description:"Create your BookPod: 15 Min Summaries account with email and password to listen to 15-minute summaries of bestselling books.",path:"/signup"}),a.jsxs("main",{className:"w-full max-w-sm animate-scale-in py-6",children:[a.jsxs("div",{className:"text-center mb-6",children:[a.jsx("img",{src:"/logo.webp",alt:"BookPod: 15 Min Summaries",width:"56",height:"56",className:"w-14 h-14 rounded-2xl mx-auto mb-2 object-cover"}),a.jsxs("div",{className:"font-heading font-bold text-xl",children:[a.jsx("span",{className:"text-foreground",children:"BookPod:"})," ",a.jsx("span",{className:"text-[#3d9a8b]",children:"15 Min Summaries"})]}),a.jsx("h1",{className:"font-heading text-xl font-semibold mt-4",children:"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Set your own password â we never see your Gmail credentials."})]}),a.jsx(mt,{children:a.jsxs(ht,{className:"pt-6",children:[a.jsxs("form",{onSubmit:ae,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"fullName",children:"Full name"}),a.jsxs("div",{className:"relative",children:[a.jsx(Xa,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"fullName",value:l,onChange:q=>d(q.target.value),placeholder:"Your name",className:"pl-10",required:!0})]}),T.fullName&&a.jsx("p",{className:"text-sm text-destructive",children:T.fullName})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"email",children:"Email"}),a.jsxs("div",{className:"relative",children:[a.jsx($n,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"email",type:"email",value:c,onChange:q=>f(q.target.value),placeholder:"[email protected]",className:"pl-10",required:!0})]}),T.email&&a.jsx("p",{className:"text-sm text-destructive",children:T.email})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ue,{htmlFor:"phone",children:["Phone ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsxs("div",{className:"relative",children:[a.jsx(zc,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"phone",type:"tel",value:h,onChange:q=>p(q.target.value),placeholder:"+91 98765 43210",className:"pl-10"})]}),T.phone&&a.jsx("p",{className:"text-sm text-destructive",children:T.phone})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{children:"Preferred language"}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:["english","hindi"].map(q=>a.jsx(Y,{type:"button",variant:m===q?"default":"outline",onClick:()=>x(q),className:"capitalize",children:q==="english"?"English":"हिनà¥à¤¦à¥"},q))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"password",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"password",type:D?"text":"password",value:y,onChange:q=>v(q.target.value),placeholder:"Min 8 characters",className:"pl-10 pr-10",required:!0}),a.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>E(!D),children:D?a.jsx(Wa,{className:"h-4 w-4"}):a.jsx(Za,{className:"h-4 w-4"})})]}),T.password&&a.jsx("p",{className:"text-sm text-destructive",children:T.password})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"confirmPassword",children:"Confirm password"}),a.jsxs("div",{className:"relative",children:[a.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"confirmPassword",type:D?"text":"password",value:w,onChange:q=>_(q.target.value),placeholder:"Re-enter password",className:"pl-10",required:!0})]}),T.confirmPassword&&a.jsx("p",{className:"text-sm text-destructive",children:T.confirmPassword})]}),a.jsxs("div",{className:"flex items-start gap-2 pt-1",children:[a.jsx(Fi,{id:"terms",checked:S,onCheckedChange:q=>N(!!q),className:"mt-0.5"}),a.jsxs(Ue,{htmlFor:"terms",className:"text-xs font-normal leading-relaxed",children:["I agree to the"," ",a.jsx(Ne,{to:"/terms",className:"text-primary hover:underline",children:"Terms"})," ","and"," ",a.jsx(Ne,{to:"/privacy-policy",className:"text-primary hover:underline",children:"Privacy Policy"}),"."]})]}),T.acceptTerms&&a.jsx("p",{className:"text-sm text-destructive",children:T.acceptTerms}),a.jsx(Y,{type:"submit",className:"w-full",size:"lg",disabled:C,children:C?a.jsxs(a.Fragment,{children:[a.jsx(fn,{className:"h-4 w-4 mr-2 animate-spin"})," Creating account..."]}):"Create account"})]}),a.jsxs("div",{className:"relative my-6",children:[a.jsx(Kn,{}),a.jsx("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-card px-2 text-xs text-muted-foreground",children:"or"})]}),a.jsxs(Y,{variant:"outline",className:"w-full",disabled:U,onClick:B,children:[a.jsxs("svg",{className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[a.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),a.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),a.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),a.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),U?"Connecting...":"Continue with Google"]})]})}),a.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Already have an account?"," ",a.jsx(Ne,{to:i,className:"text-primary font-medium hover:underline",children:"Sign In"})]})]})]})}function Uh(){var p;const t=jt(),e=In(),{user:r}=Pe(),{toast:n}=lr(),s=(p=t.state)==null?void 0:p.email,o=new URLSearchParams(t.search).get("email")??void 0,i=s||o||"",[l,d]=u.useState(0),[c,f]=u.useState(!1);u.useEffect(()=>{r&&e("/")},[r,e]),u.useEffect(()=>{if(l<=0)return;const m=setTimeout(()=>d(x=>x-1),1e3);return()=>clearTimeout(m)},[l]);const h=async()=>
230{if(!(!i||l>0)){f(!0);try{const{error:m}=await z.auth.resend({type:"signup",email:i});m?n({title:"Failed to resend",description:m.message,variant:"destructive"}):(d(60),n({title:"Activation email sent",description:`Check your inbox at ${i}.`}))}finally{f(!1)}}};return a.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-b from-primary/5 to-background",children:[a.jsx(zr,{title:"Verify your email | BookPod: 15 Min Summaries",description:"Activate your BookPod: 15 Min Summaries account.",path:"/verify-email"}),a.jsx("main",{className:"w-full max-w-sm animate-scale-in",children:a.jsx(mt,{children:a.jsxs(ht,{className:"pt-8 pb-6 text-center space-y-4",children:[a.jsx("div",{className:"mx-auto w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx($c,{className:"h-7 w-7 text-primary"})}),a.jsx("h1",{className:"font-heading text-xl font-semibold",children:"Check your inbox"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent an activation link to"," ",a.jsx("span",{className:"font-medium text-foreground",children:i||"your email"}),". Click the link to activate your account, then sign in."]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Didn't get it? Check your spam folder, or resend below."}),a.jsx(Y,{variant:"outline",className:"w-full",onClick:h,disabled:c||l>0||!i,children:l>0?`Resend in ${l}s`:"Resend activation email"}),a.jsx(Y,{asChild:!0,className:"w-full",size:"lg",children:a.jsx(Ne,{to:"/login",children:"Go to Sign In"})})]})})})]})}const Hh=dt().email("Please enter a valid email address");function Wh(){const[t,e]=u.useState(""),[r,n]=u.useState(!1),[s,o]=u.useState(!1),[i,l]=u.useState(""),{resetPassword:d}=Pe(),{toast:c}=lr(),f=async h=>{h.preventDefault(),l("");const p=Hh.safeParse(t);if(!p.success){l(p.error.errors[0].message);return}n(!0);try{const{error:m}=await d(t);m?c({title:"Error",description:m.message,variant:"destructive"}):o(!0)}catch{c({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{n(!1)}};return s?a.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-b from-primary/5 to-background",children:a.jsx("div",{className:"w-full max-w-sm animate-scale-in",children:a.jsx(mt,{children:a.jsxs(ht,{className:"pt-6 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(Tc,{className:"h-8 w-8 text-primary"})}),a.jsx("h2",{className:"font-heading text-xl font-bold mb-2",children:"Check your email"}),a.jsxs("p",{className:"text-muted-foreground mb-6",children:["We've sent a password reset link to ",a.jsx("span",{className:"font-medium text-foreground",children:t})]}),a.jsx(Ne,{to:"/login",children:a.jsx(Y,{variant:"outline",className:"w-full",children:"Back to Login"})})]})})})}):a.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-b from-primary/5 to-background",children:[a.jsx(zr,{title:"Reset Password | BookPod: 15 Min Summaries",description:"Reset your BookPod: 15 Min Summaries password and regain access to your account.",path:"/forgot-password"}),a.jsxs("div",{className:"w-full max-w-sm animate-scale-in",children:[a.jsx("div",{className:"mb-6",children:a.jsxs(Ne,{to:"/login",className:"inline-flex items-center text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(Ua,{className:"h-4 w-4 mr-2"}),"Back to Login"]})}),a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("img",{src:"/logo.webp",alt:"BookPod: 15 Min Summaries",width:"64",height:"64",className:"w-16 h-16 rounded-2xl mx-auto mb-3 object-cover"}),a.jsxs("div",{className:"font-heading font-bold text-2xl",children:[a.jsx("span",{className:"text-foreground",children:"BookPod:"})," ",a.jsx("span",{className:"text-[#3d9a8b]",children:"15 Min Summaries"})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Listen a book in 15 min"}),a.jsx("h1",{className:"font-heading text-xl font-semibold mt-5",children:"Forgot Password?"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your email to receive a reset link"})]}),a.jsx(mt,{children:a.jsx(ht,{className:"pt-6",children:a.jsxs("form",{onSubmit:f,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ue,{htmlFor:"email",children:"Email"}),a.jsxs("div",{className:"relative",children:[a.jsx($n,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Je,{id:"email",type:"email",placeholder:"[email protected]",value:t,onChange:h=>e(h.target.value),className:"pl-10",required:!0})]}),i&&a.jsx("p",{className:"text-sm text-destructive",children:i})]}),a.jsx(Y,{type:"submit",className:"w-full",size:"lg",disabled:r,children:r?"Sending...":"Send Reset Link"})]})})}),a.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Remember your password?"," ",a.jsx(Ne,{to:"/login",className:"text-primary font-medium hover:underline",children:"Sign In"})]})]})]})}const Zh=ve(()=>he(()=>import("./Landing-DX8HZN4T.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),Yh=ve(()=>he(()=>import("./Dashboard-Cr77yRNp.js"),__vite__mapDeps([7,1,2,5,8,9,3,10,11,4,6]))),Hs=ve
230(()=>he(()=>import("./Library-BzIPnZ1D.js"),__vite__mapDeps([12,1,2,13,14,8,9,3,10,15,16,5,6]))),Kh=ve(()=>he(()=>import("./Search-DNC8tXGF.js"),__vite__mapDeps([17,1,2,9,18,19,3,16,8,10,5,6]))),Qh=ve(()=>he(()=>import("./Profile-Cv-KDg0k.js"),__vite__mapDeps([20,1,2,21,13,14,9,22,23,24,25,4,3,26,27,5,6]))),Ws=ve(()=>he(()=>import("./BookDetails-DjNpjIDR.js"),__vite__mapDeps([28,1,2,9,10,3,29,24,5,6]))),Gh=ve(()=>he(()=>import("./Onboarding-ewLBSpl0.js"),__vite__mapDeps([30,1,2,14,31,4,15,5,6]))),Xh=ve(()=>he(()=>import("./NotFound-cIh3cDPH.js"),__vite__mapDeps([32,1,2]))),Jh=ve(()=>he(()=>import("./Subscription-DCTPCCWv.js"),__vite__mapDeps([33,1,2,22,9,10,11,5,34,35,6]))),ep=ve(()=>he(()=>import("./PaymentComingSoon-DcLumCy3.js"),__vite__mapDeps([36,1,2,3,23,5,6]))),Zs=ve(()=>he(()=>import("./Settings-BZh3BEZ5.js"),__vite__mapDeps([37,1,2,38,31,39,18,19,3,25,26,5,6]))),tp=ve(()=>he(()=>import("./AccountSettings-u4_gaYzG.js"),__vite__mapDeps([40,1,2,38,31,21,5,6]))),rp=ve(()=>he(()=>import("./Help-coz0vVax.js"),__vite__mapDeps([41,1,2,38,31,19,24,5,6]))),np=ve(()=>he(()=>import("./TermsAndConditions-AdrNtvjz.js"),__vite__mapDeps([42,1,2,5,6]))),sp=ve(()=>he(()=>import("./RefundPolicy-DGi4hVor.js"),__vite__mapDeps([43,1,2,5,6]))),ap=ve(()=>he(()=>import("./PrivacyPolicy-BkZLRPXc.js"),__vite__mapDeps([44,1,2,5,6]))),op=ve(()=>he(()=>import("./ShippingPolicy-D4f8vWyi.js"),__vite__mapDeps([45,1,2,5,6]))),ip=ve(()=>he(()=>import("./DeleteAccount-BBVkDyIy.js"),__vite__mapDeps([46,1,2,26,5,6]))),lp=ve(()=>he(()=>import("./OAuthConsent-CEnvww9U.js"),__vite__mapDeps([47,1,2,35,5,6]))),cp=ve(()=>he(()=>import("./AdminDashboard-C3DZzasv.js"),__vite__mapDeps([48,1,2,49,27,23,4,5,6]))),dp=ve(()=>he(()=>import("./AdminBooks-BZCtlod4.js"),__vite__mapDeps([50,1,2,9,49,27,23,39,18,19,29,26,5,6]))),up=ve(()=>he(()=>import("./AdminUsers-CELrv94p.js"),__vite__mapDeps([51,1,2,9,21,18,19,49,27,23,52,25,26,5,6]))),fp=ve(()=>he(()=>import("./AdminSubscriptions--CYhYZWH.js"),__vite__mapDeps([53,1,2,9,21,18,19,49,27,23,52,5,6])));function Vi(){return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:a.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}function mp({children:t}){return zm(),Bm(),a.jsx(a.Fragment,{children:t})}function hp(){const{user:t,loading:e}=Pe();return e?a.jsx(Vi,{}):t?a.jsx(ke,{children:a.jsx(Xt,{children:a.jsx(Yh,{})})}):a.jsx(Zh,{})}const pp=new pl({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*30,retry:2,refetchOnWindowFocus:!0,refetchOnMount:!1}}}),gp=()=>a.jsx(gl,{client:pp,children:a.jsx(uu,{defaultTheme:"system",children:a.jsx(hu,{children:a.jsx(ml,{children:a.jsx(_u,{children:a.jsx(vu,{children:a.jsx(cu,{children:a.jsxs(mp,{children:[a.jsx(Pd,{}),a.jsx(lu,{}),a.jsx(u.Suspense,{fallback:a.jsx(Vi,{}),children:a.jsxs(hl,{children:[a.jsx(le,{path:"/login",element:a.jsx(Oh,{})}),a.jsx(le,{path:"/signup",element:a.jsx(qh,{})}),a.jsx(le,{path:"/verify-email",element:a.jsx(Uh,{})}),a.jsx(le,{path:"/forgot-password",element:a.jsx(Wh,{})}),a.jsx(le,{path:"/onboarding",element:a.jsx(ke,{requireOnboarding:!1,children:a.jsx(Gh,{})})}),a.jsx(le,{path:"/",element:a.jsx(hp,{})}),a.jsx(le,{path:"/library",element:a.jsx(ke,{children:a.jsx(Xt,{children:a.jsx(Hs,{})})})}),a.jsx(le,{path:"/search",element:a.jsx(ke,{children:a.jsx(Xt,{children:a.jsx(Kh,{})})})}),a.jsx(le,{path:"/profile",element:a.jsx(ke,{children:a.jsx(Xt,{children:a.jsx(Qh,{})})})}),a.jsx(le,{path:"/book/:id",element:a.jsx(ke,{children:a.jsx(Ws,{})})}),a.jsx(le,{path:"/player/:id",element:a.jsx(ke,{children:a.jsx(Ws,{})})}),a.jsx(le,{path:"/subscription",element:a.jsx(ke,{children:a.jsx(Jh,{})})}),a.jsx(le,{path:"/payment-coming-soon",element:a.jsx(ke,{children:a.jsx(ep,{})})}),a.jsx(le,{path:"/settings",element:a.jsx(ke,{children:a.jsx(Zs,{})})}),a.jsx(le,{path:"/settings/account",element:a.jsx(ke,{children:a.jsx(tp,{})})}),a.jsx(le,{path:"/settings/notifications",element:a.jsx(ke,{children:a.jsx(Zs,{})})}),a.jsx(le,{path:"/help",element:a.jsx(ke,{children:a.jsx(rp,{})})}),a.jsx(le,{path:"/downloads",element:a.jsx(ke,{children:a.jsx(Xt,{children:a.jsx(Hs,{})})})}),a.jsx(le,{path:"/admin",element:a.jsx(ke,{requireAdmin:!0,children:a.jsx(cp,{})})}),a.jsx(le,{path:"/admin/books",element:a.jsx(ke,{requireAdmin:!0,children:a.jsx(dp,{})})}),a.jsx(le,{path:"/admin/users",element:a.jsx(ke,{requireAdmin:!0,children:a.jsx(up,{})})}),a.jsx(le,{path:"/admin/subscriptions",element:a.jsx(ke,{requireAdmin:!0,children:a.jsx(fp,{})})}),a.jsx(le,{path:"/terms",element:a.jsx(np,{})}),a.jsx(le,{path:"/refund-policy",element:a.jsx(sp,{})}),a.jsx(le,{path:"/privacy-policy",element:a.jsx(ap,{})}),a.jsx(le,{path:"/shipping-policy",element:a.jsx(op,{})}),a.jsx(le,{path:"/delete-account",element:a.jsx(ip,{})}),a.jsx(le,{path:"/.lovable/oauth/consent",element:a.jsx(lp,{})}),a.jsx(le,{path:"*",element:a.jsx(Xh,{})})]})}),a.jsx(If,{}),a.jsx(ym,{}),a.jsx(km,{}),a.jsx($m,{})]})})})})})})})});try{localStorage.removeItem("bookcast-user-profile")}catch{}ha(document.getElementById("root")).render(a.jsx(wa,{children:a.jsx(gp,{})}));export{Kn as $,Ga as A,Y as B,Nc as C,Pc as D,vm as E,xm as F,jc as G,Ic as H,Je as I,dr as J,kc as K,Lc as L,ye as M,mn as N,Sp as O,Qa as P,Cp as Q,Ap as R,zr as S,Pp as T,Xa as U,Tp as V,Ep as W,Ot as X,Ua as Y,qc as Z,Rc as _,Es as a,pm as a0,lr as a1,Ha as a2,bm as a3,Lr as a4,fu as a5,Ac as a6,Zc as a7,Lo as a8,Ya as a9,Lp as aA,Dp as aB,qp as aC,Op as aD,$p as aE,qn as aF,he as aG,Ue as aa,$n as ab,zc as ac,Om as ad,Wp as ae,vi as af,xi as ag,wi as ah,_i as ai,bi as aj,Si as ak,ki as al,Tc as am,Mp as an,Ii as ao,dt as ap,Yp as aq,Mh as ar,Zp as as,Us as at,Up as au,Bp as av,Fp as aw,zp as ax,Vp as ay,xo as az,Sc as b,X as c,Qo as d,Go as e,F as f,Au as g,mt as h,ht as i,Ec as
230j,fo as k,Bn as l,jp as m,Cu as n,Np as o,fn as p,Dc as q,vr as r,z as s,xr as t,Pe as u,Jt as v,er as w,tr as x,kp as y,em as z};
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.