tempest.games 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/app/assets/{index-Bdrp8zDN.js → index-CMk_4lqk.js} +3 -3
- package/app/index.html +1 -1
- package/bin/backend.bun.js +1 -1
- package/bin/backend.worker.game.bun.js +2 -2
- package/bin/backend.worker.tribunal.bun.js +29 -29
- package/bin/frontend.bun.js +8 -8
- package/package.json +5 -5
|
@@ -6,7 +6,7 @@ var zv=Object.defineProperty;var Uv=(s,n,i)=>n in s?zv(s,n,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Gy;function jv(){if(Gy)return Hl;Gy=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(u,c,f){var h=null;if(f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),"key"in c){f={};for(var y in c)y!=="key"&&(f[y]=c[y])}else f=c;return c=f.ref,{$$typeof:s,type:u,key:h,ref:c!==void 0?c:null,props:f}}return Hl.Fragment=n,Hl.jsx=i,Hl.jsxs=i,Hl}var Xy;function Bv(){return Xy||(Xy=1,io.exports=jv()),io.exports}var q=Bv();function mm(s=Math.random){return s().toString(36).slice(2)}class go extends Promise{constructor(i){let u,c;super((f,h)=>{u=f,c=h});j(this,"fate");j(this,"resolve");j(this,"reject");j(this,"done",!1);this.resolve=u,this.reject=c,this.use(i instanceof Promise?i:new Promise(i))}pass(i,u){i===this.fate&&(this.resolve(u),this.done=!0)}fail(i,u){i===this.fate&&(this.reject(u),this.done=!0)}use(i){if(i instanceof Promise){const u=i;this.fate=u,u.then(c=>{this.pass(u,c)},c=>{this.fail(u,c)})}else this.resolve(i),this.fate=void 0}}function pm(s){return Object.entries(s)}const qv=(s,n,i=et.STORE)=>Am(i,{key:`${s.key}:JSON`,get:({get:u})=>n.toJson(u(s)),set:({set:u},c)=>{u(s,n.fromJson(c))}});function re(s){for(;s.child!==null;)s=s.child;return s}class We{constructor(){j(this,"Subscriber");j(this,"subscribers",new Map)}subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){const i=this.subscribers.values();for(const u of i)u(n)}}class Zv extends We{constructor(i){super();j(this,"state");this.state=i}next(i){this.state=i,super.next(i)}}function Uo(s,n,i){const u={key:n.key,type:"atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","atom_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=n.default,Q={key:w,default:U instanceof Function?U(p):U};n.effects&&(Q.effects=n.effects(p));const L=Yu(C,Q,S);return f.next({type:"state_creation",token:L}),L},u,{subject:f,install:p=>Uo(p,n),internalRoles:i});return s.families.set(n.key,y),s.defaults.set(n.key,n.default),u}function Ni(s,n,i){const u={key:n.key,type:"readonly_selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","readonly_selector_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=Ko(C,{key:w,get:n.get(p)},S);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Ni(p,n),default:p=>n.get(p)({get:(...S)=>Wt(s,...S),find:(...S)=>pt(s,...S),json:S=>$a(s,S)})});return s.families.set(n.key,y),u}function Hv(s,n){return"set"in n?Go(s,n):Ni(s,n)}class jo{constructor(n){j(this,"_buffer");j(this,"_index",0);let i;typeof n=="number"?i=n:i=n.length,this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){const n=new jo([...this._buffer]);return n._index=this._index,n}}const Vv={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function Lv(s,n){const i=Ke(n),u=`${s.key}(${i})`,c=Vv[s.type],f={key:u,type:c};return Object.assign(f,{family:{key:s.key,subKey:i}}),Object.assign(f,{counterfeit:!0}),f}function Ui(s){const n={key:s.key,type:s.type};return"family"in s&&(n.family=s.family),n}function Bt(s){return Vb(et.STORE,s)}function vo(...s){return s.length===2?Wt(et.STORE,...s):Wt(et.STORE,...s)}function Kv(s,n,i=et.STORE){return i.joins.set(s.key,new xm(s,n,i)),{key:s.key,type:"join",a:s.between[0],b:s.between[1],cardinality:s.cardinality}}function Yv(s){return Kb(s,et.STORE)}const lo=s=>(n,i,u,c,...f)=>{console[s](`${n} ${i} "${u}" ${c}`,...f)},Gv={error:lo("error"),info:lo("info"),warn:lo("warn")};class Xv{constructor(n,i,u=Gv){j(this,"error",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!==null&&this.logger.error(...n)});j(this,"info",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel==="info"&&this.logger.info(...n)});j(this,"warn",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!=="error"&&this.logLevel!==null&&this.logger.warn(...n)});this.logLevel=n,this.filter=i,this.logger=u}}class $v{constructor(n=et.STORE){j(this,"store");this.store=n,ub("root",n)}allocate(n,i,u){return cs(this.store,n,i,u)}fuse(n,i,u){return rb(this.store,n,i,u)}deallocate(n){os(this.store,n)}claim(n,i,u){return zu(this.store,n,i,u)}}class Qv{constructor(n=et.STORE){j(this,"store");j(this,"realm");this.store=n,this.realm=new $v(n)}allocate(n,i,u){cs(this.store,n,i,u)}deallocate(n){os(this.store,n)}claim(n,i,u){zu(this.store,n,i,u)}}function Xa(s){return Am(et.STORE,s)}function Jv(s){return Hv(et.STORE,s)}function Bo(...s){s.length===2?Ie(et.STORE,...s):Ie(et.STORE,...s)}function rn(s){return"epoch"in s.transactionMeta}function gt(s){return"phase"in s.transactionMeta}const Fv=s=>{const n=re(s);if(!gt(n)){s.logger.warn("🐞","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}s.logger.info("🪂","transaction",n.transactionMeta.update.key,"Aborting transaction"),n.parent.child=null};function zt(s){return s[0].toUpperCase()+s.slice(1)}function rs(s){return s.type.split("_").map(zt).join(" ")}class qo extends Error{constructor(n,i){super(`${rs(n)} ${Ke(n.key)} not found in store "${i.config.name}".`)}}function Zo(s,n,i){return(...u)=>{const c=rt(s,n);if(c)return c.run(u,i);throw new qo(n,s)}}const gm=s=>n=>s instanceof Function?s(n):s,Lu=(s,n)=>{if(s.valueMap.has(n.key))return s.logger.info("📖",n.type,n.key,"reading cached value"),Bb(n,s);if(n.type==="selector"||n.type==="readonly_selector")return s.logger.info("🧮",n.type,n.key,"computing value"),n.get();const i=n.default instanceof Function?n.default():n.default;return s.logger.info("💁","atom",n.key,"could not find cached value; using default",i),n.default instanceof Function?n.default():n.default},Wv=(s,n)=>{if(s.operation.open){const i=performance.now();return s.logger.info("❗",n.type,n.key,`deferring setState at T-${i} until setState for "${s.operation.token.key}" is done`),i}s.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:n},s.logger.info("⭕",n.type,n.key,`operation start in store "${s.config.name}"${gt(s)?` ${s.transactionMeta.phase} "${s.transactionMeta.update.key}"`:""}`)},Iv=s=>{s.operation.open&&s.logger.info("🔴",s.operation.token.type,s.operation.token.key,`operation done in store "${s.config.name}"`),s.operation={open:!1},s.on.operationClose.next(s.operation)},Pv=(s,n)=>s.operation.open?s.operation.done.has(n):(s.logger.error("🐞","unknown",n,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Ho=(s,n)=>{if(!s.operation.open){s.logger.error("🐞","unknown",n,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}s.operation.done.add(n)},eb=(s,n,i)=>{switch(n.type){case"mutable_atom":s.logger.info("📢",n.type,n.key,"is now (",i.newValue,") subscribers:",n.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":s.logger.info("📢",n.type,n.key,"went (",i.oldValue,"->",i.newValue,") subscribers:",n.subject.subscribers)}n.subject.next(i)},$y=(s,n)=>{const i=re(s),u=i.selectorAtoms.getRelatedKeys(n.key);if(i.logger.info("🧹",n.type,n.key,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){i.operation.open&&i.logger.info("🧹",n.type,n.key,`[ ${[...i.operation.done].join(", ")} ] already done`);for(const c of u)Pv(i,c)||(qb(c,i),Ho(i,c))}};function tb(s,n){return!(jb(n.newValue)||s.includes("🔍"))}const nb=(s,n,i)=>{const{key:u}=n,c=re(s);if(!gt(c)||c.transactionMeta.phase!=="building"){s.logger.error("🐞","atom",u,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!tb(u,i))return;const h={type:"atom_update",key:u,...i};n.family&&(h.family=n.family),c.transactionMeta.update.updates.push(h),s.logger.info("📁","atom",u,"stowed (",i.oldValue,"->",i.newValue,")")},ab=(s,n,i)=>{const u=Lu(i,s);let c=u;if(s.type==="mutable_atom"&>(i)){const{parent:h}=i;c=_o(i,s,h)}c=gm(n)(c),i.logger.info("📝","atom",s.key,"set to",c),c=La(i,s.key,c,s.subject),Zb(i,s.key)&&Hb(i,s.key),Ho(i,s.key),$y(i,s);const f={oldValue:u,newValue:c};if(rn(i))eb(i,s,f);else if(i.parent){if(i.on.transactionApplying.state===null)nb(i,s,f);else if(s.key.startsWith("*")){const h=s.key.slice(1),y=i.atoms.get(h);let p=i.valueMap.get(h);if(y.type==="mutable_atom"&>(i)){const{parent:S}=i;p=_o(i,y,S)}p.do(f.newValue)===null&&$y(i,y)}}},vm=(s,n,i)=>{switch(n.type){case"atom":case"mutable_atom":ab(n,i,s);break;case"selector":n.set(i);break}};function ib(s,n){if(n.family){const i=s.families.get(n.family.key);if(i)return i}}function Ie(s,...n){let i,u,c,f;if(n.length===2?(i=n[0],f=n[1],u=ib(s,i)??null,u&&(c=i.family?Vi(i.family.subKey):null,i=pt(s,u,c))):(u=n[0],c=n[1],f=n[2],i=pt(s,u,c)),"counterfeit"in i&&"family"in i){const p=i.family.subKey,g=s.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===p);s.logger.error("❌",i.type,i.key,`could not be set because it was not found in the store "${s.config.name}".`,g?`This state was previously disposed:
|
|
9
|
+
*/var Gy;function jv(){if(Gy)return Hl;Gy=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(u,c,f){var h=null;if(f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),"key"in c){f={};for(var y in c)y!=="key"&&(f[y]=c[y])}else f=c;return c=f.ref,{$$typeof:s,type:u,key:h,ref:c!==void 0?c:null,props:f}}return Hl.Fragment=n,Hl.jsx=i,Hl.jsxs=i,Hl}var Xy;function Bv(){return Xy||(Xy=1,io.exports=jv()),io.exports}var q=Bv();function mm(s=Math.random){return s().toString(36).slice(2)}class go extends Promise{constructor(i){let u,c;super((f,h)=>{u=f,c=h});j(this,"fate");j(this,"resolve");j(this,"reject");j(this,"done",!1);this.resolve=u,this.reject=c,this.use(i instanceof Promise?i:new Promise(i))}pass(i,u){i===this.fate&&(this.resolve(u),this.done=!0)}fail(i,u){i===this.fate&&(this.reject(u),this.done=!0)}use(i){if(i instanceof Promise){const u=i;this.fate=u,u.then(c=>{this.pass(u,c)},c=>{this.fail(u,c)})}else this.resolve(i),this.fate=void 0}}function pm(s){return Object.entries(s)}const qv=(s,n,i=et.STORE)=>Am(i,{key:`${s.key}:JSON`,get:({get:u})=>n.toJson(u(s)),set:({set:u},c)=>{u(s,n.fromJson(c))}});function re(s){for(;s.child!==null;)s=s.child;return s}class We{constructor(){j(this,"Subscriber");j(this,"subscribers",new Map)}subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){const i=this.subscribers.values();for(const u of i)u(n)}}class Zv extends We{constructor(i){super();j(this,"state");this.state=i}next(i){this.state=i,super.next(i)}}function Uo(s,n,i){const u={key:n.key,type:"atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","atom_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=n.default,Q={key:w,default:U instanceof Function?U(p):U};n.effects&&(Q.effects=n.effects(p));const L=Yu(C,Q,S);return f.next({type:"state_creation",token:L}),L},u,{subject:f,install:p=>Uo(p,n),internalRoles:i});return s.families.set(n.key,y),s.defaults.set(n.key,n.default),u}function Ni(s,n,i){const u={key:n.key,type:"readonly_selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","readonly_selector_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=Ko(C,{key:w,get:n.get(p)},S);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Ni(p,n),default:p=>n.get(p)({get:(...S)=>Wt(s,...S),find:(...S)=>pt(s,...S),json:S=>$a(s,S)})});return s.families.set(n.key,y),u}function Hv(s,n){return"set"in n?Go(s,n):Ni(s,n)}class jo{constructor(n){j(this,"_buffer");j(this,"_index",0);let i;typeof n=="number"?i=n:i=n.length,this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){const n=new jo([...this._buffer]);return n._index=this._index,n}}const Vv={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function Lv(s,n){const i=Ke(n),u=`${s.key}(${i})`,c=Vv[s.type],f={key:u,type:c};return Object.assign(f,{family:{key:s.key,subKey:i}}),Object.assign(f,{counterfeit:!0}),f}function Ui(s){const n={key:s.key,type:s.type};return"family"in s&&(n.family=s.family),n}function Bt(s){return Vb(et.STORE,s)}function vo(...s){return s.length===2?Wt(et.STORE,...s):Wt(et.STORE,...s)}function Kv(s,n,i=et.STORE){return i.joins.set(s.key,new xm(s,n,i)),{key:s.key,type:"join",a:s.between[0],b:s.between[1],cardinality:s.cardinality}}function Yv(s){return Kb(s,et.STORE)}const lo=s=>(n,i,u,c,...f)=>{console[s](`${n} ${i} "${u}" ${c}`,...f)},Gv={error:lo("error"),info:lo("info"),warn:lo("warn")};class Xv{constructor(n,i,u=Gv){j(this,"logLevel");j(this,"filter");j(this,"logger");j(this,"error",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!==null&&this.logger.error(...n)});j(this,"info",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel==="info"&&this.logger.info(...n)});j(this,"warn",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!=="error"&&this.logLevel!==null&&this.logger.warn(...n)});this.logLevel=n,this.filter=i,this.logger=u}}class $v{constructor(n=et.STORE){j(this,"store");this.store=n,ub("root",n)}allocate(n,i,u){return cs(this.store,n,i,u)}fuse(n,i,u){return rb(this.store,n,i,u)}deallocate(n){os(this.store,n)}claim(n,i,u){return zu(this.store,n,i,u)}}class Qv{constructor(n=et.STORE){j(this,"store");j(this,"realm");this.store=n,this.realm=new $v(n)}allocate(n,i,u){cs(this.store,n,i,u)}deallocate(n){os(this.store,n)}claim(n,i,u){zu(this.store,n,i,u)}}function Xa(s){return Am(et.STORE,s)}function Jv(s){return Hv(et.STORE,s)}function Bo(...s){s.length===2?Ie(et.STORE,...s):Ie(et.STORE,...s)}function rn(s){return"epoch"in s.transactionMeta}function gt(s){return"phase"in s.transactionMeta}const Fv=s=>{const n=re(s);if(!gt(n)){s.logger.warn("🐞","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}s.logger.info("🪂","transaction",n.transactionMeta.update.key,"Aborting transaction"),n.parent.child=null};function zt(s){return s[0].toUpperCase()+s.slice(1)}function rs(s){return s.type.split("_").map(zt).join(" ")}class qo extends Error{constructor(n,i){super(`${rs(n)} ${Ke(n.key)} not found in store "${i.config.name}".`)}}function Zo(s,n,i){return(...u)=>{const c=rt(s,n);if(c)return c.run(u,i);throw new qo(n,s)}}const gm=s=>n=>s instanceof Function?s(n):s,Lu=(s,n)=>{if(s.valueMap.has(n.key))return s.logger.info("📖",n.type,n.key,"reading cached value"),Bb(n,s);if(n.type==="selector"||n.type==="readonly_selector")return s.logger.info("🧮",n.type,n.key,"computing value"),n.get();const i=n.default instanceof Function?n.default():n.default;return s.logger.info("💁","atom",n.key,"could not find cached value; using default",i),n.default instanceof Function?n.default():n.default},Wv=(s,n)=>{if(s.operation.open){const i=performance.now();return s.logger.info("❗",n.type,n.key,`deferring setState at T-${i} until setState for "${s.operation.token.key}" is done`),i}s.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:n},s.logger.info("⭕",n.type,n.key,`operation start in store "${s.config.name}"${gt(s)?` ${s.transactionMeta.phase} "${s.transactionMeta.update.key}"`:""}`)},Iv=s=>{s.operation.open&&s.logger.info("🔴",s.operation.token.type,s.operation.token.key,`operation done in store "${s.config.name}"`),s.operation={open:!1},s.on.operationClose.next(s.operation)},Pv=(s,n)=>s.operation.open?s.operation.done.has(n):(s.logger.error("🐞","unknown",n,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Ho=(s,n)=>{if(!s.operation.open){s.logger.error("🐞","unknown",n,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}s.operation.done.add(n)},eb=(s,n,i)=>{switch(n.type){case"mutable_atom":s.logger.info("📢",n.type,n.key,"is now (",i.newValue,") subscribers:",n.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":s.logger.info("📢",n.type,n.key,"went (",i.oldValue,"->",i.newValue,") subscribers:",n.subject.subscribers)}n.subject.next(i)},$y=(s,n)=>{const i=re(s),u=i.selectorAtoms.getRelatedKeys(n.key);if(i.logger.info("🧹",n.type,n.key,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){i.operation.open&&i.logger.info("🧹",n.type,n.key,`[ ${[...i.operation.done].join(", ")} ] already done`);for(const c of u)Pv(i,c)||(qb(c,i),Ho(i,c))}};function tb(s,n){return!(jb(n.newValue)||s.includes("🔍"))}const nb=(s,n,i)=>{const{key:u}=n,c=re(s);if(!gt(c)||c.transactionMeta.phase!=="building"){s.logger.error("🐞","atom",u,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!tb(u,i))return;const h={type:"atom_update",key:u,...i};n.family&&(h.family=n.family),c.transactionMeta.update.updates.push(h),s.logger.info("📁","atom",u,"stowed (",i.oldValue,"->",i.newValue,")")},ab=(s,n,i)=>{const u=Lu(i,s);let c=u;if(s.type==="mutable_atom"&>(i)){const{parent:h}=i;c=_o(i,s,h)}c=gm(n)(c),i.logger.info("📝","atom",s.key,"set to",c),c=La(i,s.key,c,s.subject),Zb(i,s.key)&&Hb(i,s.key),Ho(i,s.key),$y(i,s);const f={oldValue:u,newValue:c};if(rn(i))eb(i,s,f);else if(i.parent){if(i.on.transactionApplying.state===null)nb(i,s,f);else if(s.key.startsWith("*")){const h=s.key.slice(1),y=i.atoms.get(h);let p=i.valueMap.get(h);if(y.type==="mutable_atom"&>(i)){const{parent:S}=i;p=_o(i,y,S)}p.do(f.newValue)===null&&$y(i,y)}}},vm=(s,n,i)=>{switch(n.type){case"atom":case"mutable_atom":ab(n,i,s);break;case"selector":n.set(i);break}};function ib(s,n){if(n.family){const i=s.families.get(n.family.key);if(i)return i}}function Ie(s,...n){let i,u,c,f;if(n.length===2?(i=n[0],f=n[1],u=ib(s,i)??null,u&&(c=i.family?Vi(i.family.subKey):null,i=pt(s,u,c))):(u=n[0],c=n[1],f=n[2],i=pt(s,u,c)),"counterfeit"in i&&"family"in i){const p=i.family.subKey,g=s.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===p);s.logger.error("❌",i.type,i.key,`could not be set because it was not found in the store "${s.config.name}".`,g?`This state was previously disposed:
|
|
10
10
|
${g.trace}`:"No previous disposal trace was found.");return}const h=Wv(s,i);if(h){const p=s.on.operationClose.subscribe(`waiting to set "${i.key}" at T-${h}`,()=>{p(),s.logger.info("🟢",i.type,i.key,`resuming deferred setState from T-${h}`),Ie(s,i,f)});return}const y=rt(s,i);vm(s,y,f),Iv(s)}function lb(s,n,i){const{key:u,newValue:c,oldValue:f}=n,h=s==="newValue"?c:f,y={key:u,type:"atom"};n.family&&Object.assign(y,{family:n.family}),Ie(i,y,h)}function sb(s){var i,u;const{stack:n}=s;return n?`
|
|
11
11
|
`+((u=(i=n.split(`
|
|
12
12
|
`))==null?void 0:i.slice(1))==null?void 0:u.join(`
|
|
@@ -19,7 +19,7 @@ ${U.trace}`:`No previous disposal trace for ${i} was found.`);return}const c=s.m
|
|
|
19
19
|
${C.trace}`:`No previous disposal trace for ${c} was found.`),i}const y=Ke(n),p=f.molecules.get(y);if(!p){const C=s.disposalTraces.buffer.find(U=>(U==null?void 0:U.key)===y);return s.logger.error("❌","molecule",i,"claim failed:",`Could not allocate to ${y} in store "${s.config.name}".`,C?`
|
|
20
20
|
${y} was most recently disposed
|
|
21
21
|
${C.trace}`:`No previous disposal trace for ${y} was found.`),i}const g=s.moleculeGraph.getRelationEntries({downstreamMoleculeKey:h.stringKey}).filter(([,{source:C}])=>C!==c).map(([C])=>Vi(C));u&&f.moleculeGraph.delete(c),f.moleculeGraph.set({upstreamMoleculeKey:p.stringKey,downstreamMoleculeKey:h.stringKey},{source:p.stringKey});const S={type:"molecule_transfer",key:h.key,from:g,to:[p.key]};return gt(f)&&f.transactionMeta.phase==="building"&&f.transactionMeta.update.updates.push(S),i}function cb(s,n,i){switch(n){case"newValue":{bm(s,i);break}case"oldValue":{Ku(i,s.token);break}}}function ob(s,n,i){switch(n){case"newValue":{Ku(i,s.token);break}case"oldValue":{bm(s,i),s.subType==="atom"&&i.valueMap.set(s.token.key,s.value);break}}}function bm(s,n){const{family:i}=s.token;if(i){const u=n.families.get(i.key);u&&pt(n,u,Vi(i.subKey))}}function fb(s,n,i){switch(n){case"newValue":cs(i,s.provenance,s.key);break;case"oldValue":os(i,s.key);break}}function db(s,n,i){switch(n){case"newValue":os(i,s.key);break;case"oldValue":{const u=s.provenance.map(Vi);cs(i,u,s.key);for(const[c,f]of s.values){const h=i.families.get(c);if(h){pt(i,h,s.key);const y=`${c}(${Ke(s.key)})`;i.valueMap.set(y,f)}}}break}}function hb(s,n,i){switch(n){case"newValue":{const u=s.to.length===1?s.to[0]:s.to;zu(i,u,s.key,"exclusive")}break;case"oldValue":{const u=s.from.length===1?s.from[0]:s.from;zu(i,u,s.key,"exclusive")}break}}function Ci(s,n,i){const u=s==="newValue"?n.updates:[...n.updates].reverse();for(const c of u)switch(c.type){case"atom_update":case"selector_update":lb(s,c,i);break;case"state_creation":cb(c,s,i);break;case"state_disposal":ob(c,s,i);break;case"molecule_creation":fb(c,s,i);break;case"molecule_disposal":db(c,s,i);break;case"molecule_transfer":hb(c,s,i);break;case"transaction_update":Ci(s,c,i);break}}function Vo(s,n,i){rn(s)&&n&&s.transactionMeta.epoch.set(n,i)}function yb(s,n,i){if(!rn(s))return;const c=s.transactionMeta.actionContinuities.getRelatedKey(n);c!==void 0&&s.transactionMeta.epoch.set(c,i)}const mb=(s,n)=>{var f;const i=re(n),{parent:u}=i;if(u===null||!gt(i)||((f=i.transactionMeta)==null?void 0:f.phase)!=="building"){n.logger.warn("🐞","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}i.transactionMeta.phase="applying",i.transactionMeta.update.output=s,u.child=null,u.on.transactionApplying.next(i.transactionMeta);const{updates:c}=i.transactionMeta.update;if(n.logger.info("🛄","transaction",i.transactionMeta.update.key,`Applying transaction with ${c.length} updates:`,c),Ci("newValue",i.transactionMeta.update,u),rn(u)){yb(u,i.transactionMeta.update.key,i.transactionMeta.update.epoch);const h=rt(n,{key:i.transactionMeta.update.key,type:"transaction"});h==null||h.subject.next(i.transactionMeta.update),n.logger.info("🛬","transaction",i.transactionMeta.update.key,"Finished applying transaction.")}else gt(u)&&u.transactionMeta.update.updates.push(i.transactionMeta.update);u.on.transactionApplying.next(null)};function _m(s,n,i){if(!rn(s))return;const{epoch:c,actionContinuities:f}=s.transactionMeta;f.set(n,i),c.has(n)||c.set(n,-1)}function pb(s){return{store:s}}function Wt(s,...n){let i,u,c;if(n.length===1?i=n[0]:(u=n[0],c=n[1],i=pt(s,u,c)),"counterfeit"in i&&"family"in i){u=s.families.get(i.family.key);const f=i.family.subKey,h=s.disposalTraces.buffer.find(y=>(y==null?void 0:y.key)===f);switch(s.logger.error("❌",i.type,i.key,`could not be retrieved because it was not found in the store "${s.config.name}".`,h?`This state was previously disposed:
|
|
22
|
-
${h.trace}`:"No previous disposal trace was found."),u.type){case"atom_family":case"mutable_atom_family":return s.defaults.get(u.key);case"selector_family":case"readonly_selector_family":{if(s.defaults.has(u.key))return s.defaults.get(i.family.key);const y=rt(s,u).default(f);return s.defaults.set(u.key,y),y}}}return Lu(s,rt(s,i))}class Tt{constructor(n,i){j(this,"a");j(this,"b");j(this,"cardinality");j(this,"relations",new Map);j(this,"contents",new Map);j(this,"isAType");j(this,"isBType");j(this,"isContent");j(this,"makeContentKey",(n,i)=>`${n}:${i}`);j(this,"warn");var u,c;if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,i!=null&&i.externalStore||(this.relations=new Map((u=n.relations)==null?void 0:u.map(([f,h])=>[f,new Set(h)])),this.contents=new Map(n.contents)),this.isAType=(i==null?void 0:i.isAType)??null,this.isBType=(i==null?void 0:i.isBType)??null,this.isContent=(i==null?void 0:i.isContent)??null,i!=null&&i.makeContentKey&&(this.makeContentKey=i.makeContentKey),i!=null&&i.externalStore){const f=i.externalStore;this.has=(h,y)=>f.has(h,y),this.addRelation=(h,y)=>{f.addRelation(h,y)},this.deleteRelation=(h,y)=>{f.deleteRelation(h,y)},this.replaceRelationsSafely=(h,y)=>{f.replaceRelationsSafely(h,y)},this.replaceRelationsUnsafely=(h,y)=>{f.replaceRelationsUnsafely(h,y)},this.getRelatedKeys=h=>f.getRelatedKeys(h),f.getContent&&(this.getContentInternal=h=>f.getContent(h),this.setContent=(h,y)=>{f.setContent(h,y)},this.deleteContent=h=>{f.deleteContent(h)});for(const[h,y]of n.relations??[]){let p=(c=this.isAType)!=null&&c.call(this,h)?h:void 0,g=p===void 0?h:void 0;for(const S of y)p??(p=S),g??(g=S),this.addRelation(p,g)}for(const[h,y]of n.contents??[])this.setContent(h,y)}i!=null&&i.warn&&(this.warn=i.warn)}getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let u=this.relations.get(n),c=this.relations.get(i);u?u.add(i):(u=new Set([i]),this.relations.set(n,u)),c?c.add(n):(c=new Set([n]),this.relations.set(i,c))}deleteRelation(n,i){const u=this.relations.get(n);if(u){u.delete(i),u.size===0&&this.relations.delete(n);const c=this.relations.get(i);c&&(c.delete(n),c.size===0&&this.relations.delete(i))}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(const u of i){const c=new Set().add(n);this.relations.set(u,c)}}replaceRelationsSafely(n,i){var h;const u=this.relations.get(n);let c=(h=this.isAType)!=null&&h.call(this,n)?n:void 0,f=c===void 0?n:void 0;if(u)for(const y of u){c??(c=y),f??(f=y);const p=this.relations.get(y);p&&(p.size===1?this.relations.delete(y):p.delete(n),this.contents.delete(this.makeContentKey(c,f)))}this.relations.set(n,new Set(i));for(const y of i){let p=this.relations.get(y);p?p.add(n):(p=new Set().add(n),this.relations.set(y,p))}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,u,c;switch(n.length){case 1:{const f=n[0];i=f[this.a],u=f[this.b],c=void 0;break}case 2:{const f=n[0];typeof f=="string"?[i,u]=n:(i=f[this.a],u=f[this.b],c=n[1]);break}default:{i=n[0],u=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{const f=this.getRelatedKey(i);f&&f!==u&&this.delete(i,f)}case"1:n":{const f=this.getRelatedKey(u);f&&f!==i&&this.delete(f,u)}break}if(c){const f=this.makeContentKey(i,u);this.setContent(f,c)}return this.addRelation(i,u),this}delete(n,i){i=typeof i=="string"?i:n[this.b];const u=typeof n=="string"?n:n[this.a];if(u===void 0&&typeof i=="string"){const c=this.getRelatedKeys(i);if(c)for(const f of c)this.delete(f,i)}if(typeof u=="string"&&i===void 0){const c=this.getRelatedKeys(u);if(c)for(const f of c)this.delete(u,f)}if(typeof u=="string"&&typeof i=="string"){this.deleteRelation(u,i);const c=this.makeContentKey(u,i);this.deleteContent(c)}return this}getRelatedKey(n){var u;const i=this.getRelatedKeys(n);if(i){i.size>1&&((u=this.warn)==null||u.call(this,`${i.size} related keys were found for key "${n}": (${[...i].map(f=>`"${f}"`).join(", ")}). Only one related key was expected.`));let c;for(const f of i){c=f;break}return c}}replaceRelations(n,i,u){const c=!Array.isArray(i),f=c?Object.keys(i):i;if(u!=null&&u.reckless?this.replaceRelationsUnsafely(n,f):this.replaceRelationsSafely(n,f),c)for(const h of f){const y=this.makeContentKey(n,h),p=i[h];this.setContent(y,p)}return this}getContent(n,i){const u=this.makeContentKey(n,i);return this.getContentInternal(u)}getRelationEntries(n){const i=n[this.a],u=n[this.b];if(i!==void 0&&u===void 0){const c=this.getRelatedKeys(i);if(c)return[...c].map(f=>[f,this.getContent(i,f)])}if(i===void 0&&u!==void 0){const c=this.getRelatedKeys(u);if(c)return[...c].map(f=>[f,this.getContent(f,u)])}return[]}has(n,i){if(i){const u=this.getRelatedKeys(n);return(u==null?void 0:u.has(i))??!1}return this.relations.has(n)}}class pn extends Map{constructor(i){super();j(this,"deleted",new Set);this.source=i}get(i){if(super.has(i))return super.get(i);if(!this.deleted.has(i)&&this.source.has(i))return this.source.get(i)}set(i,u){return this.deleted.delete(i),super.set(i,u)}hasOwn(i){return super.has(i)}has(i){return!this.deleted.has(i)&&(super.has(i)||this.source.has(i))}delete(i){return this.deleted.add(i),super.delete(i)}}const gb=(s,n,i,u)=>{const c=re(s),f={parent:c,child:null,on:c.on,loggers:c.loggers,logger:c.logger,config:c.config,atoms:new pn(c.atoms),atomsThatAreDefault:new Set(c.atomsThatAreDefault),families:new pn(c.families),joins:new pn(c.joins),operation:{open:!1},readonlySelectors:new pn(c.readonlySelectors),timelines:new pn(c.timelines),timelineTopics:new Tt(c.timelineTopics.toJSON()),trackers:new Map,transactions:new pn(c.transactions),selectorAtoms:new Tt(c.selectorAtoms.toJSON()),selectorGraph:new Tt(c.selectorGraph.toJSON(),{makeContentKey:(...g)=>g.sort().join(":")}),selectors:new pn(c.selectors),valueMap:new pn(c.valueMap),defaults:c.defaults,disposalTraces:s.disposalTraces.copy(),molecules:new pn(c.molecules),moleculeGraph:new Tt(c.moleculeGraph.toJSON(),{makeContentKey:c.moleculeGraph.makeContentKey}),moleculeData:new Tt(c.moleculeData.toJSON(),{makeContentKey:c.moleculeData.makeContentKey}),moleculeJoins:new Tt(c.moleculeJoins.toJSON(),{makeContentKey:c.moleculeJoins.makeContentKey}),miscResources:new pn(c.miscResources)},h=bb(s,n),y={phase:"building",update:{type:"transaction_update",key:n,id:u,epoch:h===void 0?Number.NaN:h+1,updates:[],params:i,output:void 0},toolkit:{get:(...g)=>Wt(p,...g),set:(...g)=>{Ie(p,...g)},run:(g,S=mm())=>Zo(p,g,S),find:(g,S)=>pt(p,g,S),json:g=>$a(p,g),dispose:(...g)=>{Ku(p,...g)},env:()=>pb(p)}},p=Object.assign(f,{transactionMeta:y});return c.child=p,s.logger.info("🛫","transaction",n,"Building transaction with params:",i),p};function Sm(s,n){const i={key:n.key,type:"transaction",run:(f,h)=>{const y=gb(s,n.key,f,h);try{const p=re(s),{toolkit:g}=y.transactionMeta,S=n.do(g,...f);return mb(S,p),S}catch(p){throw Fv(u),s.logger.warn("💥","transaction",n.key,"caught:",p),p}},install:f=>Sm(f,n),subject:new We},u=re(s);u.transactions.set(i.key,i);const c=Ui(i);return s.on.transactionCreation.next(c),c}function vb(s,n){return rn(s)&&n?s.transactionMeta.epoch.get(n):void 0}function bb(s,n){const i=rn(s),u=i?s.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return i&&u!==void 0?s.transactionMeta.epoch.get(u):void 0}function _b(s){return Sm(et.STORE,s)}function Sb(s,n=mm()){return Zo(et.STORE,s,n)}class Tb{constructor(n,i=null){j(this,"parent",null);j(this,"child",null);j(this,"valueMap",new Map);j(this,"defaults",new Map);j(this,"atoms",new Map);j(this,"selectors",new Map);j(this,"readonlySelectors",new Map);j(this,"atomsThatAreDefault",new Set);j(this,"selectorAtoms",new Tt({between:["selectorKey","atomKey"],cardinality:"n:n"}));j(this,"selectorGraph",new Tt({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"trackers",new Map);j(this,"families",new Map);j(this,"joins",new Map);j(this,"transactions",new Map);j(this,"transactionMeta",{epoch:new Map,actionContinuities:new Tt({between:["continuity","action"],cardinality:"1:n"})});j(this,"timelines",new Map);j(this,"timelineTopics",new Tt({between:["timelineKey","topicKey"],cardinality:"1:n"}));j(this,"disposalTraces",new jo(100));j(this,"molecules",new Map);j(this,"moleculeJoins",new Tt({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"moleculeGraph",new Tt({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"moleculeData",new Tt({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"miscResources",new Map);j(this,"on",{atomCreation:new We,atomDisposal:new We,selectorCreation:new We,selectorDisposal:new We,timelineCreation:new We,transactionCreation:new We,transactionApplying:new Zv(null),operationClose:new We,moleculeCreation:new We,moleculeDisposal:new We});j(this,"operation",{open:!1});j(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});j(this,"loggers",[new Xv("warn",(n,i,u)=>!u.includes("🔍"))]);j(this,"logger",{error:(...n)=>{for(const i of this.loggers)i.error(...n)},info:(...n)=>{for(const i of this.loggers)i.info(...n)},warn:(...n)=>{for(const i of this.loggers)i.warn(...n)}});var u,c;if(this.config={...i==null?void 0:i.config,...n},i!==null){this.valueMap=new Map(i==null?void 0:i.valueMap),this.operation={...i==null?void 0:i.operation},rn(i)&&(this.transactionMeta={epoch:new Map(i==null?void 0:i.transactionMeta.epoch),actionContinuities:new Tt(i==null?void 0:i.transactionMeta.actionContinuities.toJSON())});for(const[,h]of i.families)(u=h.internalRoles)!=null&&u.includes("mutable")||(c=h.internalRoles)!=null&&c.includes("join")||h.install(this);const f=new Set;for(const[,h]of i.atoms)if(!f.has(h.key)&&(h.install(this),h.type==="mutable_atom")){const y=$a(i,h),p=wm(h);f.add(y.key),f.add(p.key)}for(const[,h]of i.readonlySelectors)h.install(this);for(const[,h]of i.selectors)f.has(h.key)||h.install(this);for(const[,h]of i.transactions)h.install(this);for(const[,h]of i.timelines)h.install(this)}}}const et={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE||(globalThis.ATOM_IO_IMPLICIT_STORE=new Tb({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function rt(s,n){let i,u=s;for(;u!==null;){switch(n.type){case"atom":case"mutable_atom":i=u.atoms.get(n.key);break;case"selector":i=u.selectors.get(n.key);break;case"readonly_selector":i=u.readonlySelectors.get(n.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":i=u.families.get(n.key);break;case"timeline":i=u.timelines.get(n.key);break;case"transaction":i=u.transactions.get(n.key);break}if(i)return i;u=u.child}throw new qo(n,s)}function Eb(s,n,i){const u=s.families.get(n.key);if(u===void 0)throw new qo(n,s);const c=u(i),f=re(s);if(c.family)if(rn(f))switch(c.type){case"atom":case"mutable_atom":s.on.atomCreation.next(c);break;case"selector":case"readonly_selector":s.on.selectorCreation.next(c);break}else gt(f)&&f.on.transactionApplying.state===null&&f.transactionMeta.update.updates.push({type:"state_creation",token:c});return c}function Ab(s,n,i){const u=Ke(i),c=`${n.key}(${u})`,f=re(s);let h;switch(n.type){case"atom_family":case"mutable_atom_family":h=f.atoms.get(c);break;case"selector_family":h=f.selectors.get(c);break;case"readonly_selector_family":h=f.readonlySelectors.get(c);break}return h&&Ui(h)}function pt(s,n,i){let u=Ab(s,n,i);if(u)return u;const c=Ke(i),f=s.molecules.get(c);if(!f&&s.config.lifespan==="immortal"){const h=Lv(n,i);return s.logger.error("❌",h.type,h.key,`was not found in store "${s.config.name}"; returned a counterfeit token.`),h}return u=Eb(s,n,i),f&&re(s).moleculeData.set(c,n.key),u}function Ku(s,...n){let i;if(n.length===1)i=n[0];else{const u=n[0],c=n[1];i=pt(s,u,c)}try{rt(s,i)}catch{s.logger.error("❌",i.type,i.key,`could not be disposed because it was not found in the store "${s.config.name}".`);return}switch(i.type){case"atom":case"mutable_atom":Qo(s,i);break;case"selector":case"readonly_selector":Mb(s,i);break}}const Lo=(s,n)=>re(s).atoms.has(n),Ob=(s,n)=>re(s).selectors.has(n),wb=(s,n)=>re(s).readonlySelectors.has(n),Rb=(s,n)=>Lo(s,n)||Ob(s,n)||wb(s,n),bo=(s,n)=>re(n).selectorGraph.getRelationEntries({downstreamSelectorKey:s}).filter(([u,{source:c}])=>c!==s).map(([u,{source:c}])=>c).filter(u=>Rb(n,u)),Tm=(s,n,i)=>{const u=[],c=bo(s,i);for(;c.length>0;){const f=c.shift();n.has(f)||(n.add(f),Lo(i,f)?u.includes(f)||u.push(f):c.push(...bo(f,i)))}return u},xb=(s,n)=>{const i=s.key,u=bo(i,n),c=new Set;return u.flatMap(f=>Lo(n,f)?f:Tm(f,c,n))},kb=(s,n,i,u)=>{const c=re(u);if(n.type==="atom"||n.type==="mutable_atom")c.selectorAtoms.set({selectorKey:s,atomKey:n.key}),u.logger.info("🔍","selector",s,`discovers root atom "${n.key}"`);else{const f=Tm(n.key,i,u);u.logger.info("🔍","selector",s,`discovers root atoms: [ ${f.map(h=>`"${h}"`).join(", ")} ]`);for(const h of f)c.selectorAtoms=c.selectorAtoms.set({selectorKey:s,atomKey:h})}i.add(n.key)},Em=(s,n,i)=>({get:(...u)=>{const c=re(i);let f;if(u.length===2){const[p,g]=u;f=pt(i,p,g)}else[f]=u;const h=rt(i,f),y=Lu(i,h);return i.logger.info("🔌","selector",s,`registers dependency ( "${f.key}" =`,y,")"),c.selectorGraph.set({upstreamSelectorKey:f.key,downstreamSelectorKey:s},{source:f.key}),kb(s,f,n,i),y},set:(...u)=>{let c,f;if(u.length===2)c=u[0],f=u[1];else{const p=u[0],g=u[1];f=u[2],c=pt(i,p,g)}const h=re(i),y=rt(h,c);vm(h,y,f)},find:(u,c)=>pt(i,u,c),json:u=>$a(i,u)}),Ko=(s,n,i)=>{const u=re(s),c=new We,f=new Set,{get:h,find:y,json:p}=Em(n.key,f,u),g=()=>{const U=n.get({get:h,find:y,json:p});return La(re(s),n.key,U,c),f.clear(),U},S={...n,subject:c,install:U=>Ko(U,n,i),get:g,type:"readonly_selector",...i&&{family:i}};u.readonlySelectors.set(n.key,S);const w=g();s.logger.info("✨",S.type,S.key,"=",w);const C={key:n.key,type:"readonly_selector"};return i&&(C.family=i),C},Yo=(s,n,i)=>{const u=re(s),c=new We,f=new Set,h=Em(n.key,f,u),{find:y,get:p,json:g}=h,S={find:y,get:p,json:g},w=(fe=n.get,de=re(s))=>{const he=fe(S);return La(de,n.key,he,c),f.clear(),he},U={...n,subject:c,install:fe=>Yo(fe,n,i),get:w,set:fe=>{const de=re(s),he=w(n.get,de),Ye=gm(fe)(he);s.logger.info("📝","selector",n.key,"set (",he,"->",Ye,")"),La(de,n.key,Ye,c),Ho(de,n.key),rn(de)&&c.next({newValue:Ye,oldValue:he}),n.set(h,Ye)},type:"selector",...i&&{family:i}};u.selectors.set(n.key,U);const Q=w();s.logger.info("✨",U.type,U.key,"=",Q);const L={key:n.key,type:"selector"};return i&&(L.family=i),L};function Am(s,n){if("set"in n){const c=Yo(s,n,void 0);return s.on.selectorCreation.next(c),c}const u=Ko(s,n,void 0);return s.on.selectorCreation.next(u),u}function Mb(s,n){const i=re(s),{key:u}=n,c=rt(i,n);if(!c.family)s.logger.error("❌","selector",u,"Standalone selectors cannot be disposed.");else{i.molecules.get(c.family.subKey)&&i.moleculeData.delete(c.family.subKey,c.family.key);let h;switch(n.type){case"selector":i.selectors.delete(u),h={key:c.family.key,type:"selector_family"},rt(s,h).subject.next({type:"state_disposal",subType:"selector",token:n});break;case"readonly_selector":i.readonlySelectors.delete(u),h={key:c.family.key,type:"readonly_selector_family"},rt(s,h).subject.next({type:"state_disposal",subType:"selector",token:n});break}i.valueMap.delete(u),i.selectorAtoms.delete(u),i.selectorGraph.delete(u),s.logger.info("🔥",n.type,u,"deleted"),gt(i)&&i.transactionMeta.phase==="building"?i.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:n}):s.on.selectorDisposal.next(n)}}function Go(s,n,i){const u={key:n.key,type:"selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","selector_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=Yo(C,{key:w,get:n.get(p),set:n.set(p)},S);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Go(p,n),default:p=>n.get(p)({get:(...S)=>Wt(s,...S),find:(S,w)=>pt(s,S,w),json:S=>$a(s,S)})});return s.families.set(n.key,y),u}function Nb(s,n,i){return Go(s,{key:`${n.key}:JSON`,get:c=>({get:f})=>{const h=f(n,c);return i.toJson(h)},set:c=>({set:f},h)=>{f(n,c,i.fromJson(h))}},["mutable","json"])}const Vi=s=>JSON.parse(s),Ke=s=>JSON.stringify(s),Cb=(s,n)=>{const i=re(s);return i.operation.open?i.operation.prev.get(n.key):i.valueMap.get(n.key)},Qy=(s,n)=>{const i=re(s);return xb(n,s).map(c=>{const f=i.atoms.get(c);if(f===void 0)throw new Error(`Atom "${c}", a dependency of selector "${n.key}", not found in store "${s.config.name}".`);return f.subject.subscribe(`${n.type}:${n.key}`,h=>{s.logger.info("📢",n.type,n.key,"root",c,"went",h.oldValue,"->",h.newValue);const y=Cb(i,n),p=Lu(i,n);s.logger.info("✨",n.type,n.key,"went",y,"->",p),n.subject.next({newValue:p,oldValue:y})})})};function $l(s,n,i,u){function c(w){if(s.operation.open){const C=s.on.operationClose.subscribe(`state subscription ${i}`,()=>{C(),u(w)})}else u(w)}const f=rt(s,n);s.logger.info("👀",f.type,f.key,`Adding subscription "${i}"`);const h=f.type==="selector"||f.type==="readonly_selector";let y=null,p=c;h&&(y=Qy(s,f),p=w=>{y&&(y.length=0,y.push(...Qy(s,f))),c(w)});const g=f.subject.subscribe(i,p);return()=>{if(s.logger.info("🙈",f.type,f.key,`Removing subscription "${i}"`),g(),y)for(const w of y)w()}}const Db=(s,n,i,u)=>{const c=rt(s,n);s.logger.info("👀","timeline",n.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,u);return()=>{s.logger.info("🙈","timeline",n.key,`Removing subscription "${i}" from timeline`),f()}},zb=(s,n,i,u)=>{const c=rt(s,n);s.logger.info("👀","transaction",n.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,u);return()=>{s.logger.info("🙈","transaction",n.key,`Removing subscription "${i}"`),f()}};var ym;ym=Symbol.dispose;class Xo{constructor(n,i){j(this,"Update");j(this,"unsubscribeFromInnerValue");j(this,"unsubscribeFromState");j(this,"mutableState");j(this,"latestUpdateState");j(this,ym);this.mutableState=n;const u=re(i);this.latestUpdateState=this.initializeState(n,u),this.observeCore(n,this.latestUpdateState,u),this.updateCore(n,this.latestUpdateState,u),u.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),u.trackers.delete(n.key)}}initializeState(n,i){var h;const u=`*${n.key}`;i.atoms.delete(u),i.valueMap.delete(u);const c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,f=Yu(i,{key:u,default:null},c);if((h=i.parent)!=null&&h.valueMap.has(u)){const y=i.parent.valueMap.get(u);i.valueMap.set(u,y)}return f}observeCore(n,i,u){const c=`tracker:${u.config.name}:${gt(u)?u.transactionMeta.update.key:"main"}:${n.key}`,f=Wt(u,n);this.unsubscribeFromInnerValue=f.subscribe(c,h=>{Ie(u,i,h)}),this.unsubscribeFromState=$l(u,n,c,h=>{h.newValue!==h.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=h.newValue.subscribe(c,y=>{Ie(u,i,y)}))})}updateCore(n,i,u){const c=`tracker:${u.config.name}:${gt(u)?u.transactionMeta.update.key:"main"}:${n.key}`;$l(u,i,c,({newValue:f,oldValue:h})=>{const y=u.timelineTopics.getRelatedKey(i.key);if(y){const g=u.timelines.get(y);if(g!=null&&g.timeTraveling){const S=Db(u,{key:y,type:"timeline"},c,w=>{S(),Ie(u,n,C=>(w==="redo"&&f?C.do(f):w==="undo"&&h&&C.undo(h),C))});return}}const p=u.on.operationClose.subscribe(c,()=>{p();const g=Wt(u,n),S=f===null?-1:g.getUpdateNumber(f),w=S-g.cacheUpdateNumber;f&&w===1?Ie(u,n,C=>(C.do(f),C)):u.logger.info("❌","mutable_atom",n.key,`could not be updated. Expected update number ${g.cacheUpdateNumber+1}, but got ${S}`)})})}}function $o(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="mutable_atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Ui(c);const f=new We,h={...n,type:"mutable_atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),$o(g,n,i)),subject:f};i&&(h.family=i);const y=n.default();u.atoms.set(h.key,h),Rm(s,n.key),La(u,n.key,y,f);const p=Ui(h);if(n.effects){let g=0;const S=[];for(const w of n.effects){const C=w({setSelf:U=>{Ie(s,p,U)},onSet:U=>$l(s,p,`effect[${g}]`,U)});C&&S.push(C),++g}h.cleanup=()=>{for(const w of S)w()}}return new Xo(p,s),i||qv(p,n,s),p}class Ub{constructor(n,i){j(this,"trackers",new Map);j(this,"Update");j(this,"latestUpdateAtoms");j(this,"mutableAtoms");const u=Uo(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=rt(i,u),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,c=>{const{type:f,token:h}=c;if(h.family){const y=Vi(h.family.subKey);switch(f){case"state_creation":this.trackers.set(y,new Xo(h,i));break;case"state_disposal":{const p=this.trackers.get(y);p&&(p[Symbol.dispose](),this.trackers.delete(y))}break}}})}}function Om(s,n,i){const u={key:n.key,type:"mutable_atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","mutable_atom_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U={key:w,default:()=>n.default(p),toJson:n.toJson,fromJson:n.fromJson,mutable:!0};n.effects&&(U.effects=n.effects(p));const Q=$o(C,U,S);return f.next({type:"state_creation",token:Q}),Q},u,{subject:f,install:p=>Om(p,n),toJson:n.toJson,fromJson:n.fromJson,internalRoles:i});return s.families.set(n.key,y),Nb(s,y,n),new Ub(y,s),u}const Jy=(s,n)=>{const i=re(n),u=`${s.key}:JSON`;return i.families.get(u)},$a=(s,n)=>{if(n.family){const u=re(s),f={key:`${n.family.key}:JSON`,type:"selector_family"},h=rt(u,f),y=JSON.parse(n.family.subKey);return pt(s,h,y)}return{type:"selector",key:`${n.key}:JSON`}},wm=s=>{const i={type:"atom",key:`*${s.key}`};return s.family&&(i.family={key:`*${s.family.key}`,subKey:s.family.subKey}),i};function jb(s){return typeof s=="object"&&s!==null&&"do"in s&&"undo"in s&&"subscribe"in s}function _o(s,n,i){const u=i.valueMap.get(n.key),c=s.valueMap.get(n.key);if(u===c){if(u===void 0)return typeof n.default=="function"?n.default():n.default;i.logger.info("📃","atom",n.key,"copying");const f=n.toJson(u),h=n.fromJson(f);return s.valueMap.set(n.key,h),new Xo(n,i),h}return c}function La(s,n,i,u){const c=s.valueMap.get(n);if(c instanceof go&&c.use(i),i instanceof Promise){const f=new go(i);return s.valueMap.set(n,f),f.then(h=>{La(s,n,h,u),u.next({newValue:h,oldValue:f})}).catch(h=>{s.logger.error("💥","state",n,"rejected:",h)}),f}return s.valueMap.set(n,i),i}const Bb=(s,n)=>{let i=n.valueMap.get(s.key);if(s.type==="mutable_atom"&>(n)){const{parent:u}=n;i=_o(n,s,u)}return i},qb=(s,n)=>{const i=n.valueMap.get(s);if(i instanceof go){const u=i,c=n.selectors.get(s)??n.readonlySelectors.get(s);c&&u.use(c.get());return}n.operation.open&&n.operation.prev.set(s,i),n.valueMap.delete(s),n.logger.info("🗑","state",s,"evicted")},Zb=(s,n)=>re(s).atomsThatAreDefault.has(n),Rm=(s,n)=>{const i=re(s);i.atomsThatAreDefault=new Set(i.atomsThatAreDefault).add(n)},Hb=(s,n)=>{const i=re(s);i.atomsThatAreDefault=new Set(re(s).atomsThatAreDefault),i.atomsThatAreDefault.delete(n)};function Yu(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Ui(c);const f=new We,h={...n,type:"atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),Yu(g,n,i)),subject:f};i&&(h.family=i);let y=n.default;n.default instanceof Function&&(y=n.default()),u.atoms.set(h.key,h),Rm(s,n.key),La(u,n.key,y,f);const p=Ui(h);if(n.effects){let g=0;const S=[];for(const w of n.effects){const C=w({setSelf:U=>{Ie(s,p,U)},onSet:U=>$l(s,p,`effect[${g}]`,U)});C&&S.push(C),++g}h.cleanup=()=>{for(const w of S)w()}}return p}function Vb(s,n){if("mutable"in n){const c=$o(s,n,void 0);return s.on.atomCreation.next(c),c}const u=Yu(s,n,void 0);return s.on.atomCreation.next(u),u}function Qo(s,n){var h;const i=re(s),{key:u,family:c}=n,f=rt(i,n);if(!c)s.logger.error("❌","atom",u,"Standalone atoms cannot be disposed.");else{(h=f.cleanup)==null||h.call(f);const y=s.valueMap.get(f.key),p=rt(s,{key:c.key,type:"atom_family"}),g={type:"state_disposal",subType:"atom",token:n,value:y};p.subject.next(g);const S=gt(i);if(i.atoms.delete(u),i.valueMap.delete(u),i.selectorAtoms.delete(u),i.atomsThatAreDefault.delete(u),s.timelineTopics.delete(u),n.type==="mutable_atom"){const w=wm(n);Qo(s,w),s.trackers.delete(u)}if(s.logger.info("🔥","atom",u,"deleted"),S&&i.transactionMeta.phase==="building"){const w=i.transactionMeta.update.updates.at(-1);(w==null?void 0:w.type)==="molecule_disposal"&&w.values.some(([Q])=>{var L;return Q===((L=f.family)==null?void 0:L.key)})||i.transactionMeta.update.updates.push(g)}else s.on.atomDisposal.next(n)}}class gn extends Set{constructor(i,u=0){super(i);j(this,"mode","record");j(this,"subject",new We);j(this,"cacheLimit",0);j(this,"cache",[]);j(this,"cacheIdx",-1);j(this,"cacheUpdateNumber",-1);j(this,"parent");j(this,"child",null);j(this,"transactionUpdates",null);i instanceof gn&&(this.parent=i,this.cacheUpdateNumber=i.cacheUpdateNumber),u&&(this.cacheLimit=u,this.cache=new Array(u),this.subscribe("auto cache",c=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=c}))}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(i){const u=new gn(i.members,i.cacheLimit);return u.cache=i.cache,u.cacheIdx=i.cacheIdx,u.cacheUpdateNumber=i.cacheUpdateNumber,u}add(i){const u=super.add(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`add:${Ke(i)}`)),u}clear(){const i=this.mode==="record"?[...this]:null;super.clear(),i&&(this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(i)}`))}delete(i){const u=super.delete(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`del:${Ke(i)}`)),u}transaction(i){this.mode="transaction",this.transactionUpdates=[],this.child=new gn(this);const u=this.child._subscribe("transaction",c=>{var f;(f=this.transactionUpdates)==null||f.push(c)});try{if(i(this.child)){for(const f of this.transactionUpdates)this.doStep(f);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(c){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",c),c}finally{u(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(i,u){return this.subject.subscribe(i,u)}subscribe(i,u){return this.subject.subscribe(i,c=>{u(`${this.cacheUpdateNumber}=${c}`)})}emit(i){this.subject.next(i)}doStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.add(JSON.parse(f));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(f));break;case"tx":for(const h of f.split(";"))this.doStep(h)}}getUpdateNumber(i){const u=i.indexOf("=");return Number(i.substring(0,u))}do(i){const u=i.indexOf("="),c=Number(i.substring(0,u)),f=c-this.cacheUpdateNumber;if(f>0){if(f===1){this.mode="playback";const y=i.substring(u+1);return this.doStep(y),this.mode="record",this.cacheUpdateNumber=c,null}return this.cacheUpdateNumber+1}if(Math.abs(f)<this.cacheLimit){const y=this.cacheIdx+f;if(this.cache[y]===i)return null;this.mode="playback";let g=!1;for(;!g;){this.cacheIdx%=this.cacheLimit;const w=this.cache[this.cacheIdx];if(this.cacheIdx--,!w)return"OUT_OF_RANGE";this.undo(w),g=this.cacheIdx===y-1}const S=i.substring(u+1);return this.doStep(S),this.mode="record",this.cacheUpdateNumber=c,null}return"OUT_OF_RANGE"}undoStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.delete(JSON.parse(f));break;case"del":this.add(JSON.parse(f));break;case"clear":{const h=JSON.parse(f);for(const y of h)this.add(y);break}case"tx":{const h=f.split(";");for(let y=h.length-1;y>=0;y--)this.undoStep(h[y])}}}undo(i){const u=i.indexOf("=");if(Number(i.substring(0,u))===this.cacheUpdateNumber){this.mode="playback";const f=i.substring(u+1);return this.undoStep(f),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class xm{constructor(n,i,u=et.STORE){j(this,"toolkit");j(this,"options");j(this,"defaultContent");j(this,"molecules",new Map);j(this,"relations");j(this,"states");j(this,"core");j(this,"store");j(this,"realm");this.store=u,this.realm=new Qv(u),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...N)=>Wt(u,...N),set:(...N)=>{Ie(u,...N)},find:(...N)=>pt(u,...N),json:N=>$a(u,N)};const c=n.between[0],f=n.between[1],h=Om(u,{key:`${n.key}/relatedKeys`,default:()=>new gn,mutable:!0,fromJson:N=>gn.fromJSON(N),toJson:N=>N.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:h};const y=({get:N},K)=>N(h,K),p=({set:N},K,se)=>{this.store.molecules.has(Ke(K))||this.realm.allocate(n.key,K),N(h,K,W=>W.add(se)),N(h,se,W=>W.add(K))},g=({set:N},K,se)=>{N(h,K,W=>(W.delete(se),W)),N(h,se,W=>(W.delete(K),W))},S=(N,K,se)=>{const{find:W,get:B,set:X}=N,we=W(h,K),Ge=B(we);for(const Ce of Ge)se.includes(Ce)||X(h,Ce,Ue=>(Ue.delete(K),Ue));X(we,Ce=>(Ce.transaction(at=>{at.clear();for(const Ue of se){const Z=y(N,Ue),ie=Z.has(K);if(this.relations.cardinality==="1:n"){const I=[];for(const Ee of Z){if(Ee===K)continue;const b=y(N,Ee);b.delete(Ue),b.size===0&&I.push(Ee)}!ie&&Z.size>0&&Z.clear();for(const Ee of I){const b=[Ue,Ee].sort(),D=`"${b[0]}:${b[1]}"`;this.molecules.delete(D)}}ie||Z.add(K),at.add(Ue)}return!0}),Ce))},w=(N,K,se)=>{const{set:W}=N;W(h,K,B=>(B.transaction(X=>{for(const we of se)X.add(we);return!0}),B));for(const B of se)W(h,B,X=>(X.add(K),X));return!0},C=(N,K,se)=>{const W=y(N,K);return se?W.has(se):W.size>0},U={getRelatedKeys:N=>y(this.toolkit,N),addRelation:(N,K)=>{this.store.moleculeJoins.set(N,n.key),this.store.moleculeJoins.set(K,n.key),p(this.toolkit,N,K)},deleteRelation:(N,K)=>{g(this.toolkit,N,K)},replaceRelationsSafely:(N,K)=>{S(this.toolkit,N,K)},replaceRelationsUnsafely:(N,K)=>{w(this.toolkit,N,K)},has:(N,K)=>C(this.toolkit,N,K)};let Q,L;if(i){L=Uo(u,{key:`${n.key}/content`,default:i},["join","content"]);const N=({get:W},B)=>W(L,B),K=({set:W},B,X)=>{W(L,B,X)};Q=Object.assign(U,{getContent:W=>N(this.toolkit,W),setContent:(W,B)=>{K(this.toolkit,W,B)},deleteContent:W=>{this.realm.deallocate(W)}})}else Q=U;const fe=new Tt(n,{externalStore:Q,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...N)=>{const[K,se]=N,W=N.sort(),B=`${W[0]}:${W[1]}`,X=u.molecules.get(Ke(K)),we=u.molecules.get(Ke(se));return X||this.realm.allocate(n.key,K),we||this.realm.allocate(n.key,se),this.realm.allocate(K,B,"all"),this.realm.claim(se,B),this.store.moleculeJoins.set(B,n.key),B}}),de=()=>Ni(u,{key:`${n.key}/singleRelatedKey`,get:N=>({get:K})=>{const se=K(h,N);for(const W of se)return W;return null}},["join","keys"]),he=()=>Ni(u,{key:`${n.key}/multipleRelatedKeys`,get:N=>({get:K})=>{const se=Jy(h,u);return K(se,N).members}},["join","keys"]),Ye=()=>Ni(u,{key:`${n.key}/singleRelatedEntry`,get:N=>({get:K})=>{var W;const se=K(h,N);for(const B of se){let X=(W=fe.isAType)!=null&&W.call(fe,N)?N:void 0,we=X===void 0?N:void 0;X??(X=B),we??(we=B);const Ge=fe.makeContentKey(X,we),Ce=K(L,Ge);return[B,Ce]}return null}},["join","entries"]),It=()=>Ni(u,{key:`${n.key}/multipleRelatedEntries`,get:N=>({get:K})=>{const se=Jy(h,u);return K(se,N).members.map(B=>{var at;let X=(at=fe.isAType)!=null&&at.call(fe,N)?N:void 0,we=X===void 0?N:void 0;X??(X=B),we??(we=B);const Ge=fe.makeContentKey(X,we),Ce=K(L,Ge);return[B,Ce]})}},["join","entries"]);switch(n.cardinality){case"1:1":{const N=de(),K=`${c}KeyOf${zt(f)}`,se=`${f}KeyOf${zt(c)}`,W={[K]:N,[se]:N};let B;if(i){const X=Ye(),we=`${c}EntryOf${zt(f)}`,Ge=`${f}EntryOf${zt(c)}`,Ce={[we]:X,[Ge]:X};B=Object.assign(W,Ce)}else B=W;this.relations=fe,this.states=B;break}case"1:n":{const N=de(),K=he(),se=`${c}KeyOf${zt(f)}`,W=`${f}KeysOf${zt(c)}`,B={[se]:N,[W]:K};let X;if(i){const we=Ye(),Ge=It(),Ce=`${c}EntryOf${zt(f)}`,at=`${f}EntriesOf${zt(c)}`,Ue={[Ce]:we,[at]:Ge};X=Object.assign(B,Ue)}else X=B;this.relations=fe,this.states=X;break}case"n:n":{const N=he(),K=`${c}KeysOf${zt(f)}`,se=`${f}KeysOf${zt(c)}`,W={[K]:N,[se]:N};let B;if(i){const X=It(),we=`${c}EntriesOf${zt(f)}`,Ge=`${f}EntriesOf${zt(c)}`,Ce={[we]:X,[Ge]:X};B=Object.assign(W,Ce)}else B=W;this.relations=fe,this.states=B}}}transact(n,i){const u=this.toolkit;this.toolkit=n,i(this),this.toolkit=u}[Symbol.dispose](){}}function Lb(s,n){let i=n.joins.get(s.key);if(i===void 0){const c=et.STORE.joins.get(s.key);if(c===void 0)throw new Error(`Join "${s.key}" not found in store "${n.config.name}"`);i=new xm(c.options,c.defaultContent,n),n.joins.set(s.key,i)}return i}function Kb(s,n){return Lb(s,n).core.relatedKeysAtoms}var so={exports:{}},ce={};/**
|
|
22
|
+
${h.trace}`:"No previous disposal trace was found."),u.type){case"atom_family":case"mutable_atom_family":return s.defaults.get(u.key);case"selector_family":case"readonly_selector_family":{if(s.defaults.has(u.key))return s.defaults.get(i.family.key);const y=rt(s,u).default(f);return s.defaults.set(u.key,y),y}}}return Lu(s,rt(s,i))}class Tt{constructor(n,i){j(this,"a");j(this,"b");j(this,"cardinality");j(this,"relations",new Map);j(this,"contents",new Map);j(this,"isAType");j(this,"isBType");j(this,"isContent");j(this,"makeContentKey",(n,i)=>`${n}:${i}`);j(this,"warn");var u,c;if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,i!=null&&i.externalStore||(this.relations=new Map((u=n.relations)==null?void 0:u.map(([f,h])=>[f,new Set(h)])),this.contents=new Map(n.contents)),this.isAType=(i==null?void 0:i.isAType)??null,this.isBType=(i==null?void 0:i.isBType)??null,this.isContent=(i==null?void 0:i.isContent)??null,i!=null&&i.makeContentKey&&(this.makeContentKey=i.makeContentKey),i!=null&&i.externalStore){const f=i.externalStore;this.has=(h,y)=>f.has(h,y),this.addRelation=(h,y)=>{f.addRelation(h,y)},this.deleteRelation=(h,y)=>{f.deleteRelation(h,y)},this.replaceRelationsSafely=(h,y)=>{f.replaceRelationsSafely(h,y)},this.replaceRelationsUnsafely=(h,y)=>{f.replaceRelationsUnsafely(h,y)},this.getRelatedKeys=h=>f.getRelatedKeys(h),f.getContent&&(this.getContentInternal=h=>f.getContent(h),this.setContent=(h,y)=>{f.setContent(h,y)},this.deleteContent=h=>{f.deleteContent(h)});for(const[h,y]of n.relations??[]){let p=(c=this.isAType)!=null&&c.call(this,h)?h:void 0,g=p===void 0?h:void 0;for(const S of y)p??(p=S),g??(g=S),this.addRelation(p,g)}for(const[h,y]of n.contents??[])this.setContent(h,y)}i!=null&&i.warn&&(this.warn=i.warn)}getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let u=this.relations.get(n),c=this.relations.get(i);u?u.add(i):(u=new Set([i]),this.relations.set(n,u)),c?c.add(n):(c=new Set([n]),this.relations.set(i,c))}deleteRelation(n,i){const u=this.relations.get(n);if(u){u.delete(i),u.size===0&&this.relations.delete(n);const c=this.relations.get(i);c&&(c.delete(n),c.size===0&&this.relations.delete(i))}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(const u of i){const c=new Set().add(n);this.relations.set(u,c)}}replaceRelationsSafely(n,i){var h;const u=this.relations.get(n);let c=(h=this.isAType)!=null&&h.call(this,n)?n:void 0,f=c===void 0?n:void 0;if(u)for(const y of u){c??(c=y),f??(f=y);const p=this.relations.get(y);p&&(p.size===1?this.relations.delete(y):p.delete(n),this.contents.delete(this.makeContentKey(c,f)))}this.relations.set(n,new Set(i));for(const y of i){let p=this.relations.get(y);p?p.add(n):(p=new Set().add(n),this.relations.set(y,p))}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,u,c;switch(n.length){case 1:{const f=n[0];i=f[this.a],u=f[this.b],c=void 0;break}case 2:{const f=n[0];typeof f=="string"?[i,u]=n:(i=f[this.a],u=f[this.b],c=n[1]);break}default:{i=n[0],u=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{const f=this.getRelatedKey(i);f&&f!==u&&this.delete(i,f)}case"1:n":{const f=this.getRelatedKey(u);f&&f!==i&&this.delete(f,u)}break}if(c){const f=this.makeContentKey(i,u);this.setContent(f,c)}return this.addRelation(i,u),this}delete(n,i){i=typeof i=="string"?i:n[this.b];const u=typeof n=="string"?n:n[this.a];if(u===void 0&&typeof i=="string"){const c=this.getRelatedKeys(i);if(c)for(const f of c)this.delete(f,i)}if(typeof u=="string"&&i===void 0){const c=this.getRelatedKeys(u);if(c)for(const f of c)this.delete(u,f)}if(typeof u=="string"&&typeof i=="string"){this.deleteRelation(u,i);const c=this.makeContentKey(u,i);this.deleteContent(c)}return this}getRelatedKey(n){var u;const i=this.getRelatedKeys(n);if(i){i.size>1&&((u=this.warn)==null||u.call(this,`${i.size} related keys were found for key "${n}": (${[...i].map(f=>`"${f}"`).join(", ")}). Only one related key was expected.`));let c;for(const f of i){c=f;break}return c}}replaceRelations(n,i,u){const c=!Array.isArray(i),f=c?Object.keys(i):i;if(u!=null&&u.reckless?this.replaceRelationsUnsafely(n,f):this.replaceRelationsSafely(n,f),c)for(const h of f){const y=this.makeContentKey(n,h),p=i[h];this.setContent(y,p)}return this}getContent(n,i){const u=this.makeContentKey(n,i);return this.getContentInternal(u)}getRelationEntries(n){const i=n[this.a],u=n[this.b];if(i!==void 0&&u===void 0){const c=this.getRelatedKeys(i);if(c)return[...c].map(f=>[f,this.getContent(i,f)])}if(i===void 0&&u!==void 0){const c=this.getRelatedKeys(u);if(c)return[...c].map(f=>[f,this.getContent(f,u)])}return[]}has(n,i){if(i){const u=this.getRelatedKeys(n);return(u==null?void 0:u.has(i))??!1}return this.relations.has(n)}}class pn extends Map{constructor(i){super();j(this,"deleted",new Set);j(this,"source");this.source=i}get(i){if(super.has(i))return super.get(i);if(!this.deleted.has(i)&&this.source.has(i))return this.source.get(i)}set(i,u){return this.deleted.delete(i),super.set(i,u)}hasOwn(i){return super.has(i)}has(i){return!this.deleted.has(i)&&(super.has(i)||this.source.has(i))}delete(i){return this.deleted.add(i),super.delete(i)}}const gb=(s,n,i,u)=>{const c=re(s),f={parent:c,child:null,on:c.on,loggers:c.loggers,logger:c.logger,config:c.config,atoms:new pn(c.atoms),atomsThatAreDefault:new Set(c.atomsThatAreDefault),families:new pn(c.families),joins:new pn(c.joins),operation:{open:!1},readonlySelectors:new pn(c.readonlySelectors),timelines:new pn(c.timelines),timelineTopics:new Tt(c.timelineTopics.toJSON()),trackers:new Map,transactions:new pn(c.transactions),selectorAtoms:new Tt(c.selectorAtoms.toJSON()),selectorGraph:new Tt(c.selectorGraph.toJSON(),{makeContentKey:(...g)=>g.sort().join(":")}),selectors:new pn(c.selectors),valueMap:new pn(c.valueMap),defaults:c.defaults,disposalTraces:s.disposalTraces.copy(),molecules:new pn(c.molecules),moleculeGraph:new Tt(c.moleculeGraph.toJSON(),{makeContentKey:c.moleculeGraph.makeContentKey}),moleculeData:new Tt(c.moleculeData.toJSON(),{makeContentKey:c.moleculeData.makeContentKey}),moleculeJoins:new Tt(c.moleculeJoins.toJSON(),{makeContentKey:c.moleculeJoins.makeContentKey}),miscResources:new pn(c.miscResources)},h=bb(s,n),y={phase:"building",update:{type:"transaction_update",key:n,id:u,epoch:h===void 0?Number.NaN:h+1,updates:[],params:i,output:void 0},toolkit:{get:(...g)=>Wt(p,...g),set:(...g)=>{Ie(p,...g)},run:(g,S=mm())=>Zo(p,g,S),find:(g,S)=>pt(p,g,S),json:g=>$a(p,g),dispose:(...g)=>{Ku(p,...g)},env:()=>pb(p)}},p=Object.assign(f,{transactionMeta:y});return c.child=p,s.logger.info("🛫","transaction",n,"Building transaction with params:",i),p};function Sm(s,n){const i={key:n.key,type:"transaction",run:(f,h)=>{const y=gb(s,n.key,f,h);try{const p=re(s),{toolkit:g}=y.transactionMeta,S=n.do(g,...f);return mb(S,p),S}catch(p){throw Fv(u),s.logger.warn("💥","transaction",n.key,"caught:",p),p}},install:f=>Sm(f,n),subject:new We},u=re(s);u.transactions.set(i.key,i);const c=Ui(i);return s.on.transactionCreation.next(c),c}function vb(s,n){return rn(s)&&n?s.transactionMeta.epoch.get(n):void 0}function bb(s,n){const i=rn(s),u=i?s.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return i&&u!==void 0?s.transactionMeta.epoch.get(u):void 0}function _b(s){return Sm(et.STORE,s)}function Sb(s,n=mm()){return Zo(et.STORE,s,n)}class Tb{constructor(n,i=null){j(this,"parent",null);j(this,"child",null);j(this,"valueMap",new Map);j(this,"defaults",new Map);j(this,"atoms",new Map);j(this,"selectors",new Map);j(this,"readonlySelectors",new Map);j(this,"atomsThatAreDefault",new Set);j(this,"selectorAtoms",new Tt({between:["selectorKey","atomKey"],cardinality:"n:n"}));j(this,"selectorGraph",new Tt({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"trackers",new Map);j(this,"families",new Map);j(this,"joins",new Map);j(this,"transactions",new Map);j(this,"transactionMeta",{epoch:new Map,actionContinuities:new Tt({between:["continuity","action"],cardinality:"1:n"})});j(this,"timelines",new Map);j(this,"timelineTopics",new Tt({between:["timelineKey","topicKey"],cardinality:"1:n"}));j(this,"disposalTraces",new jo(100));j(this,"molecules",new Map);j(this,"moleculeJoins",new Tt({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"moleculeGraph",new Tt({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"moleculeData",new Tt({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));j(this,"miscResources",new Map);j(this,"on",{atomCreation:new We,atomDisposal:new We,selectorCreation:new We,selectorDisposal:new We,timelineCreation:new We,transactionCreation:new We,transactionApplying:new Zv(null),operationClose:new We,moleculeCreation:new We,moleculeDisposal:new We});j(this,"operation",{open:!1});j(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});j(this,"loggers",[new Xv("warn",(n,i,u)=>!u.includes("🔍"))]);j(this,"logger",{error:(...n)=>{for(const i of this.loggers)i.error(...n)},info:(...n)=>{for(const i of this.loggers)i.info(...n)},warn:(...n)=>{for(const i of this.loggers)i.warn(...n)}});var u,c;if(this.config={...i==null?void 0:i.config,...n},i!==null){this.valueMap=new Map(i==null?void 0:i.valueMap),this.operation={...i==null?void 0:i.operation},rn(i)&&(this.transactionMeta={epoch:new Map(i==null?void 0:i.transactionMeta.epoch),actionContinuities:new Tt(i==null?void 0:i.transactionMeta.actionContinuities.toJSON())});for(const[,h]of i.families)(u=h.internalRoles)!=null&&u.includes("mutable")||(c=h.internalRoles)!=null&&c.includes("join")||h.install(this);const f=new Set;for(const[,h]of i.atoms)if(!f.has(h.key)&&(h.install(this),h.type==="mutable_atom")){const y=$a(i,h),p=wm(h);f.add(y.key),f.add(p.key)}for(const[,h]of i.readonlySelectors)h.install(this);for(const[,h]of i.selectors)f.has(h.key)||h.install(this);for(const[,h]of i.transactions)h.install(this);for(const[,h]of i.timelines)h.install(this)}}}const et={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE||(globalThis.ATOM_IO_IMPLICIT_STORE=new Tb({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function rt(s,n){let i,u=s;for(;u!==null;){switch(n.type){case"atom":case"mutable_atom":i=u.atoms.get(n.key);break;case"selector":i=u.selectors.get(n.key);break;case"readonly_selector":i=u.readonlySelectors.get(n.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":i=u.families.get(n.key);break;case"timeline":i=u.timelines.get(n.key);break;case"transaction":i=u.transactions.get(n.key);break}if(i)return i;u=u.child}throw new qo(n,s)}function Eb(s,n,i){const u=s.families.get(n.key);if(u===void 0)throw new qo(n,s);const c=u(i),f=re(s);if(c.family)if(rn(f))switch(c.type){case"atom":case"mutable_atom":s.on.atomCreation.next(c);break;case"selector":case"readonly_selector":s.on.selectorCreation.next(c);break}else gt(f)&&f.on.transactionApplying.state===null&&f.transactionMeta.update.updates.push({type:"state_creation",token:c});return c}function Ab(s,n,i){const u=Ke(i),c=`${n.key}(${u})`,f=re(s);let h;switch(n.type){case"atom_family":case"mutable_atom_family":h=f.atoms.get(c);break;case"selector_family":h=f.selectors.get(c);break;case"readonly_selector_family":h=f.readonlySelectors.get(c);break}return h&&Ui(h)}function pt(s,n,i){let u=Ab(s,n,i);if(u)return u;const c=Ke(i),f=s.molecules.get(c);if(!f&&s.config.lifespan==="immortal"){const h=Lv(n,i);return s.logger.error("❌",h.type,h.key,`was not found in store "${s.config.name}"; returned a counterfeit token.`),h}return u=Eb(s,n,i),f&&re(s).moleculeData.set(c,n.key),u}function Ku(s,...n){let i;if(n.length===1)i=n[0];else{const u=n[0],c=n[1];i=pt(s,u,c)}try{rt(s,i)}catch{s.logger.error("❌",i.type,i.key,`could not be disposed because it was not found in the store "${s.config.name}".`);return}switch(i.type){case"atom":case"mutable_atom":Qo(s,i);break;case"selector":case"readonly_selector":Mb(s,i);break}}const Lo=(s,n)=>re(s).atoms.has(n),Ob=(s,n)=>re(s).selectors.has(n),wb=(s,n)=>re(s).readonlySelectors.has(n),Rb=(s,n)=>Lo(s,n)||Ob(s,n)||wb(s,n),bo=(s,n)=>re(n).selectorGraph.getRelationEntries({downstreamSelectorKey:s}).filter(([u,{source:c}])=>c!==s).map(([u,{source:c}])=>c).filter(u=>Rb(n,u)),Tm=(s,n,i)=>{const u=[],c=bo(s,i);for(;c.length>0;){const f=c.shift();n.has(f)||(n.add(f),Lo(i,f)?u.includes(f)||u.push(f):c.push(...bo(f,i)))}return u},xb=(s,n)=>{const i=s.key,u=bo(i,n),c=new Set;return u.flatMap(f=>Lo(n,f)?f:Tm(f,c,n))},kb=(s,n,i,u)=>{const c=re(u);if(n.type==="atom"||n.type==="mutable_atom")c.selectorAtoms.set({selectorKey:s,atomKey:n.key}),u.logger.info("🔍","selector",s,`discovers root atom "${n.key}"`);else{const f=Tm(n.key,i,u);u.logger.info("🔍","selector",s,`discovers root atoms: [ ${f.map(h=>`"${h}"`).join(", ")} ]`);for(const h of f)c.selectorAtoms=c.selectorAtoms.set({selectorKey:s,atomKey:h})}i.add(n.key)},Em=(s,n,i)=>({get:(...u)=>{const c=re(i);let f;if(u.length===2){const[p,g]=u;f=pt(i,p,g)}else[f]=u;const h=rt(i,f),y=Lu(i,h);return i.logger.info("🔌","selector",s,`registers dependency ( "${f.key}" =`,y,")"),c.selectorGraph.set({upstreamSelectorKey:f.key,downstreamSelectorKey:s},{source:f.key}),kb(s,f,n,i),y},set:(...u)=>{let c,f;if(u.length===2)c=u[0],f=u[1];else{const p=u[0],g=u[1];f=u[2],c=pt(i,p,g)}const h=re(i),y=rt(h,c);vm(h,y,f)},find:(u,c)=>pt(i,u,c),json:u=>$a(i,u)}),Ko=(s,n,i)=>{const u=re(s),c=new We,f=new Set,{get:h,find:y,json:p}=Em(n.key,f,u),g=()=>{const U=n.get({get:h,find:y,json:p});return La(re(s),n.key,U,c),f.clear(),U},S={...n,subject:c,install:U=>Ko(U,n,i),get:g,type:"readonly_selector",...i&&{family:i}};u.readonlySelectors.set(n.key,S);const w=g();s.logger.info("✨",S.type,S.key,"=",w);const C={key:n.key,type:"readonly_selector"};return i&&(C.family=i),C},Yo=(s,n,i)=>{const u=re(s),c=new We,f=new Set,h=Em(n.key,f,u),{find:y,get:p,json:g}=h,S={find:y,get:p,json:g},w=(fe=n.get,de=re(s))=>{const he=fe(S);return La(de,n.key,he,c),f.clear(),he},U={...n,subject:c,install:fe=>Yo(fe,n,i),get:w,set:fe=>{const de=re(s),he=w(n.get,de),Ye=gm(fe)(he);s.logger.info("📝","selector",n.key,"set (",he,"->",Ye,")"),La(de,n.key,Ye,c),Ho(de,n.key),rn(de)&&c.next({newValue:Ye,oldValue:he}),n.set(h,Ye)},type:"selector",...i&&{family:i}};u.selectors.set(n.key,U);const Q=w();s.logger.info("✨",U.type,U.key,"=",Q);const L={key:n.key,type:"selector"};return i&&(L.family=i),L};function Am(s,n){if("set"in n){const c=Yo(s,n,void 0);return s.on.selectorCreation.next(c),c}const u=Ko(s,n,void 0);return s.on.selectorCreation.next(u),u}function Mb(s,n){const i=re(s),{key:u}=n,c=rt(i,n);if(!c.family)s.logger.error("❌","selector",u,"Standalone selectors cannot be disposed.");else{i.molecules.get(c.family.subKey)&&i.moleculeData.delete(c.family.subKey,c.family.key);let h;switch(n.type){case"selector":i.selectors.delete(u),h={key:c.family.key,type:"selector_family"},rt(s,h).subject.next({type:"state_disposal",subType:"selector",token:n});break;case"readonly_selector":i.readonlySelectors.delete(u),h={key:c.family.key,type:"readonly_selector_family"},rt(s,h).subject.next({type:"state_disposal",subType:"selector",token:n});break}i.valueMap.delete(u),i.selectorAtoms.delete(u),i.selectorGraph.delete(u),s.logger.info("🔥",n.type,u,"deleted"),gt(i)&&i.transactionMeta.phase==="building"?i.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:n}):s.on.selectorDisposal.next(n)}}function Go(s,n,i){const u={key:n.key,type:"selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","selector_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U=Yo(C,{key:w,get:n.get(p),set:n.set(p)},S);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Go(p,n),default:p=>n.get(p)({get:(...S)=>Wt(s,...S),find:(S,w)=>pt(s,S,w),json:S=>$a(s,S)})});return s.families.set(n.key,y),u}function Nb(s,n,i){return Go(s,{key:`${n.key}:JSON`,get:c=>({get:f})=>{const h=f(n,c);return i.toJson(h)},set:c=>({set:f},h)=>{f(n,c,i.fromJson(h))}},["mutable","json"])}const Vi=s=>JSON.parse(s),Ke=s=>JSON.stringify(s),Cb=(s,n)=>{const i=re(s);return i.operation.open?i.operation.prev.get(n.key):i.valueMap.get(n.key)},Qy=(s,n)=>{const i=re(s);return xb(n,s).map(c=>{const f=i.atoms.get(c);if(f===void 0)throw new Error(`Atom "${c}", a dependency of selector "${n.key}", not found in store "${s.config.name}".`);return f.subject.subscribe(`${n.type}:${n.key}`,h=>{s.logger.info("📢",n.type,n.key,"root",c,"went",h.oldValue,"->",h.newValue);const y=Cb(i,n),p=Lu(i,n);s.logger.info("✨",n.type,n.key,"went",y,"->",p),n.subject.next({newValue:p,oldValue:y})})})};function $l(s,n,i,u){function c(w){if(s.operation.open){const C=s.on.operationClose.subscribe(`state subscription ${i}`,()=>{C(),u(w)})}else u(w)}const f=rt(s,n);s.logger.info("👀",f.type,f.key,`Adding subscription "${i}"`);const h=f.type==="selector"||f.type==="readonly_selector";let y=null,p=c;h&&(y=Qy(s,f),p=w=>{y&&(y.length=0,y.push(...Qy(s,f))),c(w)});const g=f.subject.subscribe(i,p);return()=>{if(s.logger.info("🙈",f.type,f.key,`Removing subscription "${i}"`),g(),y)for(const w of y)w()}}const Db=(s,n,i,u)=>{const c=rt(s,n);s.logger.info("👀","timeline",n.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,u);return()=>{s.logger.info("🙈","timeline",n.key,`Removing subscription "${i}" from timeline`),f()}},zb=(s,n,i,u)=>{const c=rt(s,n);s.logger.info("👀","transaction",n.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,u);return()=>{s.logger.info("🙈","transaction",n.key,`Removing subscription "${i}"`),f()}};var ym;ym=Symbol.dispose;class Xo{constructor(n,i){j(this,"Update");j(this,"unsubscribeFromInnerValue");j(this,"unsubscribeFromState");j(this,"mutableState");j(this,"latestUpdateState");j(this,ym);this.mutableState=n;const u=re(i);this.latestUpdateState=this.initializeState(n,u),this.observeCore(n,this.latestUpdateState,u),this.updateCore(n,this.latestUpdateState,u),u.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),u.trackers.delete(n.key)}}initializeState(n,i){var h;const u=`*${n.key}`;i.atoms.delete(u),i.valueMap.delete(u);const c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,f=Yu(i,{key:u,default:null},c);if((h=i.parent)!=null&&h.valueMap.has(u)){const y=i.parent.valueMap.get(u);i.valueMap.set(u,y)}return f}observeCore(n,i,u){const c=`tracker:${u.config.name}:${gt(u)?u.transactionMeta.update.key:"main"}:${n.key}`,f=Wt(u,n);this.unsubscribeFromInnerValue=f.subscribe(c,h=>{Ie(u,i,h)}),this.unsubscribeFromState=$l(u,n,c,h=>{h.newValue!==h.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=h.newValue.subscribe(c,y=>{Ie(u,i,y)}))})}updateCore(n,i,u){const c=`tracker:${u.config.name}:${gt(u)?u.transactionMeta.update.key:"main"}:${n.key}`;$l(u,i,c,({newValue:f,oldValue:h})=>{const y=u.timelineTopics.getRelatedKey(i.key);if(y){const g=u.timelines.get(y);if(g!=null&&g.timeTraveling){const S=Db(u,{key:y,type:"timeline"},c,w=>{S(),Ie(u,n,C=>(w==="redo"&&f?C.do(f):w==="undo"&&h&&C.undo(h),C))});return}}const p=u.on.operationClose.subscribe(c,()=>{p();const g=Wt(u,n),S=f===null?-1:g.getUpdateNumber(f),w=S-g.cacheUpdateNumber;f&&w===1?Ie(u,n,C=>(C.do(f),C)):u.logger.info("❌","mutable_atom",n.key,`could not be updated. Expected update number ${g.cacheUpdateNumber+1}, but got ${S}`)})})}}function $o(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="mutable_atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Ui(c);const f=new We,h={...n,type:"mutable_atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),$o(g,n,i)),subject:f};i&&(h.family=i);const y=n.default();u.atoms.set(h.key,h),Rm(s,n.key),La(u,n.key,y,f);const p=Ui(h);if(n.effects){let g=0;const S=[];for(const w of n.effects){const C=w({setSelf:U=>{Ie(s,p,U)},onSet:U=>$l(s,p,`effect[${g}]`,U)});C&&S.push(C),++g}h.cleanup=()=>{for(const w of S)w()}}return new Xo(p,s),i||qv(p,n,s),p}class Ub{constructor(n,i){j(this,"trackers",new Map);j(this,"Update");j(this,"latestUpdateAtoms");j(this,"mutableAtoms");const u=Uo(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=rt(i,u),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,c=>{const{type:f,token:h}=c;if(h.family){const y=Vi(h.family.subKey);switch(f){case"state_creation":this.trackers.set(y,new Xo(h,i));break;case"state_disposal":{const p=this.trackers.get(y);p&&(p[Symbol.dispose](),this.trackers.delete(y))}break}}})}}function Om(s,n,i){const u={key:n.key,type:"mutable_atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","mutable_atom_family",n.key,`Overwriting an existing ${rs(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,y=Object.assign(p=>{const g=Ke(p),S={key:n.key,subKey:g},w=`${n.key}(${g})`,C=re(s),U={key:w,default:()=>n.default(p),toJson:n.toJson,fromJson:n.fromJson,mutable:!0};n.effects&&(U.effects=n.effects(p));const Q=$o(C,U,S);return f.next({type:"state_creation",token:Q}),Q},u,{subject:f,install:p=>Om(p,n),toJson:n.toJson,fromJson:n.fromJson,internalRoles:i});return s.families.set(n.key,y),Nb(s,y,n),new Ub(y,s),u}const Jy=(s,n)=>{const i=re(n),u=`${s.key}:JSON`;return i.families.get(u)},$a=(s,n)=>{if(n.family){const u=re(s),f={key:`${n.family.key}:JSON`,type:"selector_family"},h=rt(u,f),y=JSON.parse(n.family.subKey);return pt(s,h,y)}return{type:"selector",key:`${n.key}:JSON`}},wm=s=>{const i={type:"atom",key:`*${s.key}`};return s.family&&(i.family={key:`*${s.family.key}`,subKey:s.family.subKey}),i};function jb(s){return typeof s=="object"&&s!==null&&"do"in s&&"undo"in s&&"subscribe"in s}function _o(s,n,i){const u=i.valueMap.get(n.key),c=s.valueMap.get(n.key);if(u===c){if(u===void 0)return typeof n.default=="function"?n.default():n.default;i.logger.info("📃","atom",n.key,"copying");const f=n.toJson(u),h=n.fromJson(f);return s.valueMap.set(n.key,h),new Xo(n,i),h}return c}function La(s,n,i,u){const c=s.valueMap.get(n);if(c instanceof go&&c.use(i),i instanceof Promise){const f=new go(i);return s.valueMap.set(n,f),f.then(h=>{La(s,n,h,u),u.next({newValue:h,oldValue:f})}).catch(h=>{s.logger.error("💥","state",n,"rejected:",h)}),f}return s.valueMap.set(n,i),i}const Bb=(s,n)=>{let i=n.valueMap.get(s.key);if(s.type==="mutable_atom"&>(n)){const{parent:u}=n;i=_o(n,s,u)}return i},qb=(s,n)=>{const i=n.valueMap.get(s);if(i instanceof go){const u=i,c=n.selectors.get(s)??n.readonlySelectors.get(s);c&&u.use(c.get());return}n.operation.open&&n.operation.prev.set(s,i),n.valueMap.delete(s),n.logger.info("🗑","state",s,"evicted")},Zb=(s,n)=>re(s).atomsThatAreDefault.has(n),Rm=(s,n)=>{const i=re(s);i.atomsThatAreDefault=new Set(i.atomsThatAreDefault).add(n)},Hb=(s,n)=>{const i=re(s);i.atomsThatAreDefault=new Set(re(s).atomsThatAreDefault),i.atomsThatAreDefault.delete(n)};function Yu(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Ui(c);const f=new We,h={...n,type:"atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),Yu(g,n,i)),subject:f};i&&(h.family=i);let y=n.default;n.default instanceof Function&&(y=n.default()),u.atoms.set(h.key,h),Rm(s,n.key),La(u,n.key,y,f);const p=Ui(h);if(n.effects){let g=0;const S=[];for(const w of n.effects){const C=w({setSelf:U=>{Ie(s,p,U)},onSet:U=>$l(s,p,`effect[${g}]`,U)});C&&S.push(C),++g}h.cleanup=()=>{for(const w of S)w()}}return p}function Vb(s,n){if("mutable"in n){const c=$o(s,n,void 0);return s.on.atomCreation.next(c),c}const u=Yu(s,n,void 0);return s.on.atomCreation.next(u),u}function Qo(s,n){var h;const i=re(s),{key:u,family:c}=n,f=rt(i,n);if(!c)s.logger.error("❌","atom",u,"Standalone atoms cannot be disposed.");else{(h=f.cleanup)==null||h.call(f);const y=s.valueMap.get(f.key),p=rt(s,{key:c.key,type:"atom_family"}),g={type:"state_disposal",subType:"atom",token:n,value:y};p.subject.next(g);const S=gt(i);if(i.atoms.delete(u),i.valueMap.delete(u),i.selectorAtoms.delete(u),i.atomsThatAreDefault.delete(u),s.timelineTopics.delete(u),n.type==="mutable_atom"){const w=wm(n);Qo(s,w),s.trackers.delete(u)}if(s.logger.info("🔥","atom",u,"deleted"),S&&i.transactionMeta.phase==="building"){const w=i.transactionMeta.update.updates.at(-1);(w==null?void 0:w.type)==="molecule_disposal"&&w.values.some(([Q])=>{var L;return Q===((L=f.family)==null?void 0:L.key)})||i.transactionMeta.update.updates.push(g)}else s.on.atomDisposal.next(n)}}class gn extends Set{constructor(i,u=0){super(i);j(this,"mode","record");j(this,"subject",new We);j(this,"cacheLimit",0);j(this,"cache",[]);j(this,"cacheIdx",-1);j(this,"cacheUpdateNumber",-1);j(this,"parent");j(this,"child",null);j(this,"transactionUpdates",null);i instanceof gn&&(this.parent=i,this.cacheUpdateNumber=i.cacheUpdateNumber),u&&(this.cacheLimit=u,this.cache=new Array(u),this.subscribe("auto cache",c=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=c}))}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(i){const u=new gn(i.members,i.cacheLimit);return u.cache=i.cache,u.cacheIdx=i.cacheIdx,u.cacheUpdateNumber=i.cacheUpdateNumber,u}add(i){const u=super.add(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`add:${Ke(i)}`)),u}clear(){const i=this.mode==="record"?[...this]:null;super.clear(),i&&(this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(i)}`))}delete(i){const u=super.delete(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`del:${Ke(i)}`)),u}transaction(i){this.mode="transaction",this.transactionUpdates=[],this.child=new gn(this);const u=this.child._subscribe("transaction",c=>{var f;(f=this.transactionUpdates)==null||f.push(c)});try{if(i(this.child)){for(const f of this.transactionUpdates)this.doStep(f);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(c){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",c),c}finally{u(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(i,u){return this.subject.subscribe(i,u)}subscribe(i,u){return this.subject.subscribe(i,c=>{u(`${this.cacheUpdateNumber}=${c}`)})}emit(i){this.subject.next(i)}doStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.add(JSON.parse(f));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(f));break;case"tx":for(const h of f.split(";"))this.doStep(h)}}getUpdateNumber(i){const u=i.indexOf("=");return Number(i.substring(0,u))}do(i){const u=i.indexOf("="),c=Number(i.substring(0,u)),f=c-this.cacheUpdateNumber;if(f>0){if(f===1){this.mode="playback";const y=i.substring(u+1);return this.doStep(y),this.mode="record",this.cacheUpdateNumber=c,null}return this.cacheUpdateNumber+1}if(Math.abs(f)<this.cacheLimit){const y=this.cacheIdx+f;if(this.cache[y]===i)return null;this.mode="playback";let g=!1;for(;!g;){this.cacheIdx%=this.cacheLimit;const w=this.cache[this.cacheIdx];if(this.cacheIdx--,!w)return"OUT_OF_RANGE";this.undo(w),g=this.cacheIdx===y-1}const S=i.substring(u+1);return this.doStep(S),this.mode="record",this.cacheUpdateNumber=c,null}return"OUT_OF_RANGE"}undoStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.delete(JSON.parse(f));break;case"del":this.add(JSON.parse(f));break;case"clear":{const h=JSON.parse(f);for(const y of h)this.add(y);break}case"tx":{const h=f.split(";");for(let y=h.length-1;y>=0;y--)this.undoStep(h[y])}}}undo(i){const u=i.indexOf("=");if(Number(i.substring(0,u))===this.cacheUpdateNumber){this.mode="playback";const f=i.substring(u+1);return this.undoStep(f),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class xm{constructor(n,i,u=et.STORE){j(this,"toolkit");j(this,"options");j(this,"defaultContent");j(this,"molecules",new Map);j(this,"relations");j(this,"states");j(this,"core");j(this,"store");j(this,"realm");this.store=u,this.realm=new Qv(u),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...N)=>Wt(u,...N),set:(...N)=>{Ie(u,...N)},find:(...N)=>pt(u,...N),json:N=>$a(u,N)};const c=n.between[0],f=n.between[1],h=Om(u,{key:`${n.key}/relatedKeys`,default:()=>new gn,mutable:!0,fromJson:N=>gn.fromJSON(N),toJson:N=>N.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:h};const y=({get:N},K)=>N(h,K),p=({set:N},K,se)=>{this.store.molecules.has(Ke(K))||this.realm.allocate(n.key,K),N(h,K,W=>W.add(se)),N(h,se,W=>W.add(K))},g=({set:N},K,se)=>{N(h,K,W=>(W.delete(se),W)),N(h,se,W=>(W.delete(K),W))},S=(N,K,se)=>{const{find:W,get:B,set:X}=N,we=W(h,K),Ge=B(we);for(const Ce of Ge)se.includes(Ce)||X(h,Ce,Ue=>(Ue.delete(K),Ue));X(we,Ce=>(Ce.transaction(at=>{at.clear();for(const Ue of se){const Z=y(N,Ue),ie=Z.has(K);if(this.relations.cardinality==="1:n"){const I=[];for(const Ee of Z){if(Ee===K)continue;const b=y(N,Ee);b.delete(Ue),b.size===0&&I.push(Ee)}!ie&&Z.size>0&&Z.clear();for(const Ee of I){const b=[Ue,Ee].sort(),D=`"${b[0]}:${b[1]}"`;this.molecules.delete(D)}}ie||Z.add(K),at.add(Ue)}return!0}),Ce))},w=(N,K,se)=>{const{set:W}=N;W(h,K,B=>(B.transaction(X=>{for(const we of se)X.add(we);return!0}),B));for(const B of se)W(h,B,X=>(X.add(K),X));return!0},C=(N,K,se)=>{const W=y(N,K);return se?W.has(se):W.size>0},U={getRelatedKeys:N=>y(this.toolkit,N),addRelation:(N,K)=>{this.store.moleculeJoins.set(N,n.key),this.store.moleculeJoins.set(K,n.key),p(this.toolkit,N,K)},deleteRelation:(N,K)=>{g(this.toolkit,N,K)},replaceRelationsSafely:(N,K)=>{S(this.toolkit,N,K)},replaceRelationsUnsafely:(N,K)=>{w(this.toolkit,N,K)},has:(N,K)=>C(this.toolkit,N,K)};let Q,L;if(i){L=Uo(u,{key:`${n.key}/content`,default:i},["join","content"]);const N=({get:W},B)=>W(L,B),K=({set:W},B,X)=>{W(L,B,X)};Q=Object.assign(U,{getContent:W=>N(this.toolkit,W),setContent:(W,B)=>{K(this.toolkit,W,B)},deleteContent:W=>{this.realm.deallocate(W)}})}else Q=U;const fe=new Tt(n,{externalStore:Q,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...N)=>{const[K,se]=N,W=N.sort(),B=`${W[0]}:${W[1]}`,X=u.molecules.get(Ke(K)),we=u.molecules.get(Ke(se));return X||this.realm.allocate(n.key,K),we||this.realm.allocate(n.key,se),this.realm.allocate(K,B,"all"),this.realm.claim(se,B),this.store.moleculeJoins.set(B,n.key),B}}),de=()=>Ni(u,{key:`${n.key}/singleRelatedKey`,get:N=>({get:K})=>{const se=K(h,N);for(const W of se)return W;return null}},["join","keys"]),he=()=>Ni(u,{key:`${n.key}/multipleRelatedKeys`,get:N=>({get:K})=>{const se=Jy(h,u);return K(se,N).members}},["join","keys"]),Ye=()=>Ni(u,{key:`${n.key}/singleRelatedEntry`,get:N=>({get:K})=>{var W;const se=K(h,N);for(const B of se){let X=(W=fe.isAType)!=null&&W.call(fe,N)?N:void 0,we=X===void 0?N:void 0;X??(X=B),we??(we=B);const Ge=fe.makeContentKey(X,we),Ce=K(L,Ge);return[B,Ce]}return null}},["join","entries"]),It=()=>Ni(u,{key:`${n.key}/multipleRelatedEntries`,get:N=>({get:K})=>{const se=Jy(h,u);return K(se,N).members.map(B=>{var at;let X=(at=fe.isAType)!=null&&at.call(fe,N)?N:void 0,we=X===void 0?N:void 0;X??(X=B),we??(we=B);const Ge=fe.makeContentKey(X,we),Ce=K(L,Ge);return[B,Ce]})}},["join","entries"]);switch(n.cardinality){case"1:1":{const N=de(),K=`${c}KeyOf${zt(f)}`,se=`${f}KeyOf${zt(c)}`,W={[K]:N,[se]:N};let B;if(i){const X=Ye(),we=`${c}EntryOf${zt(f)}`,Ge=`${f}EntryOf${zt(c)}`,Ce={[we]:X,[Ge]:X};B=Object.assign(W,Ce)}else B=W;this.relations=fe,this.states=B;break}case"1:n":{const N=de(),K=he(),se=`${c}KeyOf${zt(f)}`,W=`${f}KeysOf${zt(c)}`,B={[se]:N,[W]:K};let X;if(i){const we=Ye(),Ge=It(),Ce=`${c}EntryOf${zt(f)}`,at=`${f}EntriesOf${zt(c)}`,Ue={[Ce]:we,[at]:Ge};X=Object.assign(B,Ue)}else X=B;this.relations=fe,this.states=X;break}case"n:n":{const N=he(),K=`${c}KeysOf${zt(f)}`,se=`${f}KeysOf${zt(c)}`,W={[K]:N,[se]:N};let B;if(i){const X=It(),we=`${c}EntriesOf${zt(f)}`,Ge=`${f}EntriesOf${zt(c)}`,Ce={[we]:X,[Ge]:X};B=Object.assign(W,Ce)}else B=W;this.relations=fe,this.states=B}}}transact(n,i){const u=this.toolkit;this.toolkit=n,i(this),this.toolkit=u}[Symbol.dispose](){}}function Lb(s,n){let i=n.joins.get(s.key);if(i===void 0){const c=et.STORE.joins.get(s.key);if(c===void 0)throw new Error(`Join "${s.key}" not found in store "${n.config.name}"`);i=new xm(c.options,c.defaultContent,n),n.joins.set(s.key,i)}return i}function Kb(s,n){return Lb(s,n).core.relatedKeysAtoms}var so={exports:{}},ce={};/**
|
|
23
23
|
* @license React
|
|
24
24
|
* react.production.js
|
|
25
25
|
*
|
|
@@ -59,4 +59,4 @@ ${h.trace}`:"No previous disposal trace was found."),u.type){case"atom_family":c
|
|
|
59
59
|
`+v[l].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),x}while(1<=l&&0<=r);break}}}finally{at=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ce(a):""}function Z(e){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce("Lazy");case 13:return Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return e=Ue(e.type,!1),e;case 11:return e=Ue(e.type.render,!1),e;case 1:return e=Ue(e.type,!0),e;default:return""}}function ie(e){try{var t="";do t+=Z(e),e=e.return;while(e);return t}catch(a){return`
|
|
60
60
|
Error generating stack: `+a.message+`
|
|
61
61
|
`+a.stack}}function I(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Ee(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(I(e)!==e)throw Error(u(188))}function D(e){var t=e.alternate;if(!t){if(t=I(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,l=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(l=r.return,l!==null){a=l;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return b(r),e;if(o===l)return b(r),t;o=o.sibling}throw Error(u(188))}if(a.return!==l.return)a=r,l=o;else{for(var d=!1,m=r.child;m;){if(m===a){d=!0,a=r,l=o;break}if(m===l){d=!0,l=r,a=o;break}m=m.sibling}if(!d){for(m=o.child;m;){if(m===a){d=!0,a=o,l=r;break}if(m===l){d=!0,l=o,a=r;break}m=m.sibling}if(!d)throw Error(u(189))}}if(a.alternate!==l)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function te(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=te(e),t!==null)return t;e=e.sibling}return null}var P=Array.isArray,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ye=[],bt=-1;function Re(e){return{current:e}}function $e(e){0>bt||(e.current=ye[bt],ye[bt]=null,bt--)}function je(e,t){bt++,ye[bt]=e.current,e.current=t}var cn=Re(null),Ki=Re(null),Kn=Re(null),ds=Re(null);function hs(e,t){switch(je(Kn,t),je(Ki,e),je(cn,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?_y(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=_y(e),t=Sy(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$e(cn),je(cn,t)}function Qa(){$e(cn),$e(Ki),$e(Kn)}function Ju(e){e.memoizedState!==null&&je(ds,e);var t=cn.current,a=Sy(t,e.type);t!==a&&(je(Ki,e),je(cn,a))}function ys(e){Ki.current===e&&($e(cn),$e(Ki)),ds.current===e&&($e(ds),Ul._currentValue=_e)}var Fu=Object.prototype.hasOwnProperty,Wu=s.unstable_scheduleCallback,Iu=s.unstable_cancelCallback,dp=s.unstable_shouldYield,hp=s.unstable_requestPaint,on=s.unstable_now,yp=s.unstable_getCurrentPriorityLevel,cf=s.unstable_ImmediatePriority,of=s.unstable_UserBlockingPriority,ms=s.unstable_NormalPriority,mp=s.unstable_LowPriority,ff=s.unstable_IdlePriority,pp=s.log,gp=s.unstable_setDisableYieldValue,Yi=null,Rt=null;function vp(e){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Yi,e,void 0,(e.current.flags&128)===128)}catch{}}function Yn(e){if(typeof pp=="function"&&gp(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Yi,e)}catch{}}var xt=Math.clz32?Math.clz32:Sp,bp=Math.log,_p=Math.LN2;function Sp(e){return e>>>=0,e===0?32:31-(bp(e)/_p|0)|0}var ps=128,gs=4194304;function va(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function vs(e,t){var a=e.pendingLanes;if(a===0)return 0;var l=0,r=e.suspendedLanes,o=e.pingedLanes,d=e.warmLanes;e=e.finishedLanes!==0;var m=a&134217727;return m!==0?(a=m&~r,a!==0?l=va(a):(o&=m,o!==0?l=va(o):e||(d=m&~d,d!==0&&(l=va(d))))):(m=a&~r,m!==0?l=va(m):o!==0?l=va(o):e||(d=a&~d,d!==0&&(l=va(d)))),l===0?0:t!==0&&t!==l&&(t&r)===0&&(r=l&-l,d=t&-t,r>=d||r===32&&(d&4194176)!==0)?t:l}function Gi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tp(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function df(){var e=ps;return ps<<=1,(ps&4194176)===0&&(ps=128),e}function hf(){var e=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),e}function Pu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Xi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ep(e,t,a,l,r,o){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var m=e.entanglements,v=e.expirationTimes,T=e.hiddenUpdates;for(a=d&~a;0<a;){var x=31-xt(a),M=1<<x;m[x]=0,v[x]=-1;var O=T[x];if(O!==null)for(T[x]=null,x=0;x<O.length;x++){var R=O[x];R!==null&&(R.lane&=-536870913)}a&=~M}l!==0&&yf(e,l,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(d&~t))}function yf(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-xt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&4194218}function mf(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-xt(a),r=1<<l;r&t|e[l]&t&&(e[l]|=t),a&=~r}}function pf(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gf(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Zy(e.type))}function Ap(e,t){var a=Y.p;try{return Y.p=e,t()}finally{Y.p=a}}var Gn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Gn,At="__reactProps$"+Gn,Ja="__reactContainer$"+Gn,er="__reactEvents$"+Gn,Op="__reactListeners$"+Gn,wp="__reactHandles$"+Gn,vf="__reactResources$"+Gn,$i="__reactMarker$"+Gn;function tr(e){delete e[ht],delete e[At],delete e[er],delete e[Op],delete e[wp]}function ba(e){var t=e[ht];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Ja]||a[ht]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Ay(e);e!==null;){if(a=e[ht])return a;e=Ay(e)}return t}e=a,a=e.parentNode}return null}function Fa(e){if(e=e[ht]||e[Ja]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Qi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Wa(e){var t=e[vf];return t||(t=e[vf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[$i]=!0}var bf=new Set,_f={};function _a(e,t){Ia(e,t),Ia(e+"Capture",t)}function Ia(e,t){for(_f[e]=t,e=0;e<t.length;e++)bf.add(t[e])}var En=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Sf={},Tf={};function xp(e){return Fu.call(Tf,e)?!0:Fu.call(Sf,e)?!1:Rp.test(e)?Tf[e]=!0:(Sf[e]=!0,!1)}function bs(e,t,a){if(xp(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function _s(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function An(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function qt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ef(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kp(e){var t=Ef(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(d){l=""+d,o.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ss(e){e._valueTracker||(e._valueTracker=kp(e))}function Af(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Ef(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Ts(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Mp=/[\n"\\]/g;function Zt(e){return e.replace(Mp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function nr(e,t,a,l,r,o,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qt(t)):e.value!==""+qt(t)&&(e.value=""+qt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?ar(e,d,qt(t)):a!=null?ar(e,d,qt(a)):l!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+qt(m):e.removeAttribute("name")}function Of(e,t,a,l,r,o,d,m){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null))return;a=a!=null?""+qt(a):"",t=t!=null?""+qt(t):a,m||t===e.value||(e.value=t),e.defaultValue=t}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d)}function ar(e,t,a){t==="number"&&Ts(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Pa(e,t,a,l){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&l&&(e[a].defaultSelected=!0)}else{for(a=""+qt(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,l&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function wf(e,t,a){if(t!=null&&(t=""+qt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+qt(a):""}function Rf(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(u(92));if(P(l)){if(1<l.length)throw Error(u(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=qt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l)}function ei(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Np=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Np.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function kf(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var r in t)l=t[r],t.hasOwnProperty(r)&&a[r]!==l&&xf(e,r,l)}else for(var o in t)t.hasOwnProperty(o)&&xf(e,o,t[o])}function ir(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Es(e){return Dp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var lr=null;function sr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,ni=null;function Mf(e){var t=Fa(e);if(t&&(e=t.stateNode)){var a=e[At]||null;e:switch(e=t.stateNode,t.type){case"input":if(nr(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var r=l[At]||null;if(!r)throw Error(u(90));nr(l,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Af(l)}break e;case"textarea":wf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Pa(e,!!a.multiple,t,!1)}}}var ur=!1;function Nf(e,t,a){if(ur)return e(t,a);ur=!0;try{var l=e(t);return l}finally{if(ur=!1,(ti!==null||ni!==null)&&(su(),ti&&(t=ti,e=ni,ni=ti=null,Mf(t),e)))for(t=0;t<e.length;t++)Mf(e[t])}}function Ji(e,t){var a=e.stateNode;if(a===null)return null;var l=a[At]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var rr=!1;if(En)try{var Fi={};Object.defineProperty(Fi,"passive",{get:function(){rr=!0}}),window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch{rr=!1}var Xn=null,cr=null,As=null;function Cf(){if(As)return As;var e,t=cr,a=t.length,l,r="value"in Xn?Xn.value:Xn.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===r[o-l];l++);return As=r.slice(e,1<l?1-l:void 0)}function Os(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ws(){return!0}function Df(){return!1}function Ot(e){function t(a,l,r,o,d){this._reactName=a,this._targetInst=r,this.type=l,this.nativeEvent=o,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(a=e[m],this[m]=a?a(o):o[m]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ws:Df,this.isPropagationStopped=Df,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ws)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ws)},persist:function(){},isPersistent:ws}),t}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rs=Ot(Sa),Wi=X({},Sa,{view:0,detail:0}),zp=Ot(Wi),or,fr,Ii,xs=X({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ii&&(Ii&&e.type==="mousemove"?(or=e.screenX-Ii.screenX,fr=e.screenY-Ii.screenY):fr=or=0,Ii=e),or)},movementY:function(e){return"movementY"in e?e.movementY:fr}}),zf=Ot(xs),Up=X({},xs,{dataTransfer:0}),jp=Ot(Up),Bp=X({},Wi,{relatedTarget:0}),dr=Ot(Bp),qp=X({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),Zp=Ot(qp),Hp=X({},Sa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vp=Ot(Hp),Lp=X({},Sa,{data:0}),Uf=Ot(Lp),Kp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gp[e])?!!t[e]:!1}function hr(){return Xp}var $p=X({},Wi,{key:function(e){if(e.key){var t=Kp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hr,charCode:function(e){return e.type==="keypress"?Os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qp=Ot($p),Jp=X({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jf=Ot(Jp),Fp=X({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hr}),Wp=Ot(Fp),Ip=X({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pp=Ot(Ip),eg=X({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),tg=Ot(eg),ng=X({},Sa,{newState:0,oldState:0}),ag=Ot(ng),ig=[9,13,27,32],yr=En&&"CompositionEvent"in window,Pi=null;En&&"documentMode"in document&&(Pi=document.documentMode);var lg=En&&"TextEvent"in window&&!Pi,Bf=En&&(!yr||Pi&&8<Pi&&11>=Pi),qf=" ",Zf=!1;function Hf(e,t){switch(e){case"keyup":return ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ai=!1;function sg(e,t){switch(e){case"compositionend":return Vf(t);case"keypress":return t.which!==32?null:(Zf=!0,qf);case"textInput":return e=t.data,e===qf&&Zf?null:e;default:return null}}function ug(e,t){if(ai)return e==="compositionend"||!yr&&Hf(e,t)?(e=Cf(),As=cr=Xn=null,ai=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bf&&t.locale!=="ko"?null:t.data;default:return null}}var rg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rg[e.type]:t==="textarea"}function Kf(e,t,a,l){ti?ni?ni.push(l):ni=[l]:ti=l,t=fu(t,"onChange"),0<t.length&&(a=new Rs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var el=null,tl=null;function cg(e){my(e,0)}function ks(e){var t=Qi(e);if(Af(t))return e}function Yf(e,t){if(e==="change")return t}var Gf=!1;if(En){var mr;if(En){var pr="oninput"in document;if(!pr){var Xf=document.createElement("div");Xf.setAttribute("oninput","return;"),pr=typeof Xf.oninput=="function"}mr=pr}else mr=!1;Gf=mr&&(!document.documentMode||9<document.documentMode)}function $f(){el&&(el.detachEvent("onpropertychange",Qf),tl=el=null)}function Qf(e){if(e.propertyName==="value"&&ks(tl)){var t=[];Kf(t,tl,e,sr(e)),Nf(cg,t)}}function og(e,t,a){e==="focusin"?($f(),el=t,tl=a,el.attachEvent("onpropertychange",Qf)):e==="focusout"&&$f()}function fg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ks(tl)}function dg(e,t){if(e==="click")return ks(t)}function hg(e,t){if(e==="input"||e==="change")return ks(t)}function yg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:yg;function nl(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var r=a[l];if(!Fu.call(t,r)||!kt(e[r],t[r]))return!1}return!0}function Jf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ff(e,t){var a=Jf(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Jf(a)}}function Wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function If(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ts(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ts(e.document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function mg(e,t){var a=If(t);t=e.focusedElem;var l=e.selectionRange;if(a!==t&&t&&t.ownerDocument&&Wf(t.ownerDocument.documentElement,t)){if(l!==null&&gr(t)){if(e=l.start,a=l.end,a===void 0&&(a=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(a,t.value.length);else if(a=(e=t.ownerDocument||document)&&e.defaultView||window,a.getSelection){a=a.getSelection();var r=t.textContent.length,o=Math.min(l.start,r);l=l.end===void 0?o:Math.min(l.end,r),!a.extend&&o>l&&(r=l,l=o,o=r),r=Ff(t,o);var d=Ff(t,l);r&&d&&(a.rangeCount!==1||a.anchorNode!==r.node||a.anchorOffset!==r.offset||a.focusNode!==d.node||a.focusOffset!==d.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),a.removeAllRanges(),o>l?(a.addRange(e),a.extend(d.node,d.offset)):(e.setEnd(d.node,d.offset),a.addRange(e)))}}for(e=[],a=t;a=a.parentNode;)a.nodeType===1&&e.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)a=e[t],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var pg=En&&"documentMode"in document&&11>=document.documentMode,ii=null,vr=null,al=null,br=!1;function Pf(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;br||ii==null||ii!==Ts(l)||(l=ii,"selectionStart"in l&&gr(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),al&&nl(al,l)||(al=l,l=fu(vr,"onSelect"),0<l.length&&(t=new Rs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=ii)))}function Ta(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var li={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionrun:Ta("Transition","TransitionRun"),transitionstart:Ta("Transition","TransitionStart"),transitioncancel:Ta("Transition","TransitionCancel"),transitionend:Ta("Transition","TransitionEnd")},_r={},ed={};En&&(ed=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function Ea(e){if(_r[e])return _r[e];if(!li[e])return e;var t=li[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in ed)return _r[e]=t[a];return e}var td=Ea("animationend"),nd=Ea("animationiteration"),ad=Ea("animationstart"),gg=Ea("transitionrun"),vg=Ea("transitionstart"),bg=Ea("transitioncancel"),id=Ea("transitionend"),ld=new Map,sd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function Pt(e,t){ld.set(e,t),_a(t,[e])}var Ht=[],si=0,Sr=0;function Ms(){for(var e=si,t=Sr=si=0;t<e;){var a=Ht[t];Ht[t++]=null;var l=Ht[t];Ht[t++]=null;var r=Ht[t];Ht[t++]=null;var o=Ht[t];if(Ht[t++]=null,l!==null&&r!==null){var d=l.pending;d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r}o!==0&&ud(a,r,o)}}function Ns(e,t,a,l){Ht[si++]=e,Ht[si++]=t,Ht[si++]=a,Ht[si++]=l,Sr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Tr(e,t,a,l){return Ns(e,t,a,l),Cs(e)}function $n(e,t){return Ns(e,null,null,t),Cs(e)}function ud(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,l=o.alternate,l!==null&&(l.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;r&&t!==null&&e.tag===3&&(o=e.stateNode,r=31-xt(a),o=o.hiddenUpdates,e=o[r],e===null?o[r]=[t]:e.push(t),t.lane=a|536870912)}function Cs(e){if(50<xl)throw xl=0,xc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={},rd=new WeakMap;function Vt(e,t){if(typeof e=="object"&&e!==null){var a=rd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ie(t)},rd.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var ri=[],ci=0,Ds=null,zs=0,Lt=[],Kt=0,Aa=null,On=1,wn="";function Oa(e,t){ri[ci++]=zs,ri[ci++]=Ds,Ds=e,zs=t}function cd(e,t,a){Lt[Kt++]=On,Lt[Kt++]=wn,Lt[Kt++]=Aa,Aa=e;var l=On;e=wn;var r=32-xt(l)-1;l&=~(1<<r),a+=1;var o=32-xt(t)+r;if(30<o){var d=r-r%5;o=(l&(1<<d)-1).toString(32),l>>=d,r-=d,On=1<<32-xt(t)+r|a<<r|l,wn=o+e}else On=1<<o|a<<r|l,wn=e}function Er(e){e.return!==null&&(Oa(e,1),cd(e,1,0))}function Ar(e){for(;e===Ds;)Ds=ri[--ci],ri[ci]=null,zs=ri[--ci],ri[ci]=null;for(;e===Aa;)Aa=Lt[--Kt],Lt[Kt]=null,wn=Lt[--Kt],Lt[Kt]=null,On=Lt[--Kt],Lt[Kt]=null}var _t=null,ct=null,Ae=!1,en=null,fn=!1,Or=Error(u(519));function wa(e){var t=Error(u(418,""));throw sl(Vt(t,e)),Or}function od(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[ht]=e,t[At]=l,a){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(a=0;a<Ml.length;a++)ve(Ml[a],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),Of(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Ss(t);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),Rf(t,l.value,l.defaultValue,l.children),Ss(t)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||by(t.textContent,a)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=du),t=!0):t=!1,t||wa(e)}function fd(e){for(_t=e.return;_t;)switch(_t.tag){case 3:case 27:fn=!0;return;case 5:case 13:fn=!1;return;default:_t=_t.return}}function il(e){if(e!==_t)return!1;if(!Ae)return fd(e),Ae=!0,!1;var t=!1,a;if((a=e.tag!==3&&e.tag!==27)&&((a=e.tag===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Gc(e.type,e.memoizedProps)),a=!a),a&&(t=!0),t&&ct&&wa(e),fd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){ct=nn(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}ct=null}}else ct=_t?nn(e.stateNode.nextSibling):null;return!0}function ll(){ct=_t=null,Ae=!1}function sl(e){en===null?en=[e]:en.push(e)}var ul=Error(u(460)),dd=Error(u(474)),wr={then:function(){}};function hd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Us(){}function yd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Us,Us),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===ul?Error(u(483)):e;default:if(typeof t.status=="string")t.then(Us,Us);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=l}},function(l){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===ul?Error(u(483)):e}throw rl=t,ul}}var rl=null;function md(){if(rl===null)throw Error(u(459));var e=rl;return rl=null,e}var oi=null,cl=0;function js(e){var t=cl;return cl+=1,oi===null&&(oi=[]),yd(oi,e,t)}function ol(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Bs(e,t){throw t.$$typeof===f?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pd(e){var t=e._init;return t(e._payload)}function gd(e){function t(E,_){if(e){var A=E.deletions;A===null?(E.deletions=[_],E.flags|=16):A.push(_)}}function a(E,_){if(!e)return null;for(;_!==null;)t(E,_),_=_.sibling;return null}function l(E){for(var _=new Map;E!==null;)E.key!==null?_.set(E.key,E):_.set(E.index,E),E=E.sibling;return _}function r(E,_){return E=la(E,_),E.index=0,E.sibling=null,E}function o(E,_,A){return E.index=A,e?(A=E.alternate,A!==null?(A=A.index,A<_?(E.flags|=33554434,_):A):(E.flags|=33554434,_)):(E.flags|=1048576,_)}function d(E){return e&&E.alternate===null&&(E.flags|=33554434),E}function m(E,_,A,k){return _===null||_.tag!==6?(_=_c(A,E.mode,k),_.return=E,_):(_=r(_,A),_.return=E,_)}function v(E,_,A,k){var G=A.type;return G===p?x(E,_,A.props.children,k,A.key):_!==null&&(_.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===he&&pd(G)===_.type)?(_=r(_,A.props),ol(_,A),_.return=E,_):(_=tu(A.type,A.key,A.props,null,E.mode,k),ol(_,A),_.return=E,_)}function T(E,_,A,k){return _===null||_.tag!==4||_.stateNode.containerInfo!==A.containerInfo||_.stateNode.implementation!==A.implementation?(_=Sc(A,E.mode,k),_.return=E,_):(_=r(_,A.children||[]),_.return=E,_)}function x(E,_,A,k,G){return _===null||_.tag!==7?(_=ja(A,E.mode,k,G),_.return=E,_):(_=r(_,A),_.return=E,_)}function M(E,_,A){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=_c(""+_,E.mode,A),_.return=E,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case h:return A=tu(_.type,_.key,_.props,null,E.mode,A),ol(A,_),A.return=E,A;case y:return _=Sc(_,E.mode,A),_.return=E,_;case he:var k=_._init;return _=k(_._payload),M(E,_,A)}if(P(_)||K(_))return _=ja(_,E.mode,A,null),_.return=E,_;if(typeof _.then=="function")return M(E,js(_),A);if(_.$$typeof===U)return M(E,Is(E,_),A);Bs(E,_)}return null}function O(E,_,A,k){var G=_!==null?_.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return G!==null?null:m(E,_,""+A,k);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case h:return A.key===G?v(E,_,A,k):null;case y:return A.key===G?T(E,_,A,k):null;case he:return G=A._init,A=G(A._payload),O(E,_,A,k)}if(P(A)||K(A))return G!==null?null:x(E,_,A,k,null);if(typeof A.then=="function")return O(E,_,js(A),k);if(A.$$typeof===U)return O(E,_,Is(E,A),k);Bs(E,A)}return null}function R(E,_,A,k,G){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return E=E.get(A)||null,m(_,E,""+k,G);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case h:return E=E.get(k.key===null?A:k.key)||null,v(_,E,k,G);case y:return E=E.get(k.key===null?A:k.key)||null,T(_,E,k,G);case he:var pe=k._init;return k=pe(k._payload),R(E,_,A,k,G)}if(P(k)||K(k))return E=E.get(A)||null,x(_,E,k,G,null);if(typeof k.then=="function")return R(E,_,A,js(k),G);if(k.$$typeof===U)return R(E,_,A,Is(_,k),G);Bs(_,k)}return null}function J(E,_,A,k){for(var G=null,pe=null,F=_,ee=_=0,ut=null;F!==null&&ee<A.length;ee++){F.index>ee?(ut=F,F=null):ut=F.sibling;var Oe=O(E,F,A[ee],k);if(Oe===null){F===null&&(F=ut);break}e&&F&&Oe.alternate===null&&t(E,F),_=o(Oe,_,ee),pe===null?G=Oe:pe.sibling=Oe,pe=Oe,F=ut}if(ee===A.length)return a(E,F),Ae&&Oa(E,ee),G;if(F===null){for(;ee<A.length;ee++)F=M(E,A[ee],k),F!==null&&(_=o(F,_,ee),pe===null?G=F:pe.sibling=F,pe=F);return Ae&&Oa(E,ee),G}for(F=l(F);ee<A.length;ee++)ut=R(F,E,ee,A[ee],k),ut!==null&&(e&&ut.alternate!==null&&F.delete(ut.key===null?ee:ut.key),_=o(ut,_,ee),pe===null?G=ut:pe.sibling=ut,pe=ut);return e&&F.forEach(function(da){return t(E,da)}),Ae&&Oa(E,ee),G}function le(E,_,A,k){if(A==null)throw Error(u(151));for(var G=null,pe=null,F=_,ee=_=0,ut=null,Oe=A.next();F!==null&&!Oe.done;ee++,Oe=A.next()){F.index>ee?(ut=F,F=null):ut=F.sibling;var da=O(E,F,Oe.value,k);if(da===null){F===null&&(F=ut);break}e&&F&&da.alternate===null&&t(E,F),_=o(da,_,ee),pe===null?G=da:pe.sibling=da,pe=da,F=ut}if(Oe.done)return a(E,F),Ae&&Oa(E,ee),G;if(F===null){for(;!Oe.done;ee++,Oe=A.next())Oe=M(E,Oe.value,k),Oe!==null&&(_=o(Oe,_,ee),pe===null?G=Oe:pe.sibling=Oe,pe=Oe);return Ae&&Oa(E,ee),G}for(F=l(F);!Oe.done;ee++,Oe=A.next())Oe=R(F,E,ee,Oe.value,k),Oe!==null&&(e&&Oe.alternate!==null&&F.delete(Oe.key===null?ee:Oe.key),_=o(Oe,_,ee),pe===null?G=Oe:pe.sibling=Oe,pe=Oe);return e&&F.forEach(function(Dv){return t(E,Dv)}),Ae&&Oa(E,ee),G}function Le(E,_,A,k){if(typeof A=="object"&&A!==null&&A.type===p&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case h:e:{for(var G=A.key;_!==null;){if(_.key===G){if(G=A.type,G===p){if(_.tag===7){a(E,_.sibling),k=r(_,A.props.children),k.return=E,E=k;break e}}else if(_.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===he&&pd(G)===_.type){a(E,_.sibling),k=r(_,A.props),ol(k,A),k.return=E,E=k;break e}a(E,_);break}else t(E,_);_=_.sibling}A.type===p?(k=ja(A.props.children,E.mode,k,A.key),k.return=E,E=k):(k=tu(A.type,A.key,A.props,null,E.mode,k),ol(k,A),k.return=E,E=k)}return d(E);case y:e:{for(G=A.key;_!==null;){if(_.key===G)if(_.tag===4&&_.stateNode.containerInfo===A.containerInfo&&_.stateNode.implementation===A.implementation){a(E,_.sibling),k=r(_,A.children||[]),k.return=E,E=k;break e}else{a(E,_);break}else t(E,_);_=_.sibling}k=Sc(A,E.mode,k),k.return=E,E=k}return d(E);case he:return G=A._init,A=G(A._payload),Le(E,_,A,k)}if(P(A))return J(E,_,A,k);if(K(A)){if(G=K(A),typeof G!="function")throw Error(u(150));return A=G.call(A),le(E,_,A,k)}if(typeof A.then=="function")return Le(E,_,js(A),k);if(A.$$typeof===U)return Le(E,_,Is(E,A),k);Bs(E,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,_!==null&&_.tag===6?(a(E,_.sibling),k=r(_,A),k.return=E,E=k):(a(E,_),k=_c(A,E.mode,k),k.return=E,E=k),d(E)):a(E,_)}return function(E,_,A,k){try{cl=0;var G=Le(E,_,A,k);return oi=null,G}catch(F){if(F===ul)throw F;var pe=$t(29,F,null,E.mode);return pe.lanes=k,pe.return=E,pe}finally{}}}var Ra=gd(!0),vd=gd(!1),fi=Re(null),qs=Re(0);function bd(e,t){e=Bn,je(qs,e),je(fi,t),Bn=e|t.baseLanes}function Rr(){je(qs,Bn),je(fi,fi.current)}function xr(){Bn=qs.current,$e(fi),$e(qs)}var Yt=Re(null),dn=null;function Qn(e){var t=e.alternate;je(tt,tt.current&1),je(Yt,e),dn===null&&(t===null||fi.current!==null||t.memoizedState!==null)&&(dn=e)}function _d(e){if(e.tag===22){if(je(tt,tt.current),je(Yt,e),dn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(dn=e)}}else Jn()}function Jn(){je(tt,tt.current),je(Yt,Yt.current)}function Rn(e){$e(Yt),dn===e&&(dn=null),$e(tt)}var tt=Re(0);function Zs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _g=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Sg=s.unstable_scheduleCallback,Tg=s.unstable_NormalPriority,nt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kr(){return{controller:new _g,data:new Map,refCount:0}}function fl(e){e.refCount--,e.refCount===0&&Sg(Tg,function(){e.controller.abort()})}var dl=null,Mr=0,di=0,hi=null;function Eg(e,t){if(dl===null){var a=dl=[];Mr=0,di=jc(),hi={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Mr++,t.then(Sd,Sd),t}function Sd(){if(--Mr===0&&dl!==null){hi!==null&&(hi.status="fulfilled");var e=dl;dl=null,di=0,hi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ag(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(l.status="rejected",l.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),l}var Td=B.S;B.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Eg(e,t),Td!==null&&Td(e,t)};var xa=Re(null);function Nr(){var e=xa.current;return e!==null?e:De.pooledCache}function Hs(e,t){t===null?je(xa,xa.current):je(xa,t.pool)}function Ed(){var e=Nr();return e===null?null:{parent:nt._currentValue,pool:e}}var Fn=0,me=null,ke=null,Qe=null,Vs=!1,yi=!1,ka=!1,Ls=0,hl=0,mi=null,Og=0;function Xe(){throw Error(u(321))}function Cr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!kt(e[a],t[a]))return!1;return!0}function Dr(e,t,a,l,r,o){return Fn=o,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Ma:Wn,ka=!1,o=a(l,r),ka=!1,yi&&(o=Od(t,a,l,r)),Ad(e),o}function Ad(e){B.H=hn;var t=ke!==null&&ke.next!==null;if(Fn=0,Qe=ke=me=null,Vs=!1,hl=0,mi=null,t)throw Error(u(300));e===null||lt||(e=e.dependencies,e!==null&&Ws(e)&&(lt=!0))}function Od(e,t,a,l){me=e;var r=0;do{if(yi&&(mi=null),hl=0,yi=!1,25<=r)throw Error(u(301));if(r+=1,Qe=ke=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}B.H=Na,o=t(a,l)}while(yi);return o}function wg(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?yl(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(me.flags|=1024),t}function zr(){var e=Ls!==0;return Ls=0,e}function Ur(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function jr(e){if(Vs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vs=!1}Fn=0,Qe=ke=me=null,yi=!1,hl=Ls=0,mi=null}function wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?me.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Je(){if(ke===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Qe===null?me.memoizedState:Qe.next;if(t!==null)Qe=t,ke=e;else{if(e===null)throw me.alternate===null?Error(u(467)):Error(u(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Qe===null?me.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}var Ks;Ks=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function yl(e){var t=hl;return hl+=1,mi===null&&(mi=[]),e=yd(mi,e,t),t=me,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Ma:Wn),e}function Ys(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yl(e);if(e.$$typeof===U)return yt(e)}throw Error(u(438,String(e)))}function Br(e){var t=null,a=me.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ks(),me.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=It;return t.index++,a}function xn(e,t){return typeof t=="function"?t(e):t}function Gs(e){var t=Je();return qr(t,ke,e)}function qr(e,t,a){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=a;var r=e.baseQueue,o=l.pending;if(o!==null){if(r!==null){var d=r.next;r.next=o.next,o.next=d}t.baseQueue=r=o,l.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var m=d=null,v=null,T=t,x=!1;do{var M=T.lane&-536870913;if(M!==T.lane?(Se&M)===M:(Fn&M)===M){var O=T.revertLane;if(O===0)v!==null&&(v=v.next={lane:0,revertLane:0,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),M===di&&(x=!0);else if((Fn&O)===O){T=T.next,O===di&&(x=!0);continue}else M={lane:0,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},v===null?(m=v=M,d=o):v=v.next=M,me.lanes|=O,sa|=O;M=T.action,ka&&a(o,M),o=T.hasEagerState?T.eagerState:a(o,M)}else O={lane:M,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},v===null?(m=v=O,d=o):v=v.next=O,me.lanes|=M,sa|=M;T=T.next}while(T!==null&&T!==t);if(v===null?d=o:v.next=m,!kt(o,e.memoizedState)&&(lt=!0,x&&(a=hi,a!==null)))throw a;e.memoizedState=o,e.baseState=d,e.baseQueue=v,l.lastRenderedState=o}return r===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Zr(e){var t=Je(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var l=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var d=r=r.next;do o=e(o,d.action),d=d.next;while(d!==r);kt(o,t.memoizedState)||(lt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,l]}function wd(e,t,a){var l=me,r=Je(),o=Ae;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var d=!kt((ke||r).memoizedState,a);if(d&&(r.memoizedState=a,lt=!0),r=r.queue,Lr(kd.bind(null,l,r,e),[e]),r.getSnapshot!==t||d||Qe!==null&&Qe.memoizedState.tag&1){if(l.flags|=2048,pi(9,xd.bind(null,l,r,a,t),{destroy:void 0},null),De===null)throw Error(u(349));o||(Fn&60)!==0||Rd(l,t,a)}return a}function Rd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=me.updateQueue,t===null?(t=Ks(),me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function xd(e,t,a,l){t.value=a,t.getSnapshot=l,Md(t)&&Nd(e)}function kd(e,t,a){return a(function(){Md(t)&&Nd(e)})}function Md(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!kt(e,a)}catch{return!0}}function Nd(e){var t=$n(e,2);t!==null&&St(t,e,2)}function Hr(e){var t=wt();if(typeof e=="function"){var a=e;if(e=a(),ka){Yn(!0);try{a()}finally{Yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:e},t}function Cd(e,t,a,l){return e.baseState=a,qr(e,ke,typeof l=="function"?l:xn)}function Rg(e,t,a,l,r){if(Qs(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){o.listeners.push(d)}};B.T!==null?a(!0):o.isTransition=!1,l(o),a=t.pending,a===null?(o.next=t.pending=o,Dd(t,o)):(o.next=a.next,t.pending=a.next=o)}}function Dd(e,t){var a=t.action,l=t.payload,r=e.state;if(t.isTransition){var o=B.T,d={};B.T=d;try{var m=a(r,l),v=B.S;v!==null&&v(d,m),zd(e,t,m)}catch(T){Vr(e,t,T)}finally{B.T=o}}else try{o=a(r,l),zd(e,t,o)}catch(T){Vr(e,t,T)}}function zd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Ud(e,t,l)},function(l){return Vr(e,t,l)}):Ud(e,t,a)}function Ud(e,t,a){t.status="fulfilled",t.value=a,jd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Dd(e,a)))}function Vr(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,jd(t),t=t.next;while(t!==l)}e.action=null}function jd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bd(e,t){return t}function qd(e,t){if(Ae){var a=De.formState;if(a!==null){e:{var l=me;if(Ae){if(ct){t:{for(var r=ct,o=fn;r.nodeType!==8;){if(!o){r=null;break t}if(r=nn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){ct=nn(r.nextSibling),l=r.data==="F!";break e}}wa(l)}l=!1}l&&(t=a[0])}}return a=wt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bd,lastRenderedState:t},a.queue=l,a=nh.bind(null,me,l),l.dispatch=a,l=Hr(!1),o=$r.bind(null,me,!1,l.queue),l=wt(),r={state:t,dispatch:null,action:e,pending:null},l.queue=r,a=Rg.bind(null,me,r,o,a),r.dispatch=a,l.memoizedState=e,[t,a,!1]}function Zd(e){var t=Je();return Hd(t,ke,e)}function Hd(e,t,a){t=qr(e,t,Bd)[0],e=Gs(xn)[0],t=typeof t=="object"&&t!==null&&typeof t.then=="function"?yl(t):t;var l=Je(),r=l.queue,o=r.dispatch;return a!==l.memoizedState&&(me.flags|=2048,pi(9,xg.bind(null,r,a),{destroy:void 0},null)),[t,o,e]}function xg(e,t){e.action=t}function Vd(e){var t=Je(),a=ke;if(a!==null)return Hd(t,a,e);Je(),t=t.memoizedState,a=Je();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function pi(e,t,a,l){return e={tag:e,create:t,inst:a,deps:l,next:null},t=me.updateQueue,t===null&&(t=Ks(),me.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function Ld(){return Je().memoizedState}function Xs(e,t,a,l){var r=wt();me.flags|=e,r.memoizedState=pi(1|t,a,{destroy:void 0},l===void 0?null:l)}function $s(e,t,a,l){var r=Je();l=l===void 0?null:l;var o=r.memoizedState.inst;ke!==null&&l!==null&&Cr(l,ke.memoizedState.deps)?r.memoizedState=pi(t,a,o,l):(me.flags|=e,r.memoizedState=pi(1|t,a,o,l))}function Kd(e,t){Xs(8390656,8,e,t)}function Lr(e,t){$s(2048,8,e,t)}function Yd(e,t){return $s(4,2,e,t)}function Gd(e,t){return $s(4,4,e,t)}function Xd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $d(e,t,a){a=a!=null?a.concat([e]):null,$s(4,4,Xd.bind(null,t,e),a)}function Kr(){}function Qd(e,t){var a=Je();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Cr(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Jd(e,t){var a=Je();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Cr(t,l[1]))return l[0];if(l=e(),ka){Yn(!0);try{e()}finally{Yn(!1)}}return a.memoizedState=[l,t],l}function Yr(e,t,a){return a===void 0||(Fn&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=Wh(),me.lanes|=e,sa|=e,a)}function Fd(e,t,a,l){return kt(a,t)?a:fi.current!==null?(e=Yr(e,a,l),kt(e,t)||(lt=!0),e):(Fn&42)===0?(lt=!0,e.memoizedState=a):(e=Wh(),me.lanes|=e,sa|=e,t)}function Wd(e,t,a,l,r){var o=Y.p;Y.p=o!==0&&8>o?o:8;var d=B.T,m={};B.T=m,$r(e,!1,t,a);try{var v=r(),T=B.S;if(T!==null&&T(m,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var x=Ag(v,l);ml(e,t,x,Dt(e))}else ml(e,t,l,Dt(e))}catch(M){ml(e,t,{then:function(){},status:"rejected",reason:M},Dt())}finally{Y.p=o,B.T=d}}function kg(){}function Gr(e,t,a,l){if(e.tag!==5)throw Error(u(476));var r=Id(e).queue;Wd(e,r,t,_e,a===null?kg:function(){return Pd(e),a(l)})}function Id(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:_e},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pd(e){var t=Id(e).next.queue;ml(e,t,{},Dt())}function Xr(){return yt(Ul)}function eh(){return Je().memoizedState}function th(){return Je().memoizedState}function Mg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Dt();e=ea(a);var l=ta(t,e,a);l!==null&&(St(l,t,a),vl(l,t,a)),t={cache:kr()},e.payload=t;return}t=t.return}}function Ng(e,t,a){var l=Dt();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Qs(e)?ah(t,a):(a=Tr(e,t,a,l),a!==null&&(St(a,e,l),ih(a,t,l)))}function nh(e,t,a){var l=Dt();ml(e,t,a,l)}function ml(e,t,a,l){var r={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Qs(e))ah(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var d=t.lastRenderedState,m=o(d,a);if(r.hasEagerState=!0,r.eagerState=m,kt(m,d))return Ns(e,t,r,0),De===null&&Ms(),!1}catch{}finally{}if(a=Tr(e,t,r,l),a!==null)return St(a,e,l),ih(a,t,l),!0}return!1}function $r(e,t,a,l){if(l={lane:2,revertLane:jc(),action:l,hasEagerState:!1,eagerState:null,next:null},Qs(e)){if(t)throw Error(u(479))}else t=Tr(e,a,l,2),t!==null&&St(t,e,2)}function Qs(e){var t=e.alternate;return e===me||t!==null&&t===me}function ah(e,t){yi=Vs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ih(e,t,a){if((a&4194176)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,mf(e,a)}}var hn={readContext:yt,use:Ys,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe};hn.useCacheRefresh=Xe,hn.useMemoCache=Xe,hn.useHostTransitionStatus=Xe,hn.useFormState=Xe,hn.useActionState=Xe,hn.useOptimistic=Xe;var Ma={readContext:yt,use:Ys,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Kd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Xs(4194308,4,Xd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Xs(4194308,4,e,t)},useInsertionEffect:function(e,t){Xs(4,2,e,t)},useMemo:function(e,t){var a=wt();t=t===void 0?null:t;var l=e();if(ka){Yn(!0);try{e()}finally{Yn(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=wt();if(a!==void 0){var r=a(t);if(ka){Yn(!0);try{a(t)}finally{Yn(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=Ng.bind(null,me,e),[l.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hr(e);var t=e.queue,a=nh.bind(null,me,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Kr,useDeferredValue:function(e,t){var a=wt();return Yr(a,e,t)},useTransition:function(){var e=Hr(!1);return e=Wd.bind(null,me,e.queue,!0,!1),wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=me,r=wt();if(Ae){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),De===null)throw Error(u(349));(Se&60)!==0||Rd(l,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Kd(kd.bind(null,l,o,e),[e]),l.flags|=2048,pi(9,xd.bind(null,l,o,a,t),{destroy:void 0},null),a},useId:function(){var e=wt(),t=De.identifierPrefix;if(Ae){var a=wn,l=On;a=(l&~(1<<32-xt(l)-1)).toString(32)+a,t=":"+t+"R"+a,a=Ls++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=Og++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return wt().memoizedState=Mg.bind(null,me)}};Ma.useMemoCache=Br,Ma.useHostTransitionStatus=Xr,Ma.useFormState=qd,Ma.useActionState=qd,Ma.useOptimistic=function(e){var t=wt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=$r.bind(null,me,!0,a),a.dispatch=t,[e,t]};var Wn={readContext:yt,use:Ys,useCallback:Qd,useContext:yt,useEffect:Lr,useImperativeHandle:$d,useInsertionEffect:Yd,useLayoutEffect:Gd,useMemo:Jd,useReducer:Gs,useRef:Ld,useState:function(){return Gs(xn)},useDebugValue:Kr,useDeferredValue:function(e,t){var a=Je();return Fd(a,ke.memoizedState,e,t)},useTransition:function(){var e=Gs(xn)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:yl(e),t]},useSyncExternalStore:wd,useId:eh};Wn.useCacheRefresh=th,Wn.useMemoCache=Br,Wn.useHostTransitionStatus=Xr,Wn.useFormState=Zd,Wn.useActionState=Zd,Wn.useOptimistic=function(e,t){var a=Je();return Cd(a,ke,e,t)};var Na={readContext:yt,use:Ys,useCallback:Qd,useContext:yt,useEffect:Lr,useImperativeHandle:$d,useInsertionEffect:Yd,useLayoutEffect:Gd,useMemo:Jd,useReducer:Zr,useRef:Ld,useState:function(){return Zr(xn)},useDebugValue:Kr,useDeferredValue:function(e,t){var a=Je();return ke===null?Yr(a,e,t):Fd(a,ke.memoizedState,e,t)},useTransition:function(){var e=Zr(xn)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:yl(e),t]},useSyncExternalStore:wd,useId:eh};Na.useCacheRefresh=th,Na.useMemoCache=Br,Na.useHostTransitionStatus=Xr,Na.useFormState=Vd,Na.useActionState=Vd,Na.useOptimistic=function(e,t){var a=Je();return ke!==null?Cd(a,ke,e,t):(a.baseState=e,[e,a.queue.dispatch])};function Qr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:X({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Jr={isMounted:function(e){return(e=e._reactInternals)?I(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Dt(),r=ea(l);r.payload=t,a!=null&&(r.callback=a),t=ta(e,r,l),t!==null&&(St(t,e,l),vl(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Dt(),r=ea(l);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=ta(e,r,l),t!==null&&(St(t,e,l),vl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Dt(),l=ea(a);l.tag=2,t!=null&&(l.callback=t),t=ta(e,l,a),t!==null&&(St(t,e,a),vl(t,e,a))}};function lh(e,t,a,l,r,o,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,d):t.prototype&&t.prototype.isPureReactComponent?!nl(a,l)||!nl(r,o):!0}function sh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Jr.enqueueReplaceState(t,t.state,null)}function Ca(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=X({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}var Js=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function uh(e){Js(e)}function rh(e){console.error(e)}function ch(e){Js(e)}function Fs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function oh(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Fr(e,t,a){return a=ea(a),a.tag=3,a.payload={element:null},a.callback=function(){Fs(e,t)},a}function fh(e){return e=ea(e),e.tag=3,e}function dh(e,t,a,l){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=l.value;e.payload=function(){return r(o)},e.callback=function(){oh(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){oh(t,a,l),typeof r!="function"&&(ua===null?ua=new Set([this]):ua.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Cg(e,t,a,l,r){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&gl(t,a,r,!0),a=Yt.current,a!==null){switch(a.tag){case 13:return dn===null?Nc():a.alternate===null&&Ve===0&&(Ve=3),a.flags&=-257,a.flags|=65536,a.lanes=r,l===wr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Dc(e,l,r)),!1;case 22:return a.flags|=65536,l===wr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Dc(e,l,r)),!1}throw Error(u(435,a.tag))}return Dc(e,l,r),Nc(),!1}if(Ae)return t=Yt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,l!==Or&&(e=Error(u(422),{cause:l}),sl(Vt(e,a)))):(l!==Or&&(t=Error(u(423),{cause:l}),sl(Vt(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,l=Vt(l,a),r=Fr(e.stateNode,l,r),fc(e,r),Ve!==4&&(Ve=2)),!1;var o=Error(u(520),{cause:l});if(o=Vt(o,a),wl===null?wl=[o]:wl.push(o),Ve!==4&&(Ve=2),t===null)return!0;l=Vt(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Fr(a.stateNode,l,e),fc(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(ua===null||!ua.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=fh(r),dh(r,e,a,l),fc(a,r),!1}a=a.return}while(a!==null);return!1}var hh=Error(u(461)),lt=!1;function ot(e,t,a,l){t.child=e===null?vd(t,null,a,l):Ra(t,e.child,a,l)}function yh(e,t,a,l,r){a=a.render;var o=t.ref;if("ref"in l){var d={};for(var m in l)m!=="ref"&&(d[m]=l[m])}else d=l;return za(t),l=Dr(e,t,a,d,o,r),m=zr(),e!==null&&!lt?(Ur(e,t,r),kn(e,t,r)):(Ae&&m&&Er(t),t.flags|=1,ot(e,t,l,r),t.child)}function mh(e,t,a,l,r){if(e===null){var o=a.type;return typeof o=="function"&&!bc(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,ph(e,t,o,l,r)):(e=tu(a.type,null,l,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!lc(e,r)){var d=o.memoizedProps;if(a=a.compare,a=a!==null?a:nl,a(d,l)&&e.ref===t.ref)return kn(e,t,r)}return t.flags|=1,e=la(o,l),e.ref=t.ref,e.return=t,t.child=e}function ph(e,t,a,l,r){if(e!==null){var o=e.memoizedProps;if(nl(o,l)&&e.ref===t.ref)if(lt=!1,t.pendingProps=l=o,lc(e,r))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,kn(e,t,r)}return Wr(e,t,a,l,r)}function gh(e,t,a){var l=t.pendingProps,r=l.children,o=(t.stateNode._pendingVisibility&2)!==0,d=e!==null?e.memoizedState:null;if(pl(e,t),l.mode==="hidden"||o){if((t.flags&128)!==0){if(l=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;t.childLanes=o&~l}else t.childLanes=0,t.child=null;return vh(e,t,l,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hs(t,d!==null?d.cachePool:null),d!==null?bd(t,d):Rr(),_d(t);else return t.lanes=t.childLanes=536870912,vh(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(Hs(t,d.cachePool),bd(t,d),Jn(),t.memoizedState=null):(e!==null&&Hs(t,null),Rr(),Jn());return ot(e,t,r,a),t.child}function vh(e,t,a,l){var r=Nr();return r=r===null?null:{parent:nt._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Hs(t,null),Rr(),_d(t),e!==null&&gl(e,t,l,!0),null}function pl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=2097664)}}function Wr(e,t,a,l,r){return za(t),a=Dr(e,t,a,l,void 0,r),l=zr(),e!==null&&!lt?(Ur(e,t,r),kn(e,t,r)):(Ae&&l&&Er(t),t.flags|=1,ot(e,t,a,r),t.child)}function bh(e,t,a,l,r,o){return za(t),t.updateQueue=null,a=Od(t,l,a,r),Ad(e),l=zr(),e!==null&&!lt?(Ur(e,t,o),kn(e,t,o)):(Ae&&l&&Er(t),t.flags|=1,ot(e,t,a,o),t.child)}function _h(e,t,a,l,r){if(za(t),t.stateNode===null){var o=ui,d=a.contextType;typeof d=="object"&&d!==null&&(o=yt(d)),o=new a(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Jr,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},cc(t),d=a.contextType,o.context=typeof d=="object"&&d!==null?yt(d):ui,o.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Qr(t,a,d,l),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(d=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),d!==o.state&&Jr.enqueueReplaceState(o,o.state,null),_l(t,l,o,r),bl(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var m=t.memoizedProps,v=Ca(a,m);o.props=v;var T=o.context,x=a.contextType;d=ui,typeof x=="object"&&x!==null&&(d=yt(x));var M=a.getDerivedStateFromProps;x=typeof M=="function"||typeof o.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,x||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m||T!==d)&&sh(t,o,l,d),Pn=!1;var O=t.memoizedState;o.state=O,_l(t,l,o,r),bl(),T=t.memoizedState,m||O!==T||Pn?(typeof M=="function"&&(Qr(t,a,M,l),T=t.memoizedState),(v=Pn||lh(t,a,v,l,O,T,d))?(x||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=T),o.props=l,o.state=T,o.context=d,l=v):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,oc(e,t),d=t.memoizedProps,x=Ca(a,d),o.props=x,M=t.pendingProps,O=o.context,T=a.contextType,v=ui,typeof T=="object"&&T!==null&&(v=yt(T)),m=a.getDerivedStateFromProps,(T=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(d!==M||O!==v)&&sh(t,o,l,v),Pn=!1,O=t.memoizedState,o.state=O,_l(t,l,o,r),bl();var R=t.memoizedState;d!==M||O!==R||Pn||e!==null&&e.dependencies!==null&&Ws(e.dependencies)?(typeof m=="function"&&(Qr(t,a,m,l),R=t.memoizedState),(x=Pn||lh(t,a,x,l,O,R,v)||e!==null&&e.dependencies!==null&&Ws(e.dependencies))?(T||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,R,v),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,R,v)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=R),o.props=l,o.state=R,o.context=v,l=x):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,pl(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=Ra(t,e.child,null,r),t.child=Ra(t,null,a,r)):ot(e,t,a,r),t.memoizedState=o.state,e=t.child):e=kn(e,t,r),e}function Sh(e,t,a,l){return ll(),t.flags|=256,ot(e,t,a,l),t.child}var Ir={dehydrated:null,treeContext:null,retryLane:0};function Pr(e){return{baseLanes:e,cachePool:Ed()}}function ec(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Qt),e}function Th(e,t,a){var l=t.pendingProps,r=!1,o=(t.flags&128)!==0,d;if((d=o)||(d=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),d&&(r=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(r?Qn(t):Jn(),Ae){var m=ct,v;if(v=m){e:{for(v=m,m=fn;v.nodeType!==8;){if(!m){m=null;break e}if(v=nn(v.nextSibling),v===null){m=null;break e}}m=v}m!==null?(t.memoizedState={dehydrated:m,treeContext:Aa!==null?{id:On,overflow:wn}:null,retryLane:536870912},v=$t(18,null,null,0),v.stateNode=m,v.return=t,t.child=v,_t=t,ct=null,v=!0):v=!1}v||wa(t)}if(m=t.memoizedState,m!==null&&(m=m.dehydrated,m!==null))return m.data==="$!"?t.lanes=16:t.lanes=536870912,null;Rn(t)}return m=l.children,l=l.fallback,r?(Jn(),r=t.mode,m=nc({mode:"hidden",children:m},r),l=ja(l,r,a,null),m.return=t,l.return=t,m.sibling=l,t.child=m,r=t.child,r.memoizedState=Pr(a),r.childLanes=ec(e,d,a),t.memoizedState=Ir,l):(Qn(t),tc(t,m))}if(v=e.memoizedState,v!==null&&(m=v.dehydrated,m!==null)){if(o)t.flags&256?(Qn(t),t.flags&=-257,t=ac(e,t,a)):t.memoizedState!==null?(Jn(),t.child=e.child,t.flags|=128,t=null):(Jn(),r=l.fallback,m=t.mode,l=nc({mode:"visible",children:l.children},m),r=ja(r,m,a,null),r.flags|=2,l.return=t,r.return=t,l.sibling=r,t.child=l,Ra(t,e.child,null,a),l=t.child,l.memoizedState=Pr(a),l.childLanes=ec(e,d,a),t.memoizedState=Ir,t=r);else if(Qn(t),m.data==="$!"){if(d=m.nextSibling&&m.nextSibling.dataset,d)var T=d.dgst;d=T,l=Error(u(419)),l.stack="",l.digest=d,sl({value:l,source:null,stack:null}),t=ac(e,t,a)}else if(lt||gl(e,t,a,!1),d=(a&e.childLanes)!==0,lt||d){if(d=De,d!==null){if(l=a&-a,(l&42)!==0)l=1;else switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=64;break;case 268435456:l=134217728;break;default:l=0}if(l=(l&(d.suspendedLanes|a))!==0?0:l,l!==0&&l!==v.retryLane)throw v.retryLane=l,$n(e,l),St(d,e,l),hh}m.data==="$?"||Nc(),t=ac(e,t,a)}else m.data==="$?"?(t.flags|=128,t.child=e.child,t=$g.bind(null,e),m._reactRetry=t,t=null):(e=v.treeContext,ct=nn(m.nextSibling),_t=t,Ae=!0,en=null,fn=!1,e!==null&&(Lt[Kt++]=On,Lt[Kt++]=wn,Lt[Kt++]=Aa,On=e.id,wn=e.overflow,Aa=t),t=tc(t,l.children),t.flags|=4096);return t}return r?(Jn(),r=l.fallback,m=t.mode,v=e.child,T=v.sibling,l=la(v,{mode:"hidden",children:l.children}),l.subtreeFlags=v.subtreeFlags&31457280,T!==null?r=la(T,r):(r=ja(r,m,a,null),r.flags|=2),r.return=t,l.return=t,l.sibling=r,t.child=l,l=r,r=t.child,m=e.child.memoizedState,m===null?m=Pr(a):(v=m.cachePool,v!==null?(T=nt._currentValue,v=v.parent!==T?{parent:T,pool:T}:v):v=Ed(),m={baseLanes:m.baseLanes|a,cachePool:v}),r.memoizedState=m,r.childLanes=ec(e,d,a),t.memoizedState=Ir,l):(Qn(t),a=e.child,e=a.sibling,a=la(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function tc(e,t){return t=nc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function nc(e,t){return Qh(e,t,0,null)}function ac(e,t,a){return Ra(t,e.child,null,a),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eh(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),uc(e.return,t,a)}function ic(e,t,a,l,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=l,o.tail=a,o.tailMode=r)}function Ah(e,t,a){var l=t.pendingProps,r=l.revealOrder,o=l.tail;if(ot(e,t,l.children,a),l=tt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Eh(e,a,t);else if(e.tag===19)Eh(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}switch(je(tt,l),r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&Zs(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),ic(t,!1,r,a,o);break;case"backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Zs(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}ic(t,!0,a,null,o);break;case"together":ic(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),sa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(gl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=la(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=la(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function lc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ws(e)))}function Dg(e,t,a){switch(t.tag){case 3:hs(t,t.stateNode.containerInfo),In(t,nt,e.memoizedState.cache),ll();break;case 27:case 5:Ju(t);break;case 4:hs(t,t.stateNode.containerInfo);break;case 10:In(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Qn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Th(e,t,a):(Qn(t),e=kn(e,t,a),e!==null?e.sibling:null);Qn(t);break;case 19:var r=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(gl(e,t,a,!1),l=(a&t.childLanes)!==0),r){if(l)return Ah(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),je(tt,tt.current),l)break;return null;case 22:case 23:return t.lanes=0,gh(e,t,a);case 24:In(t,nt,e.memoizedState.cache)}return kn(e,t,a)}function Oh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!lc(e,a)&&(t.flags&128)===0)return lt=!1,Dg(e,t,a);lt=(e.flags&131072)!==0}else lt=!1,Ae&&(t.flags&1048576)!==0&&cd(t,zs,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,r=l._init;if(l=r(l._payload),t.type=l,typeof l=="function")bc(l)?(e=Ca(l,e),t.tag=1,t=_h(null,t,l,e,a)):(t.tag=0,t=Wr(null,t,l,e,a));else{if(l!=null){if(r=l.$$typeof,r===Q){t.tag=11,t=yh(null,t,l,e,a);break e}else if(r===de){t.tag=14,t=mh(null,t,l,e,a);break e}}throw t=W(l)||l,Error(u(306,t,""))}}return t;case 0:return Wr(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,r=Ca(l,t.pendingProps),_h(e,t,l,r,a);case 3:e:{if(hs(t,t.stateNode.containerInfo),e===null)throw Error(u(387));var o=t.pendingProps;r=t.memoizedState,l=r.element,oc(e,t),_l(t,o,null,a);var d=t.memoizedState;if(o=d.cache,In(t,nt,o),o!==r.cache&&rc(t,[nt],a,!0),bl(),o=d.element,r.isDehydrated)if(r={element:o,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Sh(e,t,o,a);break e}else if(o!==l){l=Vt(Error(u(424)),t),sl(l),t=Sh(e,t,o,a);break e}else for(ct=nn(t.stateNode.containerInfo.firstChild),_t=t,Ae=!0,en=null,fn=!0,a=vd(t,null,o,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ll(),o===l){t=kn(e,t,a);break e}ot(e,t,o,a)}t=t.child}return t;case 26:return pl(e,t),e===null?(a=xy(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ae||(a=t.type,e=t.pendingProps,l=hu(Kn.current).createElement(a),l[ht]=t,l[At]=e,ft(l,a,e),it(l),t.stateNode=l):t.memoizedState=xy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ju(t),e===null&&Ae&&(l=t.stateNode=Oy(t.type,t.pendingProps,Kn.current),_t=t,fn=!0,ct=nn(l.firstChild)),l=t.pendingProps.children,e!==null||Ae?ot(e,t,l,a):t.child=Ra(t,null,l,a),pl(e,t),t.child;case 5:return e===null&&Ae&&((r=l=ct)&&(l=cv(l,t.type,t.pendingProps,fn),l!==null?(t.stateNode=l,_t=t,ct=nn(l.firstChild),fn=!1,r=!0):r=!1),r||wa(t)),Ju(t),r=t.type,o=t.pendingProps,d=e!==null?e.memoizedProps:null,l=o.children,Gc(r,o)?l=null:d!==null&&Gc(r,d)&&(t.flags|=32),t.memoizedState!==null&&(r=Dr(e,t,wg,null,null,a),Ul._currentValue=r),pl(e,t),ot(e,t,l,a),t.child;case 6:return e===null&&Ae&&((e=a=ct)&&(a=ov(a,t.pendingProps,fn),a!==null?(t.stateNode=a,_t=t,ct=null,e=!0):e=!1),e||wa(t)),null;case 13:return Th(e,t,a);case 4:return hs(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ra(t,null,l,a):ot(e,t,l,a),t.child;case 11:return yh(e,t,t.type,t.pendingProps,a);case 7:return ot(e,t,t.pendingProps,a),t.child;case 8:return ot(e,t,t.pendingProps.children,a),t.child;case 12:return ot(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,In(t,t.type,l.value),ot(e,t,l.children,a),t.child;case 9:return r=t.type._context,l=t.pendingProps.children,za(t),r=yt(r),l=l(r),t.flags|=1,ot(e,t,l,a),t.child;case 14:return mh(e,t,t.type,t.pendingProps,a);case 15:return ph(e,t,t.type,t.pendingProps,a);case 19:return Ah(e,t,a);case 22:return gh(e,t,a);case 24:return za(t),l=yt(nt),e===null?(r=Nr(),r===null&&(r=De,o=kr(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:l,cache:r},cc(t),In(t,nt,r)):((e.lanes&a)!==0&&(oc(e,t),_l(t,null,null,a),bl()),r=e.memoizedState,o=t.memoizedState,r.parent!==l?(r={parent:l,cache:l},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),In(t,nt,l)):(l=o.cache,In(t,nt,l),l!==r.cache&&rc(t,[nt],a,!0))),ot(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}var sc=Re(null),Da=null,Mn=null;function In(e,t,a){je(sc,t._currentValue),t._currentValue=a}function Nn(e){e._currentValue=sc.current,$e(sc)}function uc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function rc(e,t,a,l){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var d=r.child;o=o.firstContext;e:for(;o!==null;){var m=o;o=r;for(var v=0;v<t.length;v++)if(m.context===t[v]){o.lanes|=a,m=o.alternate,m!==null&&(m.lanes|=a),uc(o.return,a,e),l||(d=null);break e}o=m.next}}else if(r.tag===18){if(d=r.return,d===null)throw Error(u(341));d.lanes|=a,o=d.alternate,o!==null&&(o.lanes|=a),uc(d,a,e),d=null}else d=r.child;if(d!==null)d.return=r;else for(d=r;d!==null;){if(d===e){d=null;break}if(r=d.sibling,r!==null){r.return=d.return,d=r;break}d=d.return}r=d}}function gl(e,t,a,l){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var d=r.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var m=r.type;kt(r.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(r===ds.current){if(d=r.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Ul):e=[Ul])}r=r.return}e!==null&&rc(t,e,a,l),t.flags|=262144}function Ws(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function za(e){Da=e,Mn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return wh(Da,e)}function Is(e,t){return Da===null&&za(e),wh(e,t)}function wh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Mn===null){if(e===null)throw Error(u(308));Mn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Mn=Mn.next=t;return a}var Pn=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ta(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(qe&2)!==0){var r=l.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=Cs(e),ud(e,null,a),t}return Ns(e,l,t,a),Cs(e)}function vl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194176)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,mf(e,a)}}function fc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=d:o=o.next=d,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var dc=!1;function bl(){if(dc){var e=hi;if(e!==null)throw e}}function _l(e,t,a,l){dc=!1;var r=e.updateQueue;Pn=!1;var o=r.firstBaseUpdate,d=r.lastBaseUpdate,m=r.shared.pending;if(m!==null){r.shared.pending=null;var v=m,T=v.next;v.next=null,d===null?o=T:d.next=T,d=v;var x=e.alternate;x!==null&&(x=x.updateQueue,m=x.lastBaseUpdate,m!==d&&(m===null?x.firstBaseUpdate=T:m.next=T,x.lastBaseUpdate=v))}if(o!==null){var M=r.baseState;d=0,x=T=v=null,m=o;do{var O=m.lane&-536870913,R=O!==m.lane;if(R?(Se&O)===O:(l&O)===O){O!==0&&O===di&&(dc=!0),x!==null&&(x=x.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var J=e,le=m;O=t;var Le=a;switch(le.tag){case 1:if(J=le.payload,typeof J=="function"){M=J.call(Le,M,O);break e}M=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=le.payload,O=typeof J=="function"?J.call(Le,M,O):J,O==null)break e;M=X({},M,O);break e;case 2:Pn=!0}}O=m.callback,O!==null&&(e.flags|=64,R&&(e.flags|=8192),R=r.callbacks,R===null?r.callbacks=[O]:R.push(O))}else R={lane:O,tag:m.tag,payload:m.payload,callback:m.callback,next:null},x===null?(T=x=R,v=M):x=x.next=R,d|=O;if(m=m.next,m===null){if(m=r.shared.pending,m===null)break;R=m,m=R.next,R.next=null,r.lastBaseUpdate=R,r.shared.pending=null}}while(!0);x===null&&(v=M),r.baseState=v,r.firstBaseUpdate=T,r.lastBaseUpdate=x,o===null&&(r.shared.lanes=0),sa|=d,e.lanes=d,e.memoizedState=M}}function Rh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function xh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Rh(a[e],t)}function Sl(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){l=void 0;var o=a.create,d=a.inst;l=o(),d.destroy=l}a=a.next}while(a!==r)}}catch(m){Ne(t,t.return,m)}}function na(e,t,a){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var o=r.next;l=o;do{if((l.tag&e)===e){var d=l.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,r=t;var v=a;try{m()}catch(T){Ne(r,v,T)}}}l=l.next}while(l!==o)}}catch(T){Ne(t,t.return,T)}}function kh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{xh(t,a)}catch(l){Ne(e,e.return,l)}}}function Mh(e,t,a){a.props=Ca(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ne(e,t,l)}}function Ua(e,t){try{var a=e.ref;if(a!==null){var l=e.stateNode;switch(e.tag){case 26:case 27:case 5:var r=l;break;default:r=l}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(o){Ne(e,t,o)}}function Mt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(r){Ne(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function Nh(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(r){Ne(e,e.return,r)}}function Ch(e,t,a){try{var l=e.stateNode;iv(l,e.type,a,t),l[At]=t}catch(r){Ne(e,e.return,r)}}function Dh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==27&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=du));else if(l!==4&&l!==27&&(e=e.child,e!==null))for(yc(e,t,a),e=e.sibling;e!==null;)yc(e,t,a),e=e.sibling}function Ps(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&l!==27&&(e=e.child,e!==null))for(Ps(e,t,a),e=e.sibling;e!==null;)Ps(e,t,a),e=e.sibling}var Cn=!1,He=!1,mc=!1,zh=typeof WeakSet=="function"?WeakSet:Set,st=null,Uh=!1;function zg(e,t){if(e=e.containerInfo,Kc=bu,e=If(e),gr(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var r=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var d=0,m=-1,v=-1,T=0,x=0,M=e,O=null;t:for(;;){for(var R;M!==a||r!==0&&M.nodeType!==3||(m=d+r),M!==o||l!==0&&M.nodeType!==3||(v=d+l),M.nodeType===3&&(d+=M.nodeValue.length),(R=M.firstChild)!==null;)O=M,M=R;for(;;){if(M===e)break t;if(O===a&&++T===r&&(m=d),O===o&&++x===l&&(v=d),(R=M.nextSibling)!==null)break;M=O,O=M.parentNode}M=R}a=m===-1||v===-1?null:{start:m,end:v}}else a=null}a=a||{start:0,end:0}}else a=null;for(Yc={focusedElem:e,selectionRange:a},bu=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,o=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,l=a.stateNode;try{var J=Ca(a.type,r,a.elementType===a.type);e=l.getSnapshotBeforeUpdate(J,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(le){Ne(a,a.return,le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Qc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,st=e;break}st=t.return}return J=Uh,Uh=!1,J}function jh(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:zn(e,a),l&4&&Sl(5,a);break;case 1:if(zn(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(m){Ne(a,a.return,m)}else{var r=Ca(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ne(a,a.return,m)}}l&64&&kh(a),l&512&&Ua(a,a.return);break;case 3:if(zn(e,a),l&64&&(l=a.updateQueue,l!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{xh(l,e)}catch(m){Ne(a,a.return,m)}}break;case 26:zn(e,a),l&512&&Ua(a,a.return);break;case 27:case 5:zn(e,a),t===null&&l&4&&Nh(a),l&512&&Ua(a,a.return);break;case 12:zn(e,a);break;case 13:zn(e,a),l&4&&Zh(e,a);break;case 22:if(r=a.memoizedState!==null||Cn,!r){t=t!==null&&t.memoizedState!==null||He;var o=Cn,d=He;Cn=r,(He=t)&&!d?aa(e,a,(a.subtreeFlags&8772)!==0):zn(e,a),Cn=o,He=d}l&512&&(a.memoizedProps.mode==="manual"?Ua(a,a.return):Mt(a,a.return));break;default:zn(e,a)}}function Bh(e){var t=e.alternate;t!==null&&(e.alternate=null,Bh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Fe=null,Nt=!1;function Dn(e,t,a){for(a=a.child;a!==null;)qh(e,t,a),a=a.sibling}function qh(e,t,a){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Yi,a)}catch{}switch(a.tag){case 26:He||Mt(a,t),Dn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:He||Mt(a,t);var l=Fe,r=Nt;for(Fe=a.stateNode,Dn(e,t,a),a=a.stateNode,t=a.attributes;t.length;)a.removeAttributeNode(t[0]);tr(a),Fe=l,Nt=r;break;case 5:He||Mt(a,t);case 6:r=Fe;var o=Nt;if(Fe=null,Dn(e,t,a),Fe=r,Nt=o,Fe!==null)if(Nt)try{e=Fe,l=a.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)}catch(d){Ne(a,t,d)}else try{Fe.removeChild(a.stateNode)}catch(d){Ne(a,t,d)}break;case 18:Fe!==null&&(Nt?(t=Fe,a=a.stateNode,t.nodeType===8?$c(t.parentNode,a):t.nodeType===1&&$c(t,a),Zl(t)):$c(Fe,a.stateNode));break;case 4:l=Fe,r=Nt,Fe=a.stateNode.containerInfo,Nt=!0,Dn(e,t,a),Fe=l,Nt=r;break;case 0:case 11:case 14:case 15:He||na(2,a,t),He||na(4,a,t),Dn(e,t,a);break;case 1:He||(Mt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Mh(a,t,l)),Dn(e,t,a);break;case 21:Dn(e,t,a);break;case 22:He||Mt(a,t),He=(l=He)||a.memoizedState!==null,Dn(e,t,a),He=l;break;default:Dn(e,t,a)}}function Zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zl(e)}catch(a){Ne(t,t.return,a)}}function Ug(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zh),t;default:throw Error(u(435,e.tag))}}function pc(e,t){var a=Ug(e);t.forEach(function(l){var r=Qg.bind(null,e,l);a.has(l)||(a.add(l),l.then(r,r))})}function Gt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var r=a[l],o=e,d=t,m=d;e:for(;m!==null;){switch(m.tag){case 27:case 5:Fe=m.stateNode,Nt=!1;break e;case 3:Fe=m.stateNode.containerInfo,Nt=!0;break e;case 4:Fe=m.stateNode.containerInfo,Nt=!0;break e}m=m.return}if(Fe===null)throw Error(u(160));qh(o,d,r),Fe=null,Nt=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Hh(t,e),t=t.sibling}var tn=null;function Hh(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Xt(e),l&4&&(na(3,e,e.return),Sl(3,e),na(5,e,e.return));break;case 1:Gt(t,e),Xt(e),l&512&&(He||a===null||Mt(a,a.return)),l&64&&Cn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var r=tn;if(Gt(t,e),Xt(e),l&512&&(He||a===null||Mt(a,a.return)),l&4){var o=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(l){case"title":o=r.getElementsByTagName("title")[0],(!o||o[$i]||o[ht]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(l),r.head.insertBefore(o,r.querySelector("head > title"))),ft(o,l,a),o[ht]=e,it(o),l=o;break e;case"link":var d=Ny("link","href",r).get(l+(a.href||""));if(d){for(var m=0;m<d.length;m++)if(o=d[m],o.getAttribute("href")===(a.href==null?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(m,1);break t}}o=r.createElement(l),ft(o,l,a),r.head.appendChild(o);break;case"meta":if(d=Ny("meta","content",r).get(l+(a.content||""))){for(m=0;m<d.length;m++)if(o=d[m],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(m,1);break t}}o=r.createElement(l),ft(o,l,a),r.head.appendChild(o);break;default:throw Error(u(468,l))}o[ht]=e,it(o),l=o}e.stateNode=l}else Cy(r,e.type,e.stateNode);else e.stateNode=My(r,l,e.memoizedProps);else o!==l?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,l===null?Cy(r,e.type,e.stateNode):My(r,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ch(e,e.memoizedProps,a.memoizedProps)}break;case 27:if(l&4&&e.alternate===null){r=e.stateNode,o=e.memoizedProps;try{for(var v=r.firstChild;v;){var T=v.nextSibling,x=v.nodeName;v[$i]||x==="HEAD"||x==="BODY"||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&v.rel.toLowerCase()==="stylesheet"||r.removeChild(v),v=T}for(var M=e.type,O=r.attributes;O.length;)r.removeAttributeNode(O[0]);ft(r,M,o),r[ht]=e,r[At]=o}catch(J){Ne(e,e.return,J)}}case 5:if(Gt(t,e),Xt(e),l&512&&(He||a===null||Mt(a,a.return)),e.flags&32){r=e.stateNode;try{ei(r,"")}catch(J){Ne(e,e.return,J)}}l&4&&e.stateNode!=null&&(r=e.memoizedProps,Ch(e,r,a!==null?a.memoizedProps:r)),l&1024&&(mc=!0);break;case 6:if(Gt(t,e),Xt(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(J){Ne(e,e.return,J)}}break;case 3:if(pu=null,r=tn,tn=yu(t.containerInfo),Gt(t,e),tn=r,Xt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Zl(t.containerInfo)}catch(J){Ne(e,e.return,J)}mc&&(mc=!1,Vh(e));break;case 4:l=tn,tn=yu(e.stateNode.containerInfo),Gt(t,e),Xt(e),tn=l;break;case 12:Gt(t,e),Xt(e);break;case 13:Gt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Oc=on()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pc(e,l)));break;case 22:if(l&512&&(He||a===null||Mt(a,a.return)),v=e.memoizedState!==null,T=a!==null&&a.memoizedState!==null,x=Cn,M=He,Cn=x||v,He=M||T,Gt(t,e),He=M,Cn=x,Xt(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,l&8192&&(t._visibility=v?t._visibility&-2:t._visibility|1,v&&(t=Cn||He,a===null||T||t||gi(e)),e.memoizedProps===null||e.memoizedProps.mode!=="manual"))e:for(a=null,t=e;;){if(t.tag===5||t.tag===26||t.tag===27){if(a===null){T=a=t;try{if(r=T.stateNode,v)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{d=T.stateNode,m=T.memoizedProps.style;var R=m!=null&&m.hasOwnProperty("display")?m.display:null;d.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(J){Ne(T,T.return,J)}}}else if(t.tag===6){if(a===null){T=t;try{T.stateNode.nodeValue=v?"":T.memoizedProps}catch(J){Ne(T,T.return,J)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,pc(e,a))));break;case 19:Gt(t,e),Xt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pc(e,l)));break;case 21:break;default:Gt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{if(e.tag!==27){e:{for(var a=e.return;a!==null;){if(Dh(a)){var l=a;break e}a=a.return}throw Error(u(160))}switch(l.tag){case 27:var r=l.stateNode,o=hc(e);Ps(e,o,r);break;case 5:var d=l.stateNode;l.flags&32&&(ei(d,""),l.flags&=-33);var m=hc(e);Ps(e,m,d);break;case 3:case 4:var v=l.stateNode.containerInfo,T=hc(e);yc(e,T,v);break;default:throw Error(u(161))}}}catch(x){Ne(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function zn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jh(e,t.alternate,t),t=t.sibling}function gi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:na(4,t,t.return),gi(t);break;case 1:Mt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Mh(t,t.return,a),gi(t);break;case 26:case 27:case 5:Mt(t,t.return),gi(t);break;case 22:Mt(t,t.return),t.memoizedState===null&&gi(t);break;default:gi(t)}e=e.sibling}}function aa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,r=e,o=t,d=o.flags;switch(o.tag){case 0:case 11:case 15:aa(r,o,a),Sl(4,o);break;case 1:if(aa(r,o,a),l=o,r=l.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(T){Ne(l,l.return,T)}if(l=o,r=l.updateQueue,r!==null){var m=l.stateNode;try{var v=r.shared.hiddenCallbacks;if(v!==null)for(r.shared.hiddenCallbacks=null,r=0;r<v.length;r++)Rh(v[r],m)}catch(T){Ne(l,l.return,T)}}a&&d&64&&kh(o),Ua(o,o.return);break;case 26:case 27:case 5:aa(r,o,a),a&&l===null&&d&4&&Nh(o),Ua(o,o.return);break;case 12:aa(r,o,a);break;case 13:aa(r,o,a),a&&d&4&&Zh(r,o);break;case 22:o.memoizedState===null&&aa(r,o,a),Ua(o,o.return);break;default:aa(r,o,a)}t=t.sibling}}function gc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&fl(a))}function vc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fl(e))}function ia(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lh(e,t,a,l),t=t.sibling}function Lh(e,t,a,l){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ia(e,t,a,l),r&2048&&Sl(9,t);break;case 3:ia(e,t,a,l),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fl(e)));break;case 12:if(r&2048){ia(e,t,a,l),e=t.stateNode;try{var o=t.memoizedProps,d=o.id,m=o.onPostCommit;typeof m=="function"&&m(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){Ne(t,t.return,v)}}else ia(e,t,a,l);break;case 23:break;case 22:o=t.stateNode,t.memoizedState!==null?o._visibility&4?ia(e,t,a,l):Tl(e,t):o._visibility&4?ia(e,t,a,l):(o._visibility|=4,vi(e,t,a,l,(t.subtreeFlags&10256)!==0)),r&2048&&gc(t.alternate,t);break;case 24:ia(e,t,a,l),r&2048&&vc(t.alternate,t);break;default:ia(e,t,a,l)}}function vi(e,t,a,l,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var o=e,d=t,m=a,v=l,T=d.flags;switch(d.tag){case 0:case 11:case 15:vi(o,d,m,v,r),Sl(8,d);break;case 23:break;case 22:var x=d.stateNode;d.memoizedState!==null?x._visibility&4?vi(o,d,m,v,r):Tl(o,d):(x._visibility|=4,vi(o,d,m,v,r)),r&&T&2048&&gc(d.alternate,d);break;case 24:vi(o,d,m,v,r),r&&T&2048&&vc(d.alternate,d);break;default:vi(o,d,m,v,r)}t=t.sibling}}function Tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,r=l.flags;switch(l.tag){case 22:Tl(a,l),r&2048&&gc(l.alternate,l);break;case 24:Tl(a,l),r&2048&&vc(l.alternate,l);break;default:Tl(a,l)}t=t.sibling}}var El=8192;function bi(e){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Kh(e),e=e.sibling}function Kh(e){switch(e.tag){case 26:bi(e),e.flags&El&&e.memoizedState!==null&&Ev(tn,e.memoizedState,e.memoizedProps);break;case 5:bi(e);break;case 3:case 4:var t=tn;tn=yu(e.stateNode.containerInfo),bi(e),tn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=El,El=16777216,bi(e),El=t):bi(e));break;default:bi(e)}}function Yh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];st=l,Xh(l,e)}Yh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gh(e),e=e.sibling}function Gh(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&na(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,eu(e)):Al(e);break;default:Al(e)}}function eu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];st=l,Xh(l,e)}Yh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:na(8,t,t.return),eu(t);break;case 22:a=t.stateNode,a._visibility&4&&(a._visibility&=-5,eu(t));break;default:eu(t)}e=e.sibling}}function Xh(e,t){for(;st!==null;){var a=st;switch(a.tag){case 0:case 11:case 15:na(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:fl(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,st=l;else e:for(a=e;st!==null;){l=st;var r=l.sibling,o=l.return;if(Bh(l),l===a){st=null;break e}if(r!==null){r.return=o,st=r;break e}st=o}}}function jg(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,a,l){return new jg(e,t,a,l)}function bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function la(e,t){var a=e.alternate;return a===null?(a=$t(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&31457280,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function $h(e,t){e.flags&=31457282;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function tu(e,t,a,l,r,o){var d=0;if(l=e,typeof e=="function")bc(e)&&(d=1);else if(typeof e=="string")d=Sv(e,a,cn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case p:return ja(a.children,r,o,t);case g:d=8,r|=24;break;case S:return e=$t(12,a,t,r|2),e.elementType=S,e.lanes=o,e;case L:return e=$t(13,a,t,r),e.elementType=L,e.lanes=o,e;case fe:return e=$t(19,a,t,r),e.elementType=fe,e.lanes=o,e;case Ye:return Qh(a,r,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case w:case U:d=10;break e;case C:d=9;break e;case Q:d=11;break e;case de:d=14;break e;case he:d=16,l=null;break e}d=29,a=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=$t(d,a,t,r),t.elementType=e,t.type=l,t.lanes=o,t}function ja(e,t,a,l){return e=$t(7,e,l,t),e.lanes=a,e}function Qh(e,t,a,l){e=$t(22,e,l,t),e.elementType=Ye,e.lanes=a;var r={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var o=r._current;if(o===null)throw Error(u(456));if((r._pendingVisibility&2)===0){var d=$n(o,2);d!==null&&(r._pendingVisibility|=2,St(d,o,2))}},attach:function(){var o=r._current;if(o===null)throw Error(u(456));if((r._pendingVisibility&2)!==0){var d=$n(o,2);d!==null&&(r._pendingVisibility&=-3,St(d,o,2))}}};return e.stateNode=r,e}function _c(e,t,a){return e=$t(6,e,null,t),e.lanes=a,e}function Sc(e,t,a){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Un(e){e.flags|=4}function Jh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Dy(t)){if(t=Yt.current,t!==null&&((Se&4194176)===Se?dn!==null:(Se&62914560)!==Se&&(Se&536870912)===0||t!==dn))throw rl=wr,dd;e.flags|=8192}}function nu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hf():536870912,e.lanes|=t,Si|=t)}function Ol(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags&31457280,l|=r.flags&31457280,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Bg(e,t,a){var l=t.pendingProps;switch(Ar(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Nn(nt),Qa(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(il(t)?Un(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,en!==null&&(kc(en),en=null))),Be(t),null;case 26:return a=t.memoizedState,e===null?(Un(t),a!==null?(Be(t),Jh(t,a)):(Be(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Un(t),Be(t),Jh(t,a)):(Be(t),t.flags&=-16777217):(e.memoizedProps!==l&&Un(t),Be(t),t.flags&=-16777217),null;case 27:ys(t),a=Kn.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Un(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return Be(t),null}e=cn.current,il(t)?od(t):(e=Oy(r,l,a),t.stateNode=e,Un(t))}return Be(t),null;case 5:if(ys(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Un(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return Be(t),null}if(e=cn.current,il(t))od(t);else{switch(r=hu(Kn.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?r.createElement(a,{is:l.is}):r.createElement(a)}}e[ht]=t,e[At]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(ft(e,a,l),a){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Un(t)}}return Be(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Un(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=Kn.current,il(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,r=_t,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}e[ht]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||by(e.nodeValue,a)),e||wa(t)}else e=hu(e).createTextNode(l),e[ht]=t,t.stateNode=e}return Be(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=il(t),l!==null&&l.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[ht]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),r=!1}else en!==null&&(kc(en),en=null),r=!0;if(!r)return t.flags&256?(Rn(t),t):(Rn(t),null)}if(Rn(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=l!==null,e=e!==null&&e.memoizedState!==null,a){l=t.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool);var o=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==r&&(l.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),nu(t,t.updateQueue),Be(t),null;case 4:return Qa(),e===null&&Hc(t.stateNode.containerInfo),Be(t),null;case 10:return Nn(t.type),Be(t),null;case 19:if($e(tt),r=t.memoizedState,r===null)return Be(t),null;if(l=(t.flags&128)!==0,o=r.rendering,o===null)if(l)Ol(r,!1);else{if(Ve!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Zs(e),o!==null){for(t.flags|=128,Ol(r,!1),e=o.updateQueue,t.updateQueue=e,nu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)$h(a,e),a=a.sibling;return je(tt,tt.current&1|2),t.child}e=e.sibling}r.tail!==null&&on()>au&&(t.flags|=128,l=!0,Ol(r,!1),t.lanes=4194304)}else{if(!l)if(e=Zs(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,nu(t,e),Ol(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Ae)return Be(t),null}else 2*on()-r.renderingStartTime>au&&a!==536870912&&(t.flags|=128,l=!0,Ol(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=on(),t.sibling=null,e=tt.current,je(tt,l?e&1|2:e&1),t):(Be(t),null);case 22:case 23:return Rn(t),xr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),a=t.updateQueue,a!==null&&nu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&$e(xa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Nn(nt),Be(t),null;case 25:return null}throw Error(u(156,t.tag))}function qg(e,t){switch(Ar(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(nt),Qa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ys(t),null;case 13:if(Rn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(tt),null;case 4:return Qa(),null;case 10:return Nn(t.type),null;case 22:case 23:return Rn(t),xr(),e!==null&&$e(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(nt),null;case 25:return null;default:return null}}function Fh(e,t){switch(Ar(t),t.tag){case 3:Nn(nt),Qa();break;case 26:case 27:case 5:ys(t);break;case 4:Qa();break;case 13:Rn(t);break;case 19:$e(tt);break;case 10:Nn(t.type);break;case 22:case 23:Rn(t),xr(),e!==null&&$e(xa);break;case 24:Nn(nt)}}var Zg={getCacheForType:function(e){var t=yt(nt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},Hg=typeof WeakMap=="function"?WeakMap:Map,qe=0,De=null,ge=null,Se=0,ze=0,Ct=null,jn=!1,_i=!1,Tc=!1,Bn=0,Ve=0,sa=0,Ba=0,Ec=0,Qt=0,Si=0,wl=null,yn=null,Ac=!1,Oc=0,au=1/0,iu=null,ua=null,lu=!1,qa=null,Rl=0,wc=0,Rc=null,xl=0,xc=null;function Dt(){if((qe&2)!==0&&Se!==0)return Se&-Se;if(B.T!==null){var e=di;return e!==0?e:jc()}return gf()}function Wh(){Qt===0&&(Qt=(Se&536870912)===0||Ae?df():536870912);var e=Yt.current;return e!==null&&(e.flags|=32),Qt}function St(e,t,a){(e===De&&ze===2||e.cancelPendingCommit!==null)&&(Ti(e,0),qn(e,Se,Qt,!1)),Xi(e,a),((qe&2)===0||e!==De)&&(e===De&&((qe&2)===0&&(Ba|=a),Ve===4&&qn(e,Se,Qt,!1)),mn(e))}function Ih(e,t,a){if((qe&6)!==0)throw Error(u(327));var l=!a&&(t&60)===0&&(t&e.expiredLanes)===0||Gi(e,t),r=l?Kg(e,t):Cc(e,t,!0),o=l;do{if(r===0){_i&&!l&&qn(e,t,0,!1);break}else if(r===6)qn(e,t,0,!jn);else{if(a=e.current.alternate,o&&!Vg(a)){r=Cc(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var m=e;r=wl;var v=m.current.memoizedState.isDehydrated;if(v&&(Ti(m,d).flags|=256),d=Cc(m,d,!1),d!==2){if(Tc&&!v){m.errorRecoveryDisabledLanes|=o,Ba|=o,r=4;break e}o=yn,yn=r,o!==null&&kc(o)}r=d}if(o=!1,r!==2)continue}}if(r===1){Ti(e,0),qn(e,t,0,!0);break}e:{switch(l=e,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194176)===t){qn(l,t,Qt,!jn);break e}break;case 2:yn=null;break;case 3:case 5:break;default:throw Error(u(329))}if(l.finishedWork=a,l.finishedLanes=t,(t&62914560)===t&&(o=Oc+300-on(),10<o)){if(qn(l,t,Qt,!jn),vs(l,0)!==0)break e;l.timeoutHandle=Ty(Ph.bind(null,l,a,yn,iu,Ac,t,Qt,Ba,Si,jn,2,-0,0),o);break e}Ph(l,a,yn,iu,Ac,t,Qt,Ba,Si,jn,0,-0,0)}}break}while(!0);mn(e)}function kc(e){yn===null?yn=e:yn.push.apply(yn,e)}function Ph(e,t,a,l,r,o,d,m,v,T,x,M,O){var R=t.subtreeFlags;if((R&8192||(R&16785408)===16785408)&&(zl={stylesheets:null,count:0,unsuspend:Tv},Kh(t),t=Av(),t!==null)){e.cancelPendingCommit=t(sy.bind(null,e,a,l,r,d,m,v,1,M,O)),qn(e,o,d,!T);return}sy(e,a,l,r,d,m,v,x,M,O)}function Vg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var r=a[l],o=r.getSnapshot;r=r.value;try{if(!kt(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qn(e,t,a,l){t&=~Ec,t&=~Ba,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var o=31-xt(r),d=1<<o;l[o]=-1,r&=~d}a!==0&&yf(e,a,t)}function su(){return(qe&6)===0?(kl(0),!1):!0}function Mc(){if(ge!==null){if(ze===0)var e=ge.return;else e=ge,Mn=Da=null,jr(e),oi=null,cl=0,e=ge;for(;e!==null;)Fh(e.alternate,e),e=e.return;ge=null}}function Ti(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,sv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Mc(),De=e,ge=a=la(e.current,null),Se=t,ze=0,Ct=null,jn=!1,_i=Gi(e,t),Tc=!1,Si=Qt=Ec=Ba=sa=Ve=0,yn=wl=null,Ac=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var r=31-xt(l),o=1<<r;t|=e[r],l&=~o}return Bn=t,Ms(),a}function ey(e,t){me=null,B.H=hn,t===ul?(t=md(),ze=3):t===dd?(t=md(),ze=4):ze=t===hh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ct=t,ge===null&&(Ve=1,Fs(e,Vt(t,e.current)))}function ty(){var e=B.H;return B.H=hn,e===null?hn:e}function ny(){var e=B.A;return B.A=Zg,e}function Nc(){Ve=4,jn||(Se&4194176)!==Se&&Yt.current!==null||(_i=!0),(sa&134217727)===0&&(Ba&134217727)===0||De===null||qn(De,Se,Qt,!1)}function Cc(e,t,a){var l=qe;qe|=2;var r=ty(),o=ny();(De!==e||Se!==t)&&(iu=null,Ti(e,t)),t=!1;var d=Ve;e:do try{if(ze!==0&&ge!==null){var m=ge,v=Ct;switch(ze){case 8:Mc(),d=6;break e;case 3:case 2:case 6:Yt.current===null&&(t=!0);var T=ze;if(ze=0,Ct=null,Ei(e,m,v,T),a&&_i){d=0;break e}break;default:T=ze,ze=0,Ct=null,Ei(e,m,v,T)}}Lg(),d=Ve;break}catch(x){ey(e,x)}while(!0);return t&&e.shellSuspendCounter++,Mn=Da=null,qe=l,B.H=r,B.A=o,ge===null&&(De=null,Se=0,Ms()),d}function Lg(){for(;ge!==null;)ay(ge)}function Kg(e,t){var a=qe;qe|=2;var l=ty(),r=ny();De!==e||Se!==t?(iu=null,au=on()+500,Ti(e,t)):_i=Gi(e,t);e:do try{if(ze!==0&&ge!==null){t=ge;var o=Ct;t:switch(ze){case 1:ze=0,Ct=null,Ei(e,t,o,1);break;case 2:if(hd(o)){ze=0,Ct=null,iy(t);break}t=function(){ze===2&&De===e&&(ze=7),mn(e)},o.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:hd(o)?(ze=0,Ct=null,iy(t)):(ze=0,Ct=null,Ei(e,t,o,7));break;case 5:var d=null;switch(ge.tag){case 26:d=ge.memoizedState;case 5:case 27:var m=ge;if(!d||Dy(d)){ze=0,Ct=null;var v=m.sibling;if(v!==null)ge=v;else{var T=m.return;T!==null?(ge=T,uu(T)):ge=null}break t}}ze=0,Ct=null,Ei(e,t,o,5);break;case 6:ze=0,Ct=null,Ei(e,t,o,6);break;case 8:Mc(),Ve=6;break e;default:throw Error(u(462))}}Yg();break}catch(x){ey(e,x)}while(!0);return Mn=Da=null,B.H=l,B.A=r,qe=a,ge!==null?0:(De=null,Se=0,Ms(),Ve)}function Yg(){for(;ge!==null&&!dp();)ay(ge)}function ay(e){var t=Oh(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?uu(e):ge=t}function iy(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=bh(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=bh(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:jr(t);default:Fh(a,t),t=ge=$h(t,Bn),t=Oh(a,t,Bn)}e.memoizedProps=e.pendingProps,t===null?uu(e):ge=t}function Ei(e,t,a,l){Mn=Da=null,jr(t),oi=null,cl=0;var r=t.return;try{if(Cg(e,r,t,a,Se)){Ve=1,Fs(e,Vt(a,e.current)),ge=null;return}}catch(o){if(r!==null)throw ge=r,o;Ve=1,Fs(e,Vt(a,e.current)),ge=null;return}t.flags&32768?(Ae||l===1?e=!0:_i||(Se&536870912)!==0?e=!1:(jn=e=!0,(l===2||l===3||l===6)&&(l=Yt.current,l!==null&&l.tag===13&&(l.flags|=16384))),ly(t,e)):uu(t)}function uu(e){var t=e;do{if((t.flags&32768)!==0){ly(t,jn);return}e=t.return;var a=Bg(t.alternate,t,Bn);if(a!==null){ge=a;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);Ve===0&&(Ve=5)}function ly(e,t){do{var a=qg(e.alternate,e);if(a!==null){a.flags&=32767,ge=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=a}while(e!==null);Ve=6,ge=null}function sy(e,t,a,l,r,o,d,m,v,T){var x=B.T,M=Y.p;try{Y.p=2,B.T=null,Gg(e,t,a,l,M,r,o,d,m,v,T)}finally{B.T=x,Y.p=M}}function Gg(e,t,a,l,r,o,d,m){do Ai();while(qa!==null);if((qe&6)!==0)throw Error(u(327));var v=e.finishedWork;if(l=e.finishedLanes,v===null)return null;if(e.finishedWork=null,e.finishedLanes=0,v===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var T=v.lanes|v.childLanes;if(T|=Sr,Ep(e,l,T,o,d,m),e===De&&(ge=De=null,Se=0),(v.subtreeFlags&10256)===0&&(v.flags&10256)===0||lu||(lu=!0,wc=T,Rc=a,Jg(ms,function(){return Ai(),null})),a=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||a?(a=B.T,B.T=null,o=Y.p,Y.p=2,d=qe,qe|=4,zg(e,v),Hh(v,e),mg(Yc,e.containerInfo),bu=!!Kc,Yc=Kc=null,e.current=v,jh(e,v.alternate,v),hp(),qe=d,Y.p=o,B.T=a):e.current=v,lu?(lu=!1,qa=e,Rl=l):uy(e,T),T=e.pendingLanes,T===0&&(ua=null),vp(v.stateNode),mn(e),t!==null)for(r=e.onRecoverableError,v=0;v<t.length;v++)T=t[v],r(T.value,{componentStack:T.stack});return(Rl&3)!==0&&Ai(),T=e.pendingLanes,(l&4194218)!==0&&(T&42)!==0?e===xc?xl++:(xl=0,xc=e):xl=0,kl(0),null}function uy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fl(t)))}function Ai(){if(qa!==null){var e=qa,t=wc;wc=0;var a=pf(Rl),l=B.T,r=Y.p;try{if(Y.p=32>a?32:a,B.T=null,qa===null)var o=!1;else{a=Rc,Rc=null;var d=qa,m=Rl;if(qa=null,Rl=0,(qe&6)!==0)throw Error(u(331));var v=qe;if(qe|=4,Gh(d.current),Lh(d,d.current,m,a),qe=v,kl(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Yi,d)}catch{}o=!0}return o}finally{Y.p=r,B.T=l,uy(e,t)}}return!1}function ry(e,t,a){t=Vt(a,t),t=Fr(e.stateNode,t,2),e=ta(e,t,2),e!==null&&(Xi(e,2),mn(e))}function Ne(e,t,a){if(e.tag===3)ry(e,e,a);else for(;t!==null;){if(t.tag===3){ry(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ua===null||!ua.has(l))){e=Vt(a,e),a=fh(2),l=ta(t,a,2),l!==null&&(dh(a,l,t,e),Xi(l,2),mn(l));break}}t=t.return}}function Dc(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Hg;var r=new Set;l.set(t,r)}else r=l.get(t),r===void 0&&(r=new Set,l.set(t,r));r.has(a)||(Tc=!0,r.add(a),e=Xg.bind(null,e,t,a),t.then(e,e))}function Xg(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,De===e&&(Se&a)===a&&(Ve===4||Ve===3&&(Se&62914560)===Se&&300>on()-Oc?(qe&2)===0&&Ti(e,0):Ec|=a,Si===Se&&(Si=0)),mn(e)}function cy(e,t){t===0&&(t=hf()),e=$n(e,t),e!==null&&(Xi(e,t),mn(e))}function $g(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),cy(e,a)}function Qg(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),cy(e,a)}function Jg(e,t){return Wu(e,t)}var ru=null,Oi=null,zc=!1,cu=!1,Uc=!1,Za=0;function mn(e){e!==Oi&&e.next===null&&(Oi===null?ru=Oi=e:Oi=Oi.next=e),cu=!0,zc||(zc=!0,Wg(Fg))}function kl(e,t){if(!Uc&&cu){Uc=!0;do for(var a=!1,l=ru;l!==null;){if(e!==0){var r=l.pendingLanes;if(r===0)var o=0;else{var d=l.suspendedLanes,m=l.pingedLanes;o=(1<<31-xt(42|e)+1)-1,o&=r&~(d&~m),o=o&201326677?o&201326677|1:o?o|2:0}o!==0&&(a=!0,dy(l,o))}else o=Se,o=vs(l,l===De?o:0),(o&3)===0||Gi(l,o)||(a=!0,dy(l,o));l=l.next}while(a);Uc=!1}}function Fg(){cu=zc=!1;var e=0;Za!==0&&(lv()&&(e=Za),Za=0);for(var t=on(),a=null,l=ru;l!==null;){var r=l.next,o=oy(l,t);o===0?(l.next=null,a===null?ru=r:a.next=r,r===null&&(Oi=a)):(a=l,(e!==0||(o&3)!==0)&&(cu=!0)),l=r}kl(e)}function oy(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var d=31-xt(o),m=1<<d,v=r[d];v===-1?((m&a)===0||(m&l)!==0)&&(r[d]=Tp(m,t)):v<=t&&(e.expiredLanes|=m),o&=~m}if(t=De,a=Se,a=vs(e,e===t?a:0),l=e.callbackNode,a===0||e===t&&ze===2||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Iu(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Gi(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Iu(l),pf(a)){case 2:case 8:a=of;break;case 32:a=ms;break;case 268435456:a=ff;break;default:a=ms}return l=fy.bind(null,e),a=Wu(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Iu(l),e.callbackPriority=2,e.callbackNode=null,2}function fy(e,t){var a=e.callbackNode;if(Ai()&&e.callbackNode!==a)return null;var l=Se;return l=vs(e,e===De?l:0),l===0?null:(Ih(e,l,t),oy(e,on()),e.callbackNode!=null&&e.callbackNode===a?fy.bind(null,e):null)}function dy(e,t){if(Ai())return null;Ih(e,t,!0)}function Wg(e){uv(function(){(qe&6)!==0?Wu(cf,e):e()})}function jc(){return Za===0&&(Za=df()),Za}function hy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Es(""+e)}function yy(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Ig(e,t,a,l,r){if(t==="submit"&&a&&a.stateNode===r){var o=hy((r[At]||null).action),d=l.submitter;d&&(t=(t=d[At]||null)?hy(t.formAction):d.getAttribute("formAction"),t!==null&&(o=t,d=null));var m=new Rs("action","action",null,l,r);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Za!==0){var v=d?yy(r,d):new FormData(r);Gr(a,{pending:!0,data:v,method:r.method,action:o},null,v)}}else typeof o=="function"&&(m.preventDefault(),v=d?yy(r,d):new FormData(r),Gr(a,{pending:!0,data:v,method:r.method,action:o},o,v))},currentTarget:r}]})}}for(var Bc=0;Bc<sd.length;Bc++){var qc=sd[Bc],Pg=qc.toLowerCase(),ev=qc[0].toUpperCase()+qc.slice(1);Pt(Pg,"on"+ev)}Pt(td,"onAnimationEnd"),Pt(nd,"onAnimationIteration"),Pt(ad,"onAnimationStart"),Pt("dblclick","onDoubleClick"),Pt("focusin","onFocus"),Pt("focusout","onBlur"),Pt(gg,"onTransitionRun"),Pt(vg,"onTransitionStart"),Pt(bg,"onTransitionCancel"),Pt(id,"onTransitionEnd"),Ia("onMouseEnter",["mouseout","mouseover"]),Ia("onMouseLeave",["mouseout","mouseover"]),Ia("onPointerEnter",["pointerout","pointerover"]),Ia("onPointerLeave",["pointerout","pointerover"]),_a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_a("onBeforeInput",["compositionend","keypress","textInput","paste"]),_a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),tv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ml));function my(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],r=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var d=l.length-1;0<=d;d--){var m=l[d],v=m.instance,T=m.currentTarget;if(m=m.listener,v!==o&&r.isPropagationStopped())break e;o=m,r.currentTarget=T;try{o(r)}catch(x){Js(x)}r.currentTarget=null,o=v}else for(d=0;d<l.length;d++){if(m=l[d],v=m.instance,T=m.currentTarget,m=m.listener,v!==o&&r.isPropagationStopped())break e;o=m,r.currentTarget=T;try{o(r)}catch(x){Js(x)}r.currentTarget=null,o=v}}}}function ve(e,t){var a=t[er];a===void 0&&(a=t[er]=new Set);var l=e+"__bubble";a.has(l)||(py(t,e,2,!1),a.add(l))}function Zc(e,t,a){var l=0;t&&(l|=4),py(a,e,l,t)}var ou="_reactListening"+Math.random().toString(36).slice(2);function Hc(e){if(!e[ou]){e[ou]=!0,bf.forEach(function(a){a!=="selectionchange"&&(tv.has(a)||Zc(a,!1,e),Zc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ou]||(t[ou]=!0,Zc("selectionchange",!1,t))}}function py(e,t,a,l){switch(Zy(t)){case 2:var r=Rv;break;case 8:r=xv;break;default:r=Pc}a=r.bind(null,t,a,e),r=void 0,!rr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),l?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Vc(e,t,a,l,r){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var m=l.stateNode.containerInfo;if(m===r||m.nodeType===8&&m.parentNode===r)break;if(d===4)for(d=l.return;d!==null;){var v=d.tag;if((v===3||v===4)&&(v=d.stateNode.containerInfo,v===r||v.nodeType===8&&v.parentNode===r))return;d=d.return}for(;m!==null;){if(d=ba(m),d===null)return;if(v=d.tag,v===5||v===6||v===26||v===27){l=o=d;continue e}m=m.parentNode}}l=l.return}Nf(function(){var T=o,x=sr(a),M=[];e:{var O=ld.get(e);if(O!==void 0){var R=Rs,J=e;switch(e){case"keypress":if(Os(a)===0)break e;case"keydown":case"keyup":R=Qp;break;case"focusin":J="focus",R=dr;break;case"focusout":J="blur",R=dr;break;case"beforeblur":case"afterblur":R=dr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":R=zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=Wp;break;case td:case nd:case ad:R=Zp;break;case id:R=Pp;break;case"scroll":case"scrollend":R=zp;break;case"wheel":R=tg;break;case"copy":case"cut":case"paste":R=Vp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=jf;break;case"toggle":case"beforetoggle":R=ag}var le=(t&4)!==0,Le=!le&&(e==="scroll"||e==="scrollend"),E=le?O!==null?O+"Capture":null:O;le=[];for(var _=T,A;_!==null;){var k=_;if(A=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||A===null||E===null||(k=Ji(_,E),k!=null&&le.push(Nl(_,k,A))),Le)break;_=_.return}0<le.length&&(O=new R(O,J,null,a,x),M.push({event:O,listeners:le}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",O&&a!==lr&&(J=a.relatedTarget||a.fromElement)&&(ba(J)||J[Ja]))break e;if((R||O)&&(O=x.window===x?x:(O=x.ownerDocument)?O.defaultView||O.parentWindow:window,R?(J=a.relatedTarget||a.toElement,R=T,J=J?ba(J):null,J!==null&&(Le=I(J),le=J.tag,J!==Le||le!==5&&le!==27&&le!==6)&&(J=null)):(R=null,J=T),R!==J)){if(le=zf,k="onMouseLeave",E="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(le=jf,k="onPointerLeave",E="onPointerEnter",_="pointer"),Le=R==null?O:Qi(R),A=J==null?O:Qi(J),O=new le(k,_+"leave",R,a,x),O.target=Le,O.relatedTarget=A,k=null,ba(x)===T&&(le=new le(E,_+"enter",J,a,x),le.target=A,le.relatedTarget=Le,k=le),Le=k,R&&J)t:{for(le=R,E=J,_=0,A=le;A;A=wi(A))_++;for(A=0,k=E;k;k=wi(k))A++;for(;0<_-A;)le=wi(le),_--;for(;0<A-_;)E=wi(E),A--;for(;_--;){if(le===E||E!==null&&le===E.alternate)break t;le=wi(le),E=wi(E)}le=null}else le=null;R!==null&&gy(M,O,R,le,!1),J!==null&&Le!==null&&gy(M,Le,J,le,!0)}}e:{if(O=T?Qi(T):window,R=O.nodeName&&O.nodeName.toLowerCase(),R==="select"||R==="input"&&O.type==="file")var G=Yf;else if(Lf(O))if(Gf)G=hg;else{G=fg;var pe=og}else R=O.nodeName,!R||R.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?T&&ir(T.elementType)&&(G=Yf):G=dg;if(G&&(G=G(e,T))){Kf(M,G,a,x);break e}pe&&pe(e,O,T),e==="focusout"&&T&&O.type==="number"&&T.memoizedProps.value!=null&&ar(O,"number",O.value)}switch(pe=T?Qi(T):window,e){case"focusin":(Lf(pe)||pe.contentEditable==="true")&&(ii=pe,vr=T,al=null);break;case"focusout":al=vr=ii=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,Pf(M,a,x);break;case"selectionchange":if(pg)break;case"keydown":case"keyup":Pf(M,a,x)}var F;if(yr)e:{switch(e){case"compositionstart":var ee="onCompositionStart";break e;case"compositionend":ee="onCompositionEnd";break e;case"compositionupdate":ee="onCompositionUpdate";break e}ee=void 0}else ai?Hf(e,a)&&(ee="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ee="onCompositionStart");ee&&(Bf&&a.locale!=="ko"&&(ai||ee!=="onCompositionStart"?ee==="onCompositionEnd"&&ai&&(F=Cf()):(Xn=x,cr="value"in Xn?Xn.value:Xn.textContent,ai=!0)),pe=fu(T,ee),0<pe.length&&(ee=new Uf(ee,e,null,a,x),M.push({event:ee,listeners:pe}),F?ee.data=F:(F=Vf(a),F!==null&&(ee.data=F)))),(F=lg?sg(e,a):ug(e,a))&&(ee=fu(T,"onBeforeInput"),0<ee.length&&(pe=new Uf("onBeforeInput","beforeinput",null,a,x),M.push({event:pe,listeners:ee}),pe.data=F)),Ig(M,e,T,a,x)}my(M,t)})}function Nl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function fu(e,t){for(var a=t+"Capture",l=[];e!==null;){var r=e,o=r.stateNode;r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Ji(e,a),r!=null&&l.unshift(Nl(e,r,o)),r=Ji(e,t),r!=null&&l.push(Nl(e,r,o))),e=e.return}return l}function wi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gy(e,t,a,l,r){for(var o=t._reactName,d=[];a!==null&&a!==l;){var m=a,v=m.alternate,T=m.stateNode;if(m=m.tag,v!==null&&v===l)break;m!==5&&m!==26&&m!==27||T===null||(v=T,r?(T=Ji(a,o),T!=null&&d.unshift(Nl(a,T,v))):r||(T=Ji(a,o),T!=null&&d.push(Nl(a,T,v)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var nv=/\r\n?/g,av=/\u0000|\uFFFD/g;function vy(e){return(typeof e=="string"?e:""+e).replace(nv,`
|
|
62
|
-
`).replace(av,"")}function by(e,t){return t=vy(t),vy(e)===t}function du(){}function Me(e,t,a,l,r,o){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ei(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ei(e,""+l);break;case"className":_s(e,"class",l);break;case"tabIndex":_s(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":_s(e,a,l);break;case"style":kf(e,l,o);break;case"data":if(t!=="object"){_s(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Es(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(t!=="input"&&Me(e,t,"name",r.name,r,null),Me(e,t,"formEncType",r.formEncType,r,null),Me(e,t,"formMethod",r.formMethod,r,null),Me(e,t,"formTarget",r.formTarget,r,null)):(Me(e,t,"encType",r.encType,r,null),Me(e,t,"method",r.method,r,null),Me(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Es(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=du);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Es(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),bs(e,"popover",l);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Cp.get(a)||a,bs(e,a,l))}}function Lc(e,t,a,l,r,o){switch(a){case"style":kf(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof l=="string"?ei(e,l):(typeof l=="number"||typeof l=="bigint")&&ei(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=du);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_f.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[At]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof l=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,r);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):bs(e,a,l)}}}function ft(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var d=a[o];if(d!=null)switch(o){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,o,d,a,null)}}r&&Me(e,t,"srcSet",a.srcSet,a,null),l&&Me(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var m=o=d=r=null,v=null,T=null;for(l in a)if(a.hasOwnProperty(l)){var x=a[l];if(x!=null)switch(l){case"name":r=x;break;case"type":d=x;break;case"checked":v=x;break;case"defaultChecked":T=x;break;case"value":o=x;break;case"defaultValue":m=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(137,t));break;default:Me(e,t,l,x,a,null)}}Of(e,o,m,v,T,d,r,!1),Ss(e);return;case"select":ve("invalid",e),l=d=o=null;for(r in a)if(a.hasOwnProperty(r)&&(m=a[r],m!=null))switch(r){case"value":o=m;break;case"defaultValue":d=m;break;case"multiple":l=m;default:Me(e,t,r,m,a,null)}t=o,a=d,e.multiple=!!l,t!=null?Pa(e,!!l,t,!1):a!=null&&Pa(e,!!l,a,!0);return;case"textarea":ve("invalid",e),o=r=l=null;for(d in a)if(a.hasOwnProperty(d)&&(m=a[d],m!=null))switch(d){case"value":l=m;break;case"defaultValue":r=m;break;case"children":o=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Me(e,t,d,m,a,null)}Rf(e,l,r,o),Ss(e);return;case"option":for(v in a)if(a.hasOwnProperty(v)&&(l=a[v],l!=null))switch(v){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Me(e,t,v,l,a,null)}return;case"dialog":ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ml.length;l++)ve(Ml[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in a)if(a.hasOwnProperty(T)&&(l=a[T],l!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,T,l,a,null)}return;default:if(ir(t)){for(x in a)a.hasOwnProperty(x)&&(l=a[x],l!==void 0&&Lc(e,t,x,l,a,void 0));return}}for(m in a)a.hasOwnProperty(m)&&(l=a[m],l!=null&&Me(e,t,m,l,a,null))}function iv(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,d=null,m=null,v=null,T=null,x=null;for(R in a){var M=a[R];if(a.hasOwnProperty(R)&&M!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":v=M;default:l.hasOwnProperty(R)||Me(e,t,R,null,l,M)}}for(var O in l){var R=l[O];if(M=a[O],l.hasOwnProperty(O)&&(R!=null||M!=null))switch(O){case"type":o=R;break;case"name":r=R;break;case"checked":T=R;break;case"defaultChecked":x=R;break;case"value":d=R;break;case"defaultValue":m=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:R!==M&&Me(e,t,O,R,l,M)}}nr(e,d,m,v,T,x,o,r);return;case"select":R=d=m=O=null;for(o in a)if(v=a[o],a.hasOwnProperty(o)&&v!=null)switch(o){case"value":break;case"multiple":R=v;default:l.hasOwnProperty(o)||Me(e,t,o,null,l,v)}for(r in l)if(o=l[r],v=a[r],l.hasOwnProperty(r)&&(o!=null||v!=null))switch(r){case"value":O=o;break;case"defaultValue":m=o;break;case"multiple":d=o;default:o!==v&&Me(e,t,r,o,l,v)}t=m,a=d,l=R,O!=null?Pa(e,!!a,O,!1):!!l!=!!a&&(t!=null?Pa(e,!!a,t,!0):Pa(e,!!a,a?[]:"",!1));return;case"textarea":R=O=null;for(m in a)if(r=a[m],a.hasOwnProperty(m)&&r!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Me(e,t,m,null,l,r)}for(d in l)if(r=l[d],o=a[d],l.hasOwnProperty(d)&&(r!=null||o!=null))switch(d){case"value":O=r;break;case"defaultValue":R=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==o&&Me(e,t,d,r,l,o)}wf(e,O,R);return;case"option":for(var J in a)if(O=a[J],a.hasOwnProperty(J)&&O!=null&&!l.hasOwnProperty(J))switch(J){case"selected":e.selected=!1;break;default:Me(e,t,J,null,l,O)}for(v in l)if(O=l[v],R=a[v],l.hasOwnProperty(v)&&O!==R&&(O!=null||R!=null))switch(v){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Me(e,t,v,O,l,R)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in a)O=a[le],a.hasOwnProperty(le)&&O!=null&&!l.hasOwnProperty(le)&&Me(e,t,le,null,l,O);for(T in l)if(O=l[T],R=a[T],l.hasOwnProperty(T)&&O!==R&&(O!=null||R!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Me(e,t,T,O,l,R)}return;default:if(ir(t)){for(var Le in a)O=a[Le],a.hasOwnProperty(Le)&&O!==void 0&&!l.hasOwnProperty(Le)&&Lc(e,t,Le,void 0,l,O);for(x in l)O=l[x],R=a[x],!l.hasOwnProperty(x)||O===R||O===void 0&&R===void 0||Lc(e,t,x,O,l,R);return}}for(var E in a)O=a[E],a.hasOwnProperty(E)&&O!=null&&!l.hasOwnProperty(E)&&Me(e,t,E,null,l,O);for(M in l)O=l[M],R=a[M],!l.hasOwnProperty(M)||O===R||O==null&&R==null||Me(e,t,M,O,l,R)}var Kc=null,Yc=null;function hu(e){return e.nodeType===9?e:e.ownerDocument}function _y(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xc=null;function lv(){var e=window.event;return e&&e.type==="popstate"?e===Xc?!1:(Xc=e,!0):(Xc=null,!1)}var Ty=typeof setTimeout=="function"?setTimeout:void 0,sv=typeof clearTimeout=="function"?clearTimeout:void 0,Ey=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ey<"u"?function(e){return Ey.resolve(null).then(e).catch(rv)}:Ty;function rv(e){setTimeout(function(){throw e})}function $c(e,t){var a=t,l=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(l===0){e.removeChild(r),Zl(t);return}l--}else a!=="$"&&a!=="$?"&&a!=="$!"||l++;a=r}while(a);Zl(t)}function Qc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Qc(a),tr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cv(e,t,a,l){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[$i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=nn(e.nextSibling),e===null)break}return null}function ov(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=nn(e.nextSibling),e===null))return null;return e}function nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function Ay(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Oy(e,t,a){switch(t=hu(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}var Jt=new Map,wy=new Set;function yu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var Zn=Y.d;Y.d={f:fv,r:dv,D:hv,C:yv,L:mv,m:pv,X:vv,S:gv,M:bv};function fv(){var e=Zn.f(),t=su();return e||t}function dv(e){var t=Fa(e);t!==null&&t.tag===5&&t.type==="form"?Pd(t):Zn.r(e)}var Ri=typeof document>"u"?null:document;function Ry(e,t,a){var l=Ri;if(l&&typeof t=="string"&&t){var r=Zt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),wy.has(r)||(wy.add(r),e={rel:e,crossOrigin:a,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),ft(t,"link",e),it(t),l.head.appendChild(t)))}}function hv(e){Zn.D(e),Ry("dns-prefetch",e,null)}function yv(e,t){Zn.C(e,t),Ry("preconnect",e,t)}function mv(e,t,a){Zn.L(e,t,a);var l=Ri;if(l&&e&&t){var r='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Zt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Zt(a.imageSizes)+'"]')):r+='[href="'+Zt(e)+'"]';var o=r;switch(t){case"style":o=xi(e);break;case"script":o=ki(e)}Jt.has(o)||(e=X({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Jt.set(o,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(Cl(o))||t==="script"&&l.querySelector(Dl(o))||(t=l.createElement("link"),ft(t,"link",e),it(t),l.head.appendChild(t)))}}function pv(e,t){Zn.m(e,t);var a=Ri;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',o=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ki(e)}if(!Jt.has(o)&&(e=X({rel:"modulepreload",href:e},t),Jt.set(o,e),a.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Dl(o)))return}l=a.createElement("link"),ft(l,"link",e),it(l),a.head.appendChild(l)}}}function gv(e,t,a){Zn.S(e,t,a);var l=Ri;if(l&&e){var r=Wa(l).hoistableStyles,o=xi(e);t=t||"default";var d=r.get(o);if(!d){var m={loading:0,preload:null};if(d=l.querySelector(Cl(o)))m.loading=5;else{e=X({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Jt.get(o))&&Jc(e,a);var v=d=l.createElement("link");it(v),ft(v,"link",e),v._p=new Promise(function(T,x){v.onload=T,v.onerror=x}),v.addEventListener("load",function(){m.loading|=1}),v.addEventListener("error",function(){m.loading|=2}),m.loading|=4,mu(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:m},r.set(o,d)}}}function vv(e,t){Zn.X(e,t);var a=Ri;if(a&&e){var l=Wa(a).hoistableScripts,r=ki(e),o=l.get(r);o||(o=a.querySelector(Dl(r)),o||(e=X({src:e,async:!0},t),(t=Jt.get(r))&&Fc(e,t),o=a.createElement("script"),it(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function bv(e,t){Zn.M(e,t);var a=Ri;if(a&&e){var l=Wa(a).hoistableScripts,r=ki(e),o=l.get(r);o||(o=a.querySelector(Dl(r)),o||(e=X({src:e,async:!0,type:"module"},t),(t=Jt.get(r))&&Fc(e,t),o=a.createElement("script"),it(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function xy(e,t,a,l){var r=(r=Kn.current)?yu(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xi(a.href),a=Wa(r).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xi(a.href);var o=Wa(r).hoistableStyles,d=o.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=r.querySelector(Cl(e)))&&!o._p&&(d.instance=o,d.state.loading=5),Jt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jt.set(e,a),o||_v(r,e,a,d.state))),t&&l===null)throw Error(u(528,""));return d}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ki(a),a=Wa(r).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function xi(e){return'href="'+Zt(e)+'"'}function Cl(e){return'link[rel="stylesheet"]['+e+"]"}function ky(e){return X({},e,{"data-precedence":e.precedence,precedence:null})}function _v(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ft(t,"link",a),it(t),e.head.appendChild(t))}function ki(e){return'[src="'+Zt(e)+'"]'}function Dl(e){return"script[async]"+e}function My(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(a.href)+'"]');if(l)return t.instance=l,it(l),l;var r=X({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),it(l),ft(l,"style",r),mu(l,a.precedence,e),t.instance=l;case"stylesheet":r=xi(a.href);var o=e.querySelector(Cl(r));if(o)return t.state.loading|=4,t.instance=o,it(o),o;l=ky(a),(r=Jt.get(r))&&Jc(l,r),o=(e.ownerDocument||e).createElement("link"),it(o);var d=o;return d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",l),t.state.loading|=4,mu(o,a.precedence,e),t.instance=o;case"script":return o=ki(a.src),(r=e.querySelector(Dl(o)))?(t.instance=r,it(r),r):(l=a,(r=Jt.get(o))&&(l=X({},a),Fc(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),ft(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,mu(l,a.precedence,e));return t.instance}function mu(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,o=r,d=0;d<l.length;d++){var m=l[d];if(m.dataset.precedence===t)o=m;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var pu=null;function Ny(e,t,a){if(pu===null){var l=new Map,r=pu=new Map;r.set(a,l)}else r=pu,l=r.get(a),l||(l=new Map,r.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[$i]||o[ht]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var d=o.getAttribute(t)||"";d=e+d;var m=l.get(d);m?m.push(o):l.set(d,[o])}}return l}function Cy(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Sv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Dy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var zl=null;function Tv(){}function Ev(e,t,a){if(zl===null)throw Error(u(475));var l=zl;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var r=xi(a.href),o=e.querySelector(Cl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=gu.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=o,it(o);return}o=e.ownerDocument||e,a=ky(a),(r=Jt.get(r))&&Jc(a,r),o=o.createElement("link"),it(o);var d=o;d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",a),t.instance=o}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=gu.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function Av(){if(zl===null)throw Error(u(475));var e=zl;return e.stylesheets&&e.count===0&&Wc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Wc(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function gu(){if(this.count--,this.count===0){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vu=null;function Wc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vu=new Map,t.forEach(Ov,e),vu=null,gu.call(e))}function Ov(e,t){if(!(t.state.loading&4)){var a=vu.get(e);if(a)var l=a.get(null);else{a=new Map,vu.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var d=r[o];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}r=t.instance,d=r.getAttribute("data-precedence"),o=a.get(d)||l,o===l&&a.set(null,r),a.set(d,r),this.count++,l=gu.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Ul={$$typeof:U,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function wv(e,t,a,l,r,o,d,m){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.hiddenUpdates=Pu(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function zy(e,t,a,l,r,o,d,m,v,T,x,M){return e=new wv(e,t,a,d,m,v,T,M),t=1,o===!0&&(t|=24),o=$t(3,null,null,t),e.current=o,o.stateNode=e,t=kr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:a,cache:t},cc(o),e}function Uy(e){return e?(e=ui,e):ui}function jy(e,t,a,l,r,o){r=Uy(r),l.context===null?l.context=r:l.pendingContext=r,l=ea(t),l.payload={element:a},o=o===void 0?null:o,o!==null&&(l.callback=o),a=ta(e,l,t),a!==null&&(St(a,e,t),vl(a,e,t))}function By(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ic(e,t){By(e,t),(e=e.alternate)&&By(e,t)}function qy(e){if(e.tag===13){var t=$n(e,67108864);t!==null&&St(t,e,67108864),Ic(e,67108864)}}var bu=!0;function Rv(e,t,a,l){var r=B.T;B.T=null;var o=Y.p;try{Y.p=2,Pc(e,t,a,l)}finally{Y.p=o,B.T=r}}function xv(e,t,a,l){var r=B.T;B.T=null;var o=Y.p;try{Y.p=8,Pc(e,t,a,l)}finally{Y.p=o,B.T=r}}function Pc(e,t,a,l){if(bu){var r=eo(l);if(r===null)Vc(e,t,l,_u,a),Hy(e,l);else if(Mv(r,e,t,a,l))l.stopPropagation();else if(Hy(e,l),t&4&&-1<kv.indexOf(e)){for(;r!==null;){var o=Fa(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var d=va(o.pendingLanes);if(d!==0){var m=o;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var v=1<<31-xt(d);m.entanglements[1]|=v,d&=~v}mn(o),(qe&6)===0&&(au=on()+500,kl(0))}}break;case 13:m=$n(o,2),m!==null&&St(m,o,2),su(),Ic(o,2)}if(o=eo(l),o===null&&Vc(e,t,l,_u,a),o===r)break;r=o}r!==null&&l.stopPropagation()}else Vc(e,t,l,null,a)}}function eo(e){return e=sr(e),to(e)}var _u=null;function to(e){if(_u=null,e=ba(e),e!==null){var t=I(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Ee(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _u=e,null}function Zy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yp()){case cf:return 2;case of:return 8;case ms:case mp:return 32;case ff:return 268435456;default:return 32}default:return 32}}var no=!1,ra=null,ca=null,oa=null,jl=new Map,Bl=new Map,fa=[],kv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hy(e,t){switch(e){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(t.pointerId)}}function ql(e,t,a,l,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Fa(t),t!==null&&qy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Mv(e,t,a,l,r){switch(t){case"focusin":return ra=ql(ra,e,t,a,l,r),!0;case"dragenter":return ca=ql(ca,e,t,a,l,r),!0;case"mouseover":return oa=ql(oa,e,t,a,l,r),!0;case"pointerover":var o=r.pointerId;return jl.set(o,ql(jl.get(o)||null,e,t,a,l,r)),!0;case"gotpointercapture":return o=r.pointerId,Bl.set(o,ql(Bl.get(o)||null,e,t,a,l,r)),!0}return!1}function Vy(e){var t=ba(e.target);if(t!==null){var a=I(t);if(a!==null){if(t=a.tag,t===13){if(t=Ee(a),t!==null){e.blockedOn=t,Ap(e.priority,function(){if(a.tag===13){var l=Dt(),r=$n(a,l);r!==null&&St(r,a,l),Ic(a,l)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Su(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=eo(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);lr=l,a.target.dispatchEvent(l),lr=null}else return t=Fa(a),t!==null&&qy(t),e.blockedOn=a,!1;t.shift()}return!0}function Ly(e,t,a){Su(e)&&a.delete(t)}function Nv(){no=!1,ra!==null&&Su(ra)&&(ra=null),ca!==null&&Su(ca)&&(ca=null),oa!==null&&Su(oa)&&(oa=null),jl.forEach(Ly),Bl.forEach(Ly)}function Tu(e,t){e.blockedOn===t&&(e.blockedOn=null,no||(no=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Nv)))}var Eu=null;function Ky(e){Eu!==e&&(Eu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Eu===e&&(Eu=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(to(l||a)===null)continue;break}var o=Fa(a);o!==null&&(e.splice(t,3),t-=3,Gr(o,{pending:!0,data:r,method:a.method,action:l},l,r))}}))}function Zl(e){function t(v){return Tu(v,e)}ra!==null&&Tu(ra,e),ca!==null&&Tu(ca,e),oa!==null&&Tu(oa,e),jl.forEach(t),Bl.forEach(t);for(var a=0;a<fa.length;a++){var l=fa[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<fa.length&&(a=fa[0],a.blockedOn===null);)Vy(a),a.blockedOn===null&&fa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var r=a[l],o=a[l+1],d=r[At]||null;if(typeof o=="function")d||Ky(a);else if(d){var m=null;if(o&&o.hasAttribute("formAction")){if(r=o,d=o[At]||null)m=d.formAction;else if(to(r)!==null)continue}else m=d.action;typeof m=="function"?a[l+1]=m:(a.splice(l,3),l-=3),Ky(a)}}}function ao(e){this._internalRoot=e}Au.prototype.render=ao.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,l=Dt();jy(a,l,e,t,null,null)},Au.prototype.unmount=ao.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&Ai(),jy(e.current,2,null,e,null,null),su(),t[Ja]=null}};function Au(e){this._internalRoot=e}Au.prototype.unstable_scheduleHydration=function(e){if(e){var t=gf();e={blockedOn:null,target:e,priority:t};for(var a=0;a<fa.length&&t!==0&&t<fa[a].priority;a++);fa.splice(a,0,e),a===0&&Vy(e)}};var Yy=n.version;if(Yy!=="19.0.0")throw Error(u(527,Yy,"19.0.0"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=D(t),e=e!==null?te(e):null,e=e===null?null:e.stateNode,e};var Cv={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:B,findFiberByHostInstance:ba,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ou.isDisabled&&Ou.supportsFiber)try{Yi=Ou.inject(Cv),Rt=Ou}catch{}}return Vl.createRoot=function(e,t){if(!c(e))throw Error(u(299));var a=!1,l="",r=uh,o=rh,d=ch,m=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(m=t.unstable_transitionCallbacks)),t=zy(e,1,!1,null,null,a,l,r,o,d,m,null),e[Ja]=t.current,Hc(e.nodeType===8?e.parentNode:e),new ao(t)},Vl.hydrateRoot=function(e,t,a){if(!c(e))throw Error(u(299));var l=!1,r="",o=uh,d=rh,m=ch,v=null,T=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(m=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(v=a.unstable_transitionCallbacks),a.formState!==void 0&&(T=a.formState)),t=zy(e,1,!0,t,a??null,l,r,o,d,m,v,T),t.context=Uy(null),a=t.current,l=Dt(),r=ea(l),r.callback=null,ta(a,r,l),t.current.lanes=l,Xi(t,l),mn(t),e[Ja]=t.current,Hc(e),new Au(t)},Vl.version="19.0.0",Vl}var am;function r0(){if(am)return uo.exports;am=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),uo.exports=u0(),uo.exports}var c0=r0(),Te;(function(s){s.assertEqual=c=>c;function n(c){}s.assertIs=n;function i(c){throw new Error}s.assertNever=i,s.arrayToEnum=c=>{const f={};for(const h of c)f[h]=h;return f},s.getValidEnumValues=c=>{const f=s.objectKeys(c).filter(y=>typeof c[c[y]]!="number"),h={};for(const y of f)h[y]=c[y];return s.objectValues(h)},s.objectValues=c=>s.objectKeys(c).map(function(f){return c[f]}),s.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const f=[];for(const h in c)Object.prototype.hasOwnProperty.call(c,h)&&f.push(h);return f},s.find=(c,f)=>{for(const h of c)if(f(h))return h},s.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function u(c,f=" | "){return c.map(h=>typeof h=="string"?`'${h}'`:h).join(f)}s.joinValues=u,s.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Te||(Te={}));var To;(function(s){s.mergeShapes=(n,i)=>({...n,...i})})(To||(To={}));const V=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vn=s=>{switch(typeof s){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(s)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(s)?V.array:s===null?V.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?V.promise:typeof Map<"u"&&s instanceof Map?V.map:typeof Set<"u"&&s instanceof Set?V.set:typeof Date<"u"&&s instanceof Date?V.date:V.object;default:return V.unknown}},z=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o0=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class jt extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=n}format(n){const i=n||function(f){return f.message},u={_errors:[]},c=f=>{for(const h of f.issues)if(h.code==="invalid_union")h.unionErrors.map(c);else if(h.code==="invalid_return_type")c(h.returnTypeError);else if(h.code==="invalid_arguments")c(h.argumentsError);else if(h.path.length===0)u._errors.push(i(h));else{let y=u,p=0;for(;p<h.path.length;){const g=h.path[p];p===h.path.length-1?(y[g]=y[g]||{_errors:[]},y[g]._errors.push(i(h))):y[g]=y[g]||{_errors:[]},y=y[g],p++}}};return c(this),u}static assert(n){if(!(n instanceof jt))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=i=>i.message){const i={},u=[];for(const c of this.issues)c.path.length>0?(i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c))):u.push(n(c));return{formErrors:u,fieldErrors:i}}get formErrors(){return this.flatten()}}jt.create=s=>new jt(s);const ji=(s,n)=>{let i;switch(s.code){case z.invalid_type:s.received===V.undefined?i="Required":i=`Expected ${s.expected}, received ${s.received}`;break;case z.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(s.expected,Te.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:i=`Unrecognized key(s) in object: ${Te.joinValues(s.keys,", ")}`;break;case z.invalid_union:i="Invalid input";break;case z.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Te.joinValues(s.options)}`;break;case z.invalid_enum_value:i=`Invalid enum value. Expected ${Te.joinValues(s.options)}, received '${s.received}'`;break;case z.invalid_arguments:i="Invalid function arguments";break;case z.invalid_return_type:i="Invalid function return type";break;case z.invalid_date:i="Invalid date";break;case z.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(i=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?i=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?i=`Invalid input: must end with "${s.validation.endsWith}"`:Te.assertNever(s.validation):s.validation!=="regex"?i=`Invalid ${s.validation}`:i="Invalid";break;case z.too_small:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:i="Invalid input";break;case z.too_big:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?i=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:i="Invalid input";break;case z.custom:i="Invalid input";break;case z.invalid_intersection_types:i="Intersection results could not be merged";break;case z.not_multiple_of:i=`Number must be a multiple of ${s.multipleOf}`;break;case z.not_finite:i="Number must be finite";break;default:i=n.defaultError,Te.assertNever(s)}return{message:i}};let Cm=ji;function f0(s){Cm=s}function Uu(){return Cm}const ju=s=>{const{data:n,path:i,errorMaps:u,issueData:c}=s,f=[...i,...c.path||[]],h={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let y="";const p=u.filter(g=>!!g).slice().reverse();for(const g of p)y=g(h,{data:n,defaultError:y}).message;return{...c,path:f,message:y}},d0=[];function H(s,n){const i=Uu(),u=ju({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,i,i===ji?void 0:ji].filter(c=>!!c)});s.common.issues.push(u)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,i){const u=[];for(const c of i){if(c.status==="aborted")return ae;c.status==="dirty"&&n.dirty(),u.push(c.value)}return{status:n.value,value:u}}static async mergeObjectAsync(n,i){const u=[];for(const c of i){const f=await c.key,h=await c.value;u.push({key:f,value:h})}return vt.mergeObjectSync(n,u)}static mergeObjectSync(n,i){const u={};for(const c of i){const{key:f,value:h}=c;if(f.status==="aborted"||h.status==="aborted")return ae;f.status==="dirty"&&n.dirty(),h.status==="dirty"&&n.dirty(),f.value!=="__proto__"&&(typeof h.value<"u"||c.alwaysSet)&&(u[f.value]=h.value)}return{status:n.value,value:u}}}const ae=Object.freeze({status:"aborted"}),Di=s=>({status:"dirty",value:s}),Et=s=>({status:"valid",value:s}),Eo=s=>s.status==="aborted",Ao=s=>s.status==="dirty",Ka=s=>s.status==="valid",Ql=s=>typeof Promise<"u"&&s instanceof Promise;function Bu(s,n,i,u){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n.get(s)}function Dm(s,n,i,u,c){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(s,i),i}var $;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})($||($={}));var Kl,Yl;class _n{constructor(n,i,u,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=u,this._key=c}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const im=(s,n)=>{if(Ka(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new jt(s.common.issues);return this._error=i,this._error}}};function ue(s){if(!s)return{};const{errorMap:n,invalid_type_error:i,required_error:u,description:c}=s;if(n&&(i||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:c}:{errorMap:(h,y)=>{var p,g;const{message:S}=s;return h.code==="invalid_enum_value"?{message:S??y.defaultError}:typeof y.data>"u"?{message:(p=S??u)!==null&&p!==void 0?p:y.defaultError}:h.code!=="invalid_type"?{message:y.defaultError}:{message:(g=S??i)!==null&&g!==void 0?g:y.defaultError}},description:c}}class oe{get description(){return this._def.description}_getType(n){return Vn(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Vn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new vt,ctx:{common:n.parent.common,data:n.data,parsedType:Vn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const i=this._parse(n);if(Ql(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){const i=this._parse(n);return Promise.resolve(i)}parse(n,i){const u=this.safeParse(n,i);if(u.success)return u.data;throw u.error}safeParse(n,i){var u;const c={common:{issues:[],async:(u=i==null?void 0:i.async)!==null&&u!==void 0?u:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)},f=this._parseSync({data:n,path:c.path,parent:c});return im(c,f)}"~validate"(n){var i,u;const c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)};if(!this["~standard"].async)try{const f=this._parseSync({data:n,path:[],parent:c});return Ka(f)?{value:f.value}:{issues:c.common.issues}}catch(f){!((u=(i=f==null?void 0:f.message)===null||i===void 0?void 0:i.toLowerCase())===null||u===void 0)&&u.includes("encountered")&&(this["~standard"].async=!0),c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then(f=>Ka(f)?{value:f.value}:{issues:c.common.issues})}async parseAsync(n,i){const u=await this.safeParseAsync(n,i);if(u.success)return u.data;throw u.error}async safeParseAsync(n,i){const u={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)},c=this._parse({data:n,path:u.path,parent:u}),f=await(Ql(c)?c:Promise.resolve(c));return im(u,f)}refine(n,i){const u=c=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(c):i;return this._refinement((c,f)=>{const h=n(c),y=()=>f.addIssue({code:z.custom,...u(c)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(y(),!1)):h?!0:(y(),!1)})}refinement(n,i){return this._refinement((u,c)=>n(u)?!0:(c.addIssue(typeof i=="function"?i(u,c):i),!1))}_refinement(n){return new un({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return vn.create(this,this._def)}nullable(){return ga.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this)}promise(){return qi.create(this,this._def)}or(n){return Il.create([this,n],this._def)}and(n){return Pl.create(this,n,this._def)}transform(n){return new un({...ue(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const i=typeof n=="function"?n:()=>n;return new is({...ue(this._def),innerType:this,defaultValue:i,typeName:ne.ZodDefault})}brand(){return new Wo({typeName:ne.ZodBranded,type:this,...ue(this._def)})}catch(n){const i=typeof n=="function"?n:()=>n;return new ls({...ue(this._def),innerType:this,catchValue:i,typeName:ne.ZodCatch})}describe(n){const i=this.constructor;return new i({...this._def,description:n})}pipe(n){return fs.create(this,n)}readonly(){return ss.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const h0=/^c[^\s-]{8,}$/i,y0=/^[0-9a-z]+$/,m0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g0=/^[a-z0-9_-]{21}$/i,v0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,S0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fo;const T0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,A0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,O0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",x0=new RegExp(`^${zm}$`);function Um(s){let n="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`),n}function k0(s){return new RegExp(`^${Um(s)}$`)}function jm(s){let n=`${zm}T${Um(s)}`;const i=[];return i.push(s.local?"Z?":"Z"),s.offset&&i.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${i.join("|")})`,new RegExp(`^${n}$`)}function M0(s,n){return!!((n==="v4"||!n)&&T0.test(s)||(n==="v6"||!n)&&A0.test(s))}function N0(s,n){if(!v0.test(s))return!1;try{const[i]=s.split("."),u=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),c=JSON.parse(atob(u));return!(typeof c!="object"||c===null||!c.typ||!c.alg||n&&c.alg!==n)}catch{return!1}}function C0(s,n){return!!((n==="v4"||!n)&&E0.test(s)||(n==="v6"||!n)&&O0.test(s))}class ln extends oe{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==V.string){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.string,received:f.parsedType}),ae}const u=new vt;let c;for(const f of this._def.checks)if(f.kind==="min")n.data.length<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")n.data.length>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const h=n.data.length>f.value,y=n.data.length<f.value;(h||y)&&(c=this._getOrReturnCtx(n,c),h?H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):y&&H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")_0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"email",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")fo||(fo=new RegExp(S0,"u")),fo.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"emoji",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")p0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"uuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")g0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"nanoid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")h0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")y0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid2",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")m0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ulid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(n.data)}catch{c=this._getOrReturnCtx(n,c),H(c,{validation:"url",code:z.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"regex",code:z.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?n.data=n.data.trim():f.kind==="includes"?n.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?n.data=n.data.toLowerCase():f.kind==="toUpperCase"?n.data=n.data.toUpperCase():f.kind==="startsWith"?n.data.startsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?n.data.endsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?jm(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?x0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?k0(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?b0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"duration",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?M0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ip",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?N0(n.data,f.alg)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"jwt",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?C0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cidr",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?w0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?R0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64url",code:z.invalid_string,message:f.message}),u.dirty()):Te.assertNever(f);return{status:u.value,value:n.data}}_regex(n,i,u){return this.refinement(c=>n.test(c),{validation:i,code:z.invalid_string,...$.errToObj(u)})}_addCheck(n){return new ln({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...$.errToObj(n)})}url(n){return this._addCheck({kind:"url",...$.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...$.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...$.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...$.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...$.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...$.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...$.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...$.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...$.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...$.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...$.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...$.errToObj(n)})}datetime(n){var i,u;return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(i=n==null?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(u=n==null?void 0:n.local)!==null&&u!==void 0?u:!1,...$.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...$.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...$.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...$.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i==null?void 0:i.position,...$.errToObj(i==null?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...$.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...$.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...$.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...$.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...$.errToObj(i)})}nonempty(n){return this.min(1,$.errToObj(n))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxLength(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ln.create=s=>{var n;return new ln({checks:[],typeName:ne.ZodString,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};function D0(s,n){const i=(s.toString().split(".")[1]||"").length,u=(n.toString().split(".")[1]||"").length,c=i>u?i:u,f=parseInt(s.toFixed(c).replace(".","")),h=parseInt(n.toFixed(c).replace(".",""));return f%h/Math.pow(10,c)}class ya extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==V.number){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.number,received:f.parsedType}),ae}let u;const c=new vt;for(const f of this._def.checks)f.kind==="int"?Te.isInteger(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?D0(n.data,f.value)!==0&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_finite,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,$.toString(i))}gt(n,i){return this.setLimit("min",n,!1,$.toString(i))}lte(n,i){return this.setLimit("max",n,!0,$.toString(i))}lt(n,i){return this.setLimit("max",n,!1,$.toString(i))}setLimit(n,i,u,c){return new ya({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:$.toString(c)}]})}_addCheck(n){return new ya({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:$.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:$.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:$.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(n)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&Te.isInteger(n.value))}get isFinite(){let n=null,i=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(i===null||u.value>i)&&(i=u.value):u.kind==="max"&&(n===null||u.value<n)&&(n=u.value)}return Number.isFinite(i)&&Number.isFinite(n)}}ya.create=s=>new ya({checks:[],typeName:ne.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class ma extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==V.bigint)return this._getInvalidInput(n);let u;const c=new vt;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?n.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}_getInvalidInput(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.bigint,received:i.parsedType}),ae}gte(n,i){return this.setLimit("min",n,!0,$.toString(i))}gt(n,i){return this.setLimit("min",n,!1,$.toString(i))}lte(n,i){return this.setLimit("max",n,!0,$.toString(i))}lt(n,i){return this.setLimit("max",n,!1,$.toString(i))}setLimit(n,i,u,c){return new ma({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:$.toString(c)}]})}_addCheck(n){return new ma({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:$.toString(i)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ma.create=s=>{var n;return new ma({checks:[],typeName:ne.ZodBigInt,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};class Jl extends oe{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==V.boolean){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.boolean,received:u.parsedType}),ae}return Et(n.data)}}Jl.create=s=>new Jl({typeName:ne.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class Ya extends oe{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==V.date){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.date,received:f.parsedType}),ae}if(isNaN(n.data.getTime())){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_date}),ae}const u=new vt;let c;for(const f of this._def.checks)f.kind==="min"?n.data.getTime()<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?n.data.getTime()>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Te.assertNever(f);return{status:u.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Ya({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:$.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:$.toString(i)})}get minDate(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n!=null?new Date(n):null}}Ya.create=s=>new Ya({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:ne.ZodDate,...ue(s)});class qu extends oe{_parse(n){if(this._getType(n)!==V.symbol){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.symbol,received:u.parsedType}),ae}return Et(n.data)}}qu.create=s=>new qu({typeName:ne.ZodSymbol,...ue(s)});class Fl extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.undefined,received:u.parsedType}),ae}return Et(n.data)}}Fl.create=s=>new Fl({typeName:ne.ZodUndefined,...ue(s)});class Wl extends oe{_parse(n){if(this._getType(n)!==V.null){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.null,received:u.parsedType}),ae}return Et(n.data)}}Wl.create=s=>new Wl({typeName:ne.ZodNull,...ue(s)});class Bi extends oe{constructor(){super(...arguments),this._any=!0}_parse(n){return Et(n.data)}}Bi.create=s=>new Bi({typeName:ne.ZodAny,...ue(s)});class Va extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Et(n.data)}}Va.create=s=>new Va({typeName:ne.ZodUnknown,...ue(s)});class Ln extends oe{_parse(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.never,received:i.parsedType}),ae}}Ln.create=s=>new Ln({typeName:ne.ZodNever,...ue(s)});class Zu extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.void,received:u.parsedType}),ae}return Et(n.data)}}Zu.create=s=>new Zu({typeName:ne.ZodVoid,...ue(s)});class sn extends oe{_parse(n){const{ctx:i,status:u}=this._processInputParams(n),c=this._def;if(i.parsedType!==V.array)return H(i,{code:z.invalid_type,expected:V.array,received:i.parsedType}),ae;if(c.exactLength!==null){const h=i.data.length>c.exactLength.value,y=i.data.length<c.exactLength.value;(h||y)&&(H(i,{code:h?z.too_big:z.too_small,minimum:y?c.exactLength.value:void 0,maximum:h?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),u.dirty())}if(c.minLength!==null&&i.data.length<c.minLength.value&&(H(i,{code:z.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),u.dirty()),c.maxLength!==null&&i.data.length>c.maxLength.value&&(H(i,{code:z.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),u.dirty()),i.common.async)return Promise.all([...i.data].map((h,y)=>c.type._parseAsync(new _n(i,h,i.path,y)))).then(h=>vt.mergeArray(u,h));const f=[...i.data].map((h,y)=>c.type._parseSync(new _n(i,h,i.path,y)));return vt.mergeArray(u,f)}get element(){return this._def.type}min(n,i){return new sn({...this._def,minLength:{value:n,message:$.toString(i)}})}max(n,i){return new sn({...this._def,maxLength:{value:n,message:$.toString(i)}})}length(n,i){return new sn({...this._def,exactLength:{value:n,message:$.toString(i)}})}nonempty(n){return this.min(1,n)}}sn.create=(s,n)=>new sn({type:s,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ue(n)});function Mi(s){if(s instanceof Ze){const n={};for(const i in s.shape){const u=s.shape[i];n[i]=vn.create(Mi(u))}return new Ze({...s._def,shape:()=>n})}else return s instanceof sn?new sn({...s._def,type:Mi(s.element)}):s instanceof vn?vn.create(Mi(s.unwrap())):s instanceof ga?ga.create(Mi(s.unwrap())):s instanceof Sn?Sn.create(s.items.map(n=>Mi(n))):s}class Ze extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),i=Te.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==V.object){const g=this._getOrReturnCtx(n);return H(g,{code:z.invalid_type,expected:V.object,received:g.parsedType}),ae}const{status:u,ctx:c}=this._processInputParams(n),{shape:f,keys:h}=this._getCached(),y=[];if(!(this._def.catchall instanceof Ln&&this._def.unknownKeys==="strip"))for(const g in c.data)h.includes(g)||y.push(g);const p=[];for(const g of h){const S=f[g],w=c.data[g];p.push({key:{status:"valid",value:g},value:S._parse(new _n(c,w,c.path,g)),alwaysSet:g in c.data})}if(this._def.catchall instanceof Ln){const g=this._def.unknownKeys;if(g==="passthrough")for(const S of y)p.push({key:{status:"valid",value:S},value:{status:"valid",value:c.data[S]}});else if(g==="strict")y.length>0&&(H(c,{code:z.unrecognized_keys,keys:y}),u.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const S of y){const w=c.data[S];p.push({key:{status:"valid",value:S},value:g._parse(new _n(c,w,c.path,S)),alwaysSet:S in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const g=[];for(const S of p){const w=await S.key,C=await S.value;g.push({key:w,value:C,alwaysSet:S.alwaysSet})}return g}).then(g=>vt.mergeObjectSync(u,g)):vt.mergeObjectSync(u,p)}get shape(){return this._def.shape()}strict(n){return $.errToObj,new Ze({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,u)=>{var c,f,h,y;const p=(h=(f=(c=this._def).errorMap)===null||f===void 0?void 0:f.call(c,i,u).message)!==null&&h!==void 0?h:u.defaultError;return i.code==="unrecognized_keys"?{message:(y=$.errToObj(n).message)!==null&&y!==void 0?y:p}:{message:p}}}:{}})}strip(){return new Ze({...this._def,unknownKeys:"strip"})}passthrough(){return new Ze({...this._def,unknownKeys:"passthrough"})}extend(n){return new Ze({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Ze({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:ne.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Ze({...this._def,catchall:n})}pick(n){const i={};return Te.objectKeys(n).forEach(u=>{n[u]&&this.shape[u]&&(i[u]=this.shape[u])}),new Ze({...this._def,shape:()=>i})}omit(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{n[u]||(i[u]=this.shape[u])}),new Ze({...this._def,shape:()=>i})}deepPartial(){return Mi(this)}partial(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{const c=this.shape[u];n&&!n[u]?i[u]=c:i[u]=c.optional()}),new Ze({...this._def,shape:()=>i})}required(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{if(n&&!n[u])i[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof vn;)f=f._def.innerType;i[u]=f}}),new Ze({...this._def,shape:()=>i})}keyof(){return Bm(Te.objectKeys(this.shape))}}Ze.create=(s,n)=>new Ze({shape:()=>s,unknownKeys:"strip",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});Ze.strictCreate=(s,n)=>new Ze({shape:()=>s,unknownKeys:"strict",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});Ze.lazycreate=(s,n)=>new Ze({shape:s,unknownKeys:"strip",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});class Il extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=this._def.options;function c(f){for(const y of f)if(y.result.status==="valid")return y.result;for(const y of f)if(y.result.status==="dirty")return i.common.issues.push(...y.ctx.common.issues),y.result;const h=f.map(y=>new jt(y.ctx.common.issues));return H(i,{code:z.invalid_union,unionErrors:h}),ae}if(i.common.async)return Promise.all(u.map(async f=>{const h={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:h}),ctx:h}})).then(c);{let f;const h=[];for(const p of u){const g={...i,common:{...i.common,issues:[]},parent:null},S=p._parseSync({data:i.data,path:i.path,parent:g});if(S.status==="valid")return S;S.status==="dirty"&&!f&&(f={result:S,ctx:g}),g.common.issues.length&&h.push(g.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const y=h.map(p=>new jt(p));return H(i,{code:z.invalid_union,unionErrors:y}),ae}}get options(){return this._def.options}}Il.create=(s,n)=>new Il({options:s,typeName:ne.ZodUnion,...ue(n)});const Hn=s=>s instanceof ts?Hn(s.schema):s instanceof un?Hn(s.innerType()):s instanceof ns?[s.value]:s instanceof pa?s.options:s instanceof as?Te.objectValues(s.enum):s instanceof is?Hn(s._def.innerType):s instanceof Fl?[void 0]:s instanceof Wl?[null]:s instanceof vn?[void 0,...Hn(s.unwrap())]:s instanceof ga?[null,...Hn(s.unwrap())]:s instanceof Wo||s instanceof ss?Hn(s.unwrap()):s instanceof ls?Hn(s._def.innerType):[];class Gu extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.object)return H(i,{code:z.invalid_type,expected:V.object,received:i.parsedType}),ae;const u=this.discriminator,c=i.data[u],f=this.optionsMap.get(c);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(H(i,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,u){const c=new Map;for(const f of i){const h=Hn(f.shape[n]);if(!h.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const y of h){if(c.has(y))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(y)}`);c.set(y,f)}}return new Gu({typeName:ne.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...ue(u)})}}function Oo(s,n){const i=Vn(s),u=Vn(n);if(s===n)return{valid:!0,data:s};if(i===V.object&&u===V.object){const c=Te.objectKeys(n),f=Te.objectKeys(s).filter(y=>c.indexOf(y)!==-1),h={...s,...n};for(const y of f){const p=Oo(s[y],n[y]);if(!p.valid)return{valid:!1};h[y]=p.data}return{valid:!0,data:h}}else if(i===V.array&&u===V.array){if(s.length!==n.length)return{valid:!1};const c=[];for(let f=0;f<s.length;f++){const h=s[f],y=n[f],p=Oo(h,y);if(!p.valid)return{valid:!1};c.push(p.data)}return{valid:!0,data:c}}else return i===V.date&&u===V.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class Pl extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=(f,h)=>{if(Eo(f)||Eo(h))return ae;const y=Oo(f.value,h.value);return y.valid?((Ao(f)||Ao(h))&&i.dirty(),{status:i.value,value:y.data}):(H(u,{code:z.invalid_intersection_types}),ae)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,h])=>c(f,h)):c(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}Pl.create=(s,n,i)=>new Pl({left:s,right:n,typeName:ne.ZodIntersection,...ue(i)});class Sn extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.array)return H(u,{code:z.invalid_type,expected:V.array,received:u.parsedType}),ae;if(u.data.length<this._def.items.length)return H(u,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&u.data.length>this._def.items.length&&(H(u,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...u.data].map((h,y)=>{const p=this._def.items[y]||this._def.rest;return p?p._parse(new _n(u,h,u.path,y)):null}).filter(h=>!!h);return u.common.async?Promise.all(f).then(h=>vt.mergeArray(i,h)):vt.mergeArray(i,f)}get items(){return this._def.items}rest(n){return new Sn({...this._def,rest:n})}}Sn.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn({items:s,typeName:ne.ZodTuple,rest:null,...ue(n)})};class es extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.object)return H(u,{code:z.invalid_type,expected:V.object,received:u.parsedType}),ae;const c=[],f=this._def.keyType,h=this._def.valueType;for(const y in u.data)c.push({key:f._parse(new _n(u,y,u.path,y)),value:h._parse(new _n(u,u.data[y],u.path,y)),alwaysSet:y in u.data});return u.common.async?vt.mergeObjectAsync(i,c):vt.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,u){return i instanceof oe?new es({keyType:n,valueType:i,typeName:ne.ZodRecord,...ue(u)}):new es({keyType:ln.create(),valueType:n,typeName:ne.ZodRecord,...ue(i)})}}class Hu extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.map)return H(u,{code:z.invalid_type,expected:V.map,received:u.parsedType}),ae;const c=this._def.keyType,f=this._def.valueType,h=[...u.data.entries()].map(([y,p],g)=>({key:c._parse(new _n(u,y,u.path,[g,"key"])),value:f._parse(new _n(u,p,u.path,[g,"value"]))}));if(u.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const p of h){const g=await p.key,S=await p.value;if(g.status==="aborted"||S.status==="aborted")return ae;(g.status==="dirty"||S.status==="dirty")&&i.dirty(),y.set(g.value,S.value)}return{status:i.value,value:y}})}else{const y=new Map;for(const p of h){const g=p.key,S=p.value;if(g.status==="aborted"||S.status==="aborted")return ae;(g.status==="dirty"||S.status==="dirty")&&i.dirty(),y.set(g.value,S.value)}return{status:i.value,value:y}}}}Hu.create=(s,n,i)=>new Hu({valueType:n,keyType:s,typeName:ne.ZodMap,...ue(i)});class Ga extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.set)return H(u,{code:z.invalid_type,expected:V.set,received:u.parsedType}),ae;const c=this._def;c.minSize!==null&&u.data.size<c.minSize.value&&(H(u,{code:z.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()),c.maxSize!==null&&u.data.size>c.maxSize.value&&(H(u,{code:z.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty());const f=this._def.valueType;function h(p){const g=new Set;for(const S of p){if(S.status==="aborted")return ae;S.status==="dirty"&&i.dirty(),g.add(S.value)}return{status:i.value,value:g}}const y=[...u.data.values()].map((p,g)=>f._parse(new _n(u,p,u.path,g)));return u.common.async?Promise.all(y).then(p=>h(p)):h(y)}min(n,i){return new Ga({...this._def,minSize:{value:n,message:$.toString(i)}})}max(n,i){return new Ga({...this._def,maxSize:{value:n,message:$.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Ga.create=(s,n)=>new Ga({valueType:s,minSize:null,maxSize:null,typeName:ne.ZodSet,...ue(n)});class zi extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.function)return H(i,{code:z.invalid_type,expected:V.function,received:i.parsedType}),ae;function u(y,p){return ju({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Uu(),ji].filter(g=>!!g),issueData:{code:z.invalid_arguments,argumentsError:p}})}function c(y,p){return ju({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Uu(),ji].filter(g=>!!g),issueData:{code:z.invalid_return_type,returnTypeError:p}})}const f={errorMap:i.common.contextualErrorMap},h=i.data;if(this._def.returns instanceof qi){const y=this;return Et(async function(...p){const g=new jt([]),S=await y._def.args.parseAsync(p,f).catch(U=>{throw g.addIssue(u(p,U)),g}),w=await Reflect.apply(h,this,S);return await y._def.returns._def.type.parseAsync(w,f).catch(U=>{throw g.addIssue(c(w,U)),g})})}else{const y=this;return Et(function(...p){const g=y._def.args.safeParse(p,f);if(!g.success)throw new jt([u(p,g.error)]);const S=Reflect.apply(h,this,g.data),w=y._def.returns.safeParse(S,f);if(!w.success)throw new jt([c(S,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new zi({...this._def,args:Sn.create(n).rest(Va.create())})}returns(n){return new zi({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,u){return new zi({args:n||Sn.create([]).rest(Va.create()),returns:i||Va.create(),typeName:ne.ZodFunction,...ue(u)})}}class ts extends oe{get schema(){return this._def.getter()}_parse(n){const{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}ts.create=(s,n)=>new ts({getter:s,typeName:ne.ZodLazy,...ue(n)});class ns extends oe{_parse(n){if(n.data!==this._def.value){const i=this._getOrReturnCtx(n);return H(i,{received:i.data,code:z.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:n.data}}get value(){return this._def.value}}ns.create=(s,n)=>new ns({value:s,typeName:ne.ZodLiteral,...ue(n)});function Bm(s,n){return new pa({values:s,typeName:ne.ZodEnum,...ue(n)})}class pa extends oe{constructor(){super(...arguments),Kl.set(this,void 0)}_parse(n){if(typeof n.data!="string"){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{expected:Te.joinValues(u),received:i.parsedType,code:z.invalid_type}),ae}if(Bu(this,Kl)||Dm(this,Kl,new Set(this._def.values)),!Bu(this,Kl).has(n.data)){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{received:i.data,code:z.invalid_enum_value,options:u}),ae}return Et(n.data)}get options(){return this._def.values}get enum(){const n={};for(const i of this._def.values)n[i]=i;return n}get Values(){const n={};for(const i of this._def.values)n[i]=i;return n}get Enum(){const n={};for(const i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return pa.create(n,{...this._def,...i})}exclude(n,i=this._def){return pa.create(this.options.filter(u=>!n.includes(u)),{...this._def,...i})}}Kl=new WeakMap;pa.create=Bm;class as extends oe{constructor(){super(...arguments),Yl.set(this,void 0)}_parse(n){const i=Te.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(n);if(u.parsedType!==V.string&&u.parsedType!==V.number){const c=Te.objectValues(i);return H(u,{expected:Te.joinValues(c),received:u.parsedType,code:z.invalid_type}),ae}if(Bu(this,Yl)||Dm(this,Yl,new Set(Te.getValidEnumValues(this._def.values))),!Bu(this,Yl).has(n.data)){const c=Te.objectValues(i);return H(u,{received:u.data,code:z.invalid_enum_value,options:c}),ae}return Et(n.data)}get enum(){return this._def.values}}Yl=new WeakMap;as.create=(s,n)=>new as({values:s,typeName:ne.ZodNativeEnum,...ue(n)});class qi extends oe{unwrap(){return this._def.type}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.promise&&i.common.async===!1)return H(i,{code:z.invalid_type,expected:V.promise,received:i.parsedType}),ae;const u=i.parsedType===V.promise?i.data:Promise.resolve(i.data);return Et(u.then(c=>this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})))}}qi.create=(s,n)=>new qi({type:s,typeName:ne.ZodPromise,...ue(n)});class un extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=this._def.effect||null,f={addIssue:h=>{H(u,h),h.fatal?i.abort():i.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){const h=c.transform(u.data,f);if(u.common.async)return Promise.resolve(h).then(async y=>{if(i.value==="aborted")return ae;const p=await this._def.schema._parseAsync({data:y,path:u.path,parent:u});return p.status==="aborted"?ae:p.status==="dirty"||i.value==="dirty"?Di(p.value):p});{if(i.value==="aborted")return ae;const y=this._def.schema._parseSync({data:h,path:u.path,parent:u});return y.status==="aborted"?ae:y.status==="dirty"||i.value==="dirty"?Di(y.value):y}}if(c.type==="refinement"){const h=y=>{const p=c.refinement(y,f);if(u.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(u.common.async===!1){const y=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value),{status:i.value,value:y.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(y=>y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value).then(()=>({status:i.value,value:y.value}))))}if(c.type==="transform")if(u.common.async===!1){const h=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ka(h))return h;const y=c.transform(h.value,f);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:y}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(h=>Ka(h)?Promise.resolve(c.transform(h.value,f)).then(y=>({status:i.value,value:y})):h);Te.assertNever(c)}}un.create=(s,n,i)=>new un({schema:s,typeName:ne.ZodEffects,effect:n,...ue(i)});un.createWithPreprocess=(s,n,i)=>new un({schema:n,effect:{type:"preprocess",transform:s},typeName:ne.ZodEffects,...ue(i)});class vn extends oe{_parse(n){return this._getType(n)===V.undefined?Et(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}vn.create=(s,n)=>new vn({innerType:s,typeName:ne.ZodOptional,...ue(n)});class ga extends oe{_parse(n){return this._getType(n)===V.null?Et(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ga.create=(s,n)=>new ga({innerType:s,typeName:ne.ZodNullable,...ue(n)});class is extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);let u=i.data;return i.parsedType===V.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}is.create=(s,n)=>new is({innerType:s,typeName:ne.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...ue(n)});class ls extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return Ql(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}ls.create=(s,n)=>new ls({innerType:s,typeName:ne.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...ue(n)});class Vu extends oe{_parse(n){if(this._getType(n)!==V.nan){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.nan,received:u.parsedType}),ae}return{status:"valid",value:n.data}}}Vu.create=s=>new Vu({typeName:ne.ZodNaN,...ue(s)});const z0=Symbol("zod_brand");class Wo extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=i.data;return this._def.type._parse({data:u,path:i.path,parent:i})}unwrap(){return this._def.type}}class fs extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?ae:f.status==="dirty"?(i.dirty(),Di(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const c=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return c.status==="aborted"?ae:c.status==="dirty"?(i.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:u.path,parent:u})}}static create(n,i){return new fs({in:n,out:i,typeName:ne.ZodPipeline})}}class ss extends oe{_parse(n){const i=this._def.innerType._parse(n),u=c=>(Ka(c)&&(c.value=Object.freeze(c.value)),c);return Ql(i)?i.then(c=>u(c)):u(i)}unwrap(){return this._def.innerType}}ss.create=(s,n)=>new ss({innerType:s,typeName:ne.ZodReadonly,...ue(n)});function lm(s,n){const i=typeof s=="function"?s(n):typeof s=="string"?{message:s}:s;return typeof i=="string"?{message:i}:i}function qm(s,n={},i){return s?Bi.create().superRefine((u,c)=>{var f,h;const y=s(u);if(y instanceof Promise)return y.then(p=>{var g,S;if(!p){const w=lm(n,u),C=(S=(g=w.fatal)!==null&&g!==void 0?g:i)!==null&&S!==void 0?S:!0;c.addIssue({code:"custom",...w,fatal:C})}});if(!y){const p=lm(n,u),g=(h=(f=p.fatal)!==null&&f!==void 0?f:i)!==null&&h!==void 0?h:!0;c.addIssue({code:"custom",...p,fatal:g})}}):Bi.create()}const U0={object:Ze.lazycreate};var ne;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(ne||(ne={}));const j0=(s,n={message:`Input not instance of ${s.name}`})=>qm(i=>i instanceof s,n),Zm=ln.create,Hm=ya.create,B0=Vu.create,q0=ma.create,Vm=Jl.create,Z0=Ya.create,H0=qu.create,V0=Fl.create,L0=Wl.create,K0=Bi.create,Y0=Va.create,G0=Ln.create,X0=Zu.create,$0=sn.create,Q0=Ze.create,J0=Ze.strictCreate,F0=Il.create,W0=Gu.create,I0=Pl.create,P0=Sn.create,e_=es.create,t_=Hu.create,n_=Ga.create,a_=zi.create,i_=ts.create,l_=ns.create,s_=pa.create,u_=as.create,r_=qi.create,sm=un.create,c_=vn.create,o_=ga.create,f_=un.createWithPreprocess,d_=fs.create,h_=()=>Zm().optional(),y_=()=>Hm().optional(),m_=()=>Vm().optional(),p_={string:s=>ln.create({...s,coerce:!0}),number:s=>ya.create({...s,coerce:!0}),boolean:s=>Jl.create({...s,coerce:!0}),bigint:s=>ma.create({...s,coerce:!0}),date:s=>Ya.create({...s,coerce:!0})},g_=ae;var xe=Object.freeze({__proto__:null,defaultErrorMap:ji,setErrorMap:f0,getErrorMap:Uu,makeIssue:ju,EMPTY_PATH:d0,addIssueToContext:H,ParseStatus:vt,INVALID:ae,DIRTY:Di,OK:Et,isAborted:Eo,isDirty:Ao,isValid:Ka,isAsync:Ql,get util(){return Te},get objectUtil(){return To},ZodParsedType:V,getParsedType:Vn,ZodType:oe,datetimeRegex:jm,ZodString:ln,ZodNumber:ya,ZodBigInt:ma,ZodBoolean:Jl,ZodDate:Ya,ZodSymbol:qu,ZodUndefined:Fl,ZodNull:Wl,ZodAny:Bi,ZodUnknown:Va,ZodNever:Ln,ZodVoid:Zu,ZodArray:sn,ZodObject:Ze,ZodUnion:Il,ZodDiscriminatedUnion:Gu,ZodIntersection:Pl,ZodTuple:Sn,ZodRecord:es,ZodMap:Hu,ZodSet:Ga,ZodFunction:zi,ZodLazy:ts,ZodLiteral:ns,ZodEnum:pa,ZodNativeEnum:as,ZodPromise:qi,ZodEffects:un,ZodTransformer:un,ZodOptional:vn,ZodNullable:ga,ZodDefault:is,ZodCatch:ls,ZodNaN:Vu,BRAND:z0,ZodBranded:Wo,ZodPipeline:fs,ZodReadonly:ss,custom:qm,Schema:oe,ZodSchema:oe,late:U0,get ZodFirstPartyTypeKind(){return ne},coerce:p_,any:K0,array:$0,bigint:q0,boolean:Vm,date:Z0,discriminatedUnion:W0,effect:sm,enum:s_,function:a_,instanceof:j0,intersection:I0,lazy:i_,literal:l_,map:t_,nan:B0,nativeEnum:u_,never:G0,null:L0,nullable:o_,number:Hm,object:Q0,oboolean:m_,onumber:y_,optional:c_,ostring:h_,pipeline:d_,preprocess:f_,promise:r_,record:e_,set:n_,strictObject:J0,string:Zm,symbol:H0,transformer:sm,tuple:P0,undefined:V0,union:F0,unknown:Y0,void:X0,NEVER:g_,ZodIssueCode:z,quotelessJson:o0,ZodError:jt});const Lm={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},ho=pm(Lm).map(([s])=>xe.literal(Number(s))),v_=xe.union([ho[0],ho[1],...ho]);xe.tuple([v_,xe.string()]);function b_(){return q.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",children:[q.jsx("title",{children:"Tempest Games Logo"}),q.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M202.91,7.86h-13.18v17.03h13.18v6.84h-13.18v22.24h13.18v6.84h-30.29V.93h30.29v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M289.49.93v59.89h-17.11V7.78h-.43c-8.21,0-11.21,5.82-11.21,17.03v36.02h-16.25V24.8c0-11.21-2.99-17.03-11.21-17.03h-.43v53.04h-17.11V.93h18.74c9.92,0,15.31,4.96,18.14,11.21,2.82-6.25,8.21-11.21,18.14-11.21h18.73Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M352.82,29.68c0,11.72-6.42,19.16-24.55,19.16h-4.53v11.98h-17.11V1.1l46.2-.17v28.75ZM323.73,7.78v34.22h2.48c7.36,0,9.5-4.11,9.5-12.15V7.78h-11.98Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M396.8,7.86h-13.17v17.03h13.17v6.84h-13.17v22.24h13.17v6.84h-30.28V.93h30.28v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M425.9,12.57v14.03h27.89v16.94c0,12.75-1.71,18.13-16.43,18.13h-14.54c-9.58,0-14.03-2.74-14.03-11.97v-5.99h15.4v5.13c0,4.53.77,5.99,4.62,5.99h1.71c5.05,0,6.16-1.46,6.16-6.84v-14.54h-27.89v-16.68c0-13.52,3.85-16.68,18.82-16.68h12.83c8.81,0,13.17,1.54,13.17,10.78v7.19h-15.4v-6.5c0-3.42-1.03-4.62-4.45-4.62h-1.45c-4.28,0-6.42,1.46-6.42,5.65Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M155.96,93.78v-3.57h-5.58v-7.14h13.39v17.85h-24.76v-28.56h24.76v7.14h-16.96v14.28h9.15Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M224.26,100.92h-8.25v-10.71h-8.25v3.57h4.68v7.14h-12.94v-17.85h16.51v-3.57h-16.51v-7.14h24.76v28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M259.99,72.36h30.57v28.56h-7.81v-21.42h-3.57v21.42h-7.81v-21.42h-3.57v21.42h-7.81v-28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M343.24,83.08v-3.57h-9.14v14.28h16.96v7.14h-24.76v-28.56h24.76v17.85h-13.38v-7.14h5.57Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M394.59,79.5v3.57h16.96v17.85h-24.76v-7.14h16.96v-3.57h-16.96v-17.85h24.76v7.14h-16.96Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M0,63.42v-20.84h20.83L0,63.42ZM100,.92v32.29h-35.42v8.33h-8.33V14.46h-22.92l1.04,7.29h9.38v19.79h-8.33v-8.33H0V.92h100ZM0,100.92v-26.04l6.25-1.04,25-26.04,1.04,1.05-10.42,18.75-4.16,7.29h13.54l3.13-3.12,8.33-22.92h1.04v41.66h3.12l9.38-8.33v-33.33h1.04l8.33,22.92,3.12,3.12h13.54l-4.17-7.29-10.42-19.8,1.04-1.04,25,27.09,6.25,1.04v26.04H0ZM100,42.59v20.84l-20.83-20.84h20.83Z",style:{fill:"var(--logo-color)",strokeWidth:0}})]})}function Xu(s){return q.jsx("a",{...s})}const __={class:"_class_wtkls_1"};function S_(s){return["required",s]}function T_(s){return["optional",s]}function E_(s,n){let i=s;for(const u of n){if(i===null||typeof u!="string")return!1;const c=i[1];if(u in c)i=c[u];else{const f=Object.keys(c).find(h=>h.startsWith("$"));if(f){i=c[f];continue}return!1}}if(i===null)return!0;switch(i[0]){case"required":return!1;case"optional":return!0}}const Tn=Object.create(null);Tn.open="0";Tn.close="1";Tn.ping="2";Tn.pong="3";Tn.message="4";Tn.upgrade="5";Tn.noop="6";const Mu=Object.create(null);Object.keys(Tn).forEach(s=>{Mu[Tn[s]]=s});const wo={type:"error",data:"parser error"},Km=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ym=typeof ArrayBuffer=="function",Gm=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Io=({type:s,data:n},i,u)=>Km&&n instanceof Blob?i?u(n):um(n,u):Ym&&(n instanceof ArrayBuffer||Gm(n))?i?u(n):um(new Blob([n]),u):u(Tn[s]+(n||"")),um=(s,n)=>{const i=new FileReader;return i.onload=function(){const u=i.result.split(",")[1];n("b"+(u||""))},i.readAsDataURL(s)};function rm(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let yo;function A_(s,n){if(Km&&s.data instanceof Blob)return s.data.arrayBuffer().then(rm).then(n);if(Ym&&(s.data instanceof ArrayBuffer||Gm(s.data)))return n(rm(s.data));Io(s,!1,i=>{yo||(yo=new TextEncoder),n(yo.encode(i))})}const cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<cm.length;s++)Gl[cm.charCodeAt(s)]=s;const O_=s=>{let n=s.length*.75,i=s.length,u,c=0,f,h,y,p;s[s.length-1]==="="&&(n--,s[s.length-2]==="="&&n--);const g=new ArrayBuffer(n),S=new Uint8Array(g);for(u=0;u<i;u+=4)f=Gl[s.charCodeAt(u)],h=Gl[s.charCodeAt(u+1)],y=Gl[s.charCodeAt(u+2)],p=Gl[s.charCodeAt(u+3)],S[c++]=f<<2|h>>4,S[c++]=(h&15)<<4|y>>2,S[c++]=(y&3)<<6|p&63;return g},w_=typeof ArrayBuffer=="function",Po=(s,n)=>{if(typeof s!="string")return{type:"message",data:Xm(s,n)};const i=s.charAt(0);return i==="b"?{type:"message",data:R_(s.substring(1),n)}:Mu[i]?s.length>1?{type:Mu[i],data:s.substring(1)}:{type:Mu[i]}:wo},R_=(s,n)=>{if(w_){const i=O_(s);return Xm(i,n)}else return{base64:!0,data:s}},Xm=(s,n)=>{switch(n){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},$m="",x_=(s,n)=>{const i=s.length,u=new Array(i);let c=0;s.forEach((f,h)=>{Io(f,!1,y=>{u[h]=y,++c===i&&n(u.join($m))})})},k_=(s,n)=>{const i=s.split($m),u=[];for(let c=0;c<i.length;c++){const f=Po(i[c],n);if(u.push(f),f.type==="error")break}return u};function M_(){return new TransformStream({transform(s,n){A_(s,i=>{const u=i.length;let c;if(u<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,u);else if(u<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,u)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(u))}s.data&&typeof s.data!="string"&&(c[0]|=128),n.enqueue(c),n.enqueue(i)})}})}let mo;function Ru(s){return s.reduce((n,i)=>n+i.length,0)}function xu(s,n){if(s[0].length===n)return s.shift();const i=new Uint8Array(n);let u=0;for(let c=0;c<n;c++)i[c]=s[0][u++],u===s[0].length&&(s.shift(),u=0);return s.length&&u<s[0].length&&(s[0]=s[0].slice(u)),i}function N_(s,n){mo||(mo=new TextDecoder);const i=[];let u=0,c=-1,f=!1;return new TransformStream({transform(h,y){for(i.push(h);;){if(u===0){if(Ru(i)<1)break;const p=xu(i,1);f=(p[0]&128)===128,c=p[0]&127,c<126?u=3:c===126?u=1:u=2}else if(u===1){if(Ru(i)<2)break;const p=xu(i,2);c=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),u=3}else if(u===2){if(Ru(i)<8)break;const p=xu(i,8),g=new DataView(p.buffer,p.byteOffset,p.length),S=g.getUint32(0);if(S>Math.pow(2,21)-1){y.enqueue(wo);break}c=S*Math.pow(2,32)+g.getUint32(4),u=3}else{if(Ru(i)<c)break;const p=xu(i,c);y.enqueue(Po(f?p:mo.decode(p),n)),u=0}if(c===0||c>s){y.enqueue(wo);break}}}})}const Qm=4;function Pe(s){if(s)return C_(s)}function C_(s){for(var n in Pe.prototype)s[n]=Pe.prototype[n];return s}Pe.prototype.on=Pe.prototype.addEventListener=function(s,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(n),this};Pe.prototype.once=function(s,n){function i(){this.off(s,i),n.apply(this,arguments)}return i.fn=n,this.on(s,i),this};Pe.prototype.off=Pe.prototype.removeListener=Pe.prototype.removeAllListeners=Pe.prototype.removeEventListener=function(s,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var u,c=0;c<i.length;c++)if(u=i[c],u===n||u.fn===n){i.splice(c,1);break}return i.length===0&&delete this._callbacks["$"+s],this};Pe.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),i=this._callbacks["$"+s],u=1;u<arguments.length;u++)n[u-1]=arguments[u];if(i){i=i.slice(0);for(var u=0,c=i.length;u<c;++u)i[u].apply(this,n)}return this};Pe.prototype.emitReserved=Pe.prototype.emit;Pe.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Pe.prototype.hasListeners=function(s){return!!this.listeners(s).length};const $u=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,i)=>i(n,0),Ft=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),D_="arraybuffer";function Jm(s,...n){return n.reduce((i,u)=>(s.hasOwnProperty(u)&&(i[u]=s[u]),i),{})}const z_=Ft.setTimeout,U_=Ft.clearTimeout;function Qu(s,n){n.useNativeTimers?(s.setTimeoutFn=z_.bind(Ft),s.clearTimeoutFn=U_.bind(Ft)):(s.setTimeoutFn=Ft.setTimeout.bind(Ft),s.clearTimeoutFn=Ft.clearTimeout.bind(Ft))}const j_=1.33;function B_(s){return typeof s=="string"?q_(s):Math.ceil((s.byteLength||s.size)*j_)}function q_(s){let n=0,i=0;for(let u=0,c=s.length;u<c;u++)n=s.charCodeAt(u),n<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(u++,i+=4);return i}function Fm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Z_(s){let n="";for(let i in s)s.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return n}function H_(s){let n={},i=s.split("&");for(let u=0,c=i.length;u<c;u++){let f=i[u].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class V_ extends Error{constructor(n,i,u){super(n),this.description=i,this.context=u,this.type="TransportError"}}class ef extends Pe{constructor(n){super(),this.writable=!1,Qu(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,i,u){return super.emitReserved("error",new V_(n,i,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const i=Po(n,this.socket.binaryType);this.onPacket(i)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,i={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const i=Z_(n);return i.length?"?"+i:""}}class L_ extends ef{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const i=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||i()})),this.writable||(u++,this.once("drain",function(){--u||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};k_(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,x_(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Fm()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let Wm=!1;try{Wm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const K_=Wm;function Y_(){}class G_ extends L_{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let u=location.port;u||(u=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||u!==n.port}}doWrite(n,i){const u=this.request({method:"POST",data:n});u.on("success",i),u.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,u)=>{this.onError("xhr poll error",i,u)}),this.pollXhr=n}}class bn extends Pe{constructor(n,i,u){super(),this.createRequest=n,Qu(this,u),this._opts=u,this._method=u.method||"GET",this._uri=i,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var n;const i=Jm(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(i);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&u.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var c;u.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=bn.requestsCount++,bn.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Y_,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete bn.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}bn.requestsCount=0;bn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",om);else if(typeof addEventListener=="function"){const s="onpagehide"in Ft?"pagehide":"unload";addEventListener(s,om,!1)}}function om(){for(let s in bn.requests)bn.requests.hasOwnProperty(s)&&bn.requests[s].abort()}const X_=function(){const s=Im({xdomain:!1});return s&&s.responseType!==null}();class $_ extends G_{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=X_&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new bn(Im,this.uri(),n)}}function Im(s){const n=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||K_))return new XMLHttpRequest}catch{}if(!n)try{return new Ft[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pm=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Q_ extends ef{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,u=Pm?{}:Jm(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,u)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;Io(u,this.supportsBinary,f=>{try{this.doWrite(u,f)}catch{}c&&$u(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Fm()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const po=Ft.WebSocket||Ft.MozWebSocket;class J_ extends Q_{createSocket(n,i,u){return Pm?new po(n,i,u):i?new po(n,i):new po(n)}doWrite(n,i){this.ws.send(i)}}class F_ extends ef{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=N_(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=n.readable.pipeThrough(i).getReader(),c=M_();c.readable.pipeTo(n.writable),this._writer=c.writable.getWriter();const f=()=>{u.read().then(({done:y,value:p})=>{y||(this.onPacket(p),f())}).catch(y=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;this._writer.write(u).then(()=>{c&&$u(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const W_={websocket:J_,webtransport:F_,polling:$_},I_=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,P_=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ro(s){if(s.length>8e3)throw"URI too long";const n=s,i=s.indexOf("["),u=s.indexOf("]");i!=-1&&u!=-1&&(s=s.substring(0,i)+s.substring(i,u).replace(/:/g,";")+s.substring(u,s.length));let c=I_.exec(s||""),f={},h=14;for(;h--;)f[P_[h]]=c[h]||"";return i!=-1&&u!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=e1(f,f.path),f.queryKey=t1(f,f.query),f}function e1(s,n){const i=/\/{2,9}/g,u=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&u.splice(0,1),n.slice(-1)=="/"&&u.splice(u.length-1,1),u}function t1(s,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,f){c&&(i[c]=f)}),i}const xo=typeof addEventListener=="function"&&typeof removeEventListener=="function",Nu=[];xo&&addEventListener("offline",()=>{Nu.forEach(s=>s())},!1);class ha extends Pe{constructor(n,i){if(super(),this.binaryType=D_,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const u=Ro(n);i.hostname=u.host,i.secure=u.protocol==="https"||u.protocol==="wss",i.port=u.port,u.query&&(i.query=u.query)}else i.host&&(i.hostname=Ro(i.host).host);Qu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(u=>{const c=u.prototype.name;this.transports.push(c),this._transportsByName[c]=u}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=H_(this.opts.query)),xo&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Nu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=Qm,i.transport=n,this.id&&(i.sid=this.id);const u=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&ha.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ha.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let u=0;u<this.writeBuffer.length;u++){const c=this.writeBuffer[u].data;if(c&&(i+=B_(c)),u>0&&i>this._maxPayload)return this.writeBuffer.slice(0,u);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,$u(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,u){return this._sendPacket("message",n,i,u),this}send(n,i,u){return this._sendPacket("message",n,i,u),this}_sendPacket(n,i,u,c){if(typeof i=="function"&&(c=i,i=void 0),typeof u=="function"&&(c=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const f={type:n,data:i,options:u};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},u=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():n()}):this.upgrading?u():n()),this}_onError(n){if(ha.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),xo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=Nu.indexOf(this._offlineEventListener);u!==-1&&Nu.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}ha.protocol=Qm;class n1 extends ha{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let i=this.createTransport(n),u=!1;ha.priorWebsocketSuccess=!1;const c=()=>{u||(i.send([{type:"ping",data:"probe"}]),i.once("packet",w=>{if(!u)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ha.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(S(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const C=new Error("probe error");C.transport=i.name,this.emitReserved("upgradeError",C)}}))};function f(){u||(u=!0,S(),i.close(),i=null)}const h=w=>{const C=new Error("probe error: "+w);C.transport=i.name,f(),this.emitReserved("upgradeError",C)};function y(){h("transport closed")}function p(){h("socket closed")}function g(w){i&&w.name!==i.name&&f()}const S=()=>{i.removeListener("open",c),i.removeListener("error",h),i.removeListener("close",y),this.off("close",p),this.off("upgrading",g)};i.once("open",c),i.once("error",h),i.once("close",y),this.once("close",p),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{u||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let u=0;u<n.length;u++)~this.transports.indexOf(n[u])&&i.push(n[u]);return i}}let a1=class extends n1{constructor(n,i={}){const u=typeof n=="object"?n:i;(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(c=>W_[c]).filter(c=>!!c)),super(n,u)}};function i1(s,n="",i){let u=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),u=Ro(s)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const f=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+f+":"+u.port+n,u.href=u.protocol+"://"+f+(i&&i.port===u.port?"":":"+u.port),u}const l1=typeof ArrayBuffer=="function",s1=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,ep=Object.prototype.toString,u1=typeof Blob=="function"||typeof Blob<"u"&&ep.call(Blob)==="[object BlobConstructor]",r1=typeof File=="function"||typeof File<"u"&&ep.call(File)==="[object FileConstructor]";function tf(s){return l1&&(s instanceof ArrayBuffer||s1(s))||u1&&s instanceof Blob||r1&&s instanceof File}function Cu(s,n){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,u=s.length;i<u;i++)if(Cu(s[i]))return!0;return!1}if(tf(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Cu(s.toJSON(),!0);for(const i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&Cu(s[i]))return!0;return!1}function c1(s){const n=[],i=s.data,u=s;return u.data=ko(i,n),u.attachments=n.length,{packet:u,buffers:n}}function ko(s,n){if(!s)return s;if(tf(s)){const i={_placeholder:!0,num:n.length};return n.push(s),i}else if(Array.isArray(s)){const i=new Array(s.length);for(let u=0;u<s.length;u++)i[u]=ko(s[u],n);return i}else if(typeof s=="object"&&!(s instanceof Date)){const i={};for(const u in s)Object.prototype.hasOwnProperty.call(s,u)&&(i[u]=ko(s[u],n));return i}return s}function o1(s,n){return s.data=Mo(s.data,n),delete s.attachments,s}function Mo(s,n){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<n.length)return n[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mo(s[i],n);else if(typeof s=="object")for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mo(s[i],n));return s}const f1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],d1=5;var be;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(be||(be={}));class h1{constructor(n){this.replacer=n}encode(n){return(n.type===be.EVENT||n.type===be.ACK)&&Cu(n)?this.encodeAsBinary({type:n.type===be.EVENT?be.BINARY_EVENT:be.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;return(n.type===be.BINARY_EVENT||n.type===be.BINARY_ACK)&&(i+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(i+=n.nsp+","),n.id!=null&&(i+=n.id),n.data!=null&&(i+=JSON.stringify(n.data,this.replacer)),i}encodeAsBinary(n){const i=c1(n),u=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(u),c}}function fm(s){return Object.prototype.toString.call(s)==="[object Object]"}class nf extends Pe{constructor(n){super(),this.reviver=n}add(n){let i;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);const u=i.type===be.BINARY_EVENT;u||i.type===be.BINARY_ACK?(i.type=u?be.EVENT:be.ACK,this.reconstructor=new y1(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(tf(n)||n.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(n),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let i=0;const u={type:Number(n.charAt(0))};if(be[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===be.BINARY_EVENT||u.type===be.BINARY_ACK){const f=i+1;for(;n.charAt(++i)!=="-"&&i!=n.length;);const h=n.substring(f,i);if(h!=Number(h)||n.charAt(i)!=="-")throw new Error("Illegal attachments");u.attachments=Number(h)}if(n.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););u.nsp=n.substring(f,i)}else u.nsp="/";const c=n.charAt(i+1);if(c!==""&&Number(c)==c){const f=i+1;for(;++i;){const h=n.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===n.length)break}u.id=Number(n.substring(f,i+1))}if(n.charAt(++i)){const f=this.tryParse(n.substr(i));if(nf.isPayloadValid(u.type,f))u.data=f;else throw new Error("invalid payload")}return u}tryParse(n){try{return JSON.parse(n,this.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case be.CONNECT:return fm(i);case be.DISCONNECT:return i===void 0;case be.CONNECT_ERROR:return typeof i=="string"||fm(i);case be.EVENT:case be.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&f1.indexOf(i[0])===-1);case be.ACK:case be.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class y1{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=o1(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const m1=Object.freeze(Object.defineProperty({__proto__:null,Decoder:nf,Encoder:h1,get PacketType(){return be},protocol:d1},Symbol.toStringTag,{value:"Module"}));function an(s,n,i){return s.on(n,i),function(){s.off(n,i)}}const p1=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tp extends Pe{constructor(n,i,u){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=i,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[an(n,"open",this.onopen.bind(this)),an(n,"packet",this.onpacket.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var u,c,f;if(p1.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:be.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const S=this.ids++,w=i.pop();this._registerAckCallback(S,w),h.id=S}const y=(c=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||c===void 0?void 0:c.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!y||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(n,i){var u;const c=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(c===void 0){this.acks[n]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let y=0;y<this.sendBuffer.length;y++)this.sendBuffer[y].id===n&&this.sendBuffer.splice(y,1);i.call(this,new Error("operation has timed out"))},c),h=(...y)=>{this.io.clearTimeoutFn(f),i.apply(this,y)};h.withError=!0,this.acks[n]=h}emitWithAck(n,...i){return new Promise((u,c)=>{const f=(h,y)=>h?c(h):u(y);f.withError=!0,i.push(f),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((c,...f)=>u!==this._queue[0]?void 0:(c!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(c)):(this._queue.shift(),i&&i(null,...f)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(u=>String(u.id)===n)){const u=this.acks[n];delete this.acks[n],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case be.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case be.EVENT:case be.BINARY_EVENT:this.onevent(n);break;case be.ACK:case be.BINARY_ACK:this.onack(n);break;case be.DISCONNECT:this.ondisconnect();break;case be.CONNECT_ERROR:this.destroy();const u=new Error(n.data.message);u.data=n.data.data,this.emitReserved("connect_error",u);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const u of i)u.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let u=!1;return function(...c){u||(u=!0,i.packet({type:be.ACK,id:n,data:c}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const i=this._anyOutgoingListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const u of i)u.apply(this,n.data)}}}function Li(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Li.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*s);s=(Math.floor(n*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};Li.prototype.reset=function(){this.attempts=0};Li.prototype.setMin=function(s){this.ms=s};Li.prototype.setMax=function(s){this.max=s};Li.prototype.setJitter=function(s){this.jitter=s};class No extends Pe{constructor(n,i){var u;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Qu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((u=i.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new Li({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const c=i.parser||m1;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new a1(this.uri,this.opts);const i=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const c=an(i,"open",function(){u.onopen(),n&&n()}),f=y=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",y),n?n(y):this.maybeReconnectOnOpen()},h=an(i,"error",f);if(this._timeout!==!1){const y=this._timeout,p=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),i.close()},y);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(c),this.subs.push(h),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(an(n,"ping",this.onping.bind(this)),an(n,"data",this.ondata.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"close",this.onclose.bind(this)),an(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){$u(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let u=this.nsps[n];return u?this._autoConnect&&!u.active&&u.connect():(u=new tp(this,n,i),this.nsps[n]=u),u}_destroy(n){const i=Object.keys(this.nsps);for(const u of i)if(this.nsps[u].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let u=0;u<i.length;u++)this.engine.write(i[u],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(c=>{c?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",c)):n.onreconnect()}))},i);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Ll={};function Du(s,n){typeof s=="object"&&(n=s,s=void 0),n=n||{};const i=i1(s,n.path||"/socket.io"),u=i.source,c=i.id,f=i.path,h=Ll[c]&&f in Ll[c].nsps,y=n.forceNew||n["force new connection"]||n.multiplex===!1||h;let p;return y?p=new No(u,n):(Ll[c]||(Ll[c]=new No(u,n)),p=Ll[c]),i.query&&!n.query&&(n.query=i.queryKey),p.socket(i.path,n)}Object.assign(Du,{Manager:No,Socket:tp,io:Du,connect:Du});const g1=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"],v1=3,b1=15,_1=/^[a-zA-Z0-9_-]+$/,af=xe.string().min(v1).max(b1).regex(_1),dm=20,hm={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function S1(s){let n="";for(const i of s)i in hm?n+=hm[i]:n+=i;return n}function T1(s){const n=s.toLocaleLowerCase(),i=S1(n);for(const u of g1)if(i.includes(u)||n.includes(u))return!0;return!1}function E1(s){const n=new Set(s).size;return s.length*Math.log2(n)}function A1(s){let n=0;return T1(s)&&(n-=100),n+=E1(s)*.5,Math.max(n,0)}const lf=xe.string().refine(s=>A1(s)>=dm,{message:`Password does not meet the minimum complexity of ${dm}.`}).brand("password");xe.object({username:af,password:lf}).strict();const np=xe.string().email().brand("email");xe.object({username:af,password:lf,email:np}).strict();var O1={};function w1(s,n){const i={},u=[];for(const c in s){const f=s[c],h=n[c],y=f["~standard"].validate(h);if(y instanceof Promise)throw new Error(`Validation must be synchronous, but ${c} returned a Promise.`);if(y.issues){u.push(...y.issues.map(p=>({...p,path:[c,...p.path??[]]})));continue}i[c]=y.value}return u.length?{issues:u}:{value:i}}function R1(s){const n=s.runtimeEnvStrict??s.runtimeEnv??O1;for(const[de,he]of Object.entries(n))he===""&&delete n[de];if(!!s.skipValidation)return n;const u=typeof s.client=="object"?s.client:{},c=typeof s.server=="object"?s.server:{},f=typeof s.shared=="object"?s.shared:{},h=s.isServer??(typeof window>"u"||"Deno"in window),y=h?{...c,...f,...u}:{...u,...f},p=w1(y,n),g=s.onValidationError??(de=>{throw console.error("❌ Invalid environment variables:",de),new Error("Invalid environment variables")}),S=s.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return g(p.issues);const w=de=>s.clientPrefix?!de.startsWith(s.clientPrefix)&&!(de in f):!0,C=de=>h||!w(de),U=de=>de==="__esModule"||de==="$$typeof",Q=(s.extends??[]).reduce((de,he)=>Object.assign(de,he),{}),L=Object.assign(p.value,Q);return new Proxy(L,{get(de,he){if(typeof he=="string"&&!U(he))return C(he)?Reflect.get(de,he):S(he)}})}const x1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},k1="__vite_start_time"in globalThis,M1=typeof window<"u",sf=R1({isServer:!k1&&!M1,server:{CI:xe.string().transform(s=>!0).optional(),POSTGRES_USER:xe.string(),POSTGRES_PASSWORD:xe.string(),POSTGRES_DATABASE:xe.string(),POSTGRES_HOST:xe.string(),POSTGRES_PORT:xe.string().transform(s=>Number.parseInt(s,10)),BACKEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),RUN_WORKERS_FROM_SOURCE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true"),FRONTEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),FRONTEND_ORIGINS:xe.string().transform(s=>JSON.parse(s)).pipe(xe.array(xe.string())),OPENAI_API_KEY:xe.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:xe.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true")},runtimeEnv:x1,emptyStringAsUndefined:!0}),uf=Du(sf.VITE_BACKEND_ORIGIN,{auth:s=>{const n=vo(Zi);n&&s(n)},autoConnect:!1}).on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),Bo(Zi,null)}),Zi=Bt({key:"auth",default:null,effects:[({onSet:s})=>{s(({newValue:n})=>{n?(localStorage.setItem("username",n.username),localStorage.setItem("sessionKey",n.sessionKey),console.log("connecting..."),uf.connect()):(console.log("clearing session..."),localStorage.removeItem("sessionKey"))})},({setSelf:s})=>{const n=localStorage.getItem("username"),i=localStorage.getItem("sessionKey");n&&i&&s({username:n,sessionKey:i})}]}),us=Bt({key:"username",default:window.localStorage.getItem("username")??""}),ap=Xa({key:"usernameIssues",get:({get:s})=>{const n=s(us),i=af.safeParse(n);return i.success?null:i.error.issues}}),Hi=Bt({key:"password0",default:""}),ip=Xa({key:"password0Issues",get:({get:s})=>{const n=s(Hi),i=lf.safeParse(n);return i.success?null:i.error.issues}}),Co=Bt({key:"password1",default:""}),lp=Xa({key:"password1Issues",get:({get:s})=>{const n=s(Hi),i=s(Co),u=xe.string().refine(c=>c===n,{message:"Passwords do not match."}).safeParse(i);return u.success?null:u.error.issues}}),Do=Bt({key:"email",default:""}),sp=Xa({key:"emailIssues",get:({get:s})=>{const n=s(Do),i=np.safeParse(n);return i.success?null:i.error.issues}}),N1=Xa({key:"signupReady",get:({get:s})=>{const n=s(ap),i=s(ip),u=s(lp),c=s(sp);return!(n??i??u??c)}}),up=S_({login:null,sign_up:null,game:T_({clicker:null}),admin:null});function C1(s){return E_(up,s)}const D1=[["login"],["sign_up"]];function z1(s){return D1.some(n=>n.join("/")===s.join("/"))}function rp(s){history.pushState(null,"",s),Bo(cp,s)}const cp=Bt({key:"pathName",default:window.location.pathname,effects:[({onSet:s,setSelf:n})=>{const i=c=>{history.replaceState(null,"",c),n(c)},u=c=>{switch(c){case"/":{const f=vo(Zi);let h="/login";f&&(h="/game"),i(h);break}case"/login":case"/sign_up":{vo(Zi)&&i("/game");break}}};u(window.location.pathname),s(({newValue:c})=>{u(c)})},({setSelf:s})=>{document.addEventListener("click",n=>{const i=n.target.closest("a");if(i&&i instanceof HTMLAnchorElement){const u=i.getAttribute("href");u!=null&&u.startsWith("/")&&(n.preventDefault(),history.pushState(null,"",u),s(u))}}),window.addEventListener("popstate",()=>{s(window.location.pathname)})}]}),U1=Xa({key:"route",get:({get:s})=>{const i=s(cp).split("/").slice(1);return C1(i)?z1(i)||s(Zi)?i:401:404}});function j1(){return q.jsx("article",{children:q.jsx("h1",{children:"admin"})})}class B1 extends Map{set(n,i){return this.has(n)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this):super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Xl=class Xl{constructor(n){j(this,"type","continuity");j(this,"globals",[]);j(this,"actions",[]);j(this,"perspectives",[]);this.key=n}static create(n,i){const u=new Xl(n),{type:c,globals:f,actions:h,perspectives:y}=i(u),p={type:c,key:n,globals:f,actions:h,perspectives:y};return Xl.existing.set(n,p),p}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{const[u,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:u,viewAtoms:c})}break}return this}};j(Xl,"existing",new B1);let zo=Xl;function q1(s){const{key:n,config:i}=s,u=zo.create(n,i),{actions:c}=u;for(const f of c)_m(et.STORE,n,f.key);return Vo(et.STORE,n,-1),u}Bt({key:"usersInRoomIndex",mutable:!0,default:()=>new gn,toJson:s=>s.toJSON(),fromJson:s=>gn.fromJSON(s)});Bt({key:"roomIndex",default:()=>new gn,mutable:!0,toJson:s=>s.toJSON(),fromJson:s=>gn.fromJSON(s)});const Z1={enteredAtEpoch:0},H1=Kv({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:s=>typeof s=="string",isBType:s=>typeof s=="string"},Z1);Jv({key:"usersInMyRoomView",get:s=>({find:n})=>{const i=Yv(H1);return[n(i,s)]}});const rf=Bt({key:"count",default:0}),op=_b({key:"incrementTX",do:({set:s})=>{s(rf,n=>n+1)}}),V1=q1({key:"countContinuity",config:s=>s.add(rf).add(op)});function L1({route:[s]}){return q.jsx("article",{children:s?q.jsx(Y1,{gameId:s}):q.jsx(K1,{})})}function K1(){return q.jsx("nav",{children:q.jsx(Xu,{href:"/game/clicker",children:"Clicker"})})}pm(up[1].game[1]);function Y1({gameId:s}){console.log(s);const n=Ut(rf),i=Sb(op);return n0(V1),q.jsxs("article",{children:[q.jsxs("button",{type:"button",onClick:()=>{i()},children:["count is ",n]}),q.jsx("p",{children:"Let's see how high we can count!"})]})}async function G1(s,n="SHA-256"){const u=new TextEncoder().encode(s),c=await crypto.subtle.digest(n,u);return Array.from(new Uint8Array(c)).map(h=>h.toString(16).padStart(2,"0")).join("")}async function fp(s){const n=await G1(s);return`${n.substring(0,8)}-${n.substring(8,12)}-${n.substring(12,16)}-${n.substring(16,20)}-${n.substring(20,32)}`}function X1(){const s=Ha(us),n=Ha(Hi),i=Ut(us),u=Ut(Hi),[c,f]=dt.useState(null);return q.jsxs("form",{onSubmit:async h=>{h.preventDefault();const y=await fp("login"),p=await fetch(`${sf.VITE_BACKEND_ORIGIN}/login-${y}`,{method:"POST",body:JSON.stringify({username:i,password:u})});if(console.log(p),p.status===200){s(""),n("");const g=await p.text(),[,S]=g.split(" ");Bo(Zi,{username:i,sessionKey:S}),uf.once("connect",()=>{rp("/game")})}if(p.status>=400){const g=await p.text();f(g)}},children:[q.jsxs("main",{children:[c?q.jsx("aside",{children:c}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:i,onChange:h=>{s(h.target.value)},autoComplete:"username",autoCapitalize:"none"})]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password",type:"password",value:u,onChange:h=>{n(h.target.value)},autoComplete:"current-password",autoCapitalize:"none"})]}),q.jsx("button",{type:"submit",disabled:!i||!u,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Xu,{href:"/sign_up",children:["New here? ",q.jsx("u",{children:"Sign up"})," for an account."]})})]})}function $1(){const s=Ha(us),n=Ha(Hi),i=Ha(Co),u=Ha(Do),c=Ut(us),f=Ut(Hi),h=Ut(Co),y=Ut(Do),p=Ut(ap),g=Ut(ip),S=Ut(lp),w=Ut(sp),C=Ut(N1),[U,Q]=dt.useState(null);return q.jsxs("form",{onSubmit:async L=>{L.preventDefault();const fe=f,de=await fp("sign-up"),he=await fetch(`${sf.VITE_BACKEND_ORIGIN}/sign-up-${de}`,{method:"POST",body:JSON.stringify({username:c,password:fe,email:y})});if(he.status===201&&(i(""),u(""),rp("/login")),he.status>=400){const Ye=await he.text();Q(Ye)}},children:[q.jsxs("main",{children:[U?q.jsx("aside",{children:U}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:c,onChange:L=>{s(L.target.value)},autoComplete:"username",autoCapitalize:"none",style:{"--energy-color":c?p?"red":"green":void 0}}),c&&p?q.jsx("aside",{children:p.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password0",type:"password",value:f,onChange:L=>{n(L.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":f?g?"red":"green":void 0}}),f&&g?q.jsx("aside",{children:g.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Confirm Password"}),q.jsx("input",{id:"password1",type:"password",value:h,onChange:L=>{i(L.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":h?S?"red":"green":void 0}}),h&&S?q.jsx("aside",{children:S.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"email",children:[q.jsx("span",{children:"Email"}),q.jsx("input",{id:"email",type:"email",value:y,onChange:L=>{u(L.target.value)},autoComplete:"email",autoCapitalize:"none",style:{"--energy-color":y?w?"red":"green":void 0}}),y&&w?q.jsx("aside",{children:w.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsx("button",{type:"submit",disabled:!C,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Xu,{href:"/login",children:["Already have an account? ",q.jsx("u",{children:"Log in"})," instead."]})})]})}function Q1(){const s=Ut(U1);return q.jsxs("main",{className:__.class,children:[q.jsx("header",{children:q.jsx(b_,{})}),q.jsx("main",{children:typeof s=="number"?q.jsxs("article",{children:[q.jsx("h1",{children:s}),q.jsx("h2",{children:Lm[s]}),q.jsx(Xu,{href:"/login",children:"Return to Home Page"})]}):(()=>{const[n,...i]=s;switch(n){case"admin":return q.jsx(j1,{});case"login":return q.jsx(X1,{});case"sign_up":return q.jsx($1,{});case"game":return q.jsx(L1,{route:i})}})()})]})}c0.createRoot(document.getElementById("root")).render(q.jsx(dt.StrictMode,{children:q.jsx(Fb,{socket:uf,children:q.jsx(Q1,{})})}));
|
|
62
|
+
`).replace(av,"")}function by(e,t){return t=vy(t),vy(e)===t}function du(){}function Me(e,t,a,l,r,o){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ei(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ei(e,""+l);break;case"className":_s(e,"class",l);break;case"tabIndex":_s(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":_s(e,a,l);break;case"style":kf(e,l,o);break;case"data":if(t!=="object"){_s(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Es(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(t!=="input"&&Me(e,t,"name",r.name,r,null),Me(e,t,"formEncType",r.formEncType,r,null),Me(e,t,"formMethod",r.formMethod,r,null),Me(e,t,"formTarget",r.formTarget,r,null)):(Me(e,t,"encType",r.encType,r,null),Me(e,t,"method",r.method,r,null),Me(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Es(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=du);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Es(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),bs(e,"popover",l);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Cp.get(a)||a,bs(e,a,l))}}function Lc(e,t,a,l,r,o){switch(a){case"style":kf(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof l=="string"?ei(e,l):(typeof l=="number"||typeof l=="bigint")&&ei(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=du);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_f.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[At]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof l=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,r);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):bs(e,a,l)}}}function ft(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var d=a[o];if(d!=null)switch(o){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,o,d,a,null)}}r&&Me(e,t,"srcSet",a.srcSet,a,null),l&&Me(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var m=o=d=r=null,v=null,T=null;for(l in a)if(a.hasOwnProperty(l)){var x=a[l];if(x!=null)switch(l){case"name":r=x;break;case"type":d=x;break;case"checked":v=x;break;case"defaultChecked":T=x;break;case"value":o=x;break;case"defaultValue":m=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(137,t));break;default:Me(e,t,l,x,a,null)}}Of(e,o,m,v,T,d,r,!1),Ss(e);return;case"select":ve("invalid",e),l=d=o=null;for(r in a)if(a.hasOwnProperty(r)&&(m=a[r],m!=null))switch(r){case"value":o=m;break;case"defaultValue":d=m;break;case"multiple":l=m;default:Me(e,t,r,m,a,null)}t=o,a=d,e.multiple=!!l,t!=null?Pa(e,!!l,t,!1):a!=null&&Pa(e,!!l,a,!0);return;case"textarea":ve("invalid",e),o=r=l=null;for(d in a)if(a.hasOwnProperty(d)&&(m=a[d],m!=null))switch(d){case"value":l=m;break;case"defaultValue":r=m;break;case"children":o=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Me(e,t,d,m,a,null)}Rf(e,l,r,o),Ss(e);return;case"option":for(v in a)if(a.hasOwnProperty(v)&&(l=a[v],l!=null))switch(v){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Me(e,t,v,l,a,null)}return;case"dialog":ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ml.length;l++)ve(Ml[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in a)if(a.hasOwnProperty(T)&&(l=a[T],l!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,T,l,a,null)}return;default:if(ir(t)){for(x in a)a.hasOwnProperty(x)&&(l=a[x],l!==void 0&&Lc(e,t,x,l,a,void 0));return}}for(m in a)a.hasOwnProperty(m)&&(l=a[m],l!=null&&Me(e,t,m,l,a,null))}function iv(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,d=null,m=null,v=null,T=null,x=null;for(R in a){var M=a[R];if(a.hasOwnProperty(R)&&M!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":v=M;default:l.hasOwnProperty(R)||Me(e,t,R,null,l,M)}}for(var O in l){var R=l[O];if(M=a[O],l.hasOwnProperty(O)&&(R!=null||M!=null))switch(O){case"type":o=R;break;case"name":r=R;break;case"checked":T=R;break;case"defaultChecked":x=R;break;case"value":d=R;break;case"defaultValue":m=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:R!==M&&Me(e,t,O,R,l,M)}}nr(e,d,m,v,T,x,o,r);return;case"select":R=d=m=O=null;for(o in a)if(v=a[o],a.hasOwnProperty(o)&&v!=null)switch(o){case"value":break;case"multiple":R=v;default:l.hasOwnProperty(o)||Me(e,t,o,null,l,v)}for(r in l)if(o=l[r],v=a[r],l.hasOwnProperty(r)&&(o!=null||v!=null))switch(r){case"value":O=o;break;case"defaultValue":m=o;break;case"multiple":d=o;default:o!==v&&Me(e,t,r,o,l,v)}t=m,a=d,l=R,O!=null?Pa(e,!!a,O,!1):!!l!=!!a&&(t!=null?Pa(e,!!a,t,!0):Pa(e,!!a,a?[]:"",!1));return;case"textarea":R=O=null;for(m in a)if(r=a[m],a.hasOwnProperty(m)&&r!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Me(e,t,m,null,l,r)}for(d in l)if(r=l[d],o=a[d],l.hasOwnProperty(d)&&(r!=null||o!=null))switch(d){case"value":O=r;break;case"defaultValue":R=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==o&&Me(e,t,d,r,l,o)}wf(e,O,R);return;case"option":for(var J in a)if(O=a[J],a.hasOwnProperty(J)&&O!=null&&!l.hasOwnProperty(J))switch(J){case"selected":e.selected=!1;break;default:Me(e,t,J,null,l,O)}for(v in l)if(O=l[v],R=a[v],l.hasOwnProperty(v)&&O!==R&&(O!=null||R!=null))switch(v){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Me(e,t,v,O,l,R)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in a)O=a[le],a.hasOwnProperty(le)&&O!=null&&!l.hasOwnProperty(le)&&Me(e,t,le,null,l,O);for(T in l)if(O=l[T],R=a[T],l.hasOwnProperty(T)&&O!==R&&(O!=null||R!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Me(e,t,T,O,l,R)}return;default:if(ir(t)){for(var Le in a)O=a[Le],a.hasOwnProperty(Le)&&O!==void 0&&!l.hasOwnProperty(Le)&&Lc(e,t,Le,void 0,l,O);for(x in l)O=l[x],R=a[x],!l.hasOwnProperty(x)||O===R||O===void 0&&R===void 0||Lc(e,t,x,O,l,R);return}}for(var E in a)O=a[E],a.hasOwnProperty(E)&&O!=null&&!l.hasOwnProperty(E)&&Me(e,t,E,null,l,O);for(M in l)O=l[M],R=a[M],!l.hasOwnProperty(M)||O===R||O==null&&R==null||Me(e,t,M,O,l,R)}var Kc=null,Yc=null;function hu(e){return e.nodeType===9?e:e.ownerDocument}function _y(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xc=null;function lv(){var e=window.event;return e&&e.type==="popstate"?e===Xc?!1:(Xc=e,!0):(Xc=null,!1)}var Ty=typeof setTimeout=="function"?setTimeout:void 0,sv=typeof clearTimeout=="function"?clearTimeout:void 0,Ey=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ey<"u"?function(e){return Ey.resolve(null).then(e).catch(rv)}:Ty;function rv(e){setTimeout(function(){throw e})}function $c(e,t){var a=t,l=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(l===0){e.removeChild(r),Zl(t);return}l--}else a!=="$"&&a!=="$?"&&a!=="$!"||l++;a=r}while(a);Zl(t)}function Qc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Qc(a),tr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cv(e,t,a,l){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[$i])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=nn(e.nextSibling),e===null)break}return null}function ov(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=nn(e.nextSibling),e===null))return null;return e}function nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function Ay(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function Oy(e,t,a){switch(t=hu(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}var Jt=new Map,wy=new Set;function yu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var Zn=Y.d;Y.d={f:fv,r:dv,D:hv,C:yv,L:mv,m:pv,X:vv,S:gv,M:bv};function fv(){var e=Zn.f(),t=su();return e||t}function dv(e){var t=Fa(e);t!==null&&t.tag===5&&t.type==="form"?Pd(t):Zn.r(e)}var Ri=typeof document>"u"?null:document;function Ry(e,t,a){var l=Ri;if(l&&typeof t=="string"&&t){var r=Zt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),wy.has(r)||(wy.add(r),e={rel:e,crossOrigin:a,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),ft(t,"link",e),it(t),l.head.appendChild(t)))}}function hv(e){Zn.D(e),Ry("dns-prefetch",e,null)}function yv(e,t){Zn.C(e,t),Ry("preconnect",e,t)}function mv(e,t,a){Zn.L(e,t,a);var l=Ri;if(l&&e&&t){var r='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Zt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Zt(a.imageSizes)+'"]')):r+='[href="'+Zt(e)+'"]';var o=r;switch(t){case"style":o=xi(e);break;case"script":o=ki(e)}Jt.has(o)||(e=X({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Jt.set(o,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(Cl(o))||t==="script"&&l.querySelector(Dl(o))||(t=l.createElement("link"),ft(t,"link",e),it(t),l.head.appendChild(t)))}}function pv(e,t){Zn.m(e,t);var a=Ri;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',o=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ki(e)}if(!Jt.has(o)&&(e=X({rel:"modulepreload",href:e},t),Jt.set(o,e),a.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Dl(o)))return}l=a.createElement("link"),ft(l,"link",e),it(l),a.head.appendChild(l)}}}function gv(e,t,a){Zn.S(e,t,a);var l=Ri;if(l&&e){var r=Wa(l).hoistableStyles,o=xi(e);t=t||"default";var d=r.get(o);if(!d){var m={loading:0,preload:null};if(d=l.querySelector(Cl(o)))m.loading=5;else{e=X({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Jt.get(o))&&Jc(e,a);var v=d=l.createElement("link");it(v),ft(v,"link",e),v._p=new Promise(function(T,x){v.onload=T,v.onerror=x}),v.addEventListener("load",function(){m.loading|=1}),v.addEventListener("error",function(){m.loading|=2}),m.loading|=4,mu(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:m},r.set(o,d)}}}function vv(e,t){Zn.X(e,t);var a=Ri;if(a&&e){var l=Wa(a).hoistableScripts,r=ki(e),o=l.get(r);o||(o=a.querySelector(Dl(r)),o||(e=X({src:e,async:!0},t),(t=Jt.get(r))&&Fc(e,t),o=a.createElement("script"),it(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function bv(e,t){Zn.M(e,t);var a=Ri;if(a&&e){var l=Wa(a).hoistableScripts,r=ki(e),o=l.get(r);o||(o=a.querySelector(Dl(r)),o||(e=X({src:e,async:!0,type:"module"},t),(t=Jt.get(r))&&Fc(e,t),o=a.createElement("script"),it(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function xy(e,t,a,l){var r=(r=Kn.current)?yu(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xi(a.href),a=Wa(r).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=xi(a.href);var o=Wa(r).hoistableStyles,d=o.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=r.querySelector(Cl(e)))&&!o._p&&(d.instance=o,d.state.loading=5),Jt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jt.set(e,a),o||_v(r,e,a,d.state))),t&&l===null)throw Error(u(528,""));return d}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ki(a),a=Wa(r).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function xi(e){return'href="'+Zt(e)+'"'}function Cl(e){return'link[rel="stylesheet"]['+e+"]"}function ky(e){return X({},e,{"data-precedence":e.precedence,precedence:null})}function _v(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ft(t,"link",a),it(t),e.head.appendChild(t))}function ki(e){return'[src="'+Zt(e)+'"]'}function Dl(e){return"script[async]"+e}function My(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(a.href)+'"]');if(l)return t.instance=l,it(l),l;var r=X({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),it(l),ft(l,"style",r),mu(l,a.precedence,e),t.instance=l;case"stylesheet":r=xi(a.href);var o=e.querySelector(Cl(r));if(o)return t.state.loading|=4,t.instance=o,it(o),o;l=ky(a),(r=Jt.get(r))&&Jc(l,r),o=(e.ownerDocument||e).createElement("link"),it(o);var d=o;return d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",l),t.state.loading|=4,mu(o,a.precedence,e),t.instance=o;case"script":return o=ki(a.src),(r=e.querySelector(Dl(o)))?(t.instance=r,it(r),r):(l=a,(r=Jt.get(o))&&(l=X({},a),Fc(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),ft(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,mu(l,a.precedence,e));return t.instance}function mu(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,o=r,d=0;d<l.length;d++){var m=l[d];if(m.dataset.precedence===t)o=m;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var pu=null;function Ny(e,t,a){if(pu===null){var l=new Map,r=pu=new Map;r.set(a,l)}else r=pu,l=r.get(a),l||(l=new Map,r.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[$i]||o[ht]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var d=o.getAttribute(t)||"";d=e+d;var m=l.get(d);m?m.push(o):l.set(d,[o])}}return l}function Cy(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Sv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Dy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var zl=null;function Tv(){}function Ev(e,t,a){if(zl===null)throw Error(u(475));var l=zl;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var r=xi(a.href),o=e.querySelector(Cl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=gu.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=o,it(o);return}o=e.ownerDocument||e,a=ky(a),(r=Jt.get(r))&&Jc(a,r),o=o.createElement("link"),it(o);var d=o;d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",a),t.instance=o}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=gu.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function Av(){if(zl===null)throw Error(u(475));var e=zl;return e.stylesheets&&e.count===0&&Wc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Wc(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function gu(){if(this.count--,this.count===0){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vu=null;function Wc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vu=new Map,t.forEach(Ov,e),vu=null,gu.call(e))}function Ov(e,t){if(!(t.state.loading&4)){var a=vu.get(e);if(a)var l=a.get(null);else{a=new Map,vu.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var d=r[o];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}r=t.instance,d=r.getAttribute("data-precedence"),o=a.get(d)||l,o===l&&a.set(null,r),a.set(d,r),this.count++,l=gu.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Ul={$$typeof:U,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function wv(e,t,a,l,r,o,d,m){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.hiddenUpdates=Pu(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function zy(e,t,a,l,r,o,d,m,v,T,x,M){return e=new wv(e,t,a,d,m,v,T,M),t=1,o===!0&&(t|=24),o=$t(3,null,null,t),e.current=o,o.stateNode=e,t=kr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:a,cache:t},cc(o),e}function Uy(e){return e?(e=ui,e):ui}function jy(e,t,a,l,r,o){r=Uy(r),l.context===null?l.context=r:l.pendingContext=r,l=ea(t),l.payload={element:a},o=o===void 0?null:o,o!==null&&(l.callback=o),a=ta(e,l,t),a!==null&&(St(a,e,t),vl(a,e,t))}function By(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ic(e,t){By(e,t),(e=e.alternate)&&By(e,t)}function qy(e){if(e.tag===13){var t=$n(e,67108864);t!==null&&St(t,e,67108864),Ic(e,67108864)}}var bu=!0;function Rv(e,t,a,l){var r=B.T;B.T=null;var o=Y.p;try{Y.p=2,Pc(e,t,a,l)}finally{Y.p=o,B.T=r}}function xv(e,t,a,l){var r=B.T;B.T=null;var o=Y.p;try{Y.p=8,Pc(e,t,a,l)}finally{Y.p=o,B.T=r}}function Pc(e,t,a,l){if(bu){var r=eo(l);if(r===null)Vc(e,t,l,_u,a),Hy(e,l);else if(Mv(r,e,t,a,l))l.stopPropagation();else if(Hy(e,l),t&4&&-1<kv.indexOf(e)){for(;r!==null;){var o=Fa(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var d=va(o.pendingLanes);if(d!==0){var m=o;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var v=1<<31-xt(d);m.entanglements[1]|=v,d&=~v}mn(o),(qe&6)===0&&(au=on()+500,kl(0))}}break;case 13:m=$n(o,2),m!==null&&St(m,o,2),su(),Ic(o,2)}if(o=eo(l),o===null&&Vc(e,t,l,_u,a),o===r)break;r=o}r!==null&&l.stopPropagation()}else Vc(e,t,l,null,a)}}function eo(e){return e=sr(e),to(e)}var _u=null;function to(e){if(_u=null,e=ba(e),e!==null){var t=I(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Ee(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _u=e,null}function Zy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yp()){case cf:return 2;case of:return 8;case ms:case mp:return 32;case ff:return 268435456;default:return 32}default:return 32}}var no=!1,ra=null,ca=null,oa=null,jl=new Map,Bl=new Map,fa=[],kv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hy(e,t){switch(e){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(t.pointerId)}}function ql(e,t,a,l,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Fa(t),t!==null&&qy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Mv(e,t,a,l,r){switch(t){case"focusin":return ra=ql(ra,e,t,a,l,r),!0;case"dragenter":return ca=ql(ca,e,t,a,l,r),!0;case"mouseover":return oa=ql(oa,e,t,a,l,r),!0;case"pointerover":var o=r.pointerId;return jl.set(o,ql(jl.get(o)||null,e,t,a,l,r)),!0;case"gotpointercapture":return o=r.pointerId,Bl.set(o,ql(Bl.get(o)||null,e,t,a,l,r)),!0}return!1}function Vy(e){var t=ba(e.target);if(t!==null){var a=I(t);if(a!==null){if(t=a.tag,t===13){if(t=Ee(a),t!==null){e.blockedOn=t,Ap(e.priority,function(){if(a.tag===13){var l=Dt(),r=$n(a,l);r!==null&&St(r,a,l),Ic(a,l)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Su(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=eo(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);lr=l,a.target.dispatchEvent(l),lr=null}else return t=Fa(a),t!==null&&qy(t),e.blockedOn=a,!1;t.shift()}return!0}function Ly(e,t,a){Su(e)&&a.delete(t)}function Nv(){no=!1,ra!==null&&Su(ra)&&(ra=null),ca!==null&&Su(ca)&&(ca=null),oa!==null&&Su(oa)&&(oa=null),jl.forEach(Ly),Bl.forEach(Ly)}function Tu(e,t){e.blockedOn===t&&(e.blockedOn=null,no||(no=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Nv)))}var Eu=null;function Ky(e){Eu!==e&&(Eu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Eu===e&&(Eu=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(to(l||a)===null)continue;break}var o=Fa(a);o!==null&&(e.splice(t,3),t-=3,Gr(o,{pending:!0,data:r,method:a.method,action:l},l,r))}}))}function Zl(e){function t(v){return Tu(v,e)}ra!==null&&Tu(ra,e),ca!==null&&Tu(ca,e),oa!==null&&Tu(oa,e),jl.forEach(t),Bl.forEach(t);for(var a=0;a<fa.length;a++){var l=fa[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<fa.length&&(a=fa[0],a.blockedOn===null);)Vy(a),a.blockedOn===null&&fa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var r=a[l],o=a[l+1],d=r[At]||null;if(typeof o=="function")d||Ky(a);else if(d){var m=null;if(o&&o.hasAttribute("formAction")){if(r=o,d=o[At]||null)m=d.formAction;else if(to(r)!==null)continue}else m=d.action;typeof m=="function"?a[l+1]=m:(a.splice(l,3),l-=3),Ky(a)}}}function ao(e){this._internalRoot=e}Au.prototype.render=ao.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,l=Dt();jy(a,l,e,t,null,null)},Au.prototype.unmount=ao.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&Ai(),jy(e.current,2,null,e,null,null),su(),t[Ja]=null}};function Au(e){this._internalRoot=e}Au.prototype.unstable_scheduleHydration=function(e){if(e){var t=gf();e={blockedOn:null,target:e,priority:t};for(var a=0;a<fa.length&&t!==0&&t<fa[a].priority;a++);fa.splice(a,0,e),a===0&&Vy(e)}};var Yy=n.version;if(Yy!=="19.0.0")throw Error(u(527,Yy,"19.0.0"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=D(t),e=e!==null?te(e):null,e=e===null?null:e.stateNode,e};var Cv={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:B,findFiberByHostInstance:ba,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ou.isDisabled&&Ou.supportsFiber)try{Yi=Ou.inject(Cv),Rt=Ou}catch{}}return Vl.createRoot=function(e,t){if(!c(e))throw Error(u(299));var a=!1,l="",r=uh,o=rh,d=ch,m=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(m=t.unstable_transitionCallbacks)),t=zy(e,1,!1,null,null,a,l,r,o,d,m,null),e[Ja]=t.current,Hc(e.nodeType===8?e.parentNode:e),new ao(t)},Vl.hydrateRoot=function(e,t,a){if(!c(e))throw Error(u(299));var l=!1,r="",o=uh,d=rh,m=ch,v=null,T=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(m=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(v=a.unstable_transitionCallbacks),a.formState!==void 0&&(T=a.formState)),t=zy(e,1,!0,t,a??null,l,r,o,d,m,v,T),t.context=Uy(null),a=t.current,l=Dt(),r=ea(l),r.callback=null,ta(a,r,l),t.current.lanes=l,Xi(t,l),mn(t),e[Ja]=t.current,Hc(e),new Au(t)},Vl.version="19.0.0",Vl}var am;function r0(){if(am)return uo.exports;am=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),uo.exports=u0(),uo.exports}var c0=r0(),Te;(function(s){s.assertEqual=c=>c;function n(c){}s.assertIs=n;function i(c){throw new Error}s.assertNever=i,s.arrayToEnum=c=>{const f={};for(const h of c)f[h]=h;return f},s.getValidEnumValues=c=>{const f=s.objectKeys(c).filter(y=>typeof c[c[y]]!="number"),h={};for(const y of f)h[y]=c[y];return s.objectValues(h)},s.objectValues=c=>s.objectKeys(c).map(function(f){return c[f]}),s.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const f=[];for(const h in c)Object.prototype.hasOwnProperty.call(c,h)&&f.push(h);return f},s.find=(c,f)=>{for(const h of c)if(f(h))return h},s.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function u(c,f=" | "){return c.map(h=>typeof h=="string"?`'${h}'`:h).join(f)}s.joinValues=u,s.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Te||(Te={}));var To;(function(s){s.mergeShapes=(n,i)=>({...n,...i})})(To||(To={}));const V=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vn=s=>{switch(typeof s){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(s)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(s)?V.array:s===null?V.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?V.promise:typeof Map<"u"&&s instanceof Map?V.map:typeof Set<"u"&&s instanceof Set?V.set:typeof Date<"u"&&s instanceof Date?V.date:V.object;default:return V.unknown}},z=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o0=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class jt extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=n}format(n){const i=n||function(f){return f.message},u={_errors:[]},c=f=>{for(const h of f.issues)if(h.code==="invalid_union")h.unionErrors.map(c);else if(h.code==="invalid_return_type")c(h.returnTypeError);else if(h.code==="invalid_arguments")c(h.argumentsError);else if(h.path.length===0)u._errors.push(i(h));else{let y=u,p=0;for(;p<h.path.length;){const g=h.path[p];p===h.path.length-1?(y[g]=y[g]||{_errors:[]},y[g]._errors.push(i(h))):y[g]=y[g]||{_errors:[]},y=y[g],p++}}};return c(this),u}static assert(n){if(!(n instanceof jt))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=i=>i.message){const i={},u=[];for(const c of this.issues)c.path.length>0?(i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c))):u.push(n(c));return{formErrors:u,fieldErrors:i}}get formErrors(){return this.flatten()}}jt.create=s=>new jt(s);const ji=(s,n)=>{let i;switch(s.code){case z.invalid_type:s.received===V.undefined?i="Required":i=`Expected ${s.expected}, received ${s.received}`;break;case z.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(s.expected,Te.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:i=`Unrecognized key(s) in object: ${Te.joinValues(s.keys,", ")}`;break;case z.invalid_union:i="Invalid input";break;case z.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Te.joinValues(s.options)}`;break;case z.invalid_enum_value:i=`Invalid enum value. Expected ${Te.joinValues(s.options)}, received '${s.received}'`;break;case z.invalid_arguments:i="Invalid function arguments";break;case z.invalid_return_type:i="Invalid function return type";break;case z.invalid_date:i="Invalid date";break;case z.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(i=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?i=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?i=`Invalid input: must end with "${s.validation.endsWith}"`:Te.assertNever(s.validation):s.validation!=="regex"?i=`Invalid ${s.validation}`:i="Invalid";break;case z.too_small:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:i="Invalid input";break;case z.too_big:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?i=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:i="Invalid input";break;case z.custom:i="Invalid input";break;case z.invalid_intersection_types:i="Intersection results could not be merged";break;case z.not_multiple_of:i=`Number must be a multiple of ${s.multipleOf}`;break;case z.not_finite:i="Number must be finite";break;default:i=n.defaultError,Te.assertNever(s)}return{message:i}};let Cm=ji;function f0(s){Cm=s}function Uu(){return Cm}const ju=s=>{const{data:n,path:i,errorMaps:u,issueData:c}=s,f=[...i,...c.path||[]],h={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let y="";const p=u.filter(g=>!!g).slice().reverse();for(const g of p)y=g(h,{data:n,defaultError:y}).message;return{...c,path:f,message:y}},d0=[];function H(s,n){const i=Uu(),u=ju({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,i,i===ji?void 0:ji].filter(c=>!!c)});s.common.issues.push(u)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,i){const u=[];for(const c of i){if(c.status==="aborted")return ae;c.status==="dirty"&&n.dirty(),u.push(c.value)}return{status:n.value,value:u}}static async mergeObjectAsync(n,i){const u=[];for(const c of i){const f=await c.key,h=await c.value;u.push({key:f,value:h})}return vt.mergeObjectSync(n,u)}static mergeObjectSync(n,i){const u={};for(const c of i){const{key:f,value:h}=c;if(f.status==="aborted"||h.status==="aborted")return ae;f.status==="dirty"&&n.dirty(),h.status==="dirty"&&n.dirty(),f.value!=="__proto__"&&(typeof h.value<"u"||c.alwaysSet)&&(u[f.value]=h.value)}return{status:n.value,value:u}}}const ae=Object.freeze({status:"aborted"}),Di=s=>({status:"dirty",value:s}),Et=s=>({status:"valid",value:s}),Eo=s=>s.status==="aborted",Ao=s=>s.status==="dirty",Ka=s=>s.status==="valid",Ql=s=>typeof Promise<"u"&&s instanceof Promise;function Bu(s,n,i,u){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n.get(s)}function Dm(s,n,i,u,c){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(s,i),i}var $;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})($||($={}));var Kl,Yl;class _n{constructor(n,i,u,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=u,this._key=c}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const im=(s,n)=>{if(Ka(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new jt(s.common.issues);return this._error=i,this._error}}};function ue(s){if(!s)return{};const{errorMap:n,invalid_type_error:i,required_error:u,description:c}=s;if(n&&(i||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:c}:{errorMap:(h,y)=>{var p,g;const{message:S}=s;return h.code==="invalid_enum_value"?{message:S??y.defaultError}:typeof y.data>"u"?{message:(p=S??u)!==null&&p!==void 0?p:y.defaultError}:h.code!=="invalid_type"?{message:y.defaultError}:{message:(g=S??i)!==null&&g!==void 0?g:y.defaultError}},description:c}}class oe{get description(){return this._def.description}_getType(n){return Vn(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Vn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new vt,ctx:{common:n.parent.common,data:n.data,parsedType:Vn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const i=this._parse(n);if(Ql(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){const i=this._parse(n);return Promise.resolve(i)}parse(n,i){const u=this.safeParse(n,i);if(u.success)return u.data;throw u.error}safeParse(n,i){var u;const c={common:{issues:[],async:(u=i==null?void 0:i.async)!==null&&u!==void 0?u:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)},f=this._parseSync({data:n,path:c.path,parent:c});return im(c,f)}"~validate"(n){var i,u;const c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)};if(!this["~standard"].async)try{const f=this._parseSync({data:n,path:[],parent:c});return Ka(f)?{value:f.value}:{issues:c.common.issues}}catch(f){!((u=(i=f==null?void 0:f.message)===null||i===void 0?void 0:i.toLowerCase())===null||u===void 0)&&u.includes("encountered")&&(this["~standard"].async=!0),c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then(f=>Ka(f)?{value:f.value}:{issues:c.common.issues})}async parseAsync(n,i){const u=await this.safeParseAsync(n,i);if(u.success)return u.data;throw u.error}async safeParseAsync(n,i){const u={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Vn(n)},c=this._parse({data:n,path:u.path,parent:u}),f=await(Ql(c)?c:Promise.resolve(c));return im(u,f)}refine(n,i){const u=c=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(c):i;return this._refinement((c,f)=>{const h=n(c),y=()=>f.addIssue({code:z.custom,...u(c)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(y(),!1)):h?!0:(y(),!1)})}refinement(n,i){return this._refinement((u,c)=>n(u)?!0:(c.addIssue(typeof i=="function"?i(u,c):i),!1))}_refinement(n){return new un({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return vn.create(this,this._def)}nullable(){return ga.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this)}promise(){return qi.create(this,this._def)}or(n){return Il.create([this,n],this._def)}and(n){return Pl.create(this,n,this._def)}transform(n){return new un({...ue(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const i=typeof n=="function"?n:()=>n;return new is({...ue(this._def),innerType:this,defaultValue:i,typeName:ne.ZodDefault})}brand(){return new Wo({typeName:ne.ZodBranded,type:this,...ue(this._def)})}catch(n){const i=typeof n=="function"?n:()=>n;return new ls({...ue(this._def),innerType:this,catchValue:i,typeName:ne.ZodCatch})}describe(n){const i=this.constructor;return new i({...this._def,description:n})}pipe(n){return fs.create(this,n)}readonly(){return ss.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const h0=/^c[^\s-]{8,}$/i,y0=/^[0-9a-z]+$/,m0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g0=/^[a-z0-9_-]{21}$/i,v0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,S0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fo;const T0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,A0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,O0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",x0=new RegExp(`^${zm}$`);function Um(s){let n="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`),n}function k0(s){return new RegExp(`^${Um(s)}$`)}function jm(s){let n=`${zm}T${Um(s)}`;const i=[];return i.push(s.local?"Z?":"Z"),s.offset&&i.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${i.join("|")})`,new RegExp(`^${n}$`)}function M0(s,n){return!!((n==="v4"||!n)&&T0.test(s)||(n==="v6"||!n)&&A0.test(s))}function N0(s,n){if(!v0.test(s))return!1;try{const[i]=s.split("."),u=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),c=JSON.parse(atob(u));return!(typeof c!="object"||c===null||!c.typ||!c.alg||n&&c.alg!==n)}catch{return!1}}function C0(s,n){return!!((n==="v4"||!n)&&E0.test(s)||(n==="v6"||!n)&&O0.test(s))}class ln extends oe{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==V.string){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.string,received:f.parsedType}),ae}const u=new vt;let c;for(const f of this._def.checks)if(f.kind==="min")n.data.length<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")n.data.length>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const h=n.data.length>f.value,y=n.data.length<f.value;(h||y)&&(c=this._getOrReturnCtx(n,c),h?H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):y&&H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")_0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"email",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")fo||(fo=new RegExp(S0,"u")),fo.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"emoji",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")p0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"uuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")g0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"nanoid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")h0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")y0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid2",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")m0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ulid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(n.data)}catch{c=this._getOrReturnCtx(n,c),H(c,{validation:"url",code:z.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"regex",code:z.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?n.data=n.data.trim():f.kind==="includes"?n.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?n.data=n.data.toLowerCase():f.kind==="toUpperCase"?n.data=n.data.toUpperCase():f.kind==="startsWith"?n.data.startsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?n.data.endsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?jm(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?x0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?k0(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?b0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"duration",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?M0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ip",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?N0(n.data,f.alg)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"jwt",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?C0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cidr",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?w0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?R0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64url",code:z.invalid_string,message:f.message}),u.dirty()):Te.assertNever(f);return{status:u.value,value:n.data}}_regex(n,i,u){return this.refinement(c=>n.test(c),{validation:i,code:z.invalid_string,...$.errToObj(u)})}_addCheck(n){return new ln({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...$.errToObj(n)})}url(n){return this._addCheck({kind:"url",...$.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...$.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...$.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...$.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...$.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...$.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...$.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...$.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...$.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...$.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...$.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...$.errToObj(n)})}datetime(n){var i,u;return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(i=n==null?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(u=n==null?void 0:n.local)!==null&&u!==void 0?u:!1,...$.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...$.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...$.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...$.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i==null?void 0:i.position,...$.errToObj(i==null?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...$.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...$.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...$.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...$.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...$.errToObj(i)})}nonempty(n){return this.min(1,$.errToObj(n))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxLength(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ln.create=s=>{var n;return new ln({checks:[],typeName:ne.ZodString,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};function D0(s,n){const i=(s.toString().split(".")[1]||"").length,u=(n.toString().split(".")[1]||"").length,c=i>u?i:u,f=parseInt(s.toFixed(c).replace(".","")),h=parseInt(n.toFixed(c).replace(".",""));return f%h/Math.pow(10,c)}class ya extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==V.number){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.number,received:f.parsedType}),ae}let u;const c=new vt;for(const f of this._def.checks)f.kind==="int"?Te.isInteger(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?D0(n.data,f.value)!==0&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_finite,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,$.toString(i))}gt(n,i){return this.setLimit("min",n,!1,$.toString(i))}lte(n,i){return this.setLimit("max",n,!0,$.toString(i))}lt(n,i){return this.setLimit("max",n,!1,$.toString(i))}setLimit(n,i,u,c){return new ya({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:$.toString(c)}]})}_addCheck(n){return new ya({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:$.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:$.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:$.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(n)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&Te.isInteger(n.value))}get isFinite(){let n=null,i=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(i===null||u.value>i)&&(i=u.value):u.kind==="max"&&(n===null||u.value<n)&&(n=u.value)}return Number.isFinite(i)&&Number.isFinite(n)}}ya.create=s=>new ya({checks:[],typeName:ne.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class ma extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==V.bigint)return this._getInvalidInput(n);let u;const c=new vt;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?n.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}_getInvalidInput(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.bigint,received:i.parsedType}),ae}gte(n,i){return this.setLimit("min",n,!0,$.toString(i))}gt(n,i){return this.setLimit("min",n,!1,$.toString(i))}lte(n,i){return this.setLimit("max",n,!0,$.toString(i))}lt(n,i){return this.setLimit("max",n,!1,$.toString(i))}setLimit(n,i,u,c){return new ma({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:$.toString(c)}]})}_addCheck(n){return new ma({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:$.toString(i)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ma.create=s=>{var n;return new ma({checks:[],typeName:ne.ZodBigInt,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};class Jl extends oe{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==V.boolean){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.boolean,received:u.parsedType}),ae}return Et(n.data)}}Jl.create=s=>new Jl({typeName:ne.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class Ya extends oe{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==V.date){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.date,received:f.parsedType}),ae}if(isNaN(n.data.getTime())){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_date}),ae}const u=new vt;let c;for(const f of this._def.checks)f.kind==="min"?n.data.getTime()<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?n.data.getTime()>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Te.assertNever(f);return{status:u.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Ya({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:$.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:$.toString(i)})}get minDate(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n!=null?new Date(n):null}}Ya.create=s=>new Ya({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:ne.ZodDate,...ue(s)});class qu extends oe{_parse(n){if(this._getType(n)!==V.symbol){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.symbol,received:u.parsedType}),ae}return Et(n.data)}}qu.create=s=>new qu({typeName:ne.ZodSymbol,...ue(s)});class Fl extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.undefined,received:u.parsedType}),ae}return Et(n.data)}}Fl.create=s=>new Fl({typeName:ne.ZodUndefined,...ue(s)});class Wl extends oe{_parse(n){if(this._getType(n)!==V.null){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.null,received:u.parsedType}),ae}return Et(n.data)}}Wl.create=s=>new Wl({typeName:ne.ZodNull,...ue(s)});class Bi extends oe{constructor(){super(...arguments),this._any=!0}_parse(n){return Et(n.data)}}Bi.create=s=>new Bi({typeName:ne.ZodAny,...ue(s)});class Va extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Et(n.data)}}Va.create=s=>new Va({typeName:ne.ZodUnknown,...ue(s)});class Ln extends oe{_parse(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.never,received:i.parsedType}),ae}}Ln.create=s=>new Ln({typeName:ne.ZodNever,...ue(s)});class Zu extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.void,received:u.parsedType}),ae}return Et(n.data)}}Zu.create=s=>new Zu({typeName:ne.ZodVoid,...ue(s)});class sn extends oe{_parse(n){const{ctx:i,status:u}=this._processInputParams(n),c=this._def;if(i.parsedType!==V.array)return H(i,{code:z.invalid_type,expected:V.array,received:i.parsedType}),ae;if(c.exactLength!==null){const h=i.data.length>c.exactLength.value,y=i.data.length<c.exactLength.value;(h||y)&&(H(i,{code:h?z.too_big:z.too_small,minimum:y?c.exactLength.value:void 0,maximum:h?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),u.dirty())}if(c.minLength!==null&&i.data.length<c.minLength.value&&(H(i,{code:z.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),u.dirty()),c.maxLength!==null&&i.data.length>c.maxLength.value&&(H(i,{code:z.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),u.dirty()),i.common.async)return Promise.all([...i.data].map((h,y)=>c.type._parseAsync(new _n(i,h,i.path,y)))).then(h=>vt.mergeArray(u,h));const f=[...i.data].map((h,y)=>c.type._parseSync(new _n(i,h,i.path,y)));return vt.mergeArray(u,f)}get element(){return this._def.type}min(n,i){return new sn({...this._def,minLength:{value:n,message:$.toString(i)}})}max(n,i){return new sn({...this._def,maxLength:{value:n,message:$.toString(i)}})}length(n,i){return new sn({...this._def,exactLength:{value:n,message:$.toString(i)}})}nonempty(n){return this.min(1,n)}}sn.create=(s,n)=>new sn({type:s,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ue(n)});function Mi(s){if(s instanceof Ze){const n={};for(const i in s.shape){const u=s.shape[i];n[i]=vn.create(Mi(u))}return new Ze({...s._def,shape:()=>n})}else return s instanceof sn?new sn({...s._def,type:Mi(s.element)}):s instanceof vn?vn.create(Mi(s.unwrap())):s instanceof ga?ga.create(Mi(s.unwrap())):s instanceof Sn?Sn.create(s.items.map(n=>Mi(n))):s}class Ze extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),i=Te.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==V.object){const g=this._getOrReturnCtx(n);return H(g,{code:z.invalid_type,expected:V.object,received:g.parsedType}),ae}const{status:u,ctx:c}=this._processInputParams(n),{shape:f,keys:h}=this._getCached(),y=[];if(!(this._def.catchall instanceof Ln&&this._def.unknownKeys==="strip"))for(const g in c.data)h.includes(g)||y.push(g);const p=[];for(const g of h){const S=f[g],w=c.data[g];p.push({key:{status:"valid",value:g},value:S._parse(new _n(c,w,c.path,g)),alwaysSet:g in c.data})}if(this._def.catchall instanceof Ln){const g=this._def.unknownKeys;if(g==="passthrough")for(const S of y)p.push({key:{status:"valid",value:S},value:{status:"valid",value:c.data[S]}});else if(g==="strict")y.length>0&&(H(c,{code:z.unrecognized_keys,keys:y}),u.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const S of y){const w=c.data[S];p.push({key:{status:"valid",value:S},value:g._parse(new _n(c,w,c.path,S)),alwaysSet:S in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const g=[];for(const S of p){const w=await S.key,C=await S.value;g.push({key:w,value:C,alwaysSet:S.alwaysSet})}return g}).then(g=>vt.mergeObjectSync(u,g)):vt.mergeObjectSync(u,p)}get shape(){return this._def.shape()}strict(n){return $.errToObj,new Ze({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,u)=>{var c,f,h,y;const p=(h=(f=(c=this._def).errorMap)===null||f===void 0?void 0:f.call(c,i,u).message)!==null&&h!==void 0?h:u.defaultError;return i.code==="unrecognized_keys"?{message:(y=$.errToObj(n).message)!==null&&y!==void 0?y:p}:{message:p}}}:{}})}strip(){return new Ze({...this._def,unknownKeys:"strip"})}passthrough(){return new Ze({...this._def,unknownKeys:"passthrough"})}extend(n){return new Ze({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Ze({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:ne.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Ze({...this._def,catchall:n})}pick(n){const i={};return Te.objectKeys(n).forEach(u=>{n[u]&&this.shape[u]&&(i[u]=this.shape[u])}),new Ze({...this._def,shape:()=>i})}omit(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{n[u]||(i[u]=this.shape[u])}),new Ze({...this._def,shape:()=>i})}deepPartial(){return Mi(this)}partial(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{const c=this.shape[u];n&&!n[u]?i[u]=c:i[u]=c.optional()}),new Ze({...this._def,shape:()=>i})}required(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{if(n&&!n[u])i[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof vn;)f=f._def.innerType;i[u]=f}}),new Ze({...this._def,shape:()=>i})}keyof(){return Bm(Te.objectKeys(this.shape))}}Ze.create=(s,n)=>new Ze({shape:()=>s,unknownKeys:"strip",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});Ze.strictCreate=(s,n)=>new Ze({shape:()=>s,unknownKeys:"strict",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});Ze.lazycreate=(s,n)=>new Ze({shape:s,unknownKeys:"strip",catchall:Ln.create(),typeName:ne.ZodObject,...ue(n)});class Il extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=this._def.options;function c(f){for(const y of f)if(y.result.status==="valid")return y.result;for(const y of f)if(y.result.status==="dirty")return i.common.issues.push(...y.ctx.common.issues),y.result;const h=f.map(y=>new jt(y.ctx.common.issues));return H(i,{code:z.invalid_union,unionErrors:h}),ae}if(i.common.async)return Promise.all(u.map(async f=>{const h={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:h}),ctx:h}})).then(c);{let f;const h=[];for(const p of u){const g={...i,common:{...i.common,issues:[]},parent:null},S=p._parseSync({data:i.data,path:i.path,parent:g});if(S.status==="valid")return S;S.status==="dirty"&&!f&&(f={result:S,ctx:g}),g.common.issues.length&&h.push(g.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const y=h.map(p=>new jt(p));return H(i,{code:z.invalid_union,unionErrors:y}),ae}}get options(){return this._def.options}}Il.create=(s,n)=>new Il({options:s,typeName:ne.ZodUnion,...ue(n)});const Hn=s=>s instanceof ts?Hn(s.schema):s instanceof un?Hn(s.innerType()):s instanceof ns?[s.value]:s instanceof pa?s.options:s instanceof as?Te.objectValues(s.enum):s instanceof is?Hn(s._def.innerType):s instanceof Fl?[void 0]:s instanceof Wl?[null]:s instanceof vn?[void 0,...Hn(s.unwrap())]:s instanceof ga?[null,...Hn(s.unwrap())]:s instanceof Wo||s instanceof ss?Hn(s.unwrap()):s instanceof ls?Hn(s._def.innerType):[];class Gu extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.object)return H(i,{code:z.invalid_type,expected:V.object,received:i.parsedType}),ae;const u=this.discriminator,c=i.data[u],f=this.optionsMap.get(c);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(H(i,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,u){const c=new Map;for(const f of i){const h=Hn(f.shape[n]);if(!h.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const y of h){if(c.has(y))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(y)}`);c.set(y,f)}}return new Gu({typeName:ne.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...ue(u)})}}function Oo(s,n){const i=Vn(s),u=Vn(n);if(s===n)return{valid:!0,data:s};if(i===V.object&&u===V.object){const c=Te.objectKeys(n),f=Te.objectKeys(s).filter(y=>c.indexOf(y)!==-1),h={...s,...n};for(const y of f){const p=Oo(s[y],n[y]);if(!p.valid)return{valid:!1};h[y]=p.data}return{valid:!0,data:h}}else if(i===V.array&&u===V.array){if(s.length!==n.length)return{valid:!1};const c=[];for(let f=0;f<s.length;f++){const h=s[f],y=n[f],p=Oo(h,y);if(!p.valid)return{valid:!1};c.push(p.data)}return{valid:!0,data:c}}else return i===V.date&&u===V.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class Pl extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=(f,h)=>{if(Eo(f)||Eo(h))return ae;const y=Oo(f.value,h.value);return y.valid?((Ao(f)||Ao(h))&&i.dirty(),{status:i.value,value:y.data}):(H(u,{code:z.invalid_intersection_types}),ae)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,h])=>c(f,h)):c(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}Pl.create=(s,n,i)=>new Pl({left:s,right:n,typeName:ne.ZodIntersection,...ue(i)});class Sn extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.array)return H(u,{code:z.invalid_type,expected:V.array,received:u.parsedType}),ae;if(u.data.length<this._def.items.length)return H(u,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&u.data.length>this._def.items.length&&(H(u,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...u.data].map((h,y)=>{const p=this._def.items[y]||this._def.rest;return p?p._parse(new _n(u,h,u.path,y)):null}).filter(h=>!!h);return u.common.async?Promise.all(f).then(h=>vt.mergeArray(i,h)):vt.mergeArray(i,f)}get items(){return this._def.items}rest(n){return new Sn({...this._def,rest:n})}}Sn.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn({items:s,typeName:ne.ZodTuple,rest:null,...ue(n)})};class es extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.object)return H(u,{code:z.invalid_type,expected:V.object,received:u.parsedType}),ae;const c=[],f=this._def.keyType,h=this._def.valueType;for(const y in u.data)c.push({key:f._parse(new _n(u,y,u.path,y)),value:h._parse(new _n(u,u.data[y],u.path,y)),alwaysSet:y in u.data});return u.common.async?vt.mergeObjectAsync(i,c):vt.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,u){return i instanceof oe?new es({keyType:n,valueType:i,typeName:ne.ZodRecord,...ue(u)}):new es({keyType:ln.create(),valueType:n,typeName:ne.ZodRecord,...ue(i)})}}class Hu extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.map)return H(u,{code:z.invalid_type,expected:V.map,received:u.parsedType}),ae;const c=this._def.keyType,f=this._def.valueType,h=[...u.data.entries()].map(([y,p],g)=>({key:c._parse(new _n(u,y,u.path,[g,"key"])),value:f._parse(new _n(u,p,u.path,[g,"value"]))}));if(u.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const p of h){const g=await p.key,S=await p.value;if(g.status==="aborted"||S.status==="aborted")return ae;(g.status==="dirty"||S.status==="dirty")&&i.dirty(),y.set(g.value,S.value)}return{status:i.value,value:y}})}else{const y=new Map;for(const p of h){const g=p.key,S=p.value;if(g.status==="aborted"||S.status==="aborted")return ae;(g.status==="dirty"||S.status==="dirty")&&i.dirty(),y.set(g.value,S.value)}return{status:i.value,value:y}}}}Hu.create=(s,n,i)=>new Hu({valueType:n,keyType:s,typeName:ne.ZodMap,...ue(i)});class Ga extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.set)return H(u,{code:z.invalid_type,expected:V.set,received:u.parsedType}),ae;const c=this._def;c.minSize!==null&&u.data.size<c.minSize.value&&(H(u,{code:z.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()),c.maxSize!==null&&u.data.size>c.maxSize.value&&(H(u,{code:z.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty());const f=this._def.valueType;function h(p){const g=new Set;for(const S of p){if(S.status==="aborted")return ae;S.status==="dirty"&&i.dirty(),g.add(S.value)}return{status:i.value,value:g}}const y=[...u.data.values()].map((p,g)=>f._parse(new _n(u,p,u.path,g)));return u.common.async?Promise.all(y).then(p=>h(p)):h(y)}min(n,i){return new Ga({...this._def,minSize:{value:n,message:$.toString(i)}})}max(n,i){return new Ga({...this._def,maxSize:{value:n,message:$.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Ga.create=(s,n)=>new Ga({valueType:s,minSize:null,maxSize:null,typeName:ne.ZodSet,...ue(n)});class zi extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.function)return H(i,{code:z.invalid_type,expected:V.function,received:i.parsedType}),ae;function u(y,p){return ju({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Uu(),ji].filter(g=>!!g),issueData:{code:z.invalid_arguments,argumentsError:p}})}function c(y,p){return ju({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Uu(),ji].filter(g=>!!g),issueData:{code:z.invalid_return_type,returnTypeError:p}})}const f={errorMap:i.common.contextualErrorMap},h=i.data;if(this._def.returns instanceof qi){const y=this;return Et(async function(...p){const g=new jt([]),S=await y._def.args.parseAsync(p,f).catch(U=>{throw g.addIssue(u(p,U)),g}),w=await Reflect.apply(h,this,S);return await y._def.returns._def.type.parseAsync(w,f).catch(U=>{throw g.addIssue(c(w,U)),g})})}else{const y=this;return Et(function(...p){const g=y._def.args.safeParse(p,f);if(!g.success)throw new jt([u(p,g.error)]);const S=Reflect.apply(h,this,g.data),w=y._def.returns.safeParse(S,f);if(!w.success)throw new jt([c(S,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new zi({...this._def,args:Sn.create(n).rest(Va.create())})}returns(n){return new zi({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,u){return new zi({args:n||Sn.create([]).rest(Va.create()),returns:i||Va.create(),typeName:ne.ZodFunction,...ue(u)})}}class ts extends oe{get schema(){return this._def.getter()}_parse(n){const{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}ts.create=(s,n)=>new ts({getter:s,typeName:ne.ZodLazy,...ue(n)});class ns extends oe{_parse(n){if(n.data!==this._def.value){const i=this._getOrReturnCtx(n);return H(i,{received:i.data,code:z.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:n.data}}get value(){return this._def.value}}ns.create=(s,n)=>new ns({value:s,typeName:ne.ZodLiteral,...ue(n)});function Bm(s,n){return new pa({values:s,typeName:ne.ZodEnum,...ue(n)})}class pa extends oe{constructor(){super(...arguments),Kl.set(this,void 0)}_parse(n){if(typeof n.data!="string"){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{expected:Te.joinValues(u),received:i.parsedType,code:z.invalid_type}),ae}if(Bu(this,Kl)||Dm(this,Kl,new Set(this._def.values)),!Bu(this,Kl).has(n.data)){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{received:i.data,code:z.invalid_enum_value,options:u}),ae}return Et(n.data)}get options(){return this._def.values}get enum(){const n={};for(const i of this._def.values)n[i]=i;return n}get Values(){const n={};for(const i of this._def.values)n[i]=i;return n}get Enum(){const n={};for(const i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return pa.create(n,{...this._def,...i})}exclude(n,i=this._def){return pa.create(this.options.filter(u=>!n.includes(u)),{...this._def,...i})}}Kl=new WeakMap;pa.create=Bm;class as extends oe{constructor(){super(...arguments),Yl.set(this,void 0)}_parse(n){const i=Te.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(n);if(u.parsedType!==V.string&&u.parsedType!==V.number){const c=Te.objectValues(i);return H(u,{expected:Te.joinValues(c),received:u.parsedType,code:z.invalid_type}),ae}if(Bu(this,Yl)||Dm(this,Yl,new Set(Te.getValidEnumValues(this._def.values))),!Bu(this,Yl).has(n.data)){const c=Te.objectValues(i);return H(u,{received:u.data,code:z.invalid_enum_value,options:c}),ae}return Et(n.data)}get enum(){return this._def.values}}Yl=new WeakMap;as.create=(s,n)=>new as({values:s,typeName:ne.ZodNativeEnum,...ue(n)});class qi extends oe{unwrap(){return this._def.type}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.promise&&i.common.async===!1)return H(i,{code:z.invalid_type,expected:V.promise,received:i.parsedType}),ae;const u=i.parsedType===V.promise?i.data:Promise.resolve(i.data);return Et(u.then(c=>this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})))}}qi.create=(s,n)=>new qi({type:s,typeName:ne.ZodPromise,...ue(n)});class un extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=this._def.effect||null,f={addIssue:h=>{H(u,h),h.fatal?i.abort():i.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){const h=c.transform(u.data,f);if(u.common.async)return Promise.resolve(h).then(async y=>{if(i.value==="aborted")return ae;const p=await this._def.schema._parseAsync({data:y,path:u.path,parent:u});return p.status==="aborted"?ae:p.status==="dirty"||i.value==="dirty"?Di(p.value):p});{if(i.value==="aborted")return ae;const y=this._def.schema._parseSync({data:h,path:u.path,parent:u});return y.status==="aborted"?ae:y.status==="dirty"||i.value==="dirty"?Di(y.value):y}}if(c.type==="refinement"){const h=y=>{const p=c.refinement(y,f);if(u.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(u.common.async===!1){const y=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value),{status:i.value,value:y.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(y=>y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value).then(()=>({status:i.value,value:y.value}))))}if(c.type==="transform")if(u.common.async===!1){const h=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ka(h))return h;const y=c.transform(h.value,f);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:y}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(h=>Ka(h)?Promise.resolve(c.transform(h.value,f)).then(y=>({status:i.value,value:y})):h);Te.assertNever(c)}}un.create=(s,n,i)=>new un({schema:s,typeName:ne.ZodEffects,effect:n,...ue(i)});un.createWithPreprocess=(s,n,i)=>new un({schema:n,effect:{type:"preprocess",transform:s},typeName:ne.ZodEffects,...ue(i)});class vn extends oe{_parse(n){return this._getType(n)===V.undefined?Et(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}vn.create=(s,n)=>new vn({innerType:s,typeName:ne.ZodOptional,...ue(n)});class ga extends oe{_parse(n){return this._getType(n)===V.null?Et(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ga.create=(s,n)=>new ga({innerType:s,typeName:ne.ZodNullable,...ue(n)});class is extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);let u=i.data;return i.parsedType===V.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}is.create=(s,n)=>new is({innerType:s,typeName:ne.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...ue(n)});class ls extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return Ql(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}ls.create=(s,n)=>new ls({innerType:s,typeName:ne.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...ue(n)});class Vu extends oe{_parse(n){if(this._getType(n)!==V.nan){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.nan,received:u.parsedType}),ae}return{status:"valid",value:n.data}}}Vu.create=s=>new Vu({typeName:ne.ZodNaN,...ue(s)});const z0=Symbol("zod_brand");class Wo extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=i.data;return this._def.type._parse({data:u,path:i.path,parent:i})}unwrap(){return this._def.type}}class fs extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?ae:f.status==="dirty"?(i.dirty(),Di(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const c=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return c.status==="aborted"?ae:c.status==="dirty"?(i.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:u.path,parent:u})}}static create(n,i){return new fs({in:n,out:i,typeName:ne.ZodPipeline})}}class ss extends oe{_parse(n){const i=this._def.innerType._parse(n),u=c=>(Ka(c)&&(c.value=Object.freeze(c.value)),c);return Ql(i)?i.then(c=>u(c)):u(i)}unwrap(){return this._def.innerType}}ss.create=(s,n)=>new ss({innerType:s,typeName:ne.ZodReadonly,...ue(n)});function lm(s,n){const i=typeof s=="function"?s(n):typeof s=="string"?{message:s}:s;return typeof i=="string"?{message:i}:i}function qm(s,n={},i){return s?Bi.create().superRefine((u,c)=>{var f,h;const y=s(u);if(y instanceof Promise)return y.then(p=>{var g,S;if(!p){const w=lm(n,u),C=(S=(g=w.fatal)!==null&&g!==void 0?g:i)!==null&&S!==void 0?S:!0;c.addIssue({code:"custom",...w,fatal:C})}});if(!y){const p=lm(n,u),g=(h=(f=p.fatal)!==null&&f!==void 0?f:i)!==null&&h!==void 0?h:!0;c.addIssue({code:"custom",...p,fatal:g})}}):Bi.create()}const U0={object:Ze.lazycreate};var ne;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(ne||(ne={}));const j0=(s,n={message:`Input not instance of ${s.name}`})=>qm(i=>i instanceof s,n),Zm=ln.create,Hm=ya.create,B0=Vu.create,q0=ma.create,Vm=Jl.create,Z0=Ya.create,H0=qu.create,V0=Fl.create,L0=Wl.create,K0=Bi.create,Y0=Va.create,G0=Ln.create,X0=Zu.create,$0=sn.create,Q0=Ze.create,J0=Ze.strictCreate,F0=Il.create,W0=Gu.create,I0=Pl.create,P0=Sn.create,e_=es.create,t_=Hu.create,n_=Ga.create,a_=zi.create,i_=ts.create,l_=ns.create,s_=pa.create,u_=as.create,r_=qi.create,sm=un.create,c_=vn.create,o_=ga.create,f_=un.createWithPreprocess,d_=fs.create,h_=()=>Zm().optional(),y_=()=>Hm().optional(),m_=()=>Vm().optional(),p_={string:s=>ln.create({...s,coerce:!0}),number:s=>ya.create({...s,coerce:!0}),boolean:s=>Jl.create({...s,coerce:!0}),bigint:s=>ma.create({...s,coerce:!0}),date:s=>Ya.create({...s,coerce:!0})},g_=ae;var xe=Object.freeze({__proto__:null,defaultErrorMap:ji,setErrorMap:f0,getErrorMap:Uu,makeIssue:ju,EMPTY_PATH:d0,addIssueToContext:H,ParseStatus:vt,INVALID:ae,DIRTY:Di,OK:Et,isAborted:Eo,isDirty:Ao,isValid:Ka,isAsync:Ql,get util(){return Te},get objectUtil(){return To},ZodParsedType:V,getParsedType:Vn,ZodType:oe,datetimeRegex:jm,ZodString:ln,ZodNumber:ya,ZodBigInt:ma,ZodBoolean:Jl,ZodDate:Ya,ZodSymbol:qu,ZodUndefined:Fl,ZodNull:Wl,ZodAny:Bi,ZodUnknown:Va,ZodNever:Ln,ZodVoid:Zu,ZodArray:sn,ZodObject:Ze,ZodUnion:Il,ZodDiscriminatedUnion:Gu,ZodIntersection:Pl,ZodTuple:Sn,ZodRecord:es,ZodMap:Hu,ZodSet:Ga,ZodFunction:zi,ZodLazy:ts,ZodLiteral:ns,ZodEnum:pa,ZodNativeEnum:as,ZodPromise:qi,ZodEffects:un,ZodTransformer:un,ZodOptional:vn,ZodNullable:ga,ZodDefault:is,ZodCatch:ls,ZodNaN:Vu,BRAND:z0,ZodBranded:Wo,ZodPipeline:fs,ZodReadonly:ss,custom:qm,Schema:oe,ZodSchema:oe,late:U0,get ZodFirstPartyTypeKind(){return ne},coerce:p_,any:K0,array:$0,bigint:q0,boolean:Vm,date:Z0,discriminatedUnion:W0,effect:sm,enum:s_,function:a_,instanceof:j0,intersection:I0,lazy:i_,literal:l_,map:t_,nan:B0,nativeEnum:u_,never:G0,null:L0,nullable:o_,number:Hm,object:Q0,oboolean:m_,onumber:y_,optional:c_,ostring:h_,pipeline:d_,preprocess:f_,promise:r_,record:e_,set:n_,strictObject:J0,string:Zm,symbol:H0,transformer:sm,tuple:P0,undefined:V0,union:F0,unknown:Y0,void:X0,NEVER:g_,ZodIssueCode:z,quotelessJson:o0,ZodError:jt});const Lm={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},ho=pm(Lm).map(([s])=>xe.literal(Number(s))),v_=xe.union([ho[0],ho[1],...ho]);xe.tuple([v_,xe.string()]);function b_(){return q.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",children:[q.jsx("title",{children:"Tempest Games Logo"}),q.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M202.91,7.86h-13.18v17.03h13.18v6.84h-13.18v22.24h13.18v6.84h-30.29V.93h30.29v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M289.49.93v59.89h-17.11V7.78h-.43c-8.21,0-11.21,5.82-11.21,17.03v36.02h-16.25V24.8c0-11.21-2.99-17.03-11.21-17.03h-.43v53.04h-17.11V.93h18.74c9.92,0,15.31,4.96,18.14,11.21,2.82-6.25,8.21-11.21,18.14-11.21h18.73Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M352.82,29.68c0,11.72-6.42,19.16-24.55,19.16h-4.53v11.98h-17.11V1.1l46.2-.17v28.75ZM323.73,7.78v34.22h2.48c7.36,0,9.5-4.11,9.5-12.15V7.78h-11.98Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M396.8,7.86h-13.17v17.03h13.17v6.84h-13.17v22.24h13.17v6.84h-30.28V.93h30.28v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M425.9,12.57v14.03h27.89v16.94c0,12.75-1.71,18.13-16.43,18.13h-14.54c-9.58,0-14.03-2.74-14.03-11.97v-5.99h15.4v5.13c0,4.53.77,5.99,4.62,5.99h1.71c5.05,0,6.16-1.46,6.16-6.84v-14.54h-27.89v-16.68c0-13.52,3.85-16.68,18.82-16.68h12.83c8.81,0,13.17,1.54,13.17,10.78v7.19h-15.4v-6.5c0-3.42-1.03-4.62-4.45-4.62h-1.45c-4.28,0-6.42,1.46-6.42,5.65Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M155.96,93.78v-3.57h-5.58v-7.14h13.39v17.85h-24.76v-28.56h24.76v7.14h-16.96v14.28h9.15Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M224.26,100.92h-8.25v-10.71h-8.25v3.57h4.68v7.14h-12.94v-17.85h16.51v-3.57h-16.51v-7.14h24.76v28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M259.99,72.36h30.57v28.56h-7.81v-21.42h-3.57v21.42h-7.81v-21.42h-3.57v21.42h-7.81v-28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M343.24,83.08v-3.57h-9.14v14.28h16.96v7.14h-24.76v-28.56h24.76v17.85h-13.38v-7.14h5.57Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M394.59,79.5v3.57h16.96v17.85h-24.76v-7.14h16.96v-3.57h-16.96v-17.85h24.76v7.14h-16.96Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.jsx("path",{d:"M0,63.42v-20.84h20.83L0,63.42ZM100,.92v32.29h-35.42v8.33h-8.33V14.46h-22.92l1.04,7.29h9.38v19.79h-8.33v-8.33H0V.92h100ZM0,100.92v-26.04l6.25-1.04,25-26.04,1.04,1.05-10.42,18.75-4.16,7.29h13.54l3.13-3.12,8.33-22.92h1.04v41.66h3.12l9.38-8.33v-33.33h1.04l8.33,22.92,3.12,3.12h13.54l-4.17-7.29-10.42-19.8,1.04-1.04,25,27.09,6.25,1.04v26.04H0ZM100,42.59v20.84l-20.83-20.84h20.83Z",style:{fill:"var(--logo-color)",strokeWidth:0}})]})}function Xu(s){return q.jsx("a",{...s})}const __={class:"_class_wtkls_1"};function S_(s){return["required",s]}function T_(s){return["optional",s]}function E_(s,n){let i=s;for(const u of n){if(i===null||typeof u!="string")return!1;const c=i[1];if(u in c)i=c[u];else{const f=Object.keys(c).find(h=>h.startsWith("$"));if(f){i=c[f];continue}return!1}}if(i===null)return!0;switch(i[0]){case"required":return!1;case"optional":return!0}}const Tn=Object.create(null);Tn.open="0";Tn.close="1";Tn.ping="2";Tn.pong="3";Tn.message="4";Tn.upgrade="5";Tn.noop="6";const Mu=Object.create(null);Object.keys(Tn).forEach(s=>{Mu[Tn[s]]=s});const wo={type:"error",data:"parser error"},Km=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ym=typeof ArrayBuffer=="function",Gm=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Io=({type:s,data:n},i,u)=>Km&&n instanceof Blob?i?u(n):um(n,u):Ym&&(n instanceof ArrayBuffer||Gm(n))?i?u(n):um(new Blob([n]),u):u(Tn[s]+(n||"")),um=(s,n)=>{const i=new FileReader;return i.onload=function(){const u=i.result.split(",")[1];n("b"+(u||""))},i.readAsDataURL(s)};function rm(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let yo;function A_(s,n){if(Km&&s.data instanceof Blob)return s.data.arrayBuffer().then(rm).then(n);if(Ym&&(s.data instanceof ArrayBuffer||Gm(s.data)))return n(rm(s.data));Io(s,!1,i=>{yo||(yo=new TextEncoder),n(yo.encode(i))})}const cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<cm.length;s++)Gl[cm.charCodeAt(s)]=s;const O_=s=>{let n=s.length*.75,i=s.length,u,c=0,f,h,y,p;s[s.length-1]==="="&&(n--,s[s.length-2]==="="&&n--);const g=new ArrayBuffer(n),S=new Uint8Array(g);for(u=0;u<i;u+=4)f=Gl[s.charCodeAt(u)],h=Gl[s.charCodeAt(u+1)],y=Gl[s.charCodeAt(u+2)],p=Gl[s.charCodeAt(u+3)],S[c++]=f<<2|h>>4,S[c++]=(h&15)<<4|y>>2,S[c++]=(y&3)<<6|p&63;return g},w_=typeof ArrayBuffer=="function",Po=(s,n)=>{if(typeof s!="string")return{type:"message",data:Xm(s,n)};const i=s.charAt(0);return i==="b"?{type:"message",data:R_(s.substring(1),n)}:Mu[i]?s.length>1?{type:Mu[i],data:s.substring(1)}:{type:Mu[i]}:wo},R_=(s,n)=>{if(w_){const i=O_(s);return Xm(i,n)}else return{base64:!0,data:s}},Xm=(s,n)=>{switch(n){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},$m="",x_=(s,n)=>{const i=s.length,u=new Array(i);let c=0;s.forEach((f,h)=>{Io(f,!1,y=>{u[h]=y,++c===i&&n(u.join($m))})})},k_=(s,n)=>{const i=s.split($m),u=[];for(let c=0;c<i.length;c++){const f=Po(i[c],n);if(u.push(f),f.type==="error")break}return u};function M_(){return new TransformStream({transform(s,n){A_(s,i=>{const u=i.length;let c;if(u<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,u);else if(u<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,u)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(u))}s.data&&typeof s.data!="string"&&(c[0]|=128),n.enqueue(c),n.enqueue(i)})}})}let mo;function Ru(s){return s.reduce((n,i)=>n+i.length,0)}function xu(s,n){if(s[0].length===n)return s.shift();const i=new Uint8Array(n);let u=0;for(let c=0;c<n;c++)i[c]=s[0][u++],u===s[0].length&&(s.shift(),u=0);return s.length&&u<s[0].length&&(s[0]=s[0].slice(u)),i}function N_(s,n){mo||(mo=new TextDecoder);const i=[];let u=0,c=-1,f=!1;return new TransformStream({transform(h,y){for(i.push(h);;){if(u===0){if(Ru(i)<1)break;const p=xu(i,1);f=(p[0]&128)===128,c=p[0]&127,c<126?u=3:c===126?u=1:u=2}else if(u===1){if(Ru(i)<2)break;const p=xu(i,2);c=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),u=3}else if(u===2){if(Ru(i)<8)break;const p=xu(i,8),g=new DataView(p.buffer,p.byteOffset,p.length),S=g.getUint32(0);if(S>Math.pow(2,21)-1){y.enqueue(wo);break}c=S*Math.pow(2,32)+g.getUint32(4),u=3}else{if(Ru(i)<c)break;const p=xu(i,c);y.enqueue(Po(f?p:mo.decode(p),n)),u=0}if(c===0||c>s){y.enqueue(wo);break}}}})}const Qm=4;function Pe(s){if(s)return C_(s)}function C_(s){for(var n in Pe.prototype)s[n]=Pe.prototype[n];return s}Pe.prototype.on=Pe.prototype.addEventListener=function(s,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(n),this};Pe.prototype.once=function(s,n){function i(){this.off(s,i),n.apply(this,arguments)}return i.fn=n,this.on(s,i),this};Pe.prototype.off=Pe.prototype.removeListener=Pe.prototype.removeAllListeners=Pe.prototype.removeEventListener=function(s,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var u,c=0;c<i.length;c++)if(u=i[c],u===n||u.fn===n){i.splice(c,1);break}return i.length===0&&delete this._callbacks["$"+s],this};Pe.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),i=this._callbacks["$"+s],u=1;u<arguments.length;u++)n[u-1]=arguments[u];if(i){i=i.slice(0);for(var u=0,c=i.length;u<c;++u)i[u].apply(this,n)}return this};Pe.prototype.emitReserved=Pe.prototype.emit;Pe.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Pe.prototype.hasListeners=function(s){return!!this.listeners(s).length};const $u=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,i)=>i(n,0),Ft=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),D_="arraybuffer";function Jm(s,...n){return n.reduce((i,u)=>(s.hasOwnProperty(u)&&(i[u]=s[u]),i),{})}const z_=Ft.setTimeout,U_=Ft.clearTimeout;function Qu(s,n){n.useNativeTimers?(s.setTimeoutFn=z_.bind(Ft),s.clearTimeoutFn=U_.bind(Ft)):(s.setTimeoutFn=Ft.setTimeout.bind(Ft),s.clearTimeoutFn=Ft.clearTimeout.bind(Ft))}const j_=1.33;function B_(s){return typeof s=="string"?q_(s):Math.ceil((s.byteLength||s.size)*j_)}function q_(s){let n=0,i=0;for(let u=0,c=s.length;u<c;u++)n=s.charCodeAt(u),n<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(u++,i+=4);return i}function Fm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Z_(s){let n="";for(let i in s)s.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return n}function H_(s){let n={},i=s.split("&");for(let u=0,c=i.length;u<c;u++){let f=i[u].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class V_ extends Error{constructor(n,i,u){super(n),this.description=i,this.context=u,this.type="TransportError"}}class ef extends Pe{constructor(n){super(),this.writable=!1,Qu(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,i,u){return super.emitReserved("error",new V_(n,i,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const i=Po(n,this.socket.binaryType);this.onPacket(i)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,i={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const i=Z_(n);return i.length?"?"+i:""}}class L_ extends ef{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const i=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||i()})),this.writable||(u++,this.once("drain",function(){--u||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};k_(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,x_(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Fm()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let Wm=!1;try{Wm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const K_=Wm;function Y_(){}class G_ extends L_{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let u=location.port;u||(u=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||u!==n.port}}doWrite(n,i){const u=this.request({method:"POST",data:n});u.on("success",i),u.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,u)=>{this.onError("xhr poll error",i,u)}),this.pollXhr=n}}class bn extends Pe{constructor(n,i,u){super(),this.createRequest=n,Qu(this,u),this._opts=u,this._method=u.method||"GET",this._uri=i,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var n;const i=Jm(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(i);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&u.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var c;u.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=bn.requestsCount++,bn.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Y_,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete bn.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}bn.requestsCount=0;bn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",om);else if(typeof addEventListener=="function"){const s="onpagehide"in Ft?"pagehide":"unload";addEventListener(s,om,!1)}}function om(){for(let s in bn.requests)bn.requests.hasOwnProperty(s)&&bn.requests[s].abort()}const X_=function(){const s=Im({xdomain:!1});return s&&s.responseType!==null}();class $_ extends G_{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=X_&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new bn(Im,this.uri(),n)}}function Im(s){const n=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||K_))return new XMLHttpRequest}catch{}if(!n)try{return new Ft[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pm=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Q_ extends ef{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,u=Pm?{}:Jm(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,u)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;Io(u,this.supportsBinary,f=>{try{this.doWrite(u,f)}catch{}c&&$u(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Fm()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const po=Ft.WebSocket||Ft.MozWebSocket;class J_ extends Q_{createSocket(n,i,u){return Pm?new po(n,i,u):i?new po(n,i):new po(n)}doWrite(n,i){this.ws.send(i)}}class F_ extends ef{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=N_(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=n.readable.pipeThrough(i).getReader(),c=M_();c.readable.pipeTo(n.writable),this._writer=c.writable.getWriter();const f=()=>{u.read().then(({done:y,value:p})=>{y||(this.onPacket(p),f())}).catch(y=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;this._writer.write(u).then(()=>{c&&$u(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const W_={websocket:J_,webtransport:F_,polling:$_},I_=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,P_=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ro(s){if(s.length>8e3)throw"URI too long";const n=s,i=s.indexOf("["),u=s.indexOf("]");i!=-1&&u!=-1&&(s=s.substring(0,i)+s.substring(i,u).replace(/:/g,";")+s.substring(u,s.length));let c=I_.exec(s||""),f={},h=14;for(;h--;)f[P_[h]]=c[h]||"";return i!=-1&&u!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=e1(f,f.path),f.queryKey=t1(f,f.query),f}function e1(s,n){const i=/\/{2,9}/g,u=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&u.splice(0,1),n.slice(-1)=="/"&&u.splice(u.length-1,1),u}function t1(s,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,f){c&&(i[c]=f)}),i}const xo=typeof addEventListener=="function"&&typeof removeEventListener=="function",Nu=[];xo&&addEventListener("offline",()=>{Nu.forEach(s=>s())},!1);class ha extends Pe{constructor(n,i){if(super(),this.binaryType=D_,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const u=Ro(n);i.hostname=u.host,i.secure=u.protocol==="https"||u.protocol==="wss",i.port=u.port,u.query&&(i.query=u.query)}else i.host&&(i.hostname=Ro(i.host).host);Qu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(u=>{const c=u.prototype.name;this.transports.push(c),this._transportsByName[c]=u}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=H_(this.opts.query)),xo&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Nu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=Qm,i.transport=n,this.id&&(i.sid=this.id);const u=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&ha.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ha.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let u=0;u<this.writeBuffer.length;u++){const c=this.writeBuffer[u].data;if(c&&(i+=B_(c)),u>0&&i>this._maxPayload)return this.writeBuffer.slice(0,u);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,$u(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,u){return this._sendPacket("message",n,i,u),this}send(n,i,u){return this._sendPacket("message",n,i,u),this}_sendPacket(n,i,u,c){if(typeof i=="function"&&(c=i,i=void 0),typeof u=="function"&&(c=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const f={type:n,data:i,options:u};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},u=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():n()}):this.upgrading?u():n()),this}_onError(n){if(ha.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),xo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=Nu.indexOf(this._offlineEventListener);u!==-1&&Nu.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}ha.protocol=Qm;class n1 extends ha{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let i=this.createTransport(n),u=!1;ha.priorWebsocketSuccess=!1;const c=()=>{u||(i.send([{type:"ping",data:"probe"}]),i.once("packet",w=>{if(!u)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ha.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(S(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const C=new Error("probe error");C.transport=i.name,this.emitReserved("upgradeError",C)}}))};function f(){u||(u=!0,S(),i.close(),i=null)}const h=w=>{const C=new Error("probe error: "+w);C.transport=i.name,f(),this.emitReserved("upgradeError",C)};function y(){h("transport closed")}function p(){h("socket closed")}function g(w){i&&w.name!==i.name&&f()}const S=()=>{i.removeListener("open",c),i.removeListener("error",h),i.removeListener("close",y),this.off("close",p),this.off("upgrading",g)};i.once("open",c),i.once("error",h),i.once("close",y),this.once("close",p),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{u||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let u=0;u<n.length;u++)~this.transports.indexOf(n[u])&&i.push(n[u]);return i}}let a1=class extends n1{constructor(n,i={}){const u=typeof n=="object"?n:i;(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(c=>W_[c]).filter(c=>!!c)),super(n,u)}};function i1(s,n="",i){let u=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),u=Ro(s)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const f=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+f+":"+u.port+n,u.href=u.protocol+"://"+f+(i&&i.port===u.port?"":":"+u.port),u}const l1=typeof ArrayBuffer=="function",s1=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,ep=Object.prototype.toString,u1=typeof Blob=="function"||typeof Blob<"u"&&ep.call(Blob)==="[object BlobConstructor]",r1=typeof File=="function"||typeof File<"u"&&ep.call(File)==="[object FileConstructor]";function tf(s){return l1&&(s instanceof ArrayBuffer||s1(s))||u1&&s instanceof Blob||r1&&s instanceof File}function Cu(s,n){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,u=s.length;i<u;i++)if(Cu(s[i]))return!0;return!1}if(tf(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Cu(s.toJSON(),!0);for(const i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&Cu(s[i]))return!0;return!1}function c1(s){const n=[],i=s.data,u=s;return u.data=ko(i,n),u.attachments=n.length,{packet:u,buffers:n}}function ko(s,n){if(!s)return s;if(tf(s)){const i={_placeholder:!0,num:n.length};return n.push(s),i}else if(Array.isArray(s)){const i=new Array(s.length);for(let u=0;u<s.length;u++)i[u]=ko(s[u],n);return i}else if(typeof s=="object"&&!(s instanceof Date)){const i={};for(const u in s)Object.prototype.hasOwnProperty.call(s,u)&&(i[u]=ko(s[u],n));return i}return s}function o1(s,n){return s.data=Mo(s.data,n),delete s.attachments,s}function Mo(s,n){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<n.length)return n[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mo(s[i],n);else if(typeof s=="object")for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mo(s[i],n));return s}const f1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],d1=5;var be;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(be||(be={}));class h1{constructor(n){this.replacer=n}encode(n){return(n.type===be.EVENT||n.type===be.ACK)&&Cu(n)?this.encodeAsBinary({type:n.type===be.EVENT?be.BINARY_EVENT:be.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;return(n.type===be.BINARY_EVENT||n.type===be.BINARY_ACK)&&(i+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(i+=n.nsp+","),n.id!=null&&(i+=n.id),n.data!=null&&(i+=JSON.stringify(n.data,this.replacer)),i}encodeAsBinary(n){const i=c1(n),u=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(u),c}}function fm(s){return Object.prototype.toString.call(s)==="[object Object]"}class nf extends Pe{constructor(n){super(),this.reviver=n}add(n){let i;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);const u=i.type===be.BINARY_EVENT;u||i.type===be.BINARY_ACK?(i.type=u?be.EVENT:be.ACK,this.reconstructor=new y1(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(tf(n)||n.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(n),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let i=0;const u={type:Number(n.charAt(0))};if(be[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===be.BINARY_EVENT||u.type===be.BINARY_ACK){const f=i+1;for(;n.charAt(++i)!=="-"&&i!=n.length;);const h=n.substring(f,i);if(h!=Number(h)||n.charAt(i)!=="-")throw new Error("Illegal attachments");u.attachments=Number(h)}if(n.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););u.nsp=n.substring(f,i)}else u.nsp="/";const c=n.charAt(i+1);if(c!==""&&Number(c)==c){const f=i+1;for(;++i;){const h=n.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===n.length)break}u.id=Number(n.substring(f,i+1))}if(n.charAt(++i)){const f=this.tryParse(n.substr(i));if(nf.isPayloadValid(u.type,f))u.data=f;else throw new Error("invalid payload")}return u}tryParse(n){try{return JSON.parse(n,this.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case be.CONNECT:return fm(i);case be.DISCONNECT:return i===void 0;case be.CONNECT_ERROR:return typeof i=="string"||fm(i);case be.EVENT:case be.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&f1.indexOf(i[0])===-1);case be.ACK:case be.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class y1{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=o1(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const m1=Object.freeze(Object.defineProperty({__proto__:null,Decoder:nf,Encoder:h1,get PacketType(){return be},protocol:d1},Symbol.toStringTag,{value:"Module"}));function an(s,n,i){return s.on(n,i),function(){s.off(n,i)}}const p1=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tp extends Pe{constructor(n,i,u){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=i,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[an(n,"open",this.onopen.bind(this)),an(n,"packet",this.onpacket.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var u,c,f;if(p1.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:be.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const S=this.ids++,w=i.pop();this._registerAckCallback(S,w),h.id=S}const y=(c=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||c===void 0?void 0:c.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!y||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(n,i){var u;const c=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(c===void 0){this.acks[n]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let y=0;y<this.sendBuffer.length;y++)this.sendBuffer[y].id===n&&this.sendBuffer.splice(y,1);i.call(this,new Error("operation has timed out"))},c),h=(...y)=>{this.io.clearTimeoutFn(f),i.apply(this,y)};h.withError=!0,this.acks[n]=h}emitWithAck(n,...i){return new Promise((u,c)=>{const f=(h,y)=>h?c(h):u(y);f.withError=!0,i.push(f),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((c,...f)=>u!==this._queue[0]?void 0:(c!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(c)):(this._queue.shift(),i&&i(null,...f)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(u=>String(u.id)===n)){const u=this.acks[n];delete this.acks[n],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case be.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case be.EVENT:case be.BINARY_EVENT:this.onevent(n);break;case be.ACK:case be.BINARY_ACK:this.onack(n);break;case be.DISCONNECT:this.ondisconnect();break;case be.CONNECT_ERROR:this.destroy();const u=new Error(n.data.message);u.data=n.data.data,this.emitReserved("connect_error",u);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const u of i)u.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let u=!1;return function(...c){u||(u=!0,i.packet({type:be.ACK,id:n,data:c}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const i=this._anyOutgoingListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const u of i)u.apply(this,n.data)}}}function Li(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Li.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*s);s=(Math.floor(n*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};Li.prototype.reset=function(){this.attempts=0};Li.prototype.setMin=function(s){this.ms=s};Li.prototype.setMax=function(s){this.max=s};Li.prototype.setJitter=function(s){this.jitter=s};class No extends Pe{constructor(n,i){var u;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Qu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((u=i.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new Li({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const c=i.parser||m1;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new a1(this.uri,this.opts);const i=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const c=an(i,"open",function(){u.onopen(),n&&n()}),f=y=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",y),n?n(y):this.maybeReconnectOnOpen()},h=an(i,"error",f);if(this._timeout!==!1){const y=this._timeout,p=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),i.close()},y);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(c),this.subs.push(h),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(an(n,"ping",this.onping.bind(this)),an(n,"data",this.ondata.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"close",this.onclose.bind(this)),an(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){$u(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let u=this.nsps[n];return u?this._autoConnect&&!u.active&&u.connect():(u=new tp(this,n,i),this.nsps[n]=u),u}_destroy(n){const i=Object.keys(this.nsps);for(const u of i)if(this.nsps[u].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let u=0;u<i.length;u++)this.engine.write(i[u],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(c=>{c?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",c)):n.onreconnect()}))},i);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Ll={};function Du(s,n){typeof s=="object"&&(n=s,s=void 0),n=n||{};const i=i1(s,n.path||"/socket.io"),u=i.source,c=i.id,f=i.path,h=Ll[c]&&f in Ll[c].nsps,y=n.forceNew||n["force new connection"]||n.multiplex===!1||h;let p;return y?p=new No(u,n):(Ll[c]||(Ll[c]=new No(u,n)),p=Ll[c]),i.query&&!n.query&&(n.query=i.queryKey),p.socket(i.path,n)}Object.assign(Du,{Manager:No,Socket:tp,io:Du,connect:Du});const g1=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"],v1=3,b1=15,_1=/^[a-zA-Z0-9_-]+$/,af=xe.string().min(v1).max(b1).regex(_1),dm=20,hm={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function S1(s){let n="";for(const i of s)i in hm?n+=hm[i]:n+=i;return n}function T1(s){const n=s.toLocaleLowerCase(),i=S1(n);for(const u of g1)if(i.includes(u)||n.includes(u))return!0;return!1}function E1(s){const n=new Set(s).size;return s.length*Math.log2(n)}function A1(s){let n=0;return T1(s)&&(n-=100),n+=E1(s)*.5,Math.max(n,0)}const lf=xe.string().refine(s=>A1(s)>=dm,{message:`Password does not meet the minimum complexity of ${dm}.`}).brand("password");xe.object({username:af,password:lf}).strict();const np=xe.string().email().brand("email");xe.object({username:af,password:lf,email:np}).strict();var O1={};function w1(s,n){const i={},u=[];for(const c in s){const f=s[c],h=n[c],y=f["~standard"].validate(h);if(y instanceof Promise)throw new Error(`Validation must be synchronous, but ${c} returned a Promise.`);if(y.issues){u.push(...y.issues.map(p=>({...p,path:[c,...p.path??[]]})));continue}i[c]=y.value}return u.length?{issues:u}:{value:i}}function R1(s){const n=s.runtimeEnvStrict??s.runtimeEnv??O1;for(const[de,he]of Object.entries(n))he===""&&delete n[de];if(!!s.skipValidation)return n;const u=typeof s.client=="object"?s.client:{},c=typeof s.server=="object"?s.server:{},f=typeof s.shared=="object"?s.shared:{},h=s.isServer??(typeof window>"u"||"Deno"in window),y=h?{...c,...f,...u}:{...u,...f},p=w1(y,n),g=s.onValidationError??(de=>{throw console.error("❌ Invalid environment variables:",de),new Error("Invalid environment variables")}),S=s.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return g(p.issues);const w=de=>s.clientPrefix?!de.startsWith(s.clientPrefix)&&!(de in f):!0,C=de=>h||!w(de),U=de=>de==="__esModule"||de==="$$typeof",Q=(s.extends??[]).reduce((de,he)=>Object.assign(de,he),{}),L=Object.assign(p.value,Q);return new Proxy(L,{get(de,he){if(typeof he=="string"&&!U(he))return C(he)?Reflect.get(de,he):S(he)}})}const x1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},k1="__vite_start_time"in globalThis,M1=typeof window<"u",sf=R1({isServer:!k1&&!M1,server:{CI:xe.string().transform(s=>!0).optional(),POSTGRES_USER:xe.string(),POSTGRES_PASSWORD:xe.string(),POSTGRES_DATABASE:xe.string(),POSTGRES_HOST:xe.string(),POSTGRES_PORT:xe.string().transform(s=>Number.parseInt(s,10)),BACKEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),RUN_WORKERS_FROM_SOURCE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true"),FRONTEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),FRONTEND_ORIGINS:xe.string().transform(s=>JSON.parse(s)).pipe(xe.array(xe.string())),OPENAI_API_KEY:xe.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:xe.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true")},runtimeEnv:x1,emptyStringAsUndefined:!0}),uf=Du(sf.VITE_BACKEND_ORIGIN,{auth:s=>{const n=vo(Zi);n&&s(n)},autoConnect:!1}).on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),Bo(Zi,null)}),Zi=Bt({key:"auth",default:null,effects:[({onSet:s})=>{s(({newValue:n})=>{n?(localStorage.setItem("username",n.username),localStorage.setItem("sessionKey",n.sessionKey),console.log("connecting..."),uf.connect()):(console.log("clearing session..."),localStorage.removeItem("sessionKey"))})},({setSelf:s})=>{const n=localStorage.getItem("username"),i=localStorage.getItem("sessionKey");n&&i&&s({username:n,sessionKey:i})}]}),us=Bt({key:"username",default:window.localStorage.getItem("username")??""}),ap=Xa({key:"usernameIssues",get:({get:s})=>{const n=s(us),i=af.safeParse(n);return i.success?null:i.error.issues}}),Hi=Bt({key:"password0",default:""}),ip=Xa({key:"password0Issues",get:({get:s})=>{const n=s(Hi),i=lf.safeParse(n);return i.success?null:i.error.issues}}),Co=Bt({key:"password1",default:""}),lp=Xa({key:"password1Issues",get:({get:s})=>{const n=s(Hi),i=s(Co),u=xe.string().refine(c=>c===n,{message:"Passwords do not match."}).safeParse(i);return u.success?null:u.error.issues}}),Do=Bt({key:"email",default:""}),sp=Xa({key:"emailIssues",get:({get:s})=>{const n=s(Do),i=np.safeParse(n);return i.success?null:i.error.issues}}),N1=Xa({key:"signupReady",get:({get:s})=>{const n=s(ap),i=s(ip),u=s(lp),c=s(sp);return!(n??i??u??c)}}),up=S_({login:null,sign_up:null,game:T_({clicker:null}),admin:null});function C1(s){return E_(up,s)}const D1=[["login"],["sign_up"]];function z1(s){return D1.some(n=>n.join("/")===s.join("/"))}function rp(s){history.pushState(null,"",s),Bo(cp,s)}const cp=Bt({key:"pathName",default:window.location.pathname,effects:[({onSet:s,setSelf:n})=>{const i=c=>{history.replaceState(null,"",c),n(c)},u=c=>{switch(c){case"/":{const f=vo(Zi);let h="/login";f&&(h="/game"),i(h);break}case"/login":case"/sign_up":{vo(Zi)&&i("/game");break}}};u(window.location.pathname),s(({newValue:c})=>{u(c)})},({setSelf:s})=>{document.addEventListener("click",n=>{const i=n.target.closest("a");if(i&&i instanceof HTMLAnchorElement){const u=i.getAttribute("href");u!=null&&u.startsWith("/")&&(n.preventDefault(),history.pushState(null,"",u),s(u))}}),window.addEventListener("popstate",()=>{s(window.location.pathname)})}]}),U1=Xa({key:"route",get:({get:s})=>{const i=s(cp).split("/").slice(1);return C1(i)?z1(i)||s(Zi)?i:401:404}});function j1(){return q.jsx("article",{children:q.jsx("h1",{children:"admin"})})}class B1 extends Map{set(n,i){return this.has(n)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this):super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Xl=class Xl{constructor(n){j(this,"type","continuity");j(this,"globals",[]);j(this,"actions",[]);j(this,"perspectives",[]);j(this,"key");this.key=n}static create(n,i){const u=new Xl(n),{type:c,globals:f,actions:h,perspectives:y}=i(u),p={type:c,key:n,globals:f,actions:h,perspectives:y};return Xl.existing.set(n,p),p}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{const[u,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:u,viewAtoms:c})}break}return this}};j(Xl,"existing",new B1);let zo=Xl;function q1(s){const{key:n,config:i}=s,u=zo.create(n,i),{actions:c}=u;for(const f of c)_m(et.STORE,n,f.key);return Vo(et.STORE,n,-1),u}Bt({key:"usersInRoomIndex",mutable:!0,default:()=>new gn,toJson:s=>s.toJSON(),fromJson:s=>gn.fromJSON(s)});Bt({key:"roomIndex",default:()=>new gn,mutable:!0,toJson:s=>s.toJSON(),fromJson:s=>gn.fromJSON(s)});const Z1={enteredAtEpoch:0},H1=Kv({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:s=>typeof s=="string",isBType:s=>typeof s=="string"},Z1);Jv({key:"usersInMyRoomView",get:s=>({find:n})=>{const i=Yv(H1);return[n(i,s)]}});const rf=Bt({key:"count",default:0}),op=_b({key:"incrementTX",do:({set:s})=>{s(rf,n=>n+1)}}),V1=q1({key:"countContinuity",config:s=>s.add(rf).add(op)});function L1({route:[s]}){return q.jsx("article",{children:s?q.jsx(Y1,{gameId:s}):q.jsx(K1,{})})}function K1(){return q.jsx("nav",{children:q.jsx(Xu,{href:"/game/clicker",children:"Clicker"})})}pm(up[1].game[1]);function Y1({gameId:s}){console.log(s);const n=Ut(rf),i=Sb(op);return n0(V1),q.jsxs("article",{children:[q.jsxs("button",{type:"button",onClick:()=>{i()},children:["count is ",n]}),q.jsx("p",{children:"Let's see how high we can count!"})]})}async function G1(s,n="SHA-256"){const u=new TextEncoder().encode(s),c=await crypto.subtle.digest(n,u);return Array.from(new Uint8Array(c)).map(h=>h.toString(16).padStart(2,"0")).join("")}async function fp(s){const n=await G1(s);return`${n.substring(0,8)}-${n.substring(8,12)}-${n.substring(12,16)}-${n.substring(16,20)}-${n.substring(20,32)}`}function X1(){const s=Ha(us),n=Ha(Hi),i=Ut(us),u=Ut(Hi),[c,f]=dt.useState(null);return q.jsxs("form",{onSubmit:async h=>{h.preventDefault();const y=await fp("login"),p=await fetch(`${sf.VITE_BACKEND_ORIGIN}/login-${y}`,{method:"POST",body:JSON.stringify({username:i,password:u})});if(console.log(p),p.status===200){s(""),n("");const g=await p.text(),[,S]=g.split(" ");Bo(Zi,{username:i,sessionKey:S}),uf.once("connect",()=>{rp("/game")})}if(p.status>=400){const g=await p.text();f(g)}},children:[q.jsxs("main",{children:[c?q.jsx("aside",{children:c}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:i,onChange:h=>{s(h.target.value)},autoComplete:"username",autoCapitalize:"none"})]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password",type:"password",value:u,onChange:h=>{n(h.target.value)},autoComplete:"current-password",autoCapitalize:"none"})]}),q.jsx("button",{type:"submit",disabled:!i||!u,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Xu,{href:"/sign_up",children:["New here? ",q.jsx("u",{children:"Sign up"})," for an account."]})})]})}function $1(){const s=Ha(us),n=Ha(Hi),i=Ha(Co),u=Ha(Do),c=Ut(us),f=Ut(Hi),h=Ut(Co),y=Ut(Do),p=Ut(ap),g=Ut(ip),S=Ut(lp),w=Ut(sp),C=Ut(N1),[U,Q]=dt.useState(null);return q.jsxs("form",{onSubmit:async L=>{L.preventDefault();const fe=f,de=await fp("sign-up"),he=await fetch(`${sf.VITE_BACKEND_ORIGIN}/sign-up-${de}`,{method:"POST",body:JSON.stringify({username:c,password:fe,email:y})});if(he.status===201&&(i(""),u(""),rp("/login")),he.status>=400){const Ye=await he.text();Q(Ye)}},children:[q.jsxs("main",{children:[U?q.jsx("aside",{children:U}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:c,onChange:L=>{s(L.target.value)},autoComplete:"username",autoCapitalize:"none",style:{"--energy-color":c?p?"red":"green":void 0}}),c&&p?q.jsx("aside",{children:p.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password0",type:"password",value:f,onChange:L=>{n(L.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":f?g?"red":"green":void 0}}),f&&g?q.jsx("aside",{children:g.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Confirm Password"}),q.jsx("input",{id:"password1",type:"password",value:h,onChange:L=>{i(L.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":h?S?"red":"green":void 0}}),h&&S?q.jsx("aside",{children:S.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"email",children:[q.jsx("span",{children:"Email"}),q.jsx("input",{id:"email",type:"email",value:y,onChange:L=>{u(L.target.value)},autoComplete:"email",autoCapitalize:"none",style:{"--energy-color":y?w?"red":"green":void 0}}),y&&w?q.jsx("aside",{children:w.map(L=>q.jsx("span",{children:L.message},L.path.join(".")))}):null]}),q.jsx("button",{type:"submit",disabled:!C,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Xu,{href:"/login",children:["Already have an account? ",q.jsx("u",{children:"Log in"})," instead."]})})]})}function Q1(){const s=Ut(U1);return q.jsxs("main",{className:__.class,children:[q.jsx("header",{children:q.jsx(b_,{})}),q.jsx("main",{children:typeof s=="number"?q.jsxs("article",{children:[q.jsx("h1",{children:s}),q.jsx("h2",{children:Lm[s]}),q.jsx(Xu,{href:"/login",children:"Return to Home Page"})]}):(()=>{const[n,...i]=s;switch(n){case"admin":return q.jsx(j1,{});case"login":return q.jsx(X1,{});case"sign_up":return q.jsx($1,{});case"game":return q.jsx(L1,{route:i})}})()})]})}c0.createRoot(document.getElementById("root")).render(q.jsx(dt.StrictMode,{children:q.jsx(Fb,{socket:uf,children:q.jsx(Q1,{})})}));
|