@clicktap/state 0.11.2 → 0.11.3
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/index.js +69 -0
- package/index.mjs +6258 -0
- package/package.json +10 -5
- package/{src/toast → toast}/ToastProvider.d.ts +4 -4
- package/{src/toast → toast}/toast.d.ts +2 -2
- package/README.md +0 -9
- package/index.esm.d.ts +0 -1
- package/index.esm.js +0 -1007
- package/src/helpers/request.d.ts +0 -2
- package/src/quote/actions/addItems.d.ts +0 -8
- package/src/quote/actions/index.d.ts +0 -2
- package/src/quote/actions/removeItems.d.ts +0 -8
- package/src/quote/actors/addItems.d.ts +0 -7
- package/src/quote/actors/index.d.ts +0 -3
- package/src/quote/actors/refresh.d.ts +0 -6
- package/src/quote/actors/removeItems.d.ts +0 -7
- package/src/quote/guards/hasItems.d.ts +0 -5
- package/src/quote/guards/index.d.ts +0 -1
- package/src/quote/quote.d.ts +0 -113
- package/src/quote/types.d.ts +0 -135
- /package/{src/auth → auth}/AuthProvider.d.ts +0 -0
- /package/{src/auth → auth}/auth.d.ts +0 -0
- /package/{src/index.d.ts → index.d.ts} +0 -0
- /package/{src/toast → toast}/timer.d.ts +0 -0
- /package/{src/toast → toast}/types.d.ts +0 -0
package/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ko(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function xo(){const e=ko();if(e.__xstate__)return e.__xstate__}const Po=e=>{if(typeof window>"u")return;const t=xo();t&&t.register(e)};class Nr{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const ps=".",Io="",ys="",jo="#",Do="*",ms="xstate.init",$o="xstate.error",Tt="xstate.stop";function Fo(e,t){return{type:`xstate.after.${e}.${t}`}}function Ln(e,t){return{type:`xstate.done.state.${e}`,output:t}}function Mo(e,t){return{type:`xstate.done.actor.${e}`,output:t}}function vs(e,t){return{type:`xstate.error.actor.${e}`,error:t}}function gs(e){return{type:ms,input:e}}function Oe(e){setTimeout(()=>{throw e})}const No=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Ur(e,t){return`${e.sessionId}.${t}`}let Uo=0;function Lo(e,t){const n=new Map,r=new Map,s=new WeakMap,i=new Set,a={},c=t.clock,h={schedule:(d,m,E,w,b=Math.random().toString(36).slice(2))=>{const O={source:d,target:m,event:E,delay:w,id:b,startedAt:Date.now()},j=Ur(d,b);l._snapshot._scheduledEvents[j]=O;const J=c.setTimeout(()=>{delete a[j],delete l._snapshot._scheduledEvents[j],l._relay(d,m,E)},w);a[j]=J},cancel:(d,m)=>{const E=Ur(d,m),w=a[E];delete a[E],delete l._snapshot._scheduledEvents[E],c.clearTimeout(w)},cancelAll:d=>{for(const m in l._snapshot._scheduledEvents){const E=l._snapshot._scheduledEvents[m];E.source===d&&h.cancel(d,E.id)}}},l={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Uo++}`,_register:(d,m)=>(n.set(d,m),d),_unregister:d=>{n.delete(d.sessionId);const m=s.get(d);m!==void 0&&(r.delete(m),s.delete(d))},get:d=>r.get(d),_set:(d,m)=>{const E=r.get(d);if(E&&E!==m)throw new Error(`Actor with system ID '${d}' already exists.`);r.set(d,m),s.set(m,d)},inspect:d=>{i.add(d)},_sendInspectionEvent:d=>{const m={...d,rootId:e.sessionId};i.forEach(E=>{var w;return(w=E.next)==null?void 0:w.call(E,m)})},_relay:(d,m,E)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:d,actorRef:m,event:E}),m._send(E)},scheduler:h,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{const d=l._snapshot._scheduledEvents;l._snapshot._scheduledEvents={};for(const m in d){const{source:E,target:w,event:b,delay:O,id:j}=d[m];h.schedule(E,w,b,O,j)}}};return l}function _s(e,t){const n=Lr(e),r=Lr(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(s=>s in r?_s(n[s],r[s]):!1)}function Gn(e){if(bs(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function Lr(e){if(vi(e))return e.value;if(typeof e!="string")return e;const t=Gn(e);return Bo(t)}function Bo(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const s=n;n={},s[e[r]]=n}return t}function Br(e,t){const n={},r=Object.keys(e);for(let s=0;s<r.length;s++){const i=r[s];n[i]=t(e[i],i,e,s)}return n}function Es(e){return bs(e)?e:[e]}function $e(e){return e===void 0?[]:Es(e)}function Bn(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function bs(e){return Array.isArray(e)}function Wo(e){return e.type.startsWith("xstate.error.actor")}function at(e){return Es(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function Ss(e){if(!(e===void 0||e===Io))return $e(e)}function Wr(e,t,n){var i,a,c;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:t)==null?void 0:a.bind(s),complete:(c=r?e.complete:n)==null?void 0:c.bind(s)}}function Vr(e,t){return`${t}.${e}`}function Xn(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,s]=n,a=e.getStateNodeById(s).config.invoke;return(Array.isArray(a)?a[r]:a).src}const Zn=1;let fe=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({});const Vo={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class zo{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Nr(this._process.bind(this)),this.observers=new Set,this.logger=void 0,this._processingStatus=fe.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...Vo,...n},{clock:s,logger:i,parent:a,syncSnapshot:c,id:h,systemId:l,inspect:d}=r;this.system=a?a.system:Lo(this,{clock:s}),d&&!a&&this.system.inspect(Wr(d)),this.sessionId=this.system._bookId(),this.id=h??this.sessionId,this.logger=i,this.clock=s,this._parent=a,this._syncSnapshot=c,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:m=>{this._deferred.push(m)},system:this.system,stopChild:m=>{if(m._parent!==this)throw new Error(`Cannot stop child actor ${m.id} of ${this.id} because it is not a child`);m._stop()}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this._systemId=l,this.system._set(l,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),l&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var n;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(t,n){var s,i;this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(a){this._deferred.length=0,this._snapshot={...t,status:"error",error:a}}switch(this._snapshot.status){case"active":for(const a of this.observers)try{(s=a.next)==null||s.call(a,t)}catch(c){Oe(c)}break;case"done":for(const a of this.observers)try{(i=a.next)==null||i.call(a,t)}catch(c){Oe(c)}this._stopProcedure(),this._complete(),this._doneEvent=Mo(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){var i;const s=Wr(t,n,r);if(this._processingStatus!==fe.Stopped)this.observers.add(s);else switch(this._snapshot.status){case"done":try{(i=s.complete)==null||i.call(s)}catch(a){Oe(a)}break;case"error":{const a=this._snapshot.error;if(!s.error)Oe(a);else try{s.error(a)}catch(c){Oe(c)}break}}return{unsubscribe:()=>{this.observers.delete(s)}}}start(){if(this._processingStatus===fe.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=fe.Running;const t=gs(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(s){r={err:s}}if(r){const{err:s}=r;this._snapshot={...this._snapshot,status:"error",error:s},this._error(s);return}this.update(n,t),t.type===Tt&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===fe.Stopped?this:(this.mailbox.clear(),this._processingStatus===fe.NotStarted?(this._processingStatus=fe.Stopped,this):(this.mailbox.enqueue({type:Tt}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const n of this.observers)try{(t=n.complete)==null||t.call(n)}catch(r){Oe(r)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||Oe(t);return}let n=!1;for(const r of this.observers){const s=r.error;n||(n=!s);try{s==null||s(t)}catch(i){Oe(i)}}this.observers.clear(),n&&Oe(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,vs(this.id,t))}_stopProcedure(){return this._processingStatus!==fe.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Nr(this._process.bind(this)),this._processingStatus=fe.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==fe.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:Po)(this)}toJSON(){return{xstate$$type:Zn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[No](){return this}getSnapshot(){return this._snapshot}}function Xe(e,t){return new zo(e,t)}function Ho(e,t,n,r,{sendId:s}){const i=typeof s=="function"?s(n,r):s;return[t,i]}function qo(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t)})}function Yo(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Ho,t.execute=qo,t}function Jo(e,t,n,r,{id:s,systemId:i,src:a,input:c,syncSnapshot:h}){const l=typeof a=="string"?Xn(t.machine,a):a,d=typeof s=="function"?s(n):s;let m;return l&&(m=Xe(l,{id:d,src:a,parent:e.self,syncSnapshot:h,systemId:i,input:typeof c=="function"?c({context:t.context,event:n.event,self:e.self}):c})),[Ze(t,{children:{...t.children,[d]:m}}),{id:s,actorRef:m}]}function Ko(e,{id:t,actorRef:n}){n&&e.defer(()=>{n._processingStatus!==fe.Stopped&&n.start()})}function Go(...[e,{id:t,systemId:n,input:r,syncSnapshot:s=!1}={}]){function i(a,c){}return i.type="snapshot.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=r,i.syncSnapshot=s,i.resolve=Jo,i.execute=Ko,i}function Xo(e,t,n,r,{actorRef:s}){const i=typeof s=="function"?s(n,r):s,a=typeof i=="string"?t.children[i]:i;let c=t.children;return a&&(c={...c},delete c[a.id]),[Ze(t,{children:c}),a]}function Zo(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==fe.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function ws(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Xo,t.execute=Zo,t}function Qn(e,t,n,r){const{machine:s}=r,i=typeof e=="function",a=i?e:s.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!a)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof a!="function")return Qn(a,t,n,r);const c={context:t,event:n},h=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in a?a.check(r,c,a):a(c,h)}const er=e=>e.type==="atomic"||e.type==="final";function ct(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Ot(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Qt(e){const t=new Set(e),n=Rs(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))zr(r).forEach(s=>t.add(s));else if(r.type==="parallel"){for(const s of ct(r))if(s.type!=="history"&&!t.has(s)){const i=zr(s);for(const a of i)t.add(a)}}for(const r of t){let s=r.parent;for(;s;)t.add(s),s=s.parent}return t}function Ts(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const s=n[0];if(s){if(er(s))return s.key}else return{}}const r={};for(const s of n)r[s.key]=Ts(s,t);return r}function Rs(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Os(e,t){const n=Qt(t);return Ts(e,Rs(n))}function tr(e,t){return t.type==="compound"?ct(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?ct(t).every(n=>tr(e,n)):t.type==="final"}const sn=e=>e[0]===jo;function Qo(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>{if(r===Do)return!0;if(!r.endsWith(".*"))return!1;const s=r.split("."),i=t.split(".");for(let a=0;a<s.length;a++){const c=s[a],h=i[a];if(c==="*")return a===s.length-1;if(c!==h)return!1}return!0}).sort((r,s)=>s.length-r.length).flatMap(r=>e.transitions.get(r))}function ei(e){const t=e.config.after;if(!t)return[];const n=(s,i)=>{const a=Fo(s,e.id),c=a.type;return e.entry.push(Oi(a,{id:c,delay:s})),e.exit.push(Yo(c)),c};return Object.keys(t).flatMap((s,i)=>{const a=t[s],c=typeof a=="string"?{target:a}:a,h=Number.isNaN(+s)?s:+s,l=n(h);return $e(c).map(d=>({...d,event:l,delay:h}))}).map(s=>{const{delay:i}=s;return{...Ke(e,s.event,s),delay:i}})}function Ke(e,t,n){const r=Ss(n.target),s=n.reenter??!1,i=ri(e,r),a={...n,actions:$e(n.actions),guard:n.guard,target:i,source:e,reenter:s,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:i?i.map(c=>`#${c.id}`):void 0})};return a}function ti(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===ys)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,at(r).map(s=>Ke(e,n,s)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,at(e.config.onDone).map(r=>Ke(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,at(n.onDone).map(s=>Ke(e,r,s)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,at(n.onError).map(s=>Ke(e,r,s)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,at(n.onSnapshot).map(s=>Ke(e,r,s)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function ni(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:$e(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function ri(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(sn(n))return e.machine.getStateNodeById(n);const r=n[0]===ps;if(r&&!e.parent)return en(e,n.slice(1));const s=r?e.key+n:n;if(e.parent)try{return en(e.parent,s)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
2
|
+
${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Cs(e){const t=Ss(e.config.target);return t?{target:t.map(n=>typeof n=="string"?en(e.parent,n):n)}:e.parent.initial}function Ge(e){return e.type==="history"}function zr(e){const t=As(e);for(const n of t)for(const r of Ot(n,e))t.add(r);return t}function As(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const s of ct(r))n(s)}}return n(e),t}function ft(e,t){if(sn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function en(e,t){if(typeof t=="string"&&sn(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Gn(t).slice();let r=e;for(;n.length;){const s=n.shift();if(!s.length)break;r=ft(r,s)}return r}function tn(e,t){if(typeof t=="string")return[e,e.states[t]];const n=Object.keys(t),r=n.map(s=>ft(e,s)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((s,i)=>{const a=ft(e,i);if(!a)return s;const c=tn(a,t[i]);return s.concat(c)},[]))}function si(e,t,n,r){const i=ft(e,t).next(n,r);return!i||!i.length?e.next(n,r):i}function oi(e,t,n,r){const s=Object.keys(t),i=ft(e,s[0]),a=nr(i,t[s[0]],n,r);return!a||!a.length?e.next(n,r):a}function ii(e,t,n,r){const s=[];for(const i of Object.keys(t)){const a=t[i];if(!a)continue;const c=ft(e,i),h=nr(c,a,n,r);h&&s.push(...h)}return s.length?s:e.next(n,r)}function nr(e,t,n,r){return typeof t=="string"?si(e,t,n,r):Object.keys(t).length===1?oi(e,t,n,r):ii(e,t,n,r)}function ai(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Fe(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ui(e,t){const n=new Set(e),r=new Set(t);for(const s of n)if(r.has(s))return!0;for(const s of r)if(n.has(s))return!0;return!1}function ks(e,t,n){const r=new Set;for(const s of e){let i=!1;const a=new Set;for(const c of r)if(ui(Wn([s],t,n),Wn([c],t,n)))if(Fe(s.source,c.source))a.add(c);else{i=!0;break}if(!i){for(const c of a)r.delete(c);r.add(s)}}return Array.from(r)}function ci(e){const[t,...n]=e;for(const r of Ot(t,void 0))if(n.every(s=>Fe(s,r)))return r}function rr(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Ge(r))if(t[r.id])for(const s of t[r.id])n.add(s);else for(const s of rr(Cs(r),t))n.add(s);else n.add(r);return[...n]}function xs(e,t){const n=rr(e,t);if(!n)return;if(!e.reenter&&n.every(s=>s===e.source||Fe(s,e.source)))return e.source;const r=ci(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function Wn(e,t,n){var s;const r=new Set;for(const i of e)if((s=i.target)!=null&&s.length){const a=xs(i,n);i.reenter&&i.source===a&&r.add(a);for(const c of t)Fe(c,a)&&r.add(c)}return[...r]}function fi(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vn(e,t,n,r,s,i){if(!e.length)return t;const a=new Set(t._nodes);let c=t.historyValue;const h=ks(e,a,c);let l=t;s||([l,c]=pi(l,r,n,h,a,c,i)),l=lt(l,r,n,h.flatMap(m=>m.actions),i),l=di(l,r,n,h,a,i,c,s);const d=[...a];l.status==="done"&&(l=lt(l,r,n,d.sort((m,E)=>E.order-m.order).flatMap(m=>m.exit),i));try{return c===t.historyValue&&fi(t._nodes,a)?l:Ze(l,{_nodes:d,historyValue:c})}catch(m){throw m}}function li(e,t,n,r,s){if(!r.output)return;const i=Ln(s.id,s.output&&s.parent?Bn(s.output,e.context,t,n.self):void 0);return Bn(r.output,e.context,i,n.self)}function di(e,t,n,r,s,i,a,c){let h=e;const l=new Set,d=new Set;hi(r,a,d,l),c&&d.add(e.machine.root);const m=new Set;for(const E of[...l].sort((w,b)=>w.order-b.order)){s.add(E);const w=[];w.push(...E.entry);for(const b of E.invoke)w.push(Go(b.src,{...b,syncSnapshot:!!b.onSnapshot}));if(d.has(E)){const b=E.initial.actions;w.push(...b)}if(h=lt(h,t,n,w,i,E.invoke.map(b=>b.id)),E.type==="final"){const b=E.parent;let O=(b==null?void 0:b.type)==="parallel"?b:b==null?void 0:b.parent,j=O||E;for((b==null?void 0:b.type)==="compound"&&i.push(Ln(b.id,E.output?Bn(E.output,h.context,t,n.self):void 0));(O==null?void 0:O.type)==="parallel"&&!m.has(O)&&tr(s,O);)m.add(O),i.push(Ln(O.id)),j=O,O=O.parent;if(O)continue;h=Ze(h,{status:"done",output:li(h,t,n,h.machine.root,j)})}}return h}function hi(e,t,n,r){for(const s of e){const i=xs(s,t);for(const c of s.target||[])!Ge(c)&&(s.source!==c||s.source!==i||s.reenter)&&(r.add(c),n.add(c)),ut(c,t,n,r);const a=rr(s,t);for(const c of a){const h=Ot(c,i);(i==null?void 0:i.type)==="parallel"&&h.push(i),Ps(r,t,n,h,!s.source.parent&&s.reenter?void 0:i)}}}function ut(e,t,n,r){var s;if(Ge(e))if(t[e.id]){const i=t[e.id];for(const a of i)r.add(a),ut(a,t,n,r);for(const a of i)jn(a,e.parent,r,t,n)}else{const i=Cs(e);for(const a of i.target)r.add(a),i===((s=e.parent)==null?void 0:s.initial)&&n.add(e.parent),ut(a,t,n,r);for(const a of i.target)jn(a,e.parent,r,t,n)}else if(e.type==="compound"){const[i]=e.initial.target;Ge(i)||(r.add(i),n.add(i)),ut(i,t,n,r),jn(i,e,r,t,n)}else if(e.type==="parallel")for(const i of ct(e).filter(a=>!Ge(a)))[...r].some(a=>Fe(a,i))||(Ge(i)||(r.add(i),n.add(i)),ut(i,t,n,r))}function Ps(e,t,n,r,s){for(const i of r)if((!s||Fe(i,s))&&e.add(i),i.type==="parallel")for(const a of ct(i).filter(c=>!Ge(c)))[...e].some(c=>Fe(c,a))||(e.add(a),ut(a,t,n,e))}function jn(e,t,n,r,s){Ps(n,r,s,Ot(e,t))}function pi(e,t,n,r,s,i,a){let c=e;const h=Wn(r,s,i);h.sort((d,m)=>m.order-d.order);let l;for(const d of h)for(const m of ai(d)){let E;m.history==="deep"?E=w=>er(w)&&Fe(w,d):E=w=>w.parent===d,l??(l={...i}),l[m.id]=Array.from(s).filter(E)}for(const d of h)c=lt(c,t,n,[...d.exit,...d.invoke.map(m=>ws(m.id))],a),s.delete(d);return[c,l||i]}function Is(e,t,n,r,s,i){const{machine:a}=e;let c=e;for(const h of r){const l=typeof h=="function",d=l?h:a.implementations.actions[typeof h=="string"?h:h.type];if(!d)continue;const m={context:c.context,event:t,self:n.self,system:n.system},E=l||typeof h=="string"?void 0:"params"in h?typeof h.params=="function"?h.params({context:c.context,event:t}):h.params:void 0;if(!("resolve"in d)){n.self._processingStatus===fe.Running?d(m,E):n.defer(()=>{d(m,E)});continue}const w=d,[b,O,j]=w.resolve(n,c,m,E,d,s);c=b,"retryResolve"in w&&(i==null||i.push([w,O])),"execute"in w&&(n.self._processingStatus===fe.Running?w.execute(n,O):n.defer(w.execute.bind(null,n,O))),j&&(c=Is(c,t,n,j,s,i))}return c}function lt(e,t,n,r,s,i){const a=i?[]:void 0,c=Is(e,t,n,r,{internalQueue:s,deferredActorIds:i},a);return a==null||a.forEach(([h,l])=>{h.retryResolve(n,c,l)}),c}function Dn(e,t,n,r=[]){let s=e;const i=[];if(t.type===Tt)return s=Ze(Hr(s,t,n),{status:"stopped"}),i.push(s),{snapshot:s,microstates:i};let a=t;if(a.type!==ms){const h=a,l=Wo(h),d=qr(h,s);if(l&&!d.length)return s=Ze(e,{status:"error",error:h.error}),i.push(s),{snapshot:s,microstates:i};s=Vn(d,e,n,a,!1,r),i.push(s)}let c=!0;for(;s.status==="active";){let h=c?yi(s,a):[];const l=h.length?s:void 0;if(!h.length){if(!r.length)break;a=r.shift(),h=qr(a,s)}s=Vn(h,s,n,a,!1,r),c=s!==l,i.push(s)}return s.status!=="active"&&Hr(s,a,n),{snapshot:s,microstates:i}}function Hr(e,t,n){return lt(e,t,n,Object.values(e.children).map(r=>ws(r)),[])}function qr(e,t){return t.machine.getTransitionData(t,e)}function yi(e,t){const n=new Set,r=e._nodes.filter(er);for(const s of r)e:for(const i of[s].concat(Ot(s,void 0)))if(i.always){for(const a of i.always)if(a.guard===void 0||Qn(a.guard,e.context,t,e)){n.add(a);break e}}return ks(Array.from(n),new Set(e._nodes),e.historyValue)}function mi(e,t){const n=Qt(tn(e,t));return Os(e,[...n])}function vi(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const gi=function(t){return _s(t,this.value)},_i=function(t){return this.tags.has(t)},Ei=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},bi=function(){const{_nodes:t,tags:n,machine:r,getMeta:s,toJSON:i,can:a,hasTag:c,matches:h,...l}=this;return{...l,tags:Array.from(n)}},Si=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Jt(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Os(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:gi,hasTag:_i,can:Ei,getMeta:Si,toJSON:bi}}function Ze(e,t={}){return Jt({...e,...t},e.machine)}function wi(e,t){const{_nodes:n,tags:r,machine:s,children:i,context:a,can:c,hasTag:h,matches:l,getMeta:d,toJSON:m,...E}=e,w={};for(const O in i){const j=i[O];w[O]={snapshot:j.getPersistedSnapshot(t),src:j.src,systemId:j._systemId,syncSnapshot:j._syncSnapshot}}return{...E,context:js(a),children:w}}function js(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:Zn,id:r.id};else{const s=js(r);s!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=s)}}return t??e}function Ti(e,t,n,r,{event:s,id:i,delay:a},{internalQueue:c}){const h=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);const l=typeof s=="function"?s(n,r):s;let d;if(typeof a=="string"){const m=h&&h[a];d=typeof m=="function"?m(n,r):m}else d=typeof a=="function"?a(n,r):a;return typeof d!="number"&&c.push(l),[t,{event:l,id:i,delay:d}]}function Ri(e,t){const{event:n,delay:r,id:s}=t;if(typeof r=="number"){e.defer(()=>{const i=e.self;e.system.scheduler.schedule(i,i,n,r,s)});return}}function Oi(e,t){function n(r,s){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=Ti,n.execute=Ri,n}const Yr=new WeakMap;function Ci(e){return{config:e,start:(n,r)=>{const{self:s,system:i}=r,a={receivers:void 0,dispose:void 0};Yr.set(s,a),a.dispose=e({input:n.input,system:i,self:s,sendBack:c=>{s.getSnapshot().status!=="stopped"&&s._parent&&i._relay(s,s._parent,c)},receive:c=>{a.receivers??(a.receivers=new Set),a.receivers.add(c)}})},transition:(n,r,s)=>{var a,c;const i=Yr.get(s.self);return r.type===Tt?(n={...n,status:"stopped",error:void 0},(a=i.dispose)==null||a.call(i),n):((c=i.receivers)==null||c.forEach(h=>h(r)),n)},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}const Jr="xstate.promise.resolve",Kr="xstate.promise.reject";function $n(e){return{config:e,transition:(n,r)=>{if(n.status!=="active")return n;switch(r.type){case Jr:{const s=r.data;return{...n,status:"done",output:s,input:void 0}}case Kr:return{...n,status:"error",error:r.data,input:void 0};case Tt:return{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:s})=>{if(n.status!=="active")return;Promise.resolve(e({input:n.input,system:s,self:r})).then(a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Jr,data:a})},a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Kr,data:a})})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function Ai(e,{machine:t,context:n},r,s){const i=(a,c={})=>{const{systemId:h,input:l}=c;if(typeof a=="string"){const d=Xn(t,a);if(!d)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const m=Xe(d,{id:c.id,parent:e.self,syncSnapshot:c.syncSnapshot,input:typeof l=="function"?l({context:n,event:r,self:e.self}):l,src:a,systemId:h});return s[m.id]=m,m}else return Xe(a,{id:c.id,parent:e.self,syncSnapshot:c.syncSnapshot,input:c.input,src:a,systemId:h})};return(a,c)=>{const h=i(a,c);return s[h.id]=h,e.defer(()=>{h._processingStatus!==fe.Stopped&&h.start()}),h}}function ki(e,t,n,r,{assignment:s}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const i={},a={context:t.context,event:n.event,spawn:Ai(e,t,n.event,i),self:e.self,system:e.system};let c={};if(typeof s=="function")c=s(a,r);else for(const l of Object.keys(s)){const d=s[l];c[l]=typeof d=="function"?d(a,r):d}const h=Object.assign({},t.context,c);return[Ze(t,{context:h,children:Object.keys(i).length?{...t.children,...i}:t.children})]}function ge(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=ki,t}let Gr=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function xi(e,t,n,r,{to:s,event:i,id:a,delay:c},h){var b;const l=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);const d=typeof i=="function"?i(n,r):i;let m;if(typeof c=="string"){const O=l&&l[c];m=typeof O=="function"?O(n,r):O}else m=typeof c=="function"?c(n,r):c;const E=typeof s=="function"?s(n,r):s;let w;if(typeof E=="string"){if(E===Gr.Parent?w=e.self._parent:E===Gr.Internal?w=e.self:E.startsWith("#_")?w=t.children[E.slice(2)]:w=(b=h.deferredActorIds)!=null&&b.includes(E)?E:t.children[E],!w)throw new Error(`Unable to send event to actor '${E}' from machine '${t.machine.id}'.`)}else w=E||e.self;return[t,{to:w,event:d,id:a,delay:m}]}function Pi(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to])}function Ii(e,t){e.defer(()=>{const{to:n,event:r,delay:s,id:i}=t;if(typeof s=="number"){e.system.scheduler.schedule(e.self,n,r,s,i);return}e.system._relay(e.self,n,r.type===$o?vs(e.self.id,r.data):r)})}function Xr(e,t,n){function r(s,i){}return r.type="xsnapshot.sendTo",r.to=e,r.event=t,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=xi,r.retryResolve=Pi,r.execute=Ii,r}const Zr=new WeakMap;function it(e,t,n){let r=Zr.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Zr.set(e,r)),r[t]}const ji={},_t=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class sr{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(ps),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Br(this.config.states,(r,s)=>new sr(r,{_parent:this,_key:s,_machine:this.machine})):ji,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=$e(this.config.entry).slice(),this.exit=$e(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=$e(t.tags).slice()}_initialize(){this.transitions=ti(this),this.config.always&&(this.always=at(this.config.always).map(t=>Ke(this,ys,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(_t),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(_t),eventType:null})}:void 0,history:this.history,states:Br(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(_t)})),entry:this.entry.map(_t),exit:this.exit.map(_t),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return it(this,"invoke",()=>$e(this.config.invoke).map((t,n)=>{const{src:r,systemId:s}=t,i=t.id??Vr(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${Vr(this.id,n)}`;return{...t,src:a,id:i,systemId:s,toJSON(){const{onDone:c,onError:h,...l}=t;return{...l,type:"xstate.invoke",src:a,id:i}}}}))}get on(){return it(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(s=>[n,s])).reduce((n,[r,s])=>(n[r]=n[r]||[],n[r].push(s),n),{}))}get after(){return it(this,"delayedTransitions",()=>ei(this))}get initial(){return it(this,"initial",()=>ni(this,this.config.initial))}next(t,n){const r=n.type,s=[];let i;const a=it(this,`candidates-${r}`,()=>Qo(this,r));for(const c of a){const{guard:h}=c,l=t.context;let d=!1;try{d=!h||Qn(h,l,n,t)}catch(m){const E=typeof h=="string"?h:typeof h=="object"?h.type:void 0;throw new Error(`Unable to evaluate guard ${E?`'${E}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
3
|
+
${m.message}`)}if(d){s.push(...c.actions),i=c;break}}return i?[i]:void 0}get events(){return it(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const s=t[r];if(s.states)for(const i of s.events)n.add(`${i}`)}return Array.from(n)})}get ownEvents(){const t=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(t)}}const Di="#";class or{constructor(t,n){this.config=t,this.version=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.__TResolvedTypesMeta=void 0,this.id=t.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new sr(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:s,delays:i}=this.implementations;return new or(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...s,...t.actors},delays:{...i,...t.delays}})}resolveState(t){const n=mi(this.root,t.value),r=Qt(tn(this.root,n));return Jt({_nodes:[...r],context:t.context||{},children:{},status:tr(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return Dn(t,n,r).snapshot}microstep(t,n,r){return Dn(t,n,r).microstates}getTransitionData(t,n){return nr(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){const{context:s}=this.config,i=Jt({context:typeof s!="function"&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return typeof s=="function"?lt(i,n,t,[ge(({spawn:c,event:h,self:l})=>s({spawn:c,input:h.input,self:l}))],r):i}getInitialSnapshot(t,n){const r=gs(n),s=[],i=this.getPreInitialState(t,r,s),a=Vn([{target:[...As(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,t,r,!0,s),{snapshot:c}=Dn(a,r,t,s);return c}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=Gn(t),r=n.slice(1),s=sn(n[0])?n[0].slice(Di.length):n[0],i=this.idMap.get(s);if(!i)throw new Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return en(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return wi(t,n)}restoreSnapshot(t,n){const r={},s=t.children;Object.keys(s).forEach(h=>{const l=s[h],d=l.snapshot,m=l.src,E=typeof m=="string"?Xn(this,m):m;if(!E)return;const w=Xe(E,{id:h,parent:n.self,syncSnapshot:l.syncSnapshot,snapshot:d,src:m,systemId:l.systemId});r[h]=w});const i=Jt({...t,children:r,_nodes:Array.from(Qt(tn(this.root,t.value)))},this);let a=new Set;function c(h,l){if(!a.has(h)){a.add(h);for(let d in h){const m=h[d];if(m&&typeof m=="object"){if("xstate$$type"in m&&m.xstate$$type===Zn){h[d]=l[m.id];continue}c(m,l)}}}}return c(i.context,r),i}}function $i(e,t){return new or(e,t)}function ir({actors:e,actions:t,guards:n,delays:r}){return{createMachine:s=>$i(s,{actors:e,actions:t,guards:n,delays:r})}}function Ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Fi}=Object.prototype,{getPrototypeOf:ar}=Object,on=(e=>t=>{const n=Fi.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>on(t)===e),an=e=>t=>typeof t===e,{isArray:ht}=Array,Rt=an("undefined");function Mi(e){return e!==null&&!Rt(e)&&e.constructor!==null&&!Rt(e.constructor)&&ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=we("ArrayBuffer");function Ni(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Ui=an("string"),ye=an("function"),Fs=an("number"),un=e=>e!==null&&typeof e=="object",Li=e=>e===!0||e===!1,Kt=e=>{if(on(e)!=="object")return!1;const t=ar(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Bi=we("Date"),Wi=we("File"),Vi=we("Blob"),zi=we("FileList"),Hi=e=>un(e)&&ye(e.pipe),qi=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ye(e.append)&&((t=on(e))==="formdata"||t==="object"&&ye(e.toString)&&e.toString()==="[object FormData]"))},Yi=we("URLSearchParams"),Ji=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ht(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let c;for(r=0;r<a;r++)c=i[r],t.call(null,e[c],c,e)}}function Ms(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Ns=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Us=e=>!Rt(e)&&e!==Ns;function zn(){const{caseless:e}=Us(this)&&this||{},t={},n=(r,s)=>{const i=e&&Ms(t,s)||s;Kt(t[i])&&Kt(r)?t[i]=zn(t[i],r):Kt(r)?t[i]=zn({},r):ht(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ct(arguments[r],n);return t}const Ki=(e,t,n,{allOwnKeys:r}={})=>(Ct(t,(s,i)=>{n&&ye(s)?e[i]=Ds(s,n):e[i]=s},{allOwnKeys:r}),e),Gi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xi=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Zi=(e,t,n,r)=>{let s,i,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&ar(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qi=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},ea=e=>{if(!e)return null;if(ht(e))return e;let t=e.length;if(!Fs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ta=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ar(Uint8Array)),na=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ra=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},sa=we("HTMLFormElement"),oa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Qr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ia=we("RegExp"),Ls=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ct(n,(s,i)=>{let a;(a=t(s,i,e))!==!1&&(r[i]=a||s)}),Object.defineProperties(e,r)},aa=e=>{Ls(e,(t,n)=>{if(ye(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ye(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ua=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ht(e)?r(e):r(String(e).split(t)),n},ca=()=>{},fa=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Fn="abcdefghijklmnopqrstuvwxyz",es="0123456789",Bs={DIGIT:es,ALPHA:Fn,ALPHA_DIGIT:Fn+Fn.toUpperCase()+es},la=(e=16,t=Bs.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function da(e){return!!(e&&ye(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ha=e=>{const t=new Array(10),n=(r,s)=>{if(un(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=ht(r)?[]:{};return Ct(r,(a,c)=>{const h=n(a,s+1);!Rt(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},pa=we("AsyncFunction"),ya=e=>e&&(un(e)||ye(e))&&ye(e.then)&&ye(e.catch),g={isArray:ht,isArrayBuffer:$s,isBuffer:Mi,isFormData:qi,isArrayBufferView:Ni,isString:Ui,isNumber:Fs,isBoolean:Li,isObject:un,isPlainObject:Kt,isUndefined:Rt,isDate:Bi,isFile:Wi,isBlob:Vi,isRegExp:ia,isFunction:ye,isStream:Hi,isURLSearchParams:Yi,isTypedArray:ta,isFileList:zi,forEach:Ct,merge:zn,extend:Ki,trim:Ji,stripBOM:Gi,inherits:Xi,toFlatObject:Zi,kindOf:on,kindOfTest:we,endsWith:Qi,toArray:ea,forEachEntry:na,matchAll:ra,isHTMLForm:sa,hasOwnProperty:Qr,hasOwnProp:Qr,reduceDescriptors:Ls,freezeMethods:aa,toObjectSet:ua,toCamelCase:oa,noop:ca,toFiniteNumber:fa,findKey:Ms,global:Ns,isContextDefined:Us,ALPHABET:Bs,generateString:la,isSpecCompliantForm:da,toJSONObject:ha,isAsyncFn:pa,isThenable:ya};function L(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}g.inherits(L,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:g.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ws=L.prototype,Vs={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Vs[e]={value:e}});Object.defineProperties(L,Vs);Object.defineProperty(Ws,"isAxiosError",{value:!0});L.from=(e,t,n,r,s,i)=>{const a=Object.create(Ws);return g.toFlatObject(e,a,function(h){return h!==Error.prototype},c=>c!=="isAxiosError"),L.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const ma=null;function Hn(e){return g.isPlainObject(e)||g.isArray(e)}function zs(e){return g.endsWith(e,"[]")?e.slice(0,-2):e}function ts(e,t,n){return e?e.concat(t).map(function(s,i){return s=zs(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function va(e){return g.isArray(e)&&!e.some(Hn)}const ga=g.toFlatObject(g,{},null,function(t){return/^is[A-Z]/.test(t)});function cn(e,t,n){if(!g.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,j){return!g.isUndefined(j[O])});const r=n.metaTokens,s=n.visitor||d,i=n.dots,a=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(t);if(!g.isFunction(s))throw new TypeError("visitor must be a function");function l(b){if(b===null)return"";if(g.isDate(b))return b.toISOString();if(!h&&g.isBlob(b))throw new L("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(b)||g.isTypedArray(b)?h&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function d(b,O,j){let J=b;if(b&&!j&&typeof b=="object"){if(g.endsWith(O,"{}"))O=r?O:O.slice(0,-2),b=JSON.stringify(b);else if(g.isArray(b)&&va(b)||(g.isFileList(b)||g.endsWith(O,"[]"))&&(J=g.toArray(b)))return O=zs(O),J.forEach(function(he,pe){!(g.isUndefined(he)||he===null)&&t.append(a===!0?ts([O],pe,i):a===null?O:O+"[]",l(he))}),!1}return Hn(b)?!0:(t.append(ts(j,O,i),l(b)),!1)}const m=[],E=Object.assign(ga,{defaultVisitor:d,convertValue:l,isVisitable:Hn});function w(b,O){if(!g.isUndefined(b)){if(m.indexOf(b)!==-1)throw Error("Circular reference detected in "+O.join("."));m.push(b),g.forEach(b,function(J,W){(!(g.isUndefined(J)||J===null)&&s.call(t,J,g.isString(W)?W.trim():W,O,E))===!0&&w(J,O?O.concat(W):[W])}),m.pop()}}if(!g.isObject(e))throw new TypeError("data must be an object");return w(e),t}function ns(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ur(e,t){this._pairs=[],e&&cn(e,this,t)}const Hs=ur.prototype;Hs.append=function(t,n){this._pairs.push([t,n])};Hs.toString=function(t){const n=t?function(r){return t.call(this,r,ns)}:ns;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qs(e,t,n){if(!t)return e;const r=n&&n.encode||_a,s=n&&n.serialize;let i;if(s?i=s(t,n):i=g.isURLSearchParams(t)?t.toString():new ur(t,n).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ea{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){g.forEach(this.handlers,function(r){r!==null&&t(r)})}}const rs=Ea,Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ba=typeof URLSearchParams<"u"?URLSearchParams:ur,Sa=typeof FormData<"u"?FormData:null,wa=typeof Blob<"u"?Blob:null,Ta=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ra=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),_e={isBrowser:!0,classes:{URLSearchParams:ba,FormData:Sa,Blob:wa},isStandardBrowserEnv:Ta,isStandardBrowserWebWorkerEnv:Ra,protocols:["http","https","file","blob","url","data"]};function Oa(e,t){return cn(e,new _e.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return _e.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Ca(e){return g.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Aa(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Js(e){function t(n,r,s,i){let a=n[i++];const c=Number.isFinite(+a),h=i>=n.length;return a=!a&&g.isArray(s)?s.length:a,h?(g.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!g.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],i)&&g.isArray(s[a])&&(s[a]=Aa(s[a])),!c)}if(g.isFormData(e)&&g.isFunction(e.entries)){const n={};return g.forEachEntry(e,(r,s)=>{t(Ca(r),s,n,0)}),n}return null}function ka(e,t,n){if(g.isString(e))try{return(t||JSON.parse)(e),g.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const cr={transitional:Ys,adapter:_e.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=g.isObject(t);if(i&&g.isHTMLForm(t)&&(t=new FormData(t)),g.isFormData(t))return s&&s?JSON.stringify(Js(t)):t;if(g.isArrayBuffer(t)||g.isBuffer(t)||g.isStream(t)||g.isFile(t)||g.isBlob(t))return t;if(g.isArrayBufferView(t))return t.buffer;if(g.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Oa(t,this.formSerializer).toString();if((c=g.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return cn(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ka(t)):t}],transformResponse:[function(t){const n=this.transitional||cr.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&g.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?L.from(c,L.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],e=>{cr.headers[e]={}});const fr=cr,xa=g.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pa=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
4
|
+
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&xa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ss=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function Gt(e){return e===!1||e==null?e:g.isArray(e)?e.map(Gt):String(e)}function Ia(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const ja=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mn(e,t,n,r,s){if(g.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!g.isString(t)){if(g.isString(r))return t.indexOf(r)!==-1;if(g.isRegExp(r))return r.test(t)}}function Da(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $a(e,t){const n=g.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,a){return this[r].call(this,t,s,i,a)},configurable:!0})})}class fn{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,h,l){const d=Et(h);if(!d)throw new Error("header name must be a non-empty string");const m=g.findKey(s,d);(!m||s[m]===void 0||l===!0||l===void 0&&s[m]!==!1)&&(s[m||h]=Gt(c))}const a=(c,h)=>g.forEach(c,(l,d)=>i(l,d,h));return g.isPlainObject(t)||t instanceof this.constructor?a(t,n):g.isString(t)&&(t=t.trim())&&!ja(t)?a(Pa(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Et(t),t){const r=g.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Ia(s);if(g.isFunction(n))return n.call(this,s,r);if(g.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Et(t),t){const r=g.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Mn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(a){if(a=Et(a),a){const c=g.findKey(r,a);c&&(!n||Mn(r,r[c],c,n))&&(delete r[c],s=!0)}}return g.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Mn(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return g.forEach(this,(s,i)=>{const a=g.findKey(r,i);if(a){n[a]=Gt(s),delete n[i];return}const c=t?Da(i):String(i).trim();c!==i&&delete n[i],n[c]=Gt(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return g.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&g.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
5
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ss]=this[ss]={accessors:{}}).accessors,s=this.prototype;function i(a){const c=Et(a);r[c]||($a(s,a),r[c]=!0)}return g.isArray(t)?t.forEach(i):i(t),this}}fn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(fn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});g.freezeMethods(fn);const Ce=fn;function Nn(e,t){const n=this||fr,r=t||n,s=Ce.from(r.headers);let i=r.data;return g.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ks(e){return!!(e&&e.__CANCEL__)}function At(e,t,n){L.call(this,e??"canceled",L.ERR_CANCELED,t,n),this.name="CanceledError"}g.inherits(At,L,{__CANCEL__:!0});function Fa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new L("Request failed with status code "+n.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Ma=_e.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,a,c){const h=[];h.push(n+"="+encodeURIComponent(r)),g.isNumber(s)&&h.push("expires="+new Date(s).toGMTString()),g.isString(i)&&h.push("path="+i),g.isString(a)&&h.push("domain="+a),c===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Na(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ua(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Gs(e,t){return e&&!Na(t)?Ua(e,t):t}const La=_e.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const c=g.isString(a)?s(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Ba(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(h){const l=Date.now(),d=r[i];a||(a=l),n[s]=h,r[s]=l;let m=i,E=0;for(;m!==s;)E+=n[m++],m=m%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-a<t)return;const w=d&&l-d;return w?Math.round(E*1e3/w):void 0}}function os(e,t){let n=0;const r=Wa(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-n,h=r(c),l=i<=a;n=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:h||void 0,estimated:h&&a&&l?(a-i)/h:void 0,event:s};d[t?"download":"upload"]=!0,e(d)}}const Va=typeof XMLHttpRequest<"u",za=Va&&function(e){return new Promise(function(n,r){let s=e.data;const i=Ce.from(e.headers).normalize(),a=e.responseType;let c;function h(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}g.isFormData(s)&&(_e.isStandardBrowserEnv||_e.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(w+":"+b))}const d=Gs(e.baseURL,e.url);l.open(e.method.toUpperCase(),qs(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function m(){if(!l)return;const w=Ce.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:w,config:e,request:l};Fa(function(J){n(J),h()},function(J){r(J),h()},O),l=null}if("onloadend"in l?l.onloadend=m:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(m)},l.onabort=function(){l&&(r(new L("Request aborted",L.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new L("Network Error",L.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let b=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const O=e.transitional||Ys;e.timeoutErrorMessage&&(b=e.timeoutErrorMessage),r(new L(b,O.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,e,l)),l=null},_e.isStandardBrowserEnv){const w=(e.withCredentials||La(d))&&e.xsrfCookieName&&Ma.read(e.xsrfCookieName);w&&i.set(e.xsrfHeaderName,w)}s===void 0&&i.setContentType(null),"setRequestHeader"in l&&g.forEach(i.toJSON(),function(b,O){l.setRequestHeader(O,b)}),g.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",os(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",os(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=w=>{l&&(r(!w||w.type?new At(null,e,l):w),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const E=Ba(d);if(E&&_e.protocols.indexOf(E)===-1){r(new L("Unsupported protocol "+E+":",L.ERR_BAD_REQUEST,e));return}l.send(s||null)})},Xt={http:ma,xhr:za};g.forEach(Xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xs={getAdapter:e=>{e=g.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=g.isString(n)?Xt[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new L(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(g.hasOwnProp(Xt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!g.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Xt};function Un(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function is(e){return Un(e),e.headers=Ce.from(e.headers),e.data=Nn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xs.getAdapter(e.adapter||fr.adapter)(e).then(function(r){return Un(e),r.data=Nn.call(e,e.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return Ks(r)||(Un(e),r&&r.response&&(r.response.data=Nn.call(e,e.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const as=e=>e instanceof Ce?e.toJSON():e;function dt(e,t){t=t||{};const n={};function r(l,d,m){return g.isPlainObject(l)&&g.isPlainObject(d)?g.merge.call({caseless:m},l,d):g.isPlainObject(d)?g.merge({},d):g.isArray(d)?d.slice():d}function s(l,d,m){if(g.isUndefined(d)){if(!g.isUndefined(l))return r(void 0,l,m)}else return r(l,d,m)}function i(l,d){if(!g.isUndefined(d))return r(void 0,d)}function a(l,d){if(g.isUndefined(d)){if(!g.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function c(l,d,m){if(m in t)return r(l,d);if(m in e)return r(void 0,l)}const h={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(l,d)=>s(as(l),as(d),!0)};return g.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=h[d]||s,E=m(e[d],t[d],d);g.isUndefined(E)&&m!==c||(n[d]=E)}),n}const Zs="1.5.0",lr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const us={};lr.transitional=function(t,n,r){function s(i,a){return"[Axios v"+Zs+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,c)=>{if(t===!1)throw new L(s(a," has been removed"+(n?" in "+n:"")),L.ERR_DEPRECATED);return n&&!us[a]&&(us[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,c):!0}};function Ha(e,t,n){if(typeof e!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const c=e[i],h=c===void 0||a(c,i,e);if(h!==!0)throw new L("option "+i+" must be "+h,L.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new L("Unknown option "+i,L.ERR_BAD_OPTION)}}const qn={assertOptions:Ha,validators:lr},De=qn.validators;class nn{constructor(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&qn.assertOptions(r,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),s!=null&&(g.isFunction(s)?n.paramsSerializer={serialize:s}:qn.assertOptions(s,{encode:De.function,serialize:De.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=Ce.concat(a,i);const c=[];let h=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(n)===!1||(h=h&&O.synchronous,c.unshift(O.fulfilled,O.rejected))});const l=[];this.interceptors.response.forEach(function(O){l.push(O.fulfilled,O.rejected)});let d,m=0,E;if(!h){const b=[is.bind(this),void 0];for(b.unshift.apply(b,c),b.push.apply(b,l),E=b.length,d=Promise.resolve(n);m<E;)d=d.then(b[m++],b[m++]);return d}E=c.length;let w=n;for(m=0;m<E;){const b=c[m++],O=c[m++];try{w=b(w)}catch(j){O.call(this,j);break}}try{d=is.call(this,w)}catch(b){return Promise.reject(b)}for(m=0,E=l.length;m<E;)d=d.then(l[m++],l[m++]);return d}getUri(t){t=dt(this.defaults,t);const n=Gs(t.baseURL,t.url);return qs(n,t.params,t.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(t){nn.prototype[t]=function(n,r){return this.request(dt(r||{},{method:t,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,c){return this.request(dt(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}nn.prototype[t]=n(),nn.prototype[t+"Form"]=n(!0)});const Zt=nn;class dr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(c=>{r.subscribe(c),i=c}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,c){r.reason||(r.reason=new At(i,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new dr(function(s){t=s}),cancel:t}}}const qa=dr;function Ya(e){return function(n){return e.apply(null,n)}}function Ja(e){return g.isObject(e)&&e.isAxiosError===!0}const Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([e,t])=>{Yn[t]=e});const Ka=Yn;function Qs(e){const t=new Zt(e),n=Ds(Zt.prototype.request,t);return g.extend(n,Zt.prototype,t,{allOwnKeys:!0}),g.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qs(dt(e,s))},n}const re=Qs(fr);re.Axios=Zt;re.CanceledError=At;re.CancelToken=qa;re.isCancel=Ks;re.VERSION=Zs;re.toFormData=cn;re.AxiosError=L;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=Ya;re.isAxiosError=Ja;re.mergeConfig=dt;re.AxiosHeaders=Ce;re.formToJSON=e=>Js(g.isHTMLForm(e)?new FormData(e):e);re.getAdapter=Xs.getAdapter;re.HttpStatusCode=Ka;re.default=re;const Ga=re;async function cs(e,t){const n=await fetch(e,t);return n.status===200?n.json():Promise.resolve({message:n.statusText,success:!1})}const rn=ir({types:{context:{},events:{},input:{}},actions:{setUserContext:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="AUTHENTICATE_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetUserContext:ge(()=>({user:null,accessToken:"",refreshToken:"",ignoreRefreshToken:!1})),setAccessToken:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="REFRESH_TOKEN_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetRefreshToken:ge(()=>({refreshToken:""})),setIgnoreRefreshToken:ge(()=>({ignoreRefreshToken:!0})),addError:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.error.actor"))return e;const n=t;return{errors:[...e.errors,String(n.error).replace("Error: ","")]}}),clearErrors:ge(()=>({errors:[]}))},actors:{refreshAccessToken:$n(async({input:e})=>{let t;if(typeof window>"u"){if(e.context.refreshToken==="")throw new Error("Unauthorized.");try{const n=await Ga.post(e.context.endpoints.ssrRefresh,{grant_type:"refresh_token"},{headers:{Cookie:`refresh_token=${e.context.refreshToken}`,"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},withCredentials:!0}),{data:r}=n;if(typeof r.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:r.accessToken}}catch{throw new Error("Could not complete refresh request (server)")}}else{t=await cs(e.context.endpoints.refresh,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({grant_type:"refresh_token"}).toString()});const n=t;if(typeof n.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:n.accessToken}}}),authenticate:$n(async({input:e})=>{var r;const n=await cs(e.context.endpoints.login,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({username:e.username,password:e.password}).toString()});if(!n.success)throw new Error(((r=n.message)==null?void 0:r.toString())??"Sign in failed. Please try again.");return{type:"AUTHENTICATE_SUCCESS",accessToken:n.accessToken}}),unauthenticate:$n(async({input:e})=>(await fetch(e.context.endpoints.logout,{method:"POST",mode:"cors",credentials:"include",headers:{"clicktap-scope":"view","clicktap-scope-id":"default"}}),{type:"UNAUTHENTICATE"}))}}).createMachine({id:"auth",context:({input:e})=>{var t,n;return{user:null,accessToken:"",refreshToken:((t=e==null?void 0:e.initialContext)==null?void 0:t.refreshToken)??"",ignoreRefreshToken:!1,endpoints:((n=e==null?void 0:e.initialContext)==null?void 0:n.endpoints)??{login:"",logout:"",refresh:"",ssrRefresh:""},errors:[]}},initial:"refreshing",states:{authenticating:{invoke:{src:"authenticate",input:({context:e,event:t})=>t.type!=="LOGIN"?{context:e,username:"",password:""}:{context:e,username:t.username,password:t.password},onDone:[{actions:"setUserContext",target:"loggedIn"}],onError:[{actions:"addError",target:"loggedOut"}]}},unauthenticating:{invoke:{src:"unauthenticate",input:({context:e})=>({context:e}),onDone:[{actions:"unsetUserContext",target:"loggedOut"}],onError:[{actions:["unsetUserContext","setIgnoreRefreshToken"],target:"loggedOut"}]}},refreshing:{invoke:{src:"refreshAccessToken",input:({context:e})=>({context:e}),onDone:[{actions:["unsetRefreshToken","setAccessToken"],target:"loggedIn"}],onError:[{actions:"unsetRefreshToken",target:"unauthenticating"}]}},loggedOut:{on:{LOGIN:{target:"authenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}},loggedIn:{after:{84e4:{guard:()=>typeof window<"u",target:"refreshing"}},on:{LOGOUT:{target:"unauthenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}}}});var Jn={exports:{}},bt={},Kn={exports:{}},$={};/**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.min.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/var fs;function Xa(){if(fs)return $;fs=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.iterator;function E(p){return p===null||typeof p!="object"?null:(p=m&&p[m]||p["@@iterator"],typeof p=="function"?p:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,O={};function j(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||w}j.prototype.isReactComponent={},j.prototype.setState=function(p,T){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,T,"setState")},j.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function J(){}J.prototype=j.prototype;function W(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||w}var he=W.prototype=new J;he.constructor=W,b(he,j.prototype),he.isPureReactComponent=!0;var pe=Array.isArray,te=Object.prototype.hasOwnProperty,ue={current:null},Ee={key:!0,ref:!0,__self:!0,__source:!0};function Te(p,T,I){var B,F={},Y=null,K=null;if(T!=null)for(B in T.ref!==void 0&&(K=T.ref),T.key!==void 0&&(Y=""+T.key),T)te.call(T,B)&&!Ee.hasOwnProperty(B)&&(F[B]=T[B]);var H=arguments.length-2;if(H===1)F.children=I;else if(1<H){for(var V=Array(H),se=0;se<H;se++)V[se]=arguments[se+2];F.children=V}if(p&&p.defaultProps)for(B in H=p.defaultProps,H)F[B]===void 0&&(F[B]=H[B]);return{$$typeof:e,type:p,key:Y,ref:K,props:F,_owner:ue.current}}function Me(p,T){return{$$typeof:e,type:p.type,key:T,ref:p.ref,props:p.props,_owner:p._owner}}function Ne(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function pt(p){var T={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(I){return T[I]})}var Ue=/\/+/g;function ce(p,T){return typeof p=="object"&&p!==null&&p.key!=null?pt(""+p.key):T.toString(36)}function le(p,T,I,B,F){var Y=typeof p;(Y==="undefined"||Y==="boolean")&&(p=null);var K=!1;if(p===null)K=!0;else switch(Y){case"string":case"number":K=!0;break;case"object":switch(p.$$typeof){case e:case t:K=!0}}if(K)return K=p,F=F(K),p=B===""?"."+ce(K,0):B,pe(F)?(I="",p!=null&&(I=p.replace(Ue,"$&/")+"/"),le(F,T,I,"",function(se){return se})):F!=null&&(Ne(F)&&(F=Me(F,I+(!F.key||K&&K.key===F.key?"":(""+F.key).replace(Ue,"$&/")+"/")+p)),T.push(F)),1;if(K=0,B=B===""?".":B+":",pe(p))for(var H=0;H<p.length;H++){Y=p[H];var V=B+ce(Y,H);K+=le(Y,T,I,V,F)}else if(V=E(p),typeof V=="function")for(p=V.call(p),H=0;!(Y=p.next()).done;)Y=Y.value,V=B+ce(Y,H++),K+=le(Y,T,I,V,F);else if(Y==="object")throw T=String(p),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.");return K}function oe(p,T,I){if(p==null)return p;var B=[],F=0;return le(p,B,"","",function(Y){return T.call(I,Y,F++)}),B}function me(p){if(p._status===-1){var T=p._result;T=T(),T.then(function(I){(p._status===0||p._status===-1)&&(p._status=1,p._result=I)},function(I){(p._status===0||p._status===-1)&&(p._status=2,p._result=I)}),p._status===-1&&(p._status=0,p._result=T)}if(p._status===1)return p._result.default;throw p._result}var k={current:null},be={transition:null},Le={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:be,ReactCurrentOwner:ue};return $.Children={map:oe,forEach:function(p,T,I){oe(p,function(){T.apply(this,arguments)},I)},count:function(p){var T=0;return oe(p,function(){T++}),T},toArray:function(p){return oe(p,function(T){return T})||[]},only:function(p){if(!Ne(p))throw Error("React.Children.only expected to receive a single React element child.");return p}},$.Component=j,$.Fragment=n,$.Profiler=s,$.PureComponent=W,$.StrictMode=r,$.Suspense=h,$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Le,$.cloneElement=function(p,T,I){if(p==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+p+".");var B=b({},p.props),F=p.key,Y=p.ref,K=p._owner;if(T!=null){if(T.ref!==void 0&&(Y=T.ref,K=ue.current),T.key!==void 0&&(F=""+T.key),p.type&&p.type.defaultProps)var H=p.type.defaultProps;for(V in T)te.call(T,V)&&!Ee.hasOwnProperty(V)&&(B[V]=T[V]===void 0&&H!==void 0?H[V]:T[V])}var V=arguments.length-2;if(V===1)B.children=I;else if(1<V){H=Array(V);for(var se=0;se<V;se++)H[se]=arguments[se+2];B.children=H}return{$$typeof:e,type:p.type,key:F,ref:Y,props:B,_owner:K}},$.createContext=function(p){return p={$$typeof:a,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},p.Provider={$$typeof:i,_context:p},p.Consumer=p},$.createElement=Te,$.createFactory=function(p){var T=Te.bind(null,p);return T.type=p,T},$.createRef=function(){return{current:null}},$.forwardRef=function(p){return{$$typeof:c,render:p}},$.isValidElement=Ne,$.lazy=function(p){return{$$typeof:d,_payload:{_status:-1,_result:p},_init:me}},$.memo=function(p,T){return{$$typeof:l,type:p,compare:T===void 0?null:T}},$.startTransition=function(p){var T=be.transition;be.transition={};try{p()}finally{be.transition=T}},$.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},$.useCallback=function(p,T){return k.current.useCallback(p,T)},$.useContext=function(p){return k.current.useContext(p)},$.useDebugValue=function(){},$.useDeferredValue=function(p){return k.current.useDeferredValue(p)},$.useEffect=function(p,T){return k.current.useEffect(p,T)},$.useId=function(){return k.current.useId()},$.useImperativeHandle=function(p,T,I){return k.current.useImperativeHandle(p,T,I)},$.useInsertionEffect=function(p,T){return k.current.useInsertionEffect(p,T)},$.useLayoutEffect=function(p,T){return k.current.useLayoutEffect(p,T)},$.useMemo=function(p,T){return k.current.useMemo(p,T)},$.useReducer=function(p,T,I){return k.current.useReducer(p,T,I)},$.useRef=function(p){return k.current.useRef(p)},$.useState=function(p){return k.current.useState(p)},$.useSyncExternalStore=function(p,T,I){return k.current.useSyncExternalStore(p,T,I)},$.useTransition=function(){return k.current.useTransition()},$.version="18.2.0",$}var wt={exports:{}};/**
|
|
14
|
+
* @license React
|
|
15
|
+
* react.development.js
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/wt.exports;var ls;function Za(){return ls||(ls=1,function(e,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.2.0",r=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),j=Symbol.iterator,J="@@iterator";function W(o){if(o===null||typeof o!="object")return null;var u=j&&o[j]||o[J];return typeof u=="function"?u:null}var he={current:null},pe={transition:null},te={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},ue={current:null},Ee={},Te=null;function Me(o){Te=o}Ee.setExtraStackFrame=function(o){Te=o},Ee.getCurrentStack=null,Ee.getStackAddendum=function(){var o="";Te&&(o+=Te);var u=Ee.getCurrentStack;return u&&(o+=u()||""),o};var Ne=!1,pt=!1,Ue=!1,ce=!1,le=!1,oe={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:pe,ReactCurrentOwner:ue};oe.ReactDebugCurrentFrame=Ee,oe.ReactCurrentActQueue=te;function me(o){{for(var u=arguments.length,y=new Array(u>1?u-1:0),v=1;v<u;v++)y[v-1]=arguments[v];be("warn",o,y)}}function k(o){{for(var u=arguments.length,y=new Array(u>1?u-1:0),v=1;v<u;v++)y[v-1]=arguments[v];be("error",o,y)}}function be(o,u,y){{var v=oe.ReactDebugCurrentFrame,S=v.getStackAddendum();S!==""&&(u+="%s",y=y.concat([S]));var x=y.map(function(A){return String(A)});x.unshift("Warning: "+u),Function.prototype.apply.call(console[o],console,x)}}var Le={};function p(o,u){{var y=o.constructor,v=y&&(y.displayName||y.name)||"ReactClass",S=v+"."+u;if(Le[S])return;k("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",u,v),Le[S]=!0}}var T={isMounted:function(o){return!1},enqueueForceUpdate:function(o,u,y){p(o,"forceUpdate")},enqueueReplaceState:function(o,u,y,v){p(o,"replaceState")},enqueueSetState:function(o,u,y,v){p(o,"setState")}},I=Object.assign,B={};Object.freeze(B);function F(o,u,y){this.props=o,this.context=u,this.refs=B,this.updater=y||T}F.prototype.isReactComponent={},F.prototype.setState=function(o,u){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,u,"setState")},F.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};{var Y={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},K=function(o,u){Object.defineProperty(F.prototype,o,{get:function(){me("%s(...) is deprecated in plain JavaScript React classes. %s",u[0],u[1])}})};for(var H in Y)Y.hasOwnProperty(H)&&K(H,Y[H])}function V(){}V.prototype=F.prototype;function se(o,u,y){this.props=o,this.context=u,this.refs=B,this.updater=y||T}var ke=se.prototype=new V;ke.constructor=se,I(ke,F.prototype),ke.isPureReactComponent=!0;function ln(){var o={current:null};return Object.seal(o),o}var kt=Array.isArray;function Qe(o){return kt(o)}function dn(o){{var u=typeof Symbol=="function"&&Symbol.toStringTag,y=u&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y}}function et(o){try{return Be(o),!1}catch{return!0}}function Be(o){return""+o}function We(o){if(et(o))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dn(o)),Be(o)}function xt(o,u,y){var v=o.displayName;if(v)return v;var S=u.displayName||u.name||"";return S!==""?y+"("+S+")":y}function Ve(o){return o.displayName||"Context"}function Se(o){if(o==null)return null;if(typeof o.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case i:return"Fragment";case s:return"Portal";case c:return"Profiler";case a:return"StrictMode";case m:return"Suspense";case E:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var u=o;return Ve(u)+".Consumer";case h:var y=o;return Ve(y._context)+".Provider";case d:return xt(o,o.render,"ForwardRef");case w:var v=o.displayName||null;return v!==null?v:Se(o.type)||"Memo";case b:{var S=o,x=S._payload,A=S._init;try{return Se(A(x))}catch{return null}}}return null}var ze=Object.prototype.hasOwnProperty,tt={key:!0,ref:!0,__self:!0,__source:!0},Pt,It,nt;nt={};function yt(o){if(ze.call(o,"ref")){var u=Object.getOwnPropertyDescriptor(o,"ref").get;if(u&&u.isReactWarning)return!1}return o.ref!==void 0}function xe(o){if(ze.call(o,"key")){var u=Object.getOwnPropertyDescriptor(o,"key").get;if(u&&u.isReactWarning)return!1}return o.key!==void 0}function hn(o,u){var y=function(){Pt||(Pt=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}function jt(o,u){var y=function(){It||(It=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};y.isReactWarning=!0,Object.defineProperty(o,"ref",{get:y,configurable:!0})}function Dt(o){if(typeof o.ref=="string"&&ue.current&&o.__self&&ue.current.stateNode!==o.__self){var u=Se(ue.current.type);nt[u]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',u,o.ref),nt[u]=!0)}}var He=function(o,u,y,v,S,x,A){var P={$$typeof:r,type:o,key:u,ref:y,props:A,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function pn(o,u,y){var v,S={},x=null,A=null,P=null,N=null;if(u!=null){yt(u)&&(A=u.ref,Dt(u)),xe(u)&&(We(u.key),x=""+u.key),P=u.__self===void 0?null:u.__self,N=u.__source===void 0?null:u.__source;for(v in u)ze.call(u,v)&&!tt.hasOwnProperty(v)&&(S[v]=u[v])}var q=arguments.length-2;if(q===1)S.children=y;else if(q>1){for(var G=Array(q),X=0;X<q;X++)G[X]=arguments[X+2];Object.freeze&&Object.freeze(G),S.children=G}if(o&&o.defaultProps){var Q=o.defaultProps;for(v in Q)S[v]===void 0&&(S[v]=Q[v])}if(x||A){var ne=typeof o=="function"?o.displayName||o.name||"Unknown":o;x&&hn(S,ne),A&&jt(S,ne)}return He(o,x,A,P,N,ue.current,S)}function yn(o,u){var y=He(o.type,u,o.ref,o._self,o._source,o._owner,o.props);return y}function mn(o,u,y){if(o==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var v,S=I({},o.props),x=o.key,A=o.ref,P=o._self,N=o._source,q=o._owner;if(u!=null){yt(u)&&(A=u.ref,q=ue.current),xe(u)&&(We(u.key),x=""+u.key);var G;o.type&&o.type.defaultProps&&(G=o.type.defaultProps);for(v in u)ze.call(u,v)&&!tt.hasOwnProperty(v)&&(u[v]===void 0&&G!==void 0?S[v]=G[v]:S[v]=u[v])}var X=arguments.length-2;if(X===1)S.children=y;else if(X>1){for(var Q=Array(X),ne=0;ne<X;ne++)Q[ne]=arguments[ne+2];S.children=Q}return He(o.type,x,A,P,N,q,S)}function Pe(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}var $t=".",vn=":";function gn(o){var u=/[=:]/g,y={"=":"=0",":":"=2"},v=o.replace(u,function(S){return y[S]});return"$"+v}var rt=!1,Ft=/\/+/g;function Re(o){return o.replace(Ft,"$&/")}function qe(o,u){return typeof o=="object"&&o!==null&&o.key!=null?(We(o.key),gn(""+o.key)):u.toString(36)}function Ie(o,u,y,v,S){var x=typeof o;(x==="undefined"||x==="boolean")&&(o=null);var A=!1;if(o===null)A=!0;else switch(x){case"string":case"number":A=!0;break;case"object":switch(o.$$typeof){case r:case s:A=!0}}if(A){var P=o,N=S(P),q=v===""?$t+qe(P,0):v;if(Qe(N)){var G="";q!=null&&(G=Re(q)+"/"),Ie(N,u,G,"",function(Ao){return Ao})}else N!=null&&(Pe(N)&&(N.key&&(!P||P.key!==N.key)&&We(N.key),N=yn(N,y+(N.key&&(!P||P.key!==N.key)?Re(""+N.key)+"/":"")+q)),u.push(N));return 1}var X,Q,ne=0,ae=v===""?$t:v+vn;if(Qe(o))for(var Yt=0;Yt<o.length;Yt++)X=o[Yt],Q=ae+qe(X,Yt),ne+=Ie(X,u,y,Q,S);else{var In=W(o);if(typeof In=="function"){var $r=o;In===$r.entries&&(rt||me("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),rt=!0);for(var Oo=In.call($r),Fr,Co=0;!(Fr=Oo.next()).done;)X=Fr.value,Q=ae+qe(X,Co++),ne+=Ie(X,u,y,Q,S)}else if(x==="object"){var Mr=String(o);throw new Error("Objects are not valid as a React child (found: "+(Mr==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":Mr)+"). If you meant to render a collection of children, use an array instead.")}}return ne}function Ye(o,u,y){if(o==null)return o;var v=[],S=0;return Ie(o,v,"","",function(x){return u.call(y,x,S++)}),v}function _n(o){var u=0;return Ye(o,function(){u++}),u}function Mt(o,u,y){Ye(o,function(){u.apply(this,arguments)},y)}function En(o){return Ye(o,function(u){return u})||[]}function Nt(o){if(!Pe(o))throw new Error("React.Children.only expected to receive a single React element child.");return o}function Ut(o){var u={$$typeof:l,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};u.Provider={$$typeof:h,_context:u};var y=!1,v=!1,S=!1;{var x={$$typeof:l,_context:u};Object.defineProperties(x,{Provider:{get:function(){return v||(v=!0,k("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),u.Provider},set:function(A){u.Provider=A}},_currentValue:{get:function(){return u._currentValue},set:function(A){u._currentValue=A}},_currentValue2:{get:function(){return u._currentValue2},set:function(A){u._currentValue2=A}},_threadCount:{get:function(){return u._threadCount},set:function(A){u._threadCount=A}},Consumer:{get:function(){return y||(y=!0,k("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),u.Consumer}},displayName:{get:function(){return u.displayName},set:function(A){S||(me("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",A),S=!0)}}}),u.Consumer=x}return u._currentRenderer=null,u._currentRenderer2=null,u}var Je=-1,mt=0,vt=1,bn=2;function Sn(o){if(o._status===Je){var u=o._result,y=u();if(y.then(function(x){if(o._status===mt||o._status===Je){var A=o;A._status=vt,A._result=x}},function(x){if(o._status===mt||o._status===Je){var A=o;A._status=bn,A._result=x}}),o._status===Je){var v=o;v._status=mt,v._result=y}}if(o._status===vt){var S=o._result;return S===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
22
|
+
|
|
23
|
+
Your code should look like:
|
|
24
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
25
|
+
|
|
26
|
+
Did you accidentally put curly braces around the import?`,S),"default"in S||k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
27
|
+
|
|
28
|
+
Your code should look like:
|
|
29
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,S),S.default}else throw o._result}function wn(o){var u={_status:Je,_result:o},y={$$typeof:b,_payload:u,_init:Sn};{var v,S;Object.defineProperties(y,{defaultProps:{configurable:!0,get:function(){return v},set:function(x){k("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),v=x,Object.defineProperty(y,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return S},set:function(x){k("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),S=x,Object.defineProperty(y,"propTypes",{enumerable:!0})}}})}return y}function Tn(o){o!=null&&o.$$typeof===w?k("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof o!="function"?k("forwardRef requires a render function but was given %s.",o===null?"null":typeof o):o.length!==0&&o.length!==2&&k("forwardRef render functions accept exactly two parameters: props and ref. %s",o.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),o!=null&&(o.defaultProps!=null||o.propTypes!=null)&&k("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var u={$$typeof:d,render:o};{var y;Object.defineProperty(u,"displayName",{enumerable:!1,configurable:!0,get:function(){return y},set:function(v){y=v,!o.name&&!o.displayName&&(o.displayName=v)}})}return u}var f;f=Symbol.for("react.module.reference");function _(o){return!!(typeof o=="string"||typeof o=="function"||o===i||o===c||le||o===a||o===m||o===E||ce||o===O||Ne||pt||Ue||typeof o=="object"&&o!==null&&(o.$$typeof===b||o.$$typeof===w||o.$$typeof===h||o.$$typeof===l||o.$$typeof===d||o.$$typeof===f||o.getModuleId!==void 0))}function R(o,u){_(o)||k("memo: The first argument must be a component. Instead received: %s",o===null?"null":typeof o);var y={$$typeof:w,type:o,compare:u===void 0?null:u};{var v;Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return v},set:function(S){v=S,!o.name&&!o.displayName&&(o.displayName=S)}})}return y}function C(){var o=he.current;return o===null&&k(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
30
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
31
|
+
2. You might be breaking the Rules of Hooks
|
|
32
|
+
3. You might have more than one copy of React in the same app
|
|
33
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),o}function U(o){var u=C();if(o._context!==void 0){var y=o._context;y.Consumer===o?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):y.Provider===o&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return u.useContext(o)}function z(o){var u=C();return u.useState(o)}function M(o,u,y){var v=C();return v.useReducer(o,u,y)}function D(o){var u=C();return u.useRef(o)}function ie(o,u){var y=C();return y.useEffect(o,u)}function Z(o,u){var y=C();return y.useInsertionEffect(o,u)}function ee(o,u){var y=C();return y.useLayoutEffect(o,u)}function de(o,u){var y=C();return y.useCallback(o,u)}function je(o,u){var y=C();return y.useMemo(o,u)}function Lt(o,u,y){var v=C();return v.useImperativeHandle(o,u,y)}function ve(o,u){{var y=C();return y.useDebugValue(o,u)}}function no(){var o=C();return o.useTransition()}function ro(o){var u=C();return u.useDeferredValue(o)}function so(){var o=C();return o.useId()}function oo(o,u,y){var v=C();return v.useSyncExternalStore(o,u,y)}var gt=0,yr,mr,vr,gr,_r,Er,br;function Sr(){}Sr.__reactDisabledLog=!0;function io(){{if(gt===0){yr=console.log,mr=console.info,vr=console.warn,gr=console.error,_r=console.group,Er=console.groupCollapsed,br=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}gt++}}function ao(){{if(gt--,gt===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},o,{value:yr}),info:I({},o,{value:mr}),warn:I({},o,{value:vr}),error:I({},o,{value:gr}),group:I({},o,{value:_r}),groupCollapsed:I({},o,{value:Er}),groupEnd:I({},o,{value:br})})}gt<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Rn=oe.ReactCurrentDispatcher,On;function Bt(o,u,y){{if(On===void 0)try{throw Error()}catch(S){var v=S.stack.trim().match(/\n( *(at )?)/);On=v&&v[1]||""}return`
|
|
34
|
+
`+On+o}}var Cn=!1,Wt;{var uo=typeof WeakMap=="function"?WeakMap:Map;Wt=new uo}function wr(o,u){if(!o||Cn)return"";{var y=Wt.get(o);if(y!==void 0)return y}var v;Cn=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=Rn.current,Rn.current=null,io();try{if(u){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[])}catch(ae){v=ae}Reflect.construct(o,[],A)}else{try{A.call()}catch(ae){v=ae}o.call(A.prototype)}}else{try{throw Error()}catch(ae){v=ae}o()}}catch(ae){if(ae&&v&&typeof ae.stack=="string"){for(var P=ae.stack.split(`
|
|
35
|
+
`),N=v.stack.split(`
|
|
36
|
+
`),q=P.length-1,G=N.length-1;q>=1&&G>=0&&P[q]!==N[G];)G--;for(;q>=1&&G>=0;q--,G--)if(P[q]!==N[G]){if(q!==1||G!==1)do if(q--,G--,G<0||P[q]!==N[G]){var X=`
|
|
37
|
+
`+P[q].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),typeof o=="function"&&Wt.set(o,X),X}while(q>=1&&G>=0);break}}}finally{Cn=!1,Rn.current=x,ao(),Error.prepareStackTrace=S}var Q=o?o.displayName||o.name:"",ne=Q?Bt(Q):"";return typeof o=="function"&&Wt.set(o,ne),ne}function co(o,u,y){return wr(o,!1)}function fo(o){var u=o.prototype;return!!(u&&u.isReactComponent)}function Vt(o,u,y){if(o==null)return"";if(typeof o=="function")return wr(o,fo(o));if(typeof o=="string")return Bt(o);switch(o){case m:return Bt("Suspense");case E:return Bt("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case d:return co(o.render);case w:return Vt(o.type,u,y);case b:{var v=o,S=v._payload,x=v._init;try{return Vt(x(S),u,y)}catch{}}}return""}var Tr={},Rr=oe.ReactDebugCurrentFrame;function zt(o){if(o){var u=o._owner,y=Vt(o.type,o._source,u?u.type:null);Rr.setExtraStackFrame(y)}else Rr.setExtraStackFrame(null)}function lo(o,u,y,v,S){{var x=Function.call.bind(ze);for(var A in o)if(x(o,A)){var P=void 0;try{if(typeof o[A]!="function"){var N=Error((v||"React class")+": "+y+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}P=o[A](u,A,v,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){P=q}P&&!(P instanceof Error)&&(zt(S),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",y,A,typeof P),zt(null)),P instanceof Error&&!(P.message in Tr)&&(Tr[P.message]=!0,zt(S),k("Failed %s type: %s",y,P.message),zt(null))}}}function st(o){if(o){var u=o._owner,y=Vt(o.type,o._source,u?u.type:null);Me(y)}else Me(null)}var An;An=!1;function Or(){if(ue.current){var o=Se(ue.current.type);if(o)return`
|
|
38
|
+
|
|
39
|
+
Check the render method of \``+o+"`."}return""}function ho(o){if(o!==void 0){var u=o.fileName.replace(/^.*[\\\/]/,""),y=o.lineNumber;return`
|
|
40
|
+
|
|
41
|
+
Check your code at `+u+":"+y+"."}return""}function po(o){return o!=null?ho(o.__source):""}var Cr={};function yo(o){var u=Or();if(!u){var y=typeof o=="string"?o:o.displayName||o.name;y&&(u=`
|
|
42
|
+
|
|
43
|
+
Check the top-level render call using <`+y+">.")}return u}function Ar(o,u){if(!(!o._store||o._store.validated||o.key!=null)){o._store.validated=!0;var y=yo(u);if(!Cr[y]){Cr[y]=!0;var v="";o&&o._owner&&o._owner!==ue.current&&(v=" It was passed a child from "+Se(o._owner.type)+"."),st(o),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,v),st(null)}}}function kr(o,u){if(typeof o=="object"){if(Qe(o))for(var y=0;y<o.length;y++){var v=o[y];Pe(v)&&Ar(v,u)}else if(Pe(o))o._store&&(o._store.validated=!0);else if(o){var S=W(o);if(typeof S=="function"&&S!==o.entries)for(var x=S.call(o),A;!(A=x.next()).done;)Pe(A.value)&&Ar(A.value,u)}}}function xr(o){{var u=o.type;if(u==null||typeof u=="string")return;var y;if(typeof u=="function")y=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===d||u.$$typeof===w))y=u.propTypes;else return;if(y){var v=Se(u);lo(y,o.props,"prop",v,o)}else if(u.PropTypes!==void 0&&!An){An=!0;var S=Se(u);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mo(o){{for(var u=Object.keys(o.props),y=0;y<u.length;y++){var v=u[y];if(v!=="children"&&v!=="key"){st(o),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),st(null);break}}o.ref!==null&&(st(o),k("Invalid attribute `ref` supplied to `React.Fragment`."),st(null))}}function Pr(o,u,y){var v=_(o);if(!v){var S="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=po(u);x?S+=x:S+=Or();var A;o===null?A="null":Qe(o)?A="array":o!==void 0&&o.$$typeof===r?(A="<"+(Se(o.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):A=typeof o,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,S)}var P=pn.apply(this,arguments);if(P==null)return P;if(v)for(var N=2;N<arguments.length;N++)kr(arguments[N],o);return o===i?mo(P):xr(P),P}var Ir=!1;function vo(o){var u=Pr.bind(null,o);return u.type=o,Ir||(Ir=!0,me("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(u,"type",{enumerable:!1,get:function(){return me("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:o}),o}}),u}function go(o,u,y){for(var v=mn.apply(this,arguments),S=2;S<arguments.length;S++)kr(arguments[S],v.type);return xr(v),v}function _o(o,u){var y=pe.transition;pe.transition={};var v=pe.transition;pe.transition._updatedFibers=new Set;try{o()}finally{if(pe.transition=y,y===null&&v._updatedFibers){var S=v._updatedFibers.size;S>10&&me("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),v._updatedFibers.clear()}}}var jr=!1,Ht=null;function Eo(o){if(Ht===null)try{var u=("require"+Math.random()).slice(0,7),y=e&&e[u];Ht=y.call(e,"timers").setImmediate}catch{Ht=function(S){jr===!1&&(jr=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var x=new MessageChannel;x.port1.onmessage=S,x.port2.postMessage(void 0)}}return Ht(o)}var ot=0,Dr=!1;function bo(o){{var u=ot;ot++,te.current===null&&(te.current=[]);var y=te.isBatchingLegacy,v;try{if(te.isBatchingLegacy=!0,v=o(),!y&&te.didScheduleLegacyUpdate){var S=te.current;S!==null&&(te.didScheduleLegacyUpdate=!1,Pn(S))}}catch(Q){throw qt(u),Q}finally{te.isBatchingLegacy=y}if(v!==null&&typeof v=="object"&&typeof v.then=="function"){var x=v,A=!1,P={then:function(Q,ne){A=!0,x.then(function(ae){qt(u),ot===0?kn(ae,Q,ne):Q(ae)},function(ae){qt(u),ne(ae)})}};return!Dr&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){A||(Dr=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),P}else{var N=v;if(qt(u),ot===0){var q=te.current;q!==null&&(Pn(q),te.current=null);var G={then:function(Q,ne){te.current===null?(te.current=[],kn(N,Q,ne)):Q(N)}};return G}else{var X={then:function(Q,ne){Q(N)}};return X}}}}function qt(o){o!==ot-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),ot=o}function kn(o,u,y){{var v=te.current;if(v!==null)try{Pn(v),Eo(function(){v.length===0?(te.current=null,u(o)):kn(o,u,y)})}catch(S){y(S)}else u(o)}}var xn=!1;function Pn(o){if(!xn){xn=!0;var u=0;try{for(;u<o.length;u++){var y=o[u];do y=y(!0);while(y!==null)}o.length=0}catch(v){throw o=o.slice(u+1),v}finally{xn=!1}}}var So=Pr,wo=go,To=vo,Ro={map:Ye,forEach:Mt,count:_n,toArray:En,only:Nt};t.Children=Ro,t.Component=F,t.Fragment=i,t.Profiler=c,t.PureComponent=se,t.StrictMode=a,t.Suspense=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,t.cloneElement=wo,t.createContext=Ut,t.createElement=So,t.createFactory=To,t.createRef=ln,t.forwardRef=Tn,t.isValidElement=Pe,t.lazy=wn,t.memo=R,t.startTransition=_o,t.unstable_act=bo,t.useCallback=de,t.useContext=U,t.useDebugValue=ve,t.useDeferredValue=ro,t.useEffect=ie,t.useId=so,t.useImperativeHandle=Lt,t.useInsertionEffect=Z,t.useLayoutEffect=ee,t.useMemo=je,t.useReducer=M,t.useRef=D,t.useState=z,t.useSyncExternalStore=oo,t.useTransition=no,t.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(wt,wt.exports)),wt.exports}process.env.NODE_ENV==="production"?Kn.exports=Xa():Kn.exports=Za();var Ae=Kn.exports;/**
|
|
44
|
+
* @license React
|
|
45
|
+
* react-jsx-runtime.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var ds;function Qa(){if(ds)return bt;ds=1;var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(c,h,l){var d,m={},E=null,w=null;l!==void 0&&(E=""+l),h.key!==void 0&&(E=""+h.key),h.ref!==void 0&&(w=h.ref);for(d in h)r.call(h,d)&&!i.hasOwnProperty(d)&&(m[d]=h[d]);if(c&&c.defaultProps)for(d in h=c.defaultProps,h)m[d]===void 0&&(m[d]=h[d]);return{$$typeof:t,type:c,key:E,ref:w,props:m,_owner:s.current}}return bt.Fragment=n,bt.jsx=a,bt.jsxs=a,bt}var St={};/**
|
|
52
|
+
* @license React
|
|
53
|
+
* react-jsx-runtime.development.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var hs;function eu(){return hs||(hs=1,process.env.NODE_ENV!=="production"&&function(){var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),b=Symbol.iterator,O="@@iterator";function j(f){if(f===null||typeof f!="object")return null;var _=b&&f[b]||f[O];return typeof _=="function"?_:null}var J=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function W(f){{for(var _=arguments.length,R=new Array(_>1?_-1:0),C=1;C<_;C++)R[C-1]=arguments[C];he("error",f,R)}}function he(f,_,R){{var C=J.ReactDebugCurrentFrame,U=C.getStackAddendum();U!==""&&(_+="%s",R=R.concat([U]));var z=R.map(function(M){return String(M)});z.unshift("Warning: "+_),Function.prototype.apply.call(console[f],console,z)}}var pe=!1,te=!1,ue=!1,Ee=!1,Te=!1,Me;Me=Symbol.for("react.module.reference");function Ne(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===i||Te||f===s||f===l||f===d||Ee||f===w||pe||te||ue||typeof f=="object"&&f!==null&&(f.$$typeof===E||f.$$typeof===m||f.$$typeof===a||f.$$typeof===c||f.$$typeof===h||f.$$typeof===Me||f.getModuleId!==void 0))}function pt(f,_,R){var C=f.displayName;if(C)return C;var U=_.displayName||_.name||"";return U!==""?R+"("+U+")":R}function Ue(f){return f.displayName||"Context"}function ce(f){if(f==null)return null;if(typeof f.tag=="number"&&W("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case d:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case c:var _=f;return Ue(_)+".Consumer";case a:var R=f;return Ue(R._context)+".Provider";case h:return pt(f,f.render,"ForwardRef");case m:var C=f.displayName||null;return C!==null?C:ce(f.type)||"Memo";case E:{var U=f,z=U._payload,M=U._init;try{return ce(M(z))}catch{return null}}}return null}var le=Object.assign,oe=0,me,k,be,Le,p,T,I;function B(){}B.__reactDisabledLog=!0;function F(){{if(oe===0){me=console.log,k=console.info,be=console.warn,Le=console.error,p=console.group,T=console.groupCollapsed,I=console.groupEnd;var f={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}oe++}}function Y(){{if(oe--,oe===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:le({},f,{value:me}),info:le({},f,{value:k}),warn:le({},f,{value:be}),error:le({},f,{value:Le}),group:le({},f,{value:p}),groupCollapsed:le({},f,{value:T}),groupEnd:le({},f,{value:I})})}oe<0&&W("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=J.ReactCurrentDispatcher,H;function V(f,_,R){{if(H===void 0)try{throw Error()}catch(U){var C=U.stack.trim().match(/\n( *(at )?)/);H=C&&C[1]||""}return`
|
|
60
|
+
`+H+f}}var se=!1,ke;{var ln=typeof WeakMap=="function"?WeakMap:Map;ke=new ln}function kt(f,_){if(!f||se)return"";{var R=ke.get(f);if(R!==void 0)return R}var C;se=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var z;z=K.current,K.current=null,F();try{if(_){var M=function(){throw Error()};if(Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(ve){C=ve}Reflect.construct(f,[],M)}else{try{M.call()}catch(ve){C=ve}f.call(M.prototype)}}else{try{throw Error()}catch(ve){C=ve}f()}}catch(ve){if(ve&&C&&typeof ve.stack=="string"){for(var D=ve.stack.split(`
|
|
61
|
+
`),ie=C.stack.split(`
|
|
62
|
+
`),Z=D.length-1,ee=ie.length-1;Z>=1&&ee>=0&&D[Z]!==ie[ee];)ee--;for(;Z>=1&&ee>=0;Z--,ee--)if(D[Z]!==ie[ee]){if(Z!==1||ee!==1)do if(Z--,ee--,ee<0||D[Z]!==ie[ee]){var de=`
|
|
63
|
+
`+D[Z].replace(" at new "," at ");return f.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",f.displayName)),typeof f=="function"&&ke.set(f,de),de}while(Z>=1&&ee>=0);break}}}finally{se=!1,K.current=z,Y(),Error.prepareStackTrace=U}var je=f?f.displayName||f.name:"",Lt=je?V(je):"";return typeof f=="function"&&ke.set(f,Lt),Lt}function Qe(f,_,R){return kt(f,!1)}function dn(f){var _=f.prototype;return!!(_&&_.isReactComponent)}function et(f,_,R){if(f==null)return"";if(typeof f=="function")return kt(f,dn(f));if(typeof f=="string")return V(f);switch(f){case l:return V("Suspense");case d:return V("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case h:return Qe(f.render);case m:return et(f.type,_,R);case E:{var C=f,U=C._payload,z=C._init;try{return et(z(U),_,R)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,We={},xt=J.ReactDebugCurrentFrame;function Ve(f){if(f){var _=f._owner,R=et(f.type,f._source,_?_.type:null);xt.setExtraStackFrame(R)}else xt.setExtraStackFrame(null)}function Se(f,_,R,C,U){{var z=Function.call.bind(Be);for(var M in f)if(z(f,M)){var D=void 0;try{if(typeof f[M]!="function"){var ie=Error((C||"React class")+": "+R+" type `"+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[M]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ie.name="Invariant Violation",ie}D=f[M](_,M,C,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){D=Z}D&&!(D instanceof Error)&&(Ve(U),W("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",R,M,typeof D),Ve(null)),D instanceof Error&&!(D.message in We)&&(We[D.message]=!0,Ve(U),W("Failed %s type: %s",R,D.message),Ve(null))}}}var ze=Array.isArray;function tt(f){return ze(f)}function Pt(f){{var _=typeof Symbol=="function"&&Symbol.toStringTag,R=_&&f[Symbol.toStringTag]||f.constructor.name||"Object";return R}}function It(f){try{return nt(f),!1}catch{return!0}}function nt(f){return""+f}function yt(f){if(It(f))return W("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(f)),nt(f)}var xe=J.ReactCurrentOwner,hn={key:!0,ref:!0,__self:!0,__source:!0},jt,Dt,He;He={};function pn(f){if(Be.call(f,"ref")){var _=Object.getOwnPropertyDescriptor(f,"ref").get;if(_&&_.isReactWarning)return!1}return f.ref!==void 0}function yn(f){if(Be.call(f,"key")){var _=Object.getOwnPropertyDescriptor(f,"key").get;if(_&&_.isReactWarning)return!1}return f.key!==void 0}function mn(f,_){if(typeof f.ref=="string"&&xe.current&&_&&xe.current.stateNode!==_){var R=ce(xe.current.type);He[R]||(W('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ce(xe.current.type),f.ref),He[R]=!0)}}function Pe(f,_){{var R=function(){jt||(jt=!0,W("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};R.isReactWarning=!0,Object.defineProperty(f,"key",{get:R,configurable:!0})}}function $t(f,_){{var R=function(){Dt||(Dt=!0,W("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};R.isReactWarning=!0,Object.defineProperty(f,"ref",{get:R,configurable:!0})}}var vn=function(f,_,R,C,U,z,M){var D={$$typeof:t,type:f,key:_,ref:R,props:M,_owner:z};return D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(D,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(D,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D};function gn(f,_,R,C,U){{var z,M={},D=null,ie=null;R!==void 0&&(yt(R),D=""+R),yn(_)&&(yt(_.key),D=""+_.key),pn(_)&&(ie=_.ref,mn(_,U));for(z in _)Be.call(_,z)&&!hn.hasOwnProperty(z)&&(M[z]=_[z]);if(f&&f.defaultProps){var Z=f.defaultProps;for(z in Z)M[z]===void 0&&(M[z]=Z[z])}if(D||ie){var ee=typeof f=="function"?f.displayName||f.name||"Unknown":f;D&&Pe(M,ee),ie&&$t(M,ee)}return vn(f,D,ie,U,C,xe.current,M)}}var rt=J.ReactCurrentOwner,Ft=J.ReactDebugCurrentFrame;function Re(f){if(f){var _=f._owner,R=et(f.type,f._source,_?_.type:null);Ft.setExtraStackFrame(R)}else Ft.setExtraStackFrame(null)}var qe;qe=!1;function Ie(f){return typeof f=="object"&&f!==null&&f.$$typeof===t}function Ye(){{if(rt.current){var f=ce(rt.current.type);if(f)return`
|
|
64
|
+
|
|
65
|
+
Check the render method of \``+f+"`."}return""}}function _n(f){{if(f!==void 0){var _=f.fileName.replace(/^.*[\\\/]/,""),R=f.lineNumber;return`
|
|
66
|
+
|
|
67
|
+
Check your code at `+_+":"+R+"."}return""}}var Mt={};function En(f){{var _=Ye();if(!_){var R=typeof f=="string"?f:f.displayName||f.name;R&&(_=`
|
|
68
|
+
|
|
69
|
+
Check the top-level render call using <`+R+">.")}return _}}function Nt(f,_){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var R=En(_);if(Mt[R])return;Mt[R]=!0;var C="";f&&f._owner&&f._owner!==rt.current&&(C=" It was passed a child from "+ce(f._owner.type)+"."),Re(f),W('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,C),Re(null)}}function Ut(f,_){{if(typeof f!="object")return;if(tt(f))for(var R=0;R<f.length;R++){var C=f[R];Ie(C)&&Nt(C,_)}else if(Ie(f))f._store&&(f._store.validated=!0);else if(f){var U=j(f);if(typeof U=="function"&&U!==f.entries)for(var z=U.call(f),M;!(M=z.next()).done;)Ie(M.value)&&Nt(M.value,_)}}}function Je(f){{var _=f.type;if(_==null||typeof _=="string")return;var R;if(typeof _=="function")R=_.propTypes;else if(typeof _=="object"&&(_.$$typeof===h||_.$$typeof===m))R=_.propTypes;else return;if(R){var C=ce(_);Se(R,f.props,"prop",C,f)}else if(_.PropTypes!==void 0&&!qe){qe=!0;var U=ce(_);W("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof _.getDefaultProps=="function"&&!_.getDefaultProps.isReactClassApproved&&W("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mt(f){{for(var _=Object.keys(f.props),R=0;R<_.length;R++){var C=_[R];if(C!=="children"&&C!=="key"){Re(f),W("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Re(null);break}}f.ref!==null&&(Re(f),W("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}}function vt(f,_,R,C,U,z){{var M=Ne(f);if(!M){var D="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(D+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ie=_n(U);ie?D+=ie:D+=Ye();var Z;f===null?Z="null":tt(f)?Z="array":f!==void 0&&f.$$typeof===t?(Z="<"+(ce(f.type)||"Unknown")+" />",D=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof f,W("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,D)}var ee=gn(f,_,R,U,z);if(ee==null)return ee;if(M){var de=_.children;if(de!==void 0)if(C)if(tt(de)){for(var je=0;je<de.length;je++)Ut(de[je],f);Object.freeze&&Object.freeze(de)}else W("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(de,f)}return f===r?mt(ee):Je(ee),ee}}function bn(f,_,R){return vt(f,_,R,!0)}function Sn(f,_,R){return vt(f,_,R,!1)}var wn=Sn,Tn=bn;St.Fragment=r,St.jsx=wn,St.jsxs=Tn}()),St}process.env.NODE_ENV==="production"?Jn.exports=Qa():Jn.exports=eu();var eo=Jn.exports;const hr=Ae.createContext(Xe(rn)),tu=()=>{const e=Ae.useContext(hr),[t,n]=Ae.useState(e.getSnapshot().value==="loggedIn");return Ae.useEffect(()=>{const r=e.subscribe(s=>{(s.value==="loggedIn"||s.value==="loggedOut")&&n(s.value==="loggedIn")});return()=>{r.unsubscribe()}},[e]),{authActor:e,isLoggedIn:t}},nu=async(e="",t={inspect:void 0,endpoints:{login:"",logout:"",refresh:"",ssrRefresh:""}})=>typeof window<"u"?(console.warn("App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."),Xe(rn,{inspect:t.inspect}).start()):Xe(rn,{input:{initialContext:{endpoints:t.endpoints,refreshToken:e}},inspect:t.inspect}).start();function ru({actor:e,children:t}){return eo.jsx(hr.Provider,{value:e,children:t})}const su={},to=ir({types:{context:{},events:{},input:{}}}).createMachine({id:"timer",initial:"running",context:({input:e})=>({elapsed:0,duration:e.initialContext.duration??3e3,interval:100,intervalId:null}),states:{paused:{on:{RESUME_TIMER:{target:"running",guard:({context:e})=>e.elapsed<e.duration}}},running:{invoke:{input:({context:e})=>({interval:e.interval}),src:Ci(({sendBack:e,input:t})=>{const n=setInterval(()=>{e({type:"TICK"})},t.interval);return()=>{clearInterval(n)}})},always:[{target:"completed",guard:({context:e})=>e.elapsed>=e.duration}],on:{TICK:{actions:ge(({context:e,event:t})=>t.type!=="TICK"?e:{elapsed:e.elapsed+e.interval})},PAUSE_TIMER:{target:"paused"}}},completed:{type:"final"}}}),ou=ir({types:{context:{},events:{},input:{}},actions:{addItem:ge(({context:e,event:t})=>{if(t.type!=="ADD_ITEM")return e;const n=`notification-${su.randomBytes(16).toString("hex")}`,r=t.duration??e.duration,s=Ae.cloneElement(t.item,{duration:r,id:n,key:t.item.key??n,...t.item.props}),i={duration:r,id:n,element:s},a=e.items;return e.order==="desc"?a.push(i):a.unshift(i),{items:a,activeItem:n}}),removeItem:ge(({context:e,event:t})=>{if(t.type!=="REMOVE_ITEM"&&t.type!=="xstate.done.actor.timer")return e;const n=e.items;return e.order==="desc"?(n.pop(),{items:n,activeItem:n.length>0?n[n.length-1].id:null}):(n.shift(),{items:n,activeItem:n.length>0?n[0].id:null})})},delays:{ITEM_TIMEOUT:({context:e})=>e.items[e.items.length-1].duration??e.duration},guards:{itemHasTimeout:({context:e})=>e.items[e.items.length-1].duration>0||e.duration>0}}).createMachine({id:"toast",context:{items:[],order:"desc",duration:0,activeItem:null},initial:"idle",states:{idle:{on:{ADD_ITEM:{target:"adding"}}},active:{invoke:{id:"timer",src:to,input:({context:e})=>({initialContext:{duration:e.items[e.items.length-1].duration??e.duration}}),onDone:{target:"removing",guard:"itemHasTimeout"}},on:{ADD_ITEM:{target:"adding"},REMOVE_ITEM:{target:"removing"},SET_IDLE:{target:"idle"},RESUME_TIMER:{actions:Xr("timer",{type:"RESUME_TIMER"})},PAUSE_TIMER:{actions:Xr("timer",{type:"PAUSE_TIMER"})}}},adding:{entry:["addItem"],on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}},removing:{entry:"removeItem",on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}}}}),pr=Ae.createContext({}),iu=()=>Ae.useContext(pr);function au({children:e,actor:t}){return eo.jsx(pr.Provider,{value:t,children:e})}exports.AuthContext=hr;exports.AuthProvider=ru;exports.ToastContext=pr;exports.ToastProvider=au;exports.authMachine=rn;exports.getAuth=nu;exports.timerMachine=to;exports.toastMachine=ou;exports.useAuth=tu;exports.useToast=iu;
|