@nizza/core 0.6.3-beta.0 → 0.6.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +154 -154
- package/dist/index.mjs.map +1 -1
- package/dist/lib/types/api-graphql-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var gu=Object.defineProperty;var vu=(t,e,n)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var w=(t,e,n)=>vu(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),Ia=require("react-dom"),ku=require("react/jsx-runtime"),yu=require("@tanstack/react-query");function bu(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const pe={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"dev"};let _u=0;function Xn(t,e){const n=`atom${++_u}`,i={toString(){return(pe?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?i.read=t:(i.init=t,i.read=Su,i.write=Nu),i}function Su(t){return t(this)}function Nu(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const ds=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Ci=t=>"init"in t,xi=t=>!!t.write,Ut=Symbol((pe?"production":void 0)!=="production"?"CONTINUE_PROMISE":""),Cr="pending",Eu="fulfilled",Au="rejected",Ou=t=>typeof t=="object"&&t!==null&&Ut in t,fn=new WeakMap,wu=(t,e,n)=>{if(!fn.has(t)){let i;const r=new Promise((s,a)=>{let o=t;const l=c=>d=>{o===c&&(r.status=Eu,r.value=d,s(d),n())},u=c=>d=>{o===c&&(r.status=Au,r.reason=d,a(d),n())};t.then(l(t),u(t)),i=(c,d)=>{c&&(fn.set(c,r),o=c,c.then(l(c),u(c)),e(),e=d)}});r.status=Cr,r[Ut]=i,fn.set(t,r)}return fn.get(t)},Tu=t=>typeof(t==null?void 0:t.then)=="function",fs=t=>"v"in t||"e"in t,hn=t=>{if("e"in t)throw t.e;if((pe?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},_n=t=>{const e=t.v;return Ou(e)&&e.status===Cr?e:null},Da=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},hs=(t,e,n,i,r)=>{var s;if((pe?"production":void 0)!=="production"&&i===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(i,r.n);const a=_n(n);a&&Da(e,a,r),(s=r.m)==null||s.t.add(e),t&&Cu(t,i,e)},ut=()=>[new Map,new Map,new Set],Ri=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},Cu=(t,e,n)=>{const i=t[0].get(e);i&&i.add(n)},xu=(t,e)=>t[0].get(e),ps=(t,e)=>{t[2].add(e)},Ge=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(i=>{var r;return(r=i.m)==null?void 0:r.l.forEach(s=>s())}),n.forEach(i=>i())}},Pa=t=>{let e;(pe?"production":void 0)!=="production"&&(e=new Set);const n=(m,p,h,b=()=>{},E=()=>{})=>{const S="v"in p,N=p.v,O=_n(p);if(Tu(h))if(O)O!==h&&(O[Ut](h,b),++p.n);else{const R=wu(h,b,E);if(R.status===Cr)for(const C of p.d.keys())Da(m,R,t(C,p));p.v=R,delete p.e}else O&&O[Ut](Promise.resolve(h),b),p.v=h,delete p.e;(!S||!Object.is(N,p.v))&&++p.n},i=(m,p,h,b)=>{if(!(b!=null&&b(p))&&fs(h)&&(h.m||Array.from(h.d).every(([C,M])=>i(m,C,t(C,h),b).n===M)))return h;h.d.clear();let E=!0;const S=C=>{if(ds(p,C)){const z=t(C,h);if(!fs(z))if(Ci(C))n(C,z,C.init);else throw new Error("no atom init");return hn(z)}const M=i(m,C,t(C,h),b);if(E)hs(m,p,h,C,M);else{const z=ut();hs(z,p,h,C,M),u(z,p,h),Ge(z)}return hn(M)};let N,O;const R={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(pe?"production":void 0)!=="production"&&!xi(p)&&console.warn("setSelf function cannot be used with read-only atom"),!O&&xi(p)&&(O=(...C)=>{if((pe?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)return l(p,...C)}),O}};try{const C=p.read(S,R);return n(p,h,C,()=>N==null?void 0:N.abort(),()=>{if(h.m){const M=ut();u(M,p,h),Ge(M)}}),h}catch(C){return delete h.v,h.e=C,++h.n,h}finally{E=!1}},r=m=>hn(i(void 0,m,t(m))),s=(m,p,h)=>{var b,E;const S=new Map;for(const N of((b=h.m)==null?void 0:b.t)||[])S.set(N,t(N,h));for(const N of h.p)S.set(N,t(N,h));return(E=xu(m,p))==null||E.forEach(N=>{S.set(N,t(N,h))}),S},a=(m,p,h)=>{const b=[],E=new Set,S=(R,C)=>{if(!E.has(R)){E.add(R);for(const[M,z]of s(m,R,C))R!==M&&S(M,z);b.push([R,C,C.n])}};S(p,h);const N=new Set([p]),O=R=>E.has(R);for(let R=b.length-1;R>=0;--R){const[C,M,z]=b[R];let F=!1;for(const H of M.d.keys())if(H!==C&&N.has(H)){F=!0;break}F&&(i(m,C,M,O),u(m,C,M),z!==M.n&&(Ri(m,C,M),N.add(C))),E.delete(C)}},o=(m,p,h,...b)=>{const E=O=>hn(i(m,O,t(O,h))),S=(O,...R)=>{const C=t(O,h);let M;if(ds(p,O)){if(!Ci(O))throw new Error("atom not writable");const z="v"in C,F=C.v,H=R[0];n(O,C,H),u(m,O,C),(!z||!Object.is(F,C.v))&&(Ri(m,O,C),a(m,O,C))}else M=o(m,O,C,...R);return Ge(m),M};return p.write(E,S,...b)},l=(m,...p)=>{const h=ut(),b=o(h,m,t(m),...p);return Ge(h),b},u=(m,p,h)=>{if(h.m&&!_n(h)){for(const b of h.d.keys())h.m.d.has(b)||(c(m,b,t(b,h)).t.add(p),h.m.d.add(b));for(const b of h.m.d||[])if(!h.d.has(b)){h.m.d.delete(b);const E=d(m,b,t(b,h));E==null||E.t.delete(p)}}},c=(m,p,h)=>{if(!h.m){i(m,p,h);for(const b of h.d.keys())c(m,b,t(b,h)).t.add(p);if(h.m={l:new Set,d:new Set(h.d.keys()),t:new Set},(pe?"production":void 0)!=="production"&&e.add(p),xi(p)&&p.onMount){const b=h.m,{onMount:E}=p;ps(m,()=>{const S=E((...N)=>o(m,p,h,...N));S&&(b.u=S)})}}return h.m},d=(m,p,h)=>{if(h.m&&!h.m.l.size&&!Array.from(h.m.t).some(b=>{var E;return(E=t(b,h).m)==null?void 0:E.d.has(p)})){const b=h.m.u;b&&ps(m,b),delete h.m,(pe?"production":void 0)!=="production"&&e.delete(p);for(const S of h.d.keys()){const N=d(m,S,t(S,h));N==null||N.t.delete(p)}const E=_n(h);E&&E[Ut](void 0,()=>{});return}return h.m},g={get:r,set:l,sub:(m,p)=>{const h=ut(),b=t(m),E=c(h,m,b);Ge(h);const S=E.l;return S.add(p),()=>{S.delete(p);const N=ut();d(N,m,b),Ge(N)}},unstable_derive:m=>Pa(...m(t))};return(pe?"production":void 0)!=="production"&&Object.assign(g,{dev4_get_internal_weak_map:()=>({get:p=>{const h=t(p);if(h.n!==0)return h}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:p=>{const h=ut();for(const[b,E]of p)if(Ci(b)){const S=t(b),N="v"in S,O=S.v;n(b,S,E),u(h,b,S),(!N||!Object.is(O,S.v))&&(Ri(h,b,S),a(h,b,S))}Ge(h)}}),g},La=()=>{const t=new WeakMap;return Pa(n=>{let i=t.get(n);return i||(i={d:new Map,p:new Set,n:0},t.set(n,i)),i})};let Ft;const Ru=()=>(Ft||(Ft=La(),(pe?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Ft),globalThis.__JOTAI_DEFAULT_STORE__!==Ft&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Ft),Fu={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"dev"},Iu=$.createContext(void 0),$a=t=>$.useContext(Iu)||Ru(),Du=t=>typeof(t==null?void 0:t.then)=="function",Pu=$.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function Zi(t,e){const n=$a(),[[i,r,s],a]=$.useReducer(u=>{const c=n.get(t);return Object.is(u[0],c)&&u[1]===n&&u[2]===t?u:[c,n,t]},void 0,()=>[n.get(t),n,t]);let o=i;return(r!==n||s!==t)&&(a(),o=n.get(t)),$.useEffect(()=>{const u=n.sub(t,()=>{a()});return a(),u},[n,t,void 0]),$.useDebugValue(o),Du(o)?Pu(o):o}function xr(t,e){const n=$a();return $.useCallback((...r)=>{if((Fu?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function Fi(t,e){return[Zi(t),xr(t)]}const Rr=Xn(null);Rr.debugLabel="accountAtom";const Lu={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"dev"},{NZ_AWS_REGION:$u,NZ_BACKOFFICE_BACK_URL:Mu,NZ_CORE_SERVICES_GRAPHQL_URL:Uu,NZ_CORE_SERVICES_REST_URL:Vu}=Lu,Fr={AWS:{region:$u,cognito:{userPoolId:"us-east-1_knSlGEmJ0",userPoolWebClientId:"3hmbfhf7nl3kq20qr9i5lihf1p"}},apiUrls:{restV1:Mu||"https://pabprg32bj.execute-api.us-east-1.amazonaws.com",restV2:Vu||"https://core-services-dev.nizza.com/api",graphql:Uu||"https://core-services-dev.nizza.com/graphql",corsProxy:"https://1qmd8jteh1.execute-api.us-east-1.amazonaws.com"},publicUrls:{platformSite:"https://platformdev.nizza.com",nizzaCdn:"https://cdn.nizza.com",bundleSite:"https://bundledev.nizza.com",wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};function Ma(t,e){let n=null;const i=()=>{n||(n=e().log.createLogger(t))},r=(a,o)=>typeof a[o]=="function",s={get(a,o,l){i();const u=c=>(...d)=>{if(!n)return;const f=n[c];if(typeof f=="function")return f.apply(n,d)};return n&&r(n,o)?u(o):n?n[o]:void 0}};return new Proxy({},s)}function j(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var ju={};function Ir(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:ju}var Ua=Object.assign,Fn=Object.getOwnPropertyDescriptor,Ae=Object.defineProperty,Zn=Object.prototype,er=[];Object.freeze(er);var Va={};Object.freeze(Va);var Bu=typeof Proxy!="undefined",qu=Object.toString();function ja(){Bu||j("Proxy not available")}function Ba(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var gt=function(){};function ke(t){return typeof t=="function"}function Ze(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function ei(t){return t!==null&&typeof t=="object"}function je(t){if(!ei(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===qu}function qa(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function ti(t,e,n){Ae(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function za(t,e,n){Ae(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function rt(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return ei(i)&&i[n]===!0}}function Nt(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function zu(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),i=Object.getPrototypeOf(n);return i===null}function Ce(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Ha=typeof Object.getOwnPropertySymbols!="undefined";function Hu(t){var e=Object.keys(t);if(!Ha)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(i){return Zn.propertyIsEnumerable.call(t,i)})):e}var ni=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Ha?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Ga(t){return t===null?null:typeof t=="object"?""+t:t}function Re(t,e){return Zn.hasOwnProperty.call(t,e)}var Gu=Object.getOwnPropertyDescriptors||function(e){var n={};return ni(e).forEach(function(i){n[i]=Fn(e,i)}),n};function re(t,e){return!!(t&e)}function se(t,e,n){return n?t|=e:t&=~e,t}function ms(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Ku(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ju(i.key),i)}}function Et(t,e,n){return e&&Ku(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function vt(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Yu(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1
|
+
"use strict";var gu=Object.defineProperty;var vu=(t,e,n)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var w=(t,e,n)=>vu(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),Ia=require("react-dom"),ku=require("react/jsx-runtime"),yu=require("@tanstack/react-query");function bu(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const pe={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"prod"};let _u=0;function Xn(t,e){const n=`atom${++_u}`,i={toString(){return(pe?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?i.read=t:(i.init=t,i.read=Su,i.write=Nu),i}function Su(t){return t(this)}function Nu(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const ds=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Ci=t=>"init"in t,xi=t=>!!t.write,Ut=Symbol((pe?"production":void 0)!=="production"?"CONTINUE_PROMISE":""),Cr="pending",Eu="fulfilled",Au="rejected",Ou=t=>typeof t=="object"&&t!==null&&Ut in t,fn=new WeakMap,wu=(t,e,n)=>{if(!fn.has(t)){let i;const r=new Promise((s,a)=>{let o=t;const l=c=>d=>{o===c&&(r.status=Eu,r.value=d,s(d),n())},u=c=>d=>{o===c&&(r.status=Au,r.reason=d,a(d),n())};t.then(l(t),u(t)),i=(c,d)=>{c&&(fn.set(c,r),o=c,c.then(l(c),u(c)),e(),e=d)}});r.status=Cr,r[Ut]=i,fn.set(t,r)}return fn.get(t)},Tu=t=>typeof(t==null?void 0:t.then)=="function",fs=t=>"v"in t||"e"in t,hn=t=>{if("e"in t)throw t.e;if((pe?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},_n=t=>{const e=t.v;return Ou(e)&&e.status===Cr?e:null},Da=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},hs=(t,e,n,i,r)=>{var s;if((pe?"production":void 0)!=="production"&&i===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(i,r.n);const a=_n(n);a&&Da(e,a,r),(s=r.m)==null||s.t.add(e),t&&Cu(t,i,e)},ut=()=>[new Map,new Map,new Set],Ri=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},Cu=(t,e,n)=>{const i=t[0].get(e);i&&i.add(n)},xu=(t,e)=>t[0].get(e),ps=(t,e)=>{t[2].add(e)},Ge=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(i=>{var r;return(r=i.m)==null?void 0:r.l.forEach(s=>s())}),n.forEach(i=>i())}},Pa=t=>{let e;(pe?"production":void 0)!=="production"&&(e=new Set);const n=(m,p,h,b=()=>{},E=()=>{})=>{const S="v"in p,N=p.v,O=_n(p);if(Tu(h))if(O)O!==h&&(O[Ut](h,b),++p.n);else{const R=wu(h,b,E);if(R.status===Cr)for(const C of p.d.keys())Da(m,R,t(C,p));p.v=R,delete p.e}else O&&O[Ut](Promise.resolve(h),b),p.v=h,delete p.e;(!S||!Object.is(N,p.v))&&++p.n},i=(m,p,h,b)=>{if(!(b!=null&&b(p))&&fs(h)&&(h.m||Array.from(h.d).every(([C,M])=>i(m,C,t(C,h),b).n===M)))return h;h.d.clear();let E=!0;const S=C=>{if(ds(p,C)){const z=t(C,h);if(!fs(z))if(Ci(C))n(C,z,C.init);else throw new Error("no atom init");return hn(z)}const M=i(m,C,t(C,h),b);if(E)hs(m,p,h,C,M);else{const z=ut();hs(z,p,h,C,M),u(z,p,h),Ge(z)}return hn(M)};let N,O;const R={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(pe?"production":void 0)!=="production"&&!xi(p)&&console.warn("setSelf function cannot be used with read-only atom"),!O&&xi(p)&&(O=(...C)=>{if((pe?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)return l(p,...C)}),O}};try{const C=p.read(S,R);return n(p,h,C,()=>N==null?void 0:N.abort(),()=>{if(h.m){const M=ut();u(M,p,h),Ge(M)}}),h}catch(C){return delete h.v,h.e=C,++h.n,h}finally{E=!1}},r=m=>hn(i(void 0,m,t(m))),s=(m,p,h)=>{var b,E;const S=new Map;for(const N of((b=h.m)==null?void 0:b.t)||[])S.set(N,t(N,h));for(const N of h.p)S.set(N,t(N,h));return(E=xu(m,p))==null||E.forEach(N=>{S.set(N,t(N,h))}),S},a=(m,p,h)=>{const b=[],E=new Set,S=(R,C)=>{if(!E.has(R)){E.add(R);for(const[M,z]of s(m,R,C))R!==M&&S(M,z);b.push([R,C,C.n])}};S(p,h);const N=new Set([p]),O=R=>E.has(R);for(let R=b.length-1;R>=0;--R){const[C,M,z]=b[R];let F=!1;for(const H of M.d.keys())if(H!==C&&N.has(H)){F=!0;break}F&&(i(m,C,M,O),u(m,C,M),z!==M.n&&(Ri(m,C,M),N.add(C))),E.delete(C)}},o=(m,p,h,...b)=>{const E=O=>hn(i(m,O,t(O,h))),S=(O,...R)=>{const C=t(O,h);let M;if(ds(p,O)){if(!Ci(O))throw new Error("atom not writable");const z="v"in C,F=C.v,H=R[0];n(O,C,H),u(m,O,C),(!z||!Object.is(F,C.v))&&(Ri(m,O,C),a(m,O,C))}else M=o(m,O,C,...R);return Ge(m),M};return p.write(E,S,...b)},l=(m,...p)=>{const h=ut(),b=o(h,m,t(m),...p);return Ge(h),b},u=(m,p,h)=>{if(h.m&&!_n(h)){for(const b of h.d.keys())h.m.d.has(b)||(c(m,b,t(b,h)).t.add(p),h.m.d.add(b));for(const b of h.m.d||[])if(!h.d.has(b)){h.m.d.delete(b);const E=d(m,b,t(b,h));E==null||E.t.delete(p)}}},c=(m,p,h)=>{if(!h.m){i(m,p,h);for(const b of h.d.keys())c(m,b,t(b,h)).t.add(p);if(h.m={l:new Set,d:new Set(h.d.keys()),t:new Set},(pe?"production":void 0)!=="production"&&e.add(p),xi(p)&&p.onMount){const b=h.m,{onMount:E}=p;ps(m,()=>{const S=E((...N)=>o(m,p,h,...N));S&&(b.u=S)})}}return h.m},d=(m,p,h)=>{if(h.m&&!h.m.l.size&&!Array.from(h.m.t).some(b=>{var E;return(E=t(b,h).m)==null?void 0:E.d.has(p)})){const b=h.m.u;b&&ps(m,b),delete h.m,(pe?"production":void 0)!=="production"&&e.delete(p);for(const S of h.d.keys()){const N=d(m,S,t(S,h));N==null||N.t.delete(p)}const E=_n(h);E&&E[Ut](void 0,()=>{});return}return h.m},g={get:r,set:l,sub:(m,p)=>{const h=ut(),b=t(m),E=c(h,m,b);Ge(h);const S=E.l;return S.add(p),()=>{S.delete(p);const N=ut();d(N,m,b),Ge(N)}},unstable_derive:m=>Pa(...m(t))};return(pe?"production":void 0)!=="production"&&Object.assign(g,{dev4_get_internal_weak_map:()=>({get:p=>{const h=t(p);if(h.n!==0)return h}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:p=>{const h=ut();for(const[b,E]of p)if(Ci(b)){const S=t(b),N="v"in S,O=S.v;n(b,S,E),u(h,b,S),(!N||!Object.is(O,S.v))&&(Ri(h,b,S),a(h,b,S))}Ge(h)}}),g},La=()=>{const t=new WeakMap;return Pa(n=>{let i=t.get(n);return i||(i={d:new Map,p:new Set,n:0},t.set(n,i)),i})};let Ft;const Ru=()=>(Ft||(Ft=La(),(pe?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Ft),globalThis.__JOTAI_DEFAULT_STORE__!==Ft&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Ft),Fu={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"prod"},Iu=$.createContext(void 0),$a=t=>$.useContext(Iu)||Ru(),Du=t=>typeof(t==null?void 0:t.then)=="function",Pu=$.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function Zi(t,e){const n=$a(),[[i,r,s],a]=$.useReducer(u=>{const c=n.get(t);return Object.is(u[0],c)&&u[1]===n&&u[2]===t?u:[c,n,t]},void 0,()=>[n.get(t),n,t]);let o=i;return(r!==n||s!==t)&&(a(),o=n.get(t)),$.useEffect(()=>{const u=n.sub(t,()=>{a()});return a(),u},[n,t,void 0]),$.useDebugValue(o),Du(o)?Pu(o):o}function xr(t,e){const n=$a();return $.useCallback((...r)=>{if((Fu?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function Fi(t,e){return[Zi(t),xr(t)]}const Rr=Xn(null);Rr.debugLabel="accountAtom";const Lu={BASE_URL:"/",DEV:!1,MODE:"production",NZ_AWS_REGION:"us-east-1",PROD:!0,SSR:!1,STAGE:"prod"},{NZ_AWS_REGION:$u,NZ_BACKOFFICE_BACK_URL:Mu,NZ_CORE_SERVICES_GRAPHQL_URL:Uu,NZ_CORE_SERVICES_REST_URL:Vu}=Lu,Fr={AWS:{region:$u,cognito:{userPoolId:"us-east-1_EZ7wuZ4ig",userPoolWebClientId:"2jok7cst8ebf6ppscrhji57gvr"}},apiUrls:{restV1:Mu||"https://b133h34s56.execute-api.us-east-1.amazonaws.com",restV2:Vu||"https://core-services-prod.nizza.com/api",graphql:Uu||"https://core-services-prod.nizza.com/graphql",corsProxy:"https://3hvqfl2xcg.execute-api.us-east-1.amazonaws.com"},publicUrls:{platformSite:"https://platform.nizza.com",nizzaCdn:"https://cdn.nizza.com",bundleSite:"https://bundle.nizza.com",wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};function Ma(t,e){let n=null;const i=()=>{n||(n=e().log.createLogger(t))},r=(a,o)=>typeof a[o]=="function",s={get(a,o,l){i();const u=c=>(...d)=>{if(!n)return;const f=n[c];if(typeof f=="function")return f.apply(n,d)};return n&&r(n,o)?u(o):n?n[o]:void 0}};return new Proxy({},s)}function j(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var ju={};function Ir(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:ju}var Ua=Object.assign,Fn=Object.getOwnPropertyDescriptor,Ae=Object.defineProperty,Zn=Object.prototype,er=[];Object.freeze(er);var Va={};Object.freeze(Va);var Bu=typeof Proxy!="undefined",qu=Object.toString();function ja(){Bu||j("Proxy not available")}function Ba(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var gt=function(){};function ke(t){return typeof t=="function"}function Ze(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function ei(t){return t!==null&&typeof t=="object"}function je(t){if(!ei(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===qu}function qa(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function ti(t,e,n){Ae(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function za(t,e,n){Ae(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function rt(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return ei(i)&&i[n]===!0}}function Nt(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function zu(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),i=Object.getPrototypeOf(n);return i===null}function Ce(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Ha=typeof Object.getOwnPropertySymbols!="undefined";function Hu(t){var e=Object.keys(t);if(!Ha)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(i){return Zn.propertyIsEnumerable.call(t,i)})):e}var ni=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Ha?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Ga(t){return t===null?null:typeof t=="object"?""+t:t}function Re(t,e){return Zn.hasOwnProperty.call(t,e)}var Gu=Object.getOwnPropertyDescriptors||function(e){var n={};return ni(e).forEach(function(i){n[i]=Fn(e,i)}),n};function re(t,e){return!!(t&e)}function se(t,e,n){return n?t|=e:t&=~e,t}function ms(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Ku(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ju(i.key),i)}}function Et(t,e,n){return e&&Ku(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function vt(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Yu(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Be(){return Be=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Be.apply(null,arguments)}function Ka(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,tr(t,e)}function tr(t,e){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tr(t,e)}function Wu(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ju(t){var e=Wu(t,"string");return typeof e=="symbol"?e:e+""}function Yu(t,e){if(t){if(typeof t=="string")return ms(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ms(t,e):void 0}}var Ne=Symbol("mobx-stored-annotations");function Oe(t){function e(n,i){if(rn(i))return t.decorate_20223_(n,i);At(n,i,t)}return Object.assign(e,t)}function At(t,e,n){Re(t,Ne)||ti(t,Ne,Be({},t[Ne])),sc(n)||(t[Ne][e]=n)}function Qu(t){return Re(t,Ne)||ti(t,Ne,Be({},t[Ne])),t[Ne]}function rn(t){return typeof t=="object"&&typeof t.kind=="string"}var D=Symbol("mobx administration"),He=function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=B.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.reportObserved=function(){return uo(this)},e.reportChanged=function(){ce(),co(this),de()},e.toString=function(){return this.name_},Et(t,[{key:"isBeingObserved",get:function(){return re(this.flags_,t.isBeingObservedMask_)},set:function(i){this.flags_=se(this.flags_,t.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return re(this.flags_,t.isPendingUnobservationMask_)},set:function(i){this.flags_=se(this.flags_,t.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return re(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=se(this.flags_,t.diffValueMask_,i===1)}}])}();He.isBeingObservedMask_=1;He.isPendingUnobservationMask_=2;He.diffValueMask_=4;var Dr=rt("Atom",He);function Wa(t,e,n){e===void 0&&(e=gt),n===void 0&&(n=gt);var i=new He(t);return e!==gt&&ud(i,e),n!==gt&&vo(i,n),i}function Xu(t,e){return t===e}function Zu(t,e){return Ur(t,e)}function ec(t,e){return Ur(t,e,1)}function tc(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var In={identity:Xu,structural:Zu,default:tc,shallow:ec};function et(t,e,n){return _o(t)?t:Array.isArray(t)?W.array(t,{name:n}):je(t)?W.object(t,void 0,{name:n}):Nt(t)?W.map(t,{name:n}):Ce(t)?W.set(t,{name:n}):typeof t=="function"&&!li(t)&&!Jt(t)?qa(t)?bt(t):Wt(n,t):t}function nc(t,e,n){if(t==null||ci(t)||ui(t)||at(t)||Ot(t))return t;if(Array.isArray(t))return W.array(t,{name:n,deep:!1});if(je(t))return W.object(t,void 0,{name:n,deep:!1});if(Nt(t))return W.map(t,{name:n,deep:!1});if(Ce(t))return W.set(t,{name:n,deep:!1})}function ii(t){return t}function ic(t,e){return Ur(t,e)?e:t}var rc="override";function sc(t){return t.annotationType_===rc}function sn(t,e){return{annotationType_:t,options_:e,make_:ac,extend_:oc,decorate_20223_:lc}}function ac(t,e,n,i){var r;if((r=this.options_)!=null&&r.bound)return this.extend_(t,e,n,!1)===null?0:1;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(li(n.value))return 1;var s=Ja(t,this,e,n,!1);return Ae(i,e,s),2}function oc(t,e,n,i){var r=Ja(t,this,e,n);return t.defineProperty_(e,r,i)}function lc(t,e){var n=e.kind,i=e.name,r=e.addInitializer,s=this,a=function(u){var c,d,f,v;return qe((c=(d=s.options_)==null?void 0:d.name)!=null?c:i.toString(),u,(f=(v=s.options_)==null?void 0:v.autoAction)!=null?f:!1)};if(n=="field"){r(function(){At(this,i,s)});return}if(n=="method"){var o;return li(t)||(t=a(t)),(o=this.options_)!=null&&o.bound&&r(function(){var l=this,u=l[i].bind(l);u.isMobxAction=!0,l[i]=u}),t}j("Cannot apply '"+s.annotationType_+"' to '"+String(i)+"' (kind: "+n+"):"+(`
|
|
3
3
|
'`+s.annotationType_+"' can only be used on properties with a function value."))}function uc(t,e,n,i){e.annotationType_,i.value}function Ja(t,e,n,i,r){var s,a,o,l,u,c,d;r===void 0&&(r=T.safeDescriptors),uc(t,e,n,i);var f=i.value;if((s=e.options_)!=null&&s.bound){var v;f=f.bind((v=t.proxy_)!=null?v:t.target_)}return{value:qe((a=(o=e.options_)==null?void 0:o.name)!=null?a:n.toString(),f,(l=(u=e.options_)==null?void 0:u.autoAction)!=null?l:!1,(c=e.options_)!=null&&c.bound?(d=t.proxy_)!=null?d:t.target_:void 0),configurable:r?t.isPlainObject_:!0,enumerable:!1,writable:!r}}function Ya(t,e){return{annotationType_:t,options_:e,make_:cc,extend_:dc,decorate_20223_:fc}}function cc(t,e,n,i){var r;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!Re(t.target_,e)||!Jt(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(Jt(n.value))return 1;var s=Qa(t,this,e,n,!1,!1);return Ae(i,e,s),2}function dc(t,e,n,i){var r,s=Qa(t,this,e,n,(r=this.options_)==null?void 0:r.bound);return t.defineProperty_(e,s,i)}function fc(t,e){var n,i=e.name,r=e.addInitializer;return Jt(t)||(t=bt(t)),(n=this.options_)!=null&&n.bound&&r(function(){var s=this,a=s[i].bind(s);a.isMobXFlow=!0,s[i]=a}),t}function hc(t,e,n,i){e.annotationType_,i.value}function Qa(t,e,n,i,r,s){s===void 0&&(s=T.safeDescriptors),hc(t,e,n,i);var a=i.value;if(Jt(a)||(a=bt(a)),r){var o;a=a.bind((o=t.proxy_)!=null?o:t.target_),a.isMobXFlow=!0}return{value:a,configurable:s?t.isPlainObject_:!0,enumerable:!1,writable:!s}}function Pr(t,e){return{annotationType_:t,options_:e,make_:pc,extend_:mc,decorate_20223_:gc}}function pc(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function mc(t,e,n,i){return vc(t,this,e,n),t.defineComputedProperty_(e,Be({},this.options_,{get:n.get,set:n.set}),i)}function gc(t,e){var n=this,i=e.name,r=e.addInitializer;return r(function(){var s=wt(this)[D],a=Be({},n.options_,{get:t,context:this});a.name||(a.name="ObservableObject."+i.toString()),s.values_.set(i,new ye(a))}),function(){return this[D].getObservablePropValue_(i)}}function vc(t,e,n,i){e.annotationType_,i.get}function ri(t,e){return{annotationType_:t,options_:e,make_:kc,extend_:yc,decorate_20223_:bc}}function kc(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function yc(t,e,n,i){var r,s;return _c(t,this),t.defineObservableProperty_(e,n.value,(r=(s=this.options_)==null?void 0:s.enhancer)!=null?r:et,i)}function bc(t,e){var n=this,i=e.kind,r=e.name,s=new WeakSet;function a(o,l){var u,c,d=wt(o)[D],f=new Qe(l,(u=(c=n.options_)==null?void 0:c.enhancer)!=null?u:et,"ObservableObject."+r.toString(),!1);d.values_.set(r,f),s.add(o)}if(i=="accessor")return{get:function(){return s.has(this)||a(this,t.get.call(this)),this[D].getObservablePropValue_(r)},set:function(l){return s.has(this)||a(this,l),this[D].setObservablePropValue_(r,l)},init:function(l){return s.has(this)||a(this,l),l}}}function _c(t,e,n,i){e.annotationType_}var Sc="true",Nc=Xa();function Xa(t){return{annotationType_:Sc,options_:t,make_:Ec,extend_:Ac,decorate_20223_:Oc}}function Ec(t,e,n,i){var r,s;if(n.get)return Me.make_(t,e,n,i);if(n.set){var a=qe(e.toString(),n.set);return i===t.target_?t.defineProperty_(e,{configurable:T.safeDescriptors?t.isPlainObject_:!0,set:a})===null?0:2:(Ae(i,e,{configurable:!0,set:a}),2)}if(i!==t.target_&&typeof n.value=="function"){var o;if(qa(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?bt.bound:bt;return u.make_(t,e,n,i)}var c=(o=this.options_)!=null&&o.autoBind?Wt.bound:Wt;return c.make_(t,e,n,i)}var d=((r=this.options_)==null?void 0:r.deep)===!1?W.ref:W;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var f;n.value=n.value.bind((f=t.proxy_)!=null?f:t.target_)}return d.make_(t,e,n,i)}function Ac(t,e,n,i){var r,s;if(n.get)return Me.extend_(t,e,n,i);if(n.set)return t.defineProperty_(e,{configurable:T.safeDescriptors?t.isPlainObject_:!0,set:qe(e.toString(),n.set)},i);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var a;n.value=n.value.bind((a=t.proxy_)!=null?a:t.target_)}var o=((s=this.options_)==null?void 0:s.deep)===!1?W.ref:W;return o.extend_(t,e,n,i)}function Oc(t,e){j("'"+this.annotationType_+"' cannot be used as a decorator")}var wc="observable",Tc="observable.ref",Cc="observable.shallow",xc="observable.struct",Za={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Za);function pn(t){return t||Za}var nr=ri(wc),Rc=ri(Tc,{enhancer:ii}),Fc=ri(Cc,{enhancer:nc}),Ic=ri(xc,{enhancer:ic}),eo=Oe(nr);function mn(t){return t.deep===!0?et:t.deep===!1?ii:Pc(t.defaultDecorator)}function Dc(t){var e;return t?(e=t.defaultDecorator)!=null?e:Xa(t):void 0}function Pc(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:et}function to(t,e,n){if(rn(e))return nr.decorate_20223_(t,e);if(Ze(e)){At(t,e,nr);return}return _o(t)?t:je(t)?W.object(t,e,n):Array.isArray(t)?W.array(t,e):Nt(t)?W.map(t,e):Ce(t)?W.set(t,e):typeof t=="object"&&t!==null?t:W.box(t,e)}Ua(to,eo);var Lc={box:function(e,n){var i=pn(n);return new Qe(e,mn(i),i.name,!0,i.equals)},array:function(e,n){var i=pn(n);return(T.useProxies===!1||i.proxy===!1?Pd:Ad)(e,mn(i),i.name)},map:function(e,n){var i=pn(n);return new Ao(e,mn(i),i.name)},set:function(e,n){var i=pn(n);return new Oo(e,mn(i),i.name)},object:function(e,n,i){return ot(function(){return hd(T.useProxies===!1||(i==null?void 0:i.proxy)===!1?wt({},i):Sd({},i),e,n)})},ref:Oe(Rc),shallow:Oe(Fc),deep:eo,struct:Oe(Ic)},W=Ua(to,Lc),no="computed",$c="computed.struct",ir=Pr(no),Mc=Pr($c,{equals:In.structural}),Me=function(e,n){if(rn(n))return ir.decorate_20223_(e,n);if(Ze(n))return At(e,n,ir);if(je(e))return Oe(Pr(no,e));var i=je(n)?n:{};return i.get=e,i.name||(i.name=e.name||""),new ye(i)};Object.assign(Me,ir);Me.struct=Oe(Mc);var gs,vs,Dn=0,Uc=1,Vc=(gs=(vs=Fn(function(){},"name"))==null?void 0:vs.configurable)!=null?gs:!1,ks={value:"action",configurable:!0,writable:!1,enumerable:!1};function qe(t,e,n,i){n===void 0&&(n=!1);function r(){return jc(t,n,e,i||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return e.toString()},Vc&&(ks.value=t,Ae(r,"name",ks)),r}function jc(t,e,n,i,r){var s=Bc(t,e);try{return n.apply(i,r)}catch(a){throw s.error_=a,a}finally{qc(s)}}function Bc(t,e,n,i){var r=!1,s=0,a=T.trackingDerivation,o=!e||!a;ce();var l=T.allowStateChanges;o&&(st(),l=si(!0));var u=Lr(!0),c={runAsAction_:o,prevDerivation_:a,prevAllowStateChanges_:l,prevAllowStateReads_:u,notifySpy_:r,startTime_:s,actionId_:Uc++,parentActionId_:Dn};return Dn=c.actionId_,c}function qc(t){Dn!==t.actionId_&&j(30),Dn=t.parentActionId_,t.error_!==void 0&&(T.suppressReactionErrors=!0),ai(t.prevAllowStateChanges_),Vt(t.prevAllowStateReads_),de(),t.runAsAction_&&Fe(t.prevDerivation_),T.suppressReactionErrors=!1}function zc(t,e){var n=si(t);try{return e()}finally{ai(n)}}function si(t){var e=T.allowStateChanges;return T.allowStateChanges=t,e}function ai(t){T.allowStateChanges=t}var Qe=function(t){function e(i,r,s,a,o){var l;return s===void 0&&(s="ObservableValue"),o===void 0&&(o=In.default),l=t.call(this,s)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=r,l.name_=s,l.equals=o,l.value_=r(i,void 0,s),l}Ka(e,t);var n=e.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){this.value_,r=this.prepareNewValue_(r),r!==T.UNCHANGED&&this.setNewValue_(r)},n.prepareNewValue_=function(r){if(le(this)){var s=ue(this,{object:this,type:we,newValue:r});if(!s)return T.UNCHANGED;r=s.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?T.UNCHANGED:r},n.setNewValue_=function(r){var s=this.value_;this.value_=r,this.reportChanged(),ge(this)&&ve(this,{type:we,object:this,newValue:r,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return an(this,r)},n.observe_=function(r,s){return s&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:we,newValue:this.value_,oldValue:void 0}),on(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Ga(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(He),ye=function(){function t(n){this.dependenciesState_=B.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=B.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Ln(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Pn.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||j(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=qe("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?In.structural:In.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){Jc(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.get=function(){if(this.isComputing&&j(32,this.name_,this.derivation),T.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)rr(this)&&(this.warnAboutUntrackedRead_(),ce(),this.value_=this.computeValue_(!1),de());else if(uo(this),rr(this)){var i=T.trackingContext;this.keepAlive_&&!i&&(T.trackingContext=this),this.trackAndCompute()&&Wc(this),T.trackingContext=i}var r=this.value_;if(Sn(r))throw r.cause;return r},e.set=function(i){if(this.setter_){this.isRunningSetter&&j(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,i)}finally{this.isRunningSetter=!1}}else j(34,this.name_)},e.trackAndCompute=function(){var i=this.value_,r=this.dependenciesState_===B.NOT_TRACKING_,s=this.computeValue_(!0),a=r||Sn(i)||Sn(s)||!this.equals_(i,s);return a&&(this.value_=s),a},e.computeValue_=function(i){this.isComputing=!0;var r=si(!1),s;if(i)s=io(this,this.derivation,this.scope_);else if(T.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(a){s=new Ln(a)}return ai(r),this.isComputing=!1,s},e.suspend_=function(){this.keepAlive_||(sr(this),this.value_=void 0)},e.observe_=function(i,r){var s=this,a=!0,o=void 0;return go(function(){var l=s.get();if(!a||r){var u=st();i({observableKind:"computed",debugObjectName:s.name_,type:we,object:s,newValue:l,oldValue:o}),Fe(u)}a=!1,o=l})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Ga(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},Et(t,[{key:"isComputing",get:function(){return re(this.flags_,t.isComputingMask_)},set:function(i){this.flags_=se(this.flags_,t.isComputingMask_,i)}},{key:"isRunningSetter",get:function(){return re(this.flags_,t.isRunningSetterMask_)},set:function(i){this.flags_=se(this.flags_,t.isRunningSetterMask_,i)}},{key:"isBeingObserved",get:function(){return re(this.flags_,t.isBeingObservedMask_)},set:function(i){this.flags_=se(this.flags_,t.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return re(this.flags_,t.isPendingUnobservationMask_)},set:function(i){this.flags_=se(this.flags_,t.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return re(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=se(this.flags_,t.diffValueMask_,i===1)}}])}();ye.isComputingMask_=1;ye.isRunningSetterMask_=2;ye.isBeingObservedMask_=4;ye.isPendingUnobservationMask_=8;ye.diffValueMask_=16;var oi=rt("ComputedValue",ye),B;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(B||(B={}));var Pn;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Pn||(Pn={}));var Ln=function(e){this.cause=void 0,this.cause=e};function Sn(t){return t instanceof Ln}function rr(t){switch(t.dependenciesState_){case B.UP_TO_DATE_:return!1;case B.NOT_TRACKING_:case B.STALE_:return!0;case B.POSSIBLY_STALE_:{for(var e=Lr(!0),n=st(),i=t.observing_,r=i.length,s=0;s<r;s++){var a=i[s];if(oi(a)){if(T.disableErrorBoundaries)a.get();else try{a.get()}catch{return Fe(n),Vt(e),!0}if(t.dependenciesState_===B.STALE_)return Fe(n),Vt(e),!0}}return so(t),Fe(n),Vt(e),!1}}}function io(t,e,n){var i=Lr(!0);so(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++T.runId;var r=T.trackingDerivation;T.trackingDerivation=t,T.inBatch++;var s;if(T.disableErrorBoundaries===!0)s=e.call(n);else try{s=e.call(n)}catch(a){s=new Ln(a)}return T.inBatch--,T.trackingDerivation=r,Hc(t),Vt(i),s}function Hc(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,i=B.UP_TO_DATE_,r=0,s=t.unboundDepsCount_,a=0;a<s;a++){var o=n[a];o.diffValue===0&&(o.diffValue=1,r!==a&&(n[r]=o),r++),o.dependenciesState_>i&&(i=o.dependenciesState_)}for(n.length=r,t.newObserving_=null,s=e.length;s--;){var l=e[s];l.diffValue===0&&oo(l,t),l.diffValue=0}for(;r--;){var u=n[r];u.diffValue===1&&(u.diffValue=0,Kc(u,t))}i!==B.UP_TO_DATE_&&(t.dependenciesState_=i,t.onBecomeStale_())}function sr(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)oo(e[n],t);t.dependenciesState_=B.NOT_TRACKING_}function ro(t){var e=st();try{return t()}finally{Fe(e)}}function st(){var t=T.trackingDerivation;return T.trackingDerivation=null,t}function Fe(t){T.trackingDerivation=t}function Lr(t){var e=T.allowStateReads;return T.allowStateReads=t,e}function Vt(t){T.allowStateReads=t}function so(t){if(t.dependenciesState_!==B.UP_TO_DATE_){t.dependenciesState_=B.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=B.UP_TO_DATE_}}var Nn=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},En=!0,ao=!1,T=function(){var t=Ir();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(En=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Nn().version&&(En=!1),En?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Nn):(setTimeout(function(){ao||j(35)},1),new Nn)}();function Gc(){if((T.pendingReactions.length||T.inBatch||T.isRunningReactions)&&j(36),ao=!0,En){var t=Ir();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),T=new Nn}}function Kc(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function oo(t,e){t.observers_.delete(e),t.observers_.size===0&&lo(t)}function lo(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,T.pendingUnobservations.push(t))}function ce(){T.inBatch++}function de(){if(--T.inBatch===0){fo();for(var t=T.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof ye&&n.suspend_())}T.pendingUnobservations=[]}}function uo(t){var e=T.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&T.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&T.inBatch>0&&lo(t),!1)}function co(t){t.lowestObserverState_!==B.STALE_&&(t.lowestObserverState_=B.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===B.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=B.STALE_}))}function Wc(t){t.lowestObserverState_!==B.STALE_&&(t.lowestObserverState_=B.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===B.POSSIBLY_STALE_?e.dependenciesState_=B.STALE_:e.dependenciesState_===B.UP_TO_DATE_&&(t.lowestObserverState_=B.UP_TO_DATE_)}))}function Jc(t){t.lowestObserverState_===B.UP_TO_DATE_&&(t.lowestObserverState_=B.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===B.UP_TO_DATE_&&(e.dependenciesState_=B.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Te=function(){function t(n,i,r,s){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=B.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Pn.NONE,this.name_=n,this.onInvalidate_=i,this.errorHandler_=r,this.requiresObservable_=s}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,T.pendingReactions.push(this),fo())},e.runReaction_=function(){if(!this.isDisposed){ce(),this.isScheduled=!1;var i=T.trackingContext;if(T.trackingContext=this,rr(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(r){this.reportExceptionInDerivation_(r)}}T.trackingContext=i,de()}},e.track=function(i){if(!this.isDisposed){ce(),this.isRunning=!0;var r=T.trackingContext;T.trackingContext=this;var s=io(this,i,void 0);T.trackingContext=r,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&sr(this),Sn(s)&&this.reportExceptionInDerivation_(s.cause),de()}},e.reportExceptionInDerivation_=function(i){var r=this;if(this.errorHandler_){this.errorHandler_(i,this);return}if(T.disableErrorBoundaries)throw i;var s="[mobx] uncaught error in '"+this+"'";T.suppressReactionErrors||console.error(s,i),T.globalReactionErrorHandlers.forEach(function(a){return a(i,r)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ce(),sr(this),de()))},e.getDisposer_=function(i){var r=this,s=function a(){r.dispose(),i==null||i.removeEventListener==null||i.removeEventListener("abort",a)};return i==null||i.addEventListener==null||i.addEventListener("abort",s),s[D]=this,s},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(i){},Et(t,[{key:"isDisposed",get:function(){return re(this.flags_,t.isDisposedMask_)},set:function(i){this.flags_=se(this.flags_,t.isDisposedMask_,i)}},{key:"isScheduled",get:function(){return re(this.flags_,t.isScheduledMask_)},set:function(i){this.flags_=se(this.flags_,t.isScheduledMask_,i)}},{key:"isTrackPending",get:function(){return re(this.flags_,t.isTrackPendingMask_)},set:function(i){this.flags_=se(this.flags_,t.isTrackPendingMask_,i)}},{key:"isRunning",get:function(){return re(this.flags_,t.isRunningMask_)},set:function(i){this.flags_=se(this.flags_,t.isRunningMask_,i)}},{key:"diffValue",get:function(){return re(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=se(this.flags_,t.diffValueMask_,i===1)}}])}();Te.isDisposedMask_=1;Te.isScheduledMask_=2;Te.isTrackPendingMask_=4;Te.isRunningMask_=8;Te.diffValueMask_=16;var Yc=100,ar=function(e){return e()};function fo(){T.inBatch>0||T.isRunningReactions||ar(Qc)}function Qc(){T.isRunningReactions=!0;for(var t=T.pendingReactions,e=0;t.length>0;){++e===Yc&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction_()}T.isRunningReactions=!1}var $n=rt("Reaction",Te);function Xc(t){var e=ar;ar=function(i){return t(function(){return e(i)})}}function jt(){return!1}function Zc(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var ho="action",ed="action.bound",po="autoAction",td="autoAction.bound",nd="<unnamed action>",or=sn(ho),id=sn(ed,{bound:!0}),lr=sn(po,{autoAction:!0}),rd=sn(td,{autoAction:!0,bound:!0});function mo(t){var e=function(i,r){if(ke(i))return qe(i.name||nd,i,t);if(ke(r))return qe(i,r,t);if(rn(r))return(t?lr:or).decorate_20223_(i,r);if(Ze(r))return At(i,r,t?lr:or);if(Ze(i))return Oe(sn(t?po:ho,{name:i,autoAction:t}))};return e}var me=mo(!1);Object.assign(me,or);var Wt=mo(!0);Object.assign(Wt,lr);me.bound=Oe(id);Wt.bound=Oe(rd);function li(t){return ke(t)&&t.isMobxAction===!0}function go(t,e){var n,i,r,s;e===void 0&&(e=Va);var a=(n=(i=e)==null?void 0:i.name)!=null?n:"Autorun",o=!e.scheduler&&!e.delay,l;if(o)l=new Te(a,function(){this.track(d)},e.onError,e.requiresObservable);else{var u=ad(e),c=!1;l=new Te(a,function(){c||(c=!0,u(function(){c=!1,l.isDisposed||l.track(d)}))},e.onError,e.requiresObservable)}function d(){t(l)}return(r=e)!=null&&(r=r.signal)!=null&&r.aborted||l.schedule_(),l.getDisposer_((s=e)==null?void 0:s.signal)}var sd=function(e){return e()};function ad(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:sd}var od="onBO",ld="onBUO";function ud(t,e,n){return ko(od,t,e,n)}function vo(t,e,n){return ko(ld,t,e,n)}function ko(t,e,n,i){var r=Vn(e),s=ke(i)?i:n,a=t+"L";return r[a]?r[a].add(s):r[a]=new Set([s]),function(){var o=r[a];o&&(o.delete(s),o.size===0&&delete r[a])}}var cd="never",gn="always",dd="observed";function fd(t){t.isolateGlobalState===!0&&Gc();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(T.useProxies=e===gn?!0:e===cd?!1:typeof Proxy!="undefined"),e==="ifavailable"&&(T.verifyProxies=!0),n!==void 0){var i=n===gn?gn:n===dd;T.enforceActions=i,T.allowStateChanges=!(i===!0||i===gn)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(r){r in t&&(T[r]=!!t[r])}),T.allowStateReads=!T.observableRequiresReaction,t.reactionScheduler&&Xc(t.reactionScheduler)}function hd(t,e,n,i){var r=Gu(e);return ot(function(){var s=wt(t,i)[D];ni(r).forEach(function(a){s.extend_(a,r[a],n&&a in n?n[a]:!0)})}),t}function pd(t,e){return yo(Vn(t,e))}function yo(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=md(t.observing_).map(yo)),e}function md(t){return Array.from(new Set(t))}var gd=0;function bo(){this.message="FLOW_CANCELLED"}bo.prototype=Object.create(Error.prototype);var Ii=Ya("flow"),vd=Ya("flow.bound",{bound:!0}),bt=Object.assign(function(e,n){if(rn(n))return Ii.decorate_20223_(e,n);if(Ze(n))return At(e,n,Ii);var i=e,r=i.name||"<unnamed flow>",s=function(){var o=this,l=arguments,u=++gd,c=me(r+" - runid: "+u+" - init",i).apply(o,l),d,f=void 0,v=new Promise(function(g,m){var p=0;d=m;function h(S){f=void 0;var N;try{N=me(r+" - runid: "+u+" - yield "+p++,c.next).call(c,S)}catch(O){return m(O)}E(N)}function b(S){f=void 0;var N;try{N=me(r+" - runid: "+u+" - yield "+p++,c.throw).call(c,S)}catch(O){return m(O)}E(N)}function E(S){if(ke(S==null?void 0:S.then)){S.then(E,m);return}return S.done?g(S.value):(f=Promise.resolve(S.value),f.then(h,b))}h(void 0)});return v.cancel=me(r+" - runid: "+u+" - cancel",function(){try{f&&ys(f);var g=c.return(void 0),m=Promise.resolve(g.value);m.then(gt,gt),ys(m),d(new bo)}catch(p){d(p)}}),v};return s.isMobXFlow=!0,s},Ii);bt.bound=Oe(vd);function ys(t){ke(t.cancel)&&t.cancel()}function Jt(t){return(t==null?void 0:t.isMobXFlow)===!0}function kd(t,e){return t?ci(t)||!!t[D]||Dr(t)||$n(t)||oi(t):!1}function _o(t){return kd(t)}function xe(t,e){e===void 0&&(e=void 0),ce();try{return t.apply(e)}finally{de()}}function yd(t,e,n){return arguments.length===1||e&&typeof e=="object"?bd(t,e):So(t,e,{})}function So(t,e,n){var i;if(typeof n.timeout=="number"){var r=new Error("WHEN_TIMEOUT");i=setTimeout(function(){if(!a[D].isDisposed)if(a(),n.onError)n.onError(r);else throw r},n.timeout)}n.name="When";var s=qe("When-effect",e),a=go(function(o){var l=zc(!1,t);l&&(o.dispose(),i&&clearTimeout(i),s())},n);return a}function bd(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var i,r,s=new Promise(function(a,o){var l,u=So(t,a,Be({},e,{onError:o}));i=function(){u(),o(new Error("WHEN_CANCELLED"))},r=function(){u(),o(new Error("WHEN_ABORTED"))},e==null||(l=e.signal)==null||l.addEventListener==null||l.addEventListener("abort",r)}).finally(function(){var a;return e==null||(a=e.signal)==null||a.removeEventListener==null?void 0:a.removeEventListener("abort",r)});return s.cancel=i,s}function ct(t){return t[D]}var _d={has:function(e,n){return ct(e).has_(n)},get:function(e,n){return ct(e).get_(n)},set:function(e,n,i){var r;return Ze(n)?(r=ct(e).set_(n,i,!0))!=null?r:!0:!1},deleteProperty:function(e,n){var i;return Ze(n)?(i=ct(e).delete_(n,!0))!=null?i:!0:!1},defineProperty:function(e,n,i){var r;return(r=ct(e).defineProperty_(n,i))!=null?r:!0},ownKeys:function(e){return ct(e).ownKeys_()},preventExtensions:function(e){j(13)}};function Sd(t,e){var n,i;return ja(),t=wt(t,e),(i=(n=t[D]).proxy_)!=null?i:n.proxy_=new Proxy(t,_d)}function le(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function an(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Ba(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function ue(t,e){var n=st();try{for(var i=[].concat(t.interceptors_||[]),r=0,s=i.length;r<s&&(e=i[r](e),e&&!e.type&&j(14),!!e);r++);return e}finally{Fe(n)}}function ge(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function on(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Ba(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function ve(t,e){var n=st(),i=t.changeListeners_;if(i){i=i.slice();for(var r=0,s=i.length;r<s;r++)i[r](e);Fe(n)}}function No(t,e,n){return ot(function(){var i,r=wt(t,n)[D];(i=e)!=null||(e=Qu(t)),ni(e).forEach(function(s){return r.make_(s,e[s])})}),t}var bs="splice",we="update",Nd=1e4,Ed={get:function(e,n){var i=e[D];return n===D?i:n==="length"?i.getArrayLength_():typeof n=="string"&&!isNaN(n)?i.get_(parseInt(n)):Re(Mn,n)?Mn[n]:e[n]},set:function(e,n,i){var r=e[D];return n==="length"&&r.setArrayLength_(i),typeof n=="symbol"||isNaN(n)?e[n]=i:r.set_(parseInt(n),i),!0},preventExtensions:function(){j(15)}},$r=function(){function t(n,i,r,s){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=s,this.atom_=new He(n),this.enhancer_=function(a,o){return i(a,o,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.dehanceValues_=function(i){return this.dehancer!==void 0&&i.length>0?i.map(this.dehancer):i},e.intercept_=function(i){return an(this,i)},e.observe_=function(i,r){return r===void 0&&(r=!1),r&&i({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),on(this,i)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(i){(typeof i!="number"||isNaN(i)||i<0)&&j("Out of range: "+i);var r=this.values_.length;if(i!==r)if(i>r){for(var s=new Array(i-r),a=0;a<i-r;a++)s[a]=void 0;this.spliceWithArray_(r,0,s)}else this.spliceWithArray_(i,r-i)},e.updateArrayLength_=function(i,r){i!==this.lastKnownLength_&&j(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&xo(i+r+1)},e.spliceWithArray_=function(i,r,s){var a=this;this.atom_;var o=this.values_.length;if(i===void 0?i=0:i>o?i=o:i<0&&(i=Math.max(0,o+i)),arguments.length===1?r=o-i:r==null?r=0:r=Math.max(0,Math.min(r,o-i)),s===void 0&&(s=er),le(this)){var l=ue(this,{object:this.proxy_,type:bs,index:i,removedCount:r,added:s});if(!l)return er;r=l.removedCount,s=l.added}if(s=s.length===0?s:s.map(function(d){return a.enhancer_(d,void 0)}),this.legacyMode_){var u=s.length-r;this.updateArrayLength_(o,u)}var c=this.spliceItemsIntoValues_(i,r,s);return(r!==0||s.length!==0)&&this.notifyArraySplice_(i,s,c),this.dehanceValues_(c)},e.spliceItemsIntoValues_=function(i,r,s){if(s.length<Nd){var a;return(a=this.values_).splice.apply(a,[i,r].concat(s))}else{var o=this.values_.slice(i,i+r),l=this.values_.slice(i+r);this.values_.length+=s.length-r;for(var u=0;u<s.length;u++)this.values_[i+u]=s[u];for(var c=0;c<l.length;c++)this.values_[i+s.length+c]=l[c];return o}},e.notifyArrayChildUpdate_=function(i,r,s){var a=!this.owned_&&jt(),o=ge(this),l=o||a?{observableKind:"array",object:this.proxy_,type:we,debugObjectName:this.atom_.name_,index:i,newValue:r,oldValue:s}:null;this.atom_.reportChanged(),o&&ve(this,l)},e.notifyArraySplice_=function(i,r,s){var a=!this.owned_&&jt(),o=ge(this),l=o||a?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:bs,index:i,removed:s,added:r,removedCount:s.length,addedCount:r.length}:null;this.atom_.reportChanged(),o&&ve(this,l)},e.get_=function(i){if(this.legacyMode_&&i>=this.values_.length){console.warn("[mobx] Out of bounds read: "+i);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[i])},e.set_=function(i,r){var s=this.values_;if(this.legacyMode_&&i>s.length&&j(17,i,s.length),i<s.length){this.atom_;var a=s[i];if(le(this)){var o=ue(this,{type:we,object:this.proxy_,index:i,newValue:r});if(!o)return;r=o.newValue}r=this.enhancer_(r,a);var l=r!==a;l&&(s[i]=r,this.notifyArrayChildUpdate_(i,r,a))}else{for(var u=new Array(i+1-s.length),c=0;c<u.length-1;c++)u[c]=void 0;u[u.length-1]=r,this.spliceWithArray_(s.length,0,u)}},t}();function Ad(t,e,n,i){return n===void 0&&(n="ObservableArray"),i===void 0&&(i=!1),ja(),ot(function(){var r=new $r(n,e,i,!1);za(r.values_,D,r);var s=new Proxy(r.values_,Ed);return r.proxy_=s,t&&t.length&&r.spliceWithArray_(0,0,t),s})}var Mn={clear:function(){return this.splice(0)},replace:function(e){var n=this[D];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];var a=this[D];switch(arguments.length){case 0:return[];case 1:return a.spliceWithArray_(e);case 2:return a.spliceWithArray_(e,n)}return a.spliceWithArray_(e,n,r)},spliceWithArray:function(e,n,i){return this[D].spliceWithArray_(e,n,i)},push:function(){for(var e=this[D],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,i),e.values_.length},pop:function(){return this.splice(Math.max(this[D].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[D],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(0,0,i),e.values_.length},reverse:function(){return T.trackingDerivation&&j(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){T.trackingDerivation&&j(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[D],i=n.dehanceValues_(n.values_).indexOf(e);return i>-1?(this.splice(i,1),!0):!1}};G("at",oe);G("concat",oe);G("flat",oe);G("includes",oe);G("indexOf",oe);G("join",oe);G("lastIndexOf",oe);G("slice",oe);G("toString",oe);G("toLocaleString",oe);G("toSorted",oe);G("toSpliced",oe);G("with",oe);G("every",be);G("filter",be);G("find",be);G("findIndex",be);G("findLast",be);G("findLastIndex",be);G("flatMap",be);G("forEach",be);G("map",be);G("some",be);G("toReversed",be);G("reduce",Eo);G("reduceRight",Eo);function G(t,e){typeof Array.prototype[t]=="function"&&(Mn[t]=e(t))}function oe(t){return function(){var e=this[D];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function be(t){return function(e,n){var i=this,r=this[D];r.atom_.reportObserved();var s=r.dehanceValues_(r.values_);return s[t](function(a,o){return e.call(n,a,o,i)})}}function Eo(t){return function(){var e=this,n=this[D];n.atom_.reportObserved();var i=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(s,a,o){return r(s,a,o,e)},i[t].apply(i,arguments)}}var Od=rt("ObservableArrayAdministration",$r);function ui(t){return ei(t)&&Od(t[D])}var wd={},Ue="add",Un="delete",Ao=function(){function t(n,i,r){var s=this;i===void 0&&(i=et),r===void 0&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[D]=wd,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=i,this.name_=r,ke(Map)||j(18),ot(function(){s.keysAtom_=Wa("ObservableMap.keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var e=t.prototype;return e.has_=function(i){return this.data_.has(i)},e.has=function(i){var r=this;if(!T.trackingDerivation)return this.has_(i);var s=this.hasMap_.get(i);if(!s){var a=s=new Qe(this.has_(i),ii,"ObservableMap.key?",!1);this.hasMap_.set(i,a),vo(a,function(){return r.hasMap_.delete(i)})}return s.get()},e.set=function(i,r){var s=this.has_(i);if(le(this)){var a=ue(this,{type:s?we:Ue,object:this,newValue:r,name:i});if(!a)return this;r=a.newValue}return s?this.updateValue_(i,r):this.addValue_(i,r),this},e.delete=function(i){var r=this;if(this.keysAtom_,le(this)){var s=ue(this,{type:Un,object:this,name:i});if(!s)return!1}if(this.has_(i)){var a=jt(),o=ge(this),l=o||a?{observableKind:"map",debugObjectName:this.name_,type:Un,object:this,oldValue:this.data_.get(i).value_,name:i}:null;return xe(function(){var u;r.keysAtom_.reportChanged(),(u=r.hasMap_.get(i))==null||u.setNewValue_(!1);var c=r.data_.get(i);c.setNewValue_(void 0),r.data_.delete(i)}),o&&ve(this,l),!0}return!1},e.updateValue_=function(i,r){var s=this.data_.get(i);if(r=s.prepareNewValue_(r),r!==T.UNCHANGED){var a=jt(),o=ge(this),l=o||a?{observableKind:"map",debugObjectName:this.name_,type:we,object:this,oldValue:s.value_,name:i,newValue:r}:null;s.setNewValue_(r),o&&ve(this,l)}},e.addValue_=function(i,r){var s=this;this.keysAtom_,xe(function(){var u,c=new Qe(r,s.enhancer_,"ObservableMap.key",!1);s.data_.set(i,c),r=c.value_,(u=s.hasMap_.get(i))==null||u.setNewValue_(!0),s.keysAtom_.reportChanged()});var a=jt(),o=ge(this),l=o||a?{observableKind:"map",debugObjectName:this.name_,type:Ue,object:this,name:i,newValue:r}:null;o&&ve(this,l)},e.get=function(i){return this.has(i)?this.dehanceValue_(this.data_.get(i).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var i=this,r=this.keys();return Yt({next:function(){var a=r.next(),o=a.done,l=a.value;return{done:o,value:o?void 0:i.get(l)}}})},e.entries=function(){var i=this,r=this.keys();return Yt({next:function(){var a=r.next(),o=a.done,l=a.value;return{done:o,value:o?void 0:[l,i.get(l)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(i,r){for(var s=vt(this),a;!(a=s()).done;){var o=a.value,l=o[0],u=o[1];i.call(r,u,l,this)}},e.merge=function(i){var r=this;return at(i)&&(i=new Map(i)),xe(function(){je(i)?Hu(i).forEach(function(s){return r.set(s,i[s])}):Array.isArray(i)?i.forEach(function(s){var a=s[0],o=s[1];return r.set(a,o)}):Nt(i)?(zu(i)||j(19,i),i.forEach(function(s,a){return r.set(a,s)})):i!=null&&j(20,i)}),this},e.clear=function(){var i=this;xe(function(){ro(function(){for(var r=vt(i.keys()),s;!(s=r()).done;){var a=s.value;i.delete(a)}})})},e.replace=function(i){var r=this;return xe(function(){for(var s=Td(i),a=new Map,o=!1,l=vt(r.data_.keys()),u;!(u=l()).done;){var c=u.value;if(!s.has(c)){var d=r.delete(c);if(d)o=!0;else{var f=r.data_.get(c);a.set(c,f)}}}for(var v=vt(s.entries()),g;!(g=v()).done;){var m=g.value,p=m[0],h=m[1],b=r.data_.has(p);if(r.set(p,h),r.data_.has(p)){var E=r.data_.get(p);a.set(p,E),b||(o=!0)}}if(!o)if(r.data_.size!==a.size)r.keysAtom_.reportChanged();else for(var S=r.data_.keys(),N=a.keys(),O=S.next(),R=N.next();!O.done;){if(O.value!==R.value){r.keysAtom_.reportChanged();break}O=S.next(),R=N.next()}r.data_=a}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(i,r){return on(this,i)},e.intercept_=function(i){return an(this,i)},Et(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),at=rt("ObservableMap",Ao);function Td(t){if(Nt(t)||at(t))return t;if(Array.isArray(t))return new Map(t);if(je(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return j(21,t)}var Cd={},Oo=function(){function t(n,i,r){var s=this;i===void 0&&(i=et),r===void 0&&(r="ObservableSet"),this.name_=void 0,this[D]=Cd,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,ke(Set)||j(22),this.enhancer_=function(a,o){return i(a,o,r)},ot(function(){s.atom_=Wa(s.name_),n&&s.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.clear=function(){var i=this;xe(function(){ro(function(){for(var r=vt(i.data_.values()),s;!(s=r()).done;){var a=s.value;i.delete(a)}})})},e.forEach=function(i,r){for(var s=vt(this),a;!(a=s()).done;){var o=a.value;i.call(r,o,o,this)}},e.add=function(i){var r=this;if(this.atom_,le(this)){var s=ue(this,{type:Ue,object:this,newValue:i});if(!s)return this}if(!this.has(i)){xe(function(){r.data_.add(r.enhancer_(i,void 0)),r.atom_.reportChanged()});var a=!1,o=ge(this),l=o||a?{observableKind:"set",debugObjectName:this.name_,type:Ue,object:this,newValue:i}:null;o&&ve(this,l)}return this},e.delete=function(i){var r=this;if(le(this)){var s=ue(this,{type:Un,object:this,oldValue:i});if(!s)return!1}if(this.has(i)){var a=!1,o=ge(this),l=o||a?{observableKind:"set",debugObjectName:this.name_,type:Un,object:this,oldValue:i}:null;return xe(function(){r.atom_.reportChanged(),r.data_.delete(i)}),o&&ve(this,l),!0}return!1},e.has=function(i){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(i))},e.entries=function(){var i=0,r=Array.from(this.keys()),s=Array.from(this.values());return Yt({next:function(){var o=i;return i+=1,o<s.length?{value:[r[o],s[o]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var i=this,r=0,s=Array.from(this.data_.values());return Yt({next:function(){return r<s.length?{value:i.dehanceValue_(s[r++]),done:!1}:{done:!0}}})},e.intersection=function(i){if(Ce(i))return i.intersection(this);var r=new Set(this);return r.intersection(i)},e.union=function(i){if(Ce(i))return i.union(this);var r=new Set(this);return r.union(i)},e.difference=function(i){return new Set(this).difference(i)},e.symmetricDifference=function(i){if(Ce(i))return i.symmetricDifference(this);var r=new Set(this);return r.symmetricDifference(i)},e.isSubsetOf=function(i){return new Set(this).isSubsetOf(i)},e.isSupersetOf=function(i){return new Set(this).isSupersetOf(i)},e.isDisjointFrom=function(i){if(Ce(i))return i.isDisjointFrom(this);var r=new Set(this);return r.isDisjointFrom(i)},e.replace=function(i){var r=this;return Ot(i)&&(i=new Set(i)),xe(function(){Array.isArray(i)?(r.clear(),i.forEach(function(s){return r.add(s)})):Ce(i)?(r.clear(),i.forEach(function(s){return r.add(s)})):i!=null&&j("Cannot initialize set from "+i)}),this},e.observe_=function(i,r){return on(this,i)},e.intercept_=function(i){return an(this,i)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},Et(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ot=rt("ObservableSet",Oo),_s=Object.create(null),Ss="remove",wo=function(){function t(n,i,r,s){i===void 0&&(i=new Map),s===void 0&&(s=Nc),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=i,this.name_=r,this.defaultAnnotation_=s,this.keysAtom_=new He("ObservableObject.keys"),this.isPlainObject_=je(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(i){return this.values_.get(i).get()},e.setObservablePropValue_=function(i,r){var s=this.values_.get(i);if(s instanceof ye)return s.set(r),!0;if(le(this)){var a=ue(this,{type:we,object:this.proxy_||this.target_,name:i,newValue:r});if(!a)return null;r=a.newValue}if(r=s.prepareNewValue_(r),r!==T.UNCHANGED){var o=ge(this),l=!1,u=o||l?{type:we,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:i,newValue:r}:null;s.setNewValue_(r),o&&ve(this,u)}return!0},e.get_=function(i){return T.trackingDerivation&&!Re(this.target_,i)&&this.has_(i),this.target_[i]},e.set_=function(i,r,s){return s===void 0&&(s=!1),Re(this.target_,i)?this.values_.has(i)?this.setObservablePropValue_(i,r):s?Reflect.set(this.target_,i,r):(this.target_[i]=r,!0):this.extend_(i,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},e.has_=function(i){if(!T.trackingDerivation)return i in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(i);return r||(r=new Qe(i in this.target_,ii,"ObservableObject.key?",!1),this.pendingKeys_.set(i,r)),r.get()},e.make_=function(i,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(!(i in this.target_)){var s;if((s=this.target_[Ne])!=null&&s[i])return;j(1,r.annotationType_,this.name_+"."+i.toString())}for(var a=this.target_;a&&a!==Zn;){var o=Fn(a,i);if(o){var l=r.make_(this,i,o,a);if(l===0)return;if(l===1)break}a=Object.getPrototypeOf(a)}Es(this,r,i)}},e.extend_=function(i,r,s,a){if(a===void 0&&(a=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(i,r,a);var o=s.extend_(this,i,r,a);return o&&Es(this,s,i),o},e.defineProperty_=function(i,r,s){s===void 0&&(s=!1),this.keysAtom_;try{ce();var a=this.delete_(i);if(!a)return a;if(le(this)){var o=ue(this,{object:this.proxy_||this.target_,name:i,type:Ue,newValue:r.value});if(!o)return null;var l=o.newValue;r.value!==l&&(r=Be({},r,{value:l}))}if(s){if(!Reflect.defineProperty(this.target_,i,r))return!1}else Ae(this.target_,i,r);this.notifyPropertyAddition_(i,r.value)}finally{de()}return!0},e.defineObservableProperty_=function(i,r,s,a){a===void 0&&(a=!1),this.keysAtom_;try{ce();var o=this.delete_(i);if(!o)return o;if(le(this)){var l=ue(this,{object:this.proxy_||this.target_,name:i,type:Ue,newValue:r});if(!l)return null;r=l.newValue}var u=Ns(i),c={configurable:T.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,i,c))return!1}else Ae(this.target_,i,c);var d=new Qe(r,s,"ObservableObject.key",!1);this.values_.set(i,d),this.notifyPropertyAddition_(i,d.value_)}finally{de()}return!0},e.defineComputedProperty_=function(i,r,s){s===void 0&&(s=!1),this.keysAtom_;try{ce();var a=this.delete_(i);if(!a)return a;if(le(this)){var o=ue(this,{object:this.proxy_||this.target_,name:i,type:Ue,newValue:void 0});if(!o)return null}r.name||(r.name="ObservableObject.key"),r.context=this.proxy_||this.target_;var l=Ns(i),u={configurable:T.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(s){if(!Reflect.defineProperty(this.target_,i,u))return!1}else Ae(this.target_,i,u);this.values_.set(i,new ye(r)),this.notifyPropertyAddition_(i,void 0)}finally{de()}return!0},e.delete_=function(i,r){if(r===void 0&&(r=!1),this.keysAtom_,!Re(this.target_,i))return!0;if(le(this)){var s=ue(this,{object:this.proxy_||this.target_,name:i,type:Ss});if(!s)return null}try{var a;ce();var o=ge(this),l=!1,u=this.values_.get(i),c=void 0;if(!u&&(o||l)){var d;c=(d=Fn(this.target_,i))==null?void 0:d.value}if(r){if(!Reflect.deleteProperty(this.target_,i))return!1}else delete this.target_[i];if(u&&(this.values_.delete(i),u instanceof Qe&&(c=u.value_),co(u)),this.keysAtom_.reportChanged(),(a=this.pendingKeys_)==null||(a=a.get(i))==null||a.set(i in this.target_),o||l){var f={type:Ss,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:c,name:i};o&&ve(this,f)}}finally{de()}return!0},e.observe_=function(i,r){return on(this,i)},e.intercept_=function(i){return an(this,i)},e.notifyPropertyAddition_=function(i,r){var s,a=ge(this),o=!1;if(a||o){var l=a||o?{type:Ue,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:i,newValue:r}:null;a&&ve(this,l)}(s=this.pendingKeys_)==null||(s=s.get(i))==null||s.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),ni(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function wt(t,e){var n;if(Re(t,D))return t;var i=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",r=new wo(t,new Map,String(i),Dc(e));return ti(t,D,r),t}var xd=rt("ObservableObjectAdministration",wo);function Ns(t){return _s[t]||(_s[t]={get:function(){return this[D].getObservablePropValue_(t)},set:function(n){return this[D].setObservablePropValue_(t,n)}})}function ci(t){return ei(t)?xd(t[D]):!1}function Es(t,e,n){var i;(i=t.target_[Ne])==null||delete i[n]}var Rd=Co(0),Fd=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Di=0,To=function(){};function Id(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}Id(To,Array.prototype);var Mr=function(t){function e(i,r,s,a){var o;return s===void 0&&(s="ObservableArray"),a===void 0&&(a=!1),o=t.call(this)||this,ot(function(){var l=new $r(s,r,a,!0);l.proxy_=o,za(o,D,l),i&&i.length&&o.spliceWithArray(0,0,i),Fd&&Object.defineProperty(o,"0",Rd)}),o}Ka(e,t);var n=e.prototype;return n.concat=function(){this[D].atom_.reportObserved();for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return Array.prototype.concat.apply(this.slice(),s.map(function(o){return ui(o)?o.slice():o}))},n[Symbol.iterator]=function(){var i=this,r=0;return Yt({next:function(){return r<i.length?{value:i[r++],done:!1}:{done:!0,value:void 0}}})},Et(e,[{key:"length",get:function(){return this[D].getArrayLength_()},set:function(r){this[D].setArrayLength_(r)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(To);Object.entries(Mn).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&ti(Mr.prototype,e,n)});function Co(t){return{enumerable:!1,configurable:!0,get:function(){return this[D].get_(t)},set:function(n){this[D].set_(t,n)}}}function Dd(t){Ae(Mr.prototype,""+t,Co(t))}function xo(t){if(t>Di){for(var e=Di;e<t+100;e++)Dd(e);Di=t}}xo(1e3);function Pd(t,e,n){return new Mr(t,e,n)}function Vn(t,e){if(typeof t=="object"&&t!==null){if(ui(t))return e!==void 0&&j(23),t[D].atom_;if(Ot(t))return t.atom_;if(at(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||j(25,e,ur(t)),n}if(ci(t)){if(!e)return j(26);var i=t[D].values_.get(e);return i||j(27,e,ur(t)),i}if(Dr(t)||oi(t)||$n(t))return t}else if(ke(t)&&$n(t[D]))return t[D];j(28)}function Ld(t,e){if(t||j(29),Dr(t)||oi(t)||$n(t)||at(t)||Ot(t))return t;if(t[D])return t[D];j(24,t)}function ur(t,e){var n;if(e!==void 0)n=Vn(t,e);else{if(li(t))return t.name;ci(t)||at(t)||Ot(t)?n=Ld(t):n=Vn(t)}return n.name_}function ot(t){var e=st(),n=si(!0);ce();try{return t()}finally{de(),ai(n),Fe(e)}}var As=Zn.toString;function Ur(t,e,n){return n===void 0&&(n=-1),cr(t,e,n)}function cr(t,e,n,i,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var s=typeof t;if(s!=="function"&&s!=="object"&&typeof e!="object")return!1;var a=As.call(t);if(a!==As.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol!="undefined"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Os(t),e=Os(e);var o=a==="[object Array]";if(!o){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!(ke(l)&&l instanceof l&&ke(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),i=i||[],r=r||[];for(var c=i.length;c--;)if(i[c]===t)return r[c]===e;if(i.push(t),r.push(e),o){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!cr(t[c],e[c],n-1,i,r))return!1}else{var d=Object.keys(t),f;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(f=d[c],!(Re(e,f)&&cr(t[f],e[f],n-1,i,r)))return!1}return i.pop(),r.pop(),!0}function Os(t){return ui(t)?t.slice():Nt(t)||at(t)||Ce(t)||Ot(t)?Array.from(t.entries()):t}function Yt(t){return t[Symbol.iterator]=$d,t}function $d(){return this}["Symbol","Map","Set"].forEach(function(t){var e=Ir();typeof e[t]=="undefined"&&j("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Zc,extras:{getDebugName:ur},$mobx:D});class Ro{constructor(e,n){w(this,"logger");w(this,"channel");w(this,"listeners",new Map);w(this,"eventQueue",new Map);this.logger=ze.withPrefix(n,"EventBus");try{this.logger.debug(`Creating BroadcastChannel with name "${e}"`),this.channel=new BroadcastChannel(e),this.channel.onmessage=i=>this.handleMessage(i),this.channel.onmessageerror=i=>this.logger.error("NizzaBroadcastChannel error:",i)}catch(i){throw this.logger.error("Failed to create NizzaBroadcastChannel:",i),i}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,i={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,i)}handleMessage(e){const n=e.data,{name:i}=n;this.logger.debug(`Received message "${i}" with data`,n);for(const[r,s]of this.listeners.entries())this.matchWildcard(r,i)&&(this.logger.debug(`Matching pattern "${r}" for event "${i}"`),s.forEach(a=>a({...n,wildcard:r})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const r=new Error("Invalid arguments");throw this.logger.error(r),r}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const i=Array.from(this.eventQueue).filter(([r])=>{const s=this.matchWildcard(e,r);return s&&(this.eventQueue.delete(r),this.logger.debug(`Dequeued pending events for "${r}".`)),s}).flatMap(([,r])=>r);for(const[r,s]of this.listeners.entries())this.matchWildcard(r,e)&&(this.logger.debug(`Adding listener to pattern "${r}"`),s.add(n),i.length&&(this.logger.debug(`Delivering pending events for "${e}".`),i.forEach(a=>{n({...a,wildcard:r})})))}emitEvent(e,n,i){if(typeof e!="string"){const a=new Error("Invalid arguments");throw this.logger.error(a),a}const r={name:e,data:n,attrs:i},s=Array.from(this.getMatchingListeners(e));if(s.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[a,o]of s)o({...r,wildcard:a})}else this.logger.debug(`No listeners for event "${e}", enqueuing`),this.eventQueue.has(e)||this.eventQueue.set(e,[]),this.eventQueue.get(e).push(r);this.logger.debug("Posting message to channel",r),this.channel.postMessage(r)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,i]of this.listeners.entries())if(this.matchWildcard(n,e))for(const r of i)yield[n,r]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const i=this.listeners.get(e);i.delete(n),i.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const i=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),s=new RegExp(`^${i}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${s}`),s}}const Md="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ud=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=Md[n[t]&63];return e};const Vr=(t=8)=>Ud(t),Vd=t=>{const e=Object.entries(t).reduce((n,[i,r])=>r!==void 0?`${n}${n?"&":""}${i}=${r}`:n,"");return e?`?${e}`:""},Fo=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function jd(){const t=new Error().stack.split(`
|
|
4
4
|
`);return t.length<3?"":t[2].trim().substring(3)}function Bd(t){return new Promise(e=>setTimeout(e,t))}var jr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Br(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Io={exports:{}};(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(jr,function(){var e=function(){},n="undefined",i=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],s={},a=null;function o(m,p){var h=m[p];if(typeof h.bind=="function")return h.bind(m);try{return Function.prototype.bind.call(h,m)}catch{return function(){return Function.prototype.apply.apply(h,[m,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&i?l:console[m]!==void 0?o(console,m):console.log!==void 0?o(console,"log"):e}function c(){for(var m=this.getLevel(),p=0;p<r.length;p++){var h=r[p];this[h]=p<m?e:this.methodFactory(h,m,this.name)}if(this.log=this.debug,typeof console===n&&m<this.levels.SILENT)return"No console available for logging"}function d(m){return function(){typeof console!==n&&(c.call(this),this[m].apply(this,arguments))}}function f(m,p,h){return u(m)||d.apply(this,arguments)}function v(m,p){var h=this,b,E,S,N="loglevel";typeof m=="string"?N+=":"+m:typeof m=="symbol"&&(N=void 0);function O(F){var H=(r[F]||"silent").toUpperCase();if(!(typeof window===n||!N)){try{window.localStorage[N]=H;return}catch{}try{window.document.cookie=encodeURIComponent(N)+"="+H+";"}catch{}}}function R(){var F;if(!(typeof window===n||!N)){try{F=window.localStorage[N]}catch{}if(typeof F===n)try{var H=window.document.cookie,ie=encodeURIComponent(N),k=H.indexOf(ie+"=");k!==-1&&(F=/^([^;]+)/.exec(H.slice(k+ie.length+1))[1])}catch{}return h.levels[F]===void 0&&(F=void 0),F}}function C(){if(!(typeof window===n||!N)){try{window.localStorage.removeItem(N)}catch{}try{window.document.cookie=encodeURIComponent(N)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function M(F){var H=F;if(typeof H=="string"&&h.levels[H.toUpperCase()]!==void 0&&(H=h.levels[H.toUpperCase()]),typeof H=="number"&&H>=0&&H<=h.levels.SILENT)return H;throw new TypeError("log.setLevel() called with invalid level: "+F)}h.name=m,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=p||f,h.getLevel=function(){return S!=null?S:E!=null?E:b},h.setLevel=function(F,H){return S=M(F),H!==!1&&O(S),c.call(h)},h.setDefaultLevel=function(F){E=M(F),R()||h.setLevel(F,!1)},h.resetLevel=function(){S=null,C(),c.call(h)},h.enableAll=function(F){h.setLevel(h.levels.TRACE,F)},h.disableAll=function(F){h.setLevel(h.levels.SILENT,F)},h.rebuild=function(){if(a!==h&&(b=M(a.getLevel())),c.call(h),a===h)for(var F in s)s[F].rebuild()},b=M(a?a.getLevel():"WARN");var z=R();z!=null&&(S=M(z)),c.call(h)}a=new v,a.getLogger=function(p){if(typeof p!="symbol"&&typeof p!="string"||p==="")throw new TypeError("You must supply a name when creating a logger.");var h=s[p];return h||(h=s[p]=new v(p,a.methodFactory)),h};var g=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=g),a},a.getLoggers=function(){return s},a.default=a,a})})(Io);var Do=Io.exports;const Pi=Br(Do);var Po={exports:{}};(function(t){(function(e,n){t.exports?t.exports=n():e.prefix=n(e)})(jr,function(e){var n=function(c){for(var d=1,f=arguments.length,v;d<f;d++)for(v in arguments[d])Object.prototype.hasOwnProperty.call(arguments[d],v)&&(c[v]=arguments[d][v]);return c},i={template:"[%t] %l:",levelFormatter:function(c){return c.toUpperCase()},nameFormatter:function(c){return c||"root"},timestampFormatter:function(c){return c.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r,s={},a=function(c){if(!c||!c.getLogger)throw new TypeError("Argument is not a root logger");r=c},o=function(c,d){if(!c||!c.setLevel)throw new TypeError("Argument is not a logger");var f=c.methodFactory,v=c.name||"",g=s[v]||s[""]||i;function m(p,h,b){var E=f(p,h,b),S=s[b]||s[""],N=S.template.indexOf("%t")!==-1,O=S.template.indexOf("%l")!==-1,R=S.template.indexOf("%n")!==-1;return function(){for(var C="",M=arguments.length,z=Array(M),F=0;F<M;F++)z[F]=arguments[F];if(v||!s[b]){var H=S.timestampFormatter(new Date),ie=S.levelFormatter(p),k=S.nameFormatter(b);S.format?C+=S.format(ie,k,H):(C+=S.template,N&&(C=C.replace(/%t/,H)),O&&(C=C.replace(/%l/,ie)),R&&(C=C.replace(/%n/,k))),z.length&&typeof z[0]=="string"?z[0]=C+" "+z[0]:z.unshift(C)}E.apply(void 0,z)}}return s[v]||(c.methodFactory=m),d=d||{},d.template&&(d.format=void 0),s[v]=n({},g,d),c.setLevel(c.getLevel()),r||c.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),c},l={reg:a,apply:o},u;return e&&(u=e.prefix,l.noConflict=function(){return e.prefix===l&&(e.prefix=u),l}),l})})(Po);var qd=Po.exports;const ws=Br(qd);var Ye;let ze=(Ye=class{constructor(e=""){w(this,"provider",Pi);w(this,"defaultLevel",Do.levels.INFO);this.namePrefix=e,this.namePrefix=e?`${e}-`:"",this.provider.setDefaultLevel(this.defaultLevel),ws.reg(Pi),ws.apply(Pi,{template:"%t %l [%n]",nameFormatter:n=>{var i;return(i=n==null?void 0:n.toLowerCase())!=null?i:""},timestampFormatter:()=>new Date().toTimeString().slice(0,8)})}createLogger(e){const n=`${this.namePrefix}${e.toLowerCase()}`,i=this.provider.getLogger(n),r=localStorage.getItem(`loglevel:${n}`);return i.setLevel(r||this.defaultLevel),i}static withPrefix(e,n){const i=/\(\w+\)/,r={get(s,a){const o=s[a];return typeof o=="function"&&Ye.LOG_METHODS.includes(a)?(...l)=>(typeof l[0]=="string"&&!i.test(l[0])&&(l[0]=`(${n}) ${l[0]}`),o.apply(s,l)):o}};return new Proxy(e,r)}},w(Ye,"LOG_METHODS",["trace","debug","info","warn","error","log"]),Ye);const he=class he{constructor(){w(this,"instanceId",Vr());w(this,"log",new ze("nz"));w(this,"coreLogger",this.log.createLogger("core"));w(this,"_config",null);w(this,"_account");w(this,"_accountStatus","idle");w(this,"_productDataSource");w(this,"_eventBus",new Ro("nizza",this.coreLogger));this.coreLogger=ze.withPrefix(this.coreLogger,"NizzaStore"),No(this,{_config:W,_account:W,_productDataSource:W,_accountStatus:W,config:Me,account:Me,accountName:Me,accountStatus:Me,configure:me,refetchAccount:me,setProductDataSource:me,setAddToCartConfig:me,setProductId:me},{name:"NizzaStore",autoBind:!0}),this.refetchAccount=this.refetchAccount.bind(this)}static instance(){var n;if(!!((n=window==null?void 0:window.nizza)!=null&&n.store))he._instance=window.nizza.store;else{const i=new he;he._instance=i}return window.nizza||(window.nizza={},window.nz={},he._instance.coreLogger.debug("Initialized nizza window object")),window.nizza.store=he._instance,window.nz=window.nizza,he._instance}async configure(e){try{await this.updateConfig(e)}catch(n){this.setAccountStatus("error"),this.coreLogger.error("Error running configure",n)}}async updateConfig(e){var i;const{account:n}=(i=this._config)!=null?i:{};this._config=e,n!==e.account&&await this.fetchAccount(e.account),e.getProductDataSource&&this.setProductDataSource(await e.getProductDataSource())}async fetchAccount(e){this.setAccountStatus("loading");try{const n=await El(e);this.setAccount(n),this.setAccountStatus("success")}catch(n){this.setAccountStatus("error"),this.coreLogger.error("Error fetching account:",n)}}setAccount(e){this._account=e}setAccountStatus(e){this._accountStatus=e}setProductDataSource(e){this._productDataSource=e}setProductId(e){this._config&&(this._config.productId=e)}setOrderFormId(e){this._config&&(this._config.orderFormId=e)}setAddToCartConfig(e){if(!this._config)throw new Error("you cannot set addToCartConfig before running configure()");this._config.addToCartConfig=e}async refetchAccount(){var e;(e=this._config)!=null&&e.account&&await this.fetchAccount(this._config.account)}get version(){return he.version}get config(){return this._config}get account(){return this._account}get accountStatus(){return this._accountStatus}get accountName(){var e;return(e=this._config)==null?void 0:e.account}get productDataSource(){return this._productDataSource}get eventBus(){return this._eventBus}};w(he,"version","6"),w(he,"_instance");let jn=he;const lt=t=>{const e=jn.instance();return yd(()=>!!e.account,()=>t==null?void 0:t(e)),e};function pt(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function An(t){return function e(n){return arguments.length===0||pt(n)?e:t.apply(this,arguments)}}function zd(t){return function e(n,i){switch(arguments.length){case 0:return e;case 1:return pt(n)?e:An(function(r){return t(n,r)});default:return pt(n)&&pt(i)?e:pt(n)?An(function(r){return t(r,i)}):pt(i)?An(function(r){return t(n,r)}):t(n,i)}}}const Hd=Number.isInteger||function(e){return e<<0===e};function Gd(t){return Object.prototype.toString.call(t)==="[object String]"}function Kd(t,e){var n=t<0?e.length+t:t;return Gd(e)?e.charAt(n):e[n]}var Wd=An(function(e){return e==null});function Jd(t,e){for(var n=e,i=0;i<t.length;i+=1){if(n==null)return;var r=t[i];Hd(r)?n=Kd(r,n):n=n[r]}return n}var Yd=zd(Jd);class Tt extends Error{constructor(e,n,i){super(n),this.value=i,this.name=e}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value}}}}class Lo extends Tt{constructor(e){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${e}' not found.`,e)}}class qr extends Tt{constructor(e){var n;super("APP_UNEXPECTED_ERROR",(n=e.message)!=null?n:"An unexpected error occurred.",e)}}class $o extends Tt{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}class Mo extends Tt{constructor(e){super("INVALID_NIZZA_GLOBAL_OBJECT_ERROR",`
|