@nizza/core 0.8.0 → 0.8.1-beta.0
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/README.md +1 -1
- package/dist/environments/environment.d.ts.map +1 -1
- package/dist/environments/environment.prod.d.ts.map +1 -1
- package/dist/environments/types.d.ts +0 -1
- package/dist/environments/types.d.ts.map +1 -1
- package/dist/index.mjs +28916 -28766
- package/dist/index.mjs.map +1 -1
- package/dist/lib/accounts/core/infrastructure/repositories/rest-account-plan.repository.d.ts.map +1 -1
- package/dist/lib/accounts/core/infrastructure/repositories/rest-private-account.repository.d.ts.map +1 -1
- package/dist/lib/accounts/core/infrastructure/repositories/rest-public-account.repository.d.ts.map +1 -1
- package/dist/lib/api-client/client.d.ts +192 -0
- package/dist/lib/api-client/client.d.ts.map +1 -0
- package/dist/lib/api-client/errors.d.ts +65 -0
- package/dist/lib/api-client/errors.d.ts.map +1 -0
- package/dist/lib/api-client/index.d.ts +4 -0
- package/dist/lib/api-client/index.d.ts.map +1 -0
- package/dist/lib/api-client/types.d.ts +132 -0
- package/dist/lib/api-client/types.d.ts.map +1 -0
- package/dist/lib/api-client/utils.d.ts +17 -0
- package/dist/lib/api-client/utils.d.ts.map +1 -0
- package/dist/lib/constants/products.d.ts +0 -1
- package/dist/lib/constants/products.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ivs/socket/core/infrastructure/graphql-event-chat-room.repository.d.ts +0 -2
- package/dist/lib/ivs/socket/core/infrastructure/graphql-event-chat-room.repository.d.ts.map +1 -1
- package/dist/lib/logger/constants.d.ts.map +1 -1
- package/dist/lib/logger/core/loggers/http.logger.d.ts.map +1 -1
- package/dist/lib/types/api-graphql-types.d.ts +77 -24
- package/dist/lib/types/api-graphql-types.d.ts.map +1 -1
- package/dist/lib/types/nizza/chat.d.ts.map +1 -1
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/nz-api-client.d.ts +7 -0
- package/dist/lib/utils/nz-api-client.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/index.cjs +0 -221
- package/dist/index.cjs.map +0 -1
- package/dist/lib/utils/customFetch.d.ts +0 -30
- package/dist/lib/utils/customFetch.d.ts.map +0 -1
package/dist/index.cjs
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";var J0=Object.defineProperty;var X0=(t,e,n)=>e in t?J0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pe=(t,e,n)=>X0(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),Q0=require("react/jsx-runtime"),Z0=require("react-dom");function eS(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Dn={};let tS=0;function Ju(t,e){const n=`atom${++tS}`,r={toString(){return(Dn?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=nS,r.write=rS),r}function nS(t){return t(this)}function rS(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const hp=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,hl=t=>"init"in t,pl=t=>!!t.write,wu=new WeakMap,$d=t=>{var e;return jd(t)&&!((e=wu.get(t))!=null&&e[1])},iS=(t,e)=>{const n=wu.get(t);if(n)n[1]=!0,n[0].forEach(r=>r(e));else if((Dn?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},sS=t=>{if(wu.has(t))return;const e=[new Set,!1];wu.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},jd=t=>typeof(t==null?void 0:t.then)=="function",pp=t=>"v"in t||"e"in t,Pa=t=>{if("e"in t)throw t.e;if((Dn?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},Ty=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},mp=(t,e,n,r,i)=>{var s;if((Dn?"production":void 0)!=="production"&&r===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),$d(n.v)&&Ty(e,n.v,i),(s=i.m)==null||s.t.add(e),t&&oS(t,r,e)},qi=()=>[new Map,new Map,new Set],ml=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},oS=(t,e,n)=>{const r=t[0].get(e);r&&r.add(n)},aS=(t,e)=>t[0].get(e),gp=(t,e)=>{t[2].add(e)},ti=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(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(s=>s())}),n.forEach(r=>r())}},Oy=t=>{let e;(Dn?"production":void 0)!=="production"&&(e=new Set);const n=(w,k,C)=>{const E="v"in k,O=k.v,I=$d(k.v)?k.v:null;if(jd(C)){sS(C);for(const M of k.d.keys())Ty(w,C,t(M,k));k.v=C,delete k.e}else k.v=C,delete k.e;(!E||!Object.is(O,k.v))&&(++k.n,I&&iS(I,C))},r=(w,k,C,E)=>{var O;if(!(E!=null&&E(k))&&pp(C)&&(C.m||Array.from(C.d).every(([se,H])=>r(w,se,t(se,C),E).n===H)))return C;C.d.clear();let I=!0;const M=se=>{if(hp(k,se)){const ie=t(se,C);if(!pp(ie))if(hl(se))n(se,ie,se.init);else throw new Error("no atom init");return Pa(ie)}const H=r(w,se,t(se,C),E);if(I)mp(w,k,C,se,H);else{const ie=qi();mp(ie,k,C,se,H),u(ie,k,C),ti(ie)}return Pa(H)};let Y,ee;const F={get signal(){return Y||(Y=new AbortController),Y.signal},get setSelf(){return(Dn?"production":void 0)!=="production"&&!pl(k)&&console.warn("setSelf function cannot be used with read-only atom"),!ee&&pl(k)&&(ee=(...se)=>{if((Dn?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)return c(k,...se)}),ee}};try{const se=k.read(M,F);if(n(k,C,se),jd(se)){(O=se.onCancel)==null||O.call(se,()=>Y==null?void 0:Y.abort());const H=()=>{if(C.m){const ie=qi();u(ie,k,C),ti(ie)}};se.then(H,H)}return C}catch(se){return delete C.v,C.e=se,++C.n,C}finally{I=!1}},i=w=>Pa(r(void 0,w,t(w))),s=(w,k,C)=>{var E,O;const I=new Map;for(const M of((E=C.m)==null?void 0:E.t)||[])I.set(M,t(M,C));for(const M of C.p)I.set(M,t(M,C));return(O=aS(w,k))==null||O.forEach(M=>{I.set(M,t(M,C))}),I},o=(w,k,C)=>{const E=[],O=new Set,I=(ee,F)=>{if(!O.has(ee)){O.add(ee);for(const[se,H]of s(w,ee,F))ee!==se&&I(se,H);E.push([ee,F,F.n])}};I(k,C);const M=new Set([k]),Y=ee=>O.has(ee);for(let ee=E.length-1;ee>=0;--ee){const[F,se,H]=E[ee];let ie=!1;for(const xe of se.d.keys())if(xe!==F&&M.has(xe)){ie=!0;break}ie&&(r(w,F,se,Y),u(w,F,se),H!==se.n&&(ml(w,F,se),M.add(F))),O.delete(F)}},a=(w,k,C,...E)=>{const O=Y=>Pa(r(w,Y,t(Y,C))),I=(Y,...ee)=>{const F=t(Y,C);let se;if(hp(k,Y)){if(!hl(Y))throw new Error("atom not writable");const H="v"in F,ie=F.v,xe=ee[0];n(Y,F,xe),u(w,Y,F),(!H||!Object.is(ie,F.v))&&(ml(w,Y,F),o(w,Y,F))}else se=a(w,Y,F,...ee);return ti(w),se};return k.write(O,I,...E)},c=(w,...k)=>{const C=qi(),E=a(C,w,t(w),...k);return ti(C),E},u=(w,k,C)=>{if(C.m&&!$d(C.v)){for(const E of C.d.keys())C.m.d.has(E)||(d(w,E,t(E,C)).t.add(k),C.m.d.add(E));for(const E of C.m.d||[])if(!C.d.has(E)){C.m.d.delete(E);const O=h(w,E,t(E,C));O==null||O.t.delete(k)}}},d=(w,k,C)=>{if(!C.m){r(w,k,C);for(const E of C.d.keys())d(w,E,t(E,C)).t.add(k);if(C.m={l:new Set,d:new Set(C.d.keys()),t:new Set},(Dn?"production":void 0)!=="production"&&e.add(k),pl(k)&&k.onMount){const E=C.m,{onMount:O}=k;gp(w,()=>{const I=O((...M)=>a(w,k,C,...M));I&&(E.u=I)})}}return C.m},h=(w,k,C)=>{if(C.m&&!C.m.l.size&&!Array.from(C.m.t).some(E=>{var O;return(O=t(E,C).m)==null?void 0:O.d.has(k)})){const E=C.m.u;E&&gp(w,E),delete C.m,(Dn?"production":void 0)!=="production"&&e.delete(k);for(const O of C.d.keys()){const I=h(w,O,t(O,C));I==null||I.t.delete(k)}return}return C.m},v={get:i,set:c,sub:(w,k)=>{const C=qi(),E=t(w),O=d(C,w,E);ti(C);const I=O.l;return I.add(k),()=>{I.delete(k);const M=qi();h(M,w,E),ti(M)}},unstable_derive:w=>Oy(...w(t))};return(Dn?"production":void 0)!=="production"&&Object.assign(v,{dev4_get_internal_weak_map:()=>({get:k=>{const C=t(k);if(C.n!==0)return C}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:k=>{const C=qi();for(const[E,O]of k)if(hl(E)){const I=t(E),M="v"in I,Y=I.v;n(E,I,O),u(C,E,I),(!M||!Object.is(Y,I.v))&&(ml(C,E,I),o(C,E,I))}ti(C)}}),v},uS=()=>{const t=new WeakMap;return Oy(n=>{let r=t.get(n);return r||(r={d:new Map,p:new Set,n:0},t.set(n,r)),r})};let zs;const cS=()=>(zs||(zs=uS(),(Dn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zs),globalThis.__JOTAI_DEFAULT_STORE__!==zs&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zs),Iy={},lS=st.createContext(void 0),Ry=t=>st.useContext(lS)||cS(),Py=t=>typeof(t==null?void 0:t.then)=="function",dS=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},fS=st.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(dS(t),t)}),gl=new WeakMap,hS=t=>{let e=gl.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>u=>{i===c&&n(u)},o=c=>u=>{i===c&&r(u)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(u=>{if((Iy?"production":void 0)!=="production"&&u===c)throw new Error("[Bug] p is not updated even after cancelation");Py(u)?(gl.set(u,e),i=u,u.then(s(u),o(u)),a(u)):n(u)})};t.then(s(t),o(t)),a(t)}),gl.set(t,e)),e};function Vd(t,e){const n=Ry(),[[r,i,s],o]=st.useReducer(u=>{const d=n.get(t);return Object.is(u[0],d)&&u[1]===n&&u[2]===t?u:[d,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),st.useEffect(()=>{const u=n.sub(t,()=>{o()});return o(),u},[n,t,void 0]),st.useDebugValue(a),Py(a)){const u=hS(a);return fS(u)}return a}function zf(t,e){const n=Ry();return st.useCallback((...i)=>{if((Iy?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function vl(t,e){return[Vd(t),zf(t)]}const Dy=Ju(null);Dy.debugLabel="accountAtom";const pS={},{NZ_CORE_SERVICES_GRAPHQL_URL:mS,NZ_CORE_SERVICES_REST_URL:gS}=pS,bs={apiUrls:{restV2:gS||"https://core-services-prod.nizza.com/api",graphql:mS||"https://core-services-prod.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};var vS="Logging",yS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Hi=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bS(arguments[e]));return t},vp={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},Rn;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE"})(Rn||(Rn={}));var $n=function(){function t(e,n){n===void 0&&(n=Rn.WARN),this.name=e,this.level=n,this._pluggables=[]}return t.prototype._padding=function(e){return e<10?"0"+e:""+e},t.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},t.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},t.prototype._log=function(e){for(var n,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var o=this.level;t.LOG_LEVEL&&(o=t.LOG_LEVEL),typeof window!="undefined"&&window.LOG_LEVEL&&(o=window.LOG_LEVEL);var a=vp[o],c=vp[e];if(c>=a){var u=console.log.bind(console);e===Rn.ERROR&&console.error&&(u=console.error.bind(console)),e===Rn.WARN&&console.warn&&(u=console.warn.bind(console));var d="["+e+"] "+this._ts()+" "+this.name,h="";if(i.length===1&&typeof i[0]=="string")h=d+" - "+i[0],u(h);else if(i.length===1)h=d+" "+i[0],u(d,i[0]);else if(typeof i[0]=="string"){var p=i.slice(1);p.length===1&&(p=p[0]),h=d+" - "+i[0]+" "+p,u(d+" - "+i[0],p)}else h=d+" "+i,u(d,i);try{for(var y=yS(this._pluggables),v=y.next();!v.done;v=y.next()){var w=v.value,k={message:h,timestamp:Date.now()};w.pushLogs([k])}}catch(C){n={error:C}}finally{try{v&&!v.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.INFO],e))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.WARN],e))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.ERROR],e))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.DEBUG],e))},t.prototype.verbose=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._log.apply(this,Hi([Rn.VERBOSE],e))},t.prototype.addPluggable=function(e){e&&e.getCategoryName()===vS&&(this._pluggables.push(e),e.configure(this._config))},t.prototype.listPluggables=function(){return this._pluggables},t.LOG_LEVEL=null,t}(),wS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yl=new $n("Amplify"),_S=function(){function t(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=$n,this.ServiceWorker=null}return t.prototype.register=function(e){yl.debug("component registered in amplify",e),this._components.push(e),typeof e.getModuleName=="function"?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):yl.debug("no getModuleName method for component",e),e.configure(this._config)},t.prototype.configure=function(e){var n=this;return e?(this._config=Object.assign(this._config,e),yl.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(r){var i=wS(r,2);i[0];var s=i[1];Object.keys(s).forEach(function(o){n._modules[o]&&(s[o]=n._modules[o])})}),this._components.map(function(r){r.configure(n._config)}),this._config):this._config},t.prototype.addPluggable=function(e){e&&e.getCategory&&typeof e.getCategory=="function"&&this._components.map(function(n){n.addPluggable&&typeof n.addPluggable=="function"&&n.addPluggable(e)})},t}(),Gf=new _S,SS="4.7.14",qd="aws-amplify/"+SS,ui={userAgent:qd+" js",product:"",navigator:null,isReactNative:!1};if(typeof navigator!="undefined"&&navigator.product)switch(ui.product=navigator.product||"",ui.navigator=navigator||null,navigator.product){case"ReactNative":ui.userAgent=qd+" react-native",ui.isReactNative=!0;break;default:ui.userAgent=qd+" js",ui.isReactNative=!1;break}var kS=function(t){return""+ui.userAgent},xo=function(){return xo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xo.apply(this,arguments)},Fy=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},yp=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fy(arguments[e]));return t},tr=new $n("Hub"),ES=typeof Symbol!="undefined"&&typeof Symbol.for=="function"?Symbol.for("amplify_default"):"@@amplify_default";function AS(t){return t.onHubCapsule!==void 0}var CS=function(){function t(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return t.prototype.remove=function(e,n){if(e instanceof RegExp){var r=this.patterns.find(function(s){var o=s.pattern;return o.source===e.source});if(!r){tr.warn("No listeners for "+e);return}this.patterns=yp(this.patterns.filter(function(s){return s!==r}))}else{var i=this.listeners[e];if(!i){tr.warn("No listeners for "+e);return}this.listeners[e]=yp(i.filter(function(s){var o=s.callback;return o!==n}))}},t.prototype.dispatch=function(e,n,r,i){if(r===void 0&&(r=""),this.protectedChannels.indexOf(e)>-1){var s=i===ES;s||tr.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences")}var o={channel:e,payload:xo({},n),source:r,patternInfo:[]};try{this._toListeners(o)}catch(a){tr.error(a)}},t.prototype.listen=function(e,n,r){var i=this;r===void 0&&(r="noname");var s;if(AS(n))tr.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),s=n.onHubCapsule.bind(n);else{if(typeof n!="function")throw new Error("No callback supplied to Hub");s=n}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:s});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:r,callback:s})}return function(){i.remove(e,s)}},t.prototype._toListeners=function(e){var n=e.channel,r=e.payload,i=this.listeners[n];if(i&&i.forEach(function(o){tr.debug("Dispatching to "+n+" with ",r);try{o.callback(e)}catch(a){tr.error(a)}}),this.patterns.length>0){if(!r.message){tr.warn("Cannot perform pattern matching without a message key");return}var s=r.message;this.patterns.forEach(function(o){var a=s.match(o.pattern);if(a){var c=Fy(a),u=c.slice(1),d=xo(xo({},e),{patternInfo:u});try{o.callback(d)}catch(h){tr.error(h)}}})}},t}(),Nr=new CS("__default__"),xS=function(t){if(t.isResolved)return t;var e=!0,n=!1,r=!1,i=t.then(function(s){return r=!0,e=!1,s},function(s){throw n=!0,e=!1,s});return i.isFullfilled=function(){return r},i.isPending=function(){return e},i.isRejected=function(){return n},i},ur=function(){var t=typeof window!="undefined"&&typeof window.document!="undefined",e=typeof process!="undefined"&&process.versions!=null&&process.versions.node!=null;return{isBrowser:t,isNode:e}},Mr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ws(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var Hd=function(t,e){return Hd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},Hd(t,e)};function Wf(t,e){Hd(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var et=function(){return et=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},et.apply(this,arguments)};function Yf(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function NS(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function TS(t,e){return function(n,r){e(n,r,t)}}function OS(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ct(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function kt(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function IS(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}function RS(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function pn(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _s(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function Yn(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_s(arguments[e]));return t}function PS(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function Mo(t){return this instanceof Mo?(this.v=t,this):new Mo(t)}function DS(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(y){return new Promise(function(v,w){s.push([p,y,v,w])>1||a(p,y)})})}function a(p,y){try{c(r[p](y))}catch(v){h(s[0][3],v)}}function c(p){p.value instanceof Mo?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,y){p(y),s.shift(),s.length&&a(s[0][0],s[0][1])}}function FS(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(o){return(n=!n)?{value:Mo(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function US(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof pn=="function"?pn(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function LS(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function MS(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function BS(t){return t&&t.__esModule?t:{default:t}}function $S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function jS(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const VS=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return et},__asyncDelegator:FS,__asyncGenerator:DS,__asyncValues:US,__await:Mo,__awaiter:Ct,__classPrivateFieldGet:$S,__classPrivateFieldSet:jS,__createBinding:IS,__decorate:NS,__exportStar:RS,__extends:Wf,__generator:kt,__importDefault:BS,__importStar:MS,__makeTemplateObject:LS,__metadata:OS,__param:TS,__read:_s,__rest:Yf,__spread:Yn,__spreadArrays:PS,__values:pn},Symbol.toStringTag,{value:"Module"})),Ss=ws(VS);var Uy={};for(var Da=0;Da<256;Da++){var Fa=Da.toString(16).toLowerCase();Fa.length===1&&(Fa="0"+Fa),Uy[Da]=Fa}function is(t){for(var e="",n=0;n<t.byteLength;n++)e+=Uy[t[n]];return e}var ni={},wo={exports:{}};/*! https://mths.be/punycode v1.3.2 by @mathias */var qS=wo.exports,bp;function HS(){return bp||(bp=1,function(t,e){(function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,s=typeof Mr=="object"&&Mr;(s.global===s||s.window===s||s.self===s)&&(n=s);var o,a=2147483647,c=36,u=1,d=26,h=38,p=700,y=72,v=128,w="-",k=/^xn--/,C=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=c-u,M=Math.floor,Y=String.fromCharCode,ee;function F(U){throw RangeError(O[U])}function se(U,de){for(var Se=U.length,Fe=[];Se--;)Fe[Se]=de(U[Se]);return Fe}function H(U,de){var Se=U.split("@"),Fe="";Se.length>1&&(Fe=Se[0]+"@",U=Se[1]),U=U.replace(E,".");var L=U.split("."),X=se(L,de).join(".");return Fe+X}function ie(U){for(var de=[],Se=0,Fe=U.length,L,X;Se<Fe;)L=U.charCodeAt(Se++),L>=55296&&L<=56319&&Se<Fe?(X=U.charCodeAt(Se++),(X&64512)==56320?de.push(((L&1023)<<10)+(X&1023)+65536):(de.push(L),Se--)):de.push(L);return de}function xe(U){return se(U,function(de){var Se="";return de>65535&&(de-=65536,Se+=Y(de>>>10&1023|55296),de=56320|de&1023),Se+=Y(de),Se}).join("")}function qe(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:c}function G(U,de){return U+22+75*(U<26)-((de!=0)<<5)}function R(U,de,Se){var Fe=0;for(U=Se?M(U/p):U>>1,U+=M(U/de);U>I*d>>1;Fe+=c)U=M(U/I);return M(Fe+(I+1)*U/(U+h))}function Q(U){var de=[],Se=U.length,Fe,L=0,X=v,He=y,Ne,Ve,Ae,Ze,Ke,Ie,at,ct,Ue;for(Ne=U.lastIndexOf(w),Ne<0&&(Ne=0),Ve=0;Ve<Ne;++Ve)U.charCodeAt(Ve)>=128&&F("not-basic"),de.push(U.charCodeAt(Ve));for(Ae=Ne>0?Ne+1:0;Ae<Se;){for(Ze=L,Ke=1,Ie=c;Ae>=Se&&F("invalid-input"),at=qe(U.charCodeAt(Ae++)),(at>=c||at>M((a-L)/Ke))&&F("overflow"),L+=at*Ke,ct=Ie<=He?u:Ie>=He+d?d:Ie-He,!(at<ct);Ie+=c)Ue=c-ct,Ke>M(a/Ue)&&F("overflow"),Ke*=Ue;Fe=de.length+1,He=R(L-Ze,Fe,Ze==0),M(L/Fe)>a-X&&F("overflow"),X+=M(L/Fe),L%=Fe,de.splice(L++,0,X)}return xe(de)}function te(U){var de,Se,Fe,L,X,He,Ne,Ve,Ae,Ze,Ke,Ie=[],at,ct,Ue,lt;for(U=ie(U),at=U.length,de=v,Se=0,X=y,He=0;He<at;++He)Ke=U[He],Ke<128&&Ie.push(Y(Ke));for(Fe=L=Ie.length,L&&Ie.push(w);Fe<at;){for(Ne=a,He=0;He<at;++He)Ke=U[He],Ke>=de&&Ke<Ne&&(Ne=Ke);for(ct=Fe+1,Ne-de>M((a-Se)/ct)&&F("overflow"),Se+=(Ne-de)*ct,de=Ne,He=0;He<at;++He)if(Ke=U[He],Ke<de&&++Se>a&&F("overflow"),Ke==de){for(Ve=Se,Ae=c;Ze=Ae<=X?u:Ae>=X+d?d:Ae-X,!(Ve<Ze);Ae+=c)lt=Ve-Ze,Ue=c-Ze,Ie.push(Y(G(Ze+lt%Ue,0))),Ve=M(lt/Ue);Ie.push(Y(G(Ve,0))),X=R(Se,ct,Fe==L),Se=0,++Fe}++Se,++de}return Ie.join("")}function ge(U){return H(U,function(de){return k.test(de)?Q(de.slice(4).toLowerCase()):de})}function ve(U){return H(U,function(de){return C.test(de)?"xn--"+te(de):de})}if(o={version:"1.3.2",ucs2:{decode:ie,encode:xe},decode:Q,encode:te,toASCII:ve,toUnicode:ge},r&&i)if(t.exports==r)i.exports=o;else for(ee in o)o.hasOwnProperty(ee)&&(r[ee]=o[ee]);else n.punycode=o})(qS)}(wo,wo.exports)),wo.exports}var Ki={},bl,wp;function KS(){if(wp)return bl;wp=1;function t(e,n){return Object.prototype.hasOwnProperty.call(e,n)}return bl=function(e,n,r,i){n=n||"&",r=r||"=";var s={};if(typeof e!="string"||e.length===0)return s;var o=/\+/g;e=e.split(n);var a=1e3;i&&typeof i.maxKeys=="number"&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u<c;++u){var d=e[u].replace(o,"%20"),h=d.indexOf(r),p,y,v,w;h>=0?(p=d.substr(0,h),y=d.substr(h+1)):(p=d,y=""),v=decodeURIComponent(p),w=decodeURIComponent(y),t(s,v)?Array.isArray(s[v])?s[v].push(w):s[v]=[s[v],w]:s[v]=w}return s},bl}var wl,_p;function zS(){if(_p)return wl;_p=1;var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};return wl=function(e,n,r,i){return n=n||"&",r=r||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(s){var o=encodeURIComponent(t(s))+r;return Array.isArray(e[s])?e[s].map(function(a){return o+encodeURIComponent(t(a))}).join(n):o+encodeURIComponent(t(e[s]))}).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""},wl}var Sp;function GS(){return Sp||(Sp=1,Ki.decode=Ki.parse=KS(),Ki.encode=Ki.stringify=zS()),Ki}var kp;function WS(){if(kp)return ni;kp=1;var t=HS();ni.parse=k,ni.resolve=E,ni.resolveObject=O,ni.format=C,ni.Url=e;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=["<",">",'"',"`"," ","\r",`
|
|
15
|
-
`," "],s=["{","}","|","\\","^","`"].concat(i),o=["'"].concat(s),a=["%","/","?",";","#"].concat(o),c=["/","?","#"],u=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=GS();function k(F,se,H){if(F&&M(F)&&F instanceof e)return F;var ie=new e;return ie.parse(F,se,H),ie}e.prototype.parse=function(F,se,H){if(!I(F))throw new TypeError("Parameter 'url' must be a string, not "+typeof F);var ie=F;ie=ie.trim();var xe=n.exec(ie);if(xe){xe=xe[0];var qe=xe.toLowerCase();this.protocol=qe,ie=ie.substr(xe.length)}if(H||xe||ie.match(/^\/\/[^@\/]+@[^@\/]+/)){var G=ie.substr(0,2)==="//";G&&!(xe&&y[xe])&&(ie=ie.substr(2),this.slashes=!0)}if(!y[xe]&&(G||xe&&!v[xe])){for(var R=-1,Q=0;Q<c.length;Q++){var te=ie.indexOf(c[Q]);te!==-1&&(R===-1||te<R)&&(R=te)}var ge,ve;R===-1?ve=ie.lastIndexOf("@"):ve=ie.lastIndexOf("@",R),ve!==-1&&(ge=ie.slice(0,ve),ie=ie.slice(ve+1),this.auth=decodeURIComponent(ge)),R=-1;for(var Q=0;Q<a.length;Q++){var te=ie.indexOf(a[Q]);te!==-1&&(R===-1||te<R)&&(R=te)}R===-1&&(R=ie.length),this.host=ie.slice(0,R),ie=ie.slice(R),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var de=this.hostname.split(/\./),Q=0,Se=de.length;Q<Se;Q++){var Fe=de[Q];if(Fe&&!Fe.match(d)){for(var L="",X=0,He=Fe.length;X<He;X++)Fe.charCodeAt(X)>127?L+="x":L+=Fe[X];if(!L.match(d)){var Ne=de.slice(0,Q),Ve=de.slice(Q+1),Ae=Fe.match(h);Ae&&(Ne.push(Ae[1]),Ve.unshift(Ae[2])),Ve.length&&(ie="/"+Ve.join(".")+ie),this.hostname=Ne.join(".");break}}}if(this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),!U){for(var Ze=this.hostname.split("."),Ke=[],Q=0;Q<Ze.length;++Q){var Ie=Ze[Q];Ke.push(Ie.match(/[^A-Za-z0-9_-]/)?"xn--"+t.encode(Ie):Ie)}this.hostname=Ke.join(".")}var at=this.port?":"+this.port:"",ct=this.hostname||"";this.host=ct+at,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ie[0]!=="/"&&(ie="/"+ie))}if(!p[qe])for(var Q=0,Se=o.length;Q<Se;Q++){var Ue=o[Q],lt=encodeURIComponent(Ue);lt===Ue&&(lt=escape(Ue)),ie=ie.split(Ue).join(lt)}var vt=ie.indexOf("#");vt!==-1&&(this.hash=ie.substr(vt),ie=ie.slice(0,vt));var x=ie.indexOf("?");if(x!==-1?(this.search=ie.substr(x),this.query=ie.substr(x+1),se&&(this.query=w.parse(this.query)),ie=ie.slice(0,x)):se&&(this.search="",this.query={}),ie&&(this.pathname=ie),v[qe]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var at=this.pathname||"",Ie=this.search||"";this.path=at+Ie}return this.href=this.format(),this};function C(F){return I(F)&&(F=k(F)),F instanceof e?F.format():e.prototype.format.call(F)}e.prototype.format=function(){var F=this.auth||"";F&&(F=encodeURIComponent(F),F=F.replace(/%3A/i,":"),F+="@");var se=this.protocol||"",H=this.pathname||"",ie=this.hash||"",xe=!1,qe="";this.host?xe=F+this.host:this.hostname&&(xe=F+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(xe+=":"+this.port)),this.query&&M(this.query)&&Object.keys(this.query).length&&(qe=w.stringify(this.query));var G=this.search||qe&&"?"+qe||"";return se&&se.substr(-1)!==":"&&(se+=":"),this.slashes||(!se||v[se])&&xe!==!1?(xe="//"+(xe||""),H&&H.charAt(0)!=="/"&&(H="/"+H)):xe||(xe=""),ie&&ie.charAt(0)!=="#"&&(ie="#"+ie),G&&G.charAt(0)!=="?"&&(G="?"+G),H=H.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),G=G.replace("#","%23"),se+xe+H+G+ie};function E(F,se){return k(F,!1,!0).resolve(se)}e.prototype.resolve=function(F){return this.resolveObject(k(F,!1,!0)).format()};function O(F,se){return F?k(F,!1,!0).resolveObject(se):se}e.prototype.resolveObject=function(F){if(I(F)){var se=new e;se.parse(F,!1,!0),F=se}var H=new e;if(Object.keys(this).forEach(function(He){H[He]=this[He]},this),H.hash=F.hash,F.href==="")return H.href=H.format(),H;if(F.slashes&&!F.protocol)return Object.keys(F).forEach(function(He){He!=="protocol"&&(H[He]=F[He])}),v[H.protocol]&&H.hostname&&!H.pathname&&(H.path=H.pathname="/"),H.href=H.format(),H;if(F.protocol&&F.protocol!==H.protocol){if(!v[F.protocol])return Object.keys(F).forEach(function(He){H[He]=F[He]}),H.href=H.format(),H;if(H.protocol=F.protocol,!F.host&&!y[F.protocol]){for(var ge=(F.pathname||"").split("/");ge.length&&!(F.host=ge.shift()););F.host||(F.host=""),F.hostname||(F.hostname=""),ge[0]!==""&&ge.unshift(""),ge.length<2&&ge.unshift(""),H.pathname=ge.join("/")}else H.pathname=F.pathname;if(H.search=F.search,H.query=F.query,H.host=F.host||"",H.auth=F.auth,H.hostname=F.hostname||F.host,H.port=F.port,H.pathname||H.search){var ie=H.pathname||"",xe=H.search||"";H.path=ie+xe}return H.slashes=H.slashes||F.slashes,H.href=H.format(),H}var qe=H.pathname&&H.pathname.charAt(0)==="/",G=F.host||F.pathname&&F.pathname.charAt(0)==="/",R=G||qe||H.host&&F.pathname,Q=R,te=H.pathname&&H.pathname.split("/")||[],ge=F.pathname&&F.pathname.split("/")||[],ve=H.protocol&&!v[H.protocol];if(ve&&(H.hostname="",H.port=null,H.host&&(te[0]===""?te[0]=H.host:te.unshift(H.host)),H.host="",F.protocol&&(F.hostname=null,F.port=null,F.host&&(ge[0]===""?ge[0]=F.host:ge.unshift(F.host)),F.host=null),R=R&&(ge[0]===""||te[0]==="")),G)H.host=F.host||F.host===""?F.host:H.host,H.hostname=F.hostname||F.hostname===""?F.hostname:H.hostname,H.search=F.search,H.query=F.query,te=ge;else if(ge.length)te||(te=[]),te.pop(),te=te.concat(ge),H.search=F.search,H.query=F.query;else if(!ee(F.search)){if(ve){H.hostname=H.host=te.shift();var U=H.host&&H.host.indexOf("@")>0?H.host.split("@"):!1;U&&(H.auth=U.shift(),H.host=H.hostname=U.shift())}return H.search=F.search,H.query=F.query,(!Y(H.pathname)||!Y(H.search))&&(H.path=(H.pathname?H.pathname:"")+(H.search?H.search:"")),H.href=H.format(),H}if(!te.length)return H.pathname=null,H.search?H.path="/"+H.search:H.path=null,H.href=H.format(),H;for(var de=te.slice(-1)[0],Se=(H.host||F.host)&&(de==="."||de==="..")||de==="",Fe=0,L=te.length;L>=0;L--)de=te[L],de=="."?te.splice(L,1):de===".."?(te.splice(L,1),Fe++):Fe&&(te.splice(L,1),Fe--);if(!R&&!Q)for(;Fe--;Fe)te.unshift("..");R&&te[0]!==""&&(!te[0]||te[0].charAt(0)!=="/")&&te.unshift(""),Se&&te.join("/").substr(-1)!=="/"&&te.push("");var X=te[0]===""||te[0]&&te[0].charAt(0)==="/";if(ve){H.hostname=H.host=X?"":te.length?te.shift():"";var U=H.host&&H.host.indexOf("@")>0?H.host.split("@"):!1;U&&(H.auth=U.shift(),H.host=H.hostname=U.shift())}return R=R||H.host&&te.length,R&&!X&&te.unshift(""),te.length?H.pathname=te.join("/"):(H.pathname=null,H.path=null),(!Y(H.pathname)||!Y(H.search))&&(H.path=(H.pathname?H.pathname:"")+(H.search?H.search:"")),H.auth=F.auth||H.auth,H.slashes=H.slashes||F.slashes,H.href=H.format(),H},e.prototype.parseHost=function(){var F=this.host,se=r.exec(F);se&&(se=se[0],se!==":"&&(this.port=se.substr(1)),F=F.substr(0,F.length-se.length)),F&&(this.hostname=F)};function I(F){return typeof F=="string"}function M(F){return typeof F=="object"&&F!==null}function Y(F){return F===null}function ee(F){return F==null}return ni}var Tr=WS(),YS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ep=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},_l=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},JS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},XS=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(JS(arguments[e]));return t},Ua=new $n("Util"),hi=function(t){YS(e,t);function e(n){var r=t.call(this,n)||this;return r.nonRetryable=!0,r}return e}(Error),QS=function(t){var e="nonRetryable";return t&&t[e]};function ZS(t,e,n,r){return Ep(this,void 0,void 0,function(){var i=this;return _l(this,function(s){if(typeof t!="function")throw Error("functionToRetry must be a function");return[2,new Promise(function(o,a){return Ep(i,void 0,void 0,function(){var c,u,d,h,p,y;return _l(this,function(v){switch(v.label){case 0:c=0,u=!1,d=function(){},p=function(){var w,k,C,E;return _l(this,function(O){switch(O.label){case 0:c++,Ua.debug(t.name+" attempt #"+c+" with this vars: "+JSON.stringify(e)),O.label=1;case 1:return O.trys.push([1,3,,7]),w={},k=o,[4,t.apply(void 0,XS(e))];case 2:return[2,(w.value=k.apply(void 0,[O.sent()]),w)];case 3:return C=O.sent(),h=C,Ua.debug("error on "+t.name,C),QS(C)?(Ua.debug(t.name+" non retryable error",C),[2,{value:a(C)}]):(E=n(c,e,C),Ua.debug(t.name+" retrying in "+E+" ms"),E===!1||u?[2,{value:a(C)}]:[3,4]);case 4:return[4,new Promise(function(I){d=I,setTimeout(d,E)})];case 5:O.sent(),O.label=6;case 6:return[3,7];case 7:return[2]}})},v.label=1;case 1:return u?[3,3]:[5,p()];case 2:return y=v.sent(),typeof y=="object"?[2,y.value]:[3,1];case 3:return a(h),[2]}})})})]})})}function ek(t){var e=100,n=100;return function(r){var i=Math.pow(2,r)*e+n*Math.random();return i>t?!1:i}}var tk=function(t,e,n,r){return ZS(t,e,ek(n))};function nk(t){return t.split("").map(function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")}).join("")}function rk(t){return t.match(/.{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")}var _u=function(){return _u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_u.apply(this,arguments)},ik=new $n("Parser"),sk=function(t){var e={};if(t.aws_mobile_analytics_app_id){var n={AWSPinpoint:{appId:t.aws_mobile_analytics_app_id,region:t.aws_mobile_analytics_app_region}};e.Analytics=n}(t.aws_cognito_identity_pool_id||t.aws_user_pools_id)&&(e.Auth={userPoolId:t.aws_user_pools_id,userPoolWebClientId:t.aws_user_pools_web_client_id,region:t.aws_cognito_region,identityPoolId:t.aws_cognito_identity_pool_id,identityPoolRegion:t.aws_cognito_region,mandatorySignIn:t.aws_mandatory_sign_in==="enable",signUpVerificationMethod:t.aws_cognito_sign_up_verification_method||"code"});var r;return t.aws_user_files_s3_bucket?r={AWSS3:{bucket:t.aws_user_files_s3_bucket,region:t.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:t.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:r=t?t.Storage||t:{},t.Logging&&(e.Logging=_u(_u({},t.Logging),{region:t.aws_project_region})),t.geo&&(e.Geo=Object.assign({},t.geo),t.geo.amazon_location_service&&(e.Geo={AmazonLocationService:t.geo.amazon_location_service})),e.Analytics=Object.assign({},e.Analytics,t.Analytics),e.Auth=Object.assign({},e.Auth,t.Auth),e.Storage=Object.assign({},r),e.Logging=Object.assign({},e.Logging,t.Logging),ik.debug("parse config",t,"to amplifyconfig",e),e},ok=function(){function t(){}return t.parseMobilehubConfig=sk,t}(),Kd=function(t,e){return Kd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Kd(t,e)};function Jf(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kd(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var le=function(){return le=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},le.apply(this,arguments)};function Zt(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}function en(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ak(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var Sl={},Gs={},Ws={},Ys={},Ap;function uk(){if(Ap)return Ys;Ap=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ys.isEmptyData=t,Ys}var kl={},Cp;function Ly(){return Cp||(Cp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])}(kl)),kl}var ck=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t.charCodeAt(n);if(i<128)e.push(i);else if(i<2048)e.push(i>>6|192,i&63|128);else if(n+1<t.length&&(i&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320){var s=65536+((i&1023)<<10)+(t.charCodeAt(++n)&1023);e.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else e.push(i>>12|224,i>>6&63|128,i&63|128)}return Uint8Array.from(e)},lk=function(t){for(var e="",n=0,r=t.length;n<r;n++){var i=t[n];if(i<128)e+=String.fromCharCode(i);else if(192<=i&&i<224){var s=t[++n];e+=String.fromCharCode((i&31)<<6|s&63)}else if(240<=i&&i<365){var o=[i,t[++n],t[++n],t[++n]],a="%"+o.map(function(c){return c.toString(16)}).join("%");e+=decodeURIComponent(a)}else e+=String.fromCharCode((i&15)<<12|(t[++n]&63)<<6|t[++n]&63)}return e};function dk(t){return new TextEncoder().encode(t)}function fk(t){return new TextDecoder("utf-8").decode(t)}var My=function(t){return typeof TextEncoder=="function"?dk(t):ck(t)},By=function(t){return typeof TextDecoder=="function"?fk(t):lk(t)};const hk=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:My,toUtf8:By},Symbol.toStringTag,{value:"Module"})),pk=ws(hk),mk={};function gk(){return typeof window!="undefined"?window:typeof self!="undefined"?self:mk}const vk=Object.freeze(Object.defineProperty({__proto__:null,locateWindow:gk},Symbol.toStringTag,{value:"Module"})),Xf=ws(vk);var xp;function $y(){if(xp)return Ws;xp=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.Sha256=void 0;var t=uk(),e=Ly(),n=pk,r=Xf,i=function(){function a(c){c?(this.operation=s(c).then(function(u){return(0,r.locateWindow)().msCrypto.subtle.sign(e.SHA_256_HMAC_ALGO,u)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,r.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return a.prototype.update=function(c){var u=this;(0,t.isEmptyData)(c)||(this.operation=this.operation.then(function(d){return d.onerror=function(){u.operation=Promise.reject(new Error("Error encountered updating hash"))},d.process(o(c)),d}),this.operation.catch(function(){}))},a.prototype.digest=function(){return this.operation.then(function(c){return new Promise(function(u,d){c.onerror=function(){d(new Error("Error encountered finalizing hash"))},c.oncomplete=function(){c.result&&u(new Uint8Array(c.result)),d(new Error("Error encountered finalizing hash"))},c.finish()})})},a}();Ws.Sha256=i;function s(a){return new Promise(function(c,u){var d=(0,r.locateWindow)().msCrypto.subtle.importKey("raw",o(a),e.SHA_256_HMAC_ALGO,!1,["sign"]);d.oncomplete=function(){d.result&&c(d.result),u(new Error("ImportKey completed without importing key."))},d.onerror=function(){u(new Error("ImportKey failed to import key."))}})}function o(a){return typeof a=="string"?(0,n.fromUtf8)(a):ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(a)}return Ws}var Js={},El={},Xs={};const yk=t=>{const e=[];for(let n=0,r=t.length;n<r;n++){const i=t.charCodeAt(n);if(i<128)e.push(i);else if(i<2048)e.push(i>>6|192,i&63|128);else if(n+1<t.length&&(i&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320){const s=65536+((i&1023)<<10)+(t.charCodeAt(++n)&1023);e.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else e.push(i>>12|224,i>>6&63|128,i&63|128)}return Uint8Array.from(e)},bk=t=>{let e="";for(let n=0,r=t.length;n<r;n++){const i=t[n];if(i<128)e+=String.fromCharCode(i);else if(192<=i&&i<224){const s=t[++n];e+=String.fromCharCode((i&31)<<6|s&63)}else if(240<=i&&i<365){const o="%"+[i,t[++n],t[++n],t[++n]].map(a=>a.toString(16)).join("%");e+=decodeURIComponent(o)}else e+=String.fromCharCode((i&15)<<12|(t[++n]&63)<<6|t[++n]&63)}return e};function wk(t){return new TextEncoder().encode(t)}function _k(t){return new TextDecoder("utf-8").decode(t)}const Sk=t=>typeof TextEncoder=="function"?wk(t):yk(t),kk=t=>typeof TextDecoder=="function"?_k(t):bk(t),Ek=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:Sk,toUtf8:kk},Symbol.toStringTag,{value:"Module"})),Ak=ws(Ek);var Np;function Ck(){if(Np)return Xs;Np=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.convertToBuffer=void 0;var t=Ak,e=typeof Buffer!="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:t.fromUtf8;function n(r){return r instanceof Uint8Array?r:typeof r=="string"?e(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}return Xs.convertToBuffer=n,Xs}var Qs={},Tp;function xk(){if(Tp)return Qs;Tp=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Qs.isEmptyData=t,Qs}var Zs={},Op;function Nk(){if(Op)return Zs;Op=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Zs.numToUint8=t,Zs}var eo={},Ip;function Tk(){if(Ip)return eo;Ip=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var n=new Uint32Array(e.length),r=0;r<e.length;)n[r]=e[r];return n}return Uint32Array.from(e)}return eo.uint32ArrayFrom=t,eo}var Rp;function jy(){return Rp||(Rp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=Ck();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var n=xk();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return n.isEmptyData}});var r=Nk();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return r.numToUint8}});var i=Tk();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return i.uint32ArrayFrom}})}(El)),El}var Pp;function Vy(){if(Pp)return Js;Pp=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.Sha256=void 0;var t=jy(),e=Ly(),n=Xf,r=function(){function i(s){this.toHash=new Uint8Array(0),s!==void 0&&(this.key=new Promise(function(o,a){(0,n.locateWindow)().crypto.subtle.importKey("raw",(0,t.convertToBuffer)(s),e.SHA_256_HMAC_ALGO,!1,["sign"]).then(o,a)}),this.key.catch(function(){}))}return i.prototype.update=function(s){if(!(0,t.isEmptyData)(s)){var o=(0,t.convertToBuffer)(s),a=new Uint8Array(this.toHash.byteLength+o.byteLength);a.set(this.toHash,0),a.set(o,this.toHash.byteLength),this.toHash=a}},i.prototype.digest=function(){var s=this;return this.key?this.key.then(function(o){return(0,n.locateWindow)().crypto.subtle.sign(e.SHA_256_HMAC_ALGO,o,s.toHash).then(function(a){return new Uint8Array(a)})}):(0,t.isEmptyData)(this.toHash)?Promise.resolve(e.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,n.locateWindow)().crypto.subtle.digest(e.SHA_256_HASH,s.toHash)}).then(function(o){return Promise.resolve(new Uint8Array(o))})},i}();return Js.Sha256=r,Js}var Al={},to={},vn={},Dp;function qy(){return Dp||(Dp=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.MAX_HASHABLE_LENGTH=vn.INIT=vn.KEY=vn.DIGEST_LENGTH=vn.BLOCK_SIZE=void 0,vn.BLOCK_SIZE=64,vn.DIGEST_LENGTH=32,vn.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vn.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],vn.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),vn}var no={},Fp;function Ok(){if(Fp)return no;Fp=1,Object.defineProperty(no,"__esModule",{value:!0}),no.RawSha256=void 0;var t=qy(),e=function(){function n(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return n.prototype.update=function(r){if(this.finished)throw new Error("Attempted to update an already finished hash.");var i=0,s=r.byteLength;if(this.bytesHashed+=s,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=r[i++],s--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},n.prototype.digest=function(){if(!this.finished){var r=this.bytesHashed*8,i=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),s=this.bufferLength;if(i.setUint8(this.bufferLength++,128),s%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var o=this.bufferLength;o<t.BLOCK_SIZE;o++)i.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<t.BLOCK_SIZE-8;o++)i.setUint8(o,0);i.setUint32(t.BLOCK_SIZE-8,Math.floor(r/4294967296),!0),i.setUint32(t.BLOCK_SIZE-4,r),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(t.DIGEST_LENGTH),o=0;o<8;o++)a[o*4]=this.state[o]>>>24&255,a[o*4+1]=this.state[o]>>>16&255,a[o*4+2]=this.state[o]>>>8&255,a[o*4+3]=this.state[o]>>>0&255;return a},n.prototype.hashBuffer=function(){for(var r=this,i=r.buffer,s=r.state,o=s[0],a=s[1],c=s[2],u=s[3],d=s[4],h=s[5],p=s[6],y=s[7],v=0;v<t.BLOCK_SIZE;v++){if(v<16)this.temp[v]=(i[v*4]&255)<<24|(i[v*4+1]&255)<<16|(i[v*4+2]&255)<<8|i[v*4+3]&255;else{var w=this.temp[v-2],k=(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10;w=this.temp[v-15];var C=(w>>>7|w<<25)^(w>>>18|w<<14)^w>>>3;this.temp[v]=(k+this.temp[v-7]|0)+(C+this.temp[v-16]|0)}var E=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&h^~d&p)|0)+(y+(t.KEY[v]+this.temp[v]|0)|0)|0,O=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&a^o&c^a&c)|0;y=p,p=h,h=d,d=u+E|0,u=c,c=a,a=o,o=E+O|0}s[0]+=o,s[1]+=a,s[2]+=c,s[3]+=u,s[4]+=d,s[5]+=h,s[6]+=p,s[7]+=y},n}();return no.RawSha256=e,no}var Up;function Ik(){if(Up)return to;Up=1,Object.defineProperty(to,"__esModule",{value:!0}),to.Sha256=void 0;var t=Ss,e=qy(),n=Ok(),r=jy(),i=function(){function o(a){if(this.hash=new n.RawSha256,a){this.outer=new n.RawSha256;var c=s(a),u=new Uint8Array(e.BLOCK_SIZE);u.set(c);for(var d=0;d<e.BLOCK_SIZE;d++)c[d]^=54,u[d]^=92;this.hash.update(c),this.outer.update(u);for(var d=0;d<c.byteLength;d++)c[d]=0}}return o.prototype.update=function(a){if(!((0,r.isEmptyData)(a)||this.error))try{this.hash.update((0,r.convertToBuffer)(a))}catch(c){this.error=c}},o.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},o.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(a){return[2,this.digestSync()]})})},o}();to.Sha256=i;function s(o){var a=(0,r.convertToBuffer)(o);if(a.byteLength>e.BLOCK_SIZE){var c=new n.RawSha256;c.update(a),a=c.digest()}var u=new Uint8Array(e.BLOCK_SIZE);return u.set(a),u}return to}var Lp;function Rk(){return Lp||(Lp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ss;(0,e.__exportStar)(Ik(),t)}(Al)),Al}var Cl={},On={},Mp;function Pk(){if(Mp)return On;Mp=1,Object.defineProperty(On,"__esModule",{value:!0}),On.supportsZeroByteGCM=On.supportsSubtleCrypto=On.supportsSecureRandom=On.supportsWebCrypto=void 0;var t=Ss,e=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function n(o){if(r(o)&&typeof o.crypto.subtle=="object"){var a=o.crypto.subtle;return i(a)}return!1}On.supportsWebCrypto=n;function r(o){if(typeof o=="object"&&typeof o.crypto=="object"){var a=o.crypto.getRandomValues;return typeof a=="function"}return!1}On.supportsSecureRandom=r;function i(o){return o&&e.every(function(a){return typeof o[a]=="function"})}On.supportsSubtleCrypto=i;function s(o){return t.__awaiter(this,void 0,void 0,function(){var a,c;return t.__generator(this,function(u){switch(u.label){case 0:if(!i(o))return[2,!1];u.label=1;case 1:return u.trys.push([1,4,,5]),[4,o.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return a=u.sent(),[4,o.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},a,new Uint8Array(0))];case 3:return c=u.sent(),[2,c.byteLength===16];case 4:return u.sent(),[2,!1];case 5:return[2]}})})}return On.supportsZeroByteGCM=s,On}var Bp;function Dk(){return Bp||(Bp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ss;e.__exportStar(Pk(),t)}(Cl)),Cl}var xl={},Nl={},$p;function Fk(){return $p||($p=1,Object.defineProperty(Nl,"__esModule",{value:!0})),Nl}var Tl={},jp;function Uk(){return jp||(jp=1,Object.defineProperty(Tl,"__esModule",{value:!0})),Tl}var Ol={},Vp;function Lk(){return Vp||(Vp=1,Object.defineProperty(Ol,"__esModule",{value:!0})),Ol}var Il={},qp;function Mk(){return qp||(qp=1,Object.defineProperty(Il,"__esModule",{value:!0})),Il}var ro={},Hp;function Bk(){if(Hp)return ro;Hp=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.isMsWindow=void 0;var t=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function e(r){return"MSInputMethodContext"in r&&"msCrypto"in r}function n(r){if(e(r)&&r.msCrypto.subtle!==void 0){var i=r.msCrypto,s=i.getRandomValues,o=i.subtle;return t.map(function(a){return o[a]}).concat(s).every(function(a){return typeof a=="function"})}return!1}return ro.isMsWindow=n,ro}var Kp;function $k(){return Kp||(Kp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ss;e.__exportStar(Fk(),t),e.__exportStar(Uk(),t),e.__exportStar(Lk(),t),e.__exportStar(Mk(),t),e.__exportStar(Bk(),t)}(xl)),xl}var zp;function jk(){if(zp)return Gs;zp=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.Sha256=void 0;var t=$y(),e=Vy(),n=Rk(),r=Dk(),i=$k(),s=Xf,o=function(){function a(c){(0,r.supportsWebCrypto)((0,s.locateWindow)())?this.hash=new e.Sha256(c):(0,i.isMsWindow)((0,s.locateWindow)())?this.hash=new t.Sha256(c):this.hash=new n.Sha256(c)}return a.prototype.update=function(c,u){this.hash.update(c,u)},a.prototype.digest=function(){return this.hash.digest()},a}();return Gs.Sha256=o,Gs}var Gp;function Vk(){return Gp||(Gp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0;var e=Ss;(0,e.__exportStar)(jk(),t);var n=$y();Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return n.Sha256}});var r=Vy();Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return r.Sha256}})}(Sl)),Sl}var qk=Vk(),Wp=function(){function t(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return t.isInstance=function(e){if(!e)return!1;var n=e;return typeof n.statusCode=="number"&&typeof n.headers=="object"},t}(),fs=function(){function t(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.substr(-1)!==":"?e.protocol+":":e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?"/"+e.path:e.path:"/"}return t.isInstance=function(e){if(!e)return!1;var n=e;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"},t.prototype.clone=function(){var e=new t(et(et({},this),{headers:et({},this.headers)}));return e.query&&(e.query=Hk(e.query)),e},t}();function Hk(t){return Object.keys(t).reduce(function(e,n){var r,i=t[n];return et(et({},e),(r={},r[n]=Array.isArray(i)?Yn(i):i,r))},{})}var pi=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,Kk)},Kk=function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()};function zk(t){var e,n,r=[];try{for(var i=pn(Object.keys(t).sort()),s=i.next();!s.done;s=i.next()){var o=s.value,a=t[o];if(o=pi(o),Array.isArray(a))for(var c=0,u=a.length;c<u;c++)r.push(o+"="+pi(a[c]));else{var d=o;(a||typeof a=="string")&&(d+="="+pi(a)),r.push(d)}}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.join("&")}function Gk(t){return t===void 0&&(t=0),new Promise(function(e,n){t&&setTimeout(function(){var r=new Error("Request did not complete within "+t+" ms");r.name="TimeoutError",n(r)},t)})}var Wk=function(){function t(e){var n=e===void 0?{}:e,r=n.requestTimeout;this.requestTimeout=r}return t.prototype.destroy=function(){},t.prototype.handle=function(e,n){var r=n===void 0?{}:n,i=r.abortSignal,s=this.requestTimeout;if(i!=null&&i.aborted){var o=new Error("Request aborted");return o.name="AbortError",Promise.reject(o)}var a=e.path;if(e.query){var c=zk(e.query);c&&(a+="?"+c)}var u=e.port,d=e.method,h=e.protocol+"//"+e.hostname+(u?":"+u:"")+a,p=d==="GET"||d==="HEAD"?void 0:e.body,y={body:p,headers:new Headers(e.headers),method:d};typeof AbortController!="undefined"&&(y.signal=i);var v=new Request(h,y),w=[fetch(v).then(function(k){var C,E,O=k.headers,I={};try{for(var M=pn(O.entries()),Y=M.next();!Y.done;Y=M.next()){var ee=Y.value;I[ee[0]]=ee[1]}}catch(se){C={error:se}}finally{try{Y&&!Y.done&&(E=M.return)&&E.call(M)}finally{if(C)throw C.error}}var F=k.body!==void 0;return F?{response:new Wp({headers:I,statusCode:k.status,body:k.body})}:k.blob().then(function(se){return{response:new Wp({headers:I,statusCode:k.status,body:se})}})}),Gk(s)];return i&&w.push(new Promise(function(k,C){i.onabort=function(){var E=new Error("Request aborted");E.name="AbortError",C(E)}})),Promise.race(w)},t}(),Si={},ks=new Array(64);for(var Kt=0,Bo=65,Qf=90;Kt+Bo<=Qf;Kt++){var Vr=String.fromCharCode(Kt+Bo);Si[Vr]=Kt,ks[Kt]=Vr}for(var Kt=0,Bo=97,Qf=122;Kt+Bo<=Qf;Kt++){var Vr=String.fromCharCode(Kt+Bo),$o=Kt+26;Si[Vr]=$o,ks[$o]=Vr}for(var Kt=0;Kt<10;Kt++){Si[Kt.toString(10)]=Kt+52;var Vr=Kt.toString(10),$o=Kt+52;Si[Vr]=$o,ks[$o]=Vr}Si["+"]=62;ks[62]="+";Si["/"]=63;ks[63]="/";var cs=6,No=8,Yk=63;function Hy(t){var e=t.length/4*3;t.substr(-2)==="=="?e-=2:t.substr(-1)==="="&&e--;for(var n=new ArrayBuffer(e),r=new DataView(n),i=0;i<t.length;i+=4){for(var s=0,o=0,a=i,c=i+3;a<=c;a++)t[a]!=="="?(s|=Si[t[a]]<<(c-a)*cs,o+=cs):s>>=cs;var u=i/4*3;s>>=o%No;for(var d=Math.floor(o/No),h=0;h<d;h++){var p=(d-h-1)*No;r.setUint8(u+h,(s&255<<p)>>p)}}return new Uint8Array(n)}function Jk(t){for(var e="",n=0;n<t.length;n+=3){for(var r=0,i=0,s=n,o=Math.min(n+3,t.length);s<o;s++)r|=t[s]<<(o-s-1)*No,i+=No;var a=Math.ceil(i/cs);r<<=a*cs-i;for(var c=1;c<=a;c++){var u=(a-c)*cs;e+=ks[(r&Yk<<u)>>u]}e+="==".slice(0,4-a)}return e}var Xk=function(t){return typeof Blob=="function"&&t instanceof Blob?Qk(t):Zk(t)};function Qk(t){return Ct(this,void 0,void 0,function(){var e,n;return kt(this,function(r){switch(r.label){case 0:return[4,eE(t)];case 1:return e=r.sent(),n=Hy(e),[2,new Uint8Array(n)]}})})}function Zk(t){return Ct(this,void 0,void 0,function(){var e,n,r,i,s,o,a;return kt(this,function(c){switch(c.label){case 0:e=new Uint8Array(0),n=t.getReader(),r=!1,c.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return i=c.sent(),s=i.done,o=i.value,o&&(a=e,e=new Uint8Array(a.length+o.length),e.set(a),e.set(o,a.length)),r=s,[3,1];case 3:return[2,e]}})})}function eE(t){return new Promise(function(e,n){var r=new FileReader;r.onloadend=function(){var i;if(r.readyState!==2)return n(new Error("Reader aborted too early"));var s=(i=r.result)!==null&&i!==void 0?i:"",o=s.indexOf(","),a=o>-1?o+1:s.length;e(s.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(t)})}var tE=function(t){return function(){return Promise.reject(t)}},nE=function(t){return function(e,n){return function(r){return Ct(void 0,void 0,void 0,function(){var i;return kt(this,function(s){return!((i=t==null?void 0:t.retryStrategy)===null||i===void 0)&&i.mode&&(n.userAgent=Yn(n.userAgent||[],[["cfg/retry-mode",t.retryStrategy.mode]])),[2,t.retryStrategy.retry(e,r)]})})}}},rE={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},iE=function(t){return{applyToStack:function(e){e.add(nE(t),rE)}}},sE=100,oE=20*1e3,aE=500,uE=500,cE=5,lE=10,dE=1,fE="amz-sdk-invocation-id",hE="amz-sdk-request",pE=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],mE=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],gE=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],vE=[500,502,503,504],yE=function(t){return t.$retryable!==void 0},bE=function(t){return pE.includes(t.name)},Ky=function(t){var e,n;return((e=t.$metadata)===null||e===void 0?void 0:e.httpStatusCode)===429||mE.includes(t.name)||((n=t.$retryable)===null||n===void 0?void 0:n.throttling)==!0},wE=function(t){var e;return gE.includes(t.name)||vE.includes(((e=t.$metadata)===null||e===void 0?void 0:e.httpStatusCode)||0)},La={exports:{}},Yp;function zy(){if(Yp)return La.exports;Yp=1;var t=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(t){var e=new Uint8Array(16);La.exports=function(){return t(e),e}}else{var n=new Array(16);La.exports=function(){for(var i=0,s;i<16;i++)i&3||(s=Math.random()*4294967296),n[i]=s>>>((i&3)<<3)&255;return n}}return La.exports}var Rl,Jp;function Gy(){if(Jp)return Rl;Jp=1;for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);function n(r,i){var s=i||0,o=t;return[o[r[s++]],o[r[s++]],o[r[s++]],o[r[s++]],"-",o[r[s++]],o[r[s++]],"-",o[r[s++]],o[r[s++]],"-",o[r[s++]],o[r[s++]],"-",o[r[s++]],o[r[s++]],o[r[s++]],o[r[s++]],o[r[s++]],o[r[s++]]].join("")}return Rl=n,Rl}var Pl,Xp;function _E(){if(Xp)return Pl;Xp=1;var t=zy(),e=Gy(),n,r,i=0,s=0;function o(a,c,u){var d=c&&u||0,h=c||[];a=a||{};var p=a.node||n,y=a.clockseq!==void 0?a.clockseq:r;if(p==null||y==null){var v=t();p==null&&(p=n=[v[0]|1,v[1],v[2],v[3],v[4],v[5]]),y==null&&(y=r=(v[6]<<8|v[7])&16383)}var w=a.msecs!==void 0?a.msecs:new Date().getTime(),k=a.nsecs!==void 0?a.nsecs:s+1,C=w-i+(k-s)/1e4;if(C<0&&a.clockseq===void 0&&(y=y+1&16383),(C<0||w>i)&&a.nsecs===void 0&&(k=0),k>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");i=w,s=k,r=y,w+=122192928e5;var E=((w&268435455)*1e4+k)%4294967296;h[d++]=E>>>24&255,h[d++]=E>>>16&255,h[d++]=E>>>8&255,h[d++]=E&255;var O=w/4294967296*1e4&268435455;h[d++]=O>>>8&255,h[d++]=O&255,h[d++]=O>>>24&15|16,h[d++]=O>>>16&255,h[d++]=y>>>8|128,h[d++]=y&255;for(var I=0;I<6;++I)h[d+I]=p[I];return c||e(h)}return Pl=o,Pl}var Dl,Qp;function SE(){if(Qp)return Dl;Qp=1;var t=zy(),e=Gy();function n(r,i,s){var o=i&&s||0;typeof r=="string"&&(i=r==="binary"?new Array(16):null,r=null),r=r||{};var a=r.random||(r.rng||t)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,i)for(var c=0;c<16;++c)i[o+c]=a[c];return i||e(a)}return Dl=n,Dl}var Fl,Zp;function kE(){if(Zp)return Fl;Zp=1;var t=_E(),e=SE(),n=e;return n.v1=t,n.v4=e,Fl=n,Fl}var EE=kE(),AE=function(t){var e=t,n=t,r=function(a){return a.name==="TimeoutError"?lE:cE},i=function(a){return r(a)<=n},s=function(a){if(!i(a))throw new Error("No retry token available");var c=r(a);return n-=c,c},o=function(a){n+=a!=null?a:dE,n=Math.min(n,e)};return Object.freeze({hasRetryTokens:i,retrieveRetryTokens:s,releaseRetryTokens:o})},CE=function(t,e){return Math.floor(Math.min(oE,Math.random()*Math.pow(2,e)*t))},xE=function(t){return t?yE(t)||bE(t)||Ky(t)||wE(t):!1},Zf=3,NE="standard",TE=function(){function t(e,n){var r,i,s;this.maxAttemptsProvider=e,this.mode=NE,this.retryDecider=(r=n==null?void 0:n.retryDecider)!==null&&r!==void 0?r:xE,this.delayDecider=(i=n==null?void 0:n.delayDecider)!==null&&i!==void 0?i:CE,this.retryQuota=(s=n==null?void 0:n.retryQuota)!==null&&s!==void 0?s:AE(uE)}return t.prototype.shouldRetry=function(e,n,r){return n<r&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},t.prototype.getMaxAttempts=function(){return Ct(this,void 0,void 0,function(){var e;return kt(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=n.sent(),[3,3];case 2:return n.sent(),e=Zf,[3,3];case 3:return[2,e]}})})},t.prototype.retry=function(e,n){return Ct(this,void 0,void 0,function(){var r,i,s,o,a,c,u,d;return kt(this,function(h){switch(h.label){case 0:return i=0,s=0,[4,this.getMaxAttempts()];case 1:o=h.sent(),a=n.request,fs.isInstance(a)&&(a.headers[fE]=EE.v4()),c=function(){var p,y,v,w,k;return kt(this,function(C){switch(C.label){case 0:return C.trys.push([0,2,,5]),fs.isInstance(a)&&(a.headers[hE]="attempt="+(i+1)+"; max="+o),[4,e(n)];case 1:return p=C.sent(),y=p.response,v=p.output,u.retryQuota.releaseRetryTokens(r),v.$metadata.attempts=i+1,v.$metadata.totalRetryDelay=s,[2,{value:{response:y,output:v}}];case 2:return w=C.sent(),i++,u.shouldRetry(w,i,o)?(r=u.retryQuota.retrieveRetryTokens(w),k=u.delayDecider(Ky(w)?aE:sE,i),s+=k,[4,new Promise(function(E){return setTimeout(E,k)})]):[3,4];case 3:return C.sent(),[2,"continue"];case 4:throw w.$metadata||(w.$metadata={}),w.$metadata.attempts=i,w.$metadata.totalRetryDelay=s,w;case 5:return[2]}})},u=this,h.label=2;case 2:return[5,c()];case 3:return d=h.sent(),typeof d=="object"?[2,d.value]:[3,2];case 4:return[2]}})})},t}(),OE=function(t){var e=IE(t.maxAttempts);return et(et({},t),{maxAttempts:e,retryStrategy:t.retryStrategy||new TE(e)})},IE=function(t){if(t===void 0&&(t=Zf),typeof t=="number"){var e=Promise.resolve(t);return function(){return e}}return t};function RE(t){if(typeof t=="string"){for(var e=t.length,n=e-1;n>=0;n--){var r=t.charCodeAt(n);r>127&&r<=2047?e++:r>2047&&r<=65535&&(e+=2)}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}}const PE={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Wy={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Ft={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},nn={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Cr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class me{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5)){if(n[0]===1&&n[1]<6)return"Cupcake";if(n[0]===1&&n[1]>=6)return"Donut";if(n[0]===2&&n[1]<2)return"Eclair";if(n[0]===2&&n[1]===2)return"Froyo";if(n[0]===2&&n[1]>2)return"Gingerbread";if(n[0]===3)return"Honeycomb";if(n[0]===4&&n[1]<1)return"Ice Cream Sandwich";if(n[0]===4&&n[1]<4)return"Jelly Bean";if(n[0]===4&&n[1]>=4)return"KitKat";if(n[0]===5)return"Lollipop";if(n[0]===6)return"Marshmallow";if(n[0]===7)return"Nougat";if(n[0]===8)return"Oreo";if(n[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=me.getVersionPrecision(e),s=me.getVersionPrecision(n);let o=Math.max(i,s),a=0;const c=me.map([e,n],u=>{const d=o-me.getVersionPrecision(u),h=u+new Array(d+1).join(".0");return me.map(h.split("."),p=>new Array(20-p.length).join("0")+p).reverse()});for(r&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const o=n[i];typeof o=="object"&&o!==null&&Object.keys(o).forEach(c=>{r[c]=o[c]})}return e}static getBrowserAlias(e){return PE[e]}static getBrowserTypeByAlias(e){return Wy[e]||""}}const Et=/version\/(\d+(\.?_?\d+)+)/i,DE=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=me.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=me.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=me.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=me.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=me.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=me.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=me.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=me.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=me.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=me.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=me.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=me.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=me.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=me.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=me.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=me.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=me.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=me.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=me.getFirstMatch(Et,t)||me.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=me.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=me.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=me.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=me.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=me.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=me.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=me.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=me.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=me.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=me.getFirstMatch(Et,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=/^(.*)\/(.*) /,n=/^(.*)\/(.*)[ \t]\((.*)/,i=t.search("\\(")!==-1?n:e;return{name:me.getFirstMatch(i,t),version:me.getSecondMatch(i,t)}}}],FE=[{test:[/Roku\/DVP/],describe(t){const e=me.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:nn.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=me.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:nn.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=me.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=me.getWindowsVersionName(e);return{name:nn.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:nn.iOS},n=me.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=me.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=me.getMacOSVersionName(e),r={name:nn.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=me.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:nn.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=me.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=me.getAndroidVersionName(e),r={name:nn.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=me.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:nn.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=me.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||me.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||me.getFirstMatch(/\bbb(\d+)/i,t);return{name:nn.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=me.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:nn.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=me.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:nn.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:nn.Linux}}},{test:[/CrOS/],describe(){return{name:nn.ChromeOS}}},{test:[/PlayStation 4/],describe(t){const e=me.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:nn.PlayStation4,version:e}}}],UE=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(t){const e=me.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:Ft.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:Ft.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:Ft.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:Ft.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:Ft.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:Ft.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:Ft.tablet}}},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=me.getFirstMatch(/(ipod|iphone)/i,t);return{type:Ft.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:Ft.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:Ft.mobile}}},{test(t){return t.getBrowserName(!0)==="blackberry"},describe(){return{type:Ft.mobile,vendor:"BlackBerry"}}},{test(t){return t.getBrowserName(!0)==="bada"},describe(){return{type:Ft.mobile}}},{test(t){return t.getBrowserName()==="windows phone"},describe(){return{type:Ft.mobile,vendor:"Microsoft"}}},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe(){return{type:Ft.tablet}}},{test(t){return t.getOSName(!0)==="android"},describe(){return{type:Ft.mobile}}},{test(t){return t.getOSName(!0)==="macos"},describe(){return{type:Ft.desktop,vendor:"Apple"}}},{test(t){return t.getOSName(!0)==="windows"},describe(){return{type:Ft.desktop}}},{test(t){return t.getOSName(!0)==="linux"},describe(){return{type:Ft.desktop}}},{test(t){return t.getOSName(!0)==="playstation 4"},describe(){return{type:Ft.tv}}},{test(t){return t.getOSName(!0)==="roku"},describe(){return{type:Ft.tv}}}],LE=[{test(t){return t.getBrowserName(!0)==="microsoft edge"},describe(t){if(/\sedg\//i.test(t))return{name:Cr.Blink};const n=me.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Cr.EdgeHTML,version:n}}},{test:[/trident/i],describe(t){const e={name:Cr.Trident},n=me.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){return t.test(/presto/i)},describe(t){const e={name:Cr.Presto},n=me.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:Cr.Gecko},n=me.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:Cr.Blink}}},{test:[/(apple)?webkit/i],describe(t){const e={name:Cr.WebKit},n=me.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];let em=class{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=me.find(DE,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=me.find(FE,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=me.find(UE,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=me.find(LE,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return me.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=me.find(a,d=>this.isOS(d));if(c){const d=this.satisfies(n[c]);if(d!==void 0)return d}const u=me.find(a,d=>this.isPlatform(d));if(u){const d=this.satisfies(n[u]);if(d!==void 0)return d}}if(s>0){const a=Object.keys(i),c=me.find(a,u=>this.isBrowser(u,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=me.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(me.compareVersions(s,r,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}};/*!
|
|
16
|
-
* Bowser - a browser detector
|
|
17
|
-
* https://github.com/lancedikson/bowser
|
|
18
|
-
* MIT License | (c) Dustin Diaz 2012-2015
|
|
19
|
-
* MIT License | (c) Denis Demchenko 2015-2019
|
|
20
|
-
*/class ME{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new em(e,n)}static parse(e){return new em(e).getResult()}static get BROWSER_MAP(){return Wy}static get ENGINE_MAP(){return Cr}static get OS_MAP(){return nn}static get PLATFORMS_MAP(){return Ft}}var BE=function(t){var e=t.serviceId,n=t.clientVersion;return function(){return Ct(void 0,void 0,void 0,function(){var r,i,s,o,a,c,u,d,h;return kt(this,function(p){return r=!((s=window==null?void 0:window.navigator)===null||s===void 0)&&s.userAgent?ME.parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",n],["os/"+(((o=r==null?void 0:r.os)===null||o===void 0?void 0:o.name)||"other"),(a=r==null?void 0:r.os)===null||a===void 0?void 0:a.version],["lang/js"],["md/browser",((u=(c=r==null?void 0:r.browser)===null||c===void 0?void 0:c.name)!==null&&u!==void 0?u:"unknown")+"_"+((h=(d=r==null?void 0:r.browser)===null||d===void 0?void 0:d.version)!==null&&h!==void 0?h:"unknown")]],e&&i.push(["api/"+e,n]),[2,i]})})}};function $E(t){var e,n,r={};if(t=t.replace(/^\?/,""),t)try{for(var i=pn(t.split("&")),s=i.next();!s.done;s=i.next()){var o=s.value,a=_s(o.split("="),2),c=a[0],u=a[1],d=u===void 0?null:u;c=decodeURIComponent(c),d&&(d=decodeURIComponent(d)),c in r?Array.isArray(r[c])?r[c].push(d):r[c]=[r[c],d]:r[c]=d}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}var jE=function(t){var e=new URL(t),n=e.hostname,r=e.pathname,i=e.port,s=e.protocol,o=e.search,a;return o&&(a=$E(o)),{hostname:n,port:i?parseInt(i):void 0,protocol:s,path:r,query:a}},VE=function(t){var e;return et(et({},t),{tls:(e=t.tls)!==null&&e!==void 0?e:!0,endpoint:t.endpoint?qE(t):function(){return HE(t)},isCustomEndpoint:!!t.endpoint})},qE=function(t){var e=t.endpoint,n=t.urlParser;if(typeof e=="string"){var r=Promise.resolve(n(e));return function(){return r}}else if(typeof e=="object"){var i=Promise.resolve(e);return function(){return i}}return e},HE=function(t){return Ct(void 0,void 0,void 0,function(){var e,n,r,i,s,o;return kt(this,function(a){switch(a.label){case 0:return e=t.tls,n=e===void 0?!0:e,[4,t.region()];case 1:if(r=a.sent(),i=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/),!i.test(r))throw new Error("Invalid region in client config");return[4,t.regionInfoProvider(r)];case 2:if(s=((o=a.sent())!==null&&o!==void 0?o:{}).hostname,!s)throw new Error("Cannot resolve hostname from client config");return[2,t.urlParser((n?"https:":"http:")+"//"+s)]}})})},KE=function(t){if(!t.region)throw new Error("Region is missing");return et(et({},t),{region:zE(t.region)})},zE=function(t){if(typeof t=="string"){var e=Promise.resolve(t);return function(){return e}}return t},tm="content-length";function GE(t){var e=this;return function(n){return function(r){return Ct(e,void 0,void 0,function(){var i,s,o,a,c;return kt(this,function(u){return i=r.request,fs.isInstance(i)&&(s=i.body,o=i.headers,s&&Object.keys(o).map(function(d){return d.toLowerCase()}).indexOf(tm)===-1&&(a=t(s),a!==void 0&&(i.headers=et(et({},i.headers),(c={},c[tm]=String(a),c))))),[2,n(et(et({},r),{request:i}))]})})}}}var WE={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},YE=function(t){return{applyToStack:function(e){e.add(GE(t.bodyLengthChecker),WE)}}};var JE=function(t){return function(e){return function(n){return Ct(void 0,void 0,void 0,function(){var r,i,s;return kt(this,function(o){return fs.isInstance(n.request)?(r=n.request,i=(t.requestHandler.metadata||{}).handlerProtocol,s=i===void 0?"":i,s.indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,e(n)]):[2,e(n)]})})}}},XE={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},QE=function(t){return{applyToStack:function(e){e.add(JE(t),XE)}}},ZE=function(){return function(t,e){return function(n){return Ct(void 0,void 0,void 0,function(){var r,i,s,o,a,c,u,d,h;return kt(this,function(p){switch(p.label){case 0:return r=e.clientName,i=e.commandName,s=e.inputFilterSensitiveLog,o=e.logger,a=e.outputFilterSensitiveLog,[4,t(n)];case 1:return c=p.sent(),o?(typeof o.info=="function"&&(u=c.output,d=u.$metadata,h=Yf(u,["$metadata"]),o.info({clientName:r,commandName:i,input:s(n.input),output:a(h),metadata:d})),[2,c]):[2,c]}})})}}},eA={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},tA=function(t){return{applyToStack:function(e){e.add(ZE(),eA)}}},nA="X-Amz-Algorithm",rA="X-Amz-Credential",Yy="X-Amz-Date",iA="X-Amz-SignedHeaders",sA="X-Amz-Expires",Jy="X-Amz-Signature",Xy="X-Amz-Security-Token",Qy="authorization",Zy=Yy.toLowerCase(),oA="date",aA=[Qy,Zy,oA],uA=Jy.toLowerCase(),zd="x-amz-content-sha256",cA=Xy.toLowerCase(),lA={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},dA=/^proxy-/,fA=/^sec-/,Ul="AWS4-HMAC-SHA256",hA="AWS4-HMAC-SHA256-PAYLOAD",pA="UNSIGNED-PAYLOAD",mA=50,eb="aws4_request",gA=60*60*24*7,Ma={},Ll=[];function Ml(t,e,n){return t+"/"+e+"/"+n+"/"+eb}var vA=function(t,e,n,r,i){return Ct(void 0,void 0,void 0,function(){var s,o,a,c,u,d,h,p,y;return kt(this,function(v){switch(v.label){case 0:return[4,nm(t,e.secretAccessKey,e.accessKeyId)];case 1:if(s=v.sent(),o=n+":"+r+":"+i+":"+is(s)+":"+e.sessionToken,o in Ma)return[2,Ma[o]];for(Ll.push(o);Ll.length>mA;)delete Ma[Ll.shift()];a="AWS4"+e.secretAccessKey,v.label=2;case 2:v.trys.push([2,7,8,9]),c=pn([n,r,i,eb]),u=c.next(),v.label=3;case 3:return u.done?[3,6]:(d=u.value,[4,nm(t,a,d)]);case 4:a=v.sent(),v.label=5;case 5:return u=c.next(),[3,3];case 6:return[3,9];case 7:return h=v.sent(),p={error:h},[3,9];case 8:try{u&&!u.done&&(y=c.return)&&y.call(c)}finally{if(p)throw p.error}return[7];case 9:return[2,Ma[o]=a]}})})};function nm(t,e,n){var r=new t(e);return r.update(n),r.digest()}function rm(t,e,n){var r,i,s=t.headers,o={};try{for(var a=pn(Object.keys(s).sort()),c=a.next();!c.done;c=a.next()){var u=c.value,d=u.toLowerCase();(d in lA||e!=null&&e.has(d)||dA.test(d)||fA.test(d))&&(!n||n&&!n.has(d))||(o[d]=s[u].trim().replace(/\s+/g," "))}}catch(h){r={error:h}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function yA(t){var e,n,r=t.query,i=r===void 0?{}:r,s=[],o={},a=function(h){if(h.toLowerCase()===uA)return"continue";s.push(h);var p=i[h];typeof p=="string"?o[h]=pi(h)+"="+pi(p):Array.isArray(p)&&(o[h]=p.slice(0).sort().reduce(function(y,v){return y.concat([pi(h)+"="+pi(v)])},[]).join("&"))};try{for(var c=pn(Object.keys(i).sort()),u=c.next();!u.done;u=c.next()){var d=u.value;a(d)}}catch(h){e={error:h}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return s.map(function(h){return o[h]}).filter(function(h){return h}).join("&")}var bA=function(t){return typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"};function Bl(t,e){var n=t.headers,r=t.body;return Ct(this,void 0,void 0,function(){var i,s,o,a,c,u,d;return kt(this,function(h){switch(h.label){case 0:try{for(i=pn(Object.keys(n)),s=i.next();!s.done;s=i.next())if(o=s.value,o.toLowerCase()===zd)return[2,n[o]]}catch(p){u={error:p}}finally{try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(u)throw u.error}}return r!=null?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return typeof r=="string"||ArrayBuffer.isView(r)||bA(r)?(a=new e,a.update(r),c=is,[4,a.digest()]):[3,3];case 2:return[2,c.apply(void 0,[h.sent()])];case 3:return[2,pA]}})})}function wA(t,e){var n,r;t=t.toLowerCase();try{for(var i=pn(Object.keys(e)),s=i.next();!s.done;s=i.next()){var o=s.value;if(t===o.toLowerCase())return!0}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1}function tb(t){var e=t.headers,n=t.query,r=Yf(t,["headers","query"]);return et(et({},r),{headers:et({},e),query:n?_A(n):void 0})}function _A(t){return Object.keys(t).reduce(function(e,n){var r,i=t[n];return et(et({},e),(r={},r[n]=Array.isArray(i)?Yn(i):i,r))},{})}function SA(t,e){var n,r,i;e===void 0&&(e={});var s=typeof t.clone=="function"?t.clone():tb(t),o=s.headers,a=s.query,c=a===void 0?{}:a;try{for(var u=pn(Object.keys(o)),d=u.next();!d.done;d=u.next()){var h=d.value,p=h.toLowerCase();p.substr(0,6)==="x-amz-"&&!(!((i=e.unhoistableHeaders)===null||i===void 0)&&i.has(p))&&(c[h]=o[h],delete o[h])}}catch(y){n={error:y}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return et(et({},t),{headers:o,query:c})}function im(t){var e,n;t=typeof t.clone=="function"?t.clone():tb(t);try{for(var r=pn(Object.keys(t.headers)),i=r.next();!i.done;i=r.next()){var s=i.value;aA.indexOf(s.toLowerCase())>-1&&delete t.headers[s]}}catch(o){e={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return t}function kA(t){return EA(t).toISOString().replace(/\.\d{3}Z$/,"Z")}function EA(t){return typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t}var AA=function(){function t(e){var n=e.applyChecksum,r=e.credentials,i=e.region,s=e.service,o=e.sha256,a=e.uriEscapePath,c=a===void 0?!0:a;this.service=s,this.sha256=o,this.uriEscapePath=c,this.applyChecksum=typeof n=="boolean"?n:!0,this.regionProvider=CA(i),this.credentialProvider=xA(r)}return t.prototype.presign=function(e,n){return n===void 0&&(n={}),Ct(this,void 0,void 0,function(){var r,i,s,o,a,c,u,d,h,p,y,v,w,k,C,E,O,I,M,Y,ee,F,se,H;return kt(this,function(ie){switch(ie.label){case 0:return r=n.signingDate,i=r===void 0?new Date:r,s=n.expiresIn,o=s===void 0?3600:s,a=n.unsignableHeaders,c=n.unhoistableHeaders,u=n.signableHeaders,d=n.signingRegion,h=n.signingService,[4,this.credentialProvider()];case 1:return p=ie.sent(),d==null?[3,2]:(v=d,[3,4]);case 2:return[4,this.regionProvider()];case 3:v=ie.sent(),ie.label=4;case 4:return y=v,w=Ba(i),k=w.longDate,C=w.shortDate,o>gA?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(E=Ml(C,y,h!=null?h:this.service),O=SA(im(e),{unhoistableHeaders:c}),p.sessionToken&&(O.query[Xy]=p.sessionToken),O.query[nA]=Ul,O.query[rA]=p.accessKeyId+"/"+E,O.query[Yy]=k,O.query[sA]=o.toString(10),I=rm(O,a,u),O.query[iA]=sm(I),M=O.query,Y=Jy,ee=this.getSignature,F=[k,E,this.getSigningKey(p,y,C,h)],se=this.createCanonicalRequest,H=[O,I],[4,Bl(e,this.sha256)]);case 5:return[4,ee.apply(this,F.concat([se.apply(this,H.concat([ie.sent()]))]))];case 6:return M[Y]=ie.sent(),[2,O]}})})},t.prototype.sign=function(e,n){return Ct(this,void 0,void 0,function(){return kt(this,function(r){return typeof e=="string"?[2,this.signString(e,n)]:e.headers&&e.payload?[2,this.signEvent(e,n)]:[2,this.signRequest(e,n)]})})},t.prototype.signEvent=function(e,n){var r=e.headers,i=e.payload,s=n.signingDate,o=s===void 0?new Date:s,a=n.priorSignature,c=n.signingRegion,u=n.signingService;return Ct(this,void 0,void 0,function(){var d,h,p,y,v,w,k,C,E,O,I;return kt(this,function(M){switch(M.label){case 0:return c==null?[3,1]:(h=c,[3,3]);case 1:return[4,this.regionProvider()];case 2:h=M.sent(),M.label=3;case 3:return d=h,p=Ba(o),y=p.shortDate,v=p.longDate,w=Ml(y,d,u!=null?u:this.service),[4,Bl({headers:{},body:i},this.sha256)];case 4:return k=M.sent(),C=new this.sha256,C.update(r),O=is,[4,C.digest()];case 5:return E=O.apply(void 0,[M.sent()]),I=[hA,v,w,a,E,k].join(`
|
|
21
|
-
`),[2,this.signString(I,{signingDate:o,signingRegion:d,signingService:u})]}})})},t.prototype.signString=function(e,n){var r=n===void 0?{}:n,i=r.signingDate,s=i===void 0?new Date:i,o=r.signingRegion,a=r.signingService;return Ct(this,void 0,void 0,function(){var c,u,d,h,p,y,v,w;return kt(this,function(k){switch(k.label){case 0:return[4,this.credentialProvider()];case 1:return c=k.sent(),o==null?[3,2]:(d=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:d=k.sent(),k.label=4;case 4:return u=d,h=Ba(s).shortDate,v=(y=this.sha256).bind,[4,this.getSigningKey(c,u,h,a)];case 5:return p=new(v.apply(y,[void 0,k.sent()])),p.update(e),w=is,[4,p.digest()];case 6:return[2,w.apply(void 0,[k.sent()])]}})})},t.prototype.signRequest=function(e,n){var r=n===void 0?{}:n,i=r.signingDate,s=i===void 0?new Date:i,o=r.signableHeaders,a=r.unsignableHeaders,c=r.signingRegion,u=r.signingService;return Ct(this,void 0,void 0,function(){var d,h,p,y,v,w,k,C,E,O,I;return kt(this,function(M){switch(M.label){case 0:return[4,this.credentialProvider()];case 1:return d=M.sent(),c==null?[3,2]:(p=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:p=M.sent(),M.label=4;case 4:return h=p,y=im(e),v=Ba(s),w=v.longDate,k=v.shortDate,C=Ml(k,h,u!=null?u:this.service),y.headers[Zy]=w,d.sessionToken&&(y.headers[cA]=d.sessionToken),[4,Bl(y,this.sha256)];case 5:return E=M.sent(),!wA(zd,y.headers)&&this.applyChecksum&&(y.headers[zd]=E),O=rm(y,a,o),[4,this.getSignature(w,C,this.getSigningKey(d,h,k,u),this.createCanonicalRequest(y,O,E))];case 6:return I=M.sent(),y.headers[Qy]=Ul+" "+("Credential="+d.accessKeyId+"/"+C+", ")+("SignedHeaders="+sm(O)+", ")+("Signature="+I),[2,y]}})})},t.prototype.createCanonicalRequest=function(e,n,r){var i=Object.keys(n).sort();return e.method+`
|
|
22
|
-
`+this.getCanonicalPath(e)+`
|
|
23
|
-
`+yA(e)+`
|
|
24
|
-
`+i.map(function(s){return s+":"+n[s]}).join(`
|
|
25
|
-
`)+`
|
|
26
|
-
|
|
27
|
-
`+i.join(";")+`
|
|
28
|
-
`+r},t.prototype.createStringToSign=function(e,n,r){return Ct(this,void 0,void 0,function(){var i,s;return kt(this,function(o){switch(o.label){case 0:return i=new this.sha256,i.update(r),[4,i.digest()];case 1:return s=o.sent(),[2,Ul+`
|
|
29
|
-
`+e+`
|
|
30
|
-
`+n+`
|
|
31
|
-
`+is(s)]}})})},t.prototype.getCanonicalPath=function(e){var n=e.path;if(this.uriEscapePath){var r=encodeURIComponent(n.replace(/^\//,""));return"/"+r.replace(/%2F/g,"/")}return n},t.prototype.getSignature=function(e,n,r,i){return Ct(this,void 0,void 0,function(){var s,o,a,c,u;return kt(this,function(d){switch(d.label){case 0:return[4,this.createStringToSign(e,n,i)];case 1:return s=d.sent(),c=(a=this.sha256).bind,[4,r];case 2:return o=new(c.apply(a,[void 0,d.sent()])),o.update(s),u=is,[4,o.digest()];case 3:return[2,u.apply(void 0,[d.sent()])]}})})},t.prototype.getSigningKey=function(e,n,r,i){return vA(this.sha256,e,r,n,i||this.service)},t}(),Ba=function(t){var e=kA(t).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.substr(0,8)}},sm=function(t){return Object.keys(t).sort().join(";")},CA=function(t){if(typeof t=="string"){var e=Promise.resolve(t);return function(){return e}}else return t},xA=function(t){if(typeof t=="object"){var e=Promise.resolve(t);return function(){return e}}else return t};function NA(t){var e=this,n=t.credentials||t.credentialDefaultProvider(t),r=$l(n),i=t.signingEscapePath,s=i===void 0?!0:i,o=t.systemClockOffset,a=o===void 0?t.systemClockOffset||0:o,c=t.sha256,u;return t.signer?u=$l(t.signer):u=function(){return $l(t.region)().then(function(d){return Ct(e,void 0,void 0,function(){return kt(this,function(h){switch(h.label){case 0:return[4,t.regionInfoProvider(d)];case 1:return[2,[h.sent()||{},d]]}})})}).then(function(d){var h=_s(d,2),p=h[0],y=h[1],v=p.signingRegion,w=p.signingService;return t.signingRegion=t.signingRegion||v||y,t.signingName=t.signingName||w||t.serviceId,new AA({credentials:r,region:t.signingRegion,service:t.signingName,sha256:c,uriEscapePath:s})})},et(et({},t),{systemClockOffset:a,signingEscapePath:s,credentials:r,signer:u})}function $l(t){if(typeof t=="object"){var e=Promise.resolve(t);return function(){return e}}return t}function TA(t){return et(et({},t),{customUserAgent:typeof t.customUserAgent=="string"?[[t.customUserAgent]]:t.customUserAgent})}var jl="user-agent",OA="x-amz-user-agent",om=" ",IA=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,RA=function(t){return function(e,n){return function(r){return Ct(void 0,void 0,void 0,function(){var i,s,o,a,c,u,d,h;return kt(this,function(p){switch(p.label){case 0:return i=r.request,fs.isInstance(i)?(s=i.headers,o=((d=n==null?void 0:n.userAgent)===null||d===void 0?void 0:d.map(Vl))||[],[4,t.defaultUserAgentProvider()]):[2,e(r)];case 1:return a=p.sent().map(Vl),c=((h=t==null?void 0:t.customUserAgent)===null||h===void 0?void 0:h.map(Vl))||[],s[OA]=Yn(a,o,c).join(om),u=Yn(a.filter(function(y){return y.startsWith("aws-sdk-")}),c).join(om),t.runtime!=="browser"&&u&&(s[jl]=s[jl]?s[jl]+" "+u:u),[2,e(et(et({},r),{request:i}))]}})})}}},Vl=function(t){var e=_s(t,2),n=e[0],r=e[1],i=n.indexOf("/"),s=n.substring(0,i),o=n.substring(i+1);return s==="api"&&(o=o.toLowerCase()),[s,o,r].filter(function(a){return a&&a.length>0}).map(function(a){return a==null?void 0:a.replace(IA,"_")}).join("/")},PA={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},DA=function(t){return{applyToStack:function(e){e.add(RA(t),PA)}}},Su=function(){var t=[],e=[],n=new Set,r=function(d){return d.sort(function(h,p){return am[p.step]-am[h.step]||um[p.priority||"normal"]-um[h.priority||"normal"]})},i=function(d){var h=!1,p=function(y){return y.name&&y.name===d?(h=!0,n.delete(d),!1):!0};return t=t.filter(p),e=e.filter(p),h},s=function(d){var h=!1,p=function(y){return y.middleware===d?(h=!0,y.name&&n.delete(y.name),!1):!0};return t=t.filter(p),e=e.filter(p),h},o=function(d){return t.forEach(function(h){d.add(h.middleware,et({},h))}),e.forEach(function(h){d.addRelativeTo(h.middleware,et({},h))}),d},a=function(d){var h=[];return d.before.forEach(function(p){p.before.length===0&&p.after.length===0?h.push(p):h.push.apply(h,Yn(a(p)))}),h.push(d),d.after.reverse().forEach(function(p){p.before.length===0&&p.after.length===0?h.push(p):h.push.apply(h,Yn(a(p)))}),h},c=function(){var d=[],h=[],p={};t.forEach(function(v){var w=et(et({},v),{before:[],after:[]});w.name&&(p[w.name]=w),d.push(w)}),e.forEach(function(v){var w=et(et({},v),{before:[],after:[]});w.name&&(p[w.name]=w),h.push(w)}),h.forEach(function(v){if(v.toMiddleware){var w=p[v.toMiddleware];if(w===void 0)throw new Error(v.toMiddleware+" is not found when adding "+(v.name||"anonymous")+" middleware "+v.relation+" "+v.toMiddleware);v.relation==="after"&&w.after.push(v),v.relation==="before"&&w.before.push(v)}});var y=r(d).map(a).reduce(function(v,w){return v.push.apply(v,Yn(w)),v},[]);return y.map(function(v){return v.middleware})},u={add:function(d,h){h===void 0&&(h={});var p=h.name,y=h.override,v=et({step:"initialize",priority:"normal",middleware:d},h);if(p){if(n.has(p)){if(!y)throw new Error("Duplicate middleware name '"+p+"'");var w=t.findIndex(function(C){return C.name===p}),k=t[w];if(k.step!==v.step||k.priority!==v.priority)throw new Error('"'+p+'" middleware with '+k.priority+" priority in "+k.step+" step cannot be "+("overridden by same-name middleware with "+v.priority+" priority in "+v.step+" step."));t.splice(w,1)}n.add(p)}t.push(v)},addRelativeTo:function(d,h){var p=h.name,y=h.override,v=et({middleware:d},h);if(p){if(n.has(p)){if(!y)throw new Error("Duplicate middleware name '"+p+"'");var w=e.findIndex(function(C){return C.name===p}),k=e[w];if(k.toMiddleware!==v.toMiddleware||k.relation!==v.relation)throw new Error('"'+p+'" middleware '+k.relation+' "'+k.toMiddleware+'" middleware cannot be overridden '+("by same-name middleware "+v.relation+' "'+v.toMiddleware+'" middleware.'));e.splice(w,1)}n.add(p)}e.push(v)},clone:function(){return o(Su())},use:function(d){d.applyToStack(u)},remove:function(d){return typeof d=="string"?i(d):s(d)},removeByTag:function(d){var h=!1,p=function(y){var v=y.tags,w=y.name;return v&&v.includes(d)?(w&&n.delete(w),h=!0,!1):!0};return t=t.filter(p),e=e.filter(p),h},concat:function(d){var h=o(Su());return h.use(d),h},applyToStack:o,resolve:function(d,h){var p,y;try{for(var v=pn(c().reverse()),w=v.next();!w.done;w=v.next()){var k=w.value;d=k(d,h)}}catch(C){p={error:C}}finally{try{w&&!w.done&&(y=v.return)&&y.call(v)}finally{if(p)throw p.error}}return d}};return u},am={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},um={high:3,normal:2,low:1},FA=function(){function t(e){this.middlewareStack=Su(),this.config=e}return t.prototype.send=function(e,n,r){var i=typeof n!="function"?n:void 0,s=typeof n=="function"?n:r,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(s)o(e).then(function(a){return s(null,a.output)},function(a){return s(a)}).catch(function(){});else return o(e).then(function(a){return a.output})},t.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},t}(),nb=function(){function t(){this.middlewareStack=Su()}return t}(),ku=function(){var t=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,Yn([null],arguments)),n=new e;return Object.setPrototypeOf(n,t.prototype),n};ku.prototype=Object.create(String.prototype,{constructor:{value:ku,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(ku,String);(function(t){Wf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.deserializeJSON=function(){return JSON.parse(t.prototype.toString.call(this))},e.prototype.toJSON=function(){return t.prototype.toString.call(this)},e.fromObject=function(n){return n instanceof e?n:n instanceof String||typeof n=="string"?new e(n):new e(JSON.stringify(n))},e})(ku);var UA=function(t,e){return function(n,r){return function(i){return Ct(void 0,void 0,void 0,function(){var s,o;return kt(this,function(a){switch(a.label){case 0:return[4,n(i)];case 1:return s=a.sent().response,[4,e(s,t)];case 2:return o=a.sent(),[2,{response:s,output:o}]}})})}}},LA=function(t,e){return function(n,r){return function(i){return Ct(void 0,void 0,void 0,function(){var s;return kt(this,function(o){switch(o.label){case 0:return[4,e(i.input,t)];case 1:return s=o.sent(),[2,n(et(et({},i),{request:s}))]}})})}}},MA={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},BA={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function rb(t,e,n){return{applyToStack:function(r){r.add(UA(t,n),MA),r.add(LA(t,e),BA)}}}var $A=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},jA=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Or=new $n("CognitoCredentials"),VA=new Promise(function(t,e){if(!ur().isBrowser)return Or.debug("not in the browser, directly resolved"),t();var n=window.gapi&&window.gapi.auth2?window.gapi.auth2:null;if(n)return Or.debug("google api already loaded"),t();setTimeout(function(){return t()},2e3)}),qA=function(){function t(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return t.prototype.refreshGoogleToken=function(){return $A(this,void 0,void 0,function(){return jA(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Or.debug("need to wait for the Google SDK loaded"),[4,VA]);case 1:e.sent(),this.initialized=!0,Or.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}})})},t.prototype._refreshGoogleTokenImpl=function(){var e=null;return ur().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise(function(n,r){e.getAuthInstance().then(function(i){i||(Or.debug("google Auth undefined"),r(new hi("google Auth undefined")));var s=i.currentUser.get();s.isSignedIn()?(Or.debug("refreshing the google access token"),s.reloadAuthResponse().then(function(o){var a=o.id_token,c=o.expires_at;n({token:a,expires_at:c})}).catch(function(o){o&&o.error==="network_error"?r("Network error reloading google auth response"):r(new hi("Failed to reload google auth response"))})):r(new hi("User is not signed in with Google"))}).catch(function(i){Or.debug("Failed to refresh google token",i),r(new hi("Failed to refresh google token"))})}):(Or.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},t}(),HA=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},KA=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},li=new $n("CognitoCredentials"),zA=new Promise(function(t,e){if(!ur().isBrowser)return li.debug("not in the browser, directly resolved"),t();var n=window.FB;if(n)return li.debug("FB SDK already loaded"),t();setTimeout(function(){return t()},2e3)}),GA=function(){function t(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return t.prototype.refreshFacebookToken=function(){return HA(this,void 0,void 0,function(){return KA(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(li.debug("need to wait for the Facebook SDK loaded"),[4,zA]);case 1:e.sent(),this.initialized=!0,li.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}})})},t.prototype._refreshFacebookTokenImpl=function(){var e=null;if(ur().isBrowser&&(e=window.FB),!e){var n="no fb sdk available";return li.debug(n),Promise.reject(new hi(n))}return new Promise(function(r,i){e.getLoginStatus(function(s){if(!s||!s.authResponse){var o="no response from facebook when refreshing the jwt token";li.debug(o),i(new hi(o))}else{var a=s.authResponse,c=a.accessToken,u=a.expiresIn,d=new Date,h=u*1e3+d.getTime();if(!c){var o="the jwtToken is undefined";li.debug(o),i(new hi(o))}r({token:c,expires_at:h})}},{scope:"public_profile,email"})})},t}(),WA=new qA,YA=new GA,ri={},JA=function(){function t(){}return t.setItem=function(e,n){return ri[e]=n,ri[e]},t.getItem=function(e){return Object.prototype.hasOwnProperty.call(ri,e)?ri[e]:void 0},t.removeItem=function(e){return delete ri[e]},t.clear=function(){return ri={},ri},t}(),ib=function(){function t(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch{this.storageWindow=JA}}return t.prototype.getStorage=function(){return this.storageWindow},t}();const XA="3.6.1",QA={version:XA};var cm="cognito-identity.{region}.amazonaws.com",ZA="cognito-identity.{region}.amazonaws.com.cn",e1="cognito-identity.{region}.c2s.ic.gov",t1="cognito-identity.{region}.sc2s.sgov.gov",n1="cognito-identity.{region}.amazonaws.com",r1=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),i1=new Set(["cn-north-1","cn-northwest-1"]),s1=new Set(["us-iso-east-1"]),o1=new Set(["us-isob-east-1"]),a1=new Set(["us-gov-east-1","us-gov-west-1"]),u1=function(t,e){var n=void 0;switch(t){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:r1.has(t)&&(n={hostname:cm.replace("{region}",t),partition:"aws"}),i1.has(t)&&(n={hostname:ZA.replace("{region}",t),partition:"aws-cn"}),s1.has(t)&&(n={hostname:e1.replace("{region}",t),partition:"aws-iso"}),o1.has(t)&&(n={hostname:t1.replace("{region}",t),partition:"aws-iso-b"}),a1.has(t)&&(n={hostname:n1.replace("{region}",t),partition:"aws-us-gov"}),n===void 0&&(n={hostname:cm.replace("{region}",t),partition:"aws"})}return Promise.resolve(le({signingService:"cognito-identity"},n))},lm={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:u1,serviceId:"Cognito Identity",urlParser:jE},c1=le(le({},lm),{runtime:"browser",base64Decoder:Hy,base64Encoder:Jk,bodyLengthChecker:RE,credentialDefaultProvider:function(t){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:BE({serviceId:lm.serviceId,clientVersion:QA.version}),maxAttempts:Zf,region:tE("Region is missing"),requestHandler:new Wk,sha256:qk.Sha256,streamCollector:Xk,utf8Decoder:My,utf8Encoder:By}),l1=function(t){Jf(e,t);function e(n){var r=this,i=le(le({},c1),n),s=KE(i),o=VE(s),a=NA(o),c=OE(a),u=c,d=TA(u);return r=t.call(this,d)||this,r.config=d,r.middlewareStack.use(iE(r.config)),r.middlewareStack.use(YE(r.config)),r.middlewareStack.use(QE(r.config)),r.middlewareStack.use(tA(r.config)),r.middlewareStack.use(DA(r.config)),r}return e.prototype.destroy=function(){t.prototype.destroy.call(this)},e}(FA),dm;(function(t){t.AUTHENTICATED_ROLE="AuthenticatedRole",t.DENY="Deny"})(dm||(dm={}));var fm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(fm||(fm={}));var hm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(hm||(hm={}));var pm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(pm||(pm={}));var mm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(mm||(mm={}));var gm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(gm||(gm={}));var vm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(vm||(vm={}));var ym;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(ym||(ym={}));var bm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(bm||(bm={}));var wm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(wm||(wm={}));var _m;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(_m||(_m={}));var Sm;(function(t){t.ACCESS_DENIED="AccessDenied",t.INTERNAL_SERVER_ERROR="InternalServerError"})(Sm||(Sm={}));var km;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(km||(km={}));var Em;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Em||(Em={}));var Am;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Am||(Am={}));var Cm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Cm||(Cm={}));var xm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(xm||(xm={}));var Nm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Nm||(Nm={}));var Tm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Tm||(Tm={}));var Om;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Om||(Om={}));var Gd;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Gd||(Gd={}));var Im;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Im||(Im={}));var Wd;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Wd||(Wd={}));var Rm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Rm||(Rm={}));var Yd;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Yd||(Yd={}));var Jd;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Jd||(Jd={}));var Pm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Pm||(Pm={}));var Dm;(function(t){t.CONTAINS="Contains",t.EQUALS="Equals",t.NOT_EQUAL="NotEqual",t.STARTS_WITH="StartsWith"})(Dm||(Dm={}));var Fm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Fm||(Fm={}));var Um;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Um||(Um={}));var Lm;(function(t){t.RULES="Rules",t.TOKEN="Token"})(Lm||(Lm={}));var Mm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Mm||(Mm={}));var Bm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Bm||(Bm={}));var $m;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})($m||($m={}));var jm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(jm||(jm={}));var Vm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Vm||(Vm={}));var qm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(qm||(qm={}));var Hm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Hm||(Hm={}));var Km;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Km||(Km={}));var zm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(zm||(zm={}));var Gm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Gm||(Gm={}));var Wm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Wm||(Wm={}));var Ym;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Ym||(Ym={}));var Jm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Jm||(Jm={}));var Xm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Xm||(Xm={}));var Qm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Qm||(Qm={}));var Zm;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(Zm||(Zm={}));var eg;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(eg||(eg={}));var tg;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(tg||(tg={}));var ng;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(ng||(ng={}));var rg;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(rg||(rg={}));var ig;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(ig||(ig={}));var sg;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(sg||(sg={}));var og;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(og||(og={}));var ag;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(ag||(ag={}));var ug;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(ug||(ug={}));var cg;(function(t){t.filterSensitiveLog=function(e){return le({},e)}})(cg||(cg={}));var d1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r;return en(this,function(i){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(b1(t)),[2,hb(e,n,"/",void 0,r)]})})},f1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r;return en(this,function(i){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(w1(t)),[2,hb(e,n,"/",void 0,r)]})})},h1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){switch(s.label){case 0:return t.statusCode>=300?[2,p1(t,e)]:[4,Xu(t.body,e)];case 1:return n=s.sent(),r={},r=k1(n),i=le({$metadata:yt(t)},r),[2,Promise.resolve(i)]}})})},p1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i,s,o,a,c,u,d,h,p,y,v,w,k,C;return en(this,function(E){switch(E.label){case 0:return r=[le({},t)],C={},[4,Xu(t.body,e)];case 1:switch(n=le.apply(void 0,r.concat([(C.body=E.sent(),C)])),s="UnknownError",s=pb(t,n.body),o=s,o){case"ExternalServiceException":return[3,2];case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":return[3,4];case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":return[3,6];case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":return[3,8];case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":return[3,10];case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":return[3,12];case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":return[3,14];case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":return[3,16];case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,sb(n)];case 3:return i=le.apply(void 0,[le.apply(void 0,a.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 4:return c=[{}],[4,ob(n)];case 5:return i=le.apply(void 0,[le.apply(void 0,c.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 6:return u=[{}],[4,v1(n)];case 7:return i=le.apply(void 0,[le.apply(void 0,u.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 8:return d=[{}],[4,ab(n)];case 9:return i=le.apply(void 0,[le.apply(void 0,d.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 10:return h=[{}],[4,ub(n)];case 11:return i=le.apply(void 0,[le.apply(void 0,h.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 12:return p=[{}],[4,cb(n)];case 13:return i=le.apply(void 0,[le.apply(void 0,p.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 14:return y=[{}],[4,lb(n)];case 15:return i=le.apply(void 0,[le.apply(void 0,y.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 16:return v=[{}],[4,db(n)];case 17:return i=le.apply(void 0,[le.apply(void 0,v.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 18:w=n.body,s=w.code||w.Code||s,i=le(le({},w),{name:""+s,message:w.message||w.Message||s,$fault:"client",$metadata:yt(t)}),E.label=19;case 19:return k=i.message||i.Message||s,i.message=k,delete i.Message,[2,Promise.reject(Object.assign(new Error(k),i))]}})})},m1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){switch(s.label){case 0:return t.statusCode>=300?[2,g1(t,e)]:[4,Xu(t.body,e)];case 1:return n=s.sent(),r={},r=E1(n),i=le({$metadata:yt(t)},r),[2,Promise.resolve(i)]}})})},g1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i,s,o,a,c,u,d,h,p,y,v,w,k,C;return en(this,function(E){switch(E.label){case 0:return r=[le({},t)],C={},[4,Xu(t.body,e)];case 1:switch(n=le.apply(void 0,r.concat([(C.body=E.sent(),C)])),s="UnknownError",s=pb(t,n.body),o=s,o){case"ExternalServiceException":return[3,2];case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":return[3,4];case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":return[3,6];case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":return[3,8];case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":return[3,10];case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":return[3,12];case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":return[3,14];case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":return[3,16];case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,sb(n)];case 3:return i=le.apply(void 0,[le.apply(void 0,a.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 4:return c=[{}],[4,ob(n)];case 5:return i=le.apply(void 0,[le.apply(void 0,c.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 6:return u=[{}],[4,ab(n)];case 7:return i=le.apply(void 0,[le.apply(void 0,u.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 8:return d=[{}],[4,y1(n)];case 9:return i=le.apply(void 0,[le.apply(void 0,d.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 10:return h=[{}],[4,ub(n)];case 11:return i=le.apply(void 0,[le.apply(void 0,h.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 12:return p=[{}],[4,cb(n)];case 13:return i=le.apply(void 0,[le.apply(void 0,p.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 14:return y=[{}],[4,lb(n)];case 15:return i=le.apply(void 0,[le.apply(void 0,y.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 16:return v=[{}],[4,db(n)];case 17:return i=le.apply(void 0,[le.apply(void 0,v.concat([E.sent()])),{name:s,$metadata:yt(t)}]),[3,19];case 18:w=n.body,s=w.code||w.Code||s,i=le(le({},w),{name:""+s,message:w.message||w.Message||s,$fault:"client",$metadata:yt(t)}),E.label=19;case 19:return k=i.message||i.Message||s,i.message=k,delete i.Message,[2,Promise.reject(Object.assign(new Error(k),i))]}})})},sb=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=S1(n),i=le({name:"ExternalServiceException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},ob=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=A1(n),i=le({name:"InternalErrorException",$fault:"server",$metadata:yt(t)},r),[2,i]})})},v1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=C1(n),i=le({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},ab=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=x1(n),i=le({name:"InvalidParameterException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},y1=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=N1(n),i=le({name:"LimitExceededException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},ub=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=T1(n),i=le({name:"NotAuthorizedException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},cb=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=O1(n),i=le({name:"ResourceConflictException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},lb=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=I1(n),i=le({name:"ResourceNotFoundException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},db=function(t,e){return Zt(void 0,void 0,void 0,function(){var n,r,i;return en(this,function(s){return n=t.body,r=R1(n),i=le({name:"TooManyRequestsException",$fault:"client",$metadata:yt(t)},r),[2,i]})})},b1=function(t,e){return le(le(le({},t.CustomRoleArn!==void 0&&t.CustomRoleArn!==null&&{CustomRoleArn:t.CustomRoleArn}),t.IdentityId!==void 0&&t.IdentityId!==null&&{IdentityId:t.IdentityId}),t.Logins!==void 0&&t.Logins!==null&&{Logins:fb(t.Logins)})},w1=function(t,e){return le(le(le({},t.AccountId!==void 0&&t.AccountId!==null&&{AccountId:t.AccountId}),t.IdentityPoolId!==void 0&&t.IdentityPoolId!==null&&{IdentityPoolId:t.IdentityPoolId}),t.Logins!==void 0&&t.Logins!==null&&{Logins:fb(t.Logins)})},fb=function(t,e){return Object.entries(t).reduce(function(n,r){var i,s=ak(r,2),o=s[0],a=s[1];return a===null?n:le(le({},n),(i={},i[o]=a,i))},{})},_1=function(t,e){return{AccessKeyId:t.AccessKeyId!==void 0&&t.AccessKeyId!==null?t.AccessKeyId:void 0,Expiration:t.Expiration!==void 0&&t.Expiration!==null?new Date(Math.round(t.Expiration*1e3)):void 0,SecretKey:t.SecretKey!==void 0&&t.SecretKey!==null?t.SecretKey:void 0,SessionToken:t.SessionToken!==void 0&&t.SessionToken!==null?t.SessionToken:void 0}},S1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},k1=function(t,e){return{Credentials:t.Credentials!==void 0&&t.Credentials!==null?_1(t.Credentials):void 0,IdentityId:t.IdentityId!==void 0&&t.IdentityId!==null?t.IdentityId:void 0}},E1=function(t,e){return{IdentityId:t.IdentityId!==void 0&&t.IdentityId!==null?t.IdentityId:void 0}},A1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},C1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},x1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},N1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},T1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},O1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},I1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},R1=function(t,e){return{message:t.message!==void 0&&t.message!==null?t.message:void 0}},yt=function(t){var e;return{httpStatusCode:t.statusCode,requestId:(e=t.headers["x-amzn-requestid"])!==null&&e!==void 0?e:t.headers["x-amzn-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}},P1=function(t,e){return t===void 0&&(t=new Uint8Array),t instanceof Uint8Array?Promise.resolve(t):e.streamCollector(t)||Promise.resolve(new Uint8Array)},D1=function(t,e){return P1(t,e).then(function(n){return e.utf8Encoder(n)})},hb=function(t,e,n,r,i){return Zt(void 0,void 0,void 0,function(){var s,o,a,c,u,d;return en(this,function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:return s=h.sent(),o=s.hostname,a=s.protocol,c=a===void 0?"https":a,u=s.port,d={protocol:c,hostname:o,port:u,method:"POST",path:n,headers:e},i!==void 0&&(d.body=i),[2,new fs(d)]}})})},Xu=function(t,e){return D1(t,e).then(function(n){return n.length?JSON.parse(n):{}})},pb=function(t,e){var n=function(s,o){return Object.keys(s).find(function(a){return a.toLowerCase()===o.toLowerCase()})},r=function(s){var o=s;return o.indexOf(":")>=0&&(o=o.split(":")[0]),o.indexOf("#")>=0&&(o=o.split("#")[1]),o},i=n(t.headers,"x-amzn-errortype");return i!==void 0?r(t.headers[i]):e.code!==void 0?r(e.code):e.__type!==void 0?r(e.__type):""},Xd=function(t){Jf(e,t);function e(n){var r=t.call(this)||this;return r.input=n,r}return e.prototype.resolveMiddleware=function(n,r,i){this.middlewareStack.use(rb(r,this.serialize,this.deserialize));var s=n.concat(this.middlewareStack),o=r.logger,a="CognitoIdentityClient",c="GetCredentialsForIdentityCommand",u={logger:o,clientName:a,commandName:c,inputFilterSensitiveLog:Gd.filterSensitiveLog,outputFilterSensitiveLog:Wd.filterSensitiveLog},d=r.requestHandler;return s.resolve(function(h){return d.handle(h.request,i||{})},u)},e.prototype.serialize=function(n,r){return d1(n,r)},e.prototype.deserialize=function(n,r){return h1(n,r)},e}(nb),To=function(t){Jf(e,t);function e(n){var r=t.call(this)||this;return r.input=n,r}return e.prototype.resolveMiddleware=function(n,r,i){this.middlewareStack.use(rb(r,this.serialize,this.deserialize));var s=n.concat(this.middlewareStack),o=r.logger,a="CognitoIdentityClient",c="GetIdCommand",u={logger:o,clientName:a,commandName:c,inputFilterSensitiveLog:Yd.filterSensitiveLog,outputFilterSensitiveLog:Jd.filterSensitiveLog},d=r.requestHandler;return s.resolve(function(h){return d.handle(h.request,i||{})},u)},e.prototype.serialize=function(n,r){return f1(n,r)},e.prototype.deserialize=function(n,r){return m1(n,r)},e}(nb),Qu=function(t){Wf(e,t);function e(n,r){r===void 0&&(r=!0);var i=t.call(this,n)||this;return i.tryNextLink=r,i}return e}(Error);function mb(t){return Promise.all(Object.keys(t).reduce(function(e,n){var r=t[n];return typeof r=="string"?e.push([n,r]):e.push(r().then(function(i){return[n,i]})),e},[])).then(function(e){return e.reduce(function(n,r){var i=_s(r,2),s=i[0],o=i[1];return n[s]=o,n},{})})}function _o(t){var e=this;return function(){return Ct(e,void 0,void 0,function(){var n,r,i,s,o,a,c,u,d,h,p,y,v;return kt(this,function(w){switch(w.label){case 0:return h=(d=t.client).send,p=Xd.bind,v={CustomRoleArn:t.customRoleArn,IdentityId:t.identityId},t.logins?[4,mb(t.logins)]:[3,2];case 1:return y=w.sent(),[3,3];case 2:y=void 0,w.label=3;case 3:return[4,h.apply(d,[new(p.apply(Xd,[void 0,(v.Logins=y,v)]))])];case 4:return n=w.sent().Credentials,r=n===void 0?U1():n,i=r.AccessKeyId,s=i===void 0?F1():i,o=r.Expiration,a=r.SecretKey,c=a===void 0?L1():a,u=r.SessionToken,[2,{identityId:t.identityId,accessKeyId:s,secretAccessKey:c,sessionToken:u,expiration:o}]}})})}}function F1(){throw new Qu("Response from Amazon Cognito contained no access key ID")}function U1(){throw new Qu("Response from Amazon Cognito contained no credentials")}function L1(){throw new Qu("Response from Amazon Cognito contained no secret key")}var ql="IdentityIds",M1=function(){function t(e){e===void 0&&(e="aws:cognito-identity-ids"),this.dbName=e}return t.prototype.getItem=function(e){return this.withObjectStore("readonly",function(n){var r=n.get(e);return new Promise(function(i){r.onerror=function(){return i(null)},r.onsuccess=function(){return i(r.result?r.result.value:null)}})}).catch(function(){return null})},t.prototype.removeItem=function(e){return this.withObjectStore("readwrite",function(n){var r=n.delete(e);return new Promise(function(i,s){r.onerror=function(){return s(r.error)},r.onsuccess=function(){return i()}})})},t.prototype.setItem=function(e,n){return this.withObjectStore("readwrite",function(r){var i=r.put({id:e,value:n});return new Promise(function(s,o){i.onerror=function(){return o(i.error)},i.onsuccess=function(){return s()}})})},t.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise(function(n,r){e.onsuccess=function(){n(e.result)},e.onerror=function(){r(e.error)},e.onblocked=function(){r(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var i=e.result;i.onerror=function(){r(new Error("Failed to create object store"))},i.createObjectStore(ql,{keyPath:"id"})}})},t.prototype.withObjectStore=function(e,n){return this.getDb().then(function(r){var i=r.transaction(ql,e);return i.oncomplete=function(){return r.close()},new Promise(function(s,o){i.onerror=function(){return o(i.error)},s(n(i.objectStore(ql)))}).catch(function(s){throw r.close(),s})})},t}(),B1=function(){function t(e){e===void 0&&(e={}),this.store=e}return t.prototype.getItem=function(e){return e in this.store?this.store[e]:null},t.prototype.removeItem=function(e){delete this.store[e]},t.prototype.setItem=function(e,n){this.store[e]=n},t}(),$1=new B1;function j1(){return typeof self=="object"&&self.indexedDB?new M1:typeof window=="object"&&window.localStorage?window.localStorage:$1}function V1(t){var e=this,n=t.accountId,r=t.cache,i=r===void 0?j1():r,s=t.client,o=t.customRoleArn,a=t.identityPoolId,c=t.logins,u=t.userIdentifier,d=u===void 0?!c||Object.keys(c).length===0?"ANONYMOUS":void 0:u,h=d?"aws:cognito-identity-credentials:"+a+":"+d:void 0,p=function(){return Ct(e,void 0,void 0,function(){var y,v,w,k,C,E,O,I,M;return kt(this,function(Y){switch(Y.label){case 0:return v=h,v?[4,i.getItem(h)]:[3,2];case 1:v=Y.sent(),Y.label=2;case 2:return y=v,y?[3,7]:(E=(C=s).send,O=To.bind,M={AccountId:n,IdentityPoolId:a},c?[4,mb(c)]:[3,4]);case 3:return I=Y.sent(),[3,5];case 4:I=void 0,Y.label=5;case 5:return[4,E.apply(C,[new(O.apply(To,[void 0,(M.Logins=I,M)]))])];case 6:w=Y.sent().IdentityId,k=w===void 0?q1():w,y=k,h&&Promise.resolve(i.setItem(h,y)).catch(function(){}),Y.label=7;case 7:return p=_o({client:s,customRoleArn:o,logins:c,identityId:y}),[2,p()]}})})};return function(){return p().catch(function(y){return Ct(e,void 0,void 0,function(){return kt(this,function(v){throw h&&Promise.resolve(i.removeItem(h)).catch(function(){}),y})})})}}function q1(){throw new Qu("Response from Amazon Cognito contained no identity ID")}var Ir=function(){return Ir=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ir.apply(this,arguments)};function Hl(t){var e=new l1({region:t.region,customUserAgent:kS()});return e.middlewareStack.add(function(n,r){return function(i){return n(H1(i))}},{step:"build",name:"cacheControlMiddleWare"}),e}function H1(t){return Ir(Ir({},t),{request:Ir(Ir({},t.request),{headers:Ir(Ir({},t.request.headers),{"cache-control":"no-store"})})})}var Eu=function(){return Eu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Eu.apply(this,arguments)},on=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},an=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},it=new $n("Credentials"),K1=50*60*1e3,z1="CognitoIdentityId-",G1=function(){function t(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=WA.refreshGoogleToken,this._refreshHandlers.facebook=YA.refreshFacebookToken}return t.prototype.getModuleName=function(){return"Credentials"},t.prototype.getCredSource=function(){return this._credentials_source},t.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var n=this._config.refreshHandlers;return n&&(this._refreshHandlers=Eu(Eu({},this._refreshHandlers),n)),this._storage=this._config.storage,this._storage||(this._storage=new ib().getStorage()),this._storageSync=Promise.resolve(),typeof this._storage.sync=="function"&&(this._storageSync=this._storage.sync()),this._config},t.prototype.get=function(){return it.debug("getting credentials"),this._pickupCredentials()},t.prototype._getCognitoIdentityIdStorageKey=function(e){return""+z1+e},t.prototype._pickupCredentials=function(){return it.debug("picking up credentials"),!this._gettingCredPromise||!this._gettingCredPromise.isPending()?(it.debug("getting new cred promise"),this._gettingCredPromise=xS(this._keepAlive())):it.debug("getting old cred promise"),this._gettingCredPromise},t.prototype._keepAlive=function(){return on(this,void 0,void 0,function(){var e,n,r,i,s,o,a,c;return an(this,function(u){switch(u.label){case 0:if(it.debug("checking if credentials exists and not expired"),e=this._credentials,e&&!this._isExpired(e)&&!this._isPastTTL())return it.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(it.debug("need to get a new credential or refresh the existing one"),n=this.Auth,r=n===void 0?Gf.Auth:n,!r||typeof r.currentUserCredentials!="function")return[2,Promise.reject("No Auth module registered in Amplify")];if(!(!this._isExpired(e)&&this._isPastTTL()))return[3,6];it.debug("ttl has passed but token is not yet expired"),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,r.currentUserPoolUser()];case 2:return i=u.sent(),[4,r.currentSession()];case 3:return s=u.sent(),o=s.refreshToken,a=new Promise(function(d,h){i.refreshSession(o,function(p,y){return p?h(p):d(y)})}),[4,a];case 4:return u.sent(),[3,6];case 5:return c=u.sent(),it.debug("Error attempting to refreshing the session",c),[3,6];case 6:return[2,r.currentUserCredentials()]}})})},t.prototype.refreshFederatedToken=function(e){it.debug("Getting federated credentials");var n=e.provider,r=e.user,i=e.token,s=e.identity_id,o=e.expires_at;o=new Date(o).getFullYear()===1970?o*1e3:o;var a=this;return it.debug("checking if federated jwt token expired"),o>new Date().getTime()?(it.debug("token not expired"),this._setCredentialsFromFederation({provider:n,token:i,user:r,identity_id:s,expires_at:o})):a._refreshHandlers[n]&&typeof a._refreshHandlers[n]=="function"?(it.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:a._refreshHandlers[n],provider:n,user:r})):(it.debug("no refresh handler for provider:",n),this.clear(),Promise.reject("no refresh handler for provider"))},t.prototype._providerRefreshWithRetry=function(e){var n=this,r=e.refreshHandler,i=e.provider,s=e.user,o=10*1e3;return tk(r,[],o).then(function(a){return it.debug("refresh federated token sucessfully",a),n._setCredentialsFromFederation({provider:i,token:a.token,user:s,identity_id:a.identity_id,expires_at:a.expires_at})}).catch(function(a){var c=typeof a=="string"&&a.toLowerCase().lastIndexOf("network error",a.length)===0;return c||n.clear(),it.debug("refresh federated token failed",a),Promise.reject("refreshing federation token failed: "+a)})},t.prototype._isExpired=function(e){if(!e)return it.debug("no credentials for expiration check"),!0;it.debug("are these credentials expired?",e);var n=Date.now(),r=e.expiration;return r.getTime()<=n},t.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},t.prototype._setCredentialsForGuest=function(){return on(this,void 0,void 0,function(){var e,n,r,i,s,o,a,c,u,d,h=this;return an(this,function(p){switch(p.label){case 0:return it.debug("setting credentials for guest"),e=this._config,n=e.identityPoolId,r=e.region,i=e.mandatorySignIn,i?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:n?r?(o=this,[4,this._getGuestIdentityId()]):(it.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(it.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return s=o._identityId=p.sent(),a=Hl({region:r}),c=void 0,s?(u={identityId:s,client:a},c=_o(u)()):(d=function(){return on(h,void 0,void 0,function(){var y,v,w;return an(this,function(k){switch(k.label){case 0:return[4,a.send(new To({IdentityPoolId:n}))];case 1:return y=k.sent().IdentityId,this._identityId=y,v={client:a,identityId:y},w=_o(v),[2,w()]}})})},c=d().catch(function(y){return on(h,void 0,void 0,function(){return an(this,function(v){throw y})})})),[2,this._loadCredentials(c,"guest",!1,null).then(function(y){return y}).catch(function(y){return on(h,void 0,void 0,function(){var v,w=this;return an(this,function(k){switch(k.label){case 0:return y.name==="ResourceNotFoundException"&&y.message==="Identity '"+s+"' not found."?(it.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]):[3,2];case 1:return k.sent(),v=function(){return on(w,void 0,void 0,function(){var C,E,O;return an(this,function(I){switch(I.label){case 0:return[4,a.send(new To({IdentityPoolId:n}))];case 1:return C=I.sent().IdentityId,this._identityId=C,E={client:a,identityId:C},O=_o(E),[2,O()]}})})},c=v().catch(function(C){return on(w,void 0,void 0,function(){return an(this,function(E){throw C})})}),[2,this._loadCredentials(c,"guest",!1,null)];case 2:return[2,y]}})})})]}})})},t.prototype._setCredentialsFromFederation=function(e){var n=e.provider,r=e.token,i=e.identity_id,s={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"},o=s[n]||n;if(!o)return Promise.reject("You must specify a federated provider");var a={};a[o]=r;var c=this._config,u=c.identityPoolId,d=c.region;if(!u)return it.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!d)return it.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var h=Hl({region:d}),p=void 0;if(i){var y={identityId:i,logins:a,client:h};p=_o(y)()}else{var y={logins:a,identityPoolId:u,client:h};p=V1(y)()}return this._loadCredentials(p,"federated",!0,e)},t.prototype._setCredentialsFromSession=function(e){var n=this;it.debug("set credentials from session");var r=e.getIdToken().getJwtToken(),i=this._config,s=i.region,o=i.userPoolId,a=i.identityPoolId;if(!a)return it.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!s)return it.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c="cognito-idp."+s+".amazonaws.com/"+o,u={};u[c]=r;var d=Hl({region:s}),h=function(){return on(n,void 0,void 0,function(){var y,v,w,k,C,E,O,I,M,Y;return an(this,function(ee){switch(ee.label){case 0:return[4,this._getGuestIdentityId()];case 1:return y=ee.sent(),y?[3,3]:[4,d.send(new To({IdentityPoolId:a,Logins:u}))];case 2:w=ee.sent().IdentityId,v=w,ee.label=3;case 3:return[4,d.send(new Xd({IdentityId:y||v,Logins:u}))];case 4:return k=ee.sent(),C=k.Credentials,E=C.AccessKeyId,O=C.Expiration,I=C.SecretKey,M=C.SessionToken,Y=k.IdentityId,this._identityId=Y,y?(it.debug("The guest identity "+y+" has been successfully linked to the logins"),y===Y&&it.debug("The guest identity "+y+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:ee.sent(),ee.label=6;case 6:return[2,{accessKeyId:E,secretAccessKey:I,sessionToken:M,expiration:O,identityId:Y}]}})})},p=h().catch(function(y){return on(n,void 0,void 0,function(){return an(this,function(v){throw y})})});return this._loadCredentials(p,"userPool",!0,null)},t.prototype._loadCredentials=function(e,n,r,i){var s=this,o=this;return new Promise(function(a,c){e.then(function(u){return on(s,void 0,void 0,function(){var d,h,p,y,v;return an(this,function(w){switch(w.label){case 0:if(it.debug("Load credentials successfully",u),this._identityId&&!u.identityId&&(u.identityId=this._identityId),o._credentials=u,o._credentials.authenticated=r,o._credentials_source=n,o._nextCredentialsRefresh=new Date().getTime()+K1,n==="federated"){d=Object.assign({id:this._credentials.identityId},i.user),h=i.provider,p=i.token,y=i.expires_at,v=i.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:h,token:p,user:d,expires_at:y,identity_id:v}))}catch(k){it.debug("Failed to put federated info into auth storage",k)}}return n!=="guest"?[3,2]:[4,this._setGuestIdentityId(u.identityId)];case 1:w.sent(),w.label=2;case 2:return a(o._credentials),[2]}})})}).catch(function(u){if(u){it.debug("Failed to load credentials",e),it.debug("Error loading credentials",u),c(u);return}})})},t.prototype.set=function(e,n){return n==="session"?this._setCredentialsFromSession(e):n==="federation"?this._setCredentialsFromFederation(e):n==="guest"?this._setCredentialsForGuest():(it.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},t.prototype.clear=function(){return on(this,void 0,void 0,function(){return an(this,function(e){return this._credentials=null,this._credentials_source=null,it.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]})})},t.prototype._getGuestIdentityId=function(){return on(this,void 0,void 0,function(){var e,n;return an(this,function(r){switch(r.label){case 0:e=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return n=r.sent(),it.debug("Failed to get the cached guest identityId",n),[3,4];case 4:return[2]}})})},t.prototype._setGuestIdentityId=function(e){return on(this,void 0,void 0,function(){var n,r;return an(this,function(i){switch(i.label){case 0:n=this._config.identityPoolId,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._storageSync];case 2:return i.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(n),e),[3,4];case 3:return r=i.sent(),it.debug("Failed to cache guest identityId",r),[3,4];case 4:return[2]}})})},t.prototype._removeGuestIdentityId=function(){return on(this,void 0,void 0,function(){var e;return an(this,function(n){return e=this._config.identityPoolId,it.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]})})},t.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},t}(),gb=new G1(null);Gf.register(gb);var $a={};/*!
|
|
32
|
-
* cookie
|
|
33
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
34
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
35
|
-
* MIT Licensed
|
|
36
|
-
*/var lg;function W1(){if(lg)return $a;lg=1,$a.parse=r,$a.serialize=i;var t=decodeURIComponent,e=encodeURIComponent,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function r(o,a){if(typeof o!="string")throw new TypeError("argument str must be a string");for(var c={},u=a||{},d=o.split(";"),h=u.decode||t,p=0;p<d.length;p++){var y=d[p],v=y.indexOf("=");if(!(v<0)){var w=y.substring(0,v).trim();if(c[w]==null){var k=y.substring(v+1,y.length).trim();k[0]==='"'&&(k=k.slice(1,-1)),c[w]=s(k,h)}}}return c}function i(o,a,c){var u=c||{},d=u.encode||e;if(typeof d!="function")throw new TypeError("option encode is invalid");if(!n.test(o))throw new TypeError("argument name is invalid");var h=d(a);if(h&&!n.test(h))throw new TypeError("argument val is invalid");var p=o+"="+h;if(u.maxAge!=null){var y=u.maxAge-0;if(isNaN(y)||!isFinite(y))throw new TypeError("option maxAge is invalid");p+="; Max-Age="+Math.floor(y)}if(u.domain){if(!n.test(u.domain))throw new TypeError("option domain is invalid");p+="; Domain="+u.domain}if(u.path){if(!n.test(u.path))throw new TypeError("option path is invalid");p+="; Path="+u.path}if(u.expires){if(typeof u.expires.toUTCString!="function")throw new TypeError("option expires is invalid");p+="; Expires="+u.expires.toUTCString()}if(u.httpOnly&&(p+="; HttpOnly"),u.secure&&(p+="; Secure"),u.sameSite){var v=typeof u.sameSite=="string"?u.sameSite.toLowerCase():u.sameSite;switch(v){case!0:p+="; SameSite=Strict";break;case"lax":p+="; SameSite=Lax";break;case"strict":p+="; SameSite=Strict";break;case"none":p+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return p}function s(o,a){try{return a(o)}catch{return o}}return $a}var nu=W1();function Y1(){return typeof document=="object"&&typeof document.cookie=="string"}function J1(t,e){return typeof t=="string"?nu.parse(t,e):typeof t=="object"&&t!==null?t:{}}function X1(t,e){return typeof e=="undefined"&&(e=!t||t[0]!=="{"&&t[0]!=="["&&t[0]!=='"'),!e}function dg(t,e){e===void 0&&(e={});var n=Q1(t);if(X1(n,e.doNotParse))try{return JSON.parse(n)}catch{}return t}function Q1(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}var di=function(){return di=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},di.apply(this,arguments)},Kl=function(){function t(e,n){var r=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=J1(e,n),new Promise(function(){r.HAS_DOCUMENT_COOKIE=Y1()}).catch(function(){})}return t.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=nu.parse(document.cookie,e))},t.prototype._emitChange=function(e){for(var n=0;n<this.changeListeners.length;++n)this.changeListeners[n](e)},t.prototype.get=function(e,n,r){return n===void 0&&(n={}),this._updateBrowserValues(r),dg(this.cookies[e],n)},t.prototype.getAll=function(e,n){e===void 0&&(e={}),this._updateBrowserValues(n);var r={};for(var i in this.cookies)r[i]=dg(this.cookies[i],e);return r},t.prototype.set=function(e,n,r){var i;typeof n=="object"&&(n=JSON.stringify(n)),this.cookies=di(di({},this.cookies),(i={},i[e]=n,i)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=nu.serialize(e,n,r)),this._emitChange({name:e,value:n,options:r})},t.prototype.remove=function(e,n){var r=n=di(di({},n),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=di({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=nu.serialize(e,"",r)),this._emitChange({name:e,value:void 0,options:n})},t.prototype.addChangeListener=function(e){this.changeListeners.push(e)},t.prototype.removeChangeListener=function(e){var n=this.changeListeners.indexOf(e);n>=0&&this.changeListeners.splice(n,1)},t}(),fg=ur().isBrowser,Z1=function(){function t(e){e===void 0&&(e={}),this.cookies=new Kl,this.store=fg?window.localStorage:Object.create(null),this.cookies=e.req?new Kl(e.req.headers.cookie):new Kl,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(t.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),t.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map(function(n,r){return e.key(r)}).forEach(function(n){return e.removeItem(n)})},t.prototype.getItem=function(e){return this.getLocalItem(e)},t.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},t.prototype.getUniversalItem=function(e){return this.cookies.get(e)},t.prototype.key=function(e){return Object.keys(this.store)[e]},t.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},t.prototype.removeLocalItem=function(e){delete this.store[e]},t.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},t.prototype.setItem=function(e,n){this.setLocalItem(e,n);var r=e.split(".").pop();switch(r){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":fg?this.setUniversalItem(e,n):this.setLocalItem(e,n)}},t.prototype.setLocalItem=function(e,n){this.store[e]=n},t.prototype.setUniversalItem=function(e,n){this.cookies.set(e,n,{path:"/",sameSite:!0,secure:window.location.hostname!=="localhost"})},t}(),Au;(function(t){t.Cognito="COGNITO",t.Google="Google",t.Facebook="Facebook",t.Amazon="LoginWithAmazon",t.Apple="SignInWithApple"})(Au||(Au={}));function zl(t){var e=["provider"];return t&&!!e.find(function(n){return t.hasOwnProperty(n)})}function eC(t){var e=["customProvider"];return t&&!!e.find(function(n){return t.hasOwnProperty(n)})}function tC(t){var e=["customState"];return t&&!!e.find(function(n){return t.hasOwnProperty(n)})}function mi(t){return t.redirectSignIn!==void 0}var gt;(function(t){t.NoConfig="noConfig",t.MissingAuthConfig="missingAuthConfig",t.EmptyUsername="emptyUsername",t.InvalidUsername="invalidUsername",t.EmptyPassword="emptyPassword",t.EmptyCode="emptyCode",t.SignUpError="signUpError",t.NoMFA="noMFA",t.InvalidMFA="invalidMFA",t.EmptyChallengeResponse="emptyChallengeResponse",t.NoUserSession="noUserSession",t.Default="default",t.DeviceConfig="deviceConfig",t.NetworkError="networkError",t.AutoSignInError="autoSignInError"})(gt||(gt={}));function nC(t){return!!t.username}var hg;(function(t){t.API_KEY="API_KEY",t.AWS_IAM="AWS_IAM",t.OPENID_CONNECT="OPENID_CONNECT",t.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",t.AWS_LAMBDA="AWS_LAMBDA"})(hg||(hg={}));/*!
|
|
37
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
38
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
39
|
-
*/var pg=function(){function t(n){var r=n||{},i=r.ValidationData,s=r.Username,o=r.Password,a=r.AuthParameters,c=r.ClientMetadata;this.validationData=i||{},this.authParameters=a||{},this.clientMetadata=c||{},this.username=s,this.password=o}var e=t.prototype;return e.getUsername=function(){return this.username},e.getPassword=function(){return this.password},e.getValidationData=function(){return this.validationData},e.getAuthParameters=function(){return this.authParameters},e.getClientMetadata=function(){return this.clientMetadata},t}(),Gl={},io={},mg;function rC(){if(mg)return io;mg=1,io.byteLength=a,io.toByteArray=u,io.fromByteArray=p;for(var t=[],e=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)t[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(y){var v=y.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=y.indexOf("=");w===-1&&(w=v);var k=w===v?0:4-w%4;return[w,k]}function a(y){var v=o(y),w=v[0],k=v[1];return(w+k)*3/4-k}function c(y,v,w){return(v+w)*3/4-w}function u(y){var v,w=o(y),k=w[0],C=w[1],E=new n(c(y,k,C)),O=0,I=C>0?k-4:k,M;for(M=0;M<I;M+=4)v=e[y.charCodeAt(M)]<<18|e[y.charCodeAt(M+1)]<<12|e[y.charCodeAt(M+2)]<<6|e[y.charCodeAt(M+3)],E[O++]=v>>16&255,E[O++]=v>>8&255,E[O++]=v&255;return C===2&&(v=e[y.charCodeAt(M)]<<2|e[y.charCodeAt(M+1)]>>4,E[O++]=v&255),C===1&&(v=e[y.charCodeAt(M)]<<10|e[y.charCodeAt(M+1)]<<4|e[y.charCodeAt(M+2)]>>2,E[O++]=v>>8&255,E[O++]=v&255),E}function d(y){return t[y>>18&63]+t[y>>12&63]+t[y>>6&63]+t[y&63]}function h(y,v,w){for(var k,C=[],E=v;E<w;E+=3)k=(y[E]<<16&16711680)+(y[E+1]<<8&65280)+(y[E+2]&255),C.push(d(k));return C.join("")}function p(y){for(var v,w=y.length,k=w%3,C=[],E=16383,O=0,I=w-k;O<I;O+=E)C.push(h(y,O,O+E>I?I:O+E));return k===1?(v=y[w-1],C.push(t[v>>2]+t[v<<4&63]+"==")):k===2&&(v=(y[w-2]<<8)+y[w-1],C.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),C.join("")}return io}var ja={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var gg;function iC(){return gg||(gg=1,ja.read=function(t,e,n,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,u=c>>1,d=-7,h=n?i-1:0,p=n?-1:1,y=t[e+h];for(h+=p,s=y&(1<<-d)-1,y>>=-d,d+=a;d>0;s=s*256+t[e+h],h+=p,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=r;d>0;o=o*256+t[e+h],h+=p,d-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(y?-1:1)*o*Math.pow(2,s-r)},ja.write=function(t,e,n,r,i,s){var o,a,c,u=s*8-i-1,d=(1<<u)-1,h=d>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:s-1,v=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=p/c:e+=p*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+y]=a&255,y+=v,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[n+y]=o&255,y+=v,o/=256,u-=8);t[n+y-v]|=w*128}),ja}var Wl,vg;function sC(){if(vg)return Wl;vg=1;var t={}.toString;return Wl=Array.isArray||function(e){return t.call(e)=="[object Array]"},Wl}/*!
|
|
40
|
-
* The buffer module from node.js, for the browser.
|
|
41
|
-
*
|
|
42
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
|
43
|
-
* @license MIT
|
|
44
|
-
*/var yg;function oC(){return yg||(yg=1,function(t){var e=rC(),n=iC(),r=sC();t.Buffer=a,t.SlowBuffer=C,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=Mr.TYPED_ARRAY_SUPPORT!==void 0?Mr.TYPED_ARRAY_SUPPORT:i(),t.kMaxLength=s();function i(){try{var x=new Uint8Array(1);return x.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},x.foo()===42&&typeof x.subarray=="function"&&x.subarray(1,1).byteLength===0}catch{return!1}}function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(x,_){if(s()<_)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(x=new Uint8Array(_),x.__proto__=a.prototype):(x===null&&(x=new a(_)),x.length=_),x}function a(x,_,g){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(x,_,g);if(typeof x=="number"){if(typeof _=="string")throw new Error("If encoding is specified then the first argument must be a string");return h(this,x)}return c(this,x,_,g)}a.poolSize=8192,a._augment=function(x){return x.__proto__=a.prototype,x};function c(x,_,g,N){if(typeof _=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&_ instanceof ArrayBuffer?v(x,_,g,N):typeof _=="string"?p(x,_,g):w(x,_)}a.from=function(x,_,g){return c(null,x,_,g)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0}));function u(x){if(typeof x!="number")throw new TypeError('"size" argument must be a number');if(x<0)throw new RangeError('"size" argument must not be negative')}function d(x,_,g,N){return u(_),_<=0?o(x,_):g!==void 0?typeof N=="string"?o(x,_).fill(g,N):o(x,_).fill(g):o(x,_)}a.alloc=function(x,_,g){return d(null,x,_,g)};function h(x,_){if(u(_),x=o(x,_<0?0:k(_)|0),!a.TYPED_ARRAY_SUPPORT)for(var g=0;g<_;++g)x[g]=0;return x}a.allocUnsafe=function(x){return h(null,x)},a.allocUnsafeSlow=function(x){return h(null,x)};function p(x,_,g){if((typeof g!="string"||g==="")&&(g="utf8"),!a.isEncoding(g))throw new TypeError('"encoding" must be a valid string encoding');var N=E(_,g)|0;x=o(x,N);var V=x.write(_,g);return V!==N&&(x=x.slice(0,V)),x}function y(x,_){var g=_.length<0?0:k(_.length)|0;x=o(x,g);for(var N=0;N<g;N+=1)x[N]=_[N]&255;return x}function v(x,_,g,N){if(_.byteLength,g<0||_.byteLength<g)throw new RangeError("'offset' is out of bounds");if(_.byteLength<g+(N||0))throw new RangeError("'length' is out of bounds");return g===void 0&&N===void 0?_=new Uint8Array(_):N===void 0?_=new Uint8Array(_,g):_=new Uint8Array(_,g,N),a.TYPED_ARRAY_SUPPORT?(x=_,x.__proto__=a.prototype):x=y(x,_),x}function w(x,_){if(a.isBuffer(_)){var g=k(_.length)|0;return x=o(x,g),x.length===0||_.copy(x,0,0,g),x}if(_){if(typeof ArrayBuffer!="undefined"&&_.buffer instanceof ArrayBuffer||"length"in _)return typeof _.length!="number"||vt(_.length)?o(x,0):y(x,_);if(_.type==="Buffer"&&r(_.data))return y(x,_.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function k(x){if(x>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return x|0}function C(x){return+x!=x&&(x=0),a.alloc(+x)}a.isBuffer=function(_){return!!(_!=null&&_._isBuffer)},a.compare=function(_,g){if(!a.isBuffer(_)||!a.isBuffer(g))throw new TypeError("Arguments must be Buffers");if(_===g)return 0;for(var N=_.length,V=g.length,ae=0,ue=Math.min(N,V);ae<ue;++ae)if(_[ae]!==g[ae]){N=_[ae],V=g[ae];break}return N<V?-1:V<N?1:0},a.isEncoding=function(_){switch(String(_).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(_,g){if(!r(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return a.alloc(0);var N;if(g===void 0)for(g=0,N=0;N<_.length;++N)g+=_[N].length;var V=a.allocUnsafe(g),ae=0;for(N=0;N<_.length;++N){var ue=_[N];if(!a.isBuffer(ue))throw new TypeError('"list" argument must be an Array of Buffers');ue.copy(V,ae),ae+=ue.length}return V};function E(x,_){if(a.isBuffer(x))return x.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(x)||x instanceof ArrayBuffer))return x.byteLength;typeof x!="string"&&(x=""+x);var g=x.length;if(g===0)return 0;for(var N=!1;;)switch(_){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":case void 0:return Ie(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Ue(x).length;default:if(N)return Ie(x).length;_=(""+_).toLowerCase(),N=!0}}a.byteLength=E;function O(x,_,g){var N=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,_>>>=0,g<=_))return"";for(x||(x="utf8");;)switch(x){case"hex":return ve(this,_,g);case"utf8":case"utf-8":return G(this,_,g);case"ascii":return te(this,_,g);case"latin1":case"binary":return ge(this,_,g);case"base64":return qe(this,_,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,_,g);default:if(N)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),N=!0}}a.prototype._isBuffer=!0;function I(x,_,g){var N=x[_];x[_]=x[g],x[g]=N}a.prototype.swap16=function(){var _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var g=0;g<_;g+=2)I(this,g,g+1);return this},a.prototype.swap32=function(){var _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var g=0;g<_;g+=4)I(this,g,g+3),I(this,g+1,g+2);return this},a.prototype.swap64=function(){var _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var g=0;g<_;g+=8)I(this,g,g+7),I(this,g+1,g+6),I(this,g+2,g+5),I(this,g+3,g+4);return this},a.prototype.toString=function(){var _=this.length|0;return _===0?"":arguments.length===0?G(this,0,_):O.apply(this,arguments)},a.prototype.equals=function(_){if(!a.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:a.compare(this,_)===0},a.prototype.inspect=function(){var _="",g=t.INSPECT_MAX_BYTES;return this.length>0&&(_=this.toString("hex",0,g).match(/.{2}/g).join(" "),this.length>g&&(_+=" ... ")),"<Buffer "+_+">"},a.prototype.compare=function(_,g,N,V,ae){if(!a.isBuffer(_))throw new TypeError("Argument must be a Buffer");if(g===void 0&&(g=0),N===void 0&&(N=_?_.length:0),V===void 0&&(V=0),ae===void 0&&(ae=this.length),g<0||N>_.length||V<0||ae>this.length)throw new RangeError("out of range index");if(V>=ae&&g>=N)return 0;if(V>=ae)return-1;if(g>=N)return 1;if(g>>>=0,N>>>=0,V>>>=0,ae>>>=0,this===_)return 0;for(var ue=ae-V,We=N-g,tt=Math.min(ue,We),dt=this.slice(V,ae),Ut=_.slice(g,N),bt=0;bt<tt;++bt)if(dt[bt]!==Ut[bt]){ue=dt[bt],We=Ut[bt];break}return ue<We?-1:We<ue?1:0};function M(x,_,g,N,V){if(x.length===0)return-1;if(typeof g=="string"?(N=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,isNaN(g)&&(g=V?0:x.length-1),g<0&&(g=x.length+g),g>=x.length){if(V)return-1;g=x.length-1}else if(g<0)if(V)g=0;else return-1;if(typeof _=="string"&&(_=a.from(_,N)),a.isBuffer(_))return _.length===0?-1:Y(x,_,g,N,V);if(typeof _=="number")return _=_&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(x,_,g):Uint8Array.prototype.lastIndexOf.call(x,_,g):Y(x,[_],g,N,V);throw new TypeError("val must be string, number or Buffer")}function Y(x,_,g,N,V){var ae=1,ue=x.length,We=_.length;if(N!==void 0&&(N=String(N).toLowerCase(),N==="ucs2"||N==="ucs-2"||N==="utf16le"||N==="utf-16le")){if(x.length<2||_.length<2)return-1;ae=2,ue/=2,We/=2,g/=2}function tt(Gr,qn){return ae===1?Gr[qn]:Gr.readUInt16BE(qn*ae)}var dt;if(V){var Ut=-1;for(dt=g;dt<ue;dt++)if(tt(x,dt)===tt(_,Ut===-1?0:dt-Ut)){if(Ut===-1&&(Ut=dt),dt-Ut+1===We)return Ut*ae}else Ut!==-1&&(dt-=dt-Ut),Ut=-1}else for(g+We>ue&&(g=ue-We),dt=g;dt>=0;dt--){for(var bt=!0,gr=0;gr<We;gr++)if(tt(x,dt+gr)!==tt(_,gr)){bt=!1;break}if(bt)return dt}return-1}a.prototype.includes=function(_,g,N){return this.indexOf(_,g,N)!==-1},a.prototype.indexOf=function(_,g,N){return M(this,_,g,N,!0)},a.prototype.lastIndexOf=function(_,g,N){return M(this,_,g,N,!1)};function ee(x,_,g,N){g=Number(g)||0;var V=x.length-g;N?(N=Number(N),N>V&&(N=V)):N=V;var ae=_.length;if(ae%2!==0)throw new TypeError("Invalid hex string");N>ae/2&&(N=ae/2);for(var ue=0;ue<N;++ue){var We=parseInt(_.substr(ue*2,2),16);if(isNaN(We))return ue;x[g+ue]=We}return ue}function F(x,_,g,N){return lt(Ie(_,x.length-g),x,g,N)}function se(x,_,g,N){return lt(at(_),x,g,N)}function H(x,_,g,N){return se(x,_,g,N)}function ie(x,_,g,N){return lt(Ue(_),x,g,N)}function xe(x,_,g,N){return lt(ct(_,x.length-g),x,g,N)}a.prototype.write=function(_,g,N,V){if(g===void 0)V="utf8",N=this.length,g=0;else if(N===void 0&&typeof g=="string")V=g,N=this.length,g=0;else if(isFinite(g))g=g|0,isFinite(N)?(N=N|0,V===void 0&&(V="utf8")):(V=N,N=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ae=this.length-g;if((N===void 0||N>ae)&&(N=ae),_.length>0&&(N<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var ue=!1;;)switch(V){case"hex":return ee(this,_,g,N);case"utf8":case"utf-8":return F(this,_,g,N);case"ascii":return se(this,_,g,N);case"latin1":case"binary":return H(this,_,g,N);case"base64":return ie(this,_,g,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,_,g,N);default:if(ue)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),ue=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(x,_,g){return _===0&&g===x.length?e.fromByteArray(x):e.fromByteArray(x.slice(_,g))}function G(x,_,g){g=Math.min(x.length,g);for(var N=[],V=_;V<g;){var ae=x[V],ue=null,We=ae>239?4:ae>223?3:ae>191?2:1;if(V+We<=g){var tt,dt,Ut,bt;switch(We){case 1:ae<128&&(ue=ae);break;case 2:tt=x[V+1],(tt&192)===128&&(bt=(ae&31)<<6|tt&63,bt>127&&(ue=bt));break;case 3:tt=x[V+1],dt=x[V+2],(tt&192)===128&&(dt&192)===128&&(bt=(ae&15)<<12|(tt&63)<<6|dt&63,bt>2047&&(bt<55296||bt>57343)&&(ue=bt));break;case 4:tt=x[V+1],dt=x[V+2],Ut=x[V+3],(tt&192)===128&&(dt&192)===128&&(Ut&192)===128&&(bt=(ae&15)<<18|(tt&63)<<12|(dt&63)<<6|Ut&63,bt>65535&&bt<1114112&&(ue=bt))}}ue===null?(ue=65533,We=1):ue>65535&&(ue-=65536,N.push(ue>>>10&1023|55296),ue=56320|ue&1023),N.push(ue),V+=We}return Q(N)}var R=4096;function Q(x){var _=x.length;if(_<=R)return String.fromCharCode.apply(String,x);for(var g="",N=0;N<_;)g+=String.fromCharCode.apply(String,x.slice(N,N+=R));return g}function te(x,_,g){var N="";g=Math.min(x.length,g);for(var V=_;V<g;++V)N+=String.fromCharCode(x[V]&127);return N}function ge(x,_,g){var N="";g=Math.min(x.length,g);for(var V=_;V<g;++V)N+=String.fromCharCode(x[V]);return N}function ve(x,_,g){var N=x.length;(!_||_<0)&&(_=0),(!g||g<0||g>N)&&(g=N);for(var V="",ae=_;ae<g;++ae)V+=Ke(x[ae]);return V}function U(x,_,g){for(var N=x.slice(_,g),V="",ae=0;ae<N.length;ae+=2)V+=String.fromCharCode(N[ae]+N[ae+1]*256);return V}a.prototype.slice=function(_,g){var N=this.length;_=~~_,g=g===void 0?N:~~g,_<0?(_+=N,_<0&&(_=0)):_>N&&(_=N),g<0?(g+=N,g<0&&(g=0)):g>N&&(g=N),g<_&&(g=_);var V;if(a.TYPED_ARRAY_SUPPORT)V=this.subarray(_,g),V.__proto__=a.prototype;else{var ae=g-_;V=new a(ae,void 0);for(var ue=0;ue<ae;++ue)V[ue]=this[ue+_]}return V};function de(x,_,g){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+_>g)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(_,g,N){_=_|0,g=g|0,N||de(_,g,this.length);for(var V=this[_],ae=1,ue=0;++ue<g&&(ae*=256);)V+=this[_+ue]*ae;return V},a.prototype.readUIntBE=function(_,g,N){_=_|0,g=g|0,N||de(_,g,this.length);for(var V=this[_+--g],ae=1;g>0&&(ae*=256);)V+=this[_+--g]*ae;return V},a.prototype.readUInt8=function(_,g){return g||de(_,1,this.length),this[_]},a.prototype.readUInt16LE=function(_,g){return g||de(_,2,this.length),this[_]|this[_+1]<<8},a.prototype.readUInt16BE=function(_,g){return g||de(_,2,this.length),this[_]<<8|this[_+1]},a.prototype.readUInt32LE=function(_,g){return g||de(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},a.prototype.readUInt32BE=function(_,g){return g||de(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},a.prototype.readIntLE=function(_,g,N){_=_|0,g=g|0,N||de(_,g,this.length);for(var V=this[_],ae=1,ue=0;++ue<g&&(ae*=256);)V+=this[_+ue]*ae;return ae*=128,V>=ae&&(V-=Math.pow(2,8*g)),V},a.prototype.readIntBE=function(_,g,N){_=_|0,g=g|0,N||de(_,g,this.length);for(var V=g,ae=1,ue=this[_+--V];V>0&&(ae*=256);)ue+=this[_+--V]*ae;return ae*=128,ue>=ae&&(ue-=Math.pow(2,8*g)),ue},a.prototype.readInt8=function(_,g){return g||de(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},a.prototype.readInt16LE=function(_,g){g||de(_,2,this.length);var N=this[_]|this[_+1]<<8;return N&32768?N|4294901760:N},a.prototype.readInt16BE=function(_,g){g||de(_,2,this.length);var N=this[_+1]|this[_]<<8;return N&32768?N|4294901760:N},a.prototype.readInt32LE=function(_,g){return g||de(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},a.prototype.readInt32BE=function(_,g){return g||de(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},a.prototype.readFloatLE=function(_,g){return g||de(_,4,this.length),n.read(this,_,!0,23,4)},a.prototype.readFloatBE=function(_,g){return g||de(_,4,this.length),n.read(this,_,!1,23,4)},a.prototype.readDoubleLE=function(_,g){return g||de(_,8,this.length),n.read(this,_,!0,52,8)},a.prototype.readDoubleBE=function(_,g){return g||de(_,8,this.length),n.read(this,_,!1,52,8)};function Se(x,_,g,N,V,ae){if(!a.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>V||_<ae)throw new RangeError('"value" argument is out of bounds');if(g+N>x.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(_,g,N,V){if(_=+_,g=g|0,N=N|0,!V){var ae=Math.pow(2,8*N)-1;Se(this,_,g,N,ae,0)}var ue=1,We=0;for(this[g]=_&255;++We<N&&(ue*=256);)this[g+We]=_/ue&255;return g+N},a.prototype.writeUIntBE=function(_,g,N,V){if(_=+_,g=g|0,N=N|0,!V){var ae=Math.pow(2,8*N)-1;Se(this,_,g,N,ae,0)}var ue=N-1,We=1;for(this[g+ue]=_&255;--ue>=0&&(We*=256);)this[g+ue]=_/We&255;return g+N},a.prototype.writeUInt8=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,1,255,0),a.TYPED_ARRAY_SUPPORT||(_=Math.floor(_)),this[g]=_&255,g+1};function Fe(x,_,g,N){_<0&&(_=65535+_+1);for(var V=0,ae=Math.min(x.length-g,2);V<ae;++V)x[g+V]=(_&255<<8*(N?V:1-V))>>>(N?V:1-V)*8}a.prototype.writeUInt16LE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[g]=_&255,this[g+1]=_>>>8):Fe(this,_,g,!0),g+2},a.prototype.writeUInt16BE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[g]=_>>>8,this[g+1]=_&255):Fe(this,_,g,!1),g+2};function L(x,_,g,N){_<0&&(_=4294967295+_+1);for(var V=0,ae=Math.min(x.length-g,4);V<ae;++V)x[g+V]=_>>>(N?V:3-V)*8&255}a.prototype.writeUInt32LE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[g+3]=_>>>24,this[g+2]=_>>>16,this[g+1]=_>>>8,this[g]=_&255):L(this,_,g,!0),g+4},a.prototype.writeUInt32BE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[g]=_>>>24,this[g+1]=_>>>16,this[g+2]=_>>>8,this[g+3]=_&255):L(this,_,g,!1),g+4},a.prototype.writeIntLE=function(_,g,N,V){if(_=+_,g=g|0,!V){var ae=Math.pow(2,8*N-1);Se(this,_,g,N,ae-1,-ae)}var ue=0,We=1,tt=0;for(this[g]=_&255;++ue<N&&(We*=256);)_<0&&tt===0&&this[g+ue-1]!==0&&(tt=1),this[g+ue]=(_/We>>0)-tt&255;return g+N},a.prototype.writeIntBE=function(_,g,N,V){if(_=+_,g=g|0,!V){var ae=Math.pow(2,8*N-1);Se(this,_,g,N,ae-1,-ae)}var ue=N-1,We=1,tt=0;for(this[g+ue]=_&255;--ue>=0&&(We*=256);)_<0&&tt===0&&this[g+ue+1]!==0&&(tt=1),this[g+ue]=(_/We>>0)-tt&255;return g+N},a.prototype.writeInt8=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,1,127,-128),a.TYPED_ARRAY_SUPPORT||(_=Math.floor(_)),_<0&&(_=255+_+1),this[g]=_&255,g+1},a.prototype.writeInt16LE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[g]=_&255,this[g+1]=_>>>8):Fe(this,_,g,!0),g+2},a.prototype.writeInt16BE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[g]=_>>>8,this[g+1]=_&255):Fe(this,_,g,!1),g+2},a.prototype.writeInt32LE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[g]=_&255,this[g+1]=_>>>8,this[g+2]=_>>>16,this[g+3]=_>>>24):L(this,_,g,!0),g+4},a.prototype.writeInt32BE=function(_,g,N){return _=+_,g=g|0,N||Se(this,_,g,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),a.TYPED_ARRAY_SUPPORT?(this[g]=_>>>24,this[g+1]=_>>>16,this[g+2]=_>>>8,this[g+3]=_&255):L(this,_,g,!1),g+4};function X(x,_,g,N,V,ae){if(g+N>x.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function He(x,_,g,N,V){return V||X(x,_,g,4),n.write(x,_,g,N,23,4),g+4}a.prototype.writeFloatLE=function(_,g,N){return He(this,_,g,!0,N)},a.prototype.writeFloatBE=function(_,g,N){return He(this,_,g,!1,N)};function Ne(x,_,g,N,V){return V||X(x,_,g,8),n.write(x,_,g,N,52,8),g+8}a.prototype.writeDoubleLE=function(_,g,N){return Ne(this,_,g,!0,N)},a.prototype.writeDoubleBE=function(_,g,N){return Ne(this,_,g,!1,N)},a.prototype.copy=function(_,g,N,V){if(N||(N=0),!V&&V!==0&&(V=this.length),g>=_.length&&(g=_.length),g||(g=0),V>0&&V<N&&(V=N),V===N||_.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(N<0||N>=this.length)throw new RangeError("sourceStart out of bounds");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),_.length-g<V-N&&(V=_.length-g+N);var ae=V-N,ue;if(this===_&&N<g&&g<V)for(ue=ae-1;ue>=0;--ue)_[ue+g]=this[ue+N];else if(ae<1e3||!a.TYPED_ARRAY_SUPPORT)for(ue=0;ue<ae;++ue)_[ue+g]=this[ue+N];else Uint8Array.prototype.set.call(_,this.subarray(N,N+ae),g);return ae},a.prototype.fill=function(_,g,N,V){if(typeof _=="string"){if(typeof g=="string"?(V=g,g=0,N=this.length):typeof N=="string"&&(V=N,N=this.length),_.length===1){var ae=_.charCodeAt(0);ae<256&&(_=ae)}if(V!==void 0&&typeof V!="string")throw new TypeError("encoding must be a string");if(typeof V=="string"&&!a.isEncoding(V))throw new TypeError("Unknown encoding: "+V)}else typeof _=="number"&&(_=_&255);if(g<0||this.length<g||this.length<N)throw new RangeError("Out of range index");if(N<=g)return this;g=g>>>0,N=N===void 0?this.length:N>>>0,_||(_=0);var ue;if(typeof _=="number")for(ue=g;ue<N;++ue)this[ue]=_;else{var We=a.isBuffer(_)?_:Ie(new a(_,V).toString()),tt=We.length;for(ue=0;ue<N-g;++ue)this[ue+g]=We[ue%tt]}return this};var Ve=/[^+\/0-9A-Za-z-_]/g;function Ae(x){if(x=Ze(x).replace(Ve,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function Ze(x){return x.trim?x.trim():x.replace(/^\s+|\s+$/g,"")}function Ke(x){return x<16?"0"+x.toString(16):x.toString(16)}function Ie(x,_){_=_||1/0;for(var g,N=x.length,V=null,ae=[],ue=0;ue<N;++ue){if(g=x.charCodeAt(ue),g>55295&&g<57344){if(!V){if(g>56319){(_-=3)>-1&&ae.push(239,191,189);continue}else if(ue+1===N){(_-=3)>-1&&ae.push(239,191,189);continue}V=g;continue}if(g<56320){(_-=3)>-1&&ae.push(239,191,189),V=g;continue}g=(V-55296<<10|g-56320)+65536}else V&&(_-=3)>-1&&ae.push(239,191,189);if(V=null,g<128){if((_-=1)<0)break;ae.push(g)}else if(g<2048){if((_-=2)<0)break;ae.push(g>>6|192,g&63|128)}else if(g<65536){if((_-=3)<0)break;ae.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((_-=4)<0)break;ae.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return ae}function at(x){for(var _=[],g=0;g<x.length;++g)_.push(x.charCodeAt(g)&255);return _}function ct(x,_){for(var g,N,V,ae=[],ue=0;ue<x.length&&!((_-=2)<0);++ue)g=x.charCodeAt(ue),N=g>>8,V=g%256,ae.push(V),ae.push(N);return ae}function Ue(x){return e.toByteArray(Ae(x))}function lt(x,_,g,N){for(var V=0;V<N&&!(V+g>=_.length||V>=x.length);++V)_[V+g]=x[V];return V}function vt(x){return x!==x}}(Gl)),Gl}var xt=oC();function aC(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ru={exports:{}};const uC={},cC=Object.freeze(Object.defineProperty({__proto__:null,default:uC},Symbol.toStringTag,{value:"Module"})),lC=ws(cC);var dC=ru.exports,bg;function Es(){return bg||(bg=1,function(t,e){(function(n,r){t.exports=r()})(dC,function(){var n=n||function(r,i){var s;if(typeof window!="undefined"&&window.crypto&&(s=window.crypto),typeof self!="undefined"&&self.crypto&&(s=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window!="undefined"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof Mr!="undefined"&&Mr.crypto&&(s=Mr.crypto),!s&&typeof aC=="function")try{s=lC}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function E(){}return function(O){var I;return E.prototype=O,I=new E,E.prototype=null,I}}(),c={},u=c.lib={},d=u.Base=function(){return{extend:function(E){var O=a(this);return E&&O.mixIn(E),(!O.hasOwnProperty("init")||this.init===O.init)&&(O.init=function(){O.$super.init.apply(this,arguments)}),O.init.prototype=O,O.$super=this,O},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var O in E)E.hasOwnProperty(O)&&(this[O]=E[O]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),h=u.WordArray=d.extend({init:function(E,O){E=this.words=E||[],O!=i?this.sigBytes=O:this.sigBytes=E.length*4},toString:function(E){return(E||y).stringify(this)},concat:function(E){var O=this.words,I=E.words,M=this.sigBytes,Y=E.sigBytes;if(this.clamp(),M%4)for(var ee=0;ee<Y;ee++){var F=I[ee>>>2]>>>24-ee%4*8&255;O[M+ee>>>2]|=F<<24-(M+ee)%4*8}else for(var se=0;se<Y;se+=4)O[M+se>>>2]=I[se>>>2];return this.sigBytes+=Y,this},clamp:function(){var E=this.words,O=this.sigBytes;E[O>>>2]&=4294967295<<32-O%4*8,E.length=r.ceil(O/4)},clone:function(){var E=d.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var O=[],I=0;I<E;I+=4)O.push(o());return new h.init(O,E)}}),p=c.enc={},y=p.Hex={stringify:function(E){for(var O=E.words,I=E.sigBytes,M=[],Y=0;Y<I;Y++){var ee=O[Y>>>2]>>>24-Y%4*8&255;M.push((ee>>>4).toString(16)),M.push((ee&15).toString(16))}return M.join("")},parse:function(E){for(var O=E.length,I=[],M=0;M<O;M+=2)I[M>>>3]|=parseInt(E.substr(M,2),16)<<24-M%8*4;return new h.init(I,O/2)}},v=p.Latin1={stringify:function(E){for(var O=E.words,I=E.sigBytes,M=[],Y=0;Y<I;Y++){var ee=O[Y>>>2]>>>24-Y%4*8&255;M.push(String.fromCharCode(ee))}return M.join("")},parse:function(E){for(var O=E.length,I=[],M=0;M<O;M++)I[M>>>2]|=(E.charCodeAt(M)&255)<<24-M%4*8;return new h.init(I,O)}},w=p.Utf8={stringify:function(E){try{return decodeURIComponent(escape(v.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(E){return v.parse(unescape(encodeURIComponent(E)))}},k=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=w.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var O,I=this._data,M=I.words,Y=I.sigBytes,ee=this.blockSize,F=ee*4,se=Y/F;E?se=r.ceil(se):se=r.max((se|0)-this._minBufferSize,0);var H=se*ee,ie=r.min(H*4,Y);if(H){for(var xe=0;xe<H;xe+=ee)this._doProcessBlock(M,xe);O=M.splice(0,H),I.sigBytes-=ie}return new h.init(O,ie)},clone:function(){var E=d.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});u.Hasher=k.extend({cfg:d.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){E&&this._append(E);var O=this._doFinalize();return O},blockSize:16,_createHelper:function(E){return function(O,I){return new E.init(I).finalize(O)}},_createHmacHelper:function(E){return function(O,I){return new C.HMAC.init(E,I).finalize(O)}}});var C=c.algo={};return c}(Math);return n})}(ru)),ru.exports}var fC=Es();const Fr=Hr(fC);var iu={exports:{}},hC=iu.exports,wg;function pC(){return wg||(wg=1,function(t,e){(function(n,r){t.exports=r(Es())})(hC,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,s=i.WordArray,o=s.init,a=s.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var u=c.byteLength,d=[],h=0;h<u;h++)d[h>>>2]|=c[h]<<24-h%4*8;o.call(this,d,u)}else o.apply(this,arguments)};a.prototype=s}}(),n.lib.WordArray})}(iu)),iu.exports}pC();var su={exports:{}},mC=su.exports,_g;function vb(){return _g||(_g=1,function(t,e){(function(n,r){t.exports=r(Es())})(mC,function(n){return function(r){var i=n,s=i.lib,o=s.WordArray,a=s.Hasher,c=i.algo,u=[],d=[];(function(){function y(C){for(var E=r.sqrt(C),O=2;O<=E;O++)if(!(C%O))return!1;return!0}function v(C){return(C-(C|0))*4294967296|0}for(var w=2,k=0;k<64;)y(w)&&(k<8&&(u[k]=v(r.pow(w,1/2))),d[k]=v(r.pow(w,1/3)),k++),w++})();var h=[],p=c.SHA256=a.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(y,v){for(var w=this._hash.words,k=w[0],C=w[1],E=w[2],O=w[3],I=w[4],M=w[5],Y=w[6],ee=w[7],F=0;F<64;F++){if(F<16)h[F]=y[v+F]|0;else{var se=h[F-15],H=(se<<25|se>>>7)^(se<<14|se>>>18)^se>>>3,ie=h[F-2],xe=(ie<<15|ie>>>17)^(ie<<13|ie>>>19)^ie>>>10;h[F]=H+h[F-7]+xe+h[F-16]}var qe=I&M^~I&Y,G=k&C^k&E^C&E,R=(k<<30|k>>>2)^(k<<19|k>>>13)^(k<<10|k>>>22),Q=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),te=ee+Q+qe+d[F]+h[F],ge=R+G;ee=Y,Y=M,M=I,I=O+te|0,O=E,E=C,C=k,k=te+ge|0}w[0]=w[0]+k|0,w[1]=w[1]+C|0,w[2]=w[2]+E|0,w[3]=w[3]+O|0,w[4]=w[4]+I|0,w[5]=w[5]+M|0,w[6]=w[6]+Y|0,w[7]=w[7]+ee|0},_doFinalize:function(){var y=this._data,v=y.words,w=this._nDataBytes*8,k=y.sigBytes*8;return v[k>>>5]|=128<<24-k%32,v[(k+64>>>9<<4)+14]=r.floor(w/4294967296),v[(k+64>>>9<<4)+15]=w,y.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var y=a.clone.call(this);return y._hash=this._hash.clone(),y}});i.SHA256=a._createHelper(p),i.HmacSHA256=a._createHmacHelper(p)}(Math),n.SHA256})}(su)),su.exports}var gC=vb();const yb=Hr(gC);var ou={exports:{}},au={exports:{}},vC=au.exports,Sg;function yC(){return Sg||(Sg=1,function(t,e){(function(n,r){t.exports=r(Es())})(vC,function(n){(function(){var r=n,i=r.lib,s=i.Base,o=r.enc,a=o.Utf8,c=r.algo;c.HMAC=s.extend({init:function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=a.parse(d));var h=u.blockSize,p=h*4;d.sigBytes>p&&(d=u.finalize(d)),d.clamp();for(var y=this._oKey=d.clone(),v=this._iKey=d.clone(),w=y.words,k=v.words,C=0;C<h;C++)w[C]^=1549556828,k[C]^=909522486;y.sigBytes=v.sigBytes=p,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var d=this._hasher,h=d.finalize(u);d.reset();var p=d.finalize(this._oKey.clone().concat(h));return p}})})()})}(au)),au.exports}var bC=ou.exports,kg;function wC(){return kg||(kg=1,function(t,e){(function(n,r,i){t.exports=r(Es(),vb(),yC())})(bC,function(n){return n.HmacSHA256})}(ou)),ou.exports}var _C=wC();const Cu=Hr(_C);var En;typeof window!="undefined"&&window.crypto&&(En=window.crypto);!En&&typeof window!="undefined"&&window.msCrypto&&(En=window.msCrypto);!En&&typeof global!="undefined"&&global.crypto&&(En=global.crypto);if(!En&&typeof require=="function")try{En=require("crypto")}catch{}function SC(){if(En){if(typeof En.getRandomValues=="function")try{return En.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof En.randomBytes=="function")try{return En.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")}function kC(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")}var EC=function(){function t(n,r){n=this.words=n||[],r!=null?this.sigBytes=r:this.sigBytes=n.length*4}var e=t.prototype;return e.random=function(r){for(var i=[],s=0;s<r;s+=4)i.push(SC());return new t(i,r)},e.toString=function(){return kC(this)},t}();function Be(t,e){t!=null&&this.fromString(t,e)}function sn(){return new Be(null)}var Br,AC=0xdeadbeefcafe,Eg=(AC&16777215)==15715070;function CC(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=o&67108863}return i}function xC(t,e,n,r,i,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this[t]&32767,u=this[t++]>>15,d=a*c+u*o;c=o*c+((d&32767)<<15)+n[r]+(i&1073741823),i=(c>>>30)+(d>>>15)+a*u+(i>>>30),n[r++]=c&1073741823}return i}function NC(t,e,n,r,i,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this[t]&16383,u=this[t++]>>14,d=a*c+u*o;c=o*c+((d&16383)<<14)+n[r]+i,i=(c>>28)+(d>>14)+a*u,n[r++]=c&268435455}return i}var Ag=typeof navigator!="undefined";Ag&&Eg&&navigator.appName=="Microsoft Internet Explorer"?(Be.prototype.am=xC,Br=30):Ag&&Eg&&navigator.appName!="Netscape"?(Be.prototype.am=CC,Br=26):(Be.prototype.am=NC,Br=28);Be.prototype.DB=Br;Be.prototype.DM=(1<<Br)-1;Be.prototype.DV=1<<Br;var eh=52;Be.prototype.FV=Math.pow(2,eh);Be.prototype.F1=eh-Br;Be.prototype.F2=2*Br-eh;var TC="0123456789abcdefghijklmnopqrstuvwxyz",Zu=new Array,As,xn;As=48;for(xn=0;xn<=9;++xn)Zu[As++]=xn;As=97;for(xn=10;xn<36;++xn)Zu[As++]=xn;As=65;for(xn=10;xn<36;++xn)Zu[As++]=xn;function Cg(t){return TC.charAt(t)}function OC(t,e){var n=Zu[t.charCodeAt(e)];return n==null?-1:n}function IC(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function RC(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function th(t){var e=sn();return e.fromInt(t),e}function PC(t,e){var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else if(e==4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var o=OC(t,r);if(o<0){t.charAt(r)=="-"&&(i=!0);continue}i=!1,s==0?this[this.t++]=o:s+n>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,s+=n,s>=this.DB&&(s-=this.DB)}this.clamp(),i&&Be.ZERO.subTo(this,this)}function DC(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function FC(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var n=(1<<e)-1,r,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(r=this[o]>>a)>0&&(i=!0,s=Cg(r));o>=0;)a<e?(r=(this[o]&(1<<a)-1)<<e-a,r|=this[--o]>>(a+=this.DB-e)):(r=this[o]>>(a-=e)&n,a<=0&&(a+=this.DB,--o)),r>0&&(i=!0),i&&(s+=Cg(r));return i?s:"0"}function UC(){var t=sn();return Be.ZERO.subTo(this,t),t}function LC(){return this.s<0?this.negate():this}function MC(t){var e=this.s-t.s;if(e!=0)return e;var n=this.t;if(e=n-t.t,e!=0)return this.s<0?-e:e;for(;--n>=0;)if((e=this[n]-t[n])!=0)return e;return 0}function nh(t){var e=1,n;return(n=t>>>16)!=0&&(t=n,e+=16),(n=t>>8)!=0&&(t=n,e+=8),(n=t>>4)!=0&&(t=n,e+=4),(n=t>>2)!=0&&(t=n,e+=2),(n=t>>1)!=0&&(t=n,e+=1),e}function BC(){return this.t<=0?0:this.DB*(this.t-1)+nh(this[this.t-1]^this.s&this.DM)}function $C(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function jC(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function VC(t,e){var n=t%this.DB,r=this.DB-n,i=(1<<r)-1,s=Math.floor(t/this.DB),o=this.s<<n&this.DM,a;for(a=this.t-1;a>=0;--a)e[a+s+1]=this[a]>>r|o,o=(this[a]&i)<<n;for(a=s-1;a>=0;--a)e[a]=0;e[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function qC(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t){e.t=0;return}var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}function HC(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function KC(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&Be.ZERO.subTo(e,e)}function zC(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function GC(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){e!=null&&e.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=sn());var s=sn(),o=this.s,a=t.s,c=this.DB-nh(r[r.t-1]);c>0?(r.lShiftTo(c,s),i.lShiftTo(c,n)):(r.copyTo(s),i.copyTo(n));var u=s.t,d=s[u-1];if(d!=0){var h=d*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),p=this.FV/h,y=(1<<this.F1)/h,v=1<<this.F2,w=n.t,k=w-u,C=e==null?sn():e;for(s.dlShiftTo(k,C),n.compareTo(C)>=0&&(n[n.t++]=1,n.subTo(C,n)),Be.ONE.dlShiftTo(u,C),C.subTo(s,s);s.t<u;)s[s.t++]=0;for(;--k>=0;){var E=n[--w]==d?this.DM:Math.floor(n[w]*p+(n[w-1]+v)*y);if((n[w]+=s.am(0,E,n,k,0,u))<E)for(s.dlShiftTo(k,C),n.subTo(C,n);n[w]<--E;)n.subTo(C,n)}e!=null&&(n.drShiftTo(u,e),o!=a&&Be.ZERO.subTo(e,e)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),o<0&&Be.ZERO.subTo(n,n)}}}function WC(t){var e=sn();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Be.ZERO)>0&&t.subTo(e,e),e}function YC(){if(this.t<1)return 0;var t=this[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function JC(t){return this.compareTo(t)==0}function XC(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function QC(t){var e=sn();return this.addTo(t,e),e}function ZC(t){var e=sn();return this.subTo(t,e),e}function ex(t){var e=sn();return this.multiplyTo(t,e),e}function tx(t){var e=sn();return this.divRemTo(t,e,null),e}function Cs(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function nx(t){var e=sn();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Be.ZERO)>0&&this.m.subTo(e,e),e}function rx(t){var e=sn();return t.copyTo(e),this.reduce(e),e}function ix(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=t[e]&32767,r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function sx(t,e){t.squareTo(e),this.reduce(e)}function ox(t,e,n){t.multiplyTo(e,n),this.reduce(n)}Cs.prototype.convert=nx;Cs.prototype.revert=rx;Cs.prototype.reduce=ix;Cs.prototype.mulTo=ox;Cs.prototype.sqrTo=sx;function ax(t,e,n){var r=t.bitLength(),i,s=th(1),o=new Cs(e);if(r<=0)return s;r<18?i=1:r<48?i=3:r<144?i=4:r<768?i=5:i=6;var a=new Array,c=3,u=i-1,d=(1<<i)-1;if(a[1]=o.convert(this),i>1){var h=sn();for(o.sqrTo(a[1],h);c<=d;)a[c]=sn(),o.mulTo(h,a[c-2],a[c]),c+=2}var p=t.t-1,y,v=!0,w=sn(),k;for(r=nh(t[p])-1;p>=0;){for(r>=u?y=t[p]>>r-u&d:(y=(t[p]&(1<<r+1)-1)<<u-r,p>0&&(y|=t[p-1]>>this.DB+r-u)),c=i;!(y&1);)y>>=1,--c;if((r-=c)<0&&(r+=this.DB,--p),v)a[y].copyTo(s),v=!1;else{for(;c>1;)o.sqrTo(s,w),o.sqrTo(w,s),c-=2;c>0?o.sqrTo(s,w):(k=s,s=w,w=k),o.mulTo(w,a[y],s)}for(;p>=0&&!(t[p]&1<<r);)o.sqrTo(s,w),k=s,s=w,w=k,--r<0&&(r=this.DB-1,--p)}var C=o.revert(s);return n(null,C),C}Be.prototype.copyTo=IC;Be.prototype.fromInt=RC;Be.prototype.fromString=PC;Be.prototype.clamp=DC;Be.prototype.dlShiftTo=$C;Be.prototype.drShiftTo=jC;Be.prototype.lShiftTo=VC;Be.prototype.rShiftTo=qC;Be.prototype.subTo=HC;Be.prototype.multiplyTo=KC;Be.prototype.squareTo=zC;Be.prototype.divRemTo=GC;Be.prototype.invDigit=YC;Be.prototype.addTo=XC;Be.prototype.toString=FC;Be.prototype.negate=UC;Be.prototype.abs=LC;Be.prototype.compareTo=MC;Be.prototype.bitLength=BC;Be.prototype.mod=WC;Be.prototype.equals=JC;Be.prototype.add=QC;Be.prototype.subtract=ZC;Be.prototype.multiply=ex;Be.prototype.divide=tx;Be.prototype.modPow=ax;Be.ZERO=th(0);Be.ONE=th(1);/*!
|
|
45
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
46
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
47
|
-
*/function Yl(t){return xt.Buffer.from(new EC().random(t).toString(),"hex")}var ux=/^[89a-f]/i,cx="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",lx="userAttributes.",zi=function(){function t(n){this.N=new Be(cx,16),this.g=new Be("2",16),this.k=new Be(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=xt.Buffer.from("Caldera Derived Key","utf8"),this.poolName=n}var e=t.prototype;return e.getSmallAValue=function(){return this.smallAValue},e.getLargeAValue=function(r){var i=this;this.largeAValue?r(null,this.largeAValue):this.calculateA(this.smallAValue,function(s,o){s&&r(s,null),i.largeAValue=o,r(null,i.largeAValue)})},e.generateRandomSmallA=function(){var r=Yl(128).toString("hex"),i=new Be(r,16);return i},e.generateRandomString=function(){return Yl(40).toString("base64")},e.getRandomPassword=function(){return this.randomPassword},e.getSaltDevices=function(){return this.SaltToHashDevices},e.getVerifierDevices=function(){return this.verifierDevices},e.generateHashDevice=function(r,i,s){var o=this;this.randomPassword=this.generateRandomString();var a=""+r+i+":"+this.randomPassword,c=this.hash(a),u=Yl(16).toString("hex");this.SaltToHashDevices=this.padHex(new Be(u,16)),this.g.modPow(new Be(this.hexHash(this.SaltToHashDevices+c),16),this.N,function(d,h){d&&s(d,null),o.verifierDevices=o.padHex(h),s(null,null)})},e.calculateA=function(r,i){var s=this;this.g.modPow(r,this.N,function(o,a){o&&i(o,null),a.mod(s.N).equals(Be.ZERO)&&i(new Error("Illegal paramater. A mod N cannot be 0."),null),i(null,a)})},e.calculateU=function(r,i){this.UHexHash=this.hexHash(this.padHex(r)+this.padHex(i));var s=new Be(this.UHexHash,16);return s},e.hash=function(r){var i=r instanceof xt.Buffer?Fr.lib.WordArray.create(r):r,s=yb(i).toString();return new Array(64-s.length).join("0")+s},e.hexHash=function(r){return this.hash(xt.Buffer.from(r,"hex"))},e.computehkdf=function(r,i){var s=Fr.lib.WordArray.create(xt.Buffer.concat([this.infoBits,xt.Buffer.from("","utf8")])),o=r instanceof xt.Buffer?Fr.lib.WordArray.create(r):r,a=i instanceof xt.Buffer?Fr.lib.WordArray.create(i):i,c=Cu(o,a),u=Cu(s,c);return xt.Buffer.from(u.toString(),"hex").slice(0,16)},e.getPasswordAuthenticationKey=function(r,i,s,o,a){var c=this;if(s.mod(this.N).equals(Be.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,s),this.UValue.equals(Be.ZERO))throw new Error("U cannot be zero.");var u=""+this.poolName+r+":"+i,d=this.hash(u),h=new Be(this.hexHash(this.padHex(o)+d),16);this.calculateS(h,s,function(p,y){p&&a(p,null);var v=c.computehkdf(xt.Buffer.from(c.padHex(y),"hex"),xt.Buffer.from(c.padHex(c.UValue),"hex"));a(null,v)})},e.calculateS=function(r,i,s){var o=this;this.g.modPow(r,this.N,function(a,c){a&&s(a,null);var u=i.subtract(o.k.multiply(c));u.modPow(o.smallAValue.add(o.UValue.multiply(r)),o.N,function(d,h){d&&s(d,null),s(null,h.mod(o.N))})})},e.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return lx},e.padHex=function(r){if(!(r instanceof Be))throw new Error("Not a BigInteger");var i=r.compareTo(Be.ZERO)<0,s=r.abs().toString(16);if(s=s.length%2!==0?"0"+s:s,s=ux.test(s)?"00"+s:s,i){var o=s.split("").map(function(c){var u=~parseInt(c,16)&15;return"0123456789ABCDEF".charAt(u)}).join(""),a=new Be(o,16).add(Be.ONE);s=a.toString(16),s.toUpperCase().startsWith("FF8")&&(s=s.substring(2))}return s},t}();/*!
|
|
48
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
49
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
50
|
-
*/var bb=function(){function t(n){this.jwtToken=n||"",this.payload=this.decodePayload()}var e=t.prototype;return e.getJwtToken=function(){return this.jwtToken},e.getExpiration=function(){return this.payload.exp},e.getIssuedAt=function(){return this.payload.iat},e.decodePayload=function(){var r=this.jwtToken.split(".")[1];try{return JSON.parse(xt.Buffer.from(r,"base64").toString("utf8"))}catch{return{}}},t}();function dx(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Qd(t,e)}function Qd(t,e){return Qd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Qd(t,e)}var Zd=function(t){dx(e,t);function e(n){var r=n===void 0?{}:n,i=r.AccessToken;return t.call(this,i||"")||this}return e}(bb);function fx(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ef(t,e)}function ef(t,e){return ef=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ef(t,e)}var tf=function(t){fx(e,t);function e(n){var r=n===void 0?{}:n,i=r.IdToken;return t.call(this,i||"")||this}return e}(bb);/*!
|
|
51
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
52
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
53
|
-
*/var nf=function(){function t(n){var r=n===void 0?{}:n,i=r.RefreshToken;this.token=i||""}var e=t.prototype;return e.getToken=function(){return this.token},t}(),uu={exports:{}},hx=uu.exports,xg;function px(){return xg||(xg=1,function(t,e){(function(n,r){t.exports=r(Es())})(hx,function(n){return function(){var r=n,i=r.lib,s=i.WordArray,o=r.enc;o.Base64={stringify:function(c){var u=c.words,d=c.sigBytes,h=this._map;c.clamp();for(var p=[],y=0;y<d;y+=3)for(var v=u[y>>>2]>>>24-y%4*8&255,w=u[y+1>>>2]>>>24-(y+1)%4*8&255,k=u[y+2>>>2]>>>24-(y+2)%4*8&255,C=v<<16|w<<8|k,E=0;E<4&&y+E*.75<d;E++)p.push(h.charAt(C>>>6*(3-E)&63));var O=h.charAt(64);if(O)for(;p.length%4;)p.push(O);return p.join("")},parse:function(c){var u=c.length,d=this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var p=0;p<d.length;p++)h[d.charCodeAt(p)]=p}var y=d.charAt(64);if(y){var v=c.indexOf(y);v!==-1&&(u=v)}return a(c,u,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(c,u,d){for(var h=[],p=0,y=0;y<u;y++)if(y%4){var v=d[c.charCodeAt(y-1)]<<y%4*2,w=d[c.charCodeAt(y)]>>>6-y%4*2,k=v|w;h[p>>>2]|=k<<24-p%4*8,p++}return s.create(h,p)}}(),n.enc.Base64})}(uu)),uu.exports}var mx=px();const rf=Hr(mx);/*!
|
|
54
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
55
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
56
|
-
*/var sf=function(){function t(n){var r=n===void 0?{}:n,i=r.IdToken,s=r.RefreshToken,o=r.AccessToken,a=r.ClockDrift;if(o==null||i==null)throw new Error("Id token and Access Token must be present.");this.idToken=i,this.refreshToken=s,this.accessToken=o,this.clockDrift=a===void 0?this.calculateClockDrift():a}var e=t.prototype;return e.getIdToken=function(){return this.idToken},e.getRefreshToken=function(){return this.refreshToken},e.getAccessToken=function(){return this.accessToken},e.getClockDrift=function(){return this.clockDrift},e.calculateClockDrift=function(){var r=Math.floor(new Date/1e3),i=Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt());return r-i},e.isValid=function(){var r=Math.floor(new Date/1e3),i=r-this.clockDrift;return i<this.accessToken.getExpiration()&&i<this.idToken.getExpiration()},t}();/*!
|
|
57
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
58
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
59
|
-
*/var gx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vx=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ng=function(){function t(){}var e=t.prototype;return e.getNowString=function(){var r=new Date,i=vx[r.getUTCDay()],s=gx[r.getUTCMonth()],o=r.getUTCDate(),a=r.getUTCHours();a<10&&(a="0"+a);var c=r.getUTCMinutes();c<10&&(c="0"+c);var u=r.getUTCSeconds();u<10&&(u="0"+u);var d=r.getUTCFullYear(),h=i+" "+s+" "+o+" "+a+":"+c+":"+u+" UTC "+d;return h},t}();/*!
|
|
60
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
61
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
62
|
-
*/var es=function(){function t(n){var r=n===void 0?{}:n,i=r.Name,s=r.Value;this.Name=i||"",this.Value=s||""}var e=t.prototype;return e.getValue=function(){return this.Value},e.setValue=function(r){return this.Value=r,this},e.getName=function(){return this.Name},e.setName=function(r){return this.Name=r,this},e.toString=function(){return JSON.stringify(this)},e.toJSON=function(){return{Name:this.Name,Value:this.Value}},t}();/*!
|
|
63
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
64
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
65
|
-
*/var ii={},yx=function(){function t(){}return t.setItem=function(n,r){return ii[n]=r,ii[n]},t.getItem=function(n){return Object.prototype.hasOwnProperty.call(ii,n)?ii[n]:void 0},t.removeItem=function(n){return delete ii[n]},t.clear=function(){return ii={},ii},t}(),wb=function(){function t(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch{this.storageWindow=yx}}var e=t.prototype;return e.getStorage=function(){return this.storageWindow},t}();/*!
|
|
66
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
67
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
68
|
-
*/var bx=typeof navigator!="undefined",Tg=bx?navigator.userAgent:"nodejs",of=function(){function t(n){if(n==null||n.Username==null||n.Pool==null)throw new Error("Username and Pool information are required.");this.username=n.Username||"",this.pool=n.Pool,this.Session=null,this.client=n.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=n.Storage||new wb().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var e=t.prototype;return e.setSignInUserSession=function(r){this.clearCachedUserData(),this.signInUserSession=r,this.cacheTokens()},e.getSignInUserSession=function(){return this.signInUserSession},e.getUsername=function(){return this.username},e.getAuthenticationFlowType=function(){return this.authenticationFlowType},e.setAuthenticationFlowType=function(r){this.authenticationFlowType=r},e.initiateAuth=function(r,i){var s=this,o=r.getAuthParameters();o.USERNAME=this.username;var a=Object.keys(r.getValidationData()).length!==0?r.getValidationData():r.getClientMetadata(),c={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:o,ClientMetadata:a};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",c,function(u,d){if(u)return i.onFailure(u);var h=d.ChallengeName,p=d.ChallengeParameters;return h==="CUSTOM_CHALLENGE"?(s.Session=d.Session,i.customChallenge(p)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),i.onSuccess(s.signInUserSession))})},e.authenticateUser=function(r,i){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(r,i):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(r,i):i.onFailure(new Error("Authentication flow type is invalid."))},e.authenticateUserDefaultAuth=function(r,i){var s=this,o=new zi(this.pool.getUserPoolName()),a=new Ng,c,u,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,o.getLargeAValue(function(h,p){h&&i.onFailure(h),d.SRP_A=p.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var y=Object.keys(r.getValidationData()).length!==0?r.getValidationData():r.getClientMetadata(),v={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:y};s.getUserContextData(s.username)&&(v.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",v,function(w,k){if(w)return i.onFailure(w);var C=k.ChallengeParameters;s.username=C.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",c=new Be(C.SRP_B,16),u=new Be(C.SALT,16),s.getCachedDeviceKeyAndPassword(),o.getPasswordAuthenticationKey(s.username,r.getPassword(),c,u,function(E,O){E&&i.onFailure(E);var I=a.getNowString(),M=Fr.lib.WordArray.create(xt.Buffer.concat([xt.Buffer.from(s.pool.getUserPoolName(),"utf8"),xt.Buffer.from(s.username,"utf8"),xt.Buffer.from(C.SECRET_BLOCK,"base64"),xt.Buffer.from(I,"utf8")])),Y=Fr.lib.WordArray.create(O),ee=rf.stringify(Cu(M,Y)),F={};F.USERNAME=s.username,F.PASSWORD_CLAIM_SECRET_BLOCK=C.SECRET_BLOCK,F.TIMESTAMP=I,F.PASSWORD_CLAIM_SIGNATURE=ee,s.deviceKey!=null&&(F.DEVICE_KEY=s.deviceKey);var se=function ie(xe,qe){return s.client.request("RespondToAuthChallenge",xe,function(G,R){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(F.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),ie(xe,qe)):qe(G,R)})},H={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:F,Session:k.Session,ClientMetadata:y};s.getUserContextData()&&(H.UserContextData=s.getUserContextData()),se(H,function(ie,xe){return ie?i.onFailure(ie):s.authenticateUserInternal(xe,o,i)})})})})},e.authenticateUserPlainUsernamePassword=function(r,i){var s=this,o={};if(o.USERNAME=this.username,o.PASSWORD=r.getPassword(),!o.PASSWORD){i.onFailure(new Error("PASSWORD parameter is required"));return}var a=new zi(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(o.DEVICE_KEY=this.deviceKey);var c=Object.keys(r.getValidationData()).length!==0?r.getValidationData():r.getClientMetadata(),u={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:o,ClientMetadata:c};this.getUserContextData(this.username)&&(u.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",u,function(d,h){return d?i.onFailure(d):s.authenticateUserInternal(h,a,i)})},e.authenticateUserInternal=function(r,i,s){var o=this,a=r.ChallengeName,c=r.ChallengeParameters;if(a==="SMS_MFA")return this.Session=r.Session,s.mfaRequired(a,c);if(a==="SELECT_MFA_TYPE")return this.Session=r.Session,s.selectMFAType(a,c);if(a==="MFA_SETUP")return this.Session=r.Session,s.mfaSetup(a,c);if(a==="SOFTWARE_TOKEN_MFA")return this.Session=r.Session,s.totpRequired(a,c);if(a==="CUSTOM_CHALLENGE")return this.Session=r.Session,s.customChallenge(c);if(a==="NEW_PASSWORD_REQUIRED"){this.Session=r.Session;var u=null,d=null,h=[],p=i.getNewPasswordRequiredChallengeUserAttributePrefix();if(c&&(u=JSON.parse(r.ChallengeParameters.userAttributes),d=JSON.parse(r.ChallengeParameters.requiredAttributes)),d)for(var y=0;y<d.length;y++)h[y]=d[y].substr(p.length);return s.newPasswordRequired(u,h)}if(a==="DEVICE_SRP_AUTH"){this.Session=r.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(r.AuthenticationResult),this.challengeName=a,this.cacheTokens();var v=r.AuthenticationResult.NewDeviceMetadata;if(v==null)return s.onSuccess(this.signInUserSession);i.generateHashDevice(r.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,r.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(w){if(w)return s.onFailure(w);var k={Salt:xt.Buffer.from(i.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:xt.Buffer.from(i.getVerifierDevices(),"hex").toString("base64")};o.verifierDevices=k.PasswordVerifier,o.deviceGroupKey=v.DeviceGroupKey,o.randomPassword=i.getRandomPassword(),o.client.request("ConfirmDevice",{DeviceKey:v.DeviceKey,AccessToken:o.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:k,DeviceName:Tg},function(C,E){return C?s.onFailure(C):(o.deviceKey=r.AuthenticationResult.NewDeviceMetadata.DeviceKey,o.cacheDeviceKeyAndPassword(),E.UserConfirmationNecessary===!0?s.onSuccess(o.signInUserSession,E.UserConfirmationNecessary):s.onSuccess(o.signInUserSession))})})},e.completeNewPasswordChallenge=function(r,i,s,o){var a=this;if(!r)return s.onFailure(new Error("New password is required."));var c=new zi(this.pool.getUserPoolName()),u=c.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};i&&Object.keys(i).forEach(function(p){d[u+p]=i[p]}),d.NEW_PASSWORD=r,d.USERNAME=this.username;var h={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:o};this.getUserContextData()&&(h.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",h,function(p,y){return p?s.onFailure(p):a.authenticateUserInternal(y,c,s)})},e.getDeviceResponse=function(r,i){var s=this,o=new zi(this.deviceGroupKey),a=new Ng,c={};c.USERNAME=this.username,c.DEVICE_KEY=this.deviceKey,o.getLargeAValue(function(u,d){u&&r.onFailure(u),c.SRP_A=d.toString(16);var h={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:c,ClientMetadata:i,Session:s.Session};s.getUserContextData()&&(h.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",h,function(p,y){if(p)return r.onFailure(p);var v=y.ChallengeParameters,w=new Be(v.SRP_B,16),k=new Be(v.SALT,16);o.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,w,k,function(C,E){if(C)return r.onFailure(C);var O=a.getNowString(),I=Fr.lib.WordArray.create(xt.Buffer.concat([xt.Buffer.from(s.deviceGroupKey,"utf8"),xt.Buffer.from(s.deviceKey,"utf8"),xt.Buffer.from(v.SECRET_BLOCK,"base64"),xt.Buffer.from(O,"utf8")])),M=Fr.lib.WordArray.create(E),Y=rf.stringify(Cu(I,M)),ee={};ee.USERNAME=s.username,ee.PASSWORD_CLAIM_SECRET_BLOCK=v.SECRET_BLOCK,ee.TIMESTAMP=O,ee.PASSWORD_CLAIM_SIGNATURE=Y,ee.DEVICE_KEY=s.deviceKey;var F={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:ee,Session:y.Session};s.getUserContextData()&&(F.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",F,function(se,H){return se?r.onFailure(se):(s.signInUserSession=s.getCognitoUserSession(H.AuthenticationResult),s.cacheTokens(),r.onSuccess(s.signInUserSession))})})})})},e.confirmRegistration=function(r,i,s,o){var a={ClientId:this.pool.getClientId(),ConfirmationCode:r,Username:this.username,ForceAliasCreation:i,ClientMetadata:o};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",a,function(c){return c?s(c,null):s(null,"SUCCESS")})},e.sendCustomChallengeAnswer=function(r,i,s){var o=this,a={};a.USERNAME=this.username,a.ANSWER=r;var c=new zi(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(a.DEVICE_KEY=this.deviceKey);var u={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:a,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(d,h){return d?i.onFailure(d):o.authenticateUserInternal(h,c,i)})},e.sendMFACode=function(r,i,s,o){var a=this,c={};c.USERNAME=this.username,c.SMS_MFA_CODE=r;var u=s||"SMS_MFA";u==="SOFTWARE_TOKEN_MFA"&&(c.SOFTWARE_TOKEN_MFA_CODE=r),this.deviceKey!=null&&(c.DEVICE_KEY=this.deviceKey);var d={ChallengeName:u,ChallengeResponses:c,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:o};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(h,p){if(h)return i.onFailure(h);var y=p.ChallengeName;if(y==="DEVICE_SRP_AUTH"){a.getDeviceResponse(i);return}if(a.signInUserSession=a.getCognitoUserSession(p.AuthenticationResult),a.cacheTokens(),p.AuthenticationResult.NewDeviceMetadata==null)return i.onSuccess(a.signInUserSession);var v=new zi(a.pool.getUserPoolName());v.generateHashDevice(p.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,p.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(w){if(w)return i.onFailure(w);var k={Salt:xt.Buffer.from(v.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:xt.Buffer.from(v.getVerifierDevices(),"hex").toString("base64")};a.verifierDevices=k.PasswordVerifier,a.deviceGroupKey=p.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,a.randomPassword=v.getRandomPassword(),a.client.request("ConfirmDevice",{DeviceKey:p.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:a.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:k,DeviceName:Tg},function(C,E){return C?i.onFailure(C):(a.deviceKey=p.AuthenticationResult.NewDeviceMetadata.DeviceKey,a.cacheDeviceKeyAndPassword(),E.UserConfirmationNecessary===!0?i.onSuccess(a.signInUserSession,E.UserConfirmationNecessary):i.onSuccess(a.signInUserSession))})})})},e.changePassword=function(r,i,s,o){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:r,ProposedPassword:i,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:o},function(a){return a?s(a,null):s(null,"SUCCESS")})},e.enableMFA=function(r){if(this.signInUserSession==null||!this.signInUserSession.isValid())return r(new Error("User is not authenticated"),null);var i=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};i.push(s),this.client.request("SetUserSettings",{MFAOptions:i,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(o){return o?r(o,null):r(null,"SUCCESS")})},e.setUserMfaPreference=function(r,i,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:r,SoftwareTokenMfaSettings:i,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(o){return o?s(o,null):s(null,"SUCCESS")})},e.disableMFA=function(r){if(this.signInUserSession==null||!this.signInUserSession.isValid())return r(new Error("User is not authenticated"),null);var i=[];this.client.request("SetUserSettings",{MFAOptions:i,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?r(s,null):r(null,"SUCCESS")})},e.deleteUser=function(r,i){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return r(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:i},function(o){return o?r(o,null):(s.clearCachedUser(),r(null,"SUCCESS"))})},e.updateAttributes=function(r,i,s){var o=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return i(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:r,ClientMetadata:s},function(a){return a?i(a,null):o.getUserData(function(){return i(null,"SUCCESS")},{bypassCache:!0})})},e.getUserAttributes=function(r){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return r(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(i,s){if(i)return r(i,null);for(var o=[],a=0;a<s.UserAttributes.length;a++){var c={Name:s.UserAttributes[a].Name,Value:s.UserAttributes[a].Value},u=new es(c);o.push(u)}return r(null,o)})},e.getMFAOptions=function(r){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return r(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(i,s){return i?r(i,null):r(null,s.MFAOptions)})},e.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},e.refreshSessionIfPossible=function(r){var i=this;return r===void 0&&(r={}),new Promise(function(s){var o=i.signInUserSession.getRefreshToken();o&&o.getToken()?i.refreshSession(o,s,r.clientMetadata):s()})},e.getUserData=function(r,i){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),r(new Error("User is not authenticated"),null);var o=this.getUserDataFromCache();if(!o){this.fetchUserData().then(function(a){r(null,a)}).catch(r);return}if(this.isFetchUserDataAndTokenRequired(i)){this.fetchUserData().then(function(a){return s.refreshSessionIfPossible(i).then(function(){return a})}).then(function(a){return r(null,a)}).catch(r);return}try{r(null,JSON.parse(o));return}catch(a){this.clearCachedUserData(),r(a,null);return}},e.getUserDataFromCache=function(){var r=this.storage.getItem(this.userDataKey);return r},e.isFetchUserDataAndTokenRequired=function(r){var i=r||{},s=i.bypassCache,o=s===void 0?!1:s;return o},e.fetchUserData=function(){var r=this;return this.createGetUserRequest().then(function(i){return r.cacheUserData(i),i})},e.deleteAttributes=function(r,i){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return i(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:r,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(o){return o?i(o,null):s.getUserData(function(){return i(null,"SUCCESS")},{bypassCache:!0})})},e.resendConfirmationCode=function(r,i){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:i};this.client.request("ResendConfirmationCode",s,function(o,a){return o?r(o,null):r(null,a)})},e.getSession=function(r,i){if(i===void 0&&(i={}),this.username==null)return r(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return r(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,o=s+".idToken",a=s+".accessToken",c=s+".refreshToken",u=s+".clockDrift";if(this.storage.getItem(o)){var d=new tf({IdToken:this.storage.getItem(o)}),h=new Zd({AccessToken:this.storage.getItem(a)}),p=new nf({RefreshToken:this.storage.getItem(c)}),y=parseInt(this.storage.getItem(u),0)||0,v={IdToken:d,AccessToken:h,RefreshToken:p,ClockDrift:y},w=new sf(v);if(w.isValid())return this.signInUserSession=w,r(null,this.signInUserSession);if(!p.getToken())return r(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(p,r,i.clientMetadata)}else r(new Error("Local storage is missing an ID Token, Please authenticate"),null)},e.refreshSession=function(r,i,s){var o=this,a=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(i):i,c={};c.REFRESH_TOKEN=r.getToken();var u="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=u+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var h=u+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(h),c.DEVICE_KEY=this.deviceKey}var p={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:c,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",p,function(y,v){if(y)return y.code==="NotAuthorizedException"&&o.clearCachedUser(),a(y,null);if(v){var w=v.AuthenticationResult;return Object.prototype.hasOwnProperty.call(w,"RefreshToken")||(w.RefreshToken=r.getToken()),o.signInUserSession=o.getCognitoUserSession(w),o.cacheTokens(),a(null,o.signInUserSession)}})},e.cacheTokens=function(){var r="CognitoIdentityServiceProvider."+this.pool.getClientId(),i=r+"."+this.username+".idToken",s=r+"."+this.username+".accessToken",o=r+"."+this.username+".refreshToken",a=r+"."+this.username+".clockDrift",c=r+".LastAuthUser";this.storage.setItem(i,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(o,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(a,""+this.signInUserSession.getClockDrift()),this.storage.setItem(c,this.username)},e.cacheUserData=function(r){this.storage.setItem(this.userDataKey,JSON.stringify(r))},e.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},e.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},e.cacheDeviceKeyAndPassword=function(){var r="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,i=r+".deviceKey",s=r+".randomPasswordKey",o=r+".deviceGroupKey";this.storage.setItem(i,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(o,this.deviceGroupKey)},e.getCachedDeviceKeyAndPassword=function(){var r="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,i=r+".deviceKey",s=r+".randomPasswordKey",o=r+".deviceGroupKey";this.storage.getItem(i)&&(this.deviceKey=this.storage.getItem(i),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(o))},e.clearCachedDeviceKeyAndPassword=function(){var r="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,i=r+".deviceKey",s=r+".randomPasswordKey",o=r+".deviceGroupKey";this.storage.removeItem(i),this.storage.removeItem(s),this.storage.removeItem(o)},e.clearCachedTokens=function(){var r="CognitoIdentityServiceProvider."+this.pool.getClientId(),i=r+"."+this.username+".idToken",s=r+"."+this.username+".accessToken",o=r+"."+this.username+".refreshToken",a=r+".LastAuthUser",c=r+"."+this.username+".clockDrift";this.storage.removeItem(i),this.storage.removeItem(s),this.storage.removeItem(o),this.storage.removeItem(a),this.storage.removeItem(c)},e.getCognitoUserSession=function(r){var i=new tf(r),s=new Zd(r),o=new nf(r),a={IdToken:i,AccessToken:s,RefreshToken:o};return new sf(a)},e.forgotPassword=function(r,i){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:i};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(o,a){return o?r.onFailure(o):typeof r.inputVerificationCode=="function"?r.inputVerificationCode(a):r.onSuccess(a)})},e.confirmPassword=function(r,i,s,o){var a={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:r,Password:i,ClientMetadata:o};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",a,function(c){return c?s.onFailure(c):s.onSuccess("SUCCESS")})},e.getAttributeVerificationCode=function(r,i,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:r,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(o,a){return o?i.onFailure(o):typeof i.inputVerificationCode=="function"?i.inputVerificationCode(a):i.onSuccess("SUCCESS")})},e.verifyAttribute=function(r,i,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:r,Code:i,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(o){return o?s.onFailure(o):s.onSuccess("SUCCESS")})},e.getDevice=function(r){if(this.signInUserSession==null||!this.signInUserSession.isValid())return r.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(i,s){return i?r.onFailure(i):r.onSuccess(s)})},e.forgetSpecificDevice=function(r,i){if(this.signInUserSession==null||!this.signInUserSession.isValid())return i.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:r},function(s){return s?i.onFailure(s):i.onSuccess("SUCCESS")})},e.forgetDevice=function(r){var i=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:r.onFailure,onSuccess:function(o){return i.deviceKey=null,i.deviceGroupKey=null,i.randomPassword=null,i.clearCachedDeviceKeyAndPassword(),r.onSuccess(o)}})},e.setDeviceStatusRemembered=function(r){if(this.signInUserSession==null||!this.signInUserSession.isValid())return r.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(i){return i?r.onFailure(i):r.onSuccess("SUCCESS")})},e.setDeviceStatusNotRemembered=function(r){if(this.signInUserSession==null||!this.signInUserSession.isValid())return r.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(i){return i?r.onFailure(i):r.onSuccess("SUCCESS")})},e.listDevices=function(r,i,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var o={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:r};i&&(o.PaginationToken=i),this.client.request("ListDevices",o,function(a,c){return a?s.onFailure(a):s.onSuccess(c)})},e.globalSignOut=function(r){var i=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return r.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?r.onFailure(s):(i.clearCachedUser(),r.onSuccess("SUCCESS"))})},e.signOut=function(r){var i=this;if(!r||typeof r!="function"){this.cleanClientData();return}this.getSession(function(s,o){if(s)return r(s);i.revokeTokens(function(a){i.cleanClientData(),r(a)})})},e.revokeTokens=function(r){if(r===void 0&&(r=function(){}),typeof r!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var i=new Error("User is not authenticated");return r(i)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return r(s)}var o=this.signInUserSession.getRefreshToken().getToken(),a=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(a)&&o)return this.revokeToken({token:o,callback:r});r()},e.isSessionRevocable=function(r){if(r&&typeof r.decodePayload=="function")try{var i=r.decodePayload(),s=i.origin_jti;return!!s}catch{}return!1},e.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},e.revokeToken=function(r){var i=r.token,s=r.callback;this.client.requestWithRetry("RevokeToken",{Token:i,ClientId:this.pool.getClientId()},function(o){if(o)return s(o);s()})},e.sendMFASelectionAnswer=function(r,i){var s=this,o={};o.USERNAME=this.username,o.ANSWER=r;var a={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:o,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,function(c,u){if(c)return i.onFailure(c);if(s.Session=u.Session,r==="SMS_MFA")return i.mfaRequired(u.ChallengeName,u.ChallengeParameters);if(r==="SOFTWARE_TOKEN_MFA")return i.totpRequired(u.ChallengeName,u.ChallengeParameters)})},e.getUserContextData=function(){var r=this.pool;return r.getUserContextData(this.username)},e.associateSoftwareToken=function(r){var i=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,o){return s?r.onFailure(s):r.associateSecretCode(o.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,o){return s?r.onFailure(s):(i.Session=o.Session,r.associateSecretCode(o.SecretCode))})},e.verifySoftwareToken=function(r,i,s){var o=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:r,FriendlyDeviceName:i},function(a,c){return a?s.onFailure(a):s.onSuccess(c)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:r,FriendlyDeviceName:i},function(a,c){if(a)return s.onFailure(a);o.Session=c.Session;var u={};u.USERNAME=o.username;var d={ChallengeName:"MFA_SETUP",ClientId:o.pool.getClientId(),ChallengeResponses:u,Session:o.Session};o.getUserContextData()&&(d.UserContextData=o.getUserContextData()),o.client.request("RespondToAuthChallenge",d,function(h,p){return h?s.onFailure(h):(o.signInUserSession=o.getCognitoUserSession(p.AuthenticationResult),o.cacheTokens(),s.onSuccess(o.signInUserSession))})})},t}();function wx(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,s=[],o=[],a={},c=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:c,headers:{keys:function(){return s},entries:function(){return o},get:function(d){return a[d.toLowerCase()]},has:function(d){return d.toLowerCase()in a}}}};for(var u in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,h,p){s.push(h=h.toLowerCase()),o.push([h,p]),a[h]=a[h]?a[h]+","+p:p}),n(c())},i.onerror=r,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(u,e.headers[u]);i.send(e.body||null)})}const _x=Object.freeze(Object.defineProperty({__proto__:null,default:wx},Symbol.toStringTag,{value:"Module"})),Og=ws(_x);var Jl,Ig;function Sx(){return Ig||(Ig=1,Jl=self.fetch||(self.fetch=Og.default||Og)),Jl}Sx();var kx="5.0.4";/*!
|
|
69
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
70
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
71
|
-
*/var af="aws-amplify/"+kx,ci={userAgent:af+" js",product:"",navigator:null,isReactNative:!1};if(typeof navigator!="undefined"&&navigator.product)switch(ci.product=navigator.product||"",ci.navigator=navigator||null,navigator.product){case"ReactNative":ci.userAgent=af+" react-native",ci.isReactNative=!0;break;default:ci.userAgent=af+" js",ci.isReactNative=!1;break}var Ex=function(){return ci.userAgent};function _b(){}_b.prototype.userAgent=Ex();function Ax(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,jo(t,e)}function uf(t){var e=typeof Map=="function"?new Map:void 0;return uf=function(r){if(r===null||!xx(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return cu(r,arguments,cf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),jo(i,r)},uf(t)}function cu(t,e,n){return Cx()?cu=Reflect.construct.bind():cu=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),u=new c;return o&&jo(u,o.prototype),u},cu.apply(null,arguments)}function Cx(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xx(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function jo(t,e){return jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jo(t,e)}function cf(t){return cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cf(t)}var Nx=function(t){Ax(e,t);function e(n,r,i,s){var o;return o=t.call(this,n)||this,o.code=r,o.name=i,o.statusCode=s,o}return e}(uf(Error)),Tx=function(){function t(n,r,i){this.endpoint=r||"https://cognito-idp."+n+".amazonaws.com/";var s=i||{},o=s.credentials;this.fetchOptions=o?{credentials:o}:{}}var e=t.prototype;return e.promisifyRequest=function(r,i){var s=this;return new Promise(function(o,a){s.request(r,i,function(c,u){c?a(new Nx(c.message,c.code,c.name,c.statusCode)):o(u)})})},e.requestWithRetry=function(r,i,s){var o=this,a=5*1e3;Rx(function(c){return new Promise(function(u,d){o.request(r,c,function(h,p){h?d(h):u(p)})})},[i],a).then(function(c){return s(null,c)}).catch(function(c){return s(c)})},e.request=function(r,i,s){var o={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+r,"X-Amz-User-Agent":_b.prototype.userAgent,"Cache-Control":"no-store"},a=Object.assign({},this.fetchOptions,{headers:o,method:"POST",mode:"cors",body:JSON.stringify(i)}),c;fetch(this.endpoint,a).then(function(u){return c=u,u},function(u){throw u instanceof TypeError?new Error("Network error"):u}).then(function(u){return u.json().catch(function(){return{}})}).then(function(u){if(c.ok)return s(null,u);var d=(u.__type||u.code).split("#").pop(),h=new Error(u.message||u.Message||null);return h.name=d,h.code=d,s(h)}).catch(function(u){if(c&&c.headers&&c.headers.get("x-amzn-errortype"))try{var d=c.headers.get("x-amzn-errortype").split(":")[0],h=new Error(c.status?c.status.toString():null);return h.code=d,h.name=d,h.statusCode=c.status,s(h)}catch{return s(u)}else u instanceof Error&&u.message==="Network error"&&(u.code="NetworkError");return s(u)})},t}(),Va={debug:function(){}},Ox=function(e){var n="nonRetryable";return e&&e[n]};function Sb(t,e,n,r){if(r===void 0&&(r=1),typeof t!="function")throw Error("functionToRetry must be a function");return Va.debug(t.name+" attempt #"+r+" with args: "+JSON.stringify(e)),t.apply(void 0,e).catch(function(i){if(Va.debug("error on "+t.name,i),Ox(i))throw Va.debug(t.name+" non retryable error",i),i;var s=n(r,e,i);if(Va.debug(t.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(o){return setTimeout(o,s)}).then(function(){return Sb(t,e,n,r+1)});throw i})}function Ix(t){var e=100,n=100;return function(r){var i=Math.pow(2,r)*e+n*Math.random();return i>t?!1:i}}function Rx(t,e,n){return Sb(t,e,Ix(n))}/*!
|
|
72
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
73
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
74
|
-
*/var Px=55,Dx=function(){function t(n,r){var i=n||{},s=i.UserPoolId,o=i.ClientId,a=i.endpoint,c=i.fetchOptions,u=i.AdvancedSecurityDataCollectionFlag;if(!s||!o)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>Px||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var d=s.split("_")[0];this.userPoolId=s,this.clientId=o,this.client=new Tx(d,a,c),this.advancedSecurityDataCollectionFlag=u!==!1,this.storage=n.Storage||new wb().getStorage(),r&&(this.wrapRefreshSessionCallback=r)}var e=t.prototype;return e.getUserPoolId=function(){return this.userPoolId},e.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},e.getClientId=function(){return this.clientId},e.signUp=function(r,i,s,o,a,c){var u=this,d={ClientId:this.clientId,Username:r,Password:i,UserAttributes:s,ValidationData:o,ClientMetadata:c};this.getUserContextData(r)&&(d.UserContextData=this.getUserContextData(r)),this.client.request("SignUp",d,function(h,p){if(h)return a(h,null);var y={Username:r,Pool:u,Storage:u.storage},v={user:new of(y),userConfirmed:p.UserConfirmed,userSub:p.UserSub,codeDeliveryDetails:p.CodeDeliveryDetails};return a(null,v)})},e.getCurrentUser=function(){var r="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",i=this.storage.getItem(r);if(i){var s={Username:i,Pool:this,Storage:this.storage};return new of(s)}return null},e.getUserContextData=function(r){if(typeof AmazonCognitoAdvancedSecurityData!="undefined"){var i=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=i.getData(r,this.userPoolId,this.clientId);if(s){var o={EncodedData:s};return o}}return{}}},t}(),Xl={exports:{}};/*!
|
|
75
|
-
* JavaScript Cookie v2.2.1
|
|
76
|
-
* https://github.com/js-cookie/js-cookie
|
|
77
|
-
*
|
|
78
|
-
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
79
|
-
* Released under the MIT license
|
|
80
|
-
*/var Rg;function Fx(){return Rg||(Rg=1,function(t,e){(function(n){var r;if(t.exports=n(),r=!0,!r){var i=window.Cookies,s=window.Cookies=n();s.noConflict=function(){return window.Cookies=i,s}}})(function(){function n(){for(var s=0,o={};s<arguments.length;s++){var a=arguments[s];for(var c in a)o[c]=a[c]}return o}function r(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function i(s){function o(){}function a(u,d,h){if(typeof document!="undefined"){h=n({path:"/"},o.defaults,h),typeof h.expires=="number"&&(h.expires=new Date(new Date*1+h.expires*864e5)),h.expires=h.expires?h.expires.toUTCString():"";try{var p=JSON.stringify(d);/^[\{\[]/.test(p)&&(d=p)}catch{}d=s.write?s.write(d,u):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),u=encodeURIComponent(String(u)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var y="";for(var v in h)h[v]&&(y+="; "+v,h[v]!==!0&&(y+="="+h[v].split(";")[0]));return document.cookie=u+"="+d+y}}function c(u,d){if(typeof document!="undefined"){for(var h={},p=document.cookie?document.cookie.split("; "):[],y=0;y<p.length;y++){var v=p[y].split("="),w=v.slice(1).join("=");!d&&w.charAt(0)==='"'&&(w=w.slice(1,-1));try{var k=r(v[0]);if(w=(s.read||s)(w,k)||r(w),d)try{w=JSON.parse(w)}catch{}if(h[k]=w,u===k)break}catch{}}return u?h[u]:h}}return o.set=a,o.get=function(u){return c(u,!1)},o.getJSON=function(u){return c(u,!0)},o.remove=function(u,d){a(u,"",n(d,{expires:-1}))},o.defaults={},o.withConverter=i,o}return i(function(){})})}(Xl)),Xl.exports}var so=Fx(),Ux=function(){function t(n){if(n.domain)this.domain=n.domain;else throw new Error("The domain of cookieStorage can not be undefined.");if(n.path?this.path=n.path:this.path="/",Object.prototype.hasOwnProperty.call(n,"expires")?this.expires=n.expires:this.expires=365,Object.prototype.hasOwnProperty.call(n,"secure")?this.secure=n.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(n,"sameSite")){if(!["strict","lax","none"].includes(n.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(n.sameSite==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=n.sameSite}else this.sameSite=null}var e=t.prototype;return e.setItem=function(r,i){var s={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(s.sameSite=this.sameSite),so.set(r,i,s),so.get(r)},e.getItem=function(r){return so.get(r)},e.removeItem=function(r){var i={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(i.sameSite=this.sameSite),so.remove(r,i)},e.clear=function(){for(var r=so.get(),i=Object.keys(r).length,s=0;s<i;++s)this.removeItem(Object.keys(r)[s]);return{}},t}(),Lx="_self",Mx=function(t){var e=window.open(t,Lx);return e?Promise.resolve(e):Promise.reject()},Bx=function(t){window.sessionStorage.setItem("oauth_state",t)},$x=function(){var t=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),t},jx=function(t){window.sessionStorage.setItem("ouath_pkce_key",t)},Vx=function(){var t=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),t},rn=function(){return rn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},rn.apply(this,arguments)},qa=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},Ha=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},si=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},qx=typeof Symbol!="undefined"&&typeof Symbol.for=="function"?Symbol.for("amplify_default"):"@@amplify_default",Ql=function(t,e,n){Nr.dispatch("auth",{event:t,data:e,message:n},"Auth",qx)},Gi=new $n("OAuth"),Hx=function(){function t(e){var n=e.config,r=e.cognitoClientId,i=e.scopes,s=i===void 0?[]:i;if(this._urlOpener=n.urlOpener||Mx,this._config=n,this._cognitoClientId=r,!this.isValidScopes(s))throw Error("scopes must be a String Array");this._scopes=s}return t.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every(function(n){return typeof n=="string"})},t.prototype.oauthSignIn=function(e,n,r,i,s,o){e===void 0&&(e="code"),s===void 0&&(s=Au.Cognito);var a=this._generateState(32),c=o?a+"-"+nk(o):a;Bx(c);var u=this._generateRandom(128);jx(u);var d=this._generateChallenge(u),h="S256",p=this._scopes.join(" "),y=Object.entries(rn(rn({redirect_uri:r,response_type:e,client_id:i,identity_provider:s,scope:p,state:c},e==="code"?{code_challenge:d}:{}),e==="code"?{code_challenge_method:h}:{})).map(function(w){var k=si(w,2),C=k[0],E=k[1];return encodeURIComponent(C)+"="+encodeURIComponent(E)}).join("&"),v="https://"+n+"/oauth2/authorize?"+y;Gi.debug("Redirecting to "+v),this._urlOpener(v,r)},t.prototype._handleCodeFlow=function(e){return qa(this,void 0,void 0,function(){var n,r,i,s,o,a,c,u,d,h,p,y,v,w;return Ha(this,function(k){switch(k.label){case 0:return n=(Tr.parse(e).query||"").split("&").map(function(C){return C.split("=")}).reduce(function(C,E){var O,I=si(E,2),M=I[0],Y=I[1];return rn(rn({},C),(O={},O[M]=Y,O))},{code:void 0}).code,r=Tr.parse(e).pathname||"/",i=Tr.parse(this._config.redirectSignIn).pathname||"/",!n||r!==i?[2]:(s="https://"+this._config.domain+"/oauth2/token",Ql("codeFlow",{},"Retrieving tokens from "+s),o=mi(this._config)?this._cognitoClientId:this._config.clientID,a=mi(this._config)?this._config.redirectSignIn:this._config.redirectUri,c=Vx(),u=rn({grant_type:"authorization_code",code:n,client_id:o,redirect_uri:a},c?{code_verifier:c}:{}),Gi.debug("Calling token endpoint: "+s+" with",u),d=Object.entries(u).map(function(C){var E=si(C,2),O=E[0],I=E[1];return encodeURIComponent(O)+"="+encodeURIComponent(I)}).join("&"),[4,fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d})]);case 1:return[4,k.sent().json()];case 2:if(h=k.sent(),p=h.access_token,y=h.refresh_token,v=h.id_token,w=h.error,w)throw new Error(w);return[2,{accessToken:p,refreshToken:y,idToken:v}]}})})},t.prototype._handleImplicitFlow=function(e){return qa(this,void 0,void 0,function(){var n,r,i;return Ha(this,function(s){return n=(Tr.parse(e).hash||"#").substr(1).split("&").map(function(o){return o.split("=")}).reduce(function(o,a){var c,u=si(a,2),d=u[0],h=u[1];return rn(rn({},o),(c={},c[d]=h,c))},{id_token:void 0,access_token:void 0}),r=n.id_token,i=n.access_token,Ql("implicitFlow",{},"Got tokens from "+e),Gi.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:i,idToken:r,refreshToken:null}]})})},t.prototype.handleAuthResponse=function(e){return qa(this,void 0,void 0,function(){var n,r,i,s,o,a,c;return Ha(this,function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),n=e?rn(rn({},(Tr.parse(e).hash||"#").substr(1).split("&").map(function(d){return d.split("=")}).reduce(function(d,h){var p=si(h,2),y=p[0],v=p[1];return d[y]=v,d},{})),(Tr.parse(e).query||"").split("&").map(function(d){return d.split("=")}).reduce(function(d,h){var p=si(h,2),y=p[0],v=p[1];return d[y]=v,d},{})):{},r=n.error,i=n.error_description,r)throw new Error(i);return s=this._validateState(n),Gi.debug("Starting "+this._config.responseType+" flow with "+e),this._config.responseType!=="code"?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,rn.apply(void 0,[rn.apply(void 0,o.concat([u.sent()])),{state:s}])];case 2:return a=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,rn.apply(void 0,[rn.apply(void 0,a.concat([u.sent()])),{state:s}])];case 4:return[3,6];case 5:throw c=u.sent(),Gi.error("Error handling auth response.",c),c;case 6:return[2]}})})},t.prototype._validateState=function(e){if(e){var n=$x(),r=e.state;if(n&&n!==r)throw new Error("Invalid state in OAuth flow");return r}},t.prototype.signOut=function(){return qa(this,void 0,void 0,function(){var e,n,r;return Ha(this,function(i){return e="https://"+this._config.domain+"/logout?",n=mi(this._config)?this._cognitoClientId:this._config.oauth.clientID,r=mi(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:n,logout_uri:encodeURIComponent(r)}).map(function(s){var o=si(s,2),a=o[0],c=o[1];return a+"="+c}).join("&"),Ql("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Gi.debug("Signing out from "+e),[2,this._urlOpener(e,r)]})})},t.prototype._generateState=function(e){for(var n="",r=e,i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";r>0;--r)n+=i[Math.round(Math.random()*(i.length-1))];return n},t.prototype._generateChallenge=function(e){return this._base64URL(yb(e))},t.prototype._base64URL=function(e){return e.toString(rf).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},t.prototype._generateRandom=function(e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=new Uint8Array(e);if(typeof window!="undefined"&&window.crypto)window.crypto.getRandomValues(r);else for(var i=0;i<e;i+=1)r[i]=Math.random()*n.length|0;return this._bufferToString(r)},t.prototype._bufferToString=function(e){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[],i=0;i<e.byteLength;i+=1){var s=e[i]%n.length;r.push(n[s])}return r.join("")},t}();const Kx=function(t){if(ur().isBrowser&&window.location){var e=window.location.href;t({url:e})}else if(!ur().isNode)throw new Error("Not supported")};var Ht;(function(t){t.DEFAULT_MSG="Authentication Error",t.EMPTY_EMAIL="Email cannot be empty",t.EMPTY_PHONE="Phone number cannot be empty",t.EMPTY_USERNAME="Username cannot be empty",t.INVALID_USERNAME="The username should either be a string or one of the sign in types",t.EMPTY_PASSWORD="Password cannot be empty",t.EMPTY_CODE="Confirmation code cannot be empty",t.SIGN_UP_ERROR="Error creating account",t.NO_MFA="No valid MFA method provided",t.INVALID_MFA="Invalid MFA type",t.EMPTY_CHALLENGE="Challenge response cannot be empty",t.NO_USER_SESSION="Failed to get the session because the user is empty",t.NETWORK_ERROR="Network Error",t.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",t.AUTOSIGNIN_ERROR="Please use your credentials to sign in"})(Ht||(Ht={}));var kb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zx=new $n("AuthError"),xr=function(t){kb(e,t);function e(n){var r=this,i=Wx[n],s=i.message,o=i.log;return r=t.call(this,s)||this,r.constructor=e,Object.setPrototypeOf(r,e.prototype),r.name="AuthError",r.log=o||s,zx.error(r.log),r}return e}(Error),Gx=function(t){kb(e,t);function e(n){var r=t.call(this,n)||this;return r.constructor=e,Object.setPrototypeOf(r,e.prototype),r.name="NoUserPoolError",r}return e}(xr),Wx={noConfig:{message:Ht.DEFAULT_MSG,log:`
|
|
81
|
-
Error: Amplify has not been configured correctly.
|
|
82
|
-
This error is typically caused by one of the following scenarios:
|
|
83
|
-
|
|
84
|
-
1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point
|
|
85
|
-
See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information
|
|
86
|
-
|
|
87
|
-
2. There might be multiple conflicting versions of amplify packages in your node_modules.
|
|
88
|
-
Refer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)
|
|
89
|
-
`},missingAuthConfig:{message:Ht.DEFAULT_MSG,log:`
|
|
90
|
-
Error: Amplify has not been configured correctly.
|
|
91
|
-
The configuration object is missing required auth properties.
|
|
92
|
-
This error is typically caused by one of the following scenarios:
|
|
93
|
-
|
|
94
|
-
1. Did you run \`amplify push\` after adding auth via \`amplify add auth\`?
|
|
95
|
-
See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information
|
|
96
|
-
|
|
97
|
-
2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.
|
|
98
|
-
`},emptyUsername:{message:Ht.EMPTY_USERNAME},invalidUsername:{message:Ht.INVALID_USERNAME},emptyPassword:{message:Ht.EMPTY_PASSWORD},emptyCode:{message:Ht.EMPTY_CODE},signUpError:{message:Ht.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:Ht.NO_MFA},invalidMFA:{message:Ht.INVALID_MFA},emptyChallengeResponse:{message:Ht.EMPTY_CHALLENGE},noUserSession:{message:Ht.NO_USER_SESSION},deviceConfig:{message:Ht.DEVICE_CONFIG},networkError:{message:Ht.NETWORK_ERROR},autoSignInError:{message:Ht.AUTOSIGNIN_ERROR},default:{message:Ht.DEFAULT_MSG}},xu=function(){return xu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xu.apply(this,arguments)},wt=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},_t=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Pg=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},ye=new $n("AuthClass"),Dg="aws.cognito.signin.user.admin",Yx=10*1e3,Jx=typeof Symbol!="undefined"&&typeof Symbol.for=="function"?Symbol.for("amplify_default"):"@@amplify_default",ht=function(t,e,n){Nr.dispatch("auth",{event:t,data:e,message:n},"Auth",Jx)},Xx=60,Qx=3*60*1e3,Zx=function(){function t(e){var n=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.autoSignInInitiated=!1,this.Credentials=gb,this.wrapRefreshSessionCallback=function(r){var i=function(s,o){return o?ht("tokenRefresh",void 0,"New token retrieved"):ht("tokenRefresh_failure",s,"Failed to retrieve new token"),r(s,o)};return i},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),Nr.listen("auth",function(r){var i=r.payload,s=i.event;switch(s){case"signIn":n._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":n._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":n._storage.setItem("amplify-signin-with-hostedUI","true");break}})}return t.prototype.getModuleName=function(){return"Auth"},t.prototype.configure=function(e){var n=this;if(!e)return this._config||{};ye.debug("configure Auth");var r=Object.assign({},this._config,ok.parseMobilehubConfig(e).Auth,e);this._config=r;var i=this._config,s=i.userPoolId,o=i.userPoolWebClientId,a=i.cookieStorage,c=i.oauth,u=i.region,d=i.identityPoolId,h=i.mandatorySignIn,p=i.refreshHandlers,y=i.identityPoolRegion,v=i.clientMetadata,w=i.endpoint;if(!this._config.storage)a?this._storage=new Ux(a):this._storage=e.ssr?new Z1:new ib().getStorage();else{if(!this._isValidAuthStorage(this._config.storage))throw ye.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}if(this._storageSync=Promise.resolve(),typeof this._storage.sync=="function"&&(this._storageSync=this._storage.sync()),s){var k={UserPoolId:s,ClientId:o,endpoint:w};k.Storage=this._storage,this.userPool=new Dx(k,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:h,region:y||u,userPoolId:s,identityPoolId:d,refreshHandlers:p,storage:this._storage});var C=c?mi(this._config.oauth)?c:c.awsCognito:void 0;if(C){var E=Object.assign({cognitoClientId:o,UserPoolId:s,domain:C.domain,scopes:C.scope,redirectSignIn:C.redirectSignIn,redirectSignOut:C.redirectSignOut,responseType:C.responseType,Storage:this._storage,urlOpener:C.urlOpener,clientMetadata:v},C.options);this._oAuthHandler=new Hx({scopes:E.scopes,config:E,cognitoClientId:E.cognitoClientId});var O={};Kx(function(M){var Y=M.url;O[Y]||(O[Y]=!0,n._handleAuthResponse(Y))})}if(ht("configured",null,"The Auth category has been configured successfully"),!this.autoSignInInitiated&&typeof this._storage.getItem=="function"){var I=this.isTrueStorageValue("amplify-polling-started");I&&(ht("autoSignIn_failure",null,gt.AutoSignInError),this._storage.removeItem("amplify-auto-sign-in")),this._storage.removeItem("amplify-polling-started")}return this._config},t.prototype.signUp=function(e){for(var n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s,o,a;if(!this.userPool)return this.rejectNoUserPool();var c=null,u=null,d=[],h=null,p,y={enabled:!1},v={},w={};if(e&&typeof e=="string"){c=e,u=r?r[0]:null;var k=r?r[1]:null,C=r?r[2]:null;k&&d.push(new es({Name:"email",Value:k})),C&&d.push(new es({Name:"phone_number",Value:C}))}else if(e&&typeof e=="object"){c=e.username,u=e.password,e&&e.clientMetadata?p=e.clientMetadata:this._config.clientMetadata&&(p=this._config.clientMetadata);var E=e.attributes;E&&Object.keys(E).map(function(I){d.push(new es({Name:I,Value:E[I]}))});var O=e.validationData;O&&(h=[],Object.keys(O).map(function(I){h.push(new es({Name:I,Value:O[I]}))})),y=(s=e.autoSignIn)!==null&&s!==void 0?s:{enabled:!1},y.enabled&&(this._storage.setItem("amplify-auto-sign-in","true"),v=(o=y.validationData)!==null&&o!==void 0?o:{},w=(a=y.clientMetaData)!==null&&a!==void 0?a:{})}else return this.rejectAuthError(gt.SignUpError);return c?u?(ye.debug("signUp attrs:",d),ye.debug("signUp validation data:",h),new Promise(function(I,M){n.userPool.signUp(c,u,d,h,function(Y,ee){Y?(ht("signUp_failure",Y,c+" failed to signup"),M(Y)):(ht("signUp",ee,c+" has signed up successfully"),y.enabled&&n.handleAutoSignIn(c,u,v,w,ee),I(ee))},p)})):this.rejectAuthError(gt.EmptyPassword):this.rejectAuthError(gt.EmptyUsername)},t.prototype.handleAutoSignIn=function(e,n,r,i,s){this.autoSignInInitiated=!0;var o=new pg({Username:e,Password:n,ValidationData:r,ClientMetadata:i});s.userConfirmed?this.signInAfterUserConfirmed(o):this._config.signUpVerificationMethod==="link"?this.handleLinkAutoSignIn(o):this.handleCodeAutoSignIn(o)},t.prototype.handleCodeAutoSignIn=function(e){var n=this,r=function(i){var s=i.payload;s.event==="confirmSignUp"&&n.signInAfterUserConfirmed(e,r)};Nr.listen("auth",r)},t.prototype.handleLinkAutoSignIn=function(e){var n=this;this._storage.setItem("amplify-polling-started","true");var r=Date.now(),i=setInterval(function(){Date.now()-r>Qx?(clearInterval(i),ht("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),n._storage.removeItem("amplify-auto-sign-in")):n.signInAfterUserConfirmed(e,null,i)},5e3)},t.prototype.signInAfterUserConfirmed=function(e,n,r){return wt(this,void 0,void 0,function(){var i,s,o=this;return _t(this,function(a){switch(a.label){case 0:i=this.createCognitoUser(e.getUsername()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.authenticateUser(e,this.authCallbacks(i,function(c){ht("autoSignIn",c,e.getUsername()+" has signed in successfully"),n&&Nr.remove("auth",n),r&&(clearInterval(r),o._storage.removeItem("amplify-polling-started")),o._storage.removeItem("amplify-auto-sign-in")},function(c){ye.error(c),o._storage.removeItem("amplify-auto-sign-in")}))];case 2:return a.sent(),[3,4];case 3:return s=a.sent(),ye.error(s),[3,4];case 4:return[2]}})})},t.prototype.confirmSignUp=function(e,n,r){var i=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(gt.EmptyUsername);if(!n)return this.rejectAuthError(gt.EmptyCode);var s=this.createCognitoUser(e),o=r&&typeof r.forceAliasCreation=="boolean"?r.forceAliasCreation:!0,a;return r&&r.clientMetadata?a=r.clientMetadata:this._config.clientMetadata&&(a=this._config.clientMetadata),new Promise(function(c,u){s.confirmRegistration(n,o,function(d,h){if(d)u(d);else{ht("confirmSignUp",h,e+" has been confirmed successfully");var p=i.isTrueStorageValue("amplify-auto-sign-in");p&&!i.autoSignInInitiated&&(ht("autoSignIn_failure",null,gt.AutoSignInError),i._storage.removeItem("amplify-auto-sign-in")),c(h)}},a)})},t.prototype.isTrueStorageValue=function(e){var n=this._storage.getItem(e);return n?n==="true":!1},t.prototype.resendSignUp=function(e,n){if(n===void 0&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(gt.EmptyUsername);var r=this.createCognitoUser(e);return new Promise(function(i,s){r.resendConfirmationCode(function(o,a){o?s(o):i(a)},n)})},t.prototype.signIn=function(e,n,r){if(r===void 0&&(r=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var i=null,s=null,o={};if(typeof e=="string")i=e,s=n;else if(nC(e))typeof n!="undefined"&&ye.warn("The password should be defined under the first parameter object!"),i=e.username,s=e.password,o=e.validationData;else return this.rejectAuthError(gt.InvalidUsername);if(!i)return this.rejectAuthError(gt.EmptyUsername);var a=new pg({Username:i,Password:s,ValidationData:o,ClientMetadata:r});return s?this.signInWithPassword(a):this.signInWithoutPassword(a)},t.prototype.authCallbacks=function(e,n,r){var i=this,s=this;return{onSuccess:function(o){return wt(i,void 0,void 0,function(){var a,c,u,d;return _t(this,function(h){switch(h.label){case 0:ye.debug(o),delete e.challengeName,delete e.challengeParam,h.label=1;case 1:return h.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return h.sent(),[4,this.Credentials.set(o,"session")];case 3:return a=h.sent(),ye.debug("succeed to get cognito credentials",a),[3,9];case 4:return c=h.sent(),ye.debug("cannot get cognito credentials",c),[3,9];case 5:return h.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return u=h.sent(),s.user=u,ht("signIn",u,"A user "+e.getUsername()+" has been signed in"),n(u),[3,8];case 7:return d=h.sent(),ye.error("Failed to get the signed in user",d),r(d),[3,8];case 8:return[7];case 9:return[2]}})})},onFailure:function(o){ye.debug("signIn failure",o),ht("signIn_failure",o,e.getUsername()+" failed to signin"),r(o)},customChallenge:function(o){ye.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=o,n(e)},mfaRequired:function(o,a){ye.debug("signIn MFA required"),e.challengeName=o,e.challengeParam=a,n(e)},mfaSetup:function(o,a){ye.debug("signIn mfa setup",o),e.challengeName=o,e.challengeParam=a,n(e)},newPasswordRequired:function(o,a){ye.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:o,requiredAttributes:a},n(e)},totpRequired:function(o,a){ye.debug("signIn totpRequired"),e.challengeName=o,e.challengeParam=a,n(e)},selectMFAType:function(o,a){ye.debug("signIn selectMFAType",o),e.challengeName=o,e.challengeParam=a,n(e)}}},t.prototype.signInWithPassword=function(e){var n=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var r=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise(function(i,s){r.authenticateUser(e,n.authCallbacks(r,function(o){n.pendingSignIn=null,i(o)},function(o){n.pendingSignIn=null,s(o)}))}),this.pendingSignIn},t.prototype.signInWithoutPassword=function(e){var n=this,r=this.createCognitoUser(e.getUsername());return r.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise(function(i,s){r.initiateAuth(e,n.authCallbacks(r,i,s))})},t.prototype.getMFAOptions=function(e){return new Promise(function(n,r){e.getMFAOptions(function(i,s){if(i){ye.debug("get MFA Options failed",i),r(i);return}ye.debug("get MFA options success",s),n(s)})})},t.prototype.getPreferredMFA=function(e,n){var r=this,i=this;return new Promise(function(s,o){var a=r._config.clientMetadata,c=n?n.bypassCache:!1;e.getUserData(function(u,d){return wt(r,void 0,void 0,function(){var h,p;return _t(this,function(y){switch(y.label){case 0:if(!u)return[3,5];if(ye.debug("getting preferred mfa failed",u),!this.isSessionInvalid(u))return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return y.sent(),[3,4];case 3:return h=y.sent(),o(new Error("Session is invalid due to: "+u.message+" and failed to clean up invalid session: "+h.message)),[2];case 4:return o(u),[2];case 5:return p=i._getMfaTypeFromUserData(d),p?(s(p),[2]):(o("invalid MFA Type"),[2])}})})},{bypassCache:c,clientMetadata:a})})},t.prototype._getMfaTypeFromUserData=function(e){var n=null,r=e.PreferredMfaSetting;if(r)n=r;else{var i=e.UserMFASettingList;if(i)i.length===0?n="NOMFA":ye.debug("invalid case for getPreferredMFA",e);else{var s=e.MFAOptions;s?n="SMS_MFA":n="NOMFA"}}return n},t.prototype._getUserData=function(e,n){var r=this;return new Promise(function(i,s){e.getUserData(function(o,a){return wt(r,void 0,void 0,function(){var c;return _t(this,function(u){switch(u.label){case 0:if(!o)return[3,5];if(ye.debug("getting user data failed",o),!this.isSessionInvalid(o))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return u.sent(),[3,4];case 3:return c=u.sent(),s(new Error("Session is invalid due to: "+o.message+" and failed to clean up invalid session: "+c.message)),[2];case 4:return s(o),[2];case 5:i(a),u.label=6;case 6:return[2]}})})},n)})},t.prototype.setPreferredMFA=function(e,n){return wt(this,void 0,void 0,function(){var r,i,s,o,a,c,u,d=this;return _t(this,function(h){switch(h.label){case 0:return r=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:r})];case 1:switch(i=h.sent(),s=null,o=null,a=n,a){case"TOTP":return[3,2];case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":return[3,3];case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return s={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return c=i.UserMFASettingList,[4,this._getMfaTypeFromUserData(i)];case 5:if(u=h.sent(),u==="NOMFA")return[2,Promise.resolve("No change for mfa type")];if(u==="SMS_MFA")s={PreferredMfa:!1,Enabled:!1};else if(u==="SOFTWARE_TOKEN_MFA")o={PreferredMfa:!1,Enabled:!1};else return[2,this.rejectAuthError(gt.InvalidMFA)];return c&&c.length!==0&&c.forEach(function(p){p==="SMS_MFA"?s={PreferredMfa:!1,Enabled:!1}:p==="SOFTWARE_TOKEN_MFA"&&(o={PreferredMfa:!1,Enabled:!1})}),[3,7];case 6:return ye.debug("no validmfa method provided"),[2,this.rejectAuthError(gt.NoMFA)];case 7:return[2,new Promise(function(p,y){e.setUserMfaPreference(s,o,function(v,w){if(v)return ye.debug("Set user mfa preference error",v),y(v);ye.debug("Set user mfa success",w),ye.debug("Caching the latest user data into local"),e.getUserData(function(k,C){return wt(d,void 0,void 0,function(){var E;return _t(this,function(O){switch(O.label){case 0:if(!k)return[3,5];if(ye.debug("getting user data failed",k),!this.isSessionInvalid(k))return[3,4];O.label=1;case 1:return O.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return O.sent(),[3,4];case 3:return E=O.sent(),y(new Error("Session is invalid due to: "+k.message+" and failed to clean up invalid session: "+E.message)),[2];case 4:return[2,y(k)];case 5:return[2,p(w)]}})})},{bypassCache:!0,clientMetadata:r})})})]}})})},t.prototype.disableSMS=function(e){return new Promise(function(n,r){e.disableMFA(function(i,s){if(i){ye.debug("disable mfa failed",i),r(i);return}ye.debug("disable mfa succeed",s),n(s)})})},t.prototype.enableSMS=function(e){return new Promise(function(n,r){e.enableMFA(function(i,s){if(i){ye.debug("enable mfa failed",i),r(i);return}ye.debug("enable mfa succeed",s),n(s)})})},t.prototype.setupTOTP=function(e){return new Promise(function(n,r){e.associateSoftwareToken({onFailure:function(i){ye.debug("associateSoftwareToken failed",i),r(i)},associateSecretCode:function(i){ye.debug("associateSoftwareToken sucess",i),n(i)}})})},t.prototype.verifyTotpToken=function(e,n){return ye.debug("verification totp token",e,n),new Promise(function(r,i){e.verifySoftwareToken(n,"My TOTP device",{onFailure:function(s){ye.debug("verifyTotpToken failed",s),i(s)},onSuccess:function(s){ht("signIn",e,"A user "+e.getUsername()+" has been signed in"),ye.debug("verifyTotpToken success",s),r(s)}})})},t.prototype.confirmSignIn=function(e,n,r,i){var s=this;if(i===void 0&&(i=this._config.clientMetadata),!n)return this.rejectAuthError(gt.EmptyCode);var o=this;return new Promise(function(a,c){e.sendMFACode(n,{onSuccess:function(u){return wt(s,void 0,void 0,function(){var d,h;return _t(this,function(p){switch(p.label){case 0:ye.debug(u),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return p.sent(),[4,this.Credentials.set(u,"session")];case 3:return d=p.sent(),ye.debug("succeed to get cognito credentials",d),[3,6];case 4:return h=p.sent(),ye.debug("cannot get cognito credentials",h),[3,6];case 5:return o.user=e,ht("signIn",e,"A user "+e.getUsername()+" has been signed in"),a(e),[7];case 6:return[2]}})})},onFailure:function(u){ye.debug("confirm signIn failure",u),c(u)}},r,i)})},t.prototype.completeNewPassword=function(e,n,r,i){var s=this;if(r===void 0&&(r={}),i===void 0&&(i=this._config.clientMetadata),!n)return this.rejectAuthError(gt.EmptyPassword);var o=this;return new Promise(function(a,c){e.completeNewPasswordChallenge(n,r,{onSuccess:function(u){return wt(s,void 0,void 0,function(){var d,h;return _t(this,function(p){switch(p.label){case 0:ye.debug(u),p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return p.sent(),[4,this.Credentials.set(u,"session")];case 3:return d=p.sent(),ye.debug("succeed to get cognito credentials",d),[3,6];case 4:return h=p.sent(),ye.debug("cannot get cognito credentials",h),[3,6];case 5:return o.user=e,ht("signIn",e,"A user "+e.getUsername()+" has been signed in"),a(e),[7];case 6:return[2]}})})},onFailure:function(u){ye.debug("completeNewPassword failure",u),ht("completeNewPassword_failure",u,s.user+" failed to complete the new password flow"),c(u)},mfaRequired:function(u,d){ye.debug("signIn MFA required"),e.challengeName=u,e.challengeParam=d,a(e)},mfaSetup:function(u,d){ye.debug("signIn mfa setup",u),e.challengeName=u,e.challengeParam=d,a(e)},totpRequired:function(u,d){ye.debug("signIn mfa setup",u),e.challengeName=u,e.challengeParam=d,a(e)}},i)})},t.prototype.sendCustomChallengeAnswer=function(e,n,r){var i=this;return r===void 0&&(r=this._config.clientMetadata),this.userPool?n?new Promise(function(s,o){e.sendCustomChallengeAnswer(n,i.authCallbacks(e,s,o),r)}):this.rejectAuthError(gt.EmptyChallengeResponse):this.rejectNoUserPool()},t.prototype.deleteUserAttributes=function(e,n){var r=this;return new Promise(function(i,s){r.userSession(e).then(function(o){e.deleteAttributes(n,function(a,c){return a?s(a):i(c)})})})},t.prototype.deleteUser=function(){return wt(this,void 0,void 0,function(){var e,n,r=this;return _t(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._storageSync];case 1:return i.sent(),[3,3];case 2:throw e=i.sent(),ye.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return n=this._oAuthHandler&&this._storage.getItem("amplify-signin-with-hostedUI")==="true",[2,new Promise(function(s,o){return wt(r,void 0,void 0,function(){var a,c=this;return _t(this,function(u){if(this.userPool)if(a=this.userPool.getCurrentUser(),a)a.getSession(function(d,h){return wt(c,void 0,void 0,function(){var p,y=this;return _t(this,function(v){switch(v.label){case 0:if(!d)return[3,5];if(ye.debug("Failed to get the user session",d),!this.isSessionInvalid(d))return[3,4];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(a)];case 2:return v.sent(),[3,4];case 3:return p=v.sent(),o(new Error("Session is invalid due to: "+d.message+" and failed to clean up invalid session: "+p.message)),[2];case 4:return[2,o(d)];case 5:a.deleteUser(function(w,k){if(w)o(w);else{ht("userDeleted",k,"The authenticated user has been deleted."),a.signOut(),y.user=null;try{y.cleanCachedItems()}catch{ye.debug("failed to clear cached items")}n?y.oAuthSignOutRedirect(s,o):(ht("signOut",y.user,"A user has been signed out"),s(k))}}),v.label=6;case 6:return[2]}})})});else return ye.debug("Failed to get user from user pool"),[2,o(new Error("No current user."))];else ye.debug("no Congito User pool"),o(new Error("Cognito User pool does not exist"));return[2]})})})]}})})},t.prototype.updateUserAttributes=function(e,n,r){r===void 0&&(r=this._config.clientMetadata);var i=[],s=this;return new Promise(function(o,a){s.userSession(e).then(function(c){for(var u in n)if(u!=="sub"&&u.indexOf("_verified")<0){var d={Name:u,Value:n[u]};i.push(d)}e.updateAttributes(i,function(h,p){return h?a(h):o(p)},r)})})},t.prototype.userAttributes=function(e){var n=this;return new Promise(function(r,i){n.userSession(e).then(function(s){e.getUserAttributes(function(o,a){o?i(o):r(a)})})})},t.prototype.verifiedContact=function(e){var n=this;return this.userAttributes(e).then(function(r){var i=n.attributesToObject(r),s={},o={};return i.email&&(i.email_verified?o.email=i.email:s.email=i.email),i.phone_number&&(i.phone_number_verified?o.phone_number=i.phone_number:s.phone_number=i.phone_number),{verified:o,unverified:s}})},t.prototype.isErrorWithMessage=function(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"message")},t.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&e.message==="Access Token has been revoked"},t.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&e.message==="Refresh Token has been revoked"},t.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&e.message==="User is disabled."},t.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&e.message==="User does not exist."},t.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&e.message==="Refresh Token has expired"},t.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&this._storage.getItem("amplify-signin-with-hostedUI")==="true"},t.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)},t.prototype.cleanUpInvalidSession=function(e){return wt(this,void 0,void 0,function(){var n=this;return _t(this,function(r){switch(r.label){case 0:e.signOut(),this.user=null,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return r.sent(),[3,4];case 3:return r.sent(),ye.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise(function(i,s){n.oAuthSignOutRedirect(i,s)})]:(ht("signOut",this.user,"A user has been signed out"),[2])}})})},t.prototype.currentUserPoolUser=function(e){var n=this;return this.userPool?new Promise(function(r,i){n._storageSync.then(function(){return wt(n,void 0,void 0,function(){var s,o,a=this;return _t(this,function(c){switch(c.label){case 0:return this.isOAuthInProgress()?(ye.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise(function(u){var d=setTimeout(function(){ye.debug("OAuth signIn in progress timeout"),Nr.remove("auth",h),u()},Yx);Nr.listen("auth",h);function h(p){var y=p.payload,v=y.event;(v==="cognitoHostedUI"||v==="cognitoHostedUI_failure")&&(ye.debug("OAuth signIn resolved: "+v),clearTimeout(d),Nr.remove("auth",h),u())}})]):[3,2];case 1:c.sent(),c.label=2;case 2:return s=this.userPool.getCurrentUser(),s?(o=this._config.clientMetadata,s.getSession(function(u,d){return wt(a,void 0,void 0,function(){var h,p,y,v,w,k=this;return _t(this,function(C){switch(C.label){case 0:if(!u)return[3,5];if(ye.debug("Failed to get the user session",u),!this.isSessionInvalid(u))return[3,4];C.label=1;case 1:return C.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(s)];case 2:return C.sent(),[3,4];case 3:return h=C.sent(),i(new Error("Session is invalid due to: "+u.message+" and failed to clean up invalid session: "+h.message)),[2];case 4:return i(u),[2];case 5:return p=e?e.bypassCache:!1,p?[4,this.Credentials.clear()]:[3,7];case 6:C.sent(),C.label=7;case 7:if(y=this._config.clientMetadata,v=d.getAccessToken().decodePayload().scope,w=v===void 0?"":v,w.split(" ").includes(Dg))s.getUserData(function(E,O){return wt(k,void 0,void 0,function(){var I,M,Y,ee,F,se,H;return _t(this,function(ie){switch(ie.label){case 0:if(!E)return[3,7];if(ye.debug("getting user data failed",E),!this.isSessionInvalid(E))return[3,5];ie.label=1;case 1:return ie.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(s)];case 2:return ie.sent(),[3,4];case 3:return I=ie.sent(),i(new Error("Session is invalid due to: "+E.message+" and failed to clean up invalid session: "+I.message)),[2];case 4:return i(E),[3,6];case 5:r(s),ie.label=6;case 6:return[2];case 7:for(M=O.PreferredMfaSetting||"NOMFA",Y=[],ee=0;ee<O.UserAttributes.length;ee++)F={Name:O.UserAttributes[ee].Name,Value:O.UserAttributes[ee].Value},se=new es(F),Y.push(se);return H=this.attributesToObject(Y),Object.assign(s,{attributes:H,preferredMFA:M}),[2,r(s)]}})})},{bypassCache:p,clientMetadata:y});else return ye.debug("Unable to get the user data because the "+Dg+" is not in the scopes of the access token"),[2,r(s)];return[2]}})})},{clientMetadata:o}),[2]):(ye.debug("Failed to get user from user pool"),i("No current user"),[2])}})})}).catch(function(s){return ye.debug("Failed to sync cache info into memory",s),i(s)})}):this.rejectNoUserPool()},t.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},t.prototype.currentAuthenticatedUser=function(e){return wt(this,void 0,void 0,function(){var n,r,i,s,o;return _t(this,function(a){switch(a.label){case 0:ye.debug("getting current authenticated user"),n=null,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._storageSync];case 2:return a.sent(),[3,4];case 3:throw r=a.sent(),ye.debug("Failed to sync cache info into memory",r),r;case 4:try{i=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")),i&&(n=xu(xu({},i.user),{token:i.token}))}catch{ye.debug("cannot load federated user from auth storage")}return n?(this.user=n,ye.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:ye.debug("get current authenticated userpool user"),s=null,a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return s=a.sent(),[3,9];case 8:return o=a.sent(),o==="No userPool"&&ye.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),ye.debug("The user is not authenticated by the error",o),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=s,[2,this.user]}})})},t.prototype.currentSession=function(){var e=this;return ye.debug("Getting current session"),this.userPool?new Promise(function(n,r){e.currentUserPoolUser().then(function(i){e.userSession(i).then(function(s){n(s)}).catch(function(s){ye.debug("Failed to get the current session",s),r(s)})}).catch(function(i){ye.debug("Failed to get the current user",i),r(i)})}):Promise.reject(new Error("No User Pool in the configuration."))},t.prototype.userSession=function(e){var n=this;if(!e)return ye.debug("the user is null"),this.rejectAuthError(gt.NoUserSession);var r=this._config.clientMetadata;return new Promise(function(i,s){ye.debug("Getting the session from this user:",e),e.getSession(function(o,a){return wt(n,void 0,void 0,function(){var c;return _t(this,function(u){switch(u.label){case 0:if(!o)return[3,5];if(ye.debug("Failed to get the session from user",e),!this.isSessionInvalid(o))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return u.sent(),[3,4];case 3:return c=u.sent(),s(new Error("Session is invalid due to: "+o.message+" and failed to clean up invalid session: "+c.message)),[2];case 4:return s(o),[2];case 5:return ye.debug("Succeed to get the user session",a),i(a),[2]}})})},{clientMetadata:r})})},t.prototype.currentUserCredentials=function(){return wt(this,void 0,void 0,function(){var e,n,r=this;return _t(this,function(i){switch(i.label){case 0:ye.debug("Getting current user credentials"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._storageSync];case 2:return i.sent(),[3,4];case 3:throw e=i.sent(),ye.debug("Failed to sync cache info into memory",e),e;case 4:n=null;try{n=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(s){ye.debug("failed to get or parse item aws-amplify-federatedInfo",s)}return n?[2,this.Credentials.refreshFederatedToken(n)]:[2,this.currentSession().then(function(s){return ye.debug("getting session success",s),r.Credentials.set(s,"session")}).catch(function(){return ye.debug("getting guest credentials"),r.Credentials.set(null,"guest")})]}})})},t.prototype.currentCredentials=function(){return ye.debug("getting current credentials"),this.Credentials.get()},t.prototype.verifyUserAttribute=function(e,n,r){return r===void 0&&(r=this._config.clientMetadata),new Promise(function(i,s){e.getAttributeVerificationCode(n,{onSuccess:function(o){return i(o)},onFailure:function(o){return s(o)}},r)})},t.prototype.verifyUserAttributeSubmit=function(e,n,r){return r?new Promise(function(i,s){e.verifyAttribute(n,r,{onSuccess:function(o){i(o)},onFailure:function(o){s(o)}})}):this.rejectAuthError(gt.EmptyCode)},t.prototype.verifyCurrentUserAttribute=function(e){var n=this;return n.currentUserPoolUser().then(function(r){return n.verifyUserAttribute(r,e)})},t.prototype.verifyCurrentUserAttributeSubmit=function(e,n){var r=this;return r.currentUserPoolUser().then(function(i){return r.verifyUserAttributeSubmit(i,e,n)})},t.prototype.cognitoIdentitySignOut=function(e,n){return wt(this,void 0,void 0,function(){var r,i,s=this;return _t(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._storageSync];case 1:return o.sent(),[3,3];case 2:throw r=o.sent(),ye.debug("Failed to sync cache info into memory",r),r;case 3:return i=this._oAuthHandler&&this._storage.getItem("amplify-signin-with-hostedUI")==="true",[2,new Promise(function(a,c){if(e&&e.global){ye.debug("user global sign out",n);var u=s._config.clientMetadata;n.getSession(function(d,h){return wt(s,void 0,void 0,function(){var p,y=this;return _t(this,function(v){switch(v.label){case 0:if(!d)return[3,5];if(ye.debug("failed to get the user session",d),!this.isSessionInvalid(d))return[3,4];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(n)];case 2:return v.sent(),[3,4];case 3:return p=v.sent(),c(new Error("Session is invalid due to: "+d.message+" and failed to clean up invalid session: "+p.message)),[2];case 4:return[2,c(d)];case 5:return n.globalSignOut({onSuccess:function(w){if(ye.debug("global sign out success"),i)y.oAuthSignOutRedirect(a,c);else return a()},onFailure:function(w){return ye.debug("global sign out failed",w),c(w)}}),[2]}})})},{clientMetadata:u})}else ye.debug("user sign out",n),n.signOut(function(){if(i)s.oAuthSignOutRedirect(a,c);else return a()})})]}})})},t.prototype.oAuthSignOutRedirect=function(e,n){var r=ur().isBrowser;r?this.oAuthSignOutRedirectOrReject(n):this.oAuthSignOutAndResolve(e)},t.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},t.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout(function(){return e(Error("Signout timeout fail"))},3e3)},t.prototype.signOut=function(e){return wt(this,void 0,void 0,function(){var n;return _t(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return r.sent(),[3,3];case 2:return r.sent(),ye.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(n=this.userPool.getCurrentUser(),n?[4,this.cognitoIdentitySignOut(e,n)]:[3,5]):[3,7];case 4:return r.sent(),[3,6];case 5:ye.debug("no current Cognito user"),r.label=6;case 6:return[3,8];case 7:ye.debug("no Cognito User pool"),r.label=8;case 8:return ht("signOut",this.user,"A user has been signed out"),this.user=null,[2]}})})},t.prototype.cleanCachedItems=function(){return wt(this,void 0,void 0,function(){return _t(this,function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}})})},t.prototype.changePassword=function(e,n,r,i){var s=this;return i===void 0&&(i=this._config.clientMetadata),new Promise(function(o,a){s.userSession(e).then(function(c){e.changePassword(n,r,function(u,d){return u?(ye.debug("change password failure",u),a(u)):o(d)},i)})})},t.prototype.forgotPassword=function(e,n){if(n===void 0&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(gt.EmptyUsername);var r=this.createCognitoUser(e);return new Promise(function(i,s){r.forgotPassword({onSuccess:function(){i()},onFailure:function(o){ye.debug("forgot password failure",o),ht("forgotPassword_failure",o,e+" forgotPassword failed"),s(o)},inputVerificationCode:function(o){ht("forgotPassword",r,e+" has initiated forgot password flow"),i(o)}},n)})},t.prototype.forgotPasswordSubmit=function(e,n,r,i){if(i===void 0&&(i=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(gt.EmptyUsername);if(!n)return this.rejectAuthError(gt.EmptyCode);if(!r)return this.rejectAuthError(gt.EmptyPassword);var s=this.createCognitoUser(e);return new Promise(function(o,a){s.confirmPassword(n,r,{onSuccess:function(c){ht("forgotPasswordSubmit",s,e+" forgotPasswordSubmit successful"),o(c)},onFailure:function(c){ht("forgotPasswordSubmit_failure",c,e+" forgotPasswordSubmit failed"),a(c)}},i)})},t.prototype.currentUserInfo=function(){return wt(this,void 0,void 0,function(){var e,c,n,r,i,s,o,a,c;return _t(this,function(u){switch(u.label){case 0:return e=this.Credentials.getCredSource(),!e||e==="aws"||e==="userPool"?[4,this.currentUserPoolUser().catch(function(d){return ye.error(d)})]:[3,9];case 1:if(c=u.sent(),!c)return[2,null];u.label=2;case 2:return u.trys.push([2,8,,9]),[4,this.userAttributes(c)];case 3:n=u.sent(),r=this.attributesToObject(n),i=null,u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return i=u.sent(),[3,7];case 6:return s=u.sent(),ye.debug("Failed to retrieve credentials while getting current user info",s),[3,7];case 7:return o={id:i?i.identityId:void 0,username:c.getUsername(),attributes:r},[2,o];case 8:return a=u.sent(),ye.error("currentUserInfo error",a),[2,{}];case 9:return e==="federated"?(c=this.user,[2,c||{}]):[2]}})})},t.prototype.federatedSignIn=function(e,n,r){return wt(this,void 0,void 0,function(){var i,c,s,o,a,c,u,d,h,p,y,v;return _t(this,function(w){switch(w.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(typeof e=="undefined"&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return zl(e)||eC(e)||tC(e)||typeof e=="undefined"?(i=e||{provider:Au.Cognito},c=zl(i)?i.provider:i.customProvider,s=(zl(i),i.customState),this._config.userPoolId&&(o=mi(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,a=mi(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,a,o,c,s)),[3,4]):[3,1];case 1:c=e;try{u=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user),u&&ye.warn("There is already a signed in user: "+u+` in your app.
|
|
99
|
-
You should not call Auth.federatedSignIn method again as it may cause unexpected behavior.`)}catch{}return d=n.token,h=n.identity_id,p=n.expires_at,[4,this.Credentials.set({provider:c,token:d,identity_id:h,user:r,expires_at:p},"federation")];case 2:return y=w.sent(),[4,this.currentAuthenticatedUser()];case 3:return v=w.sent(),ht("signIn",v,"A user "+v.username+" has been signed in"),ye.debug("federated sign in credentials",y),[2,y];case 4:return[2]}})})},t.prototype._handleAuthResponse=function(e){return wt(this,void 0,void 0,function(){var n,r,i,s,o,a,c,u,d,h,p,y,v,w;return _t(this,function(k){switch(k.label){case 0:if(this.oAuthFlowInProgress)return ye.debug("Skipping URL "+e+" current flow in progress"),[2];k.label=1;case 1:if(k.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(ht("parsingCallbackUrl",{url:e},"The callback url is being parsed"),n=e||(ur().isBrowser?window.location.href:""),r=!!(Tr.parse(n).query||"").split("&").map(function(C){return C.split("=")}).find(function(C){var E=Pg(C,1),O=E[0];return O==="code"||O==="error"}),i=!!(Tr.parse(n).hash||"#").substr(1).split("&").map(function(C){return C.split("=")}).find(function(C){var E=Pg(C,1),O=E[0];return O==="access_token"||O==="error"}),!(r||i))return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),k.label=2;case 2:return k.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(n)];case 3:return s=k.sent(),o=s.accessToken,a=s.idToken,c=s.refreshToken,u=s.state,d=new sf({IdToken:new tf({IdToken:a}),RefreshToken:new nf({RefreshToken:c}),AccessToken:new Zd({AccessToken:o})}),h=void 0,this._config.identityPoolId?[4,this.Credentials.set(d,"session")]:[3,5];case 4:h=k.sent(),ye.debug("AWS credentials",h),k.label=5;case 5:return p=/-/.test(u),y=this.createCognitoUser(d.getIdToken().decodePayload()["cognito:username"]),y.setSignInUserSession(d),window&&typeof window.history!="undefined"&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),ht("signIn",y,"A user "+y.getUsername()+" has been signed in"),ht("cognitoHostedUI",y,"A user "+y.getUsername()+" has been signed in via Cognito Hosted UI"),p&&(v=u.split("-").splice(1).join("-"),ht("customOAuthState",rk(v),"State for user "+y.getUsername())),[2,h];case 6:return w=k.sent(),ye.debug("Error in cognito hosted auth response",w),window&&typeof window.history!="undefined"&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),ht("signIn_failure",w,"The OAuth response flow failed"),ht("cognitoHostedUI_failure",w,"A failure occurred when returning to the Cognito Hosted UI"),ht("customState_failure",w,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}})})},t.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},t.prototype.attributesToObject=function(e){var n=this,r={};return e&&e.map(function(i){i.Name==="email_verified"||i.Name==="phone_number_verified"?r[i.Name]=n.isTruthyString(i.Value)||i.Value===!0:r[i.Name]=i.Value}),r},t.prototype.isTruthyString=function(e){return typeof e.toLowerCase=="function"&&e.toLowerCase()==="true"},t.prototype.createCognitoUser=function(e){var n={Username:e,Pool:this.userPool};n.Storage=this._storage;var r=this._config.authenticationFlowType,i=new of(n);return r&&i.setAuthenticationFlowType(r),i},t.prototype._isValidAuthStorage=function(e){return!!e&&typeof e.getItem=="function"&&typeof e.setItem=="function"&&typeof e.removeItem=="function"&&typeof e.clear=="function"},t.prototype.noUserPoolErrorHandler=function(e){return e&&(!e.userPoolId||!e.identityPoolId)?gt.MissingAuthConfig:gt.NoConfig},t.prototype.rejectAuthError=function(e){return Promise.reject(new xr(e))},t.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new Gx(e))},t.prototype.rememberDevice=function(){return wt(this,void 0,void 0,function(){var e,n;return _t(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=r.sent(),[3,3];case 2:return n=r.sent(),ye.debug("The user is not authenticated by the error",n),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(i,s){e.setDeviceStatusRemembered({onSuccess:function(o){i(o)},onFailure:function(o){o.code==="InvalidParameterException"?s(new xr(gt.DeviceConfig)):o.code==="NetworkError"?s(new xr(gt.NetworkError)):s(o)}})})]}})})},t.prototype.forgetDevice=function(){return wt(this,void 0,void 0,function(){var e,n;return _t(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=r.sent(),[3,3];case 2:return n=r.sent(),ye.debug("The user is not authenticated by the error",n),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(i,s){e.forgetDevice({onSuccess:function(o){i(o)},onFailure:function(o){o.code==="InvalidParameterException"?s(new xr(gt.DeviceConfig)):o.code==="NetworkError"?s(new xr(gt.NetworkError)):s(o)}})})]}})})},t.prototype.fetchDevices=function(){return wt(this,void 0,void 0,function(){var e,n;return _t(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=r.sent(),[3,3];case 2:throw n=r.sent(),ye.debug("The user is not authenticated by the error",n),new Error("The user is not authenticated");case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(i,s){var o={onSuccess:function(a){var c=a.Devices.map(function(u){var d=u.DeviceAttributes.find(function(p){var y=p.Name;return y==="device_name"})||{},h={id:u.DeviceKey,name:d.Value};return h});i(c)},onFailure:function(a){a.code==="InvalidParameterException"?s(new xr(gt.DeviceConfig)):a.code==="NetworkError"?s(new xr(gt.NetworkError)):s(a)}};e.listDevices(Xx,null,o)})]}})})},t}(),Eb=new Zx(null);Gf.register(Eb);function ts(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function lu(t){return function e(n){return arguments.length===0||ts(n)?e:t.apply(this,arguments)}}function eN(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return ts(n)?e:lu(function(i){return t(n,i)});default:return ts(n)&&ts(r)?e:ts(n)?lu(function(i){return t(i,r)}):ts(r)?lu(function(i){return t(n,i)}):t(n,r)}}}const tN=Number.isInteger||function(e){return e<<0===e};function nN(t){return Object.prototype.toString.call(t)==="[object String]"}function rN(t,e){var n=t<0?e.length+t:t;return nN(e)?e.charAt(n):e[n]}var iN=lu(function(e){return e==null});function sN(t,e){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;var i=t[r];tN(i)?n=rN(i,n):n=n[i]}return n}var oN=eN(sN);class hr extends Error{constructor(e,n,r){super(n),this.value=r,this.name=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value},...this.stack&&{stack:this.formatStack()}}}formatStack(){return this.stack?this.stack.split(`
|
|
100
|
-
`).map(e=>e.trim()).join(" | "):""}}class aN extends hr{constructor(e){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${e}' not found.`,e)}}class rh extends hr{constructor(e){var n;super("APP_UNEXPECTED_ERROR",(n=e.message)!=null?n:"An unexpected error occurred.",e)}}class Ab extends hr{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}class Cb extends hr{constructor(e){super("INVALID_NIZZA_GLOBAL_OBJECT_ERROR",`
|
|
101
|
-
Configuration property invalid: "${e}".
|
|
102
|
-
|
|
103
|
-
It looks like you are trying to use a configuration property that is required but is "undefined", make sure you have initialized the global object "nizza".
|
|
104
|
-
|
|
105
|
-
* If you are using the @nizza/core library:
|
|
106
|
-
|
|
107
|
-
import { getNizza } from '@nizza/core';
|
|
108
|
-
|
|
109
|
-
const nizza = getNizza();
|
|
110
|
-
|
|
111
|
-
nizza.configure({
|
|
112
|
-
account: env.account,
|
|
113
|
-
...
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
* If you are using the window:
|
|
117
|
-
|
|
118
|
-
window.nizza.configure({
|
|
119
|
-
account: env.account,
|
|
120
|
-
...
|
|
121
|
-
});
|
|
122
|
-
`)}}function uN(t,e){e.forEach(n=>{if(iN(oN(n.split("."),t)))throw new Cb(n)})}function mt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];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 cN={};function xb(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:cN}var Nb=Object.assign,Nu=Object.getOwnPropertyDescriptor,Jn=Object.defineProperty,ec=Object.prototype,lf=[];Object.freeze(lf);var ih={};Object.freeze(ih);var lN=typeof Proxy!="undefined",dN=Object.toString();function Tb(){lN||mt("Proxy not available")}function Ob(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ss=function(){};function Mn(t){return typeof t=="function"}function ki(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function tc(t){return t!==null&&typeof t=="object"}function cr(t){if(!tc(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()===dN}function Ib(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function nc(t,e,n){Jn(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Rb(t,e,n){Jn(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ri(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return tc(r)&&r[n]===!0}}function xs(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function fN(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function nr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Pb=typeof Object.getOwnPropertySymbols!="undefined";function hN(t){var e=Object.keys(t);if(!Pb)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return ec.propertyIsEnumerable.call(t,r)})):e}var Vo=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Pb?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Db(t){return t===null?null:typeof t=="object"?""+t:t}function $r(t,e){return ec.hasOwnProperty.call(t,e)}var pN=Object.getOwnPropertyDescriptors||function(e){var n={};return Vo(e).forEach(function(r){n[r]=Nu(e,r)}),n};function yn(t,e){return!!(t&e)}function bn(t,e,n){return n?t|=e:t&=~e,t}function Fg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function mN(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vN(r.key),r)}}function Ns(t,e,n){return e&&mN(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function os(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=yN(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
123
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ei(){return Ei=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ei.apply(null,arguments)}function Fb(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,df(t,e)}function df(t,e){return df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},df(t,e)}function gN(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function vN(t){var e=gN(t,"string");return typeof e=="symbol"?e:e+""}function yN(t,e){if(t){if(typeof t=="string")return Fg(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)?Fg(t,e):void 0}}var as=Symbol("mobx-stored-annotations");function Xn(t){function e(n,r){if(ea(r))return t.decorate_20223_(n,r);Ts(n,r,t)}return Object.assign(e,t)}function Ts(t,e,n){$r(t,as)||nc(t,as,Ei({},t[as])),AN(n)||(t[as][e]=n)}function ea(t){return typeof t=="object"&&typeof t.kind=="string"}var Ge=Symbol("mobx administration"),Kr=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_=pt.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(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.reportObserved=function(){return Xb(this)},e.reportChanged=function(){Nn(),Qb(this),Tn()},e.toString=function(){return this.name_},Ns(t,[{key:"isBeingObserved",get:function(){return yn(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=bn(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return yn(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=bn(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return yn(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=bn(this.flags_,t.diffValueMask_,r===1)}}])}();Kr.isBeingObservedMask_=1;Kr.isPendingUnobservationMask_=2;Kr.diffValueMask_=4;var sh=Ri("Atom",Kr);function Ub(t,e,n){e===void 0&&(e=ss),n===void 0&&(n=ss);var r=new Kr(t);return e!==ss&&xT(r,e),n!==ss&&sw(r,n),r}function bN(t,e){return lh(t,e)}function wN(t,e){return lh(t,e,1)}function _N(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Ai={structural:bN,default:_N,shallow:wN};function Ci(t,e,n){return cw(t)?t:Array.isArray(t)?zt.array(t,{name:n}):cr(t)?zt.object(t,void 0,{name:n}):xs(t)?zt.map(t,{name:n}):nr(t)?zt.set(t,{name:n}):typeof t=="function"&&!cc(t)&&!Ho(t)?Ib(t)?hs(t):qo(n,t):t}function SN(t,e,n){if(t==null||fc(t)||dc(t)||Di(t)||Os(t))return t;if(Array.isArray(t))return zt.array(t,{name:n,deep:!1});if(cr(t))return zt.object(t,void 0,{name:n,deep:!1});if(xs(t))return zt.map(t,{name:n,deep:!1});if(nr(t))return zt.set(t,{name:n,deep:!1})}function rc(t){return t}function kN(t,e){return lh(t,e)?e:t}var EN="override";function AN(t){return t.annotationType_===EN}function ta(t,e){return{annotationType_:t,options_:e,make_:CN,extend_:xN,decorate_20223_:NN}}function CN(t,e,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,n,!1)===null?0:1;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(cc(n.value))return 1;var s=Lb(t,this,e,n,!1);return Jn(r,e,s),2}function xN(t,e,n,r){var i=Lb(t,this,e,n);return t.defineProperty_(e,i,r)}function NN(t,e){var n=e.kind,r=e.name,i=e.addInitializer,s=this,o=function(u){var d,h,p,y;return qr((d=(h=s.options_)==null?void 0:h.name)!=null?d:r.toString(),u,(p=(y=s.options_)==null?void 0:y.autoAction)!=null?p:!1)};if(n=="field"){i(function(){Ts(this,r,s)});return}if(n=="method"){var a;return cc(t)||(t=o(t)),(a=this.options_)!=null&&a.bound&&i(function(){var c=this,u=c[r].bind(c);u.isMobxAction=!0,c[r]=u}),t}mt("Cannot apply '"+s.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
|
|
124
|
-
'`+s.annotationType_+"' can only be used on properties with a function value."))}function TN(t,e,n,r){e.annotationType_,r.value}function Lb(t,e,n,r,i){var s,o,a,c,u,d,h;i===void 0&&(i=Me.safeDescriptors),TN(t,e,n,r);var p=r.value;if((s=e.options_)!=null&&s.bound){var y;p=p.bind((y=t.proxy_)!=null?y:t.target_)}return{value:qr((o=(a=e.options_)==null?void 0:a.name)!=null?o:n.toString(),p,(c=(u=e.options_)==null?void 0:u.autoAction)!=null?c:!1,(d=e.options_)!=null&&d.bound?(h=t.proxy_)!=null?h:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function Mb(t,e){return{annotationType_:t,options_:e,make_:ON,extend_:IN,decorate_20223_:RN}}function ON(t,e,n,r){var i;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!$r(t.target_,e)||!Ho(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(Ho(n.value))return 1;var s=Bb(t,this,e,n,!1,!1);return Jn(r,e,s),2}function IN(t,e,n,r){var i,s=Bb(t,this,e,n,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,s,r)}function RN(t,e){var n,r=e.name,i=e.addInitializer;return Ho(t)||(t=hs(t)),(n=this.options_)!=null&&n.bound&&i(function(){var s=this,o=s[r].bind(s);o.isMobXFlow=!0,s[r]=o}),t}function PN(t,e,n,r){e.annotationType_,r.value}function Bb(t,e,n,r,i,s){s===void 0&&(s=Me.safeDescriptors),PN(t,e,n,r);var o=r.value;if(Ho(o)||(o=hs(o)),i){var a;o=o.bind((a=t.proxy_)!=null?a:t.target_),o.isMobXFlow=!0}return{value:o,configurable:s?t.isPlainObject_:!0,enumerable:!1,writable:!s}}function oh(t,e){return{annotationType_:t,options_:e,make_:DN,extend_:FN,decorate_20223_:UN}}function DN(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function FN(t,e,n,r){return LN(t,this,e,n),t.defineComputedProperty_(e,Ei({},this.options_,{get:n.get,set:n.set}),r)}function UN(t,e){var n=this,r=e.name,i=e.addInitializer;return i(function(){var s=Is(this)[Ge],o=Ei({},n.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+r.toString()),s.values_.set(r,new Bn(o))}),function(){return this[Ge].getObservablePropValue_(r)}}function LN(t,e,n,r){e.annotationType_,r.get}function ic(t,e){return{annotationType_:t,options_:e,make_:MN,extend_:BN,decorate_20223_:$N}}function MN(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function BN(t,e,n,r){var i,s;return jN(t,this),t.defineObservableProperty_(e,n.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:Ci,r)}function $N(t,e){var n=this,r=e.kind,i=e.name,s=new WeakSet;function o(a,c){var u,d,h=Is(a)[Ge],p=new wi(c,(u=(d=n.options_)==null?void 0:d.enhancer)!=null?u:Ci,"ObservableObject."+i.toString(),!1);h.values_.set(i,p),s.add(a)}if(r=="accessor")return{get:function(){return s.has(this)||o(this,t.get.call(this)),this[Ge].getObservablePropValue_(i)},set:function(c){return s.has(this)||o(this,c),this[Ge].setObservablePropValue_(i,c)},init:function(c){return s.has(this)||o(this,c),c}}}function jN(t,e,n,r){e.annotationType_}var VN="true",qN=$b();function $b(t){return{annotationType_:VN,options_:t,make_:HN,extend_:KN,decorate_20223_:zN}}function HN(t,e,n,r){var i,s;if(n.get)return sc.make_(t,e,n,r);if(n.set){var o=qr(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:Me.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Jn(r,e,{configurable:!0,set:o}),2)}if(r!==t.target_&&typeof n.value=="function"){var a;if(Ib(n.value)){var c,u=(c=this.options_)!=null&&c.autoBind?hs.bound:hs;return u.make_(t,e,n,r)}var d=(a=this.options_)!=null&&a.autoBind?qo.bound:qo;return d.make_(t,e,n,r)}var h=((i=this.options_)==null?void 0:i.deep)===!1?zt.ref:zt;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var p;n.value=n.value.bind((p=t.proxy_)!=null?p:t.target_)}return h.make_(t,e,n,r)}function KN(t,e,n,r){var i,s;if(n.get)return sc.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:Me.safeDescriptors?t.isPlainObject_:!0,set:qr(e.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=t.proxy_)!=null?o:t.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?zt.ref:zt;return a.extend_(t,e,n,r)}function zN(t,e){mt("'"+this.annotationType_+"' cannot be used as a decorator")}var GN="observable",WN="observable.ref",YN="observable.shallow",JN="observable.struct",jb={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(jb);function Ka(t){return t||jb}var ff=ic(GN),XN=ic(WN,{enhancer:rc}),QN=ic(YN,{enhancer:SN}),ZN=ic(JN,{enhancer:kN}),Vb=Xn(ff);function za(t){return t.deep===!0?Ci:t.deep===!1?rc:tT(t.defaultDecorator)}function eT(t){var e;return t?(e=t.defaultDecorator)!=null?e:$b(t):void 0}function tT(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:Ci}function qb(t,e,n){if(ea(e))return ff.decorate_20223_(t,e);if(ki(e)){Ts(t,e,ff);return}return cw(t)?t:cr(t)?zt.object(t,e,n):Array.isArray(t)?zt.array(t,e):xs(t)?zt.map(t,e):nr(t)?zt.set(t,e):typeof t=="object"&&t!==null?t:zt.box(t,e)}Nb(qb,Vb);var nT={box:function(e,n){var r=Ka(n);return new wi(e,za(r),r.name,!0,r.equals)},array:function(e,n){var r=Ka(n);return(Me.useProxies===!1||r.proxy===!1?WT:MT)(e,za(r),r.name)},map:function(e,n){var r=Ka(n);return new fw(e,za(r),r.name)},set:function(e,n){var r=Ka(n);return new hw(e,za(r),r.name)},object:function(e,n,r){return Fi(function(){return aw(Me.useProxies===!1||(r==null?void 0:r.proxy)===!1?Is({},r):DT({},r),e,n)})},ref:Xn(XN),shallow:Xn(QN),deep:Vb,struct:Xn(ZN)},zt=Nb(qb,nT),Hb="computed",rT="computed.struct",hf=oh(Hb),iT=oh(rT,{equals:Ai.structural}),sc=function(e,n){if(ea(n))return hf.decorate_20223_(e,n);if(ki(n))return Ts(e,n,hf);if(cr(e))return Xn(oh(Hb,e));var r=cr(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new Bn(r)};Object.assign(sc,hf);sc.struct=Xn(iT);var Ug,Lg,Tu=0,sT=1,oT=(Ug=(Lg=Nu(function(){},"name"))==null?void 0:Lg.configurable)!=null?Ug:!1,Mg={value:"action",configurable:!0,writable:!1,enumerable:!1};function qr(t,e,n,r){n===void 0&&(n=!1);function i(){return aT(t,n,e,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},oT&&(Mg.value=t,Jn(i,"name",Mg)),i}function aT(t,e,n,r,i){var s=uT(t,e);try{return n.apply(r,i)}catch(o){throw s.error_=o,o}finally{cT(s)}}function uT(t,e,n,r){var i=!1,s=0,o=Me.trackingDerivation,a=!e||!o;Nn();var c=Me.allowStateChanges;a&&(Pi(),c=oc(!0));var u=ah(!0),d={runAsAction_:a,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:u,notifySpy_:i,startTime_:s,actionId_:sT++,parentActionId_:Tu};return Tu=d.actionId_,d}function cT(t){Tu!==t.actionId_&&mt(30),Tu=t.parentActionId_,t.error_!==void 0&&(Me.suppressReactionErrors=!0),ac(t.prevAllowStateChanges_),Oo(t.prevAllowStateReads_),Tn(),t.runAsAction_&&ar(t.prevDerivation_),Me.suppressReactionErrors=!1}function Kb(t,e){var n=oc(t);try{return e()}finally{ac(n)}}function oc(t){var e=Me.allowStateChanges;return Me.allowStateChanges=t,e}function ac(t){Me.allowStateChanges=t}var wi=function(t){function e(r,i,s,o,a){var c;return s===void 0&&(s="ObservableValue"),a===void 0&&(a=Ai.default),c=t.call(this,s)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=i,c.name_=s,c.equals=a,c.value_=i(r,void 0,s),c}Fb(e,t);var n=e.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Me.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(An(this)){var s=Cn(this,{object:this,type:Qn,newValue:i});if(!s)return Me.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Me.UNCHANGED:i},n.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),Un(this)&&Ln(this,{type:Qn,object:this,newValue:i,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return na(this,i)},n.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Qn,newValue:this.value_,oldValue:void 0}),ra(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Db(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Kr),Bn=function(){function t(n){this.dependenciesState_=pt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=pt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Iu(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Ou.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||mt(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=qr("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Ai.structural:Ai.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){hT(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&mt(32,this.name_,this.derivation),Me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)pf(this)&&(this.warnAboutUntrackedRead_(),Nn(),this.value_=this.computeValue_(!1),Tn());else if(Xb(this),pf(this)){var r=Me.trackingContext;this.keepAlive_&&!r&&(Me.trackingContext=this),this.trackAndCompute()&&fT(this),Me.trackingContext=r}var i=this.value_;if(du(i))throw i.cause;return i},e.set=function(r){if(this.setter_){this.isRunningSetter&&mt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else mt(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===pt.NOT_TRACKING_,s=this.computeValue_(!0),o=i||du(r)||du(s)||!this.equals_(r,s);return o&&(this.value_=s),o},e.computeValue_=function(r){this.isComputing=!0;var i=oc(!1),s;if(r)s=zb(this,this.derivation,this.scope_);else if(Me.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new Iu(o)}return ac(i),this.isComputing=!1,s},e.suspend_=function(){this.keepAlive_||(mf(this),this.value_=void 0)},e.observe_=function(r,i){var s=this,o=!0,a=void 0;return lc(function(){var c=s.get();if(!o||i){var u=Pi();r({observableKind:"computed",debugObjectName:s.name_,type:Qn,object:s,newValue:c,oldValue:a}),ar(u)}o=!1,a=c})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Db(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},Ns(t,[{key:"isComputing",get:function(){return yn(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=bn(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return yn(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=bn(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return yn(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=bn(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return yn(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=bn(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return yn(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=bn(this.flags_,t.diffValueMask_,r===1)}}])}();Bn.isComputingMask_=1;Bn.isRunningSetterMask_=2;Bn.isBeingObservedMask_=4;Bn.isPendingUnobservationMask_=8;Bn.diffValueMask_=16;var uc=Ri("ComputedValue",Bn),pt;(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_"})(pt||(pt={}));var Ou;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Ou||(Ou={}));var Iu=function(e){this.cause=void 0,this.cause=e};function du(t){return t instanceof Iu}function pf(t){switch(t.dependenciesState_){case pt.UP_TO_DATE_:return!1;case pt.NOT_TRACKING_:case pt.STALE_:return!0;case pt.POSSIBLY_STALE_:{for(var e=ah(!0),n=Pi(),r=t.observing_,i=r.length,s=0;s<i;s++){var o=r[s];if(uc(o)){if(Me.disableErrorBoundaries)o.get();else try{o.get()}catch{return ar(n),Oo(e),!0}if(t.dependenciesState_===pt.STALE_)return ar(n),Oo(e),!0}}return Wb(t),ar(n),Oo(e),!1}}}function zb(t,e,n){var r=ah(!0);Wb(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Me.runId;var i=Me.trackingDerivation;Me.trackingDerivation=t,Me.inBatch++;var s;if(Me.disableErrorBoundaries===!0)s=e.call(n);else try{s=e.call(n)}catch(o){s=new Iu(o)}return Me.inBatch--,Me.trackingDerivation=i,lT(t),Oo(r),s}function lT(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=pt.UP_TO_DATE_,i=0,s=t.unboundDepsCount_,o=0;o<s;o++){var a=n[o];a.diffValue===0&&(a.diffValue=1,i!==o&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,t.newObserving_=null,s=e.length;s--;){var c=e[s];c.diffValue===0&&Yb(c,t),c.diffValue=0}for(;i--;){var u=n[i];u.diffValue===1&&(u.diffValue=0,dT(u,t))}r!==pt.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function mf(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)Yb(e[n],t);t.dependenciesState_=pt.NOT_TRACKING_}function Gb(t){var e=Pi();try{return t()}finally{ar(e)}}function Pi(){var t=Me.trackingDerivation;return Me.trackingDerivation=null,t}function ar(t){Me.trackingDerivation=t}function ah(t){var e=Me.allowStateReads;return Me.allowStateReads=t,e}function Oo(t){Me.allowStateReads=t}function Wb(t){if(t.dependenciesState_!==pt.UP_TO_DATE_){t.dependenciesState_=pt.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=pt.UP_TO_DATE_}}var Zl=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},ed=!0,Me=function(){var t=xb();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(ed=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Zl().version&&(ed=!1),ed?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Zl):(setTimeout(function(){mt(35)},1),new Zl)}();function dT(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function Yb(t,e){t.observers_.delete(e),t.observers_.size===0&&Jb(t)}function Jb(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Me.pendingUnobservations.push(t))}function Nn(){Me.inBatch++}function Tn(){if(--Me.inBatch===0){Zb();for(var t=Me.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 Bn&&n.suspend_())}Me.pendingUnobservations=[]}}function Xb(t){var e=Me.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Me.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Me.inBatch>0&&Jb(t),!1)}function Qb(t){t.lowestObserverState_!==pt.STALE_&&(t.lowestObserverState_=pt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===pt.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=pt.STALE_}))}function fT(t){t.lowestObserverState_!==pt.STALE_&&(t.lowestObserverState_=pt.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===pt.POSSIBLY_STALE_?e.dependenciesState_=pt.STALE_:e.dependenciesState_===pt.UP_TO_DATE_&&(t.lowestObserverState_=pt.UP_TO_DATE_)}))}function hT(t){t.lowestObserverState_===pt.UP_TO_DATE_&&(t.lowestObserverState_=pt.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===pt.UP_TO_DATE_&&(e.dependenciesState_=pt.POSSIBLY_STALE_,e.onBecomeStale_())}))}var lr=function(){function t(n,r,i,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_=pt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Ou.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=s}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Me.pendingReactions.push(this),Zb())},e.runReaction_=function(){if(!this.isDisposed){Nn(),this.isScheduled=!1;var r=Me.trackingContext;if(Me.trackingContext=this,pf(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Me.trackingContext=r,Tn()}},e.track=function(r){if(!this.isDisposed){Nn(),this.isRunning=!0;var i=Me.trackingContext;Me.trackingContext=this;var s=zb(this,r,void 0);Me.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&mf(this),du(s)&&this.reportExceptionInDerivation_(s.cause),Tn()}},e.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Me.disableErrorBoundaries)throw r;var s="[mobx] uncaught error in '"+this+"'";Me.suppressReactionErrors||console.error(s,r),Me.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Nn(),mf(this),Tn()))},e.getDisposer_=function(r){var i=this,s=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",s),s[Ge]=this,s},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){},Ns(t,[{key:"isDisposed",get:function(){return yn(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=bn(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return yn(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=bn(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return yn(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=bn(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return yn(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=bn(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return yn(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=bn(this.flags_,t.diffValueMask_,r===1)}}])}();lr.isDisposedMask_=1;lr.isScheduledMask_=2;lr.isTrackPendingMask_=4;lr.isRunningMask_=8;lr.diffValueMask_=16;var pT=100,mT=function(e){return e()};function Zb(){Me.inBatch>0||Me.isRunningReactions||mT(gT)}function gT(){Me.isRunningReactions=!0;for(var t=Me.pendingReactions,e=0;t.length>0;){++e===pT&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Me.isRunningReactions=!1}var Ru=Ri("Reaction",lr);function Io(){return!1}function vT(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var ew="action",yT="action.bound",tw="autoAction",bT="autoAction.bound",wT="<unnamed action>",gf=ta(ew),_T=ta(yT,{bound:!0}),vf=ta(tw,{autoAction:!0}),ST=ta(bT,{autoAction:!0,bound:!0});function nw(t){var e=function(r,i){if(Mn(r))return qr(r.name||wT,r,t);if(Mn(i))return qr(r,i,t);if(ea(i))return(t?vf:gf).decorate_20223_(r,i);if(ki(i))return Ts(r,i,t?vf:gf);if(ki(r))return Xn(ta(t?tw:ew,{name:r,autoAction:t}))};return e}var gi=nw(!1);Object.assign(gi,gf);var qo=nw(!0);Object.assign(qo,vf);gi.bound=Xn(_T);qo.bound=Xn(ST);function cc(t){return Mn(t)&&t.isMobxAction===!0}function lc(t,e){var n,r,i,s;e===void 0&&(e=ih);var o=(n=(r=e)==null?void 0:r.name)!=null?n:"Autorun",a=!e.scheduler&&!e.delay,c;if(a)c=new lr(o,function(){this.track(h)},e.onError,e.requiresObservable);else{var u=rw(e),d=!1;c=new lr(o,function(){d||(d=!0,u(function(){d=!1,c.isDisposed||c.track(h)}))},e.onError,e.requiresObservable)}function h(){t(c)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||c.schedule_(),c.getDisposer_((s=e)==null?void 0:s.signal)}var kT=function(e){return e()};function rw(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:kT}function iw(t,e,n){var r,i,s;n===void 0&&(n=ih);var o=(r=n.name)!=null?r:"Reaction",a=gi(o,n.onError?ET(n.onError,e):e),c=!n.scheduler&&!n.delay,u=rw(n),d=!0,h=!1,p,y=n.compareStructural?Ai.structural:n.equals||Ai.default,v=new lr(o,function(){d||c?w():h||(h=!0,u(w))},n.onError,n.requiresObservable);function w(){if(h=!1,!v.isDisposed){var k=!1,C=p;v.track(function(){var E=Kb(!1,function(){return t(v)});k=d||!y(p,E),p=E}),(d&&n.fireImmediately||!d&&k)&&a(p,C,v),d=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||v.schedule_(),v.getDisposer_((s=n)==null?void 0:s.signal)}function ET(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var AT="onBO",CT="onBUO";function xT(t,e,n){return ow(AT,t,e,n)}function sw(t,e,n){return ow(CT,t,e,n)}function ow(t,e,n,r){var i=yf(e),s=Mn(r)?r:n,o=t+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}function aw(t,e,n,r){var i=pN(e);return Fi(function(){var s=Is(t,r)[Ge];Vo(i).forEach(function(o){s.extend_(o,i[o],n&&o in n?n[o]:!0)})}),t}var NT=0;function uw(){this.message="FLOW_CANCELLED"}uw.prototype=Object.create(Error.prototype);var td=Mb("flow"),TT=Mb("flow.bound",{bound:!0}),hs=Object.assign(function(e,n){if(ea(n))return td.decorate_20223_(e,n);if(ki(n))return Ts(e,n,td);var r=e,i=r.name||"<unnamed flow>",s=function(){var a=this,c=arguments,u=++NT,d=gi(i+" - runid: "+u+" - init",r).apply(a,c),h,p=void 0,y=new Promise(function(v,w){var k=0;h=w;function C(I){p=void 0;var M;try{M=gi(i+" - runid: "+u+" - yield "+k++,d.next).call(d,I)}catch(Y){return w(Y)}O(M)}function E(I){p=void 0;var M;try{M=gi(i+" - runid: "+u+" - yield "+k++,d.throw).call(d,I)}catch(Y){return w(Y)}O(M)}function O(I){if(Mn(I==null?void 0:I.then)){I.then(O,w);return}return I.done?v(I.value):(p=Promise.resolve(I.value),p.then(C,E))}C(void 0)});return y.cancel=gi(i+" - runid: "+u+" - cancel",function(){try{p&&Bg(p);var v=d.return(void 0),w=Promise.resolve(v.value);w.then(ss,ss),Bg(w),h(new uw)}catch(k){h(k)}}),y};return s.isMobXFlow=!0,s},td);hs.bound=Xn(TT);function Bg(t){Mn(t.cancel)&&t.cancel()}function Ho(t){return(t==null?void 0:t.isMobXFlow)===!0}function OT(t,e){return t?fc(t)||!!t[Ge]||sh(t)||Ru(t)||uc(t):!1}function cw(t){return OT(t)}function rr(t,e){e===void 0&&(e=void 0),Nn();try{return t.apply(e)}finally{Tn()}}function IT(t,e,n){return arguments.length===1||e&&typeof e=="object"?RT(t,e):lw(t,e,{})}function lw(t,e,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!o[Ge].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var s=qr("When-effect",e),o=lc(function(a){var c=Kb(!1,t);c&&(a.dispose(),r&&clearTimeout(r),s())},n);return o}function RT(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 r,i,s=new Promise(function(o,a){var c,u=lw(t,o,Ei({},e,{onError:a}));r=function(){u(),a(new Error("WHEN_CANCELLED"))},i=function(){u(),a(new Error("WHEN_ABORTED"))},e==null||(c=e.signal)==null||c.addEventListener==null||c.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return s.cancel=r,s}function Wi(t){return t[Ge]}var PT={has:function(e,n){return Wi(e).has_(n)},get:function(e,n){return Wi(e).get_(n)},set:function(e,n,r){var i;return ki(n)?(i=Wi(e).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(e,n){var r;return ki(n)?(r=Wi(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var i;return(i=Wi(e).defineProperty_(n,r))!=null?i:!0},ownKeys:function(e){return Wi(e).ownKeys_()},preventExtensions:function(e){mt(13)}};function DT(t,e){var n,r;return Tb(),t=Is(t,e),(r=(n=t[Ge]).proxy_)!=null?r:n.proxy_=new Proxy(t,PT)}function An(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function na(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Ob(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Cn(t,e){var n=Pi();try{for(var r=[].concat(t.interceptors_||[]),i=0,s=r.length;i<s&&(e=r[i](e),e&&!e.type&&mt(14),!!e);i++);return e}finally{ar(n)}}function Un(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function ra(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Ob(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Ln(t,e){var n=Pi(),r=t.changeListeners_;if(r){r=r.slice();for(var i=0,s=r.length;i<s;i++)r[i](e);ar(n)}}var nd=Symbol("mobx-keys");function FT(t,e,n){return cr(t)?aw(t,t,e,n):(Fi(function(){var r=Is(t,n)[Ge];if(!t[nd]){var i=Object.getPrototypeOf(t),s=new Set([].concat(Vo(t),Vo(i)));s.delete("constructor"),s.delete(Ge),nc(i,nd,s)}t[nd].forEach(function(o){return r.make_(o,e&&o in e?e[o]:!0)})}),t)}var $g="splice",Qn="update",UT=1e4,LT={get:function(e,n){var r=e[Ge];return n===Ge?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):$r(Pu,n)?Pu[n]:e[n]},set:function(e,n,r){var i=e[Ge];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){mt(15)}},uh=function(){function t(n,r,i,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_=i,this.legacyMode_=s,this.atom_=new Kr(n),this.enhancer_=function(o,a){return r(o,a,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return na(this,r)},e.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ra(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&mt("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var s=new Array(r-i),o=0;o<r-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(r,i-r)},e.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&mt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&vw(r+i+1)},e.spliceWithArray_=function(r,i,s){var o=this;this.atom_;var a=this.values_.length;if(r===void 0?r=0:r>a?r=a:r<0&&(r=Math.max(0,a+r)),arguments.length===1?i=a-r:i==null?i=0:i=Math.max(0,Math.min(i,a-r)),s===void 0&&(s=lf),An(this)){var c=Cn(this,{object:this.proxy_,type:$g,index:r,removedCount:i,added:s});if(!c)return lf;i=c.removedCount,s=c.added}if(s=s.length===0?s:s.map(function(h){return o.enhancer_(h,void 0)}),this.legacyMode_){var u=s.length-i;this.updateArrayLength_(a,u)}var d=this.spliceItemsIntoValues_(r,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(r,s,d),this.dehanceValues_(d)},e.spliceItemsIntoValues_=function(r,i,s){if(s.length<UT){var o;return(o=this.values_).splice.apply(o,[r,i].concat(s))}else{var a=this.values_.slice(r,r+i),c=this.values_.slice(r+i);this.values_.length+=s.length-i;for(var u=0;u<s.length;u++)this.values_[r+u]=s[u];for(var d=0;d<c.length;d++)this.values_[r+s.length+d]=c[d];return a}},e.notifyArrayChildUpdate_=function(r,i,s){var o=!this.owned_&&Io(),a=Un(this),c=a||o?{observableKind:"array",object:this.proxy_,type:Qn,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:s}:null;this.atom_.reportChanged(),a&&Ln(this,c)},e.notifyArraySplice_=function(r,i,s){var o=!this.owned_&&Io(),a=Un(this),c=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:$g,index:r,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;this.atom_.reportChanged(),a&&Ln(this,c)},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,i){var s=this.values_;if(this.legacyMode_&&r>s.length&&mt(17,r,s.length),r<s.length){this.atom_;var o=s[r];if(An(this)){var a=Cn(this,{type:Qn,object:this.proxy_,index:r,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var c=i!==o;c&&(s[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var u=new Array(r+1-s.length),d=0;d<u.length-1;d++)u[d]=void 0;u[u.length-1]=i,this.spliceWithArray_(s.length,0,u)}},t}();function MT(t,e,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),Tb(),Fi(function(){var i=new uh(n,e,r,!1);Rb(i.values_,Ge,i);var s=new Proxy(i.values_,LT);return i.proxy_=s,t&&t.length&&i.spliceWithArray_(0,0,t),s})}var Pu={clear:function(){return this.splice(0)},replace:function(e){var n=this[Ge];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];var o=this[Ge];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,n)}return o.spliceWithArray_(e,n,i)},spliceWithArray:function(e,n,r){return this[Ge].spliceWithArray_(e,n,r)},push:function(){for(var e=this[Ge],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[Ge].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[Ge],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Me.trackingDerivation&&mt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Me.trackingDerivation&&mt(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[Ge],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Nt("at",_n);Nt("concat",_n);Nt("flat",_n);Nt("includes",_n);Nt("indexOf",_n);Nt("join",_n);Nt("lastIndexOf",_n);Nt("slice",_n);Nt("toString",_n);Nt("toLocaleString",_n);Nt("toSorted",_n);Nt("toSpliced",_n);Nt("with",_n);Nt("every",jn);Nt("filter",jn);Nt("find",jn);Nt("findIndex",jn);Nt("findLast",jn);Nt("findLastIndex",jn);Nt("flatMap",jn);Nt("forEach",jn);Nt("map",jn);Nt("some",jn);Nt("toReversed",jn);Nt("reduce",dw);Nt("reduceRight",dw);function Nt(t,e){typeof Array.prototype[t]=="function"&&(Pu[t]=e(t))}function _n(t){return function(){var e=this[Ge];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function jn(t){return function(e,n){var r=this,i=this[Ge];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[t](function(o,a){return e.call(n,o,a,r)})}}function dw(t){return function(){var e=this,n=this[Ge];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,e)},r[t].apply(r,arguments)}}var BT=Ri("ObservableArrayAdministration",uh);function dc(t){return tc(t)&&BT(t[Ge])}var $T={},Ur="add",Du="delete",fw=function(){function t(n,r,i){var s=this;r===void 0&&(r=Ci),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ge]=$T,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_=r,this.name_=i,Mn(Map)||mt(18),Fi(function(){s.keysAtom_=Ub("ObservableMap.keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var i=this;if(!Me.trackingDerivation)return this.has_(r);var s=this.hasMap_.get(r);if(!s){var o=s=new wi(this.has_(r),rc,"ObservableMap.key?",!1);this.hasMap_.set(r,o),sw(o,function(){return i.hasMap_.delete(r)})}return s.get()},e.set=function(r,i){var s=this.has_(r);if(An(this)){var o=Cn(this,{type:s?Qn:Ur,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return s?this.updateValue_(r,i):this.addValue_(r,i),this},e.delete=function(r){var i=this;if(this.keysAtom_,An(this)){var s=Cn(this,{type:Du,object:this,name:r});if(!s)return!1}if(this.has_(r)){var o=Io(),a=Un(this),c=a||o?{observableKind:"map",debugObjectName:this.name_,type:Du,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return rr(function(){var u;i.keysAtom_.reportChanged(),(u=i.hasMap_.get(r))==null||u.setNewValue_(!1);var d=i.data_.get(r);d.setNewValue_(void 0),i.data_.delete(r)}),a&&Ln(this,c),!0}return!1},e.updateValue_=function(r,i){var s=this.data_.get(r);if(i=s.prepareNewValue_(i),i!==Me.UNCHANGED){var o=Io(),a=Un(this),c=a||o?{observableKind:"map",debugObjectName:this.name_,type:Qn,object:this,oldValue:s.value_,name:r,newValue:i}:null;s.setNewValue_(i),a&&Ln(this,c)}},e.addValue_=function(r,i){var s=this;this.keysAtom_,rr(function(){var u,d=new wi(i,s.enhancer_,"ObservableMap.key",!1);s.data_.set(r,d),i=d.value_,(u=s.hasMap_.get(r))==null||u.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=Io(),a=Un(this),c=a||o?{observableKind:"map",debugObjectName:this.name_,type:Ur,object:this,name:r,newValue:i}:null;a&&Ln(this,c)},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,i=this.keys();return Ko({next:function(){var o=i.next(),a=o.done,c=o.value;return{done:a,value:a?void 0:r.get(c)}}})},e.entries=function(){var r=this,i=this.keys();return Ko({next:function(){var o=i.next(),a=o.done,c=o.value;return{done:a,value:a?void 0:[c,r.get(c)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,i){for(var s=os(this),o;!(o=s()).done;){var a=o.value,c=a[0],u=a[1];r.call(i,u,c,this)}},e.merge=function(r){var i=this;return Di(r)&&(r=new Map(r)),rr(function(){cr(r)?hN(r).forEach(function(s){return i.set(s,r[s])}):Array.isArray(r)?r.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):xs(r)?(fN(r)||mt(19,r),r.forEach(function(s,o){return i.set(o,s)})):r!=null&&mt(20,r)}),this},e.clear=function(){var r=this;rr(function(){Gb(function(){for(var i=os(r.keys()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},e.replace=function(r){var i=this;return rr(function(){for(var s=jT(r),o=new Map,a=!1,c=os(i.data_.keys()),u;!(u=c()).done;){var d=u.value;if(!s.has(d)){var h=i.delete(d);if(h)a=!0;else{var p=i.data_.get(d);o.set(d,p)}}}for(var y=os(s.entries()),v;!(v=y()).done;){var w=v.value,k=w[0],C=w[1],E=i.data_.has(k);if(i.set(k,C),i.data_.has(k)){var O=i.data_.get(k);o.set(k,O),E||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var I=i.data_.keys(),M=o.keys(),Y=I.next(),ee=M.next();!Y.done;){if(Y.value!==ee.value){i.keysAtom_.reportChanged();break}Y=I.next(),ee=M.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,i){return ra(this,r)},e.intercept_=function(r){return na(this,r)},Ns(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Di=Ri("ObservableMap",fw);function jT(t){if(xs(t)||Di(t))return t;if(Array.isArray(t))return new Map(t);if(cr(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return mt(21,t)}var VT={},hw=function(){function t(n,r,i){var s=this;r===void 0&&(r=Ci),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ge]=VT,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_=i,Mn(Set)||mt(22),this.enhancer_=function(o,a){return r(o,a,i)},Fi(function(){s.atom_=Ub(s.name_),n&&s.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;rr(function(){Gb(function(){for(var i=os(r.data_.values()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},e.forEach=function(r,i){for(var s=os(this),o;!(o=s()).done;){var a=o.value;r.call(i,a,a,this)}},e.add=function(r){var i=this;if(this.atom_,An(this)){var s=Cn(this,{type:Ur,object:this,newValue:r});if(!s)return this}if(!this.has(r)){rr(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=!1,a=Un(this),c=a||o?{observableKind:"set",debugObjectName:this.name_,type:Ur,object:this,newValue:r}:null;a&&Ln(this,c)}return this},e.delete=function(r){var i=this;if(An(this)){var s=Cn(this,{type:Du,object:this,oldValue:r});if(!s)return!1}if(this.has(r)){var o=!1,a=Un(this),c=a||o?{observableKind:"set",debugObjectName:this.name_,type:Du,object:this,oldValue:r}:null;return rr(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&Ln(this,c),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=0,i=Array.from(this.keys()),s=Array.from(this.values());return Ko({next:function(){var a=r;return r+=1,a<s.length?{value:[i[a],s[a]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,i=0,s=Array.from(this.data_.values());return Ko({next:function(){return i<s.length?{value:r.dehanceValue_(s[i++]),done:!1}:{done:!0}}})},e.intersection=function(r){if(nr(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},e.union=function(r){if(nr(r))return r.union(this);var i=new Set(this);return i.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(nr(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(nr(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},e.replace=function(r){var i=this;return Os(r)&&(r=new Set(r)),rr(function(){Array.isArray(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):nr(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):r!=null&&mt("Cannot initialize set from "+r)}),this},e.observe_=function(r,i){return ra(this,r)},e.intercept_=function(r){return na(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},Ns(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Os=Ri("ObservableSet",hw),jg=Object.create(null),Vg="remove",pw=function(){function t(n,r,i,s){r===void 0&&(r=new Map),s===void 0&&(s=qN),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_=r,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new Kr("ObservableObject.keys"),this.isPlainObject_=cr(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,i){var s=this.values_.get(r);if(s instanceof Bn)return s.set(i),!0;if(An(this)){var o=Cn(this,{type:Qn,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==Me.UNCHANGED){var a=Un(this),c=!1,u=a||c?{type:Qn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:r,newValue:i}:null;s.setNewValue_(i),a&&Ln(this,u)}return!0},e.get_=function(r){return Me.trackingDerivation&&!$r(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,i,s){return s===void 0&&(s=!1),$r(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):s?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},e.has_=function(r){if(!Me.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new wi(r in this.target_,rc,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},e.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var s;if((s=this.target_[as])!=null&&s[r])return;mt(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==ec;){var a=Nu(o,r);if(a){var c=i.make_(this,r,a,o);if(c===0)return;if(c===1)break}o=Object.getPrototypeOf(o)}Hg(this,i,r)}},e.extend_=function(r,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(r,i,o);var a=s.extend_(this,r,i,o);return a&&Hg(this,s,r),a},e.defineProperty_=function(r,i,s){s===void 0&&(s=!1),this.keysAtom_;try{Nn();var o=this.delete_(r);if(!o)return o;if(An(this)){var a=Cn(this,{object:this.proxy_||this.target_,name:r,type:Ur,newValue:i.value});if(!a)return null;var c=a.newValue;i.value!==c&&(i=Ei({},i,{value:c}))}if(s){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Jn(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{Tn()}return!0},e.defineObservableProperty_=function(r,i,s,o){o===void 0&&(o=!1),this.keysAtom_;try{Nn();var a=this.delete_(r);if(!a)return a;if(An(this)){var c=Cn(this,{object:this.proxy_||this.target_,name:r,type:Ur,newValue:i});if(!c)return null;i=c.newValue}var u=qg(r),d={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(o){if(!Reflect.defineProperty(this.target_,r,d))return!1}else Jn(this.target_,r,d);var h=new wi(i,s,"ObservableObject.key",!1);this.values_.set(r,h),this.notifyPropertyAddition_(r,h.value_)}finally{Tn()}return!0},e.defineComputedProperty_=function(r,i,s){s===void 0&&(s=!1),this.keysAtom_;try{Nn();var o=this.delete_(r);if(!o)return o;if(An(this)){var a=Cn(this,{object:this.proxy_||this.target_,name:r,type:Ur,newValue:void 0});if(!a)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var c=qg(r),u={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(s){if(!Reflect.defineProperty(this.target_,r,u))return!1}else Jn(this.target_,r,u);this.values_.set(r,new Bn(i)),this.notifyPropertyAddition_(r,void 0)}finally{Tn()}return!0},e.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!$r(this.target_,r))return!0;if(An(this)){var s=Cn(this,{object:this.proxy_||this.target_,name:r,type:Vg});if(!s)return null}try{var o;Nn();var a=Un(this),c=!1,u=this.values_.get(r),d=void 0;if(!u&&(a||c)){var h;d=(h=Nu(this.target_,r))==null?void 0:h.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(u&&(this.values_.delete(r),u instanceof wi&&(d=u.value_),Qb(u)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),a||c){var p={type:Vg,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};a&&Ln(this,p)}}finally{Tn()}return!0},e.observe_=function(r,i){return ra(this,r)},e.intercept_=function(r){return na(this,r)},e.notifyPropertyAddition_=function(r,i){var s,o=Un(this),a=!1;if(o||a){var c=o||a?{type:Ur,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;o&&Ln(this,c)}(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Vo(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function Is(t,e){var n;if($r(t,Ge))return t;var r=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",i=new pw(t,new Map,String(r),eT(e));return nc(t,Ge,i),t}var qT=Ri("ObservableObjectAdministration",pw);function qg(t){return jg[t]||(jg[t]={get:function(){return this[Ge].getObservablePropValue_(t)},set:function(n){return this[Ge].setObservablePropValue_(t,n)}})}function fc(t){return tc(t)?qT(t[Ge]):!1}function Hg(t,e,n){var r;(r=t.target_[as])==null||delete r[n]}var HT=gw(0),KT=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),rd=0,mw=function(){};function zT(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}zT(mw,Array.prototype);var ch=function(t){function e(r,i,s,o){var a;return s===void 0&&(s="ObservableArray"),o===void 0&&(o=!1),a=t.call(this)||this,Fi(function(){var c=new uh(s,i,o,!0);c.proxy_=a,Rb(a,Ge,c),r&&r.length&&a.spliceWithArray(0,0,r),KT&&Object.defineProperty(a,"0",HT)}),a}Fb(e,t);var n=e.prototype;return n.concat=function(){this[Ge].atom_.reportObserved();for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(a){return dc(a)?a.slice():a}))},n[Symbol.iterator]=function(){var r=this,i=0;return Ko({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Ns(e,[{key:"length",get:function(){return this[Ge].getArrayLength_()},set:function(i){this[Ge].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(mw);Object.entries(Pu).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&nc(ch.prototype,e,n)});function gw(t){return{enumerable:!1,configurable:!0,get:function(){return this[Ge].get_(t)},set:function(n){this[Ge].set_(t,n)}}}function GT(t){Jn(ch.prototype,""+t,gw(t))}function vw(t){if(t>rd){for(var e=rd;e<t+100;e++)GT(e);rd=t}}vw(1e3);function WT(t,e,n){return new ch(t,e,n)}function yf(t,e){if(typeof t=="object"&&t!==null){if(dc(t))return e!==void 0&&mt(23),t[Ge].atom_;if(Os(t))return t.atom_;if(Di(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||mt(25,e,bf(t)),n}if(fc(t)){if(!e)return mt(26);var r=t[Ge].values_.get(e);return r||mt(27,e,bf(t)),r}if(sh(t)||uc(t)||Ru(t))return t}else if(Mn(t)&&Ru(t[Ge]))return t[Ge];mt(28)}function YT(t,e){if(t||mt(29),sh(t)||uc(t)||Ru(t)||Di(t)||Os(t))return t;if(t[Ge])return t[Ge];mt(24,t)}function bf(t,e){var n;if(e!==void 0)n=yf(t,e);else{if(cc(t))return t.name;fc(t)||Di(t)||Os(t)?n=YT(t):n=yf(t)}return n.name_}function Fi(t){var e=Pi(),n=oc(!0);Nn();try{return t()}finally{Tn(),ac(n),ar(e)}}var Kg=ec.toString;function lh(t,e,n){return n===void 0&&(n=-1),wf(t,e,n)}function wf(t,e,n,r,i){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 o=Kg.call(t);if(o!==Kg.call(e))return!1;switch(o){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=zg(t),e=zg(e);var a=o==="[object Array]";if(!a){if(typeof t!="object"||typeof e!="object")return!1;var c=t.constructor,u=e.constructor;if(c!==u&&!(Mn(c)&&c instanceof c&&Mn(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var d=r.length;d--;)if(r[d]===t)return i[d]===e;if(r.push(t),i.push(e),a){if(d=t.length,d!==e.length)return!1;for(;d--;)if(!wf(t[d],e[d],n-1,r,i))return!1}else{var h=Object.keys(t),p;if(d=h.length,Object.keys(e).length!==d)return!1;for(;d--;)if(p=h[d],!($r(e,p)&&wf(t[p],e[p],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function zg(t){return dc(t)?t.slice():xs(t)||Di(t)||nr(t)||Os(t)?Array.from(t.entries()):t}function Ko(t){return t[Symbol.iterator]=JT,t}function JT(){return this}["Symbol","Map","Set"].forEach(function(t){var e=xb();typeof e[t]=="undefined"&&mt("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:vT,extras:{getDebugName:bf},$mobx:Ge});function XT(t,e=[]){st.useEffect(()=>{const n=lc(t);return()=>n()},e)}function yw(t,e={}){const{defaultValue:n,deps:r=[]}=e,i=st.useMemo(()=>t,r),[s,o]=st.useState(()=>i()||n);return st.useEffect(()=>{const a=lc(()=>o(i()));return()=>a()},[i,...r]),s}function QT(t,e,n=[]){const r=st.useMemo(()=>t,n),i=st.useMemo(()=>e,n);st.useEffect(()=>{const s=iw(r,i);return()=>s()},[r,i])}let dh=new Map;const _f=st.createContext(dh),ZT=({children:t,stores:e})=>{const n=st.useContext(_f),r=st.useMemo(()=>{const i=new Map;return e.forEach(s=>i.set(s.class,s.value)),dh=new Map([...n,...i])},[]);return Q0.jsx(_f.Provider,{value:r,children:t})};function eO(t){return st.useContext(_f).get(t)}function tO(t){return dh.get(t)}var fu={exports:{}},nO=fu.exports,Gg;function rO(){return Gg||(Gg=1,function(t,e){(function(n,r){t.exports=r()})(nO,function(){var n=function(l,f){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,b){m.__proto__=b}||function(m,b){for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(m[S]=b[S])})(l,f)},r=function(){return(r=Object.assign||function(l){for(var f,m=1,b=arguments.length;m<b;m++)for(var S in f=arguments[m])Object.prototype.hasOwnProperty.call(f,S)&&(l[S]=f[S]);return l}).apply(this,arguments)};function i(l,f,m){for(var b,S=0,A=f.length;S<A;S++)!b&&S in f||((b=b||Array.prototype.slice.call(f,0,S))[S]=f[S]);return l.concat(b||Array.prototype.slice.call(f))}var s=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:Mr,o=Object.keys,a=Array.isArray;function c(l,f){return typeof f!="object"||o(f).forEach(function(m){l[m]=f[m]}),l}typeof Promise=="undefined"||s.Promise||(s.Promise=Promise);var u=Object.getPrototypeOf,d={}.hasOwnProperty;function h(l,f){return d.call(l,f)}function p(l,f){typeof f=="function"&&(f=f(u(l))),(typeof Reflect=="undefined"?o:Reflect.ownKeys)(f).forEach(function(m){v(l,m,f[m])})}var y=Object.defineProperty;function v(l,f,m,b){y(l,f,c(m&&h(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},b))}function w(l){return{from:function(f){return l.prototype=Object.create(f.prototype),v(l.prototype,"constructor",l),{extend:p.bind(null,l.prototype)}}}}var k=Object.getOwnPropertyDescriptor,C=[].slice;function E(l,f,m){return C.call(l,f,m)}function O(l,f){return f(l)}function I(l){if(!l)throw new Error("Assertion Failed")}function M(l){s.setImmediate?setImmediate(l):setTimeout(l,0)}function Y(l,f){if(typeof f=="string"&&h(l,f))return l[f];if(!f)return l;if(typeof f!="string"){for(var m=[],b=0,S=f.length;b<S;++b){var A=Y(l,f[b]);m.push(A)}return m}var T=f.indexOf(".");if(T!==-1){var P=l[f.substr(0,T)];return P==null?void 0:Y(P,f.substr(T+1))}}function ee(l,f,m){if(l&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(l)))if(typeof f!="string"&&"length"in f){I(typeof m!="string"&&"length"in m);for(var b=0,S=f.length;b<S;++b)ee(l,f[b],m[b])}else{var A,T,P=f.indexOf(".");P!==-1?(A=f.substr(0,P),(T=f.substr(P+1))===""?m===void 0?a(l)&&!isNaN(parseInt(A))?l.splice(A,1):delete l[A]:l[A]=m:ee(P=!(P=l[A])||!h(l,A)?l[A]={}:P,T,m)):m===void 0?a(l)&&!isNaN(parseInt(f))?l.splice(f,1):delete l[f]:l[f]=m}}function F(l){var f,m={};for(f in l)h(l,f)&&(m[f]=l[f]);return m}var se=[].concat;function H(l){return se.apply([],l)}var tt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(H([8,16,32,64].map(function(l){return["Int","Uint","Float"].map(function(f){return f+l+"Array"})}))).filter(function(l){return s[l]}),ie=new Set(tt.map(function(l){return s[l]})),xe=null;function qe(l){return xe=new WeakMap,l=function f(m){if(!m||typeof m!="object")return m;var b=xe.get(m);if(b)return b;if(a(m)){b=[],xe.set(m,b);for(var S=0,A=m.length;S<A;++S)b.push(f(m[S]))}else if(ie.has(m.constructor))b=m;else{var T,P=u(m);for(T in b=P===Object.prototype?{}:Object.create(P),xe.set(m,b),m)h(m,T)&&(b[T]=f(m[T]))}return b}(l),xe=null,l}var G={}.toString;function R(l){return G.call(l).slice(8,-1)}var Q=typeof Symbol!="undefined"?Symbol.iterator:"@@iterator",te=typeof Q=="symbol"?function(l){var f;return l!=null&&(f=l[Q])&&f.apply(l)}:function(){return null};function ge(l,f){return f=l.indexOf(f),0<=f&&l.splice(f,1),0<=f}var ve={};function U(l){var f,m,b,S;if(arguments.length===1){if(a(l))return l.slice();if(this===ve&&typeof l=="string")return[l];if(S=te(l)){for(m=[];!(b=S.next()).done;)m.push(b.value);return m}if(l==null)return[l];if(typeof(f=l.length)!="number")return[l];for(m=new Array(f);f--;)m[f]=l[f];return m}for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var de=typeof Symbol!="undefined"?function(l){return l[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},We=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Sn=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(We),Se={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Fe(l,f){this.name=l,this.message=f}function L(l,f){return l+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,b,S){return S.indexOf(m)===b}).join(`
|
|
125
|
-
`)}function X(l,f,m,b){this.failures=f,this.failedKeys=b,this.successCount=m,this.message=L(l,f)}function He(l,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=L(l,this.failures)}w(Fe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),w(X).from(Fe),w(He).from(Fe);var Ne=Sn.reduce(function(l,f){return l[f]=f+"Error",l},{}),Ve=Fe,Ae=Sn.reduce(function(l,f){var m=f+"Error";function b(S,A){this.name=m,S?typeof S=="string"?(this.message="".concat(S).concat(A?`
|
|
126
|
-
`+A:""),this.inner=A||null):typeof S=="object"&&(this.message="".concat(S.name," ").concat(S.message),this.inner=S):(this.message=Se[f]||m,this.inner=null)}return w(b).from(Ve),l[f]=b,l},{});Ae.Syntax=SyntaxError,Ae.Type=TypeError,Ae.Range=RangeError;var Ze=We.reduce(function(l,f){return l[f+"Error"]=Ae[f],l},{}),Ke=Sn.reduce(function(l,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(l[f+"Error"]=Ae[f]),l},{});function Ie(){}function at(l){return l}function ct(l,f){return l==null||l===at?f:function(m){return f(l(m))}}function Ue(l,f){return function(){l.apply(this,arguments),f.apply(this,arguments)}}function lt(l,f){return l===Ie?f:function(){var m=l.apply(this,arguments);m!==void 0&&(arguments[0]=m);var b=this.onsuccess,S=this.onerror;this.onsuccess=null,this.onerror=null;var A=f.apply(this,arguments);return b&&(this.onsuccess=this.onsuccess?Ue(b,this.onsuccess):b),S&&(this.onerror=this.onerror?Ue(S,this.onerror):S),A!==void 0?A:m}}function vt(l,f){return l===Ie?f:function(){l.apply(this,arguments);var m=this.onsuccess,b=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?Ue(m,this.onsuccess):m),b&&(this.onerror=this.onerror?Ue(b,this.onerror):b)}}function x(l,f){return l===Ie?f:function(m){var b=l.apply(this,arguments);c(m,b);var S=this.onsuccess,A=this.onerror;return this.onsuccess=null,this.onerror=null,m=f.apply(this,arguments),S&&(this.onsuccess=this.onsuccess?Ue(S,this.onsuccess):S),A&&(this.onerror=this.onerror?Ue(A,this.onerror):A),b===void 0?m===void 0?void 0:m:c(b,m)}}function _(l,f){return l===Ie?f:function(){return f.apply(this,arguments)!==!1&&l.apply(this,arguments)}}function g(l,f){return l===Ie?f:function(){var m=l.apply(this,arguments);if(m&&typeof m.then=="function"){for(var b=this,S=arguments.length,A=new Array(S);S--;)A[S]=arguments[S];return m.then(function(){return f.apply(b,A)})}return f.apply(this,arguments)}}Ke.ModifyError=X,Ke.DexieError=Fe,Ke.BulkError=He;var N=typeof location!="undefined"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function V(l){N=l}var ae={},ue=100,tt=typeof Promise=="undefined"?[]:function(){var l=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[l,u(l),l];var f=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[f,u(f),l]}(),We=tt[0],Sn=tt[1],tt=tt[2],Sn=Sn&&Sn.then,dt=We&&We.constructor,Ut=!!tt,bt=function(l,f){Us.push([l,f]),Gr&&(queueMicrotask(C0),Gr=!1)},gr=!0,Gr=!0,qn=[],ua=[],Dc=at,vr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},je=vr,Us=[],Wr=0,ca=[];function De(l){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=je;if(typeof l!="function"){if(l!==ae)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Uc(this,this._value))}this._state=null,this._value=null,++f.ref,function m(b,S){try{S(function(A){if(b._state===null){if(A===b)throw new TypeError("A promise cannot be resolved with itself.");var T=b._lib&&Ui();A&&typeof A.then=="function"?m(b,function(P,B){A instanceof De?A._then(P,B):A.then(P,B)}):(b._state=!0,b._value=A,Lh(b)),T&&Li()}},Uc.bind(null,b))}catch(A){Uc(b,A)}}(this,l)}var Fc={get:function(){var l=je,f=ha;function m(b,S){var A=this,T=!l.global&&(l!==je||f!==ha),P=T&&!br(),B=new De(function(j,z){Lc(A,new Uh(Bh(b,l,T,P),Bh(S,l,T,P),j,z,l))});return this._consoleTask&&(B._consoleTask=this._consoleTask),B}return m.prototype=ae,m},set:function(l){v(this,"then",l&&l.prototype===ae?Fc:{get:function(){return l},set:Fc.set})}};function Uh(l,f,m,b,S){this.onFulfilled=typeof l=="function"?l:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=b,this.psd=S}function Uc(l,f){var m,b;ua.push(f),l._state===null&&(m=l._lib&&Ui(),f=Dc(f),l._state=!1,l._value=f,b=l,qn.some(function(S){return S._value===b._value})||qn.push(b),Lh(l),m&&Li())}function Lh(l){var f=l._listeners;l._listeners=[];for(var m=0,b=f.length;m<b;++m)Lc(l,f[m]);var S=l._PSD;--S.ref||S.finalize(),Wr===0&&(++Wr,bt(function(){--Wr==0&&Mc()},[]))}function Lc(l,f){if(l._state!==null){var m=l._state?f.onFulfilled:f.onRejected;if(m===null)return(l._state?f.resolve:f.reject)(l._value);++f.psd.ref,++Wr,bt(A0,[m,l,f])}else l._listeners.push(f)}function A0(l,f,m){try{var b,S=f._value;!f._state&&ua.length&&(ua=[]),b=N&&f._consoleTask?f._consoleTask.run(function(){return l(S)}):l(S),f._state||ua.indexOf(S)!==-1||function(A){for(var T=qn.length;T;)if(qn[--T]._value===A._value)return qn.splice(T,1)}(f),m.resolve(b)}catch(A){m.reject(A)}finally{--Wr==0&&Mc(),--m.psd.ref||m.psd.finalize()}}function C0(){Yr(vr,function(){Ui()&&Li()})}function Ui(){var l=gr;return Gr=gr=!1,l}function Li(){var l,f,m;do for(;0<Us.length;)for(l=Us,Us=[],m=l.length,f=0;f<m;++f){var b=l[f];b[0].apply(null,b[1])}while(0<Us.length);Gr=gr=!0}function Mc(){var l=qn;qn=[],l.forEach(function(b){b._PSD.onunhandled.call(null,b._value,b)});for(var f=ca.slice(0),m=f.length;m;)f[--m]()}function la(l){return new De(ae,!1,l)}function Ot(l,f){var m=je;return function(){var b=Ui(),S=je;try{return wr(m,!0),l.apply(this,arguments)}catch(A){f&&f(A)}finally{wr(S,!1),b&&Li()}}}p(De.prototype,{then:Fc,_then:function(l,f){Lc(this,new Uh(null,null,l,f,je))},catch:function(l){if(arguments.length===1)return this.then(null,l);var f=l,m=arguments[1];return typeof f=="function"?this.then(null,function(b){return(b instanceof f?m:la)(b)}):this.then(null,function(b){return(b&&b.name===f?m:la)(b)})},finally:function(l){return this.then(function(f){return De.resolve(l()).then(function(){return f})},function(f){return De.resolve(l()).then(function(){return la(f)})})},timeout:function(l,f){var m=this;return l<1/0?new De(function(b,S){var A=setTimeout(function(){return S(new Ae.Timeout(f))},l);m.then(b,S).finally(clearTimeout.bind(null,A))}):this}}),typeof Symbol!="undefined"&&Symbol.toStringTag&&v(De.prototype,Symbol.toStringTag,"Dexie.Promise"),vr.env=Mh(),p(De,{all:function(){var l=U.apply(null,arguments).map(pa);return new De(function(f,m){l.length===0&&f([]);var b=l.length;l.forEach(function(S,A){return De.resolve(S).then(function(T){l[A]=T,--b||f(l)},m)})})},resolve:function(l){return l instanceof De?l:l&&typeof l.then=="function"?new De(function(f,m){l.then(f,m)}):new De(ae,!0,l)},reject:la,race:function(){var l=U.apply(null,arguments).map(pa);return new De(function(f,m){l.map(function(b){return De.resolve(b).then(f,m)})})},PSD:{get:function(){return je},set:function(l){return je=l}},totalEchoes:{get:function(){return ha}},newPSD:yr,usePSD:Yr,scheduler:{get:function(){return bt},set:function(l){bt=l}},rejectionMapper:{get:function(){return Dc},set:function(l){Dc=l}},follow:function(l,f){return new De(function(m,b){return yr(function(S,A){var T=je;T.unhandleds=[],T.onunhandled=A,T.finalize=Ue(function(){var P,B=this;P=function(){B.unhandleds.length===0?S():A(B.unhandleds[0])},ca.push(function j(){P(),ca.splice(ca.indexOf(j),1)}),++Wr,bt(function(){--Wr==0&&Mc()},[])},T.finalize),l()},f,m,b)})}}),dt&&(dt.allSettled&&v(De,"allSettled",function(){var l=U.apply(null,arguments).map(pa);return new De(function(f){l.length===0&&f([]);var m=l.length,b=new Array(m);l.forEach(function(S,A){return De.resolve(S).then(function(T){return b[A]={status:"fulfilled",value:T}},function(T){return b[A]={status:"rejected",reason:T}}).then(function(){return--m||f(b)})})})}),dt.any&&typeof AggregateError!="undefined"&&v(De,"any",function(){var l=U.apply(null,arguments).map(pa);return new De(function(f,m){l.length===0&&m(new AggregateError([]));var b=l.length,S=new Array(b);l.forEach(function(A,T){return De.resolve(A).then(function(P){return f(P)},function(P){S[T]=P,--b||m(new AggregateError(S))})})})}),dt.withResolvers&&(De.withResolvers=dt.withResolvers));var $t={awaits:0,echoes:0,id:0},x0=0,da=[],fa=0,ha=0,N0=0;function yr(l,f,m,b){var S=je,A=Object.create(S);return A.parent=S,A.ref=0,A.global=!1,A.id=++N0,vr.env,A.env=Ut?{Promise:De,PromiseProp:{value:De,configurable:!0,writable:!0},all:De.all,race:De.race,allSettled:De.allSettled,any:De.any,resolve:De.resolve,reject:De.reject}:{},f&&c(A,f),++S.ref,A.finalize=function(){--this.parent.ref||this.parent.finalize()},b=Yr(A,l,m,b),A.ref===0&&A.finalize(),b}function Mi(){return $t.id||($t.id=++x0),++$t.awaits,$t.echoes+=ue,$t.id}function br(){return!!$t.awaits&&(--$t.awaits==0&&($t.id=0),$t.echoes=$t.awaits*ue,!0)}function pa(l){return $t.echoes&&l&&l.constructor===dt?(Mi(),l.then(function(f){return br(),f},function(f){return br(),Pt(f)})):l}function T0(){var l=da[da.length-1];da.pop(),wr(l,!1)}function wr(l,f){var m,b=je;(f?!$t.echoes||fa++&&l===je:!fa||--fa&&l===je)||queueMicrotask(f?function(S){++ha,$t.echoes&&--$t.echoes!=0||($t.echoes=$t.awaits=$t.id=0),da.push(je),wr(S,!0)}.bind(null,l):T0),l!==je&&(je=l,b===vr&&(vr.env=Mh()),Ut&&(m=vr.env.Promise,f=l.env,(b.global||l.global)&&(Object.defineProperty(s,"Promise",f.PromiseProp),m.all=f.all,m.race=f.race,m.resolve=f.resolve,m.reject=f.reject,f.allSettled&&(m.allSettled=f.allSettled),f.any&&(m.any=f.any))))}function Mh(){var l=s.Promise;return Ut?{Promise:l,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:l.all,race:l.race,allSettled:l.allSettled,any:l.any,resolve:l.resolve,reject:l.reject}:{}}function Yr(l,f,m,b,S){var A=je;try{return wr(l,!0),f(m,b,S)}finally{wr(A,!1)}}function Bh(l,f,m,b){return typeof l!="function"?l:function(){var S=je;m&&Mi(),wr(f,!0);try{return l.apply(this,arguments)}finally{wr(S,!1),b&&queueMicrotask(br)}}}function Bc(l){Promise===dt&&$t.echoes===0?fa===0?l():enqueueNativeMicroTask(l):setTimeout(l,0)}(""+Sn).indexOf("[native code]")===-1&&(Mi=br=Ie);var Pt=De.reject,Jr="",Zn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$h="String expected.",Bi=[],ma="__dbnames",$c="readonly",jc="readwrite";function Xr(l,f){return l?f?function(){return l.apply(this,arguments)&&f.apply(this,arguments)}:l:f}var jh={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ga(l){return typeof l!="string"||/\./.test(l)?function(f){return f}:function(f){return f[l]===void 0&&l in f&&delete(f=qe(f))[l],f}}function Vh(){throw Ae.Type()}function ut(l,f){try{var m=qh(l),b=qh(f);if(m!==b)return m==="Array"?1:b==="Array"?-1:m==="binary"?1:b==="binary"?-1:m==="string"?1:b==="string"?-1:m==="Date"?1:b!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<l?1:l<f?-1:0;case"binary":return function(S,A){for(var T=S.length,P=A.length,B=T<P?T:P,j=0;j<B;++j)if(S[j]!==A[j])return S[j]<A[j]?-1:1;return T===P?0:T<P?-1:1}(Hh(l),Hh(f));case"Array":return function(S,A){for(var T=S.length,P=A.length,B=T<P?T:P,j=0;j<B;++j){var z=ut(S[j],A[j]);if(z!==0)return z}return T===P?0:T<P?-1:1}(l,f)}}catch{}return NaN}function qh(l){var f=typeof l;return f!="object"?f:ArrayBuffer.isView(l)?"binary":(l=R(l),l==="ArrayBuffer"?"binary":l)}function Hh(l){return l instanceof Uint8Array?l:ArrayBuffer.isView(l)?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(l)}var Kh=(Tt.prototype._trans=function(l,f,m){var b=this._tx||je.trans,S=this.name,A=N&&typeof console!="undefined"&&console.createTask&&console.createTask("Dexie: ".concat(l==="readonly"?"read":"write"," ").concat(this.name));function T(j,z,D){if(!D.schema[S])throw new Ae.NotFound("Table "+S+" not part of transaction");return f(D.idbtrans,D)}var P=Ui();try{var B=b&&b.db._novip===this.db._novip?b===je.trans?b._promise(l,T,m):yr(function(){return b._promise(l,T,m)},{trans:b,transless:je.transless||je}):function j(z,D,J,$){if(z.idbdb&&(z._state.openComplete||je.letThrough||z._vip)){var K=z._createTransaction(D,J,z._dbSchema);try{K.create(),z._state.PR1398_maxLoop=3}catch(W){return W.name===Ne.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return j(z,D,J,$)})):Pt(W)}return K._promise(D,function(W,q){return yr(function(){return je.trans=K,$(W,q,K)})}).then(function(W){if(D==="readwrite")try{K.idbtrans.commit()}catch{}return D==="readonly"?W:K._completion.then(function(){return W})})}if(z._state.openComplete)return Pt(new Ae.DatabaseClosed(z._state.dbOpenError));if(!z._state.isBeingOpened){if(!z._state.autoOpen)return Pt(new Ae.DatabaseClosed);z.open().catch(Ie)}return z._state.dbReadyPromise.then(function(){return j(z,D,J,$)})}(this.db,l,[this.name],T);return A&&(B._consoleTask=A,B=B.catch(function(j){return console.trace(j),Pt(j)})),B}finally{P&&Li()}},Tt.prototype.get=function(l,f){var m=this;return l&&l.constructor===Object?this.where(l).first(f):l==null?Pt(new Ae.Type("Invalid argument to Table.get()")):this._trans("readonly",function(b){return m.core.get({trans:b,key:l}).then(function(S){return m.hook.reading.fire(S)})}).then(f)},Tt.prototype.where=function(l){if(typeof l=="string")return new this.db.WhereClause(this,l);if(a(l))return new this.db.WhereClause(this,"[".concat(l.join("+"),"]"));var f=o(l);if(f.length===1)return this.where(f[0]).equals(l[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(P){if(P.compound&&f.every(function(j){return 0<=P.keyPath.indexOf(j)})){for(var B=0;B<f.length;++B)if(f.indexOf(P.keyPath[B])===-1)return!1;return!0}return!1}).sort(function(P,B){return P.keyPath.length-B.keyPath.length})[0];if(m&&this.db._maxKey!==Jr){var A=m.keyPath.slice(0,f.length);return this.where(A).equals(A.map(function(B){return l[B]}))}!m&&N&&console.warn("The query ".concat(JSON.stringify(l)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var b=this.schema.idxByName;function S(P,B){return ut(P,B)===0}var T=f.reduce(function(D,B){var j=D[0],z=D[1],D=b[B],J=l[B];return[j||D,j||!D?Xr(z,D&&D.multi?function($){return $=Y($,B),a($)&&$.some(function(K){return S(J,K)})}:function($){return S(J,Y($,B))}):z]},[null,null]),A=T[0],T=T[1];return A?this.where(A.name).equals(l[A.keyPath]).filter(T):m?this.filter(T):this.where(f).equals("")},Tt.prototype.filter=function(l){return this.toCollection().and(l)},Tt.prototype.count=function(l){return this.toCollection().count(l)},Tt.prototype.offset=function(l){return this.toCollection().offset(l)},Tt.prototype.limit=function(l){return this.toCollection().limit(l)},Tt.prototype.each=function(l){return this.toCollection().each(l)},Tt.prototype.toArray=function(l){return this.toCollection().toArray(l)},Tt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Tt.prototype.orderBy=function(l){return new this.db.Collection(new this.db.WhereClause(this,a(l)?"[".concat(l.join("+"),"]"):l))},Tt.prototype.reverse=function(){return this.toCollection().reverse()},Tt.prototype.mapToClass=function(l){var f,m=this.db,b=this.name;function S(){return f!==null&&f.apply(this,arguments)||this}(this.schema.mappedClass=l).prototype instanceof Vh&&(function(B,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");function z(){this.constructor=B}n(B,j),B.prototype=j===null?Object.create(j):(z.prototype=j.prototype,new z)}(S,f=l),Object.defineProperty(S.prototype,"db",{get:function(){return m},enumerable:!1,configurable:!0}),S.prototype.table=function(){return b},l=S);for(var A=new Set,T=l.prototype;T;T=u(T))Object.getOwnPropertyNames(T).forEach(function(B){return A.add(B)});function P(B){if(!B)return B;var j,z=Object.create(l.prototype);for(j in B)if(!A.has(j))try{z[j]=B[j]}catch{}return z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=P,this.hook("reading",P),l},Tt.prototype.defineClass=function(){return this.mapToClass(function(l){c(this,l)})},Tt.prototype.add=function(l,f){var m=this,b=this.schema.primKey,S=b.auto,A=b.keyPath,T=l;return A&&S&&(T=ga(A)(l)),this._trans("readwrite",function(P){return m.core.mutate({trans:P,type:"add",keys:f!=null?[f]:null,values:[T]})}).then(function(P){return P.numFailures?De.reject(P.failures[0]):P.lastResult}).then(function(P){if(A)try{ee(l,A,P)}catch{}return P})},Tt.prototype.update=function(l,f){return typeof l!="object"||a(l)?this.where(":id").equals(l).modify(f):(l=Y(l,this.schema.primKey.keyPath),l===void 0?Pt(new Ae.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(l).modify(f))},Tt.prototype.put=function(l,f){var m=this,b=this.schema.primKey,S=b.auto,A=b.keyPath,T=l;return A&&S&&(T=ga(A)(l)),this._trans("readwrite",function(P){return m.core.mutate({trans:P,type:"put",values:[T],keys:f!=null?[f]:null})}).then(function(P){return P.numFailures?De.reject(P.failures[0]):P.lastResult}).then(function(P){if(A)try{ee(l,A,P)}catch{}return P})},Tt.prototype.delete=function(l){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[l]})}).then(function(m){return m.numFailures?De.reject(m.failures[0]):void 0})},Tt.prototype.clear=function(){var l=this;return this._trans("readwrite",function(f){return l.core.mutate({trans:f,type:"deleteRange",range:jh})}).then(function(f){return f.numFailures?De.reject(f.failures[0]):void 0})},Tt.prototype.bulkGet=function(l){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:l,trans:m}).then(function(b){return b.map(function(S){return f.hook.reading.fire(S)})})})},Tt.prototype.bulkAdd=function(l,f,m){var b=this,S=Array.isArray(f)?f:void 0,A=(m=m||(S?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(T){var j=b.schema.primKey,P=j.auto,j=j.keyPath;if(j&&S)throw new Ae.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(S&&S.length!==l.length)throw new Ae.InvalidArgument("Arguments objects and keys must have the same length");var B=l.length,j=j&&P?l.map(ga(j)):l;return b.core.mutate({trans:T,type:"add",keys:S,values:j,wantResults:A}).then(function(K){var D=K.numFailures,J=K.results,$=K.lastResult,K=K.failures;if(D===0)return A?J:$;throw new He("".concat(b.name,".bulkAdd(): ").concat(D," of ").concat(B," operations failed"),K)})})},Tt.prototype.bulkPut=function(l,f,m){var b=this,S=Array.isArray(f)?f:void 0,A=(m=m||(S?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(T){var j=b.schema.primKey,P=j.auto,j=j.keyPath;if(j&&S)throw new Ae.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(S&&S.length!==l.length)throw new Ae.InvalidArgument("Arguments objects and keys must have the same length");var B=l.length,j=j&&P?l.map(ga(j)):l;return b.core.mutate({trans:T,type:"put",keys:S,values:j,wantResults:A}).then(function(K){var D=K.numFailures,J=K.results,$=K.lastResult,K=K.failures;if(D===0)return A?J:$;throw new He("".concat(b.name,".bulkPut(): ").concat(D," of ").concat(B," operations failed"),K)})})},Tt.prototype.bulkUpdate=function(l){var f=this,m=this.core,b=l.map(function(T){return T.key}),S=l.map(function(T){return T.changes}),A=[];return this._trans("readwrite",function(T){return m.getMany({trans:T,keys:b,cache:"clone"}).then(function(P){var B=[],j=[];l.forEach(function(D,J){var $=D.key,K=D.changes,W=P[J];if(W){for(var q=0,Z=Object.keys(K);q<Z.length;q++){var ne=Z[q],re=K[ne];if(ne===f.schema.primKey.keyPath){if(ut(re,$)!==0)throw new Ae.Constraint("Cannot update primary key in bulkUpdate()")}else ee(W,ne,re)}A.push(J),B.push($),j.push(W)}});var z=B.length;return m.mutate({trans:T,type:"put",keys:B,values:j,updates:{keys:b,changeSpecs:S}}).then(function(D){var J=D.numFailures,$=D.failures;if(J===0)return z;for(var K=0,W=Object.keys($);K<W.length;K++){var q,Z=W[K],ne=A[Number(Z)];ne!=null&&(q=$[Z],delete $[Z],$[ne]=q)}throw new He("".concat(f.name,".bulkUpdate(): ").concat(J," of ").concat(z," operations failed"),$)})})})},Tt.prototype.bulkDelete=function(l){var f=this,m=l.length;return this._trans("readwrite",function(b){return f.core.mutate({trans:b,type:"delete",keys:l})}).then(function(T){var S=T.numFailures,A=T.lastResult,T=T.failures;if(S===0)return A;throw new He("".concat(f.name,".bulkDelete(): ").concat(S," of ").concat(m," operations failed"),T)})},Tt);function Tt(){}function Ls(l){function f(T,P){if(P){for(var B=arguments.length,j=new Array(B-1);--B;)j[B-1]=arguments[B];return m[T].subscribe.apply(null,j),l}if(typeof T=="string")return m[T]}var m={};f.addEventType=A;for(var b=1,S=arguments.length;b<S;++b)A(arguments[b]);return f;function A(T,P,B){if(typeof T!="object"){var j;P=P||_;var z={subscribers:[],fire:B=B||Ie,subscribe:function(D){z.subscribers.indexOf(D)===-1&&(z.subscribers.push(D),z.fire=P(z.fire,D))},unsubscribe:function(D){z.subscribers=z.subscribers.filter(function(J){return J!==D}),z.fire=z.subscribers.reduce(P,B)}};return m[T]=f[T]=z}o(j=T).forEach(function(D){var J=j[D];if(a(J))A(D,j[D][0],j[D][1]);else{if(J!=="asap")throw new Ae.InvalidArgument("Invalid event config");var $=A(D,at,function(){for(var K=arguments.length,W=new Array(K);K--;)W[K]=arguments[K];$.subscribers.forEach(function(q){M(function(){q.apply(null,W)})})})}})}}function Ms(l,f){return w(f).from({prototype:l}),f}function $i(l,f){return!(l.filter||l.algorithm||l.or)&&(f?l.justLimit:!l.replayFilter)}function Vc(l,f){l.filter=Xr(l.filter,f)}function qc(l,f,m){var b=l.replayFilter;l.replayFilter=b?function(){return Xr(b(),f())}:f,l.justLimit=m&&!b}function va(l,f){if(l.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(l.index);if(!m)throw new Ae.Schema("KeyPath "+l.index+" on object store "+f.name+" is not indexed");return m}function zh(l,f,m){var b=va(l,f.schema);return f.openCursor({trans:m,values:!l.keysOnly,reverse:l.dir==="prev",unique:!!l.unique,query:{index:b,range:l.range}})}function ya(l,f,m,b){var S=l.replayFilter?Xr(l.filter,l.replayFilter()):l.filter;if(l.or){var A={},T=function(P,B,j){var z,D;S&&!S(B,j,function(J){return B.stop(J)},function(J){return B.fail(J)})||((D=""+(z=B.primaryKey))=="[object ArrayBuffer]"&&(D=""+new Uint8Array(z)),h(A,D)||(A[D]=!0,f(P,B,j)))};return Promise.all([l.or._iterate(T,m),Gh(zh(l,b,m),l.algorithm,T,!l.keysOnly&&l.valueMapper)])}return Gh(zh(l,b,m),Xr(l.algorithm,S),f,!l.keysOnly&&l.valueMapper)}function Gh(l,f,m,b){var S=Ot(b?function(A,T,P){return m(b(A),T,P)}:m);return l.then(function(A){if(A)return A.start(function(){var T=function(){return A.continue()};f&&!f(A,function(P){return T=P},function(P){A.stop(P),T=Ie},function(P){A.fail(P),T=Ie})||S(A.value,A,function(P){return T=P}),T()})})}var Bs=(Wh.prototype.execute=function(l){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(a(m))return i(i([],a(l)?l:[],!0),m).sort();if(typeof m=="number")return(Number(l)||0)+m;if(typeof m=="bigint")try{return BigInt(l)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var b=f.remove;if(a(b))return a(l)?l.filter(function(S){return!b.includes(S)}).sort():[];if(typeof b=="number")return Number(l)-b;if(typeof b=="bigint")try{return BigInt(l)-b}catch{return BigInt(0)-b}throw new TypeError("Invalid subtrahend ".concat(b))}return m=(m=f.replacePrefix)===null||m===void 0?void 0:m[0],m&&typeof l=="string"&&l.startsWith(m)?f.replacePrefix[1]+l.substring(m.length):l},Wh);function Wh(l){this["@@propmod"]=l}var O0=(ft.prototype._read=function(l,f){var m=this._ctx;return m.error?m.table._trans(null,Pt.bind(null,m.error)):m.table._trans("readonly",l).then(f)},ft.prototype._write=function(l){var f=this._ctx;return f.error?f.table._trans(null,Pt.bind(null,f.error)):f.table._trans("readwrite",l,"locked")},ft.prototype._addAlgorithm=function(l){var f=this._ctx;f.algorithm=Xr(f.algorithm,l)},ft.prototype._iterate=function(l,f){return ya(this._ctx,l,f,this._ctx.table.core)},ft.prototype.clone=function(l){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return l&&c(m,l),f._ctx=m,f},ft.prototype.raw=function(){return this._ctx.valueMapper=null,this},ft.prototype.each=function(l){var f=this._ctx;return this._read(function(m){return ya(f,l,m,f.table.core)})},ft.prototype.count=function(l){var f=this;return this._read(function(m){var b=f._ctx,S=b.table.core;if($i(b,!0))return S.count({trans:m,query:{index:va(b,S.schema),range:b.range}}).then(function(T){return Math.min(T,b.limit)});var A=0;return ya(b,function(){return++A,!1},m,S).then(function(){return A})}).then(l)},ft.prototype.sortBy=function(l,f){var m=l.split(".").reverse(),b=m[0],S=m.length-1;function A(B,j){return j?A(B[m[j]],j-1):B[b]}var T=this._ctx.dir==="next"?1:-1;function P(B,j){return ut(A(B,S),A(j,S))*T}return this.toArray(function(B){return B.sort(P)}).then(f)},ft.prototype.toArray=function(l){var f=this;return this._read(function(m){var b=f._ctx;if(b.dir==="next"&&$i(b,!0)&&0<b.limit){var S=b.valueMapper,A=va(b,b.table.core.schema);return b.table.core.query({trans:m,limit:b.limit,values:!0,query:{index:A,range:b.range}}).then(function(P){return P=P.result,S?P.map(S):P})}var T=[];return ya(b,function(P){return T.push(P)},m,b.table.core).then(function(){return T})},l)},ft.prototype.offset=function(l){var f=this._ctx;return l<=0||(f.offset+=l,$i(f)?qc(f,function(){var m=l;return function(b,S){return m===0||(m===1?--m:S(function(){b.advance(m),m=0}),!1)}}):qc(f,function(){var m=l;return function(){return--m<0}})),this},ft.prototype.limit=function(l){return this._ctx.limit=Math.min(this._ctx.limit,l),qc(this._ctx,function(){var f=l;return function(m,b,S){return--f<=0&&b(S),0<=f}},!0),this},ft.prototype.until=function(l,f){return Vc(this._ctx,function(m,b,S){return!l(m.value)||(b(S),f)}),this},ft.prototype.first=function(l){return this.limit(1).toArray(function(f){return f[0]}).then(l)},ft.prototype.last=function(l){return this.reverse().first(l)},ft.prototype.filter=function(l){var f;return Vc(this._ctx,function(m){return l(m.value)}),(f=this._ctx).isMatch=Xr(f.isMatch,l),this},ft.prototype.and=function(l){return this.filter(l)},ft.prototype.or=function(l){return new this.db.WhereClause(this._ctx.table,l,this)},ft.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ft.prototype.desc=function(){return this.reverse()},ft.prototype.eachKey=function(l){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,b){l(b.key,b)})},ft.prototype.eachUniqueKey=function(l){return this._ctx.unique="unique",this.eachKey(l)},ft.prototype.eachPrimaryKey=function(l){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,b){l(b.primaryKey,b)})},ft.prototype.keys=function(l){var f=this._ctx;f.keysOnly=!f.isMatch;var m=[];return this.each(function(b,S){m.push(S.key)}).then(function(){return m}).then(l)},ft.prototype.primaryKeys=function(l){var f=this._ctx;if(f.dir==="next"&&$i(f,!0)&&0<f.limit)return this._read(function(b){var S=va(f,f.table.core.schema);return f.table.core.query({trans:b,values:!1,limit:f.limit,query:{index:S,range:f.range}})}).then(function(b){return b.result}).then(l);f.keysOnly=!f.isMatch;var m=[];return this.each(function(b,S){m.push(S.primaryKey)}).then(function(){return m}).then(l)},ft.prototype.uniqueKeys=function(l){return this._ctx.unique="unique",this.keys(l)},ft.prototype.firstKey=function(l){return this.limit(1).keys(function(f){return f[0]}).then(l)},ft.prototype.lastKey=function(l){return this.reverse().firstKey(l)},ft.prototype.distinct=function(){var l=this._ctx,l=l.index&&l.table.schema.idxByName[l.index];if(!l||!l.multi)return this;var f={};return Vc(this._ctx,function(S){var b=S.primaryKey.toString(),S=h(f,b);return f[b]=!0,!S}),this},ft.prototype.modify=function(l){var f=this,m=this._ctx;return this._write(function(b){var S,A,T;T=typeof l=="function"?l:(S=o(l),A=S.length,function(q){for(var Z=!1,ne=0;ne<A;++ne){var re=S[ne],ce=l[re],ke=Y(q,re);ce instanceof Bs?(ee(q,re,ce.execute(ke)),Z=!0):ke!==ce&&(ee(q,re,ce),Z=!0)}return Z});var P=m.table.core,D=P.schema.primaryKey,B=D.outbound,j=D.extractKey,z=200,D=f.db._options.modifyChunkSize;D&&(z=typeof D=="object"?D[P.name]||D["*"]||200:D);function J(q,re){var ne=re.failures,re=re.numFailures;K+=q-re;for(var ce=0,ke=o(ne);ce<ke.length;ce++){var Oe=ke[ce];$.push(ne[Oe])}}var $=[],K=0,W=[];return f.clone().primaryKeys().then(function(q){function Z(re){var ce=Math.min(z,q.length-re);return P.getMany({trans:b,keys:q.slice(re,re+ce),cache:"immutable"}).then(function(ke){for(var Oe=[],Ee=[],Ce=B?[]:null,Re=[],Te=0;Te<ce;++Te){var Le=ke[Te],Je={value:qe(Le),primKey:q[re+Te]};T.call(Je,Je.value,Je)!==!1&&(Je.value==null?Re.push(q[re+Te]):B||ut(j(Le),j(Je.value))===0?(Ee.push(Je.value),B&&Ce.push(q[re+Te])):(Re.push(q[re+Te]),Oe.push(Je.value)))}return Promise.resolve(0<Oe.length&&P.mutate({trans:b,type:"add",values:Oe}).then(function(nt){for(var rt in nt.failures)Re.splice(parseInt(rt),1);J(Oe.length,nt)})).then(function(){return(0<Ee.length||ne&&typeof l=="object")&&P.mutate({trans:b,type:"put",keys:Ce,values:Ee,criteria:ne,changeSpec:typeof l!="function"&&l,isAdditionalChunk:0<re}).then(function(nt){return J(Ee.length,nt)})}).then(function(){return(0<Re.length||ne&&l===Hc)&&P.mutate({trans:b,type:"delete",keys:Re,criteria:ne,isAdditionalChunk:0<re}).then(function(nt){return J(Re.length,nt)})}).then(function(){return q.length>re+ce&&Z(re+z)})})}var ne=$i(m)&&m.limit===1/0&&(typeof l!="function"||l===Hc)&&{index:m.index,range:m.range};return Z(0).then(function(){if(0<$.length)throw new X("Error modifying one or more objects",$,K,W);return q.length})})})},ft.prototype.delete=function(){var l=this._ctx,f=l.range;return $i(l)&&(l.isPrimKey||f.type===3)?this._write(function(m){var b=l.table.core.schema.primaryKey,S=f;return l.table.core.count({trans:m,query:{index:b,range:S}}).then(function(A){return l.table.core.mutate({trans:m,type:"deleteRange",range:S}).then(function(T){var P=T.failures;if(T.lastResult,T.results,T=T.numFailures,T)throw new X("Could not delete some values",Object.keys(P).map(function(B){return P[B]}),A-T);return A-T})})}):this.modify(Hc)},ft);function ft(){}var Hc=function(l,f){return f.value=null};function I0(l,f){return l<f?-1:l===f?0:1}function R0(l,f){return f<l?-1:l===f?0:1}function mn(l,f,m){return l=l instanceof Jh?new l.Collection(l):l,l._ctx.error=new(m||TypeError)(f),l}function ji(l){return new l.Collection(l,function(){return Yh("")}).limit(0)}function ba(l,f,m,b){var S,A,T,P,B,j,z,D=m.length;if(!m.every(function(K){return typeof K=="string"}))return mn(l,$h);function J(K){S=K==="next"?function(q){return q.toUpperCase()}:function(q){return q.toLowerCase()},A=K==="next"?function(q){return q.toLowerCase()}:function(q){return q.toUpperCase()},T=K==="next"?I0:R0;var W=m.map(function(q){return{lower:A(q),upper:S(q)}}).sort(function(q,Z){return T(q.lower,Z.lower)});P=W.map(function(q){return q.upper}),B=W.map(function(q){return q.lower}),z=(j=K)==="next"?"":b}J("next"),l=new l.Collection(l,function(){return _r(P[0],B[D-1]+b)}),l._ondirectionchange=function(K){J(K)};var $=0;return l._addAlgorithm(function(K,W,q){var Z=K.key;if(typeof Z!="string")return!1;var ne=A(Z);if(f(ne,B,$))return!0;for(var re=null,ce=$;ce<D;++ce){var ke=function(Oe,Ee,Ce,Re,Te,Le){for(var Je=Math.min(Oe.length,Re.length),nt=-1,rt=0;rt<Je;++rt){var gn=Ee[rt];if(gn!==Re[rt])return Te(Oe[rt],Ce[rt])<0?Oe.substr(0,rt)+Ce[rt]+Ce.substr(rt+1):Te(Oe[rt],Re[rt])<0?Oe.substr(0,rt)+Re[rt]+Ce.substr(rt+1):0<=nt?Oe.substr(0,nt)+Ee[nt]+Ce.substr(nt+1):null;Te(Oe[rt],gn)<0&&(nt=rt)}return Je<Re.length&&Le==="next"?Oe+Ce.substr(Oe.length):Je<Oe.length&&Le==="prev"?Oe.substr(0,Ce.length):nt<0?null:Oe.substr(0,nt)+Re[nt]+Ce.substr(nt+1)}(Z,ne,P[ce],B[ce],T,j);ke===null&&re===null?$=ce+1:(re===null||0<T(re,ke))&&(re=ke)}return W(re!==null?function(){K.continue(re+z)}:q),!1}),l}function _r(l,f,m,b){return{type:2,lower:l,upper:f,lowerOpen:m,upperOpen:b}}function Yh(l){return{type:1,lower:l,upper:l}}var Jh=(Object.defineProperty(jt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),jt.prototype.between=function(l,f,m,b){m=m!==!1,b=b===!0;try{return 0<this._cmp(l,f)||this._cmp(l,f)===0&&(m||b)&&(!m||!b)?ji(this):new this.Collection(this,function(){return _r(l,f,!m,!b)})}catch{return mn(this,Zn)}},jt.prototype.equals=function(l){return l==null?mn(this,Zn):new this.Collection(this,function(){return Yh(l)})},jt.prototype.above=function(l){return l==null?mn(this,Zn):new this.Collection(this,function(){return _r(l,void 0,!0)})},jt.prototype.aboveOrEqual=function(l){return l==null?mn(this,Zn):new this.Collection(this,function(){return _r(l,void 0,!1)})},jt.prototype.below=function(l){return l==null?mn(this,Zn):new this.Collection(this,function(){return _r(void 0,l,!1,!0)})},jt.prototype.belowOrEqual=function(l){return l==null?mn(this,Zn):new this.Collection(this,function(){return _r(void 0,l)})},jt.prototype.startsWith=function(l){return typeof l!="string"?mn(this,$h):this.between(l,l+Jr,!0,!0)},jt.prototype.startsWithIgnoreCase=function(l){return l===""?this.startsWith(l):ba(this,function(f,m){return f.indexOf(m[0])===0},[l],Jr)},jt.prototype.equalsIgnoreCase=function(l){return ba(this,function(f,m){return f===m[0]},[l],"")},jt.prototype.anyOfIgnoreCase=function(){var l=U.apply(ve,arguments);return l.length===0?ji(this):ba(this,function(f,m){return m.indexOf(f)!==-1},l,"")},jt.prototype.startsWithAnyOfIgnoreCase=function(){var l=U.apply(ve,arguments);return l.length===0?ji(this):ba(this,function(f,m){return m.some(function(b){return f.indexOf(b)===0})},l,Jr)},jt.prototype.anyOf=function(){var l=this,f=U.apply(ve,arguments),m=this._cmp;try{f.sort(m)}catch{return mn(this,Zn)}if(f.length===0)return ji(this);var b=new this.Collection(this,function(){return _r(f[0],f[f.length-1])});b._ondirectionchange=function(A){m=A==="next"?l._ascending:l._descending,f.sort(m)};var S=0;return b._addAlgorithm(function(A,T,P){for(var B=A.key;0<m(B,f[S]);)if(++S===f.length)return T(P),!1;return m(B,f[S])===0||(T(function(){A.continue(f[S])}),!1)}),b},jt.prototype.notEqual=function(l){return this.inAnyRange([[-1/0,l],[l,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},jt.prototype.noneOf=function(){var l=U.apply(ve,arguments);if(l.length===0)return new this.Collection(this);try{l.sort(this._ascending)}catch{return mn(this,Zn)}var f=l.reduce(function(m,b){return m?m.concat([[m[m.length-1][1],b]]):[[-1/0,b]]},null);return f.push([l[l.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},jt.prototype.inAnyRange=function(Z,f){var m=this,b=this._cmp,S=this._ascending,A=this._descending,T=this._min,P=this._max;if(Z.length===0)return ji(this);if(!Z.every(function(ne){return ne[0]!==void 0&&ne[1]!==void 0&&S(ne[0],ne[1])<=0}))return mn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ae.InvalidArgument);var B=!f||f.includeLowers!==!1,j=f&&f.includeUppers===!0,z,D=S;function J(ne,re){return D(ne[0],re[0])}try{(z=Z.reduce(function(ne,re){for(var ce=0,ke=ne.length;ce<ke;++ce){var Oe=ne[ce];if(b(re[0],Oe[1])<0&&0<b(re[1],Oe[0])){Oe[0]=T(Oe[0],re[0]),Oe[1]=P(Oe[1],re[1]);break}}return ce===ke&&ne.push(re),ne},[])).sort(J)}catch{return mn(this,Zn)}var $=0,K=j?function(ne){return 0<S(ne,z[$][1])}:function(ne){return 0<=S(ne,z[$][1])},W=B?function(ne){return 0<A(ne,z[$][0])}:function(ne){return 0<=A(ne,z[$][0])},q=K,Z=new this.Collection(this,function(){return _r(z[0][0],z[z.length-1][1],!B,!j)});return Z._ondirectionchange=function(ne){D=ne==="next"?(q=K,S):(q=W,A),z.sort(J)},Z._addAlgorithm(function(ne,re,ce){for(var ke,Oe=ne.key;q(Oe);)if(++$===z.length)return re(ce),!1;return!K(ke=Oe)&&!W(ke)||(m._cmp(Oe,z[$][1])===0||m._cmp(Oe,z[$][0])===0||re(function(){D===S?ne.continue(z[$][0]):ne.continue(z[$][1])}),!1)}),Z},jt.prototype.startsWithAnyOf=function(){var l=U.apply(ve,arguments);return l.every(function(f){return typeof f=="string"})?l.length===0?ji(this):this.inAnyRange(l.map(function(f){return[f,f+Jr]})):mn(this,"startsWithAnyOf() only works with strings")},jt);function jt(){}function Hn(l){return Ot(function(f){return $s(f),l(f.target.error),!1})}function $s(l){l.stopPropagation&&l.stopPropagation(),l.preventDefault&&l.preventDefault()}var js="storagemutated",Kc="x-storagemutated-1",Sr=Ls(null,js),P0=(Kn.prototype._lock=function(){return I(!je.global),++this._reculock,this._reculock!==1||je.global||(je.lockOwnerFor=this),this},Kn.prototype._unlock=function(){if(I(!je.global),--this._reculock==0)for(je.global||(je.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var l=this._blockedFuncs.shift();try{Yr(l[1],l[0])}catch{}}return this},Kn.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},Kn.prototype.create=function(l){var f=this;if(!this.mode)return this;var m=this.db.idbdb,b=this.db._state.dbOpenError;if(I(!this.idbtrans),!l&&!m)switch(b&&b.name){case"DatabaseClosedError":throw new Ae.DatabaseClosed(b);case"MissingAPIError":throw new Ae.MissingAPI(b.message,b);default:throw new Ae.OpenFailed(b)}if(!this.active)throw new Ae.TransactionInactive;return I(this._completion._state===null),(l=this.idbtrans=l||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ot(function(S){$s(S),f._reject(l.error)}),l.onabort=Ot(function(S){$s(S),f.active&&f._reject(new Ae.Abort(l.error)),f.active=!1,f.on("abort").fire(S)}),l.oncomplete=Ot(function(){f.active=!1,f._resolve(),"mutatedParts"in l&&Sr.storagemutated.fire(l.mutatedParts)}),this},Kn.prototype._promise=function(l,f,m){var b=this;if(l==="readwrite"&&this.mode!=="readwrite")return Pt(new Ae.ReadOnly("Transaction is readonly"));if(!this.active)return Pt(new Ae.TransactionInactive);if(this._locked())return new De(function(A,T){b._blockedFuncs.push([function(){b._promise(l,f,m).then(A,T)},je])});if(m)return yr(function(){var A=new De(function(T,P){b._lock();var B=f(T,P,b);B&&B.then&&B.then(T,P)});return A.finally(function(){return b._unlock()}),A._lib=!0,A});var S=new De(function(A,T){var P=f(A,T,b);P&&P.then&&P.then(A,T)});return S._lib=!0,S},Kn.prototype._root=function(){return this.parent?this.parent._root():this},Kn.prototype.waitFor=function(l){var f,m=this._root(),b=De.resolve(l);m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return b}):(m._waitingFor=b,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),function A(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=A)}());var S=m._waitingFor;return new De(function(A,T){b.then(function(P){return m._waitingQueue.push(Ot(A.bind(null,P)))},function(P){return m._waitingQueue.push(Ot(T.bind(null,P)))}).finally(function(){m._waitingFor===S&&(m._waitingFor=null)})})},Kn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ae.Abort))},Kn.prototype.table=function(l){var f=this._memoizedTables||(this._memoizedTables={});if(h(f,l))return f[l];var m=this.schema[l];if(!m)throw new Ae.NotFound("Table "+l+" not part of transaction");return m=new this.db.Table(l,m,this),m.core=this.db.core.table(l),f[l]=m},Kn);function Kn(){}function zc(l,f,m,b,S,A,T){return{name:l,keyPath:f,unique:m,multi:b,auto:S,compound:A,src:(m&&!T?"&":"")+(b?"*":"")+(S?"++":"")+Xh(f)}}function Xh(l){return typeof l=="string"?l:l?"["+[].join.call(l,"+")+"]":""}function Gc(l,f,m){return{name:l,primKey:f,indexes:m,mappedClass:null,idxByName:(b=function(S){return[S.name,S]},m.reduce(function(S,A,T){return T=b(A,T),T&&(S[T[0]]=T[1]),S},{}))};var b}var Vs=function(l){try{return l.only([[]]),Vs=function(){return[[]]},[[]]}catch{return Vs=function(){return Jr},Jr}};function Wc(l){return l==null?function(){}:typeof l=="string"?(f=l).split(".").length===1?function(m){return m[f]}:function(m){return Y(m,f)}:function(m){return Y(m,l)};var f}function Qh(l){return[].slice.call(l)}var D0=0;function qs(l){return l==null?":id":typeof l=="string"?l:"[".concat(l.join("+"),"]")}function F0(l,f,B){function b(q){if(q.type===3)return null;if(q.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var $=q.lower,K=q.upper,W=q.lowerOpen,q=q.upperOpen;return $===void 0?K===void 0?null:f.upperBound(K,!!q):K===void 0?f.lowerBound($,!!W):f.bound($,K,!!W,!!q)}function S(J){var $,K=J.name;return{name:K,schema:J,mutate:function(W){var q=W.trans,Z=W.type,ne=W.keys,re=W.values,ce=W.range;return new Promise(function(ke,Oe){ke=Ot(ke);var Ee=q.objectStore(K),Ce=Ee.keyPath==null,Re=Z==="put"||Z==="add";if(!Re&&Z!=="delete"&&Z!=="deleteRange")throw new Error("Invalid operation type: "+Z);var Te,Le=(ne||re||{length:1}).length;if(ne&&re&&ne.length!==re.length)throw new Error("Given keys array must have same length as given values array.");if(Le===0)return ke({numFailures:0,failures:{},results:[],lastResult:void 0});function Je(tn){++gn,$s(tn)}var nt=[],rt=[],gn=0;if(Z==="deleteRange"){if(ce.type===4)return ke({numFailures:gn,failures:rt,results:[],lastResult:void 0});ce.type===3?nt.push(Te=Ee.clear()):nt.push(Te=Ee.delete(b(ce)))}else{var Ce=Re?Ce?[re,ne]:[re,null]:[ne,null],Ye=Ce[0],Yt=Ce[1];if(Re)for(var Jt=0;Jt<Le;++Jt)nt.push(Te=Yt&&Yt[Jt]!==void 0?Ee[Z](Ye[Jt],Yt[Jt]):Ee[Z](Ye[Jt])),Te.onerror=Je;else for(Jt=0;Jt<Le;++Jt)nt.push(Te=Ee[Z](Ye[Jt])),Te.onerror=Je}function Ra(tn){tn=tn.target.result,nt.forEach(function(ei,fl){return ei.error!=null&&(rt[fl]=ei.error)}),ke({numFailures:gn,failures:rt,results:Z==="delete"?ne:nt.map(function(ei){return ei.result}),lastResult:tn})}Te.onerror=function(tn){Je(tn),Ra(tn)},Te.onsuccess=Ra})},getMany:function(W){var q=W.trans,Z=W.keys;return new Promise(function(ne,re){ne=Ot(ne);for(var ce,ke=q.objectStore(K),Oe=Z.length,Ee=new Array(Oe),Ce=0,Re=0,Te=function(nt){nt=nt.target,Ee[nt._pos]=nt.result,++Re===Ce&&ne(Ee)},Le=Hn(re),Je=0;Je<Oe;++Je)Z[Je]!=null&&((ce=ke.get(Z[Je]))._pos=Je,ce.onsuccess=Te,ce.onerror=Le,++Ce);Ce===0&&ne(Ee)})},get:function(W){var q=W.trans,Z=W.key;return new Promise(function(ne,re){ne=Ot(ne);var ce=q.objectStore(K).get(Z);ce.onsuccess=function(ke){return ne(ke.target.result)},ce.onerror=Hn(re)})},query:($=j,function(W){return new Promise(function(q,Z){q=Ot(q);var ne,re,ce,Ce=W.trans,ke=W.values,Oe=W.limit,Te=W.query,Ee=Oe===1/0?void 0:Oe,Re=Te.index,Te=Te.range,Ce=Ce.objectStore(K),Re=Re.isPrimaryKey?Ce:Ce.index(Re.name),Te=b(Te);if(Oe===0)return q({result:[]});$?((Ee=ke?Re.getAll(Te,Ee):Re.getAllKeys(Te,Ee)).onsuccess=function(Le){return q({result:Le.target.result})},Ee.onerror=Hn(Z)):(ne=0,re=!ke&&"openKeyCursor"in Re?Re.openKeyCursor(Te):Re.openCursor(Te),ce=[],re.onsuccess=function(Le){var Je=re.result;return Je?(ce.push(ke?Je.value:Je.primaryKey),++ne===Oe?q({result:ce}):void Je.continue()):q({result:ce})},re.onerror=Hn(Z))})}),openCursor:function(W){var q=W.trans,Z=W.values,ne=W.query,re=W.reverse,ce=W.unique;return new Promise(function(ke,Oe){ke=Ot(ke);var Re=ne.index,Ee=ne.range,Ce=q.objectStore(K),Ce=Re.isPrimaryKey?Ce:Ce.index(Re.name),Re=re?ce?"prevunique":"prev":ce?"nextunique":"next",Te=!Z&&"openKeyCursor"in Ce?Ce.openKeyCursor(b(Ee),Re):Ce.openCursor(b(Ee),Re);Te.onerror=Hn(Oe),Te.onsuccess=Ot(function(Le){var Je,nt,rt,gn,Ye=Te.result;Ye?(Ye.___id=++D0,Ye.done=!1,Je=Ye.continue.bind(Ye),nt=(nt=Ye.continuePrimaryKey)&&nt.bind(Ye),rt=Ye.advance.bind(Ye),gn=function(){throw new Error("Cursor not stopped")},Ye.trans=q,Ye.stop=Ye.continue=Ye.continuePrimaryKey=Ye.advance=function(){throw new Error("Cursor not started")},Ye.fail=Ot(Oe),Ye.next=function(){var Yt=this,Jt=1;return this.start(function(){return Jt--?Yt.continue():Yt.stop()}).then(function(){return Yt})},Ye.start=function(Yt){function Jt(){if(Te.result)try{Yt()}catch(tn){Ye.fail(tn)}else Ye.done=!0,Ye.start=function(){throw new Error("Cursor behind last entry")},Ye.stop()}var Ra=new Promise(function(tn,ei){tn=Ot(tn),Te.onerror=Hn(ei),Ye.fail=ei,Ye.stop=function(fl){Ye.stop=Ye.continue=Ye.continuePrimaryKey=Ye.advance=gn,tn(fl)}});return Te.onsuccess=Ot(function(tn){Te.onsuccess=Jt,Jt()}),Ye.continue=Je,Ye.continuePrimaryKey=nt,Ye.advance=rt,Jt(),Ra},ke(Ye)):ke(null)},Oe)})},count:function(W){var q=W.query,Z=W.trans,ne=q.index,re=q.range;return new Promise(function(ce,ke){var Oe=Z.objectStore(K),Ee=ne.isPrimaryKey?Oe:Oe.index(ne.name),Oe=b(re),Ee=Oe?Ee.count(Oe):Ee.count();Ee.onsuccess=Ot(function(Ce){return ce(Ce.target.result)}),Ee.onerror=Hn(ke)})}}}var A,T,P,z=(T=B,P=Qh((A=l).objectStoreNames),{schema:{name:A.name,tables:P.map(function(J){return T.objectStore(J)}).map(function(J){var $=J.keyPath,q=J.autoIncrement,K=a($),W={},q={name:J.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:$==null,compound:K,keyPath:$,autoIncrement:q,unique:!0,extractKey:Wc($)},indexes:Qh(J.indexNames).map(function(Z){return J.index(Z)}).map(function(ce){var ne=ce.name,re=ce.unique,ke=ce.multiEntry,ce=ce.keyPath,ke={name:ne,compound:a(ce),keyPath:ce,unique:re,multiEntry:ke,extractKey:Wc(ce)};return W[qs(ce)]=ke}),getIndexByKeyPath:function(Z){return W[qs(Z)]}};return W[":id"]=q.primaryKey,$!=null&&(W[qs($)]=q.primaryKey),q})},hasGetAll:0<P.length&&"getAll"in T.objectStore(P[0])&&!(typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),B=z.schema,j=z.hasGetAll,z=B.tables.map(S),D={};return z.forEach(function(J){return D[J.name]=J}),{stack:"dbcore",transaction:l.transaction.bind(l),table:function(J){if(!D[J])throw new Error("Table '".concat(J,"' not found"));return D[J]},MIN_KEY:-1/0,MAX_KEY:Vs(f),schema:B}}function U0(l,f,m,b){var S=m.IDBKeyRange;return m.indexedDB,{dbcore:(b=F0(f,S,b),l.dbcore.reduce(function(A,T){return T=T.create,r(r({},A),T(A))},b))}}function wa(l,b){var m=b.db,b=U0(l._middlewares,m,l._deps,b);l.core=b.dbcore,l.tables.forEach(function(S){var A=S.name;l.core.schema.tables.some(function(T){return T.name===A})&&(S.core=l.core.table(A),l[A]instanceof l.Table&&(l[A].core=S.core))})}function _a(l,f,m,b){m.forEach(function(S){var A=b[S];f.forEach(function(T){var P=function B(j,z){return k(j,z)||(j=u(j))&&B(j,z)}(T,S);(!P||"value"in P&&P.value===void 0)&&(T===l.Transaction.prototype||T instanceof l.Transaction?v(T,S,{get:function(){return this.table(S)},set:function(B){y(this,S,{value:B,writable:!0,configurable:!0,enumerable:!0})}}):T[S]=new l.Table(S,A))})})}function Yc(l,f){f.forEach(function(m){for(var b in m)m[b]instanceof l.Table&&delete m[b]})}function L0(l,f){return l._cfg.version-f._cfg.version}function M0(l,f,m,b){var S=l._dbSchema;m.objectStoreNames.contains("$meta")&&!S.$meta&&(S.$meta=Gc("$meta",ep("")[0],[]),l._storeNames.push("$meta"));var A=l._createTransaction("readwrite",l._storeNames,S);A.create(m),A._completion.catch(b);var T=A._reject.bind(A),P=je.transless||je;yr(function(){return je.trans=A,je.transless=P,f!==0?(wa(l,m),j=f,((B=A).storeNames.includes("$meta")?B.table("$meta").get("version").then(function(z){return z!=null?z:j}):De.resolve(j)).then(function(z){return J=z,$=A,K=m,W=[],z=(D=l)._versions,q=D._dbSchema=ka(0,D.idbdb,K),(z=z.filter(function(Z){return Z._cfg.version>=J})).length!==0?(z.forEach(function(Z){W.push(function(){var ne=q,re=Z._cfg.dbschema;Ea(D,ne,K),Ea(D,re,K),q=D._dbSchema=re;var ce=Jc(ne,re);ce.add.forEach(function(Re){Xc(K,Re[0],Re[1].primKey,Re[1].indexes)}),ce.change.forEach(function(Re){if(Re.recreate)throw new Ae.Upgrade("Not yet support for changing primary key");var Te=K.objectStore(Re.name);Re.add.forEach(function(Le){return Sa(Te,Le)}),Re.change.forEach(function(Le){Te.deleteIndex(Le.name),Sa(Te,Le)}),Re.del.forEach(function(Le){return Te.deleteIndex(Le)})});var ke=Z._cfg.contentUpgrade;if(ke&&Z._cfg.version>J){wa(D,K),$._memoizedTables={};var Oe=F(re);ce.del.forEach(function(Re){Oe[Re]=ne[Re]}),Yc(D,[D.Transaction.prototype]),_a(D,[D.Transaction.prototype],o(Oe),Oe),$.schema=Oe;var Ee,Ce=de(ke);return Ce&&Mi(),ce=De.follow(function(){var Re;(Ee=ke($))&&Ce&&(Re=br.bind(null,null),Ee.then(Re,Re))}),Ee&&typeof Ee.then=="function"?De.resolve(Ee):ce.then(function(){return Ee})}}),W.push(function(ne){var re,ce,ke=Z._cfg.dbschema;re=ke,ce=ne,[].slice.call(ce.db.objectStoreNames).forEach(function(Oe){return re[Oe]==null&&ce.db.deleteObjectStore(Oe)}),Yc(D,[D.Transaction.prototype]),_a(D,[D.Transaction.prototype],D._storeNames,D._dbSchema),$.schema=D._dbSchema}),W.push(function(ne){D.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(D.idbdb.version/10)===Z._cfg.version?(D.idbdb.deleteObjectStore("$meta"),delete D._dbSchema.$meta,D._storeNames=D._storeNames.filter(function(re){return re!=="$meta"})):ne.objectStore("$meta").put(Z._cfg.version,"version"))})}),function Z(){return W.length?De.resolve(W.shift()($.idbtrans)).then(Z):De.resolve()}().then(function(){Zh(q,K)})):De.resolve();var D,J,$,K,W,q}).catch(T)):(o(S).forEach(function(z){Xc(m,z,S[z].primKey,S[z].indexes)}),wa(l,m),void De.follow(function(){return l.on.populate.fire(A)}).catch(T));var B,j})}function B0(l,f){Zh(l._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var m=ka(0,l.idbdb,f);Ea(l,l._dbSchema,f);for(var b=0,S=Jc(m,l._dbSchema).change;b<S.length;b++){var A=function(T){if(T.change.length||T.recreate)return console.warn("Unable to patch indexes of table ".concat(T.name," because it has changes on the type of index or primary key.")),{value:void 0};var P=f.objectStore(T.name);T.add.forEach(function(B){N&&console.debug("Dexie upgrade patch: Creating missing index ".concat(T.name,".").concat(B.src)),Sa(P,B)})}(S[b]);if(typeof A=="object")return A.value}}function Jc(l,f){var m,b={del:[],add:[],change:[]};for(m in l)f[m]||b.del.push(m);for(m in f){var S=l[m],A=f[m];if(S){var T={name:m,def:A,recreate:!1,del:[],add:[],change:[]};if(""+(S.primKey.keyPath||"")!=""+(A.primKey.keyPath||"")||S.primKey.auto!==A.primKey.auto)T.recreate=!0,b.change.push(T);else{var P=S.idxByName,B=A.idxByName,j=void 0;for(j in P)B[j]||T.del.push(j);for(j in B){var z=P[j],D=B[j];z?z.src!==D.src&&T.change.push(D):T.add.push(D)}(0<T.del.length||0<T.add.length||0<T.change.length)&&b.change.push(T)}}else b.add.push([m,A])}return b}function Xc(l,f,m,b){var S=l.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});return b.forEach(function(A){return Sa(S,A)}),S}function Zh(l,f){o(l).forEach(function(m){f.db.objectStoreNames.contains(m)||(N&&console.debug("Dexie: Creating missing table",m),Xc(f,m,l[m].primKey,l[m].indexes))})}function Sa(l,f){l.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function ka(l,f,m){var b={};return E(f.objectStoreNames,0).forEach(function(S){for(var A=m.objectStore(S),T=zc(Xh(j=A.keyPath),j||"",!0,!1,!!A.autoIncrement,j&&typeof j!="string",!0),P=[],B=0;B<A.indexNames.length;++B){var z=A.index(A.indexNames[B]),j=z.keyPath,z=zc(z.name,j,!!z.unique,!!z.multiEntry,!1,j&&typeof j!="string",!1);P.push(z)}b[S]=Gc(S,T,P)}),b}function Ea(l,f,m){for(var b=m.db.objectStoreNames,S=0;S<b.length;++S){var A=b[S],T=m.objectStore(A);l._hasGetAll="getAll"in T;for(var P=0;P<T.indexNames.length;++P){var B=T.indexNames[P],j=T.index(B).keyPath,z=typeof j=="string"?j:"["+E(j).join("+")+"]";!f[A]||(j=f[A].idxByName[z])&&(j.name=B,delete f[A].idxByName[z],f[A].idxByName[B]=j)}}typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(l._hasGetAll=!1)}function ep(l){return l.split(",").map(function(f,m){var b=(f=f.trim()).replace(/([&*]|\+\+)/g,""),S=/^\[/.test(b)?b.match(/^\[(.*)\]$/)[1].split("+"):b;return zc(b,S||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),a(S),m===0)})}var $0=(Aa.prototype._parseStoresSpec=function(l,f){o(l).forEach(function(m){if(l[m]!==null){var b=ep(l[m]),S=b.shift();if(S.unique=!0,S.multi)throw new Ae.Schema("Primary key cannot be multi-valued");b.forEach(function(A){if(A.auto)throw new Ae.Schema("Only primary key can be marked as autoIncrement (++)");if(!A.keyPath)throw new Ae.Schema("Index must have a name and cannot be an empty string")}),f[m]=Gc(m,S,b)}})},Aa.prototype.stores=function(m){var f=this.db;this._cfg.storesSource=this._cfg.storesSource?c(this._cfg.storesSource,m):m;var m=f._versions,b={},S={};return m.forEach(function(A){c(b,A._cfg.storesSource),S=A._cfg.dbschema={},A._parseStoresSpec(b,S)}),f._dbSchema=S,Yc(f,[f._allTables,f,f.Transaction.prototype]),_a(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],o(S),S),f._storeNames=o(S),this},Aa.prototype.upgrade=function(l){return this._cfg.contentUpgrade=g(this._cfg.contentUpgrade||Ie,l),this},Aa);function Aa(){}function Qc(l,f){var m=l._dbNamesDB;return m||(m=l._dbNamesDB=new er(ma,{addons:[],indexedDB:l,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function Zc(l){return l&&typeof l.databases=="function"}function el(l){return yr(function(){return je.letThrough=!0,l()})}function tl(l){return!("from"in l)}var Wt=function(l,f){if(!this){var m=new Wt;return l&&"d"in l&&c(m,l),m}c(this,arguments.length?{d:1,from:l,to:1<arguments.length?f:l}:{d:0})};function Hs(l,f,m){var b=ut(f,m);if(!isNaN(b)){if(0<b)throw RangeError();if(tl(l))return c(l,{from:f,to:m,d:1});var S=l.l,b=l.r;if(ut(m,l.from)<0)return S?Hs(S,f,m):l.l={from:f,to:m,d:1,l:null,r:null},np(l);if(0<ut(f,l.to))return b?Hs(b,f,m):l.r={from:f,to:m,d:1,l:null,r:null},np(l);ut(f,l.from)<0&&(l.from=f,l.l=null,l.d=b?b.d+1:1),0<ut(m,l.to)&&(l.to=m,l.r=null,l.d=l.l?l.l.d+1:1),m=!l.r,S&&!l.l&&Ks(l,S),b&&m&&Ks(l,b)}}function Ks(l,f){tl(f)||function m(b,B){var A=B.from,T=B.to,P=B.l,B=B.r;Hs(b,A,T),P&&m(b,P),B&&m(b,B)}(l,f)}function tp(l,f){var m=Ca(f),b=m.next();if(b.done)return!1;for(var S=b.value,A=Ca(l),T=A.next(S.from),P=T.value;!b.done&&!T.done;){if(ut(P.from,S.to)<=0&&0<=ut(P.to,S.from))return!0;ut(S.from,P.from)<0?S=(b=m.next(P.from)).value:P=(T=A.next(S.from)).value}return!1}function Ca(l){var f=tl(l)?null:{s:0,n:l};return{next:function(m){for(var b=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,b)for(;f.n.l&&ut(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!b||ut(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function np(l){var f,m,b=(((f=l.r)===null||f===void 0?void 0:f.d)||0)-(((m=l.l)===null||m===void 0?void 0:m.d)||0),S=1<b?"r":b<-1?"l":"";S&&(f=S=="r"?"l":"r",m=r({},l),b=l[S],l.from=b.from,l.to=b.to,l[S]=b[S],m[S]=b[f],(l[f]=m).d=rp(m)),l.d=rp(l)}function rp(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function xa(l,f){return o(f).forEach(function(m){l[m]?Ks(l[m],f[m]):l[m]=function b(S){var A,T,P={};for(A in S)h(S,A)&&(T=S[A],P[A]=!T||typeof T!="object"||ie.has(T.constructor)?T:b(T));return P}(f[m])}),l}function nl(l,f){return l.all||f.all||Object.keys(l).some(function(m){return f[m]&&tp(f[m],l[m])})}p(Wt.prototype,((Sn={add:function(l){return Ks(this,l),this},addKey:function(l){return Hs(this,l,l),this},addKeys:function(l){var f=this;return l.forEach(function(m){return Hs(f,m,m)}),this},hasKey:function(l){var f=Ca(this).next(l).value;return f&&ut(f.from,l)<=0&&0<=ut(f.to,l)}})[Q]=function(){return Ca(this)},Sn));var Qr={},rl={},il=!1;function Na(l){xa(rl,l),il||(il=!0,setTimeout(function(){il=!1,sl(rl,!(rl={}))},0))}function sl(l,f){f===void 0&&(f=!1);var m=new Set;if(l.all)for(var b=0,S=Object.values(Qr);b<S.length;b++)ip(T=S[b],l,m,f);else for(var A in l){var T,P=/^idb\:\/\/(.*)\/(.*)\//.exec(A);P&&(A=P[1],P=P[2],(T=Qr["idb://".concat(A,"/").concat(P)])&&ip(T,l,m,f))}m.forEach(function(B){return B()})}function ip(l,f,m,b){for(var S=[],A=0,T=Object.entries(l.queries.query);A<T.length;A++){for(var P=T[A],B=P[0],j=[],z=0,D=P[1];z<D.length;z++){var J=D[z];nl(f,J.obsSet)?J.subscribers.forEach(function(q){return m.add(q)}):b&&j.push(J)}b&&S.push([B,j])}if(b)for(var $=0,K=S;$<K.length;$++){var W=K[$],B=W[0],j=W[1];l.queries.query[B]=j}}function j0(l){var f=l._state,m=l._deps.indexedDB;if(f.isBeingOpened||l.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?Pt(f.dbOpenError):l});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var b=f.openCanceller,S=Math.round(10*l.verno),A=!1;function T(){if(f.openCanceller!==b)throw new Ae.DatabaseClosed("db.open() was cancelled")}function P(){return new De(function(J,$){if(T(),!m)throw new Ae.MissingAPI;var K=l.name,W=f.autoSchema||!S?m.open(K):m.open(K,S);if(!W)throw new Ae.MissingAPI;W.onerror=Hn($),W.onblocked=Ot(l._fireOnBlocked),W.onupgradeneeded=Ot(function(q){var Z;z=W.transaction,f.autoSchema&&!l._options.allowEmptyDB?(W.onerror=$s,z.abort(),W.result.close(),(Z=m.deleteDatabase(K)).onsuccess=Z.onerror=Ot(function(){$(new Ae.NoSuchDatabase("Database ".concat(K," doesnt exist")))})):(z.onerror=Hn($),q=q.oldVersion>Math.pow(2,62)?0:q.oldVersion,D=q<1,l.idbdb=W.result,A&&B0(l,z),M0(l,q/10,z,$))},$),W.onsuccess=Ot(function(){z=null;var q,Z,ne,re,ce,ke=l.idbdb=W.result,Oe=E(ke.objectStoreNames);if(0<Oe.length)try{var Ee=ke.transaction((re=Oe).length===1?re[0]:re,"readonly");if(f.autoSchema)Z=ke,ne=Ee,(q=l).verno=Z.version/10,ne=q._dbSchema=ka(0,Z,ne),q._storeNames=E(Z.objectStoreNames,0),_a(q,[q._allTables],o(ne),ne);else if(Ea(l,l._dbSchema,Ee),((ce=Jc(ka(0,(ce=l).idbdb,Ee),ce._dbSchema)).add.length||ce.change.some(function(Ce){return Ce.add.length||Ce.change.length}))&&!A)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ke.close(),S=ke.version+1,A=!0,J(P());wa(l,Ee)}catch{}Bi.push(l),ke.onversionchange=Ot(function(Ce){f.vcFired=!0,l.on("versionchange").fire(Ce)}),ke.onclose=Ot(function(Ce){l.on("close").fire(Ce)}),D&&(ce=l._deps,Ee=K,ke=ce.indexedDB,ce=ce.IDBKeyRange,Zc(ke)||Ee===ma||Qc(ke,ce).put({name:Ee}).catch(Ie)),J()},$)}).catch(function(J){switch(J==null?void 0:J.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),P();break;case"VersionError":if(0<S)return S=0,P()}return De.reject(J)})}var B,j=f.dbReadyResolve,z=null,D=!1;return De.race([b,(typeof navigator=="undefined"?De.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(J){function $(){return indexedDB.databases().finally(J)}B=setInterval($,100),$()}).finally(function(){return clearInterval(B)}):Promise.resolve()).then(P)]).then(function(){return T(),f.onReadyBeingFired=[],De.resolve(el(function(){return l.on.ready.fire(l.vip)})).then(function J(){if(0<f.onReadyBeingFired.length){var $=f.onReadyBeingFired.reduce(g,Ie);return f.onReadyBeingFired=[],De.resolve(el(function(){return $(l.vip)})).then(J)}})}).finally(function(){f.openCanceller===b&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(J){f.dbOpenError=J;try{z&&z.abort()}catch{}return b===f.openCanceller&&l._close(),Pt(J)}).finally(function(){f.openComplete=!0,j()}).then(function(){var J;return D&&(J={},l.tables.forEach(function($){$.schema.indexes.forEach(function(K){K.name&&(J["idb://".concat(l.name,"/").concat($.name,"/").concat(K.name)]=new Wt(-1/0,[[[]]]))}),J["idb://".concat(l.name,"/").concat($.name,"/")]=J["idb://".concat(l.name,"/").concat($.name,"/:dels")]=new Wt(-1/0,[[[]]])}),Sr(js).fire(J),sl(J,!0)),l})}function ol(l){function f(A){return l.next(A)}var m=S(f),b=S(function(A){return l.throw(A)});function S(A){return function(B){var P=A(B),B=P.value;return P.done?B:B&&typeof B.then=="function"?B.then(m,b):a(B)?Promise.all(B).then(m,b):m(B)}}return S(f)()}function Ta(l,f,m){for(var b=a(l)?l.slice():[l],S=0;S<m;++S)b.push(f);return b}var V0={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(l){return r(r({},l),{table:function(f){var m=l.table(f),b=m.schema,S={},A=[];function T(D,J,$){var K=qs(D),W=S[K]=S[K]||[],q=D==null?0:typeof D=="string"?1:D.length,Z=0<J,Z=r(r({},$),{name:Z?"".concat(K,"(virtual-from:").concat($.name,")"):$.name,lowLevelIndex:$,isVirtual:Z,keyTail:J,keyLength:q,extractKey:Wc(D),unique:!Z&&$.unique});return W.push(Z),Z.isPrimaryKey||A.push(Z),1<q&&T(q===2?D[0]:D.slice(0,q-1),J+1,$),W.sort(function(ne,re){return ne.keyTail-re.keyTail}),Z}f=T(b.primaryKey.keyPath,0,b.primaryKey),S[":id"]=[f];for(var P=0,B=b.indexes;P<B.length;P++){var j=B[P];T(j.keyPath,0,j)}function z(D){var J,$=D.query.index;return $.isVirtual?r(r({},D),{query:{index:$.lowLevelIndex,range:(J=D.query.range,$=$.keyTail,{type:J.type===1?2:J.type,lower:Ta(J.lower,J.lowerOpen?l.MAX_KEY:l.MIN_KEY,$),lowerOpen:!0,upper:Ta(J.upper,J.upperOpen?l.MIN_KEY:l.MAX_KEY,$),upperOpen:!0})}}):D}return r(r({},m),{schema:r(r({},b),{primaryKey:f,indexes:A,getIndexByKeyPath:function(D){return(D=S[qs(D)])&&D[0]}}),count:function(D){return m.count(z(D))},query:function(D){return m.query(z(D))},openCursor:function(D){var J=D.query.index,$=J.keyTail,K=J.isVirtual,W=J.keyLength;return K?m.openCursor(z(D)).then(function(Z){return Z&&q(Z)}):m.openCursor(D);function q(Z){return Object.create(Z,{continue:{value:function(ne){ne!=null?Z.continue(Ta(ne,D.reverse?l.MAX_KEY:l.MIN_KEY,$)):D.unique?Z.continue(Z.key.slice(0,W).concat(D.reverse?l.MIN_KEY:l.MAX_KEY,$)):Z.continue()}},continuePrimaryKey:{value:function(ne,re){Z.continuePrimaryKey(Ta(ne,l.MAX_KEY,$),re)}},primaryKey:{get:function(){return Z.primaryKey}},key:{get:function(){var ne=Z.key;return W===1?ne[0]:ne.slice(0,W)}},value:{get:function(){return Z.value}}})}}})}})}};function al(l,f,m,b){return m=m||{},b=b||"",o(l).forEach(function(S){var A,T,P;h(f,S)?(A=l[S],T=f[S],typeof A=="object"&&typeof T=="object"&&A&&T?(P=R(A))!==R(T)?m[b+S]=f[S]:P==="Object"?al(A,T,m,b+S+"."):A!==T&&(m[b+S]=f[S]):A!==T&&(m[b+S]=f[S])):m[b+S]=void 0}),o(f).forEach(function(S){h(l,S)||(m[b+S]=f[S])}),m}function ul(l,f){return f.type==="delete"?f.keys:f.keys||f.values.map(l.extractKey)}var q0={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(l){return r(r({},l),{table:function(f){var m=l.table(f),b=m.schema.primaryKey;return r(r({},m),{mutate:function(S){var A=je.trans,T=A.table(f).hook,P=T.deleting,B=T.creating,j=T.updating;switch(S.type){case"add":if(B.fire===Ie)break;return A._promise("readwrite",function(){return z(S)},!0);case"put":if(B.fire===Ie&&j.fire===Ie)break;return A._promise("readwrite",function(){return z(S)},!0);case"delete":if(P.fire===Ie)break;return A._promise("readwrite",function(){return z(S)},!0);case"deleteRange":if(P.fire===Ie)break;return A._promise("readwrite",function(){return function D(J,$,K){return m.query({trans:J,values:!1,query:{index:b,range:$},limit:K}).then(function(W){var q=W.result;return z({type:"delete",keys:q,trans:J}).then(function(Z){return 0<Z.numFailures?Promise.reject(Z.failures[0]):q.length<K?{failures:[],numFailures:0,lastResult:void 0}:D(J,r(r({},$),{lower:q[q.length-1],lowerOpen:!0}),K)})})}(S.trans,S.range,1e4)},!0)}return m.mutate(S);function z(D){var J,$,K,W=je.trans,q=D.keys||ul(b,D);if(!q)throw new Error("Keys missing");return(D=D.type==="add"||D.type==="put"?r(r({},D),{keys:q}):r({},D)).type!=="delete"&&(D.values=i([],D.values)),D.keys&&(D.keys=i([],D.keys)),J=m,K=q,(($=D).type==="add"?Promise.resolve([]):J.getMany({trans:$.trans,keys:K,cache:"immutable"})).then(function(Z){var ne=q.map(function(re,ce){var ke,Oe,Ee,Ce=Z[ce],Re={onerror:null,onsuccess:null};return D.type==="delete"?P.fire.call(Re,re,Ce,W):D.type==="add"||Ce===void 0?(ke=B.fire.call(Re,re,D.values[ce],W),re==null&&ke!=null&&(D.keys[ce]=re=ke,b.outbound||ee(D.values[ce],b.keyPath,re))):(ke=al(Ce,D.values[ce]),(Oe=j.fire.call(Re,ke,re,Ce,W))&&(Ee=D.values[ce],Object.keys(Oe).forEach(function(Te){h(Ee,Te)?Ee[Te]=Oe[Te]:ee(Ee,Te,Oe[Te])}))),Re});return m.mutate(D).then(function(re){for(var ce=re.failures,ke=re.results,Oe=re.numFailures,re=re.lastResult,Ee=0;Ee<q.length;++Ee){var Ce=(ke||q)[Ee],Re=ne[Ee];Ce==null?Re.onerror&&Re.onerror(ce[Ee]):Re.onsuccess&&Re.onsuccess(D.type==="put"&&Z[Ee]?D.values[Ee]:Ce)}return{failures:ce,results:ke,numFailures:Oe,lastResult:re}}).catch(function(re){return ne.forEach(function(ce){return ce.onerror&&ce.onerror(re)}),Promise.reject(re)})})}}})}})}};function sp(l,f,m){try{if(!f||f.keys.length<l.length)return null;for(var b=[],S=0,A=0;S<f.keys.length&&A<l.length;++S)ut(f.keys[S],l[A])===0&&(b.push(m?qe(f.values[S]):f.values[S]),++A);return b.length===l.length?b:null}catch{return null}}var H0={stack:"dbcore",level:-1,create:function(l){return{table:function(f){var m=l.table(f);return r(r({},m),{getMany:function(b){if(!b.cache)return m.getMany(b);var S=sp(b.keys,b.trans._cache,b.cache==="clone");return S?De.resolve(S):m.getMany(b).then(function(A){return b.trans._cache={keys:b.keys,values:b.cache==="clone"?qe(A):A},A})},mutate:function(b){return b.type!=="add"&&(b.trans._cache=null),m.mutate(b)}})}}}};function op(l,f){return l.trans.mode==="readonly"&&!!l.subscr&&!l.trans.explicit&&l.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function ap(l,f){switch(l){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var K0={stack:"dbcore",level:0,name:"Observability",create:function(l){var f=l.schema.name,m=new Wt(l.MIN_KEY,l.MAX_KEY);return r(r({},l),{transaction:function(b,S,A){if(je.subscr&&S!=="readonly")throw new Ae.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(je.querier));return l.transaction(b,S,A)},table:function(b){var S=l.table(b),A=S.schema,T=A.primaryKey,D=A.indexes,P=T.extractKey,B=T.outbound,j=T.autoIncrement&&D.filter(function($){return $.compound&&$.keyPath.includes(T.keyPath)}),z=r(r({},S),{mutate:function($){function K(Te){return Te="idb://".concat(f,"/").concat(b,"/").concat(Te),re[Te]||(re[Te]=new Wt)}var W,q,Z,ne=$.trans,re=$.mutatedParts||($.mutatedParts={}),ce=K(""),ke=K(":dels"),Oe=$.type,Re=$.type==="deleteRange"?[$.range]:$.type==="delete"?[$.keys]:$.values.length<50?[ul(T,$).filter(function(Te){return Te}),$.values]:[],Ee=Re[0],Ce=Re[1],Re=$.trans._cache;return a(Ee)?(ce.addKeys(Ee),(Re=Oe==="delete"||Ee.length===Ce.length?sp(Ee,Re):null)||ke.addKeys(Ee),(Re||Ce)&&(W=K,q=Re,Z=Ce,A.indexes.forEach(function(Te){var Le=W(Te.name||"");function Je(rt){return rt!=null?Te.extractKey(rt):null}function nt(rt){return Te.multiEntry&&a(rt)?rt.forEach(function(gn){return Le.addKey(gn)}):Le.addKey(rt)}(q||Z).forEach(function(rt,Yt){var Ye=q&&Je(q[Yt]),Yt=Z&&Je(Z[Yt]);ut(Ye,Yt)!==0&&(Ye!=null&&nt(Ye),Yt!=null&&nt(Yt))})}))):Ee?(Ce={from:(Ce=Ee.lower)!==null&&Ce!==void 0?Ce:l.MIN_KEY,to:(Ce=Ee.upper)!==null&&Ce!==void 0?Ce:l.MAX_KEY},ke.add(Ce),ce.add(Ce)):(ce.add(m),ke.add(m),A.indexes.forEach(function(Te){return K(Te.name).add(m)})),S.mutate($).then(function(Te){return!Ee||$.type!=="add"&&$.type!=="put"||(ce.addKeys(Te.results),j&&j.forEach(function(Le){for(var Je=$.values.map(function(Ye){return Le.extractKey(Ye)}),nt=Le.keyPath.findIndex(function(Ye){return Ye===T.keyPath}),rt=0,gn=Te.results.length;rt<gn;++rt)Je[rt][nt]=Te.results[rt];K(Le.name).addKeys(Je)})),ne.mutatedParts=xa(ne.mutatedParts||{},re),Te})}}),D=function(K){var W=K.query,K=W.index,W=W.range;return[K,new Wt((K=W.lower)!==null&&K!==void 0?K:l.MIN_KEY,(W=W.upper)!==null&&W!==void 0?W:l.MAX_KEY)]},J={get:function($){return[T,new Wt($.key)]},getMany:function($){return[T,new Wt().addKeys($.keys)]},count:D,query:D,openCursor:D};return o(J).forEach(function($){z[$]=function(K){var W=je.subscr,q=!!W,Z=op(je,S)&&ap($,K)?K.obsSet={}:W;if(q){var ne=function(Ce){return Ce="idb://".concat(f,"/").concat(b,"/").concat(Ce),Z[Ce]||(Z[Ce]=new Wt)},re=ne(""),ce=ne(":dels"),W=J[$](K),q=W[0],W=W[1];if(($==="query"&&q.isPrimaryKey&&!K.values?ce:ne(q.name||"")).add(W),!q.isPrimaryKey){if($!=="count"){var ke=$==="query"&&B&&K.values&&S.query(r(r({},K),{values:!1}));return S[$].apply(this,arguments).then(function(Ce){if($==="query"){if(B&&K.values)return ke.then(function(Je){return Je=Je.result,re.addKeys(Je),Ce});var Re=K.values?Ce.result.map(P):Ce.result;(K.values?re:ce).addKeys(Re)}else if($==="openCursor"){var Te=Ce,Le=K.values;return Te&&Object.create(Te,{key:{get:function(){return ce.addKey(Te.primaryKey),Te.key}},primaryKey:{get:function(){var Je=Te.primaryKey;return ce.addKey(Je),Je}},value:{get:function(){return Le&&re.addKey(Te.primaryKey),Te.value}}})}return Ce})}ce.add(m)}}return S[$].apply(this,arguments)}}),z}})}};function up(l,f,m){if(m.numFailures===0)return f;if(f.type==="deleteRange")return null;var b=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1;return m.numFailures===b?null:(f=r({},f),a(f.keys)&&(f.keys=f.keys.filter(function(S,A){return!(A in m.failures)})),"values"in f&&a(f.values)&&(f.values=f.values.filter(function(S,A){return!(A in m.failures)})),f)}function cl(l,f){return m=l,((b=f).lower===void 0||(b.lowerOpen?0<ut(m,b.lower):0<=ut(m,b.lower)))&&(l=l,(f=f).upper===void 0||(f.upperOpen?ut(l,f.upper)<0:ut(l,f.upper)<=0));var m,b}function cp(l,f,J,b,S,A){if(!J||J.length===0)return l;var T=f.query.index,P=T.multiEntry,B=f.query.range,j=b.schema.primaryKey.extractKey,z=T.extractKey,D=(T.lowLevelIndex||T).extractKey,J=J.reduce(function($,K){var W=$,q=[];if(K.type==="add"||K.type==="put")for(var Z=new Wt,ne=K.values.length-1;0<=ne;--ne){var re,ce=K.values[ne],ke=j(ce);Z.hasKey(ke)||(re=z(ce),(P&&a(re)?re.some(function(Te){return cl(Te,B)}):cl(re,B))&&(Z.addKey(ke),q.push(ce)))}switch(K.type){case"add":var Oe=new Wt().addKeys(f.values?$.map(function(Le){return j(Le)}):$),W=$.concat(f.values?q.filter(function(Le){return Le=j(Le),!Oe.hasKey(Le)&&(Oe.addKey(Le),!0)}):q.map(function(Le){return j(Le)}).filter(function(Le){return!Oe.hasKey(Le)&&(Oe.addKey(Le),!0)}));break;case"put":var Ee=new Wt().addKeys(K.values.map(function(Le){return j(Le)}));W=$.filter(function(Le){return!Ee.hasKey(f.values?j(Le):Le)}).concat(f.values?q:q.map(function(Le){return j(Le)}));break;case"delete":var Ce=new Wt().addKeys(K.keys);W=$.filter(function(Le){return!Ce.hasKey(f.values?j(Le):Le)});break;case"deleteRange":var Re=K.range;W=$.filter(function(Le){return!cl(j(Le),Re)})}return W},l);return J===l?l:(J.sort(function($,K){return ut(D($),D(K))||ut(j($),j(K))}),f.limit&&f.limit<1/0&&(J.length>f.limit?J.length=f.limit:l.length===f.limit&&J.length<f.limit&&(S.dirty=!0)),A?Object.freeze(J):J)}function lp(l,f){return ut(l.lower,f.lower)===0&&ut(l.upper,f.upper)===0&&!!l.lowerOpen==!!f.lowerOpen&&!!l.upperOpen==!!f.upperOpen}function z0(l,f){return function(m,b,S,A){if(m===void 0)return b!==void 0?-1:0;if(b===void 0)return 1;if((b=ut(m,b))===0){if(S&&A)return 0;if(S)return 1;if(A)return-1}return b}(l.lower,f.lower,l.lowerOpen,f.lowerOpen)<=0&&0<=function(m,b,S,A){if(m===void 0)return b!==void 0?1:0;if(b===void 0)return-1;if((b=ut(m,b))===0){if(S&&A)return 0;if(S)return-1;if(A)return 1}return b}(l.upper,f.upper,l.upperOpen,f.upperOpen)}function G0(l,f,m,b){l.subscribers.add(m),b.addEventListener("abort",function(){var S,A;l.subscribers.delete(m),l.subscribers.size===0&&(S=l,A=f,setTimeout(function(){S.subscribers.size===0&&ge(A,S)},3e3))})}var W0={stack:"dbcore",level:0,name:"Cache",create:function(l){var f=l.schema.name;return r(r({},l),{transaction:function(m,b,S){var A,T,P=l.transaction(m,b,S);return b==="readwrite"&&(T=(A=new AbortController).signal,S=function(B){return function(){if(A.abort(),b==="readwrite"){for(var j=new Set,z=0,D=m;z<D.length;z++){var J=D[z],$=Qr["idb://".concat(f,"/").concat(J)];if($){var K=l.table(J),W=$.optimisticOps.filter(function(Le){return Le.trans===P});if(P._explicit&&B&&P.mutatedParts)for(var q=0,Z=Object.values($.queries.query);q<Z.length;q++)for(var ne=0,re=(Oe=Z[q]).slice();ne<re.length;ne++)nl((Ee=re[ne]).obsSet,P.mutatedParts)&&(ge(Oe,Ee),Ee.subscribers.forEach(function(Le){return j.add(Le)}));else if(0<W.length){$.optimisticOps=$.optimisticOps.filter(function(Le){return Le.trans!==P});for(var ce=0,ke=Object.values($.queries.query);ce<ke.length;ce++)for(var Oe,Ee,Ce,Re=0,Te=(Oe=ke[ce]).slice();Re<Te.length;Re++)(Ee=Te[Re]).res!=null&&P.mutatedParts&&(B&&!Ee.dirty?(Ce=Object.isFrozen(Ee.res),Ce=cp(Ee.res,Ee.req,W,K,Ee,Ce),Ee.dirty?(ge(Oe,Ee),Ee.subscribers.forEach(function(Le){return j.add(Le)})):Ce!==Ee.res&&(Ee.res=Ce,Ee.promise=De.resolve({result:Ce}))):(Ee.dirty&&ge(Oe,Ee),Ee.subscribers.forEach(function(Le){return j.add(Le)})))}}}j.forEach(function(Le){return Le()})}}},P.addEventListener("abort",S(!1),{signal:T}),P.addEventListener("error",S(!1),{signal:T}),P.addEventListener("complete",S(!0),{signal:T})),P},table:function(m){var b=l.table(m),S=b.schema.primaryKey;return r(r({},b),{mutate:function(A){var T=je.trans;if(S.outbound||T.db._options.cache==="disabled"||T.explicit||T.idbtrans.mode!=="readwrite")return b.mutate(A);var P=Qr["idb://".concat(f,"/").concat(m)];return P?(T=b.mutate(A),A.type!=="add"&&A.type!=="put"||!(50<=A.values.length||ul(S,A).some(function(B){return B==null}))?(P.optimisticOps.push(A),A.mutatedParts&&Na(A.mutatedParts),T.then(function(B){0<B.numFailures&&(ge(P.optimisticOps,A),(B=up(0,A,B))&&P.optimisticOps.push(B),A.mutatedParts&&Na(A.mutatedParts))}),T.catch(function(){ge(P.optimisticOps,A),A.mutatedParts&&Na(A.mutatedParts)})):T.then(function(B){var j=up(0,r(r({},A),{values:A.values.map(function(z,D){var J;return B.failures[D]?z:(z=(J=S.keyPath)!==null&&J!==void 0&&J.includes(".")?qe(z):r({},z),ee(z,S.keyPath,B.results[D]),z)})}),B);P.optimisticOps.push(j),queueMicrotask(function(){return A.mutatedParts&&Na(A.mutatedParts)})}),T):b.mutate(A)},query:function(A){if(!op(je,b)||!ap("query",A))return b.query(A);var T=((j=je.trans)===null||j===void 0?void 0:j.db._options.cache)==="immutable",D=je,P=D.requery,B=D.signal,j=function(K,W,q,Z){var ne=Qr["idb://".concat(K,"/").concat(W)];if(!ne)return[];if(!(W=ne.queries[q]))return[null,!1,ne,null];var re=W[(Z.query?Z.query.index.name:null)||""];if(!re)return[null,!1,ne,null];switch(q){case"query":var ce=re.find(function(ke){return ke.req.limit===Z.limit&&ke.req.values===Z.values&&lp(ke.req.query.range,Z.query.range)});return ce?[ce,!0,ne,re]:[re.find(function(ke){return("limit"in ke.req?ke.req.limit:1/0)>=Z.limit&&(!Z.values||ke.req.values)&&z0(ke.req.query.range,Z.query.range)}),!1,ne,re];case"count":return ce=re.find(function(ke){return lp(ke.req.query.range,Z.query.range)}),[ce,!!ce,ne,re]}}(f,m,"query",A),z=j[0],D=j[1],J=j[2],$=j[3];return z&&D?z.obsSet=A.obsSet:(D=b.query(A).then(function(K){var W=K.result;if(z&&(z.res=W),T){for(var q=0,Z=W.length;q<Z;++q)Object.freeze(W[q]);Object.freeze(W)}else K.result=qe(W);return K}).catch(function(K){return $&&z&&ge($,z),Promise.reject(K)}),z={obsSet:A.obsSet,promise:D,subscribers:new Set,type:"query",req:A,dirty:!1},$?$.push(z):($=[z],(J=J||(Qr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[A.query.index.name||""]=$)),G0(z,$,P,B),z.promise.then(function(K){return{result:cp(K.result,A,J==null?void 0:J.optimisticOps,b,z,T)}})}})}})}};function Oa(l,f){return new Proxy(l,{get:function(m,b,S){return b==="db"?f:Reflect.get(m,b,S)}})}var er=(Dt.prototype.version=function(l){if(isNaN(l)||l<.1)throw new Ae.Type("Given version is not a positive number");if(l=Math.round(10*l)/10,this.idbdb||this._state.isBeingOpened)throw new Ae.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,l);var f=this._versions,m=f.filter(function(b){return b._cfg.version===l})[0];return m||(m=new this.Version(l),f.push(m),f.sort(L0),m.stores({}),this._state.autoSchema=!1,m)},Dt.prototype._whenReady=function(l){var f=this;return this.idbdb&&(this._state.openComplete||je.letThrough||this._vip)?l():new De(function(m,b){if(f._state.openComplete)return b(new Ae.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void b(new Ae.DatabaseClosed);f.open().catch(Ie)}f._state.dbReadyPromise.then(m,b)}).then(l)},Dt.prototype.use=function(l){var f=l.stack,m=l.create,b=l.level,S=l.name;return S&&this.unuse({stack:f,name:S}),l=this._middlewares[f]||(this._middlewares[f]=[]),l.push({stack:f,create:m,level:b==null?10:b,name:S}),l.sort(function(A,T){return A.level-T.level}),this},Dt.prototype.unuse=function(l){var f=l.stack,m=l.name,b=l.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(S){return b?S.create!==b:!!m&&S.name!==m})),this},Dt.prototype.open=function(){var l=this;return Yr(vr,function(){return j0(l)})},Dt.prototype._close=function(){var l=this._state,f=Bi.indexOf(this);if(0<=f&&Bi.splice(f,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}l.isBeingOpened||(l.dbReadyPromise=new De(function(m){l.dbReadyResolve=m}),l.openCanceller=new De(function(m,b){l.cancelOpen=b}))},Dt.prototype.close=function(m){var f=(m===void 0?{disableAutoOpen:!0}:m).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new Ae.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new Ae.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},Dt.prototype.delete=function(l){var f=this;l===void 0&&(l={disableAutoOpen:!0});var m=0<arguments.length&&typeof arguments[0]!="object",b=this._state;return new De(function(S,A){function T(){f.close(l);var P=f._deps.indexedDB.deleteDatabase(f.name);P.onsuccess=Ot(function(){var B,j,z;B=f._deps,j=f.name,z=B.indexedDB,B=B.IDBKeyRange,Zc(z)||j===ma||Qc(z,B).delete(j).catch(Ie),S()}),P.onerror=Hn(A),P.onblocked=f._fireOnBlocked}if(m)throw new Ae.InvalidArgument("Invalid closeOptions argument to db.delete()");b.isBeingOpened?b.dbReadyPromise.then(T):T()})},Dt.prototype.backendDB=function(){return this.idbdb},Dt.prototype.isOpen=function(){return this.idbdb!==null},Dt.prototype.hasBeenClosed=function(){var l=this._state.dbOpenError;return l&&l.name==="DatabaseClosed"},Dt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Dt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dt.prototype,"tables",{get:function(){var l=this;return o(this._allTables).map(function(f){return l._allTables[f]})},enumerable:!1,configurable:!0}),Dt.prototype.transaction=function(){var l=function(f,m,b){var S=arguments.length;if(S<2)throw new Ae.InvalidArgument("Too few arguments");for(var A=new Array(S-1);--S;)A[S-1]=arguments[S];return b=A.pop(),[f,H(A),b]}.apply(this,arguments);return this._transaction.apply(this,l)},Dt.prototype._transaction=function(l,f,m){var b=this,S=je.trans;S&&S.db===this&&l.indexOf("!")===-1||(S=null);var A,T,P=l.indexOf("?")!==-1;l=l.replace("!","").replace("?","");try{if(T=f.map(function(j){if(j=j instanceof b.Table?j.name:j,typeof j!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return j}),l=="r"||l===$c)A=$c;else{if(l!="rw"&&l!=jc)throw new Ae.InvalidArgument("Invalid transaction mode: "+l);A=jc}if(S){if(S.mode===$c&&A===jc){if(!P)throw new Ae.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");S=null}S&&T.forEach(function(j){if(S&&S.storeNames.indexOf(j)===-1){if(!P)throw new Ae.SubTransaction("Table "+j+" not included in parent transaction.");S=null}}),P&&S&&!S.active&&(S=null)}}catch(j){return S?S._promise(null,function(z,D){D(j)}):Pt(j)}var B=function j(z,D,J,$,K){return De.resolve().then(function(){var W=je.transless||je,q=z._createTransaction(D,J,z._dbSchema,$);if(q.explicit=!0,W={trans:q,transless:W},$)q.idbtrans=$.idbtrans;else try{q.create(),q.idbtrans._explicit=!0,z._state.PR1398_maxLoop=3}catch(re){return re.name===Ne.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return j(z,D,J,null,K)})):Pt(re)}var Z,ne=de(K);return ne&&Mi(),W=De.follow(function(){var re;(Z=K.call(q,q))&&(ne?(re=br.bind(null,null),Z.then(re,re)):typeof Z.next=="function"&&typeof Z.throw=="function"&&(Z=ol(Z)))},W),(Z&&typeof Z.then=="function"?De.resolve(Z).then(function(re){return q.active?re:Pt(new Ae.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):W.then(function(){return Z})).then(function(re){return $&&q._resolve(),q._completion.then(function(){return re})}).catch(function(re){return q._reject(re),Pt(re)})})}.bind(null,this,A,T,S,m);return S?S._promise(A,B,"lock"):je.trans?Yr(je.transless,function(){return b._whenReady(B)}):this._whenReady(B)},Dt.prototype.table=function(l){if(!h(this._allTables,l))throw new Ae.InvalidTable("Table ".concat(l," does not exist"));return this._allTables[l]},Dt);function Dt(l,f){var m=this;this._middlewares={},this.verno=0;var b=Dt.dependencies;this._options=f=r({addons:Dt.addons,autoOpen:!0,indexedDB:b.indexedDB,IDBKeyRange:b.IDBKeyRange,cache:"cloned"},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},b=f.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var S,A,T,P,B,j={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ie,dbReadyPromise:null,cancelOpen:Ie,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen};j.dbReadyPromise=new De(function(D){j.dbReadyResolve=D}),j.openCanceller=new De(function(D,J){j.cancelOpen=J}),this._state=j,this.name=l,this.on=Ls(this,"populate","blocked","versionchange","close",{ready:[g,Ie]}),this.on.ready.subscribe=O(this.on.ready.subscribe,function(D){return function(J,$){Dt.vip(function(){var K,W=m._state;W.openComplete?(W.dbOpenError||De.resolve().then(J),$&&D(J)):W.onReadyBeingFired?(W.onReadyBeingFired.push(J),$&&D(J)):(D(J),K=m,$||D(function q(){K.on.ready.unsubscribe(J),K.on.ready.unsubscribe(q)}))})}}),this.Collection=(S=this,Ms(O0.prototype,function(Z,q){this.db=S;var $=jh,K=null;if(q)try{$=q()}catch(ne){K=ne}var W=Z._ctx,q=W.table,Z=q.hook.reading.fire;this._ctx={table:q,index:W.index,isPrimKey:!W.index||q.schema.primKey.keyPath&&W.index===q.schema.primKey.name,range:$,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:K,or:W.or,valueMapper:Z!==at?Z:null}})),this.Table=(A=this,Ms(Kh.prototype,function(D,J,$){this.db=A,this._tx=$,this.name=D,this.schema=J,this.hook=A._allTables[D]?A._allTables[D].hook:Ls(null,{creating:[lt,Ie],reading:[ct,at],updating:[x,Ie],deleting:[vt,Ie]})})),this.Transaction=(T=this,Ms(P0.prototype,function(D,J,$,K,W){var q=this;this.db=T,this.mode=D,this.storeNames=J,this.schema=$,this.chromeTransactionDurability=K,this.idbtrans=null,this.on=Ls(this,"complete","error","abort"),this.parent=W||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new De(function(Z,ne){q._resolve=Z,q._reject=ne}),this._completion.then(function(){q.active=!1,q.on.complete.fire()},function(Z){var ne=q.active;return q.active=!1,q.on.error.fire(Z),q.parent?q.parent._reject(Z):ne&&q.idbtrans&&q.idbtrans.abort(),Pt(Z)})})),this.Version=(P=this,Ms($0.prototype,function(D){this.db=P,this._cfg={version:D,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(B=this,Ms(Jh.prototype,function(D,J,$){if(this.db=B,this._ctx={table:D,index:J===":id"?null:J,or:$},this._cmp=this._ascending=ut,this._descending=function(K,W){return ut(W,K)},this._max=function(K,W){return 0<ut(K,W)?K:W},this._min=function(K,W){return ut(K,W)<0?K:W},this._IDBKeyRange=B._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ae.MissingAPI})),this.on("versionchange",function(D){0<D.newVersion?console.warn("Another connection wants to upgrade database '".concat(m.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(m.name,"'. Closing db now to resume the delete request.")),m.close({disableAutoOpen:!1})}),this.on("blocked",function(D){!D.newVersion||D.newVersion<D.oldVersion?console.warn("Dexie.delete('".concat(m.name,"') was blocked")):console.warn("Upgrade '".concat(m.name,"' blocked by other connection holding version ").concat(D.oldVersion/10))}),this._maxKey=Vs(f.IDBKeyRange),this._createTransaction=function(D,J,$,K){return new m.Transaction(D,J,$,m._options.chromeTransactionDurability,K)},this._fireOnBlocked=function(D){m.on("blocked").fire(D),Bi.filter(function(J){return J.name===m.name&&J!==m&&!J._state.vcFired}).map(function(J){return J.on("versionchange").fire(D)})},this.use(H0),this.use(W0),this.use(K0),this.use(V0),this.use(q0);var z=new Proxy(this,{get:function(D,J,$){if(J==="_vip")return!0;if(J==="table")return function(W){return Oa(m.table(W),z)};var K=Reflect.get(D,J,$);return K instanceof Kh?Oa(K,z):J==="tables"?K.map(function(W){return Oa(W,z)}):J==="_createTransaction"?function(){return Oa(K.apply(this,arguments),z)}:K}});this.vip=z,b.forEach(function(D){return D(m)})}var Ia,Sn=typeof Symbol!="undefined"&&"observable"in Symbol?Symbol.observable:"@@observable",Y0=(ll.prototype.subscribe=function(l,f,m){return this._subscribe(l&&typeof l!="function"?l:{next:l,error:f,complete:m})},ll.prototype[Sn]=function(){return this},ll);function ll(l){this._subscribe=l}try{Ia={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{Ia={indexedDB:null,IDBKeyRange:null}}function dp(l){var f,m=!1,b=new Y0(function(S){var A=de(l),T,P=!1,B={},j={},z={get closed(){return P},unsubscribe:function(){P||(P=!0,T&&T.abort(),D&&Sr.storagemutated.unsubscribe($))}};S.start&&S.start(z);var D=!1,J=function(){return Bc(K)},$=function(W){xa(B,W),nl(j,B)&&J()},K=function(){var W,q,Z;!P&&Ia.indexedDB&&(B={},W={},T&&T.abort(),T=new AbortController,Z=function(ne){var re=Ui();try{A&&Mi();var ce=yr(l,ne);return ce=A?ce.finally(br):ce}finally{re&&Li()}}(q={subscr:W,signal:T.signal,requery:J,querier:l,trans:null}),Promise.resolve(Z).then(function(ne){m=!0,f=ne,P||q.signal.aborted||(B={},function(re){for(var ce in re)if(h(re,ce))return;return 1}(j=W)||D||(Sr(js,$),D=!0),Bc(function(){return!P&&S.next&&S.next(ne)}))},function(ne){m=!1,["DatabaseClosedError","AbortError"].includes(ne==null?void 0:ne.name)||P||Bc(function(){P||S.error&&S.error(ne)})}))};return setTimeout(J,0),z});return b.hasValue=function(){return m},b.getValue=function(){return f},b}var Zr=er;function dl(l){var f=kr;try{kr=!0,Sr.storagemutated.fire(l),sl(l,!0)}finally{kr=f}}p(Zr,r(r({},Ke),{delete:function(l){return new Zr(l,{addons:[]}).delete()},exists:function(l){return new Zr(l,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(l){try{return f=Zr.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(Zc(m)?Promise.resolve(m.databases()).then(function(b){return b.map(function(S){return S.name}).filter(function(S){return S!==ma})}):Qc(m,f).toCollection().primaryKeys()).then(l)}catch{return Pt(new Ae.MissingAPI)}var f,m},defineClass:function(){return function(l){c(this,l)}},ignoreTransaction:function(l){return je.trans?Yr(je.transless,l):l()},vip:el,async:function(l){return function(){try{var f=ol(l.apply(this,arguments));return f&&typeof f.then=="function"?f:De.resolve(f)}catch(m){return Pt(m)}}},spawn:function(l,f,m){try{var b=ol(l.apply(m,f||[]));return b&&typeof b.then=="function"?b:De.resolve(b)}catch(S){return Pt(S)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(l,f){return f=De.resolve(typeof l=="function"?Zr.ignoreTransaction(l):l).timeout(f||6e4),je.trans?je.trans.waitFor(f):f},Promise:De,debug:{get:function(){return N},set:function(l){V(l)}},derive:w,extend:c,props:p,override:O,Events:Ls,on:Sr,liveQuery:dp,extendObservabilitySet:xa,getByKeyPath:Y,setByKeyPath:ee,delByKeyPath:function(l,f){typeof f=="string"?ee(l,f,void 0):"length"in f&&[].map.call(f,function(m){ee(l,m,void 0)})},shallowClone:F,deepClone:qe,getObjectDiff:al,cmp:ut,asap:M,minKey:-1/0,addons:[],connections:Bi,errnames:Ne,dependencies:Ia,cache:Qr,semVer:"4.0.11",version:"4.0.11".split(".").map(function(l){return parseInt(l)}).reduce(function(l,f,m){return l+f/Math.pow(10,2*m)})})),Zr.maxKey=Vs(Zr.dependencies.IDBKeyRange),typeof dispatchEvent!="undefined"&&typeof addEventListener!="undefined"&&(Sr(js,function(l){kr||(l=new CustomEvent(Kc,{detail:l}),kr=!0,dispatchEvent(l),kr=!1)}),addEventListener(Kc,function(l){l=l.detail,kr||dl(l)}));var Vi,kr=!1,fp=function(){};return typeof BroadcastChannel!="undefined"&&((fp=function(){(Vi=new BroadcastChannel(Kc)).onmessage=function(l){return l.data&&dl(l.data)}})(),typeof Vi.unref=="function"&&Vi.unref(),Sr(js,function(l){kr||Vi.postMessage(l)})),typeof addEventListener!="undefined"&&(addEventListener("pagehide",function(l){if(!er.disableBfCache&&l.persisted){N&&console.debug("Dexie: handling persisted pagehide"),Vi!=null&&Vi.close();for(var f=0,m=Bi;f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(l){!er.disableBfCache&&l.persisted&&(N&&console.debug("Dexie: handling persisted pageshow"),fp(),dl({all:new Wt(-1/0,[[]])}))})),De.rejectionMapper=function(l,f){return!l||l instanceof Fe||l instanceof TypeError||l instanceof SyntaxError||!l.name||!Ze[l.name]?l:(f=new Ze[l.name](f||l.message,l),"stack"in l&&v(f,"stack",{get:function(){return this.inner.stack}}),f)},V(N),r(er,Object.freeze({__proto__:null,Dexie:er,liveQuery:dp,Entity:Vh,cmp:ut,PropModification:Bs,replacePrefix:function(l,f){return new Bs({replacePrefix:[l,f]})},add:function(l){return new Bs({add:l})},remove:function(l){return new Bs({remove:l})},default:er,RangeSet:Wt,mergeRanges:Ks,rangesOverlap:tp}),{default:er}),er})}(fu)),fu.exports}var iO=rO();const Sf=Hr(iO),Wg=Symbol.for("Dexie"),Fu=globalThis[Wg]||(globalThis[Wg]=Sf);if(Sf.semVer!==Fu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Sf.semVer} and ${Fu.semVer}`);const{liveQuery:UU,mergeRanges:LU,rangesOverlap:MU,RangeSet:BU,cmp:$U,Entity:jU,PropModification:VU,replacePrefix:qU,add:HU,remove:KU}=Fu;class bw extends Fu{constructor(n,r,i={}){super(n);Pe(this,"logs");const s={logs:"id, level, time, source, account"};this.version(r).stores({...s,...i})}}class sO extends bw{constructor(){super("nizza",1)}}class ww{constructor(e,n){Pe(this,"logger");Pe(this,"channel");Pe(this,"listeners",new Map);Pe(this,"eventQueue",new Map);this.logger=n.child("EventBus");try{this.logger.debug(`Creating BroadcastChannel with name "${e}"`),this.channel=new BroadcastChannel(e),this.channel.onmessage=r=>this.handleMessage(r),this.channel.onmessageerror=r=>this.logger.error("NizzaBroadcastChannel error:",r)}catch(r){throw this.logger.error("Failed to create NizzaBroadcastChannel:",r),r}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,r={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,r)}handleMessage(e){const n=e.data,{name:r}=n;this.logger.debug(`Received message "${r}" with data`,n);for(const[i,s]of this.listeners.entries())this.matchWildcard(i,r)&&(this.logger.debug(`Matching pattern "${i}" for event "${r}"`),s.forEach(o=>o({...n,wildcard:i})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const i=new Error("Invalid arguments");throw this.logger.error(i),i}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const r=Array.from(this.eventQueue).filter(([i])=>{const s=this.matchWildcard(e,i);return s&&(this.eventQueue.delete(i),this.logger.debug(`Dequeued pending events for "${i}".`)),s}).flatMap(([,i])=>i);for(const[i,s]of this.listeners.entries())this.matchWildcard(i,e)&&(this.logger.debug(`Adding listener to pattern "${i}"`),s.add(n),r.length&&(this.logger.debug(`Delivering pending events for "${e}".`),r.forEach(o=>{n({...o,wildcard:i})})))}emitEvent(e,n,r){if(typeof e!="string"){const o=new Error("Invalid arguments");throw this.logger.error(o),o}const i={name:e,data:n,attrs:r},s=Array.from(this.getMatchingListeners(e));if(s.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[o,a]of s)a({...i,wildcard:o})}else this.logger.debug(`No listeners for event "${e}", enqueuing`),this.eventQueue.has(e)||this.eventQueue.set(e,[]),this.eventQueue.get(e).push(i);this.logger.debug("Posting message to channel",i),this.channel.postMessage(i)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,r]of this.listeners.entries())if(this.matchWildcard(n,e))for(const i of r)yield[n,i]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const r=this.listeners.get(e);r.delete(n),r.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const r=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),s=new RegExp(`^${r}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${s}`),s}}var oo={exports:{}},id,Yg;function oO(){if(Yg)return id;Yg=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}id=e;function e(n,r,i){var s=i&&i.stringify||t,o=1;if(typeof n=="object"&&n!==null){var a=r.length+o;if(a===1)return n;var c=new Array(a);c[0]=s(n);for(var u=1;u<a;u++)c[u]=s(r[u]);return c.join(" ")}if(typeof n!="string")return n;var d=r.length;if(d===0)return n;for(var h="",p=1-o,y=-1,v=n&&n.length||0,w=0;w<v;){if(n.charCodeAt(w)===37&&w+1<v){switch(y=y>-1?y:0,n.charCodeAt(w+1)){case 100:case 102:if(p>=d||r[p]==null)break;y<w&&(h+=n.slice(y,w)),h+=Number(r[p]),y=w+2,w++;break;case 105:if(p>=d||r[p]==null)break;y<w&&(h+=n.slice(y,w)),h+=Math.floor(Number(r[p])),y=w+2,w++;break;case 79:case 111:case 106:if(p>=d||r[p]===void 0)break;y<w&&(h+=n.slice(y,w));var k=typeof r[p];if(k==="string"){h+="'"+r[p]+"'",y=w+2,w++;break}if(k==="function"){h+=r[p].name||"<anonymous>",y=w+2,w++;break}h+=s(r[p]),y=w+2,w++;break;case 115:if(p>=d)break;y<w&&(h+=n.slice(y,w)),h+=String(r[p]),y=w+2,w++;break;case 37:y<w&&(h+=n.slice(y,w)),h+="%",y=w+2,w++,p--;break}++p}++w}return y===-1?n:(y<v&&(h+=n.slice(y)),h)}return id}var Jg;function aO(){if(Jg)return oo.exports;Jg=1;const t=oO();oo.exports=d;const e=G().console||{},n={mapHttpRequest:ee,mapHttpResponse:ee,wrapRequestSerializer:F,wrapResponseSerializer:F,wrapErrorSerializer:F,req:ee,res:ee,err:M,errWithCause:M};function r(R,Q){return R==="silent"?1/0:Q.levels.values[R]}const i=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function a(R,Q){const te={logger:Q,parent:R[s]};Q[s]=te}function c(R,Q,te){const ge={};Q.forEach(ve=>{ge[ve]=te[ve]?te[ve]:e[ve]||e[o[ve]||"log"]||se}),R[i]=ge}function u(R,Q){return Array.isArray(R)?R.filter(function(ge){return ge!=="!stdSerializers.err"}):R===!0?Object.keys(Q):!1}function d(R){R=R||{},R.browser=R.browser||{};const Q=R.browser.transmit;if(Q&&typeof Q.send!="function")throw Error("pino: transmit option must have a send function");const te=R.browser.write||e;R.browser.write&&(R.browser.asObject=!0);const ge=R.serializers||{},ve=u(R.browser.serialize,ge);let U=R.browser.serialize;Array.isArray(R.browser.serialize)&&R.browser.serialize.indexOf("!stdSerializers.err")>-1&&(U=!1);const de=Object.keys(R.customLevels||{}),Se=["error","fatal","warn","info","debug","trace"].concat(de);typeof te=="function"&&Se.forEach(function(Ze){te[Ze]=te}),(R.enabled===!1||R.browser.disabled)&&(R.level="silent");const Fe=R.level||"info",L=Object.create(te);L.log||(L.log=se),c(L,Se,te),a({},L),Object.defineProperty(L,"levelVal",{get:He}),Object.defineProperty(L,"level",{get:Ne,set:Ve});const X={transmit:Q,serialize:ve,asObject:R.browser.asObject,formatters:R.browser.formatters,levels:Se,timestamp:Y(R),messageKey:R.messageKey||"msg",onChild:R.onChild||se};L.levels=h(R),L.level=Fe,L.setMaxListeners=L.getMaxListeners=L.emit=L.addListener=L.on=L.prependListener=L.once=L.prependOnceListener=L.removeListener=L.removeAllListeners=L.listeners=L.listenerCount=L.eventNames=L.write=L.flush=se,L.serializers=ge,L._serialize=ve,L._stdErrSerialize=U,L.child=function(...Ze){return Ae.call(this,X,...Ze)},Q&&(L._logEvent=I());function He(){return r(this.level,this)}function Ne(){return this._level}function Ve(Ze){if(Ze!=="silent"&&!this.levels.values[Ze])throw Error("unknown level "+Ze);this._level=Ze,v(this,X,L,"error"),v(this,X,L,"fatal"),v(this,X,L,"warn"),v(this,X,L,"info"),v(this,X,L,"debug"),v(this,X,L,"trace"),de.forEach(Ke=>{v(this,X,L,Ke)})}function Ae(Ze,Ke,Ie){if(!Ke)throw new Error("missing bindings for child Pino");Ie=Ie||{},ve&&Ke.serializers&&(Ie.serializers=Ke.serializers);const at=Ie.serializers;if(ve&&at){var ct=Object.assign({},ge,at),Ue=R.browser.serialize===!0?Object.keys(ct):ve;delete Ke.serializers,E([Ke],Ue,ct,this._stdErrSerialize)}function lt(x){this._childLevel=(x._childLevel|0)+1,this.bindings=Ke,ct&&(this.serializers=ct,this._serialize=Ue),Q&&(this._logEvent=I([].concat(x._logEvent.bindings,Ke)))}lt.prototype=this;const vt=new lt(this);return a(this,vt),vt.child=function(...x){return Ae.call(this,Ze,...x)},vt.level=Ie.level||this.level,Ze.onChild(vt),vt}return L}function h(R){const Q=R.customLevels||{},te=Object.assign({},d.levels.values,Q),ge=Object.assign({},d.levels.labels,p(Q));return{values:te,labels:ge}}function p(R){const Q={};return Object.keys(R).forEach(function(te){Q[R[te]]=te}),Q}d.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},d.stdSerializers=n,d.stdTimeFunctions=Object.assign({},{nullTime:H,epochTime:ie,unixTime:xe,isoTime:qe});function y(R){const Q=[];R.bindings&&Q.push(R.bindings);let te=R[s];for(;te.parent;)te=te.parent,te.logger.bindings&&Q.push(te.logger.bindings);return Q.reverse()}function v(R,Q,te,ge){if(Object.defineProperty(R,ge,{value:r(R.level,te)>r(ge,te)?se:te[i][ge],writable:!0,enumerable:!0,configurable:!0}),R[ge]===se){if(!Q.transmit)return;const U=Q.transmit.level||R.level,de=r(U,te);if(r(ge,te)<de)return}R[ge]=k(R,Q,te,ge);const ve=y(R);ve.length!==0&&(R[ge]=w(ve,R[ge]))}function w(R,Q){return function(){return Q.apply(this,[...R,...arguments])}}function k(R,Q,te,ge){return function(ve){return function(){const de=Q.timestamp(),Se=new Array(arguments.length),Fe=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var L=0;L<Se.length;L++)Se[L]=arguments[L];var X=!1;if(Q.serialize&&(E(Se,this._serialize,this.serializers,this._stdErrSerialize),X=!0),Q.asObject||Q.formatters?ve.call(Fe,C(this,ge,Se,de,Q)):ve.apply(Fe,Se),Q.transmit){const He=Q.transmit.level||R._level,Ne=r(He,te),Ve=r(ge,te);if(Ve<Ne)return;O(this,{ts:de,methodLevel:ge,methodValue:Ve,transmitValue:te.levels.values[Q.transmit.level||R._level],send:Q.transmit.send,val:r(R._level,te)},Se,X)}}}(R[i][ge])}function C(R,Q,te,ge,ve){const{level:U,log:de=Ne=>Ne}=ve.formatters||{},Se=te.slice();let Fe=Se[0];const L={};if(ge&&(L.time=ge),U){const Ne=U(Q,R.levels.values[Q]);Object.assign(L,Ne)}else L.level=R.levels.values[Q];let X=(R._childLevel|0)+1;if(X<1&&(X=1),Fe!==null&&typeof Fe=="object"){for(;X--&&typeof Se[0]=="object";)Object.assign(L,Se.shift());Fe=Se.length?t(Se.shift(),Se):void 0}else typeof Fe=="string"&&(Fe=t(Se.shift(),Se));return Fe!==void 0&&(L[ve.messageKey]=Fe),de(L)}function E(R,Q,te,ge){for(const ve in R)if(ge&&R[ve]instanceof Error)R[ve]=d.stdSerializers.err(R[ve]);else if(typeof R[ve]=="object"&&!Array.isArray(R[ve])&&Q)for(const U in R[ve])Q.indexOf(U)>-1&&U in te&&(R[ve][U]=te[U](R[ve][U]))}function O(R,Q,te,ge=!1){const ve=Q.send,U=Q.ts,de=Q.methodLevel,Se=Q.methodValue,Fe=Q.val,L=R._logEvent.bindings;ge||E(te,R._serialize||Object.keys(R.serializers),R.serializers,R._stdErrSerialize===void 0?!0:R._stdErrSerialize),R._logEvent.ts=U,R._logEvent.messages=te.filter(function(X){return L.indexOf(X)===-1}),R._logEvent.level.label=de,R._logEvent.level.value=Se,ve(de,R._logEvent,Fe),R._logEvent=I(L)}function I(R){return{ts:0,messages:[],bindings:R||[],level:{label:"",value:0}}}function M(R){const Q={type:R.constructor.name,msg:R.message,stack:R.stack};for(const te in R)Q[te]===void 0&&(Q[te]=R[te]);return Q}function Y(R){return typeof R.timestamp=="function"?R.timestamp:R.timestamp===!1?H:ie}function ee(){return{}}function F(R){return R}function se(){}function H(){return!1}function ie(){return Date.now()}function xe(){return Math.round(Date.now()/1e3)}function qe(){return new Date(Date.now()).toISOString()}function G(){function R(Q){return typeof Q!="undefined"&&Q}try{return typeof globalThis!="undefined"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return R(self)||R(window)||R(this)||{}}}return oo.exports.default=d,oo.exports.pino=d,oo.exports}var uO=aO();const cO=Hr(uO),qt=[];for(let t=0;t<256;++t)qt.push((t+256).toString(16).slice(1));function lO(t,e=0){return(qt[t[e+0]]+qt[t[e+1]]+qt[t[e+2]]+qt[t[e+3]]+"-"+qt[t[e+4]]+qt[t[e+5]]+"-"+qt[t[e+6]]+qt[t[e+7]]+"-"+qt[t[e+8]]+qt[t[e+9]]+"-"+qt[t[e+10]]+qt[t[e+11]]+qt[t[e+12]]+qt[t[e+13]]+qt[t[e+14]]+qt[t[e+15]]).toLowerCase()}let sd;const dO=new Uint8Array(16);function fO(){if(!sd){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");sd=crypto.getRandomValues.bind(crypto)}return sd(dO)}const hO=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xg={randomUUID:hO};function pO(t,e,n){var i,s,o;if(Xg.randomUUID&&!t)return Xg.randomUUID();t=t||{};const r=(o=(s=t.random)!=null?s:(i=t.rng)==null?void 0:i.call(t))!=null?o:fO();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,lO(r)}const mO=4;var _w=(t=>(t.CREATED="CREATED",t.STARTING="STARTING",t.LIVE="LIVE",t.FINALIZED="FINALIZED",t))(_w||{});const gO={ALL:"*",CORE:"core:**",ADD_TO_CART_HOOKS:"core:addToCartHooks:**",LIVE_STREAMING_EVENT:"event:**",EVENT_CHAT:"event:chat:**",EVENT_PRODUCTS:"event:products:**",CUSTOMIZE_LIVE:"customize-live:**",PLAYER:"player:**",SNACK_SIZE_VIDEO:"ssv:**",SNACK_SIZE_VIDEO_ADMIN:"ssv-admin:**",UI:"ui:**",UTILS:"utils:**"},Sw={EVENT_STATUS_CHANGED:"event:statusChanged",ATCH_ACTION_EXECUTED:"core:addToCartHooks:actionExecuted"};var kw=(t=>(t.English="en",t.Spanish="es",t.Portuguese="pt",t))(kw||{}),Rt=(t=>(t.TRACE="trace",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.FATAL="fatal",t))(Rt||{});const At={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Ew={[At.trace]:"trace",[At.debug]:"debug",[At.info]:"info",[At.warn]:"warn",[At.error]:"error",[At.fatal]:"fatal"};var Aw=(t=>(t.COMBO="Combo",t.BADGE="Badged",t))(Aw||{}),Cw=(t=>(t.VTEX="VTEX",t.PLATFORM="platform",t.CACE="CACE",t.GLOBAL_PAGE="globalPage",t.CUSTOMIZATION="customization",t.FAST_STORE="faststore",t.UNKNOWN="unknown",t))(Cw||{});function xw(t){return Object.values(Rt).includes(String(t).toLowerCase())}class fh extends Error{constructor(e){super(`Invalid log level: ${e}`),this.name="InvalidLogLevelError"}}const Qt=class Qt{constructor(e){Pe(this,"instance");Pe(this,"httpLogger");Pe(this,"consoleLogger");Pe(this,"config");var a;this.config=e;const{source:n,levelService:r,metadata:i={},consoleLogger:s,httpLogger:o}=e;(a=Qt.root)!=null||(Qt.root=Qt.createRootLogger(s,o)),Qt.mergeGlobalMetadata(i),this.instance=Qt.root.child({source:n}),this.consoleLogger=s,this.httpLogger=o,this.setLevel(r.getLevel(n))}static createRootLogger(e,n){return cO({customLevels:At,browser:{write:r=>{const{payload:i,options:s,stack:o,...a}=r,c={...a,...i};s.silent||e.print(c,o),c.level>=At[Rt.WARN]&&n.save(c)}}})}static mergeGlobalMetadata(e={}){Qt.globalMetadata={...Qt.globalMetadata,...e}}child(e,n={}){return Qt.mergeGlobalMetadata(n),new Qt({source:`${this.config.source}:${e}`,levelService:this.config.levelService,consoleLogger:this.consoleLogger,httpLogger:this.httpLogger})}setLevel(e){this.instance.level=e}setMetadata(e){Qt.mergeGlobalMetadata(e)}formatLogEntry(e){const{content:n,stack:r,options:i={}}=e,{message:s,args:o=[]}=n,a=pO(),c={};let u;return s instanceof Error?(c.error={name:s.name,message:s.message,stack:s.stack},u=s.message):u=typeof s=="object"?JSON.stringify(s):String(s),o.forEach((h,p)=>this.formatArg(h,p,c)),{payload:{id:a,msg:u,data:c,...Qt.globalMetadata},options:i,stack:r}}formatArg(e,n,r){if(e instanceof Error){const i=r.error?`error${n+1}`:"error";r[i]={message:e.message,stack:e.stack,name:e.name}}else typeof e=="object"&&e!==null?Object.assign(r,e):r[`$${n}`]=String(e)}log(e,n){if(typeof this.instance[e]!="function")throw new fh(e);const r=this.formatLogEntry(n);this.instance[e](r)}trace(e){this.log("trace",e)}debug(e){this.log("debug",e)}info(e){this.log("info",e)}warn(e){this.log("warn",e)}error(e){this.log("error",e)}fatal(e){this.log("fatal",e)}get source(){return this.config.source}};Pe(Qt,"globalMetadata",{}),Pe(Qt,"root",null);let kf=Qt;const Qg={stackExclusionPatterns:/\b(PinoAdapter|ConsoleLogger|LoggerChain|Logger|Proxy|Child|pino\.js)\b/,themes:{dark:{baseStyles:{timestamp:"color: #A9A9A9; font-weight: normal;",source:"color: #B0B0B0; font-weight: normal;",context:"color: #FFFFFF; font-weight: bold;",defaultMessage:"color: #E5E5E5; font-weight: normal;"},levels:{[At[Rt.TRACE]]:"color: #778899; font-weight: bold;",[At[Rt.DEBUG]]:"color: #008B8B; font-weight: bold;",[At[Rt.INFO]]:"color: #00FFFF; font-weight: bold;",[At[Rt.WARN]]:"color: #FFD700; font-weight: bold;",[At[Rt.ERROR]]:"color: #FF4500; font-weight: bold;",[At[Rt.FATAL]]:"color: #FF0000; font-weight: bold; text-shadow: 1px 1px 1px black;"},messages:{[At[Rt.WARN]]:"color: #FFD700; font-weight: normal;",[At[Rt.ERROR]]:"color: #FF4500; font-weight: normal;",[At[Rt.FATAL]]:"color: #FF0000; font-weight: bold;"}},light:{baseStyles:{timestamp:"color: #4D4D4D; font-weight: normal;",source:"color: #666666; font-weight: normal;",context:"color: #000000; font-weight: bold;",defaultMessage:"color: #333333; font-weight: normal;"},levels:{[At[Rt.TRACE]]:"color: #6A5ACD; font-weight: bold;",[At[Rt.DEBUG]]:"color: #00509E; font-weight: bold;",[At[Rt.INFO]]:"color: #1E90FF; font-weight: bold;",[At[Rt.WARN]]:"color: #FFA500; font-weight: bold;",[At[Rt.ERROR]]:"color: #ff0033; font-weight: bold;",[At[Rt.FATAL]]:"color: #D80000; font-weight: bold; text-shadow: 1px 1px 1px #660000;"},messages:{[At[Rt.WARN]]:"color: #FFA500; font-weight: normal;",[At[Rt.ERROR]]:"color: #ff0033; font-weight: normal;",[At[Rt.FATAL]]:"color: #D80000; font-weight: bold;"}}}};class vO{constructor(){Pe(this,"theme");this.theme=this.initializeTheme(),this.setupThemeChangeListener()}initializeTheme(){const e=localStorage.getItem("log-theme");return e==="light"||e==="dark"?e:this.detectTheme()}detectTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}setupThemeChangeListener(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{this.theme=e.matches?"dark":"light"})}static setTheme(e){localStorage.setItem("consoleLoggerTheme",e)}formatStack(e){return e.split(`
|
|
127
|
-
`).filter(n=>!Qg.stackExclusionPatterns.test(n)).map(n=>n.replace(/^Error\s*/,"").trim())}getStyles(e){const n=Qg.themes[this.theme];return{...n.baseStyles,level:n.levels[e]||n.baseStyles.defaultMessage,message:n.messages[e]||n.baseStyles.defaultMessage}}getTime(){return new Date().toLocaleTimeString("en-US",{hour12:!1})+`.${new Date().getMilliseconds().toString().padStart(3,"0")}`}print({level:e,source:n,msg:r,data:i},s){const[o,a,c]=n.split(":"),u=(Ew[e]||"UNKNOWN").toUpperCase(),d=c?`${c}: `:"",h=a?`:${a}`:"",p=this.getStyles(e);console.groupCollapsed(`%c${this.getTime()} %c${u} %c[${o}${h}] %c${d}%c${r}`,p.timestamp,p.level,p.source,p.context,p.message),i&&Object.keys(i).length&&console.log("Data:",i);const y=this.formatStack(s||new Error().stack);y.length&&console.log("Stack:",y.join(`
|
|
128
|
-
`)),console.groupEnd()}}const yO={endpoint:`${bs.apiUrls.restV2}/v1/telemetry/logs`,batchSize:500,flushInterval:10,maxRetries:5,retryBackoffFactor:2,maxPayloadSize:500};class hh{constructor(e){Pe(this,"config");Pe(this,"isFlushing",!1);Pe(this,"retryCount",0);Pe(this,"isFlushScheduled",!1);this.config=e,this.setupUnloadListener()}static create(e){const n={...yO,...e};if(!n.db)throw new Error("Invalid Dixie DB");if(!n.project)throw new Error("Project name is required");return new hh(n)}async save(e){const n=JSON.parse(JSON.stringify(e));await this.config.db.logs.add(n),this.scheduleFlush()}scheduleFlush(e=this.config.flushInterval*1e3){this.isFlushScheduled||this.isFlushing||(this.isFlushScheduled=!0,setTimeout(()=>{this.isFlushScheduled=!1,this.flush()},e))}async flush(){if(this.isFlushing)return;this.isFlushing=!0;let e=!1;try{await this.processLogsBatch(async r=>{await this.sendLogs(r),await this.deleteLogs(r)}),this.retryCount=0,e=!0}catch(r){this.logError("flush",r)}this.isFlushing=!1;const n=await this.hasPendingLogs();!e&&n?this.handleRetry():e&&n&&this.scheduleFlush()}async processLogsBatch(e){const n=await this.getLogsBatch(),r=this.splitLogsByPayloadSize(n);for(const i of r)await e(i)}async getLogsBatch(e=this.config.batchSize){return this.config.db.logs.orderBy("time").limit(e).toArray()}splitLogsByPayloadSize(e){let n=[],r=0;const i=[];return e.forEach(s=>{const o=JSON.stringify(s).length/1024;r+o>this.config.maxPayloadSize&&(i.push(n),n=[],r=0),n.push(s),r+=o}),n.length>0&&i.push(n),i}async sendLogs(e){const n=this.buildPayload(e);await xi({url:this.config.endpoint,method:"POST",body:n})}buildPayload(e){return JSON.stringify({project:this.config.project,logs:e})}async deleteLogs(e){const n=e.map(r=>r.id);await this.config.db.logs.bulkDelete(n)}logError(e,n){console.error(`[${e}]`,n)}handleRetry(){if(this.retryCount>=this.config.maxRetries)return;this.retryCount++;const e=this.config.flushInterval*Math.pow(this.config.retryBackoffFactor,this.retryCount)*1e3;this.scheduleFlush(e)}async hasPendingLogs(){return await this.config.db.logs.count()>0}setupUnloadListener(){window.addEventListener("beforeunload",async()=>{this.isFlushing||!await this.hasPendingLogs()||await this.processLogsBatch(async e=>{const n=this.buildPayload(e);navigator.sendBeacon(this.config.endpoint,n)?await this.deleteLogs(e):console.warn("Failed to send logs via sendBeacon; logs will remain in the database.")})})}}var od={},ad,Zg;function hc(){if(Zg)return ad;Zg=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",c=`(?:${s}|$)`,u=`(?:^|${s})`,d=`${n}{1,2}${c}`,h=`(?!${n})`,p=`(?!${u}${d})`,y=`(?!${n}{0,1}${c})`,v=`(?!${d})`,w=`[^.${s}]`,k=`${a}*?`,E={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:c,DOTS_SLASH:d,NO_DOT:h,NO_DOTS:p,NO_DOT_SLASH:y,NO_DOTS_SLASH:v,QMARK_NO_DOT:w,STAR:k,START_ANCHOR:u,SEP:"/"},O={...E,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},I={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ad={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:I,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(M){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${M.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(M){return M===!0?O:E}},ad}var ev;function pc(){return ev||(ev=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=hc();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator!="undefined"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process!="undefined"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,o=>o==="\\"?"":o),t.escapeLast=(s,o,a)=>{const c=s.lastIndexOf(o,a);return c===-1?s:s[c-1]==="\\"?t.escapeLast(s,o,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const c=a.contains?"":"^",u=a.contains?"":"$";let d=`${c}(?:${s})${u}`;return o.negated===!0&&(d=`(?:^(?!${d}).*$)`),d},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}}(od)),od}var ud,tv;function bO(){if(tv)return ud;tv=1;const t=pc(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:d,CHAR_PLUS:h,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:w}=hc(),k=O=>O===a||O===r,C=O=>{O.isPrefix!==!0&&(O.depth=O.isGlobstar?1/0:1)};return ud=(O,I)=>{const M=I||{},Y=O.length-1,ee=M.parts===!0||M.scanToEnd===!0,F=[],se=[],H=[];let ie=O,xe=-1,qe=0,G=0,R=!1,Q=!1,te=!1,ge=!1,ve=!1,U=!1,de=!1,Se=!1,Fe=!1,L=!1,X=0,He,Ne,Ve={value:"",depth:0,isGlob:!1};const Ae=()=>xe>=Y,Ze=()=>ie.charCodeAt(xe+1),Ke=()=>(He=Ne,ie.charCodeAt(++xe));for(;xe<Y;){Ne=Ke();let lt;if(Ne===r){de=Ve.backslashes=!0,Ne=Ke(),Ne===c&&(U=!0);continue}if(U===!0||Ne===c){for(X++;Ae()!==!0&&(Ne=Ke());){if(Ne===r){de=Ve.backslashes=!0,Ke();continue}if(Ne===c){X++;continue}if(U!==!0&&Ne===s&&(Ne=Ke())===s){if(R=Ve.isBrace=!0,te=Ve.isGlob=!0,L=!0,ee===!0)continue;break}if(U!==!0&&Ne===i){if(R=Ve.isBrace=!0,te=Ve.isGlob=!0,L=!0,ee===!0)continue;break}if(Ne===y&&(X--,X===0)){U=!1,R=Ve.isBrace=!0,L=!0;break}}if(ee===!0)continue;break}if(Ne===a){if(F.push(xe),se.push(Ve),Ve={value:"",depth:0,isGlob:!1},L===!0)continue;if(He===s&&xe===qe+1){qe+=2;continue}G=xe+1;continue}if(M.noext!==!0&&(Ne===h||Ne===n||Ne===e||Ne===p||Ne===o)===!0&&Ze()===u){if(te=Ve.isGlob=!0,ge=Ve.isExtglob=!0,L=!0,Ne===o&&xe===qe&&(Fe=!0),ee===!0){for(;Ae()!==!0&&(Ne=Ke());){if(Ne===r){de=Ve.backslashes=!0,Ne=Ke();continue}if(Ne===v){te=Ve.isGlob=!0,L=!0;break}}continue}break}if(Ne===e){if(He===e&&(ve=Ve.isGlobstar=!0),te=Ve.isGlob=!0,L=!0,ee===!0)continue;break}if(Ne===p){if(te=Ve.isGlob=!0,L=!0,ee===!0)continue;break}if(Ne===d){for(;Ae()!==!0&&(lt=Ke());){if(lt===r){de=Ve.backslashes=!0,Ke();continue}if(lt===w){Q=Ve.isBracket=!0,te=Ve.isGlob=!0,L=!0;break}}if(ee===!0)continue;break}if(M.nonegate!==!0&&Ne===o&&xe===qe){Se=Ve.negated=!0,qe++;continue}if(M.noparen!==!0&&Ne===u){if(te=Ve.isGlob=!0,ee===!0){for(;Ae()!==!0&&(Ne=Ke());){if(Ne===u){de=Ve.backslashes=!0,Ne=Ke();continue}if(Ne===v){L=!0;break}}continue}break}if(te===!0){if(L=!0,ee===!0)continue;break}}M.noext===!0&&(ge=!1,te=!1);let Ie=ie,at="",ct="";qe>0&&(at=ie.slice(0,qe),ie=ie.slice(qe),G-=qe),Ie&&te===!0&&G>0?(Ie=ie.slice(0,G),ct=ie.slice(G)):te===!0?(Ie="",ct=ie):Ie=ie,Ie&&Ie!==""&&Ie!=="/"&&Ie!==ie&&k(Ie.charCodeAt(Ie.length-1))&&(Ie=Ie.slice(0,-1)),M.unescape===!0&&(ct&&(ct=t.removeBackslashes(ct)),Ie&&de===!0&&(Ie=t.removeBackslashes(Ie)));const Ue={prefix:at,input:O,start:qe,base:Ie,glob:ct,isBrace:R,isBracket:Q,isGlob:te,isExtglob:ge,isGlobstar:ve,negated:Se,negatedExtglob:Fe};if(M.tokens===!0&&(Ue.maxDepth=0,k(Ne)||se.push(Ve),Ue.tokens=se),M.parts===!0||M.tokens===!0){let lt;for(let vt=0;vt<F.length;vt++){const x=lt?lt+1:qe,_=F[vt],g=O.slice(x,_);M.tokens&&(vt===0&&qe!==0?(se[vt].isPrefix=!0,se[vt].value=at):se[vt].value=g,C(se[vt]),Ue.maxDepth+=se[vt].depth),(vt!==0||g!=="")&&H.push(g),lt=_}if(lt&<+1<O.length){const vt=O.slice(lt+1);H.push(vt),M.tokens&&(se[se.length-1].value=vt,C(se[se.length-1]),Ue.maxDepth+=se[se.length-1].depth)}Ue.slashes=F,Ue.parts=H}return Ue},ud}var cd,nv;function wO(){if(nv)return cd;nv=1;const t=hc(),e=pc(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(d,h)=>{if(typeof h.expandRange=="function")return h.expandRange(...d,h);d.sort();const p=`[${d.join("-")}]`;try{new RegExp(p)}catch{return d.map(v=>e.escapeRegex(v)).join("..")}return p},c=(d,h)=>`Missing ${d}: "${h}" - use "\\\\${h}" to match literal characters`,u=(d,h)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=o[d]||d;const p={...h},y=typeof p.maxLength=="number"?Math.min(n,p.maxLength):n;let v=d.length;if(v>y)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${y}`);const w={type:"bos",value:"",output:p.prepend||""},k=[w],C=p.capture?"":"?:",E=t.globChars(p.windows),O=t.extglobChars(E),{DOT_LITERAL:I,PLUS_LITERAL:M,SLASH_LITERAL:Y,ONE_CHAR:ee,DOTS_SLASH:F,NO_DOT:se,NO_DOT_SLASH:H,NO_DOTS_SLASH:ie,QMARK:xe,QMARK_NO_DOT:qe,STAR:G,START_ANCHOR:R}=E,Q=x=>`(${C}(?:(?!${R}${x.dot?F:I}).)*?)`,te=p.dot?"":se,ge=p.dot?xe:qe;let ve=p.bash===!0?Q(p):G;p.capture&&(ve=`(${ve})`),typeof p.noext=="boolean"&&(p.noextglob=p.noext);const U={input:d,index:-1,start:0,dot:p.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:k};d=e.removePrefix(d,U),v=d.length;const de=[],Se=[],Fe=[];let L=w,X;const He=()=>U.index===v-1,Ne=U.peek=(x=1)=>d[U.index+x],Ve=U.advance=()=>d[++U.index]||"",Ae=()=>d.slice(U.index+1),Ze=(x="",_=0)=>{U.consumed+=x,U.index+=_},Ke=x=>{U.output+=x.output!=null?x.output:x.value,Ze(x.value)},Ie=()=>{let x=1;for(;Ne()==="!"&&(Ne(2)!=="("||Ne(3)==="?");)Ve(),U.start++,x++;return x%2===0?!1:(U.negated=!0,U.start++,!0)},at=x=>{U[x]++,Fe.push(x)},ct=x=>{U[x]--,Fe.pop()},Ue=x=>{if(L.type==="globstar"){const _=U.braces>0&&(x.type==="comma"||x.type==="brace"),g=x.extglob===!0||de.length&&(x.type==="pipe"||x.type==="paren");x.type!=="slash"&&x.type!=="paren"&&!_&&!g&&(U.output=U.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=ve,U.output+=L.output)}if(de.length&&x.type!=="paren"&&(de[de.length-1].inner+=x.value),(x.value||x.output)&&Ke(x),L&&L.type==="text"&&x.type==="text"){L.output=(L.output||L.value)+x.value,L.value+=x.value;return}x.prev=L,k.push(x),L=x},lt=(x,_)=>{const g={...O[_],conditions:1,inner:""};g.prev=L,g.parens=U.parens,g.output=U.output;const N=(p.capture?"(":"")+g.open;at("parens"),Ue({type:x,value:_,output:U.output?"":ee}),Ue({type:"paren",extglob:!0,value:Ve(),output:N}),de.push(g)},vt=x=>{let _=x.close+(p.capture?")":""),g;if(x.type==="negate"){let N=ve;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(N=Q(p)),(N!==ve||He()||/^\)+$/.test(Ae()))&&(_=x.close=`)$))${N}`),x.inner.includes("*")&&(g=Ae())&&/^\.[^\\/.]+$/.test(g)){const V=u(g,{...h,fastpaths:!1}).output;_=x.close=`)${V})${N})`}x.prev.type==="bos"&&(U.negatedExtglob=!0)}Ue({type:"paren",extglob:!0,value:X,output:_}),ct("parens")};if(p.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let x=!1,_=d.replace(s,(g,N,V,ae,ue,We)=>ae==="\\"?(x=!0,g):ae==="?"?N?N+ae+(ue?xe.repeat(ue.length):""):We===0?ge+(ue?xe.repeat(ue.length):""):xe.repeat(V.length):ae==="."?I.repeat(V.length):ae==="*"?N?N+ae+(ue?ve:""):ve:N?g:`\\${g}`);return x===!0&&(p.unescape===!0?_=_.replace(/\\/g,""):_=_.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),_===d&&p.contains===!0?(U.output=d,U):(U.output=e.wrapOutput(_,U,h),U)}for(;!He();){if(X=Ve(),X==="\0")continue;if(X==="\\"){const g=Ne();if(g==="/"&&p.bash!==!0||g==="."||g===";")continue;if(!g){X+="\\",Ue({type:"text",value:X});continue}const N=/^\\+/.exec(Ae());let V=0;if(N&&N[0].length>2&&(V=N[0].length,U.index+=V,V%2!==0&&(X+="\\")),p.unescape===!0?X=Ve():X+=Ve(),U.brackets===0){Ue({type:"text",value:X});continue}}if(U.brackets>0&&(X!=="]"||L.value==="["||L.value==="[^")){if(p.posix!==!1&&X===":"){const g=L.value.slice(1);if(g.includes("[")&&(L.posix=!0,g.includes(":"))){const N=L.value.lastIndexOf("["),V=L.value.slice(0,N),ae=L.value.slice(N+2),ue=r[ae];if(ue){L.value=V+ue,U.backtrack=!0,Ve(),!w.output&&k.indexOf(L)===1&&(w.output=ee);continue}}}(X==="["&&Ne()!==":"||X==="-"&&Ne()==="]")&&(X=`\\${X}`),X==="]"&&(L.value==="["||L.value==="[^")&&(X=`\\${X}`),p.posix===!0&&X==="!"&&L.value==="["&&(X="^"),L.value+=X,Ke({value:X});continue}if(U.quotes===1&&X!=='"'){X=e.escapeRegex(X),L.value+=X,Ke({value:X});continue}if(X==='"'){U.quotes=U.quotes===1?0:1,p.keepQuotes===!0&&Ue({type:"text",value:X});continue}if(X==="("){at("parens"),Ue({type:"paren",value:X});continue}if(X===")"){if(U.parens===0&&p.strictBrackets===!0)throw new SyntaxError(c("opening","("));const g=de[de.length-1];if(g&&U.parens===g.parens+1){vt(de.pop());continue}Ue({type:"paren",value:X,output:U.parens?")":"\\)"}),ct("parens");continue}if(X==="["){if(p.nobracket===!0||!Ae().includes("]")){if(p.nobracket!==!0&&p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));X=`\\${X}`}else at("brackets");Ue({type:"bracket",value:X});continue}if(X==="]"){if(p.nobracket===!0||L&&L.type==="bracket"&&L.value.length===1){Ue({type:"text",value:X,output:`\\${X}`});continue}if(U.brackets===0){if(p.strictBrackets===!0)throw new SyntaxError(c("opening","["));Ue({type:"text",value:X,output:`\\${X}`});continue}ct("brackets");const g=L.value.slice(1);if(L.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(X=`/${X}`),L.value+=X,Ke({value:X}),p.literalBrackets===!1||e.hasRegexChars(g))continue;const N=e.escapeRegex(L.value);if(U.output=U.output.slice(0,-L.value.length),p.literalBrackets===!0){U.output+=N,L.value=N;continue}L.value=`(${C}${N}|${L.value})`,U.output+=L.value;continue}if(X==="{"&&p.nobrace!==!0){at("braces");const g={type:"brace",value:X,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};Se.push(g),Ue(g);continue}if(X==="}"){const g=Se[Se.length-1];if(p.nobrace===!0||!g){Ue({type:"text",value:X,output:X});continue}let N=")";if(g.dots===!0){const V=k.slice(),ae=[];for(let ue=V.length-1;ue>=0&&(k.pop(),V[ue].type!=="brace");ue--)V[ue].type!=="dots"&&ae.unshift(V[ue].value);N=a(ae,p),U.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){const V=U.output.slice(0,g.outputIndex),ae=U.tokens.slice(g.tokensIndex);g.value=g.output="\\{",X=N="\\}",U.output=V;for(const ue of ae)U.output+=ue.output||ue.value}Ue({type:"brace",value:X,output:N}),ct("braces"),Se.pop();continue}if(X==="|"){de.length>0&&de[de.length-1].conditions++,Ue({type:"text",value:X});continue}if(X===","){let g=X;const N=Se[Se.length-1];N&&Fe[Fe.length-1]==="braces"&&(N.comma=!0,g="|"),Ue({type:"comma",value:X,output:g});continue}if(X==="/"){if(L.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",k.pop(),L=w;continue}Ue({type:"slash",value:X,output:Y});continue}if(X==="."){if(U.braces>0&&L.type==="dot"){L.value==="."&&(L.output=I);const g=Se[Se.length-1];L.type="dots",L.output+=X,L.value+=X,g.dots=!0;continue}if(U.braces+U.parens===0&&L.type!=="bos"&&L.type!=="slash"){Ue({type:"text",value:X,output:I});continue}Ue({type:"dot",value:X,output:I});continue}if(X==="?"){if(!(L&&L.value==="(")&&p.noextglob!==!0&&Ne()==="("&&Ne(2)!=="?"){lt("qmark",X);continue}if(L&&L.type==="paren"){const N=Ne();let V=X;(L.value==="("&&!/[!=<:]/.test(N)||N==="<"&&!/<([!=]|\w+>)/.test(Ae()))&&(V=`\\${X}`),Ue({type:"text",value:X,output:V});continue}if(p.dot!==!0&&(L.type==="slash"||L.type==="bos")){Ue({type:"qmark",value:X,output:qe});continue}Ue({type:"qmark",value:X,output:xe});continue}if(X==="!"){if(p.noextglob!==!0&&Ne()==="("&&(Ne(2)!=="?"||!/[!=<:]/.test(Ne(3)))){lt("negate",X);continue}if(p.nonegate!==!0&&U.index===0){Ie();continue}}if(X==="+"){if(p.noextglob!==!0&&Ne()==="("&&Ne(2)!=="?"){lt("plus",X);continue}if(L&&L.value==="("||p.regex===!1){Ue({type:"plus",value:X,output:M});continue}if(L&&(L.type==="bracket"||L.type==="paren"||L.type==="brace")||U.parens>0){Ue({type:"plus",value:X});continue}Ue({type:"plus",value:M});continue}if(X==="@"){if(p.noextglob!==!0&&Ne()==="("&&Ne(2)!=="?"){Ue({type:"at",extglob:!0,value:X,output:""});continue}Ue({type:"text",value:X});continue}if(X!=="*"){(X==="$"||X==="^")&&(X=`\\${X}`);const g=i.exec(Ae());g&&(X+=g[0],U.index+=g[0].length),Ue({type:"text",value:X});continue}if(L&&(L.type==="globstar"||L.star===!0)){L.type="star",L.star=!0,L.value+=X,L.output=ve,U.backtrack=!0,U.globstar=!0,Ze(X);continue}let x=Ae();if(p.noextglob!==!0&&/^\([^?]/.test(x)){lt("star",X);continue}if(L.type==="star"){if(p.noglobstar===!0){Ze(X);continue}const g=L.prev,N=g.prev,V=g.type==="slash"||g.type==="bos",ae=N&&(N.type==="star"||N.type==="globstar");if(p.bash===!0&&(!V||x[0]&&x[0]!=="/")){Ue({type:"star",value:X,output:""});continue}const ue=U.braces>0&&(g.type==="comma"||g.type==="brace"),We=de.length&&(g.type==="pipe"||g.type==="paren");if(!V&&g.type!=="paren"&&!ue&&!We){Ue({type:"star",value:X,output:""});continue}for(;x.slice(0,3)==="/**";){const tt=d[U.index+4];if(tt&&tt!=="/")break;x=x.slice(3),Ze("/**",3)}if(g.type==="bos"&&He()){L.type="globstar",L.value+=X,L.output=Q(p),U.output=L.output,U.globstar=!0,Ze(X);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!ae&&He()){U.output=U.output.slice(0,-(g.output+L.output).length),g.output=`(?:${g.output}`,L.type="globstar",L.output=Q(p)+(p.strictSlashes?")":"|$)"),L.value+=X,U.globstar=!0,U.output+=g.output+L.output,Ze(X);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&x[0]==="/"){const tt=x[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(g.output+L.output).length),g.output=`(?:${g.output}`,L.type="globstar",L.output=`${Q(p)}${Y}|${Y}${tt})`,L.value+=X,U.output+=g.output+L.output,U.globstar=!0,Ze(X+Ve()),Ue({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&x[0]==="/"){L.type="globstar",L.value+=X,L.output=`(?:^|${Y}|${Q(p)}${Y})`,U.output=L.output,U.globstar=!0,Ze(X+Ve()),Ue({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-L.output.length),L.type="globstar",L.output=Q(p),L.value+=X,U.output+=L.output,U.globstar=!0,Ze(X);continue}const _={type:"star",value:X,output:ve};if(p.bash===!0){_.output=".*?",(L.type==="bos"||L.type==="slash")&&(_.output=te+_.output),Ue(_);continue}if(L&&(L.type==="bracket"||L.type==="paren")&&p.regex===!0){_.output=X,Ue(_);continue}(U.index===U.start||L.type==="slash"||L.type==="dot")&&(L.type==="dot"?(U.output+=H,L.output+=H):p.dot===!0?(U.output+=ie,L.output+=ie):(U.output+=te,L.output+=te),Ne()!=="*"&&(U.output+=ee,L.output+=ee)),Ue(_)}for(;U.brackets>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));U.output=e.escapeLast(U.output,"["),ct("brackets")}for(;U.parens>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing",")"));U.output=e.escapeLast(U.output,"("),ct("parens")}for(;U.braces>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing","}"));U.output=e.escapeLast(U.output,"{"),ct("braces")}if(p.strictSlashes!==!0&&(L.type==="star"||L.type==="bracket")&&Ue({type:"maybe_slash",value:"",output:`${Y}?`}),U.backtrack===!0){U.output="";for(const x of U.tokens)U.output+=x.output!=null?x.output:x.value,x.suffix&&(U.output+=x.suffix)}return U};return u.fastpaths=(d,h)=>{const p={...h},y=typeof p.maxLength=="number"?Math.min(n,p.maxLength):n,v=d.length;if(v>y)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${y}`);d=o[d]||d;const{DOT_LITERAL:w,SLASH_LITERAL:k,ONE_CHAR:C,DOTS_SLASH:E,NO_DOT:O,NO_DOTS:I,NO_DOTS_SLASH:M,STAR:Y,START_ANCHOR:ee}=t.globChars(p.windows),F=p.dot?I:O,se=p.dot?M:O,H=p.capture?"":"?:",ie={negated:!1,prefix:""};let xe=p.bash===!0?".*?":Y;p.capture&&(xe=`(${xe})`);const qe=te=>te.noglobstar===!0?xe:`(${H}(?:(?!${ee}${te.dot?E:w}).)*?)`,G=te=>{switch(te){case"*":return`${F}${C}${xe}`;case".*":return`${w}${C}${xe}`;case"*.*":return`${F}${xe}${w}${C}${xe}`;case"*/*":return`${F}${xe}${k}${C}${se}${xe}`;case"**":return F+qe(p);case"**/*":return`(?:${F}${qe(p)}${k})?${se}${C}${xe}`;case"**/*.*":return`(?:${F}${qe(p)}${k})?${se}${xe}${w}${C}${xe}`;case"**/.*":return`(?:${F}${qe(p)}${k})?${w}${C}${xe}`;default:{const ge=/^(.*?)\.(\w+)$/.exec(te);if(!ge)return;const ve=G(ge[1]);return ve?ve+w+ge[2]:void 0}}},R=e.removePrefix(d,ie);let Q=G(R);return Q&&p.strictSlashes!==!0&&(Q+=`${k}?`),Q},cd=u,cd}var ld,rv;function _O(){if(rv)return ld;rv=1;const t=bO(),e=wO(),n=pc(),r=hc(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,c=!1)=>{if(Array.isArray(o)){const k=o.map(E=>s(E,a,c));return E=>{for(const O of k){const I=O(E);if(I)return I}return!1}}const u=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const d=a||{},h=d.windows,p=u?s.compileRe(o,a):s.makeRe(o,a,!1,!0),y=p.state;delete p.state;let v=()=>!1;if(d.ignore){const k={...a,ignore:null,onMatch:null,onResult:null};v=s(d.ignore,k,c)}const w=(k,C=!1)=>{const{isMatch:E,match:O,output:I}=s.test(k,p,a,{glob:o,posix:h}),M={glob:o,state:y,regex:p,posix:h,input:k,output:I,match:O,isMatch:E};return typeof d.onResult=="function"&&d.onResult(M),E===!1?(M.isMatch=!1,C?M:!1):v(k)?(typeof d.onIgnore=="function"&&d.onIgnore(M),M.isMatch=!1,C?M:!1):(typeof d.onMatch=="function"&&d.onMatch(M),C?M:!0)};return c&&(w.state=y),w};return s.test=(o,a,c,{glob:u,posix:d}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const h=c||{},p=h.format||(d?n.toPosixSlashes:null);let y=o===u,v=y&&p?p(o):o;return y===!1&&(v=p?p(o):o,y=v===u),(y===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?y=s.matchBase(o,a,c,d):y=a.exec(v)),{isMatch:!!y,match:y,output:v}},s.matchBase=(o,a,c)=>(a instanceof RegExp?a:s.makeRe(a,c)).test(n.basename(o)),s.isMatch=(o,a,c)=>s(a,c)(o),s.parse=(o,a)=>Array.isArray(o)?o.map(c=>s.parse(c,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,c=!1,u=!1)=>{if(c===!0)return o.output;const d=a||{},h=d.contains?"":"^",p=d.contains?"":"$";let y=`${h}(?:${o.output})${p}`;o&&o.negated===!0&&(y=`^(?!${y}).*$`);const v=s.toRegex(y,a);return u===!0&&(v.state=o),v},s.makeRe=(o,a={},c=!1,u=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let d={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(d.output=e.fastpaths(o,a)),d.output||(d=e(o,a)),s.compileRe(d,a,c,u)},s.toRegex=(o,a)=>{try{const c=a||{};return new RegExp(o,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},s.constants=r,ld=s,ld}var dd,iv;function SO(){if(iv)return dd;iv=1;const t=_O(),e=pc();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),dd=n,dd}var kO=SO();const sv=Hr(kO),ov="loglevel-patterns",Ga="loglevel:",fd="!",EO=Rt.INFO;class AO{constructor(e){Pe(this,"projectPrefix");Pe(this,"patternsCache",null);this.projectPrefix=`${Ga}${e}:`}getLevel(e){const n=this.loadAndUnifyPatterns();return this.resolveLogLevelFromPatterns(e,n)||EO}setLevel(e,n){const{level:r,override:i}=this.parseLogLevel(n),s=`${Ga}${e}`,o=i?`${r}${fd}`:r;localStorage.setItem(s,o),this.patternsCache=null}loadAndUnifyPatterns(){if(this.patternsCache)return this.patternsCache;const e=this.readPatternsFromJSON(),n=this.unifyWithIndividualKeys(e);return this.patternsCache=n,n}resolveLogLevelFromPatterns(e,n){let r;for(const[i,{level:s,override:o}]of Object.entries(n))if(sv(i.toLowerCase())(e.toLowerCase())){if(o)return s;(!r||sv(i)(e))&&(r=s)}return r}readPatternsFromJSON(){try{const e=localStorage.getItem(ov);return e?JSON.parse(e):{}}catch{return console.error("Failed to parse loglevel-patterns from localStorage"),{}}}unifyWithIndividualKeys(e){const n={...e};for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);if(!i||!i.startsWith(Ga)||i===ov)continue;const s=i.replace(Ga,"").toLowerCase(),o=localStorage.getItem(i);if(!o)continue;const{level:a,override:c}=this.parseLogLevel(o);n[s]={level:a,override:c}}return n}parseLogLevel(e){const n=e.endsWith(fd),r=n?e.slice(0,-fd.length):e;if(!xw(r))throw new fh(r);return{level:r,override:n}}}class CO{constructor(e,n){Pe(this,"committed",!1);Pe(this,"chainOptions",{});Pe(this,"method",null);Pe(this,"stack","");Pe(this,"args",[]);this.adapter=e,n&&(this.chainOptions={...n}),Promise.resolve().then(()=>this.commit())}options(e){return this.chainOptions={...this.chainOptions,...e},this}trace(...e){return this.log("trace",e)}debug(...e){return this.log("debug",e)}info(...e){return this.log("info",e)}warn(...e){return this.log("warn",e)}error(...e){return this.log("error",e)}fatal(...e){return this.log("fatal",e)}log(e,n){var r;return this.method=e,this.args=n,this.stack=(r=new Error().stack)!=null?r:"",this}commit(){if(!this.committed&&(this.committed=!0,this.method)){const e=this.args[0],n=this.args.slice(1),r={stack:this.stack,content:{message:e,args:n},options:this.chainOptions};this.adapter[this.method](r)}}}let Nw=class Ef{constructor(e){Pe(this,"adapter");this.adapter=e}static create(e){const n=new Ef(e);return n.setMetadata({account:null,client:Bw()}),n}child(e,n={}){return new Ef(this.adapter.child(e,n))}lazyChild(e,n={}){let r;return new Proxy({},{get:(i,s,o)=>(r||(r=this.child(e,n)),Reflect.get(r,s,o))})}setMetadata(e){this.adapter.setMetadata(e)}setLevel(e){if(!xw(e))throw new fh(e);this.adapter.setLevel(e)}createChain(e){return new CO(this.adapter,e)}trace(...e){return this.createChain().trace(...e)}debug(...e){return this.createChain().debug(...e)}info(...e){return this.createChain().info(...e)}warn(...e){return this.createChain().warn(...e)}error(...e){return this.createChain().error(...e)}fatal(...e){return this.createChain().fatal(...e)}options(e){return this.createChain(e)}};function xO(t){return pr().baseLogger.lazyChild(t)}function Tw(t,e){return Nw.create(new kf({source:t,levelService:new AO(t),consoleLogger:new vO,httpLogger:hh.create({db:e,project:t})}))}const NO="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let TO=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=NO[n[t]&63];return e};const Uu=(t=8)=>TO(t),Ow=(t,e=!1)=>{const n=Object.entries(t).reduce((r,[i,s])=>s!==void 0&&(!e||s!==null)?`${r}${r?"&":""}${i}=${s}`:r,"");return n?`?${n}`:""},Iw=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function OO(){const t=new Error().stack.split(`
|
|
129
|
-
`);return t.length<3?"":t[2].trim().substring(3)}function IO(t){return new Promise(e=>setTimeout(e,t))}const Pn=class Pn{constructor(){Pe(this,"projectName","nizza");Pe(this,"instanceId",Uu());Pe(this,"db",new sO);Pe(this,"baseLogger",Tw(this.projectName,this.db));Pe(this,"coreLogger",this.baseLogger.child("core"));Pe(this,"logger",this.coreLogger.child("NizzaStore"));Pe(this,"eventBus",new ww(this.projectName,this.coreLogger));Pe(this,"cfg",null);Pe(this,"accountData");Pe(this,"statusInternal","idle");Pe(this,"currentFetchId",null);Pe(this,"pds");FT(this,{projectName:!1,instanceId:!1,db:!1,logger:!1,coreLogger:!1,eventBus:!1},{autoBind:!0}),iw(()=>{var e,n;return[(e=this.cfg)==null?void 0:e.account,(n=this.cfg)==null?void 0:n.authToken]},([e,n])=>{e&&this.loadAccount(e,!!n)},{delay:500,equals:Ai.shallow})}static instance(){var n;const e=window;return(n=e.nizza)!=null&&n.store?Pn.instanceRef=e.nizza.store:(Pn.instanceRef=new Pn,Pn.instanceRef.logger.debug("Created NizzaStore")),e.nizza=e.nizza||{},e.nz=e.nz||e.nizza,e.nizza.store=Pn.instanceRef,e.nz=e.nizza,Pn.instanceRef}async configure(e){try{this.logger.debug("Configuring NizzaStore",e),await this.applyConfig(e)}catch(n){this.setStatus("error"),this.logger.error("Configuration error",n)}}async applyConfig(e={}){this.cfg={...this.cfg,...e},e.getProductDataSource&&this.setProductDataSource(await e.getProductDataSource())}async loadAccount(e,n){this.setStatus("loading");const r=Uu();this.currentFetchId=r,this.logger.setMetadata({account:e});try{const i=await Zw(e,n);if(this.currentFetchId!==r)return;this.setAccount(i),this.setStatus("success"),this.logger.debug("Account loaded",i)}catch(i){if(this.currentFetchId!==r)return;this.setStatus("error"),i instanceof vh?this.logger.fatal("Account not found",e).options({silent:!0}):this.logger.fatal("Error loading account",i)}}setAccount(e){this.accountData=e}setStatus(e){this.statusInternal=e}setProductDataSource(e){this.pds=e}setProductId(e){this.cfg&&(this.cfg.productId=e)}setOrderFormId(e){this.cfg&&(this.cfg.orderFormId=e)}setAddToCartConfig(e){if(!this.cfg)throw new Error("Call configure() first");this.cfg.addToCartConfig=e}setAuthToken(e){this.applyConfig({authToken:e})}async refetchAccount(){var e;(e=this.cfg)!=null&&e.account&&await this.loadAccount(this.cfg.account,!!this.cfg.authToken)}resetAccount(){this.accountData=void 0,this.statusInternal="idle",this.currentFetchId=null,this.pds=void 0,this.cfg&&(this.cfg.account=void 0,this.cfg.authToken=void 0,this.cfg.productId=null,this.cfg.orderFormId=null),this.logger.debug("Account state and related config fields have been reset")}get version(){return Pn.version}get config(){return this.cfg}get account(){return this.accountData}get accountStatus(){return this.statusInternal}get accountName(){var e;return(e=this.cfg)==null?void 0:e.account}isPvtAccount(e){var n;return!!(e&&((n=this.cfg)!=null&&n.authToken))}isPubAccount(e){var n;return!!(e&&!((n=this.cfg)!=null&&n.authToken))}get productDataSource(){return this.pds}};Pe(Pn,"version","11"),Pe(Pn,"instanceRef");let Lu=Pn;const pr=t=>{const e=Lu.instance();return IT(()=>!!e.account,()=>t==null?void 0:t(e)),e};function Rw(){return st.useMemo(()=>pr(),[])}function Pw(t,e){const n=Rw();return yw(()=>t(n),e)}async function xi(t){const{url:e,method:n="GET",headers:r,body:i,raw:s=!1,contentTypeJson:o=!0,timeout:a,secure:c=!1,account:u,...d}=t,h=await PO({headers:r,secure:c,account:u,contentTypeJson:o}),p=typeof i=="string"?i:o&&i!=null?JSON.stringify(i):i,y={method:n,headers:h,body:p,...d},v=await DO(e,y,a);if(s)return v;const w=await v.json();if(!v.ok)throw new Error((w==null?void 0:w.message)||v.statusText);return{...w,success:v.ok}}const RO=t=>xi({...t,raw:!1,contentTypeJson:!1});async function PO({headers:t,secure:e,account:n,contentTypeJson:r}){var s,o,a;const i=new Headers(t);if(r&&i.set("Content-Type","application/json"),e){const c=await FO();c?(i.set("Authorization",`Bearer ${c}`),i.set("ls-account",n!=null?n:"")):(a=(o=(s=pr())==null?void 0:s.coreLogger)==null?void 0:o.warn)==null||a.call(o,"Secure request without auth token")}return i}async function DO(t,e,n){const r=new AbortController,i=r.signal,s=n?setTimeout(()=>r.abort(),n):void 0;try{return await fetch(t,{...e,signal:i})}finally{s&&clearTimeout(s)}}async function FO(){var t,e,n;try{return(await Eb.currentSession()).getIdToken().getJwtToken()}catch{return(n=(e=(t=pr())==null?void 0:t.config)==null?void 0:e.authToken)!=null?n:null}}function UO(t,e,n){fetch(e).then(r=>r.blob()).then(r=>Dw(r,`${t}.${n}`))}const Dw=(t,e,n)=>{const r=[t],i=new Blob(r,{type:n!=null?n:"application/octet-stream"});if(typeof window.navigator.msSaveBlob!="undefined")return window.navigator.msSaveBlob(i,e);const s=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(i):window.webkitURL.createObjectURL(i),o=document.createElement("a");return o.style.display="none",o.href=s,o.setAttribute("download",e),typeof o.download=="undefined"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o),window.URL.revokeObjectURL(s)},200)};var LO="2.0.3",Af=500,av="user-agent",ps="",uv="?",Mu="function",Lr="undefined",ms="object",Cf="string",cn="browser",ir="cpu",Gn="device",Fn="engine",kn="os",ls="result",we="name",fe="type",be="vendor",_e="version",ln="architecture",zo="major",pe="model",So="console",Xe="mobile",St="tablet",Lt="smarttv",zn="wearable",hd="xr",ko="embedded",ao="inapp",ph="brands",fi="formFactors",mh="fullVersionList",ds="platform",gh="platformVersion",mc="bitness",zr="sec-ch-ua",MO=zr+"-full-version-list",BO=zr+"-arch",$O=zr+"-"+mc,jO=zr+"-form-factors",VO=zr+"-"+Xe,qO=zr+"-"+pe,Fw=zr+"-"+ds,HO=Fw+"-version",Uw=[ph,mh,Xe,pe,ds,gh,ln,fi,mc],Wa="Amazon",Yi="Apple",cv="ASUS",lv="BlackBerry",oi="Google",dv="Huawei",fv="Lenovo",hv="Honor",Ya="LG",pd="Microsoft",md="Motorola",gd="Nvidia",pv="OnePlus",vd="OPPO",uo="Samsung",mv="Sharp",co="Sony",yd="Xiaomi",bd="Zebra",gv="Chrome",vv="Chromium",Er="Chromecast",KO="Edge",lo="Firefox",fo="Opera",wd="Facebook",yv="Sogou",Ji="Mobile ",ho=" Browser",xf="Windows",zO=typeof window!==Lr,dn=zO&&window.navigator?window.navigator:void 0,Rr=dn&&dn.userAgentData?dn.userAgentData:void 0,GO=function(t,e){var n={},r=e;if(!Bu(e)){r={};for(var i in e)for(var s in e[i])r[s]=e[i][s].concat(r[s]?r[s]:[])}for(var o in t)n[o]=r[o]&&r[o].length%2===0?r[o].concat(t[o]):t[o];return n},gc=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},Nf=function(t,e){if(typeof t===ms&&t.length>0){for(var n in t)if(sr(t[n])==sr(e))return!0;return!1}return Rs(t)?sr(e).indexOf(sr(t))!==-1:!1},Bu=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?Bu(t[n]):!1)},Rs=function(t){return typeof t===Cf},_d=function(t){if(t){for(var e=[],n=gs(/\\?\"/g,t).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var i=Go(n[r]).split(";v=");e[r]={brand:i[0],version:i[1]}}else e[r]=Go(n[r]);return e}},sr=function(t){return Rs(t)?t.toLowerCase():t},Sd=function(t){return Rs(t)?gs(/[^\d\.]/g,t).split(".")[0]:void 0},or=function(t){for(var e in t){var n=t[e];typeof n==ms&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},gs=function(t,e){return Rs(e)?e.replace(t,ps):e},po=function(t){return gs(/\\?\"/g,t)},Go=function(t,e){if(Rs(t))return t=gs(/^\s\s*/,t),typeof e===Lr?t:t.substring(0,Af)},kd=function(t,e){if(!(!t||!e))for(var n=0,r,i,s,o,a,c;n<e.length&&!a;){var u=e[n],d=e[n+1];for(r=i=0;r<u.length&&!a&&u[r];)if(a=u[r++].exec(t),a)for(s=0;s<d.length;s++)c=a[++i],o=d[s],typeof o===ms&&o.length>0?o.length===2?typeof o[1]==Mu?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length===3?typeof o[1]===Mu&&!(o[1].exec&&o[1].test)?this[o[0]]=c?o[1].call(this,c,o[2]):void 0:this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length===4&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0):this[o]=c||void 0;n+=2}},Pr=function(t,e){for(var n in e)if(typeof e[n]===ms&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(Nf(e[n][r],t))return n===uv?void 0:n}else if(Nf(e[n],t))return n===uv?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},bv={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},wv={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},_v={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_e,[we,Ji+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_e,[we,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[we,_e],[/opios[\/ ]+([\w\.]+)/i],[_e,[we,fo+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[_e,[we,fo+" GX"]],[/\bopr\/([\w\.]+)/i],[_e,[we,fo]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[_e,[we,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[_e,[we,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[we,_e],[/quark(?:pc)?\/([-\w\.]+)/i],[_e,[we,"Quark"]],[/\bddg\/([\w\.]+)/i],[_e,[we,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_e,[we,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[_e,[we,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_e,[we,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_e,[we,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[_e,[we,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[_e,[we,"Smart "+fv+ho]],[/(avast|avg)\/([\w\.]+)/i],[[we,/(.+)/,"$1 Secure"+ho],_e],[/\bfocus\/([\w\.]+)/i],[_e,[we,lo+" Focus"]],[/\bopt\/([\w\.]+)/i],[_e,[we,fo+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[_e,[we,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_e,[we,"Dolphin"]],[/coast\/([\w\.]+)/i],[_e,[we,fo+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[_e,[we,"MIUI"+ho]],[/fxios\/([\w\.-]+)/i],[_e,[we,Ji+lo]],[/\bqihoobrowser\/?([\w\.]*)/i],[_e,[we,"360"]],[/\b(qq)\/([\w\.]+)/i],[[we,/(.+)/,"$1Browser"],_e],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[we,/(.+)/,"$1"+ho],_e],[/samsungbrowser\/([\w\.]+)/i],[_e,[we,uo+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[_e,[we,yv+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[we,yv+" Mobile"],_e],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[we,_e],[/(lbbrowser|rekonq)/i],[we],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[_e,we],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[we,wd],_e,[fe,ao]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[we,_e,[fe,ao]],[/\bgsa\/([\w\.]+) .*safari\//i],[_e,[we,"GSA"],[fe,ao]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[_e,[we,"TikTok"],[fe,ao]],[/\[(linkedin)app\]/i],[we,[fe,ao]],[/(chromium)[\/ ]([-\w\.]+)/i],[we,_e],[/headlesschrome(?:\/([\w\.]+)| )/i],[_e,[we,gv+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[we,gv+" WebView"],_e],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_e,[we,"Android"+ho]],[/chrome\/([\w\.]+) mobile/i],[_e,[we,Ji+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[we,_e],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[_e,[we,Ji+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[we,Ji+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[_e,we],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[we,[_e,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[we,_e],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[we,Ji+lo],_e],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[we,"Netscape"],_e],[/(wolvic|librewolf)\/([\w\.]+)/i],[we,_e],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_e,[we,lo+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[we,[_e,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[we,[_e,/[^\d\.]+./,ps]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ln,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ln,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ln,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ln,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ln,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ln,/ower/,ps,sr]],[/ sun4\w[;\)]/i],[[ln,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ln,sr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[pe,[be,uo],[fe,St]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[pe,[be,uo],[fe,Xe]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[pe,[be,Yi],[fe,Xe]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[pe,[be,Yi],[fe,St]],[/(macintosh);/i],[pe,[be,Yi]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[pe,[be,mv],[fe,Xe]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[pe,[be,hv],[fe,St]],[/honor([-\w ]+)[;\)]/i],[pe,[be,hv],[fe,Xe]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[pe,[be,dv],[fe,St]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[pe,[be,dv],[fe,Xe]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[pe,/_/g," "],[be,yd],[fe,St]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[pe,/_/g," "],[be,yd],[fe,Xe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[pe,[be,vd],[fe,Xe]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[pe,[be,Pr,{OnePlus:["304","403","203"],"*":vd}],[fe,St]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[pe,[be,"BLU"],[fe,Xe]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[pe,[be,"Vivo"],[fe,Xe]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[pe,[be,"Realme"],[fe,Xe]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[pe,[be,md],[fe,Xe]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[pe,[be,md],[fe,St]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[pe,[be,Ya],[fe,St]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[pe,[be,Ya],[fe,Xe]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[pe,[be,fv],[fe,St]],[/(nokia) (t[12][01])/i],[be,pe,[fe,St]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[pe,/_/g," "],[fe,Xe],[be,"Nokia"]],[/(pixel (c|tablet))\b/i],[pe,[be,oi],[fe,St]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[pe,[be,oi],[fe,Xe]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[pe,[be,co],[fe,Xe]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[pe,"Xperia Tablet"],[be,co],[fe,St]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[pe,[be,pv],[fe,Xe]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[pe,[be,Wa],[fe,St]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[pe,/(.+)/g,"Fire Phone $1"],[be,Wa],[fe,Xe]],[/(playbook);[-\w\),; ]+(rim)/i],[pe,be,[fe,St]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[pe,[be,lv],[fe,Xe]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[pe,[be,cv],[fe,St]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[pe,[be,cv],[fe,Xe]],[/(nexus 9)/i],[pe,[be,"HTC"],[fe,St]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[be,[pe,/_/g," "],[fe,Xe]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[pe,[be,"TCL"],[fe,St]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[pe,[be,"TCL"],[fe,Xe]],[/(itel) ((\w+))/i],[[be,sr],pe,[fe,Pr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[pe,[be,"Acer"],[fe,St]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[pe,[be,"Meizu"],[fe,Xe]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[pe,[be,"Ulefone"],[fe,Xe]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[pe,[be,"Energizer"],[fe,Xe]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[pe,[be,"Cat"],[fe,Xe]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[pe,[be,"Smartfren"],[fe,Xe]],[/droid.+; (a(?:015|06[35]|142p?))/i],[pe,[be,"Nothing"],[fe,Xe]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[pe,[be,"Archos"],[fe,St]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[pe,[be,"Archos"],[fe,Xe]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[be,pe,[fe,St]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[be,pe,[fe,Xe]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[be,pe,[fe,St]],[/(surface duo)/i],[pe,[be,pd],[fe,St]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[pe,[be,"Fairphone"],[fe,Xe]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[pe,[be,gd],[fe,St]],[/(sprint) (\w+)/i],[be,pe,[fe,Xe]],[/(kin\.[onetw]{3})/i],[[pe,/\./g," "],[be,pd],[fe,Xe]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[pe,[be,bd],[fe,St]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[pe,[be,bd],[fe,Xe]],[/smart-tv.+(samsung)/i],[be,[fe,Lt]],[/hbbtv.+maple;(\d+)/i],[[pe,/^/,"SmartTV"],[be,uo],[fe,Lt]],[/tcast.+(lg)e?. ([-\w]+)/i],[be,pe,[fe,Lt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[be,Ya],[fe,Lt]],[/(apple) ?tv/i],[be,[pe,Yi+" TV"],[fe,Lt]],[/crkey.*devicetype\/chromecast/i],[[pe,Er+" Third Generation"],[be,oi],[fe,Lt]],[/crkey.*devicetype\/([^/]*)/i],[[pe,/^/,"Chromecast "],[be,oi],[fe,Lt]],[/fuchsia.*crkey/i],[[pe,Er+" Nest Hub"],[be,oi],[fe,Lt]],[/crkey/i],[[pe,Er],[be,oi],[fe,Lt]],[/(portaltv)/i],[pe,[be,wd],[fe,Lt]],[/droid.+aft(\w+)( bui|\))/i],[pe,[be,Wa],[fe,Lt]],[/(shield \w+ tv)/i],[pe,[be,gd],[fe,Lt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[pe,[be,mv],[fe,Lt]],[/(bravia[\w ]+)( bui|\))/i],[pe,[be,co],[fe,Lt]],[/(mi(tv|box)-?\w+) bui/i],[pe,[be,yd],[fe,Lt]],[/Hbbtv.*(technisat) (.*);/i],[be,pe,[fe,Lt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[be,Go],[pe,Go],[fe,Lt]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[pe,[fe,Lt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[fe,Lt]],[/(ouya)/i,/(nintendo) (\w+)/i],[be,pe,[fe,So]],[/droid.+; (shield)( bui|\))/i],[pe,[be,gd],[fe,So]],[/(playstation \w+)/i],[pe,[be,co],[fe,So]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[pe,[be,pd],[fe,So]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[pe,[be,uo],[fe,zn]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[be,pe,[fe,zn]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[pe,[be,vd],[fe,zn]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[pe,[be,Yi],[fe,zn]],[/(opwwe\d{3})/i],[pe,[be,pv],[fe,zn]],[/(moto 360)/i],[pe,[be,md],[fe,zn]],[/(smartwatch 3)/i],[pe,[be,co],[fe,zn]],[/(g watch r)/i],[pe,[be,Ya],[fe,zn]],[/droid.+; (wt63?0{2,3})\)/i],[pe,[be,bd],[fe,zn]],[/droid.+; (glass) \d/i],[pe,[be,oi],[fe,hd]],[/(pico) (4|neo3(?: link|pro)?)/i],[be,pe,[fe,hd]],[/(quest( \d| pro)?s?).+vr/i],[pe,[be,wd],[fe,hd]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[be,[fe,ko]],[/(aeobc)\b/i],[pe,[be,Wa],[fe,ko]],[/(homepod).+mac os/i],[pe,[be,Yi],[fe,ko]],[/windows iot/i],[[fe,ko]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[pe,[fe,Pr,{mobile:"Mobile",xr:"VR","*":St}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[fe,St]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[fe,Xe]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[pe,[be,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_e,[we,KO+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[we,_e],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_e,[we,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[we,_e],[/ladybird\//i],[[we,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_e,we]],os:[[/microsoft (windows) (vista|xp)/i],[we,_e],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[we,[_e,Pr,bv]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[_e,Pr,bv],[we,xf]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[_e,/_/g,"."],[we,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[we,"macOS"],[_e,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[_e,[we,Er+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[_e,[we,Er+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[_e,[we,Er+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[_e,[we,Er+" Linux"]],[/crkey\/([\d\.]+)/i],[_e,[we,Er]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[_e,we],[/(ubuntu) ([\w\.]+) like android/i],[[we,/(.+)/,"$1 Touch"],_e],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[we,_e],[/\(bb(10);/i],[_e,[we,lv]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[_e,[we,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_e,[we,lo+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_e,[we,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[_e,[we,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[we,"Chrome OS"],_e],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[we,_e],[/(sunos) ?([\w\.\d]*)/i],[[we,"Solaris"],_e],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[we,_e]]},Ja=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return or.call(t.init,[[cn,[we,_e,zo,fe]],[ir,[ln]],[Gn,[fe,pe,be]],[Fn,[we,_e]],[kn,[we,_e]]]),or.call(t.isIgnore,[[cn,[_e,zo]],[Fn,[_e]],[kn,[_e]]]),or.call(t.isIgnoreRgx,[[cn,/ ?browser$/i],[kn,/ ?os$/i]]),or.call(t.toString,[[cn,[we,_e]],[ir,[ln]],[Gn,[be,pe]],[Fn,[we,_e]],[kn,[we,_e]]]),t}(),WO=function(t,e){var n=Ja.init[e],r=Ja.isIgnore[e]||0,i=Ja.isIgnoreRgx[e]||0,s=Ja.toString[e]||0;function o(){or.call(this,n)}return o.prototype.getItem=function(){return t},o.prototype.withClientHints=function(){return Rr?Rr.getHighEntropyValues(Uw).then(function(a){return t.setCH(new Lw(a,!1)).parseCH().get()}):t.parseCH().get()},o.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=ls&&(o.prototype.is=function(a){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!Nf(r,u)&&sr(i?gs(i,this[u]):this[u])==sr(i?gs(i,a):a)){if(c=!0,a!=Lr)break}else if(a==Lr&&c){c=!c;break}return c},o.prototype.toString=function(){var a=ps;for(var c in s)typeof this[s[c]]!==Lr&&(a+=(a?" ":ps)+this[s[c]]);return a||Lr}),Rr||(o.prototype.then=function(a){var c=this,u=function(){for(var h in c)c.hasOwnProperty(h)&&(this[h]=c[h])};u.prototype={is:o.prototype.is,toString:o.prototype.toString};var d=new u;return a(d),d}),new o};function Lw(t,e){if(t=t||{},or.call(this,Uw),e)or.call(this,[[ph,_d(t[zr])],[mh,_d(t[MO])],[Xe,/\?1/.test(t[VO])],[pe,po(t[qO])],[ds,po(t[Fw])],[gh,po(t[HO])],[ln,po(t[BO])],[fi,_d(t[jO])],[mc,po(t[$O])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==Lr&&(this[n]=t[n])}function Sv(t,e,n,r){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,s){return this.data[i]=s,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(dn&&dn.userAgent==this.ua)switch(this.itemType){case cn:dn.brave&&typeof dn.brave.isBrave==Mu&&this.set(we,"Brave");break;case Gn:!this.get(fe)&&Rr&&Rr[Xe]&&this.set(fe,Xe),this.get(pe)=="Macintosh"&&dn&&typeof dn.standalone!==Lr&&dn.maxTouchPoints&&dn.maxTouchPoints>2&&this.set(pe,"iPad").set(fe,St);break;case kn:!this.get(we)&&Rr&&Rr[ds]&&this.set(we,Rr[ds]);break;case ls:var i=this.data,s=function(o){return i[o].getItem().detectFeature().get()};this.set(cn,s(cn)).set(ir,s(ir)).set(Gn,s(Gn)).set(Fn,s(Fn)).set(kn,s(kn))}return this},this.parseUA=function(){return this.itemType!=ls&&kd.call(this.data,this.ua,this.rgxMap),this.itemType==cn&&this.set(zo,Sd(this.get(_e))),this},this.parseCH=function(){var i=this.uaCH,s=this.rgxMap;switch(this.itemType){case cn:case Fn:var o=i[mh]||i[ph],a;if(o)for(var c in o){var u=o[c].brand||o[c],d=o[c].version;this.itemType==cn&&!/not.a.brand/i.test(u)&&(!a||/chrom/i.test(a)&&u!=vv)&&(u=Pr(u,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(we,u).set(_e,d).set(zo,Sd(d)),a=u),this.itemType==Fn&&u==vv&&this.set(_e,d)}break;case ir:var h=i[ln];h&&(h&&i[mc]=="64"&&(h+="64"),kd.call(this.data,h+";",s));break;case Gn:if(i[Xe]&&this.set(fe,Xe),i[pe]&&(this.set(pe,i[pe]),!this.get(fe)||!this.get(be))){var p={};kd.call(p,"droid 9; "+i[pe]+")",s),!this.get(fe)&&p.type&&this.set(fe,p.type),!this.get(be)&&p.vendor&&this.set(be,p.vendor)}if(i[fi]){var y;if(typeof i[fi]!="string")for(var v=0;!y&&v<i[fi].length;)y=Pr(i[fi][v++],wv);else y=Pr(i[fi],wv);this.set(fe,y)}break;case kn:var w=i[ds];if(w){var k=i[gh];w==xf&&(k=parseInt(Sd(k),10)>=13?"11":"10"),this.set(we,w).set(_e,k)}this.get(we)==xf&&i[pe]=="Xbox"&&this.set(we,"Xbox").set(_e,void 0);break;case ls:var C=this.data,E=function(O){return C[O].getItem().setCH(i).parseCH().get()};this.set(cn,E(cn)).set(ir,E(ir)).set(Gn,E(Gn)).set(Fn,E(Fn)).set(kn,E(kn))}return this},or.call(this,[["itemType",t],["ua",e],["uaCH",r],["rgxMap",n],["data",WO(this,t)]]),this}function dr(t,e,n){if(typeof t===ms?(Bu(t,!0)?(typeof e===ms&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===Cf&&!Bu(e,!0)&&(n=e,e=void 0),n&&typeof n.append===Mu){var r={};n.forEach(function(c,u){r[u]=c}),n=r}if(!(this instanceof dr))return new dr(t,e,n).getResult();var i=typeof t===Cf?t:n&&n[av]?n[av]:dn&&dn.userAgent?dn.userAgent:ps,s=new Lw(n,!0),o=e?GO(_v,e):_v,a=function(c){return c==ls?function(){return new Sv(c,i,o,s).set("ua",i).set(cn,this.getBrowser()).set(ir,this.getCPU()).set(Gn,this.getDevice()).set(Fn,this.getEngine()).set(kn,this.getOS()).get()}:function(){return new Sv(c,i,o[c],s).parseUA().get()}};return or.call(this,[["getBrowser",a(cn)],["getCPU",a(ir)],["getDevice",a(Gn)],["getEngine",a(Fn)],["getOS",a(kn)],["getResult",a(ls)],["getUA",function(){return i}],["setUA",function(c){return Rs(c)&&(i=c.length>Af?Go(c,Af):c),this}]]).setUA(i),this}dr.VERSION=LO;dr.BROWSER=gc([we,_e,zo,fe]);dr.CPU=gc([ln]);dr.DEVICE=gc([pe,be,fe,So,Xe,Lt,St,zn,ko]);dr.ENGINE=dr.OS=gc([we,_e]);const{coreLogger:YO}=pr(),JO=YO.child("getClientTimeZone");function Mw(t=!1){var s,o,a;let e=null,n=null,r=null;try{e=(a=(o=(s=Intl.DateTimeFormat())==null?void 0:s.resolvedOptions())==null?void 0:o.timeZone)!=null?a:null;const c=-new Date().getTimezoneOffset();r=c;const u=c>=0?"+":"-",d=String(Math.floor(Math.abs(c)/60)).padStart(2,"0"),h=String(Math.abs(c)%60).padStart(2,"0");n=`${u}${d}:${h}`}catch(c){JO.error("Error obtaining time zone or offset",c)}const i={offset:n,offsetValue:r,value:e,country:null,included:null,label:null};if(t){const{country:c,included:u,label:d,...h}=i;return h}return i}function Bw(){const e=typeof navigator!="undefined"?navigator.userAgent:"server",n=XO(e),{language:r,languages:i}=QO(),s=ZO(),o=eI(),{hardwareConcurrency:a,deviceMemory:c}=tI(),u=nI();return{userAgent:e,browser:n.browser,os:n.os,device:n.device,language:r,languages:i,screen:s,connection:o,hardwareConcurrency:a,deviceMemory:c,timezone:u}}function XO(t){try{const n=new dr(t).getResult();return{browser:{name:n.browser.name||"Unknown",version:n.browser.version||"Unknown"},os:{name:n.os.name||"Unknown",version:n.os.version||"Unknown"},device:{model:n.device.model||"Unknown",type:n.device.type||"Desktop",vendor:n.device.vendor||"Unknown"}}}catch(e){return console.error("Error parsing user agent:",e),{browser:{name:"Unknown",version:"Unknown"},os:{name:"Unknown",version:"Unknown"},device:{model:"Unknown",type:"Desktop",vendor:"Unknown"}}}}function QO(){return typeof navigator!="undefined"?{language:navigator.language||"Unknown",languages:navigator.languages?[...navigator.languages]:[]}:{language:"Unknown",languages:[]}}function ZO(){return typeof window!="undefined"&&window.screen?{width:window.screen.width,height:window.screen.height,colorDepth:window.screen.colorDepth}:null}function eI(){var t,e,n,r;if(typeof navigator!="undefined"&&"connection"in navigator){const i=navigator.connection;return{downlink:(t=i==null?void 0:i.downlink)!=null?t:0,effectiveType:(e=i==null?void 0:i.effectiveType)!=null?e:"Unknown",rtt:(n=i==null?void 0:i.rtt)!=null?n:0,saveData:(r=i==null?void 0:i.saveData)!=null?r:!1}}return null}function tI(){return typeof navigator!="undefined"?{hardwareConcurrency:navigator.hardwareConcurrency||null,deviceMemory:navigator.deviceMemory||null}:{hardwareConcurrency:null,deviceMemory:null}}function nI(){try{return Mw(!0)}catch(t){return console.error("Error retrieving client timezone:",t),{offset:null,offsetValue:null,value:"Unknown",country:null,included:null,label:null}}}var $w=(t=>(t.VTEX="VTEX",t.VTEX_IO="VTEX-IO",t.VTEX_CMS="PORTAL-VTEX",t.PLATFORM="PLATFORM",t.UNKNOWN="UNKNOWN",t))($w||{}),jw=(t=>(t.PLATFORM="platform_module",t.ADENDA="subscription_module",t.APP_STORE="app_store",t))(jw||{}),Vw=(t=>(t.ACTIVE="active_contract",t.INACTIVE="inactive_contract",t))(Vw||{}),qw=(t=>(t.LITE="lite",t.STANDARD="standard",t.PRO="pro",t))(qw||{}),Hw=(t=>(t.LITE="PLAN_LITE",t.STANDARD="PLAN_ESTANDAR",t.PRO="PLAN_PRO",t.NONE="NO_PLAN",t))(Hw||{}),Kw=(t=>(t.PAST="past",t.LIVE="live",t.FUTURE="future",t))(Kw||{});class vh extends hr{constructor(e){super("NIZZA_ACCOUNT_NOT_FOUND_ERROR",`Error finding account: ${e}`)}}class zw extends hr{constructor(e){super("NIZZA_PLAN_NOT_FOUND_ERROR",`Error finding plan: ${e}`)}}class Gw extends hr{constructor(e){super("NIZZA_CREATE_PLAN_ERROR",`Error creating plan: ${e.plan}`,e)}}const kv=`${bs.apiUrls.restV2}/v1/plans`;class Ww{async get(e,n){const i=`/info${Ow({planType:e})}`,s=kv+i,{data:o}=await xi({url:s,account:n});return o}async create(e){const n=`${kv}/create`,{success:r}=await xi({url:n,method:"POST",body:JSON.stringify(e)});if(!r)throw new Gw(e)}}function rI(t){const{host:e,account:n,username:r,createdAt:i,subscriptionType:s,installationDateApp:o,...a}=t;return{...a,account:n,host:e!=null?e:null,username:r!=null?r:n,createdAt:new Date(i),subscriptionType:s!=null?s:null,installationDateApp:new Date(o)}}function iI(t){const{host:e,...n}=t;return{...n,host:e!=null?e:null,plan:{}}}const sI=`${bs.apiUrls.restV2}/v1/accounts`;class Yw{async get(e){const n=`${sI}/${e}/public`,{data:r}=await xi({url:n,account:e});return r?iI(r):null}}const oI=`${bs.apiUrls.restV2}/v1/accounts`;class aI{async get(e){const n=`${oI}/${e}`,{data:r}=await xi({url:n,account:e,secure:!0});return r?rI(r):null}}class Jw{constructor(e,n,r){this.publicAccountRepo=e,this.privateAccountRepo=n,this.accountPlanRepo=r}async get(e,n=!1){try{const r=n?await this.privateAccountRepo.get(e):await this.publicAccountRepo.get(e);if(!r)throw new vh(e);const i=await this.accountPlanRepo.get(r.descriptionPlan,r.account);if(!i)throw new zw(r.descriptionPlan);return{...r,plan:i}}catch(r){throw new rh(r)}}}const uI=new Yw,cI=new aI,lI=new Ww,Xw=new Jw(uI,cI,lI),Qw=()=>{const{account:t,accountName:e,accountStatus:n,refetchAccount:r,isPvtAccount:i,isPubAccount:s}=Pw(u=>({account:u.account,accountName:u.accountName,accountStatus:u.accountStatus,refetchAccount:u.refetchAccount,isPvtAccount:u.isPvtAccount,isPubAccount:u.isPubAccount})),o=["idle","loading"].includes(n);return{account:t,accountName:e,isLoading:o,isError:n==="error",isSuccess:n==="success",accountStatus:n,refetchAccount:r,isPvtAccount:i,isPubAccount:s}};async function Zw(t,e){return Xw.get(t,e)}var e_=(t=>(t.Created="CREATED",t.CreateComplete="CREATE_COMPLETE",t.Finalized="FINALIZED",t.Live="LIVE",t.Starting="STARTING",t))(e_||{}),t_=(t=>(t.Add="add",t.Remove="remove",t))(t_||{}),n_=(t=>(t.Vtex="VTEX",t))(n_||{}),r_=(t=>(t.Active="active",t.Inactive="inactive",t))(r_||{});const dI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},fI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},hI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},pI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},mI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ManageCollectionProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ManageCollectionProductInInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"manageCollectionProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},gI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},vI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},yI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindMinimalEvent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"thumbnails"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},bI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchMinimalEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},wI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BlockUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BlockUserInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"blockUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BlockUserSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},_I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ChangeAccountUsername"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"changeAccountUsername"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},SI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},kI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetAllChatMessageInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatMessageArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"connectionId"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"idEvent"}},{kind:"Field",name:{kind:"Name",value:"sendDate"}},{kind:"Field",name:{kind:"Name",value:"sessionId"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"username"}},{kind:"Field",name:{kind:"Name",value:"isAdmin"}},{kind:"Field",name:{kind:"Name",value:"urlGif"}},{kind:"Field",name:{kind:"Name",value:"second"}},{kind:"Field",name:{kind:"Name",value:"ip"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},i_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetChatRoomToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetChatRoomInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getChatRoomToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatRoomTokenData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},EI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PinChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PinChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pinChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PinChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},AI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"highlightProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highlightProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},CI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInputAccount"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},xI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"section"}},{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},NI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},TI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"sendAddToCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddToCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sendAddToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AddToCartSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},OI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetTimeLine"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetTimeLineInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getTimeLine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TimeLineArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"time"}},{kind:"Field",name:{kind:"Name",value:"likes"}},{kind:"Field",name:{kind:"Name",value:"comments"}},{kind:"Field",name:{kind:"Name",value:"viewers"}},{kind:"Field",name:{kind:"Name",value:"orders"}},{kind:"Field",name:{kind:"Name",value:"minute"}},{kind:"Field",name:{kind:"Name",value:"hour"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},II={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppendProductsToSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"RelateToProductsSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appendProductsSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},RI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},PI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateSnackVideoBatch"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},DI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteRelationshipWithSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteRelationshipSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}}]}}]}}]},FI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},UI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindManySnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindManySnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findManySnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},LI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},MI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayLists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayLists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"videoAmount"}},{kind:"Field",name:{kind:"Name",value:"productAmount"}},{kind:"Field",name:{kind:"Name",value:"updated"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},BI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSnackVideoRelationships"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getRelationshipSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"RelationshipSnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceEntity"}},{kind:"Field",name:{kind:"Name",value:"attributeId"}}]}}]}}]}}]}}]},$I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},jI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updatePlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},VI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindByProductSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindByProductSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findByProductSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},qI={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetPlayListQueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productId"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"productName"}},{kind:"Field",name:{kind:"Name",value:"productImageUrl"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},HI=Object.freeze(Object.defineProperty({__proto__:null,AddCollectionDocument:dI,AppendProductsToSnackVideoDocument:II,BlockUserDocument:wI,ChangeAccountUsernameDocument:_I,CreatePlayListDocument:RI,CreateSnackVideoBatchDocument:PI,DeleteAllCustomizationDocument:CI,DeleteChatMessageDocument:SI,DeleteCollectionDocument:fI,DeleteRelationshipWithSnackVideoDocument:DI,DeleteSnackVideoDocument:FI,EventStatus:e_,FindByProductSnackVideoDocument:VI,FindCollectionDocument:hI,FindManySnackVideosDocument:UI,FindMinimalEventDocument:yI,GetAllChatMessageDocument:kI,GetAllCollectionsDocument:pI,GetAllCustomizationDocument:xI,GetAllSnackVideosDocument:LI,GetChatRoomTokenDocument:i_,GetPlayListDocument:qI,GetPlayListsDocument:MI,GetSnackVideoRelationshipsDocument:BI,GetTimeLineDocument:OI,HighlightProductDocument:AI,ManageCollectionProductDocument:mI,Methods:t_,PinChatMessageDocument:EI,SearchCollectionsDocument:gI,SearchMinimalEventsDocument:bI,SearchSnackVideosDocument:$I,SendAddToCartDocument:TI,SignProvider:n_,Status:r_,UpdateCollectionDocument:vI,UpdateCustomizationDocument:NI,UpdatePlayListDocument:jI},Symbol.toStringTag,{value:"Module"}));var vc=(t=>(t.OPEN_TAB="openTab",t.OPEN_VARIATION_SELECTOR="openVariationSelector",t.ADD_TO_CART="addToCart",t))(vc||{});function KI(t){return{class:t,_value:null,get value(){return this._value||(this._value=new t,Object.freeze(this)),this._value}}}var mr=(t=>(t.Local="local",t.VtexLegacy="vtexlegacy",t.VtexIO="vtexio",t.VtexFastStore="faststore",t.Platform="platform",t.External="external",t))(mr||{}),yh=(t=>(t.PROD="prod",t.DEV="dev",t.LOCAL="local",t))(yh||{});const{coreLogger:zI}=pr(),Tf=zI.child("addToCartHooks"),Of={errorAddingToCart:"addToCartHooks.notification.error",errorOpeningVariationSelector:"addToCartHooks.notification.error",errorOpeningNewTab:"addToCartHooks.notification.error",successAddingToCart:"addToCartHooks.notification.success"};async function GI(t){const e={...t,action:{type:vc.ADD_TO_CART,exec:()=>Tf.error("action no implemented in validate hook")}};try{const n=await WI(e),r=await YI(n);await JI(r)}catch(n){Tf.error("error unhandled",n)}}async function WI(t){var s,o;const{context:e,userAddToCartConfig:n}=t,r=(s=n==null?void 0:n.hooks)==null?void 0:s.transform;let i=t.product;if(r)try{i=await r({product:{...i},data:(o=e.data)!=null?o:{}})}catch(a){$u("transform",a)}return{...t,product:i}}async function YI(t){var c,u;const{context:e,hookStrategy:n,userAddToCartConfig:r,product:i}=t,s=s_(t),o=(c=r==null?void 0:r.hooks)==null?void 0:c.validate;let a=n.validate({...t,actionFactory:s});if(o)try{a=await o({product:{...i},defaultAction:{...a},action:s,data:(u=e.data)!=null?u:{}})}catch(d){$u("validate",d)}return{...t,action:a,actionFactory:s}}async function JI(t){var k;const{eventBus:e}=pr(),{product:n,userAddToCartConfig:r,notifyFactory:i,action:s,actionFactory:o}=t,{isVariationSelectorOpen:a,data:c={}}=t.context,u=(k=r==null?void 0:r.hooks)==null?void 0:k.end,d=s.type===vc.ADD_TO_CART;let h=null,p=!1;const y=()=>{!d||!a||o.openVariationSelector(!1).exec()},v=()=>{!d||p||(h?i.error(Of.errorAddingToCart):i.success(Of.successAddingToCart))},w=()=>{const C={product:n,actionType:s.type,success:!h,error:h};e.emit(Sw.ATCH_ACTION_EXECUTED,C)};try{if(!s.type||!s.exec)throw new Error("Invalid action object, missing keys 'type' or 'exec'");await s.exec()}catch(C){$u("end",C),h=C}if(u)try{p=!!await u({data:c,error:h,notify:i,actionExecuted:s})}catch(C){$u("end",C)}y(),v(),w()}function s_(t){const{actionFactory:e,userAddToCartConfig:n}=t,r=i=>Object.entries(i!=null?i:{}).reduce((s,[o,a])=>({...s,[o]:c=>({type:o,exec:()=>a(c)})}),{});return{...r(e),...r(n==null?void 0:n.actionFactory)}}function $u(t,e){Tf.error(`addToCartHooks error running ${t}: `,e)}class o_{constructor(e){Pe(this,"aggregate");Pe(this,"_numSetPropsApplied",0);this.aggregate=e}setProps(e){for(const[n,r]of Object.entries(e))n in this.aggregate&&(this.aggregate[n]=r);this._numSetPropsApplied++}get isFirstSetProps(){return this._numSetPropsApplied===1}}function a_(t){return new o_(t)}class XI{constructor(e){Pe(this,"_value");e!==void 0&&(this._value=e)}get value(){return this._value}}var Xt=(t=>(t.GENERAL_ERROR="GENERAL_ERROR",t.AXIOS_ERROR="AXIOS_ERROR",t.NETWORK_ERROR="NETWORK_ERROR",t.CONFIG_ERROR="CONFIG_ERROR",t.TIMEOUT_ERROR="TIMEOUT_ERROR",t.AUTH_ERROR="AUTH_ERROR",t.NOT_FOUND="NOT_FOUND",t.VALIDATION_ERROR="VALIDATION_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.BAD_REQUEST="BAD_REQUEST",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.CONFLICT="CONFLICT",t.GONE="GONE",t.UNSUPPORTED_MEDIA_TYPE="UNSUPPORTED_MEDIA_TYPE",t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",t.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",t))(Xt||{});function u_(t,e){return function(){return t.apply(e,arguments)}}const{toString:QI}=Object.prototype,{getPrototypeOf:bh}=Object,yc=(t=>e=>{const n=QI.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Vn=t=>(t=t.toLowerCase(),e=>yc(e)===t),bc=t=>e=>typeof e===t,{isArray:Ps}=Array,Wo=bc("undefined");function ZI(t){return t!==null&&!Wo(t)&&t.constructor!==null&&!Wo(t.constructor)&&wn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const c_=Vn("ArrayBuffer");function eR(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&c_(t.buffer),e}const tR=bc("string"),wn=bc("function"),l_=bc("number"),wc=t=>t!==null&&typeof t=="object",nR=t=>t===!0||t===!1,hu=t=>{if(yc(t)!=="object")return!1;const e=bh(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},rR=Vn("Date"),iR=Vn("File"),sR=Vn("Blob"),oR=Vn("FileList"),aR=t=>wc(t)&&wn(t.pipe),uR=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wn(t.append)&&((e=yc(t))==="formdata"||e==="object"&&wn(t.toString)&&t.toString()==="[object FormData]"))},cR=Vn("URLSearchParams"),[lR,dR,fR,hR]=["ReadableStream","Request","Response","Headers"].map(Vn),pR=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ia(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let r,i;if(typeof t!="object"&&(t=[t]),Ps(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let a;for(r=0;r<o;r++)a=s[r],e.call(null,t[a],a,t)}}function d_(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const vi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,f_=t=>!Wo(t)&&t!==vi;function If(){const{caseless:t}=f_(this)&&this||{},e={},n=(r,i)=>{const s=t&&d_(e,i)||i;hu(e[s])&&hu(r)?e[s]=If(e[s],r):hu(r)?e[s]=If({},r):Ps(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ia(arguments[r],n);return e}const mR=(t,e,n,{allOwnKeys:r}={})=>(ia(e,(i,s)=>{n&&wn(i)?t[s]=u_(i,n):t[s]=i},{allOwnKeys:r}),t),gR=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),vR=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},yR=(t,e,n,r)=>{let i,s,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&bh(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},bR=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},wR=t=>{if(!t)return null;if(Ps(t))return t;let e=t.length;if(!l_(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},_R=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&bh(Uint8Array)),SR=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},kR=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ER=Vn("HTMLFormElement"),AR=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Ev=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),CR=Vn("RegExp"),h_=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ia(n,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(r[s]=o||i)}),Object.defineProperties(t,r)},xR=t=>{h_(t,(e,n)=>{if(wn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},NR=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Ps(t)?r(t):r(String(t).split(e)),n},TR=()=>{},OR=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Ed="abcdefghijklmnopqrstuvwxyz",Av="0123456789",p_={DIGIT:Av,ALPHA:Ed,ALPHA_DIGIT:Ed+Ed.toUpperCase()+Av},IR=(t=16,e=p_.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function RR(t){return!!(t&&wn(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const PR=t=>{const e=new Array(10),n=(r,i)=>{if(wc(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=Ps(r)?[]:{};return ia(r,(o,a)=>{const c=n(o,i+1);!Wo(c)&&(s[a]=c)}),e[i]=void 0,s}}return r};return n(t,0)},DR=Vn("AsyncFunction"),FR=t=>t&&(wc(t)||wn(t))&&wn(t.then)&&wn(t.catch),m_=((t,e)=>t?setImmediate:e?((n,r)=>(vi.addEventListener("message",({source:i,data:s})=>{i===vi&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),vi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wn(vi.postMessage)),UR=typeof queueMicrotask!="undefined"?queueMicrotask.bind(vi):typeof process!="undefined"&&process.nextTick||m_,oe={isArray:Ps,isArrayBuffer:c_,isBuffer:ZI,isFormData:uR,isArrayBufferView:eR,isString:tR,isNumber:l_,isBoolean:nR,isObject:wc,isPlainObject:hu,isReadableStream:lR,isRequest:dR,isResponse:fR,isHeaders:hR,isUndefined:Wo,isDate:rR,isFile:iR,isBlob:sR,isRegExp:CR,isFunction:wn,isStream:aR,isURLSearchParams:cR,isTypedArray:_R,isFileList:oR,forEach:ia,merge:If,extend:mR,trim:pR,stripBOM:gR,inherits:vR,toFlatObject:yR,kindOf:yc,kindOfTest:Vn,endsWith:bR,toArray:wR,forEachEntry:SR,matchAll:kR,isHTMLForm:ER,hasOwnProperty:Ev,hasOwnProp:Ev,reduceDescriptors:h_,freezeMethods:xR,toObjectSet:NR,toCamelCase:AR,noop:TR,toFiniteNumber:OR,findKey:d_,global:vi,isContextDefined:f_,ALPHABET:p_,generateString:IR,isSpecCompliantForm:RR,toJSONObject:PR,isAsyncFn:DR,isThenable:FR,setImmediate:m_,asap:UR};function Qe(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}oe.inherits(Qe,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:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const g_=Qe.prototype,v_={};["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(t=>{v_[t]={value:t}});Object.defineProperties(Qe,v_);Object.defineProperty(g_,"isAxiosError",{value:!0});Qe.from=(t,e,n,r,i,s)=>{const o=Object.create(g_);return oe.toFlatObject(t,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Qe.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const LR=null;function Rf(t){return oe.isPlainObject(t)||oe.isArray(t)}function y_(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function Cv(t,e,n){return t?t.concat(e).map(function(i,s){return i=y_(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function MR(t){return oe.isArray(t)&&!t.some(Rf)}const BR=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function _c(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!oe.isUndefined(k[w])});const r=n.metaTokens,i=n.visitor||d,s=n.dots,o=n.indexes,c=(n.Blob||typeof Blob!="undefined"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(oe.isDate(v))return v.toISOString();if(!c&&oe.isBlob(v))throw new Qe("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(v)||oe.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function d(v,w,k){let C=v;if(v&&!k&&typeof v=="object"){if(oe.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(oe.isArray(v)&&MR(v)||(oe.isFileList(v)||oe.endsWith(w,"[]"))&&(C=oe.toArray(v)))return w=y_(w),C.forEach(function(O,I){!(oe.isUndefined(O)||O===null)&&e.append(o===!0?Cv([w],I,s):o===null?w:w+"[]",u(O))}),!1}return Rf(v)?!0:(e.append(Cv(k,w,s),u(v)),!1)}const h=[],p=Object.assign(BR,{defaultVisitor:d,convertValue:u,isVisitable:Rf});function y(v,w){if(!oe.isUndefined(v)){if(h.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));h.push(v),oe.forEach(v,function(C,E){(!(oe.isUndefined(C)||C===null)&&i.call(e,C,oe.isString(E)?E.trim():E,w,p))===!0&&y(C,w?w.concat(E):[E])}),h.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return y(t),e}function xv(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function wh(t,e){this._pairs=[],t&&_c(t,this,e)}const b_=wh.prototype;b_.append=function(e,n){this._pairs.push([e,n])};b_.toString=function(e){const n=e?function(r){return e.call(this,r,xv)}:xv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function $R(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function w_(t,e,n){if(!e)return t;const r=n&&n.encode||$R,i=n&&n.serialize;let s;if(i?s=i(e,n):s=oe.isURLSearchParams(e)?e.toString():new wh(e,n).toString(r),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Nv{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const __={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},jR=typeof URLSearchParams!="undefined"?URLSearchParams:wh,VR=typeof FormData!="undefined"?FormData:null,qR=typeof Blob!="undefined"?Blob:null,HR={isBrowser:!0,classes:{URLSearchParams:jR,FormData:VR,Blob:qR},protocols:["http","https","file","blob","url","data"]},_h=typeof window!="undefined"&&typeof document!="undefined",Pf=typeof navigator=="object"&&navigator||void 0,KR=_h&&(!Pf||["ReactNative","NativeScript","NS"].indexOf(Pf.product)<0),zR=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",GR=_h&&window.location.href||"http://localhost",WR=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_h,hasStandardBrowserEnv:KR,hasStandardBrowserWebWorkerEnv:zR,navigator:Pf,origin:GR},Symbol.toStringTag,{value:"Module"})),fn={...WR,...HR};function YR(t,e){return _c(t,new fn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return fn.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function JR(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function XR(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function S_(t){function e(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=s>=n.length;return o=!o&&oe.isArray(i)?i.length:o,c?(oe.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!oe.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],s)&&oe.isArray(i[o])&&(i[o]=XR(i[o])),!a)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,i)=>{e(JR(r),i,n,0)}),n}return null}function QR(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const sa={transitional:__,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=oe.isObject(e);if(s&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return i?JSON.stringify(S_(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return YR(e,this.formSerializer).toString();if((a=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return _c(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),QR(e)):e}],transformResponse:[function(e){const n=this.transitional||sa.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Qe.from(a,Qe.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fn.classes.FormData,Blob:fn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{sa.headers[t]={}});const ZR=oe.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"]),eP=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
130
|
-
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&ZR[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Tv=Symbol("internals");function mo(t){return t&&String(t).trim().toLowerCase()}function pu(t){return t===!1||t==null?t:oe.isArray(t)?t.map(pu):String(t)}function tP(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const nP=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ad(t,e,n,r,i){if(oe.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function rP(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function iP(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,o){return this[r].call(this,e,i,s,o)},configurable:!0})})}let hn=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(a,c,u){const d=mo(c);if(!d)throw new Error("header name must be a non-empty string");const h=oe.findKey(i,d);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||c]=pu(a))}const o=(a,c)=>oe.forEach(a,(u,d)=>s(u,d,c));if(oe.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(oe.isString(e)&&(e=e.trim())&&!nP(e))o(eP(e),n);else if(oe.isHeaders(e))for(const[a,c]of e.entries())s(c,a,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=mo(e),e){const r=oe.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return tP(i);if(oe.isFunction(n))return n.call(this,i,r);if(oe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=mo(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Ad(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(o){if(o=mo(o),o){const a=oe.findKey(r,o);a&&(!n||Ad(r,r[a],a,n))&&(delete r[a],i=!0)}}return oe.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||Ad(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return oe.forEach(this,(i,s)=>{const o=oe.findKey(r,s);if(o){n[o]=pu(i),delete n[s];return}const a=e?rP(s):String(s).trim();a!==s&&delete n[s],n[a]=pu(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
131
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Tv]=this[Tv]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=mo(o);r[a]||(iP(i,o),r[a]=!0)}return oe.isArray(e)?e.forEach(s):s(e),this}};hn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(hn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});oe.freezeMethods(hn);function Cd(t,e){const n=this||sa,r=e||n,i=hn.from(r.headers);let s=r.data;return oe.forEach(t,function(a){s=a.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function k_(t){return!!(t&&t.__CANCEL__)}function Ds(t,e,n){Qe.call(this,t==null?"canceled":t,Qe.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(Ds,Qe,{__CANCEL__:!0});function E_(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Qe("Request failed with status code "+n.status,[Qe.ERR_BAD_REQUEST,Qe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function sP(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function oP(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=r[s];o||(o=u),n[i]=c,r[i]=u;let h=s,p=0;for(;h!==i;)p+=n[h++],h=h%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o<e)return;const y=d&&u-d;return y?Math.round(p*1e3/y):void 0}}function aP(t,e){let n=0,r=1e3/e,i,s;const o=(u,d=Date.now())=>{n=d,i=null,s&&(clearTimeout(s),s=null),t.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-n;h>=r?o(u,d):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-h)))},()=>i&&o(i)]}const ju=(t,e,n=3)=>{let r=0;const i=oP(50,250);return aP(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-r,u=i(c),d=o<=a;r=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},n)},Ov=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Iv=t=>(...e)=>oe.asap(()=>t(...e)),uP=fn.hasStandardBrowserEnv?function(){const e=fn.navigator&&/(msie|trident)/i.test(fn.navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{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=i(window.location.href),function(o){const a=oe.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),cP=fn.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&o.push("path="+r),oe.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function lP(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function dP(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function A_(t,e){return t&&!lP(e)?dP(t,e):e}const Rv=t=>t instanceof hn?{...t}:t;function Ni(t,e){e=e||{};const n={};function r(u,d,h){return oe.isPlainObject(u)&&oe.isPlainObject(d)?oe.merge.call({caseless:h},u,d):oe.isPlainObject(d)?oe.merge({},d):oe.isArray(d)?d.slice():d}function i(u,d,h){if(oe.isUndefined(d)){if(!oe.isUndefined(u))return r(void 0,u,h)}else return r(u,d,h)}function s(u,d){if(!oe.isUndefined(d))return r(void 0,d)}function o(u,d){if(oe.isUndefined(d)){if(!oe.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function a(u,d,h){if(h in e)return r(u,d);if(h in t)return r(void 0,u)}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d)=>i(Rv(u),Rv(d),!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(d){const h=c[d]||i,p=h(t[d],e[d],d);oe.isUndefined(p)&&h!==a||(n[d]=p)}),n}const C_=t=>{const e=Ni({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=hn.from(o),e.url=w_(A_(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(oe.isFormData(n)){if(fn.hasStandardBrowserEnv||fn.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(fn.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(e)),r||r!==!1&&uP(e.url))){const u=i&&s&&cP.read(s);u&&o.set(i,u)}return e},fP=typeof XMLHttpRequest!="undefined",hP=fP&&function(t){return new Promise(function(n,r){const i=C_(t);let s=i.data;const o=hn.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=i,d,h,p,y,v;function w(){y&&y(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function C(){if(!k)return;const O=hn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),M={data:!a||a==="text"||a==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:O,config:t,request:k};E_(function(ee){n(ee),w()},function(ee){r(ee),w()},M),k=null}"onloadend"in k?k.onloadend=C:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(C)},k.onabort=function(){k&&(r(new Qe("Request aborted",Qe.ECONNABORTED,t,k)),k=null)},k.onerror=function(){r(new Qe("Network Error",Qe.ERR_NETWORK,t,k)),k=null},k.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const M=i.transitional||__;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new Qe(I,M.clarifyTimeoutError?Qe.ETIMEDOUT:Qe.ECONNABORTED,t,k)),k=null},s===void 0&&o.setContentType(null),"setRequestHeader"in k&&oe.forEach(o.toJSON(),function(I,M){k.setRequestHeader(M,I)}),oe.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),a&&a!=="json"&&(k.responseType=i.responseType),u&&([p,v]=ju(u,!0),k.addEventListener("progress",p)),c&&k.upload&&([h,y]=ju(c),k.upload.addEventListener("progress",h),k.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(d=O=>{k&&(r(!O||O.type?new Ds(null,t,k):O),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const E=sP(i.url);if(E&&fn.protocols.indexOf(E)===-1){r(new Qe("Unsupported protocol "+E+":",Qe.ERR_BAD_REQUEST,t));return}k.send(s||null)})},pP=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Qe?d:new Ds(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,s(new Qe(`timeout ${e} of ms exceeded`,Qe.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>oe.asap(a),c}},mP=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},gP=async function*(t,e){for await(const n of vP(t))yield*mP(n,e)},vP=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Pv=(t,e,n,r)=>{const i=gP(t,e);let s=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await i.next();if(u){a(),c.close();return}let h=d.byteLength;if(n){let p=s+=h;n(p)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},Sc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",x_=Sc&&typeof ReadableStream=="function",yP=Sc&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),N_=(t,...e)=>{try{return!!t(...e)}catch{return!1}},bP=x_&&N_(()=>{let t=!1;const e=new Request(fn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Dv=64*1024,Df=x_&&N_(()=>oe.isReadableStream(new Response("").body)),Vu={stream:Df&&(t=>t.body)};Sc&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Vu[e]&&(Vu[e]=oe.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Qe(`Response type '${e}' is not supported`,Qe.ERR_NOT_SUPPORT,r)})})})(new Response);const wP=async t=>{if(t==null)return 0;if(oe.isBlob(t))return t.size;if(oe.isSpecCompliantForm(t))return(await new Request(fn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(t)||oe.isArrayBuffer(t))return t.byteLength;if(oe.isURLSearchParams(t)&&(t=t+""),oe.isString(t))return(await yP(t)).byteLength},_P=async(t,e)=>{const n=oe.toFiniteNumber(t.getContentLength());return n==null?wP(e):n},SP=Sc&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:p}=C_(t);u=u?(u+"").toLowerCase():"text";let y=pP([i,s&&s.toAbortSignal()],o),v;const w=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let k;try{if(c&&bP&&n!=="get"&&n!=="head"&&(k=await _P(d,r))!==0){let M=new Request(e,{method:"POST",body:r,duplex:"half"}),Y;if(oe.isFormData(r)&&(Y=M.headers.get("content-type"))&&d.setContentType(Y),M.body){const[ee,F]=Ov(k,ju(Iv(c)));r=Pv(M.body,Dv,ee,F)}}oe.isString(h)||(h=h?"include":"omit");const C="credentials"in Request.prototype;v=new Request(e,{...p,signal:y,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:C?h:void 0});let E=await fetch(v);const O=Df&&(u==="stream"||u==="response");if(Df&&(a||O&&w)){const M={};["status","statusText","headers"].forEach(se=>{M[se]=E[se]});const Y=oe.toFiniteNumber(E.headers.get("content-length")),[ee,F]=a&&Ov(Y,ju(Iv(a),!0))||[];E=new Response(Pv(E.body,Dv,ee,()=>{F&&F(),w&&w()}),M)}u=u||"text";let I=await Vu[oe.findKey(Vu,u)||"text"](E,t);return!O&&w&&w(),await new Promise((M,Y)=>{E_(M,Y,{data:I,headers:hn.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:v})})}catch(C){throw w&&w(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new Qe("Network Error",Qe.ERR_NETWORK,t,v),{cause:C.cause||C}):Qe.from(C,C&&C.code,t,v)}}),Ff={http:LR,xhr:hP,fetch:SP};oe.forEach(Ff,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Fv=t=>`- ${t}`,kP=t=>oe.isFunction(t)||t===null||t===!1,T_={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let o;if(r=n,!kP(n)&&(r=Ff[(o=String(n)).toLowerCase()],r===void 0))throw new Qe(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
|
|
132
|
-
`+s.map(Fv).join(`
|
|
133
|
-
`):" "+Fv(s[0]):"as no adapter specified";throw new Qe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Ff};function xd(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ds(null,t)}function Uv(t){return xd(t),t.headers=hn.from(t.headers),t.data=Cd.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),T_.getAdapter(t.adapter||sa.adapter)(t).then(function(r){return xd(t),r.data=Cd.call(t,t.transformResponse,r),r.headers=hn.from(r.headers),r},function(r){return k_(r)||(xd(t),r&&r.response&&(r.response.data=Cd.call(t,t.transformResponse,r.response),r.response.headers=hn.from(r.response.headers))),Promise.reject(r)})}const O_="1.7.7",Sh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Sh[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Lv={};Sh.transitional=function(e,n,r){function i(s,o){return"[Axios v"+O_+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new Qe(i(o," has been removed"+(n?" in "+n:"")),Qe.ERR_DEPRECATED);return n&&!Lv[o]&&(Lv[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};function EP(t,e,n){if(typeof t!="object")throw new Qe("options must be an object",Qe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],c=a===void 0||o(a,s,t);if(c!==!0)throw new Qe("option "+s+" must be "+c,Qe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Qe("Unknown option "+s,Qe.ERR_BAD_OPTION)}}const Uf={assertOptions:EP,validators:Sh},Ar=Uf.validators;let _i=class{constructor(e){this.defaults=e,this.interceptors={request:new Nv,response:new Nv}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
134
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ni(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Uf.assertOptions(r,{silentJSONParsing:Ar.transitional(Ar.boolean),forcedJSONParsing:Ar.transitional(Ar.boolean),clarifyTimeoutError:Ar.transitional(Ar.boolean)},!1),i!=null&&(oe.isFunction(i)?n.paramsSerializer={serialize:i}:Uf.assertOptions(i,{encode:Ar.function,serialize:Ar.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&oe.merge(s.common,s[n.method]);s&&oe.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=hn.concat(o,s);const a=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,a.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let d,h=0,p;if(!c){const v=[Uv.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),p=v.length,d=Promise.resolve(n);h<p;)d=d.then(v[h++],v[h++]);return d}p=a.length;let y=n;for(h=0;h<p;){const v=a[h++],w=a[h++];try{y=v(y)}catch(k){w.call(this,k);break}}try{d=Uv.call(this,y)}catch(v){return Promise.reject(v)}for(h=0,p=u.length;h<p;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=Ni(this.defaults,e);const n=A_(e.baseURL,e.url);return w_(n,e.params,e.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(e){_i.prototype[e]=function(n,r){return this.request(Ni(r||{},{method:e,url:n,data:(r||{}).data}))}});oe.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(Ni(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}_i.prototype[e]=n(),_i.prototype[e+"Form"]=n(!0)});let AP=class I_{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Ds(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new I_(function(i){e=i}),cancel:e}}};function CP(t){return function(n){return t.apply(null,n)}}function xP(t){return oe.isObject(t)&&t.isAxiosError===!0}const Lf={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(Lf).forEach(([t,e])=>{Lf[e]=t});function R_(t){const e=new _i(t),n=u_(_i.prototype.request,e);return oe.extend(n,_i.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return R_(Ni(t,i))},n}const It=R_(sa);It.Axios=_i;It.CanceledError=Ds;It.CancelToken=AP;It.isCancel=k_;It.VERSION=O_;It.toFormData=_c;It.AxiosError=Qe;It.Cancel=It.CanceledError;It.all=function(e){return Promise.all(e)};It.spread=CP;It.isAxiosError=xP;It.mergeConfig=Ni;It.AxiosHeaders=hn;It.formToJSON=t=>S_(oe.isHTMLForm(t)?new FormData(t):t);It.getAdapter=T_.getAdapter;It.HttpStatusCode=Lf;It.default=It;const{Axios:WU,AxiosError:YU,CanceledError:JU,isCancel:XU,CancelToken:QU,VERSION:ZU,all:eL,Cancel:tL,isAxiosError:nL,spread:rL,toFormData:iL,AxiosHeaders:sL,HttpStatusCode:oL,formToJSON:aL,getAdapter:uL,mergeConfig:cL}=It,NP={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class qu{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||NP,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new qu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new qu(this.logger,e)}}var Wn=new qu;class kc{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[a,c]=o;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let u=0;u<c;u++)a.apply(a,[e,...r])})}}const go=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},Mv=t=>t==null?"":""+t,TP=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},OP=/###/g,Bv=t=>t&&t.indexOf("###")>-1?t.replace(OP,"."):t,$v=t=>!t||typeof t=="string",Ro=(t,e,n)=>{const r=typeof e!="string"?e:e.split(".");let i=0;for(;i<r.length-1;){if($v(t))return{};const s=Bv(r[i]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return $v(t)?{}:{obj:t,k:Bv(r[i])}},jv=(t,e,n)=>{const{obj:r,k:i}=Ro(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let s=e[e.length-1],o=e.slice(0,e.length-1),a=Ro(t,o,Object);for(;a.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=Ro(t,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${s}`]!="undefined"&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=n},IP=(t,e,n,r)=>{const{obj:i,k:s}=Ro(t,e,Object);i[s]=i[s]||[],i[s].push(n)},Hu=(t,e)=>{const{obj:n,k:r}=Ro(t,e);if(n)return n[r]},RP=(t,e,n)=>{const r=Hu(t,n);return r!==void 0?r:Hu(e,n)},P_=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):P_(t[r],e[r],n):t[r]=e[r]);return t},Xi=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var PP={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const DP=t=>typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>PP[e]):t;class FP{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const UP=[" ",",","?","!",";"],LP=new FP(20),MP=(t,e,n)=>{e=e||"",n=n||"";const r=UP.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=LP.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(t);if(!s){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(s=!0)}return s},Mf=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let o,a="";for(let c=s;c<r.length;++c)if(c!==s&&(a+=n),a+=r[c],o=i[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;s+=c-s+1;break}i=o}return i},Ku=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class Vv extends kc{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&s?a.push(...r.split(s)):a.push(r)));const c=Hu(this.data,a);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||typeof r!="string"?c:Mf(this.data&&this.data[e]&&this.data[e][n],r,s)}addResource(e,n,r,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),i=n,n=a[1]),this.addNamespaces(n),jv(this.data,a,i),s.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(typeof r[s]=="string"||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let c=Hu(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?P_(c,r,s):c={...c,...r},jv(this.data,a,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var D_={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(s=>{this.processors[s]&&(e=this.processors[s].process(e,n,r,i))}),e}};const qv={};class zu extends kc{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),TP(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Wn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!MP(e,r,i);if(o&&!a){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:s};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),e=u.join(i)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],n),c=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const I=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${I}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${I}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const h=this.resolve(e,n);let p=h&&h.res;const y=h&&h.usedKey||o,v=h&&h.exactUsedKey||o,w=Object.prototype.toString.apply(p),k=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject;if(E&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&k.indexOf(w)<0&&!(typeof C=="string"&&Array.isArray(p))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,p,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(h.res=I,h.usedParams=this.getUsedParamsDetails(n),h):I}if(s){const I=Array.isArray(p),M=I?[]:{},Y=I?v:y;for(const ee in p)if(Object.prototype.hasOwnProperty.call(p,ee)){const F=`${Y}${s}${ee}`;M[ee]=this.translate(F,{...n,joinArrays:!1,ns:a}),M[ee]===F&&(M[ee]=p[ee])}p=M}}else if(E&&typeof C=="string"&&Array.isArray(p))p=p.join(C),p&&(p=this.extendTranslation(p,e,n,r));else{let I=!1,M=!1;const Y=n.count!==void 0&&typeof n.count!="string",ee=zu.hasDefaultValue(n),F=Y?this.pluralResolver.getSuffix(u,n.count,n):"",se=n.ordinal&&Y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",H=Y&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),ie=H&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${F}`]||n[`defaultValue${se}`]||n.defaultValue;!this.isValidLookup(p)&&ee&&(I=!0,p=ie),this.isValidLookup(p)||(M=!0,p=o);const qe=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&M?void 0:p,G=ee&&ie!==p&&this.options.updateMissing;if(M||I||G){if(this.logger.log(G?"updateKey":"missingKey",u,c,o,G?ie:p),s){const ge=this.resolve(o,{...n,keySeparator:!1});ge&&ge.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let R=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let ge=0;ge<Q.length;ge++)R.push(Q[ge]);else this.options.saveMissingTo==="all"?R=this.languageUtils.toResolveHierarchy(n.lng||this.language):R.push(n.lng||this.language);const te=(ge,ve,U)=>{const de=ee&&U!==p?U:qe;this.options.missingKeyHandler?this.options.missingKeyHandler(ge,c,ve,de,G,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ge,c,ve,de,G,n),this.emit("missingKey",ge,c,ve,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Y?R.forEach(ge=>{const ve=this.pluralResolver.getSuffixes(ge,n);H&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ve.indexOf(`${this.options.pluralSeparator}zero`)<0&&ve.push(`${this.options.pluralSeparator}zero`),ve.forEach(U=>{te([ge],o+U,n[`defaultValue${U}`]||ie)})}):te(R,o,ie))}p=this.extendTranslation(p,e,n,h,r),M&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}:${o}`),(M||I)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,I?p:void 0):p=this.options.parseMissingKeyHandler(p))}return i?(h.res=p,h.usedParams=this.getUsedParamsDetails(n),h):p}extendTranslation(e,n,r,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof e=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const p=e.match(this.interpolator.nestingRegexp);d=p&&p.length}let h=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,r.lng||this.language||i.usedLng,r),u){const p=e.match(this.interpolator.nestingRegexp),y=p&&p.length;d<y&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var p=arguments.length,y=new Array(p),v=0;v<p;v++)y[v]=arguments[v];return s&&s[0]===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=typeof a=="string"?[a]:a;return e!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(e=D_.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,s,o,a;return typeof e=="string"&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;i=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const p=n.count!==void 0&&typeof n.count!="string",y=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),v=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",w=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(k=>{this.isValidLookup(r)||(a=k,!qv[`${w[0]}-${k}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(qv[`${w[0]}-${k}`]=!0,this.logger.warn(`key "${i}" for languages "${w.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(C=>{if(this.isValidLookup(r))return;o=C;const E=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(E,d,C,k,n);else{let I;p&&(I=this.pluralResolver.getSuffix(C,n.count,n));const M=`${this.options.pluralSeparator}zero`,Y=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(E.push(d+I),n.ordinal&&I.indexOf(Y)===0&&E.push(d+I.replace(Y,this.options.pluralSeparator)),y&&E.push(d+M)),v){const ee=`${d}${this.options.contextSeparator}${n.context}`;E.push(ee),p&&(E.push(ee+I),n.ordinal&&I.indexOf(Y)===0&&E.push(ee+I.replace(Y,this.options.pluralSeparator)),y&&E.push(ee+M))}}let O;for(;O=E.pop();)this.isValidLookup(r)||(s=O,r=this.getResource(C,k,O,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let i=r?e.replace:e;if(r&&typeof e.count!="undefined"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}const Nd=t=>t.charAt(0).toUpperCase()+t.slice(1);class Hv{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wn.create("languageUtils")}getScriptPartFromCode(e){if(e=Ku(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Ku(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Nd(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Nd(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Nd(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):typeof e=="string"&&s(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}let BP=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$P={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const jP=["v1","v2","v3"],VP=["v4"],Kv={zero:0,one:1,two:2,few:3,many:4,other:5},qP=()=>{const t={};return BP.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:$P[e.fc]}})}),t};class HP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Wn.create("pluralResolver"),(!this.options.compatibilityJSON||VP.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=qP(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Ku(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];const o=new Intl.PluralRules(r,{type:i});return this.pluralRulesCache[s]=o,o}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,s)=>Kv[i]-Kv[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(e,i,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let i=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const s=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!jP.includes(this.options.compatibilityJSON)}}const zv=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=RP(t,e,n);return!s&&i&&typeof n=="string"&&(s=Mf(t,n,r),s===void 0&&(s=Mf(e,n,r))),s},Td=t=>t.replace(/\$/g,"$$$$");class KP{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Wn.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:v,nestingSuffixEscaped:w,nestingOptionsSeparator:k,maxReplaces:C,alwaysFormat:E}=e.interpolation;this.escape=n!==void 0?n:DP,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Xi(s):o||"{{",this.suffix=a?Xi(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?Xi(p):y||Xi("$t("),this.nestingSuffix=v?Xi(v):w||Xi(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=C||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){let s,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=y=>{if(y.indexOf(this.formatSeparator)<0){const C=zv(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,r,{...i,...n,interpolationkey:y}):C}const v=y.split(this.formatSeparator),w=v.shift().trim(),k=v.join(this.formatSeparator).trim();return this.format(zv(n,c,w,this.options.keySeparator,this.options.ignoreJSONStructure),k,r,{...i,...n,interpolationkey:w})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>Td(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?Td(this.escape(y)):Td(y)}].forEach(y=>{for(a=0;s=y.regex.exec(e);){const v=s[1].trim();if(o=u(v),o===void 0)if(typeof d=="function"){const k=d(e,s,i);o=typeof k=="string"?k:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))o="";else if(h){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=Mv(o));const w=y.safeValue(o);if(e=e.replace(s[0],w),h?(y.regex.lastIndex+=o.length,y.regex.lastIndex-=s[0].length):y.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,o;const a=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const h=c.split(new RegExp(`${d}[ ]*{`));let p=`{${h[1]}`;c=h[0],p=this.interpolate(p,o);const y=p.match(/'/g),v=p.match(/"/g);(y&&y.length%2===0&&!v||v.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,w),`${c}${d}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),c=d,u=!0}if(s=n(a.call(this,i[1].trim(),o),o),s&&i[0]===e&&typeof s!="string")return s;typeof s!="string"&&(s=Mv(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),u&&(s=c.reduce((d,h)=>this.format(d,h,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const zP=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},Qi=t=>{const e={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=r+JSON.stringify(s);let a=e[o];return a||(a=t(Ku(r),i),e[o]=a),a(n)}};class GP{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Wn.create("formatter"),this.options=e,this.formats={number:Qi((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return s=>i.format(s)}),currency:Qi((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>i.format(s)}),datetime:Qi((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return s=>i.format(s)}),relativetime:Qi((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return s=>i.format(s,r.range||"day")}),list:Qi((n,r)=>{const i=new Intl.ListFormat(n,{...r});return s=>i.format(s)})},this.init(e)}init(e){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Qi(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(a=>a.indexOf(")")>-1)){const a=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,a)].join(this.formatSeparator)}return s.reduce((a,c)=>{const{formatName:u,formatOptions:d}=zP(c);if(this.formats[u]){let h=a;try{const p=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},y=p.locale||p.lng||i.locale||i.lng||r;h=this.formats[u](a,y,{...d,...i,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const WP=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class YP extends kc{constructor(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Wn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(e,n,r,i){const s={},o={},a={},c={};return e.forEach(u=>{let d=!0;n.forEach(h=>{const p=`${u}|${h}`;!r.reload&&this.store.hasResourceBundle(u,h)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,d=!1,o[p]===void 0&&(o[p]=!0),s[p]===void 0&&(s[p]=!0),c[h]===void 0&&(c[h]=!0)))}),d||(a[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const i=e.split("|"),s=i[0],o=i[1];n&&this.emit("failedLoading",s,o,n),!n&&r&&this.store.addResourceBundle(s,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(c=>{IP(c.loaded,[s],o),WP(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:s,callback:o});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,s*2,o)},s);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(e,n,a)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const s=this.queueLoad(e,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(e,n,r,i,c):d=u(e,n,r,i),d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}else u(e,n,r,i,a,c)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const Gv=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Wv=t=>(typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Xa=()=>{},JP=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Yo extends kc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Wv(e),this.services={},this.logger=Wn,this.modules={external:[]},JP(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=Gv();this.options={...i,...this.options,...Wv(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Wn.init(s(this.modules.logger),this.options):Wn.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl!="undefined"&&(d=GP);const h=new Hv(this.options);this.store=new Vv(this.options.resources,this.options);const p=this.services;p.logger=Wn,p.resourceStore=this.store,p.languageUtils=h,p.pluralResolver=new HP(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=s(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new KP(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new YP(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(y){for(var v=arguments.length,w=new Array(v>1?v-1:0),k=1;k<v;k++)w[k-1]=arguments[k];e.emit(y,...w)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new zu(this.services,this.options),this.translator.on("*",function(y){for(var v=arguments.length,w=new Array(v>1?v-1:0),k=1;k<v;k++)w[k-1]=arguments[k];e.emit(y,...w)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Xa),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const c=go(),u=()=>{const d=(h,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(p),r(h,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa;const i=typeof e=="string"?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(s,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(e,n,r){const i=go();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Xa),this.services.backendConnector.reload(e,n,s=>{i.resolve(),r(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&D_.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=go();this.emit("languageChanging",e);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?(s(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{o(d,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),i}getFixedT(e,n,r){var i=this;const s=function(o,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),h=2;h<u;h++)d[h-2]=arguments[h];c=i.options.overloadTranslationOptionHandler([o,a].concat(d))}else c={...a};c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||s.keyPrefix);const p=i.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(o)?y=o.map(v=>`${c.keyPrefix}${p}${v}`):y=c.keyPrefix?`${c.keyPrefix}${p}${o}`:o,i.t(y,c)};return typeof e=="string"?s.lng=e:s.lngs=e,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(s,e)))}loadNamespaces(e,n){const r=go();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=go();typeof e=="string"&&(e=[e]);const i=this.options.preload||[],s=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new Hv(Gv());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Yo(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new Yo(i);return(e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(a=>{s[a]=this[a]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new Vv(this.store.data,i),s.services.resourceStore=s.store),s.translator=new zu(s.services,i),s.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];s.emit(a,...u)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Gt=Yo.createInstance();Gt.createInstance=Yo.createInstance;Gt.createInstance;Gt.dir;Gt.init;Gt.loadResources;Gt.reloadResources;Gt.use;Gt.changeLanguage;Gt.getFixedT;const Yv=Gt.t;Gt.exists;Gt.setDefaultNamespace;Gt.hasLoadedNamespace;Gt.loadNamespaces;Gt.loadLanguages;const F_=t=>Yv(t?`errorCodes.${t}`:"errorCodes.DEFAULT");class XP{constructor(e){Pe(this,"logger");Pe(this,"axiosInstance");this.logger=e.logger,this.axiosInstance=It.create({baseURL:e.baseUrl,headers:e.accessToken?{Authorization:`Bearer ${e.accessToken}`}:{}})}async get(e){try{return(await this.axiosInstance.get(e)).data}catch(n){throw this.handleError(n)}}async post(e,n){var s;const{data:r={},ignoreError:i=!1}=n;try{return(await this.axiosInstance.post(e,r)).data}catch(o){if(i&&It.isAxiosError(o))return(s=o.response)==null?void 0:s.data;throw this.handleError(o)}}async put(e,n){var s;const{data:r={},ignoreError:i=!1}=n;try{return(await this.axiosInstance.put(e,r)).data}catch(o){if(i&&It.isAxiosError(o))return(s=o.response)==null?void 0:s.data;throw this.handleError(o)}}async delete(e){try{return(await this.axiosInstance.delete(e)).data}catch(n){throw this.handleError(n)}}handleError(e){var i;let n=Xt.GENERAL_ERROR;if(It.isAxiosError(e))if(e.response)switch(e.response.status){case 400:n=Xt.BAD_REQUEST;break;case 401:n=Xt.UNAUTHORIZED;break;case 403:n=Xt.FORBIDDEN;break;case 404:n=Xt.NOT_FOUND;break;case 409:n=Xt.CONFLICT;break;case 410:n=Xt.GONE;break;case 415:n=Xt.UNSUPPORTED_MEDIA_TYPE;break;case 429:n=Xt.TOO_MANY_REQUESTS;break;case 500:n=Xt.INTERNAL_SERVER_ERROR;break;case 503:n=Xt.SERVICE_UNAVAILABLE;break;default:n=Xt.SERVER_ERROR}else e.request?n=Xt.NETWORK_ERROR:n=Xt.CONFIG_ERROR;const r=F_(n);return this.logger.error("Error Code:",n,"Message:",r),this.logger.error("Result Data:",(i=e.response)==null?void 0:i.data),new Error(r)}}function QP(t){return Symbol(t)}function ZP(t){return Symbol(t)}function eD(t){return{key:t,isOptional:!0}}function tD(t,e){return Object.entries(e).reduce((n,[r,i])=>(n[r]=t.token(i),n),{})}var Od=new WeakMap,U_=new Map,nD=new Map,Ti;(function(t){t[t.Constant=0]="Constant",t[t.Instance=1]="Instance",t[t.Factory=2]="Factory"})(Ti||(Ti={}));var fr;(function(t){t[t.Container=0]="Container",t[t.Resolution=1]="Resolution",t[t.Singleton=2]="Singleton",t[t.Transient=3]="Transient"})(fr||(fr={}));var rD=class{constructor(t){this.impl=t,this.type=Ti.Constant}},iD=class{constructor(t){this.impl=t,this.type=Ti.Factory}},sD=t=>t.type===Ti.Factory,Ec=class{constructor(t){this.impl=t,this.type=Ti.Instance}},oD=class extends Ec{constructor(){super(...arguments),this.scope=fr.Container,this.cache=new WeakMap}},aD=class extends Ec{constructor(){super(...arguments),this.scope=fr.Resolution}},uD=class extends Ec{constructor(t){super(t),this.impl=t,this.scope=fr.Singleton}},cD=class extends Ec{constructor(){super(...arguments),this.scope=fr.Transient}},lD=t=>t.type===Ti.Instance,dD=t=>t.scope===fr.Container,fD=t=>t.scope===fr.Resolution,hD=t=>t.scope===fr.Singleton,L_=t=>Symbol(t),pD=t=>{const e=Symbol(t);return{__t:null,__d:t,__s:e,__o:!1,optional:{__t:null,__d:t,__s:e,__o:!0}}},Eo=class{constructor(){this.parent=null,this.map=new Map}set(t,e,n=Eo.notag){const r=this.map.get(e.__s);r?r.set(n,t):this.map.set(e.__s,new Map().set(n,t))}find(t,e,n){const r=this.map.get(t.__s);if(r!==void 0){if(n){const i=r.get(n);if(i)return i}if(e)for(let i=0,s=e.length;i<s;i+=1){const o=r.get(e[i]);if(o)return o}return r.get(Eo.notag)}}resolve(t,e,n,r){const i=this.find(t,n,r);return i===void 0?this.parent?this.parent.resolve(t,e,n,r):null:i instanceof Eo?(e.vaults.push(i),i.resolve(t,e,n,r)):i}get(t,e,n,r){const i=this.resolve(t,e,n,r);if(i)return i;for(let s=0,o=e.vaults,a=o.length;s<a;s+=1){const c=o[s].resolve(t,e,n,r);if(c)return c}return null}from(t){const e=new Eo;return e.parent=this.parent,this.map.forEach((n,r)=>{e.map.set(r,t(n))}),e}clone(){return this.from(t=>new Map(t))}},M_=Eo;M_.notag=L_("NO_TAG");var mD=class{constructor(t,e,n,r){this.vault=t,this.tokens=e,this.getVault=n,this.condition=r}from(t){const{tokens:e}=this;for(let n=0,r=e.length;n<r;n+=1)this.vault.set(this.getVault(t),e[n],this.condition)}},gD=class{constructor(t,e,n,r){this.vault=t,this.impl=e,this.token=n,this.condition=r}inContainerScope(){this.set(oD)}inResolutionScope(){this.set(aD)}inSingletonScope(){this.set(uD)}inTransientScope(){this.set(cD)}set(t){this.vault.set(new t(this.impl),this.token,this.condition)}},vD=class{constructor(t,e,n){this.vault=t,this.token=e,this.condition=n}toConstant(t){this.vault.set(new rD(t),this.token,this.condition)}toFactory(t,e){this.vault.set(new iD({creator:t,initializer:e}),this.token,this.condition)}toInstance(t){return new gD(this.vault,t,this.token,this.condition)}},Bf=class{constructor(t,e){this.vault=t,this.condition=e}static vault(t){return t.vault}bind(t){return new vD(this.vault,t,this.condition)}use(...t){return new mD(this.vault,t,Bf.vault,this.condition)}},yD=class extends Bf{when(t){return new Bf(this.vault,t)}},bD=class extends yD{constructor(){super(new M_)}},B_=class{constructor(t=new Map,e=[]){this.instances=t,this.vaults=e}split(){return new B_(this.instances,this.vaults.slice())}},mu=class extends bD{constructor(){super(),this.snapshot=null}extend(t){return this.vault.parent=t===null?null:t.vault,this}clone(){const t=new mu;return t.vault=this.vault.clone(),t}get(t,e){return this.resolveToken(t,e)}resolveTokens(t,e,n,r){return t.map(i=>this.resolveToken(i,n,r,e.split()))}resolveToken(t,e,n,r=new B_){const i=this.vault.get(t,r,e,n);if(i)return this.resolveBinding(i,r);if(!t.__o)throw new Error(`No matching bindings found for '${t.__d}' token.`)}resolveBinding(t,e){return lD(t)?hD(t)?this.resolveCache(t,e,()=>t.cache,n=>{t.cache=n}):dD(t)?this.resolveCache(t,e,()=>t.cache.get(this.vault),n=>{t.cache.set(this.vault,n)}):fD(t)?this.resolveCache(t,e,()=>e.instances.get(t),n=>{e.instances.set(t,n)}):this.createInstance(t.impl,e):sD(t)?(...n)=>{const r=this.createInstance(t.impl.creator,e);return r instanceof Promise?r.then(i=>mu.resolveInitialization(i,n,t.impl.initializer)):mu.resolveInitialization(r,n,t.impl.initializer)}:t.impl}resolveCache(t,e,n,r){const i=n();if(i!==void 0)return i;const s=this.createInstance(t.impl,e);return r(s),s}createInstance(t,e){const n=this.getParameters(t,e),r=Od.get(t);if(r!==void 0)return r?t(...n):new t(...n);try{const i=t(...n);return Od.set(t,!0),i}catch{const s=new t(...n);return Od.set(t,!1),s}}getParameters(t,e){const n=U_.get(t);if(n)return this.resolveTokens(n,e,nD.get(t),t);if(t.length===0)return[];throw new Error(`Missing required 'injected' registration of '${t.name}'`)}static resolveInitialization(t,e,n){const r=n==null?void 0:n(t,...e);return r instanceof Promise?r.then(()=>t):t}},Jv=(t,...e)=>(U_.set(t,e),t);function kh(t){return typeof t=="object"&&t!==null&&t.isOptional===!0}function $_(t){return"useClass"in t}function j_(t){return"useValue"in t}function V_(t){return"useFactory"in t}var yi=(t=>(t.Singleton="singleton",t.Transient="transient",t.Container="container",t.Resolution="resolution",t))(yi||{});function ns(t,e){var n;return t.has(e)||t.set(e,pD((n=e.description)!=null?n:"unknown_key")),t.get(e)}function Eh(t,e){var n;return t.has(e)||t.set(e,L_((n=e.description)!=null?n:"unknown_tag")),t.get(e)}function q_(t,e){return typeof e=="symbol"?Eh(t,e):e}function $f(t,e,n){return e.map(r=>{const i=kh(r),s=i?r.key:r,o=t.get(s);if(!o)throw new Error(`DI Error: Dependency key "${String(s.description)}" required by "${String(n.description)}" not found.`);return i?o.optional:o})}function H_(t,e){switch(e){case yi.Singleton:t.inSingletonScope();break;case yi.Container:t.inContainerScope();break;case yi.Resolution:t.inResolutionScope();break;case yi.Transient:default:t.inTransientScope();break}}class Ah{constructor(){Pe(this,"container");Pe(this,"keyToTokenMap",new Map);Pe(this,"tagToBrandiTagMap",new Map);this.container=new mu}static create(e){const n=new Ah;return n.initializeTokensAndTags(e),n.bindProviders(e),n}token(e){const n=this.keyToTokenMap.get(e);if(!n)throw new Error(`DI Error: Token for key "${String(e.description)}" not found.`);return n}initializeTokensAndTags(e){e.forEach(n=>{ns(this.keyToTokenMap,n.key),n.when&&typeof n.when=="symbol"&&Eh(this.tagToBrandiTagMap,n.when),"deps"in n&&n.deps&&n.deps.forEach(r=>{const i=kh(r)?r.key:r;ns(this.keyToTokenMap,i)})})}bindProviders(e){e.forEach(n=>{const r=n.when?q_(this.tagToBrandiTagMap,n.when):void 0,i=r?this.container.when(r):this.container;$_(n)?this.bindClassProvider(i,n):j_(n)?this.bindValueProvider(i,n):V_(n)&&this.bindFactoryProvider(i,n)})}bindClassProvider(e,n){const{key:r,useClass:i,deps:s=[],scope:o=yi.Transient}=n,a=ns(this.keyToTokenMap,r),c=$f(this.keyToTokenMap,s,r);c.length>0&&Jv(i,...c);const u=e.bind(a).toInstance(i);H_(u,o)}bindValueProvider(e,n){const r=ns(this.keyToTokenMap,n.key);e.bind(r).toConstant(n.useValue)}bindFactoryProvider(e,n){var c;const{key:r,useFactory:i,deps:s=[],initializer:o}=n,a=ns(this.keyToTokenMap,r);if(typeof i=="function"&&((c=i.prototype)==null?void 0:c.constructor)===i&&s.length>0){const u=$f(this.keyToTokenMap,s,r);u.length>0&&Jv(i,...u)}e.bind(a).toFactory(i,o)}}function K_(t){const e=Object.values(t);return Object.assign({},...e)}function z_(t){return Object.entries(t).reduce((e,[n,r])=>{const i=K_(r);return{...e,[n]:i}},{})}function G_(t,e){const n=z_(e);Object.entries(n).forEach(([r,i])=>{t.addResourceBundle(r,"translation",i,!0)})}const{slice:wD,forEach:_D}=[];function SD(t){return _D.call(wD.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const Xv=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,kD=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!Xv.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!Xv.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s},Qv={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=kD(t,encodeURIComponent(e),i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t){this.create(t,"",-1)}};var ED={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document!="undefined")return Qv.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document!="undefined"&&Qv.create(n,t,r,i,s)}},AD={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window!="undefined"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(n=o[a].substring(c+1))}}return n}};let vo=null;const Zv=()=>{if(vo!==null)return vo;try{vo=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{vo=!1}return vo};var CD={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&Zv())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&Zv()&&window.localStorage.setItem(n,t)}};let yo=null;const ey=()=>{if(yo!==null)return yo;try{yo=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{yo=!1}return yo};var xD={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&ey())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&ey()&&window.sessionStorage.setItem(n,t)}},ND={name:"navigator",lookup(t){const e=[];if(typeof navigator!="undefined"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},TD={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document!="undefined"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},OD={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window=="undefined")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},ID={name:"subdomain",lookup(t){var i,s;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window!="undefined"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function RD(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class W_{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=SD(n,this.options||{},RD()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(ED),this.addDetector(AD),this.addDetector(CD),this.addDetector(xD),this.addDetector(ND),this.addDetector(TD),this.addDetector(OD),this.addDetector(ID)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}W_.type="languageDetector";function Y_(t,e){t.use(e).use(W_).init({resources:{},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(n,r,i)=>{if(r){const[s,...o]=r.split(",").map(a=>a.trim());if(s==="number")return new Intl.NumberFormat(i).format(n);if(s==="date")return new Intl.DateTimeFormat(i).format(n);if(s==="currency")return new Intl.NumberFormat(i,{style:"currency",currency:o[0]||"USD",currencyDisplay:"narrowSymbol"}).format(n).replace("$","").trim()}return n}},detection:{order:["navigator","cookie","localStorage","sessionStorage","querystring","htmlTag","path","subdomain"]}})}const PD=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,DD={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},FD=t=>DD[t],UD=t=>t.replace(PD,FD);let ty={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:UD};function LD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ty={...ty,...t}}const MD={type:"3rdParty",init(t){LD(t.options.react)}};Y_(Gt,MD);const BD=t=>G_(Gt,t),ny={startTime:"UNKNOWN",viewerCount:0,status:"UNKNOWN"},$D=()=>{const[t,e]=st.useState([]),[n,r]=st.useState(ny);return{realTimeStreamInfo:n,productsInCart:t,onTextMetadataCue:o=>{const{action:a,data:c,startTime:u,viewerCount:d,status:h}=JSON.parse(o==null?void 0:o.text);switch(a){case"sendivsdatarealtime":{r({startTime:u,viewerCount:d,status:h});break}case"sendaddtocart":{const{id:p,sessionId:y,productId:v,productImageUrl:w,productName:k}=c;e(C=>[...C,{id:p,sessionId:y,productId:v,productImageUrl:w,productName:k}])}break}},resetRealTimeStreamInfo:()=>{r(ny)},setProductsInCart:e}},Ch=JSON,jD=t=>t.toUpperCase(),VD=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},qD=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},HD=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},KD=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};function gu(t,e){if(!!!t)throw new Error(e)}function zD(t){return typeof t=="object"&&t!==null}function GD(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const WD=/\r\n|[\n\r]/g;function jf(t,e){let n=0,r=1;for(const i of t.body.matchAll(WD)){if(typeof i.index=="number"||GD(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function YD(t){return J_(t.source,jf(t.source,t.start))}function J_(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,c=e.column+a,u=`${t.name}:${o}:${c}
|
|
135
|
-
`,d=r.split(/\r\n|[\n\r]/g),h=d[i];if(h.length>120){const p=Math.floor(c/80),y=c%80,v=[];for(let w=0;w<h.length;w+=80)v.push(h.slice(w,w+80));return u+ry([[`${o} |`,v[0]],...v.slice(1,p+1).map(w=>["|",w]),["|","^".padStart(y)],["|",v[p+1]]])}return u+ry([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(c)],[`${o+1} |`,d[i+1]]])}function ry(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
|
|
136
|
-
`)}function JD(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class xh extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:c,path:u,originalError:d,extensions:h}=JD(n);super(e),this.name="GraphQLError",this.path=u!=null?u:void 0,this.originalError=d!=null?d:void 0,this.nodes=iy(Array.isArray(o)?o:o?[o]:void 0);const p=iy((r=this.nodes)===null||r===void 0?void 0:r.map(v=>v.loc).filter(v=>v!=null));this.source=a!=null?a:p==null||(i=p[0])===null||i===void 0?void 0:i.source,this.positions=c!=null?c:p==null?void 0:p.map(v=>v.start),this.locations=c&&a?c.map(v=>jf(a,v)):p==null?void 0:p.map(v=>jf(v.source,v.start));const y=zD(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=h!=null?h:y)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,xh):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
|
|
137
|
-
|
|
138
|
-
`+YD(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
|
|
139
|
-
|
|
140
|
-
`+J_(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function iy(t){return t===void 0||t.length===0?void 0:t}function Vt(t,e,n){return new xh(`Syntax Error: ${n}`,{source:t,positions:[e]})}class XD{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class X_{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Q_={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},QD=new Set(Object.keys(Q_));function sy(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&QD.has(e)}var us;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(us||(us={}));var Vf;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Vf||(Vf={}));var ze;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ze||(ze={}));function qf(t){return t===9||t===32}function Jo(t){return t>=48&&t<=57}function Z_(t){return t>=97&&t<=122||t>=65&&t<=90}function e0(t){return Z_(t)||t===95}function ZD(t){return Z_(t)||Jo(t)||t===95}function eF(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],c=tF(a);c!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function tF(t){let e=0;for(;e<t.length&&qf(t.charCodeAt(e));)++e;return e}function nF(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(y=>y.length===0||qf(y.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,c=t.endsWith("\\"),u=a||c,d=!i||t.length>70||u||s||o;let h="";const p=i&&qf(t.charCodeAt(0));return(d&&!p||s)&&(h+=`
|
|
141
|
-
`),h+=n,(d||u)&&(h+=`
|
|
142
|
-
`),'"""'+h+'"""'}var he;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(he||(he={}));class rF{constructor(e){const n=new X_(he.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==he.EOF)do if(e.next)e=e.next;else{const n=sF(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===he.COMMENT);return e}}function iF(t){return t===he.BANG||t===he.DOLLAR||t===he.AMP||t===he.PAREN_L||t===he.PAREN_R||t===he.SPREAD||t===he.COLON||t===he.EQUALS||t===he.AT||t===he.BRACKET_L||t===he.BRACKET_R||t===he.BRACE_L||t===he.PIPE||t===he.BRACE_R}function Fs(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function Ac(t,e){return t0(t.charCodeAt(e))&&n0(t.charCodeAt(e+1))}function t0(t){return t>=55296&&t<=56319}function n0(t){return t>=56320&&t<=57343}function Oi(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return he.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Mt(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new X_(e,n,r,s,o,i)}function sF(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return oF(t,i);case 33:return Mt(t,he.BANG,i,i+1);case 36:return Mt(t,he.DOLLAR,i,i+1);case 38:return Mt(t,he.AMP,i,i+1);case 40:return Mt(t,he.PAREN_L,i,i+1);case 41:return Mt(t,he.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Mt(t,he.SPREAD,i,i+3);break;case 58:return Mt(t,he.COLON,i,i+1);case 61:return Mt(t,he.EQUALS,i,i+1);case 64:return Mt(t,he.AT,i,i+1);case 91:return Mt(t,he.BRACKET_L,i,i+1);case 93:return Mt(t,he.BRACKET_R,i,i+1);case 123:return Mt(t,he.BRACE_L,i,i+1);case 124:return Mt(t,he.PIPE,i,i+1);case 125:return Mt(t,he.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?fF(t,i):uF(t,i)}if(Jo(s)||s===45)return aF(t,i,s);if(e0(s))return hF(t,i);throw Vt(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Fs(s)||Ac(n,i)?`Unexpected character: ${Oi(t,i)}.`:`Invalid character: ${Oi(t,i)}.`)}return Mt(t,he.EOF,r,r)}function oF(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Fs(s))++i;else if(Ac(n,i))i+=2;else break}return Mt(t,he.COMMENT,e,i,n.slice(e+1,i))}function aF(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),Jo(s))throw Vt(t.source,i,`Invalid number, unexpected digit after 0: ${Oi(t,i)}.`)}else i=Id(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Id(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Id(t,i,s),s=r.charCodeAt(i)),s===46||e0(s))throw Vt(t.source,i,`Invalid number, expected digit but got: ${Oi(t,i)}.`);return Mt(t,o?he.FLOAT:he.INT,e,i,r.slice(e,i))}function Id(t,e,n){if(!Jo(n))throw Vt(t.source,e,`Invalid number, expected digit but got: ${Oi(t,e)}.`);const r=t.source.body;let i=e+1;for(;Jo(r.charCodeAt(i));)++i;return i}function uF(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Mt(t,he.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?cF(t,i):lF(t,i):dF(t,i);o+=c.value,i+=c.size,s=i;continue}if(a===10||a===13)break;if(Fs(a))++i;else if(Ac(n,i))i+=2;else throw Vt(t.source,i,`Invalid character within String: ${Oi(t,i)}.`)}throw Vt(t.source,i,"Unterminated string.")}function cF(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!Fs(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ao(s),r<0)break}throw Vt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function lF(t,e){const n=t.source.body,r=oy(n,e+2);if(Fs(r))return{value:String.fromCodePoint(r),size:6};if(t0(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=oy(n,e+8);if(n0(i))return{value:String.fromCodePoint(r,i),size:12}}throw Vt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function oy(t,e){return Ao(t.charCodeAt(e))<<12|Ao(t.charCodeAt(e+1))<<8|Ao(t.charCodeAt(e+2))<<4|Ao(t.charCodeAt(e+3))}function Ao(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function dF(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
143
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Vt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function fF(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const c=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),c.push(a);const d=Mt(t,he.BLOCK_STRING,e,s+3,eF(c).join(`
|
|
144
|
-
`));return t.line+=c.length-1,t.lineStart=i,d}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),c.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Fs(u))++s;else if(Ac(n,s))s+=2;else throw Vt(t.source,s,`Invalid character within String: ${Oi(t,s)}.`)}throw Vt(t.source,s,"Unterminated string.")}function hF(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(ZD(s))++i;else break}return Mt(t,he.NAME,e,i,n.slice(e,i))}const pF=10,r0=2;function Nh(t){return Cc(t,[])}function Cc(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return mF(t,e);default:return String(t)}}function mF(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(gF(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:Cc(r,n)}else if(Array.isArray(t))return yF(t,n);return vF(t,n)}function gF(t){return typeof t.toJSON=="function"}function vF(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>r0?"["+bF(t)+"]":"{ "+n.map(([i,s])=>i+": "+Cc(s,e)).join(", ")+" }"}function yF(t,e){if(t.length===0)return"[]";if(e.length>r0)return"[Array]";const n=Math.min(pF,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(Cc(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function bF(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const wF=globalThis.process&&!0,_F=wF?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=Nh(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
145
|
-
|
|
146
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
147
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
148
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
149
|
-
|
|
150
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
151
|
-
|
|
152
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
153
|
-
versions may have different capabilities and behavior. The data from one
|
|
154
|
-
version used in the function from another could produce confusing and
|
|
155
|
-
spurious results.`)}}return!1};class i0{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||gu(!1,`Body must be a string. Received: ${Nh(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||gu(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||gu(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function SF(t){return _F(t,i0)}function kF(t,e){return new EF(t,e).parseDocument()}class EF{constructor(e,n={}){const r=SF(e)?e:new i0(e);this._lexer=new rF(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(he.NAME);return this.node(e,{kind:ze.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ze.DOCUMENT,definitions:this.many(he.SOF,this.parseDefinition,he.EOF)})}parseDefinition(){if(this.peek(he.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===he.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Vt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(he.BRACE_L))return this.node(e,{kind:ze.OPERATION_DEFINITION,operation:us.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(he.NAME)&&(r=this.parseName()),this.node(e,{kind:ze.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(he.NAME);switch(e.value){case"query":return us.QUERY;case"mutation":return us.MUTATION;case"subscription":return us.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(he.PAREN_L,this.parseVariableDefinition,he.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ze.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(he.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(he.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(he.DOLLAR),this.node(e,{kind:ze.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ze.SELECTION_SET,selections:this.many(he.BRACE_L,this.parseSelection,he.BRACE_R)})}parseSelection(){return this.peek(he.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(he.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:ze.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(he.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(he.PAREN_L,n,he.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(he.COLON),this.node(n,{kind:ze.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(he.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(he.NAME)?this.node(e,{kind:ze.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:ze.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:ze.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:ze.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case he.BRACKET_L:return this.parseList(e);case he.BRACE_L:return this.parseObject(e);case he.INT:return this.advanceLexer(),this.node(n,{kind:ze.INT,value:n.value});case he.FLOAT:return this.advanceLexer(),this.node(n,{kind:ze.FLOAT,value:n.value});case he.STRING:case he.BLOCK_STRING:return this.parseStringLiteral();case he.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:ze.BOOLEAN,value:!0});case"false":return this.node(n,{kind:ze.BOOLEAN,value:!1});case"null":return this.node(n,{kind:ze.NULL});default:return this.node(n,{kind:ze.ENUM,value:n.value})}case he.DOLLAR:if(e)if(this.expectToken(he.DOLLAR),this._lexer.token.kind===he.NAME){const r=this._lexer.token.value;throw Vt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:ze.STRING,value:e.value,block:e.kind===he.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:ze.LIST,values:this.any(he.BRACKET_L,n,he.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:ze.OBJECT,fields:this.any(he.BRACE_L,n,he.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(he.COLON),this.node(n,{kind:ze.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(he.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(he.AT),this.node(n,{kind:ze.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(he.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(he.BRACKET_R),n=this.node(e,{kind:ze.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(he.BANG)?this.node(e,{kind:ze.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:ze.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(he.STRING)||this.peek(he.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(he.BRACE_L,this.parseOperationTypeDefinition,he.BRACE_R);return this.node(e,{kind:ze.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(he.COLON);const r=this.parseNamedType();return this.node(e,{kind:ze.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:ze.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ze.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(he.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(he.BRACE_L,this.parseFieldDefinition,he.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(he.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:ze.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(he.PAREN_L,this.parseInputValueDef,he.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(he.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(he.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:ze.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ze.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:ze.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(he.EQUALS)?this.delimitedMany(he.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:ze.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(he.BRACE_L,this.parseEnumValueDefinition,he.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:ze.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Vt(this._lexer.source,this._lexer.token.start,`${Qa(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:ze.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(he.BRACE_L,this.parseInputValueDef,he.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===he.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(he.BRACE_L,this.parseOperationTypeDefinition,he.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:ze.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:ze.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ze.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ze.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ze.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ze.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ze.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(he.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:ze.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(he.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Vf,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new XD(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Vt(this._lexer.source,n.start,`Expected ${s0(e)}, found ${Qa(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===he.NAME&&n.value===e)this.advanceLexer();else throw Vt(this._lexer.source,n.start,`Expected "${e}", found ${Qa(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===he.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e!=null?e:this._lexer.token;return Vt(this._lexer.source,n.start,`Unexpected ${Qa(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==he.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw Vt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Qa(t){const e=t.value;return s0(t.kind)+(e!=null?` "${e}"`:"")}function s0(t){return iF(t)?`"${t}"`:t}function AF(t){return`"${t.replace(CF,xF)}"`}const CF=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xF(t){return NF[t.charCodeAt(0)]}const NF=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],TF=Object.freeze({});function OF(t,e,n=Q_){const r=new Map;for(const C of Object.values(ze))r.set(C,IF(e,C));let i,s=Array.isArray(t),o=[t],a=-1,c=[],u=t,d,h;const p=[],y=[];do{a++;const C=a===o.length,E=C&&c.length!==0;if(C){if(d=y.length===0?void 0:p[p.length-1],u=h,h=y.pop(),E)if(s){u=u.slice();let I=0;for(const[M,Y]of c){const ee=M-I;Y===null?(u.splice(ee,1),I++):u[ee]=Y}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[I,M]of c)u[I]=M}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(h){if(d=s?a:o[a],u=h[d],u==null)continue;p.push(d)}let O;if(!Array.isArray(u)){var v,w;sy(u)||gu(!1,`Invalid AST Node: ${Nh(u)}.`);const I=C?(v=r.get(u.kind))===null||v===void 0?void 0:v.leave:(w=r.get(u.kind))===null||w===void 0?void 0:w.enter;if(O=I==null?void 0:I.call(e,u,d,h,p,y),O===TF)break;if(O===!1){if(!C){p.pop();continue}}else if(O!==void 0&&(c.push([d,O]),!C))if(sy(O))u=O;else{p.pop();continue}}if(O===void 0&&E&&c.push([d,u]),C)p.pop();else{var k;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(u),o=s?u:(k=n[u.kind])!==null&&k!==void 0?k:[],a=-1,c=[],h&&y.push(h),h=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function IF(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function RF(t){return OF(t,DF)}const PF=80,DF={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>$e(t.definitions,`
|
|
156
|
-
|
|
157
|
-
`)},OperationDefinition:{leave(t){const e=ot("(",$e(t.variableDefinitions,", "),")"),n=$e([t.operation,$e([t.name,e]),$e(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+ot(" = ",n)+ot(" ",$e(r," "))},SelectionSet:{leave:({selections:t})=>In(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=ot("",t,": ")+e;let o=s+ot("(",$e(n,", "),")");return o.length>PF&&(o=s+ot(`(
|
|
158
|
-
`,vu($e(n,`
|
|
159
|
-
`)),`
|
|
160
|
-
)`)),$e([o,$e(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+ot(" ",$e(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>$e(["...",ot("on ",t),$e(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${ot("(",$e(n,", "),")")} on ${e} ${ot("",$e(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?nF(t):AF(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+$e(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+$e(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+ot("(",$e(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>ot("",t,`
|
|
161
|
-
`)+$e(["schema",$e(e," "),In(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>ot("",t,`
|
|
162
|
-
`)+$e(["scalar",e,$e(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>ot("",t,`
|
|
163
|
-
`)+$e(["type",e,ot("implements ",$e(n," & ")),$e(r," "),In(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>ot("",t,`
|
|
164
|
-
`)+e+(ay(n)?ot(`(
|
|
165
|
-
`,vu($e(n,`
|
|
166
|
-
`)),`
|
|
167
|
-
)`):ot("(",$e(n,", "),")"))+": "+r+ot(" ",$e(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>ot("",t,`
|
|
168
|
-
`)+$e([e+": "+n,ot("= ",r),$e(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>ot("",t,`
|
|
169
|
-
`)+$e(["interface",e,ot("implements ",$e(n," & ")),$e(r," "),In(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>ot("",t,`
|
|
170
|
-
`)+$e(["union",e,$e(n," "),ot("= ",$e(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>ot("",t,`
|
|
171
|
-
`)+$e(["enum",e,$e(n," "),In(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>ot("",t,`
|
|
172
|
-
`)+$e([e,$e(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>ot("",t,`
|
|
173
|
-
`)+$e(["input",e,$e(n," "),In(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>ot("",t,`
|
|
174
|
-
`)+"directive @"+e+(ay(n)?ot(`(
|
|
175
|
-
`,vu($e(n,`
|
|
176
|
-
`)),`
|
|
177
|
-
)`):ot("(",$e(n,", "),")"))+(r?" repeatable":"")+" on "+$e(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>$e(["extend schema",$e(t," "),In(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>$e(["extend scalar",t,$e(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>$e(["extend type",t,ot("implements ",$e(e," & ")),$e(n," "),In(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>$e(["extend interface",t,ot("implements ",$e(e," & ")),$e(n," "),In(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>$e(["extend union",t,$e(e," "),ot("= ",$e(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>$e(["extend enum",t,$e(e," "),In(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>$e(["extend input",t,$e(e," "),In(n)]," ")}};function $e(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function In(t){return ot(`{
|
|
178
|
-
`,vu($e(t,`
|
|
179
|
-
`)),`
|
|
180
|
-
}`)}function ot(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function vu(t){return ot(" ",t.replace(/\n/g,`
|
|
181
|
-
`))}function ay(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
|
|
182
|
-
`)))!==null&&e!==void 0?e:!1}const uy=t=>{var r,i;let e;const n=t.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(e=(i=(r=n[0])==null?void 0:r.name)==null?void 0:i.value),e},Rd=t=>{if(typeof t=="string"){let n;try{const r=kF(t);n=uy(r)}catch{}return{query:t,operationName:n}}const e=uy(t);return{query:RF(t),operationName:e}};class Po extends Error{constructor(e,n){const r=`${Po.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(r),Object.setPrototypeOf(this,Po.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Po)}static extractMessage(e){var n,r,i;return(i=(r=(n=e.errors)==null?void 0:n[0])==null?void 0:r.message)!=null?i:`GraphQL Error (Code: ${e.status})`}}var Co={exports:{}},FF=Co.exports,cy;function UF(){return cy||(cy=1,function(t,e){var n=typeof self!="undefined"?self:FF,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(G){return G&&DataView.prototype.isPrototypeOf(G)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(G){return G&&u.indexOf(Object.prototype.toString.call(G))>-1};function h(G){if(typeof G!="string"&&(G=String(G)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(G))throw new TypeError("Invalid character in header field name");return G.toLowerCase()}function p(G){return typeof G!="string"&&(G=String(G)),G}function y(G){var R={next:function(){var Q=G.shift();return{done:Q===void 0,value:Q}}};return a.iterable&&(R[Symbol.iterator]=function(){return R}),R}function v(G){this.map={},G instanceof v?G.forEach(function(R,Q){this.append(Q,R)},this):Array.isArray(G)?G.forEach(function(R){this.append(R[0],R[1])},this):G&&Object.getOwnPropertyNames(G).forEach(function(R){this.append(R,G[R])},this)}v.prototype.append=function(G,R){G=h(G),R=p(R);var Q=this.map[G];this.map[G]=Q?Q+", "+R:R},v.prototype.delete=function(G){delete this.map[h(G)]},v.prototype.get=function(G){return G=h(G),this.has(G)?this.map[G]:null},v.prototype.has=function(G){return this.map.hasOwnProperty(h(G))},v.prototype.set=function(G,R){this.map[h(G)]=p(R)},v.prototype.forEach=function(G,R){for(var Q in this.map)this.map.hasOwnProperty(Q)&&G.call(R,this.map[Q],Q,this)},v.prototype.keys=function(){var G=[];return this.forEach(function(R,Q){G.push(Q)}),y(G)},v.prototype.values=function(){var G=[];return this.forEach(function(R){G.push(R)}),y(G)},v.prototype.entries=function(){var G=[];return this.forEach(function(R,Q){G.push([Q,R])}),y(G)},a.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function w(G){if(G.bodyUsed)return Promise.reject(new TypeError("Already read"));G.bodyUsed=!0}function k(G){return new Promise(function(R,Q){G.onload=function(){R(G.result)},G.onerror=function(){Q(G.error)}})}function C(G){var R=new FileReader,Q=k(R);return R.readAsArrayBuffer(G),Q}function E(G){var R=new FileReader,Q=k(R);return R.readAsText(G),Q}function O(G){for(var R=new Uint8Array(G),Q=new Array(R.length),te=0;te<R.length;te++)Q[te]=String.fromCharCode(R[te]);return Q.join("")}function I(G){if(G.slice)return G.slice(0);var R=new Uint8Array(G.byteLength);return R.set(new Uint8Array(G)),R.buffer}function M(){return this.bodyUsed=!1,this._initBody=function(G){this._bodyInit=G,G?typeof G=="string"?this._bodyText=G:a.blob&&Blob.prototype.isPrototypeOf(G)?this._bodyBlob=G:a.formData&&FormData.prototype.isPrototypeOf(G)?this._bodyFormData=G:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(G)?this._bodyText=G.toString():a.arrayBuffer&&a.blob&&c(G)?(this._bodyArrayBuffer=I(G.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(G)||d(G))?this._bodyArrayBuffer=I(G):this._bodyText=G=Object.prototype.toString.call(G):this._bodyText="",this.headers.get("content-type")||(typeof G=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(G)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var G=w(this);if(G)return G;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(C)}),this.text=function(){var G=w(this);if(G)return G;if(this._bodyBlob)return E(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(se)}),this.json=function(){return this.text().then(JSON.parse)},this}var Y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ee(G){var R=G.toUpperCase();return Y.indexOf(R)>-1?R:G}function F(G,R){R=R||{};var Q=R.body;if(G instanceof F){if(G.bodyUsed)throw new TypeError("Already read");this.url=G.url,this.credentials=G.credentials,R.headers||(this.headers=new v(G.headers)),this.method=G.method,this.mode=G.mode,this.signal=G.signal,!Q&&G._bodyInit!=null&&(Q=G._bodyInit,G.bodyUsed=!0)}else this.url=String(G);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new v(R.headers)),this.method=ee(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Q)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Q)}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function se(G){var R=new FormData;return G.trim().split("&").forEach(function(Q){if(Q){var te=Q.split("="),ge=te.shift().replace(/\+/g," "),ve=te.join("=").replace(/\+/g," ");R.append(decodeURIComponent(ge),decodeURIComponent(ve))}}),R}function H(G){var R=new v,Q=G.replace(/\r?\n[\t ]+/g," ");return Q.split(/\r?\n/).forEach(function(te){var ge=te.split(":"),ve=ge.shift().trim();if(ve){var U=ge.join(":").trim();R.append(ve,U)}}),R}M.call(F.prototype);function ie(G,R){R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in R?R.statusText:"OK",this.headers=new v(R.headers),this.url=R.url||"",this._initBody(G)}M.call(ie.prototype),ie.prototype.clone=function(){return new ie(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},ie.error=function(){var G=new ie(null,{status:0,statusText:""});return G.type="error",G};var xe=[301,302,303,307,308];ie.redirect=function(G,R){if(xe.indexOf(R)===-1)throw new RangeError("Invalid status code");return new ie(null,{status:R,headers:{location:G}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(R,Q){this.message=R,this.name=Q;var te=Error(R);this.stack=te.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function qe(G,R){return new Promise(function(Q,te){var ge=new F(G,R);if(ge.signal&&ge.signal.aborted)return te(new o.DOMException("Aborted","AbortError"));var ve=new XMLHttpRequest;function U(){ve.abort()}ve.onload=function(){var de={status:ve.status,statusText:ve.statusText,headers:H(ve.getAllResponseHeaders()||"")};de.url="responseURL"in ve?ve.responseURL:de.headers.get("X-Request-URL");var Se="response"in ve?ve.response:ve.responseText;Q(new ie(Se,de))},ve.onerror=function(){te(new TypeError("Network request failed"))},ve.ontimeout=function(){te(new TypeError("Network request failed"))},ve.onabort=function(){te(new o.DOMException("Aborted","AbortError"))},ve.open(ge.method,ge.url,!0),ge.credentials==="include"?ve.withCredentials=!0:ge.credentials==="omit"&&(ve.withCredentials=!1),"responseType"in ve&&a.blob&&(ve.responseType="blob"),ge.headers.forEach(function(de,Se){ve.setRequestHeader(Se,de)}),ge.signal&&(ge.signal.addEventListener("abort",U),ve.onreadystatechange=function(){ve.readyState===4&&ge.signal.removeEventListener("abort",U)}),ve.send(typeof ge._bodyInit=="undefined"?null:ge._bodyInit)})}return qe.polyfill=!0,s.fetch||(s.fetch=qe,s.Headers=v,s.Request=F,s.Response=ie),o.Headers=v,o.Request=F,o.Response=ie,o.fetch=qe,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(Co,Co.exports)),Co.exports}var Gu=UF();const yu=Hr(Gu),LF=eS({__proto__:null,default:yu},[Gu]),Zi=t=>{let e={};return t&&(typeof Headers!="undefined"&&t instanceof Headers||LF&&Gu.Headers&&t instanceof Gu.Headers?e=VD(t):Array.isArray(t)?t.forEach(([n,r])=>{n&&r!==void 0&&(e[n]=r)}):e=t),e},ly=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),MF=t=>{if(!Array.isArray(t.query)){const r=t,i=[`query=${encodeURIComponent(ly(r.query))}`];return t.variables&&i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`),r.operationName&&i.push(`operationName=${encodeURIComponent(r.operationName)}`),i.join("&")}if(typeof t.variables!="undefined"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((r,i,s)=>(r.push({query:ly(i),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),r),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},BF=t=>async e=>{var w;const{url:n,query:r,variables:i,operationName:s,fetch:o,fetchOptions:a,middleware:c}=e,u={...e.headers};let d="",h;t==="POST"?(h=jF(r,i,s,a.jsonSerializer),typeof h=="string"&&(u["Content-Type"]="application/json")):d=MF({query:r,variables:i,operationName:s,jsonSerializer:(w=a.jsonSerializer)!=null?w:Ch});const p={method:t,headers:u,body:h,...a};let y=n,v=p;if(c){const k=await Promise.resolve(c({...p,url:n,operationName:s,variables:i})),{url:C,...E}=k;y=C,v=E}return d&&(y=`${y}?${d}`),await o(y,v)};class $F{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...r)=>{const[i,s,o]=r,a=HD(i,s,o),{headers:c,fetch:u=yu,method:d="POST",requestMiddleware:h,responseMiddleware:p,...y}=this.requestConfig,{url:v}=this;a.signal!==void 0&&(y.signal=a.signal);const{operationName:w}=Rd(a.query);return Pd({url:v,query:a.query,variables:a.variables,headers:{...Zi(Dd(c)),...Zi(a.requestHeaders)},operationName:w,fetch:u,method:d,fetchOptions:y,middleware:h}).then(k=>(p&&p(k),k)).catch(k=>{throw p&&p(k),k})}}async request(e,...n){const[r,i]=n,s=qD(e,r,i),{headers:o,fetch:a=yu,method:c="POST",requestMiddleware:u,responseMiddleware:d,...h}=this.requestConfig,{url:p}=this;s.signal!==void 0&&(h.signal=s.signal);const{query:y,operationName:v}=Rd(s.document);return Pd({url:p,query:y,variables:s.variables,headers:{...Zi(Dd(o)),...Zi(s.requestHeaders)},operationName:v,fetch:a,method:c,fetchOptions:h,middleware:u}).then(w=>(d&&d(w),w.data)).catch(w=>{throw d&&d(w),w})}batchRequests(e,n){var c;const r=KD(e,n),{headers:i,...s}=this.requestConfig;r.signal!==void 0&&(s.signal=r.signal);const o=r.documents.map(({document:u})=>Rd(u).query),a=r.documents.map(({variables:u})=>u);return Pd({url:this.url,query:o,variables:a,headers:{...Zi(Dd(i)),...Zi(r.requestHeaders)},operationName:void 0,fetch:(c=this.requestConfig.fetch)!=null?c:yu,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:r}=this.requestConfig;return r?r[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const Pd=async t=>{var d,h;const{query:e,variables:n,fetchOptions:r}=t,i=BF(jD((d=t.method)!=null?d:"post")),s=Array.isArray(t.query),o=await i(t),a=await VF(o,(h=r.jsonSerializer)!=null?h:Ch),c=Array.isArray(a)?!a.some(({data:p})=>!p):!!a.data,u=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||r.errorPolicy==="all"||r.errorPolicy==="ignore";if(o.ok&&u&&c){const{errors:p,...y}=(Array.isArray(a),a),v=r.errorPolicy==="ignore"?y:a;return{...s?{data:v}:v,headers:o.headers,status:o.status}}else{const p=typeof a=="string"?{error:a}:a;throw new Po({...p,status:o.status,headers:o.headers},{query:e,variables:n})}},jF=(t,e,n,r)=>{const i=r!=null?r:Ch;if(!Array.isArray(t))return i.stringify({query:t,variables:e,operationName:n});if(typeof e!="undefined"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const s=t.reduce((o,a,c)=>(o.push({query:a,variables:e?e[c]:void 0}),o),[]);return i.stringify(s)},VF=async(t,e)=>{let n;return t.headers.forEach((r,i)=>{i.toLowerCase()==="content-type"&&(n=r)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},Dd=t=>typeof t=="function"?t():t;class o0 extends hr{constructor(){super("EVENT_CHAT_ROOM_TOKEN_ERROR","Error getting chat room connection token")}}class xc{constructor(e){Pe(this,"root",a_(this));Pe(this,"token");this.root.setProps(e)}static toDomain(e){const n={token:e.token};return new xc(n)}toPrimitives(){const{root:e,...n}=this;return{...n}}}const qF=bs.apiUrls.graphql;class a0{constructor(){Pe(this,"client");this.client=new $F(qF)}async getChatRoom(e){var i;const{getChatRoomToken:n}=await this.client.request(i_,{data:{account:e.account,idEvent:e.eventId,userName:e.userName}});this.propagateGraphqlErrorIfExists(n);const r=(i=n.data)==null?void 0:i.token;if(!r)throw new o0;return xc.toDomain({token:r})}propagateGraphqlErrorIfExists(e){if(e.__typename==="ErrorGeneral")throw new Error(e.message)}}class u0{constructor(e){Pe(this,"account");this.eventChatRoomRepository=e}async get(e){this.validateAccount();try{return await this.eventChatRoomRepository.getChatRoom({...e,account:this.account})}catch(n){throw new rh(n)}}setAccount(e){this.account=e}validateAccount(){if(!this.account)throw new Ab}}const HF=new a0,Hf=new u0(HF),Nc=Ju(void 0);Nc.debugLabel="chatSocketAtom";const Tc=Ju(!1);Tc.debugLabel="chatIsConnectedAtom";const oa=Ju([]);oa.debugLabel="chatMessageListAtom";const c0=t=>{var n;t.data=t.data.replace("replace_gif",(n=t.urlGif)!=null?n:"");const e=t.data.indexOf("::question__")>-1;if(e){const[r,i]=t.data.split("::")||["none","none"],s=i.split("question__")[1],o={response:r.replace("response__",""),question:JSON.parse(s)};return{...t,data:o.response,isResponse:e,responseData:t.data,question:e?o.question:null}}return t},l0=t=>{const{url:e,token:n,onOpen:r,onClose:i,onMessage:s,onError:o}=t,a=new WebSocket(e,n);return a.onopen=c=>r(c),a.onclose=c=>i(c),a.onerror=c=>o(c),a.onmessage=c=>s(c),a},d0=()=>{const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*16)];return e},Th=(t,e)=>{var p,y;const{Content:n,Attributes:r,Sender:{Attributes:i}}=e,{username:s,type:o,email:a}=r,{isAdmin:c}=i,u=(p=r==null?void 0:r.id)!=null?p:Uu(8),d=((y=t.find(v=>v.username===s))==null?void 0:y.color)||d0(),h={id:u,type:o,color:d,username:s,email:a,data:n,sendDate:r.sendDate,isAdmin:c==="true",responseAdmin:!1,question:null,account:r.account,idEvent:r.idEvent,urlGif:r.urlGif,ip:r.ip};return c0(h)},f0=t=>{const{eventId:e,userName:n,enabled:r=!0}=t,{accountName:i}=Qw(),[s,o]=st.useState(""),a=()=>{r&&i&&(Hf.setAccount(i),Hf.get({eventId:e,userName:n}).then(c=>{o(c.token)}))};return st.useEffect(()=>{a()},[i,r]),{getQuery:{refetch:a},token:s}},{coreLogger:KF}=pr(),un=KF.child("useConnectChatSocket"),zF=bs.publicUrls.wssIVSChat,GF=10,WF=t=>Math.min(1e4,1e3*Math.pow(2,t)),YF=(t,e,n)=>{const r=JSON.parse(t.data);switch(r.Type){case"EVENT":e==null||e(r);break;case"MESSAGE":n==null||n(r);break;case"ERROR":un.error("Chat room error:",r);break;default:un.error("Unknown chat room event:",t)}},h0=t=>{const{onMessage:e,eventId:n,enabled:r=!0,userName:i,onEvent:s}=t,{token:o,getQuery:a}=f0({eventId:n,userName:i,enabled:r}),[c,u]=vl(Nc),[d,h]=vl(Tc),[p,y]=vl(oa),v=st.useRef(0),w=st.useCallback(I=>un.error("Chat room socket error:",I),[]),k=st.useCallback(()=>{h(!0),v.current=0,un.debug("Successfully connected to the chat room")},[h]),C=st.useCallback(()=>{if(v.current>=GF){un.error("Max reconnection attempts reached. No further attempts will be made.");return}h(!1),v.current+=1;const I=WF(v.current);un.debug(`Disconnected from chat room. Reconnecting in ${I/1e3} seconds... (Attempt ${v.current})`),setTimeout(()=>a.refetch(),I)},[a,h]),E=st.useCallback(()=>{if(!o){un.debug("No token available. Connection aborted.");return}if((c==null?void 0:c.readyState)===WebSocket.OPEN){un.debug("WebSocket is already open. No need to reconnect.");return}un.debug("Connecting to the chat room...");const I=l0({token:o,url:zF,onOpen:k,onClose:C,onError:w,onMessage:M=>YF(M,s,e)});u(I)},[o,c,s,e,k,C,w,u]),O=st.useCallback(()=>{if(!c||c.readyState!==WebSocket.OPEN){un.debug("No open socket to close.");return}un.debug("Closing chat room socket..."),c.close()},[c]);return st.useEffect(()=>{if(!r){un.debug("Chat is disabled, skipping connection.");return}if(!o){un.debug("Token not available, skipping connection.");return}return un.debug("Initializing connection with token:",o),O(),E(),O},[o,r]),{socket:c,chatIsConnected:d,chatMessageList:p,setChatMessageList:y}},JF=()=>{const t=Vd(Nc),e=Vd(Tc);return{sendMessage:st.useCallback((r,i)=>{if(!t||!e)return;const s={id:i.id,sendDate:new Date,content:r,action:"SEND_MESSAGE",attributes:i},o=JSON.stringify(s);t.send(o)},[e,t])}},p0=()=>{const t=zf(oa);return{handleEvent:r=>{var i;if(r.EventName==="senddeletemessage"){const s=JSON.parse((i=r.Attributes)==null?void 0:i.data);t(o=>o.filter(a=>a.id!==s.id))}},handleMessage:r=>{t(i=>[...i,Th(i,r)])}}},XF=t=>{const{eventId:e,userName:n}=t,[r,i]=st.useState(!1),[s,o]=st.useState(),[a,c]=st.useState(),[u,d]=st.useState([]),{handleEvent:h}=p0(),p=zf(oa),y=E=>{p(O=>[Th(O,E),...O]),i(!1)},v=E=>{var O,I,M;if(h(E),E.EventName==="sendpinmessage"){const Y=JSON.parse((O=E.Attributes)==null?void 0:O.data);o({data:Y.data,id:Y.id,username:Y.username})}if(E.EventName==="sendunpinmessage"&&o(void 0),E.EventName==="sendhighlightproduct"){const Y=JSON.parse((I=E.Attributes)==null?void 0:I.data);c({products:Y.productIds,collection:Y.collection,livestreamingId:Y.idEvent})}if(E.EventName==="sendaddtocart"){const Y=JSON.parse((M=E.Attributes)==null?void 0:M.data);d(ee=>[...ee,{id:Y.id,sessionId:Y.sessionId,productId:Y.productId,productImageUrl:Y.productImageUrl,productName:Y.productName}])}},{socket:w,chatMessageList:k,setChatMessageList:C}=h0({onMessage:y,onEvent:v,eventId:e,userName:n});return{socket:w,chat:k,showLoader:r,pinnedMessage:s,highlightProduct:a,productsInCart:u,setChat:C,setShowLoader:i,setPinnedMessage:o,setProductsInCart:d}};/**
|
|
183
|
-
* @license
|
|
184
|
-
* Copyright 2019 Google LLC
|
|
185
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
186
|
-
*/const bu=globalThis,Oh=bu.ShadowRoot&&(bu.ShadyCSS===void 0||bu.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ih=Symbol(),dy=new WeakMap;let m0=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Ih)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Oh&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=dy.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&dy.set(n,e))}return e}toString(){return this.cssText}};const QF=t=>new m0(typeof t=="string"?t:t+"",void 0,Ih),ZF=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((r,i,s)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new m0(n,t,Ih)},eU=(t,e)=>{if(Oh)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),i=bu.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}},fy=Oh?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return QF(n)})(t):t;/**
|
|
187
|
-
* @license
|
|
188
|
-
* Copyright 2017 Google LLC
|
|
189
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
190
|
-
*/const{is:tU,defineProperty:nU,getOwnPropertyDescriptor:rU,getOwnPropertyNames:iU,getOwnPropertySymbols:sU,getPrototypeOf:oU}=Object,jr=globalThis,hy=jr.trustedTypes,aU=hy?hy.emptyScript:"",Fd=jr.reactiveElementPolyfillSupport,Do=(t,e)=>t,Kf={toAttribute(t,e){switch(e){case Boolean:t=t?aU:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},g0=(t,e)=>!tU(t,e),py={attribute:!0,type:String,converter:Kf,reflect:!1,hasChanged:g0};var ky,Ey;(ky=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Ey=jr.litPropertyMetadata)!=null||(jr.litPropertyMetadata=new WeakMap);class rs extends HTMLElement{static addInitializer(e){var n;this._$Ei(),((n=this.l)!=null?n:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=py){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,n);i!==void 0&&nU(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){var o;const{get:i,set:s}=(o=rU(this.prototype,e))!=null?o:{get(){return this[n]},set(a){this[n]=a}};return{get(){return i==null?void 0:i.call(this)},set(a){const c=i==null?void 0:i.call(this);s.call(this,a),this.requestUpdate(e,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var n;return(n=this.elementProperties.get(e))!=null?n:py}static _$Ei(){if(this.hasOwnProperty(Do("elementProperties")))return;const e=oU(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Do("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Do("properties"))){const n=this.properties,r=[...iU(n),...sU(n)];for(const i of r)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)n.unshift(fy(i))}else e!==void 0&&n.push(fy(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n,r;((n=this._$EO)!=null?n:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var n;(n=this._$EO)==null||n.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var n;const e=(n=this.shadowRoot)!=null?n:this.attachShadow(this.constructor.shadowRootOptions);return eU(e,this.constructor.elementStyles),e}connectedCallback(){var e,n;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(n=this._$EO)==null||n.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostDisconnected)==null?void 0:r.call(n)})}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$EC(e,n){var s;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const o=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:Kf).toAttribute(n,r.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,n){var s;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=r.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:Kf;this._$Em=i,this[i]=a.fromAttribute(n,o.type),this._$Em=null}}requestUpdate(e,n,r){var i;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((i=r.hasChanged)!=null?i:g0)(this[e],n))return;this.P(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,n,r){var i;this._$AL.has(e)||this._$AL.set(e,n),r.reflect===!0&&this._$Em!==e&&((i=this._$Ej)!=null?i:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,a]of s)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(n)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$EO)==null||n.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(e){}firstUpdated(e){}}var Ay;rs.elementStyles=[],rs.shadowRootOptions={mode:"open"},rs[Do("elementProperties")]=new Map,rs[Do("finalized")]=new Map,Fd==null||Fd({ReactiveElement:rs}),((Ay=jr.reactiveElementVersions)!=null?Ay:jr.reactiveElementVersions=[]).push("2.0.4");/**
|
|
191
|
-
* @license
|
|
192
|
-
* Copyright 2017 Google LLC
|
|
193
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
194
|
-
*/const Fo=globalThis,Wu=Fo.trustedTypes,my=Wu?Wu.createPolicy("lit-html",{createHTML:t=>t}):void 0,v0="$lit$",Dr=`lit$${Math.random().toFixed(9).slice(2)}$`,y0="?"+Dr,uU=`<${y0}>`,Ii=document,Xo=()=>Ii.createComment(""),Qo=t=>t===null||typeof t!="object"&&typeof t!="function",Rh=Array.isArray,cU=t=>Rh(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Ud=`[
|
|
195
|
-
\f\r]`,bo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gy=/-->/g,vy=/>/g,ai=RegExp(`>|${Ud}(?:([^\\s"'>=/]+)(${Ud}*=${Ud}*(?:[^
|
|
196
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),yy=/'/g,by=/"/g,b0=/^(?:script|style|textarea|title)$/i,lU=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),dU=lU(1),vs=Symbol.for("lit-noChange"),Bt=Symbol.for("lit-nothing"),wy=new WeakMap,bi=Ii.createTreeWalker(Ii,129);function w0(t,e){if(!Rh(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return my!==void 0?my.createHTML(e):e}const fU=(t,e)=>{const n=t.length-1,r=[];let i,s=e===2?"<svg>":e===3?"<math>":"",o=bo;for(let a=0;a<n;a++){const c=t[a];let u,d,h=-1,p=0;for(;p<c.length&&(o.lastIndex=p,d=o.exec(c),d!==null);)p=o.lastIndex,o===bo?d[1]==="!--"?o=gy:d[1]!==void 0?o=vy:d[2]!==void 0?(b0.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=ai):d[3]!==void 0&&(o=ai):o===ai?d[0]===">"?(o=i!=null?i:bo,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,u=d[1],o=d[3]===void 0?ai:d[3]==='"'?by:yy):o===by||o===yy?o=ai:o===gy||o===vy?o=bo:(o=ai,i=void 0);const y=o===ai&&t[a+1].startsWith("/>")?" ":"";s+=o===bo?c+uU:h>=0?(r.push(u),c.slice(0,h)+v0+c.slice(h)+Dr+y):c+Dr+(h===-2?a:y)}return[w0(t,s+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class Zo{constructor({strings:e,_$litType$:n},r){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[u,d]=fU(e,n);if(this.el=Zo.createElement(u,r),bi.currentNode=this.el.content,n===2||n===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=bi.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(v0)){const p=d[o++],y=i.getAttribute(h).split(Dr),v=/([.?@])?(.*)/.exec(p);c.push({type:1,index:s,name:v[2],strings:y,ctor:v[1]==="."?pU:v[1]==="?"?mU:v[1]==="@"?gU:Oc}),i.removeAttribute(h)}else h.startsWith(Dr)&&(c.push({type:6,index:s}),i.removeAttribute(h));if(b0.test(i.tagName)){const h=i.textContent.split(Dr),p=h.length-1;if(p>0){i.textContent=Wu?Wu.emptyScript:"";for(let y=0;y<p;y++)i.append(h[y],Xo()),bi.nextNode(),c.push({type:2,index:++s});i.append(h[p],Xo())}}}else if(i.nodeType===8)if(i.data===y0)c.push({type:2,index:s});else{let h=-1;for(;(h=i.data.indexOf(Dr,h+1))!==-1;)c.push({type:7,index:s}),h+=Dr.length-1}s++}}static createElement(e,n){const r=Ii.createElement("template");return r.innerHTML=e,r}}function ys(t,e,n=t,r){var o,a,c;if(e===vs)return e;let i=r!==void 0?(o=n.o)==null?void 0:o[r]:n.l;const s=Qo(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,n,r)),r!==void 0?((c=n.o)!=null?c:n.o=[])[r]=i:n.l=i),i!==void 0&&(e=ys(t,i._$AS(t,e.values),i,r)),e}class hU{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var u;const{el:{content:n},parts:r}=this._$AD,i=((u=e==null?void 0:e.creationScope)!=null?u:Ii).importNode(n,!0);bi.currentNode=i;let s=bi.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let d;c.type===2?d=new aa(s,s.nextSibling,this,e):c.type===1?d=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(d=new vU(s,this,e)),this._$AV.push(d),c=r[++a]}o!==(c==null?void 0:c.index)&&(s=bi.nextNode(),o++)}return bi.currentNode=Ii,i}p(e){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}}class aa{get _$AU(){var e,n;return(n=(e=this._$AM)==null?void 0:e._$AU)!=null?n:this.v}constructor(e,n,r,i){var s;this.type=2,this._$AH=Bt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this.v=(s=i==null?void 0:i.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=ys(this,e,n),Qo(e)?e===Bt||e==null||e===""?(this._$AH!==Bt&&this._$AR(),this._$AH=Bt):e!==this._$AH&&e!==vs&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):cU(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Bt&&Qo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ii.createTextNode(e)),this._$AH=e}$(e){var s;const{values:n,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Zo.createElement(w0(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(n);else{const o=new hU(i,this),a=o.u(this.options);o.p(n),this.T(a),this._$AH=o}}_$AC(e){let n=wy.get(e.strings);return n===void 0&&wy.set(e.strings,n=new Zo(e)),n}k(e){Rh(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,i=0;for(const s of e)i===n.length?n.push(r=new aa(this.O(Xo()),this.O(Xo()),this,this.options)):r=n[i],r._$AI(s),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,n);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var n;this._$AM===void 0&&(this.v=e,(n=this._$AP)==null||n.call(this,e))}}class Oc{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,r,i,s){this.type=1,this._$AH=Bt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Bt}_$AI(e,n=this,r,i){const s=this.strings;let o=!1;if(s===void 0)e=ys(this,e,n,0),o=!Qo(e)||e!==this._$AH&&e!==vs,o&&(this._$AH=e);else{const a=e;let c,u;for(e=s[0],c=0;c<s.length-1;c++)u=ys(this,a[r+c],n,c),u===vs&&(u=this._$AH[c]),o||(o=!Qo(u)||u!==this._$AH[c]),u===Bt?e=Bt:e!==Bt&&(e+=(u!=null?u:"")+s[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===Bt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}}class pU extends Oc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Bt?void 0:e}}class mU extends Oc{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Bt)}}class gU extends Oc{constructor(e,n,r,i,s){super(e,n,r,i,s),this.type=5}_$AI(e,n=this){var o;if((e=(o=ys(this,e,n,0))!=null?o:Bt)===vs)return;const r=this._$AH,i=e===Bt&&r!==Bt||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==Bt&&(r===Bt||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var n,r;typeof this._$AH=="function"?this._$AH.call((r=(n=this.options)==null?void 0:n.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}}class vU{constructor(e,n,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){ys(this,e)}}const Ld=Fo.litHtmlPolyfillSupport;var Cy;Ld==null||Ld(Zo,aa),((Cy=Fo.litHtmlVersions)!=null?Cy:Fo.litHtmlVersions=[]).push("3.2.0");const yU=(t,e,n)=>{var s,o;const r=(s=n==null?void 0:n.renderBefore)!=null?s:e;let i=r._$litPart$;if(i===void 0){const a=(o=n==null?void 0:n.renderBefore)!=null?o:null;r._$litPart$=i=new aa(e.insertBefore(Xo(),a),a,void 0,n!=null?n:{})}return i._$AI(t),i};/**
|
|
197
|
-
* @license
|
|
198
|
-
* Copyright 2017 Google LLC
|
|
199
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
200
|
-
*/class Uo extends rs{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var n,r;const e=super.createRenderRoot();return(r=(n=this.renderOptions).renderBefore)!=null||(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=yU(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return vs}}var xy;Uo._$litElement$=!0,Uo.finalized=!0,(xy=globalThis.litElementHydrateSupport)==null||xy.call(globalThis,{LitElement:Uo});const Md=globalThis.litElementPolyfillSupport;Md==null||Md({LitElement:Uo});var Ny;((Ny=globalThis.litElementVersions)!=null?Ny:globalThis.litElementVersions=[]).push("4.1.0");/**
|
|
201
|
-
* @license
|
|
202
|
-
* Copyright 2020 Google LLC
|
|
203
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
204
|
-
*/const bU=t=>t.strings===void 0;/**
|
|
205
|
-
* @license
|
|
206
|
-
* Copyright 2017 Google LLC
|
|
207
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
208
|
-
*/const wU={CHILD:2},_U=t=>(...e)=>({_$litDirective$:t,values:e});class SU{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,r){this.t=e,this._$AM=n,this.i=r}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}}/**
|
|
209
|
-
* @license
|
|
210
|
-
* Copyright 2017 Google LLC
|
|
211
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
212
|
-
*/const Lo=(t,e)=>{var r;const n=t._$AN;if(n===void 0)return!1;for(const i of n)(r=i._$AO)==null||r.call(i,e,!1),Lo(i,e);return!0},Yu=t=>{let e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n==null?void 0:n.size)===0)},_0=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),AU(e)}};function kU(t){this._$AN!==void 0?(Yu(this),this._$AM=t,_0(this)):this._$AM=t}function EU(t,e=!1,n=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=n;s<r.length;s++)Lo(r[s],!1),Yu(r[s]);else r!=null&&(Lo(r,!1),Yu(r));else Lo(this,t)}const AU=t=>{var e,n;t.type==wU.CHILD&&((e=t._$AP)!=null||(t._$AP=EU),(n=t._$AQ)!=null||(t._$AQ=kU))};class CU extends SU{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,r){super._$AT(e,n,r),_0(this),this.isConnected=e._$AU}_$AO(e,n=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),n&&(Lo(this,e),Yu(this))}setValue(e){if(bU(this.t))this.t._$AI(e,this);else{const n=[...this.t._$AH];n[this.i]=e,this.t._$AI(n,this,0)}}disconnected(){}reconnected(){}}/**
|
|
213
|
-
* @license
|
|
214
|
-
* Copyright 2020 Google LLC
|
|
215
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
216
|
-
*/const xU=()=>new NU;class NU{}const Bd=new WeakMap,TU=_U(class extends CU{render(t){return Bt}update(t,[e]){var r;const n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=(r=t.options)==null?void 0:r.host,this.rt(this.ct=t.element)),Bt}rt(t){var e;if(this.isConnected||(t=void 0),typeof this.Y=="function"){const n=(e=this.ht)!=null?e:globalThis;let r=Bd.get(n);r===void 0&&(r=new WeakMap,Bd.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e,n;return typeof this.Y=="function"?(e=Bd.get((t=this.ht)!=null?t:globalThis))==null?void 0:e.get(this.Y):(n=this.Y)==null?void 0:n.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Za={},_y;function OU(){if(_y)return Za;_y=1;var t=Z0;return Za.createRoot=t.createRoot,Za.hydrateRoot=t.hydrateRoot,Za}var IU=OU();class S0 extends Uo{constructor(){super(...arguments);Pe(this,"rootRef",xU());Pe(this,"rootInstance")}render(){return dU`<div ${TU(this.rootRef)}></div>`}updated(){this.updateReactComponent()}updateReactComponent(){if(!this.rootRef.value)return;this.rootInstance||(this.rootInstance=IU.createRoot(this.rootRef.value));const n=st.createElement(this.getReactComponent(),this.getReactProps(),st.createElement("slot"));this.rootInstance.render(n)}handleHMR(n){}injectStyles(n){const r=i=>i.replace("./","");for(const[i,s]of Object.entries(n)){const o=r(i),a=document.createElement("style");a.setAttribute("type","text/css"),a.setAttribute("id",o),a.innerHTML=s,setTimeout(()=>{var c;return(c=this.shadowRoot)==null?void 0:c.appendChild(a)})}}setupHMRListener(){}}Pe(S0,"baseStyles",ZF`
|
|
217
|
-
:host {
|
|
218
|
-
width: 100%;
|
|
219
|
-
}
|
|
220
|
-
`);class k0{constructor(e,n,r){Pe(this,"_lifecycleHandlers",new Map([["mount",new Set],["update",new Set],["unmount",new Set]]));Pe(this,"_containerId");Pe(this,"_renderHandler");Pe(this,"_logger");Pe(this,"element",null);Pe(this,"updateProps");Pe(this,"unmount");this._containerId=e,this._renderHandler=n,this._logger=r}async render(e={}){var n;if(this.element)this.updateProps(e);else{this._logger.debug("mounting component",e);const r=await this._renderHandler(this._containerId,e);this.element=(n=r==null?void 0:r.element)!=null?n:null,this.updateProps=i=>{r==null||r.updateProps(i),this._logger.debug("updating props",i),this._trigger("update",i)},this.unmount=()=>{this._logger.debug("unmounting component"),r==null||r.unmount(),this._trigger("unmount"),this.element=null},this._trigger("mount")}}onMount(e){return this._lifecycleHandlers.get("mount").add(e),this}onUpdate(e){return this._lifecycleHandlers.get("update").add(e),this}onUnmount(e){return this._lifecycleHandlers.get("unmount").add(e),this}_trigger(e,n){this._lifecycleHandlers.get(e).forEach(i=>i(n))}}class Ic{constructor(e){this.config=e}static isApplicable(e){return yh.LOCAL===e.bundler.stage}async execute(){var n;const{runtime:e}=this.config;(n=e.env)!=null&&n.account?await e.configureStore(e.env):e.logger.warn("missing account in local environment")}}Pe(Ic,"type",mr.Local);const RU=window==null?void 0:window.__NZ_APP__;class Ph{constructor(e){this.config=e}static isApplicable(){return RU==="platform"}async execute(){}}Pe(Ph,"type",mr.Platform);const eu=window==null?void 0:window.faststore_sdk_stores;class Dh{constructor(e){this.config=e;const n={vtexfaststore:eu};this.config.runtime.updateMeta(n)}static isApplicable(){return!!eu}async execute(){const{runtime:e}=this.config;if(!eu.account){e.logger.error("missing the account in window.faststore_sdk_stores");return}await e.configureStore({account:eu.account})}}Pe(Dh,"type",mr.VtexFastStore);const tu=window==null?void 0:window.__RUNTIME__;class Rc{constructor(e){this.config=e;const n={vtexio:tu};this.config.runtime.updateMeta(n)}static isApplicable(){return!!tu}async execute(){const{runtime:e}=this.config;if(!tu.account){e.logger.error("missing the account in window.__RUNTIME__");return}await e.configureStore({account:tu.account})}}Pe(Rc,"type",mr.VtexIO);const Sy=window==null?void 0:window.vtexjs;class Pc{constructor(e){this.config=e;const n={vtexjs:Sy};this.config.runtime.updateMeta(n)}static isApplicable(){return!!Sy}async execute(){const{runtime:e}=this.config;let n={};const r=`${e.componentId.value}-script`,i=Iw(r);if(n=Object.fromEntries(i.entries()),!n.account){e.logger.error(`missing the account in the search params of the script #${r}`);return}await e.configureStore({account:n.account})}}Pe(Pc,"type",mr.VtexLegacy);class Fh{constructor(e){this.config=e}static isApplicable(e){return!Ic.isApplicable(e)&&!Rc.isApplicable()&&!Pc.isApplicable()&&!Dh.isApplicable()&&!Ph.isApplicable()}async execute(){}}Pe(Fh,"type",mr.External);const E0=[Ic,Rc,Pc,Fh,Dh,Ph];class PU{constructor(e){Pe(this,"globalId");Pe(this,"metadata");Pe(this,"customConfigList");Pe(this,"env");Pe(this,"bundler");Pe(this,"logger");Pe(this,"componentId");Pe(this,"renderHandler");Pe(this,"store");this.globalId=e.globalId,this.store=e.getStore(),this.logger=e.logger.child("Runtime"),this.env=e.env,this.bundler=e.bundler,this.customConfigList=new Map,this.metadata={type:mr.External},this.initializeGlobals()}config(e,n,r){typeof n=="function"&&(r=n,n={});const{skipBaseBehavior:i=!1}=n;return this.customConfigList.set(e,{callback:r,skipBaseBehavior:i}),this}registerComponent(e,n){const r=this.toCamel(e);if(window[this.globalId][r])return this.logger.debug(`Component "${r}" is already registered.`),this;this.componentId={value:e,formatted:r},this.renderHandler=n;const i={render:this.renderHandler};return window[this.globalId][this.componentId.formatted]=i,this.logger.debug(`Component "${r}" registered.`),this}async execute(e){for(const n of E0)if(n.isApplicable(this)){const r=new n({runtime:this}),i=this.customConfigList.get(n.type);this.updateMeta({type:n.type}),i!=null&&i.skipBaseBehavior||await r.execute(),i&&await i.callback({runtime:this,component:new k0(this.componentId.value,this.renderHandler,this.logger)});break}await(e==null?void 0:e())}updateMeta(e){this.metadata={...this.metadata,...e}}async configureStore(e){await this.store.configure(e)}get meta(){return this.metadata}initializeGlobals(){var r;if(window[this.globalId]||(window[this.globalId]={},this.logger.debug(`Initialized "${this.globalId}" window object`)),(r=window[this.globalId])!=null&&r.runtime){this.logger.debug(`Runtime for "${this.globalId}" are already initialized.`);return}const e=()=>Object.freeze({...this.metadata}),n=()=>Object.freeze({isProd:this.bundler.isProd,get meta(){return e()}});Object.defineProperty(window[this.globalId],"runtime",{get:()=>n()}),this.logger.debug(`Initialized runtime for "${this.globalId}".`)}toCamel(e){return e.replace(/^[a-z]{2}-/,"").replace(/-./g,n=>n[1].toUpperCase())}}exports.AccountContractStatusTypes=Vw;exports.AccountContractTypes=jw;exports.AccountInvalidError=Ab;exports.AccountNotFoundError=vh;exports.AccountPlanDescriptionTypes=Hw;exports.AccountService=Jw;exports.AccountSubscriptionTypes=qw;exports.AccountTypes=$w;exports.AddToCartActionTypes=vc;exports.AggregateRoot=o_;exports.ApiGraphqlTypes=HI;exports.BaseDB=bw;exports.BroadcastChannelEventBus=ww;exports.ComponentManager=k0;exports.CreatePlanError=Gw;exports.DependencyInjector=Ah;exports.DomainError=hr;exports.ErrorCodes=Xt;exports.EventBusWildcards=gO;exports.EventChatRoom=xc;exports.EventChatRoomService=u0;exports.EventChatRoomTokenError=o0;exports.EventNames=Sw;exports.ExternalRuntime=Fh;exports.GlobalPageSectionTypes=Kw;exports.GraphqlEventChatRoomRepository=a0;exports.HttpAxiosClient=XP;exports.InvalidNizzaGlobalObjectError=Cb;exports.LanguageTypes=kw;exports.LocalRuntime=Ic;exports.LogLevel=Rt;exports.LogLevelPriority=At;exports.Logger=Nw;exports.MAX_PRODUCTS_IN_CART=mO;exports.NizzaEventStatus=_w;exports.NizzaProductRequestOriginTypes=Cw;exports.NizzaStore=Lu;exports.NizzaVariationTypes=Aw;exports.PlanNotFoundError=zw;exports.PriorityToLogLevelMap=Ew;exports.ReactHostElement=S0;exports.ResourceNotFoundError=aN;exports.RestAccountPlanRepository=Ww;exports.RestPublicAccountRepository=Yw;exports.Runtime=PU;exports.RuntimeStage=yh;exports.RuntimeType=mr;exports.Scope=yi;exports.StoreProvider=ZT;exports.UnexpectedError=rh;exports.ValueObject=XI;exports.VtexIORuntime=Rc;exports.VtexLegacyRuntime=Pc;exports.accountAtom=Dy;exports.accountService=Xw;exports.addQuestionData=c0;exports.addToCartMessages=Of;exports.apiCall=RO;exports.applyScopeInternal=H_;exports.buildLanguageTranslations=K_;exports.buildTranslations=z_;exports.chatIsConnectedAtom=Tc;exports.chatMessageListAtom=oa;exports.chatSocketAtom=Nc;exports.connectToSocket=l0;exports.createActionFactory=s_;exports.createAggregateRoot=a_;exports.createNizzaLogger=xO;exports.createPinoLogger=Tw;exports.createStore=KI;exports.customFetch=xi;exports.downloadFile=UO;exports.eventChatRoomService=Hf;exports.fileOrigin=OO;exports.getAccount=Zw;exports.getBrandiTagInternal=Eh;exports.getClientMetadata=Bw;exports.getClientTimeZone=Mw;exports.getNizza=pr;exports.getRandomColor=d0;exports.getScriptParams=Iw;exports.getStore=tO;exports.getTokenInternal=ns;exports.getUserFriendlyMessage=F_;exports.i18Init=Y_;exports.isClassProvider=$_;exports.isFactoryProvider=V_;exports.isOptionalDependencyDef=kh;exports.isValueProvider=j_;exports.jsDownload=Dw;exports.key=QP;exports.normalizeChatMessage=Th;exports.optional=eD;exports.registerTranslations=BD;exports.registerTranslationsOf=G_;exports.resolveConditionInternal=q_;exports.resolveDependenciesInternal=$f;exports.runAddToCartHooks=GI;exports.runtimeList=E0;exports.searchParams=Ow;exports.shortId=Uu;exports.sleep=IO;exports.tag=ZP;exports.tokens=tD;exports.useAccount=Qw;exports.useAutorun=XT;exports.useChatSocketActions=JF;exports.useChatSocketClient=XF;exports.useChatSocketHandlers=p0;exports.useConnectChatSocket=h0;exports.useEventChatRoom=f0;exports.useMetaDataClient=$D;exports.useNZ=Rw;exports.useNizza=Pw;exports.useReaction=QT;exports.useSelect=yw;exports.useStore=eO;exports.validateRequiredProps=uN;
|
|
221
|
-
//# sourceMappingURL=index.cjs.map
|