1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HowItWorks-BG9ctBOI.js","assets/vendor-ui-DhlpVjDs.js","assets/vendor-react-Bj1po1vP.js","assets/vendor-i18n-D3vIpi1U.js","assets/circle-check-CCMmzX81.js","assets/clipboard-paste-QuP9vS1n.js","assets/ComparePage-DyCDoYyZ.js","assets/LoginPage-Bx0PgCfR.js","assets/DashboardPage-Dw1brTw_.js","assets/NotFound-CFXCBwaE.js","assets/TextToIcsPage-BP1XzAI7.js","assets/ConverterLandingPage-BLSX201E.js","assets/PdfToIcsPage-BOyA8Qpm.js","assets/CsvToIcsPage-BVOXFfI9.js","assets/ImageToCalendarPage-DMvhw3B1.js","assets/IcsViewerPage-CHzSOC3X.js","assets/EmailToIcsPage-Ds-IRIsV.js","assets/BirthdayListToCalendarPage-Zcf9B0A6.js","assets/MeetingNotesToCalendarPage-D1YAn_Ep.js","assets/IcsForGoogleCalendarPage-0iRCmY4k.js","assets/GuideLandingPage-BeQyup0J.js","assets/HowToCreateIcsFilePage-NjEaNCrF.js","assets/IcsFileNotImportingPage-BQs-MuTq.js","assets/ChromeExtensionPage-R_nEY_XP.js","assets/BlogIndex-Ba-hsCLp.js","assets/posts-B8nT-Yjm.js","assets/BlogPost-DaoJ3o2_.js","assets/ChangelogPage-DscTsP6t.js","assets/FeedbackPage-Dm_V6xAJ.js","assets/PrivacyPage-wnPrL6wn.js"])))=>i.map(i=>d[i]); 2var Vl=Object.defineProperty;var Oo=n=>{throw TypeError(n)};var Bl=(n,e,t)=>e in n?Vl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var F=(n,e,t)=>Bl(n,typeof e!="symbol"?e+"":e,t),rs=(n,e,t)=>e.has(n)||Oo("Cannot "+t);var x=(n,e,t)=>(rs(n,e,"read from private field"),t?t.call(n):e.get(n)),H=(n,e,t)=>e.has(n)?Oo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),B=(n,e,t,r)=>(rs(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be=(n,e,t)=>(rs(n,e,"access private method"),t);var ar=(n,e,t,r)=>({set _(s){B(n,e,s,t)},get _(){return x(n,e,r)}});import{j as c,V as sa,R as oa,A as ia,C as aa,T as ca,D as la,P as Ql,a as ua,b as Wl,S as zl,m as Ce,c as da,d as no,u as Ge,e as Ir,f as ha,g as me,h as oe,i as er,k as Hl,l as fa,n as Yl,o as Et,p as Gl,q as Kl,r as Jl,F as Zl,s as Xl,t as eu,v as tu,w as nu,x as ru,y as su,z as ou,B as iu}from"./vendor-ui-DhlpVjDs.js";import{a as ro,r as f,R as w,g as so,b as au,u as pa,d as tr,e as $r,L as Re,B as cu,f as lu,h as se,N as oo,O as uu}from"./vendor-react-Bj1po1vP.js";import{i as Ps,a as du,u as Ke}from"./vendor-i18n-D3vIpi1U.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"]'))r(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"&&r(i)}).observe(document,{childList:!0,subtree:!0});function t(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 r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var ma,_o=ro;ma=_o.createRoot,_o.hydrateRoot;const _t="1.34.1";var rt=[],je=[],hu=Uint8Array,ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var tn=0,fu=ss.length;tn<fu;++tn)rt[tn]=ss[tn],je[ss.charCodeAt(tn)]=tn;je[45]=62;je[95]=63;function pu(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function mu(n,e,t){return(e+t)*3/4-t}function zn(n){var e,t=pu(n),r=t[0],s=t[1],o=new hu(mu(n,r,s)),i=0,a=s>0?r-4:r,l;for(l=0;l<a;
2l+=4)e=je[n.charCodeAt(l)]<<18|je[n.charCodeAt(l+1)]<<12|je[n.charCodeAt(l+2)]<<6|je[n.charCodeAt(l+3)],o[i++]=e>>16&255,o[i++]=e>>8&255,o[i++]=e&255;return s===2&&(e=je[n.charCodeAt(l)]<<2|je[n.charCodeAt(l+1)]>>4,o[i++]=e&255),s===1&&(e=je[n.charCodeAt(l)]<<10|je[n.charCodeAt(l+1)]<<4|je[n.charCodeAt(l+2)]>>2,o[i++]=e>>8&255,o[i++]=e&255),o}function gu(n){return rt[n>>18&63]+rt[n>>12&63]+rt[n>>6&63]+rt[n&63]}function yu(n,e,t){for(var r,s=[],o=e;o<t;o+=3)r=(n[o]<<16&16711680)+(n[o+1]<<8&65280)+(n[o+2]&255),s.push(gu(r));return s.join("")}function Hn(n){for(var e,t=n.length,r=t%3,s=[],o=16383,i=0,a=t-r;i<a;i+=o)s.push(yu(n,i,i+o>a?a:i+o));return r===1?(e=n[t-1],s.push(rt[e>>2]+rt[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],s.push(rt[e>>10]+rt[e>>4&63]+rt[e<<2&63]+"=")),s.join("")}function Ie(n){if(n===void 0)return{};if(!ya(n))throw new Error(`The arguments to a Convex function must be an object. Received: ${n}`);return n}function ga(n){if(typeof n>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof n!="string")throw new Error(`Invalid deployment address: found ${n}".`);if(!(n.startsWith("http:")||n.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${n}".`);try{new URL(n)}catch{throw new Error(`Invalid deployment address: "${n}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(n.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${n}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function ya(n){var s;const e=typeof n=="object",t=Object.getPrototypeOf(n),r=t===null||t===Object.prototype||((s=t==null?void 0:t.constructor)==null?void 0:s.name)==="Object";return e&&r}const va=!0,Cn=BigInt("-9223372036854775808"),io=BigInt("9223372036854775807"),Ns=BigInt("0"),vu=BigInt("8"),xu=BigInt("256");function xa(n){return Number.isNaN(n)||!Number.isFinite(n)||Object.is(n,-0)}function bu(n){n<Ns&&(n-=Cn+Cn);let e=n.toString(16);e.length%2===1&&(e="0"+e);const t=new Uint8Array(new ArrayBuffer(8));let r=0;for(const s of e.match(/.{2}/g).reverse())t.set([parseInt(s,16)],r++),n>>=vu;return Hn(t)}function wu(n){const e=zn(n);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);let t=Ns,r=Ns;for(const s of e)t+=BigInt(s)*xu**r,r++;return t>io&&(t+=Cn+Cn),t}function Tu(n){if(n<Cn||io<n)throw new Error(`BigInt ${n} does not fit into a 64-bit signed integer.`);const e=new ArrayBuffer(8);return new DataView(e).setBigInt64(0,n,!0),Hn(new Uint8Array(e))}function Su(n){const e=zn(n);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);return new DataView(e.buffer).getBigInt64(0,!0)}const Cu=DataView.prototype.setBigInt64?Tu:bu,Eu=DataView.prototype.getBigInt64?Su:wu,jo=1024;function ba(n){if(n.length>jo)throw new Error(`Field name ${n} exceeds maximum field name length ${jo}.`);if(n.startsWith("$"))throw new Error(`Field name ${n} starts with a '$', which is reserved.`);for(let e=0;e<n.length;e+=1){const t=n.charCodeAt(e);if(t<32||t>=127)throw new Error(`Field name ${n} has invalid character '${n[e]}': Field names can only contain non-control ASCII characters`)}}function He(n){if(n===null||typeof n=="boolean"||typeof n=="number"||typeof n=="string")return n;if(Array.isArray(n))return n.map(r=>He(r));if(typeof n!="object")throw new Error(`Unexpected type of ${n}`);const e=Object.entries(n);if(e.length===1){const r=e[0][0];if(r==="$bytes"){if(typeof n.$bytes!="string")throw new Error(`Malformed $bytes field on ${n}`);return zn(n.$bytes).buffer}if(r==="$integer"){if(typeof n.$integer!="string")throw new Error(`Malformed $integer field on ${n}`);return Eu(n.$integer)}if(r==="$float"){if(typeof n.$float!="string")throw new Error(`Malformed $float field on ${n}`);const s=zn(n.$float);if(s.byteLength!==8)throw new Error(`Received ${s.byteLength} bytes, expected 8 for $float`);const i=new DataView(s.buffer).getFloat64(0,va);if(!xa(i))throw new Error(`Float ${i} should be encoded as a number`);return i}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const t={};for(const[r,s]of Object.entries(n))ba(r),t[r]=He(s);return t}const Fo=16384;function Bn(n){const e=JSON.stringify(n,(t,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(e.length>
2Fo){const t="[...truncated]";let r=Fo-t.length;const s=e.codePointAt(r-1);return s!==void 0&&s>65535&&(r-=1),e.substring(0,r)+t}return e}function Ds(n,e,t,r){var i;if(n===void 0){const a=t&&` (present at path ${t} in original object ${Bn(e)})`;throw new Error(`undefined is not a valid Convex value${a}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(n===null)return n;if(typeof n=="bigint"){if(n<Cn||io<n)throw new Error(`BigInt ${n} does not fit into a 64-bit signed integer.`);return{$integer:Cu(n)}}if(typeof n=="number")if(xa(n)){const a=new ArrayBuffer(8);return new DataView(a).setFloat64(0,n,va),{$float:Hn(new Uint8Array(a))}}else return n;if(typeof n=="boolean"||typeof n=="string")return n;if(n instanceof ArrayBuffer)return{$bytes:Hn(new Uint8Array(n))};if(Array.isArray(n))return n.map((a,l)=>Ds(a,e,t+`[${l}]`));if(n instanceof Set)throw new Error(os(t,"Set",[...n],e));if(n instanceof Map)throw new Error(os(t,"Map",[...n],e));if(!ya(n)){const a=(i=n==null?void 0:n.constructor)==null?void 0:i.name,l=a?`${a} `:"";throw new Error(os(t,l,n,e))}const s={},o=Object.entries(n);o.sort(([a,l],[u,h])=>a===u?0:a<u?-1:1);for(const[a,l]of o)l!==void 0&&(ba(a),s[a]=Ds(l,e,t+`.${a}`));return s}function os(n,e,t,r){return n?`${e}${Bn(t)} is not a supported Convex type (present at path ${n} in original object ${Bn(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${e}${Bn(t)} is not a supported Convex type.`}function Pe(n){return Ds(n,n,"")}var ku=Object.defineProperty,Au=(n,e,t)=>e in n?ku(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,is=(n,e,t)=>Au(n,typeof e!="symbol"?e+"":e,t),$o,Lo;const Ru=Symbol.for("ConvexError");class ut extends(Lo=Error,$o=Ru,Lo){constructor(e){super(typeof e=="string"?e:Bn(e)),is(this,"name","ConvexError"),is(this,"data"),is(this,$o,!0),this.data=e}}const wa=()=>Array.from({length:4},()=>0);wa();wa();var Iu=Object.defineProperty,Pu=(n,e,t)=>e in n?Iu(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Uo=(n,e,t)=>Pu(n,typeof e!="symbol"?e+"":e,t);const Nu="color:rgb(0, 145, 255)";function Ta(n){switch(n){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class Sa{constructor(e){Uo(this,"_onLogLineFuncs"),Uo(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let r=0;r<10&&this._onLogLineFuncs[t]!==void 0;r++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(const t of Object.values(this._onLogLineFuncs))t("debug",`${new Date().toISOString()}`,...e)}log(...e){for(const t of Object.values(this._onLogLineFuncs))t("info",...e)}warn(...e){for(const t of Object.values(this._onLogLineFuncs))t("warn",...e)}error(...e){for(const t of Object.values(this._onLogLineFuncs))t("error",...e)}}function ao(n){const e=new Sa(n);return e.addLogLineListener((t,...r)=>{switch(t){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),e}function co(n){return new Sa(n)}function Ct(n,e,t,r,s){const o=Ta(t);if(typeof s=="object"&&(s=`ConvexError ${JSON.stringify(s.errorData,null,2)}`),e==="info"){const i=s.match(/^\[.*?\] /);if(i===null){n.error(`[CONVEX ${o}(${r})] Could not parse console.log`);return}const a=s.slice(1,i[0].length-2),l=s.slice(i[0].length);n.log(`%c[CONVEX ${o}(${r})] [${a}]`,Nu,l)}else n.error(`[CONVEX ${o}(${r})] ${s}`)}function Du(n,e){const t=`[CONVEX FATAL ERROR] ${e}`;return n.error(t),new Error(t)}function hn(n,e,t){return`[CONVEX ${Ta(n)}(${e})] ${t.errorMessage} 3 Called by client`}function Ms(n,e){return e.data=n.errorData,e}function Ht(n){const e=n.split(":");let t,r;return e.length===1?(t=e[0],r="default"):(t=e.slice(0,e.length-1).join(":"),r=e[e.length-1]),t.endsWith(".js")&&(t=t.
3slice(0,-3)),`${t}:${r}`}function Wt(n,e){return JSON.stringify({udfPath:Ht(n),args:Pe(e)})}function qo(n,e,t){const{initialNumItems:r,id:s}=t;return JSON.stringify({type:"paginated",udfPath:Ht(n),args:Pe(e),options:Pe({initialNumItems:r,id:s})})}var Mu=Object.defineProperty,Ou=(n,e,t)=>e in n?Mu(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ze=(n,e,t)=>Ou(n,typeof e!="symbol"?e+"":e,t);class _u{constructor(){Ze(this,"nextQueryId"),Ze(this,"querySetVersion"),Ze(this,"querySet"),Ze(this,"queryIdToToken"),Ze(this,"identityVersion"),Ze(this,"auth"),Ze(this,"outstandingQueriesOlderThanRestart"),Ze(this,"outstandingAuthOlderThanRestart"),Ze(this,"paused"),Ze(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,r,s){const o=Ht(e),i=Wt(o,t),a=this.querySet.get(i);if(a!==void 0)return a.numSubscribers+=1,{queryToken:i,modification:null,unsubscribe:()=>this.removeSubscriber(i)};{const l=this.nextQueryId++,u={id:l,canonicalizedUdfPath:o,args:t,numSubscribers:1,journal:r,componentPath:s};this.querySet.set(i,u),this.queryIdToToken.set(l,i);const h=this.querySetVersion,p=this.querySetVersion+1,g={type:"Add",queryId:l,udfPath:o,args:[Pe(t)],journal:r,componentPath:s};return this.paused?this.pendingQuerySetModifications.set(l,g):this.querySetVersion=p,{queryToken:i,modification:{type:"ModifyQuerySet",baseVersion:h,newVersion:p,modifications:[g]},unsubscribe:()=>this.removeSubscriber(i)}}}transition(e){for(const t of e.modifications)switch(t.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(t.queryId);const r=t.journal;if(r!==void 0){const s=this.queryIdToToken.get(t.queryId);s!==void 0&&(this.querySet.get(s).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(t.queryId);break}default:throw new Error(`Invalid modification ${t.type}`)}}queryId(e,t){const r=Ht(e),s=Wt(r,t),o=this.querySet.get(s);return o!==void 0?o.id:null}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:"User",value:e};const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",baseVersion:t,...this.auth}}setAdminAuth(e,t){const r={tokenType:"Admin",value:e,impersonating:t};this.auth=r;const s=this.identityVersion;return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",tokenType:"None",baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){var t;return((t=this.auth)==null?void 0:t.value)!==e}queryPath(e){const t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){const t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){var t;return(t=this.querySet.get(e))==null?void 0:t.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const e=[];for(const s of this.querySet.values()){const o={type:"Add",queryId:s.id,udfPath:s.canonicalizedUdfPath,args:[Pe(s.args)],journal:s.journal,componentPath:s.componentPath};e.push(o),this.outstandingQueriesOlderThanRestart.add(s.id)}this.querySetVersion=1;const t={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;const r={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[t,r]}pause(){this.paused=!0}resume(){const e=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){const t=this.querySet.get(e);if(t.numSubscribers>1)return t.numSubscribers-=1,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);const r=this.querySetVersion,s=this.querySetVersion+1,o={type:"Remove",queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,o):this.querySetVersion=s,{type:"ModifyQuerySet",baseVersion:r,newVersion:s,modifications:[o]}}}}var ju=Object.defineProperty,Fu=(n,e,t)=>e in n?ju(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,cr=(n,e,t)=>Fu(n,typeof e!="symbol"?e+"":e,t);class $u{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,cr(this,"inflightRequests"),cr(this,"requestsOlderThanRestart"),cr(this,"inflightMutationsCount",0),cr(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){const r=new Promise(s=>{const o=t?"Requested":"NotSent";this.inflightRequests.set(e.requestId,{message:e,status:{status:o,requestedAt:new Date,onResult:s}}),e.type==="Mutation"?this.inflightMutationsCount++:e.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(e){const t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status==="Completed")return null;const r=t.message.type==="Mutation"?"mutation":"action",s=t.message.udfPath;for(const l of e.logLines)Ct(this.logger,"info",r,s,l);const o=t.status;let i,a;if(e.success)i={success:!0,logLines:e.logLines,value:He(e.result)},a=()=>o.onResult(i);else{const l=e.result,{errorData:u}=e;Ct(this.logger,"error",r,s,l),i={success:!1,errorMessage:l,errorData:u!==void 0?He(u):void 0,logLines:e.logLines},a=()=>o.onResult(i)}return e.type==="ActionResponse"||!e.success?(a(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type==="Action"?this.inflightActionsCount--:t.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:i}
3):(t.status={status:"Completed",result:i,ts:e.ts,onResolve:a},null)}removeCompleted(e){const t=new Map;for(const[r,s]of this.inflightRequests.entries()){const o=s.status;o.status==="Completed"&&o.ts.lessThanOrEqual(e)&&(o.onResolve(),t.set(r,o.result),s.message.type==="Mutation"?this.inflightMutationsCount--:s.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const e=[];for(const[t,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",e.push(r.message);continue}if(r.message.type==="Mutation")e.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){const e=[];for(const[,t]of this.inflightRequests)if(t.status.status==="NotSent"){t.status.status="Requested",e.push(t.message);continue}return e}hasIncompleteRequests(){for(const e of this.inflightRequests.values())if(e.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(const t of this.inflightRequests.values())t.status.status!=="Completed"&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const Yn=Symbol.for("functionName"),Ca=Symbol.for("toReferencePath");function Lu(n){return n[Ca]??null}function Uu(n){return n.startsWith("function://")}function qu(n){let e;if(typeof n=="string")Uu(n)?e={functionHandle:n}:e={name:n};else if(n[Yn])e={name:n[Yn]};else{const t=Lu(n);if(!t)throw new Error(`${n} is not a functionReference`);e={reference:t}}return e}function ve(n){const e=qu(n);if(e.name===void 0)throw e.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`):e.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${e.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`);if(typeof n=="string")return n;const t=n[Yn];if(!t)throw new Error(`${n} is not a functionReference`);return t}function lo(n){return{[Yn]:n}}function Ea(n=[]){const e={get(t,r){if(typeof r=="string"){const s=[...n,r];return Ea(s)}else if(r===Yn){if(n.length<2){const i=["api",...n].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${i}\``)}const s=n.slice(0,-1).join("/"),o=n[n.length-1];return o==="default"?s:s+":"+o}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},e)}const Vu=Ea();var Bu=Object.defineProperty,Qu=(n,e,t)=>e in n?Bu(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Pr=(n,e,t)=>Qu(n,typeof e!="symbol"?e+"":e,t);class Gn{constructor(e){Pr(this,"queryResults"),Pr(this,"modifiedQueries"),this.queryResults=e,this.modifiedQueries=[]}getQuery(e,...t){const r=Ie(t[0]),s=ve(e),o=this.queryResults.get(Wt(s,r));if(o!==void 0)return Gn.queryValue(o.result)}getAllQueries(e){const t=[],r=ve(e);for(const s of this.queryResults.values())s.udfPath===Ht(r)&&t.push({args:s.args,value:Gn.queryValue(s.result)});return t}setQuery(e,t,r){const s=Ie(t),o=ve(e),i=Wt(o,s);let a;r===void 0?a=void 0:a={success:!0,value:r,logLines:[]};const l={udfPath:o,args:s,result:a};this.queryResults.set(i,l),this.modifiedQueries.push(i)}static queryValue(e){if(e!==void 0)return e.success?e.value:void 0}}class Wu{constructor(){Pr(this,"queryResults"),Pr(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(i=>!t.has(i.mutationId));const r=this.queryResults;this.queryResults=new Map(e);const s=new Gn(this.queryResults);for(const i of this.optimisticUpdates)i.update(s);const o=[];for(const[i,a]of this.queryResults){const l=r.get(i);(l===void 0||l.result!==a.result)&&o.push(i)}return o}
3applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});const r=new Gn(this.queryResults);return e(r),r.modifiedQueries}rawQueryResult(e){const t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){const t=this.queryResults.get(e);if(t===void 0)return;const r=t.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?Ms(r,new ut(hn("query",t.udfPath,r))):new Error(hn("query",t.udfPath,r))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){var r;const t=this.queryResults.get(e);return(r=t==null?void 0:t.result)==null?void 0:r.logLines}}var zu=Object.defineProperty,Hu=(n,e,t)=>e in n?zu(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,as=(n,e,t)=>Hu(n,typeof e!="symbol"?e+"":e,t);class ke{constructor(e,t){as(this,"low"),as(this,"high"),as(this,"__isUnsignedLong__"),this.low=e|0,this.high=t|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(e){return new ke(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24)}toBytesLE(){const e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(e){return isNaN(e)||e<0?Vo:e>=Yu?Gu:new ke(e%Qn|0,e/Qn|0)}toString(){return(BigInt(this.high)*BigInt(Qn)+BigInt(this.low)).toString()}equals(e){return ke.isLong(e)||(e=ke.fromValue(e)),this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low}notEquals(e){return!this.equals(e)}comp(e){return ke.isLong(e)||(e=ke.fromValue(e)),this.equals(e)?0:e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(e){return typeof e=="number"?ke.fromNumber(e):new ke(e.low,e.high)}}const Vo=new ke(0,0),Bo=65536,Qn=Bo*Bo,Yu=Qn*Qn,Gu=new ke(-1,-1);var Ku=Object.defineProperty,Ju=(n,e,t)=>e in n?Ku(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lr=(n,e,t)=>Ju(n,typeof e!="symbol"?e+"":e,t);class Qo{constructor(e,t){lr(this,"version"),lr(this,"remoteQuerySet"),lr(this,"queryPath"),lr(this,"logger"),this.version={querySet:0,ts:ke.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){const t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw new Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const r of e.modifications)switch(r.type){case"QueryUpdated":{const s=this.queryPath(r.queryId);if(s)for(const i of r.logLines)Ct(this.logger,"info","query",s,i);const o=He(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:o,logLines:r.logLines});break}case"QueryFailed":{const s=this.queryPath(r.queryId);if(s)for(const i of r.logLines)Ct(this.logger,"info","query",s,i);const{errorData:o}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:o!==void 0?He(o):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function cs(n){const e=zn(n);return ke.fromBytesLE(Array.from(e))}function Zu(n){const e=new Uint8Array(n.toBytesLE());return Hn(e)}function Wo(n){switch(n.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...n};case"MutationResponse":return n.success?{...n,ts:cs(n.ts)}:{...n};case"Transition":return{...n,startVersion:{...n.startVersion,ts:cs(n.startVersion.ts)},endVersion:{...n.endVersion,ts:cs(n.endVersion.ts)}}}}function Xu(n){switch(n.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...n};case"Connect":return n.maxObservedTimestamp!==void 0?{...n,maxObservedTimestamp:Zu(n.maxObservedTimestamp)}:{...n,maxObservedTimestamp:void 0}}}var ed=Object.defineProperty,td=(n,e,t)=>e in n?ed(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fe=(n,e,t)=>td(n,typeof e!="symbol"?e+"":e,t);const nd=1e3,rd=1001,sd=1005,od=4040;let Tr;function cn(){return Tr===void 0&&(Tr=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Tr+performance.now())}function zo(){return`t=${Math.round((cn()-Tr)/100)/10}s`}const ka={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function id(n){if(n===void 0)return"Unknown";
3for(const e of Object.keys(ka))if(n.startsWith(e))return e;return"Unknown"}class ad{constructor(e,t,r,s,o,i){this.markConnectionStateDirty=o,this.debug=i,fe(this,"socket"),fe(this,"connectionCount"),fe(this,"_hasEverConnected",!1),fe(this,"lastCloseReason"),fe(this,"transitionChunkBuffer",null),fe(this,"defaultInitialBackoff"),fe(this,"maxBackoff"),fe(this,"retries"),fe(this,"serverInactivityThreshold"),fe(this,"reconnectDueToServerInactivityTimeout"),fe(this,"scheduledReconnect",null),fe(this,"networkOnlineHandler",null),fe(this,"pendingNetworkRecoveryInfo",null),fe(this,"uri"),fe(this,"onOpen"),fe(this,"onResume"),fe(this,"onMessage"),fe(this,"webSocketConstructor"),fe(this,"logger"),fe(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=s,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){const t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){const t=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const r=Wo(JSON.parse(t));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const e=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:e,paused:"no"}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:e,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:cn()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",zo(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",zo())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:t}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:t}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(t/1e3)}s of waiting`)}},e.onerror=t=>{this.transitionChunkBuffer=null;const r=t.message;r&&this.logger.log(`WebSocket error message: ${r}`)},e.onmessage=t=>{this.resetServerInactivityTimeout();const r=t.data.length;let s=Wo(JSON.parse(t.data));if(this._logVerbose(`received ws message with type ${s.type}`),s.type==="Ping")return;if(s.type==="TransitionChunk"){const i=this.assembleTransition(s);if(!i)return;s=i,this._logVerbose(`assembled full ws message of type ${s.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${s.type} while buffering TransitionChunks`)),s.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:s}),this.onMessage(s).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},e.onclose=t=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=t.reason||`closed with code ${t.code}`),t.code!==nd&&t.code!==rd&&t.code!==sd&&t.code!==od){let s=`WebSocket closed with code ${t.code}`;t.reason&&(s+=`: ${t.reason}`),this.logger.log(s),this.onServerDisconnectError&&t.reason&&this.onServerDisconnectError(s)}const r=id(t.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(e){const t={type:e.type,...e.type==="Authenticate"&&e.tokenType==="User"?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=Xu(e),s=JSON.stringify(r);let o=!1;try{this.socket.ws.send(s),o=!0}catch(i){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${i}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${o?"sent":"failed to send"} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);const r=cn(),s=setTimeout(()=>{var o;((o=this.scheduledReconnect)==null?void 0:o.timeout)===s&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:s,scheduledAt:r,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=e,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const e=this.socket.ws;return e.onmessage=t=>{this._logVerbose("Ignoring message received after close")},new Promise(t=>{e.onclose=()=>{this._logVerbose("Closed after connecting"),t()},e.onopen=()=>{this._logVerbose("Opened after connecting"),e.close()}})}case"ready":{this._logVerbose("ws.close called");const e=this.socket.ws;e.onmessage=r=>{this._logVerbose("Ignoring message received after close")};const t=new Promise(r=>{e.onclose=()=>{r()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const e=this.close();return this.setSocketState({state:"terminated"}),e}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const e=this.close();return this.socket={state:"stopped"},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){const t=cn()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=e!==null?{timeSavedMs:e}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:cn()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){const r=(e==="client"?100:e==="Unknown"?this.defaultInitialBackoff:ka[e].timeout)*Math.pow(2,this.retries);this.retries+=1;const s=Math.min(r,this.maxBackoff),o=s*(Math.random()-.5);return s+o}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;const r=cn()-e.clientClockSkew-e.serverTs/1e6,s=`${Math.round(r)}ms`,o=`${Math.round(t/1e4)/100}MB`,i=t/(r/1e3),a=`${Math.round(i/1e4)/100}MB per second`;this._logVerbose(`received ${o} transition in ${s} at ${a}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${o}
3) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${o} which took more than 20s to arrive (${s})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:t}})}}function cd(){return ld()}function ld(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}class Ln extends Error{}Ln.prototype.name="InvalidTokenError";function ud(n){return decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function dd(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ud(e)}catch{return atob(e)}}function Aa(n,e){if(typeof n!="string")throw new Ln("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,r=n.split(".")[t];if(typeof r!="string")throw new Ln(`Invalid token specified: missing part #${t+1}`);let s;try{s=dd(r)}catch(o){throw new Ln(`Invalid token specified: invalid base64 for part #${t+1} (${o.message})`)}try{return JSON.parse(s)}catch(o){throw new Ln(`Invalid token specified: invalid json for part #${t+1} (${o.message})`)}}var hd=Object.defineProperty,fd=(n,e,t)=>e in n?hd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Oe=(n,e,t)=>fd(n,typeof e!="symbol"?e+"":e,t);const pd=20*24*60*60*1e3,Ho=2;class md{constructor(e,t,r){Oe(this,"authState",{state:"noAuth"}),Oe(this,"configVersion",0),Oe(this,"syncState"),Oe(this,"authenticate"),Oe(this,"stopSocket"),Oe(this,"tryRestartSocket"),Oe(this,"pauseSocket"),Oe(this,"resumeSocket"),Oe(this,"clearAuth"),Oe(this,"logger"),Oe(this,"refreshTokenLeewaySeconds"),Oe(this,"tokenConfirmationAttempts",0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(e,t){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:e,onAuthChange:t},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:e,onAuthChange:t}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=Ho){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Ho-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:t.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(e){if(this.authState.state==="noAuth")return;const t=this.decodeToken(e);if(!t){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:s}=t;if(!r||!s){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const o=s-r;if(o<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let i=Math.min(pd,(o-this.refreshTokenLeewaySeconds)*1e3);i<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${o}s`),i=0);const a=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},i);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:a,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${i}ms`)}async fetchTokenAndGuardAgainstRace(e,t){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const s=await e(t);
3return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:s}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(e){const t=e.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return Aa(e)}catch(t){return this._logVerbose(`Error decoding token: ${t instanceof Error?t.message:"Unknown error"}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}}const gd=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function yd(n,e){const t={sessionId:e};typeof performance>"u"||!performance.mark||performance.mark(n,{detail:t})}function vd(n){let e=n.name.slice(6);return e=e.charAt(0).toLowerCase()+e.slice(1),{name:e,startTime:n.startTime}}function xd(n){if(typeof performance>"u"||!performance.getEntriesByName)return[];const e=[];for(const t of gd){const r=performance.getEntriesByName(t).filter(s=>s.entryType==="mark").filter(s=>s.detail.sessionId===n);e.push(...r)}return e.map(vd)}var bd=Object.defineProperty,wd=(n,e,t)=>e in n?bd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pe=(n,e,t)=>wd(n,typeof e!="symbol"?e+"":e,t);class Td{constructor(e,t,r){if(pe(this,"address"),pe(this,"state"),pe(this,"requestManager"),pe(this,"webSocketManager"),pe(this,"authenticationManager"),pe(this,"remoteQuerySet"),pe(this,"optimisticQueryResults"),pe(this,"_transitionHandlerCounter",0),pe(this,"_nextRequestId"),pe(this,"_onTransitionFns",new Map),pe(this,"_sessionId"),pe(this,"firstMessageReceived",!1),pe(this,"debug"),pe(this,"logger"),pe(this,"maxObservedTimestamp"),pe(this,"connectionStateSubscribers",new Map),pe(this,"nextConnectionStateSubscriberId",0),pe(this,"_lastPublishedConnectionState"),pe(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const d=this.connectionState();if(JSON.stringify(d)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=d;for(const y of this.connectionStateSubscribers.values())y(d)}})}),pe(this,"mark",d=>{this.debug&&yd(d,this.sessionId)}),typeof e=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");(r==null?void 0:r.skipConvexDeploymentUrlCheck)!==!0&&ga(e),r={...r};const s=r.authRefreshTokenLeewaySeconds??10;let o=r.webSocketConstructor;if(!o&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");o=o||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=e,this.logger=r.logger===!1?co({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:ao({verbose:r.verbose??!1});const i=e.search("://");if(i===-1)throw new Error("Provided address was not an absolute URL.");const a=e.substring(i+3),l=e.substring(0,i);let u;if(l==="http")u="ws";else if(l==="https")u="wss";else throw new Error(`Unknown parent protocol ${l}`);const h=`${u}://${a}/api/${_t}/sync`;this.state=new _u,this.remoteQuerySet=new Qo(d=>this.state.queryPath(d),this.logger),this.requestManager=new $u(this.logger,this.markConnectionStateDirty);const p=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new md(this.state,{authenticate:d=>{const y=this.state.setAuth(d);return this.webSocketManager.sendMessage(y),y.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:p,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:s}),this.optimisticQueryResults=new Wu,this.addOnTransitionHandler(d=>{t(d.queries.map(y=>y.token))}),this._nextRequestId=0,this._sessionId=cd();const{unsavedChangesWarning:g}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(g===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else g!==!1&&window.addEventListener("beforeunload",d=>{if(this.requestManager.hasIncompleteRequests()){d.preventDefault();const y="Are you sure you want to leave? Your changes may not be saved.";return(d||window.event).returnValue=y,y}});this.webSocketManager=new ad(h,{onOpen:d=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...d,type:"C
3onnect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new Qo(v=>this.state.queryPath(v),this.logger);const[y,m]=this.state.restart();m&&this.webSocketManager.sendMessage(m),this.webSocketManager.sendMessage(y);for(const v of this.requestManager.restart())this.webSocketManager.sendMessage(v)},onResume:()=>{const[d,y]=this.state.resume();y&&this.webSocketManager.sendMessage(y),d&&this.webSocketManager.sendMessage(d);for(const m of this.requestManager.resume())this.webSocketManager.sendMessage(m)},onMessage:d=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),d.type){case"Transition":{this.observedTimestamp(d.endVersion.ts),this.authenticationManager.onTransition(d),this.remoteQuerySet.transition(d),this.state.transition(d);const y=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(y);break}case"MutationResponse":{d.success&&this.observedTimestamp(d.ts);const y=this.requestManager.onResponse(d);y!==null&&this.notifyOnQueryResultChanges(new Map([[y.requestId,y.result]]));break}case"ActionResponse":{this.requestManager.onResponse(d);break}case"AuthError":{this.authenticationManager.onAuthError(d);break}case"FatalError":{const y=Du(this.logger,d.error);throw this.webSocketManager.terminate(),y}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},o,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&p()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){const t=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[o,i]of t){const a=this.state.queryToken(o);if(a!==null){const l={result:i,udfPath:this.state.queryPath(o),args:this.state.queryArgs(o)};r.set(a,l)}}const s=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(e.keys()));this.handleTransition({queries:s.map(o=>{const i=this.optimisticQueryResults.rawQueryResult(o);return{token:o,modification:{kind:"Updated",result:i}}}),reflectedMutations:Array.from(e).map(([o,i])=>({requestId:o,result:i})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(const t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){const t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){const e=this.state.getAuth();let t={};if(e&&e.tokenType==="User")try{t=e?Aa(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t){this.authenticationManager.setConfig(e,t)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){const r=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(r)}clearAuth(){const e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,r){const s=Ie(t),{modification:o,queryToken:i,unsubscribe:a}=this.state.subscribe(e,s,r==null?void 0:r.journal,r==null?void 0:r.componentPath);return o!==null&&this.webSocketManager.sendMessage(o),{queryToken:i,unsubscribe:()=>{const l=a();l&&this.webSocketManager.sendMessage(l)}}}localQueryResult(e,t){const r=Ie(t),s=Wt(e,r);return this.optimisticQueryResults.queryResult(s)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){const r=Ie(t),s=Wt(e,r);return this.optimisticQueryResults.queryLogs(s)}queryJournal(e,t){const r=Ie(t),s=Wt(e,r);return this.state.queryJournal(s)}connectionState(){const e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){const t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,r){const s=await this.mutationInternal(e,t,r);if(!s.success)throw s.errorData!==void 0?Ms(s,new ut(hn("mutation",e,s))):new Error(hn("mutation",e,s));return s.value}async mutationInternal(e,t,r,s){const{mutationPromise:o}=this.enqueueMutation(e,t,r,s);return o}enqueueMutation(e,t,r,s){const o=Ie(t);this.tryReportLongDisconnect();const i=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const h=r.optimisticUpdate;if(h!==void 0){const p=y=>{h(y,o)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},d=this.optimisticQueryResults.applyOptimisticUpdate(p,i).map(y=>{const m=this.localQueryResultByToken(y);return{token:y,modification:{kind:"Updated",result:m===void 0?void 0:{success:!0,value:m,logLines:[]}}}});this.handleTransition({queries:d,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const a={type:"Mutation",requestId:i,udfPath:e,componentPath:s,args:[Pe(o)]},l=this.webSocketManager.sendMessage(a),u=this.requestManager.request(a,l);return{requestId:i,mutationPromise:u}}async action(e,t){const r=await this.actionInternal(e,t);if(!r.success)throw r.errorData!==void 0?Ms(r,new ut(hn("action",e,r))):new Error(hn("action",e,r));return r.value}async actionInternal(e,t,r){const s=Ie(t),o=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const i={type:"Action",requestId:o,udfPath:e,componentPath:r,args:[Pe(s)]},a=this.webSocketManager.sendMessage(i);return this.requestManager.request(i,a)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}
3reportMarks(){if(this.debug){const e=xd(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:e})}}tryReportLongDisconnect(){if(!this.debug)return;const e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;const t=`${this.address}/api/debug_event`;fetch(t,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${_t}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function ls(n){if(typeof n!="object"||n===null||!Array.isArray(n.page)||typeof n.isDone!="boolean"||typeof n.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${n==null?void 0:n.toString()}`);return n}var Sd=Object.defineProperty,Cd=(n,e,t)=>e in n?Sd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Yo=(n,e,t)=>Cd(n,typeof e!="symbol"?e+"":e,t);class Ed{constructor(e,t){this.client=e,this.onTransition=t,Yo(this,"paginatedQuerySet",new Map),Yo(this,"lastTransitionTs"),this.lastTransitionTs=ke.fromNumber(0),this.client.addOnTransitionHandler(r=>this.onBaseTransition(r))}subscribe(e,t,r){const s=Ht(e),o=qo(s,t,r),i=()=>this.removePaginatedQuerySubscriber(o),a=this.paginatedQuerySet.get(o);return a?(a.numSubscribers+=1,{paginatedQueryToken:o,unsubscribe:i}):(this.paginatedQuerySet.set(o,{token:o,canonicalizedUdfPath:s,args:t,numSubscribers:1,options:{initialNumItems:r.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:r.id}),this.addPageToPaginatedQuery(o,null,r.initialNumItems),{paginatedQueryToken:o,unsubscribe:i})}localQueryResult(e,t,r){const s=Ht(e),o=qo(s,t,r);return this.localQueryResultByToken(o)}localQueryResultByToken(e){const t=this.paginatedQuerySet.get(e);if(!t)return;const r=this.activePageQueryTokens(t);if(r.length===0)return{results:[],status:"LoadingFirstPage",loadMore:l=>this.loadMoreOfPaginatedQuery(e,l)};let s=[],o=!1,i=!1;for(const l of r){const u=this.client.localQueryResultByToken(l);if(u===void 0){o=!0,i=!1;continue}const h=ls(u);s=s.concat(h.page),i=!!h.isDone}let a;return o?a=s.length===0?"LoadingFirstPage":"LoadingMore":i?a="Exhausted":a="CanLoadMore",{results:s,status:a,loadMore:l=>this.loadMoreOfPaginatedQuery(e,l)}}onBaseTransition(e){const t=e.queries.map(i=>i.token),r=this.queriesContainingTokens(t);let s=[];r.length>0&&(this.processPaginatedQuerySplits(r,i=>this.client.localQueryResultByToken(i)),s=r.map(i=>({token:i,modification:{kind:"Updated",result:this.localQueryResultByToken(i)}})));const o={...e,paginatedQueries:s};this.onTransition(o)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);const r=this.queryTokenForLastPageOfPaginatedQuery(e),s=this.client.localQueryResultByToken(r);if(!s)return!1;const o=ls(s);if(o.isDone)return!1;this.addPageToPaginatedQuery(e,o.continueCursor,t);const i={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:"Updated",result:this.localQueryResultByToken(e)}}]};return this.onTransition(i),!0}queriesContainingTokens(e){if(e.length===0)return[];const t=[],r=new Set(e);for(const[s,o]of this.paginatedQuerySet)for(const i of this.allQueryTokens(o))if(r.has(i)){t.push(s);break}return t}processPaginatedQuerySplits(e,t){for(const r of e){const s=this.mustGetPaginatedQuery(r),{ongoingSplits:o,pageKeyToQuery:i,pageKeys:a}=s;for(const[l,[u,h]]of o)t(i.get(u).queryToken)!==void 0&&t(i.get(h).queryToken)!==void 0&&this.completePaginatedQuerySplit(s,l,u,h);for(const l of a){if(o.has(l))continue;const u=i.get(l).queryToken,h=t(u);if(!h)continue;const p=ls(h);p.splitCursor&&(p.pageStatus==="SplitRecommended"||p.pageStatus==="SplitRequired"||p.page.length>s.options.initialNumItems*2)&&this.splitPaginatedQueryPage(s,l,p.splitCursor,p.continueCursor)}}}splitPaginatedQueryPage(e,t,r,s){const o=e.nextPageKey++,i=e.nextPageKey++,a={cursor:s,numItems:e.options.initialNumItems,id:e.id},l=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:null,endCursor:r}});e.pageKeyToQuery.set(o,l);const u=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:r,endCursor:s}});e.pageKeyToQuery.set(i,u),e.ongoingSplits.set(t,[o,i])}addPageToPaginatedQuery(e,t,r){const s=this.mustGetPaginatedQuery(e),o=s.nextPageKey++,i={cursor:t,numItems:r,id:s.id},a={...s.args,paginationOpts:i},l=this.client.subscribe(s.canonicalizedUdfPath,a);return s.pageKeys.push(o),s.pageKeyToQuery.set(o,l),l}removePaginatedQuerySubscriber(e){const t=this.paginatedQuerySet.get(e);if(t&&(t.numSubscribers-=1,!(t.numSubscribers>
30))){for(const r of t.pageKeyToQuery.values())r.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,r,s){const o=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);const i=e.pageKeys.indexOf(t);e.pageKeys.splice(i,1,r,s),e.ongoingSplits.delete(t),o.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(t=>t.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){const t=this.mustGetPaginatedQuery(e),r=t.pageKeys[t.pageKeys.length-1];if(r===void 0)throw new Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(r).queryToken}mustGetPaginatedQuery(e){const t=this.paginatedQuerySet.get(e);if(!t)throw new Error("paginated query no longer exists for token "+e);return t}}var kd=Object.defineProperty,Ad=(n,e,t)=>e in n?kd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xe=(n,e,t)=>Ad(n,typeof e!="symbol"?e+"":e,t);const ur=560;let On;class Rd{constructor(e,t){if(Xe(this,"address"),Xe(this,"auth"),Xe(this,"adminAuth"),Xe(this,"encodedTsPromise"),Xe(this,"debug"),Xe(this,"fetchOptions"),Xe(this,"fetch"),Xe(this,"logger"),Xe(this,"mutationQueue",[]),Xe(this,"isProcessingQueue",!1),typeof t=="boolean")throw new Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");(t??{}).skipConvexDeploymentUrlCheck!==!0&&ga(e),this.logger=(t==null?void 0:t.logger)===!1?co({verbose:!1}):(t==null?void 0:t.logger)!==!0&&(t!=null&&t.logger)?t.logger:ao({verbose:!1}),this.address=e,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,this.fetch=t==null?void 0:t.fetch,t!=null&&t.auth&&this.setAuth(t.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(e){this.clearAuth(),this.auth=e}setAdminAuth(e,t){if(this.clearAuth(),t!==void 0){const r=new TextEncoder().encode(JSON.stringify(t)),s=btoa(String.fromCodePoint(...r));this.adminAuth=`${e}:${s}`}else this.adminAuth=e}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(e){this.debug=e}setFetchOptions(e){this.fetchOptions=e}async consistentQuery(e,...t){const r=Ie(t[0]),s=this.getTimestamp();return await this.queryInner(e,r,{timestampPromise:s})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){const e=this.fetch||On||fetch,t={"Content-Type":"application/json","Convex-Client":`npm-${_t}`},r=await e(`${this.address}/api/query_ts`,{...this.fetchOptions,method:"POST",headers:t});if(!r.ok)throw new Error(await r.text());const{ts:s}=await r.json();return s}async query(e,...t){const r=Ie(t[0]);return await this.queryInner(e,r,{})}async queryInner(e,t,r){const s=ve(e),o=[Pe(t)],i={"Content-Type":"application/json","Convex-Client":`npm-${_t}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);const a=this.fetch||On||fetch,l=r.timestampPromise?await r.timestampPromise:void 0,u=JSON.stringify({path:s,format:"convex_encoded_json",args:o,...l?{ts:l}:{}}),h=l?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,p=await a(h,{...this.fetchOptions,body:u,method:"POST",headers:i});if(!p.ok&&p.status!==ur)throw new Error(await p.text());const g=await p.json();if(this.debug)for(const d of g.logLines??[])Ct(this.logger,"info","query",s,d);switch(g.status){case"success":return He(g.value);case"error":throw g.errorData!==void 0?dr(g.errorData,new ut(g.errorMessage)):new Error(g.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(g)}`)}}async mutationInner(e,t){const r=ve(e),s=JSON.stringify({path:r,format:"convex_encoded_json",args:[Pe(t)]}),o={"Content-Type":"application/json","Convex-Client":`npm-${_t}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);const a=await(this.fetch||On||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:s,method:"POST",headers:o});if(!a.ok&&a.status!==ur)throw new Error(await a.text());const l=await a.json();if(this.debug)for(const u of l.logLines??[])Ct(this.logger,"info","mutation",r,u);switch(l.status){case"success":return He(l.value);case"error":throw l.errorData!==void 0?dr(l.errorData,new ut(l.errorMessage)):new Error(l.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(l)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;
3this.mutationQueue.length>0;){const{mutation:e,args:t,resolve:r,reject:s}=this.mutationQueue.shift();try{const o=await this.mutationInner(e,t);r(o)}catch(o){s(o)}}this.isProcessingQueue=!1}}enqueueMutation(e,t){return new Promise((r,s)=>{this.mutationQueue.push({mutation:e,args:t,resolve:r,reject:s}),this.processMutationQueue()})}async mutation(e,...t){const[r,s]=t,o=Ie(r);return s!=null&&s.skipQueue?await this.mutationInner(e,o):await this.enqueueMutation(e,o)}async action(e,...t){const r=Ie(t[0]),s=ve(e),o=JSON.stringify({path:s,format:"convex_encoded_json",args:[Pe(r)]}),i={"Content-Type":"application/json","Convex-Client":`npm-${_t}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);const l=await(this.fetch||On||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:o,method:"POST",headers:i});if(!l.ok&&l.status!==ur)throw new Error(await l.text());const u=await l.json();if(this.debug)for(const h of u.logLines??[])Ct(this.logger,"info","action",s,h);switch(u.status){case"success":return He(u.value);case"error":throw u.errorData!==void 0?dr(u.errorData,new ut(u.errorMessage)):new Error(u.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(u)}`)}}async function(e,t,...r){const s=Ie(r[0]),o=typeof e=="string"?e:ve(e),i=JSON.stringify({componentPath:t,path:o,format:"convex_encoded_json",args:Pe(s)}),a={"Content-Type":"application/json","Convex-Client":`npm-${_t}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);const u=await(this.fetch||On||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:i,method:"POST",headers:a});if(!u.ok&&u.status!==ur)throw new Error(await u.text());const h=await u.json();if(this.debug)for(const p of h.logLines??[])Ct(this.logger,"info","any",o,p);switch(h.status){case"success":return He(h.value);case"error":throw h.errorData!==void 0?dr(h.errorData,new ut(h.errorMessage)):new Error(h.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(h)}`)}}}function dr(n,e){return e.data=He(n),e}function Id({getCurrentValue:n,subscribe:e}){const[t,r]=f.useState(()=>({getCurrentValue:n,subscribe:e,value:n()}));let s=t.value;return(t.getCurrentValue!==n||t.subscribe!==e)&&(s=n(),r({getCurrentValue:n,subscribe:e,value:s})),f.useEffect(()=>{let o=!1;const i=()=>{o||r(l=>{if(l.getCurrentValue!==n||l.subscribe!==e)return l;const u=n();return l.value===u?l:{...l,value:u}})},a=e(i);return i(),()=>{o=!0,a()}},[n,e]),s}var Pd=Object.defineProperty,Nd=(n,e,t)=>e in n?Pd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,it=(n,e,t)=>Nd(n,typeof e!="symbol"?e+"":e,t);const Dd=5e3;if(typeof w>"u")throw new Error("Required dependency 'react' not found");function Ra(n,e,t){function r(s){return $d(s),e.mutation(n,s,{optimisticUpdate:t})}return r.withOptimisticUpdate=function(o){if(t!==void 0)throw new Error(`Already specified optimistic update for mutation ${ve(n)}`);return Ra(n,e,o)},r}function Md(n,e){return function(t){return e.action(n,t)}}class Od{constructor(e,t){if(it(this,"address"),it(this,"cachedSync"),it(this,"cachedPaginatedQueryClient"),it(this,"listeners"),it(this,"options"),it(this,"closed",!1),it(this,"_logger"),it(this,"adminAuth"),it(this,"fakeUserIdentity"),e===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof e!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=e,this.listeners=new Map,this._logger=(t==null?void 0:t.logger)===!1?co({verbose:(t==null?void 0:t.verbose)??!1}):(t==null?void 0:t.logger)!==!0&&(t!=null&&t.logger)?t.logger:ao({verbose:(t==null?void 0:t.verbose)??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new Td(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new Ed(this.cachedSync,e=>this.handleTransition(e)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(e,t){if(typeof e=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(e,t??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){const[r,s]=t,o=ve(e);return{onUpdate:i=>{const{queryToken:a,unsubscribe:l}=this.sync.subscribe(o,r,s),u=this.listeners.get(a);return u!==void 0?u.add(i):this.listeners.set(a,new Set([i])),()=>{if(this.closed)return;const h=this.listeners.get(a);h.delete(i),h.size===0&&this.listeners.delete(a),l()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(o,r)},localQueryLogs:()=>
3{if(this.cachedSync)return this.cachedSync.localQueryLogs(o,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(o,r)}}}prewarmQuery(e){const t=e.extendSubscriptionFor??Dd,s=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(s,t)}watchPaginatedQuery(e,t,r){const s=ve(e);return{onUpdate:o=>{const{paginatedQueryToken:i,unsubscribe:a}=this.paginatedQueryClient.subscribe(s,t||{},r),l=this.listeners.get(i);return l!==void 0?l.add(o):this.listeners.set(i,new Set([o])),()=>{if(this.closed)return;const u=this.listeners.get(i);u.delete(o),u.size===0&&this.listeners.delete(i),a()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(s,t,r)}}mutation(e,...t){const[r,s]=t,o=ve(e);return this.sync.mutation(o,r,s)}action(e,...t){const r=ve(e);return this.sync.action(r,...t)}query(e,...t){const r=this.watchQuery(e,...t),s=r.localQueryResult();return s!==void 0?Promise.resolve(s):new Promise((o,i)=>{const a=r.onUpdate(()=>{a();try{o(r.localQueryResult())}catch(l){i(l)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){const t=e.queries.map(s=>s.token),r=e.paginatedQueries.map(s=>s.token);this.transition([...t,...r])}transition(e){for(const t of e){const r=this.listeners.get(t);if(r)for(const s of r)s()}}}const Lr=w.createContext(void 0);function _d(){return f.useContext(Lr)}const jd=({client:n,children:e})=>w.createElement(Lr.Provider,{value:n},e);function Os(n,...e){const t=e[0]==="skip",r=e[0]==="skip"?{}:Ie(e[0]),s=typeof n=="string"?lo(n):n,o=ve(s),i=f.useMemo(()=>t?{}:{query:{query:s,args:r}},[JSON.stringify(Pe(r)),o,t]),l=Vd(i).query;if(l instanceof Error)throw l;return l}function Fd(n){const e=typeof n=="string"?lo(n):n,t=f.useContext(Lr);if(t===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return f.useMemo(()=>Ra(e,t),[t,ve(e)])}function _s(n){const e=f.useContext(Lr),t=typeof n=="string"?lo(n):n;if(e===void 0)throw new Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return f.useMemo(()=>Md(t,e),[e,ve(t)])}function $d(n){if(typeof n=="object"&&n!==null&&"bubbles"in n&&"persist"in n&&"isDefaultPrevented"in n)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Ld=Object.defineProperty,Ud=(n,e,t)=>e in n?Ld(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,us=(n,e,t)=>Ud(n,typeof e!="symbol"?e+"":e,t);class qd{constructor(e){us(this,"createWatch"),us(this,"queries"),us(this,"listeners"),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(const t of Object.keys(e)){const{query:r,args:s,paginationOptions:o}=e[t];if(ve(r),this.queries[t]===void 0)this.addQuery(t,r,s,o?{paginationOptions:o}:{});else{const i=this.queries[t];(ve(r)!==ve(i.query)||JSON.stringify(Pe(s))!==JSON.stringify(Pe(i.args))||JSON.stringify(o)!==JSON.stringify(i.paginationOptions))&&(this.removeQuery(t),this.addQuery(t,r,s,o?{paginationOptions:o}:{}))}}for(const t of Object.keys(this.queries))e[t]===void 0&&this.removeQuery(t)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){const t={};for(const r of Object.keys(e)){const{query:s,args:o}=e[r],i=e[r].paginationOptions;ve(s);const a=this.createWatch(s,o,i?{paginationOptions:i}:{});let l;try{l=a.localQueryResult()}catch(u){if(u instanceof Error)l=u;else throw u}t[r]=l}return t}setCreateWatch(e){this.createWatch=e;for(const t of Object.keys(this.queries)){const{query:r,args:s,watch:o,paginationOptions:i}=this.queries[t],a="journal"in o?o.journal():void 0;this.removeQuery(t),this.addQuery(t,r,s,{...a?{journal:a}:[],...i?{paginationOptions:i}:{}})}}destroy(){for(const e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,t,r,{paginationOptions:s,journal:o}){if(this.queries[e]!==void 0)throw new Error(`Tried to add a new query with identifier ${e} when it already exists.`);const i=this.createWatch(t,r,{...o?{journal:o}:[],...s?{paginationOptions:s}:{}}),a=i.onUpdate(()=>this.notifyListeners());this.queries[e]={query:t,args:r,watch:i,unsubscribe:a,...s?{paginationOptions:s}:{}}}removeQuery(e){const t=this.queries[e];if(t===void 0)throw new Error(`No query found with identifier ${e}.`);t.unsubscribe(),delete this.queries[e]}notifyListeners(){for(const e of this.listeners)e()}}function Vd(n){const e=_d();if(e===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const t=f.useMemo(()=>(r,s,{journal:o,paginationOptions:i})=>
3i?e.watchPaginatedQuery(r,s,i):e.watchQuery(r,s,o?{journal:o}:{}),[e]);return Bd(n,t)}function Bd(n,e){const[t]=f.useState(()=>new qd(e));t.createWatch!==e&&t.setCreateWatch(e),f.useEffect(()=>()=>t.destroy(),[t]);const r=f.useMemo(()=>({getCurrentValue:()=>t.getLocalResults(n),subscribe:s=>(t.setQueries(n),t.subscribe(s))}),[t,n]);return Id(r)}const Ia=f.createContext(void 0);function uo(){const n=f.useContext(Ia);if(n===void 0)throw new Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return n}function Qd({children:n,client:e,useAuth:t}){const{isLoading:r,isAuthenticated:s,fetchAccessToken:o}=t(),[i,a]=f.useState(null);return r&&i!==null&&a(null),!r&&!s&&i!==!1&&a(!1),w.createElement(Ia.Provider,{value:{isLoading:i===null,isAuthenticated:s&&(i??!1)}},w.createElement(Wd,{authProviderAuthenticated:s,fetchAccessToken:o,authProviderLoading:r,client:e,setIsConvexAuthenticated:a}),w.createElement(jd,{client:e},n),w.createElement(zd,{authProviderAuthenticated:s,fetchAccessToken:o,authProviderLoading:r,client:e,setIsConvexAuthenticated:a}))}function Wd({authProviderAuthenticated:n,fetchAccessToken:e,authProviderLoading:t,client:r,setIsConvexAuthenticated:s}){return f.useEffect(()=>{let o=!0;if(n)return r.setAuth(e,i=>{o&&s(()=>i)}),()=>{o=!1,s(i=>i?!1:null)}},[n,e,t,r,s]),null}function zd({authProviderAuthenticated:n,fetchAccessToken:e,authProviderLoading:t,client:r,setIsConvexAuthenticated:s}){return f.useEffect(()=>{if(n)return()=>{r.clearAuth(),s(()=>null)}},[n,e,t,r,s]),null}const Hd=Object.prototype.toString,Yd=n=>Hd.call(n)==="[object Error]",Gd=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function Kd(n){if(!(n&&Yd(n)&&n.name==="TypeError"&&typeof n.message=="string"))return!1;const{message:t,stack:r}=n;return t==="Load failed"?r===void 0||"__sentry_captured__"in n:t.startsWith("error sending request for url")||t==="Failed to fetch"||t.startsWith("Failed to fetch (")&&t.endsWith(")")?!0:Gd.has(t)}const ds=[500,2e3],Jd=100,Pa=f.createContext(void 0),Na=f.createContext(void 0);function Zd(){return f.useContext(Na)}const Xd=f.createContext(null),hs="__convexAuthOAuthVerifier",hr="__convexAuthJWT",fr="__convexAuthRefreshToken",Go="__convexAuthServerStateFetchTime";function eh({client:n,serverState:e,onChange:t,shouldHandleCode:r,storage:s,storageNamespace:o,replaceURL:i,children:a}){const l=f.useRef((e==null?void 0:e._state.token)??null),[u,h]=f.useState(l.current===null),[p,g]=f.useState(l.current),d=n.verbose??!1,y=f.useCallback(N=>{var k;d&&(console.debug(`${new Date().toISOString()} ${N}`),(k=n.logger)==null||k.logVerbose(N))},[d]),{storageSet:m,storageGet:v,storageRemove:S,storageKey:T}=th(s,o),[b,R]=f.useState(!1),I=f.useCallback(async N=>{const k=l.current!==null;let D;if(N.tokens===null)l.current=null,N.shouldStore&&(await S(hr),await S(fr)),D=null;else{const{token:_}=N.tokens;if(l.current=_,N.shouldStore){const{refreshToken:E}=N.tokens;await m(hr,_),await m(fr,E)}D=_}k!==(D!==null)&&await(t==null?void 0:t()),g(D),h(!1)},[m,S]);f.useEffect(()=>{const N=async k=>{if(b){k.preventDefault();const D="Are you sure you want to leave? Your changes may not be saved.";return k.returnValue=!0,D}};return Ko("beforeunload",N),()=>{Jo("beforeunload",N)}}),f.useEffect(()=>{const N=k=>{(async()=>{if(k.storageArea===s&&k.key===T(hr)){const D=k.newValue;y(`synced access token, is null: ${D===null}`),await I({shouldStore:!1,tokens:D===null?null:{token:D}})}})()};return Ko("storage",N),()=>Jo("storage",N)},[I]);const W=f.useCallback(async N=>{let k,D=0;for(;D<ds.length;)try{return await n.unauthenticatedCall("auth:signIn","code"in N?{params:{code:N.code},verifier:N.verifier}:N)}catch(_){if(k=_,!Kd(_))break;const E=ds[D]+Jd*Math.random();D++,y(`verifyCode failed with network error, retry ${D} of ${ds.length} in ${E}ms`),await new Promise(C=>setTimeout(C,E))}throw k},[n]),U=f.useCallback(async N=>{const{tokens:k}=await W(N);return y(`retrieved tokens, is null: ${k===null}`),await I({shouldStore:!0,tokens:k??null}),k!==null},[n,I]),j=f.useCallback(async(N,k)=>{const D=k instanceof FormData?Array.from(k.entries()).reduce((C,[P,L])=>(C[P]=L,C),{}):k??{},_=await v(hs)??void 0;await S(hs);const E=await n.authenticatedCall("auth:signIn",{provider:N,params:D,verifier:_});if(E.redirect!==void 0){const C=new URL(E.redirect);return await m(hs,E.verifier),navigator.product!=="ReactNative"&&(window.location.href=C.toString()),{signingIn:!1,redirect:C}}else if(E.tokens!==void 0){const{tokens:C}=E;return y(`signed in and got tokens, is null: ${C===null}`),await I({shouldStore:!0,tokens:C}),{signingIn:E.tokens!==null}}return{signingIn:!1}},[n,I,v]),$=f.useCallback(async()=>{try{await n.authenticatedCall("auth:signOut")}catch{}y("signed out, erasing tokens"),await I({shouldStore:!0,tokens:null})},[I,n]),z=f.useCallback(async({forceRefreshToken:N})=>{if(N){const k=l.current;return await rh(fr,async()=>{const D=l.current;if(D!==k)return y(`returning synced token, is null: ${D===null}`),D;const _=await v(fr)??null;return _!==null?(R(!0),await U({refreshToken:_}).finally(()=>{R(!1)}),y(`returning retrieved token, is null: ${D===null}`),l.current):(R(!1),y("returning null, there is no refresh token"),null)})}return l.current},[U,$,v]),Y=f.useRef(!1);f.useEffect(()=>{var D;if(s===void 0)throw new Error("`localStorage` is not available in this environment, set the `storage` prop on `ConvexAuthProvider`!");const N=async()=>{const _=await v(hr)??null;y(`retrieved token from storage, is null: ${_===null}`),await I({shouldStore:!1,tokens:_===null?null:{token:_}})};if(e!==void 0){const _=v(Go),E=C=>{if(!C||e._timeFetched>+C){const{token:P,refreshToken:L}=e._state,q=P===null||L===null?null:{token:P,refreshToken:L};m(Go,e._timeFetched.toString()),I({tokens:q,shouldStore:!0})}else N()};_ instanceof Promise?_.then(E):E(_);return}const k=typeof((D=window==null?void 0:window.location)==null?void 0:D.search)<"u"?new URLSearchParams(window.location.search).get("code"):null;if(!Y.current)if(k&&(r===void 0||(typeof r=="function"?r():r))){Y.current=!0;const _=new URL(window.location.href);_.searchParams.delete("code"),(async()=>(await i(_.pathname+_.search+_.hash),await j(void 0,{code:k}),Y.current=!1))()}else N()},[n,v]);const O=f.useMemo(()=>({signIn:j,signOut:$}),[j,$]),ie=p!==null,ne=f.useMemo(()=>({isLoading:u,isAuthenticated:ie,fetchAccessToken:z}),[z,u,ie]);return c.jsx(Na.Provider,{value:ne,children:c.jsx(Pa.Provider,{value:O,children:c.jsx(Xd.Provider,{value:p,children:a})})})}function th(n,e){const t=nh(),r=f.useMemo(()=>n??t(),[n]),s=e.replace(/[^a-zA-Z0-9]/g,""),o=f.useCallback(u=>`${u}_${s}`,[e]),i=f.useCallback((u,h)=>r.setItem(o(u),h),[r,o]),a=f.useCallback(u=>r.getItem(o(u)),[r,o]),l=f.useCallback(u=>r.removeItem(o(u)),[r,o]);return{storageSet:i,storageGet:a,storageRemove:l,storageKey:o}}function nh(){const[n,e]=f.useState({});return()=>({getItem:t=>n[t],setItem:(t,r)=>
3{e(s=>({...s,[t]:r}))},removeItem:t=>{e(r=>{const{[t]:s,...o}=r;return o})}})}async function rh(n,e){var r;const t=(r=window==null?void 0:window.navigator)==null?void 0:r.locks;return t!==void 0?await t.request(n,e):await sh(n,e)}function pr(n){globalThis.__convexAuthMutexes===void 0&&(globalThis.__convexAuthMutexes={});let e=globalThis.__convexAuthMutexes[n];return e===void 0&&(globalThis.__convexAuthMutexes[n]={currentlyRunning:null,waiting:[]}),e=globalThis.__convexAuthMutexes[n],e}function fs(n,e){globalThis.__convexAuthMutexes[n]=e}async function Da(n,e){const t=pr(n);t.currentlyRunning===null?fs(n,{currentlyRunning:e().finally(()=>{const r=pr(n).waiting.shift();pr(n).currentlyRunning=null,fs(n,{...pr(n),currentlyRunning:r===void 0?null:Da(n,r)})}),waiting:[]}):fs(n,{...t,waiting:[...t.waiting,e]})}async function sh(n,e){return new Promise((r,s)=>{Da(n,()=>e().then(i=>r(i)).catch(i=>s(i)))})}function Ko(n,e,t){var r;typeof window>"u"||(r=window.addEventListener)==null||r.call(window,n,e,t)}function Jo(n,e,t){var r;typeof window>"u"||(r=window.removeEventListener)==null||r.call(window,n,e,t)}function Jx(){return f.useContext(Pa)}function oh(n){const{client:e,storage:t,storageNamespace:r,replaceURL:s,shouldHandleCode:o,children:i}=n,a=f.useMemo(()=>{var l;return{authenticatedCall(u,h){return e.action(u,h)},unauthenticatedCall(u,h){return new Rd(e.address,{logger:e.logger}).action(u,h)},verbose:(l=e.options)==null?void 0:l.verbose,logger:e.logger}},[e]);return c.jsx(eh,{client:a,storage:t??(typeof window>"u"||window==null?void 0:window.localStorage),storageNamespace:r??e.address,replaceURL:s??(l=>{window.history.replaceState({},"",l)}),shouldHandleCode:o,children:c.jsx(Qd,{client:e,useAuth:Zd,children:i})})}var ih=typeof Element<"u",ah=typeof Map=="function",ch=typeof Set=="function",lh=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Sr(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,s;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(!Sr(n[r],e[r]))return!1;return!0}var o;if(ah&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=n.entries();!(r=o.next()).done;)if(!Sr(r.value[1],e.get(r.value[0])))return!1;return!0}if(ch&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(lh&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if(s=Object.keys(n),t=s.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;if(ih&&n instanceof Element)return!1;for(r=t;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&n.$$typeof)&&!Sr(n[s[r]],e[s[r]]))return!1;return!0}return n!==n&&e!==e}var uh=function(e,t){try{return Sr(e,t)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const dh=so(uh);var hh=function(n,e,t,r,s,o,i,a){if(!n){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[t,r,s,o,i,a],h=0;l=new Error(e.replace(/%s/g,function(){return u[h++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},fh=hh;const Zo=so(fh);var ph=function(e,t,r,s){var o=r?r.call(s,e,t):void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),u=0;u<i.length;u++){var h=i[u];if(!l(h))return!1;var p=e[h],g=t[h];if(o=r?r.call(s,p,g,h):void 0,o===!1||o===void 0&&p!==g)return!1}return!0};const mh=so(ph);var Ma=(n=>(n.BASE="base",n.BODY="body",n.HEAD="head",n.HTML="html",n.LINK="link",n.META="meta",n.NOSCRIPT="noscript",n.SCRIPT="script",n.STYLE="style",n.TITLE="title",n.FRAGMENT="Symbol(react.fragment)",n))(Ma||{}),ps={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]}
3,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"]}},Xo=Object.values(Ma),Ur={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Oa=Object.entries(Ur).reduce((n,[e,t])=>(n[t]=e,n),{}),Ye="data-rh",fn={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},pn=(n,e)=>{for(let t=n.length-1;t>=0;t-=1){const r=n[t];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},gh=n=>{let e=pn(n,"title");const t=pn(n,fn.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),t&&e)return t.replace(/%s/g,()=>e);const r=pn(n,fn.DEFAULT_TITLE);return e||r||void 0},yh=n=>pn(n,fn.ON_CHANGE_CLIENT_STATE)||(()=>{}),ms=(n,e)=>e.filter(t=>typeof t[n]<"u").map(t=>t[n]).reduce((t,r)=>({...t,...r}),{}),vh=(n,e)=>e.filter(t=>typeof t.base<"u").map(t=>t.base).reverse().reduce((t,r)=>{if(!t.length){const s=Object.keys(r);for(let o=0;o<s.length;o+=1){const a=s[o].toLowerCase();if(n.indexOf(a)!==-1&&r[a])return t.concat(r)}}return t},[]),xh=n=>console&&typeof console.warn=="function"&&console.warn(n),_n=(n,e,t)=>{const r={};return t.filter(s=>Array.isArray(s[n])?!0:(typeof s[n]<"u"&&xh(`Helmet: ${n} should be of type "Array". Instead found type "${typeof s[n]}"`),!1)).map(s=>s[n]).reverse().reduce((s,o)=>{const i={};o.filter(l=>{let u;const h=Object.keys(l);for(let g=0;g<h.length;g+=1){const d=h[g],y=d.toLowerCase();e.indexOf(y)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(y==="rel"&&l[y].toLowerCase()==="stylesheet")&&(u=y),e.indexOf(d)!==-1&&(d==="innerHTML"||d==="cssText"||d==="itemprop")&&(u=d)}if(!u||!l[u])return!1;const p=l[u].toLowerCase();return r[u]||(r[u]={}),i[u]||(i[u]={}),r[u][p]?!1:(i[u][p]=!0,!0)}).reverse().forEach(l=>s.push(l));const a=Object.keys(i);for(let l=0;l<a.length;l+=1){const u=a[l],h={...r[u],...i[u]};r[u]=h}return s},[]).reverse()},bh=(n,e)=>{if(Array.isArray(n)&&n.length){for(let t=0;t<n.length;t+=1)if(n[t][e])return!0}return!1},wh=n=>({baseTag:vh(["href"],n),bodyAttributes:ms("bodyAttributes",n),defer:pn(n,fn.DEFER),encode:pn(n,fn.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:ms("htmlAttributes",n),linkTags:_n("link",["rel","href"],n),metaTags:_n("meta",["name","charset","http-equiv","property","itemprop"],n),noscriptTags:_n("noscript",["innerHTML"],n),onChangeClientState:yh(n),scriptTags:_n("script",["src","innerHTML"],n),styleTags:_n("style",["cssText"],n),title:gh(n),titleAttributes:ms("titleAttributes",n),prioritizeSeoTags:bh(n,fn.PRIORITIZE_SEO_TAGS)}),_a=n=>Array.isArray(n)?n.join(""):n,Th=(n,e)=>{const t=Object.keys(n);for(let r=0;r<t.length;r+=1)if(e[t[r]]&&e[t[r]].includes(n[t[r]]))return!0;return!1},gs=(n,e)=>Array.isArray(n)?n.reduce((t,r)=>(Th(r,e)?t.priority.push(r):t.default.push(r),t),{priority:[],default:[]}):{default:n,priority:[]},ei=(n,e)=>({...n,[e]:void 0}),Sh=["noscript","script","style"],js=(n,e=!0)=>e===!1?String(n):String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ja=n=>Object.keys(n).reduce((e,t)=>{const r=typeof n[t]<"u"?`${t}="${n[t]}"`:`${t}`;return e?`${e} ${r}`:r},""),Ch=(n,e,t,r)=>{const s=ja(t),o=_a(e);return s?`<${n} ${Ye}="true" ${s}>${js(o,r)}</${n}>`:`<${n} ${Ye}="true">${js(o,r)}</${n}>`},Eh=(n,e,t=!0)=>e.reduce((r,s)=>{const o=s,i=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,h)=>{const p=typeof o[h]>"u"?h:`${h}="${js(o[h],t)}"`;return u?`${u} ${p}`:p},""),a=o.innerHTML||o.cssText||"",l=Sh.indexOf(n)===-1;return`${r}<${n} ${Ye}="true" ${i}${l?"/>":`>${a}</${n}>`}`},""),Fa=(n,e={})=>Object.keys(n).reduce((t,r)=>{const s=Ur[r];return t[s||r]=n[r],t},e),kh=(n,e,t)=>{const r={key:e,[Ye]:!0},s=Fa(t,r);return[w.createElement("title",s,e)]},Cr=(n,e)=>e.map((t,r)=>{const s={key:r,[Ye]:!0};return Object.keys(t).forEach(o=>{const a=Ur[o]||o;if(a==="innerHTML"||a==="cssText"){const l=t.innerHTML||t.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=t[o]}),w.createElement(n,s)}),Fe=(n,e,t=!0)=>{switch(n){case"title":return{toComponent:()=>kh(n,e.title,e.titleAttributes),toString:()=>Ch(n,e.title,e.titleAttributes,t)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Fa(e),toString:()=>ja(e)};default:return{toComponent:()=>
3Cr(n,e),toString:()=>Eh(n,e,t)}}},Ah=({metaTags:n,linkTags:e,scriptTags:t,encode:r})=>{const s=gs(n,ps.meta),o=gs(e,ps.link),i=gs(t,ps.script);return{priorityMethods:{toComponent:()=>[...Cr("meta",s.priority),...Cr("link",o.priority),...Cr("script",i.priority)],toString:()=>`${Fe("meta",s.priority,r)} ${Fe("link",o.priority,r)} ${Fe("script",i.priority,r)}`},metaTags:s.default,linkTags:o.default,scriptTags:i.default}},Rh=n=>{const{baseTag:e,bodyAttributes:t,encode:r=!0,htmlAttributes:s,noscriptTags:o,styleTags:i,title:a="",titleAttributes:l,prioritizeSeoTags:u}=n;let{linkTags:h,metaTags:p,scriptTags:g}=n,d={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:d,linkTags:h,metaTags:p,scriptTags:g}=Ah(n)),{priority:d,base:Fe("base",e,r),bodyAttributes:Fe("bodyAttributes",t,r),htmlAttributes:Fe("htmlAttributes",s,r),link:Fe("link",h,r),meta:Fe("meta",p,r),noscript:Fe("noscript",o,r),script:Fe("script",g,r),style:Fe("style",i,r),title:Fe("title",{title:a,titleAttributes:l},r)}},Fs=Rh,mr=[],ho=!!(typeof window<"u"&&window.document&&window.document.createElement),$s=class{constructor(n,e){F(this,"instances",[]);F(this,"canUseDOM",ho);F(this,"context");F(this,"value",{setHelmet:n=>{this.context.helmet=n},helmetInstances:{get:()=>this.canUseDOM?mr:this.instances,add:n=>{(this.canUseDOM?mr:this.instances).push(n)},remove:n=>{const e=(this.canUseDOM?mr:this.instances).indexOf(n);(this.canUseDOM?mr:this.instances).splice(e,1)}}});this.context=n,this.canUseDOM=e||!1,e||(n.helmet=Fs({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ih=parseInt(w.version.split(".")[0],10),Ls=Ih>=19,Ph={},$a=w.createContext(Ph),$t,La=($t=class extends f.Component{constructor(t){super(t);F(this,"helmetData");Ls?this.helmetData=null:this.helmetData=new $s(this.props.context||{},$t.canUseDOM)}render(){return Ls?w.createElement(w.Fragment,null,this.props.children):w.createElement($a.Provider,{value:this.helmetData.value},this.props.children)}},F($t,"canUseDOM",ho),$t),nn=(n,e)=>{const t=document.head||document.querySelector("head"),r=t.querySelectorAll(`${n}[${Ye}]`),s=[].slice.call(r),o=[];let i;return e&&e.length&&e.forEach(a=>{const l=document.createElement(n);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText"){const h=a.cssText;l.appendChild(document.createTextNode(h))}else{const h=u,p=typeof a[h]>"u"?"":a[h];l.setAttribute(u,p)}l.setAttribute(Ye,"true"),s.some((u,h)=>(i=h,l.isEqualNode(u)))?s.splice(i,1):o.push(l)}),s.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>t.appendChild(a)),{oldTags:s,newTags:o}},Us=(n,e)=>{const t=document.getElementsByTagName(n)[0];if(!t)return;const r=t.getAttribute(Ye),s=r?r.split(","):[],o=[...s],i=Object.keys(e);for(const a of i){const l=e[a]||"";t.getAttribute(a)!==l&&t.setAttribute(a,l),s.indexOf(a)===-1&&s.push(a);const u=o.indexOf(a);u!==-1&&o.splice(u,1)}for(let a=o.length-1;a>=0;a-=1)t.removeAttribute(o[a]);s.length===o.length?t.removeAttribute(Ye):t.getAttribute(Ye)!==i.join(",")&&t.setAttribute(Ye,i.join(","))},Nh=(n,e)=>{typeof n<"u"&&document.title!==n&&(document.title=_a(n)),Us("title",e)},ti=(n,e)=>{const{baseTag:t,bodyAttributes:r,htmlAttributes:s,linkTags:o,metaTags:i,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:h,title:p,titleAttributes:g}=n;Us("body",r),Us("html",s),Nh(p,g);const d={baseTag:nn("base",t),linkTags:nn("link",o),metaTags:nn("meta",i),noscriptTags:nn("noscript",a),scriptTags:nn("script",u),styleTags:nn("style",h)},y={},m={};Object.keys(d).forEach(v=>{const{newTags:S,oldTags:T}=d[v];S.length&&(y[v]=S),T.length&&(m[v]=d[v].oldTags)}),e&&e(),l(n,y,m)},jn=null,Dh=n=>{jn&&cancelAnimationFrame(jn),n.defer?jn=requestAnimationFrame(()=>{ti(n,()=>{jn=null})}):(ti(n),jn=null)},Mh=Dh,ni=class extends f.Component{constructor(){super(...arguments);F(this,"rendered",!1)}shouldComponentUpdate(e){return!mh(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let r=null;const s=wh(e.get().map(o=>{const{context:i,...a}=o.props;return a}));La.canUseDOM?Mh(s):Fs&&(r=Fs(s)),t(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},Er=[],ri=n=>{const e={};for(const t of Object.keys(n))e[Oa[t]||t]=n[t];return e},Nt=n=>{const e={};for(const t of Object.keys(n)){const r=Ur[t];e[r||t]=n[t]}return e},si=(n,e)=>{if(!ho)return;const t=document.getElementsByTagName(n)[0];if(!t)return;const r="data-rh-managed",s=t.getAttribute(r),o=s?s.split(","):[],i=Object.keys(e);for(const a of o)i.includes(a)||t.removeAttribute(a);for(const a of i){const l=e[a];l==null||l===!1?t.removeAttribute(a):l===!0?t.setAttribute(a,""):t.setAttribute(a,String(l))}i.length>0?t.setAttribute(r,i.join(",")):t.removeAttribute(r)},ys=()=>{const n={},e={};for(const t of Er){const{htmlAttributes:r,bodyAttributes:s}=t.props;r&&Object.assign(n,ri(r)),s&&Object.assign(e,ri(s))}si("html",n),si("body",e)},Oh=class extends f.Component{componentDidMount(){Er.push(this),ys()}componentDidUpdate(){ys()}componentWillUnmount(){const n=Er.indexOf(this);n!==-1&&Er.splice(n,1),ys()}resolveTitle(){const{title:n,titleTemplate:e,defaultTitle:t}=this.props;return n&&e?e.replace(/%s/g,()=>Array.isArray(n)?n.join(""):n):n||t||void 0}renderTitle(){const n=this.resolveTitle();if(n===void 0)return null;const e=this.props.titleAttributes||{};return w.createElement("title",Nt(e),n)}renderBase(){const{base:n}=this.props;return n?w.createElement("base",Nt(n)):null}renderMeta(){const{meta:n}=this.props;return!n||!Array.isArray(n)?null:n.map((e,t)=>w.createElement("meta",{key:t,...Nt(e)}))}renderLink(){const{link:n}=this.props;return!n||!Array.isArray(n)?null:n.map((e,t)=>w.createElement("link",{key:t,...Nt(e)}))}renderScript(){const{script:n}=this.props;return!n||!Array.isArray(n)?null:n.map((e,t)=>{const{innerHTML:r,...s}=e,o=Nt(s);return r&&(o.dangerouslySetInnerHTML={__html:r}),w.createElement("script",{key:t,...o})})}renderStyle(){const{style:n}=this.props;return!n||!Array.isArray(n)?null:n.map((e,t)=>{const{cssText:r,...s}=e,o=Nt(s);return r&&(o.dangerouslySetInnerHTML={__html:r}),w.createElement("style",{key:t,...o})})}renderNoscript(){const{noscript:n}=this.props;return!n||!Array.isArray(n)?null:n.map((e,t)=>{const{innerHTML:r,...s}=e,o=Nt(s);return r&&(o.dangerouslySetInnerHTML={__html:r}),w.createElement("noscript",{key:t,...o})})}render(){return w.createElement(w.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},Is,_h=(Is=class extends f.Component{shouldComponentUpdate(n){return!dh(ei(this.props,"helmetData"),ei(n,"helmetData"))}mapNestedChildrenToProps(n,e){if(!e)return null;switch(n.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${n.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(n,e,t,r){return{...e,[n.type]:[...e[n.type]||[],{...t,...this.mapNestedChildrenToProps(n,r)}]}}mapObjectTypeChildren(n,e,t,r){switch(n.type){case"title":return{...e,[n.type]:r,titleAttributes:{...t}};case"body":return{...e,bodyAttributes:{...t}};case"html":return{...e,htmlAttributes:{...t}};default:return{...e,[n.type]:{...t}}}}mapArrayTypeChildrenToProps(n,e){let t={...e};
3return Object.keys(n).forEach(r=>{t={...t,[r]:n[r]}}),t}warnOnInvalidChildren(n,e){return Zo(Xo.some(t=>n.type===t),typeof n.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 ${Xo.join(", ")} are allowed. Helmet does not support rendering <${n.type}> elements. Refer to our API for more information.`),Zo(!e||typeof e=="string"||Array.isArray(e)&&!e.some(t=>typeof t!="string"),`Helmet expects a string as a child of <${n.type}>. Did you forget to wrap your children in braces? ( <${n.type}>{\`\`}</${n.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(n,e){let t={};return w.Children.forEach(n,r=>{if(!r||!r.props)return;const{children:s,...o}=r.props,i=Object.keys(o).reduce((l,u)=>(l[Oa[u]||u]=o[u],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,s),a){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":t=this.flattenArrayTypeChildren(r,t,i,s);break;default:e=this.mapObjectTypeChildren(r,e,i,s);break}}),this.mapArrayTypeChildrenToProps(t,e)}render(){const{children:n,...e}=this.props;let t={...e},{helmetData:r}=e;if(n&&(t=this.mapChildrenToProps(n,t)),r&&!(r instanceof $s)){const s=r;r=new $s(s.context,!0),delete t.helmetData}return Ls?w.createElement(Oh,{...t}):r?w.createElement(ni,{...t,context:r.value}):w.createElement($a.Consumer,null,s=>w.createElement(ni,{...t,context:s}))}},F(Is,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Is);const jh="modulepreload",Fh=function(n){return"/"+n},oi={},J=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=Fh(l),l in oi)return;oi[l]=!0;const u=l.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":jh,u||(p.as="script"),p.crossOrigin="",p.href=l,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((g,d)=>{p.addEventListener("load",g),p.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};var qr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vr=typeof window>"u"||"Deno"in globalThis;function Qe(){}function $h(n,e){return typeof n=="function"?n(e):n}function Lh(n){return typeof n=="number"&&n>=0&&n!==1/0}function Uh(n,e){return Math.max(n+(e||0)-Date.now(),0)}function qs(n,e){return typeof n=="function"?n(e):n}function qh(n,e){return typeof n=="function"?n(e):n}function ii(n,e){const{type:t="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=n;if(i){if(r){if(e.queryHash!==fo(i,e.options))return!1}else if(!Jn(e.queryKey,i))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||o&&!o(e))}function ai(n,e){const{exact:t,status:r,predicate:s,mutationKey:o}=n;if(o){if(!e.options.mutationKey)return!1;if(t){if(Kn(e.options.mutationKey)!==Kn(o))return!1}else if(!Jn(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function fo(n,e){return((e==null?void 0:e.queryKeyHashFn)||Kn)(n)}function Kn(n){return JSON.stringify(n,(e,t)=>Vs(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Jn(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>Jn(n[t],e[t])):!1}function Ua(n,e){if(n===e)return n;const t=ci(n)&&ci(e);if(t||Vs(n)&&Vs(e)){const r=t?n:Object.keys(n),s=r.length,o=t?e:Object.keys(e),i=o.length,a=t?[]:{},l=new Set(r);let u=0;for(let h=0;h<i;h++){const p=t?h:o[h];(!t&&l.has(p)||t)&&n[p]===void 0&&e[p]===void 0?(a[p]=void 0,u++):(a[p]=Ua(n[p],e[p]
3),a[p]===n[p]&&n[p]!==void 0&&u++)}return s===i&&u===s?n:a}return e}function ci(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Vs(n){if(!li(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!li(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function li(n){return Object.prototype.toString.call(n)==="[object Object]"}function Vh(n){return new Promise(e=>{setTimeout(e,n)})}function Bh(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?Ua(n,e):e}function Qh(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function Wh(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var po=Symbol();function qa(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===po?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var Lt,xt,gn,Ki,zh=(Ki=class extends qr{constructor(){super();H(this,Lt);H(this,xt);H(this,gn);B(this,gn,e=>{if(!Vr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){x(this,xt)||this.setEventListener(x(this,gn))}onUnsubscribe(){var e;this.hasListeners()||((e=x(this,xt))==null||e.call(this),B(this,xt,void 0))}setEventListener(e){var t;B(this,gn,e),(t=x(this,xt))==null||t.call(this),B(this,xt,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){x(this,Lt)!==e&&(B(this,Lt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof x(this,Lt)=="boolean"?x(this,Lt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Lt=new WeakMap,xt=new WeakMap,gn=new WeakMap,Ki),Va=new zh,yn,bt,vn,Ji,Hh=(Ji=class extends qr{constructor(){super();H(this,yn,!0);H(this,bt);H(this,vn);B(this,vn,e=>{if(!Vr&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){x(this,bt)||this.setEventListener(x(this,vn))}onUnsubscribe(){var e;this.hasListeners()||((e=x(this,bt))==null||e.call(this),B(this,bt,void 0))}setEventListener(e){var t;B(this,vn,e),(t=x(this,bt))==null||t.call(this),B(this,bt,e(this.setOnline.bind(this)))}setOnline(e){x(this,yn)!==e&&(B(this,yn,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return x(this,yn)}},yn=new WeakMap,bt=new WeakMap,vn=new WeakMap,Ji),Nr=new Hh;function Yh(){let n,e;const t=new Promise((s,o)=>{n=s,e=o});t.status="pending",t.catch(()=>{});function r(s){Object.assign(t,s),delete t.resolve,delete t.reject}return t.resolve=s=>{r({status:"fulfilled",value:s}),n(s)},t.reject=s=>{r({status:"rejected",reason:s}),e(s)},t}function Gh(n){return Math.min(1e3*2**n,3e4)}function Ba(n){return(n??"online")==="online"?Nr.isOnline():!0}var Qa=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function vs(n){return n instanceof Qa}function Wa(n){let e=!1,t=0,r=!1,s;const o=Yh(),i=m=>{var v;r||(g(new Qa(m)),(v=n.abort)==null||v.call(n))},a=()=>{e=!0},l=()=>{e=!1},u=()=>Va.isFocused()&&(n.networkMode==="always"||Nr.isOnline())&&n.canRun(),h=()=>Ba(n.networkMode)&&n.canRun(),p=m=>{var v;r||(r=!0,(v=n.onSuccess)==null||v.call(n,m),s==null||s(),o.resolve(m))},g=m=>{var v;r||(r=!0,(v=n.onError)==null||v.call(n,m),s==null||s(),o.reject(m))},d=()=>new Promise(m=>{var v;s=S=>{(r||u())&&m(S)},(v=n.onPause)==null||v.call(n)}).then(()=>{var m;s=void 0,r||(m=n.onContinue)==null||m.call(n)}),y=()=>{if(r)return;let m;const v=t===0?n.initialPromise:void 0;try{m=v??n.fn()}catch(S){m=Promise.reject(S)}Promise.resolve(m).then(p).catch(S=>{var W;if(r)return;const T=n.retry??(Vr?0:3),b=n.retryDelay??Gh,R=typeof b=="function"?b(t,S):b,I=T===!0||typeof T=="number"&&t<T||typeof T=="function"&&T(t,S);if(e||!I){g(S);return}t++,(W=n.onFail)==null||W.call(n,t,S),Vh(R).then(()=>u()?void 0:d()).then(()=>{e?g(S):y()})})};return{promise:o,cancel:i,continue:()=>(s==null||s(),o),cancelRetry:a,continueRetry:l,canStart:h,start:()=>(h()?y():d().then(y),o)}}var Kh=n=>setTimeout(n,0);function Jh(){let n=[],e=0,t=a=>{a()},r=a=>{a()},s=Kh;const o=a=>{e?n.push(a):s(()=>{t(a)})},i=()=>{const a=n;n=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{t(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||i()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Se=Jh(),Ut,Zi,za=(Zi=class{constructor(){H(this,Ut)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lh(this.gcTime)&&B(this,Ut,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Vr?1/0:5*60*1e3))}clearGcTimeout(){x(this,Ut)&&(clearTimeout(x(this,Ut)),B(this,Ut,void 0))}}
3,Ut=new WeakMap,Zi),xn,qt,$e,Vt,we,Zn,Bt,We,ct,Xi,Zh=(Xi=class extends za{constructor(e){super();H(this,We);H(this,xn);H(this,qt);H(this,$e);H(this,Vt);H(this,we);H(this,Zn);H(this,Bt);B(this,Bt,!1),B(this,Zn,e.defaultOptions),this.setOptions(e.options),this.observers=[],B(this,Vt,e.client),B(this,$e,x(this,Vt).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,B(this,xn,ef(this.options)),this.state=e.state??x(this,xn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=x(this,we))==null?void 0:e.promise}setOptions(e){this.options={...x(this,Zn),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,$e).remove(this)}setData(e,t){const r=Bh(this.state.data,e,this.options);return be(this,We,ct).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){be(this,We,ct).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r,s;const t=(r=x(this,we))==null?void 0:r.promise;return(s=x(this,we))==null||s.cancel(e),t?t.then(Qe).catch(Qe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(x(this,xn))}isActive(){return this.observers.some(e=>qh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===po||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>qs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Uh(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=x(this,we))==null||t.continue()}onOnline(){var t;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=x(this,we))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),x(this,$e).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(x(this,we)&&(x(this,Bt)?x(this,we).
3cancel({revert:!0}):x(this,we).cancelRetry()),this.scheduleGc()),x(this,$e).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,We,ct).call(this,{type:"invalidate"})}fetch(e,t){var u,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(x(this,we))return x(this,we).continueRetry(),x(this,we).promise}if(e&&this.setOptions(e),!this.options.queryFn){const g=this.observers.find(d=>d.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(B(this,Bt,!0),r.signal)})},o=()=>{const g=qa(this.options,t),y=(()=>{const m={client:x(this,Vt),queryKey:this.queryKey,meta:this.meta};return s(m),m})();return B(this,Bt,!1),this.options.persister?this.options.persister(g,y,this):g(y)},a=(()=>{const g={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:x(this,Vt),state:this.state,fetchFn:o};return s(g),g})();(u=this.options.behavior)==null||u.onFetch(a,this),B(this,qt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&be(this,We,ct).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var d,y,m,v;vs(g)&&g.silent||be(this,We,ct).call(this,{type:"error",error:g}),vs(g)||((y=(d=x(this,$e).config).onError)==null||y.call(d,g,this),(v=(m=x(this,$e).config).onSettled)==null||v.call(m,this.state.data,g,this)),this.scheduleGc()};return B(this,we,Wa({initialPromise:t==null?void 0:t.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var d,y,m,v;if(g===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(S){l(S);return}(y=(d=x(this,$e).config).onSuccess)==null||y.call(d,g,this),(v=(m=x(this,$e).config).onSettled)==null||v.call(m,g,this.state.error,this),this.scheduleGc()},onError:l,onFail:(g,d)=>{be(this,We,ct).call(this,{type:"failed",failureCount:g,error:d})},onPause:()=>{be(this,We,ct).call(this,{type:"pause"})},onContinue:()=>{be(this,We,ct).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),x(this,we).start()}},xn=new WeakMap,qt=new WeakMap,$e=new WeakMap,Vt=new WeakMap,we=new WeakMap,Zn=new WeakMap,Bt=new WeakMap,We=new WeakSet,ct=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Xh(r.data,this.options),fetchMeta:e.meta??null};case"success":return B(this,qt,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return vs(s)&&s.revert&&x(this,qt)?{...x(this,qt),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Se.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),x(this,$e).notify({query:this,type:"updated",action:e})})},Xi);function Xh(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ba(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function ef(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var et,ea,tf=(ea=class extends qr{constructor(e={}){super();H(this,et);this.config=e,B(this,et,new Map)}build(e,t,r){const s=t.queryKey,o=t.queryHash??fo(s,t);let i=this.get(o);
3return i||(i=new Zh({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(i)),i}add(e){x(this,et).has(e.queryHash)||(x(this,et).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=x(this,et).get(e.queryHash);t&&(e.destroy(),t===e&&x(this,et).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Se.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return x(this,et).get(e)}getAll(){return[...x(this,et).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>ii(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>ii(e,r)):t}notify(e){Se.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Se.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Se.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},et=new WeakMap,ea),tt,Te,Qt,nt,yt,ta,nf=(ta=class extends za{constructor(e){super();H(this,nt);H(this,tt);H(this,Te);H(this,Qt);this.mutationId=e.mutationId,B(this,Te,e.mutationCache),B(this,tt,[]),this.state=e.state||rf(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){x(this,tt).includes(e)||(x(this,tt).push(e),this.clearGcTimeout(),x(this,Te).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){B(this,tt,x(this,tt).filter(t=>t!==e)),this.scheduleGc(),x(this,Te).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){x(this,tt).length||(this.state.status==="pending"?this.scheduleGc():x(this,Te).remove(this))}continue(){var e;return((e=x(this,Qt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,i,a,l,u,h,p,g,d,y,m,v,S,T,b,R,I,W,U,j;const t=()=>{be(this,nt,yt).call(this,{type:"continue"})};B(this,Qt,Wa({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:($,z)=>{be(this,nt,yt).call(this,{type:"failed",failureCount:$,error:z})},onPause:()=>{be(this,nt,yt).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>x(this,Te).canRun(this)}));const r=this.state.status==="pending",s=!x(this,Qt).canStart();try{if(r)t();else{be(this,nt,yt).call(this,{type:"pending",variables:e,isPaused:s}),await((i=(o=x(this,Te).config).onMutate)==null?void 0:i.call(o,e,this));const z=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));z!==this.state.context&&be(this,nt,yt).call(this,{type:"pending",context:z,variables:e,isPaused:s})}const $=await x(this,Qt).start();return await((h=(u=x(this,Te).config).onSuccess)==null?void 0:h.call(u,$,e,this.state.context,this)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,$,e,this.state.context)),await((y=(d=x(this,Te).config).onSettled)==null?void 0:y.call(d,$,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,$,null,e,this.state.context)),be(this,nt,yt).call(this,{type:"success",data:$}),$}catch($){try{throw await((T=(S=x(this,Te).config).onError)==null?void 0:T.call(S,$,e,this.state.context,this)),await((R=(b=this.options).onError)==null?void 0:R.call(b,$,e,this.state.context)),await((W=(I=x(this,Te).config).onSettled)==null?void 0:W.call(I,void 0,$,this.state.variables,this.state.context,this)),await((j=(U=this.options).onSettled)==null?void 0:j.call(U,void 0,$,e,this.state.context)),$}finally{be(this,nt,yt).call(this,{type:"error",error:$})}}finally{x(this,Te).runNext(this)}}},tt=new WeakMap,Te=new WeakMap,Qt=new WeakMap,nt=new WeakSet,yt=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPau
3sed:!1,status:"error"}}};this.state=t(this.state),Se.batch(()=>{x(this,tt).forEach(r=>{r.onMutationUpdate(e)}),x(this,Te).notify({mutation:this,type:"updated",action:e})})},ta);function rf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lt,ze,Xn,na,sf=(na=class extends qr{constructor(e={}){super();H(this,lt);H(this,ze);H(this,Xn);this.config=e,B(this,lt,new Set),B(this,ze,new Map),B(this,Xn,0)}build(e,t,r){const s=new nf({mutationCache:this,mutationId:++ar(this,Xn)._,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){x(this,lt).add(e);const t=gr(e);if(typeof t=="string"){const r=x(this,ze).get(t);r?r.push(e):x(this,ze).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(x(this,lt).delete(e)){const t=gr(e);if(typeof t=="string"){const r=x(this,ze).get(t);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&x(this,ze).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=gr(e);if(typeof t=="string"){const r=x(this,ze).get(t),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const t=gr(e);if(typeof t=="string"){const s=(r=x(this,ze).get(t))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Se.batch(()=>{x(this,lt).forEach(e=>{this.notify({type:"removed",mutation:e})}),x(this,lt).clear(),x(this,ze).clear()})}getAll(){return Array.from(x(this,lt))}find(e){const t={exact:!0,...e};return this.getAll().find(r=>ai(t,r))}findAll(e={}){return this.getAll().filter(t=>ai(e,t))}notify(e){Se.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>
3t.state.isPaused);return Se.batch(()=>Promise.all(e.map(t=>t.continue().catch(Qe))))}},lt=new WeakMap,ze=new WeakMap,Xn=new WeakMap,na);function gr(n){var e;return(e=n.options.scope)==null?void 0:e.id}function ui(n){return{onFetch:(e,t)=>{var h,p,g,d,y;const r=e.options,s=(g=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,o=((d=e.state.data)==null?void 0:d.pages)||[],i=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},S=qa(e.options,e.fetchOptions),T=async(b,R,I)=>{if(m)return Promise.reject();if(R==null&&b.pages.length)return Promise.resolve(b);const U=(()=>{const Y={client:e.client,queryKey:e.queryKey,pageParam:R,direction:I?"backward":"forward",meta:e.options.meta};return v(Y),Y})(),j=await S(U),{maxPages:$}=e.options,z=I?Wh:Qh;return{pages:z(b.pages,j,$),pageParams:z(b.pageParams,R,$)}};if(s&&o.length){const b=s==="backward",R=b?of:di,I={pages:o,pageParams:i},W=R(r,I);a=await T(I,W,b)}else{const b=n??o.length;do{const R=l===0?i[0]??r.initialPageParam:di(r,a);if(l>0&&R==null)break;a=await T(a,R),l++}while(l<b)}return a};e.options.persister?e.fetchFn=()=>{var m,v;return(v=(m=e.options).persister)==null?void 0:v.call(m,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=u}}}function di(n,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,t[r],t):void 0}function of(n,{pages:e,pageParams:t}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t):void 0}var de,wt,Tt,bn,wn,St,Tn,Sn,ra,af=(ra=class{constructor(n={}){H(this,de);H(this,wt);H(this,Tt);H(this,bn);H(this,wn);H(this,St);H(this,Tn);H(this,Sn);B(this,de,n.queryCache||new tf),B(this,wt,n.mutationCache||new sf),B(this,Tt,n.defaultOptions||{}),B(this,bn,new Map),B(this,wn,new Map),B(this,St,0)}mount(){ar(this,St)._++,x(this,St)===1&&(B(this,Tn,Va.subscribe(async n=>{n&&(await this.resumePausedMutations(),x(this,de).onFocus())})),B(this,Sn,Nr.subscribe(async n=>{n&&(await this.resumePausedMutations(),x(this,de).onOnline())})))}unmount(){var n,e;ar(this,St)._--,x(this,St)===0&&((n=x(this,Tn))==null||n.call(this),B(this,Tn,void 0),(e=x(this,Sn))==null||e.call(this),B(this,Sn,void 0))}isFetching(n){return x(this,de).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return x(this,wt).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=x(this,de).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=x(this,de).build(this,e),r=t.state.data;return r===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(qs(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(n){return x(this,de).findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=this.defaultQueryOptions({queryKey:n}),s=x(this,de).get(r.queryHash),o=s==null?void 0:s.state.data,i=$h(e,o);if(i!==void 0)return x(this,de).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(n,e,t){return Se.batch(()=>x(this,de).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=x(this,de).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=x(this,de);Se.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=x(this,de);return Se.batch(()=>(t.findAll(n).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},r=Se.batch(()=>x(this,de).findAll(n).map(s=>s.cancel(t)));return Promise.all(r).then(Qe).catch(Qe)}invalidateQueries(n,e={}){return Se.batch(()=>(x(this,de).findAll(n).forEach(t=>{t.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},r=Se.batch(()=>x(this,de).findAll(n).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,t);return t.throwOnError||(o=o.catch(Qe)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Qe)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=x(this,de).build(this,e);return t.isStaleByTime(qs(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Qe).catch(Qe)}
3fetchInfiniteQuery(n){return n.behavior=ui(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Qe).catch(Qe)}ensureInfiniteQueryData(n){return n.behavior=ui(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Nr.isOnline()?x(this,wt).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,de)}getMutationCache(){return x(this,wt)}getDefaultOptions(){return x(this,Tt)}setDefaultOptions(n){B(this,Tt,n)}setQueryDefaults(n,e){x(this,bn).set(Kn(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...x(this,bn).values()],t={};return e.forEach(r=>{Jn(n,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(n,e){x(this,wn).set(Kn(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...x(this,wn).values()],t={};return e.forEach(r=>{Jn(n,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...x(this,Tt).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=fo(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===po&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...x(this,Tt).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){x(this,de).clear(),x(this,wt).clear()}},de=new WeakMap,wt=new WeakMap,Tt=new WeakMap,bn=new WeakMap,wn=new WeakMap,St=new WeakMap,Tn=new WeakMap,Sn=new WeakMap,ra),cf=f.createContext(void 0),lf=({client:n,children:e})=>(f.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),c.jsx(cf.Provider,{value:n,children:e})),hi=["light","dark"],uf="(prefers-color-scheme: dark)",df=f.createContext(void 0),hf={setTheme:n=>{},themes:[]},ff=()=>{var n;return(n=f.useContext(df))!=null?n:hf};f.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let u=o==="system",h=t==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${t}',s='setAttribute';`,p=s?hi.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(y,m=!1,v=!0)=>{let S=i?i[y]:y,T=m?y+"|| ''":`'${S}'`,b="";return s&&v&&!m&&hi.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),t==="class"?m||S?b+=`c.add(${T})`:b+="null":S&&(b+=`d[s](n,${T})`),b},d=n?`!function(){${h}${g(n)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${uf}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}${u?"":"else{"+g(o,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${e}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}else{${g(o,!1,!1)};}${p}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:d}})});var pf=n=>{switch(n){case"success":return yf;case"info":return xf;case"warning":return vf;case"error":return bf;default:return null}},mf=Array(12).fill(0),gf=({visible:n,className:e})=>w.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":n},w.createElement("div",{className:"sonner-spinner"},mf.map((t,r)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yf=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.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"})),vf=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.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"})),xf=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.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"})),bf=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.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"})),wf=w.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"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Tf=()=>{let[n,e]=w.useState(document.hidden);return w.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),n},Bs=1,Sf=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let e=this.subscribers.indexOf(n);this.subscribers.splice(e,1)}),this.publish=n=>
3{this.subscribers.forEach(e=>e(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var e;let{message:t,...r}=n,s=typeof(n==null?void 0:n.id)=="number"||((e=n.id)==null?void 0:e.length)>0?n.id:Bs++,o=this.toasts.find(a=>a.id===s),i=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...n,id:s,title:t}),{...a,...n,id:s,dismissible:i,title:t}):a):this.addToast({title:t,...r,dismissible:i,id:s}),s},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:n,dismiss:!0})),n),this.message=(n,e)=>this.create({...e,message:n}),this.error=(n,e)=>this.create({...e,message:n,type:"error"}),this.success=(n,e)=>this.create({...e,type:"success",message:n}),this.info=(n,e)=>this.create({...e,type:"info",message:n}),this.warning=(n,e)=>this.create({...e,type:"warning",message:n}),this.loading=(n,e)=>this.create({...e,type:"loading",message:n}),this.promise=(n,e)=>{if(!e)return;let t;e.loading!==void 0&&(t=this.create({...e,promise:n,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=n instanceof Promise?n:n(),s=t!==void 0,o,i=r.then(async l=>{if(o=["resolve",l],w.isValidElement(l))s=!1,this.create({id:t,type:"default",message:l});else if(Ef(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,h=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:t,type:"error",message:u,description:h})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,h=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"success",message:u,description:h})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,h=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"error",message:u,description:h})}}).finally(()=>{var l;s&&(this.dismiss(t),t=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>i.then(()=>o[0]==="reject"?u(o[1]):l(o[1])).catch(u));return typeof t!="string"&&typeof t!="number"?{unwrap:a}:Object.assign(t,{unwrap:a})},this.custom=(n,e)=>{let t=(e==null?void 0:e.id)||Bs++;return this.create({jsx:n(t),id:t,...e}),t},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ee=new Sf,Cf=(n,e)=>{let t=(e==null?void 0:e.id)||Bs++;return Ee.addToast({title:n,...e,id:t}),t},Ef=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",kf=Cf,Af=()=>Ee.toasts,Rf=()=>Ee.getActiveToasts();Object.assign(kf,{success:Ee.success,info:Ee.info,warning:Ee.warning,error:Ee.error,custom:Ee.custom,message:Ee.message,promise:Ee.promise,dismiss:Ee.dismiss,loading:Ee.loading},{getHistory:Af,getToasts:Rf});function If(n,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}If(`: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;
3left: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}
3: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%);
3--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%)} 4`);function yr(n){return n.label!==void 0}var Pf=3,Nf="32px",Df="16px",fi=4e3,Mf=356,Of=14,_f=20,jf=200;function Ve(...n){return n.filter(Boolean).join(" ")}function Ff(n){let[e,t]=n.split("-"),r=[];return e&&r.push(e),t&&r.push(t),r}var $f=n=>{var e,t,r,s,o,i,a,l,u,h,p;let{invert:g,toast:d,unstyled:y,interacting:m,setHeights:v,visibleToasts:S,heights:T,index:b,toasts:R,expanded:I,removeToast:W,defaultRichColors:U,closeButton:j,style:$,cancelButtonStyle:z,actionButtonStyle:Y,className:O="",descriptionClassName:ie="",duration:ne,position:N,gap:k,loadingIcon:D,expandByDefault:_,classNames:E,icons:C,closeButtonAriaLabel:P="Close toast",pauseWhenPageIsHidden:L}=n,[q,M]=w.useState(null),[ge,De]=w.useState(null),[A,re]=w.useState(!1),[ye,ee]=w.useState(!1),[G,X]=w.useState(!1),[Je,ot]=w.useState(!1),[Nn,Jt]=w.useState(!1),[Dn,es]=w.useState(0),[Dl,Ro]=w.useState(0),Mn=w.useRef(d.duration||ne||fi),Io=w.useRef(null),It=w.useRef(null),Ml=b===0,Ol=b+1<=S,Me=d.type,Zt=d.dismissible!==!1,_l=d.className||"",jl=d.descriptionClassName||"",ir=w.useMemo(()=>T.findIndex(V=>V.toastId===d.id)||0,[T,d.id]),Fl=w.useMemo(()=>{var V;return(V=d.closeButton)!=null?V:j},[d.closeButton,j]),Po=w.useMemo(()=>d.duration||ne||fi,[d.duration,ne]),ts=w.useRef(0),Xt=w.useRef(0),No=w.useRef(0),en=w.useRef(null),[$l,Ll]=N.split("-"),Do=w.useMemo(()=>T.reduce((V,te,le)=>le>=ir?V:V+te.height,0),[T,ir]),Mo=Tf(),Ul=d.invert||g,ns=Me==="loading";Xt.current=w.useMemo(()=>ir*k+Do,[ir,Do]),w.useEffect(()=>{Mn.current=Po},[Po]),w.useEffect(()=>{re(!0)},[]),w.useEffect(()=>{let V=It.current;if(V){let te=V.getBoundingClientRect().height;return Ro(te),v(le=>[{toastId:d.id,height:te,position:d.position},...le]),()=>v(le=>le.filter(Le=>Le.toastId!==d.id))}},[v,d.id]),w.useLayoutEffect(()=>{if(!A)return;let V=It.current,te=V.style.height;V.style.height="auto";let le=V.getBoundingClientRect().height;V.style.height=te,Ro(le),v(Le=>Le.find(Ue=>Ue.toastId===d.id)?Le.map(Ue=>Ue.toastId===d.id?{...Ue,height:le}:Ue):[{toastId:d.id,height:le,position:d.position},...Le])},[A,d.title,d.description,v,d.id]);let dt=w.useCallback(()=>{ee(!0),es(Xt.current),v(V=>V.filter(te=>te.toastId!==d.id)),setTimeout(()=>{W(d)},jf)},[d,W,v,Xt]);w.useEffect(()=>{if(d.promise&&Me==="loading"||d.duration===1/0||d.type==="loading")return;let V;return I||m||L&&Mo?(()=>{if(No.current<ts.current){let te=new Date().getTime()-ts.current;Mn.current=Mn.current-te}
4No.current=new Date().getTime()})():Mn.current!==1/0&&(ts.current=new Date().getTime(),V=setTimeout(()=>{var te;(te=d.onAutoClose)==null||te.call(d,d),dt()},Mn.current)),()=>clearTimeout(V)},[I,m,d,Me,L,Mo,dt]),w.useEffect(()=>{d.delete&&dt()},[dt,d.delete]);function ql(){var V,te,le;return C!=null&&C.loading?w.createElement("div",{className:Ve(E==null?void 0:E.loader,(V=d==null?void 0:d.classNames)==null?void 0:V.loader,"sonner-loader"),"data-visible":Me==="loading"},C.loading):D?w.createElement("div",{className:Ve(E==null?void 0:E.loader,(te=d==null?void 0:d.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":Me==="loading"},D):w.createElement(gf,{className:Ve(E==null?void 0:E.loader,(le=d==null?void 0:d.classNames)==null?void 0:le.loader),visible:Me==="loading"})}return w.createElement("li",{tabIndex:0,ref:It,className:Ve(O,_l,E==null?void 0:E.toast,(e=d==null?void 0:d.classNames)==null?void 0:e.toast,E==null?void 0:E.default,E==null?void 0:E[Me],(t=d==null?void 0:d.classNames)==null?void 0:t[Me]),"data-sonner-toast":"","data-rich-colors":(r=d.richColors)!=null?r:U,"data-styled":!(d.jsx||d.unstyled||y),"data-mounted":A,"data-promise":!!d.promise,"data-swiped":Nn,"data-removed":ye,"data-visible":Ol,"data-y-position":$l,"data-x-position":Ll,"data-index":b,"data-front":Ml,"data-swiping":G,"data-dismissible":Zt,"data-type":Me,"data-invert":Ul,"data-swipe-out":Je,"data-swipe-direction":ge,"data-expanded":!!(I||_&&A),style:{"--index":b,"--toasts-before":b,"--z-index":R.length-b,"--offset":`${ye?Dn:Xt.current}px`,"--initial-height":_?"auto":`${Dl}px`,...$,...d.style},onDragEnd:()=>{X(!1),M(null),en.current=null},onPointerDown:V=>{ns||!Zt||(Io.current=new Date,es(Xt.current),V.target.setPointerCapture(V.pointerId),V.target.tagName!=="BUTTON"&&(X(!0),en.current={x:V.clientX,y:V.clientY}))},onPointerUp:()=>{var V,te,le,Le;if(Je||!Zt)return;en.current=null;let Ue=Number(((V=It.current)==null?void 0:V.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((te=It.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Pt=new Date().getTime()-((le=Io.current)==null?void 0:le.getTime()),qe=q==="x"?Ue:ht,ft=Math.abs(qe)/Pt;if(Math.abs(qe)>=_f||ft>.11){es(Xt.current),(Le=d.onDismiss)==null||Le.call(d,d),De(q==="x"?Ue>0?"right":"left":ht>0?"down":"up"),dt(),ot(!0),Jt(!1);return}X(!1),M(null)},onPointerMove:V=>{var te,le,Le,Ue;if(!en.current||!Zt||((te=window.getSelection())==null?void 0:te.toString().length)>0)return;let ht=V.clientY-en.current.y,Pt=V.clientX-en.current.x,qe=(le=n.swipeDirections)!=null?le:Ff(N);!q&&(Math.abs(Pt)>1||Math.abs(ht)>1)&&M(Math.abs(Pt)>Math.abs(ht)?"x":"y");let ft={x:0,y:0};q==="y"?(qe.includes("top")||qe.includes("bottom"))&&(qe.includes("top")&&ht<0||qe.includes("bottom")&&ht>0)&&(ft.y=ht):q==="x"&&(qe.includes("left")||qe.includes("right"))&&(qe.includes("left")&&Pt<0||qe.includes("right")&&Pt>0)&&(ft.x=Pt),(Math.abs(ft.x)>0||Math.abs(ft.y)>0)&&Jt(!0),(Le=It.current)==null||Le.style.setProperty("--swipe-amount-x",`${ft.x}px`),(Ue=It.current)==null||Ue.style.setProperty("--swipe-amount-y",`${ft.y}px`)}},Fl&&!d.jsx?w.createElement("button",{"aria-label":P,"data-disabled":ns,"data-close-button":!0,onClick:ns||!Zt?()=>{}:()=>{var V;dt(),(V=d.onDismiss)==null||V.call(d,d)},className:Ve(E==null?void 0:E.closeButton,(s=d==null?void 0:d.classNames)==null?void 0:s.closeButton)},(o=C==null?void 0:C.close)!=null?o:wf):null,d.jsx||f.isValidElement(d.title)?d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title:w.createElement(w.Fragment,null,Me||d.icon||d.promise?w.createElement("div",{"data-icon":"",className:Ve(E==null?void 0:E.icon,(i=d==null?void 0:d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||ql():null,d.type!=="loading"?d.icon||(C==null?void 0:C[Me])||pf(Me):null):null,w.createElement("div",{"data-content":"",className:Ve(E==null?void 0:E.content,(a=d==null?void 0:d.classNames)==null?void 0:a.content)},w.createElement("div",{"data-title":"",className:Ve(E==null?void 0:E.title,(l=d==null?void 0:d.classNames)==null?void 0:l.title)},typeof d.title=="function"?d.title():d.title),d.description?w.createElement("div",{"data-description":"",className:Ve(ie,jl,E==null?void 0:E.description,(u=d==null?void 0:d.classNames)==null?void 0:u.description)},typeof d.description=="function"?d.description():d.description):null),f.isValidElement(d.cancel)?d.cancel:d.cancel&&yr(d.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||z,onClick:V=>{var te,le;yr(d.cancel)&&Zt&&((le=(te=d.cancel).onClick)==null||le.call(te,V),dt())}
4,className:Ve(E==null?void 0:E.cancelButton,(h=d==null?void 0:d.classNames)==null?void 0:h.cancelButton)},d.cancel.label):null,f.isValidElement(d.action)?d.action:d.action&&yr(d.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||Y,onClick:V=>{var te,le;yr(d.action)&&((le=(te=d.action).onClick)==null||le.call(te,V),!V.defaultPrevented&&dt())},className:Ve(E==null?void 0:E.actionButton,(p=d==null?void 0:d.classNames)==null?void 0:p.actionButton)},d.action.label):null))};function pi(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function Lf(n,e){let t={};return[n,e].forEach((r,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",a=o?Df:Nf;function l(u){["top","right","bottom","left"].forEach(h=>{t[`${i}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${i}-${u}`]=a:t[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),t}var Uf=f.forwardRef(function(n,e){let{invert:t,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:a,offset:l,mobileOffset:u,theme:h="light",richColors:p,duration:g,style:d,visibleToasts:y=Pf,toastOptions:m,dir:v=pi(),gap:S=Of,loadingIcon:T,icons:b,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:I}=n,[W,U]=w.useState([]),j=w.useMemo(()=>Array.from(new Set([r].concat(W.filter(L=>L.position).map(L=>L.position)))),[W,r]),[$,z]=w.useState([]),[Y,O]=w.useState(!1),[ie,ne]=w.useState(!1),[N,k]=w.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=w.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=w.useRef(null),C=w.useRef(!1),P=w.useCallback(L=>{U(q=>{var M;return(M=q.find(ge=>ge.id===L.id))!=null&&M.delete||Ee.dismiss(L.id),q.filter(({id:ge})=>ge!==L.id)})},[]);return w.useEffect(()=>Ee.subscribe(L=>{if(L.dismiss){U(q=>q.map(M=>M.id===L.id?{...M,delete:!0}:M));return}setTimeout(()=>{au.flushSync(()=>{U(q=>{let M=q.findIndex(ge=>ge.id===L.id);return M!==-1?[...q.slice(0,M),{...q[M],...L},...q.slice(M+1)]:[L,...q]})})})}),[]),w.useEffect(()=>{if(h!=="system"){k(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:q})=>{k(q?"dark":"light")})}catch{L.addListener(({matches:M})=>{try{k(M?"dark":"light")}catch(ge){console.error(ge)}})}},[h]),w.useEffect(()=>{W.length<=1&&O(!1)},[W]),w.useEffect(()=>{let L=q=>{var M,ge;s.every(De=>q[De]||q.code===De)&&(O(!0),(M=D.current)==null||M.focus()),q.code==="Escape"&&(document.activeElement===D.current||(ge=D.current)!=null&&ge.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[s]),w.useEffect(()=>{if(D.current)return()=>{E.current&&(E.current.focus({preventScroll:!0}),E.current=null,C.current=!1)}},[D.current]),w.createElement("section",{ref:e,"aria-label":`${R} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((L,q)=>{var M;let[ge,De]=L.split("-");return W.length?w.createElement("ol",{key:L,dir:v==="auto"?pi():v,tabIndex:-1,ref:D,className:a,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":ge,"data-lifted":Y&&W.length>1&&!o,"data-x-position":De,style:{"--front-toast-height":`${((M=$[0])==null?void 0:M.height)||0}px`,"--width":`${Mf}px`,"--gap":`${S}px`,...d,...Lf(l,u)},onBlur:A=>{C.current&&!A.currentTarget.contains(A.relatedTarget)&&(C.current=!1,E.current&&(E.current.focus({preventScroll:!0}),E.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||C.current||(C.current=!0,E.current=A.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ie||O(!1)},onDragEnd:()=>O(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||ne(!0)},onPointerUp:()=>ne(!1)},W.filter(A=>!A.position&&q===0||A.position===L).map((A,re)=>{var ye,ee;return w.createElement($f,{key:A.id,icons:b,index:re,toast:A,defaultRichColors:p,duration:(ye=m==null?void 0:m.duration)!=null?ye:g,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:t,visibleToasts:y,closeButton:(ee=m==null?void 0:m.closeButton)!=null?ee:i,interacting:ie,position:L,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:P,toasts:W.filter(G=>G.position==A.position),heights:$.filter(G=>G.position==A.position),setHeights:z,expandByDefault:o,gap:S,loadingIcon:T,expanded:Y,pauseWhenPageIsHidden:I,swipeDirections:n.swipeDirections})})):null}))});const qf=({...n})=>{const{theme:e="system"}=ff();return c.jsx(Uf,{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"}},...n})},Vf=1,Bf=1e6;let xs=0;function Qf(){return xs=(xs+1)%Number.MAX_SAFE_INTEGER,xs.toString()}const bs=new Map,mi=n=>{if(bs.has(n))return;const e=setTimeout(()=>{bs.delete(n),Wn({type:"REMOVE_TOAST",toastId:n})},Bf);bs.set(n,e)},Wf=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,Vf)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>
4t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?mi(t):n.toasts.forEach(r=>{mi(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},kr=[];let Ar={toasts:[]};function Wn(n){Ar=Wf(Ar,n),kr.forEach(e=>{e(Ar)})}function zf({...n}){const e=Qf(),t=s=>Wn({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Wn({type:"DISMISS_TOAST",toastId:e});return Wn({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:t}}function mo(){const[n,e]=f.useState(Ar);return f.useEffect(()=>(kr.push(e),()=>{const t=kr.indexOf(e);t>-1&&kr.splice(t,1)}),[n]),{...n,toast:zf,dismiss:t=>Wn({type:"DISMISS_TOAST",toastId:t})}}function Ha(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=Ha(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Ya(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=Ha(n))&&(r&&(r+=" "),r+=e);return r}const gi=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,yi=Ya,go=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return yi(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:s,defaultVariants:o}=e,i=Object.keys(s).map(u=>{const h=t==null?void 0:t[u],p=o==null?void 0:o[u];if(h===null)return null;const g=gi(h)||gi(p);return s[u][g]}),a=t&&Object.entries(t).reduce((u,h)=>{let[p,g]=h;return g===void 0||(u[p]=g),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,h)=>{let{class:p,className:g,...d}=h;return Object.entries(d).every(y=>{let[m,v]=y;return Array.isArray(v)?v.includes({...o,...a}[m]):{...o,...a}[m]===v})?[...u,p,g]:u},[]);return yi(n,i,l,t==null?void 0:t.class,t==null?void 0:t.className)};/** 5 * @license lucide-react v0.462.0 - ISC 6 * 7 * This source code is licensed under the ISC license. 8 * See the LICENSE file in the root directory of this source tree. 9 */const Hf=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ga=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();/** 10 * @license lucide-react v0.462.0 - ISC 11 * 12 * This source code is licensed under the ISC license. 13 * See the LICENSE file in the root directory of this source tree. 14 */var Yf={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"};/** 15 * @license lucide-react v0.462.0 - ISC 16 * 17 * This source code is licensed under the ISC license. 18 * See the LICENSE file in the root directory of this source tree. 19 */const Gf=f.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>f.createElement("svg",{ref:l,...Yf,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:Ga("lucide",s),...a},[...i.map(([u,h])=>f.createElement(u,h)),...Array.isArray(o)?o:[o]]));/** 20 * @license lucide-react v0.462.0 - ISC 21 * 22 * This source code is licensed under the ISC license. 23 * See the LICENSE file in the root directory of this source tree. 24 */const Z=(n,e)=>{const t=f.forwardRef(({className:r,...s},o)=>f.createElement(Gf,{ref:o,iconNode:e,className:Ga(`lucide-${Hf(n)}`,r),...s}));return t.displayName=`${n}`,t};/** 25 * @license lucide-react v0.462.0 - ISC 26 * 27 * This source code is licensed under the ISC license. 28 * See the LICENSE file in the root directory of this source tree. 29 */const Kf=Z("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/** 30 * @license lucide-react v0.462.0 - ISC 31 * 32 * This source code is licensed under the ISC license. 33 * See the LICENSE file in the root directory of this source tree. 34 */const Jf=Z("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 35 * @license lucide-react v0.462.0 - ISC 36 * 37 * This source code is licensed under the ISC license. 38 * See the LICENSE file in the root directory of this source tree. 39 */const Zf=Z("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 40 * @license lucide-react v0.462.0 - ISC 41 * 42 * This source code is licensed under the ISC license. 43 * See the LICENSE file in the root directory of this source tree. 44 */const Xf=Z("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/** 45 * @license lucide-react v0.462.0 - ISC 46 * 47 * This source code is licensed under the ISC license. 48 * See the LICENSE file in the root directory of this source tree. 49 */const nr=Z("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"}]]);/** 50 * @license lucide-react v0.462.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const ep=Z("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 55 * @license lucide-react v0.462.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */const Dr=Z("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 60 * @license lucide-react v0.462.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const yo=Z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 65 * @license lucide-react v0.462.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const tp=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 70 * @license lucide-react v0.462.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const np=Z("Chrome",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["line",{x1:"21.17",x2:"12",y1:"8",y2:"8",key:"a0cw5f"}],["line",{x1:"3.95",x2:"8.54",y1:"6.06",y2:"14",key:"1kftof"}],["line",{x1:"10.88",x2:"15.46",y1:"21.94",y2:"14",key:"1ymyh8"}]]);/** 75 * @license lucide-react v0.462.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const vi=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 80 * @license lucide-react v0.462.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const rp=Z("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"}]]);/** 85 * @license lucide-react v0.462.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const sp=Z("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"}]]);/** 90 * @license lucide-react v0.462.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const vo=Z("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 95 * @license lucide-react v0.462.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const Mr=Z("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 100 * @license lucide-react v0.462.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const Ka=Z("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"}]]);/** 105 * @license lucide-react v0.462.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Ja=Z("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 110 * @license lucide-react v0.462.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const Or=Z("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 115 * @license lucide-react v0.462.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const Un=Z("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",ke
119y:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 120 * @license lucide-react v0.462.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const op=Z("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 125 * @license lucide-react v0.462.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const ip=Z("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 130 * @license lucide-react v0.462.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const ap=Z("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** 135 * @license lucide-react v0.462.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const cp=Z("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 140 * @license lucide-react v0.462.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const lp=Z("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 145 * @license lucide-react v0.462.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const up=Z("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 150 * @license lucide-react v0.462.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree. 154 */const dp=Z("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 155 * @license lucide-react v0.462.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const hp=Z("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 160 * @license lucide-react v0.462.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const xi=Z("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** 165 * @license lucide-react v0.462.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const Za=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 5,445 bytes, lines 169-174
169],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 170 * @license lucide-react v0.462.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const xo=Z("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),bo="-",fp=n=>{const e=mp(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:i=>{const a=i.split(bo);return a[0]===""&&a.length!==1&&a.shift(),Xa(a,e)||pp(i)},getConflictingClassGroupIds:(i,a)=>{const l=t[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Xa=(n,e)=>{var i;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),s=r?Xa(n.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const o=n.join(bo);return(i=e.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},bi=/^\[(.+)\]$/,pp=n=>{if(bi.test(n)){const e=bi.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},mp=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return yp(Object.entries(n.classGroups),t).forEach(([o,i])=>{Qs(i,r,o,e)}),r},Qs=(n,e,t,r)=>{n.forEach(s=>{if(typeof s=="string"){const o=s===""?e:wi(e,s);o.classGroupId=t;return}if(typeof s=="function"){if(gp(s)){Qs(s(r),e,t,r);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([o,i])=>{Qs(i,wi(e,o),t,r)})})},wi=(n,e)=>{let t=n;return e.split(bo).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},gp=n=>n.isThemeGetter,yp=(n,e)=>e?n.map(([t,r])=>{const s=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[e+i,a])):o);return[t,s]}):n,vp=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const s=(o,i)=>{t.set(o,i),e++,e>n&&(e=0,r=t,t=new Map)};return{get(o){let i=t.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){t.has(o)?t.set(o,i):s(o,i)}}},ec="!",xp=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,s=e[0],o=e.length,i=a=>{const l=[];let u=0,h=0,p;for(let v=0;v<a.length;v++){let S=a[v];if(u===0){if(S===s&&(r||a.slice(v,v+o)===e)){l.push(a.slice(h,v)),h=v+o;continue}if(S==="/"){p=v;continue}}S==="["?u++:S==="]"&&u--}const g=l.length===0?a:a.substring(h),d=g.startsWith(ec),y=d?g.substring(1):g,m=p&&p>h?p-h:void 0;return{modifiers:l,hasImportantModifier:d,baseClassName:y,maybePostfixModifierPosition:m}};return t?a=>t({className:a,parseClassName:i}):i},bp=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},wp=n=>({cache:vp(n.cacheSize),parseClassName:xp(n),...fp(n)}),Tp=/\s+/,Sp=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s}=e,o=[],i=n.trim().split(Tp);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:d}=t(u);let y=!!d,m=r(y?g.substring(0,d):g);if(!m){if(!y){a=u+(a.length>0?" "+a:a);continue}if(m=r(g),!m){a=u+(a.length>0?" "+a:a);continue}y=!1}const v=bp(h).join(":"),S=p?v+ec:v,T=S+m;if(o.includes(T))continue;o.push(T);const b=s(m,y);for(let R=0;R<b.length;++R){const I=b[R];o.push(S+I)}a=u+(a.length>0?" "+a:a)}return a};function Cp(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=tc(e))&&(r&&(r+=" "),r+=t);return r}const tc=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=tc(n[r]))&&(t&&(t+=" "),t+=e);return t};function Ep(n,...e){let t,r,s,o=i;function i(l){const u=e.reduce((h,p)=>p(h),n());return t=wp(u),r=t.cache.get,s=t.cache.set,o=a,a(l)}function a(l){const u=r(l);if(u)return u;const h=Sp(l,t);return s(l,h),h}return function(){return o(Cp.apply(null,arguments))}}const ae=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},nc=/^\[(?:([a-z-]+):)?(.+)\]$/i,kp=/^\d+\/\d+$/,Ap=new Set(["px","full","screen"]),Rp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ip=/\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$/,Pp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Np=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,at=n=>mn(n)||Ap.has(n)||kp.test(n),pt=n=>kn(n,"length",Up),mn=n=>!!n&&!Number.isNaN(Number(n)),ws=n=>kn(n,"number",mn),Fn=n=>!!n&&Number.isInteger(Number(n)),Mp=n=>n.endsWith("%")&&mn(n.slice(0,-1)),Q=n=>nc.test(n),mt=n=>Rp.test(n),Op=new Set(["length","size","percentage"]),_p=n=>kn(n,Op,rc),jp=n=>kn(n,"position",rc),Fp=new Set(["image","url"]),$p=n=>kn(n,Fp,Vp),Lp=n=>kn(n,"",qp),$n=()=>!0,kn=(n,e,t)=>{const r=nc.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},Up=n=>Ip.test(n)&&!Pp.test(n),rc=()=>!1,qp=n=>Np.test(n),Vp=n=>Dp.test(n),Bp=()=>{const n=ae("colors"),e=ae("spacing"),t=ae("blur"),r=ae("brightness"),s=ae("borderColor"),o=ae("borderRadius"),i=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),h=ae("hueRotate"),p=ae("invert"),g=ae("gap"),d=ae("gradientColorStops"),y=ae("gradientColorStopPositions"),m=ae("inset"),v=ae("margin"),S=ae("opacity"),T=ae("padding"),b=ae("saturate"),R=ae("scale"),I=ae("sepia"),W=
vendor: 7,161 bytes, line 174
174ae("skew"),U=ae("space"),j=ae("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",Q,e],O=()=>[Q,e],ie=()=>["",at,pt],ne=()=>["auto",mn,Q],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",Q],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[mn,Q];return{cacheSize:500,separator:":",theme:{colors:[$n],spacing:[at,pt],blur:["none","",mt,Q],brightness:P(),borderColor:[n],borderRadius:["none","","full",mt,Q],borderSpacing:O(),borderWidth:ie(),contrast:P(),grayscale:E(),hueRotate:P(),invert:E(),gap:O(),gradientColorStops:[n],gradientColorStopPositions:[Mp,pt],inset:Y(),margin:Y(),opacity:P(),padding:O(),saturate:P(),scale:P(),sepia:E(),skew:P(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[mt]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...N(),Q]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Fn,Q]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Fn,Q]}],"grid-cols":[{"grid-cols":[$n]}],"col-start-end":[{col:["auto",{span:["full",Fn,Q]},Q]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[$n]}],"row-start-end":[{row:["auto",{span:[Fn,Q]},Q]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],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":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,e]}],"min-w":[{"min-w":[Q,e,"min","max","fit"]}],"max-w":[{"max-w":[Q,e,"none","full","min","max","fit","prose",{screen:[mt]},mt]}],h:[{h:[Q,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,e,"auto","min","max","fit"]}],"font-size":[{text:["base",mt,pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ws]}],"font-family":[{font:[$n]}],"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",Q]}],"line-clamp":[{"line-clamp":["none",mn,ws]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",at,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",at,pt]}],"underline-offset":[{"underline-offset":["auto",at,Q]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],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",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),jp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_p]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$p]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[y]}
174],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],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:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}
vendor: 4,459 bytes, line 174
174],"divide-style":[{divide:k()}],"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:["",...k()]}],"outline-offset":[{"outline-offset":[at,Q]}],"outline-w":[{outline:[at,pt]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[at,pt]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",mt,Lp]}],"shadow-color":[{shadow:[$n]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",mt,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[b]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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",Q]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Fn,Q]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","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",Q]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Q]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[at,pt,ws]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
174none"]}]},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"]}}},Qp=Ep(Bp);function he(...n){return Qp(Ya(n))}const Wp=Ql,sc=f.forwardRef(({className:n,...e},t)=>c.jsx(sa,{ref:t,className:he("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]",n),...e}));sc.displayName=sa.displayName;const zp=go("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"}}),oc=f.forwardRef(({className:n,variant:e,...t},r)=>c.jsx(oa,{ref:r,className:he(zp({variant:e}),n),...t}));oc.displayName=oa.displayName;const Hp=f.forwardRef(({className:n,...e},t)=>c.jsx(ia,{ref:t,className:he("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",n),...e}));Hp.displayName=ia.displayName;const ic=f.forwardRef(({className:n,...e},t)=>c.jsx(aa,{ref:t,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground
174/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",n),"toast-close":"",...e,children:c.jsx(Za,{className:"h-4 w-4"})}));ic.displayName=aa.displayName;const ac=f.forwardRef(({className:n,...e},t)=>c.jsx(ca,{ref:t,className:he("text-sm font-semibold",n),...e}));ac.displayName=ca.displayName;const cc=f.forwardRef(({className:n,...e},t)=>c.jsx(la,{ref:t,className:he("text-sm opacity-90",n),...e}));cc.displayName=la.displayName;function Yp(){const{toasts:n}=mo();return c.jsxs(Wp,{children:[n.map(function({id:e,title:t,description:r,action:s,...o}){return c.jsxs(oc,{...o,children:[c.jsxs("div",{className:"grid gap-1",children:[t&&c.jsx(ac,{children:t}),r&&c.jsx(cc,{children:r})]}),s,c.jsx(ic,{})]},e)}),c.jsx(sc,{})]})}const Gp=Wl,Kp=f.forwardRef(({className:n,sideOffset:e=4,...t},r)=>c.jsx(ua,{ref:r,sideOffset:e,className:he("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",n),...t}));Kp.displayName=ua.displayName;const{slice:Jp,forEach:Zp}=[];function Xp(n){return Zp.call(Jp.call(arguments,1),e=>{if(e)for(const t in e)n[t]===void 0&&(n[t]=e[t])}),n}
174function em(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(n))}const Ti=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,tm=function(n,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let o=`${n}=${s}`;if(r.maxAge>0){const i=r.maxAge-0;if(Number.isNaN(i))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(i)}`}if(r.domain){if(!Ti.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Ti.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Si={create(n,e,t,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+t*60*1e3)),r&&(s.domain=r),document.cookie=tm(n,e,s)},read(n){const e=`${n}=`,t=document.cookie.split(";");for(let r=0;r<t.length;r++){let s=t[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(n,e){this.create(n,"",-1,e)}};var nm={name:"cookie",lookup(n){let{lookupCookie:e}=n;if(e&&typeof document<"u")return Si.read(e)||void 0},cacheUserLanguage(n,e){let{lookupCookie:t,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;t&&typeof document<"u"&&Si.create(t,n,r,s,o)}},rm={name:"querystring",lookup(n){var r;let{lookupQuerystring:e}=n,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const i=s.substring(1).split("&");for(let a=0;a<i.length;a++){const l=i[a].indexOf("=");l>0&&i[a].substring(0,l)===e&&(t=i[a].substring(l+1))}}return t}},sm={name:"hash",lookup(n){var s;let{lookupHash:e,lookupFromHashIndex:t}=n,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const i=o.substring(1);if(e){const a=i.split("&");for(let l=0;l<a.length;l++){const u=a[l].indexOf("=");u>0&&a[l].substring(0,u)===e&&(r=a[l].substring(u+1))}}if(r)return r;if(!r&&t>-1){const a=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(s=a[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let rn=null;const Ci=()=>{if(rn!==null)return rn;try{if(rn=typeof window<"u"&&window.localStorage!==null,!rn)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{rn=!1}return rn};var om={name:"localStorage",lookup(n){let{lookupLocalStorage:e}=n;if(e&&Ci())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupLocalStorage:t}=e;t&&Ci()&&window.localStorage.setItem(t,n)}};let sn=null;const Ei=()=>{if(sn!==null)return sn;try{if(sn=typeof window<"u"&&window.sessionStorage!==null,!sn)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{sn=!1}return sn};var im={name:"sessionStorage",lookup(n){let{lookupSessionStorage:e}=n;if(e&&Ei())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(n,e){let{lookupSessionStorage:t}=e;t&&Ei()&&window.sessionStorage.setItem(t,n)}},am={name:"navigator",lookup(n){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:r,language:s}=navigator;if(t)for(let o=0;o<t.length;
174o++)e.push(t[o]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},cm={name:"htmlTag",lookup(n){let{htmlTag:e}=n,t;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(t=r.getAttribute("lang")),t}},lm={name:"path",lookup(n){var s;let{lookupFromPathIndex:e}=n;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?(s=t[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},um={name:"subdomain",lookup(n){var s,o;let{lookupFromSubdomainIndex:e}=n;const t=typeof e=="number"?e+1:1,r=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[t]}};let lc=!1;try{document.cookie,lc=!0}catch{}const uc=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];lc||uc.splice(1,1);const dm=()=>({order:uc,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class dc{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Xp(t,this.options||{},dm()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(nm),this.addDetector(rm),this.addDetector(om),this.addDetector(im),this.addDetector(am),this.addDetector(cm),this.addDetector(lm),this.addDetector(um),this.addDetector(sm)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(t=t.concat(s))}}),t=t.filter(r=>r!=null&&!em(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}dc.type="languageDetector";const hm={tools:"Tools",howItWorks:"How It Works",compare:"Compare",pricing:"Pricing",blog:"Blog",signIn:"Sign In",account:"Account",textToIcs:"Text to ICS",pdfToIcs:"PDF to ICS",csvToIcs:"CSV to ICS",imageToCalendar:"Image to Calendar",icsViewer:"ICS Viewer",emailToIcs:"Email to ICS",chromeExtension:"Chrome Extension",howToCreateIcs:"How to Create an ICS File",icsForGoogleCalendar:"ICS for Google Calendar"},fm={brand:"Convert text, PDFs, images, and spreadsheets into calendar events. Works with every calendar app.",tools:"Tools",resources:"Resources",support:"Support",feedback:"Feedback",reportBug:"Report a Bug",requestFeature:"Request a Feature",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",copyright:"© {{year}} Text2ICS. All rights reserved.",changelog:"Changelog",chromeExtensions:"Chrome Extensions"},pm={pasteText:"Paste text.",getEvents:"Get calendar events.",subtitle:"Drop in any event details â meeting notes, email invites, schedules â and download a ready-to-import .ics file.",text:"Text",pdf:"PDF",images:"Images",csv:"CSV"},mm={text:"Text",textAI:"Text AI",pdfAI:"PDF AI",imageAI:"Image AI",csvAI:"CSV AI",icsViewer:"ICS Viewer",free:"Free",charsLeft:"{{count}} chars left",textPlaceholder:`Paste your event details here... 175 176Examples: 177⢠Team standup every Monday at 9am in Room 202 178⢠Dentist appointment March 15 at 2:30pm 179⢠Conference: April 10-12, 2026`,textAIPlaceholder:`Paste your event details here... 180 181AI-powered extraction handles complex formats: 182⢠Long email threads with multiple events 183⢠Unstructured meeting notes 184⢠Birthday lists, exam schedules`,extractFree:"Extract Events â Free",extractAI:"Extract with AI",extractingAI:"Extracting with AI...",extractingEventsCount:"Extracting... {{count}} events found so far",quotaExceeded:"Delivered {{delivered}} of {{total}} events â event limit reached",upgradeForMore:"Upgrade your plan to extract more events.",getMoreEvents:"Get More Events",signInAI:"Sign in to use AI extraction",signInRequired:"Sign in required",signInDescription:"Sign in to use PDF, image, and CSV conversion.",signInPdf:"Sign in to convert PDFs",signInImage:"Sign in to convert images",signInCsv:"Sign in to convert CSVs",signInFeature:"Sign in to use this feature",processingAI:"Processing with AI...",pasteText:"Please paste some event text",noEvents:"No events found",noEventsDesc:"Try including dates or times.",foundEvents:"Found {{count}} event!",foundEvents_plural:"Found {{count}}
184 events!",foundEventsFrom:"Found {{count}} event from {{type}}!",foundEventsFrom_plural:"Found {{count}} events from {{type}}!",notEnoughCredits:"Not enough events",failedParse:"Failed to parse",failedProcess:"Failed to process {{type}}",fileTooLarge:"File too large",fileTooLargeDesc:"Maximum file size is 1MB.",maxSize:"Max 1MB",creditPerUse:"{{count}} event per use",creditPerUse_plural:"{{count}} events per use",eventsFound:"{{count}} event found",eventsFound_plural:"{{count}} events found",downloadIcs:"Download .ics",downloaded:"Calendar file downloaded!",dropPdf:"Drop your PDF here or click to browse",pdfDesc:"Schedules, itineraries, event lists",dropImage:"Drop your image here or click to browse",imageDesc:"Screenshots, photos of schedules, flyers",dropCsv:"Drop your CSV here or click to browse",csvDesc:"Spreadsheets exported as CSV",dropIcs:"Drop your .ics file here or click to browse",icsDesc:"View events from any .ics calendar file · Free, no cost",loadedEvents:"Loaded {{count}} event from ICS!",loadedEvents_plural:"Loaded {{count}} events from ICS!",noEventsIcs:"No events found in ICS file",failedIcs:"Failed to read ICS file"},gm={title:"Everything you need to",titleHighlight:"save time",subtitle:"Stop manually creating calendar events. Drop in your content and let us handle the rest.",textPdfs:"Text & PDFs",textPdfsDesc:"Paste meeting notes, email threads, or upload PDFs â we extract every event automatically.",imagesScreenshots:"Images & Screenshots",imagesScreenshotsDesc:"Snap a photo of a flyer or poster and convert it into calendar entries instantly.",csvSpreadsheets:"CSV & Spreadsheets",csvSpreadsheetsDesc:"Import bulk schedules from CSV files and export clean .ics files for your whole team.",instantConversion:"Instant Conversion",instantConversionDesc:"Events are extracted in seconds, not minutes. Paste in, download out.",worksEverywhere:"Works Everywhere",worksEverywhereDesc:"Compatible with Google Calendar, Apple Calendar, Outlook, and any app that supports .ics.",privateSecure:"Private & Secure",privateSecureDesc:"Your data is processed and never stored. We don't keep copies of your events."},ym={title:"Simple, transparent pricing",subtitle:"Pay for what you use. No subscriptions required.",mostPopular:"Most Popular",free:"Free",freePrice:"$0",freePeriod:"forever",freeDesc:"Perfect for trying it out",freeCredits:"3 events",freeFeature1:"AI-powered event extraction",freeFeature2:"Standard .ics download",freeFeature3:"Edit events before export",freeCta:"Get Started",starter:"Starter",starterPrice:"$5",starterPeriod:"one-time",starterDesc:"For occasional use",starterCredits:"100 events",starterFeature1:"Text, CSV, PDF & Image support",starterFeature2:"Real-time event extraction",starterFeature3:"Batch event extraction",starterFeature4:"Edit events before export",starterCta:"Buy 100 Events",pro:"Pro",proPrice:"$10",proPeriod:"one-time",proDesc:"Best value for teams",proCredits:"250 events",proFeature1:"Everything in Starter",proFeature2:"Bulk .ics downloads",proFeature3:"Priority processing",proFeature4:"Priority support",proCta:"Buy 250 Events",paymentError:"Payment error",noCheckoutUrl:"No checkout URL returned.",checkoutFailed:"Failed to create checkout session."},vm={title:"Ready to stop typing events manually?",subtitle:"Join thousands who save hours every week by converting text into calendar events instantly.",button:"Try It Free",note:"No sign-up required · 3 free events to start"},xm={allDay:"All day",title:"Title",start:"Start",end:"End",location:"Location",optional:"Optional",recurrence:"Recurrence",noRepeat:"No repeat",daily:"Daily",weekly:"Weekly",weekdays:"Weekdays",every2Weeks:"Every 2 weeks",monthly:"Monthly",yearly:"Yearly",save:"Save",cancel:"Cancel"},bm={pageTitle:"Feedback",pageSubtitle:"Found a bug? Have a feature idea? We'd love to hear from you.",type:"Type",feedbackLabel:"Feedback",bugLabel:"Bug Report",featureLabel:"Feature Request",message:"Message",bugPlaceholder:"Describe the bug: what happened, what you expected, steps to reproduce...",featurePlaceholder:"Describe the feature you would like to see...",feedbackPlaceholder:"Tell us what you think...",email:"Email",emailOptional:"(optional â if you want a reply)",emailPlaceholder:"[email protected]",send:"Send Feedback",sending:"Sending...",enterMessage:"Please enter a message",thanks:"Thank y
184ou!",thanksDesc:"Your feedback has been received. We appreciate you taking the time.",sendAnother:"Send another",thanksFeedback:"Thanks for your feedback!",failedSend:"Failed to send",failedSendDesc:"Please try again later."},wm={title:"Dashboard",seoDesc:"Manage your calendar conversions and events.",newConversion:"New Conversion",signOut:"Sign Out",creditsRemaining:"Events Remaining",eventsRemaining:"Events Remaining",eventsGenerated:"Events Generated",allTime:"All time",conversions:"Conversions",filesGenerated:"Files generated",buyMore:"Buy More",getCredits:"Get Events",generationHistory:"Generation History",event:"event",events:"events",noGenerations:"No generations yet",firstConversion:"Create your first conversion"},Tm={seoTitle:"Sign In â Text2ICS",seoDesc:"Sign in to your Text2ICS account.",createAccount:"Create account",welcomeBack:"Welcome back",signUpDesc:"Sign up to get started",signInDesc:"Sign in to manage your events and history",continueGoogle:"Continue with Google",or:"or",email:"Email address",password:"Password",signUpError:"Could not create account. Try a different email.",signInError:"Invalid email or password.",noAccount:"Don't have an account?",signUp:"Sign up",hasAccount:"Already have an account?",signIn:"Sign in",agreeTo:"By signing in, you agree to our",terms:"Terms of Service",and:"and",privacy:"Privacy Policy"},Sm={title:"404",subtitle:"Oops! Page not found",home:"Return to Home"},Cm={title:"Changelog",subtitle:"What's new in Text2ICS. Latest features and improvements."},Em={title:"Blog",subtitle:"Guides, tutorials, and tips for calendar management and .ics files.",readMore:"Read more",backToBlog:"Back to Blog"},km={seoTitle:"How Text2ICS Works â 4 Steps to Calendar Events",seoDesc:"Learn how to paste text, extract events, review, and download .ics files in seconds. No sign-up required.",title:"How Text2ICS Works",subtitle:"Four simple steps to turn any text into calendar events you can import anywhere. No sign-up needed.",step1Title:"Paste your text",step1Desc:"Copy any event information â meeting invites, email threads, class schedules, conference agendas, or even a screenshot description â and paste it into the text box.",step1Detail1:"Supports plain text, meeting notes, email forwards",step1Detail2:"Works with any language or date format",step1Detail3:"No formatting required â just paste raw text",step2Title:"We extract the events",step2Desc:"Text2ICS intelligently parses your text to identify event titles, dates, times, locations, and descriptions. Multiple events in one paste? No problem.",step2Detail1:"Detects multiple events from a single block of text",step2Detail2:'Recognises relative dates ("next Tuesday") and ranges',step2Detail3:"Extracts locations, descriptions, and attendees",step3Title:"Review & edit",step3Desc:"Preview every extracted event before downloading. Remove events you don't need, or verify that dates and times are correct.",step3Detail1:"Visual event cards with all details at a glance",step3Detail2:"Remove individual events with one click",step3Detail3:"Verify times, dates, and locations",step4Title:"Download your .ics file",step4Desc:'Click "Download .ics" and import the file into Google Calendar, Apple Calendar, Outlook, or any calendar app that supports the iCalendar standard.',step4Detail1:"Universal .ics format â works everywhere",step4Detail2:"Single file contains all your events",step4Detail3:"Double-click to auto-import on most systems",formatsTitle:"Supported Input Formats",formatsSubtitle:"Text2ICS handles all common date and time formats.",isoLabel:"ISO dates",isoExample:"2026-04-01T14:00:00",writtenLabel:"Written dates",writtenExample:"April 1, 2026 at 2:00 PM",shortLabel:"Short dates",shortExample:"01/04/2026 14:00",relativeLabel:"Relative dates",relativeExample:"Next Tuesday at 3pm",rangeLabel:"Date ranges",rangeExample:"March 28â30, 2026",allDayLabel:"All-day events",allDayExample:"Conference Day â June 15",useCasesTitle:"Use Cases for Every Scenario",useCasesSubtitle:"Whether you're a student, professional, or event organiser â Text2ICS saves you time.",useCase1Title:"Conference Schedules",useCase1Desc:"Paste an entire conference agenda and get every talk, workshop, and break as separate calendar events.",useCase2Title:"University Timetables",useCase2Desc:"Convert your semester schedule into calendar events. Paste the raw timetable text and you're set for the term.",useCase3Title:"Meeting Email Chains",useCase3Desc:"Forward a meeting invite or email thread into Text2ICS and extract the when, where, and what instantly.",useCase4Title:"Event Flyers & Posters",useCase4Desc:"Type out or OCR the details from a poster or flyer and convert them into a calendar event you won't forget.",useCase5Title:"Travel Itineraries",useCase5Desc:"Paste flight confirmations, hotel bookings, or tour schedules and get every leg of your trip on your calendar.",useCase6Title:"Sports Fixtures",useCase6Desc:"Drop in a league fixture list and get every game date, time, and venue as individual calendar entries.",faqTitle:"Frequently Asked Questions"},Am={seoTitle:"Text2ICS vs Alternatives â Calendar Event Conversion Compared",seoDesc:"Compare Text2ICS with manual event creation, Google Calendar, Apple Calendar, and Outlook. See why Text2ICS is faster for converting text to calendar events.",title:"Text2ICS vs. The Alternatives",subtitle:"See how Text2ICS compares to manually creating events, Google Calendar, Outlook, and other methods.",feature:"Feature",manualEntry:"Manual Entry",googleCal:"Google Cal",outlook:"Outlook",pasteTextEvents:"Paste plain text â events",multipleEvents:"Multiple events at once",downloadIcs:"Download .ics file",noAccount:"No account required",worksAnyCalendar:"Works with any calendar app",pdfImageSupport:"PDF / image support",bulkImport:"Bulk schedule import",freeTier:"Free tier available",timeFor10:"Time to add 10 events",yes:"â",no:"â",partial:"Partial",comingSoon:"Coming soon",about30s:"~30 seconds",about10m:"~10 minutes",about8m:"~8 minutes",detailedTitle:"Detailed Comparisons",detailedSubtitle:"An honest look at how Text2ICS stacks up against each alternative.",vs:"Text2ICS vs.",pros:"Pros",cons:"Cons",whyWins:"Why Text2ICS wins:",timeSaved:"Time Saved",timeSubtitle:"Adding 10 events to your calendar"},Rm={whyUse:"Why use this tool?",faq:"Frequently Asked Questions",otherTools:"Other Conversion Tools"},Im={seoTitle:"Text to ICS Converter â Convert Text to Calendar Events",seoDesc:"Paste any text â meeting notes, email threads, schedules â and instantly convert it to a downloadable .ics calendar file. Works with Google Calendar, Apple Calendar, and Outlook.",h1:"Convert Text to ICS Calendar Events",subtitle:"Paste meeting notes, email threads, or any schedule text and get a ready-to-import .ics file in seconds. No formatting required.",feature1:"Paste raw text â no special formatting needed",feature2:"Handles multiple events from a single block of text",feature3:'Recognises written dates like "next Tuesday at 3pm"',feature4:"Supports ISO, relative, and natural language dates",feature5:"Extracts titles, times, locations, and descriptions",feature6:"Downloads a universal .ics file compatible with all calendar apps"},Pm={seoTitle:"PDF to ICS Converter â Extract Calendar Events from PDFs",seoDesc:"Upload a PDF schedule, itinerary, or event list and automatically extract calendar events into a downloadable .ics file. Works with Google Calendar, Apple Calendar, and Outlook.",h1:"Convert PDF Schedules to Calendar Events",subtitle:"Upload any PDF containing event details â
184conference agendas, flight itineraries, class timetables â and get a calendar-ready .ics file.",feature1:"Upload any PDF up to 1MB with event information",feature2:"AI-powered text extraction from PDF documents",feature3:"Handles multi-page schedules and agendas",feature4:"Extracts dates, times, locations, and descriptions",feature5:"Perfect for conference programs and academic timetables",feature6:"Downloads a universal .ics file for any calendar app"},Nm={seoTitle:"CSV to ICS Converter â Convert Spreadsheets to Calendar Events",seoDesc:"Upload a CSV file with event data and convert it into a downloadable .ics calendar file. Bulk import schedules from Excel, Google Sheets, or any spreadsheet.",h1:"Convert CSV Files to ICS Calendar Events",subtitle:"Upload a CSV exported from Excel, Google Sheets, or any spreadsheet tool and get all your events as a single .ics file.",feature1:"Import events from any CSV or spreadsheet export",feature2:"Bulk convert dozens or hundreds of events at once",feature3:"AI-powered column detection â no strict format required",feature4:"Works with exports from Excel, Google Sheets, Numbers",feature5:"Handles dates, times, locations, and descriptions",feature6:"Perfect for team schedules, shift rosters, and event lists"},Dm={seoTitle:"Image to Calendar Converter â Extract Events from Photos & Screenshots",seoDesc:"Upload a photo, screenshot, or image of a schedule and automatically extract calendar events into a downloadable .ics file. Works with Google Calendar, Apple Calendar, and Outlook.",h1:"Convert Images & Screenshots to Calendar Events",subtitle:"Upload a photo of a schedule, flyer, whiteboard, or screenshot and let AI extract the events into a calendar-ready .ics file.",feature1:"Upload photos, screenshots, or any image format",feature2:"AI vision extracts events from handwritten or printed schedules",feature3:"Works with event flyers, posters, and whiteboard photos",feature4:"Handles screenshots of schedules from apps and websites",feature5:"Extracts dates, times, titles, locations, and descriptions",feature6:"Downloads a universal .ics file for any calendar app"},Mm={seoTitle:"Free ICS File Viewer â View & Edit Calendar Events Online",seoDesc:"Upload any .ics calendar file to view, preview, and edit events online. Free tool â no sign-up required. Re-download as a new .ics file.",h1:"Free ICS File Viewer â View Calendar Events Online",subtitle:"Upload any .ics file to preview events, check dates and times, and re-download. Completely free â no cost or sign-up needed.",feature1:"View all events inside any .ics calendar file",feature2:"Completely free â no cost or account required",feature3:"Preview event titles, dates, times, and locations",feature4:"Remove unwanted events before re-downloading",feature5:"Re-export as a clean .ics file",feature6:"Works with files from Google Calendar, Outlook, Apple Calendar, and more"},Om={seoTitle:"Text2ICS â Convert Text to Calendar Events (.ics)",seoDesc:"Instantly convert text, PDFs, images, and CSVs into downloadable .ics calendar files. Works with Google Calendar, Apple Calendar, and Outlook."},_m={seoTitle:"Privacy Policy â Text2ICS",seoDesc:"How Text2ICS handles your data. We process text locally in your browser and don't store your content.",title:"Privacy Policy",lastUpdated:"Last updated: March 28, 2026",whatWeCollect:"What we collect",collectNoAccount:"When you use Text2ICS without an account, we collect nothing. Your text is parsed locally in your browser and never leaves your device.",collectWithAccount:"When you create an account, we store:",collectEmail:"Your email address (for authentication)",collectName:"Your name (if provided via Google sign-in)",collectCredits:"Event balance and usage count",collectHistory:"Generation history (input text truncated to 5,000 characters, extracted event titles and dates)",howWeProcess:"How we process your data",processFreeTab:"Free Text tab: All parsing happens in your browser using a local parser. No data is sent to any server.",processAITabs:"Text AI, PDF AI, Image AI, CSV AI tabs: Your content is sent to OpenAI's API for event extraction. OpenAI processes the data according to their API data usage policy â API inputs are not used to train their models.",processIcsViewer:"ICS Viewer: Files are parsed entirely in your browser. Nothing is uploaded.",apiPolicy:"API data usage policy",cookies:"Cookies and tracking",cookiesDesc:"We use essential cookies for authentication only. We do not use analytics trackers, advertising cookies, or third-party tracking scripts.",thirdParty:"Third-party services",thirdPartyConvex:"Convex â backend database and authentication",thirdPartyOpenAI:"OpenAI â AI-powered event extraction (only for paid features)",thirdPartyStripe:"Stripe â payment processing (we never see your card details)",thirdPartyGoogle:"Google OAuth â optional sign-in method",dataRetention:"Data retention",dataRetentionDesc:"Your generation history is stored as long as your account exists. You can request deleti
184on of your account and all associated data by contacting us via the feedback form.",yourRights:"Your rights",yourRightsDesc:"You have the right to:",rightAccess:"Access the data we hold about you",rightCorrect:"Request correction of inaccurate data",rightDelete:"Request deletion of your data",rightExport:"Export your data",rightContact:"To exercise any of these rights, contact us via the feedback form.",changes:"Changes to this policy",changesDesc:"We may update this policy from time to time. Changes will be posted on this page with an updated date."},jm={seoTitle:"Email to ICS Converter â Convert Emails to Calendar Events",seoDesc:"Paste any email â meeting invites, confirmations, scheduling threads â and convert it to a downloadable .ics calendar file. Works with Gmail, Outlook, and Apple Mail.",h1:"Convert Emails to Calendar Events",subtitle:"Paste a forwarded email, meeting invite, or scheduling thread and get a ready-to-import .ics file. AI extracts dates, times, and locations automatically.",feature1:"Paste email text from Gmail, Outlook, or any email client",feature2:"Handles forwarded emails, replies, and full threads",feature3:"AI extracts meeting times, locations, and event titles",feature4:"Works with confirmation emails, booking receipts, and invites",feature5:"Extracts multiple events from a single email thread",feature6:"Downloads a universal .ics file for any calendar app"},Fm={seoTitle:"Birthday List to Calendar â Add Birthdays to Your Calendar",seoDesc:"Convert a list of birthdays into calendar events. Paste names and dates, download an .ics file, and import into Google Calendar, Apple Calendar, or Outlook.",h1:"Convert a Birthday List to Calendar Events",subtitle:"Paste a list of names and birthdays in any format. Text2ICS creates a calendar event for each one â download and import into your calendar app.",feature1:"Paste birthdays in any format â names and dates, lists, or tables",feature2:"AI detects names, dates, and creates individual events",feature3:"Handles all date formats: March 15, 03/15, 15-Mar, and more",feature4:"Import into Google Calendar, Apple Calendar, or Outlook",feature5:"Set yearly recurrence in your calendar after import",feature6:"Bulk convert dozens of birthdays at once"},$m={seoTitle:"Meeting Notes to Calendar â Turn Notes into Events",seoDesc:"Paste meeting notes with dates and action items and convert them into calendar events. Download an .ics file for Google Calendar, Apple Calendar, or Outlook.",h1:"Turn Meeting Notes into Calendar Events",subtitle:"Paste your meeting notes â follow-ups, deadlines, action items â and Text2ICS extracts every event with dates and times into a downloadable .ics file.",feature1:"Paste raw meeting notes â no formatting required",feature2:"AI detects follow-ups, deadlines, and scheduled events",feature3:"Extracts multiple events from a single set of notes",feature4:"Works with notes from Notion, Google Docs, Apple Notes, or any app",feature5:'Handles action items like "submit by Friday" or "demo on March 15"',feature6:"Downloads a universal .ics file for any calendar app"},Lm={seoTitle:"How to Import ICS Files into Google Calendar â Step-by-Step Guide",seoDesc:"Learn how to create and import .ics calendar files into Google Calendar. Step-by-step instructions with troubleshooting tips.",h1:"How to Import ICS Files into Google Calendar",subtitle:"A step-by-step guide to creating .ics files with Text2ICS and importing them into Google Calendar."},Um={seoTitle:"How to Create an ICS File â Complete Guide to Calendar Files",seoDesc:"Learn what .ics files are, how the iCalendar format works, and how to create .ics files â manually or using Text2ICS. Includes format examples and compatibility guide.",h1:"How to Create an ICS Calendar File",subtitle:"Everything you need to know about .ics files â what they are, how the format works, and the fastest way to create them."},qm={seoTitle:"ICS File Not Importing? Fix Common Calendar Import Issues",seoDesc:"Troubleshoot .ics file import problems for Google Calendar, Apple Calendar, and Outlook. Common errors, fixes, and a step-by-step checklist.",h1:"ICS File Not Importing? Here's How to Fix It",subt
184itle:"Common .ics import issues and solutions for Google Calendar, Apple Calendar, and Outlook â plus a troubleshooting checklist."},Vm={seoTitle:"Text2ICS Chrome Extension â Select Text, Create Calendar Events",seoDesc:"Install the Text2ICS Chrome extension to select any text on a webpage and convert it to calendar events. Download .ics files instantly from any website.",h1:"Text to Calendar â Right from Your Browser",subtitle:"Select any text on a webpage â meeting details, event listings, schedules â and convert it to a downloadable .ics calendar file with one click."},Bm={nav:hm,footer:fm,hero:pm,converter:mm,features:gm,pricing:ym,cta:vm,eventCard:xm,feedback:bm,dashboard:wm,login:Tm,notFound:Sm,changelog:Cm,blog:Em,howItWorks:km,compare:Am,converterLanding:Rm,textToIcs:Im,pdfToIcs:Pm,csvToIcs:Nm,imageToCalendar:Dm,icsViewerPage:Mm,index:Om,privacy:_m,emailToIcs:jm,birthdayListToCalendar:Fm,meetingNotesToCalendar:$m,icsForGoogleCalendar:Lm,howToCreateIcsFile:Um,icsFileNotImporting:qm,chromeExtension:Vm},An=["en","pt-BR","pt","es","fr","de","it","nl","pl"],Qm={en:"English","pt-BR":"Português (BR)",pt:"Português",es:"Español",fr:"Français",de:"Deutsch",it:"Italiano",nl:"Nederlands",pl:"Polski"},Wm={"pt-BR":()=>J(()=>import("./translation-DzRHh-kO.js"),[]),pt:()=>J(()=>import("./translation-lAX4o7HR.js"),[]),es:()=>J(()=>import("./translation-Bg1-20Kr.js"),[]),fr:()=>J(()=>import("./translation-DVg3ZoGN.js"),[]),de:()=>J(()=>import("./translation-CmRpvriD.js"),[]),it:()=>J(()=>import("./translation-DVITxwPu.js"),[]),nl:()=>J(()=>import("./translation-CIxHnfpS.js"),[]),pl:()=>J(()=>import("./translation-DDLx1kd_.js"),[])};Ps.use(dc).use(du).init({resources:{en:{translation:Bm}},fallbackLng:"en",supportedLngs:An,interpolation:{escapeValue:!1},detection:{order:["path"],lookupFromPathIndex:0}});async function zm(n){if(n==="en"||Ps.hasResourceBundle(n,"translation"))return;const e=Wm[n];if(!e)return;const t=await e();Ps.addResourceBundle(n,"translation",t.default)}const Hm=go("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"}}),xe=f.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...s},o)=>{const i=r?zl:"button";return c.jsx(i,{className:he(Hm({variant:e,size:t,className:n})),ref:o,...s})});xe.displayName="Button";function hc(n,e){const t={get(r,s){if(typeof s=="string"){const o=[...e,s];return hc(n,o)}else if(s===Ca){if(e.length<1){const o=[n,...e].join(".");throw new Error(`API path is expected to be of the form \`${n}.childComponent.functionName\`. Found: \`${o}\``)}return"_reference/childComponent/"+e.join("/")}else return}};return new Proxy({},t)}const Ym=()=>hc("components",[]),jt=Vu;Ym();function wo(){const{locale:n}=pa();return n&&An.includes(n)?n:"en"}function Br(){const n=wo();return e=>`/${n}${e}`}function Gm(){const n=tr(),e=$r(),{i18n:t}=Ke();return r=>{const s=n.pathname.split("/");s.length>=2&&An.includes(s[1])?s[1]=r:s.splice(1,0,r),t.changeLanguage(r),e(s.join("/")||`/${r}`,{replace:!0})}}const ki={en:"ð¬ð§","pt-BR":"ð§ð·",pt:"ðµð¹",es:"ðªð¸",fr:"ð«ð·",de:"ð©ðª",it:"ð®ð¹",nl:"ð³ð±",pl:"ðµð±"};function Km(){const n=wo(),e=Gm(),[t,r]=f.useState(!1);return c.jsxs("div",{className:"relative",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[c.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(Ka,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"hidden sm:inline",children:ki[n]})]}),t&&c.jsx("div",{className:"absolute right-0 top-full mt-0 w-44 rounded-xl border border-border bg-background shadow-lg py-1 z-50",children:An.map(s=>c.jsxs("button",{onClick:()=>{e(s),r(!1)},className:`w-full text-left px-3 py-1.5 text-sm transition-colors flex items-center gap-2 ${s===n?"text-primary font-medium bg-primary/5":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[c.jsx("span",{children:ki[s]}),c.jsx("span",{children:Qm[s]})]},s))})]})}function Jm(){var p;const{t:n}=Ke(),e=Br(),t=tr(),r=$r(),{isAuthenticated:s}=uo(),o=Os(jt.users.getMe),[i,a]=f.useState(!1),l=[{name:n("nav.textToIcs"),path:e("/text-to-ics")},{name:n("nav.pdfToIcs"),path:e("/pdf-to-ics")},{name:n("nav.csvToIcs"),path:e("/csv-to-ics")},{name:n("nav.imageToCalendar"),path:e("/image-to-calendar")},{name:n("nav.icsViewer"),path:e("/ics-viewer")}],u=t.pathname.match(/^\/[a-z]{2}(-[A-Z]{2})?\/?$/),h=g=>{var d;u?(d=document.getElementById(g))==null||d.scrollIntoView({behavior:"smooth"}):(r(e("/")),setTimeout(()=>{var y;return(y=document.getElementById(g))==null?void 0:y.scrollIntoView({behavior:"smooth"})},100))};return c.jsx("nav",{className:"sticky top-0 z-50 border-b border-border bg-background/80 backdrop-blur-md",children:c.jsxs("div",{className:"container mx-auto px-4 h-14 flex items-center justify-between",children:[c.jsxs(Re,{to:e("/"),className:"flex items-center gap-2",children:[c.jsx(nr,{className:"h-5 w-5 text-primary"}),c.jsx("span",{className:"font-heading text-lg text-foreground",children:"Text2ICS"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{className:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[c.jsxs(xe,{variant:"ghost",className:"text-sm text-muted-foreground font-body gap-1",children:[n("nav.tools")," ",c.jsx(yo,{className:"h-3 w-3"})]}),i&&c.jsx("div",{className:"absolute top-full left-0 mt-0 w-48 rounded-xl border border-border bg-background shadow-lg py-1 z-50",children:l.map(g=>c.jsx(Re,{to:g.path,className:"block px-4 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>a(!1),children:g.name},g.path))})]}),c.jsx(Re,{to:e("/how-it-works"),children:c.jsx(xe,{variant:"ghost",className:"text-sm text-muted-foreground font-body",children:n("nav.howItWorks")})}),c.jsx(Re,{to:e("/compare"),children:c.jsx(xe,{variant:"ghost",className:"text-sm text-muted-foreground font-body hidden sm:inline-flex",children:n("nav.compare")})}),c.jsx(xe,{variant:"ghost",className:"text-sm text-muted-foreground font-body hidden sm:inline-flex",onClick:()=>h("pricing"),children:n("nav.pricing")}),c.jsx(Re,{to:e("/blog"),children:c.jsx(xe,{variant:"ghost",className:"text-sm text-muted-foreground font-body hidden sm:inline-flex",children:n("nav.blog")})}),c.jsx(Km,{}
184),s?c.jsx(Re,{to:e("/dashboard"),children:c.jsxs(xe,{variant:"ghost",className:"ml-1 gap-2 text-sm font-body text-foreground hover:bg-muted",children:[c.jsx("div",{className:"h-6 w-6 rounded-full bg-muted border border-border flex items-center justify-center",children:c.jsx("span",{className:"text-xs font-medium text-foreground",children:((o==null?void 0:o.name)??(o==null?void 0:o.email)??"?")[0].toUpperCase()})}),c.jsx("span",{className:"hidden sm:inline",children:((p=o==null?void 0:o.name)==null?void 0:p.split(" ")[0])??n("nav.account")})]})}):c.jsx(Re,{to:e("/login"),children:c.jsx(xe,{className:"ml-2 rounded-xl bg-primary text-primary-foreground font-body text-sm h-9 hover:opacity-90",children:n("nav.signIn")})})]})]})})}function Zm(){const{t:n}=Ke(),e=[{icon:Mr,label:n("hero.text")},{icon:Mr,label:n("hero.pdf")},{icon:Ja,label:n("hero.images")},{icon:vo,label:n("hero.csv")}];return c.jsxs("div",{className:"text-center",children:[c.jsxs(Ce.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.6},className:"flex items-center justify-center gap-2 mb-4",children:[c.jsx(nr,{className:"h-8 w-8 text-primary"}),c.jsx("span",{className:"font-heading text-2xl text-foreground",children:"Text2ICS"})]}),c.jsxs("h1",{className:"font-heading text-4xl md:text-5xl lg:text-6xl text-foreground leading-tight",children:[n("hero.pasteText")," ",c.jsx("span",{className:"text-primary",children:n("hero.getEvents")})]}),c.jsx(Ce.p,{initial:{opacity:0}
184,animate:{opacity:1},transition:{delay:.3},className:"mt-4 text-lg text-muted-foreground max-w-xl mx-auto",children:n("hero.subtitle")}),c.jsx(Ce.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},className:"mt-6 flex items-center justify-center gap-3 flex-wrap",children:e.map(({icon:t,label:r})=>c.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm text-muted-foreground",children:[c.jsx(t,{className:"h-3.5 w-3.5"}),r]},r))})]})}var Xm=f.createContext(void 0);function To(n){const e=f.useContext(Xm);return n||e||"ltr"}var Ts="rovingFocusGroup.onEntryFocus",eg={bubbles:!1,cancelable:!0},rr="RovingFocusGroup",[Ws,fc,tg]=da(rr),[ng,pc]=no(rr,[tg]),[rg,sg]=ng(rr),mc=f.forwardRef((n,e)=>c.jsx(Ws.Provider,{scope:n.__scopeRovingFocusGroup,children:c.jsx(Ws.Slot,{scope:n.__scopeRovingFocusGroup,children:c.jsx(og,{...n,ref:e})})}));mc.displayName=rr;var og=f.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...p}=n,g=f.useRef(null),d=Ge(e,g),y=To(o),[m,v]=Ir({prop:i,defaultProp:a??null,onChange:l,caller:rr}),[S,T]=f.useState(!1),b=ha(u),R=fc(t),I=f.useRef(!1),[W,U]=f.useState(0);return f.useEffect(()=>{const j=g.current;if(j)return j.addEventListener(Ts,b),()=>j.removeEventListener(Ts,b)},[b]),c.jsx(rg,{scope:t,orientation:r,dir:y,loop:s,currentTabStopId:m,onItemFocus:f.useCallback(j=>v(j),[v]),onItemShiftTab:f.useCallback(()=>T(!0),[]),onFocusableItemAdd:f.useCallback(()=>U(j=>j+1),[]),onFocusableItemRemove:f.useCallback(()=>U(j=>j-1),[]),children:c.jsx(me.div,{tabIndex:S||W===0?-1:0,"data-orientation":r,...p,ref:d,style:{outline:"none",...n.style},onMouseDown:oe(n.onMouseDown,()=>{I.current=!0}),onFocus:oe(n.onFocus,j=>{const $=!I.current;if(j.target===j.currentTarget&&$&&!S){const z=new CustomEvent(Ts,eg);if(j.currentTarget.dispatchEvent(z),!z.defaultPrevented){const Y=R().filter(k=>k.focusable),O=Y.find(k=>k.active),ie=Y.find(k=>k.id===m),N=[O,ie,...Y].filter(Boolean).map(k=>k.ref.current);vc(N,h)}}I.current=!1}),onBlur:oe(n.onBlur,()=>T(!1))})})}),gc="RovingFocusGroupItem",yc=f.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...a}=n,l=er(),u=o||l,h=sg(gc,t),p=h.currentTabStopId===u,g=fc(t),{onFocusableItemAdd:d,onFocusableItemRemove:y,currentTabStopId:m}=h;return f.useEffect(()=>{if(r)return d(),()=>y()},[r,d,y]),c.jsx(Ws.ItemSlot,{scope:t,id:u,focusable:r,active:s,children:c.jsx(me.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...a,ref:e,onMouseDown:oe(n.onMouseDown,v=>{r?h.onItemFocus(u):v.preventDefault()}),onFocus:oe(n.onFocus,()=>h.onItemFocus(u)),onKeyDown:oe(n.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){h.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const S=cg(v,h.orientation,h.dir);if(S!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=g().filter(R=>R.focusable).map(R=>R.ref.current);if(S==="last")b.reverse();else if(S==="prev"||S==="next"){S==="prev"&&b.reverse();const R=b.indexOf(v.currentTarget);b=h.loop?lg(b,R+1):b.slice(R+1)}setTimeout(()=>vc(b))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:m!=null}):i})})});yc.displayName=gc;var ig={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ag(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function cg(n,e,t){const r=ag(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ig[r]}function vc(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function lg(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var ug=mc,dg=yc,Qr="Tabs",[hg,Zx]=no(Qr,[pc]),xc=pc(),[fg,So]=hg(Qr),bc=f.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:l="automatic",...u}=n,h=To(a),[p,g]=Ir({prop:r,onChange:s,defaultProp:o??"",caller:Qr});return c.jsx(fg,{scope:t,baseId:er(),value:p,onValueChange:g,orientation:i,dir:h,activationMode:l,children:c.jsx(me.div,{dir:h,"data-orientation":i,...u,ref:e})})});bc.displayName=Qr;var wc="TabsList",Tc=f.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...s}=n,o=So(wc,t),i=xc(t);return c.jsx(ug,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(me.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:e})})});Tc.displayName=wc;var Sc="TabsTrigger",Cc=f.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:s=!1,...o}=n,i=So(Sc,t),a=xc(t),l=Ac(i.baseId,r),u=Rc(i.baseId,r),h=r===i.value;return c.jsx(dg,{asChild:!0,...a,focusable:!s,active:h,children:c.jsx(me.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...o,ref:e,onMouseDown:oe(n.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:oe(n.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:oe(n.onFocus,()=>{const p=i.activationMode!=="manual";!h&&!s&&p&&i.onValueChange(r)})})})});Cc.displayName=Sc;var Ec="TabsContent",kc=f.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:s,children:o,...i}=n,a=So(Ec,t),l=Ac(a.baseId,r),u=Rc(a.baseId,r),h=r===a.value,p=f.useRef(h);return f.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),c.jsx(Hl,{present:s||h,children:({present:g})=>c.jsx(me.div,{"data-state":h?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:u,tabIndex:0,...i,ref:e,style:{...n.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});kc.displayName=Ec;function Ac(n,e){return`${n}-trigger-${e}`}function Rc(n,e){return`${n}-content-${e}`}var pg=bc,Ic=Tc,Pc=Cc,Nc=kc;const mg=pg,Dc=f.forwardRef(({className:n,...e},t)=>c.jsx(Ic,{ref:t,className:he("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));Dc.displayName=Ic.displayName;const Mt=f.forwardRef(({className:n,...e},t)=>c.jsx(Pc,{ref:t,className:he("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",n),...e}));Mt.displayName=Pc.displayName;const Ot=f.forwardRef(({className:n,...e},t)=>c.jsx(Nc,{ref:t,className:he("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));Ot.displayName=Nc.displayName;const zs=f.forwardRef(({className:n,...e},t)=>c.jsx("textarea",{className:he("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
184ing-offset-background 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",n),ref:t,...e}));zs.displayName="Textarea";const qn=f.forwardRef(({className:n,type:e,...t},r)=>c.jsx("input",{type:e,className:he("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",n),ref:r,...t}));qn.displayName="Input";var gg="Label",Mc=f.forwardRef((n,e)=>c.jsx(me.label,{...n,ref:e,onMouseDown:t=>{var s;t.target.closest("button, input, select, textarea")||((s=n.onMouseDown)==null||s.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Mc.displayName=gg;var Oc=Mc;const yg=go("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ln=f.forwardRef(({className:n,...e},t)=>c.jsx(Oc,{ref:t,className:he(yg(),n),...e}));ln.displayName=Oc.displayName;function Ai(n,[e,t]){return Math.min(t,Math.max(e,n))}function vg(n){const e=f.useRef({value:n,previous:n});return f.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var xg=[" ","Enter","ArrowUp","ArrowDown"],bg=[" ","Enter"],Yt="Select",[Wr,zr,wg]=da(Yt),[Rn,Xx]=no(Yt,[wg,fa]),Hr=fa(),[Tg,kt]=Rn(Yt),[Sg,Cg]=Rn(Yt),_c=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:u,name:h,autoComplete:p,disabled:g,required:d,form:y}=n,m=Hr(e),[v,S]=f.useState(null),[T,b]=f.useState(null),[R,I]=f.useState(!1),W=To(u),[U,j]=Ir({prop:r,defaultProp:s??!1,onChange:o,caller:Yt}),[$,z]=Ir({prop:i,defaultProp:a,onChange:l,caller:Yt}),Y=f.useRef(null),O=v?y||!!v.closest("form"):!0,[ie,ne]=f.useState(new Set),N=Array.from(ie).map(k=>k.props.value).join(";");return c.jsx(ou,{...m,children:c.jsxs(Tg,{required:d,scope:e,trigger:v,onTriggerChange:S,valueNode:T,onValueNodeChange:b,valueNodeHasChildren:R,onValueNodeHasChildrenChange:I,contentId:er(),value:$,onValueChange:z,open:U,onOpenChange:j,dir:W,triggerPointerDownPosRef:Y,disabled:g,children:[c.jsx(Wr.Provider,{scope:e,children:c.jsx(Sg,{scope:n.__scopeSelect,onNativeOptionAdd:f.useCallback(k=>{ne(D=>new Set(D).add(k))},[]),onNativeOptionRemove:f.useCallback(k=>{ne(D=>{const _=new Set(D);return _.delete(k),_})},[]),children:t})}),O?c.jsxs(ol,{"aria-hidden":!0,required:d,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:k=>z(k.target.value),disabled:g,form:y,children:[$===void 0?c.jsx("option",{value:""}):null,Array.from(ie)]},N):null]})})};_c.displayName=Yt;var jc="SelectTrigger",Fc=f.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...s}=n,o=Hr(t),i=kt(jc,t),a=i.disabled||r,l=Ge(e,i.onTriggerChange),u=zr(t),h=f.useRef("touch"),[p,g,d]=al(m=>{const v=u().filter(b=>!b.disabled),S=v.find(b=>b.value===i.value),T=cl(v,m,S);T!==void 0&&i.onValueChange(T.value)}),y=m=>{a||(i.onOpenChange(!0),d()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Yl,{asChild:!0,...o,children:c.jsx(me.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":il(i.value)?"":void 0,...s,ref:l,onClick:oe(s.onClick,m=>{m.currentTarget.focus(),h.current!=="mouse"&&y(m)}),onPointerDown:oe(s.onPointerDown,m=>{h.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:oe(s.onKeyDown,m=>{const v=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(v&&m.key===" ")&&xg.includes(m.key)&&
184(y(),m.preventDefault())})})})});Fc.displayName=jc;var $c="SelectValue",Lc=f.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:s,children:o,placeholder:i="",...a}=n,l=kt($c,t),{onValueNodeHasChildrenChange:u}=l,h=o!==void 0,p=Ge(e,l.onValueNodeChange);return Et(()=>{u(h)},[u,h]),c.jsx(me.span,{...a,ref:p,style:{pointerEvents:"none"},children:il(l.value)?c.jsx(c.Fragment,{children:i}):o})});Lc.displayName=$c;var Eg="SelectIcon",Uc=f.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...s}=n;return c.jsx(me.span,{"aria-hidden":!0,...s,ref:e,children:r||"â¼"})});Uc.displayName=Eg;var kg="SelectPortal",qc=n=>c.jsx(ru,{asChild:!0,...n});qc.displayName=kg;var Gt="SelectContent",Vc=f.forwardRef((n,e)=>{const t=kt(Gt,n.__scopeSelect),[r,s]=f.useState();if(Et(()=>{s(new DocumentFragment)},[]),!t.open){const o=r;return o?ro.createPortal(c.jsx(Bc,{scope:n.__scopeSelect,children:c.jsx(Wr.Slot,{scope:n.__scopeSelect,children:c.jsx("div",{children:n.children})})}),o):null}return c.jsx(Qc,{...n,ref:e})});Vc.displayName=Gt;var Be=10,[Bc,At]=Rn(Gt),Ag="SelectContentImpl",Rg=su("SelectContent.RemoveScroll"),Qc=f.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:v,...S}=n,T=kt(Gt,t),[b,R]=f.useState(null),[I,W]=f.useState(null),U=Ge(e,A=>R(A)),[j,$]=f.useState(null),[z,Y]=f.useState(null),O=zr(t),[ie,ne]=f.useState(!1),N=f.useRef(!1);f.useEffect(()=>{if(b)return Gl(b)},[b]),Kl();const k=f.useCallback(A=>{const[re,...ye]=O().map(X=>X.ref.current),[ee]=ye.slice(-1),G=document.activeElement;for(const X of A)if(X===G||(X==null||X.scrollIntoView({block:"nearest"}),X===re&&I&&(I.scrollTop=0),X===ee&&I&&(I.scrollTop=I.scrollHeight),X==null||X.focus(),document.activeElement!==G))return},[O,I]),D=f.useCallback(()=>k([j,b]),[k,j,b]);f.useEffect(()=>{ie&&D()},[ie,D]);const{onOpenChange:_,triggerPointerDownPosRef:E}=T;f.useEffect(()=>{if(b){let A={x:0,y:0};const re=ee=>{var G,X;A={x:Math.abs(Math.round(ee.pageX)-(((G=E.current)==null?void 0:G.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((X=E.current)==null?void 0:X.y)??0))}},ye=ee=>{A.x<=10&&A.y<=10?ee.preventDefault():b.contains(ee.target)||_(!1),document.removeEventListener("pointermove",re),E.current=null};return E.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ye,{capture:!0})}}},[b,_,E]),f.useEffect(()=>{const A=()=>_(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[_]);const[C,P]=al(A=>{const re=O().filter(G=>!G.disabled),ye=re.find(G=>G.ref.current===document.activeElement),ee=cl(re,A,ye);ee&&setTimeout(()=>ee.ref.current.focus())}),L=f.useCallback((A,re,ye)=>{const ee=!N.current&&!ye;(T.value!==void 0&&T.value===re||ee)&&($(A),ee&&(N.current=!0))},[T.value]),q=f.useCallback(()=>b==null?void 0:b.focus(),[b]),M=f.useCallback((A,re,ye)=>{const ee=!N.current&&!ye;(T.value!==void 0&&T.value===re||ee)&&Y(A)},[T.value]),ge=r==="popper"?Hs:Wc,De=ge===Hs?{side:a,sideOffset:l,align:u,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:d,sticky:y,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(Bc,{scope:t,content:b,viewport:I,onViewportChange:W,itemRefCallback:L,selectedItem:j,onItemLeave:q,itemTextRefCallback:M,focusSelectedItem:D,selectedItemText:z,position:r,isPositioned:ie,searchRef:C,children:c.jsx(Jl,{as:Rg,allowPinchZoom:!0,children:c.jsx(Zl,{asChild:!0,trapped:T.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:oe(s,A=>{var re;(re=T.trigger)==null||re.focus({preventScroll:!0}),A.preventDefault()}),children:c.jsx(Xl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:A=>A.preventDefault(),...S,...De,onPlaced:()=>ne(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:oe(S.onKeyDown,A=>{const re=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!re&&A.key.length===1&&P(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let ee=O().filter(G=>!G.disabled).map(G=>G.ref.current);
184if(["ArrowUp","End"].includes(A.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const G=A.target,X=ee.indexOf(G);ee=ee.slice(X+1)}setTimeout(()=>k(ee)),A.preventDefault()}})})})})})})});Qc.displayName=Ag;var Ig="SelectItemAlignedPosition",Wc=f.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...s}=n,o=kt(Gt,t),i=At(Gt,t),[a,l]=f.useState(null),[u,h]=f.useState(null),p=Ge(e,U=>h(U)),g=zr(t),d=f.useRef(!1),y=f.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:S,focusSelectedItem:T}=i,b=f.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&m&&v&&S){const U=o.trigger.getBoundingClientRect(),j=u.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(o.dir!=="rtl"){const G=z.left-j.left,X=$.left-G,Je=U.left-X,ot=U.width+Je,Nn=Math.max(ot,j.width),Jt=window.innerWidth-Be,Dn=Ai(X,[Be,Math.max(Be,Jt-Nn)]);a.style.minWidth=ot+"px",a.style.left=Dn+"px"}else{const G=j.right-z.right,X=window.innerWidth-$.right-G,Je=window.innerWidth-U.right-X,ot=U.width+Je,Nn=Math.max(ot,j.width),Jt=window.innerWidth-Be,Dn=Ai(X,[Be,Math.max(Be,Jt-Nn)]);a.style.minWidth=ot+"px",a.style.right=Dn+"px"}const Y=g(),O=window.innerHeight-Be*2,ie=m.scrollHeight,ne=window.getComputedStyle(u),N=parseInt(ne.borderTopWidth,10),k=parseInt(ne.paddingTop,10),D=parseInt(ne.borderBottomWidth,10),_=parseInt(ne.paddingBottom,10),E=N+k+ie+_+D,C=Math.min(v.offsetHeight*5,E),P=window.getComputedStyle(m),L=parseInt(P.paddingTop,10),q=parseInt(P.paddingBottom,10),M=U.top+U.height/2-Be,ge=O-M,De=v.offsetHeight/2,A=v.offsetTop+De,re=N+k+A,ye=E-re;if(re<=M){const G=Y.length>0&&v===Y[Y.length-1].ref.current;a.style.bottom="0px";const X=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(ge,De+(G?q:0)+X+D),ot=re+Je;a.style.height=ot+"px"}else{const G=Y.length>0&&v===Y[0].ref.current;a.style.top="0px";const Je=Math.max(M,N+m.offsetTop+(G?L:0)+De)+ye;a.style.height=Je+"px",m.scrollTop=re-M+m.offsetTop}a.style.margin=`${Be}px 0`,a.style.minHeight=C+"px",a.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>d.current=!0)}},[g,o.trigger,o.valueNode,a,u,m,v,S,o.dir,r]);Et(()=>b(),[b]);const[R,I]=f.useState();Et(()=>{u&&I(window.getComputedStyle(u).zIndex)},[u]);const W=f.useCallback(U=>
184{U&&y.current===!0&&(b(),T==null||T(),y.current=!1)},[b,T]);return c.jsx(Ng,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:W,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:c.jsx(me.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Wc.displayName=Ig;var Pg="SelectPopperPosition",Hs=f.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:s=Be,...o}=n,i=Hr(t);return c.jsx(eu,{...i,...o,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hs.displayName=Pg;var[Ng,Co]=Rn(Gt,{}),Ys="SelectViewport",zc=f.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...s}=n,o=At(Ys,t),i=Co(Ys,t),a=Ge(e,o.onViewportChange),l=f.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Wr.Slot,{scope:t,children:c.jsx(me.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:oe(s.onScroll,u=>{const h=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g!=null&&g.current&&p){const d=Math.abs(l.current-h.scrollTop);if(d>0){const y=window.innerHeight-Be*2,m=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),S=Math.max(m,v);if(S<y){const T=S+d,b=Math.min(y,T),R=T-b;p.style.height=b+"px",p.style.bottom==="0px"&&(h.scrollTop=R>0?R:0,p.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});zc.displayName=Ys;var Hc="SelectGroup",[Dg,Mg]=Rn(Hc),Og=f.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=er();return c.jsx(Dg,{scope:t,id:s,children:c.jsx(me.div,{role:"group","aria-labelledby":s,...r,ref:e})})});Og.displayName=Hc;var Yc="SelectLabel",Gc=f.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=Mg(Yc,t);return c.jsx(me.div,{id:s.id,...r,ref:e})});Gc.displayName=Yc;var _r="SelectItem",[_g,Kc]=Rn(_r),Jc=f.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:s=!1,textValue:o,...i}=n,a=kt(_r,t),l=At(_r,t),u=a.value===r,[h,p]=f.useState(o??""),[g,d]=f.useState(!1),y=Ge(e,T=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,T,r,s)}),m=er(),v=f.useRef("touch"),S=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(_g,{scope:t,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:f.useCallback(T=>{p(b=>b||((T==null?void 0:T.textContent)??"").trim())},[]),children:c.jsx(Wr.ItemSlot,{scope:t,value:r,disabled:s,textValue:h,children:c.jsx(me.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:oe(i.onFocus,()=>d(!0)),onBlur:oe(i.onBlur,()=>d(!1)),onClick:oe(i.onClick,()=>{v.current!=="mouse"&&S()}),onPointerUp:oe(i.onPointerUp,()=>{v.current==="mouse"&&S()}),onPointerDown:oe(i.onPointerDown,T=>{v.current=T.pointerType}),onPointerMove:oe(i.onPointerMove,T=>{var b;v.current=T.pointerType,s?(b=l.onItemLeave)==null||b.call(l):v.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(i.onPointerLeave,T=>{var b;T.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:oe(i.onKeyDown,T=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(bg.includes(T.key)&&S(),T.key===" "&&T.preventDefault())})})})})});Jc.displayName=_r;var Vn="SelectItemText",Zc=f.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:s,...o}=n,i=kt(Vn,t),a=At(Vn,t),l=Kc(Vn,t),u=Cg(Vn,t),[h,p]=f.useState(null),g=Ge(e,S=>p(S),l.onItemTextChange,S=>{var T;return(T=a.itemTextRefCallback)==null?void 0:T.call(a,S,l.value,l.disabled)}),d=h==null?void 0:h.textContent,y=f.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return Et(()=>(m(y),()=>v(y)),[m,v,y]),c.jsxs(c.Fragment,{children:[c.jsx(me.span,{id:l.textId,...o,ref:g}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ro.createPortal(o.children,i.valueNode):null]})});Zc.displayName=Vn;var Xc="SelectItemIndicator",el=f.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return Kc(Xc,t).isSelected?c.jsx(me.span,{"aria-hidden":!0,...r,ref:e}):null});el.displayName=Xc;var Gs="SelectScrollUpButton",tl=f.forwardRef((n,e)=>{const t=At(Gs,n.__scopeSelect),r=Co(Gs,n.__scopeSelect),[s,o]=f.useState(!1),i=Ge(e,r.onScrollButtonChange);return Et(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=l.scrollTop>0;o(u)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?c.jsx(rl,{...n,ref:i,onAutoScroll:()=>
184{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});tl.displayName=Gs;var Ks="SelectScrollDownButton",nl=f.forwardRef((n,e)=>{const t=At(Ks,n.__scopeSelect),r=Co(Ks,n.__scopeSelect),[s,o]=f.useState(!1),i=Ge(e,r.onScrollButtonChange);return Et(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)<u;o(h)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?c.jsx(rl,{...n,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});nl.displayName=Ks;var rl=f.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...s}=n,o=At("SelectScrollButton",t),i=f.useRef(null),a=zr(t),l=f.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),Et(()=>{var h;const u=a().find(p=>p.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[a]),c.jsx(me.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:oe(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:oe(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:oe(s.onPointerLeave,()=>{l()})})}),jg="SelectSeparator",sl=f.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return c.jsx(me.div,{"aria-hidden":!0,...r,ref:e})});sl.displayName=jg;var Js="SelectArrow",Fg=f.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,s=Hr(t),o=kt(Js,t),i=At(Js,t);return o.open&&i.position==="popper"?c.jsx(tu,{...s,...r,ref:e}):null});Fg.displayName=Js;var $g="SelectBubbleInput",ol=f.forwardRef(({__scopeSelect:n,value:e,...t},r)=>{const s=f.useRef(null),o=Ge(r,s),i=vg(e);return f.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==e&&h){const p=new Event("change",{bubbles:!0});h.call(a,e),a.dispatchEvent(p)}},[i,e]),c.jsx(me.select,{...t,style:{...nu,...t.style},ref:o,defaultValue:e})});ol.displayName=$g;function il(n){return n===""||n===void 0}function al(n){const e=ha(n),t=f.useRef(""),r=f.useRef(0),s=f.useCallback(i=>{const a=t.current+i;e(a),function l(u){t.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),o=f.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,s,o]}function cl(n,e,t){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,o=t?n.indexOf(t):-1;let i=Lg(n,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==t));const l=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==t?l:void 0}function Lg(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var Ug=_c,ll=Fc,qg=Lc,Vg=Uc,Bg=qc,ul=Vc,Qg=zc,dl=Gc,hl=Jc,Wg=Zc,zg=el,fl=tl,pl=nl,ml=sl;const Hg=Ug,Yg=qg,gl=f.forwardRef(({className:n,children:e,...t},r)=>c.jsxs(ll,{ref:r,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
184ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...t,children:[e,c.jsx(Vg,{asChild:!0,children:c.jsx(yo,{className:"h-4 w-4 opacity-50"})})]}));gl.displayName=ll.displayName;const yl=f.forwardRef(({className:n,...e},t)=>c.jsx(fl,{ref:t,className:he("flex cursor-default items-center justify-center py-1",n),...e,children:c.jsx(tp,{className:"h-4 w-4"})}));yl.displayName=fl.displayName;const vl=f.forwardRef(({className:n,...e},t)=>c.jsx(pl,{ref:t,className:he("flex cursor-default items-center justify-center py-1",n),...e,children:c.jsx(yo,{className:"h-4 w-4"})}));vl.displayName=pl.displayName;const xl=f.forwardRef(({className:n,children:e,position:t="popper",...r},s)=>c.jsx(Bg,{children:c.jsxs(ul,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...r,children:[c.jsx(yl,{}),c.jsx(Qg,{className:he("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),c.jsx(vl,{})]})}));xl.displayName=ul.displayName;const Gg=f.forwardRef(({className:n,...e},t)=>c.jsx(dl,{ref:t,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));Gg.displayName=dl.displayName;const vt=f.forwardRef(({className:n,children:e,...t},r)=>c.jsxs(hl,{ref:r,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",n),...t,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(zg,{children:c.jsx(Dr,{className:"h-4 w-4"})})}),c.jsx(Wg,{children:e})]}));vt.displayName=hl.displayName;const Kg=f.forwardRef(({className:n,...e},t)=>c.jsx(ml,{ref:t,className:he("-mx-1 my-1 h-px bg-muted",n),...e}));Kg.displayName=ml.displayName;function Jg(n){const e={};for(const o of n.split(";")){const[i,a]=o.split("=");e[i]=a}const t={DAILY:"Daily",WEEKLY:"Weekly",MONTHLY:"Monthly",YEARLY:"Yearly"},r={MO:"Mon",TU:"Tue",WE:"Wed",TH:"Thu",FR:"Fri",SA:"Sat",SU:"Sun"};let s=t[e.FREQ]||e.FREQ;if(e.INTERVAL&&e.INTERVAL!=="1"&&(s=`Every ${e.INTERVAL} ${s.toLowerCase().replace("ly","")}s`),e.BYDAY){const o=e.BYDAY.split(",").map(i=>r[i]||i).join(", ");s+=` on ${o}`}return s}function vr(n){const e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0"),s=String(n.getHours()).padStart(2,"0"),o=String(n.getMinutes()).padStart(2,"0");return`${e}-${t}-${r}T${s}:${o}`}function Zg({event:n,index:e,onRemove:t,onUpdate:r}){const{t:s}=Ke(),[o,i]=f.useState(!1),[a,l]=f.useState({title:n.title,location:n.location||"",startDate:vr(n.startDate),endDate:vr(n.endDate),recurrence:n.recurrenceRule||"none"}),u=y=>y.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}),h=y=>y.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),p=()=>{l({title:n.title,location:n.location||"",startDate:vr(n.startDate),endDate:vr(n.endDate),recurrence:n.recurrenceRule||"none"}),i(!0)},g=()=>{r(n.id,{title:a.title,location:a.location||void 0,startDate:new Date(a.startDate),endDate:new Date(a.endDate),recurrenceRule:a.recurrence==="none"?void 0:a.recurrence}),i(!1)},d=()=>{i(!1)};return o?c.jsx(Ce.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:e*.08},className:"relative rounded-xl border-2 border-primary bg-card p-5",children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(ln,{className:"text-xs text-muted-foreground mb-1",children:s("eventCard.title")}),c.jsx(qn,{value:a.title,onChange:y=>l(m=>({...m,title:y.target.value})),className:"h-9 rounded-lg"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx(ln,{className:"text-xs text-muted-foreground mb-1",children:s("eventCard.start")}),c.jsx(qn,{type:"datetime-local",value:a.startDate,onChange:y=>l(m=>({...m,startDate:y.target.value})),className:"h-9 rounded-lg"})]}),c.jsxs("div",{children:[c.jsx(ln,{className:"text-xs text-muted-foreground mb-1",children:s("eventCard.end")}),c.jsx(qn,{type:"datetime-local",value:a.endDate,onChange:y=>l(m=>({...m,endDate:y.target.value})),className:"h-9 rounded-lg"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx(ln,{className:"text-xs text-muted-foreground mb-1",children:s("eventCard.location")}),c.jsx(qn,{value:a.location,onChange:y=>l(m=>({...m,location:y.target.value})),placeholder:s("eventCard.optional"),className:"h-9 rounded-lg"})]}),c.jsxs("div",{children:[c.jsx(ln,{className:"text-xs text-muted-foreground mb-1",children:s("eventCard.recurrence")}),c.jsxs(Hg,{value:a.recurrence,onValueChange:y=>l(m=>({...m,recurrence:y})),children:[c.jsx(gl,{className:"h-9 rounded-lg",children:c.jsx(Yg,{})}),c.jsxs(xl,{children:[c.jsx(vt,{value:"none",children:s("eventCard.noRepeat")}),c.jsx(vt,{value:"FREQ=DAILY",children:s("eventCard.daily")}),c.jsx(vt,{value:"FREQ=WEEKLY",children:s("eventCard.weekly")}),c.jsx(vt,{value:"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR",children:s("eventCard.weekdays")}),c.jsx(vt,{value:"FREQ=WEEKLY;INTERVAL=2",children:s("eventCard.every2Weeks")}),c.jsx(vt,{value:"FREQ=MONTHLY",children:s("eventCard.monthly")}),c.jsx(vt,{value:"FREQ=YEARLY",children:s("eventCard.yearly")})]})]})]})]}),c.jsxs("div",{className:"flex gap-2 pt-1",children:[c.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:opacity-90 transition-opacity",children:[c.jsx(Dr,{className:"h-3.5 w-3.5"}),s("eventCard.save")]}),c.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-muted transition-colors",children:[c.jsx(Za,{className:"h-3.5 w-3.5"}),s("eventCard.cancel")]})]})]})}):c.jsxs(Ce.div,{initial:{opacity:0,y:12}
184,animate:{opacity:1,y:0},transition:{delay:e*.08},className:"group relative rounded-xl border border-border bg-card p-5 transition-shadow hover:shadow-md",children:[c.jsxs("div",{className:"absolute right-3 top-3 flex gap-1 opacity-0 transition-all group-hover:opacity-100",children:[c.jsx("button",{onClick:p,className:"rounded-lg p-1.5 text-muted-foreground hover:bg-primary/10 hover:text-primary",children:c.jsx(ip,{className:"h-4 w-4"})}),c.jsx("button",{onClick:()=>t(n.id),className:"rounded-lg p-1.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:c.jsx(up,{className:"h-4 w-4"})})]}),c.jsx("h3",{className:"font-heading text-lg font-medium text-foreground pr-16",children:n.title}),c.jsxs("div",{className:"mt-3 flex flex-col gap-1.5 text-sm text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nr,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:u(n.startDate)})]}),!n.allDay&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vi,{className:"h-3.5 w-3.5 text-primary"}),c.jsxs("span",{children:[h(n.startDate)," â ",h(n.endDate)]})]}),n.allDay&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vi,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:s("eventCard.allDay")})]}),n.location&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(op,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:n.location})]}),n.recurrenceRule&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ap,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:Jg(n.recurrenceRule)})]})]}),n.description&&c.jsx("p",{className:"mt-3 text-sm text-muted-foreground/80 line-clamp-2",children:n.description})]})}function Ft(n){return n.toString().padStart(2,"0")}function Ss(n){return`${n.getUTCFullYear()}${Ft(n.getUTCMonth()+1)}${Ft(n.getUTCDate())}T${Ft(n.getUTCHours())}${Ft(n.getUTCMinutes())}${Ft(n.getUTCSeconds())}Z`}function Ri(n){return`${n.getFullYear()}${Ft(n.getMonth()+1)}${Ft(n.getDate())}`}function Cs(n){return n.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n")}function Xg(){return`${Date.now()}-${Math.random().toString(36).slice(2,11)}@text2ics`}function ey(n){const e=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Text2ICS//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH"];for(const t of n)e.push("BEGIN:VEVENT"),e.push(`UID:${Xg()}`),e.push(`DTSTAMP:${Ss(new Date)}`),t.allDay?(e.push(`DTSTART;VALUE=DATE:${Ri(t.startDate)}`),e.push(`DTEND;VALUE=DATE:${Ri(t.endDate)}`)):(e.push(`DTSTART:${Ss(t.startDate)}`),e.push(`DTEND:${Ss(t.endDate)}`)),e.push(`SUMMARY:${Cs(t.title)}`),t.recurrenceRule&&e.push(`RRULE:${t.recurrenceRule}`),t.description&&e.push(`DESCRIPTION:${Cs(t.description)}`),t.location&&e.push(`LOCATION:${Cs(t.location)}`),e.push("END:VEVENT");return e.push("END:VCALENDAR"),e.join(`\r 185`)}function ty(n,e="events.ics"){const t=ey(n),r=new Blob([t],{type:"text/calendar;charset=utf-8"}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s)}function ny(n){const e=[],t=n.split("BEGIN:VEVENT");for(let r=1;r<t.length;r++){const s=t[r].split("END:VEVENT")[0],o=v=>{const S=s.replace(/\r?\n[ \t]/g,""),T=new RegExp(`^${v}[;:](.*)$`,"m"),b=S.match(T);
185return b?b[1].replace(/\\n/g,` 186`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\"):null},i=v=>{if(!v)return null;const S=v.includes(":")?v.split(":").pop():v,T=S.match(/^(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2}))?Z?$/);if(!T)return null;const[,b,R,I,W,U,j]=T;return S.endsWith("Z")?new Date(Date.UTC(+b,+R-1,+I,+(W||0),+(U||0),+(j||0))):new Date(+b,+R-1,+I,+(W||0),+(U||0),+(j||0))},a=o("SUMMARY"),l=o("DTSTART"),u=o("DTEND"),h=o("DESCRIPTION"),p=o("LOCATION"),g=o("RRULE"),d=i(l);if(!d)continue;const y=i(u)||new Date(d.getTime()+36e5),m=l?!l.includes("T"):!1;e.push({id:`ics-${r}-${Date.now()}`,title:a||"Untitled Event",description:h||void 0,location:p||void 0,startDate:d,endDate:y,allDay:m,recurrenceRule:g||void 0})}return e}async function ry(n){const e=await J(()=>import("./pdf-fe5Q_vu3.js"),[]);e.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${e.version}/pdf.worker.min.mjs`;const t=await n.arrayBuffer(),r=await e.getDocument({data:t}).promise,s=[];for(let o=1;o<=r.numPages;o++){const a=await(await r.getPage(o)).getTextContent();s.push(a.items.map(l=>l.str).join(" "))}return s.join(` 187`)}function sy(n){return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;e(s.split(",")[1])},r.onerror=t,r.readAsDataURL(n)})}var K;(function(n){n[n.AM=0]="AM",n[n.PM=1]="PM"})(K||(K={}));var ue;(function(n){n[n.SUNDAY=0]="SUNDAY",n[n.MONDAY=1]="MONDAY",n[n.TUESDAY=2]="TUESDAY",n[n.WEDNESDAY=3]="WEDNESDAY",n[n.THURSDAY=4]="THURSDAY",n[n.FRIDAY=5]="FRIDAY",n[n.SATURDAY=6]="SATURDAY"})(ue||(ue={}));var _e;(function(n){n[n.JANUARY=1]="JANUARY",n[n.FEBRUARY=2]="FEBRUARY",n[n.MARCH=3]="MARCH",n[n.APRIL=4]="APRIL",n[n.MAY=5]="MAY",n[n.JUNE=6]="JUNE",n[n.JULY=7]="JULY",n[n.AUGUST=8]="AUGUST",n[n.SEPTEMBER=9]="SEPTEMBER",n[n.OCTOBER=10]="OCTOBER",n[n.NOVEMBER=11]="NOVEMBER",n[n.DECEMBER=12]="DECEMBER"})(_e||(_e={}));function Kt(n,e){n.assign("day",e.getDate()),n.assign("month",e.getMonth()+1),n.assign("year",e.getFullYear())}function bl(n,e){n.assign("hour",e.getHours()),n.assign("minute",e.getMinutes()),n.assign("second",e.getSeconds()),n.assign("millisecond",e.getMilliseconds()),n.assign("meridiem",e.getHours()<12?K.AM:K.PM)}function un(n,e){n.imply("day",e.getDate()),n.imply("month",e.getMonth()+1),n.imply("year",e.getFullYear())}function Eo(n,e){n.imply("hour",e.getHours()),n.imply("minute",e.getMinutes()),n.imply("second",e.getSeconds()),n.imply("millisecond",e.getMilliseconds()),n.imply("meridiem",e.getHours()<12?K.AM:K.PM)}const oy={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:2*60,timezoneOffsetNonDst:60,dstStart:n=>Ii(n,_e.MARCH,ue.SUNDAY,2),dstEnd:n=>Ii(n,_e.OCTOBER,ue.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-5*60,timezoneOffsetNonDst:-6*60,dstStart:n=>gt(n,_e.MARCH,ue.SUNDAY,2,2),dstEnd:n=>gt(n,_e.NOVEMBER,ue.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-4*60,timezoneOffsetNonDst:-5*60,dstStart:n=>gt(n,_e.MARCH,ue.SUNDAY,2,2),dstEnd:n=>gt(n,_e.NOVEMBER,ue.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-6*60,timezoneOffsetNonDst:-7*60,dstStart:n=>gt(n,_e.MARCH,ue.SUNDAY,2,2),dstEnd:n=>gt(n,_e.NOVEMBER,ue.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-7*60,timezoneOffsetNonDst:-8*60,dstStart:n=>gt(n,_e.MARCH,ue.SUNDAY,2,2),dstEnd:n=>gt(n,_e.NOVEMBER,ue.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function gt(n,e,t,r,s=0){let o=0,i=0;for(;i<r;)o++,new Date(n,e-1,o).getDay()===t&&i++;return new Date(n,e-1,o,s)}function Ii(n,e,t,r=0){const s=t===0?7:t,o=new Date(n,e-1+1,1,12),i=o.getDay()===0?7:o.getDay();let a;return i===s?a=7:i<s?a=7+i-s:a=i-s,o.setDate(o.getDate()-a),new Date(n,e-1,o.getDate(),r)}function wl(n,e,t={}){if(n==null)return null;if(typeof n=="number")return n;const r=t[n]??oy[n];return r==null?null:typeof r=="number"?r:e==null?null:e>r.dstStart(e.getFullYear())&&!(e>r.dstEnd(e.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}const iy={day:0,second:0,millisecond:0};function Ae(n,e){let t=new Date(n);if(e.y&&(e.year=e.y,delete e.y),e.mo&&(e.month=e.mo,delete e.mo),e.M&&(e.month=e.M,delete e.M),e.w&&(e.week=e.w,delete e.w),e.d&&(e.day=e.d,delete e.d),e.h&&(e.hour=e.h,delete e.h),e.m&&(e.minute=e.m,delete e.m),e.s&&(e.second=e.s,delete e.s),e.ms&&(e.millisecond=e.ms,delete e.ms),"year"in e){const r=Math.floor(e.year);t.setFullYear(t.getFullYear()+r);const s=e.year-r;s>0&&(e.month=(e==null?void 0:e.month)??0,e.month+=s*12)}if("quarter"in e){const r=Math.floor(e.quarter);t.setMonth(t.getMonth()+r*3)}if("month"in e){const r=Math.floor(e.month);t.setMonth(t.getMonth()+r);const s=e.month-r;s>0&&(e.week=(e==null?void 0:e.week)??0,e.week+=s*4)}if("week"in e){const r=Math.floor(e.week);t.setDate(t.getDate()+r*7);const s=e.week-r;s>0&&(e.day=(e==null?void 0:e.day)??0,e.day+=Math.round(s*7))}if("day"in e){const r=Math.floor(e.day);t.setDate(t.getDate()+r);const s=e.day-r;s>0&&(e.hour=(e==null?void 0:e.hour)??0,e.hour+=Math.round(s*24))}if("hour"in e){const r=Math.floor(e.hour);t.setHours(t.getHours()+r);const s=e.hour-r;s>0&&(e.minute=(e==null?void 0:e.minute)??0,e.minute+=Math.round(s*60))}if("minute"in e){const r=Math.floor(e.minute);t.setMinutes(t.getMinutes()+r);const s=e.minute-r;s>0&&(e.second=(e==null?void 0:e.second)??0,e.second+=Math.round(s*60))}if("second"in e){const r=Math.floor(e.second);t.setSeconds(t.getSeconds()+r);const s=e.second-r;s>0&&(e.millisecond=(e==null?void 0:e.millisecond)??0,e.millisecond+=Math.round(s*1e3))}if("millisecond"in e){const r=Math.floor(e.millisecond);t.setMilliseconds(t.getMilliseconds()+r)}return t}function Yr(n){const e={};for(const t in n)e[t]=-n[t];return e}class zt{constructor(e,t){F(this,"instant");F(this,"timezoneOffset");this.instant=e??new Date,this.timezoneOffset=t??null}static fromDate(e){return new zt(e)}static fromInput(e,t){if(e instanceof Date)return zt.fromDate(e);const r=(e==null?void 0:e.instant)??new Date,s=wl(e==null?void 0:e.timezone,r,t);return new zt(r,s)}getDateWithAdjustedTimezone(){const e=new Date(this.instant);return this.timezoneOffset!==null&&e.setMinutes(e.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),e}getSystemTimezoneAdjustmentMinute(e,t){(!e||e.getTime()<0)&&(e=new Date);const r=-e.getTimezoneOffset(),s=t??this.timezoneOffset??r;return r-s}
187getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}}class ce{constructor(e,t){F(this,"knownValues");F(this,"impliedValues");F(this,"reference");F(this,"_tags",new Set);if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(const s in t)this.knownValues[s]=t[s];const r=e.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(e,t=iy){let r=Ae(e.getDateWithAdjustedTimezone(),t);const s=new ce(e);return s.addTag("result/relativeDate"),"hour"in t||"minute"in t||"second"in t||"millisecond"in t?(s.addTag("result/relativeDateAndTime"),bl(s,r),Kt(s,r),s.assign("timezoneOffset",e.getTimezoneOffset())):(Eo(s,r),s.imply("timezoneOffset",e.getTimezoneOffset()),"day"in t?(s.assign("day",r.getDate()),s.assign("month",r.getMonth()+1),s.assign("year",r.getFullYear()),s.assign("weekday",r.getDay())):"week"in t?(s.assign("day",r.getDate()),s.assign("month",r.getMonth()+1),s.assign("year",r.getFullYear()),s.imply("weekday",r.getDay())):(s.imply("day",r.getDate()),"month"in t?(s.assign("month",r.getMonth()+1),s.assign("year",r.getFullYear())):(s.imply("month",r.getMonth()+1),"year"in t?s.assign("year",r.getFullYear()):s.imply("year",r.getFullYear())))),s}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}addDurationAsImplied(e){const t=this.dateWithoutTimezoneAdjustment(),r=Ae(t,e);return("day"in e||"week"in e||"month"in e||"year"in e)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in e||"minute"in e||"hour"in e)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(e){typeof e=="string"&&(e=[e]);for(const t of e)delete this.knownValues[t],delete this.impliedValues[t]}clone(){const e=new ce(this.reference);e.knownValues={},e.impliedValues={};for(const t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(const t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){const e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents { 188 tags: ${JSON.stringify(Array.from(this._tags).sort())}, 189 knownValues: ${JSON.stringify(this.knownValues)}, 190 impliedValues: ${JSON.stringify(this.impliedValues)}}, 191 reference: ${JSON.stringify(this.reference)}]`}date(){const e=this.dateWithoutTimezoneAdjustment(),t=this.reference.getSystemTimezoneAdjustmentMinute(e,this.get("timezoneOffset"));return new Date(e.getTime()+t*6e4)}addTag(e){return this._tags.add(e),this}addTags(e){for(const t of e)this._tags.add(t);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){const e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}}class In{constructor(e,t,r,s,o){F(this,"refDate");F(this,"index");F(this,"text");F(this,"reference");F(this,"start");F(this,"end");this.reference=e,this.refDate=e.instant,this.index=t,this.text=r,this.start=s||new ce(e),this.end=o}clone(){const e=new In(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}addTag(e){return this.start.addTag(e),this.end&&this.end.addTag(e),this}addTags(e){return this.start.addTags(e),this.end&&this.end.addTags(e),this}tags(){const e=new Set(this.start.tags());if(this.end)for(const t of this.end.tags())e.add(t);return e}toString(){const e=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(e)} ...}]`}}function Tl(n,e,t="\\s{0,5},?\\s{0,5}"){const r=e.replace(/\((?!\?)/g,"(?:");return`${n}${r}(?:${t}${r}){0,10}`}function ay(n){let e;return n instanceof Array?e=[...n]:n instanceof Map?e=Array.from(n.keys()):e=Object.keys(n),e}function st(n){return`(?:${ay(n).sort((t,r)=>r.length-t.length).join("|").replace(/\./g,"\\.")})`}function Sl(n){return n<100&&(n>50?n=n+1900:n=n+2e3),n}function Gr(n,e,t){let r=new Date(n);r.setMonth(t-1),r.setDate(e);const s=Ae(r,{year:1}),o=Ae(r,{year:-1});return Math.abs(s.getTime()-n.getTime())<Math.abs(r.getTime()-n.getTime())?r=s:Math.abs(o.getTime()-n.getTime())<Math.abs(r.getTime()-n.getTime())&&(r=o),r.getFullYear()}const Zs={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},Cl={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Rt={...Cl,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},Xs={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},eo={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},El={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},Kr={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...El},kl=`(?:${st(Xs)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function cy(n){const e=n.toLowerCase();return Xs[e]!==void 0?Xs[e]:e==="a"||e==="an"||e=="the"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}const jr=`(?:${st(eo)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Fr(n){let e=n.toLowerCase();return eo[e]!==void 0?eo[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}const Jr="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9]|2[0-5])";function Zr(n){if(/BE/i.test(n))return n=n.replace(/BE/i,""),parseInt(n)-543;if(/BCE?/i.test(n))return n=n.replace(/BCE?/i,""),-parseInt(n);if(/(AD|CE)/i.test(n))return n=n.replace(/(AD|CE)/i,""),parseInt(n);const e=parseInt(n);return Sl(e)}const Al=`(${kl})\\s{0,3}(${st(Kr)})`,Pi=new RegExp(Al,"i"),ly=`(${kl})\\s{0,3}(${st(El)})`,Rl="\\s{0,5},?(?:\\s*and)?\\s{0,5}",sr=Tl("(?:(?:about|around)\\s{0,3})?",Al,Rl),Xr=Tl("(?:(?:about|around)\\s{0,3})?",ly,Rl);function Pn(n){const e={};let t=n,r=Pi.exec(t);for(;r;
191)uy(e,r),t=t.substring(r[0].length).trim(),r=Pi.exec(t);return Object.keys(e).length==0?null:e}function uy(n,e){if(e[0].match(/^[a-zA-Z]+$/))return;const t=cy(e[1]),r=Kr[e[2].toLowerCase()];n[r]=t}class Ne{constructor(){F(this,"cachedInnerPattern",null);F(this,"cachedPattern",null)}innerPatternHasChange(e,t){return this.innerPattern(e)!==t}patternLeftBoundary(){return"(\\W|^)"}pattern(e){return this.cachedInnerPattern&&!this.innerPatternHasChange(e,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(e),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(e,t){const r=t[1]??"";t.index=t.index+r.length,t[0]=t[0].substring(r.length);for(let s=2;s<t.length;s++)t[s-1]=t[s];return this.innerExtract(e,t)}}const dy=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${sr})(?=\\W|$)`,"i"),hy=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${sr})(?=\\W|$)`,"i"),fy=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Xr})(?=\\W|$)`,"i");class py extends Ne{constructor(t){super();F(this,"strictMode");this.strictMode=t}innerPattern(t){return this.strictMode?fy:t.option.forwardDate?dy:hy}innerExtract(t,r){if(r[0].match(/^for\s*the\s*\w+/))return null;const s=Pn(r[1]);return s?ce.createRelativeFromReference(t.reference,s):null}}const my=new RegExp(`(?:on\\s{0,3})?(${jr})(?:\\s{0,3}(?:to|\\-|\\â|until|through|till)?\\s{0,3}(${jr}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${st(Rt)})(?:(?:-|/|,?\\s{0,3})(${Jr}(?!\\w)))?(?=\\W|$)`,"i"),Ni=1,Di=2,gy=3,Mi=4;class yy extends Ne{innerPattern(){return my}innerExtract(e,t){const r=e.createParsingResult(t.index,t[0]),s=Rt[t[gy].toLowerCase()],o=Fr(t[Ni]);if(o>31)return t.index=t.index+t[Ni].length,null;if(r.start.assign("month",s),r.start.assign("day",o),t[Mi]){const i=Zr(t[Mi]);r.start.assign("year",i)}else{const i=Gr(e.refDate,o,s);r.start.imply("year",i)}if(t[Di]){const i=Fr(t[Di]);r.end=r.start.clone(),r.end.assign("day",i)}return r}}const vy=new RegExp(`(${st(Rt)})(?:-|/|\\s*,?\\s*)(${jr})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${jr})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${Jr}))?(?=\\W|$)(?!\\:\\d)`,"i"),xy=1,Oi=2,Es=3,ks=4;class by extends Ne{constructor(t){super();F(this,"shouldSkipYearLikeDate");this.shouldSkipYearLikeDate=t}innerPattern(){return vy}innerExtract(t,r){const s=Rt[r[xy].toLowerCase()],o=Fr(r[Oi]);if(o>31||this.shouldSkipYearLikeDate&&!r[Es]&&!r[ks]&&r[Oi].match(/^2[0-5]$/))return null;const i=t.createParsingComponents({day:o,month:s}).addTag("parser/ENMonthNameMiddleEndianParser");if(r[ks]){const u=Zr(r[ks]);i.assign("year",u)}else{const u=Gr(t.refDate,o,s);i.imply("year",u)}if(!r[Es])return i;const a=Fr(r[Es]),l=t.createParsingResult(r.index,r[0]);return l.start=i,l.end=i.clone(),l.end.assign("day",a),l}}const wy=new RegExp(`((?:in)\\s*)?(${st(Rt)}
191)\\s*(?:(?:,|-|of)?\\s*(${Jr})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Ty=1,Sy=2,_i=3;class Cy extends Ne{innerPattern(){return wy}innerExtract(e,t){const r=t[Sy].toLowerCase();if(t[0].length<=3&&!Cl[r])return null;const s=e.createParsingResult(t.index+(t[Ty]||"").length,t.index+t[0].length);s.start.imply("day",1),s.start.addTag("parser/ENMonthNameParser");const o=Rt[r];if(s.start.assign("month",o),t[_i]){const i=Zr(t[_i]);s.start.assign("year",i)}else{const i=Gr(e.refDate,1,o);s.start.imply("year",i)}return s}}const Ey=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${st(Rt)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),ky=1,Ay=2,ji=3,Ry=4;class Iy extends Ne{constructor(t){super();F(this,"strictMonthDateOrder");this.strictMonthDateOrder=t}innerPattern(){return Ey}innerExtract(t,r){const s=parseInt(r[ky]);let o=parseInt(r[Ry]),i=r[ji]?parseInt(r[ji]):Rt[r[Ay].toLowerCase()];if(i<1||i>12){if(this.strictMonthDateOrder)return null;o>=1&&o<=12&&([i,o]=[o,i])}return o<1||o>31?null:{day:o,month:i,year:s}}}const Py=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Ny=1,Dy=2;class My extends Ne{innerPattern(){return Py}innerExtract(e,t){const r=parseInt(t[Dy]),s=parseInt(t[Ny]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",r)}}function Oy(n,e,t,r){return new RegExp(`${n}${e}(\\d{1,4})(?:(?:\\.|:|ï¼)(\\d{1,2})(?:(?::|ï¼)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,r)}function _y(n,e){return new RegExp(`^(${n})(\\d{1,4})(?:(?:\\.|\\:|\\ï¼)(\\d{1,2})(?:(?:\\.|\\:|\\ï¼)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}const As=2,Dt=3,xr=4,br=5,on=6;class jy{constructor(e=!1){F(this,"strictMode");F(this,"cachedPrimaryPrefix",null);F(this,"cachedPrimarySuffix",null);F(this,"cachedPrimaryTimePattern",null);F(this,"cachedFollowingPhase",null);F(this,"cachedFollowingSuffix",null);F(this,"cachedFollowingTimePatten",null);this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){const r=this.extractPrimaryTimeComponents(e,t);if(!r)return t[0].match(/^\d{4}/)?(t.index+=4,null):(t.index+=t[0].length,null);const s=t.index+t[1].length,o=t[0].substring(t[1].length),i=e.createParsingResult(s,o,r);t.index+=t[0].length;const a=e.text.substring(t.index),u=this.getFollowingTimePatternThroughCache().exec(a);return o.match(/^\d{3,4}/)&&u&&(u[0].match(/^\s*([+-])\s*\d{2,4}$/)||u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!u||u[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(i):(i.end=this.extractFollowingTimeComponents(e,u,i),i.end&&(i.text+=u[0]),this.checkAndReturnWithFollowingPattern(i))}extractPrimaryTimeComponents(e,t,r=!1){const s=e.createParsingComponents();let o=0,i=null,a=parseInt(t[As]);if(a>100){if(t[As].length==4&&t[Dt]==null&&!t[on]||this.strictMode||t[Dt]!=null)return null;o=a%100,a=Math.floor(a/100)}if(a>24)return null;if(t[Dt]!=null){if(t[Dt].length==1&&!t[on])return null;o=parseInt(t[Dt])}if(o>=60)return null;if(a>12&&(i=K.PM),t[on]!=null){if(a>12)return null;const l=t[on][0].toLowerCase();l=="a"&&(i=K.AM,a==12&&(a=0)),l=="p"&&(i=K.PM,a!=12&&(a+=12))}if(s.assign("hour",a),s.assign("minute",o),i!==null?s.assign("meridiem",i):a<12?s.imply("meridiem",K.AM):s.imply("meridiem",K.PM),t[br]!=null){const l=parseInt(t[br].substring(0,3));if(l>=1e3)return null;s.assign("millisecond",l)}if(t[xr]!=null){const l=parseInt(t[xr]);if(l>=60)return null;s.assign("second",l)}return s}extractFollowingTimeComponents(e,t,r){const s=e.createParsingComponents();if(t[br]!=null){const l=parseInt(t[br].substring(0,3));if(l>=1e3)return null;s.assign("millisecond",l)}if(t[xr]!=null){const l=parseInt(t[xr]);if(l>=60)return null;s.assign("second",l)}let o=parseInt(t[As]),i=0,a=-1;if(t[Dt]!=null?i=parseInt(t[Dt]):o>100&&(i=o%100,o=Math.floor(o/100)),i>=60||o>24)return null;if(o>=12&&(a=K.PM),t[on]!=null){if(o>12)return null;const l=t[on][0].toLowerCase();
191l=="a"&&(a=K.AM,o==12&&(o=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),l=="p"&&(a=K.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(a==K.AM?(r.start.imply("meridiem",K.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",K.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return s.assign("hour",o),s.assign("minute",i),a>=0?s.assign("meridiem",a):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?s.imply("meridiem",K.AM):o<=12&&(s.assign("hour",o+12),s.assign("meridiem",K.PM)):o>12?s.imply("meridiem",K.PM):o<=12&&s.imply("meridiem",K.AM),s.date().getTime()<r.start.date().getTime()&&s.imply("day",s.get("day")+1),s}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;const t=e.text.match(/[^\d:.](\d[\d.]+)$/);if(t){const r=t[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;const t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;const r=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;const o=parseInt(s),i=parseInt(r);if(o>24||i>24)return null}return e}getPrimaryTimePatternThroughCache(){const e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=Oy(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){const e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=_y(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}}class Fy extends jy{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\â|\\~|\\ã|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){const r=super.extractPrimaryTimeComponents(e,t);if(!r)return r;if(t[0].endsWith("night")){const s=r.get("hour");s>=6&&s<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",K.PM)):s<6&&r.assign("meridiem",K.AM)}if(t[0].endsWith("afternoon")){r.assign("meridiem",K.PM);const s=r.get("hour");s>=0&&s<=6&&r.assign("hour",r.get("hour")+12)}return t[0].endsWith("morning")&&(r.assign("meridiem",K.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(e,t,r){const s=super.extractFollowingTimeComponents(e,t,r);return s&&s.addTag("parser/ENTimeExpressionParser"),s}}const $y=new RegExp(`(${sr})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Ly=new RegExp(`(${Xr})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i");class Uy extends Ne{constructor(t){super();F(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Ly:$y}innerExtract(t,r){const s=Pn(r[1]);return s?ce.createRelativeFromReference(t.reference,Yr(s)):null}}const qy=new RegExp(`(${sr})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),Vy=new RegExp(`(${Xr})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),By=1;class Qy extends Ne{constructor(t){super();F(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Vy:qy}innerExtract(t,r){const s=Pn(r[By]);return s?ce.createRelativeFromReference(t.reference,s):null}}class Il{refine(e,t){return t.filter(r=>this.isValid(e,r))}}class or{refine(e,t){if(t.length<2)return t;const r=[];let s=t[0],o=null;for(let i=1;i<t.length;i++){o=t[i];const a=e.text.substring(s.index+s.text.length,o.index);if(!this.shouldMergeResults(a,s,o,e))r.push(s),s=o;else{const l=s,u=o,h=this.mergeResults(a,l,u,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${l} and ${u} into ${h}`)}),s=h}}return s!=null&&r.push(s),r}}class Wy extends or{shouldMergeResults(e,t,r){return!t.end&&!r.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,r){if(!t.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEac
191h(o=>{t.start.isCertain(o)||t.start.imply(o,r.start.get(o))}),t.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,t.start.get(o))})),t.start.date()>r.start.date()){let o=t.start.date(),i=r.start.date();r.start.isOnlyWeekdayComponent()&&Ae(i,{day:7})>o?(i=Ae(i,{day:7}),r.start.imply("day",i.getDate()),r.start.imply("month",i.getMonth()+1),r.start.imply("year",i.getFullYear())):t.start.isOnlyWeekdayComponent()&&Ae(o,{day:-7})<i?(o=Ae(o,{day:-7}),t.start.imply("day",o.getDate()),t.start.imply("month",o.getMonth()+1),t.start.imply("year",o.getFullYear())):r.start.isDateWithUnknownYear()&&Ae(i,{year:1})>o?(i=Ae(i,{year:1}),r.start.imply("year",i.getFullYear())):t.start.isDateWithUnknownYear()&&Ae(o,{year:-1})<i?(o=Ae(o,{year:-1}),t.start.imply("year",o.getFullYear())):[r,t]=[t,r]}const s=t.clone();return s.start=t.start,s.end=r.start,s.index=Math.min(t.index,r.index),t.index<r.index?s.text=t.text+e+r.text:s.text=r.text+e+t.text,s}}class zy extends Wy{patternBetween(){return/^\s*(to|-|â|until|through|till)\s*$/i}}function Fi(n,e){const t=n.clone(),r=n.start,s=e.start;if(t.start=$i(r,s),n.end!=null||e.end!=null){const o=n.end==null?n.start:n.end,i=e.end==null?e.start:e.end,a=$i(o,i);if(n.end==null&&a.date().getTime()<t.start.date().getTime()){const l=new Date(a.date().getTime());l.setDate(l.getDate()+1),a.isCertain("day")?Kt(a,l):un(a,l)}t.end=a}return t}function $i(n,e){const t=n.clone();return e.isCertain("hour")?(t.assign("hour",e.get("hour")),t.assign("minute",e.get("minute")),e.isCertain("second")?(t.assign("second",e.get("second")),e.isCertain("millisecond")?t.assign("millisecond",e.get("millisecond")):t.imply("millisecond",e.get("millisecond"))):(t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond")))):(t.imply("hour",e.get("hour")),t.imply("minute",e.get("minute")),t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&t.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?t.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&t.get("meridiem")==null&&t.imply("meridiem",e.get("meridiem")),t.get("meridiem")==K.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t.addTags(n.tags()),t.addTags(e.tags()),t}class Hy extends or{shouldMergeResults(e,t,r){return(t.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,r){const s=t.start.isOnlyDate()?Fi(t,r):Fi(r,t);return s.index=t.index,s.text=t.text+e+r.text,s}}class Li extends Hy{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|â|:)?\\s*$")}}const Yy=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i");class Gy{constructor(e){F(this,"timezoneOverrides");this.timezoneOverrides=e}refine(e,t){const r=e.option.timezones??{};return t.forEach(s=>{const o=e.text.substring(s.index+s.text.length),i=Yy.exec(o);if(!i)return;const a=i[1].toUpperCase(),l=s.start.date()??s.refDate??new Date,u={...this.timezoneOverrides,...r},h=wl(a,l,u);if(h==null)return;e.debug(()=>{console.log(`Extracting timezone: '${a}' into: ${h} for: ${s.start}`)});const p=s.start.get("timezoneOffset");p!==null&&h!=p&&(s.start.isCertain("timezoneOffset")||a!=i[1])||s.start.isOnlyDate()&&a!=i[1]||(s.text+=i[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",h),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",h))}),t}}const Ky=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),Jy=1,Zy=2,Xy=3;class ev{refine(e,t){return t.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;const s=e.text.substring(r.index+r.text.length),o=Ky.exec(s);if(!o)return;e.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});const i=parseInt(o[Zy]),a=parseInt(o[Xy]||"0");let l=i*60+a;l>14*60||(o[Jy]==="-"&&(l=-l),r.end!=null&&r.end.assign("timezoneOffset",l),r.start.assign("timezoneOffset",l),r.text+=o[0])}),t}}class to{refine(e,t){if(t.length<2)return t;const r=[];let s=t[0];for(let o=1;o<t.length;o++){const i=t[o];if(i.index>=s.index+s.text.length){r.push(s),s=i;continue}let a=null,l=null;i.text.length>s.text.length?(a=i,l=s):(a=s,l=i),e.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${a}`)}),s=a}return s!=null&&r.push(s),r}}class tv{refine(e,t){return e.option.forwardDate&&t.forEach(r=>{let s=e.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&e.reference.instant>r.start.date()){const o=e.reference.getDateWithAdjustedTimezone(),i=new Date(o);i.setDate(i.getDate()+1),un(r.start,i),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${o}) to the following day (${i})`)}),r.end&&r.end.isOnlyTime()&&(un(r.end,i),r.start.date()>r.end.date()&&(i.setDate(i.getDate()+1),un(r.end,i)))}if(r.start.isOnlyWeekdayComponent()&&s>r.start.date()){let o=r.start.get("weekday")-s.getDay();if(o<=0&&(o+=7),s=Ae(s,{day:o}),un(r.start,s),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.end.isOnlyWeekdayComponent()){let i=r.end.get("weekday")-s.getDay();i<=0&&(i+=7),s=Ae(s,{day:i}),un(r.end,s),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&s>r.start.date())for(let o=0;o<3&&s>r.start.date();o++)r.start.imply("year",r.start.get("year")+1),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),t}}class nv extends Il{constructor(t){super();F(this,"strictMode");this.strictMode=t}isValid(t,r){return r.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${r.text}'`)}),!1):r.start.isValidDate()?r.end&&!r.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${r} (${r.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,r):!0:(t.debug(()=>{console.log(`Removing invalid result: ${r} (${r.start})`)}),!1)}isStrictModeValid(t,r){return r.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${r} (${r.end})`)}),!1):!0}}const rv=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),sv=1,ov=2,iv=3,Ui=4,av=5,qi=6,Vi=7,cv=8,Bi=9,Qi=10;class lv extends Ne{innerPattern(){return rv}innerExtract(e,t){const r=e.createParsingComponents({year:parseInt(t[sv]),month:parseInt(t[ov]),day:parseInt(t[iv])});if(t[Ui]!=null&&(r.assign("hour",parseInt(t[Ui])),r.assign("minute",parseInt(t[av])),t[qi]!=null&&r.assign("second",parseInt(t[qi])),t[Vi]!=null&&r.assign("millisecond",parseInt(t[Vi])),t[cv]!=null)){let s=0;if(t[Bi]){const o=parseInt(t[Bi]);let i=0;t[Qi]!=null&&(i=parseInt(t[Qi])),s=o*60,s<0?s-=i:s+=i}r.assign("timezoneOffset",s)}return r.addTag("parser/ISOFormatParser")}}class uv extends or{mergeResults(e,t,r){const s=r.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,r){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&r.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}}function dv(n,e=!1){return n.parsers.unshift(new lv),n.refiners.unshift(new uv),n.refiners.unshift(new ev),n.refiners.unshift(new to),n.refiners.push(new Gy),n.refiners.push(new to),n.refiners.push(new tv),n.refiners.push(new nv(e)),n}function hv(n){const e=n.getDateWithAdjustedTimezone(),t=new ce(n,{});return Kt(t,e),bl(t,e),t.assign("timezoneOffset",n.getTimezoneOffset()),t.addTag("casualReference/now"),t}function fv(n){const e=n.getDateWithAdjustedTimezone(),t=new ce(n,{});return Kt(t,e),Eo(t,e),t.delete("meridiem"),t.addTag("casualReference/today"),t}function pv(n){return gv(n,1).addTag("casualReference/yesterday")}function mv(n){return ko(n,1).addTag("casualReference/tomorrow")}
191function gv(n,e){return ko(n,-e)}function ko(n,e){const t=n.getDateWithAdjustedTimezone(),r=new ce(n,{}),s=new Date(t.getTime());return s.setDate(s.getDate()+e),Kt(r,s),Eo(r,s),r.delete("meridiem"),r}function yv(n,e=22){const t=n.getDateWithAdjustedTimezone(),r=new ce(n,{});return Kt(r,t),r.imply("hour",e),r.imply("meridiem",K.PM),r.addTag("casualReference/tonight"),r}function vv(n,e=20){const t=new ce(n,{});return t.imply("meridiem",K.PM),t.imply("hour",e),t.addTag("casualReference/evening"),t}function xv(n){const e=new ce(n,{});return n.getDateWithAdjustedTimezone().getHours()>2&&e.addDurationAsImplied({day:1}),e.assign("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/midnight"),e}function bv(n,e=6){const t=new ce(n,{});return t.imply("meridiem",K.AM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/morning"),t}function wv(n,e=15){const t=new ce(n,{});return t.imply("meridiem",K.PM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/afternoon"),t}function Tv(n){const e=new ce(n,{});return e.imply("meridiem",K.AM),e.assign("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/noon"),e}const Sv=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;class Cv extends Ne{innerPattern(e){return Sv}innerExtract(e,t){let r=e.refDate;const s=t[0].toLowerCase();let o=e.createParsingComponents();switch(s){case"now":o=hv(e.reference);break;case"today":o=fv(e.reference);break;case"yesterday":o=pv(e.reference);break;case"tomorrow":case"tmr":case"tmrw":o=mv(e.reference);break;case"tonight":o=yv(e.reference);break;case"overmorrow":o=ko(e.reference,2);break;default:if(s.match(/last\s*night/)){if(r.getHours()>6){const i=new Date(r.getTime());i.setDate(i.getDate()-1),r=i}Kt(o,r),o.imply("hour",0)}break}return o.addTag("parser/ENCasualDateParser"),o}}const Ev=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i;class kv extends Ne{innerPattern(){return Ev}innerExtract(e,t){let r=null;switch(t[1].toLowerCase()){case"afternoon":r=wv(e.reference);break;case"evening":case"night":r=vv(e.reference);break;case"midnight":r=xv(e.reference);break;case"morning":r=bv(e.reference);break;case"noon":case"midday":r=Tv(e.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}}function Av(n,e,t){const r=n.getDateWithAdjustedTimezone(),s=Rv(r,e,t);let o=new ce(n);return o=o.addDurationAsImplied({day:s}),o.assign("weekday",e),o}function Rv(n,e,t){const r=n.getDay();switch(t){case"this":return Rr(n,e);case"last":return Pl(n,e);case"next":return r==ue.SUNDAY?e==ue.SUNDAY?7:e:r==ue.SATURDAY?e==ue.SATURDAY?7:e==ue.SUNDAY?8:1+e:e<r&&e!=ue.SUNDAY?Rr(n,e):Rr(n,e)+7}return Iv(n,e)}function Iv(n,e){const t=Pl(n,e),r=Rr(n,e);return r<-t?r:t}function Rr(n,e){const t=n.getDay();let r=e-t;return r<0&&(r+=7),r}function Pl(n,e){const t=n.getDay();let r=e-t;return r>=0&&(r-=7),r}const Pv=new RegExp(`(?:(?:\\,|\\(|\\ï¼)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${st(Zs)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\ï¼))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),Nv=1,Dv=2,Mv=3;class Ov extends Ne{innerPattern(){return Pv}innerExtract(e,t){const r=t[Nv],s=t[Mv];let o=r||s;o=o||"",o=o.toLowerCase();let i=null;o=="last"||o=="past"?i="last":o=="next"?i="next":o=="this"&&(i="this");const a=t[Dv].toLowerCase();let l;if(Zs[a]!==void 0)l=Zs[a];else if(a=="weekend")l=i=="last"?ue.SUNDAY:ue.SATURDAY;else if(a=="weekday"){const u=e.reference.getDateWithAdjustedTimezone().getDay();u==ue.SUNDAY||u==ue.SATURDAY?l=i=="last"?ue.FRIDAY:ue.MONDAY:(l=u-1,l=i=="last"?l-1:l+1,l=l%5+1)}else return null;return Av(e.reference,l,i)}}const _v=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${st(Kr)})(?=\\s*)(?=\\W|$)`,"i"),jv=1,Fv=2;class $v extends Ne{innerPattern(){return _v}innerExtract(e,t){const r=t[jv].toLowerCase(),s=t[Fv].toLowerCase(),o=Kr[s];if(r=="next"||r.startsWith("after")){const l={};return l[o]=1,ce.createRelativeFromReference(e.reference,l)}if(r=="last"||r=="past"){const l={};return l[o]=-1,ce.createRelativeFromReference(e.reference,l)}const i=e.createParsingComponents();let a=new Date(e.reference.instant.getTime());return s.match(/week/i)?(a.setDate(a.getDate()-a.getDay()),i.imply("day",a.getDate()),i.imply("month",a.getMonth()+1),i.imply("year",a.getFullYear())):s.match(/month/i)?(a.setDate(1),i.imply("day",a.getDate()),i.assign("year",a.getFullYear()),i.assign("month",a.getMonth()+1)):s.match(/year/i)&&(a.setDate(1),a.setMonth(0),i.imply("day",a.getDate()),i.imply("month",a.getMonth()+1),i.assign("year",a.getFullYear())),i}}const Lv=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Uv=1,qv=5,Wi=2,zi=3,Rs=4;class Vv{constructor(e){F(this,"groupNumberMonth");F(this,"groupNumberDay");this.groupNumberMonth=e?zi:Wi,this.groupNumberDay=e?Wi:zi}pattern(){return Lv}extract(e,t){const r=t.index+t[Uv].length,s=t.index+t[0].length-t[qv].length;if(r>0&&e.text.substring(0,r).match("\\d/?$")||s<e.text.length&&e.text.substring(s).match("^/?\\d"))return;const o=e.text.substring(r,s);if(o.match(/^\d\.\d$/)||o.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Rs]&&o.indexOf("/")<0)return;const i=e.createParsingResult(r,o);let a=parseInt(t[this.groupNumberMonth]),l=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(l>=1&&l<=12&&a<=31)[l,a]=[a,l];else return null;if(l<1||l>31)return null;if(i.start.assign("day",l),i.start.assign("month",a),t[Rs]){const u=parseInt(t[Rs]),h=Sl(u);i.start.assign("year",h)}else{const u=Gr(e.refDate,l,a);i.start.imply("year",u)}return i.addTag("parser/SlashDateFormatParser")}}const Bv=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${sr})(?=\\W|$)`,"i"),Qv=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Xr})(?=\\W|$)`,"i");class Wv extends Ne{constructor(t=!0){super();F(this,"allowAbbreviations");this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?Bv:Qv}innerExtract(t,r){const s=r[1].toLowerCase();let o=Pn(r[2]);if(!o)return null;switch(s){case"last":case"past":case"-":o=Yr(o);break}return ce.createRelativeFromReference(t.reference,o)}}function zv(n){return n.text.match(/^[+-]/i)!=null}function Hi(n){return n.text.match(/^-/i)!=null}class Hv extends or{shouldMergeResults(e,t,r){return e.match(/^\s*$/i)?zv(r)||Hi(r):!1}mergeResults(e,t,r,s){let o=Pn(r.text);Hi(r)&&(o=Yr(o));const i=ce.createRelativeFromReference(zt.fromDate(t.start.date()),o);return new In(t.reference,t.index,`${t.text}${e}${r.text}`,i)}}function Yi(n){return n.text.match(/\s+(before|from)$/i)!=null}function Yv(n){return n.text.match(/\s+(after|since)$/i)!=null}class Gv extends or{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,r){return!e.match(this.patternBetween())||!Yi(t)&&!Yv(t)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(e,t,r){let s=Pn(t.text);Yi(t)&&(s=Yr(s));const o=ce.createRelativeFromReference(zt.fromDate(r.start.date()),s);return new In(r.reference,t.index,`${t.text}${e}${r.text}`,o)}}const Kv=new RegExp(`^\\s*(${Jr})`,"i"),Jv=1;class Zv{refine(e,t){return t.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;const s=e.text.substring(r.index+r.text.length),o=Kv.exec(s);if(!o||o[0].trim().length<=3)return;e.debug(()=>{console.log(`Extracting year: '${o[0]}' into : ${r}`)});const i=Zr(o[Jv]);r.end!=null&&r.end.assign("year",i),r.start.assign("year",i),r.text+=o[0]}),t}}class Xv extends Il{constructor(){super()}isValid(e,t){const r=t.text.trim();return r===e.text.trim()?!0:r.toLowerCase()==="may"&&!e.text.substring(0,t.index).trim().match(/\b(in)$/i)?(e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):r.toLowerCase().endsWith("the second")?(e.text.substring(t.index+t.text.length).trim().length>0&&e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):!0}}class Nl{createCasualConfiguration(e=!1){const t=this.createConfiguration(!1,e);return t.parsers.push(new Cv),t.parsers.push(new kv),t.parsers.push(new Cy),t.parsers.push(new $v),t.parsers.push(new Wv),t.refiners.push(new Xv),t}createConfiguration(e=!0,t=!1){const r=dv({parsers:[new Vv(t),new py(e),new yy,new by(t),new Ov,new My,new Fy(e),new Uy(e),new Qy(e)],refiners:[new Li]},e);return r.parsers.unshift(new Iy(e)),r.refiners.unshift(new Gv),r.refiners.unshift(new Hv),r.refiners.unshift(new to),r.refiners.push(new Li),r.refiners.push(new Zv),r.refiners.push(new zy),r}}class En{constructor(e){F(this,"parsers");F(this,"refiners");
191F(this,"defaultConfig",new Nl);e=e||this.defaultConfig.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new En({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,r){const s=this.parse(e,t,r);return s.length>0?s[0].start.date():null}parse(e,t,r){const s=new ex(e,t,r);let o=[];return this.parsers.forEach(i=>{const a=En.executeParser(s,i);o=o.concat(a)}),o.sort((i,a)=>i.index-a.index),this.refiners.forEach(function(i){o=i.refine(s,o)}),o}static executeParser(e,t){const r=[],s=t.pattern(e),o=e.text;let i=e.text,a=s.exec(i);for(;a;){const l=a.index+o.length-i.length;a.index=l;const u=t.extract(e,a);if(!u){i=o.substring(a.index+1),a=s.exec(i);continue}let h=null;u instanceof In?h=u:u instanceof ce?(h=e.createParsingResult(a.index,a[0]),h.start=u):h=e.createParsingResult(a.index,a[0],u);const p=h.index,g=h.text;e.debug(()=>console.log(`${t.constructor.name} extracted (at index=${p}) '${g}'`)),r.push(h),i=o.substring(p+g.length),a=s.exec(i)}return r}}class ex{constructor(e,t,r){F(this,"text");F(this,"option");F(this,"reference");F(this,"refDate");this.text=e,this.option=r??{},this.reference=zt.fromInput(t,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ce?e:new ce(this.reference,e)}createParsingResult(e,t,r,s){const o=typeof t=="string"?t:this.text.substring(e,t),i=r?this.createParsingComponents(r):null,a=s?this.createParsingComponents(s):null;return new In(this.reference,e,o,i,a)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}}const Ao=new Nl,tx=new En(Ao.createCasualConfiguration(!1));new En(Ao.createConfiguration(!0,!1));new En(Ao.createCasualConfiguration(!0));const nx=tx;function rx(n,e,t){return nx.parse(n,e,t)}const sx=[[/\bevery\s+day\b/i,"FREQ=DAILY"],[/\bdaily\b/i,"FREQ=DAILY"],[/\bevery\s+weekday\b/i,"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"],[/\bevery\s+monday\b/i,"FREQ=WEEKLY;BYDAY=MO"],[/\bevery\s+tuesday\b/i,"FREQ=WEEKLY;BYDAY=TU"],[/\bevery\s+wednesday\b/i,"FREQ=WEEKLY;BYDAY=WE"],[/\bevery\s+thursday\b/i,"FREQ=WEEKLY;BYDAY=TH"],[/\bevery\s+friday\b/i,"FREQ=WEEKLY;BYDAY=FR"],[/\bevery\s+saturday\b/i,"FREQ=WEEKLY;BYDAY=SA"],[/\bevery\s+sunday\b/i,"FREQ=WEEKLY;BYDAY=SU"],[/\bevery\s+week\b/i,"FREQ=WEEKLY"],[/\bweekly\b/i,"FREQ=WEEKLY"],[/\bevery\s+(?:other|2)\s+weeks?\b/i,"FREQ=WEEKLY;INTERVAL=2"],[/\bbiweekly\b/i,"FREQ=WEEKLY;INTERVAL=2"],[/\bevery\s+month\b/i,"FREQ=MONTHLY"],[/\bmonthly\b/i,"FREQ=MONTHLY"],[/\bevery\s+year\b/i,"FREQ=YEARLY"],[/\byearly\b/i,"FREQ=YEARLY"],[/\bannually\b/i,"FREQ=YEARLY"]],ox=/\b(?:at|in|@)\s+([A-Z][^,.\n]{2,40})/i;function ix(n){for(const[e,t]of sx)if(e.test(n))return t}function ax(n){const e=n.match(ox);if(!e)return;const t=e[1].trim();if(!/^(the same|least|most|around|about|that|this|once|a time)/i.test(t))return t}function cx(n,e){let t=n;for(const r of e)t=t.replace(r.text,"").trim();return t=t.replace(/\b(every\s+\w+|daily|weekly|monthly|yearly|annually|biweekly)\b/gi,"").trim(),t=t.replace(/\b(at|in|@)\s+[A-Z][^,.\n]{2,40}/i,"").trim(),t=t.replace(/^[-ââ·â¢*,;:\s]+/,"").replace(/[-ââ·â¢*,;:\s]+$/,"").trim(),t||(t=n.slice(0,60).trim()),t.length>60&&(t=t.slice(0,57)+"..."),t||"Untitled Event"}function lx(n){const e=[],t=new Date,r=n.split(/\n/).map(s=>s.trim()).filter(s=>s.length>0);for(const s of r){if(s.length<4||/^(please|create|add|make|convert|extract|here|the following)/i.test(s))continue;const o=rx(s,t,{forwardDate:!0});if(o.length!==0)for(const i of o){const a=i.start.date(),l=i.start.isCertain("hour"),u=i.end?i.end.date():l?new Date(a.getTime()+36e5):new Date(a.getTime()+864e5),h=!l,p=ix(s),g=ax(s),d=cx(s,[i]);e.push({id:`local-${e.length}-${Date.now()}`,title:d,startDate:a,endDate:u,allDay:h,location:g,recurrenceRule:p})}}return e}const an=2e3,ux=5e4,Gi=1e6;function wr({accept:n,label:e,description:t,onFile:r,loading:s,fileName:o,locked:i,t:a}){const l=f.useRef(null);return c.jsxs("div",{onClick:()=>{var u;i||(u=l.current)==null||u.click()},className:`flex flex-col items-center justify-center gap-3 min-h-[180px] rounded-xl border-2 border-dashed bg-card p-8 transition-colors ${i?"border-border
191cursor-default opacity-60":"border-border cursor-pointer hover:border-primary/50 hover:bg-primary/5"}`,children:[s?c.jsx(Or,{className:"h-10 w-10 text-primary animate-spin"}):i?c.jsx(Un,{className:"h-10 w-10 text-muted-foreground"}):c.jsx(hp,{className:"h-10 w-10 text-muted-foreground"}),c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-base font-body font-medium text-foreground",children:i?a("converter.signInRequired"):o||e}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s?a("converter.processingAI"):i?a("converter.signInFeature"):t}),!i&&c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a("converter.maxSize")})]}),!i&&c.jsx("input",{ref:l,type:"file",accept:n,onChange:u=>{var p;const h=(p=u.target.files)==null?void 0:p[0];h&&r(h)},className:"hidden"})]})}function dx({initialTab:n="text"}){const{t:e}=Ke(),t=Br(),[r,s]=f.useState([]),[o,i]=f.useState(""),[a,l]=f.useState(!1),[u,h]=f.useState(null),{toast:p}=mo(),g=$r(),{isAuthenticated:d}=uo(),y=_s(jt.ai.parseText),m=_s(jt.ai.parseImage),v=Fd(jt.sessions.createSession),[S,T]=f.useState(null),b=Os(jt.sessions.getSession,S?{sessionId:S}:"skip"),R=Os(jt.sessions.getSessionEvents,S?{sessionId:S}:"skip"),I=S!==null&&(b==null?void 0:b.status)==="processing",[W,U]=f.useState(null);f.useEffect(()=>{if(!(!S||!b||!R))if(b.status==="completed"||b.status==="quota_exceeded"){const C=R.map(P=>({id:P._id,title:P.title,startDate:new Date(P.startDate),endDate:new Date(P.endDate),location:P.location,description:P.description,recurrenceRule:P.recurrenceRule,allDay:P.allDay}));s(C),b.status==="quota_exceeded"?U({delivered:b.eventsDelivered,total:b.totalEventsFromAI??0}):(U(null),C.length>0&&p({title:e("converter.foundEvents",{count:C.length})})),T(null)}else b.status==="error"&&(p({title:e("converter.failedParse"),description:b.errorMessage||void 0,variant:"destructive"}),T(null),U(null))},[b==null?void 0:b.status,R==null?void 0:R.length]);const j=I?(R==null?void 0:R.length)??0:0,$=new Date().toISOString().split("T")[0],z=()=>{p({title:e("converter.signInRequired"),description:e("converter.signInDescription"),variant:"destructive"}),g(t("/login"))},Y=()=>{if(!o.trim()){p({title:e("converter.pasteText"),variant:"destructive"});return}T(null);const C=lx(o.slice(0,an));C.length>0?(s(C),p({title:e("converter.foundEvents",{count:C.length})})):p({title:e("converter.noEvents"),description:e("converter.noEventsDesc"),variant:"destructive"})},O=async()=>{if(!d){z();return}if(!o.trim()){p({title:e("converter.pasteText"),variant:"destructive"});return}l(!0),s([]),U(null);try{const C=await v({inputText:o.slice(0,an),inputType:"text"});T(C),await y({text:o.slice(0,an),today:$,sessionId:C})}catch(C){const P=C instanceof ut?String(C.data):C.message;P!=null&&P.includes("events")||P!=null&&P.includes("plan")||P!=null&&P.includes("quota")||P!=null&&P.includes("credits")?p({title:e("converter.notEnoughCredits"),description:P,variant:"destructive"}):p({title:e("converter.failedParse"),description:P,variant:"destructive"})}finally{l(!1)}},ie=async(C,P)=>{if(!d){z();return}if(C.size>Gi){p({title:e("converter.fileTooLarge"),description:e("converter.fileTooLargeDesc"),variant:"destructive"});return}const L=C.type.startsWith("image/")?"image":C.type==="application/pdf"?"pdf":C.name.endsWith(".csv")?"csv":"text";h(C.name),l(!0),s([]),U(null);try{const q=await v({inputText:C.name,inputType:L});if(T(q),C.type.startsWith("image/")){const M=await sy(C);await m({imageBase64:M,mimeType:C.type,today:$,sessionId:q})}else{let M;C.type==="application/pdf"?M=await ry(C):M=await C.text(),await y({text:M.slice(0,ux),today:$,sessionId:q})}}catch(q){const M=q instanceof ut?String(q.data):q.message;M!=null&&M.includes("events")||M!=null&&M.includes("plan")||M!=null&&M.includes("quota")||M!=null&&M.includes("credits")?p({title:e("converter.notEnoughCredits"),description:M,variant:"destructive"}):p({title:e("converter.failedProcess",{type:P}),description:M,variant:"destructive"})}finally{l(!1)}},ne=async C=>{if(C.size>Gi){p({title:e("converter.fileTooLarge"),description:e("converter.fileTooLargeDesc"),variant:"destructive"});return}h(C.name),T(null);try{const P=await C.text(),L=ny(P);L.length>0?(s(L),p({title:e("converter.loadedEvents",{count:L.length})}
191)):p({title:e("converter.noEventsIcs"),variant:"destructive"})}catch{p({title:e("converter.failedIcs"),variant:"destructive"})}},N=C=>s(P=>P.filter(L=>L.id!==C)),k=(C,P)=>s(L=>L.map(q=>q.id===C?{...q,...P}:q)),D=()=>{r.length!==0&&(ty(r),p({title:e("converter.downloaded")}))},_=an-o.length,E=!d;return c.jsxs("div",{className:"w-full max-w-3xl mx-auto space-y-6",children:[c.jsxs(mg,{defaultValue:n,className:"w-full",children:[c.jsxs(Dc,{className:"w-full grid grid-cols-3 sm:grid-cols-6 h-auto gap-1 bg-muted/50 p-1 rounded-xl",children:[c.jsxs(Mt,{value:"text",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(Kf,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.text")}),c.jsx("span",{className:"text-[10px] text-green-600/70 shrink-0",children:e("converter.free")})]}),c.jsxs(Mt,{value:"text-ai",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(xi,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.textAI")})]}),c.jsxs(Mt,{value:"pdf",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(Mr,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.pdfAI")})]}),c.jsxs(Mt,{value:"image",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(ep,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.imageAI")})]}),c.jsxs(Mt,{value:"csv",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(vo,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.csvAI")})]}),c.jsxs(Mt,{value:"ics",className:"gap-1 rounded-lg text-xs sm:text-sm px-2 py-1.5 data-[state=active]:bg-background data-[state=active]:shadow-sm overflow-hidden",children:[c.jsx(Zf,{className:"h-3.5 w-3.5 shrink-0"})," ",c.jsx("span",{className:"truncate",children:e("converter.icsViewer")}),c.jsx("span",{className:"text-[10px] text-green-600/70 shrink-0",children:e("converter.free")})]})]}),c.jsx(Ot,{value:"text",className:"mt-4",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(zs,{value:o,onChange:C=>i(C.target.value.slice(0,an)),placeholder:e("converter.textPlaceholder"),className:"min-h-[180px] resize-y rounded-xl border-border bg-card p-5 text-base font-body placeholder:text-muted-foreground/50 focus-visible:ring-primary"}),c.jsx("span",{className:`absolute bottom-3 right-3 text-xs ${_<200?"text-destructive":"text-muted-foreground/50"}`,children:e("converter.charsLeft",{count:_})})]}),c.jsxs(xe,{onClick:Y,disabled:!o.trim(),className:"w-full h-12 rounded-xl bg-primary text-primary-foreground font-body font-semibold text-base hover:opacity-90 transition-opacity",children:[c.jsx(lp,{className:"mr-2 h-4 w-4"}),e("converter.extractFree")]})]})}),c.jsx(Ot,{value:"text-ai",className:"mt-4",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(zs,{value:o,onChange:C=>i(C.target.value.slice(0,an)),placeholder:e("converter.textAIPlaceholder"),className:"min-h-[180px] resize-y rounded-xl border-border bg-card p-5 text-base font-body placeholder:text-muted-foreground/50 focus-visible:ring-primary"}),c.jsx("span",{className:`absolute bottom-3 right-3 text-xs ${_<200?"text-destructive":"text-muted-foreground/50"}`,children:e("converter.charsLeft",{count:_})})]}),E?c.jsxs(xe,{onClick:()=>g(t("/login")),variant:"outline",className:"w-full h-12 rounded-xl border-primary text-primary font-body font-semibold text-base hover:bg-primary/5",children:[c.jsx(Un,{className:"mr-2 h-4 w-4"}),e("converter.signInAI")]}):c.jsxs(xe,{onClick:O,disabled:a||I||!o.trim(),className:"w-full h-12 rounded-xl bg-primary text-primary-foreground font-body font-semibold text-base hover:opacity-90 transition-opacity",children:[a||I?c.jsx(Or,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(xi,{className:"mr-2 h-4 w-4"}),e(a||I?"converter.extractingAI":"converter.extractAI")]})]})}),c.jsxs(Ot,{value:"pdf",className:"mt-4",children:[c.jsx(wr,{accept:".pdf,application/pdf",label:e("converter.dropPdf"),description:e("converter.pdfDesc"),onFile:C=>ie(C,"PDF"),loading:a||I,fileName:u,locked:E,t:e}),E&&c.jsxs(xe,{onClick:()=>g(t("/login")),variant:"outline",className:"w-full mt-3 rounded-xl border-primary text-primary font-body font-semibold hover:bg-primary/5",children:[c.jsx(Un,{className:"mr-2 h-4 w-4"})," ",e("converter.signInPdf")]})]}),c.jsxs(Ot,{value:"image",className:"mt-4",children:[c.jsx(wr,{accept:"image/*",label:e("converter.dropImage"),description:e("converter.imageDesc"),onFile:C=>ie(C,"image"),loading:a||I,fileName:u,locked:E,t:e}),E&&c.jsxs(xe,{onClick:()=>g(t("/login")),variant:"outline",className:"w-full mt-3 rounded-xl border-primary text-primary font-body font-semibold hover:bg-primary/5",children:[c.jsx(Un,{className:"mr-2 h-4 w-4"})," ",e("converter.signInImage")]})]}),c.jsxs(Ot,{value:"csv",className:"mt-4",children:[c.jsx(wr,{accept:".csv,text/csv",label:e("converter.dropCsv"),description:e("converter.csvDesc"),onFile:C=>ie(C,"CSV"),loading:a||I,fileName:u,locked:E,t:e}),E&&c.jsxs(xe,{onClick:()=>g(t("/login")),variant:"outline",className:"w-full mt-3 rounded-xl border-primary text-primary font-body font-semibold hover:bg-primary/5",children:[c.jsx(Un,{className:"mr-2 h-4 w-4"})," ",e("converter.signInCsv")]})]}),c.jsx(Ot,{value:"ics",className:"mt-4",children:c.jsx(wr,{accept:".ics,text/calendar",label:e("converter.dropIcs"),description:e("converter.icsDesc"),onFile:ne,loading:!1,fileName:u,t:e})})]}),c.jsxs(iu,{children:[I&&c.jsxs(Ce.div,{initial:{opacity:0}
191,animate:{opacity:1},className:"flex items-center justify-center gap-3 py-8",children:[c.jsx(Or,{className:"h-6 w-6 text-primary animate-spin"}),c.jsx("span",{className:"text-muted-foreground font-body",children:j>0?e("converter.extractingEventsCount",{count:j}):e("converter.extractingAI")})]}),W&&c.jsxs(Ce.div,{initial:{opacity:0},animate:{opacity:1},className:"rounded-xl border border-yellow-500/30 bg-yellow-500/5 p-4",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(dp,{className:"h-5 w-5 text-yellow-600 shrink-0 mt-0.5"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:e("converter.quotaExceeded",{delivered:W.delivered,total:W.total})}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e("converter.upgradeForMore")})]})]}),c.jsxs(xe,{onClick:()=>{var C;return(C=document.getElementById("pricing"))==null?void 0:C.scrollIntoView({behavior:"smooth"})},className:"w-full mt-3 h-10 rounded-xl bg-primary text-primary-foreground font-body font-semibold text-sm hover:opacity-90 transition-opacity",children:[c.jsx(xo,{className:"mr-2 h-4 w-4"}),e("converter.getMoreEvents")]})]}),r.length>0&&c.jsxs(Ce.div,{initial:{opacity:0}
191,animate:{opacity:1},className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[c.jsx(Xf,{className:"h-4 w-4 text-primary"}),c.jsx("span",{children:e("converter.eventsFound",{count:r.length})})]}),c.jsxs(xe,{onClick:D,variant:"outline",className:"h-10 rounded-xl border-primary text-primary font-body font-semibold hover:bg-primary/5",children:[c.jsx(sp,{className:"mr-2 h-4 w-4"})," ",e("converter.downloadIcs")]})]}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:r.map((C,P)=>c.jsx(Zg,{event:C,index:P,onRemove:N,onUpdate:k},C.id))})]})]})]})}function hx(){const{t:n}=Ke(),e=[{icon:Mr,titleKey:"features.textPdfs",descKey:"features.textPdfsDesc"},{icon:Ja,titleKey:"features.imagesScreenshots",descKey:"features.imagesScreenshotsDesc"},{icon:vo,titleKey:"features.csvSpreadsheets",descKey:"features.csvSpreadsheetsDesc"},{icon:xo,titleKey:"features.instantConversion",descKey:"features.instantConversionDesc"},{icon:Ka,titleKey:"features.worksEverywhere",descKey:"features.worksEverywhereDesc"},{icon:cp,titleKey:"features.privateSecure",descKey:"features.privateSecureDesc"}];return c.jsxs("section",{id:"features",className:"py-20 border-t border-border",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsxs(Ce.h2,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"font-heading text-3xl md:text-4xl text-foreground",children:[n("features.title")," ",c.jsx("span",{className:"text-primary",children:n("features.titleHighlight")})]}),c.jsx(Ce.p,{initial:{opacity:0}
191,whileInView:{opacity:1},viewport:{once:!0},transition:{delay:.1},className:"mt-3 text-muted-foreground text-lg max-w-lg mx-auto",children:n("features.subtitle")})]}),c.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:e.map((t,r)=>{const s=t.icon;return c.jsxs(Ce.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:r*.08},className:"rounded-2xl border border-border bg-card p-6 hover:shadow-md transition-shadow",children:[c.jsx("div",{className:"rounded-xl bg-primary/10 p-2.5 w-fit mb-4",children:c.jsx(s,{className:"h-5 w-5 text-primary"})}),c.jsx("h3",{className:"font-heading text-lg text-foreground mb-2",children:n(t.titleKey)}),c.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n(t.descKey)})]},t.titleKey)})})]})}function fx(){const{t:n}=Ke(),e=Br(),{isAuthenticated:t}=uo(),r=_s(jt.stripe.createCheckoutSession),s=$r(),{toast:o}=mo(),[i,a]=f.useState(null),l=[{name:n("pricing.free"),price:n("pricing.freePrice"),period:n("pricing.freePeriod"),description:n("pricing.freeDesc"),icon:xo,events:n("pricing.freeCredits"),features:[n("pricing.freeFeature1"),n("pricing.freeFeature2"),n("pricing.freeFeature3")],cta:n("pricing.freeCta"),highlighted:!1,planType:null},{name:n("pricing.starter"),price:n("pricing.starterPrice"),period:n("pricing.starterPeriod"),description:n("pricing.starterDesc"),icon:Dr,events:n("pricing.starterCredits"),features:[n("pricing.starterFeature1"),n("pricing.starterFeature2"),n("pricing.starterFeature3"),n("pricing.starterFeature4")],cta:n("pricing.starterCta"),highlighted:!1,planType:"starter"},{name:n("pricing.pro"),price:n("pricing.proPrice"),period:n("pricing.proPeriod"),description:n("pricing.proDesc"),icon:rp,events:n("pricing.proCredits"),features:[n("pricing.proFeature1"),n("pricing.proFeature2"),n("pricing.proFeature3"),n("pricing.proFeature4")],cta:n("pricing.proCta"),highlighted:!0,planType:"pro"}],u=async h=>{if(!h){s(e("/login"));return}if(!t){s(e("/login"));return}a(h);try{const p=await r({planType:h});p?window.location.href=p:o({title:n("pricing.paymentError"),description:n("pricing.noCheckoutUrl"),variant:"destructive"})}catch(p){o({title:n("pricing.paymentError"),description:p.message||n("pricing.checkoutFailed"),variant:"destructive"})}finally{a(null)}};return c.jsxs("section",{id:"pricing",className:"py-20",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx(Ce.h2,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"font-heading text-3xl md:text-4xl text-foreground",children:n("pricing.title")}),c.jsx(Ce.p,{initial:{opacity:0}
191,whileInView:{opacity:1},viewport:{once:!0},transition:{delay:.1},className:"mt-3 text-muted-foreground text-lg",children:n("pricing.subtitle")})]}),c.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:l.map((h,p)=>{const g=h.icon,d=i===h.planType;return c.jsxs(Ce.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:p*.1},className:`relative flex flex-col rounded-2xl border p-6 transition-shadow hover:shadow-lg ${h.highlighted?"border-primary bg-primary/[0.03] shadow-md":"border-border bg-card"}`,children:[h.highlighted&&c.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-primary px-3 py-0.5 text-xs font-semibold text-primary-foreground",children:n("pricing.mostPopular")}),c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx("div",{className:`rounded-lg p-2 ${h.highlighted?"bg-primary/10":"bg-muted"}`,children:c.jsx(g,{className:`h-4 w-4 ${h.highlighted?"text-primary":"text-muted-foreground"}`})}),c.jsx("h3",{className:"font-heading text-xl text-foreground",children:h.name})]}),c.jsxs("div",{className:"mb-1",children:[c.jsx("span",{className:"font-heading text-3xl text-foreground",children:h.price}),c.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:h.period})]}),c.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:h.description}),c.jsx("p",{className:"text-sm font-semibold text-foreground mb-5",children:h.events}),c.jsx("ul",{className:"space-y-2.5 mb-6 flex-1",children:h.features.map(y=>c.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[c.jsx(Dr,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),c.jsx("span",{children:y})]},y))}),c.jsxs(xe,{onClick:()=>u(h.planType),disabled:d,className:`w-full rounded-xl h-11 font-body font-semibold ${h.highlighted?"bg-primary text-primary-foreground hover:opacity-90":"bg-foreground
191/5 text-foreground hover:bg-foreground/10"}`,children:[d&&c.jsx(Or,{className:"mr-2 h-4 w-4 animate-spin"}),h.cta]})]},h.name)})})]})}function px(){const{t:n}=Ke(),e=()=>{window.scrollTo({top:0,behavior:"smooth"})};return c.jsx("section",{className:"py-20 border-t border-border",children:c.jsxs(Ce.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"text-center max-w-2xl mx-auto",children:[c.jsx("div",{className:"flex items-center justify-center gap-2 mb-4",children:c.jsx(nr,{className:"h-6 w-6 text-primary"})}),c.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground mb-4",children:n("cta.title")}),c.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:n("cta.subtitle")}),c.jsxs(xe,{onClick:e,className:"h-12 px-8 rounded-xl bg-primary text-primary-foreground font-body font-semibold text-base hover:opacity-90 transition-opacity",children:[n("cta.button"),c.jsx(Jf,{className:"ml-2 h-4 w-4"})]}),c.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:n("cta.note")})]})})}const dn="https://text2ics.cc",mx=`${dn}/og-image.png`;function gx({title:n,description:e,canonicalPath:t,ogImage:r=mx,noindex:s=!1,jsonLd:o}){const i=wo(),a=`${dn}/${i}${t}`,l=o?Array.isArray(o)?o:[o]:[],u=t.split("/").filter(Boolean),h=[{name:"Home",item:`${dn}/${i}`}];u.length>0&&(u[0]==="blog"&&u.length>1&&h.push({name:"Blog",item:`${dn}/${i}/blog`}),h.push({name:n.replace(" â Text2ICS",""),item:a}));const p=u.length>0?{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:h.map((d,y)=>({"@type":"ListItem",position:y+1,name:d.name,item:d.item}))}:null,g=p?[...l,p]:l;return c.jsxs(_h,{children:[c.jsx("html",{lang:i}),c.jsx("title",{children:n}),c.jsx("meta",{name:"description",content:e}),c.jsx("link",{rel:"canonical",href:a}),s&&c.jsx("meta",{name:"robots",content:"noindex, nofollow"}),An.map(d=>c.jsx("link",{rel:"alternate",hrefLang:d,href:`${dn}/${d}${t}`},d)),c.jsx("link",{rel:"alternate",hrefLang:"x-default",href:`${dn}/en${t}`}),c.jsx("meta",{property:"og:title",content:n}),c.jsx("meta",{property:"og:description",content:e}),c.jsx("meta",{property:"og:url",content:a}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{property:"og:image",content:r}),c.jsx("meta",{property:"og:locale",content:i.replace("-","_")}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:n}),c.jsx("meta",{name:"twitter:description",content:e}),c.jsx("meta",{name:"twitter:image",content:r}),g.map((d,y)=>c.jsx("script",{type:"application/ld+json",children:JSON.stringify(d)},y))]})}function yx(){const{t:n}=Ke(),e=Br(),t=[{name:n("nav.textToIcs"),path:e("/text-to-ics")},{name:n("nav.pdfToIcs"),path:e("/pdf-to-ics")},{name:n("nav.csvToIcs"),path:e("/csv-to-ics")},{name:n("nav.imageToCalendar"),path:e("/image-to-calendar")},{name:n("nav.icsViewer"),path:e("/ics-viewer")},{name:n("nav.emailToIcs"),path:e("/email-to-ics")}],r=[{name:n("nav.howItWorks"),path:e("/how-it-works")},{name:n("nav.compare"),path:e("/compare")},{name:n("nav.blog"),path:e("/blog")},{name:n("footer.changelog"),path:e("/changelog")},{name:n("nav.howToCreateIcs"),path:e("/how-to-create-an-ics-file")},{name:n("nav.icsForGoogleCalendar"),path:e("/ics-for-google-calendar")},{name:n("nav.chromeExtension"),path:e("/chrome-extension")}];return c.jsx("footer",{className:"border-t border-border py-10",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("div",{className:"grid gap-8 sm:grid-cols-2 lg:grid-cols-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx(nr,{className:"h-4 w-4 text-primary"}),c.jsx("span",{className:"font-heading text-foreground",children:"Text2ICS"})]}),c.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("footer.brand")})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-body font-semibold text-foreground text-sm mb-3",children:n("footer.tools")}),c.jsx("ul",{className:"space-y-2",children:t.map(s=>c.jsx("li",{children:c.jsx(Re,{to:s.path,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:s.name})},s.path))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-body font-semibold text-foreground text-sm mb-3",children:n("footer.resources")}),c.jsx("ul",{className:"space-y-2",children:r.map(s=>c.jsx("li",{children:c.jsx(Re,{to:s.path,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:s.name})},s.path))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-body font-semibold text-foreground text-sm mb-3",children:n("footer.support")}),c.jsxs("ul",{className:"space-y-2",children:[c.jsx("li",{children:c.jsx(Re,{to:`${e("/feedback")}?type=feedback`,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:n("footer.feedback")})}),c.jsx("li",{children:c.jsx(Re,{to:`${e("/feedback")}?type=bug`,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:n("footer.reportBug")})}),c.jsx("li",{children:c.jsx(Re,{to:`${e("/feedback")}?type=feature`,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:n("footer.requestFeature")})}),c.jsx("li",{className:"pt-2 border-t border-border",children:c.jsx(Re,{to:e("/privacy"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:n("footer.privacyPolicy")})}),c.jsx("li",{children:c.jsx(Re,{to:e("/privacy"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:n("footer.termsOfService")})})]})]})]}),c.jsx("div",{className:"mt-8 pt-6 border-t border-border",children:c.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[c.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[c.jsx(np,{className:"h-3.5 w-3.5"}),n("footer.chromeExtensions")]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("a",{href:"https://chromewebstore.google.com/detail/text2ics-text-to-calendar/fmnpnmiibabkdknoeoioknonhfgkbojn",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:"Text2ICS â Text to Calendar"}),c.jsx("a",{href:"https://chromewebstore.google.com/detail/calpalette-add-more-color/pnomieafpanmioibkgjgpccijpoefbmf",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:"CalPalette â Google Calendar Colors"})]})]})}),c.jsx("div",{className:"mt-4 text-center text-xs text-muted-foreground",children:n("footer.copyright",{year:new Date().getFullYear()})})]})})}const vx=()=>{const{t:n}=Ke();return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(gx,{title:n("index.seoTitle"),description:n("index.seoDesc"),canonicalPath:"/",jsonLd:[{"@context":"https://schema.org","@type":"WebApplication",name:"Text2ICS",url:"https://text2ics.cc",applicationCategory:"UtilityApplication",operatingSystem:"Web",description:"Convert text, PDFs, images, and CSVs into downloadable .ics calendar files.",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}},{"@context":"https://schema.org","@type":"Organization",name:"Text2ICS",url:"https://text2ics.cc"}]}),c.jsx(Jm,{}),c.jsxs("main",{className:"container mx-auto px-4",children:[c.jsxs("section",{className:"py-16 md:py-24 space-y-12",children:[c.jsx(Zm,{}),c.jsx(dx,{})]}),c.jsx(hx,{}),c.jsx(fx,{}),c.jsx(px,{})]}),c.jsx(yx,{})]})},xx=f.lazy(()=>J(()=>import("./HowItWorks-BG9ctBOI.js"),__vite__mapDeps([0,1,2,3,4,5]))),bx=f.lazy(()=>J(()=>import("./ComparePage-DyCDoYyZ.js"),__vite__mapDeps([6,1,2,3]))),wx=f.lazy(()=>J(()=>import("./LoginPage-Bx0PgCfR.js"),__vite__mapDeps([7,1,2,3]))),Tx=f.lazy(()=>J(()=>import("./DashboardPage-Dw1brTw_.js"),__vite__mapDeps([8,1,2,3]))),Sx=f.lazy(()=>J(()=>import("./NotFound-CFXCBwaE.js"),__vite__mapDeps([9,1,2,3]))),Cx=f.lazy(()=>J(()=>import("./TextToIcsPage-BP1XzAI7.js"),__vite__mapDeps([10,1,2,11,3,4]))),Ex=f.lazy(()=>J(()=>import("./PdfToIcsPage-BOyA8Qpm.js"),__vite__mapDeps([12,1,2,11,3,4]))),kx=f.lazy(()=>J(()=>import("./CsvToIcsPage-BVOXFfI9.js"),__vite__mapDeps([13,1,2,11,3,4]))),Ax=f.lazy(()=>J(()=>import("./ImageToCalendarPage-DMvhw3B1.js"),__vite__mapDeps([14,1,2,11,3,4]))),Rx=f.lazy(()=>J(()=>import("./IcsViewerPage-CHzSOC3X.js"),__vite__mapDeps([15,1,2,11,3,4]))),Ix=f.lazy(()=>J(()=>import("./EmailToIcsPage-Ds-IRIsV.js"),__vite__mapDeps([16,1,2,11,3,4]))),Px=f.lazy(()=>J(()=>import("./BirthdayListToCalendarPage-Zcf9B0A6.js"),__vite__mapDeps([17,1,2,11,3,4]))),Nx=f.lazy(()=>J(()=>import("./MeetingNotesToCalendarPage-D1YAn_Ep.js"),__vite__mapDeps([18,1,2,11,3,4]))),Dx=f.lazy(()=>J(()=>import("./IcsForGoogleCalendarPage-0iRCmY4k.js"),__vite__mapDeps([19,1,2,20,3,4]))),Mx=f.lazy(()=>J(()=>import("./HowToCreateIcsFilePage-NjEaNCrF.js"),__vite__mapDeps([21,1,2,20,3]))),Ox=f.lazy(()=>J(()=>
191import("./IcsFileNotImportingPage-BQs-MuTq.js"),__vite__mapDeps([22,1,2,20,3,4]))),_x=f.lazy(()=>J(()=>import("./ChromeExtensionPage-R_nEY_XP.js"),__vite__mapDeps([23,1,2,3,5]))),jx=f.lazy(()=>J(()=>import("./BlogIndex-Ba-hsCLp.js"),__vite__mapDeps([24,1,2,25,3]))),Fx=f.lazy(()=>J(()=>import("./BlogPost-DaoJ3o2_.js"),__vite__mapDeps([26,1,2,25,3]))),$x=f.lazy(()=>J(()=>import("./ChangelogPage-DscTsP6t.js"),__vite__mapDeps([27,1,2,3]))),Lx=f.lazy(()=>J(()=>import("./FeedbackPage-Dm_V6xAJ.js"),__vite__mapDeps([28,1,2,3,4]))),Ux=f.lazy(()=>J(()=>import("./PrivacyPage-wnPrL6wn.js"),__vite__mapDeps([29,1,2,3]))),qx=new af;function Vx(){const{locale:n}=pa(),{i18n:e}=Ke(),t=tr(),[r,s]=f.useState(n==="en"),o=n&&An.includes(n);return f.useEffect(()=>{!o||!n||zm(n).then(()=>{e.language!==n&&e.changeLanguage(n),s(!0)})},[n,o,e]),o?r?c.jsx(uu,{}):null:c.jsx(oo,{to:`/en${t.search}${t.hash}`,replace:!0})}function Bx(){const n=tr();return c.jsx(oo,{to:`/en${n.search}${n.hash}`,replace:!0})}function Qx(){const n=tr();return c.jsx(oo,{to:`/en${n.search}${n.hash}`,replace:!0})}const Wx=()=>c.jsx(lf,{client:qx,children:c.jsxs(Gp,{children:[c.jsx(Yp,{}),c.jsx(qf,{}),c.jsx(cu,{children:c.jsx(f.Suspense,{fallback:null,children:c.jsxs(lu,{children:[c.jsx(se,{path:"/",element:c.jsx(Bx,{})}),c.jsxs(se,{path:"/:locale",element:c.jsx(Vx,{}),children:[c.jsx(se,{index:!0,element:c.jsx(vx,{})}),c.jsx(se,{path:"how-it-works",element:c.jsx(xx,{})}),c.jsx(se,{path:"compare",element:c.jsx(bx,{})}),c.jsx(se,{path:"login",element:c.jsx(wx,{})}),c.jsx(se,{path:"dashboard",element:c.jsx(Tx,{})}),c.jsx(se,{path:"text-to-ics",element:c.jsx(Cx,{})}),c.jsx(se,{path:"pdf-to-ics",element:c.jsx(Ex,{})}),c.jsx(se,{path:"csv-to-ics",element:c.jsx(kx,{})}),c.jsx(se,{path:"image-to-calendar",element:c.jsx(Ax,{})}),c.jsx(se,{path:"ics-viewer",element:c.jsx(Rx,{})}),c.jsx(se,{path:"email-to-ics",element:c.jsx(Ix,{})}),c.jsx(se,{path:"birthday-list-to-calendar",element:c.jsx(Px,{})}),c.jsx(se,{path:"meeting-notes-to-calendar",element:c.jsx(Nx,{})}),c.jsx(se,{path:"ics-for-google-calendar",element:c.jsx(Dx,{})}),c.jsx(se,{path:"how-to-create-an-ics-file",element:c.jsx(Mx,{})}),c.jsx(se,{path:"ics-file-not-importing",element:c.jsx(Ox,{})}),c.jsx(se,{path:"chrome-extension",element:c.jsx(_x,{})}),c.jsx(se,{path:"blog",element:c.jsx(jx,{})}),c.jsx(se,{path:"blog/:slug",element:c.jsx(Fx,{})}),c.jsx(se,{path:"changelog",element:c.jsx($x,{})}),c.jsx(se,{path:"feedback",element:c.jsx(Lx,{})}),c.jsx(se,{path:"privacy",element:c.jsx(Ux,{})}),c.jsx(se,{path:"*",element:c.jsx(Sx,{})})]}),c.jsx(se,{path:"*",element:c.jsx(Qx,{})})]})})})]})}),zx=new Od("https://hearty-newt-279.convex.cloud");ma(document.getElementById("root")).render(c.jsx(La,{children:c.jsx(oh,{client:zx,children:c.jsx(Wx,{})})}));export{Jf as A,xe as B,px as C,sp as D,yx as F,Or as L,Jm as N,gx as S,dp as T,Za as X,xo as Z,lp as a,Dr as b,Z as c,uo as d,Jx as e,nr as f,Os as g,jt as h,Fd as i,vi as j,ty as k,wo as l,dx as m,np as n,cp as o,mo as p,zs as q,Br as u};
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.