@nizza/core 0.7.0 → 0.7.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/dist/index.cjs +157 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +23374 -10544
- package/dist/index.mjs.map +1 -1
- package/dist/lib/accounts/core/domain/repositories/account-plan.repository.d.ts +1 -1
- package/dist/lib/accounts/core/domain/repositories/account-plan.repository.d.ts.map +1 -1
- package/dist/lib/accounts/core/domain/repositories/private-account.repository.d.ts +1 -1
- package/dist/lib/accounts/core/domain/repositories/private-account.repository.d.ts.map +1 -1
- package/dist/lib/accounts/core/infrastructure/repositories/rest-account-plan.repository.d.ts +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 +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 +1 -1
- package/dist/lib/accounts/core/infrastructure/repositories/rest-public-account.repository.d.ts.map +1 -1
- package/dist/lib/accounts/core/services/account.service.d.ts +1 -1
- package/dist/lib/accounts/core/services/account.service.d.ts.map +1 -1
- package/dist/lib/accounts/utils/getAccount.d.ts +1 -1
- package/dist/lib/accounts/utils/getAccount.d.ts.map +1 -1
- package/dist/lib/nizza-store/NizzaStore.d.ts +52 -17
- package/dist/lib/nizza-store/NizzaStore.d.ts.map +1 -1
- package/dist/lib/types/api-graphql-types.d.ts +1 -0
- package/dist/lib/types/api-graphql-types.d.ts.map +1 -1
- package/dist/lib/types/utils.d.ts +2 -0
- package/dist/lib/types/utils.d.ts.map +1 -1
- package/dist/lib/utils/customFetch.d.ts +22 -8
- package/dist/lib/utils/customFetch.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
|
-
"use strict";var hg=Object.defineProperty;var pg=(t,e,n)=>e in t?hg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var me=(t,e,n)=>pg(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const je=require("react"),mg=require("react/jsx-runtime"),gg=require("react-dom");function vg(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Zt={};let yg=0;function Da(t,e){const n=`atom${++yg}`,i={toString(){return(Zt?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?i.read=t:(i.init=t,i.read=bg,i.write=kg),i}function bg(t){return t(this)}function kg(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const Mc=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Qo=t=>"init"in t,Zo=t=>!!t.write,da=new WeakMap,Hu=t=>{var e;return qu(t)&&!((e=da.get(t))!=null&&e[1])},_g=(t,e)=>{const n=da.get(t);if(n)n[1]=!0,n[0].forEach(i=>i(e));else if((Zt?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},wg=t=>{if(da.has(t))return;const e=[new Set,!1];da.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=i=>{e[0].add(i)}},qu=t=>typeof(t==null?void 0:t.then)=="function",Bc=t=>"v"in t||"e"in t,Hs=t=>{if("e"in t)throw t.e;if((Zt?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},$f=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},Uc=(t,e,n,i,r)=>{var s;if((Zt?"production":void 0)!=="production"&&i===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(i,r.n),Hu(n.v)&&$f(e,n.v,r),(s=r.m)==null||s.t.add(e),t&&Sg(t,i,e)},Li=()=>[new Map,new Map,new Set],eu=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},Sg=(t,e,n)=>{const i=t[0].get(e);i&&i.add(n)},Eg=(t,e)=>t[0].get(e),jc=(t,e)=>{t[2].add(e)},ui=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(i=>{var r;return(r=i.m)==null?void 0:r.l.forEach(s=>s())}),n.forEach(i=>i())}},Mf=t=>{let e;(Zt?"production":void 0)!=="production"&&(e=new Set);const n=(S,E,R)=>{const j="v"in E,J=E.v,z=Hu(E.v)?E.v:null;if(qu(R)){wg(R);for(const X of E.d.keys())$f(S,R,t(X,E));E.v=R,delete E.e}else E.v=R,delete E.e;(!j||!Object.is(J,E.v))&&(++E.n,z&&_g(z,R))},i=(S,E,R,j)=>{var J;if(!(j!=null&&j(E))&&Bc(R)&&(R.m||Array.from(R.d).every(([ve,ze])=>i(S,ve,t(ve,R),j).n===ze)))return R;R.d.clear();let z=!0;const X=ve=>{if(Mc(E,ve)){const Ne=t(ve,R);if(!Bc(Ne))if(Qo(ve))n(ve,Ne,ve.init);else throw new Error("no atom init");return Hs(Ne)}const ze=i(S,ve,t(ve,R),j);if(z)Uc(S,E,R,ve,ze);else{const Ne=Li();Uc(Ne,E,R,ve,ze),h(Ne,E,R),ui(Ne)}return Hs(ze)};let ne,oe;const Se={get signal(){return ne||(ne=new AbortController),ne.signal},get setSelf(){return(Zt?"production":void 0)!=="production"&&!Zo(E)&&console.warn("setSelf function cannot be used with read-only atom"),!oe&&Zo(E)&&(oe=(...ve)=>{if((Zt?"production":void 0)!=="production"&&z&&console.warn("setSelf function cannot be called in sync"),!z)return d(E,...ve)}),oe}};try{const ve=E.read(X,Se);if(n(E,R,ve),qu(ve)){(J=ve.onCancel)==null||J.call(ve,()=>ne==null?void 0:ne.abort());const ze=()=>{if(R.m){const Ne=Li();h(Ne,E,R),ui(Ne)}};ve.then(ze,ze)}return R}catch(ve){return delete R.v,R.e=ve,++R.n,R}finally{z=!1}},r=S=>Hs(i(void 0,S,t(S))),s=(S,E,R)=>{var j,J;const z=new Map;for(const X of((j=R.m)==null?void 0:j.t)||[])z.set(X,t(X,R));for(const X of R.p)z.set(X,t(X,R));return(J=Eg(S,E))==null||J.forEach(X=>{z.set(X,t(X,R))}),z},o=(S,E,R)=>{const j=[],J=new Set,z=(oe,Se)=>{if(!J.has(oe)){J.add(oe);for(const[ve,ze]of s(S,oe,Se))oe!==ve&&z(ve,ze);j.push([oe,Se,Se.n])}};z(E,R);const X=new Set([E]),ne=oe=>J.has(oe);for(let oe=j.length-1;oe>=0;--oe){const[Se,ve,ze]=j[oe];let Ne=!1;for(const Re of ve.d.keys())if(Re!==Se&&X.has(Re)){Ne=!0;break}Ne&&(i(S,Se,ve,ne),h(S,Se,ve),ze!==ve.n&&(eu(S,Se,ve),X.add(Se))),J.delete(Se)}},l=(S,E,R,...j)=>{const J=ne=>Hs(i(S,ne,t(ne,R))),z=(ne,...oe)=>{const Se=t(ne,R);let ve;if(Mc(E,ne)){if(!Qo(ne))throw new Error("atom not writable");const ze="v"in Se,Ne=Se.v,Re=oe[0];n(ne,Se,Re),h(S,ne,Se),(!ze||!Object.is(Ne,Se.v))&&(eu(S,ne,Se),o(S,ne,Se))}else ve=l(S,ne,Se,...oe);return ui(S),ve};return E.write(J,z,...j)},d=(S,...E)=>{const R=Li(),j=l(R,S,t(S),...E);return ui(R),j},h=(S,E,R)=>{if(R.m&&!Hu(R.v)){for(const j of R.d.keys())R.m.d.has(j)||(m(S,j,t(j,R)).t.add(E),R.m.d.add(j));for(const j of R.m.d||[])if(!R.d.has(j)){R.m.d.delete(j);const J=y(S,j,t(j,R));J==null||J.t.delete(E)}}},m=(S,E,R)=>{if(!R.m){i(S,E,R);for(const j of R.d.keys())m(S,j,t(j,R)).t.add(E);if(R.m={l:new Set,d:new Set(R.d.keys()),t:new Set},(Zt?"production":void 0)!=="production"&&e.add(E),Zo(E)&&E.onMount){const j=R.m,{onMount:J}=E;jc(S,()=>{const z=J((...X)=>l(S,E,R,...X));z&&(j.u=z)})}}return R.m},y=(S,E,R)=>{if(R.m&&!R.m.l.size&&!Array.from(R.m.t).some(j=>{var J;return(J=t(j,R).m)==null?void 0:J.d.has(E)})){const j=R.m.u;j&&jc(S,j),delete R.m,(Zt?"production":void 0)!=="production"&&e.delete(E);for(const J of R.d.keys()){const z=y(S,J,t(J,R));z==null||z.t.delete(E)}return}return R.m},_={get:r,set:d,sub:(S,E)=>{const R=Li(),j=t(S),J=m(R,S,j);ui(R);const z=J.l;return z.add(E),()=>{z.delete(E);const X=Li();y(X,S,j),ui(X)}},unstable_derive:S=>Mf(...S(t))};return(Zt?"production":void 0)!=="production"&&Object.assign(_,{dev4_get_internal_weak_map:()=>({get:E=>{const R=t(E);if(R.n!==0)return R}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:E=>{const R=Li();for(const[j,J]of E)if(Qo(j)){const z=t(j),X="v"in z,ne=z.v;n(j,z,J),h(R,j,z),(!X||!Object.is(ne,z.v))&&(eu(R,j,z),o(R,j,z))}ui(R)}}),_},Ng=()=>{const t=new WeakMap;return Mf(n=>{let i=t.get(n);return i||(i={d:new Map,p:new Set,n:0},t.set(n,i)),i})};let Nr;const Ag=()=>(Nr||(Nr=Ng(),(Zt?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Nr),globalThis.__JOTAI_DEFAULT_STORE__!==Nr&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Nr),Bf={},Og=je.createContext(void 0),Uf=t=>je.useContext(Og)||Ag(),jf=t=>typeof(t==null?void 0:t.then)=="function",xg=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},Tg=je.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(xg(t),t)}),tu=new WeakMap,Cg=t=>{let e=tu.get(t);return e||(e=new Promise((n,i)=>{let r=t;const s=d=>h=>{r===d&&n(h)},o=d=>h=>{r===d&&i(h)},l=d=>{"onCancel"in d&&typeof d.onCancel=="function"&&d.onCancel(h=>{if((Bf?"production":void 0)!=="production"&&h===d)throw new Error("[Bug] p is not updated even after cancelation");jf(h)?(tu.set(h,e),r=h,h.then(s(h),o(h)),l(h)):n(h)})};t.then(s(t),o(t)),l(t)}),tu.set(t,e)),e};function zu(t,e){const n=Uf(),[[i,r,s],o]=je.useReducer(h=>{const m=n.get(t);return Object.is(h[0],m)&&h[1]===n&&h[2]===t?h:[m,n,t]},void 0,()=>[n.get(t),n,t]);let l=i;if((r!==n||s!==t)&&(o(),l=n.get(t)),je.useEffect(()=>{const h=n.sub(t,()=>{o()});return o(),h},[n,t,void 0]),je.useDebugValue(l),jf(l)){const h=Cg(l);return Tg(h)}return l}function xl(t,e){const n=Uf();return je.useCallback((...r)=>{if((Bf?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function nu(t,e){return[zu(t),xl(t)]}const Vf=Da(null);Vf.debugLabel="accountAtom";const Rg={},{NZ_BACKOFFICE_BACK_URL:Fg,NZ_CORE_SERVICES_GRAPHQL_URL:Ig,NZ_CORE_SERVICES_REST_URL:Dg}=Rg,rr={apiUrls:{restV1:Fg||"https://b133h34s56.execute-api.us-east-1.amazonaws.com",restV2:Dg||"https://core-services-prod.nizza.com/api",graphql:Ig||"https://core-services-prod.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};async function vi(t){const{url:e,method:n="GET",body:i,raw:r=!1,contentTypeJson:s=!0,timeout:o,...l}=t,d=new Headers({...s?{"content-type":"application/json"}:{},...t.headers}),h=new AbortController,{signal:m}=h;let y;const g=fetch(e,{method:n,headers:d,body:i,signal:m,...l});o&&(y=setTimeout(()=>{h.abort()},o));const O=await g;if(r)return O;const _=await O.json();if(clearTimeout(y),!O.ok){const S=_?JSON.stringify(_):O.statusText;throw new Error(S)}return _}const Pg=t=>vi({...t,contentTypeJson:!1,raw:!1});function Lg(t,e,n){fetch(e).then(i=>i.blob()).then(i=>Hf(i,`${t}.${n}`))}const Hf=(t,e,n)=>{const i=[t],r=new Blob(i,{type:n!=null?n:"application/octet-stream"});if(typeof window.navigator.msSaveBlob!="undefined")return window.navigator.msSaveBlob(r,e);const s=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(r):window.webkitURL.createObjectURL(r),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 $g="2.0.3",Ku=500,Vc="user-agent",Xi="",Hc="?",fa="function",qn="undefined",Qi="object",Gu="string",Ft="browser",kn="cpu",dn="device",en="engine",Gt="os",Ji="result",ee="name",W="type",Z="vendor",te="version",It="architecture",Qr="major",Q="model",Br="console",Pe="mobile",Qe="tablet",gt="smarttv",cn="wearable",iu="xr",Ur="embedded",Ar="inapp",Tl="brands",di="formFactors",Cl="fullVersionList",Yi="platform",Rl="platformVersion",Pa="bitness",Xn="sec-ch-ua",Mg=Xn+"-full-version-list",Bg=Xn+"-arch",Ug=Xn+"-"+Pa,jg=Xn+"-form-factors",Vg=Xn+"-"+Pe,Hg=Xn+"-"+Q,qf=Xn+"-"+Yi,qg=qf+"-version",zf=[Tl,Cl,Pe,Q,Yi,Rl,It,di,Pa],qs="Amazon",$i="Apple",qc="ASUS",zc="BlackBerry",li="Google",Kc="Huawei",Gc="Lenovo",Wc="Honor",zs="LG",ru="Microsoft",su="Motorola",au="Nvidia",Jc="OnePlus",ou="OPPO",Or="Samsung",Yc="Sharp",xr="Sony",uu="Xiaomi",lu="Zebra",Xc="Chrome",Qc="Chromium",Bn="Chromecast",zg="Edge",Tr="Firefox",Cr="Opera",cu="Facebook",Zc="Sogou",Mi="Mobile ",Rr=" Browser",Wu="Windows",Kg=typeof window!==qn,Dt=Kg&&window.navigator?window.navigator:void 0,jn=Dt&&Dt.userAgentData?Dt.userAgentData:void 0,Gg=function(t,e){var n={},i=e;if(!ha(e)){i={};for(var r in e)for(var s in e[r])i[s]=e[r][s].concat(i[s]?i[s]:[])}for(var o in t)n[o]=i[o]&&i[o].length%2===0?i[o].concat(t[o]):t[o];return n},La=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},Ju=function(t,e){if(typeof t===Qi&&t.length>0){for(var n in t)if(Sn(t[n])==Sn(e))return!0;return!1}return sr(t)?Sn(e).indexOf(Sn(t))!==-1:!1},ha=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?ha(t[n]):!1)},sr=function(t){return typeof t===Gu},du=function(t){if(t){for(var e=[],n=Zi(/\\?\"/g,t).split(","),i=0;i<n.length;i++)if(n[i].indexOf(";")>-1){var r=Zr(n[i]).split(";v=");e[i]={brand:r[0],version:r[1]}}else e[i]=Zr(n[i]);return e}},Sn=function(t){return sr(t)?t.toLowerCase():t},fu=function(t){return sr(t)?Zi(/[^\d\.]/g,t).split(".")[0]:void 0},En=function(t){for(var e in t){var n=t[e];typeof n==Qi&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Zi=function(t,e){return sr(e)?e.replace(t,Xi):e},Fr=function(t){return Zi(/\\?\"/g,t)},Zr=function(t,e){if(sr(t))return t=Zi(/^\s\s*/,t),typeof e===qn?t:t.substring(0,Ku)},hu=function(t,e){if(!(!t||!e))for(var n=0,i,r,s,o,l,d;n<e.length&&!l;){var h=e[n],m=e[n+1];for(i=r=0;i<h.length&&!l&&h[i];)if(l=h[i++].exec(t),l)for(s=0;s<m.length;s++)d=l[++r],o=m[s],typeof o===Qi&&o.length>0?o.length===2?typeof o[1]==fa?this[o[0]]=o[1].call(this,d):this[o[0]]=o[1]:o.length===3?typeof o[1]===fa&&!(o[1].exec&&o[1].test)?this[o[0]]=d?o[1].call(this,d,o[2]):void 0:this[o[0]]=d?d.replace(o[1],o[2]):void 0:o.length===4&&(this[o[0]]=d?o[3].call(this,d.replace(o[1],o[2])):void 0):this[o]=d||void 0;n+=2}},Vn=function(t,e){for(var n in e)if(typeof e[n]===Qi&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(Ju(e[n][i],t))return n===Hc?void 0:n}else if(Ju(e[n],t))return n===Hc?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},ed={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"},td={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},nd={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[te,[ee,Mi+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[te,[ee,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[ee,te],[/opios[\/ ]+([\w\.]+)/i],[te,[ee,Cr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[te,[ee,Cr+" GX"]],[/\bopr\/([\w\.]+)/i],[te,[ee,Cr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[te,[ee,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[te,[ee,"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],[ee,te],[/quark(?:pc)?\/([-\w\.]+)/i],[te,[ee,"Quark"]],[/\bddg\/([\w\.]+)/i],[te,[ee,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[te,[ee,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[te,[ee,"WeChat"]],[/konqueror\/([\w\.]+)/i],[te,[ee,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[te,[ee,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[te,[ee,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[te,[ee,"Smart "+Gc+Rr]],[/(avast|avg)\/([\w\.]+)/i],[[ee,/(.+)/,"$1 Secure"+Rr],te],[/\bfocus\/([\w\.]+)/i],[te,[ee,Tr+" Focus"]],[/\bopt\/([\w\.]+)/i],[te,[ee,Cr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[te,[ee,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[te,[ee,"Dolphin"]],[/coast\/([\w\.]+)/i],[te,[ee,Cr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[te,[ee,"MIUI"+Rr]],[/fxios\/([\w\.-]+)/i],[te,[ee,Mi+Tr]],[/\bqihoobrowser\/?([\w\.]*)/i],[te,[ee,"360"]],[/\b(qq)\/([\w\.]+)/i],[[ee,/(.+)/,"$1Browser"],te],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[ee,/(.+)/,"$1"+Rr],te],[/samsungbrowser\/([\w\.]+)/i],[te,[ee,Or+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[te,[ee,Zc+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[ee,Zc+" Mobile"],te],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[ee,te],[/(lbbrowser|rekonq)/i],[ee],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[te,ee],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[ee,cu],te,[W,Ar]],[/(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],[ee,te,[W,Ar]],[/\bgsa\/([\w\.]+) .*safari\//i],[te,[ee,"GSA"],[W,Ar]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[te,[ee,"TikTok"],[W,Ar]],[/\[(linkedin)app\]/i],[ee,[W,Ar]],[/(chromium)[\/ ]([-\w\.]+)/i],[ee,te],[/headlesschrome(?:\/([\w\.]+)| )/i],[te,[ee,Xc+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[ee,Xc+" WebView"],te],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[te,[ee,"Android"+Rr]],[/chrome\/([\w\.]+) mobile/i],[te,[ee,Mi+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[ee,te],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[te,[ee,Mi+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[ee,Mi+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[te,ee],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[ee,[te,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[ee,te],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[ee,Mi+Tr],te],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[ee,"Netscape"],te],[/(wolvic|librewolf)\/([\w\.]+)/i],[ee,te],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[te,[ee,Tr+" 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],[ee,[te,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[ee,[te,/[^\d\.]+./,Xi]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[It,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[It,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[It,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[It,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[It,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[It,/ower/,Xi,Sn]],[/ sun4\w[;\)]/i],[[It,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[It,Sn]]],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],[Q,[Z,Or],[W,Qe]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[Q,[Z,Or],[W,Pe]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[Q,[Z,$i],[W,Pe]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[Q,[Z,$i],[W,Qe]],[/(macintosh);/i],[Q,[Z,$i]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[Q,[Z,Yc],[W,Pe]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[Q,[Z,Wc],[W,Qe]],[/honor([-\w ]+)[;\)]/i],[Q,[Z,Wc],[W,Pe]],[/\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],[Q,[Z,Kc],[W,Qe]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[Q,[Z,Kc],[W,Pe]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[Q,/_/g," "],[Z,uu],[W,Qe]],[/\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],[[Q,/_/g," "],[Z,uu],[W,Pe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[Q,[Z,ou],[W,Pe]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[Q,[Z,Vn,{OnePlus:["304","403","203"],"*":ou}],[W,Qe]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[Q,[Z,"BLU"],[W,Pe]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[Q,[Z,"Vivo"],[W,Pe]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[Q,[Z,"Realme"],[W,Pe]],[/\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],[Q,[Z,su],[W,Pe]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[Q,[Z,su],[W,Qe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[Q,[Z,zs],[W,Qe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[Q,[Z,zs],[W,Pe]],[/(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],[Q,[Z,Gc],[W,Qe]],[/(nokia) (t[12][01])/i],[Z,Q,[W,Qe]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[Q,/_/g," "],[W,Pe],[Z,"Nokia"]],[/(pixel (c|tablet))\b/i],[Q,[Z,li],[W,Qe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[Q,[Z,li],[W,Pe]],[/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],[Q,[Z,xr],[W,Pe]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[Q,"Xperia Tablet"],[Z,xr],[W,Qe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[Q,[Z,Jc],[W,Pe]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[Q,[Z,qs],[W,Qe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[Q,/(.+)/g,"Fire Phone $1"],[Z,qs],[W,Pe]],[/(playbook);[-\w\),; ]+(rim)/i],[Q,Z,[W,Qe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[Q,[Z,zc],[W,Pe]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[Q,[Z,qc],[W,Qe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[Q,[Z,qc],[W,Pe]],[/(nexus 9)/i],[Q,[Z,"HTC"],[W,Qe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[Z,[Q,/_/g," "],[W,Pe]],[/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],[Q,[Z,"TCL"],[W,Qe]],[/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],[Q,[Z,"TCL"],[W,Pe]],[/(itel) ((\w+))/i],[[Z,Sn],Q,[W,Vn,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[Q,[Z,"Acer"],[W,Qe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[Q,[Z,"Meizu"],[W,Pe]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[Q,[Z,"Ulefone"],[W,Pe]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[Q,[Z,"Energizer"],[W,Pe]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[Q,[Z,"Cat"],[W,Pe]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[Q,[Z,"Smartfren"],[W,Pe]],[/droid.+; (a(?:015|06[35]|142p?))/i],[Q,[Z,"Nothing"],[W,Pe]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[Q,[Z,"Archos"],[W,Qe]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[Q,[Z,"Archos"],[W,Pe]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[Z,Q,[W,Qe]],[/(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],[Z,Q,[W,Pe]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[Z,Q,[W,Qe]],[/(surface duo)/i],[Q,[Z,ru],[W,Qe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[Q,[Z,"Fairphone"],[W,Pe]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[Q,[Z,au],[W,Qe]],[/(sprint) (\w+)/i],[Z,Q,[W,Pe]],[/(kin\.[onetw]{3})/i],[[Q,/\./g," "],[Z,ru],[W,Pe]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[Q,[Z,lu],[W,Qe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[Q,[Z,lu],[W,Pe]],[/smart-tv.+(samsung)/i],[Z,[W,gt]],[/hbbtv.+maple;(\d+)/i],[[Q,/^/,"SmartTV"],[Z,Or],[W,gt]],[/tcast.+(lg)e?. ([-\w]+)/i],[Z,Q,[W,gt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[Z,zs],[W,gt]],[/(apple) ?tv/i],[Z,[Q,$i+" TV"],[W,gt]],[/crkey.*devicetype\/chromecast/i],[[Q,Bn+" Third Generation"],[Z,li],[W,gt]],[/crkey.*devicetype\/([^/]*)/i],[[Q,/^/,"Chromecast "],[Z,li],[W,gt]],[/fuchsia.*crkey/i],[[Q,Bn+" Nest Hub"],[Z,li],[W,gt]],[/crkey/i],[[Q,Bn],[Z,li],[W,gt]],[/(portaltv)/i],[Q,[Z,cu],[W,gt]],[/droid.+aft(\w+)( bui|\))/i],[Q,[Z,qs],[W,gt]],[/(shield \w+ tv)/i],[Q,[Z,au],[W,gt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[Q,[Z,Yc],[W,gt]],[/(bravia[\w ]+)( bui|\))/i],[Q,[Z,xr],[W,gt]],[/(mi(tv|box)-?\w+) bui/i],[Q,[Z,uu],[W,gt]],[/Hbbtv.*(technisat) (.*);/i],[Z,Q,[W,gt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[Z,Zr],[Q,Zr],[W,gt]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[Q,[W,gt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[W,gt]],[/(ouya)/i,/(nintendo) (\w+)/i],[Z,Q,[W,Br]],[/droid.+; (shield)( bui|\))/i],[Q,[Z,au],[W,Br]],[/(playstation \w+)/i],[Q,[Z,xr],[W,Br]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[Q,[Z,ru],[W,Br]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[Q,[Z,Or],[W,cn]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[Z,Q,[W,cn]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[Q,[Z,ou],[W,cn]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[Q,[Z,$i],[W,cn]],[/(opwwe\d{3})/i],[Q,[Z,Jc],[W,cn]],[/(moto 360)/i],[Q,[Z,su],[W,cn]],[/(smartwatch 3)/i],[Q,[Z,xr],[W,cn]],[/(g watch r)/i],[Q,[Z,zs],[W,cn]],[/droid.+; (wt63?0{2,3})\)/i],[Q,[Z,lu],[W,cn]],[/droid.+; (glass) \d/i],[Q,[Z,li],[W,iu]],[/(pico) (4|neo3(?: link|pro)?)/i],[Z,Q,[W,iu]],[/(quest( \d| pro)?s?).+vr/i],[Q,[Z,cu],[W,iu]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[Z,[W,Ur]],[/(aeobc)\b/i],[Q,[Z,qs],[W,Ur]],[/(homepod).+mac os/i],[Q,[Z,$i],[W,Ur]],[/windows iot/i],[[W,Ur]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[Q,[W,Vn,{mobile:"Mobile",xr:"VR","*":Qe}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[W,Qe]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[W,Pe]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[Q,[Z,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[te,[ee,zg+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[ee,te],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[te,[ee,"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],[ee,te],[/ladybird\//i],[[ee,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[te,ee]],os:[[/microsoft (windows) (vista|xp)/i],[ee,te],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[ee,[te,Vn,ed]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[te,Vn,ed],[ee,Wu]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[te,/_/g,"."],[ee,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[ee,"macOS"],[te,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[te,[ee,Bn+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[te,[ee,Bn+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[te,[ee,Bn+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[te,[ee,Bn+" Linux"]],[/crkey\/([\d\.]+)/i],[te,[ee,Bn]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[te,ee],[/(ubuntu) ([\w\.]+) like android/i],[[ee,/(.+)/,"$1 Touch"],te],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[ee,te],[/\(bb(10);/i],[te,[ee,zc]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[te,[ee,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[te,[ee,Tr+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[te,[ee,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[te,[ee,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[ee,"Chrome OS"],te],[/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],[ee,te],[/(sunos) ?([\w\.\d]*)/i],[[ee,"Solaris"],te],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[ee,te]]},Ks=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return En.call(t.init,[[Ft,[ee,te,Qr,W]],[kn,[It]],[dn,[W,Q,Z]],[en,[ee,te]],[Gt,[ee,te]]]),En.call(t.isIgnore,[[Ft,[te,Qr]],[en,[te]],[Gt,[te]]]),En.call(t.isIgnoreRgx,[[Ft,/ ?browser$/i],[Gt,/ ?os$/i]]),En.call(t.toString,[[Ft,[ee,te]],[kn,[It]],[dn,[Z,Q]],[en,[ee,te]],[Gt,[ee,te]]]),t}(),Wg=function(t,e){var n=Ks.init[e],i=Ks.isIgnore[e]||0,r=Ks.isIgnoreRgx[e]||0,s=Ks.toString[e]||0;function o(){En.call(this,n)}return o.prototype.getItem=function(){return t},o.prototype.withClientHints=function(){return jn?jn.getHighEntropyValues(zf).then(function(l){return t.setCH(new Kf(l,!1)).parseCH().get()}):t.parseCH().get()},o.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=Ji&&(o.prototype.is=function(l){var d=!1;for(var h in this)if(this.hasOwnProperty(h)&&!Ju(i,h)&&Sn(r?Zi(r,this[h]):this[h])==Sn(r?Zi(r,l):l)){if(d=!0,l!=qn)break}else if(l==qn&&d){d=!d;break}return d},o.prototype.toString=function(){var l=Xi;for(var d in s)typeof this[s[d]]!==qn&&(l+=(l?" ":Xi)+this[s[d]]);return l||qn}),jn||(o.prototype.then=function(l){var d=this,h=function(){for(var y in d)d.hasOwnProperty(y)&&(this[y]=d[y])};h.prototype={is:o.prototype.is,toString:o.prototype.toString};var m=new h;return l(m),m}),new o};function Kf(t,e){if(t=t||{},En.call(this,zf),e)En.call(this,[[Tl,du(t[Xn])],[Cl,du(t[Mg])],[Pe,/\?1/.test(t[Vg])],[Q,Fr(t[Hg])],[Yi,Fr(t[qf])],[Rl,Fr(t[qg])],[It,Fr(t[Bg])],[di,du(t[jg])],[Pa,Fr(t[Ug])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==qn&&(this[n]=t[n])}function id(t,e,n,i){return this.get=function(r){return r?this.data.hasOwnProperty(r)?this.data[r]:void 0:this.data},this.set=function(r,s){return this.data[r]=s,this},this.setCH=function(r){return this.uaCH=r,this},this.detectFeature=function(){if(Dt&&Dt.userAgent==this.ua)switch(this.itemType){case Ft:Dt.brave&&typeof Dt.brave.isBrave==fa&&this.set(ee,"Brave");break;case dn:!this.get(W)&&jn&&jn[Pe]&&this.set(W,Pe),this.get(Q)=="Macintosh"&&Dt&&typeof Dt.standalone!==qn&&Dt.maxTouchPoints&&Dt.maxTouchPoints>2&&this.set(Q,"iPad").set(W,Qe);break;case Gt:!this.get(ee)&&jn&&jn[Yi]&&this.set(ee,jn[Yi]);break;case Ji:var r=this.data,s=function(o){return r[o].getItem().detectFeature().get()};this.set(Ft,s(Ft)).set(kn,s(kn)).set(dn,s(dn)).set(en,s(en)).set(Gt,s(Gt))}return this},this.parseUA=function(){return this.itemType!=Ji&&hu.call(this.data,this.ua,this.rgxMap),this.itemType==Ft&&this.set(Qr,fu(this.get(te))),this},this.parseCH=function(){var r=this.uaCH,s=this.rgxMap;switch(this.itemType){case Ft:case en:var o=r[Cl]||r[Tl],l;if(o)for(var d in o){var h=o[d].brand||o[d],m=o[d].version;this.itemType==Ft&&!/not.a.brand/i.test(h)&&(!l||/chrom/i.test(l)&&h!=Qc)&&(h=Vn(h,{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(ee,h).set(te,m).set(Qr,fu(m)),l=h),this.itemType==en&&h==Qc&&this.set(te,m)}break;case kn:var y=r[It];y&&(y&&r[Pa]=="64"&&(y+="64"),hu.call(this.data,y+";",s));break;case dn:if(r[Pe]&&this.set(W,Pe),r[Q]&&(this.set(Q,r[Q]),!this.get(W)||!this.get(Z))){var g={};hu.call(g,"droid 9; "+r[Q]+")",s),!this.get(W)&&g.type&&this.set(W,g.type),!this.get(Z)&&g.vendor&&this.set(Z,g.vendor)}if(r[di]){var O;if(typeof r[di]!="string")for(var _=0;!O&&_<r[di].length;)O=Vn(r[di][_++],td);else O=Vn(r[di],td);this.set(W,O)}break;case Gt:var S=r[Yi];if(S){var E=r[Rl];S==Wu&&(E=parseInt(fu(E),10)>=13?"11":"10"),this.set(ee,S).set(te,E)}this.get(ee)==Wu&&r[Q]=="Xbox"&&this.set(ee,"Xbox").set(te,void 0);break;case Ji:var R=this.data,j=function(J){return R[J].getItem().setCH(r).parseCH().get()};this.set(Ft,j(Ft)).set(kn,j(kn)).set(dn,j(dn)).set(en,j(en)).set(Gt,j(Gt))}return this},En.call(this,[["itemType",t],["ua",e],["uaCH",i],["rgxMap",n],["data",Wg(this,t)]]),this}function On(t,e,n){if(typeof t===Qi?(ha(t,!0)?(typeof e===Qi&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===Gu&&!ha(e,!0)&&(n=e,e=void 0),n&&typeof n.append===fa){var i={};n.forEach(function(d,h){i[h]=d}),n=i}if(!(this instanceof On))return new On(t,e,n).getResult();var r=typeof t===Gu?t:n&&n[Vc]?n[Vc]:Dt&&Dt.userAgent?Dt.userAgent:Xi,s=new Kf(n,!0),o=e?Gg(nd,e):nd,l=function(d){return d==Ji?function(){return new id(d,r,o,s).set("ua",r).set(Ft,this.getBrowser()).set(kn,this.getCPU()).set(dn,this.getDevice()).set(en,this.getEngine()).set(Gt,this.getOS()).get()}:function(){return new id(d,r,o[d],s).parseUA().get()}};return En.call(this,[["getBrowser",l(Ft)],["getCPU",l(kn)],["getDevice",l(dn)],["getEngine",l(en)],["getOS",l(Gt)],["getResult",l(Ji)],["getUA",function(){return r}],["setUA",function(d){return sr(d)&&(r=d.length>Ku?Zr(d,Ku):d),this}]]).setUA(r),this}On.VERSION=$g;On.BROWSER=La([ee,te,Qr,W]);On.CPU=La([It]);On.DEVICE=La([Q,Z,W,Br,Pe,gt,Qe,cn,Ur]);On.ENGINE=On.OS=La([ee,te]);function Hi(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function ta(t){return function e(n){return arguments.length===0||Hi(n)?e:t.apply(this,arguments)}}function Jg(t){return function e(n,i){switch(arguments.length){case 0:return e;case 1:return Hi(n)?e:ta(function(r){return t(n,r)});default:return Hi(n)&&Hi(i)?e:Hi(n)?ta(function(r){return t(r,i)}):Hi(i)?ta(function(r){return t(n,r)}):t(n,i)}}}const Yg=Number.isInteger||function(e){return e<<0===e};function Xg(t){return Object.prototype.toString.call(t)==="[object String]"}function Qg(t,e){var n=t<0?e.length+t:t;return Xg(e)?e.charAt(n):e[n]}var Zg=ta(function(e){return e==null});function ev(t,e){for(var n=e,i=0;i<t.length;i+=1){if(n==null)return;var r=t[i];Yg(r)?n=Qg(r,n):n=n[r]}return n}var tv=Jg(ev);class Cn extends Error{constructor(e,n,i){super(n),this.value=i,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(`
|
|
2
|
-
|
|
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-dev.nizza.com/api",graphql:mS||"https://core-services-dev.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",`
|
|
3
101
|
Configuration property invalid: "${e}".
|
|
4
102
|
|
|
5
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".
|
|
@@ -21,29 +119,29 @@
|
|
|
21
119
|
account: env.account,
|
|
22
120
|
...
|
|
23
121
|
});
|
|
24
|
-
`)}}function
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
26
|
-
'`+s.annotationType_+"' can only be used on properties with a function value."))}function Ev(t,e,n,i){e.annotationType_,i.value}function sh(t,e,n,i,r){var s,o,l,d,h,m,y;r===void 0&&(r=ke.safeDescriptors),Ev(t,e,n,i);var g=i.value;if((s=e.options_)!=null&&s.bound){var O;g=g.bind((O=t.proxy_)!=null?O:t.target_)}return{value:Yn((o=(l=e.options_)==null?void 0:l.name)!=null?o:n.toString(),g,(d=(h=e.options_)==null?void 0:h.autoAction)!=null?d:!1,(m=e.options_)!=null&&m.bound?(y=t.proxy_)!=null?y:t.target_:void 0),configurable:r?t.isPlainObject_:!0,enumerable:!1,writable:!r}}function ah(t,e){return{annotationType_:t,options_:e,make_:Nv,extend_:Av,decorate_20223_:Ov}}function Nv(t,e,n,i){var r;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!Nn(t.target_,e)||!ts(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(ts(n.value))return 1;var s=oh(t,this,e,n,!1,!1);return pn(i,e,s),2}function Av(t,e,n,i){var r,s=oh(t,this,e,n,(r=this.options_)==null?void 0:r.bound);return t.defineProperty_(e,s,i)}function Ov(t,e){var n,i=e.name,r=e.addInitializer;return ts(t)||(t=tr(t)),(n=this.options_)!=null&&n.bound&&r(function(){var s=this,o=s[i].bind(s);o.isMobXFlow=!0,s[i]=o}),t}function xv(t,e,n,i){e.annotationType_,i.value}function oh(t,e,n,i,r,s){s===void 0&&(s=ke.safeDescriptors),xv(t,e,n,i);var o=i.value;if(ts(o)||(o=tr(o)),r){var l;o=o.bind((l=t.proxy_)!=null?l:t.target_),o.isMobXFlow=!0}return{value:o,configurable:s?t.isPlainObject_:!0,enumerable:!1,writable:!s}}function Pl(t,e){return{annotationType_:t,options_:e,make_:Tv,extend_:Cv,decorate_20223_:Rv}}function Tv(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Cv(t,e,n,i){return Fv(t,this,e,n),t.defineComputedProperty_(e,Jn({},this.options_,{get:n.get,set:n.set}),i)}function Rv(t,e){var n=this,i=e.name,r=e.addInitializer;return r(function(){var s=cr(this)[Ce],o=Jn({},n.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+i.toString()),s.values_.set(i,new sn(o))}),function(){return this[Ce].getObservablePropValue_(i)}}function Fv(t,e,n,i){e.annotationType_,i.get}function Va(t,e){return{annotationType_:t,options_:e,make_:Iv,extend_:Dv,decorate_20223_:Pv}}function Iv(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Dv(t,e,n,i){var r,s;return Lv(t,this),t.defineObservableProperty_(e,n.value,(r=(s=this.options_)==null?void 0:s.enhancer)!=null?r:bi,i)}function Pv(t,e){var n=this,i=e.kind,r=e.name,s=new WeakSet;function o(l,d){var h,m,y=cr(l)[Ce],g=new mi(d,(h=(m=n.options_)==null?void 0:m.enhancer)!=null?h:bi,"ObservableObject."+r.toString(),!1);y.values_.set(r,g),s.add(l)}if(i=="accessor")return{get:function(){return s.has(this)||o(this,t.get.call(this)),this[Ce].getObservablePropValue_(r)},set:function(d){return s.has(this)||o(this,d),this[Ce].setObservablePropValue_(r,d)},init:function(d){return s.has(this)||o(this,d),d}}}function Lv(t,e,n,i){e.annotationType_}var $v="true",Mv=uh();function uh(t){return{annotationType_:$v,options_:t,make_:Bv,extend_:Uv,decorate_20223_:jv}}function Bv(t,e,n,i){var r,s;if(n.get)return zn.make_(t,e,n,i);if(n.set){var o=Yn(e.toString(),n.set);return i===t.target_?t.defineProperty_(e,{configurable:ke.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(pn(i,e,{configurable:!0,set:o}),2)}if(i!==t.target_&&typeof n.value=="function"){var l;if(Zf(n.value)){var d,h=(d=this.options_)!=null&&d.autoBind?tr.bound:tr;return h.make_(t,e,n,i)}var m=(l=this.options_)!=null&&l.autoBind?es.bound:es;return m.make_(t,e,n,i)}var y=((r=this.options_)==null?void 0:r.deep)===!1?ht.ref:ht;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var g;n.value=n.value.bind((g=t.proxy_)!=null?g:t.target_)}return y.make_(t,e,n,i)}function Uv(t,e,n,i){var r,s;if(n.get)return zn.extend_(t,e,n,i);if(n.set)return t.defineProperty_(e,{configurable:ke.safeDescriptors?t.isPlainObject_:!0,set:Yn(e.toString(),n.set)},i);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var o;n.value=n.value.bind((o=t.proxy_)!=null?o:t.target_)}var l=((s=this.options_)==null?void 0:s.deep)===!1?ht.ref:ht;return l.extend_(t,e,n,i)}function jv(t,e){We("'"+this.annotationType_+"' cannot be used as a decorator")}var Vv="observable",Hv="observable.ref",qv="observable.shallow",zv="observable.struct",lh={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(lh);function Gs(t){return t||lh}var Qu=Va(Vv),Kv=Va(Hv,{enhancer:ja}),Gv=Va(qv,{enhancer:vv}),Wv=Va(zv,{enhancer:yv}),ch=mn(Qu);function Ws(t){return t.deep===!0?bi:t.deep===!1?ja:Yv(t.defaultDecorator)}function Jv(t){var e;return t?(e=t.defaultDecorator)!=null?e:uh(t):void 0}function Yv(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:bi}function dh(t,e,n){if(ls(e))return Qu.decorate_20223_(t,e);if(yi(e)){ur(t,e,Qu);return}return Th(t)?t:Wn(t)?ht.object(t,e,n):Array.isArray(t)?ht.array(t,e):ar(t)?ht.map(t,e):_n(t)?ht.set(t,e):typeof t=="object"&&t!==null?t:ht.box(t,e)}Yf(dh,ch);var Xv={box:function(e,n){var i=Gs(n);return new mi(e,Ws(i),i.name,!0,i.equals)},array:function(e,n){var i=Gs(n);return(ke.useProxies===!1||i.proxy===!1?zy:Py)(e,Ws(i),i.name)},map:function(e,n){var i=Gs(n);return new Fh(e,Ws(i),i.name)},set:function(e,n){var i=Gs(n);return new Ih(e,Ws(i),i.name)},object:function(e,n,i){return Oi(function(){return Ey(ke.useProxies===!1||(i==null?void 0:i.proxy)===!1?cr({},i):Ry({},i),e,n)})},ref:mn(Kv),shallow:mn(Gv),deep:ch,struct:mn(Wv)},ht=Yf(dh,Xv),fh="computed",Qv="computed.struct",Zu=Pl(fh),Zv=Pl(Qv,{equals:er.structural}),zn=function(e,n){if(ls(n))return Zu.decorate_20223_(e,n);if(yi(n))return ur(e,n,Zu);if(Wn(e))return mn(Pl(fh,e));var i=Wn(n)?n:{};return i.get=e,i.name||(i.name=e.name||""),new sn(i)};Object.assign(zn,Zu);zn.struct=mn(Zv);var sd,ad,ma=0,ey=1,ty=(sd=(ad=pa(function(){},"name"))==null?void 0:ad.configurable)!=null?sd:!1,od={value:"action",configurable:!0,writable:!1,enumerable:!1};function Yn(t,e,n,i){n===void 0&&(n=!1);function r(){return ny(t,n,e,i||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return e.toString()},ty&&(od.value=t,pn(r,"name",od)),r}function ny(t,e,n,i,r){var s=iy(t,e);try{return n.apply(i,r)}catch(o){throw s.error_=o,o}finally{ry(s)}}function iy(t,e,n,i){var r=!1,s=0,o=ke.trackingDerivation,l=!e||!o;Yt();var d=ke.allowStateChanges;l&&(Ni(),d=Ha(!0));var h=Ll(!0),m={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:d,prevAllowStateReads_:h,notifySpy_:r,startTime_:s,actionId_:ey++,parentActionId_:ma};return ma=m.actionId_,m}function ry(t){ma!==t.actionId_&&We(30),ma=t.parentActionId_,t.error_!==void 0&&(ke.suppressReactionErrors=!0),qa(t.prevAllowStateChanges_),qr(t.prevAllowStateReads_),Xt(),t.runAsAction_&&An(t.prevDerivation_),ke.suppressReactionErrors=!1}function hh(t,e){var n=Ha(t);try{return e()}finally{qa(n)}}function Ha(t){var e=ke.allowStateChanges;return ke.allowStateChanges=t,e}function qa(t){ke.allowStateChanges=t}var mi=function(t){function e(i,r,s,o,l){var d;return s===void 0&&(s="ObservableValue"),l===void 0&&(l=er.default),d=t.call(this,s)||this,d.enhancer=void 0,d.name_=void 0,d.equals=void 0,d.hasUnreportedChange_=!1,d.interceptors_=void 0,d.changeListeners_=void 0,d.value_=void 0,d.dehancer=void 0,d.enhancer=r,d.name_=s,d.equals=l,d.value_=r(i,void 0,s),d}ih(e,t);var n=e.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){this.value_,r=this.prepareNewValue_(r),r!==ke.UNCHANGED&&this.setNewValue_(r)},n.prepareNewValue_=function(r){if(Wt(this)){var s=Jt(this,{object:this,type:gn,newValue:r});if(!s)return ke.UNCHANGED;r=s.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?ke.UNCHANGED:r},n.setNewValue_=function(r){var s=this.value_;this.value_=r,this.reportChanged(),tn(this)&&nn(this,{type:gn,object:this,newValue:r,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return ds(this,r)},n.observe_=function(r,s){return s&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:gn,newValue:this.value_,oldValue:void 0}),fs(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return nh(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Qn),sn=function(){function t(n){this.dependenciesState_=Ge.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ge.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new va(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ga.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||We(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=Yn("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?er.structural:er.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){uy(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.get=function(){if(this.isComputing&&We(32,this.name_,this.derivation),ke.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)el(this)&&(this.warnAboutUntrackedRead_(),Yt(),this.value_=this.computeValue_(!1),Xt());else if(bh(this),el(this)){var i=ke.trackingContext;this.keepAlive_&&!i&&(ke.trackingContext=this),this.trackAndCompute()&&oy(this),ke.trackingContext=i}var r=this.value_;if(na(r))throw r.cause;return r},e.set=function(i){if(this.setter_){this.isRunningSetter&&We(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,i)}finally{this.isRunningSetter=!1}}else We(34,this.name_)},e.trackAndCompute=function(){var i=this.value_,r=this.dependenciesState_===Ge.NOT_TRACKING_,s=this.computeValue_(!0),o=r||na(i)||na(s)||!this.equals_(i,s);return o&&(this.value_=s),o},e.computeValue_=function(i){this.isComputing=!0;var r=Ha(!1),s;if(i)s=ph(this,this.derivation,this.scope_);else if(ke.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new va(o)}return qa(r),this.isComputing=!1,s},e.suspend_=function(){this.keepAlive_||(tl(this),this.value_=void 0)},e.observe_=function(i,r){var s=this,o=!0,l=void 0;return Ga(function(){var d=s.get();if(!o||r){var h=Ni();i({observableKind:"computed",debugObjectName:s.name_,type:gn,object:s,newValue:d,oldValue:l}),An(h)}o=!1,l=d})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return nh(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},or(t,[{key:"isComputing",get:function(){return Ut(this.flags_,t.isComputingMask_)},set:function(i){this.flags_=jt(this.flags_,t.isComputingMask_,i)}},{key:"isRunningSetter",get:function(){return Ut(this.flags_,t.isRunningSetterMask_)},set:function(i){this.flags_=jt(this.flags_,t.isRunningSetterMask_,i)}},{key:"isBeingObserved",get:function(){return Ut(this.flags_,t.isBeingObservedMask_)},set:function(i){this.flags_=jt(this.flags_,t.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return Ut(this.flags_,t.isPendingUnobservationMask_)},set:function(i){this.flags_=jt(this.flags_,t.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return Ut(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=jt(this.flags_,t.diffValueMask_,i===1)}}])}();sn.isComputingMask_=1;sn.isRunningSetterMask_=2;sn.isBeingObservedMask_=4;sn.isPendingUnobservationMask_=8;sn.diffValueMask_=16;var za=Ei("ComputedValue",sn),Ge;(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_"})(Ge||(Ge={}));var ga;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(ga||(ga={}));var va=function(e){this.cause=void 0,this.cause=e};function na(t){return t instanceof va}function el(t){switch(t.dependenciesState_){case Ge.UP_TO_DATE_:return!1;case Ge.NOT_TRACKING_:case Ge.STALE_:return!0;case Ge.POSSIBLY_STALE_:{for(var e=Ll(!0),n=Ni(),i=t.observing_,r=i.length,s=0;s<r;s++){var o=i[s];if(za(o)){if(ke.disableErrorBoundaries)o.get();else try{o.get()}catch{return An(n),qr(e),!0}if(t.dependenciesState_===Ge.STALE_)return An(n),qr(e),!0}}return gh(t),An(n),qr(e),!1}}}function ph(t,e,n){var i=Ll(!0);gh(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++ke.runId;var r=ke.trackingDerivation;ke.trackingDerivation=t,ke.inBatch++;var s;if(ke.disableErrorBoundaries===!0)s=e.call(n);else try{s=e.call(n)}catch(o){s=new va(o)}return ke.inBatch--,ke.trackingDerivation=r,sy(t),qr(i),s}function sy(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,i=Ge.UP_TO_DATE_,r=0,s=t.unboundDepsCount_,o=0;o<s;o++){var l=n[o];l.diffValue===0&&(l.diffValue=1,r!==o&&(n[r]=l),r++),l.dependenciesState_>i&&(i=l.dependenciesState_)}for(n.length=r,t.newObserving_=null,s=e.length;s--;){var d=e[s];d.diffValue===0&&vh(d,t),d.diffValue=0}for(;r--;){var h=n[r];h.diffValue===1&&(h.diffValue=0,ay(h,t))}i!==Ge.UP_TO_DATE_&&(t.dependenciesState_=i,t.onBecomeStale_())}function tl(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)vh(e[n],t);t.dependenciesState_=Ge.NOT_TRACKING_}function mh(t){var e=Ni();try{return t()}finally{An(e)}}function Ni(){var t=ke.trackingDerivation;return ke.trackingDerivation=null,t}function An(t){ke.trackingDerivation=t}function Ll(t){var e=ke.allowStateReads;return ke.allowStateReads=t,e}function qr(t){ke.allowStateReads=t}function gh(t){if(t.dependenciesState_!==Ge.UP_TO_DATE_){t.dependenciesState_=Ge.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=Ge.UP_TO_DATE_}}var pu=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},mu=!0,ke=function(){var t=Jf();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(mu=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new pu().version&&(mu=!1),mu?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new pu):(setTimeout(function(){We(35)},1),new pu)}();function ay(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function vh(t,e){t.observers_.delete(e),t.observers_.size===0&&yh(t)}function yh(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,ke.pendingUnobservations.push(t))}function Yt(){ke.inBatch++}function Xt(){if(--ke.inBatch===0){_h();for(var t=ke.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 sn&&n.suspend_())}ke.pendingUnobservations=[]}}function bh(t){var e=ke.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&ke.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&ke.inBatch>0&&yh(t),!1)}function kh(t){t.lowestObserverState_!==Ge.STALE_&&(t.lowestObserverState_=Ge.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ge.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Ge.STALE_}))}function oy(t){t.lowestObserverState_!==Ge.STALE_&&(t.lowestObserverState_=Ge.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ge.POSSIBLY_STALE_?e.dependenciesState_=Ge.STALE_:e.dependenciesState_===Ge.UP_TO_DATE_&&(t.lowestObserverState_=Ge.UP_TO_DATE_)}))}function uy(t){t.lowestObserverState_===Ge.UP_TO_DATE_&&(t.lowestObserverState_=Ge.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ge.UP_TO_DATE_&&(e.dependenciesState_=Ge.POSSIBLY_STALE_,e.onBecomeStale_())}))}var xn=function(){function t(n,i,r,s){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ge.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=ga.NONE,this.name_=n,this.onInvalidate_=i,this.errorHandler_=r,this.requiresObservable_=s}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,ke.pendingReactions.push(this),_h())},e.runReaction_=function(){if(!this.isDisposed){Yt(),this.isScheduled=!1;var i=ke.trackingContext;if(ke.trackingContext=this,el(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(r){this.reportExceptionInDerivation_(r)}}ke.trackingContext=i,Xt()}},e.track=function(i){if(!this.isDisposed){Yt(),this.isRunning=!0;var r=ke.trackingContext;ke.trackingContext=this;var s=ph(this,i,void 0);ke.trackingContext=r,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&tl(this),na(s)&&this.reportExceptionInDerivation_(s.cause),Xt()}},e.reportExceptionInDerivation_=function(i){var r=this;if(this.errorHandler_){this.errorHandler_(i,this);return}if(ke.disableErrorBoundaries)throw i;var s="[mobx] uncaught error in '"+this+"'";ke.suppressReactionErrors||console.error(s,i),ke.globalReactionErrorHandlers.forEach(function(o){return o(i,r)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Yt(),tl(this),Xt()))},e.getDisposer_=function(i){var r=this,s=function o(){r.dispose(),i==null||i.removeEventListener==null||i.removeEventListener("abort",o)};return i==null||i.addEventListener==null||i.addEventListener("abort",s),s[Ce]=this,s},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(i){},or(t,[{key:"isDisposed",get:function(){return Ut(this.flags_,t.isDisposedMask_)},set:function(i){this.flags_=jt(this.flags_,t.isDisposedMask_,i)}},{key:"isScheduled",get:function(){return Ut(this.flags_,t.isScheduledMask_)},set:function(i){this.flags_=jt(this.flags_,t.isScheduledMask_,i)}},{key:"isTrackPending",get:function(){return Ut(this.flags_,t.isTrackPendingMask_)},set:function(i){this.flags_=jt(this.flags_,t.isTrackPendingMask_,i)}},{key:"isRunning",get:function(){return Ut(this.flags_,t.isRunningMask_)},set:function(i){this.flags_=jt(this.flags_,t.isRunningMask_,i)}},{key:"diffValue",get:function(){return Ut(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=jt(this.flags_,t.diffValueMask_,i===1)}}])}();xn.isDisposedMask_=1;xn.isScheduledMask_=2;xn.isTrackPendingMask_=4;xn.isRunningMask_=8;xn.diffValueMask_=16;var ly=100,cy=function(e){return e()};function _h(){ke.inBatch>0||ke.isRunningReactions||cy(dy)}function dy(){ke.isRunningReactions=!0;for(var t=ke.pendingReactions,e=0;t.length>0;){++e===ly&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction_()}ke.isRunningReactions=!1}var ya=Ei("Reaction",xn);function zr(){return!1}function fy(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var wh="action",hy="action.bound",Sh="autoAction",py="autoAction.bound",my="<unnamed action>",nl=cs(wh),gy=cs(hy,{bound:!0}),il=cs(Sh,{autoAction:!0}),vy=cs(py,{autoAction:!0,bound:!0});function Eh(t){var e=function(i,r){if(rn(i))return Yn(i.name||my,i,t);if(rn(r))return Yn(i,r,t);if(ls(r))return(t?il:nl).decorate_20223_(i,r);if(yi(r))return ur(i,r,t?il:nl);if(yi(i))return mn(cs(t?Sh:wh,{name:i,autoAction:t}))};return e}var Bt=Eh(!1);Object.assign(Bt,nl);var es=Eh(!0);Object.assign(es,il);Bt.bound=mn(gy);es.bound=mn(vy);function Ka(t){return rn(t)&&t.isMobxAction===!0}function Ga(t,e){var n,i,r,s;e===void 0&&(e=Il);var o=(n=(i=e)==null?void 0:i.name)!=null?n:"Autorun",l=!e.scheduler&&!e.delay,d;if(l)d=new xn(o,function(){this.track(y)},e.onError,e.requiresObservable);else{var h=Nh(e),m=!1;d=new xn(o,function(){m||(m=!0,h(function(){m=!1,d.isDisposed||d.track(y)}))},e.onError,e.requiresObservable)}function y(){t(d)}return(r=e)!=null&&(r=r.signal)!=null&&r.aborted||d.schedule_(),d.getDisposer_((s=e)==null?void 0:s.signal)}var yy=function(e){return e()};function Nh(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:yy}function by(t,e,n){var i,r,s;n===void 0&&(n=Il);var o=(i=n.name)!=null?i:"Reaction",l=Bt(o,n.onError?ky(n.onError,e):e),d=!n.scheduler&&!n.delay,h=Nh(n),m=!0,y=!1,g,O=n.compareStructural?er.structural:n.equals||er.default,_=new xn(o,function(){m||d?S():y||(y=!0,h(S))},n.onError,n.requiresObservable);function S(){if(y=!1,!_.isDisposed){var E=!1,R=g;_.track(function(){var j=hh(!1,function(){return t(_)});E=m||!O(g,j),g=j}),(m&&n.fireImmediately||!m&&E)&&l(g,R,_),m=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||_.schedule_(),_.getDisposer_((s=n)==null?void 0:s.signal)}function ky(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var _y="onBO",wy="onBUO";function Sy(t,e,n){return Oh(_y,t,e,n)}function Ah(t,e,n){return Oh(wy,t,e,n)}function Oh(t,e,n,i){var r=rl(e),s=rn(i)?i:n,o=t+"L";return r[o]?r[o].add(s):r[o]=new Set([s]),function(){var l=r[o];l&&(l.delete(s),l.size===0&&delete r[o])}}function Ey(t,e,n,i){var r=lv(e);return Oi(function(){var s=cr(t,i)[Ce];Ua(r).forEach(function(o){s.extend_(o,r[o],n&&o in n?n[o]:!0)})}),t}var Ny=0;function xh(){this.message="FLOW_CANCELLED"}xh.prototype=Object.create(Error.prototype);var gu=ah("flow"),Ay=ah("flow.bound",{bound:!0}),tr=Object.assign(function(e,n){if(ls(n))return gu.decorate_20223_(e,n);if(yi(n))return ur(e,n,gu);var i=e,r=i.name||"<unnamed flow>",s=function(){var l=this,d=arguments,h=++Ny,m=Bt(r+" - runid: "+h+" - init",i).apply(l,d),y,g=void 0,O=new Promise(function(_,S){var E=0;y=S;function R(z){g=void 0;var X;try{X=Bt(r+" - runid: "+h+" - yield "+E++,m.next).call(m,z)}catch(ne){return S(ne)}J(X)}function j(z){g=void 0;var X;try{X=Bt(r+" - runid: "+h+" - yield "+E++,m.throw).call(m,z)}catch(ne){return S(ne)}J(X)}function J(z){if(rn(z==null?void 0:z.then)){z.then(J,S);return}return z.done?_(z.value):(g=Promise.resolve(z.value),g.then(R,j))}R(void 0)});return O.cancel=Bt(r+" - runid: "+h+" - cancel",function(){try{g&&ud(g);var _=m.return(void 0),S=Promise.resolve(_.value);S.then(Ki,Ki),ud(S),y(new xh)}catch(E){y(E)}}),O};return s.isMobXFlow=!0,s},gu);tr.bound=mn(Ay);function ud(t){rn(t.cancel)&&t.cancel()}function ts(t){return(t==null?void 0:t.isMobXFlow)===!0}function Oy(t,e){return t?Ja(t)||!!t[Ce]||Dl(t)||ya(t)||za(t):!1}function Th(t){return Oy(t)}function wn(t,e){e===void 0&&(e=void 0),Yt();try{return t.apply(e)}finally{Xt()}}function xy(t,e,n){return arguments.length===1||e&&typeof e=="object"?Ty(t,e):Ch(t,e,{})}function Ch(t,e,n){var i;if(typeof n.timeout=="number"){var r=new Error("WHEN_TIMEOUT");i=setTimeout(function(){if(!o[Ce].isDisposed)if(o(),n.onError)n.onError(r);else throw r},n.timeout)}n.name="When";var s=Yn("When-effect",e),o=Ga(function(l){var d=hh(!1,t);d&&(l.dispose(),i&&clearTimeout(i),s())},n);return o}function Ty(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var i,r,s=new Promise(function(o,l){var d,h=Ch(t,o,Jn({},e,{onError:l}));i=function(){h(),l(new Error("WHEN_CANCELLED"))},r=function(){h(),l(new Error("WHEN_ABORTED"))},e==null||(d=e.signal)==null||d.addEventListener==null||d.addEventListener("abort",r)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",r)});return s.cancel=i,s}function Bi(t){return t[Ce]}var Cy={has:function(e,n){return Bi(e).has_(n)},get:function(e,n){return Bi(e).get_(n)},set:function(e,n,i){var r;return yi(n)?(r=Bi(e).set_(n,i,!0))!=null?r:!0:!1},deleteProperty:function(e,n){var i;return yi(n)?(i=Bi(e).delete_(n,!0))!=null?i:!0:!1},defineProperty:function(e,n,i){var r;return(r=Bi(e).defineProperty_(n,i))!=null?r:!0},ownKeys:function(e){return Bi(e).ownKeys_()},preventExtensions:function(e){We(13)}};function Ry(t,e){var n,i;return Xf(),t=cr(t,e),(i=(n=t[Ce]).proxy_)!=null?i:n.proxy_=new Proxy(t,Cy)}function Wt(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function ds(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Qf(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function Jt(t,e){var n=Ni();try{for(var i=[].concat(t.interceptors_||[]),r=0,s=i.length;r<s&&(e=i[r](e),e&&!e.type&&We(14),!!e);r++);return e}finally{An(n)}}function tn(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function fs(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Qf(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function nn(t,e){var n=Ni(),i=t.changeListeners_;if(i){i=i.slice();for(var r=0,s=i.length;r<s;r++)i[r](e);An(n)}}function Fy(t,e,n){return Oi(function(){var i,r=cr(t,n)[Ce];(i=e)!=null||(e=pv(t)),Ua(e).forEach(function(s){return r.make_(s,e[s])})}),t}var ld="splice",gn="update",Iy=1e4,Dy={get:function(e,n){var i=e[Ce];return n===Ce?i:n==="length"?i.getArrayLength_():typeof n=="string"&&!isNaN(n)?i.get_(parseInt(n)):Nn(ba,n)?ba[n]:e[n]},set:function(e,n,i){var r=e[Ce];return n==="length"&&r.setArrayLength_(i),typeof n=="symbol"||isNaN(n)?e[n]=i:r.set_(parseInt(n),i),!0},preventExtensions:function(){We(15)}},$l=function(){function t(n,i,r,s){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=s,this.atom_=new Qn(n),this.enhancer_=function(o,l){return i(o,l,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.dehanceValues_=function(i){return this.dehancer!==void 0&&i.length>0?i.map(this.dehancer):i},e.intercept_=function(i){return ds(this,i)},e.observe_=function(i,r){return r===void 0&&(r=!1),r&&i({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),fs(this,i)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(i){(typeof i!="number"||isNaN(i)||i<0)&&We("Out of range: "+i);var r=this.values_.length;if(i!==r)if(i>r){for(var s=new Array(i-r),o=0;o<i-r;o++)s[o]=void 0;this.spliceWithArray_(r,0,s)}else this.spliceWithArray_(i,r-i)},e.updateArrayLength_=function(i,r){i!==this.lastKnownLength_&&We(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&$h(i+r+1)},e.spliceWithArray_=function(i,r,s){var o=this;this.atom_;var l=this.values_.length;if(i===void 0?i=0:i>l?i=l:i<0&&(i=Math.max(0,l+i)),arguments.length===1?r=l-i:r==null?r=0:r=Math.max(0,Math.min(r,l-i)),s===void 0&&(s=Yu),Wt(this)){var d=Jt(this,{object:this.proxy_,type:ld,index:i,removedCount:r,added:s});if(!d)return Yu;r=d.removedCount,s=d.added}if(s=s.length===0?s:s.map(function(y){return o.enhancer_(y,void 0)}),this.legacyMode_){var h=s.length-r;this.updateArrayLength_(l,h)}var m=this.spliceItemsIntoValues_(i,r,s);return(r!==0||s.length!==0)&&this.notifyArraySplice_(i,s,m),this.dehanceValues_(m)},e.spliceItemsIntoValues_=function(i,r,s){if(s.length<Iy){var o;return(o=this.values_).splice.apply(o,[i,r].concat(s))}else{var l=this.values_.slice(i,i+r),d=this.values_.slice(i+r);this.values_.length+=s.length-r;for(var h=0;h<s.length;h++)this.values_[i+h]=s[h];for(var m=0;m<d.length;m++)this.values_[i+s.length+m]=d[m];return l}},e.notifyArrayChildUpdate_=function(i,r,s){var o=!this.owned_&&zr(),l=tn(this),d=l||o?{observableKind:"array",object:this.proxy_,type:gn,debugObjectName:this.atom_.name_,index:i,newValue:r,oldValue:s}:null;this.atom_.reportChanged(),l&&nn(this,d)},e.notifyArraySplice_=function(i,r,s){var o=!this.owned_&&zr(),l=tn(this),d=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:ld,index:i,removed:s,added:r,removedCount:s.length,addedCount:r.length}:null;this.atom_.reportChanged(),l&&nn(this,d)},e.get_=function(i){if(this.legacyMode_&&i>=this.values_.length){console.warn("[mobx] Out of bounds read: "+i);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[i])},e.set_=function(i,r){var s=this.values_;if(this.legacyMode_&&i>s.length&&We(17,i,s.length),i<s.length){this.atom_;var o=s[i];if(Wt(this)){var l=Jt(this,{type:gn,object:this.proxy_,index:i,newValue:r});if(!l)return;r=l.newValue}r=this.enhancer_(r,o);var d=r!==o;d&&(s[i]=r,this.notifyArrayChildUpdate_(i,r,o))}else{for(var h=new Array(i+1-s.length),m=0;m<h.length-1;m++)h[m]=void 0;h[h.length-1]=r,this.spliceWithArray_(s.length,0,h)}},t}();function Py(t,e,n,i){return n===void 0&&(n="ObservableArray"),i===void 0&&(i=!1),Xf(),Oi(function(){var r=new $l(n,e,i,!1);eh(r.values_,Ce,r);var s=new Proxy(r.values_,Dy);return r.proxy_=s,t&&t.length&&r.spliceWithArray_(0,0,t),s})}var ba={clear:function(){return this.splice(0)},replace:function(e){var n=this[Ce];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];var o=this[Ce];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,n)}return o.spliceWithArray_(e,n,r)},spliceWithArray:function(e,n,i){return this[Ce].spliceWithArray_(e,n,i)},push:function(){for(var e=this[Ce],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,i),e.values_.length},pop:function(){return this.splice(Math.max(this[Ce].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[Ce],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(0,0,i),e.values_.length},reverse:function(){return ke.trackingDerivation&&We(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){ke.trackingDerivation&&We(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[Ce],i=n.dehanceValues_(n.values_).indexOf(e);return i>-1?(this.splice(i,1),!0):!1}};nt("at",Ht);nt("concat",Ht);nt("flat",Ht);nt("includes",Ht);nt("indexOf",Ht);nt("join",Ht);nt("lastIndexOf",Ht);nt("slice",Ht);nt("toString",Ht);nt("toLocaleString",Ht);nt("toSorted",Ht);nt("toSpliced",Ht);nt("with",Ht);nt("every",an);nt("filter",an);nt("find",an);nt("findIndex",an);nt("findLast",an);nt("findLastIndex",an);nt("flatMap",an);nt("forEach",an);nt("map",an);nt("some",an);nt("toReversed",an);nt("reduce",Rh);nt("reduceRight",Rh);function nt(t,e){typeof Array.prototype[t]=="function"&&(ba[t]=e(t))}function Ht(t){return function(){var e=this[Ce];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function an(t){return function(e,n){var i=this,r=this[Ce];r.atom_.reportObserved();var s=r.dehanceValues_(r.values_);return s[t](function(o,l){return e.call(n,o,l,i)})}}function Rh(t){return function(){var e=this,n=this[Ce];n.atom_.reportObserved();var i=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(s,o,l){return r(s,o,l,e)},i[t].apply(i,arguments)}}var Ly=Ei("ObservableArrayAdministration",$l);function Wa(t){return Ma(t)&&Ly(t[Ce])}var $y={},Kn="add",ka="delete",Fh=function(){function t(n,i,r){var s=this;i===void 0&&(i=bi),r===void 0&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ce]=$y,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=i,this.name_=r,rn(Map)||We(18),Oi(function(){s.keysAtom_=rh("ObservableMap.keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var e=t.prototype;return e.has_=function(i){return this.data_.has(i)},e.has=function(i){var r=this;if(!ke.trackingDerivation)return this.has_(i);var s=this.hasMap_.get(i);if(!s){var o=s=new mi(this.has_(i),ja,"ObservableMap.key?",!1);this.hasMap_.set(i,o),Ah(o,function(){return r.hasMap_.delete(i)})}return s.get()},e.set=function(i,r){var s=this.has_(i);if(Wt(this)){var o=Jt(this,{type:s?gn:Kn,object:this,newValue:r,name:i});if(!o)return this;r=o.newValue}return s?this.updateValue_(i,r):this.addValue_(i,r),this},e.delete=function(i){var r=this;if(this.keysAtom_,Wt(this)){var s=Jt(this,{type:ka,object:this,name:i});if(!s)return!1}if(this.has_(i)){var o=zr(),l=tn(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:ka,object:this,oldValue:this.data_.get(i).value_,name:i}:null;return wn(function(){var h;r.keysAtom_.reportChanged(),(h=r.hasMap_.get(i))==null||h.setNewValue_(!1);var m=r.data_.get(i);m.setNewValue_(void 0),r.data_.delete(i)}),l&&nn(this,d),!0}return!1},e.updateValue_=function(i,r){var s=this.data_.get(i);if(r=s.prepareNewValue_(r),r!==ke.UNCHANGED){var o=zr(),l=tn(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:gn,object:this,oldValue:s.value_,name:i,newValue:r}:null;s.setNewValue_(r),l&&nn(this,d)}},e.addValue_=function(i,r){var s=this;this.keysAtom_,wn(function(){var h,m=new mi(r,s.enhancer_,"ObservableMap.key",!1);s.data_.set(i,m),r=m.value_,(h=s.hasMap_.get(i))==null||h.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=zr(),l=tn(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:Kn,object:this,name:i,newValue:r}:null;l&&nn(this,d)},e.get=function(i){return this.has(i)?this.dehanceValue_(this.data_.get(i).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var i=this,r=this.keys();return ns({next:function(){var o=r.next(),l=o.done,d=o.value;return{done:l,value:l?void 0:i.get(d)}}})},e.entries=function(){var i=this,r=this.keys();return ns({next:function(){var o=r.next(),l=o.done,d=o.value;return{done:l,value:l?void 0:[d,i.get(d)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(i,r){for(var s=Gi(this),o;!(o=s()).done;){var l=o.value,d=l[0],h=l[1];i.call(r,h,d,this)}},e.merge=function(i){var r=this;return Ai(i)&&(i=new Map(i)),wn(function(){Wn(i)?uv(i).forEach(function(s){return r.set(s,i[s])}):Array.isArray(i)?i.forEach(function(s){var o=s[0],l=s[1];return r.set(o,l)}):ar(i)?(ov(i)||We(19,i),i.forEach(function(s,o){return r.set(o,s)})):i!=null&&We(20,i)}),this},e.clear=function(){var i=this;wn(function(){mh(function(){for(var r=Gi(i.keys()),s;!(s=r()).done;){var o=s.value;i.delete(o)}})})},e.replace=function(i){var r=this;return wn(function(){for(var s=My(i),o=new Map,l=!1,d=Gi(r.data_.keys()),h;!(h=d()).done;){var m=h.value;if(!s.has(m)){var y=r.delete(m);if(y)l=!0;else{var g=r.data_.get(m);o.set(m,g)}}}for(var O=Gi(s.entries()),_;!(_=O()).done;){var S=_.value,E=S[0],R=S[1],j=r.data_.has(E);if(r.set(E,R),r.data_.has(E)){var J=r.data_.get(E);o.set(E,J),j||(l=!0)}}if(!l)if(r.data_.size!==o.size)r.keysAtom_.reportChanged();else for(var z=r.data_.keys(),X=o.keys(),ne=z.next(),oe=X.next();!ne.done;){if(ne.value!==oe.value){r.keysAtom_.reportChanged();break}ne=z.next(),oe=X.next()}r.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(i,r){return fs(this,i)},e.intercept_=function(i){return ds(this,i)},or(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Ai=Ei("ObservableMap",Fh);function My(t){if(ar(t)||Ai(t))return t;if(Array.isArray(t))return new Map(t);if(Wn(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return We(21,t)}var By={},Ih=function(){function t(n,i,r){var s=this;i===void 0&&(i=bi),r===void 0&&(r="ObservableSet"),this.name_=void 0,this[Ce]=By,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,rn(Set)||We(22),this.enhancer_=function(o,l){return i(o,l,r)},Oi(function(){s.atom_=rh(s.name_),n&&s.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.clear=function(){var i=this;wn(function(){mh(function(){for(var r=Gi(i.data_.values()),s;!(s=r()).done;){var o=s.value;i.delete(o)}})})},e.forEach=function(i,r){for(var s=Gi(this),o;!(o=s()).done;){var l=o.value;i.call(r,l,l,this)}},e.add=function(i){var r=this;if(this.atom_,Wt(this)){var s=Jt(this,{type:Kn,object:this,newValue:i});if(!s)return this}if(!this.has(i)){wn(function(){r.data_.add(r.enhancer_(i,void 0)),r.atom_.reportChanged()});var o=!1,l=tn(this),d=l||o?{observableKind:"set",debugObjectName:this.name_,type:Kn,object:this,newValue:i}:null;l&&nn(this,d)}return this},e.delete=function(i){var r=this;if(Wt(this)){var s=Jt(this,{type:ka,object:this,oldValue:i});if(!s)return!1}if(this.has(i)){var o=!1,l=tn(this),d=l||o?{observableKind:"set",debugObjectName:this.name_,type:ka,object:this,oldValue:i}:null;return wn(function(){r.atom_.reportChanged(),r.data_.delete(i)}),l&&nn(this,d),!0}return!1},e.has=function(i){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(i))},e.entries=function(){var i=0,r=Array.from(this.keys()),s=Array.from(this.values());return ns({next:function(){var l=i;return i+=1,l<s.length?{value:[r[l],s[l]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var i=this,r=0,s=Array.from(this.data_.values());return ns({next:function(){return r<s.length?{value:i.dehanceValue_(s[r++]),done:!1}:{done:!0}}})},e.intersection=function(i){if(_n(i))return i.intersection(this);var r=new Set(this);return r.intersection(i)},e.union=function(i){if(_n(i))return i.union(this);var r=new Set(this);return r.union(i)},e.difference=function(i){return new Set(this).difference(i)},e.symmetricDifference=function(i){if(_n(i))return i.symmetricDifference(this);var r=new Set(this);return r.symmetricDifference(i)},e.isSubsetOf=function(i){return new Set(this).isSubsetOf(i)},e.isSupersetOf=function(i){return new Set(this).isSupersetOf(i)},e.isDisjointFrom=function(i){if(_n(i))return i.isDisjointFrom(this);var r=new Set(this);return r.isDisjointFrom(i)},e.replace=function(i){var r=this;return lr(i)&&(i=new Set(i)),wn(function(){Array.isArray(i)?(r.clear(),i.forEach(function(s){return r.add(s)})):_n(i)?(r.clear(),i.forEach(function(s){return r.add(s)})):i!=null&&We("Cannot initialize set from "+i)}),this},e.observe_=function(i,r){return fs(this,i)},e.intercept_=function(i){return ds(this,i)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},or(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),lr=Ei("ObservableSet",Ih),cd=Object.create(null),dd="remove",Dh=function(){function t(n,i,r,s){i===void 0&&(i=new Map),s===void 0&&(s=Mv),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=i,this.name_=r,this.defaultAnnotation_=s,this.keysAtom_=new Qn("ObservableObject.keys"),this.isPlainObject_=Wn(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(i){return this.values_.get(i).get()},e.setObservablePropValue_=function(i,r){var s=this.values_.get(i);if(s instanceof sn)return s.set(r),!0;if(Wt(this)){var o=Jt(this,{type:gn,object:this.proxy_||this.target_,name:i,newValue:r});if(!o)return null;r=o.newValue}if(r=s.prepareNewValue_(r),r!==ke.UNCHANGED){var l=tn(this),d=!1,h=l||d?{type:gn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:i,newValue:r}:null;s.setNewValue_(r),l&&nn(this,h)}return!0},e.get_=function(i){return ke.trackingDerivation&&!Nn(this.target_,i)&&this.has_(i),this.target_[i]},e.set_=function(i,r,s){return s===void 0&&(s=!1),Nn(this.target_,i)?this.values_.has(i)?this.setObservablePropValue_(i,r):s?Reflect.set(this.target_,i,r):(this.target_[i]=r,!0):this.extend_(i,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},e.has_=function(i){if(!ke.trackingDerivation)return i in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(i);return r||(r=new mi(i in this.target_,ja,"ObservableObject.key?",!1),this.pendingKeys_.set(i,r)),r.get()},e.make_=function(i,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(!(i in this.target_)){var s;if((s=this.target_[fn])!=null&&s[i])return;We(1,r.annotationType_,this.name_+"."+i.toString())}for(var o=this.target_;o&&o!==$a;){var l=pa(o,i);if(l){var d=r.make_(this,i,l,o);if(d===0)return;if(d===1)break}o=Object.getPrototypeOf(o)}hd(this,r,i)}},e.extend_=function(i,r,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(i,r,o);var l=s.extend_(this,i,r,o);return l&&hd(this,s,i),l},e.defineProperty_=function(i,r,s){s===void 0&&(s=!1),this.keysAtom_;try{Yt();var o=this.delete_(i);if(!o)return o;if(Wt(this)){var l=Jt(this,{object:this.proxy_||this.target_,name:i,type:Kn,newValue:r.value});if(!l)return null;var d=l.newValue;r.value!==d&&(r=Jn({},r,{value:d}))}if(s){if(!Reflect.defineProperty(this.target_,i,r))return!1}else pn(this.target_,i,r);this.notifyPropertyAddition_(i,r.value)}finally{Xt()}return!0},e.defineObservableProperty_=function(i,r,s,o){o===void 0&&(o=!1),this.keysAtom_;try{Yt();var l=this.delete_(i);if(!l)return l;if(Wt(this)){var d=Jt(this,{object:this.proxy_||this.target_,name:i,type:Kn,newValue:r});if(!d)return null;r=d.newValue}var h=fd(i),m={configurable:ke.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,i,m))return!1}else pn(this.target_,i,m);var y=new mi(r,s,"ObservableObject.key",!1);this.values_.set(i,y),this.notifyPropertyAddition_(i,y.value_)}finally{Xt()}return!0},e.defineComputedProperty_=function(i,r,s){s===void 0&&(s=!1),this.keysAtom_;try{Yt();var o=this.delete_(i);if(!o)return o;if(Wt(this)){var l=Jt(this,{object:this.proxy_||this.target_,name:i,type:Kn,newValue:void 0});if(!l)return null}r.name||(r.name="ObservableObject.key"),r.context=this.proxy_||this.target_;var d=fd(i),h={configurable:ke.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:d.get,set:d.set};if(s){if(!Reflect.defineProperty(this.target_,i,h))return!1}else pn(this.target_,i,h);this.values_.set(i,new sn(r)),this.notifyPropertyAddition_(i,void 0)}finally{Xt()}return!0},e.delete_=function(i,r){if(r===void 0&&(r=!1),this.keysAtom_,!Nn(this.target_,i))return!0;if(Wt(this)){var s=Jt(this,{object:this.proxy_||this.target_,name:i,type:dd});if(!s)return null}try{var o;Yt();var l=tn(this),d=!1,h=this.values_.get(i),m=void 0;if(!h&&(l||d)){var y;m=(y=pa(this.target_,i))==null?void 0:y.value}if(r){if(!Reflect.deleteProperty(this.target_,i))return!1}else delete this.target_[i];if(h&&(this.values_.delete(i),h instanceof mi&&(m=h.value_),kh(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(i))==null||o.set(i in this.target_),l||d){var g={type:dd,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:m,name:i};l&&nn(this,g)}}finally{Xt()}return!0},e.observe_=function(i,r){return fs(this,i)},e.intercept_=function(i){return ds(this,i)},e.notifyPropertyAddition_=function(i,r){var s,o=tn(this),l=!1;if(o||l){var d=o||l?{type:Kn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:i,newValue:r}:null;o&&nn(this,d)}(s=this.pendingKeys_)==null||(s=s.get(i))==null||s.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Ua(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function cr(t,e){var n;if(Nn(t,Ce))return t;var i=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",r=new Dh(t,new Map,String(i),Jv(e));return Ba(t,Ce,r),t}var Uy=Ei("ObservableObjectAdministration",Dh);function fd(t){return cd[t]||(cd[t]={get:function(){return this[Ce].getObservablePropValue_(t)},set:function(n){return this[Ce].setObservablePropValue_(t,n)}})}function Ja(t){return Ma(t)?Uy(t[Ce]):!1}function hd(t,e,n){var i;(i=t.target_[fn])==null||delete i[n]}var jy=Lh(0),Vy=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),vu=0,Ph=function(){};function Hy(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}Hy(Ph,Array.prototype);var Ml=function(t){function e(i,r,s,o){var l;return s===void 0&&(s="ObservableArray"),o===void 0&&(o=!1),l=t.call(this)||this,Oi(function(){var d=new $l(s,r,o,!0);d.proxy_=l,eh(l,Ce,d),i&&i.length&&l.spliceWithArray(0,0,i),Vy&&Object.defineProperty(l,"0",jy)}),l}ih(e,t);var n=e.prototype;return n.concat=function(){this[Ce].atom_.reportObserved();for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(l){return Wa(l)?l.slice():l}))},n[Symbol.iterator]=function(){var i=this,r=0;return ns({next:function(){return r<i.length?{value:i[r++],done:!1}:{done:!0,value:void 0}}})},or(e,[{key:"length",get:function(){return this[Ce].getArrayLength_()},set:function(r){this[Ce].setArrayLength_(r)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(Ph);Object.entries(ba).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&Ba(Ml.prototype,e,n)});function Lh(t){return{enumerable:!1,configurable:!0,get:function(){return this[Ce].get_(t)},set:function(n){this[Ce].set_(t,n)}}}function qy(t){pn(Ml.prototype,""+t,Lh(t))}function $h(t){if(t>vu){for(var e=vu;e<t+100;e++)qy(e);vu=t}}$h(1e3);function zy(t,e,n){return new Ml(t,e,n)}function rl(t,e){if(typeof t=="object"&&t!==null){if(Wa(t))return e!==void 0&&We(23),t[Ce].atom_;if(lr(t))return t.atom_;if(Ai(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||We(25,e,sl(t)),n}if(Ja(t)){if(!e)return We(26);var i=t[Ce].values_.get(e);return i||We(27,e,sl(t)),i}if(Dl(t)||za(t)||ya(t))return t}else if(rn(t)&&ya(t[Ce]))return t[Ce];We(28)}function Ky(t,e){if(t||We(29),Dl(t)||za(t)||ya(t)||Ai(t)||lr(t))return t;if(t[Ce])return t[Ce];We(24,t)}function sl(t,e){var n;if(e!==void 0)n=rl(t,e);else{if(Ka(t))return t.name;Ja(t)||Ai(t)||lr(t)?n=Ky(t):n=rl(t)}return n.name_}function Oi(t){var e=Ni(),n=Ha(!0);Yt();try{return t()}finally{Xt(),qa(n),An(e)}}var pd=$a.toString;function Mh(t,e,n){return n===void 0&&(n=-1),al(t,e,n)}function al(t,e,n,i,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var s=typeof t;if(s!=="function"&&s!=="object"&&typeof e!="object")return!1;var o=pd.call(t);if(o!==pd.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=md(t),e=md(e);var l=o==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var d=t.constructor,h=e.constructor;if(d!==h&&!(rn(d)&&d instanceof d&&rn(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),i=i||[],r=r||[];for(var m=i.length;m--;)if(i[m]===t)return r[m]===e;if(i.push(t),r.push(e),l){if(m=t.length,m!==e.length)return!1;for(;m--;)if(!al(t[m],e[m],n-1,i,r))return!1}else{var y=Object.keys(t),g;if(m=y.length,Object.keys(e).length!==m)return!1;for(;m--;)if(g=y[m],!(Nn(e,g)&&al(t[g],e[g],n-1,i,r)))return!1}return i.pop(),r.pop(),!0}function md(t){return Wa(t)?t.slice():ar(t)||Ai(t)||_n(t)||lr(t)?Array.from(t.entries()):t}function ns(t){return t[Symbol.iterator]=Gy,t}function Gy(){return this}["Symbol","Map","Set"].forEach(function(t){var e=Jf();typeof e[t]=="undefined"&&We("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:fy,extras:{getDebugName:sl},$mobx:Ce});function Wy(t,e=[]){je.useEffect(()=>{const n=Ga(t);return()=>n()},e)}function Bh(t,e={}){const{defaultValue:n,deps:i=[]}=e,r=je.useMemo(()=>t,i),[s,o]=je.useState(()=>r()||n);return je.useEffect(()=>{const l=Ga(()=>o(r()));return()=>l()},[r,...i]),s}function Jy(t,e,n=[]){const i=je.useMemo(()=>t,n),r=je.useMemo(()=>e,n);je.useEffect(()=>{const s=by(i,r);return()=>s()},[i,r])}let Bl=new Map;const ol=je.createContext(Bl),Yy=({children:t,stores:e})=>{const n=je.useContext(ol),i=je.useMemo(()=>{const r=new Map;return e.forEach(s=>r.set(s.class,s.value)),Bl=new Map([...n,...r])},[]);return mg.jsx(ol.Provider,{value:i,children:t})};function Xy(t){return je.useContext(ol).get(t)}function Qy(t){return Bl.get(t)}var Zy=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ya(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ia={exports:{}},eb=ia.exports,gd;function tb(){return gd||(gd=1,function(t,e){(function(n,i){t.exports=i()})(eb,function(){var n=function(a,u){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(c[p]=f[p])})(a,u)},i=function(){return(i=Object.assign||function(a){for(var u,c=1,f=arguments.length;c<f;c++)for(var p in u=arguments[c])Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p]);return a}).apply(this,arguments)};function r(a,u,c){for(var f,p=0,v=u.length;p<v;p++)!f&&p in u||((f=f||Array.prototype.slice.call(u,0,p))[p]=u[p]);return a.concat(f||Array.prototype.slice.call(u))}var s=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:Zy,o=Object.keys,l=Array.isArray;function d(a,u){return typeof u!="object"||o(u).forEach(function(c){a[c]=u[c]}),a}typeof Promise=="undefined"||s.Promise||(s.Promise=Promise);var h=Object.getPrototypeOf,m={}.hasOwnProperty;function y(a,u){return m.call(a,u)}function g(a,u){typeof u=="function"&&(u=u(h(a))),(typeof Reflect=="undefined"?o:Reflect.ownKeys)(u).forEach(function(c){_(a,c,u[c])})}var O=Object.defineProperty;function _(a,u,c,f){O(a,u,d(c&&y(c,"get")&&typeof c.get=="function"?{get:c.get,set:c.set,configurable:!0}:{value:c,configurable:!0,writable:!0},f))}function S(a){return{from:function(u){return a.prototype=Object.create(u.prototype),_(a.prototype,"constructor",a),{extend:g.bind(null,a.prototype)}}}}var E=Object.getOwnPropertyDescriptor,R=[].slice;function j(a,u,c){return R.call(a,u,c)}function J(a,u){return u(a)}function z(a){if(!a)throw new Error("Assertion Failed")}function X(a){s.setImmediate?setImmediate(a):setTimeout(a,0)}function ne(a,u){if(typeof u=="string"&&y(a,u))return a[u];if(!u)return a;if(typeof u!="string"){for(var c=[],f=0,p=u.length;f<p;++f){var v=ne(a,u[f]);c.push(v)}return c}var b=u.indexOf(".");if(b!==-1){var k=a[u.substr(0,b)];return k==null?void 0:ne(k,u.substr(b+1))}}function oe(a,u,c){if(a&&u!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof u!="string"&&"length"in u){z(typeof c!="string"&&"length"in c);for(var f=0,p=u.length;f<p;++f)oe(a,u[f],c[f])}else{var v,b,k=u.indexOf(".");k!==-1?(v=u.substr(0,k),(b=u.substr(k+1))===""?c===void 0?l(a)&&!isNaN(parseInt(v))?a.splice(v,1):delete a[v]:a[v]=c:oe(k=!(k=a[v])||!y(a,v)?a[v]={}:k,b,c)):c===void 0?l(a)&&!isNaN(parseInt(u))?a.splice(u,1):delete a[u]:a[u]=c}}function Se(a){var u,c={};for(u in a)y(a,u)&&(c[u]=a[u]);return c}var ve=[].concat;function ze(a){return ve.apply([],a)}var qt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ze([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(u){return u+a+"Array"})}))).filter(function(a){return s[a]}),Ne=new Set(qt.map(function(a){return s[a]})),Re=null;function Ve(a){return Re=new WeakMap,a=function u(c){if(!c||typeof c!="object")return c;var f=Re.get(c);if(f)return f;if(l(c)){f=[],Re.set(c,f);for(var p=0,v=c.length;p<v;++p)f.push(u(c[p]))}else if(Ne.has(c.constructor))f=c;else{var b,k=h(c);for(b in f=k===Object.prototype?{}:Object.create(k),Re.set(c,f),c)y(c,b)&&(f[b]=u(c[b]))}return f}(a),Re=null,a}var M={}.toString;function N(a){return M.call(a).slice(8,-1)}var K=typeof Symbol!="undefined"?Symbol.iterator:"@@iterator",ie=typeof K=="symbol"?function(a){var u;return a!=null&&(u=a[K])&&u.apply(a)}:function(){return null};function ce(a,u){return u=a.indexOf(u),0<=u&&a.splice(u,1),0<=u}var ae={};function B(a){var u,c,f,p;if(arguments.length===1){if(l(a))return a.slice();if(this===ae&&typeof a=="string")return[a];if(p=ie(a)){for(c=[];!(f=p.next()).done;)c.push(f.value);return c}if(a==null)return[a];if(typeof(u=a.length)!="number")return[a];for(c=new Array(u);u--;)c[u]=a[u];return c}for(u=arguments.length,c=new Array(u);u--;)c[u]=arguments[u];return c}var Fe=typeof Symbol!="undefined"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},vn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],zt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(vn),$e={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 Xe(a,u){this.name=a,this.message=u}function D(a,u){return a+". Errors: "+Object.keys(u).map(function(c){return u[c].toString()}).filter(function(c,f,p){return p.indexOf(c)===f}).join(`
|
|
27
|
-
`)}function
|
|
28
|
-
`+v:""),this.inner=v||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=$e[u]||c,this.inner=null)}return S(f).from(Me),a[u]=f,a},{});ye.Syntax=SyntaxError,ye.Type=TypeError,ye.Range=RangeError;var et=vn.reduce(function(a,u){return a[u+"Error"]=ye[u],a},{}),Je=zt.reduce(function(a,u){return["Syntax","Type","Range"].indexOf(u)===-1&&(a[u+"Error"]=ye[u]),a},{});function Oe(){}function wt(a){return a}function lt(a,u){return a==null||a===wt?u:function(c){return u(a(c))}}function Ae(a,u){return function(){a.apply(this,arguments),u.apply(this,arguments)}}function mt(a,u){return a===Oe?u:function(){var c=a.apply(this,arguments);c!==void 0&&(arguments[0]=c);var f=this.onsuccess,p=this.onerror;this.onsuccess=null,this.onerror=null;var v=u.apply(this,arguments);return f&&(this.onsuccess=this.onsuccess?Ae(f,this.onsuccess):f),p&&(this.onerror=this.onerror?Ae(p,this.onerror):p),v!==void 0?v:c}}function rt(a,u){return a===Oe?u:function(){a.apply(this,arguments);var c=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,u.apply(this,arguments),c&&(this.onsuccess=this.onsuccess?Ae(c,this.onsuccess):c),f&&(this.onerror=this.onerror?Ae(f,this.onerror):f)}}function he(a,u){return a===Oe?u:function(c){var f=a.apply(this,arguments);d(c,f);var p=this.onsuccess,v=this.onerror;return this.onsuccess=null,this.onerror=null,c=u.apply(this,arguments),p&&(this.onsuccess=this.onsuccess?Ae(p,this.onsuccess):p),v&&(this.onerror=this.onerror?Ae(v,this.onerror):v),f===void 0?c===void 0?void 0:c:d(f,c)}}function Ye(a,u){return a===Oe?u:function(){return u.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function ue(a,u){return a===Oe?u:function(){var c=a.apply(this,arguments);if(c&&typeof c.then=="function"){for(var f=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return c.then(function(){return u.apply(f,v)})}return u.apply(this,arguments)}}Je.ModifyError=H,Je.DexieError=Xe,Je.BulkError=pt;var Te=typeof location!="undefined"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function tt(a){Te=a}var ct={},ut=100,qt=typeof Promise=="undefined"?[]:function(){var a=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[a,h(a),a];var u=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[u,h(u),a]}(),vn=qt[0],zt=qt[1],qt=qt[2],zt=zt&&zt.then,Zn=vn&&vn.constructor,vo=!!qt,pr=function(a,u){mr.push([a,u]),vs&&(queueMicrotask(Hm),vs=!1)},yo=!0,vs=!0,ei=[],ys=[],bo=wt,Fn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Oe,pgp:!1,env:{},finalize:Oe},Ee=Fn,mr=[],ti=0,bs=[];function ge(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var u=this._PSD=Ee;if(typeof a!="function"){if(a!==ct)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&_o(this,this._value))}this._state=null,this._value=null,++u.ref,function c(f,p){try{p(function(v){if(f._state===null){if(v===f)throw new TypeError("A promise cannot be resolved with itself.");var b=f._lib&&Ti();v&&typeof v.then=="function"?c(f,function(k,A){v instanceof ge?v._then(k,A):v.then(k,A)}):(f._state=!0,f._value=v,uc(f)),b&&Ci()}},_o.bind(null,f))}catch(v){_o(f,v)}}(this,a)}var ko={get:function(){var a=Ee,u=Ss;function c(f,p){var v=this,b=!a.global&&(a!==Ee||u!==Ss),k=b&&!Dn(),A=new ge(function(T,I){wo(v,new oc(cc(f,a,b,k),cc(p,a,b,k),T,I,a))});return this._consoleTask&&(A._consoleTask=this._consoleTask),A}return c.prototype=ct,c},set:function(a){_(this,"then",a&&a.prototype===ct?ko:{get:function(){return a},set:ko.set})}};function oc(a,u,c,f,p){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof u=="function"?u:null,this.resolve=c,this.reject=f,this.psd=p}function _o(a,u){var c,f;ys.push(u),a._state===null&&(c=a._lib&&Ti(),u=bo(u),a._state=!1,a._value=u,f=a,ei.some(function(p){return p._value===f._value})||ei.push(f),uc(a),c&&Ci())}function uc(a){var u=a._listeners;a._listeners=[];for(var c=0,f=u.length;c<f;++c)wo(a,u[c]);var p=a._PSD;--p.ref||p.finalize(),ti===0&&(++ti,pr(function(){--ti==0&&So()},[]))}function wo(a,u){if(a._state!==null){var c=a._state?u.onFulfilled:u.onRejected;if(c===null)return(a._state?u.resolve:u.reject)(a._value);++u.psd.ref,++ti,pr(Vm,[c,a,u])}else a._listeners.push(u)}function Vm(a,u,c){try{var f,p=u._value;!u._state&&ys.length&&(ys=[]),f=Te&&u._consoleTask?u._consoleTask.run(function(){return a(p)}):a(p),u._state||ys.indexOf(p)!==-1||function(v){for(var b=ei.length;b;)if(ei[--b]._value===v._value)return ei.splice(b,1)}(u),c.resolve(f)}catch(v){c.reject(v)}finally{--ti==0&&So(),--c.psd.ref||c.psd.finalize()}}function Hm(){ni(Fn,function(){Ti()&&Ci()})}function Ti(){var a=yo;return vs=yo=!1,a}function Ci(){var a,u,c;do for(;0<mr.length;)for(a=mr,mr=[],c=a.length,u=0;u<c;++u){var f=a[u];f[0].apply(null,f[1])}while(0<mr.length);vs=yo=!0}function So(){var a=ei;ei=[],a.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)});for(var u=bs.slice(0),c=u.length;c;)u[--c]()}function ks(a){return new ge(ct,!1,a)}function st(a,u){var c=Ee;return function(){var f=Ti(),p=Ee;try{return Pn(c,!0),a.apply(this,arguments)}catch(v){u&&u(v)}finally{Pn(p,!1),f&&Ci()}}}g(ge.prototype,{then:ko,_then:function(a,u){wo(this,new oc(null,null,a,u,Ee))},catch:function(a){if(arguments.length===1)return this.then(null,a);var u=a,c=arguments[1];return typeof u=="function"?this.then(null,function(f){return(f instanceof u?c:ks)(f)}):this.then(null,function(f){return(f&&f.name===u?c:ks)(f)})},finally:function(a){return this.then(function(u){return ge.resolve(a()).then(function(){return u})},function(u){return ge.resolve(a()).then(function(){return ks(u)})})},timeout:function(a,u){var c=this;return a<1/0?new ge(function(f,p){var v=setTimeout(function(){return p(new ye.Timeout(u))},a);c.then(f,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol!="undefined"&&Symbol.toStringTag&&_(ge.prototype,Symbol.toStringTag,"Dexie.Promise"),Fn.env=lc(),g(ge,{all:function(){var a=B.apply(null,arguments).map(Es);return new ge(function(u,c){a.length===0&&u([]);var f=a.length;a.forEach(function(p,v){return ge.resolve(p).then(function(b){a[v]=b,--f||u(a)},c)})})},resolve:function(a){return a instanceof ge?a:a&&typeof a.then=="function"?new ge(function(u,c){a.then(u,c)}):new ge(ct,!0,a)},reject:ks,race:function(){var a=B.apply(null,arguments).map(Es);return new ge(function(u,c){a.map(function(f){return ge.resolve(f).then(u,c)})})},PSD:{get:function(){return Ee},set:function(a){return Ee=a}},totalEchoes:{get:function(){return Ss}},newPSD:In,usePSD:ni,scheduler:{get:function(){return pr},set:function(a){pr=a}},rejectionMapper:{get:function(){return bo},set:function(a){bo=a}},follow:function(a,u){return new ge(function(c,f){return In(function(p,v){var b=Ee;b.unhandleds=[],b.onunhandled=v,b.finalize=Ae(function(){var k,A=this;k=function(){A.unhandleds.length===0?p():v(A.unhandleds[0])},bs.push(function T(){k(),bs.splice(bs.indexOf(T),1)}),++ti,pr(function(){--ti==0&&So()},[])},b.finalize),a()},u,c,f)})}}),Zn&&(Zn.allSettled&&_(ge,"allSettled",function(){var a=B.apply(null,arguments).map(Es);return new ge(function(u){a.length===0&&u([]);var c=a.length,f=new Array(c);a.forEach(function(p,v){return ge.resolve(p).then(function(b){return f[v]={status:"fulfilled",value:b}},function(b){return f[v]={status:"rejected",reason:b}}).then(function(){return--c||u(f)})})})}),Zn.any&&typeof AggregateError!="undefined"&&_(ge,"any",function(){var a=B.apply(null,arguments).map(Es);return new ge(function(u,c){a.length===0&&c(new AggregateError([]));var f=a.length,p=new Array(f);a.forEach(function(v,b){return ge.resolve(v).then(function(k){return u(k)},function(k){p[b]=k,--f||c(new AggregateError(p))})})})}),Zn.withResolvers&&(ge.withResolvers=Zn.withResolvers));var bt={awaits:0,echoes:0,id:0},qm=0,_s=[],ws=0,Ss=0,zm=0;function In(a,u,c,f){var p=Ee,v=Object.create(p);return v.parent=p,v.ref=0,v.global=!1,v.id=++zm,Fn.env,v.env=vo?{Promise:ge,PromiseProp:{value:ge,configurable:!0,writable:!0},all:ge.all,race:ge.race,allSettled:ge.allSettled,any:ge.any,resolve:ge.resolve,reject:ge.reject}:{},u&&d(v,u),++p.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},f=ni(v,a,c,f),v.ref===0&&v.finalize(),f}function Ri(){return bt.id||(bt.id=++qm),++bt.awaits,bt.echoes+=ut,bt.id}function Dn(){return!!bt.awaits&&(--bt.awaits==0&&(bt.id=0),bt.echoes=bt.awaits*ut,!0)}function Es(a){return bt.echoes&&a&&a.constructor===Zn?(Ri(),a.then(function(u){return Dn(),u},function(u){return Dn(),dt(u)})):a}function Km(){var a=_s[_s.length-1];_s.pop(),Pn(a,!1)}function Pn(a,u){var c,f=Ee;(u?!bt.echoes||ws++&&a===Ee:!ws||--ws&&a===Ee)||queueMicrotask(u?function(p){++Ss,bt.echoes&&--bt.echoes!=0||(bt.echoes=bt.awaits=bt.id=0),_s.push(Ee),Pn(p,!0)}.bind(null,a):Km),a!==Ee&&(Ee=a,f===Fn&&(Fn.env=lc()),vo&&(c=Fn.env.Promise,u=a.env,(f.global||a.global)&&(Object.defineProperty(s,"Promise",u.PromiseProp),c.all=u.all,c.race=u.race,c.resolve=u.resolve,c.reject=u.reject,u.allSettled&&(c.allSettled=u.allSettled),u.any&&(c.any=u.any))))}function lc(){var a=s.Promise;return vo?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function ni(a,u,c,f,p){var v=Ee;try{return Pn(a,!0),u(c,f,p)}finally{Pn(v,!1)}}function cc(a,u,c,f){return typeof a!="function"?a:function(){var p=Ee;c&&Ri(),Pn(u,!0);try{return a.apply(this,arguments)}finally{Pn(p,!1),f&&queueMicrotask(Dn)}}}function Eo(a){Promise===Zn&&bt.echoes===0?ws===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+zt).indexOf("[native code]")===-1&&(Ri=Dn=Oe);var dt=ge.reject,ii="",yn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",dc="String expected.",Fi=[],Ns="__dbnames",No="readonly",Ao="readwrite";function ri(a,u){return a?u?function(){return a.apply(this,arguments)&&u.apply(this,arguments)}:a:u}var fc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function As(a){return typeof a!="string"||/\./.test(a)?function(u){return u}:function(u){return u[a]===void 0&&a in u&&delete(u=Ve(u))[a],u}}function hc(){throw ye.Type()}function qe(a,u){try{var c=pc(a),f=pc(u);if(c!==f)return c==="Array"?1:f==="Array"?-1:c==="binary"?1:f==="binary"?-1:c==="string"?1:f==="string"?-1:c==="Date"?1:f!=="Date"?NaN:-1;switch(c){case"number":case"Date":case"string":return u<a?1:a<u?-1:0;case"binary":return function(p,v){for(var b=p.length,k=v.length,A=b<k?b:k,T=0;T<A;++T)if(p[T]!==v[T])return p[T]<v[T]?-1:1;return b===k?0:b<k?-1:1}(mc(a),mc(u));case"Array":return function(p,v){for(var b=p.length,k=v.length,A=b<k?b:k,T=0;T<A;++T){var I=qe(p[T],v[T]);if(I!==0)return I}return b===k?0:b<k?-1:1}(a,u)}}catch{}return NaN}function pc(a){var u=typeof a;return u!="object"?u:ArrayBuffer.isView(a)?"binary":(a=N(a),a==="ArrayBuffer"?"binary":a)}function mc(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}var gc=(it.prototype._trans=function(a,u,c){var f=this._tx||Ee.trans,p=this.name,v=Te&&typeof console!="undefined"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function b(T,I,w){if(!w.schema[p])throw new ye.NotFound("Table "+p+" not part of transaction");return u(w.idbtrans,w)}var k=Ti();try{var A=f&&f.db._novip===this.db._novip?f===Ee.trans?f._promise(a,b,c):In(function(){return f._promise(a,b,c)},{trans:f,transless:Ee.transless||Ee}):function T(I,w,L,x){if(I.idbdb&&(I._state.openComplete||Ee.letThrough||I._vip)){var F=I._createTransaction(w,L,I._dbSchema);try{F.create(),I._state.PR1398_maxLoop=3}catch(P){return P.name===_e.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return T(I,w,L,x)})):dt(P)}return F._promise(w,function(P,C){return In(function(){return Ee.trans=F,x(P,C,F)})}).then(function(P){if(w==="readwrite")try{F.idbtrans.commit()}catch{}return w==="readonly"?P:F._completion.then(function(){return P})})}if(I._state.openComplete)return dt(new ye.DatabaseClosed(I._state.dbOpenError));if(!I._state.isBeingOpened){if(!I._state.autoOpen)return dt(new ye.DatabaseClosed);I.open().catch(Oe)}return I._state.dbReadyPromise.then(function(){return T(I,w,L,x)})}(this.db,a,[this.name],b);return v&&(A._consoleTask=v,A=A.catch(function(T){return console.trace(T),dt(T)})),A}finally{k&&Ci()}},it.prototype.get=function(a,u){var c=this;return a&&a.constructor===Object?this.where(a).first(u):a==null?dt(new ye.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return c.core.get({trans:f,key:a}).then(function(p){return c.hook.reading.fire(p)})}).then(u)},it.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(l(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var u=o(a);if(u.length===1)return this.where(u[0]).equals(a[u[0]]);var c=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&u.every(function(T){return 0<=k.keyPath.indexOf(T)})){for(var A=0;A<u.length;++A)if(u.indexOf(k.keyPath[A])===-1)return!1;return!0}return!1}).sort(function(k,A){return k.keyPath.length-A.keyPath.length})[0];if(c&&this.db._maxKey!==ii){var v=c.keyPath.slice(0,u.length);return this.where(v).equals(v.map(function(A){return a[A]}))}!c&&Te&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(u.join("+"),"]"));var f=this.schema.idxByName;function p(k,A){return qe(k,A)===0}var b=u.reduce(function(w,A){var T=w[0],I=w[1],w=f[A],L=a[A];return[T||w,T||!w?ri(I,w&&w.multi?function(x){return x=ne(x,A),l(x)&&x.some(function(F){return p(L,F)})}:function(x){return p(L,ne(x,A))}):I]},[null,null]),v=b[0],b=b[1];return v?this.where(v.name).equals(a[v.keyPath]).filter(b):c?this.filter(b):this.where(u).equals("")},it.prototype.filter=function(a){return this.toCollection().and(a)},it.prototype.count=function(a){return this.toCollection().count(a)},it.prototype.offset=function(a){return this.toCollection().offset(a)},it.prototype.limit=function(a){return this.toCollection().limit(a)},it.prototype.each=function(a){return this.toCollection().each(a)},it.prototype.toArray=function(a){return this.toCollection().toArray(a)},it.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},it.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,l(a)?"[".concat(a.join("+"),"]"):a))},it.prototype.reverse=function(){return this.toCollection().reverse()},it.prototype.mapToClass=function(a){var u,c=this.db,f=this.name;function p(){return u!==null&&u.apply(this,arguments)||this}(this.schema.mappedClass=a).prototype instanceof hc&&(function(A,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function I(){this.constructor=A}n(A,T),A.prototype=T===null?Object.create(T):(I.prototype=T.prototype,new I)}(p,u=a),Object.defineProperty(p.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),p.prototype.table=function(){return f},a=p);for(var v=new Set,b=a.prototype;b;b=h(b))Object.getOwnPropertyNames(b).forEach(function(A){return v.add(A)});function k(A){if(!A)return A;var T,I=Object.create(a.prototype);for(T in A)if(!v.has(T))try{I[T]=A[T]}catch{}return I}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=k,this.hook("reading",k),a},it.prototype.defineClass=function(){return this.mapToClass(function(a){d(this,a)})},it.prototype.add=function(a,u){var c=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=a;return v&&p&&(b=As(v)(a)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"add",keys:u!=null?[u]:null,values:[b]})}).then(function(k){return k.numFailures?ge.reject(k.failures[0]):k.lastResult}).then(function(k){if(v)try{oe(a,v,k)}catch{}return k})},it.prototype.update=function(a,u){return typeof a!="object"||l(a)?this.where(":id").equals(a).modify(u):(a=ne(a,this.schema.primKey.keyPath),a===void 0?dt(new ye.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(u))},it.prototype.put=function(a,u){var c=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=a;return v&&p&&(b=As(v)(a)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"put",values:[b],keys:u!=null?[u]:null})}).then(function(k){return k.numFailures?ge.reject(k.failures[0]):k.lastResult}).then(function(k){if(v)try{oe(a,v,k)}catch{}return k})},it.prototype.delete=function(a){var u=this;return this._trans("readwrite",function(c){return u.core.mutate({trans:c,type:"delete",keys:[a]})}).then(function(c){return c.numFailures?ge.reject(c.failures[0]):void 0})},it.prototype.clear=function(){var a=this;return this._trans("readwrite",function(u){return a.core.mutate({trans:u,type:"deleteRange",range:fc})}).then(function(u){return u.numFailures?ge.reject(u.failures[0]):void 0})},it.prototype.bulkGet=function(a){var u=this;return this._trans("readonly",function(c){return u.core.getMany({keys:a,trans:c}).then(function(f){return f.map(function(p){return u.hook.reading.fire(p)})})})},it.prototype.bulkAdd=function(a,u,c){var f=this,p=Array.isArray(u)?u:void 0,v=(c=c||(p?void 0:u))?c.allKeys:void 0;return this._trans("readwrite",function(b){var T=f.schema.primKey,k=T.auto,T=T.keyPath;if(T&&p)throw new ye.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==a.length)throw new ye.InvalidArgument("Arguments objects and keys must have the same length");var A=a.length,T=T&&k?a.map(As(T)):a;return f.core.mutate({trans:b,type:"add",keys:p,values:T,wantResults:v}).then(function(F){var w=F.numFailures,L=F.results,x=F.lastResult,F=F.failures;if(w===0)return v?L:x;throw new pt("".concat(f.name,".bulkAdd(): ").concat(w," of ").concat(A," operations failed"),F)})})},it.prototype.bulkPut=function(a,u,c){var f=this,p=Array.isArray(u)?u:void 0,v=(c=c||(p?void 0:u))?c.allKeys:void 0;return this._trans("readwrite",function(b){var T=f.schema.primKey,k=T.auto,T=T.keyPath;if(T&&p)throw new ye.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==a.length)throw new ye.InvalidArgument("Arguments objects and keys must have the same length");var A=a.length,T=T&&k?a.map(As(T)):a;return f.core.mutate({trans:b,type:"put",keys:p,values:T,wantResults:v}).then(function(F){var w=F.numFailures,L=F.results,x=F.lastResult,F=F.failures;if(w===0)return v?L:x;throw new pt("".concat(f.name,".bulkPut(): ").concat(w," of ").concat(A," operations failed"),F)})})},it.prototype.bulkUpdate=function(a){var u=this,c=this.core,f=a.map(function(b){return b.key}),p=a.map(function(b){return b.changes}),v=[];return this._trans("readwrite",function(b){return c.getMany({trans:b,keys:f,cache:"clone"}).then(function(k){var A=[],T=[];a.forEach(function(w,L){var x=w.key,F=w.changes,P=k[L];if(P){for(var C=0,$=Object.keys(F);C<$.length;C++){var U=$[C],V=F[U];if(U===u.schema.primKey.keyPath){if(qe(V,x)!==0)throw new ye.Constraint("Cannot update primary key in bulkUpdate()")}else oe(P,U,V)}v.push(L),A.push(x),T.push(P)}});var I=A.length;return c.mutate({trans:b,type:"put",keys:A,values:T,updates:{keys:f,changeSpecs:p}}).then(function(w){var L=w.numFailures,x=w.failures;if(L===0)return I;for(var F=0,P=Object.keys(x);F<P.length;F++){var C,$=P[F],U=v[Number($)];U!=null&&(C=x[$],delete x[$],x[U]=C)}throw new pt("".concat(u.name,".bulkUpdate(): ").concat(L," of ").concat(I," operations failed"),x)})})})},it.prototype.bulkDelete=function(a){var u=this,c=a.length;return this._trans("readwrite",function(f){return u.core.mutate({trans:f,type:"delete",keys:a})}).then(function(b){var p=b.numFailures,v=b.lastResult,b=b.failures;if(p===0)return v;throw new pt("".concat(u.name,".bulkDelete(): ").concat(p," of ").concat(c," operations failed"),b)})},it);function it(){}function gr(a){function u(b,k){if(k){for(var A=arguments.length,T=new Array(A-1);--A;)T[A-1]=arguments[A];return c[b].subscribe.apply(null,T),a}if(typeof b=="string")return c[b]}var c={};u.addEventType=v;for(var f=1,p=arguments.length;f<p;++f)v(arguments[f]);return u;function v(b,k,A){if(typeof b!="object"){var T;k=k||Ye;var I={subscribers:[],fire:A=A||Oe,subscribe:function(w){I.subscribers.indexOf(w)===-1&&(I.subscribers.push(w),I.fire=k(I.fire,w))},unsubscribe:function(w){I.subscribers=I.subscribers.filter(function(L){return L!==w}),I.fire=I.subscribers.reduce(k,A)}};return c[b]=u[b]=I}o(T=b).forEach(function(w){var L=T[w];if(l(L))v(w,T[w][0],T[w][1]);else{if(L!=="asap")throw new ye.InvalidArgument("Invalid event config");var x=v(w,wt,function(){for(var F=arguments.length,P=new Array(F);F--;)P[F]=arguments[F];x.subscribers.forEach(function(C){X(function(){C.apply(null,P)})})})}})}}function vr(a,u){return S(u).from({prototype:a}),u}function Ii(a,u){return!(a.filter||a.algorithm||a.or)&&(u?a.justLimit:!a.replayFilter)}function Oo(a,u){a.filter=ri(a.filter,u)}function xo(a,u,c){var f=a.replayFilter;a.replayFilter=f?function(){return ri(f(),u())}:u,a.justLimit=c&&!f}function Os(a,u){if(a.isPrimKey)return u.primaryKey;var c=u.getIndexByKeyPath(a.index);if(!c)throw new ye.Schema("KeyPath "+a.index+" on object store "+u.name+" is not indexed");return c}function vc(a,u,c){var f=Os(a,u.schema);return u.openCursor({trans:c,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:f,range:a.range}})}function xs(a,u,c,f){var p=a.replayFilter?ri(a.filter,a.replayFilter()):a.filter;if(a.or){var v={},b=function(k,A,T){var I,w;p&&!p(A,T,function(L){return A.stop(L)},function(L){return A.fail(L)})||((w=""+(I=A.primaryKey))=="[object ArrayBuffer]"&&(w=""+new Uint8Array(I)),y(v,w)||(v[w]=!0,u(k,A,T)))};return Promise.all([a.or._iterate(b,c),yc(vc(a,f,c),a.algorithm,b,!a.keysOnly&&a.valueMapper)])}return yc(vc(a,f,c),ri(a.algorithm,p),u,!a.keysOnly&&a.valueMapper)}function yc(a,u,c,f){var p=st(f?function(v,b,k){return c(f(v),b,k)}:c);return a.then(function(v){if(v)return v.start(function(){var b=function(){return v.continue()};u&&!u(v,function(k){return b=k},function(k){v.stop(k),b=Oe},function(k){v.fail(k),b=Oe})||p(v.value,v,function(k){return b=k}),b()})})}var yr=(bc.prototype.execute=function(a){var u=this["@@propmod"];if(u.add!==void 0){var c=u.add;if(l(c))return r(r([],l(a)?a:[],!0),c).sort();if(typeof c=="number")return(Number(a)||0)+c;if(typeof c=="bigint")try{return BigInt(a)+c}catch{return BigInt(0)+c}throw new TypeError("Invalid term ".concat(c))}if(u.remove!==void 0){var f=u.remove;if(l(f))return l(a)?a.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(a)-f;if(typeof f=="bigint")try{return BigInt(a)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return c=(c=u.replacePrefix)===null||c===void 0?void 0:c[0],c&&typeof a=="string"&&a.startsWith(c)?u.replacePrefix[1]+a.substring(c.length):a},bc);function bc(a){this["@@propmod"]=a}var Gm=(Ke.prototype._read=function(a,u){var c=this._ctx;return c.error?c.table._trans(null,dt.bind(null,c.error)):c.table._trans("readonly",a).then(u)},Ke.prototype._write=function(a){var u=this._ctx;return u.error?u.table._trans(null,dt.bind(null,u.error)):u.table._trans("readwrite",a,"locked")},Ke.prototype._addAlgorithm=function(a){var u=this._ctx;u.algorithm=ri(u.algorithm,a)},Ke.prototype._iterate=function(a,u){return xs(this._ctx,a,u,this._ctx.table.core)},Ke.prototype.clone=function(a){var u=Object.create(this.constructor.prototype),c=Object.create(this._ctx);return a&&d(c,a),u._ctx=c,u},Ke.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ke.prototype.each=function(a){var u=this._ctx;return this._read(function(c){return xs(u,a,c,u.table.core)})},Ke.prototype.count=function(a){var u=this;return this._read(function(c){var f=u._ctx,p=f.table.core;if(Ii(f,!0))return p.count({trans:c,query:{index:Os(f,p.schema),range:f.range}}).then(function(b){return Math.min(b,f.limit)});var v=0;return xs(f,function(){return++v,!1},c,p).then(function(){return v})}).then(a)},Ke.prototype.sortBy=function(a,u){var c=a.split(".").reverse(),f=c[0],p=c.length-1;function v(A,T){return T?v(A[c[T]],T-1):A[f]}var b=this._ctx.dir==="next"?1:-1;function k(A,T){return qe(v(A,p),v(T,p))*b}return this.toArray(function(A){return A.sort(k)}).then(u)},Ke.prototype.toArray=function(a){var u=this;return this._read(function(c){var f=u._ctx;if(f.dir==="next"&&Ii(f,!0)&&0<f.limit){var p=f.valueMapper,v=Os(f,f.table.core.schema);return f.table.core.query({trans:c,limit:f.limit,values:!0,query:{index:v,range:f.range}}).then(function(k){return k=k.result,p?k.map(p):k})}var b=[];return xs(f,function(k){return b.push(k)},c,f.table.core).then(function(){return b})},a)},Ke.prototype.offset=function(a){var u=this._ctx;return a<=0||(u.offset+=a,Ii(u)?xo(u,function(){var c=a;return function(f,p){return c===0||(c===1?--c:p(function(){f.advance(c),c=0}),!1)}}):xo(u,function(){var c=a;return function(){return--c<0}})),this},Ke.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),xo(this._ctx,function(){var u=a;return function(c,f,p){return--u<=0&&f(p),0<=u}},!0),this},Ke.prototype.until=function(a,u){return Oo(this._ctx,function(c,f,p){return!a(c.value)||(f(p),u)}),this},Ke.prototype.first=function(a){return this.limit(1).toArray(function(u){return u[0]}).then(a)},Ke.prototype.last=function(a){return this.reverse().first(a)},Ke.prototype.filter=function(a){var u;return Oo(this._ctx,function(c){return a(c.value)}),(u=this._ctx).isMatch=ri(u.isMatch,a),this},Ke.prototype.and=function(a){return this.filter(a)},Ke.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},Ke.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ke.prototype.desc=function(){return this.reverse()},Ke.prototype.eachKey=function(a){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(c,f){a(f.key,f)})},Ke.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},Ke.prototype.eachPrimaryKey=function(a){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(c,f){a(f.primaryKey,f)})},Ke.prototype.keys=function(a){var u=this._ctx;u.keysOnly=!u.isMatch;var c=[];return this.each(function(f,p){c.push(p.key)}).then(function(){return c}).then(a)},Ke.prototype.primaryKeys=function(a){var u=this._ctx;if(u.dir==="next"&&Ii(u,!0)&&0<u.limit)return this._read(function(f){var p=Os(u,u.table.core.schema);return u.table.core.query({trans:f,values:!1,limit:u.limit,query:{index:p,range:u.range}})}).then(function(f){return f.result}).then(a);u.keysOnly=!u.isMatch;var c=[];return this.each(function(f,p){c.push(p.primaryKey)}).then(function(){return c}).then(a)},Ke.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},Ke.prototype.firstKey=function(a){return this.limit(1).keys(function(u){return u[0]}).then(a)},Ke.prototype.lastKey=function(a){return this.reverse().firstKey(a)},Ke.prototype.distinct=function(){var a=this._ctx,a=a.index&&a.table.schema.idxByName[a.index];if(!a||!a.multi)return this;var u={};return Oo(this._ctx,function(p){var f=p.primaryKey.toString(),p=y(u,f);return u[f]=!0,!p}),this},Ke.prototype.modify=function(a){var u=this,c=this._ctx;return this._write(function(f){var p,v,b;b=typeof a=="function"?a:(p=o(a),v=p.length,function(C){for(var $=!1,U=0;U<v;++U){var V=p[U],G=a[V],re=ne(C,V);G instanceof yr?(oe(C,V,G.execute(re)),$=!0):re!==G&&(oe(C,V,G),$=!0)}return $});var k=c.table.core,w=k.schema.primaryKey,A=w.outbound,T=w.extractKey,I=200,w=u.db._options.modifyChunkSize;w&&(I=typeof w=="object"?w[k.name]||w["*"]||200:w);function L(C,V){var U=V.failures,V=V.numFailures;F+=C-V;for(var G=0,re=o(U);G<re.length;G++){var fe=re[G];x.push(U[fe])}}var x=[],F=0,P=[];return u.clone().primaryKeys().then(function(C){function $(V){var G=Math.min(I,C.length-V);return k.getMany({trans:f,keys:C.slice(V,V+G),cache:"immutable"}).then(function(re){for(var fe=[],se=[],le=A?[]:null,pe=[],de=0;de<G;++de){var be=re[de],De={value:Ve(be),primKey:C[V+de]};b.call(De,De.value,De)!==!1&&(De.value==null?pe.push(C[V+de]):A||qe(T(be),T(De.value))===0?(se.push(De.value),A&&le.push(C[V+de])):(pe.push(C[V+de]),fe.push(De.value)))}return Promise.resolve(0<fe.length&&k.mutate({trans:f,type:"add",values:fe}).then(function(Be){for(var Ue in Be.failures)pe.splice(parseInt(Ue),1);L(fe.length,Be)})).then(function(){return(0<se.length||U&&typeof a=="object")&&k.mutate({trans:f,type:"put",keys:le,values:se,criteria:U,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<V}).then(function(Be){return L(se.length,Be)})}).then(function(){return(0<pe.length||U&&a===To)&&k.mutate({trans:f,type:"delete",keys:pe,criteria:U,isAdditionalChunk:0<V}).then(function(Be){return L(pe.length,Be)})}).then(function(){return C.length>V+G&&$(V+I)})})}var U=Ii(c)&&c.limit===1/0&&(typeof a!="function"||a===To)&&{index:c.index,range:c.range};return $(0).then(function(){if(0<x.length)throw new H("Error modifying one or more objects",x,F,P);return C.length})})})},Ke.prototype.delete=function(){var a=this._ctx,u=a.range;return Ii(a)&&(a.isPrimKey||u.type===3)?this._write(function(c){var f=a.table.core.schema.primaryKey,p=u;return a.table.core.count({trans:c,query:{index:f,range:p}}).then(function(v){return a.table.core.mutate({trans:c,type:"deleteRange",range:p}).then(function(b){var k=b.failures;if(b.lastResult,b.results,b=b.numFailures,b)throw new H("Could not delete some values",Object.keys(k).map(function(A){return k[A]}),v-b);return v-b})})}):this.modify(To)},Ke);function Ke(){}var To=function(a,u){return u.value=null};function Wm(a,u){return a<u?-1:a===u?0:1}function Jm(a,u){return u<a?-1:a===u?0:1}function $t(a,u,c){return a=a instanceof _c?new a.Collection(a):a,a._ctx.error=new(c||TypeError)(u),a}function Di(a){return new a.Collection(a,function(){return kc("")}).limit(0)}function Ts(a,u,c,f){var p,v,b,k,A,T,I,w=c.length;if(!c.every(function(F){return typeof F=="string"}))return $t(a,dc);function L(F){p=F==="next"?function(C){return C.toUpperCase()}:function(C){return C.toLowerCase()},v=F==="next"?function(C){return C.toLowerCase()}:function(C){return C.toUpperCase()},b=F==="next"?Wm:Jm;var P=c.map(function(C){return{lower:v(C),upper:p(C)}}).sort(function(C,$){return b(C.lower,$.lower)});k=P.map(function(C){return C.upper}),A=P.map(function(C){return C.lower}),I=(T=F)==="next"?"":f}L("next"),a=new a.Collection(a,function(){return Ln(k[0],A[w-1]+f)}),a._ondirectionchange=function(F){L(F)};var x=0;return a._addAlgorithm(function(F,P,C){var $=F.key;if(typeof $!="string")return!1;var U=v($);if(u(U,A,x))return!0;for(var V=null,G=x;G<w;++G){var re=function(fe,se,le,pe,de,be){for(var De=Math.min(fe.length,pe.length),Be=-1,Ue=0;Ue<De;++Ue){var Mt=se[Ue];if(Mt!==pe[Ue])return de(fe[Ue],le[Ue])<0?fe.substr(0,Ue)+le[Ue]+le.substr(Ue+1):de(fe[Ue],pe[Ue])<0?fe.substr(0,Ue)+pe[Ue]+le.substr(Ue+1):0<=Be?fe.substr(0,Be)+se[Be]+le.substr(Be+1):null;de(fe[Ue],Mt)<0&&(Be=Ue)}return De<pe.length&&be==="next"?fe+le.substr(fe.length):De<fe.length&&be==="prev"?fe.substr(0,le.length):Be<0?null:fe.substr(0,Be)+pe[Be]+le.substr(Be+1)}($,U,k[G],A[G],b,T);re===null&&V===null?x=G+1:(V===null||0<b(V,re))&&(V=re)}return P(V!==null?function(){F.continue(V+I)}:C),!1}),a}function Ln(a,u,c,f){return{type:2,lower:a,upper:u,lowerOpen:c,upperOpen:f}}function kc(a){return{type:1,lower:a,upper:a}}var _c=(Object.defineProperty(kt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),kt.prototype.between=function(a,u,c,f){c=c!==!1,f=f===!0;try{return 0<this._cmp(a,u)||this._cmp(a,u)===0&&(c||f)&&(!c||!f)?Di(this):new this.Collection(this,function(){return Ln(a,u,!c,!f)})}catch{return $t(this,yn)}},kt.prototype.equals=function(a){return a==null?$t(this,yn):new this.Collection(this,function(){return kc(a)})},kt.prototype.above=function(a){return a==null?$t(this,yn):new this.Collection(this,function(){return Ln(a,void 0,!0)})},kt.prototype.aboveOrEqual=function(a){return a==null?$t(this,yn):new this.Collection(this,function(){return Ln(a,void 0,!1)})},kt.prototype.below=function(a){return a==null?$t(this,yn):new this.Collection(this,function(){return Ln(void 0,a,!1,!0)})},kt.prototype.belowOrEqual=function(a){return a==null?$t(this,yn):new this.Collection(this,function(){return Ln(void 0,a)})},kt.prototype.startsWith=function(a){return typeof a!="string"?$t(this,dc):this.between(a,a+ii,!0,!0)},kt.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):Ts(this,function(u,c){return u.indexOf(c[0])===0},[a],ii)},kt.prototype.equalsIgnoreCase=function(a){return Ts(this,function(u,c){return u===c[0]},[a],"")},kt.prototype.anyOfIgnoreCase=function(){var a=B.apply(ae,arguments);return a.length===0?Di(this):Ts(this,function(u,c){return c.indexOf(u)!==-1},a,"")},kt.prototype.startsWithAnyOfIgnoreCase=function(){var a=B.apply(ae,arguments);return a.length===0?Di(this):Ts(this,function(u,c){return c.some(function(f){return u.indexOf(f)===0})},a,ii)},kt.prototype.anyOf=function(){var a=this,u=B.apply(ae,arguments),c=this._cmp;try{u.sort(c)}catch{return $t(this,yn)}if(u.length===0)return Di(this);var f=new this.Collection(this,function(){return Ln(u[0],u[u.length-1])});f._ondirectionchange=function(v){c=v==="next"?a._ascending:a._descending,u.sort(c)};var p=0;return f._addAlgorithm(function(v,b,k){for(var A=v.key;0<c(A,u[p]);)if(++p===u.length)return b(k),!1;return c(A,u[p])===0||(b(function(){v.continue(u[p])}),!1)}),f},kt.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},kt.prototype.noneOf=function(){var a=B.apply(ae,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return $t(this,yn)}var u=a.reduce(function(c,f){return c?c.concat([[c[c.length-1][1],f]]):[[-1/0,f]]},null);return u.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(u,{includeLowers:!1,includeUppers:!1})},kt.prototype.inAnyRange=function($,u){var c=this,f=this._cmp,p=this._ascending,v=this._descending,b=this._min,k=this._max;if($.length===0)return Di(this);if(!$.every(function(U){return U[0]!==void 0&&U[1]!==void 0&&p(U[0],U[1])<=0}))return $t(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ye.InvalidArgument);var A=!u||u.includeLowers!==!1,T=u&&u.includeUppers===!0,I,w=p;function L(U,V){return w(U[0],V[0])}try{(I=$.reduce(function(U,V){for(var G=0,re=U.length;G<re;++G){var fe=U[G];if(f(V[0],fe[1])<0&&0<f(V[1],fe[0])){fe[0]=b(fe[0],V[0]),fe[1]=k(fe[1],V[1]);break}}return G===re&&U.push(V),U},[])).sort(L)}catch{return $t(this,yn)}var x=0,F=T?function(U){return 0<p(U,I[x][1])}:function(U){return 0<=p(U,I[x][1])},P=A?function(U){return 0<v(U,I[x][0])}:function(U){return 0<=v(U,I[x][0])},C=F,$=new this.Collection(this,function(){return Ln(I[0][0],I[I.length-1][1],!A,!T)});return $._ondirectionchange=function(U){w=U==="next"?(C=F,p):(C=P,v),I.sort(L)},$._addAlgorithm(function(U,V,G){for(var re,fe=U.key;C(fe);)if(++x===I.length)return V(G),!1;return!F(re=fe)&&!P(re)||(c._cmp(fe,I[x][1])===0||c._cmp(fe,I[x][0])===0||V(function(){w===p?U.continue(I[x][0]):U.continue(I[x][1])}),!1)}),$},kt.prototype.startsWithAnyOf=function(){var a=B.apply(ae,arguments);return a.every(function(u){return typeof u=="string"})?a.length===0?Di(this):this.inAnyRange(a.map(function(u){return[u,u+ii]})):$t(this,"startsWithAnyOf() only works with strings")},kt);function kt(){}function un(a){return st(function(u){return br(u),a(u.target.error),!1})}function br(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var kr="storagemutated",Co="x-storagemutated-1",$n=gr(null,kr),Ym=(ln.prototype._lock=function(){return z(!Ee.global),++this._reculock,this._reculock!==1||Ee.global||(Ee.lockOwnerFor=this),this},ln.prototype._unlock=function(){if(z(!Ee.global),--this._reculock==0)for(Ee.global||(Ee.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{ni(a[1],a[0])}catch{}}return this},ln.prototype._locked=function(){return this._reculock&&Ee.lockOwnerFor!==this},ln.prototype.create=function(a){var u=this;if(!this.mode)return this;var c=this.db.idbdb,f=this.db._state.dbOpenError;if(z(!this.idbtrans),!a&&!c)switch(f&&f.name){case"DatabaseClosedError":throw new ye.DatabaseClosed(f);case"MissingAPIError":throw new ye.MissingAPI(f.message,f);default:throw new ye.OpenFailed(f)}if(!this.active)throw new ye.TransactionInactive;return z(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||c).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=st(function(p){br(p),u._reject(a.error)}),a.onabort=st(function(p){br(p),u.active&&u._reject(new ye.Abort(a.error)),u.active=!1,u.on("abort").fire(p)}),a.oncomplete=st(function(){u.active=!1,u._resolve(),"mutatedParts"in a&&$n.storagemutated.fire(a.mutatedParts)}),this},ln.prototype._promise=function(a,u,c){var f=this;if(a==="readwrite"&&this.mode!=="readwrite")return dt(new ye.ReadOnly("Transaction is readonly"));if(!this.active)return dt(new ye.TransactionInactive);if(this._locked())return new ge(function(v,b){f._blockedFuncs.push([function(){f._promise(a,u,c).then(v,b)},Ee])});if(c)return In(function(){var v=new ge(function(b,k){f._lock();var A=u(b,k,f);A&&A.then&&A.then(b,k)});return v.finally(function(){return f._unlock()}),v._lib=!0,v});var p=new ge(function(v,b){var k=u(v,b,f);k&&k.then&&k.then(v,b)});return p._lib=!0,p},ln.prototype._root=function(){return this.parent?this.parent._root():this},ln.prototype.waitFor=function(a){var u,c=this._root(),f=ge.resolve(a);c._waitingFor?c._waitingFor=c._waitingFor.then(function(){return f}):(c._waitingFor=f,c._waitingQueue=[],u=c.idbtrans.objectStore(c.storeNames[0]),function v(){for(++c._spinCount;c._waitingQueue.length;)c._waitingQueue.shift()();c._waitingFor&&(u.get(-1/0).onsuccess=v)}());var p=c._waitingFor;return new ge(function(v,b){f.then(function(k){return c._waitingQueue.push(st(v.bind(null,k)))},function(k){return c._waitingQueue.push(st(b.bind(null,k)))}).finally(function(){c._waitingFor===p&&(c._waitingFor=null)})})},ln.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ye.Abort))},ln.prototype.table=function(a){var u=this._memoizedTables||(this._memoizedTables={});if(y(u,a))return u[a];var c=this.schema[a];if(!c)throw new ye.NotFound("Table "+a+" not part of transaction");return c=new this.db.Table(a,c,this),c.core=this.db.core.table(a),u[a]=c},ln);function ln(){}function Ro(a,u,c,f,p,v,b){return{name:a,keyPath:u,unique:c,multi:f,auto:p,compound:v,src:(c&&!b?"&":"")+(f?"*":"")+(p?"++":"")+wc(u)}}function wc(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Fo(a,u,c){return{name:a,primKey:u,indexes:c,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},c.reduce(function(p,v,b){return b=f(v,b),b&&(p[b[0]]=b[1]),p},{}))};var f}var _r=function(a){try{return a.only([[]]),_r=function(){return[[]]},[[]]}catch{return _r=function(){return ii},ii}};function Io(a){return a==null?function(){}:typeof a=="string"?(u=a).split(".").length===1?function(c){return c[u]}:function(c){return ne(c,u)}:function(c){return ne(c,a)};var u}function Sc(a){return[].slice.call(a)}var Xm=0;function wr(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Qm(a,u,A){function f(C){if(C.type===3)return null;if(C.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var x=C.lower,F=C.upper,P=C.lowerOpen,C=C.upperOpen;return x===void 0?F===void 0?null:u.upperBound(F,!!C):F===void 0?u.lowerBound(x,!!P):u.bound(x,F,!!P,!!C)}function p(L){var x,F=L.name;return{name:F,schema:L,mutate:function(P){var C=P.trans,$=P.type,U=P.keys,V=P.values,G=P.range;return new Promise(function(re,fe){re=st(re);var se=C.objectStore(F),le=se.keyPath==null,pe=$==="put"||$==="add";if(!pe&&$!=="delete"&&$!=="deleteRange")throw new Error("Invalid operation type: "+$);var de,be=(U||V||{length:1}).length;if(U&&V&&U.length!==V.length)throw new Error("Given keys array must have same length as given values array.");if(be===0)return re({numFailures:0,failures:{},results:[],lastResult:void 0});function De(Ct){++Mt,br(Ct)}var Be=[],Ue=[],Mt=0;if($==="deleteRange"){if(G.type===4)return re({numFailures:Mt,failures:Ue,results:[],lastResult:void 0});G.type===3?Be.push(de=se.clear()):Be.push(de=se.delete(f(G)))}else{var le=pe?le?[V,U]:[V,null]:[U,null],Ie=le[0],At=le[1];if(pe)for(var Ot=0;Ot<be;++Ot)Be.push(de=At&&At[Ot]!==void 0?se[$](Ie[Ot],At[Ot]):se[$](Ie[Ot])),de.onerror=De;else for(Ot=0;Ot<be;++Ot)Be.push(de=se[$](Ie[Ot])),de.onerror=De}function Vs(Ct){Ct=Ct.target.result,Be.forEach(function(oi,Xo){return oi.error!=null&&(Ue[Xo]=oi.error)}),re({numFailures:Mt,failures:Ue,results:$==="delete"?U:Be.map(function(oi){return oi.result}),lastResult:Ct})}de.onerror=function(Ct){De(Ct),Vs(Ct)},de.onsuccess=Vs})},getMany:function(P){var C=P.trans,$=P.keys;return new Promise(function(U,V){U=st(U);for(var G,re=C.objectStore(F),fe=$.length,se=new Array(fe),le=0,pe=0,de=function(Be){Be=Be.target,se[Be._pos]=Be.result,++pe===le&&U(se)},be=un(V),De=0;De<fe;++De)$[De]!=null&&((G=re.get($[De]))._pos=De,G.onsuccess=de,G.onerror=be,++le);le===0&&U(se)})},get:function(P){var C=P.trans,$=P.key;return new Promise(function(U,V){U=st(U);var G=C.objectStore(F).get($);G.onsuccess=function(re){return U(re.target.result)},G.onerror=un(V)})},query:(x=T,function(P){return new Promise(function(C,$){C=st(C);var U,V,G,le=P.trans,re=P.values,fe=P.limit,de=P.query,se=fe===1/0?void 0:fe,pe=de.index,de=de.range,le=le.objectStore(F),pe=pe.isPrimaryKey?le:le.index(pe.name),de=f(de);if(fe===0)return C({result:[]});x?((se=re?pe.getAll(de,se):pe.getAllKeys(de,se)).onsuccess=function(be){return C({result:be.target.result})},se.onerror=un($)):(U=0,V=!re&&"openKeyCursor"in pe?pe.openKeyCursor(de):pe.openCursor(de),G=[],V.onsuccess=function(be){var De=V.result;return De?(G.push(re?De.value:De.primaryKey),++U===fe?C({result:G}):void De.continue()):C({result:G})},V.onerror=un($))})}),openCursor:function(P){var C=P.trans,$=P.values,U=P.query,V=P.reverse,G=P.unique;return new Promise(function(re,fe){re=st(re);var pe=U.index,se=U.range,le=C.objectStore(F),le=pe.isPrimaryKey?le:le.index(pe.name),pe=V?G?"prevunique":"prev":G?"nextunique":"next",de=!$&&"openKeyCursor"in le?le.openKeyCursor(f(se),pe):le.openCursor(f(se),pe);de.onerror=un(fe),de.onsuccess=st(function(be){var De,Be,Ue,Mt,Ie=de.result;Ie?(Ie.___id=++Xm,Ie.done=!1,De=Ie.continue.bind(Ie),Be=(Be=Ie.continuePrimaryKey)&&Be.bind(Ie),Ue=Ie.advance.bind(Ie),Mt=function(){throw new Error("Cursor not stopped")},Ie.trans=C,Ie.stop=Ie.continue=Ie.continuePrimaryKey=Ie.advance=function(){throw new Error("Cursor not started")},Ie.fail=st(fe),Ie.next=function(){var At=this,Ot=1;return this.start(function(){return Ot--?At.continue():At.stop()}).then(function(){return At})},Ie.start=function(At){function Ot(){if(de.result)try{At()}catch(Ct){Ie.fail(Ct)}else Ie.done=!0,Ie.start=function(){throw new Error("Cursor behind last entry")},Ie.stop()}var Vs=new Promise(function(Ct,oi){Ct=st(Ct),de.onerror=un(oi),Ie.fail=oi,Ie.stop=function(Xo){Ie.stop=Ie.continue=Ie.continuePrimaryKey=Ie.advance=Mt,Ct(Xo)}});return de.onsuccess=st(function(Ct){de.onsuccess=Ot,Ot()}),Ie.continue=De,Ie.continuePrimaryKey=Be,Ie.advance=Ue,Ot(),Vs},re(Ie)):re(null)},fe)})},count:function(P){var C=P.query,$=P.trans,U=C.index,V=C.range;return new Promise(function(G,re){var fe=$.objectStore(F),se=U.isPrimaryKey?fe:fe.index(U.name),fe=f(V),se=fe?se.count(fe):se.count();se.onsuccess=st(function(le){return G(le.target.result)}),se.onerror=un(re)})}}}var v,b,k,I=(b=A,k=Sc((v=a).objectStoreNames),{schema:{name:v.name,tables:k.map(function(L){return b.objectStore(L)}).map(function(L){var x=L.keyPath,C=L.autoIncrement,F=l(x),P={},C={name:L.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:x==null,compound:F,keyPath:x,autoIncrement:C,unique:!0,extractKey:Io(x)},indexes:Sc(L.indexNames).map(function($){return L.index($)}).map(function(G){var U=G.name,V=G.unique,re=G.multiEntry,G=G.keyPath,re={name:U,compound:l(G),keyPath:G,unique:V,multiEntry:re,extractKey:Io(G)};return P[wr(G)]=re}),getIndexByKeyPath:function($){return P[wr($)]}};return P[":id"]=C.primaryKey,x!=null&&(P[wr(x)]=C.primaryKey),C})},hasGetAll:0<k.length&&"getAll"in b.objectStore(k[0])&&!(typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),A=I.schema,T=I.hasGetAll,I=A.tables.map(p),w={};return I.forEach(function(L){return w[L.name]=L}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(L){if(!w[L])throw new Error("Table '".concat(L,"' not found"));return w[L]},MIN_KEY:-1/0,MAX_KEY:_r(u),schema:A}}function Zm(a,u,c,f){var p=c.IDBKeyRange;return c.indexedDB,{dbcore:(f=Qm(u,p,f),a.dbcore.reduce(function(v,b){return b=b.create,i(i({},v),b(v))},f))}}function Cs(a,f){var c=f.db,f=Zm(a._middlewares,c,a._deps,f);a.core=f.dbcore,a.tables.forEach(function(p){var v=p.name;a.core.schema.tables.some(function(b){return b.name===v})&&(p.core=a.core.table(v),a[v]instanceof a.Table&&(a[v].core=p.core))})}function Rs(a,u,c,f){c.forEach(function(p){var v=f[p];u.forEach(function(b){var k=function A(T,I){return E(T,I)||(T=h(T))&&A(T,I)}(b,p);(!k||"value"in k&&k.value===void 0)&&(b===a.Transaction.prototype||b instanceof a.Transaction?_(b,p,{get:function(){return this.table(p)},set:function(A){O(this,p,{value:A,writable:!0,configurable:!0,enumerable:!0})}}):b[p]=new a.Table(p,v))})})}function Do(a,u){u.forEach(function(c){for(var f in c)c[f]instanceof a.Table&&delete c[f]})}function eg(a,u){return a._cfg.version-u._cfg.version}function tg(a,u,c,f){var p=a._dbSchema;c.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Fo("$meta",Nc("")[0],[]),a._storeNames.push("$meta"));var v=a._createTransaction("readwrite",a._storeNames,p);v.create(c),v._completion.catch(f);var b=v._reject.bind(v),k=Ee.transless||Ee;In(function(){return Ee.trans=v,Ee.transless=k,u!==0?(Cs(a,c),T=u,((A=v).storeNames.includes("$meta")?A.table("$meta").get("version").then(function(I){return I!=null?I:T}):ge.resolve(T)).then(function(I){return L=I,x=v,F=c,P=[],I=(w=a)._versions,C=w._dbSchema=Is(0,w.idbdb,F),(I=I.filter(function($){return $._cfg.version>=L})).length!==0?(I.forEach(function($){P.push(function(){var U=C,V=$._cfg.dbschema;Ds(w,U,F),Ds(w,V,F),C=w._dbSchema=V;var G=Po(U,V);G.add.forEach(function(pe){Lo(F,pe[0],pe[1].primKey,pe[1].indexes)}),G.change.forEach(function(pe){if(pe.recreate)throw new ye.Upgrade("Not yet support for changing primary key");var de=F.objectStore(pe.name);pe.add.forEach(function(be){return Fs(de,be)}),pe.change.forEach(function(be){de.deleteIndex(be.name),Fs(de,be)}),pe.del.forEach(function(be){return de.deleteIndex(be)})});var re=$._cfg.contentUpgrade;if(re&&$._cfg.version>L){Cs(w,F),x._memoizedTables={};var fe=Se(V);G.del.forEach(function(pe){fe[pe]=U[pe]}),Do(w,[w.Transaction.prototype]),Rs(w,[w.Transaction.prototype],o(fe),fe),x.schema=fe;var se,le=Fe(re);return le&&Ri(),G=ge.follow(function(){var pe;(se=re(x))&&le&&(pe=Dn.bind(null,null),se.then(pe,pe))}),se&&typeof se.then=="function"?ge.resolve(se):G.then(function(){return se})}}),P.push(function(U){var V,G,re=$._cfg.dbschema;V=re,G=U,[].slice.call(G.db.objectStoreNames).forEach(function(fe){return V[fe]==null&&G.db.deleteObjectStore(fe)}),Do(w,[w.Transaction.prototype]),Rs(w,[w.Transaction.prototype],w._storeNames,w._dbSchema),x.schema=w._dbSchema}),P.push(function(U){w.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(w.idbdb.version/10)===$._cfg.version?(w.idbdb.deleteObjectStore("$meta"),delete w._dbSchema.$meta,w._storeNames=w._storeNames.filter(function(V){return V!=="$meta"})):U.objectStore("$meta").put($._cfg.version,"version"))})}),function $(){return P.length?ge.resolve(P.shift()(x.idbtrans)).then($):ge.resolve()}().then(function(){Ec(C,F)})):ge.resolve();var w,L,x,F,P,C}).catch(b)):(o(p).forEach(function(I){Lo(c,I,p[I].primKey,p[I].indexes)}),Cs(a,c),void ge.follow(function(){return a.on.populate.fire(v)}).catch(b));var A,T})}function ng(a,u){Ec(a._dbSchema,u),u.db.version%10!=0||u.objectStoreNames.contains("$meta")||u.db.createObjectStore("$meta").add(Math.ceil(u.db.version/10-1),"version");var c=Is(0,a.idbdb,u);Ds(a,a._dbSchema,u);for(var f=0,p=Po(c,a._dbSchema).change;f<p.length;f++){var v=function(b){if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=u.objectStore(b.name);b.add.forEach(function(A){Te&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(A.src)),Fs(k,A)})}(p[f]);if(typeof v=="object")return v.value}}function Po(a,u){var c,f={del:[],add:[],change:[]};for(c in a)u[c]||f.del.push(c);for(c in u){var p=a[c],v=u[c];if(p){var b={name:c,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||p.primKey.auto!==v.primKey.auto)b.recreate=!0,f.change.push(b);else{var k=p.idxByName,A=v.idxByName,T=void 0;for(T in k)A[T]||b.del.push(T);for(T in A){var I=k[T],w=A[T];I?I.src!==w.src&&b.change.push(w):b.add.push(w)}(0<b.del.length||0<b.add.length||0<b.change.length)&&f.change.push(b)}}else f.add.push([c,v])}return f}function Lo(a,u,c,f){var p=a.db.createObjectStore(u,c.keyPath?{keyPath:c.keyPath,autoIncrement:c.auto}:{autoIncrement:c.auto});return f.forEach(function(v){return Fs(p,v)}),p}function Ec(a,u){o(a).forEach(function(c){u.db.objectStoreNames.contains(c)||(Te&&console.debug("Dexie: Creating missing table",c),Lo(u,c,a[c].primKey,a[c].indexes))})}function Fs(a,u){a.createIndex(u.name,u.keyPath,{unique:u.unique,multiEntry:u.multi})}function Is(a,u,c){var f={};return j(u.objectStoreNames,0).forEach(function(p){for(var v=c.objectStore(p),b=Ro(wc(T=v.keyPath),T||"",!0,!1,!!v.autoIncrement,T&&typeof T!="string",!0),k=[],A=0;A<v.indexNames.length;++A){var I=v.index(v.indexNames[A]),T=I.keyPath,I=Ro(I.name,T,!!I.unique,!!I.multiEntry,!1,T&&typeof T!="string",!1);k.push(I)}f[p]=Fo(p,b,k)}),f}function Ds(a,u,c){for(var f=c.db.objectStoreNames,p=0;p<f.length;++p){var v=f[p],b=c.objectStore(v);a._hasGetAll="getAll"in b;for(var k=0;k<b.indexNames.length;++k){var A=b.indexNames[k],T=b.index(A).keyPath,I=typeof T=="string"?T:"["+j(T).join("+")+"]";!u[v]||(T=u[v].idxByName[I])&&(T.name=A,delete u[v].idxByName[I],u[v].idxByName[A]=T)}}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&&(a._hasGetAll=!1)}function Nc(a){return a.split(",").map(function(u,c){var f=(u=u.trim()).replace(/([&*]|\+\+)/g,""),p=/^\[/.test(f)?f.match(/^\[(.*)\]$/)[1].split("+"):f;return Ro(f,p||null,/\&/.test(u),/\*/.test(u),/\+\+/.test(u),l(p),c===0)})}var ig=(Ps.prototype._parseStoresSpec=function(a,u){o(a).forEach(function(c){if(a[c]!==null){var f=Nc(a[c]),p=f.shift();if(p.unique=!0,p.multi)throw new ye.Schema("Primary key cannot be multi-valued");f.forEach(function(v){if(v.auto)throw new ye.Schema("Only primary key can be marked as autoIncrement (++)");if(!v.keyPath)throw new ye.Schema("Index must have a name and cannot be an empty string")}),u[c]=Fo(c,p,f)}})},Ps.prototype.stores=function(c){var u=this.db;this._cfg.storesSource=this._cfg.storesSource?d(this._cfg.storesSource,c):c;var c=u._versions,f={},p={};return c.forEach(function(v){d(f,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(f,p)}),u._dbSchema=p,Do(u,[u._allTables,u,u.Transaction.prototype]),Rs(u,[u._allTables,u,u.Transaction.prototype,this._cfg.tables],o(p),p),u._storeNames=o(p),this},Ps.prototype.upgrade=function(a){return this._cfg.contentUpgrade=ue(this._cfg.contentUpgrade||Oe,a),this},Ps);function Ps(){}function $o(a,u){var c=a._dbNamesDB;return c||(c=a._dbNamesDB=new bn(Ns,{addons:[],indexedDB:a,IDBKeyRange:u})).version(1).stores({dbnames:"name"}),c.table("dbnames")}function Mo(a){return a&&typeof a.databases=="function"}function Bo(a){return In(function(){return Ee.letThrough=!0,a()})}function Uo(a){return!("from"in a)}var Nt=function(a,u){if(!this){var c=new Nt;return a&&"d"in a&&d(c,a),c}d(this,arguments.length?{d:1,from:a,to:1<arguments.length?u:a}:{d:0})};function Sr(a,u,c){var f=qe(u,c);if(!isNaN(f)){if(0<f)throw RangeError();if(Uo(a))return d(a,{from:u,to:c,d:1});var p=a.l,f=a.r;if(qe(c,a.from)<0)return p?Sr(p,u,c):a.l={from:u,to:c,d:1,l:null,r:null},Oc(a);if(0<qe(u,a.to))return f?Sr(f,u,c):a.r={from:u,to:c,d:1,l:null,r:null},Oc(a);qe(u,a.from)<0&&(a.from=u,a.l=null,a.d=f?f.d+1:1),0<qe(c,a.to)&&(a.to=c,a.r=null,a.d=a.l?a.l.d+1:1),c=!a.r,p&&!a.l&&Er(a,p),f&&c&&Er(a,f)}}function Er(a,u){Uo(u)||function c(f,A){var v=A.from,b=A.to,k=A.l,A=A.r;Sr(f,v,b),k&&c(f,k),A&&c(f,A)}(a,u)}function Ac(a,u){var c=Ls(u),f=c.next();if(f.done)return!1;for(var p=f.value,v=Ls(a),b=v.next(p.from),k=b.value;!f.done&&!b.done;){if(qe(k.from,p.to)<=0&&0<=qe(k.to,p.from))return!0;qe(p.from,k.from)<0?p=(f=c.next(k.from)).value:k=(b=v.next(p.from)).value}return!1}function Ls(a){var u=Uo(a)?null:{s:0,n:a};return{next:function(c){for(var f=0<arguments.length;u;)switch(u.s){case 0:if(u.s=1,f)for(;u.n.l&&qe(c,u.n.from)<0;)u={up:u,n:u.n.l,s:1};else for(;u.n.l;)u={up:u,n:u.n.l,s:1};case 1:if(u.s=2,!f||qe(c,u.n.to)<=0)return{value:u.n,done:!1};case 2:if(u.n.r){u.s=3,u={up:u,n:u.n.r,s:0};continue}case 3:u=u.up}return{done:!0}}}}function Oc(a){var u,c,f=(((u=a.r)===null||u===void 0?void 0:u.d)||0)-(((c=a.l)===null||c===void 0?void 0:c.d)||0),p=1<f?"r":f<-1?"l":"";p&&(u=p=="r"?"l":"r",c=i({},a),f=a[p],a.from=f.from,a.to=f.to,a[p]=f[p],c[p]=f[u],(a[u]=c).d=xc(c)),a.d=xc(a)}function xc(c){var u=c.r,c=c.l;return(u?c?Math.max(u.d,c.d):u.d:c?c.d:0)+1}function $s(a,u){return o(u).forEach(function(c){a[c]?Er(a[c],u[c]):a[c]=function f(p){var v,b,k={};for(v in p)y(p,v)&&(b=p[v],k[v]=!b||typeof b!="object"||Ne.has(b.constructor)?b:f(b));return k}(u[c])}),a}function jo(a,u){return a.all||u.all||Object.keys(a).some(function(c){return u[c]&&Ac(u[c],a[c])})}g(Nt.prototype,((zt={add:function(a){return Er(this,a),this},addKey:function(a){return Sr(this,a,a),this},addKeys:function(a){var u=this;return a.forEach(function(c){return Sr(u,c,c)}),this},hasKey:function(a){var u=Ls(this).next(a).value;return u&&qe(u.from,a)<=0&&0<=qe(u.to,a)}})[K]=function(){return Ls(this)},zt));var si={},Vo={},Ho=!1;function Ms(a){$s(Vo,a),Ho||(Ho=!0,setTimeout(function(){Ho=!1,qo(Vo,!(Vo={}))},0))}function qo(a,u){u===void 0&&(u=!1);var c=new Set;if(a.all)for(var f=0,p=Object.values(si);f<p.length;f++)Tc(b=p[f],a,c,u);else for(var v in a){var b,k=/^idb\:\/\/(.*)\/(.*)\//.exec(v);k&&(v=k[1],k=k[2],(b=si["idb://".concat(v,"/").concat(k)])&&Tc(b,a,c,u))}c.forEach(function(A){return A()})}function Tc(a,u,c,f){for(var p=[],v=0,b=Object.entries(a.queries.query);v<b.length;v++){for(var k=b[v],A=k[0],T=[],I=0,w=k[1];I<w.length;I++){var L=w[I];jo(u,L.obsSet)?L.subscribers.forEach(function(C){return c.add(C)}):f&&T.push(L)}f&&p.push([A,T])}if(f)for(var x=0,F=p;x<F.length;x++){var P=F[x],A=P[0],T=P[1];a.queries.query[A]=T}}function rg(a){var u=a._state,c=a._deps.indexedDB;if(u.isBeingOpened||a.idbdb)return u.dbReadyPromise.then(function(){return u.dbOpenError?dt(u.dbOpenError):a});u.isBeingOpened=!0,u.dbOpenError=null,u.openComplete=!1;var f=u.openCanceller,p=Math.round(10*a.verno),v=!1;function b(){if(u.openCanceller!==f)throw new ye.DatabaseClosed("db.open() was cancelled")}function k(){return new ge(function(L,x){if(b(),!c)throw new ye.MissingAPI;var F=a.name,P=u.autoSchema||!p?c.open(F):c.open(F,p);if(!P)throw new ye.MissingAPI;P.onerror=un(x),P.onblocked=st(a._fireOnBlocked),P.onupgradeneeded=st(function(C){var $;I=P.transaction,u.autoSchema&&!a._options.allowEmptyDB?(P.onerror=br,I.abort(),P.result.close(),($=c.deleteDatabase(F)).onsuccess=$.onerror=st(function(){x(new ye.NoSuchDatabase("Database ".concat(F," doesnt exist")))})):(I.onerror=un(x),C=C.oldVersion>Math.pow(2,62)?0:C.oldVersion,w=C<1,a.idbdb=P.result,v&&ng(a,I),tg(a,C/10,I,x))},x),P.onsuccess=st(function(){I=null;var C,$,U,V,G,re=a.idbdb=P.result,fe=j(re.objectStoreNames);if(0<fe.length)try{var se=re.transaction((V=fe).length===1?V[0]:V,"readonly");if(u.autoSchema)$=re,U=se,(C=a).verno=$.version/10,U=C._dbSchema=Is(0,$,U),C._storeNames=j($.objectStoreNames,0),Rs(C,[C._allTables],o(U),U);else if(Ds(a,a._dbSchema,se),((G=Po(Is(0,(G=a).idbdb,se),G._dbSchema)).add.length||G.change.some(function(le){return le.add.length||le.change.length}))&&!v)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."),re.close(),p=re.version+1,v=!0,L(k());Cs(a,se)}catch{}Fi.push(a),re.onversionchange=st(function(le){u.vcFired=!0,a.on("versionchange").fire(le)}),re.onclose=st(function(le){a.on("close").fire(le)}),w&&(G=a._deps,se=F,re=G.indexedDB,G=G.IDBKeyRange,Mo(re)||se===Ns||$o(re,G).put({name:se}).catch(Oe)),L()},x)}).catch(function(L){switch(L==null?void 0:L.name){case"UnknownError":if(0<u.PR1398_maxLoop)return u.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return ge.reject(L)})}var A,T=u.dbReadyResolve,I=null,w=!1;return ge.race([f,(typeof navigator=="undefined"?ge.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(L){function x(){return indexedDB.databases().finally(L)}A=setInterval(x,100),x()}).finally(function(){return clearInterval(A)}):Promise.resolve()).then(k)]).then(function(){return b(),u.onReadyBeingFired=[],ge.resolve(Bo(function(){return a.on.ready.fire(a.vip)})).then(function L(){if(0<u.onReadyBeingFired.length){var x=u.onReadyBeingFired.reduce(ue,Oe);return u.onReadyBeingFired=[],ge.resolve(Bo(function(){return x(a.vip)})).then(L)}})}).finally(function(){u.openCanceller===f&&(u.onReadyBeingFired=null,u.isBeingOpened=!1)}).catch(function(L){u.dbOpenError=L;try{I&&I.abort()}catch{}return f===u.openCanceller&&a._close(),dt(L)}).finally(function(){u.openComplete=!0,T()}).then(function(){var L;return w&&(L={},a.tables.forEach(function(x){x.schema.indexes.forEach(function(F){F.name&&(L["idb://".concat(a.name,"/").concat(x.name,"/").concat(F.name)]=new Nt(-1/0,[[[]]]))}),L["idb://".concat(a.name,"/").concat(x.name,"/")]=L["idb://".concat(a.name,"/").concat(x.name,"/:dels")]=new Nt(-1/0,[[[]]])}),$n(kr).fire(L),qo(L,!0)),a})}function zo(a){function u(v){return a.next(v)}var c=p(u),f=p(function(v){return a.throw(v)});function p(v){return function(A){var k=v(A),A=k.value;return k.done?A:A&&typeof A.then=="function"?A.then(c,f):l(A)?Promise.all(A).then(c,f):c(A)}}return p(u)()}function Bs(a,u,c){for(var f=l(a)?a.slice():[a],p=0;p<c;++p)f.push(u);return f}var sg={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return i(i({},a),{table:function(u){var c=a.table(u),f=c.schema,p={},v=[];function b(w,L,x){var F=wr(w),P=p[F]=p[F]||[],C=w==null?0:typeof w=="string"?1:w.length,$=0<L,$=i(i({},x),{name:$?"".concat(F,"(virtual-from:").concat(x.name,")"):x.name,lowLevelIndex:x,isVirtual:$,keyTail:L,keyLength:C,extractKey:Io(w),unique:!$&&x.unique});return P.push($),$.isPrimaryKey||v.push($),1<C&&b(C===2?w[0]:w.slice(0,C-1),L+1,x),P.sort(function(U,V){return U.keyTail-V.keyTail}),$}u=b(f.primaryKey.keyPath,0,f.primaryKey),p[":id"]=[u];for(var k=0,A=f.indexes;k<A.length;k++){var T=A[k];b(T.keyPath,0,T)}function I(w){var L,x=w.query.index;return x.isVirtual?i(i({},w),{query:{index:x.lowLevelIndex,range:(L=w.query.range,x=x.keyTail,{type:L.type===1?2:L.type,lower:Bs(L.lower,L.lowerOpen?a.MAX_KEY:a.MIN_KEY,x),lowerOpen:!0,upper:Bs(L.upper,L.upperOpen?a.MIN_KEY:a.MAX_KEY,x),upperOpen:!0})}}):w}return i(i({},c),{schema:i(i({},f),{primaryKey:u,indexes:v,getIndexByKeyPath:function(w){return(w=p[wr(w)])&&w[0]}}),count:function(w){return c.count(I(w))},query:function(w){return c.query(I(w))},openCursor:function(w){var L=w.query.index,x=L.keyTail,F=L.isVirtual,P=L.keyLength;return F?c.openCursor(I(w)).then(function($){return $&&C($)}):c.openCursor(w);function C($){return Object.create($,{continue:{value:function(U){U!=null?$.continue(Bs(U,w.reverse?a.MAX_KEY:a.MIN_KEY,x)):w.unique?$.continue($.key.slice(0,P).concat(w.reverse?a.MIN_KEY:a.MAX_KEY,x)):$.continue()}},continuePrimaryKey:{value:function(U,V){$.continuePrimaryKey(Bs(U,a.MAX_KEY,x),V)}},primaryKey:{get:function(){return $.primaryKey}},key:{get:function(){var U=$.key;return P===1?U[0]:U.slice(0,P)}},value:{get:function(){return $.value}}})}}})}})}};function Ko(a,u,c,f){return c=c||{},f=f||"",o(a).forEach(function(p){var v,b,k;y(u,p)?(v=a[p],b=u[p],typeof v=="object"&&typeof b=="object"&&v&&b?(k=N(v))!==N(b)?c[f+p]=u[p]:k==="Object"?Ko(v,b,c,f+p+"."):v!==b&&(c[f+p]=u[p]):v!==b&&(c[f+p]=u[p])):c[f+p]=void 0}),o(u).forEach(function(p){y(a,p)||(c[f+p]=u[p])}),c}function Go(a,u){return u.type==="delete"?u.keys:u.keys||u.values.map(a.extractKey)}var ag={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return i(i({},a),{table:function(u){var c=a.table(u),f=c.schema.primaryKey;return i(i({},c),{mutate:function(p){var v=Ee.trans,b=v.table(u).hook,k=b.deleting,A=b.creating,T=b.updating;switch(p.type){case"add":if(A.fire===Oe)break;return v._promise("readwrite",function(){return I(p)},!0);case"put":if(A.fire===Oe&&T.fire===Oe)break;return v._promise("readwrite",function(){return I(p)},!0);case"delete":if(k.fire===Oe)break;return v._promise("readwrite",function(){return I(p)},!0);case"deleteRange":if(k.fire===Oe)break;return v._promise("readwrite",function(){return function w(L,x,F){return c.query({trans:L,values:!1,query:{index:f,range:x},limit:F}).then(function(P){var C=P.result;return I({type:"delete",keys:C,trans:L}).then(function($){return 0<$.numFailures?Promise.reject($.failures[0]):C.length<F?{failures:[],numFailures:0,lastResult:void 0}:w(L,i(i({},x),{lower:C[C.length-1],lowerOpen:!0}),F)})})}(p.trans,p.range,1e4)},!0)}return c.mutate(p);function I(w){var L,x,F,P=Ee.trans,C=w.keys||Go(f,w);if(!C)throw new Error("Keys missing");return(w=w.type==="add"||w.type==="put"?i(i({},w),{keys:C}):i({},w)).type!=="delete"&&(w.values=r([],w.values)),w.keys&&(w.keys=r([],w.keys)),L=c,F=C,((x=w).type==="add"?Promise.resolve([]):L.getMany({trans:x.trans,keys:F,cache:"immutable"})).then(function($){var U=C.map(function(V,G){var re,fe,se,le=$[G],pe={onerror:null,onsuccess:null};return w.type==="delete"?k.fire.call(pe,V,le,P):w.type==="add"||le===void 0?(re=A.fire.call(pe,V,w.values[G],P),V==null&&re!=null&&(w.keys[G]=V=re,f.outbound||oe(w.values[G],f.keyPath,V))):(re=Ko(le,w.values[G]),(fe=T.fire.call(pe,re,V,le,P))&&(se=w.values[G],Object.keys(fe).forEach(function(de){y(se,de)?se[de]=fe[de]:oe(se,de,fe[de])}))),pe});return c.mutate(w).then(function(V){for(var G=V.failures,re=V.results,fe=V.numFailures,V=V.lastResult,se=0;se<C.length;++se){var le=(re||C)[se],pe=U[se];le==null?pe.onerror&&pe.onerror(G[se]):pe.onsuccess&&pe.onsuccess(w.type==="put"&&$[se]?w.values[se]:le)}return{failures:G,results:re,numFailures:fe,lastResult:V}}).catch(function(V){return U.forEach(function(G){return G.onerror&&G.onerror(V)}),Promise.reject(V)})})}}})}})}};function Cc(a,u,c){try{if(!u||u.keys.length<a.length)return null;for(var f=[],p=0,v=0;p<u.keys.length&&v<a.length;++p)qe(u.keys[p],a[v])===0&&(f.push(c?Ve(u.values[p]):u.values[p]),++v);return f.length===a.length?f:null}catch{return null}}var og={stack:"dbcore",level:-1,create:function(a){return{table:function(u){var c=a.table(u);return i(i({},c),{getMany:function(f){if(!f.cache)return c.getMany(f);var p=Cc(f.keys,f.trans._cache,f.cache==="clone");return p?ge.resolve(p):c.getMany(f).then(function(v){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?Ve(v):v},v})},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),c.mutate(f)}})}}}};function Rc(a,u){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!u.schema.primaryKey.outbound}function Fc(a,u){switch(a){case"query":return u.values&&!u.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ug={stack:"dbcore",level:0,name:"Observability",create:function(a){var u=a.schema.name,c=new Nt(a.MIN_KEY,a.MAX_KEY);return i(i({},a),{transaction:function(f,p,v){if(Ee.subscr&&p!=="readonly")throw new ye.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ee.querier));return a.transaction(f,p,v)},table:function(f){var p=a.table(f),v=p.schema,b=v.primaryKey,w=v.indexes,k=b.extractKey,A=b.outbound,T=b.autoIncrement&&w.filter(function(x){return x.compound&&x.keyPath.includes(b.keyPath)}),I=i(i({},p),{mutate:function(x){function F(de){return de="idb://".concat(u,"/").concat(f,"/").concat(de),V[de]||(V[de]=new Nt)}var P,C,$,U=x.trans,V=x.mutatedParts||(x.mutatedParts={}),G=F(""),re=F(":dels"),fe=x.type,pe=x.type==="deleteRange"?[x.range]:x.type==="delete"?[x.keys]:x.values.length<50?[Go(b,x).filter(function(de){return de}),x.values]:[],se=pe[0],le=pe[1],pe=x.trans._cache;return l(se)?(G.addKeys(se),(pe=fe==="delete"||se.length===le.length?Cc(se,pe):null)||re.addKeys(se),(pe||le)&&(P=F,C=pe,$=le,v.indexes.forEach(function(de){var be=P(de.name||"");function De(Ue){return Ue!=null?de.extractKey(Ue):null}function Be(Ue){return de.multiEntry&&l(Ue)?Ue.forEach(function(Mt){return be.addKey(Mt)}):be.addKey(Ue)}(C||$).forEach(function(Ue,At){var Ie=C&&De(C[At]),At=$&&De($[At]);qe(Ie,At)!==0&&(Ie!=null&&Be(Ie),At!=null&&Be(At))})}))):se?(le={from:(le=se.lower)!==null&&le!==void 0?le:a.MIN_KEY,to:(le=se.upper)!==null&&le!==void 0?le:a.MAX_KEY},re.add(le),G.add(le)):(G.add(c),re.add(c),v.indexes.forEach(function(de){return F(de.name).add(c)})),p.mutate(x).then(function(de){return!se||x.type!=="add"&&x.type!=="put"||(G.addKeys(de.results),T&&T.forEach(function(be){for(var De=x.values.map(function(Ie){return be.extractKey(Ie)}),Be=be.keyPath.findIndex(function(Ie){return Ie===b.keyPath}),Ue=0,Mt=de.results.length;Ue<Mt;++Ue)De[Ue][Be]=de.results[Ue];F(be.name).addKeys(De)})),U.mutatedParts=$s(U.mutatedParts||{},V),de})}}),w=function(F){var P=F.query,F=P.index,P=P.range;return[F,new Nt((F=P.lower)!==null&&F!==void 0?F:a.MIN_KEY,(P=P.upper)!==null&&P!==void 0?P:a.MAX_KEY)]},L={get:function(x){return[b,new Nt(x.key)]},getMany:function(x){return[b,new Nt().addKeys(x.keys)]},count:w,query:w,openCursor:w};return o(L).forEach(function(x){I[x]=function(F){var P=Ee.subscr,C=!!P,$=Rc(Ee,p)&&Fc(x,F)?F.obsSet={}:P;if(C){var U=function(le){return le="idb://".concat(u,"/").concat(f,"/").concat(le),$[le]||($[le]=new Nt)},V=U(""),G=U(":dels"),P=L[x](F),C=P[0],P=P[1];if((x==="query"&&C.isPrimaryKey&&!F.values?G:U(C.name||"")).add(P),!C.isPrimaryKey){if(x!=="count"){var re=x==="query"&&A&&F.values&&p.query(i(i({},F),{values:!1}));return p[x].apply(this,arguments).then(function(le){if(x==="query"){if(A&&F.values)return re.then(function(De){return De=De.result,V.addKeys(De),le});var pe=F.values?le.result.map(k):le.result;(F.values?V:G).addKeys(pe)}else if(x==="openCursor"){var de=le,be=F.values;return de&&Object.create(de,{key:{get:function(){return G.addKey(de.primaryKey),de.key}},primaryKey:{get:function(){var De=de.primaryKey;return G.addKey(De),De}},value:{get:function(){return be&&V.addKey(de.primaryKey),de.value}}})}return le})}G.add(c)}}return p[x].apply(this,arguments)}}),I}})}};function Ic(a,u,c){if(c.numFailures===0)return u;if(u.type==="deleteRange")return null;var f=u.keys?u.keys.length:"values"in u&&u.values?u.values.length:1;return c.numFailures===f?null:(u=i({},u),l(u.keys)&&(u.keys=u.keys.filter(function(p,v){return!(v in c.failures)})),"values"in u&&l(u.values)&&(u.values=u.values.filter(function(p,v){return!(v in c.failures)})),u)}function Wo(a,u){return c=a,((f=u).lower===void 0||(f.lowerOpen?0<qe(c,f.lower):0<=qe(c,f.lower)))&&(a=a,(u=u).upper===void 0||(u.upperOpen?qe(a,u.upper)<0:qe(a,u.upper)<=0));var c,f}function Dc(a,u,L,f,p,v){if(!L||L.length===0)return a;var b=u.query.index,k=b.multiEntry,A=u.query.range,T=f.schema.primaryKey.extractKey,I=b.extractKey,w=(b.lowLevelIndex||b).extractKey,L=L.reduce(function(x,F){var P=x,C=[];if(F.type==="add"||F.type==="put")for(var $=new Nt,U=F.values.length-1;0<=U;--U){var V,G=F.values[U],re=T(G);$.hasKey(re)||(V=I(G),(k&&l(V)?V.some(function(de){return Wo(de,A)}):Wo(V,A))&&($.addKey(re),C.push(G)))}switch(F.type){case"add":var fe=new Nt().addKeys(u.values?x.map(function(be){return T(be)}):x),P=x.concat(u.values?C.filter(function(be){return be=T(be),!fe.hasKey(be)&&(fe.addKey(be),!0)}):C.map(function(be){return T(be)}).filter(function(be){return!fe.hasKey(be)&&(fe.addKey(be),!0)}));break;case"put":var se=new Nt().addKeys(F.values.map(function(be){return T(be)}));P=x.filter(function(be){return!se.hasKey(u.values?T(be):be)}).concat(u.values?C:C.map(function(be){return T(be)}));break;case"delete":var le=new Nt().addKeys(F.keys);P=x.filter(function(be){return!le.hasKey(u.values?T(be):be)});break;case"deleteRange":var pe=F.range;P=x.filter(function(be){return!Wo(T(be),pe)})}return P},a);return L===a?a:(L.sort(function(x,F){return qe(w(x),w(F))||qe(T(x),T(F))}),u.limit&&u.limit<1/0&&(L.length>u.limit?L.length=u.limit:a.length===u.limit&&L.length<u.limit&&(p.dirty=!0)),v?Object.freeze(L):L)}function Pc(a,u){return qe(a.lower,u.lower)===0&&qe(a.upper,u.upper)===0&&!!a.lowerOpen==!!u.lowerOpen&&!!a.upperOpen==!!u.upperOpen}function lg(a,u){return function(c,f,p,v){if(c===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((f=qe(c,f))===0){if(p&&v)return 0;if(p)return 1;if(v)return-1}return f}(a.lower,u.lower,a.lowerOpen,u.lowerOpen)<=0&&0<=function(c,f,p,v){if(c===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((f=qe(c,f))===0){if(p&&v)return 0;if(p)return-1;if(v)return 1}return f}(a.upper,u.upper,a.upperOpen,u.upperOpen)}function cg(a,u,c,f){a.subscribers.add(c),f.addEventListener("abort",function(){var p,v;a.subscribers.delete(c),a.subscribers.size===0&&(p=a,v=u,setTimeout(function(){p.subscribers.size===0&&ce(v,p)},3e3))})}var dg={stack:"dbcore",level:0,name:"Cache",create:function(a){var u=a.schema.name;return i(i({},a),{transaction:function(c,f,p){var v,b,k=a.transaction(c,f,p);return f==="readwrite"&&(b=(v=new AbortController).signal,p=function(A){return function(){if(v.abort(),f==="readwrite"){for(var T=new Set,I=0,w=c;I<w.length;I++){var L=w[I],x=si["idb://".concat(u,"/").concat(L)];if(x){var F=a.table(L),P=x.optimisticOps.filter(function(be){return be.trans===k});if(k._explicit&&A&&k.mutatedParts)for(var C=0,$=Object.values(x.queries.query);C<$.length;C++)for(var U=0,V=(fe=$[C]).slice();U<V.length;U++)jo((se=V[U]).obsSet,k.mutatedParts)&&(ce(fe,se),se.subscribers.forEach(function(be){return T.add(be)}));else if(0<P.length){x.optimisticOps=x.optimisticOps.filter(function(be){return be.trans!==k});for(var G=0,re=Object.values(x.queries.query);G<re.length;G++)for(var fe,se,le,pe=0,de=(fe=re[G]).slice();pe<de.length;pe++)(se=de[pe]).res!=null&&k.mutatedParts&&(A&&!se.dirty?(le=Object.isFrozen(se.res),le=Dc(se.res,se.req,P,F,se,le),se.dirty?(ce(fe,se),se.subscribers.forEach(function(be){return T.add(be)})):le!==se.res&&(se.res=le,se.promise=ge.resolve({result:le}))):(se.dirty&&ce(fe,se),se.subscribers.forEach(function(be){return T.add(be)})))}}}T.forEach(function(be){return be()})}}},k.addEventListener("abort",p(!1),{signal:b}),k.addEventListener("error",p(!1),{signal:b}),k.addEventListener("complete",p(!0),{signal:b})),k},table:function(c){var f=a.table(c),p=f.schema.primaryKey;return i(i({},f),{mutate:function(v){var b=Ee.trans;if(p.outbound||b.db._options.cache==="disabled"||b.explicit||b.idbtrans.mode!=="readwrite")return f.mutate(v);var k=si["idb://".concat(u,"/").concat(c)];return k?(b=f.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Go(p,v).some(function(A){return A==null}))?(k.optimisticOps.push(v),v.mutatedParts&&Ms(v.mutatedParts),b.then(function(A){0<A.numFailures&&(ce(k.optimisticOps,v),(A=Ic(0,v,A))&&k.optimisticOps.push(A),v.mutatedParts&&Ms(v.mutatedParts))}),b.catch(function(){ce(k.optimisticOps,v),v.mutatedParts&&Ms(v.mutatedParts)})):b.then(function(A){var T=Ic(0,i(i({},v),{values:v.values.map(function(I,w){var L;return A.failures[w]?I:(I=(L=p.keyPath)!==null&&L!==void 0&&L.includes(".")?Ve(I):i({},I),oe(I,p.keyPath,A.results[w]),I)})}),A);k.optimisticOps.push(T),queueMicrotask(function(){return v.mutatedParts&&Ms(v.mutatedParts)})}),b):f.mutate(v)},query:function(v){if(!Rc(Ee,f)||!Fc("query",v))return f.query(v);var b=((T=Ee.trans)===null||T===void 0?void 0:T.db._options.cache)==="immutable",w=Ee,k=w.requery,A=w.signal,T=function(F,P,C,$){var U=si["idb://".concat(F,"/").concat(P)];if(!U)return[];if(!(P=U.queries[C]))return[null,!1,U,null];var V=P[($.query?$.query.index.name:null)||""];if(!V)return[null,!1,U,null];switch(C){case"query":var G=V.find(function(re){return re.req.limit===$.limit&&re.req.values===$.values&&Pc(re.req.query.range,$.query.range)});return G?[G,!0,U,V]:[V.find(function(re){return("limit"in re.req?re.req.limit:1/0)>=$.limit&&(!$.values||re.req.values)&&lg(re.req.query.range,$.query.range)}),!1,U,V];case"count":return G=V.find(function(re){return Pc(re.req.query.range,$.query.range)}),[G,!!G,U,V]}}(u,c,"query",v),I=T[0],w=T[1],L=T[2],x=T[3];return I&&w?I.obsSet=v.obsSet:(w=f.query(v).then(function(F){var P=F.result;if(I&&(I.res=P),b){for(var C=0,$=P.length;C<$;++C)Object.freeze(P[C]);Object.freeze(P)}else F.result=Ve(P);return F}).catch(function(F){return x&&I&&ce(x,I),Promise.reject(F)}),I={obsSet:v.obsSet,promise:w,subscribers:new Set,type:"query",req:v,dirty:!1},x?x.push(I):(x=[I],(L=L||(si["idb://".concat(u,"/").concat(c)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=x)),cg(I,x,k,A),I.promise.then(function(F){return{result:Dc(F.result,v,L==null?void 0:L.optimisticOps,f,I,b)}})}})}})}};function Us(a,u){return new Proxy(a,{get:function(c,f,p){return f==="db"?u:Reflect.get(c,f,p)}})}var bn=(ft.prototype.version=function(a){if(isNaN(a)||a<.1)throw new ye.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new ye.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var u=this._versions,c=u.filter(function(f){return f._cfg.version===a})[0];return c||(c=new this.Version(a),u.push(c),u.sort(eg),c.stores({}),this._state.autoSchema=!1,c)},ft.prototype._whenReady=function(a){var u=this;return this.idbdb&&(this._state.openComplete||Ee.letThrough||this._vip)?a():new ge(function(c,f){if(u._state.openComplete)return f(new ye.DatabaseClosed(u._state.dbOpenError));if(!u._state.isBeingOpened){if(!u._state.autoOpen)return void f(new ye.DatabaseClosed);u.open().catch(Oe)}u._state.dbReadyPromise.then(c,f)}).then(a)},ft.prototype.use=function(a){var u=a.stack,c=a.create,f=a.level,p=a.name;return p&&this.unuse({stack:u,name:p}),a=this._middlewares[u]||(this._middlewares[u]=[]),a.push({stack:u,create:c,level:f==null?10:f,name:p}),a.sort(function(v,b){return v.level-b.level}),this},ft.prototype.unuse=function(a){var u=a.stack,c=a.name,f=a.create;return u&&this._middlewares[u]&&(this._middlewares[u]=this._middlewares[u].filter(function(p){return f?p.create!==f:!!c&&p.name!==c})),this},ft.prototype.open=function(){var a=this;return ni(Fn,function(){return rg(a)})},ft.prototype._close=function(){var a=this._state,u=Fi.indexOf(this);if(0<=u&&Fi.splice(u,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new ge(function(c){a.dbReadyResolve=c}),a.openCanceller=new ge(function(c,f){a.cancelOpen=f}))},ft.prototype.close=function(c){var u=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,c=this._state;u?(c.isBeingOpened&&c.cancelOpen(new ye.DatabaseClosed),this._close(),c.autoOpen=!1,c.dbOpenError=new ye.DatabaseClosed):(this._close(),c.autoOpen=this._options.autoOpen||c.isBeingOpened,c.openComplete=!1,c.dbOpenError=null)},ft.prototype.delete=function(a){var u=this;a===void 0&&(a={disableAutoOpen:!0});var c=0<arguments.length&&typeof arguments[0]!="object",f=this._state;return new ge(function(p,v){function b(){u.close(a);var k=u._deps.indexedDB.deleteDatabase(u.name);k.onsuccess=st(function(){var A,T,I;A=u._deps,T=u.name,I=A.indexedDB,A=A.IDBKeyRange,Mo(I)||T===Ns||$o(I,A).delete(T).catch(Oe),p()}),k.onerror=un(v),k.onblocked=u._fireOnBlocked}if(c)throw new ye.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(b):b()})},ft.prototype.backendDB=function(){return this.idbdb},ft.prototype.isOpen=function(){return this.idbdb!==null},ft.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},ft.prototype.hasFailed=function(){return this._state.dbOpenError!==null},ft.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(ft.prototype,"tables",{get:function(){var a=this;return o(this._allTables).map(function(u){return a._allTables[u]})},enumerable:!1,configurable:!0}),ft.prototype.transaction=function(){var a=function(u,c,f){var p=arguments.length;if(p<2)throw new ye.InvalidArgument("Too few arguments");for(var v=new Array(p-1);--p;)v[p-1]=arguments[p];return f=v.pop(),[u,ze(v),f]}.apply(this,arguments);return this._transaction.apply(this,a)},ft.prototype._transaction=function(a,u,c){var f=this,p=Ee.trans;p&&p.db===this&&a.indexOf("!")===-1||(p=null);var v,b,k=a.indexOf("?")!==-1;a=a.replace("!","").replace("?","");try{if(b=u.map(function(T){if(T=T instanceof f.Table?T.name:T,typeof T!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return T}),a=="r"||a===No)v=No;else{if(a!="rw"&&a!=Ao)throw new ye.InvalidArgument("Invalid transaction mode: "+a);v=Ao}if(p){if(p.mode===No&&v===Ao){if(!k)throw new ye.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");p=null}p&&b.forEach(function(T){if(p&&p.storeNames.indexOf(T)===-1){if(!k)throw new ye.SubTransaction("Table "+T+" not included in parent transaction.");p=null}}),k&&p&&!p.active&&(p=null)}}catch(T){return p?p._promise(null,function(I,w){w(T)}):dt(T)}var A=function T(I,w,L,x,F){return ge.resolve().then(function(){var P=Ee.transless||Ee,C=I._createTransaction(w,L,I._dbSchema,x);if(C.explicit=!0,P={trans:C,transless:P},x)C.idbtrans=x.idbtrans;else try{C.create(),C.idbtrans._explicit=!0,I._state.PR1398_maxLoop=3}catch(V){return V.name===_e.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return T(I,w,L,null,F)})):dt(V)}var $,U=Fe(F);return U&&Ri(),P=ge.follow(function(){var V;($=F.call(C,C))&&(U?(V=Dn.bind(null,null),$.then(V,V)):typeof $.next=="function"&&typeof $.throw=="function"&&($=zo($)))},P),($&&typeof $.then=="function"?ge.resolve($).then(function(V){return C.active?V:dt(new ye.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):P.then(function(){return $})).then(function(V){return x&&C._resolve(),C._completion.then(function(){return V})}).catch(function(V){return C._reject(V),dt(V)})})}.bind(null,this,v,b,p,c);return p?p._promise(v,A,"lock"):Ee.trans?ni(Ee.transless,function(){return f._whenReady(A)}):this._whenReady(A)},ft.prototype.table=function(a){if(!y(this._allTables,a))throw new ye.InvalidTable("Table ".concat(a," does not exist"));return this._allTables[a]},ft);function ft(a,u){var c=this;this._middlewares={},this.verno=0;var f=ft.dependencies;this._options=u=i({addons:ft.addons,autoOpen:!0,indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange,cache:"cloned"},u),this._deps={indexedDB:u.indexedDB,IDBKeyRange:u.IDBKeyRange},f=u.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var p,v,b,k,A,T={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Oe,dbReadyPromise:null,cancelOpen:Oe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:u.autoOpen};T.dbReadyPromise=new ge(function(w){T.dbReadyResolve=w}),T.openCanceller=new ge(function(w,L){T.cancelOpen=L}),this._state=T,this.name=a,this.on=gr(this,"populate","blocked","versionchange","close",{ready:[ue,Oe]}),this.on.ready.subscribe=J(this.on.ready.subscribe,function(w){return function(L,x){ft.vip(function(){var F,P=c._state;P.openComplete?(P.dbOpenError||ge.resolve().then(L),x&&w(L)):P.onReadyBeingFired?(P.onReadyBeingFired.push(L),x&&w(L)):(w(L),F=c,x||w(function C(){F.on.ready.unsubscribe(L),F.on.ready.unsubscribe(C)}))})}}),this.Collection=(p=this,vr(Gm.prototype,function($,C){this.db=p;var x=fc,F=null;if(C)try{x=C()}catch(U){F=U}var P=$._ctx,C=P.table,$=C.hook.reading.fire;this._ctx={table:C,index:P.index,isPrimKey:!P.index||C.schema.primKey.keyPath&&P.index===C.schema.primKey.name,range:x,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:F,or:P.or,valueMapper:$!==wt?$:null}})),this.Table=(v=this,vr(gc.prototype,function(w,L,x){this.db=v,this._tx=x,this.name=w,this.schema=L,this.hook=v._allTables[w]?v._allTables[w].hook:gr(null,{creating:[mt,Oe],reading:[lt,wt],updating:[he,Oe],deleting:[rt,Oe]})})),this.Transaction=(b=this,vr(Ym.prototype,function(w,L,x,F,P){var C=this;this.db=b,this.mode=w,this.storeNames=L,this.schema=x,this.chromeTransactionDurability=F,this.idbtrans=null,this.on=gr(this,"complete","error","abort"),this.parent=P||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 ge(function($,U){C._resolve=$,C._reject=U}),this._completion.then(function(){C.active=!1,C.on.complete.fire()},function($){var U=C.active;return C.active=!1,C.on.error.fire($),C.parent?C.parent._reject($):U&&C.idbtrans&&C.idbtrans.abort(),dt($)})})),this.Version=(k=this,vr(ig.prototype,function(w){this.db=k,this._cfg={version:w,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(A=this,vr(_c.prototype,function(w,L,x){if(this.db=A,this._ctx={table:w,index:L===":id"?null:L,or:x},this._cmp=this._ascending=qe,this._descending=function(F,P){return qe(P,F)},this._max=function(F,P){return 0<qe(F,P)?F:P},this._min=function(F,P){return qe(F,P)<0?F:P},this._IDBKeyRange=A._deps.IDBKeyRange,!this._IDBKeyRange)throw new ye.MissingAPI})),this.on("versionchange",function(w){0<w.newVersion?console.warn("Another connection wants to upgrade database '".concat(c.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(c.name,"'. Closing db now to resume the delete request.")),c.close({disableAutoOpen:!1})}),this.on("blocked",function(w){!w.newVersion||w.newVersion<w.oldVersion?console.warn("Dexie.delete('".concat(c.name,"') was blocked")):console.warn("Upgrade '".concat(c.name,"' blocked by other connection holding version ").concat(w.oldVersion/10))}),this._maxKey=_r(u.IDBKeyRange),this._createTransaction=function(w,L,x,F){return new c.Transaction(w,L,x,c._options.chromeTransactionDurability,F)},this._fireOnBlocked=function(w){c.on("blocked").fire(w),Fi.filter(function(L){return L.name===c.name&&L!==c&&!L._state.vcFired}).map(function(L){return L.on("versionchange").fire(w)})},this.use(og),this.use(dg),this.use(ug),this.use(sg),this.use(ag);var I=new Proxy(this,{get:function(w,L,x){if(L==="_vip")return!0;if(L==="table")return function(P){return Us(c.table(P),I)};var F=Reflect.get(w,L,x);return F instanceof gc?Us(F,I):L==="tables"?F.map(function(P){return Us(P,I)}):L==="_createTransaction"?function(){return Us(F.apply(this,arguments),I)}:F}});this.vip=I,f.forEach(function(w){return w(c)})}var js,zt=typeof Symbol!="undefined"&&"observable"in Symbol?Symbol.observable:"@@observable",fg=(Jo.prototype.subscribe=function(a,u,c){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:u,complete:c})},Jo.prototype[zt]=function(){return this},Jo);function Jo(a){this._subscribe=a}try{js={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{js={indexedDB:null,IDBKeyRange:null}}function Lc(a){var u,c=!1,f=new fg(function(p){var v=Fe(a),b,k=!1,A={},T={},I={get closed(){return k},unsubscribe:function(){k||(k=!0,b&&b.abort(),w&&$n.storagemutated.unsubscribe(x))}};p.start&&p.start(I);var w=!1,L=function(){return Eo(F)},x=function(P){$s(A,P),jo(T,A)&&L()},F=function(){var P,C,$;!k&&js.indexedDB&&(A={},P={},b&&b.abort(),b=new AbortController,$=function(U){var V=Ti();try{v&&Ri();var G=In(a,U);return G=v?G.finally(Dn):G}finally{V&&Ci()}}(C={subscr:P,signal:b.signal,requery:L,querier:a,trans:null}),Promise.resolve($).then(function(U){c=!0,u=U,k||C.signal.aborted||(A={},function(V){for(var G in V)if(y(V,G))return;return 1}(T=P)||w||($n(kr,x),w=!0),Eo(function(){return!k&&p.next&&p.next(U)}))},function(U){c=!1,["DatabaseClosedError","AbortError"].includes(U==null?void 0:U.name)||k||Eo(function(){k||p.error&&p.error(U)})}))};return setTimeout(L,0),I});return f.hasValue=function(){return c},f.getValue=function(){return u},f}var ai=bn;function Yo(a){var u=Mn;try{Mn=!0,$n.storagemutated.fire(a),qo(a,!0)}finally{Mn=u}}g(ai,i(i({},Je),{delete:function(a){return new ai(a,{addons:[]}).delete()},exists:function(a){return new ai(a,{addons:[]}).open().then(function(u){return u.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return u=ai.dependencies,c=u.indexedDB,u=u.IDBKeyRange,(Mo(c)?Promise.resolve(c.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==Ns})}):$o(c,u).toCollection().primaryKeys()).then(a)}catch{return dt(new ye.MissingAPI)}var u,c},defineClass:function(){return function(a){d(this,a)}},ignoreTransaction:function(a){return Ee.trans?ni(Ee.transless,a):a()},vip:Bo,async:function(a){return function(){try{var u=zo(a.apply(this,arguments));return u&&typeof u.then=="function"?u:ge.resolve(u)}catch(c){return dt(c)}}},spawn:function(a,u,c){try{var f=zo(a.apply(c,u||[]));return f&&typeof f.then=="function"?f:ge.resolve(f)}catch(p){return dt(p)}},currentTransaction:{get:function(){return Ee.trans||null}},waitFor:function(a,u){return u=ge.resolve(typeof a=="function"?ai.ignoreTransaction(a):a).timeout(u||6e4),Ee.trans?Ee.trans.waitFor(u):u},Promise:ge,debug:{get:function(){return Te},set:function(a){tt(a)}},derive:S,extend:d,props:g,override:J,Events:gr,on:$n,liveQuery:Lc,extendObservabilitySet:$s,getByKeyPath:ne,setByKeyPath:oe,delByKeyPath:function(a,u){typeof u=="string"?oe(a,u,void 0):"length"in u&&[].map.call(u,function(c){oe(a,c,void 0)})},shallowClone:Se,deepClone:Ve,getObjectDiff:Ko,cmp:qe,asap:X,minKey:-1/0,addons:[],connections:Fi,errnames:_e,dependencies:js,cache:si,semVer:"4.0.11",version:"4.0.11".split(".").map(function(a){return parseInt(a)}).reduce(function(a,u,c){return a+u/Math.pow(10,2*c)})})),ai.maxKey=_r(ai.dependencies.IDBKeyRange),typeof dispatchEvent!="undefined"&&typeof addEventListener!="undefined"&&($n(kr,function(a){Mn||(a=new CustomEvent(Co,{detail:a}),Mn=!0,dispatchEvent(a),Mn=!1)}),addEventListener(Co,function(a){a=a.detail,Mn||Yo(a)}));var Pi,Mn=!1,$c=function(){};return typeof BroadcastChannel!="undefined"&&(($c=function(){(Pi=new BroadcastChannel(Co)).onmessage=function(a){return a.data&&Yo(a.data)}})(),typeof Pi.unref=="function"&&Pi.unref(),$n(kr,function(a){Mn||Pi.postMessage(a)})),typeof addEventListener!="undefined"&&(addEventListener("pagehide",function(a){if(!bn.disableBfCache&&a.persisted){Te&&console.debug("Dexie: handling persisted pagehide"),Pi!=null&&Pi.close();for(var u=0,c=Fi;u<c.length;u++)c[u].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!bn.disableBfCache&&a.persisted&&(Te&&console.debug("Dexie: handling persisted pageshow"),$c(),Yo({all:new Nt(-1/0,[[]])}))})),ge.rejectionMapper=function(a,u){return!a||a instanceof Xe||a instanceof TypeError||a instanceof SyntaxError||!a.name||!et[a.name]?a:(u=new et[a.name](u||a.message,a),"stack"in a&&_(u,"stack",{get:function(){return this.inner.stack}}),u)},tt(Te),i(bn,Object.freeze({__proto__:null,Dexie:bn,liveQuery:Lc,Entity:hc,cmp:qe,PropModification:yr,replacePrefix:function(a,u){return new yr({replacePrefix:[a,u]})},add:function(a){return new yr({add:a})},remove:function(a){return new yr({remove:a})},default:bn,RangeSet:Nt,mergeRanges:Er,rangesOverlap:Ac}),{default:bn}),bn})}(ia)),ia.exports}var nb=tb();const ul=Ya(nb),vd=Symbol.for("Dexie"),_a=globalThis[vd]||(globalThis[vd]=ul);if(ul.semVer!==_a.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ul.semVer} and ${_a.semVer}`);const{liveQuery:gN,mergeRanges:vN,rangesOverlap:yN,RangeSet:bN,cmp:kN,Entity:_N,PropModification:wN,replacePrefix:SN,add:EN,remove:NN}=_a;class Uh extends _a{constructor(n,i,r={}){super(n);me(this,"logs");const s={logs:"id, level, time, source, account"};this.version(i).stores({...s,...r})}}class ib extends Uh{constructor(){super("nizza",1)}}class jh{constructor(e,n){me(this,"logger");me(this,"channel");me(this,"listeners",new Map);me(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=i=>this.handleMessage(i),this.channel.onmessageerror=i=>this.logger.error("NizzaBroadcastChannel error:",i)}catch(i){throw this.logger.error("Failed to create NizzaBroadcastChannel:",i),i}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,i={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,i)}handleMessage(e){const n=e.data,{name:i}=n;this.logger.debug(`Received message "${i}" with data`,n);for(const[r,s]of this.listeners.entries())this.matchWildcard(r,i)&&(this.logger.debug(`Matching pattern "${r}" for event "${i}"`),s.forEach(o=>o({...n,wildcard:r})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const r=new Error("Invalid arguments");throw this.logger.error(r),r}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const i=Array.from(this.eventQueue).filter(([r])=>{const s=this.matchWildcard(e,r);return s&&(this.eventQueue.delete(r),this.logger.debug(`Dequeued pending events for "${r}".`)),s}).flatMap(([,r])=>r);for(const[r,s]of this.listeners.entries())this.matchWildcard(r,e)&&(this.logger.debug(`Adding listener to pattern "${r}"`),s.add(n),i.length&&(this.logger.debug(`Delivering pending events for "${e}".`),i.forEach(o=>{n({...o,wildcard:r})})))}emitEvent(e,n,i){if(typeof e!="string"){const o=new Error("Invalid arguments");throw this.logger.error(o),o}const r={name:e,data:n,attrs:i},s=Array.from(this.getMatchingListeners(e));if(s.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[o,l]of s)l({...r,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(r);this.logger.debug("Posting message to channel",r),this.channel.postMessage(r)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,i]of this.listeners.entries())if(this.matchWildcard(n,e))for(const r of i)yield[n,r]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const i=this.listeners.get(e);i.delete(n),i.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const i=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),s=new RegExp(`^${i}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${s}`),s}}var Ir={exports:{}},yu,yd;function rb(){if(yd)return yu;yd=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}yu=e;function e(n,i,r){var s=r&&r.stringify||t,o=1;if(typeof n=="object"&&n!==null){var l=i.length+o;if(l===1)return n;var d=new Array(l);d[0]=s(n);for(var h=1;h<l;h++)d[h]=s(i[h]);return d.join(" ")}if(typeof n!="string")return n;var m=i.length;if(m===0)return n;for(var y="",g=1-o,O=-1,_=n&&n.length||0,S=0;S<_;){if(n.charCodeAt(S)===37&&S+1<_){switch(O=O>-1?O:0,n.charCodeAt(S+1)){case 100:case 102:if(g>=m||i[g]==null)break;O<S&&(y+=n.slice(O,S)),y+=Number(i[g]),O=S+2,S++;break;case 105:if(g>=m||i[g]==null)break;O<S&&(y+=n.slice(O,S)),y+=Math.floor(Number(i[g])),O=S+2,S++;break;case 79:case 111:case 106:if(g>=m||i[g]===void 0)break;O<S&&(y+=n.slice(O,S));var E=typeof i[g];if(E==="string"){y+="'"+i[g]+"'",O=S+2,S++;break}if(E==="function"){y+=i[g].name||"<anonymous>",O=S+2,S++;break}y+=s(i[g]),O=S+2,S++;break;case 115:if(g>=m)break;O<S&&(y+=n.slice(O,S)),y+=String(i[g]),O=S+2,S++;break;case 37:O<S&&(y+=n.slice(O,S)),y+="%",O=S+2,S++,g--;break}++g}++S}return O===-1?n:(O<_&&(y+=n.slice(O)),y)}return yu}var bd;function sb(){if(bd)return Ir.exports;bd=1;const t=rb();Ir.exports=m;const e=M().console||{},n={mapHttpRequest:oe,mapHttpResponse:oe,wrapRequestSerializer:Se,wrapResponseSerializer:Se,wrapErrorSerializer:Se,req:oe,res:oe,err:X,errWithCause:X};function i(N,K){return N==="silent"?1/0:K.levels.values[N]}const r=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(N,K){const ie={logger:K,parent:N[s]};K[s]=ie}function d(N,K,ie){const ce={};K.forEach(ae=>{ce[ae]=ie[ae]?ie[ae]:e[ae]||e[o[ae]||"log"]||ve}),N[r]=ce}function h(N,K){return Array.isArray(N)?N.filter(function(ce){return ce!=="!stdSerializers.err"}):N===!0?Object.keys(K):!1}function m(N){N=N||{},N.browser=N.browser||{};const K=N.browser.transmit;if(K&&typeof K.send!="function")throw Error("pino: transmit option must have a send function");const ie=N.browser.write||e;N.browser.write&&(N.browser.asObject=!0);const ce=N.serializers||{},ae=h(N.browser.serialize,ce);let B=N.browser.serialize;Array.isArray(N.browser.serialize)&&N.browser.serialize.indexOf("!stdSerializers.err")>-1&&(B=!1);const Fe=Object.keys(N.customLevels||{}),$e=["error","fatal","warn","info","debug","trace"].concat(Fe);typeof ie=="function"&&$e.forEach(function(et){ie[et]=ie}),(N.enabled===!1||N.browser.disabled)&&(N.level="silent");const Xe=N.level||"info",D=Object.create(ie);D.log||(D.log=ve),d(D,$e,ie),l({},D),Object.defineProperty(D,"levelVal",{get:pt}),Object.defineProperty(D,"level",{get:_e,set:Me});const H={transmit:K,serialize:ae,asObject:N.browser.asObject,formatters:N.browser.formatters,levels:$e,timestamp:ne(N),messageKey:N.messageKey||"msg",onChild:N.onChild||ve};D.levels=y(N),D.level=Xe,D.setMaxListeners=D.getMaxListeners=D.emit=D.addListener=D.on=D.prependListener=D.once=D.prependOnceListener=D.removeListener=D.removeAllListeners=D.listeners=D.listenerCount=D.eventNames=D.write=D.flush=ve,D.serializers=ce,D._serialize=ae,D._stdErrSerialize=B,D.child=function(...et){return ye.call(this,H,...et)},K&&(D._logEvent=z());function pt(){return i(this.level,this)}function _e(){return this._level}function Me(et){if(et!=="silent"&&!this.levels.values[et])throw Error("unknown level "+et);this._level=et,_(this,H,D,"error"),_(this,H,D,"fatal"),_(this,H,D,"warn"),_(this,H,D,"info"),_(this,H,D,"debug"),_(this,H,D,"trace"),Fe.forEach(Je=>{_(this,H,D,Je)})}function ye(et,Je,Oe){if(!Je)throw new Error("missing bindings for child Pino");Oe=Oe||{},ae&&Je.serializers&&(Oe.serializers=Je.serializers);const wt=Oe.serializers;if(ae&&wt){var lt=Object.assign({},ce,wt),Ae=N.browser.serialize===!0?Object.keys(lt):ae;delete Je.serializers,j([Je],Ae,lt,this._stdErrSerialize)}function mt(he){this._childLevel=(he._childLevel|0)+1,this.bindings=Je,lt&&(this.serializers=lt,this._serialize=Ae),K&&(this._logEvent=z([].concat(he._logEvent.bindings,Je)))}mt.prototype=this;const rt=new mt(this);return l(this,rt),rt.child=function(...he){return ye.call(this,et,...he)},rt.level=Oe.level||this.level,et.onChild(rt),rt}return D}function y(N){const K=N.customLevels||{},ie=Object.assign({},m.levels.values,K),ce=Object.assign({},m.levels.labels,g(K));return{values:ie,labels:ce}}function g(N){const K={};return Object.keys(N).forEach(function(ie){K[N[ie]]=ie}),K}m.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"}},m.stdSerializers=n,m.stdTimeFunctions=Object.assign({},{nullTime:ze,epochTime:Ne,unixTime:Re,isoTime:Ve});function O(N){const K=[];N.bindings&&K.push(N.bindings);let ie=N[s];for(;ie.parent;)ie=ie.parent,ie.logger.bindings&&K.push(ie.logger.bindings);return K.reverse()}function _(N,K,ie,ce){if(Object.defineProperty(N,ce,{value:i(N.level,ie)>i(ce,ie)?ve:ie[r][ce],writable:!0,enumerable:!0,configurable:!0}),N[ce]===ve){if(!K.transmit)return;const B=K.transmit.level||N.level,Fe=i(B,ie);if(i(ce,ie)<Fe)return}N[ce]=E(N,K,ie,ce);const ae=O(N);ae.length!==0&&(N[ce]=S(ae,N[ce]))}function S(N,K){return function(){return K.apply(this,[...N,...arguments])}}function E(N,K,ie,ce){return function(ae){return function(){const Fe=K.timestamp(),$e=new Array(arguments.length),Xe=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var D=0;D<$e.length;D++)$e[D]=arguments[D];var H=!1;if(K.serialize&&(j($e,this._serialize,this.serializers,this._stdErrSerialize),H=!0),K.asObject||K.formatters?ae.call(Xe,R(this,ce,$e,Fe,K)):ae.apply(Xe,$e),K.transmit){const pt=K.transmit.level||N._level,_e=i(pt,ie),Me=i(ce,ie);if(Me<_e)return;J(this,{ts:Fe,methodLevel:ce,methodValue:Me,transmitValue:ie.levels.values[K.transmit.level||N._level],send:K.transmit.send,val:i(N._level,ie)},$e,H)}}}(N[r][ce])}function R(N,K,ie,ce,ae){const{level:B,log:Fe=_e=>_e}=ae.formatters||{},$e=ie.slice();let Xe=$e[0];const D={};if(ce&&(D.time=ce),B){const _e=B(K,N.levels.values[K]);Object.assign(D,_e)}else D.level=N.levels.values[K];let H=(N._childLevel|0)+1;if(H<1&&(H=1),Xe!==null&&typeof Xe=="object"){for(;H--&&typeof $e[0]=="object";)Object.assign(D,$e.shift());Xe=$e.length?t($e.shift(),$e):void 0}else typeof Xe=="string"&&(Xe=t($e.shift(),$e));return Xe!==void 0&&(D[ae.messageKey]=Xe),Fe(D)}function j(N,K,ie,ce){for(const ae in N)if(ce&&N[ae]instanceof Error)N[ae]=m.stdSerializers.err(N[ae]);else if(typeof N[ae]=="object"&&!Array.isArray(N[ae])&&K)for(const B in N[ae])K.indexOf(B)>-1&&B in ie&&(N[ae][B]=ie[B](N[ae][B]))}function J(N,K,ie,ce=!1){const ae=K.send,B=K.ts,Fe=K.methodLevel,$e=K.methodValue,Xe=K.val,D=N._logEvent.bindings;ce||j(ie,N._serialize||Object.keys(N.serializers),N.serializers,N._stdErrSerialize===void 0?!0:N._stdErrSerialize),N._logEvent.ts=B,N._logEvent.messages=ie.filter(function(H){return D.indexOf(H)===-1}),N._logEvent.level.label=Fe,N._logEvent.level.value=$e,ae(Fe,N._logEvent,Xe),N._logEvent=z(D)}function z(N){return{ts:0,messages:[],bindings:N||[],level:{label:"",value:0}}}function X(N){const K={type:N.constructor.name,msg:N.message,stack:N.stack};for(const ie in N)K[ie]===void 0&&(K[ie]=N[ie]);return K}function ne(N){return typeof N.timestamp=="function"?N.timestamp:N.timestamp===!1?ze:Ne}function oe(){return{}}function Se(N){return N}function ve(){}function ze(){return!1}function Ne(){return Date.now()}function Re(){return Math.round(Date.now()/1e3)}function Ve(){return new Date(Date.now()).toISOString()}function M(){function N(K){return typeof K!="undefined"&&K}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 N(self)||N(window)||N(this)||{}}}return Ir.exports.default=m,Ir.exports.pino=m,Ir.exports}var ab=sb();const ob=Ya(ab),St=[];for(let t=0;t<256;++t)St.push((t+256).toString(16).slice(1));function ub(t,e=0){return(St[t[e+0]]+St[t[e+1]]+St[t[e+2]]+St[t[e+3]]+"-"+St[t[e+4]]+St[t[e+5]]+"-"+St[t[e+6]]+St[t[e+7]]+"-"+St[t[e+8]]+St[t[e+9]]+"-"+St[t[e+10]]+St[t[e+11]]+St[t[e+12]]+St[t[e+13]]+St[t[e+14]]+St[t[e+15]]).toLowerCase()}let bu;const lb=new Uint8Array(16);function cb(){if(!bu){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");bu=crypto.getRandomValues.bind(crypto)}return bu(lb)}const db=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kd={randomUUID:db};function fb(t,e,n){var r,s,o;if(kd.randomUUID&&!t)return kd.randomUUID();t=t||{};const i=(o=(s=t.random)!=null?s:(r=t.rng)==null?void 0:r.call(t))!=null?o:cb();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ub(i)}const hb=4;var Vh=(t=>(t.CREATED="CREATED",t.STARTING="STARTING",t.LIVE="LIVE",t.FINALIZED="FINALIZED",t))(Vh||{});const pb={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:**"},Hh={EVENT_STATUS_CHANGED:"event:statusChanged",ATCH_ACTION_EXECUTED:"core:addToCartHooks:actionExecuted"};var qh=(t=>(t.English="en",t.Spanish="es",t.Portuguese="pt",t))(qh||{}),ot=(t=>(t.TRACE="trace",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.FATAL="fatal",t))(ot||{});const Ze={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},zh={[Ze.trace]:"trace",[Ze.debug]:"debug",[Ze.info]:"info",[Ze.warn]:"warn",[Ze.error]:"error",[Ze.fatal]:"fatal"};var Kh=(t=>(t.COMBO="Combo",t.BADGE="Badged",t))(Kh||{}),Gh=(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))(Gh||{});function Wh(t){return Object.values(ot).includes(String(t).toLowerCase())}class Ul extends Error{constructor(e){super(`Invalid log level: ${e}`),this.name="InvalidLogLevelError"}}const Tt=class Tt{constructor(e){me(this,"instance");me(this,"httpLogger");me(this,"consoleLogger");me(this,"config");var l;this.config=e;const{source:n,levelService:i,metadata:r={},consoleLogger:s,httpLogger:o}=e;(l=Tt.root)!=null||(Tt.root=Tt.createRootLogger(s,o)),Tt.mergeGlobalMetadata(r),this.instance=Tt.root.child({source:n}),this.consoleLogger=s,this.httpLogger=o,this.setLevel(i.getLevel(n))}static createRootLogger(e,n){return ob({customLevels:Ze,browser:{write:i=>{const{payload:r,options:s,stack:o,...l}=i,d={...l,...r};s.silent||e.print(d,o),d.level>=Ze[ot.WARN]&&n.save(d)}}})}static mergeGlobalMetadata(e={}){Tt.globalMetadata={...Tt.globalMetadata,...e}}child(e,n={}){return Tt.mergeGlobalMetadata(n),new Tt({source:`${this.config.source}:${e}`,levelService:this.config.levelService,consoleLogger:this.consoleLogger,httpLogger:this.httpLogger})}setLevel(e){this.instance.level=e}setMetadata(e){Tt.mergeGlobalMetadata(e)}formatLogEntry(e){const{content:n,stack:i,options:r={}}=e,{message:s,args:o=[]}=n,l=fb(),d={};let h;return s instanceof Error?(d.error={name:s.name,message:s.message,stack:s.stack},h=s.message):h=typeof s=="object"?JSON.stringify(s):String(s),o.forEach((y,g)=>this.formatArg(y,g,d)),{payload:{id:l,msg:h,data:d,...Tt.globalMetadata},options:r,stack:i}}formatArg(e,n,i){if(e instanceof Error){const r=i.error?`error${n+1}`:"error";i[r]={message:e.message,stack:e.stack,name:e.name}}else typeof e=="object"&&e!==null?Object.assign(i,e):i[`$${n}`]=String(e)}log(e,n){if(typeof this.instance[e]!="function")throw new Ul(e);const i=this.formatLogEntry(n);this.instance[e](i)}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}};me(Tt,"globalMetadata",{}),me(Tt,"root",null);let ll=Tt;const _d={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:{[Ze[ot.TRACE]]:"color: #778899; font-weight: bold;",[Ze[ot.DEBUG]]:"color: #008B8B; font-weight: bold;",[Ze[ot.INFO]]:"color: #00FFFF; font-weight: bold;",[Ze[ot.WARN]]:"color: #FFD700; font-weight: bold;",[Ze[ot.ERROR]]:"color: #FF4500; font-weight: bold;",[Ze[ot.FATAL]]:"color: #FF0000; font-weight: bold; text-shadow: 1px 1px 1px black;"},messages:{[Ze[ot.WARN]]:"color: #FFD700; font-weight: normal;",[Ze[ot.ERROR]]:"color: #FF4500; font-weight: normal;",[Ze[ot.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:{[Ze[ot.TRACE]]:"color: #6A5ACD; font-weight: bold;",[Ze[ot.DEBUG]]:"color: #00509E; font-weight: bold;",[Ze[ot.INFO]]:"color: #1E90FF; font-weight: bold;",[Ze[ot.WARN]]:"color: #FFA500; font-weight: bold;",[Ze[ot.ERROR]]:"color: #ff0033; font-weight: bold;",[Ze[ot.FATAL]]:"color: #D80000; font-weight: bold; text-shadow: 1px 1px 1px #660000;"},messages:{[Ze[ot.WARN]]:"color: #FFA500; font-weight: normal;",[Ze[ot.ERROR]]:"color: #ff0033; font-weight: normal;",[Ze[ot.FATAL]]:"color: #D80000; font-weight: bold;"}}}};class mb{constructor(){me(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(`
|
|
29
|
-
`).filter(n=>!
|
|
30
|
-
`)),console.groupEnd()}}const gb={endpoint:`${rr.apiUrls.restV2}/v1/telemetry/logs`,batchSize:500,flushInterval:10,maxRetries:5,retryBackoffFactor:2,maxPayloadSize:500};class jl{constructor(e){me(this,"config");me(this,"isFlushing",!1);me(this,"retryCount",0);me(this,"isFlushScheduled",!1);this.config=e,this.setupUnloadListener()}static create(e){const n={...gb,...e};if(!n.db)throw new Error("Invalid Dixie DB");if(!n.project)throw new Error("Project name is required");return new jl(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 i=>{await this.sendLogs(i),await this.deleteLogs(i)}),this.retryCount=0,e=!0}catch(i){this.logError("flush",i)}this.isFlushing=!1;const n=await this.hasPendingLogs();!e&&n?this.handleRetry():e&&n&&this.scheduleFlush()}async processLogsBatch(e){const n=await this.getLogsBatch(),i=this.splitLogsByPayloadSize(n);for(const r of i)await e(r)}async getLogsBatch(e=this.config.batchSize){return this.config.db.logs.orderBy("time").limit(e).toArray()}splitLogsByPayloadSize(e){let n=[],i=0;const r=[];return e.forEach(s=>{const o=JSON.stringify(s).length/1024;i+o>this.config.maxPayloadSize&&(r.push(n),n=[],i=0),n.push(s),i+=o}),n.length>0&&r.push(n),r}async sendLogs(e){const n=this.buildPayload(e);await vi({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(i=>i.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 ku={},_u,wd;function Xa(){if(wd)return _u;wd=1;const t="\\\\/",e=`[^${t}]`,n="\\.",i="\\+",r="\\?",s="\\/",o="(?=.)",l="[^/]",d=`(?:${s}|$)`,h=`(?:^|${s})`,m=`${n}{1,2}${d}`,y=`(?!${n})`,g=`(?!${h}${m})`,O=`(?!${n}{0,1}${d})`,_=`(?!${m})`,S=`[^.${s}]`,E=`${l}*?`,j={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:r,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:l,END_ANCHOR:d,DOTS_SLASH:m,NO_DOT:y,NO_DOTS:g,NO_DOT_SLASH:O,NO_DOTS_SLASH:_,QMARK_NO_DOT:S,STAR:E,START_ANCHOR:h,SEP:"/"},J={...j,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:"\\"},z={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 _u={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:z,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(X){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${X.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(X){return X===!0?J:j}},_u}var Sd;function Qa(){return Sd||(Sd=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:r}=Xa();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>i.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(r,"\\$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,l)=>{const d=s.lastIndexOf(o,l);return d===-1?s:s[d-1]==="\\"?t.escapeLast(s,o,d-1):`${s.slice(0,d)}\\${s.slice(d)}`},t.removePrefix=(s,o={})=>{let l=s;return l.startsWith("./")&&(l=l.slice(2),o.prefix="./"),l},t.wrapOutput=(s,o={},l={})=>{const d=l.contains?"":"^",h=l.contains?"":"$";let m=`${d}(?:${s})${h}`;return o.negated===!0&&(m=`(?:^(?!${m}).*$)`),m},t.basename=(s,{windows:o}={})=>{const l=s.split(o?/[\\/]/:"/"),d=l[l.length-1];return d===""?l[l.length-2]:d}}(ku)),ku}var wu,Ed;function vb(){if(Ed)return wu;Ed=1;const t=Qa(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:r,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:d,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:y,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:O,CHAR_RIGHT_PARENTHESES:_,CHAR_RIGHT_SQUARE_BRACKET:S}=Xa(),E=J=>J===l||J===i,R=J=>{J.isPrefix!==!0&&(J.depth=J.isGlobstar?1/0:1)};return wu=(J,z)=>{const X=z||{},ne=J.length-1,oe=X.parts===!0||X.scanToEnd===!0,Se=[],ve=[],ze=[];let Ne=J,Re=-1,Ve=0,M=0,N=!1,K=!1,ie=!1,ce=!1,ae=!1,B=!1,Fe=!1,$e=!1,Xe=!1,D=!1,H=0,pt,_e,Me={value:"",depth:0,isGlob:!1};const ye=()=>Re>=ne,et=()=>Ne.charCodeAt(Re+1),Je=()=>(pt=_e,Ne.charCodeAt(++Re));for(;Re<ne;){_e=Je();let mt;if(_e===i){Fe=Me.backslashes=!0,_e=Je(),_e===d&&(B=!0);continue}if(B===!0||_e===d){for(H++;ye()!==!0&&(_e=Je());){if(_e===i){Fe=Me.backslashes=!0,Je();continue}if(_e===d){H++;continue}if(B!==!0&&_e===s&&(_e=Je())===s){if(N=Me.isBrace=!0,ie=Me.isGlob=!0,D=!0,oe===!0)continue;break}if(B!==!0&&_e===r){if(N=Me.isBrace=!0,ie=Me.isGlob=!0,D=!0,oe===!0)continue;break}if(_e===O&&(H--,H===0)){B=!1,N=Me.isBrace=!0,D=!0;break}}if(oe===!0)continue;break}if(_e===l){if(Se.push(Re),ve.push(Me),Me={value:"",depth:0,isGlob:!1},D===!0)continue;if(pt===s&&Re===Ve+1){Ve+=2;continue}M=Re+1;continue}if(X.noext!==!0&&(_e===y||_e===n||_e===e||_e===g||_e===o)===!0&&et()===h){if(ie=Me.isGlob=!0,ce=Me.isExtglob=!0,D=!0,_e===o&&Re===Ve&&(Xe=!0),oe===!0){for(;ye()!==!0&&(_e=Je());){if(_e===i){Fe=Me.backslashes=!0,_e=Je();continue}if(_e===_){ie=Me.isGlob=!0,D=!0;break}}continue}break}if(_e===e){if(pt===e&&(ae=Me.isGlobstar=!0),ie=Me.isGlob=!0,D=!0,oe===!0)continue;break}if(_e===g){if(ie=Me.isGlob=!0,D=!0,oe===!0)continue;break}if(_e===m){for(;ye()!==!0&&(mt=Je());){if(mt===i){Fe=Me.backslashes=!0,Je();continue}if(mt===S){K=Me.isBracket=!0,ie=Me.isGlob=!0,D=!0;break}}if(oe===!0)continue;break}if(X.nonegate!==!0&&_e===o&&Re===Ve){$e=Me.negated=!0,Ve++;continue}if(X.noparen!==!0&&_e===h){if(ie=Me.isGlob=!0,oe===!0){for(;ye()!==!0&&(_e=Je());){if(_e===h){Fe=Me.backslashes=!0,_e=Je();continue}if(_e===_){D=!0;break}}continue}break}if(ie===!0){if(D=!0,oe===!0)continue;break}}X.noext===!0&&(ce=!1,ie=!1);let Oe=Ne,wt="",lt="";Ve>0&&(wt=Ne.slice(0,Ve),Ne=Ne.slice(Ve),M-=Ve),Oe&&ie===!0&&M>0?(Oe=Ne.slice(0,M),lt=Ne.slice(M)):ie===!0?(Oe="",lt=Ne):Oe=Ne,Oe&&Oe!==""&&Oe!=="/"&&Oe!==Ne&&E(Oe.charCodeAt(Oe.length-1))&&(Oe=Oe.slice(0,-1)),X.unescape===!0&&(lt&&(lt=t.removeBackslashes(lt)),Oe&&Fe===!0&&(Oe=t.removeBackslashes(Oe)));const Ae={prefix:wt,input:J,start:Ve,base:Oe,glob:lt,isBrace:N,isBracket:K,isGlob:ie,isExtglob:ce,isGlobstar:ae,negated:$e,negatedExtglob:Xe};if(X.tokens===!0&&(Ae.maxDepth=0,E(_e)||ve.push(Me),Ae.tokens=ve),X.parts===!0||X.tokens===!0){let mt;for(let rt=0;rt<Se.length;rt++){const he=mt?mt+1:Ve,Ye=Se[rt],ue=J.slice(he,Ye);X.tokens&&(rt===0&&Ve!==0?(ve[rt].isPrefix=!0,ve[rt].value=wt):ve[rt].value=ue,R(ve[rt]),Ae.maxDepth+=ve[rt].depth),(rt!==0||ue!=="")&&ze.push(ue),mt=Ye}if(mt&&mt+1<J.length){const rt=J.slice(mt+1);ze.push(rt),X.tokens&&(ve[ve.length-1].value=rt,R(ve[ve.length-1]),Ae.maxDepth+=ve[ve.length-1].depth)}Ae.slashes=Se,Ae.parts=ze}return Ae},wu}var Su,Nd;function yb(){if(Nd)return Su;Nd=1;const t=Xa(),e=Qa(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,l=(m,y)=>{if(typeof y.expandRange=="function")return y.expandRange(...m,y);m.sort();const g=`[${m.join("-")}]`;try{new RegExp(g)}catch{return m.map(_=>e.escapeRegex(_)).join("..")}return g},d=(m,y)=>`Missing ${m}: "${y}" - use "\\\\${y}" to match literal characters`,h=(m,y)=>{if(typeof m!="string")throw new TypeError("Expected a string");m=o[m]||m;const g={...y},O=typeof g.maxLength=="number"?Math.min(n,g.maxLength):n;let _=m.length;if(_>O)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${O}`);const S={type:"bos",value:"",output:g.prepend||""},E=[S],R=g.capture?"":"?:",j=t.globChars(g.windows),J=t.extglobChars(j),{DOT_LITERAL:z,PLUS_LITERAL:X,SLASH_LITERAL:ne,ONE_CHAR:oe,DOTS_SLASH:Se,NO_DOT:ve,NO_DOT_SLASH:ze,NO_DOTS_SLASH:Ne,QMARK:Re,QMARK_NO_DOT:Ve,STAR:M,START_ANCHOR:N}=j,K=he=>`(${R}(?:(?!${N}${he.dot?Se:z}).)*?)`,ie=g.dot?"":ve,ce=g.dot?Re:Ve;let ae=g.bash===!0?K(g):M;g.capture&&(ae=`(${ae})`),typeof g.noext=="boolean"&&(g.noextglob=g.noext);const B={input:m,index:-1,start:0,dot:g.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:E};m=e.removePrefix(m,B),_=m.length;const Fe=[],$e=[],Xe=[];let D=S,H;const pt=()=>B.index===_-1,_e=B.peek=(he=1)=>m[B.index+he],Me=B.advance=()=>m[++B.index]||"",ye=()=>m.slice(B.index+1),et=(he="",Ye=0)=>{B.consumed+=he,B.index+=Ye},Je=he=>{B.output+=he.output!=null?he.output:he.value,et(he.value)},Oe=()=>{let he=1;for(;_e()==="!"&&(_e(2)!=="("||_e(3)==="?");)Me(),B.start++,he++;return he%2===0?!1:(B.negated=!0,B.start++,!0)},wt=he=>{B[he]++,Xe.push(he)},lt=he=>{B[he]--,Xe.pop()},Ae=he=>{if(D.type==="globstar"){const Ye=B.braces>0&&(he.type==="comma"||he.type==="brace"),ue=he.extglob===!0||Fe.length&&(he.type==="pipe"||he.type==="paren");he.type!=="slash"&&he.type!=="paren"&&!Ye&&!ue&&(B.output=B.output.slice(0,-D.output.length),D.type="star",D.value="*",D.output=ae,B.output+=D.output)}if(Fe.length&&he.type!=="paren"&&(Fe[Fe.length-1].inner+=he.value),(he.value||he.output)&&Je(he),D&&D.type==="text"&&he.type==="text"){D.output=(D.output||D.value)+he.value,D.value+=he.value;return}he.prev=D,E.push(he),D=he},mt=(he,Ye)=>{const ue={...J[Ye],conditions:1,inner:""};ue.prev=D,ue.parens=B.parens,ue.output=B.output;const Te=(g.capture?"(":"")+ue.open;wt("parens"),Ae({type:he,value:Ye,output:B.output?"":oe}),Ae({type:"paren",extglob:!0,value:Me(),output:Te}),Fe.push(ue)},rt=he=>{let Ye=he.close+(g.capture?")":""),ue;if(he.type==="negate"){let Te=ae;if(he.inner&&he.inner.length>1&&he.inner.includes("/")&&(Te=K(g)),(Te!==ae||pt()||/^\)+$/.test(ye()))&&(Ye=he.close=`)$))${Te}`),he.inner.includes("*")&&(ue=ye())&&/^\.[^\\/.]+$/.test(ue)){const tt=h(ue,{...y,fastpaths:!1}).output;Ye=he.close=`)${tt})${Te})`}he.prev.type==="bos"&&(B.negatedExtglob=!0)}Ae({type:"paren",extglob:!0,value:H,output:Ye}),lt("parens")};if(g.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(m)){let he=!1,Ye=m.replace(s,(ue,Te,tt,ct,ut,vn)=>ct==="\\"?(he=!0,ue):ct==="?"?Te?Te+ct+(ut?Re.repeat(ut.length):""):vn===0?ce+(ut?Re.repeat(ut.length):""):Re.repeat(tt.length):ct==="."?z.repeat(tt.length):ct==="*"?Te?Te+ct+(ut?ae:""):ae:Te?ue:`\\${ue}`);return he===!0&&(g.unescape===!0?Ye=Ye.replace(/\\/g,""):Ye=Ye.replace(/\\+/g,ue=>ue.length%2===0?"\\\\":ue?"\\":"")),Ye===m&&g.contains===!0?(B.output=m,B):(B.output=e.wrapOutput(Ye,B,y),B)}for(;!pt();){if(H=Me(),H==="\0")continue;if(H==="\\"){const ue=_e();if(ue==="/"&&g.bash!==!0||ue==="."||ue===";")continue;if(!ue){H+="\\",Ae({type:"text",value:H});continue}const Te=/^\\+/.exec(ye());let tt=0;if(Te&&Te[0].length>2&&(tt=Te[0].length,B.index+=tt,tt%2!==0&&(H+="\\")),g.unescape===!0?H=Me():H+=Me(),B.brackets===0){Ae({type:"text",value:H});continue}}if(B.brackets>0&&(H!=="]"||D.value==="["||D.value==="[^")){if(g.posix!==!1&&H===":"){const ue=D.value.slice(1);if(ue.includes("[")&&(D.posix=!0,ue.includes(":"))){const Te=D.value.lastIndexOf("["),tt=D.value.slice(0,Te),ct=D.value.slice(Te+2),ut=i[ct];if(ut){D.value=tt+ut,B.backtrack=!0,Me(),!S.output&&E.indexOf(D)===1&&(S.output=oe);continue}}}(H==="["&&_e()!==":"||H==="-"&&_e()==="]")&&(H=`\\${H}`),H==="]"&&(D.value==="["||D.value==="[^")&&(H=`\\${H}`),g.posix===!0&&H==="!"&&D.value==="["&&(H="^"),D.value+=H,Je({value:H});continue}if(B.quotes===1&&H!=='"'){H=e.escapeRegex(H),D.value+=H,Je({value:H});continue}if(H==='"'){B.quotes=B.quotes===1?0:1,g.keepQuotes===!0&&Ae({type:"text",value:H});continue}if(H==="("){wt("parens"),Ae({type:"paren",value:H});continue}if(H===")"){if(B.parens===0&&g.strictBrackets===!0)throw new SyntaxError(d("opening","("));const ue=Fe[Fe.length-1];if(ue&&B.parens===ue.parens+1){rt(Fe.pop());continue}Ae({type:"paren",value:H,output:B.parens?")":"\\)"}),lt("parens");continue}if(H==="["){if(g.nobracket===!0||!ye().includes("]")){if(g.nobracket!==!0&&g.strictBrackets===!0)throw new SyntaxError(d("closing","]"));H=`\\${H}`}else wt("brackets");Ae({type:"bracket",value:H});continue}if(H==="]"){if(g.nobracket===!0||D&&D.type==="bracket"&&D.value.length===1){Ae({type:"text",value:H,output:`\\${H}`});continue}if(B.brackets===0){if(g.strictBrackets===!0)throw new SyntaxError(d("opening","["));Ae({type:"text",value:H,output:`\\${H}`});continue}lt("brackets");const ue=D.value.slice(1);if(D.posix!==!0&&ue[0]==="^"&&!ue.includes("/")&&(H=`/${H}`),D.value+=H,Je({value:H}),g.literalBrackets===!1||e.hasRegexChars(ue))continue;const Te=e.escapeRegex(D.value);if(B.output=B.output.slice(0,-D.value.length),g.literalBrackets===!0){B.output+=Te,D.value=Te;continue}D.value=`(${R}${Te}|${D.value})`,B.output+=D.value;continue}if(H==="{"&&g.nobrace!==!0){wt("braces");const ue={type:"brace",value:H,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};$e.push(ue),Ae(ue);continue}if(H==="}"){const ue=$e[$e.length-1];if(g.nobrace===!0||!ue){Ae({type:"text",value:H,output:H});continue}let Te=")";if(ue.dots===!0){const tt=E.slice(),ct=[];for(let ut=tt.length-1;ut>=0&&(E.pop(),tt[ut].type!=="brace");ut--)tt[ut].type!=="dots"&&ct.unshift(tt[ut].value);Te=l(ct,g),B.backtrack=!0}if(ue.comma!==!0&&ue.dots!==!0){const tt=B.output.slice(0,ue.outputIndex),ct=B.tokens.slice(ue.tokensIndex);ue.value=ue.output="\\{",H=Te="\\}",B.output=tt;for(const ut of ct)B.output+=ut.output||ut.value}Ae({type:"brace",value:H,output:Te}),lt("braces"),$e.pop();continue}if(H==="|"){Fe.length>0&&Fe[Fe.length-1].conditions++,Ae({type:"text",value:H});continue}if(H===","){let ue=H;const Te=$e[$e.length-1];Te&&Xe[Xe.length-1]==="braces"&&(Te.comma=!0,ue="|"),Ae({type:"comma",value:H,output:ue});continue}if(H==="/"){if(D.type==="dot"&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",E.pop(),D=S;continue}Ae({type:"slash",value:H,output:ne});continue}if(H==="."){if(B.braces>0&&D.type==="dot"){D.value==="."&&(D.output=z);const ue=$e[$e.length-1];D.type="dots",D.output+=H,D.value+=H,ue.dots=!0;continue}if(B.braces+B.parens===0&&D.type!=="bos"&&D.type!=="slash"){Ae({type:"text",value:H,output:z});continue}Ae({type:"dot",value:H,output:z});continue}if(H==="?"){if(!(D&&D.value==="(")&&g.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){mt("qmark",H);continue}if(D&&D.type==="paren"){const Te=_e();let tt=H;(D.value==="("&&!/[!=<:]/.test(Te)||Te==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(tt=`\\${H}`),Ae({type:"text",value:H,output:tt});continue}if(g.dot!==!0&&(D.type==="slash"||D.type==="bos")){Ae({type:"qmark",value:H,output:Ve});continue}Ae({type:"qmark",value:H,output:Re});continue}if(H==="!"){if(g.noextglob!==!0&&_e()==="("&&(_e(2)!=="?"||!/[!=<:]/.test(_e(3)))){mt("negate",H);continue}if(g.nonegate!==!0&&B.index===0){Oe();continue}}if(H==="+"){if(g.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){mt("plus",H);continue}if(D&&D.value==="("||g.regex===!1){Ae({type:"plus",value:H,output:X});continue}if(D&&(D.type==="bracket"||D.type==="paren"||D.type==="brace")||B.parens>0){Ae({type:"plus",value:H});continue}Ae({type:"plus",value:X});continue}if(H==="@"){if(g.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){Ae({type:"at",extglob:!0,value:H,output:""});continue}Ae({type:"text",value:H});continue}if(H!=="*"){(H==="$"||H==="^")&&(H=`\\${H}`);const ue=r.exec(ye());ue&&(H+=ue[0],B.index+=ue[0].length),Ae({type:"text",value:H});continue}if(D&&(D.type==="globstar"||D.star===!0)){D.type="star",D.star=!0,D.value+=H,D.output=ae,B.backtrack=!0,B.globstar=!0,et(H);continue}let he=ye();if(g.noextglob!==!0&&/^\([^?]/.test(he)){mt("star",H);continue}if(D.type==="star"){if(g.noglobstar===!0){et(H);continue}const ue=D.prev,Te=ue.prev,tt=ue.type==="slash"||ue.type==="bos",ct=Te&&(Te.type==="star"||Te.type==="globstar");if(g.bash===!0&&(!tt||he[0]&&he[0]!=="/")){Ae({type:"star",value:H,output:""});continue}const ut=B.braces>0&&(ue.type==="comma"||ue.type==="brace"),vn=Fe.length&&(ue.type==="pipe"||ue.type==="paren");if(!tt&&ue.type!=="paren"&&!ut&&!vn){Ae({type:"star",value:H,output:""});continue}for(;he.slice(0,3)==="/**";){const qt=m[B.index+4];if(qt&&qt!=="/")break;he=he.slice(3),et("/**",3)}if(ue.type==="bos"&&pt()){D.type="globstar",D.value+=H,D.output=K(g),B.output=D.output,B.globstar=!0,et(H);continue}if(ue.type==="slash"&&ue.prev.type!=="bos"&&!ct&&pt()){B.output=B.output.slice(0,-(ue.output+D.output).length),ue.output=`(?:${ue.output}`,D.type="globstar",D.output=K(g)+(g.strictSlashes?")":"|$)"),D.value+=H,B.globstar=!0,B.output+=ue.output+D.output,et(H);continue}if(ue.type==="slash"&&ue.prev.type!=="bos"&&he[0]==="/"){const qt=he[1]!==void 0?"|$":"";B.output=B.output.slice(0,-(ue.output+D.output).length),ue.output=`(?:${ue.output}`,D.type="globstar",D.output=`${K(g)}${ne}|${ne}${qt})`,D.value+=H,B.output+=ue.output+D.output,B.globstar=!0,et(H+Me()),Ae({type:"slash",value:"/",output:""});continue}if(ue.type==="bos"&&he[0]==="/"){D.type="globstar",D.value+=H,D.output=`(?:^|${ne}|${K(g)}${ne})`,B.output=D.output,B.globstar=!0,et(H+Me()),Ae({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-D.output.length),D.type="globstar",D.output=K(g),D.value+=H,B.output+=D.output,B.globstar=!0,et(H);continue}const Ye={type:"star",value:H,output:ae};if(g.bash===!0){Ye.output=".*?",(D.type==="bos"||D.type==="slash")&&(Ye.output=ie+Ye.output),Ae(Ye);continue}if(D&&(D.type==="bracket"||D.type==="paren")&&g.regex===!0){Ye.output=H,Ae(Ye);continue}(B.index===B.start||D.type==="slash"||D.type==="dot")&&(D.type==="dot"?(B.output+=ze,D.output+=ze):g.dot===!0?(B.output+=Ne,D.output+=Ne):(B.output+=ie,D.output+=ie),_e()!=="*"&&(B.output+=oe,D.output+=oe)),Ae(Ye)}for(;B.brackets>0;){if(g.strictBrackets===!0)throw new SyntaxError(d("closing","]"));B.output=e.escapeLast(B.output,"["),lt("brackets")}for(;B.parens>0;){if(g.strictBrackets===!0)throw new SyntaxError(d("closing",")"));B.output=e.escapeLast(B.output,"("),lt("parens")}for(;B.braces>0;){if(g.strictBrackets===!0)throw new SyntaxError(d("closing","}"));B.output=e.escapeLast(B.output,"{"),lt("braces")}if(g.strictSlashes!==!0&&(D.type==="star"||D.type==="bracket")&&Ae({type:"maybe_slash",value:"",output:`${ne}?`}),B.backtrack===!0){B.output="";for(const he of B.tokens)B.output+=he.output!=null?he.output:he.value,he.suffix&&(B.output+=he.suffix)}return B};return h.fastpaths=(m,y)=>{const g={...y},O=typeof g.maxLength=="number"?Math.min(n,g.maxLength):n,_=m.length;if(_>O)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${O}`);m=o[m]||m;const{DOT_LITERAL:S,SLASH_LITERAL:E,ONE_CHAR:R,DOTS_SLASH:j,NO_DOT:J,NO_DOTS:z,NO_DOTS_SLASH:X,STAR:ne,START_ANCHOR:oe}=t.globChars(g.windows),Se=g.dot?z:J,ve=g.dot?X:J,ze=g.capture?"":"?:",Ne={negated:!1,prefix:""};let Re=g.bash===!0?".*?":ne;g.capture&&(Re=`(${Re})`);const Ve=ie=>ie.noglobstar===!0?Re:`(${ze}(?:(?!${oe}${ie.dot?j:S}).)*?)`,M=ie=>{switch(ie){case"*":return`${Se}${R}${Re}`;case".*":return`${S}${R}${Re}`;case"*.*":return`${Se}${Re}${S}${R}${Re}`;case"*/*":return`${Se}${Re}${E}${R}${ve}${Re}`;case"**":return Se+Ve(g);case"**/*":return`(?:${Se}${Ve(g)}${E})?${ve}${R}${Re}`;case"**/*.*":return`(?:${Se}${Ve(g)}${E})?${ve}${Re}${S}${R}${Re}`;case"**/.*":return`(?:${Se}${Ve(g)}${E})?${S}${R}${Re}`;default:{const ce=/^(.*?)\.(\w+)$/.exec(ie);if(!ce)return;const ae=M(ce[1]);return ae?ae+S+ce[2]:void 0}}},N=e.removePrefix(m,Ne);let K=M(N);return K&&g.strictSlashes!==!0&&(K+=`${E}?`),K},Su=h,Su}var Eu,Ad;function bb(){if(Ad)return Eu;Ad=1;const t=vb(),e=yb(),n=Qa(),i=Xa(),r=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,l,d=!1)=>{if(Array.isArray(o)){const E=o.map(j=>s(j,l,d));return j=>{for(const J of E){const z=J(j);if(z)return z}return!1}}const h=r(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!h)throw new TypeError("Expected pattern to be a non-empty string");const m=l||{},y=m.windows,g=h?s.compileRe(o,l):s.makeRe(o,l,!1,!0),O=g.state;delete g.state;let _=()=>!1;if(m.ignore){const E={...l,ignore:null,onMatch:null,onResult:null};_=s(m.ignore,E,d)}const S=(E,R=!1)=>{const{isMatch:j,match:J,output:z}=s.test(E,g,l,{glob:o,posix:y}),X={glob:o,state:O,regex:g,posix:y,input:E,output:z,match:J,isMatch:j};return typeof m.onResult=="function"&&m.onResult(X),j===!1?(X.isMatch=!1,R?X:!1):_(E)?(typeof m.onIgnore=="function"&&m.onIgnore(X),X.isMatch=!1,R?X:!1):(typeof m.onMatch=="function"&&m.onMatch(X),R?X:!0)};return d&&(S.state=O),S};return s.test=(o,l,d,{glob:h,posix:m}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const y=d||{},g=y.format||(m?n.toPosixSlashes:null);let O=o===h,_=O&&g?g(o):o;return O===!1&&(_=g?g(o):o,O=_===h),(O===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?O=s.matchBase(o,l,d,m):O=l.exec(_)),{isMatch:!!O,match:O,output:_}},s.matchBase=(o,l,d)=>(l instanceof RegExp?l:s.makeRe(l,d)).test(n.basename(o)),s.isMatch=(o,l,d)=>s(l,d)(o),s.parse=(o,l)=>Array.isArray(o)?o.map(d=>s.parse(d,l)):e(o,{...l,fastpaths:!1}),s.scan=(o,l)=>t(o,l),s.compileRe=(o,l,d=!1,h=!1)=>{if(d===!0)return o.output;const m=l||{},y=m.contains?"":"^",g=m.contains?"":"$";let O=`${y}(?:${o.output})${g}`;o&&o.negated===!0&&(O=`^(?!${O}).*$`);const _=s.toRegex(O,l);return h===!0&&(_.state=o),_},s.makeRe=(o,l={},d=!1,h=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let m={negated:!1,fastpaths:!0};return l.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(m.output=e.fastpaths(o,l)),m.output||(m=e(o,l)),s.compileRe(m,l,d,h)},s.toRegex=(o,l)=>{try{const d=l||{};return new RegExp(o,d.flags||(d.nocase?"i":""))}catch(d){if(l&&l.debug===!0)throw d;return/$^/}},s.constants=i,Eu=s,Eu}var Nu,Od;function kb(){if(Od)return Nu;Od=1;const t=bb(),e=Qa();function n(i,r,s=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:e.isWindows()}),t(i,r,s)}return Object.assign(n,t),Nu=n,Nu}var _b=kb();const xd=Ya(_b),Td="loglevel-patterns",Js="loglevel:",Au="!",wb=ot.INFO;class Sb{constructor(e){me(this,"projectPrefix");me(this,"patternsCache",null);this.projectPrefix=`${Js}${e}:`}getLevel(e){const n=this.loadAndUnifyPatterns();return this.resolveLogLevelFromPatterns(e,n)||wb}setLevel(e,n){const{level:i,override:r}=this.parseLogLevel(n),s=`${Js}${e}`,o=r?`${i}${Au}`:i;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 i;for(const[r,{level:s,override:o}]of Object.entries(n))if(xd(r.toLowerCase())(e.toLowerCase())){if(o)return s;(!i||xd(r)(e))&&(i=s)}return i}readPatternsFromJSON(){try{const e=localStorage.getItem(Td);return e?JSON.parse(e):{}}catch{return console.error("Failed to parse loglevel-patterns from localStorage"),{}}}unifyWithIndividualKeys(e){const n={...e};for(let i=0;i<localStorage.length;i++){const r=localStorage.key(i);if(!r||!r.startsWith(Js)||r===Td)continue;const s=r.replace(Js,"").toLowerCase(),o=localStorage.getItem(r);if(!o)continue;const{level:l,override:d}=this.parseLogLevel(o);n[s]={level:l,override:d}}return n}parseLogLevel(e){const n=e.endsWith(Au),i=n?e.slice(0,-Au.length):e;if(!Wh(i))throw new Ul(i);return{level:i,override:n}}}class Eb{constructor(e,n){me(this,"committed",!1);me(this,"chainOptions",{});me(this,"method",null);me(this,"stack","");me(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 i;return this.method=e,this.args=n,this.stack=(i=new Error().stack)!=null?i:"",this}commit(){if(!this.committed&&(this.committed=!0,this.method)){const e=this.args[0],n=this.args.slice(1),i={stack:this.stack,content:{message:e,args:n},options:this.chainOptions};this.adapter[this.method](i)}}}let Jh=class cl{constructor(e){me(this,"adapter");this.adapter=e}static create(e){const n=new cl(e);return n.setMetadata({account:null,client:np()}),n}child(e,n={}){return new cl(this.adapter.child(e,n))}lazyChild(e,n={}){let i;return new Proxy({},{get:(r,s,o)=>(i||(i=this.child(e,n)),Reflect.get(i,s,o))})}setMetadata(e){this.adapter.setMetadata(e)}setLevel(e){if(!Wh(e))throw new Ul(e);this.adapter.setLevel(e)}createChain(e){return new Eb(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 Nb(t){return xi().logger.lazyChild(t)}function Yh(t,e){return Jh.create(new ll({source:t,levelService:new Sb(t),consoleLogger:new mb,httpLogger:jl.create({db:e,project:t})}))}const Ab="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ob=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=Ab[n[t]&63];return e};const wa=(t=8)=>Ob(t),Xh=(t,e=!1)=>{const n=Object.entries(t).reduce((i,[r,s])=>s!==void 0&&(!e||s!==null)?`${i}${i?"&":""}${r}=${s}`:i,"");return n?`?${n}`:""},Qh=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function xb(){const t=new Error().stack.split(`
|
|
31
|
-
`);return t.length<3?"":t[2].trim().substring(3)}function Tb(t){return new Promise(e=>setTimeout(e,t))}const Kt=class Kt{constructor(){me(this,"projectName","nizza");me(this,"instanceId",wa());me(this,"nizzaDB",new ib);me(this,"logger",Yh(this.projectName,this.nizzaDB));me(this,"coreLogger",this.logger.child("core"));me(this,"_logger",this.coreLogger.child("NizzaStore"));me(this,"_config",null);me(this,"_account");me(this,"_accountStatus","idle");me(this,"_productDataSource");me(this,"_eventBus",new jh("nizza",this.coreLogger));me(this,"activeAccountFetchId",null);Fy(this,{_config:ht,_account:ht,_productDataSource:ht,_accountStatus:ht,config:zn,account:zn,accountName:zn,accountStatus:zn,setAccount:Bt,configure:Bt,refetchAccount:Bt,setProductDataSource:Bt,setAddToCartConfig:Bt,setProductId:Bt},{name:"NizzaStore",autoBind:!0}),this.refetchAccount=this.refetchAccount.bind(this)}static instance(){var n;if(!!((n=window==null?void 0:window.nizza)!=null&&n.store))Kt._instance=window.nizza.store;else{const i=new Kt;Kt._instance=i,Kt._instance._logger.debug("Created new NizzaStore instance")}return window.nizza||(window.nizza={},window.nz={},Kt._instance._logger.debug("Initialized nizza window object")),window.nizza.store=Kt._instance,window.nz=window.nizza,Kt._instance}async configure(e){try{this._logger.debug("Running configure with config:",e),await this.updateConfig(e)}catch(n){this.setAccountStatus("error"),this._logger.error("Error running configure",n)}}async updateConfig(e={}){var r,s;const{account:n,authToken:i}=(r=this._config)!=null?r:{};this._config={...this._config,...e},(s=this._config)!=null&&s.account&&(n!==this._config.account||i!==this._config.authToken)?(this._logger.debug(`Fetching account data for account: ${this._config.account}, authToken provided: ${!!this._config.authToken}`),this.logger.setMetadata({account:this._config.account}),await this.fetchAccount(this._config.account,this._config.authToken)):this._logger.debug("Skipped fetching account data as the account or authToken did not change"),e.getProductDataSource&&this.setProductDataSource(await e.getProductDataSource())}async fetchAccount(e,n){this.setAccountStatus("loading");const i=wa();this.activeAccountFetchId=i;try{const r=await gp(e,n);if(this.activeAccountFetchId!==i){this._logger.debug("Fetch account request was superseded by a newer request");return}this.setAccount(r),this.setAccountStatus("success"),this._logger.debug("Account fetched and set successfully:",r)}catch(r){this.activeAccountFetchId===i&&(this.setAccountStatus("error"),r instanceof Vl?this._logger.fatal("Nizza account not found",e).options({silent:!0}):this._logger.fatal("Unexpected error fetching account",r))}}setAccount(e){this._account=e}setAccountStatus(e){this._accountStatus=e}setProductDataSource(e){this._productDataSource=e}setProductId(e){this._config&&(this._config.productId=e)}setOrderFormId(e){this._config&&(this._config.orderFormId=e)}setAddToCartConfig(e){if(!this._config){const n="You cannot set addToCartConfig before running configure()";throw this._logger.error(n),new Error(n)}this._config.addToCartConfig=e}setAuthToken(e){this.updateConfig({authToken:e})}async refetchAccount(){var e;(e=this._config)!=null&&e.account&&await this.fetchAccount(this._config.account,this._config.authToken)}get version(){return Kt.version}get config(){return this._config}get account(){return this._account}get accountStatus(){return this._accountStatus}get accountName(){var e;return(e=this._config)==null?void 0:e.account}isPvtAccount(e){var n;return!!(e&&((n=this._config)!=null&&n.authToken))}isPubAccount(e){var n;return!!(e&&!((n=this._config)!=null&&n.authToken))}get productDataSource(){return this._productDataSource}get eventBus(){return this._eventBus}};me(Kt,"version","9"),me(Kt,"_instance");let Sa=Kt;const xi=t=>{const e=Sa.instance();return xy(()=>!!e.account,()=>t==null?void 0:t(e)),e};function Zh(){return je.useMemo(()=>xi(),[])}function ep(t,e){const n=Zh();return Bh(()=>t(n),e)}const{coreLogger:Cb}=xi(),Rb=Cb.child("getClientTimeZone");function tp(t=!1){var s,o,l;let e=null,n=null,i=null;try{e=(l=(o=(s=Intl.DateTimeFormat())==null?void 0:s.resolvedOptions())==null?void 0:o.timeZone)!=null?l:null;const d=-new Date().getTimezoneOffset();i=d;const h=d>=0?"+":"-",m=String(Math.floor(Math.abs(d)/60)).padStart(2,"0"),y=String(Math.abs(d)%60).padStart(2,"0");n=`${h}${m}:${y}`}catch(d){Rb.error("Error obtaining time zone or offset",d)}const r={offset:n,offsetValue:i,value:e,country:null,included:null,label:null};if(t){const{country:d,included:h,label:m,...y}=r;return y}return r}function np(){const e=typeof navigator!="undefined"?navigator.userAgent:"server",n=Fb(e),{language:i,languages:r}=Ib(),s=Db(),o=Pb(),{hardwareConcurrency:l,deviceMemory:d}=Lb(),h=$b();return{userAgent:e,browser:n.browser,os:n.os,device:n.device,language:i,languages:r,screen:s,connection:o,hardwareConcurrency:l,deviceMemory:d,timezone:h}}function Fb(t){try{const n=new On(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 Ib(){return typeof navigator!="undefined"?{language:navigator.language||"Unknown",languages:navigator.languages?[...navigator.languages]:[]}:{language:"Unknown",languages:[]}}function Db(){return typeof window!="undefined"&&window.screen?{width:window.screen.width,height:window.screen.height,colorDepth:window.screen.colorDepth}:null}function Pb(){var t,e,n,i;if(typeof navigator!="undefined"&&"connection"in navigator){const r=navigator.connection;return{downlink:(t=r==null?void 0:r.downlink)!=null?t:0,effectiveType:(e=r==null?void 0:r.effectiveType)!=null?e:"Unknown",rtt:(n=r==null?void 0:r.rtt)!=null?n:0,saveData:(i=r==null?void 0:r.saveData)!=null?i:!1}}return null}function Lb(){return typeof navigator!="undefined"?{hardwareConcurrency:navigator.hardwareConcurrency||null,deviceMemory:navigator.deviceMemory||null}:{hardwareConcurrency:null,deviceMemory:null}}function $b(){try{return tp(!0)}catch(t){return console.error("Error retrieving client timezone:",t),{offset:null,offsetValue:null,value:"Unknown",country:null,included:null,label:null}}}var ip=(t=>(t.VTEX="VTEX",t.VTEX_IO="VTEX-IO",t.VTEX_CMS="PORTAL-VTEX",t.PLATFORM="PLATFORM",t.UNKNOWN="UNKNOWN",t))(ip||{}),rp=(t=>(t.PLATFORM="platform_module",t.ADENDA="subscription_module",t.APP_STORE="app_store",t))(rp||{}),sp=(t=>(t.ACTIVE="active_contract",t.INACTIVE="inactive_contract",t))(sp||{}),ap=(t=>(t.LITE="lite",t.STANDARD="standard",t.PRO="pro",t))(ap||{}),op=(t=>(t.LITE="PLAN_LITE",t.STANDARD="PLAN_ESTANDAR",t.PRO="PLAN_PRO",t.NONE="NO_PLAN",t))(op||{}),up=(t=>(t.PAST="past",t.LIVE="live",t.FUTURE="future",t))(up||{});class Vl extends Cn{constructor(e){super("NIZZA_ACCOUNT_NOT_FOUND_ERROR",`Error finding account: ${e}`)}}class lp extends Cn{constructor(e){super("NIZZA_PLAN_NOT_FOUND_ERROR",`Error finding plan: ${e}`)}}class cp extends Cn{constructor(e){super("NIZZA_CREATE_PLAN_ERROR",`Error creating plan: ${e.plan}`,e)}}const Cd=`${rr.apiUrls.restV1}/plans`;class dp{async get(e){const i=`/info${Xh({planType:e})}`,r=Cd+i,{data:s}=await vi({url:r});return s}async create(e){const n=`${Cd}/create`,{success:i}=await vi({url:n,method:"POST",body:JSON.stringify(e)});if(!i)throw new cp(e)}}function Mb(t){const{host:e,account:n,username:i,createdAt:r,subscriptionType:s,installationDateApp:o,...l}=t;return{...l,account:n,host:e!=null?e:null,username:i!=null?i:n,createdAt:new Date(r),subscriptionType:s!=null?s:null,installationDateApp:new Date(o)}}function Bb(t){const{host:e,...n}=t;return{...n,host:e!=null?e:null,plan:{}}}const Ub=`${rr.apiUrls.restV1}/accounts/v2`;class fp{async get(e){const n=`${Ub}/${e}`,{data:i}=await vi({url:n});return i?Bb(i):null}}const jb=`${rr.apiUrls.restV1}/accounts/v2/pvt`;class Vb{async get(e,n){const i=`${jb}/${e}`,{data:r}=await vi({url:i,headers:{authorization:`Bearer ${n}`}});return r?Mb(r):null}}class hp{constructor(e,n,i){this.publicAccountRepo=e,this.privateAccountRepo=n,this.accountPlanRepo=i}async get(e,n){try{const i=n?await this.privateAccountRepo.get(e,n):await this.publicAccountRepo.get(e);if(!i)throw new Vl(e);const r=await this.accountPlanRepo.get(i.descriptionPlan);if(!r)throw new lp(i.descriptionPlan);return{...i,plan:r}}catch(i){throw new Fl(i)}}}const Hb=new fp,qb=new Vb,zb=new dp,pp=new hp(Hb,qb,zb),mp=()=>{const{account:t,accountName:e,accountStatus:n,refetchAccount:i,isPvtAccount:r,isPubAccount:s}=ep(h=>({account:h.account,accountName:h.accountName,accountStatus:h.accountStatus,refetchAccount:h.refetchAccount,isPvtAccount:h.isPvtAccount,isPubAccount:h.isPubAccount})),o=["idle","loading"].includes(n);return{account:t,accountName:e,isLoading:o,isError:n==="error",isSuccess:n==="success",accountStatus:n,refetchAccount:i,isPvtAccount:r,isPubAccount:s}};async function gp(t,e){return pp.get(t,e)}var vp=(t=>(t.Created="CREATED",t.CreateComplete="CREATE_COMPLETE",t.Finalized="FINALIZED",t.Live="LIVE",t.Starting="STARTING",t))(vp||{}),yp=(t=>(t.Add="add",t.Remove="remove",t))(yp||{}),bp=(t=>(t.Vtex="VTEX",t))(bp||{}),kp=(t=>(t.Active="active",t.Inactive="inactive",t))(kp||{});const Kb={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"}}]}}]}}]}}]},Gb={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"}}]}}]}}]}}]},Wb={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"}}]}}]}}]}}]},Jb={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"}}]}}]}}]}}]},Yb={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"}}]}}]}}]}}]},Xb={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"}}]}}]}}]}}]},Qb={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"}}]}}]}}]}}]},Zb={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"}}]}}]}}]}}]},ek={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"}}]}}]}}]}}]},tk={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"}}]}}]}}]}}]},nk={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"}}]}}]}}]}}]},ik={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"}}]}}]}}]}}]},rk={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"}}]}}]}}]}}]},_p={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"}}]}}]}}]}}]},sk={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"}}]}}]}}]}}]},ak={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"}}]}}]}}]}}]},ok={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"}}]}}]}}]}}]},uk={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"}}]}}]}}]}}]},lk={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"}}]}}]}}]}}]},ck={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"}}]}}]}}]}}]},dk={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"}}]}}]}}]}}]},fk={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"}}]}}]}}]}}]},hk={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"}}]}}]}}]}}]},pk={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"}}]}}]}}]}}]},mk={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"}}]}}]}}]}}]},gk={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"}}]}}]}}]}}]},vk={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"}}]}}]}}]}}]},yk={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"}}]}}]}}]}}]},bk={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"}}]}}]}}]}}]},kk={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"}}]}}]}}]}}]}}]},_k={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"}}]}}]}}]}}]},wk={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"}}]}}]}}]}}]},Sk={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"}}]}}]}}]}}]},Ek={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"}}]}}]}}]}}]},Nk=Object.freeze(Object.defineProperty({__proto__:null,AddCollectionDocument:Kb,AppendProductsToSnackVideoDocument:fk,BlockUserDocument:tk,ChangeAccountUsernameDocument:nk,CreatePlayListDocument:hk,CreateSnackVideoBatchDocument:pk,DeleteAllCustomizationDocument:ok,DeleteChatMessageDocument:ik,DeleteCollectionDocument:Gb,DeleteRelationshipWithSnackVideoDocument:mk,DeleteSnackVideoDocument:gk,EventStatus:vp,FindByProductSnackVideoDocument:Sk,FindCollectionDocument:Wb,FindManySnackVideosDocument:vk,FindMinimalEventDocument:Zb,GetAllChatMessageDocument:rk,GetAllCollectionsDocument:Jb,GetAllCustomizationDocument:uk,GetAllSnackVideosDocument:yk,GetChatRoomTokenDocument:_p,GetPlayListDocument:Ek,GetPlayListsDocument:bk,GetSnackVideoRelationshipsDocument:kk,GetTimeLineDocument:dk,HighlightProductDocument:ak,ManageCollectionProductDocument:Yb,Methods:yp,PinChatMessageDocument:sk,SearchCollectionsDocument:Xb,SearchMinimalEventsDocument:ek,SearchSnackVideosDocument:_k,SendAddToCartDocument:ck,SignProvider:bp,Status:kp,UpdateCollectionDocument:Qb,UpdateCustomizationDocument:lk,UpdatePlayListDocument:wk},Symbol.toStringTag,{value:"Module"}));var Za=(t=>(t.OPEN_TAB="openTab",t.OPEN_VARIATION_SELECTOR="openVariationSelector",t.ADD_TO_CART="addToCart",t))(Za||{});function Ak(t){return{class:t,_value:null,get value(){return this._value||(this._value=new t,Object.freeze(this)),this._value}}}var Rn=(t=>(t.Local="local",t.VtexLegacy="vtexlegacy",t.VtexIO="vtexio",t.VtexFastStore="faststore",t.Platform="platform",t.External="external",t))(Rn||{}),Hl=(t=>(t.PROD="prod",t.DEV="dev",t.LOCAL="local",t))(Hl||{});const{coreLogger:Ok}=xi(),dl=Ok.child("addToCartHooks"),fl={errorAddingToCart:"addToCartHooks.notification.error",errorOpeningVariationSelector:"addToCartHooks.notification.error",errorOpeningNewTab:"addToCartHooks.notification.error",successAddingToCart:"addToCartHooks.notification.success"};async function xk(t){const e={...t,action:{type:Za.ADD_TO_CART,exec:()=>dl.error("action no implemented in validate hook")}};try{const n=await Tk(e),i=await Ck(n);await Rk(i)}catch(n){dl.error("error unhandled",n)}}async function Tk(t){var s,o;const{context:e,userAddToCartConfig:n}=t,i=(s=n==null?void 0:n.hooks)==null?void 0:s.transform;let r=t.product;if(i)try{r=await i({product:{...r},data:(o=e.data)!=null?o:{}})}catch(l){Ea("transform",l)}return{...t,product:r}}async function Ck(t){var d,h;const{context:e,hookStrategy:n,userAddToCartConfig:i,product:r}=t,s=wp(t),o=(d=i==null?void 0:i.hooks)==null?void 0:d.validate;let l=n.validate({...t,actionFactory:s});if(o)try{l=await o({product:{...r},defaultAction:{...l},action:s,data:(h=e.data)!=null?h:{}})}catch(m){Ea("validate",m)}return{...t,action:l,actionFactory:s}}async function Rk(t){var E;const{eventBus:e}=xi(),{product:n,userAddToCartConfig:i,notifyFactory:r,action:s,actionFactory:o}=t,{isVariationSelectorOpen:l,data:d={}}=t.context,h=(E=i==null?void 0:i.hooks)==null?void 0:E.end,m=s.type===Za.ADD_TO_CART;let y=null,g=!1;const O=()=>{!m||!l||o.openVariationSelector(!1).exec()},_=()=>{!m||g||(y?r.error(fl.errorAddingToCart):r.success(fl.successAddingToCart))},S=()=>{const R={product:n,actionType:s.type,success:!y,error:y};e.emit(Hh.ATCH_ACTION_EXECUTED,R)};try{if(!s.type||!s.exec)throw new Error("Invalid action object, missing keys 'type' or 'exec'");await s.exec()}catch(R){Ea("end",R),y=R}if(h)try{g=!!await h({data:d,error:y,notify:r,actionExecuted:s})}catch(R){Ea("end",R)}O(),_(),S()}function wp(t){const{actionFactory:e,userAddToCartConfig:n}=t,i=r=>Object.entries(r!=null?r:{}).reduce((s,[o,l])=>({...s,[o]:d=>({type:o,exec:()=>l(d)})}),{});return{...i(e),...i(n==null?void 0:n.actionFactory)}}function Ea(t,e){dl.error(`addToCartHooks error running ${t}: `,e)}class Sp{constructor(e){me(this,"aggregate");me(this,"_numSetPropsApplied",0);this.aggregate=e}setProps(e){for(const[n,i]of Object.entries(e))n in this.aggregate&&(this.aggregate[n]=i);this._numSetPropsApplied++}get isFirstSetProps(){return this._numSetPropsApplied===1}}function Ep(t){return new Sp(t)}class Fk{constructor(e){me(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 Np(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ik}=Object.prototype,{getPrototypeOf:ql}=Object,eo=(t=>e=>{const n=Ik.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),on=t=>(t=t.toLowerCase(),e=>eo(e)===t),to=t=>e=>typeof e===t,{isArray:dr}=Array,is=to("undefined");function Dk(t){return t!==null&&!is(t)&&t.constructor!==null&&!is(t.constructor)&&Vt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ap=on("ArrayBuffer");function Pk(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ap(t.buffer),e}const Lk=to("string"),Vt=to("function"),Op=to("number"),no=t=>t!==null&&typeof t=="object",$k=t=>t===!0||t===!1,ra=t=>{if(eo(t)!=="object")return!1;const e=ql(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Mk=on("Date"),Bk=on("File"),Uk=on("Blob"),jk=on("FileList"),Vk=t=>no(t)&&Vt(t.pipe),Hk=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Vt(t.append)&&((e=eo(t))==="formdata"||e==="object"&&Vt(t.toString)&&t.toString()==="[object FormData]"))},qk=on("URLSearchParams"),[zk,Kk,Gk,Wk]=["ReadableStream","Request","Response","Headers"].map(on),Jk=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function hs(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,r;if(typeof t!="object"&&(t=[t]),dr(t))for(i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length;let l;for(i=0;i<o;i++)l=s[i],e.call(null,t[l],l,t)}}function xp(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,r;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const fi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Tp=t=>!is(t)&&t!==fi;function hl(){const{caseless:t}=Tp(this)&&this||{},e={},n=(i,r)=>{const s=t&&xp(e,r)||r;ra(e[s])&&ra(i)?e[s]=hl(e[s],i):ra(i)?e[s]=hl({},i):dr(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&hs(arguments[i],n);return e}const Yk=(t,e,n,{allOwnKeys:i}={})=>(hs(e,(r,s)=>{n&&Vt(r)?t[s]=Np(r,n):t[s]=r},{allOwnKeys:i}),t),Xk=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Qk=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Zk=(t,e,n,i)=>{let r,s,o;const l={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),s=r.length;s-- >0;)o=r[s],(!i||i(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=n!==!1&&ql(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},e_=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},t_=t=>{if(!t)return null;if(dr(t))return t;let e=t.length;if(!Op(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},n_=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&ql(Uint8Array)),i_=(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(t,s[0],s[1])}},r_=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},s_=on("HTMLFormElement"),a_=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),Rd=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),o_=on("RegExp"),Cp=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};hs(n,(r,s)=>{let o;(o=e(r,s,t))!==!1&&(i[s]=o||r)}),Object.defineProperties(t,i)},u_=t=>{Cp(t,(e,n)=>{if(Vt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Vt(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},l_=(t,e)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return dr(t)?i(t):i(String(t).split(e)),n},c_=()=>{},d_=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Ou="abcdefghijklmnopqrstuvwxyz",Fd="0123456789",Rp={DIGIT:Fd,ALPHA:Ou,ALPHA_DIGIT:Ou+Ou.toUpperCase()+Fd},f_=(t=16,e=Rp.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function h_(t){return!!(t&&Vt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const p_=t=>{const e=new Array(10),n=(i,r)=>{if(no(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=dr(i)?[]:{};return hs(i,(o,l)=>{const d=n(o,r+1);!is(d)&&(s[l]=d)}),e[r]=void 0,s}}return i};return n(t,0)},m_=on("AsyncFunction"),g_=t=>t&&(no(t)||Vt(t))&&Vt(t.then)&&Vt(t.catch),Fp=((t,e)=>t?setImmediate:e?((n,i)=>(fi.addEventListener("message",({source:r,data:s})=>{r===fi&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),fi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Vt(fi.postMessage)),v_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(fi):typeof process!="undefined"&&process.nextTick||Fp,q={isArray:dr,isArrayBuffer:Ap,isBuffer:Dk,isFormData:Hk,isArrayBufferView:Pk,isString:Lk,isNumber:Op,isBoolean:$k,isObject:no,isPlainObject:ra,isReadableStream:zk,isRequest:Kk,isResponse:Gk,isHeaders:Wk,isUndefined:is,isDate:Mk,isFile:Bk,isBlob:Uk,isRegExp:o_,isFunction:Vt,isStream:Vk,isURLSearchParams:qk,isTypedArray:n_,isFileList:jk,forEach:hs,merge:hl,extend:Yk,trim:Jk,stripBOM:Xk,inherits:Qk,toFlatObject:Zk,kindOf:eo,kindOfTest:on,endsWith:e_,toArray:t_,forEachEntry:i_,matchAll:r_,isHTMLForm:s_,hasOwnProperty:Rd,hasOwnProp:Rd,reduceDescriptors:Cp,freezeMethods:u_,toObjectSet:l_,toCamelCase:a_,noop:c_,toFiniteNumber:d_,findKey:xp,global:fi,isContextDefined:Tp,ALPHABET:Rp,generateString:f_,isSpecCompliantForm:h_,toJSONObject:p_,isAsyncFn:m_,isThenable:g_,setImmediate:Fp,asap:v_};function Le(t,e,n,i,r){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),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}q.inherits(Le,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:q.toJSONObject(this.config),code:this.code,status:this.status}}});const Ip=Le.prototype,Dp={};["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=>{Dp[t]={value:t}});Object.defineProperties(Le,Dp);Object.defineProperty(Ip,"isAxiosError",{value:!0});Le.from=(t,e,n,i,r,s)=>{const o=Object.create(Ip);return q.toFlatObject(t,o,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),Le.call(o,t.message,e,n,i,r),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const y_=null;function pl(t){return q.isPlainObject(t)||q.isArray(t)}function Pp(t){return q.endsWith(t,"[]")?t.slice(0,-2):t}function Id(t,e,n){return t?t.concat(e).map(function(r,s){return r=Pp(r),!n&&s?"["+r+"]":r}).join(n?".":""):e}function b_(t){return q.isArray(t)&&!t.some(pl)}const k_=q.toFlatObject(q,{},null,function(e){return/^is[A-Z]/.test(e)});function io(t,e,n){if(!q.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,E){return!q.isUndefined(E[S])});const i=n.metaTokens,r=n.visitor||m,s=n.dots,o=n.indexes,d=(n.Blob||typeof Blob!="undefined"&&Blob)&&q.isSpecCompliantForm(e);if(!q.isFunction(r))throw new TypeError("visitor must be a function");function h(_){if(_===null)return"";if(q.isDate(_))return _.toISOString();if(!d&&q.isBlob(_))throw new Le("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(_)||q.isTypedArray(_)?d&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function m(_,S,E){let R=_;if(_&&!E&&typeof _=="object"){if(q.endsWith(S,"{}"))S=i?S:S.slice(0,-2),_=JSON.stringify(_);else if(q.isArray(_)&&b_(_)||(q.isFileList(_)||q.endsWith(S,"[]"))&&(R=q.toArray(_)))return S=Pp(S),R.forEach(function(J,z){!(q.isUndefined(J)||J===null)&&e.append(o===!0?Id([S],z,s):o===null?S:S+"[]",h(J))}),!1}return pl(_)?!0:(e.append(Id(E,S,s),h(_)),!1)}const y=[],g=Object.assign(k_,{defaultVisitor:m,convertValue:h,isVisitable:pl});function O(_,S){if(!q.isUndefined(_)){if(y.indexOf(_)!==-1)throw Error("Circular reference detected in "+S.join("."));y.push(_),q.forEach(_,function(R,j){(!(q.isUndefined(R)||R===null)&&r.call(e,R,q.isString(j)?j.trim():j,S,g))===!0&&O(R,S?S.concat(j):[j])}),y.pop()}}if(!q.isObject(t))throw new TypeError("data must be an object");return O(t),e}function Dd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function zl(t,e){this._pairs=[],t&&io(t,this,e)}const Lp=zl.prototype;Lp.append=function(e,n){this._pairs.push([e,n])};Lp.toString=function(e){const n=e?function(i){return e.call(this,i,Dd)}:Dd;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function __(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $p(t,e,n){if(!e)return t;const i=n&&n.encode||__,r=n&&n.serialize;let s;if(r?s=r(e,n):s=q.isURLSearchParams(e)?e.toString():new zl(e,n).toString(i),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Pd{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){q.forEach(this.handlers,function(i){i!==null&&e(i)})}}const Mp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w_=typeof URLSearchParams!="undefined"?URLSearchParams:zl,S_=typeof FormData!="undefined"?FormData:null,E_=typeof Blob!="undefined"?Blob:null,N_={isBrowser:!0,classes:{URLSearchParams:w_,FormData:S_,Blob:E_},protocols:["http","https","file","blob","url","data"]},Kl=typeof window!="undefined"&&typeof document!="undefined",ml=typeof navigator=="object"&&navigator||void 0,A_=Kl&&(!ml||["ReactNative","NativeScript","NS"].indexOf(ml.product)<0),O_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",x_=Kl&&window.location.href||"http://localhost",T_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Kl,hasStandardBrowserEnv:A_,hasStandardBrowserWebWorkerEnv:O_,navigator:ml,origin:x_},Symbol.toStringTag,{value:"Module"})),Pt={...T_,...N_};function C_(t,e){return io(t,new Pt.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return Pt.isNode&&q.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function R_(t){return q.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function F_(t){const e={},n=Object.keys(t);let i;const r=n.length;let s;for(i=0;i<r;i++)s=n[i],e[s]=t[s];return e}function Bp(t){function e(n,i,r,s){let o=n[s++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),d=s>=n.length;return o=!o&&q.isArray(r)?r.length:o,d?(q.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!l):((!r[o]||!q.isObject(r[o]))&&(r[o]=[]),e(n,i,r[o],s)&&q.isArray(r[o])&&(r[o]=F_(r[o])),!l)}if(q.isFormData(t)&&q.isFunction(t.entries)){const n={};return q.forEachEntry(t,(i,r)=>{e(R_(i),r,n,0)}),n}return null}function I_(t,e,n){if(q.isString(t))try{return(e||JSON.parse)(t),q.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const ps={transitional:Mp,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=q.isObject(e);if(s&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return r?JSON.stringify(Bp(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)||q.isReadableStream(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return C_(e,this.formSerializer).toString();if((l=q.isFileList(e))||i.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return io(l?{"files[]":e}:e,d&&new d,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),I_(e)):e}],transformResponse:[function(e){const n=this.transitional||ps.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(q.isResponse(e)||q.isReadableStream(e))return e;if(e&&q.isString(e)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?Le.from(l,Le.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],t=>{ps.headers[t]={}});const D_=q.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"]),P_=t=>{const e={};let n,i,r;return t&&t.split(`
|
|
32
|
-
`).forEach(function(o){
|
|
33
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Ld]=this[Ld]={accessors:{}}).accessors,r=this.prototype;function s(o){const l=Dr(o);i[l]||(B_(r,o),i[l]=!0)}return q.isArray(e)?e.forEach(s):s(e),this}};Lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.reduceDescriptors(Lt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});q.freezeMethods(Lt);function Tu(t,e){const n=this||ps,i=e||n,r=Lt.from(i.headers);let s=i.data;return q.forEach(t,function(l){s=l.call(n,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Up(t){return!!(t&&t.__CANCEL__)}function fr(t,e,n){Le.call(this,t==null?"canceled":t,Le.ERR_CANCELED,e,n),this.name="CanceledError"}q.inherits(fr,Le,{__CANCEL__:!0});function jp(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new Le("Request failed with status code "+n.status,[Le.ERR_BAD_REQUEST,Le.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function U_(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function j_(t,e){t=t||10;const n=new Array(t),i=new Array(t);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),m=i[s];o||(o=h),n[r]=d,i[r]=h;let y=s,g=0;for(;y!==r;)g+=n[y++],y=y%t;if(r=(r+1)%t,r===s&&(s=(s+1)%t),h-o<e)return;const O=m&&h-m;return O?Math.round(g*1e3/O):void 0}}function V_(t,e){let n=0,i=1e3/e,r,s;const o=(h,m=Date.now())=>{n=m,r=null,s&&(clearTimeout(s),s=null),t.apply(null,h)};return[(...h)=>{const m=Date.now(),y=m-n;y>=i?o(h,m):(r=h,s||(s=setTimeout(()=>{s=null,o(r)},i-y)))},()=>r&&o(r)]}const Na=(t,e,n=3)=>{let i=0;const r=j_(50,250);return V_(s=>{const o=s.loaded,l=s.lengthComputable?s.total:void 0,d=o-i,h=r(d),m=o<=l;i=o;const y={loaded:o,total:l,progress:l?o/l:void 0,bytes:d,rate:h||void 0,estimated:h&&l&&m?(l-o)/h:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(y)},n)},$d=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Md=t=>(...e)=>q.asap(()=>t(...e)),H_=Pt.hasStandardBrowserEnv?function(){const e=Pt.navigator&&/(msie|trident)/i.test(Pt.navigator.userAgent),n=document.createElement("a");let i;function r(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 i=r(window.location.href),function(o){const l=q.isString(o)?r(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}(),q_=Pt.hasStandardBrowserEnv?{write(t,e,n,i,r,s){const o=[t+"="+encodeURIComponent(e)];q.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),q.isString(i)&&o.push("path="+i),q.isString(r)&&o.push("domain="+r),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 z_(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function K_(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vp(t,e){return t&&!z_(e)?K_(t,e):e}const Bd=t=>t instanceof Lt?{...t}:t;function ki(t,e){e=e||{};const n={};function i(h,m,y){return q.isPlainObject(h)&&q.isPlainObject(m)?q.merge.call({caseless:y},h,m):q.isPlainObject(m)?q.merge({},m):q.isArray(m)?m.slice():m}function r(h,m,y){if(q.isUndefined(m)){if(!q.isUndefined(h))return i(void 0,h,y)}else return i(h,m,y)}function s(h,m){if(!q.isUndefined(m))return i(void 0,m)}function o(h,m){if(q.isUndefined(m)){if(!q.isUndefined(h))return i(void 0,h)}else return i(void 0,m)}function l(h,m,y){if(y in e)return i(h,m);if(y in t)return i(void 0,h)}const d={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:l,headers:(h,m)=>r(Bd(h),Bd(m),!0)};return q.forEach(Object.keys(Object.assign({},t,e)),function(m){const y=d[m]||r,g=y(t[m],e[m],m);q.isUndefined(g)&&y!==l||(n[m]=g)}),n}const Hp=t=>{const e=ki({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:l}=e;e.headers=o=Lt.from(o),e.url=$p(Vp(e.baseURL,e.url),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let d;if(q.isFormData(n)){if(Pt.hasStandardBrowserEnv||Pt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((d=o.getContentType())!==!1){const[h,...m]=d?d.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...m].join("; "))}}if(Pt.hasStandardBrowserEnv&&(i&&q.isFunction(i)&&(i=i(e)),i||i!==!1&&H_(e.url))){const h=r&&s&&q_.read(s);h&&o.set(r,h)}return e},G_=typeof XMLHttpRequest!="undefined",W_=G_&&function(t){return new Promise(function(n,i){const r=Hp(t);let s=r.data;const o=Lt.from(r.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:h}=r,m,y,g,O,_;function S(){O&&O(),_&&_(),r.cancelToken&&r.cancelToken.unsubscribe(m),r.signal&&r.signal.removeEventListener("abort",m)}let E=new XMLHttpRequest;E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout;function R(){if(!E)return;const J=Lt.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),X={data:!l||l==="text"||l==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:J,config:t,request:E};jp(function(oe){n(oe),S()},function(oe){i(oe),S()},X),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(i(new Le("Request aborted",Le.ECONNABORTED,t,E)),E=null)},E.onerror=function(){i(new Le("Network Error",Le.ERR_NETWORK,t,E)),E=null},E.ontimeout=function(){let z=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const X=r.transitional||Mp;r.timeoutErrorMessage&&(z=r.timeoutErrorMessage),i(new Le(z,X.clarifyTimeoutError?Le.ETIMEDOUT:Le.ECONNABORTED,t,E)),E=null},s===void 0&&o.setContentType(null),"setRequestHeader"in E&&q.forEach(o.toJSON(),function(z,X){E.setRequestHeader(X,z)}),q.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),l&&l!=="json"&&(E.responseType=r.responseType),h&&([g,_]=Na(h,!0),E.addEventListener("progress",g)),d&&E.upload&&([y,O]=Na(d),E.upload.addEventListener("progress",y),E.upload.addEventListener("loadend",O)),(r.cancelToken||r.signal)&&(m=J=>{E&&(i(!J||J.type?new fr(null,t,E):J),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(m),r.signal&&(r.signal.aborted?m():r.signal.addEventListener("abort",m)));const j=U_(r.url);if(j&&Pt.protocols.indexOf(j)===-1){i(new Le("Unsupported protocol "+j+":",Le.ERR_BAD_REQUEST,t));return}E.send(s||null)})},J_=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,r;const s=function(h){if(!r){r=!0,l();const m=h instanceof Error?h:this.reason;i.abort(m instanceof Le?m:new fr(m instanceof Error?m.message:m))}};let o=e&&setTimeout(()=>{o=null,s(new Le(`timeout ${e} of ms exceeded`,Le.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),t=null)};t.forEach(h=>h.addEventListener("abort",s));const{signal:d}=i;return d.unsubscribe=()=>q.asap(l),d}},Y_=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,r;for(;i<n;)r=i+e,yield t.slice(i,r),i=r},X_=async function*(t,e){for await(const n of Q_(t))yield*Y_(n,e)},Q_=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Ud=(t,e,n,i)=>{const r=X_(t,e);let s=0,o,l=d=>{o||(o=!0,i&&i(d))};return new ReadableStream({async pull(d){try{const{done:h,value:m}=await r.next();if(h){l(),d.close();return}let y=m.byteLength;if(n){let g=s+=y;n(g)}d.enqueue(new Uint8Array(m))}catch(h){throw l(h),h}},cancel(d){return l(d),r.return()}},{highWaterMark:2})},ro=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",qp=ro&&typeof ReadableStream=="function",Z_=ro&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),zp=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ew=qp&&zp(()=>{let t=!1;const e=new Request(Pt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),jd=64*1024,gl=qp&&zp(()=>q.isReadableStream(new Response("").body)),Aa={stream:gl&&(t=>t.body)};ro&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Aa[e]&&(Aa[e]=q.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new Le(`Response type '${e}' is not supported`,Le.ERR_NOT_SUPPORT,i)})})})(new Response);const tw=async t=>{if(t==null)return 0;if(q.isBlob(t))return t.size;if(q.isSpecCompliantForm(t))return(await new Request(Pt.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(q.isArrayBufferView(t)||q.isArrayBuffer(t))return t.byteLength;if(q.isURLSearchParams(t)&&(t=t+""),q.isString(t))return(await Z_(t)).byteLength},nw=async(t,e)=>{const n=q.toFiniteNumber(t.getContentLength());return n==null?tw(e):n},iw=ro&&(async t=>{let{url:e,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:l,onUploadProgress:d,responseType:h,headers:m,withCredentials:y="same-origin",fetchOptions:g}=Hp(t);h=h?(h+"").toLowerCase():"text";let O=J_([r,s&&s.toAbortSignal()],o),_;const S=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let E;try{if(d&&ew&&n!=="get"&&n!=="head"&&(E=await nw(m,i))!==0){let X=new Request(e,{method:"POST",body:i,duplex:"half"}),ne;if(q.isFormData(i)&&(ne=X.headers.get("content-type"))&&m.setContentType(ne),X.body){const[oe,Se]=$d(E,Na(Md(d)));i=Ud(X.body,jd,oe,Se)}}q.isString(y)||(y=y?"include":"omit");const R="credentials"in Request.prototype;_=new Request(e,{...g,signal:O,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:i,duplex:"half",credentials:R?y:void 0});let j=await fetch(_);const J=gl&&(h==="stream"||h==="response");if(gl&&(l||J&&S)){const X={};["status","statusText","headers"].forEach(ve=>{X[ve]=j[ve]});const ne=q.toFiniteNumber(j.headers.get("content-length")),[oe,Se]=l&&$d(ne,Na(Md(l),!0))||[];j=new Response(Ud(j.body,jd,oe,()=>{Se&&Se(),S&&S()}),X)}h=h||"text";let z=await Aa[q.findKey(Aa,h)||"text"](j,t);return!J&&S&&S(),await new Promise((X,ne)=>{jp(X,ne,{data:z,headers:Lt.from(j.headers),status:j.status,statusText:j.statusText,config:t,request:_})})}catch(R){throw S&&S(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new Le("Network Error",Le.ERR_NETWORK,t,_),{cause:R.cause||R}):Le.from(R,R&&R.code,t,_)}}),vl={http:y_,xhr:W_,fetch:iw};q.forEach(vl,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Vd=t=>`- ${t}`,rw=t=>q.isFunction(t)||t===null||t===!1,Kp={getAdapter:t=>{t=q.isArray(t)?t:[t];const{length:e}=t;let n,i;const r={};for(let s=0;s<e;s++){n=t[s];let o;if(i=n,!rw(n)&&(i=vl[(o=String(n)).toLowerCase()],i===void 0))throw new Le(`Unknown adapter '${o}'`);if(i)break;r[o||"#"+s]=i}if(!i){const s=Object.entries(r).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
|
|
34
|
-
`+s.map(
|
|
35
|
-
`):" "+
|
|
36
|
-
`+s):i.stack=s}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ki(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&yl.assertOptions(i,{silentJSONParsing:Un.transitional(Un.boolean),forcedJSONParsing:Un.transitional(Un.boolean),clarifyTimeoutError:Un.transitional(Un.boolean)},!1),r!=null&&(q.isFunction(r)?n.paramsSerializer={serialize:r}:yl.assertOptions(r,{encode:Un.function,serialize:Un.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&q.merge(s.common,s[n.method]);s&&q.forEach(["delete","get","head","post","put","patch","common"],_=>{delete s[_]}),n.headers=Lt.concat(o,s);const l=[];let d=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(d=d&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let m,y=0,g;if(!d){const _=[Hd.bind(this),void 0];for(_.unshift.apply(_,l),_.push.apply(_,h),g=_.length,m=Promise.resolve(n);y<g;)m=m.then(_[y++],_[y++]);return m}g=l.length;let O=n;for(y=0;y<g;){const _=l[y++],S=l[y++];try{O=_(O)}catch(E){S.call(this,E);break}}try{m=Hd.call(this,O)}catch(_){return Promise.reject(_)}for(y=0,g=h.length;y<g;)m=m.then(h[y++],h[y++]);return m}getUri(e){e=ki(this.defaults,e);const n=Vp(e.baseURL,e.url);return $p(n,e.params,e.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(e){gi.prototype[e]=function(n,i){return this.request(ki(i||{},{method:e,url:n,data:(i||{}).data}))}});q.forEach(["post","put","patch"],function(e){function n(i){return function(s,o,l){return this.request(ki(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}gi.prototype[e]=n(),gi.prototype[e+"Form"]=n(!0)});let aw=class Wp{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 i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(l=>{i.subscribe(l),s=l}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,l){i.reason||(i.reason=new fr(s,o,l),n(i.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=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Wp(function(r){e=r}),cancel:e}}};function ow(t){return function(n){return t.apply(null,n)}}function uw(t){return q.isObject(t)&&t.isAxiosError===!0}const bl={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(bl).forEach(([t,e])=>{bl[e]=t});function Jp(t){const e=new gi(t),n=Np(gi.prototype.request,e);return q.extend(n,gi.prototype,e,{allOwnKeys:!0}),q.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return Jp(ki(t,r))},n}const at=Jp(ps);at.Axios=gi;at.CanceledError=fr;at.CancelToken=aw;at.isCancel=Up;at.VERSION=Gp;at.toFormData=io;at.AxiosError=Le;at.Cancel=at.CanceledError;at.all=function(e){return Promise.all(e)};at.spread=ow;at.isAxiosError=uw;at.mergeConfig=ki;at.AxiosHeaders=Lt;at.formToJSON=t=>Bp(q.isHTMLForm(t)?new FormData(t):t);at.getAdapter=Kp.getAdapter;at.HttpStatusCode=bl;at.default=at;const{Axios:xN,AxiosError:TN,CanceledError:CN,isCancel:RN,CancelToken:FN,VERSION:IN,all:DN,Cancel:PN,isAxiosError:LN,spread:$N,toFormData:MN,AxiosHeaders:BN,HttpStatusCode:UN,formToJSON:jN,getAdapter:VN,mergeConfig:HN}=at,lw={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 Oa{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||lw,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,i,r){return r&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Oa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Oa(this.logger,e)}}var hn=new Oa;class so{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+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,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[l,d]=o;for(let h=0;h<d;h++)l(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,d]=o;for(let h=0;h<d;h++)l.apply(l,[e,...i])})}}const Pr=()=>{let t,e;const n=new Promise((i,r)=>{t=i,e=r});return n.resolve=t,n.reject=e,n},zd=t=>t==null?"":""+t,cw=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},dw=/###/g,Kd=t=>t&&t.indexOf("###")>-1?t.replace(dw,"."):t,Gd=t=>!t||typeof t=="string",Kr=(t,e,n)=>{const i=typeof e!="string"?e:e.split(".");let r=0;for(;r<i.length-1;){if(Gd(t))return{};const s=Kd(i[r]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++r}return Gd(t)?{}:{obj:t,k:Kd(i[r])}},Wd=(t,e,n)=>{const{obj:i,k:r}=Kr(t,e,Object);if(i!==void 0||e.length===1){i[r]=n;return}let s=e[e.length-1],o=e.slice(0,e.length-1),l=Kr(t,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=Kr(t,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${s}`]!="undefined"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},fw=(t,e,n,i)=>{const{obj:r,k:s}=Kr(t,e,Object);r[s]=r[s]||[],r[s].push(n)},xa=(t,e)=>{const{obj:n,k:i}=Kr(t,e);if(n)return n[i]},hw=(t,e,n)=>{const i=xa(t,n);return i!==void 0?i:xa(e,n)},Yp=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?typeof t[i]=="string"||t[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?n&&(t[i]=e[i]):Yp(t[i],e[i],n):t[i]=e[i]);return t},Ui=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var pw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const mw=t=>typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>pw[e]):t;class gw{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 i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const vw=[" ",",","?","!",";"],yw=new gw(20),bw=(t,e,n)=>{e=e||"",n=n||"";const i=vw.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(i.length===0)return!0;const r=yw.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(t);if(!s){const o=t.indexOf(n);o>0&&!r.test(t.substring(0,o))&&(s=!0)}return s},kl=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const i=e.split(n);let r=t;for(let s=0;s<i.length;){if(!r||typeof r!="object")return;let o,l="";for(let d=s;d<i.length;++d)if(d!==s&&(l+=n),l+=i[d],o=r[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&d<i.length-1)continue;s+=d-s+1;break}r=o}return r},Ta=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class Jd extends so{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,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,n],i&&(Array.isArray(i)?l.push(...i):typeof i=="string"&&s?l.push(...i.split(s)):l.push(i)));const d=xa(this.data,l);return!d&&!n&&!i&&e.indexOf(".")>-1&&(e=l[0],n=l[1],i=l.slice(2).join(".")),d||!o||typeof i!="string"?d:kl(this.data&&this.data[e]&&this.data[e][n],i,s)}addResource(e,n,i,r){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 l=[e,n];i&&(l=l.concat(o?i.split(o):i)),e.indexOf(".")>-1&&(l=e.split("."),r=n,n=l[1]),this.addNamespaces(n),Wd(this.data,l,r),s.silent||this.emit("added",e,n,i,r)}addResources(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in i)(typeof i[s]=="string"||Array.isArray(i[s]))&&this.addResource(e,n,s,i[s],{silent:!0});r.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,r,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,n];e.indexOf(".")>-1&&(l=e.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let d=xa(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Yp(d,i,s):d={...d,...i},Wd(this.data,l,d),o.silent||this.emit("added",e,n,i)}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(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Xp={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,r){return t.forEach(s=>{this.processors[s]&&(e=this.processors[s].process(e,n,i,r))}),e}};const Yd={};class Ca extends so{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),cw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hn.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 i=this.resolve(e,n);return i&&i.res!==void 0}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&e.indexOf(i)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bw(e,i,r);if(o&&!l){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:s};const h=e.split(i);(i!==r||i===r&&this.options.ns.indexOf(h[0])>-1)&&(s=h.shift()),e=h.join(r)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}translate(e,n,i){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 r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),d=l[l.length-1],h=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(m){const z=n.nsSeparator||this.options.nsSeparator;return r?{res:`${d}${z}${o}`,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:`${d}${z}${o}`}return r?{res:o,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:o}const y=this.resolve(e,n);let g=y&&y.res;const O=y&&y.usedKey||o,_=y&&y.exactUsedKey||o,S=Object.prototype.toString.apply(g),E=["[object Number]","[object Function]","[object RegExp]"],R=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&E.indexOf(S)<0&&!(typeof R=="string"&&Array.isArray(g))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const z=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,g,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(y.res=z,y.usedParams=this.getUsedParamsDetails(n),y):z}if(s){const z=Array.isArray(g),X=z?[]:{},ne=z?_:O;for(const oe in g)if(Object.prototype.hasOwnProperty.call(g,oe)){const Se=`${ne}${s}${oe}`;X[oe]=this.translate(Se,{...n,joinArrays:!1,ns:l}),X[oe]===Se&&(X[oe]=g[oe])}g=X}}else if(j&&typeof R=="string"&&Array.isArray(g))g=g.join(R),g&&(g=this.extendTranslation(g,e,n,i));else{let z=!1,X=!1;const ne=n.count!==void 0&&typeof n.count!="string",oe=Ca.hasDefaultValue(n),Se=ne?this.pluralResolver.getSuffix(h,n.count,n):"",ve=n.ordinal&&ne?this.pluralResolver.getSuffix(h,n.count,{ordinal:!1}):"",ze=ne&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),Ne=ze&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${Se}`]||n[`defaultValue${ve}`]||n.defaultValue;!this.isValidLookup(g)&&oe&&(z=!0,g=Ne),this.isValidLookup(g)||(X=!0,g=o);const Ve=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&X?void 0:g,M=oe&&Ne!==g&&this.options.updateMissing;if(X||z||M){if(this.logger.log(M?"updateKey":"missingKey",h,d,o,M?Ne:g),s){const ce=this.resolve(o,{...n,keySeparator:!1});ce&&ce.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 N=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let ce=0;ce<K.length;ce++)N.push(K[ce]);else this.options.saveMissingTo==="all"?N=this.languageUtils.toResolveHierarchy(n.lng||this.language):N.push(n.lng||this.language);const ie=(ce,ae,B)=>{const Fe=oe&&B!==g?B:Ve;this.options.missingKeyHandler?this.options.missingKeyHandler(ce,d,ae,Fe,M,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ce,d,ae,Fe,M,n),this.emit("missingKey",ce,d,ae,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&ne?N.forEach(ce=>{const ae=this.pluralResolver.getSuffixes(ce,n);ze&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ae.indexOf(`${this.options.pluralSeparator}zero`)<0&&ae.push(`${this.options.pluralSeparator}zero`),ae.forEach(B=>{ie([ce],o+B,n[`defaultValue${B}`]||Ne)})}):ie(N,o,Ne))}g=this.extendTranslation(g,e,n,y,i),X&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${d}:${o}`),(X||z)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}:${o}`:o,z?g:void 0):g=this.options.parseMissingKeyHandler(g))}return r?(y.res=g,y.usedParams=this.getUsedParamsDetails(n),y):g}extendTranslation(e,n,i,r,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const h=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(h){const g=e.match(this.interpolator.nestingRegexp);m=g&&g.length}let y=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,i.lng||this.language||r.usedLng,i),h){const g=e.match(this.interpolator.nestingRegexp),O=g&&g.length;m<O&&(i.nest=!1)}!i.lng&&this.options.compatibilityAPI!=="v1"&&r&&r.res&&(i.lng=this.language||r.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,O=new Array(g),_=0;_<g;_++)O[_]=arguments[_];return s&&s[0]===O[0]&&!i.context?(o.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${n[0]}`),null):o.translate(...O,n)},i)),i.interpolation&&this.interpolator.reset()}const l=i.postProcess||this.options.postProcess,d=typeof l=="string"?[l]:l;return e!=null&&d&&d.length&&i.applyPostProcessor!==!1&&(e=Xp.handle(d,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r,s,o,l;return typeof e=="string"&&(e=[e]),e.forEach(d=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(d,n),m=h.key;r=m;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const g=n.count!==void 0&&typeof n.count!="string",O=g&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(E=>{this.isValidLookup(i)||(l=E,!Yd[`${S[0]}-${E}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Yd[`${S[0]}-${E}`]=!0,this.logger.warn(`key "${r}" for languages "${S.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),S.forEach(R=>{if(this.isValidLookup(i))return;o=R;const j=[m];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,m,R,E,n);else{let z;g&&(z=this.pluralResolver.getSuffix(R,n.count,n));const X=`${this.options.pluralSeparator}zero`,ne=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(j.push(m+z),n.ordinal&&z.indexOf(ne)===0&&j.push(m+z.replace(ne,this.options.pluralSeparator)),O&&j.push(m+X)),_){const oe=`${m}${this.options.contextSeparator}${n.context}`;j.push(oe),g&&(j.push(oe+z),n.ordinal&&z.indexOf(ne)===0&&j.push(oe+z.replace(ne,this.options.pluralSeparator)),O&&j.push(oe+X))}}let J;for(;J=j.pop();)this.isValidLookup(i)||(s=J,i=this.getResource(R,E,J,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,i,r):this.resourceStore.getResource(e,n,i,r)}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"],i=e.replace&&typeof e.replace!="string";let r=i?e.replace:e;if(i&&typeof e.count!="undefined"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}}const Ru=t=>t.charAt(0).toUpperCase()+t.slice(1);class Xd{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hn.create("languageUtils")}getScriptPartFromCode(e){if(e=Ta(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=Ta(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 i=e.split("-");return this.options.lowerCaseLng?i=i.map(r=>r.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ru(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ru(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=Ru(i[2].toLowerCase()))),i.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(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const r=this.getLanguagePartFromCode(i);if(this.isSupportedCode(r))return n=r;n=this.options.supportedLngs.find(s=>{if(s===r)return s;if(!(s.indexOf("-")<0&&r.indexOf("-")<0)&&(s.indexOf("-")>0&&r.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===r||s.indexOf(r)===0&&r.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 i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.getFallbackCodes(n||this.options.fallbackLng||[],e),r=[],s=o=>{o&&(this.isSupportedCode(o)?r.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)),i.forEach(o=>{r.indexOf(o)<0&&s(this.formatLanguageCode(o))}),r}}let kw=[{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}],_w={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 ww=["v1","v2","v3"],Sw=["v4"],Qd={zero:0,one:1,two:2,few:3,many:4,other:5},Ew=()=>{const t={};return kw.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:_w[e.fc]}})}),t};class Nw{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=hn.create("pluralResolver"),(!this.options.compatibilityJSON||Sw.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=Ew(),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 i=Ta(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];const o=new Intl.PluralRules(i,{type:r});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 i=this.getRule(e,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(r=>`${n}${r}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((r,s)=>Qd[r]-Qd[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):i.numbers.map(r=>this.getSuffix(e,r,n)):[]}getSuffix(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=this.getRule(e,i);return r?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:this.getSuffixRetroCompatible(r,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const i=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let r=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r="plural":r===1&&(r=""));const s=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON==="v1"?r===1?"":typeof r=="number"?`_plural_${r.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!ww.includes(this.options.compatibilityJSON)}}const Zd=function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=hw(t,e,n);return!s&&r&&typeof n=="string"&&(s=kl(t,n,i),s===void 0&&(s=kl(e,n,i))),s},Fu=t=>t.replace(/\$/g,"$$$$");class Aw{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hn.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:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:d,formatSeparator:h,unescapeSuffix:m,unescapePrefix:y,nestingPrefix:g,nestingPrefixEscaped:O,nestingSuffix:_,nestingSuffixEscaped:S,nestingOptionsSeparator:E,maxReplaces:R,alwaysFormat:j}=e.interpolation;this.escape=n!==void 0?n:mw,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Ui(s):o||"{{",this.suffix=l?Ui(l):d||"}}",this.formatSeparator=h||",",this.unescapePrefix=m?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=g?Ui(g):O||Ui("$t("),this.nestingSuffix=_?Ui(_):S||Ui(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=R||1e3,this.alwaysFormat=j!==void 0?j:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n&&n.source===i?(n.lastIndex=0,n):new RegExp(i,"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,i,r){let s,o,l;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=O=>{if(O.indexOf(this.formatSeparator)<0){const R=Zd(n,d,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,i,{...r,...n,interpolationkey:O}):R}const _=O.split(this.formatSeparator),S=_.shift().trim(),E=_.join(this.formatSeparator).trim();return this.format(Zd(n,d,S,this.options.keySeparator,this.options.ignoreJSONStructure),E,i,{...r,...n,interpolationkey:S})};this.resetRegExp();const m=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,y=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>Fu(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?Fu(this.escape(O)):Fu(O)}].forEach(O=>{for(l=0;s=O.regex.exec(e);){const _=s[1].trim();if(o=h(_),o===void 0)if(typeof m=="function"){const E=m(e,s,r);o=typeof E=="string"?E:""}else if(r&&Object.prototype.hasOwnProperty.call(r,_))o="";else if(y){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${_} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=zd(o));const S=O.safeValue(o);if(e=e.replace(s[0],S),y?(O.regex.lastIndex+=o.length,O.regex.lastIndex-=s[0].length):O.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,s,o;const l=(d,h)=>{const m=this.nestingOptionsSeparator;if(d.indexOf(m)<0)return d;const y=d.split(new RegExp(`${m}[ ]*{`));let g=`{${y[1]}`;d=y[0],g=this.interpolate(g,o);const O=g.match(/'/g),_=g.match(/"/g);(O&&O.length%2===0&&!_||_.length%2!==0)&&(g=g.replace(/'/g,'"'));try{o=JSON.parse(g),h&&(o={...h,...o})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,S),`${d}${m}${g}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,d};for(;r=this.nestingRegexp.exec(e);){let d=[];o={...i},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let h=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){const m=r[1].split(this.formatSeparator).map(y=>y.trim());r[1]=m.shift(),d=m,h=!0}if(s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===e&&typeof s!="string")return s;typeof s!="string"&&(s=zd(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),s=""),h&&(s=d.reduce((m,y)=>this.format(m,y,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),e=e.replace(r[0],s),this.regexp.lastIndex=0}return e}}const Ow=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const r=i[1].substring(0,i[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...d]=o.split(":"),h=d.join(":").trim().replace(/^'+|'+$/g,""),m=l.trim();n[m]||(n[m]=h),h==="false"&&(n[m]=!1),h==="true"&&(n[m]=!0),isNaN(h)||(n[m]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},ji=t=>{const e={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=e[o];return l||(l=t(Ta(i),r),e[o]=l),l(n)}};class xw{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hn.create("formatter"),this.options=e,this.formats={number:ji((n,i)=>{const r=new Intl.NumberFormat(n,{...i});return s=>r.format(s)}),currency:ji((n,i)=>{const r=new Intl.NumberFormat(n,{...i,style:"currency"});return s=>r.format(s)}),datetime:ji((n,i)=>{const r=new Intl.DateTimeFormat(n,{...i});return s=>r.format(s)}),relativetime:ji((n,i)=>{const r=new Intl.RelativeTimeFormat(n,{...i});return s=>r.format(s,i.range||"day")}),list:ji((n,i)=>{const r=new Intl.ListFormat(n,{...i});return s=>r.format(s)})},this.init(e)}init(e){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=ji(n)}format(e,n,i){let r=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(l=>l.indexOf(")")>-1)){const l=s.findIndex(d=>d.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,l)].join(this.formatSeparator)}return s.reduce((l,d)=>{const{formatName:h,formatOptions:m}=Ow(d);if(this.formats[h]){let y=l;try{const g=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},O=g.locale||g.lng||r.locale||r.lng||i;y=this.formats[h](l,O,{...m,...r,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${h}`);return l},e)}}const Tw=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Cw extends so{constructor(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=hn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,r.backend,r)}queueLoad(e,n,i,r){const s={},o={},l={},d={};return e.forEach(h=>{let m=!0;n.forEach(y=>{const g=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?o[g]===void 0&&(o[g]=!0):(this.state[g]=1,m=!1,o[g]===void 0&&(o[g]=!0),s[g]===void 0&&(s[g]=!0),d[y]===void 0&&(d[y]=!0)))}),m||(l[h]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(d)}}loaded(e,n,i){const r=e.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const l={};this.queue.forEach(d=>{fw(d.loaded,[s],o),Tw(d,e),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(h=>{l[h]||(l[h]={});const m=d.loaded[h];m.length&&m.forEach(y=>{l[h][y]===void 0&&(l[h][y]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(d=>!d.done)}read(e,n,i){let r=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:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(h,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&m&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,i,r+1,s*2,o)},s);return}o(h,m)},d=this.backend[i].bind(this.backend);if(d.length===2){try{const h=d(e,n);h&&typeof h.then=="function"?h.then(m=>l(null,m)).catch(l):l(null,h)}catch(h){l(h)}return}return d(e,n,l)}prepareLoading(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=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."),r&&r();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const s=this.queueLoad(e,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(e,o,l)})}saveMissing(e,n,i,r,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=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 "${i}" 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(!(i==null||i==="")){if(this.backend&&this.backend.create){const d={...o,isUpdate:s},h=this.backend.create.bind(this.backend);if(h.length<6)try{let m;h.length===5?m=h(e,n,i,r,d):m=h(e,n,i,r),m&&typeof m.then=="function"?m.then(y=>l(null,y)).catch(l):l(null,m)}catch(m){l(m)}else h(e,n,i,r,l,d)}!e||!e[0]||this.store.addResource(e[0],n,i,r)}}}const ef=()=>({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(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),tf=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),Ys=()=>{},Rw=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class rs extends so{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=tf(e),this.services={},this.logger=hn,this.modules={external:[]},Rw(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]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(i=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 r=ef();this.options={...r,...this.options,...tf(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?hn.init(s(this.modules.logger),this.options):hn.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:typeof Intl!="undefined"&&(m=xw);const y=new Xd(this.options);this.store=new Jd(this.options.resources,this.options);const g=this.services;g.logger=hn,g.resourceStore=this.store,g.languageUtils=y,g.pluralResolver=new Nw(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),m&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(g.formatter=s(m),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Aw(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new Cw(s(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(O){for(var _=arguments.length,S=new Array(_>1?_-1:0),E=1;E<_;E++)S[E-1]=arguments[E];e.emit(O,...S)}),this.modules.languageDetector&&(g.languageDetector=s(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=s(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new Ca(this.services,this.options),this.translator.on("*",function(O){for(var _=arguments.length,S=new Array(_>1?_-1:0),E=1;E<_;E++)S[E-1]=arguments[E];e.emit(O,...S)}),this.modules.external.forEach(O=>{O.init&&O.init(this)})}if(this.format=this.options.interpolation.format,i||(i=Ys),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=function(){return e.store[m](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=function(){return e.store[m](...arguments),e}});const d=Pr(),h=()=>{const m=(y,g)=>{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),d.resolve(g),i(y,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ys;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const s=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(h=>{h!=="cimode"&&s.indexOf(h)<0&&s.push(h)})};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>o(d)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(s,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(l)})}else i(null)}reloadResources(e,n,i){const r=Pr();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=Ys),this.services.backendConnector.reload(e,n,s=>{r.resolve(),i(s)}),r}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"&&Xp.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 i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,n){var i=this;this.isLanguageChangingTo=e;const r=Pr();this.emit("languageChanging",e);const s=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,h)=>{h?(s(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,r.resolve(function(){return i.t(...arguments)}),n&&n(d,function(){return i.t(...arguments)})},l=d=>{!e&&!d&&this.services.languageDetector&&(d=[]);const h=typeof d=="string"?d:this.services.languageUtils.getBestMatchFromCodes(d);h&&(this.language||s(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(h)),this.loadResources(h,m=>{o(m,h)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,i){var r=this;const s=function(o,l){let d;if(typeof l!="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),y=2;y<h;y++)m[y-2]=arguments[y];d=r.options.overloadTranslationOptionHandler([o,l].concat(m))}else d={...l};d.lng=d.lng||s.lng,d.lngs=d.lngs||s.lngs,d.ns=d.ns||s.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||s.keyPrefix);const g=r.options.keySeparator||".";let O;return d.keyPrefix&&Array.isArray(o)?O=o.map(_=>`${d.keyPrefix}${g}${_}`):O=d.keyPrefix?`${d.keyPrefix}${g}${o}`:o,r.t(O,d)};return typeof e=="string"?s.lng=e:s.lngs=e,s.ns=n,s.keyPrefix=i,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 i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,d)=>{const h=this.services.backendConnector.state[`${l}|${d}`];return h===-1||h===0||h===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,e)&&(!r||o(s,e)))}loadNamespaces(e,n){const i=Pr();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=Pr();typeof e=="string"&&(e=[e]);const r=this.options.preload||[],s=e.filter(o=>r.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(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"],i=this.services&&this.services.languageUtils||new Xd(ef());return n.indexOf(i.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 rs(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ys;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},s=new rs(r);return(e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i&&(s.store=new Jd(this.store.data,r),s.services.resourceStore=s.store),s.translator=new Ca(s.services,r),s.translator.on("*",function(l){for(var d=arguments.length,h=new Array(d>1?d-1:0),m=1;m<d;m++)h[m-1]=arguments[m];s.emit(l,...h)}),s.init(r,n),s.translator.options=r,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 Et=rs.createInstance();Et.createInstance=rs.createInstance;Et.createInstance;Et.dir;Et.init;Et.loadResources;Et.reloadResources;Et.use;Et.changeLanguage;Et.getFixedT;const nf=Et.t;Et.exists;Et.setDefaultNamespace;Et.hasLoadedNamespace;Et.loadNamespaces;Et.loadLanguages;const Qp=t=>nf(t?`errorCodes.${t}`:"errorCodes.DEFAULT");class Fw{constructor(e){me(this,"logger");me(this,"axiosInstance");this.logger=e.logger,this.axiosInstance=at.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:i={},ignoreError:r=!1}=n;try{return(await this.axiosInstance.post(e,i)).data}catch(o){if(r&&at.isAxiosError(o))return(s=o.response)==null?void 0:s.data;throw this.handleError(o)}}async put(e,n){var s;const{data:i={},ignoreError:r=!1}=n;try{return(await this.axiosInstance.put(e,i)).data}catch(o){if(r&&at.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 r;let n=xt.GENERAL_ERROR;if(at.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 i=Qp(n);return this.logger.error("Error Code:",n,"Message:",i),this.logger.error("Result Data:",(r=e.response)==null?void 0:r.data),new Error(i)}}function Iw(t){return Symbol(t)}function Dw(t){return Symbol(t)}function Pw(t){return{key:t,isOptional:!0}}function Lw(t,e){return Object.entries(e).reduce((n,[i,r])=>(n[i]=t.token(r),n),{})}var Iu=new WeakMap,Zp=new Map,$w=new Map,_i;(function(t){t[t.Constant=0]="Constant",t[t.Instance=1]="Instance",t[t.Factory=2]="Factory"})(_i||(_i={}));var Tn;(function(t){t[t.Container=0]="Container",t[t.Resolution=1]="Resolution",t[t.Singleton=2]="Singleton",t[t.Transient=3]="Transient"})(Tn||(Tn={}));var Mw=class{constructor(t){this.impl=t,this.type=_i.Constant}},Bw=class{constructor(t){this.impl=t,this.type=_i.Factory}},Uw=t=>t.type===_i.Factory,ao=class{constructor(t){this.impl=t,this.type=_i.Instance}},jw=class extends ao{constructor(){super(...arguments),this.scope=Tn.Container,this.cache=new WeakMap}},Vw=class extends ao{constructor(){super(...arguments),this.scope=Tn.Resolution}},Hw=class extends ao{constructor(t){super(t),this.impl=t,this.scope=Tn.Singleton}},qw=class extends ao{constructor(){super(...arguments),this.scope=Tn.Transient}},zw=t=>t.type===_i.Instance,Kw=t=>t.scope===Tn.Container,Gw=t=>t.scope===Tn.Resolution,Ww=t=>t.scope===Tn.Singleton,em=t=>Symbol(t),Jw=t=>{const e=Symbol(t);return{__t:null,__d:t,__s:e,__o:!1,optional:{__t:null,__d:t,__s:e,__o:!0}}},jr=class{constructor(){this.parent=null,this.map=new Map}set(t,e,n=jr.notag){const i=this.map.get(e.__s);i?i.set(n,t):this.map.set(e.__s,new Map().set(n,t))}find(t,e,n){const i=this.map.get(t.__s);if(i!==void 0){if(n){const r=i.get(n);if(r)return r}if(e)for(let r=0,s=e.length;r<s;r+=1){const o=i.get(e[r]);if(o)return o}return i.get(jr.notag)}}resolve(t,e,n,i){const r=this.find(t,n,i);return r===void 0?this.parent?this.parent.resolve(t,e,n,i):null:r instanceof jr?(e.vaults.push(r),r.resolve(t,e,n,i)):r}get(t,e,n,i){const r=this.resolve(t,e,n,i);if(r)return r;for(let s=0,o=e.vaults,l=o.length;s<l;s+=1){const d=o[s].resolve(t,e,n,i);if(d)return d}return null}from(t){const e=new jr;return e.parent=this.parent,this.map.forEach((n,i)=>{e.map.set(i,t(n))}),e}clone(){return this.from(t=>new Map(t))}},tm=jr;tm.notag=em("NO_TAG");var Yw=class{constructor(t,e,n,i){this.vault=t,this.tokens=e,this.getVault=n,this.condition=i}from(t){const{tokens:e}=this;for(let n=0,i=e.length;n<i;n+=1)this.vault.set(this.getVault(t),e[n],this.condition)}},Xw=class{constructor(t,e,n,i){this.vault=t,this.impl=e,this.token=n,this.condition=i}inContainerScope(){this.set(jw)}inResolutionScope(){this.set(Vw)}inSingletonScope(){this.set(Hw)}inTransientScope(){this.set(qw)}set(t){this.vault.set(new t(this.impl),this.token,this.condition)}},Qw=class{constructor(t,e,n){this.vault=t,this.token=e,this.condition=n}toConstant(t){this.vault.set(new Mw(t),this.token,this.condition)}toFactory(t,e){this.vault.set(new Bw({creator:t,initializer:e}),this.token,this.condition)}toInstance(t){return new Xw(this.vault,t,this.token,this.condition)}},_l=class{constructor(t,e){this.vault=t,this.condition=e}static vault(t){return t.vault}bind(t){return new Qw(this.vault,t,this.condition)}use(...t){return new Yw(this.vault,t,_l.vault,this.condition)}},Zw=class extends _l{when(t){return new _l(this.vault,t)}},eS=class extends Zw{constructor(){super(new tm)}},nm=class{constructor(t=new Map,e=[]){this.instances=t,this.vaults=e}split(){return new nm(this.instances,this.vaults.slice())}},aa=class extends eS{constructor(){super(),this.snapshot=null}extend(t){return this.vault.parent=t===null?null:t.vault,this}clone(){const t=new aa;return t.vault=this.vault.clone(),t}get(t,e){return this.resolveToken(t,e)}resolveTokens(t,e,n,i){return t.map(r=>this.resolveToken(r,n,i,e.split()))}resolveToken(t,e,n,i=new nm){const r=this.vault.get(t,i,e,n);if(r)return this.resolveBinding(r,i);if(!t.__o)throw new Error(`No matching bindings found for '${t.__d}' token.`)}resolveBinding(t,e){return zw(t)?Ww(t)?this.resolveCache(t,e,()=>t.cache,n=>{t.cache=n}):Kw(t)?this.resolveCache(t,e,()=>t.cache.get(this.vault),n=>{t.cache.set(this.vault,n)}):Gw(t)?this.resolveCache(t,e,()=>e.instances.get(t),n=>{e.instances.set(t,n)}):this.createInstance(t.impl,e):Uw(t)?(...n)=>{const i=this.createInstance(t.impl.creator,e);return i instanceof Promise?i.then(r=>aa.resolveInitialization(r,n,t.impl.initializer)):aa.resolveInitialization(i,n,t.impl.initializer)}:t.impl}resolveCache(t,e,n,i){const r=n();if(r!==void 0)return r;const s=this.createInstance(t.impl,e);return i(s),s}createInstance(t,e){const n=this.getParameters(t,e),i=Iu.get(t);if(i!==void 0)return i?t(...n):new t(...n);try{const r=t(...n);return Iu.set(t,!0),r}catch{const s=new t(...n);return Iu.set(t,!1),s}}getParameters(t,e){const n=Zp.get(t);if(n)return this.resolveTokens(n,e,$w.get(t),t);if(t.length===0)return[];throw new Error(`Missing required 'injected' registration of '${t.name}'`)}static resolveInitialization(t,e,n){const i=n==null?void 0:n(t,...e);return i instanceof Promise?i.then(()=>t):t}},rf=(t,...e)=>(Zp.set(t,e),t);function Wl(t){return typeof t=="object"&&t!==null&&t.isOptional===!0}function im(t){return"useClass"in t}function rm(t){return"useValue"in t}function sm(t){return"useFactory"in t}var hi=(t=>(t.Singleton="singleton",t.Transient="transient",t.Container="container",t.Resolution="resolution",t))(hi||{});function qi(t,e){var n;return t.has(e)||t.set(e,Jw((n=e.description)!=null?n:"unknown_key")),t.get(e)}function Jl(t,e){var n;return t.has(e)||t.set(e,em((n=e.description)!=null?n:"unknown_tag")),t.get(e)}function am(t,e){return typeof e=="symbol"?Jl(t,e):e}function wl(t,e,n){return e.map(i=>{const r=Wl(i),s=r?i.key:i,o=t.get(s);if(!o)throw new Error(`DI Error: Dependency key "${String(s.description)}" required by "${String(n.description)}" not found.`);return r?o.optional:o})}function om(t,e){switch(e){case hi.Singleton:t.inSingletonScope();break;case hi.Container:t.inContainerScope();break;case hi.Resolution:t.inResolutionScope();break;case hi.Transient:default:t.inTransientScope();break}}class Yl{constructor(){me(this,"container");me(this,"keyToTokenMap",new Map);me(this,"tagToBrandiTagMap",new Map);this.container=new aa}static create(e){const n=new Yl;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=>{qi(this.keyToTokenMap,n.key),n.when&&typeof n.when=="symbol"&&Jl(this.tagToBrandiTagMap,n.when),"deps"in n&&n.deps&&n.deps.forEach(i=>{const r=Wl(i)?i.key:i;qi(this.keyToTokenMap,r)})})}bindProviders(e){e.forEach(n=>{const i=n.when?am(this.tagToBrandiTagMap,n.when):void 0,r=i?this.container.when(i):this.container;im(n)?this.bindClassProvider(r,n):rm(n)?this.bindValueProvider(r,n):sm(n)&&this.bindFactoryProvider(r,n)})}bindClassProvider(e,n){const{key:i,useClass:r,deps:s=[],scope:o=hi.Transient}=n,l=qi(this.keyToTokenMap,i),d=wl(this.keyToTokenMap,s,i);d.length>0&&rf(r,...d);const h=e.bind(l).toInstance(r);om(h,o)}bindValueProvider(e,n){const i=qi(this.keyToTokenMap,n.key);e.bind(i).toConstant(n.useValue)}bindFactoryProvider(e,n){var d;const{key:i,useFactory:r,deps:s=[],initializer:o}=n,l=qi(this.keyToTokenMap,i);if(typeof r=="function"&&((d=r.prototype)==null?void 0:d.constructor)===r&&s.length>0){const h=wl(this.keyToTokenMap,s,i);h.length>0&&rf(r,...h)}e.bind(l).toFactory(r,o)}}function um(t){const e=Object.values(t);return Object.assign({},...e)}function lm(t){return Object.entries(t).reduce((e,[n,i])=>{const r=um(i);return{...e,[n]:r}},{})}function cm(t,e){const n=lm(e);Object.entries(n).forEach(([i,r])=>{t.addResourceBundle(i,"translation",r,!0)})}const{slice:tS,forEach:nS}=[];function iS(t){return nS.call(tS.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const sf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rS=(t,e,n)=>{const i=n||{};i.path=i.path||"/";const r=encodeURIComponent(e);let s=`${t}=${r}`;if(i.maxAge>0){const o=i.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(i.domain){if(!sf.test(i.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${i.domain}`}if(i.path){if(!sf.test(i.path))throw new TypeError("option path is invalid");s+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.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},af={create(t,e,n,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+n*60*1e3)),i&&(r.domain=i),document.cookie=rS(t,encodeURIComponent(e),r)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i];for(;r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return r.substring(e.length,r.length)}return null},remove(t){this.create(t,"",-1)}};var sS={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document!="undefined")return af.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:i,cookieDomain:r,cookieOptions:s}=e;n&&typeof document!="undefined"&&af.create(n,t,i,r,s)}},aS={name:"querystring",lookup(t){var i;let{lookupQuerystring:e}=t,n;if(typeof window!="undefined"){let{search:r}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let l=0;l<o.length;l++){const d=o[l].indexOf("=");d>0&&o[l].substring(0,d)===e&&(n=o[l].substring(d+1))}}return n}};let Lr=null;const of=()=>{if(Lr!==null)return Lr;try{Lr=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Lr=!1}return Lr};var oS={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&of())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&of()&&window.localStorage.setItem(n,t)}};let $r=null;const uf=()=>{if($r!==null)return $r;try{$r=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{$r=!1}return $r};var uS={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&uf())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&uf()&&window.sessionStorage.setItem(n,t)}},lS={name:"navigator",lookup(t){const e=[];if(typeof navigator!="undefined"){const{languages:n,userLanguage:i,language:r}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);i&&e.push(i),r&&e.push(r)}return e.length>0?e:void 0}},cS={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const i=e||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(n=i.getAttribute("lang")),n}},dS={name:"path",lookup(t){var r;let{lookupFromPathIndex:e}=t;if(typeof window=="undefined")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(r=n[typeof e=="number"?e:0])==null?void 0:r.replace("/",""):void 0}},fS={name:"subdomain",lookup(t){var r,s;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,i=typeof window!="undefined"&&((s=(r=window.location)==null?void 0:r.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[n]}};function hS(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class dm{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]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=iS(n,this.options||{},hS()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=r=>r.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(sS),this.addDetector(aS),this.addDetector(oS),this.addDetector(uS),this.addDetector(lS),this.addDetector(cS),this.addDetector(dS),this.addDetector(fS)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(i=>{if(this.detectors[i]){let r=this.detectors[i].lookup(this.options);r&&typeof r=="string"&&(r=[r]),r&&(n=n.concat(r))}}),n=n.map(i=>this.options.convertDetectedLanguage(i)),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(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(e,this.options)}))}}dm.type="languageDetector";function fm(t,e){t.use(e).use(dm).init({resources:{},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(n,i,r)=>{if(i){const[s,...o]=i.split(",").map(l=>l.trim());if(s==="number")return new Intl.NumberFormat(r).format(n);if(s==="date")return new Intl.DateTimeFormat(r).format(n);if(s==="currency")return new Intl.NumberFormat(r,{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 pS=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mS={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},gS=t=>mS[t],vS=t=>t.replace(pS,gS);let lf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:vS};function yS(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf={...lf,...t}}const bS={type:"3rdParty",init(t){yS(t.options.react)}};fm(Et,bS);const kS=t=>cm(Et,t),cf={startTime:"UNKNOWN",viewerCount:0,status:"UNKNOWN"},_S=()=>{const[t,e]=je.useState([]),[n,i]=je.useState(cf);return{realTimeStreamInfo:n,productsInCart:t,onTextMetadataCue:o=>{const{action:l,data:d,startTime:h,viewerCount:m,status:y}=JSON.parse(o==null?void 0:o.text);switch(l){case"sendivsdatarealtime":{i({startTime:h,viewerCount:m,status:y});break}case"sendaddtocart":{const{id:g,sessionId:O,productId:_,productImageUrl:S,productName:E}=d;e(R=>[...R,{id:g,sessionId:O,productId:_,productImageUrl:S,productName:E}])}break}},resetRealTimeStreamInfo:()=>{i(cf)},setProductsInCart:e}},Xl=JSON,wS=t=>t.toUpperCase(),SS=t=>{const e={};return t.forEach((n,i)=>{e[i]=n}),e},ES=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},NS=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},AS=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};function oa(t,e){if(!!!t)throw new Error(e)}function OS(t){return typeof t=="object"&&t!==null}function xS(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const TS=/\r\n|[\n\r]/g;function Sl(t,e){let n=0,i=1;for(const r of t.body.matchAll(TS)){if(typeof r.index=="number"||xS(!1),r.index>=e)break;n=r.index+r[0].length,i+=1}return{line:i,column:e+1-n}}function CS(t){return hm(t.source,Sl(t.source,t.start))}function hm(t,e){const n=t.locationOffset.column-1,i="".padStart(n)+t.body,r=e.line-1,s=t.locationOffset.line-1,o=e.line+s,l=e.line===1?n:0,d=e.column+l,h=`${t.name}:${o}:${d}
|
|
37
|
-
`,
|
|
38
|
-
`)}function
|
|
39
|
-
|
|
40
|
-
`+
|
|
41
|
-
|
|
42
|
-
`+
|
|
43
|
-
`),
|
|
44
|
-
`),'"""'+
|
|
45
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw
|
|
46
|
-
`));return t.line+=
|
|
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().logger.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)}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","10"),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,secure:!0,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.
|
|
47
145
|
|
|
48
146
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
49
147
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -54,70 +152,70 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
54
152
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
55
153
|
versions may have different capabilities and behavior. The data from one
|
|
56
154
|
version used in the function from another could produce confusing and
|
|
57
|
-
spurious results.`)}}return!1};class _m{constructor(e,n="GraphQL request",i={line:1,column:1}){typeof e=="string"||oa(!1,`Body must be a string. Received: ${Zl(e)}.`),this.body=e,this.name=n,this.locationOffset=i,this.locationOffset.line>0||oa(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||oa(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function iE(t){return nE(t,_m)}function rE(t,e){return new sE(t,e).parseDocument()}class sE{constructor(e,n={}){const i=iE(e)?e:new _m(e);this._lexer=new MS(i),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(Y.NAME);return this.node(e,{kind:xe.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:xe.DOCUMENT,definitions:this.many(Y.SOF,this.parseDefinition,Y.EOF)})}parseDefinition(){if(this.peek(Y.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===Y.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 _t(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(Y.BRACE_L))return this.node(e,{kind:xe.OPERATION_DEFINITION,operation:Wi.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(Y.NAME)&&(i=this.parseName()),this.node(e,{kind:xe.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Y.NAME);switch(e.value){case"query":return Wi.QUERY;case"mutation":return Wi.MUTATION;case"subscription":return Wi.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Y.PAREN_L,this.parseVariableDefinition,Y.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:xe.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Y.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Y.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Y.DOLLAR),this.node(e,{kind:xe.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:xe.SELECTION_SET,selections:this.many(Y.BRACE_L,this.parseSelection,Y.BRACE_R)})}parseSelection(){return this.peek(Y.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(Y.COLON)?(i=n,r=this.parseName()):r=n,this.node(e,{kind:xe.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Y.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Y.PAREN_L,n,Y.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(Y.COLON),this.node(n,{kind:xe.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Y.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(Y.NAME)?this.node(e,{kind:xe.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:xe.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:xe.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:xe.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 Y.BRACKET_L:return this.parseList(e);case Y.BRACE_L:return this.parseObject(e);case Y.INT:return this.advanceLexer(),this.node(n,{kind:xe.INT,value:n.value});case Y.FLOAT:return this.advanceLexer(),this.node(n,{kind:xe.FLOAT,value:n.value});case Y.STRING:case Y.BLOCK_STRING:return this.parseStringLiteral();case Y.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:xe.BOOLEAN,value:!0});case"false":return this.node(n,{kind:xe.BOOLEAN,value:!1});case"null":return this.node(n,{kind:xe.NULL});default:return this.node(n,{kind:xe.ENUM,value:n.value})}case Y.DOLLAR:if(e)if(this.expectToken(Y.DOLLAR),this._lexer.token.kind===Y.NAME){const i=this._lexer.token.value;throw _t(this._lexer.source,n.start,`Unexpected variable "$${i}" 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:xe.STRING,value:e.value,block:e.kind===Y.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:xe.LIST,values:this.any(Y.BRACKET_L,n,Y.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:xe.OBJECT,fields:this.any(Y.BRACE_L,n,Y.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,i=this.parseName();return this.expectToken(Y.COLON),this.node(n,{kind:xe.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(Y.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(Y.AT),this.node(n,{kind:xe.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(Y.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(Y.BRACKET_R),n=this.node(e,{kind:xe.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(Y.BANG)?this.node(e,{kind:xe.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:xe.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Y.STRING)||this.peek(Y.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(Y.BRACE_L,this.parseOperationTypeDefinition,Y.BRACE_R);return this.node(e,{kind:xe.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(Y.COLON);const i=this.parseNamedType();return this.node(e,{kind:xe.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:xe.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:xe.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Y.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Y.BRACE_L,this.parseFieldDefinition,Y.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Y.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:xe.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(Y.PAREN_L,this.parseInputValueDef,Y.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(Y.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(Y.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:xe.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:xe.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:xe.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(Y.EQUALS)?this.delimitedMany(Y.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:xe.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(Y.BRACE_L,this.parseEnumValueDefinition,Y.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:xe.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw _t(this._lexer.source,this._lexer.token.start,`${Xs(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 i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:xe.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(Y.BRACE_L,this.parseInputValueDef,Y.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Y.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(),i=this.optionalMany(Y.BRACE_L,this.parseOperationTypeDefinition,Y.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:xe.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(e,{kind:xe.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:xe.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:xe.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:xe.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:xe.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:xe.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Y.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:xe.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Y.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(El,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new FS(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 _t(this._lexer.source,n.start,`Expected ${wm(e)}, found ${Xs(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===Y.NAME&&n.value===e)this.advanceLexer();else throw _t(this._lexer.source,n.start,`Expected "${e}", found ${Xs(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===Y.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e!=null?e:this._lexer.token;return _t(this._lexer.source,n.start,`Unexpected ${Xs(n)}.`)}any(e,n,i){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(e,n,i){if(this.expectOptionalToken(e)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(e,n,i){this.expectToken(e);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(e,n){this.expectOptionalToken(e);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==Y.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw _t(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Xs(t){const e=t.value;return wm(t.kind)+(e!=null?` "${e}"`:"")}function wm(t){return BS(t)?`"${t}"`:t}function aE(t){return`"${t.replace(oE,uE)}"`}const oE=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function uE(t){return lE[t.charCodeAt(0)]}const lE=["\\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"],cE=Object.freeze({});function dE(t,e,n=mm){const i=new Map;for(const R of Object.values(xe))i.set(R,fE(e,R));let r,s=Array.isArray(t),o=[t],l=-1,d=[],h=t,m,y;const g=[],O=[];do{l++;const R=l===o.length,j=R&&d.length!==0;if(R){if(m=O.length===0?void 0:g[g.length-1],h=y,y=O.pop(),j)if(s){h=h.slice();let z=0;for(const[X,ne]of d){const oe=X-z;ne===null?(h.splice(oe,1),z++):h[oe]=ne}}else{h=Object.defineProperties({},Object.getOwnPropertyDescriptors(h));for(const[z,X]of d)h[z]=X}l=r.index,o=r.keys,d=r.edits,s=r.inArray,r=r.prev}else if(y){if(m=s?l:o[l],h=y[m],h==null)continue;g.push(m)}let J;if(!Array.isArray(h)){var _,S;hf(h)||oa(!1,`Invalid AST Node: ${Zl(h)}.`);const z=R?(_=i.get(h.kind))===null||_===void 0?void 0:_.leave:(S=i.get(h.kind))===null||S===void 0?void 0:S.enter;if(J=z==null?void 0:z.call(e,h,m,y,g,O),J===cE)break;if(J===!1){if(!R){g.pop();continue}}else if(J!==void 0&&(d.push([m,J]),!R))if(hf(J))h=J;else{g.pop();continue}}if(J===void 0&&j&&d.push([m,h]),R)g.pop();else{var E;r={inArray:s,index:l,keys:o,edits:d,prev:r},s=Array.isArray(h),o=s?h:(E=n[h.kind])!==null&&E!==void 0?E:[],l=-1,d=[],y&&O.push(y),y=h}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:t}function fE(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 hE(t){return dE(t,mE)}const pE=80,mE={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>we(t.definitions,`
|
|
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,`
|
|
58
156
|
|
|
59
|
-
`)},OperationDefinition:{leave(t){const e=
|
|
60
|
-
`,
|
|
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,`
|
|
61
159
|
`)),`
|
|
62
|
-
)`))
|
|
63
|
-
`)
|
|
64
|
-
`)
|
|
65
|
-
`)
|
|
66
|
-
`)+e+(
|
|
67
|
-
`,
|
|
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,`
|
|
68
166
|
`)),`
|
|
69
|
-
)`):
|
|
70
|
-
`)
|
|
71
|
-
`)
|
|
72
|
-
`)
|
|
73
|
-
`)
|
|
74
|
-
`)
|
|
75
|
-
`)
|
|
76
|
-
`)+"directive @"+e+(
|
|
77
|
-
`,
|
|
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,`
|
|
78
176
|
`)),`
|
|
79
|
-
)`):
|
|
80
|
-
`,
|
|
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,`
|
|
81
179
|
`)),`
|
|
82
|
-
}`)}function
|
|
83
|
-
`))}function
|
|
84
|
-
`)))!==null&&e!==void 0?e:!1}const gf=t=>{var i,r;let e;const n=t.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(e=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),e},Pu=t=>{if(typeof t=="string"){let n;try{const i=rE(t);n=gf(i)}catch{}return{query:t,operationName:n}}const e=gf(t);return{query:hE(t),operationName:e}};class Gr extends Error{constructor(e,n){const i=`${Gr.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(i),Object.setPrototypeOf(this,Gr.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Gr)}static extractMessage(e){var n,i,r;return(r=(i=(n=e.errors)==null?void 0:n[0])==null?void 0:i.message)!=null?r:`GraphQL Error (Code: ${e.status})`}}var Hr={exports:{}},gE=Hr.exports,vf;function vE(){return vf||(vf=1,function(t,e){var n=typeof self!="undefined"?self:gE,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var l={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 d(M){return M&&DataView.prototype.isPrototypeOf(M)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(M){return M&&h.indexOf(Object.prototype.toString.call(M))>-1};function y(M){if(typeof M!="string"&&(M=String(M)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(M))throw new TypeError("Invalid character in header field name");return M.toLowerCase()}function g(M){return typeof M!="string"&&(M=String(M)),M}function O(M){var N={next:function(){var K=M.shift();return{done:K===void 0,value:K}}};return l.iterable&&(N[Symbol.iterator]=function(){return N}),N}function _(M){this.map={},M instanceof _?M.forEach(function(N,K){this.append(K,N)},this):Array.isArray(M)?M.forEach(function(N){this.append(N[0],N[1])},this):M&&Object.getOwnPropertyNames(M).forEach(function(N){this.append(N,M[N])},this)}_.prototype.append=function(M,N){M=y(M),N=g(N);var K=this.map[M];this.map[M]=K?K+", "+N:N},_.prototype.delete=function(M){delete this.map[y(M)]},_.prototype.get=function(M){return M=y(M),this.has(M)?this.map[M]:null},_.prototype.has=function(M){return this.map.hasOwnProperty(y(M))},_.prototype.set=function(M,N){this.map[y(M)]=g(N)},_.prototype.forEach=function(M,N){for(var K in this.map)this.map.hasOwnProperty(K)&&M.call(N,this.map[K],K,this)},_.prototype.keys=function(){var M=[];return this.forEach(function(N,K){M.push(K)}),O(M)},_.prototype.values=function(){var M=[];return this.forEach(function(N){M.push(N)}),O(M)},_.prototype.entries=function(){var M=[];return this.forEach(function(N,K){M.push([K,N])}),O(M)},l.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function S(M){if(M.bodyUsed)return Promise.reject(new TypeError("Already read"));M.bodyUsed=!0}function E(M){return new Promise(function(N,K){M.onload=function(){N(M.result)},M.onerror=function(){K(M.error)}})}function R(M){var N=new FileReader,K=E(N);return N.readAsArrayBuffer(M),K}function j(M){var N=new FileReader,K=E(N);return N.readAsText(M),K}function J(M){for(var N=new Uint8Array(M),K=new Array(N.length),ie=0;ie<N.length;ie++)K[ie]=String.fromCharCode(N[ie]);return K.join("")}function z(M){if(M.slice)return M.slice(0);var N=new Uint8Array(M.byteLength);return N.set(new Uint8Array(M)),N.buffer}function X(){return this.bodyUsed=!1,this._initBody=function(M){this._bodyInit=M,M?typeof M=="string"?this._bodyText=M:l.blob&&Blob.prototype.isPrototypeOf(M)?this._bodyBlob=M:l.formData&&FormData.prototype.isPrototypeOf(M)?this._bodyFormData=M:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)?this._bodyText=M.toString():l.arrayBuffer&&l.blob&&d(M)?(this._bodyArrayBuffer=z(M.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(M)||m(M))?this._bodyArrayBuffer=z(M):this._bodyText=M=Object.prototype.toString.call(M):this._bodyText="",this.headers.get("content-type")||(typeof M=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var M=S(this);if(M)return M;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?S(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var M=S(this);if(M)return M;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(J(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(ve)}),this.json=function(){return this.text().then(JSON.parse)},this}var ne=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function oe(M){var N=M.toUpperCase();return ne.indexOf(N)>-1?N:M}function Se(M,N){N=N||{};var K=N.body;if(M instanceof Se){if(M.bodyUsed)throw new TypeError("Already read");this.url=M.url,this.credentials=M.credentials,N.headers||(this.headers=new _(M.headers)),this.method=M.method,this.mode=M.mode,this.signal=M.signal,!K&&M._bodyInit!=null&&(K=M._bodyInit,M.bodyUsed=!0)}else this.url=String(M);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new _(N.headers)),this.method=oe(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&K)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(K)}Se.prototype.clone=function(){return new Se(this,{body:this._bodyInit})};function ve(M){var N=new FormData;return M.trim().split("&").forEach(function(K){if(K){var ie=K.split("="),ce=ie.shift().replace(/\+/g," "),ae=ie.join("=").replace(/\+/g," ");N.append(decodeURIComponent(ce),decodeURIComponent(ae))}}),N}function ze(M){var N=new _,K=M.replace(/\r?\n[\t ]+/g," ");return K.split(/\r?\n/).forEach(function(ie){var ce=ie.split(":"),ae=ce.shift().trim();if(ae){var B=ce.join(":").trim();N.append(ae,B)}}),N}X.call(Se.prototype);function Ne(M,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new _(N.headers),this.url=N.url||"",this._initBody(M)}X.call(Ne.prototype),Ne.prototype.clone=function(){return new Ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},Ne.error=function(){var M=new Ne(null,{status:0,statusText:""});return M.type="error",M};var Re=[301,302,303,307,308];Ne.redirect=function(M,N){if(Re.indexOf(N)===-1)throw new RangeError("Invalid status code");return new Ne(null,{status:N,headers:{location:M}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(N,K){this.message=N,this.name=K;var ie=Error(N);this.stack=ie.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Ve(M,N){return new Promise(function(K,ie){var ce=new Se(M,N);if(ce.signal&&ce.signal.aborted)return ie(new o.DOMException("Aborted","AbortError"));var ae=new XMLHttpRequest;function B(){ae.abort()}ae.onload=function(){var Fe={status:ae.status,statusText:ae.statusText,headers:ze(ae.getAllResponseHeaders()||"")};Fe.url="responseURL"in ae?ae.responseURL:Fe.headers.get("X-Request-URL");var $e="response"in ae?ae.response:ae.responseText;K(new Ne($e,Fe))},ae.onerror=function(){ie(new TypeError("Network request failed"))},ae.ontimeout=function(){ie(new TypeError("Network request failed"))},ae.onabort=function(){ie(new o.DOMException("Aborted","AbortError"))},ae.open(ce.method,ce.url,!0),ce.credentials==="include"?ae.withCredentials=!0:ce.credentials==="omit"&&(ae.withCredentials=!1),"responseType"in ae&&l.blob&&(ae.responseType="blob"),ce.headers.forEach(function(Fe,$e){ae.setRequestHeader($e,Fe)}),ce.signal&&(ce.signal.addEventListener("abort",B),ae.onreadystatechange=function(){ae.readyState===4&&ce.signal.removeEventListener("abort",B)}),ae.send(typeof ce._bodyInit=="undefined"?null:ce._bodyInit)})}return Ve.polyfill=!0,s.fetch||(s.fetch=Ve,s.Headers=_,s.Request=Se,s.Response=Ne),o.Headers=_,o.Request=Se,o.Response=Ne,o.fetch=Ve,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}(Hr,Hr.exports)),Hr.exports}var Ra=vE();const la=Ya(Ra),yE=vg({__proto__:null,default:la},[Ra]),Vi=t=>{let e={};return t&&(typeof Headers!="undefined"&&t instanceof Headers||yE&&Ra.Headers&&t instanceof Ra.Headers?e=SS(t):Array.isArray(t)?t.forEach(([n,i])=>{n&&i!==void 0&&(e[n]=i)}):e=t),e},yf=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),bE=t=>{if(!Array.isArray(t.query)){const i=t,r=[`query=${encodeURIComponent(yf(i.query))}`];return t.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.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((i,r,s)=>(i.push({query:yf(r),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},kE=t=>async e=>{var S;const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:l,middleware:d}=e,h={...e.headers};let m="",y;t==="POST"?(y=wE(i,r,s,l.jsonSerializer),typeof y=="string"&&(h["Content-Type"]="application/json")):m=bE({query:i,variables:r,operationName:s,jsonSerializer:(S=l.jsonSerializer)!=null?S:Xl});const g={method:t,headers:h,body:y,...l};let O=n,_=g;if(d){const E=await Promise.resolve(d({...g,url:n,operationName:s,variables:r})),{url:R,...j}=E;O=R,_=j}return m&&(O=`${O}?${m}`),await o(O,_)};class _E{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,l=NS(r,s,o),{headers:d,fetch:h=la,method:m="POST",requestMiddleware:y,responseMiddleware:g,...O}=this.requestConfig,{url:_}=this;l.signal!==void 0&&(O.signal=l.signal);const{operationName:S}=Pu(l.query);return Lu({url:_,query:l.query,variables:l.variables,headers:{...Vi($u(d)),...Vi(l.requestHeaders)},operationName:S,fetch:h,method:m,fetchOptions:O,middleware:y}).then(E=>(g&&g(E),E)).catch(E=>{throw g&&g(E),E})}}async request(e,...n){const[i,r]=n,s=ES(e,i,r),{headers:o,fetch:l=la,method:d="POST",requestMiddleware:h,responseMiddleware:m,...y}=this.requestConfig,{url:g}=this;s.signal!==void 0&&(y.signal=s.signal);const{query:O,operationName:_}=Pu(s.document);return Lu({url:g,query:O,variables:s.variables,headers:{...Vi($u(o)),...Vi(s.requestHeaders)},operationName:_,fetch:l,method:d,fetchOptions:y,middleware:h}).then(S=>(m&&m(S),S.data)).catch(S=>{throw m&&m(S),S})}batchRequests(e,n){var d;const i=AS(e,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:h})=>Pu(h).query),l=i.documents.map(({variables:h})=>h);return Lu({url:this.url,query:o,variables:l,headers:{...Vi($u(r)),...Vi(i.requestHeaders)},operationName:void 0,fetch:(d=this.requestConfig.fetch)!=null?d:la,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(h=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h.data)).catch(h=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:i}=this.requestConfig;return i?i[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const Lu=async t=>{var m,y;const{query:e,variables:n,fetchOptions:i}=t,r=kE(wS((m=t.method)!=null?m:"post")),s=Array.isArray(t.query),o=await r(t),l=await SE(o,(y=i.jsonSerializer)!=null?y:Xl),d=Array.isArray(l)?!l.some(({data:g})=>!g):!!l.data,h=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&h&&d){const{errors:g,...O}=(Array.isArray(l),l),_=i.errorPolicy==="ignore"?O:l;return{...s?{data:_}:_,headers:o.headers,status:o.status}}else{const g=typeof l=="string"?{error:l}:l;throw new Gr({...g,status:o.status,headers:o.headers},{query:e,variables:n})}},wE=(t,e,n,i)=>{const r=i!=null?i:Xl;if(!Array.isArray(t))return r.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,l,d)=>(o.push({query:l,variables:e?e[d]:void 0}),o),[]);return r.stringify(s)},SE=async(t,e)=>{let n;return t.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),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()},$u=t=>typeof t=="function"?t():t;class Sm extends Cn{constructor(){super("EVENT_CHAT_ROOM_TOKEN_ERROR","Error getting chat room connection token")}}class lo{constructor(e){me(this,"root",Ep(this));me(this,"token");this.root.setProps(e)}static toDomain(e){const n={token:e.token};return new lo(n)}toPrimitives(){const{root:e,...n}=this;return{...n}}}const EE=rr.apiUrls.graphql;class Em{constructor(){me(this,"client");this.client=new _E(EE)}async getChatRoom(e){var r;const{getChatRoomToken:n}=await this.client.request(_p,{data:{account:e.account,idEvent:e.eventId,userName:e.userName}});this.propagateGraphqlErrorIfExists(n);const i=(r=n.data)==null?void 0:r.token;if(!i)throw new Sm;return lo.toDomain({token:i})}propagateGraphqlErrorIfExists(e){if(e.__typename==="ErrorGeneral")throw new Error(e.message)}}class Nm{constructor(e){me(this,"account");this.eventChatRoomRepository=e}async get(e){this.validateAccount();try{return await this.eventChatRoomRepository.getChatRoom({...e,account:this.account})}catch(n){throw new Fl(n)}}setAccount(e){this.account=e}validateAccount(){if(!this.account)throw new Gf}}const NE=new Em,Al=new Nm(NE),co=Da(void 0);co.debugLabel="chatSocketAtom";const fo=Da(!1);fo.debugLabel="chatIsConnectedAtom";const ms=Da([]);ms.debugLabel="chatMessageListAtom";const Am=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[i,r]=t.data.split("::")||["none","none"],s=r.split("question__")[1],o={response:i.replace("response__",""),question:JSON.parse(s)};return{...t,data:o.response,isResponse:e,responseData:t.data,question:e?o.question:null}}return t},Om=t=>{const{url:e,token:n,onOpen:i,onClose:r,onMessage:s,onError:o}=t,l=new WebSocket(e,n);return l.onopen=d=>i(d),l.onclose=d=>r(d),l.onerror=d=>o(d),l.onmessage=d=>s(d),l},xm=()=>{const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*16)];return e},ec=(t,e)=>{var g,O;const{Content:n,Attributes:i,Sender:{Attributes:r}}=e,{username:s,type:o,email:l}=i,{isAdmin:d}=r,h=(g=i==null?void 0:i.id)!=null?g:wa(8),m=((O=t.find(_=>_.username===s))==null?void 0:O.color)||xm(),y={id:h,type:o,color:m,username:s,email:l,data:n,sendDate:i.sendDate,isAdmin:d==="true",responseAdmin:!1,question:null,account:i.account,idEvent:i.idEvent,urlGif:i.urlGif,ip:i.ip};return Am(y)},Tm=t=>{const{eventId:e,userName:n,enabled:i=!0}=t,{accountName:r}=mp(),[s,o]=je.useState(""),l=()=>{i&&r&&(Al.setAccount(r),Al.get({eventId:e,userName:n}).then(d=>{o(d.token)}))};return je.useEffect(()=>{l()},[r,i]),{getQuery:{refetch:l},token:s}},{coreLogger:AE}=xi(),Rt=AE.child("useConnectChatSocket"),OE=rr.publicUrls.wssIVSChat,xE=10,TE=t=>Math.min(1e4,1e3*Math.pow(2,t)),CE=(t,e,n)=>{const i=JSON.parse(t.data);switch(i.Type){case"EVENT":e==null||e(i);break;case"MESSAGE":n==null||n(i);break;case"ERROR":Rt.error("Chat room error:",i);break;default:Rt.error("Unknown chat room event:",t)}},Cm=t=>{const{onMessage:e,eventId:n,enabled:i=!0,userName:r,onEvent:s}=t,{token:o,getQuery:l}=Tm({eventId:n,userName:r,enabled:i}),[d,h]=nu(co),[m,y]=nu(fo),[g,O]=nu(ms),_=je.useRef(0),S=je.useCallback(z=>Rt.error("Chat room socket error:",z),[]),E=je.useCallback(()=>{y(!0),_.current=0,Rt.debug("Successfully connected to the chat room")},[y]),R=je.useCallback(()=>{if(_.current>=xE){Rt.error("Max reconnection attempts reached. No further attempts will be made.");return}y(!1),_.current+=1;const z=TE(_.current);Rt.debug(`Disconnected from chat room. Reconnecting in ${z/1e3} seconds... (Attempt ${_.current})`),setTimeout(()=>l.refetch(),z)},[l,y]),j=je.useCallback(()=>{if(!o){Rt.debug("No token available. Connection aborted.");return}if((d==null?void 0:d.readyState)===WebSocket.OPEN){Rt.debug("WebSocket is already open. No need to reconnect.");return}Rt.debug("Connecting to the chat room...");const z=Om({token:o,url:OE,onOpen:E,onClose:R,onError:S,onMessage:X=>CE(X,s,e)});h(z)},[o,d,s,e,E,R,S,h]),J=je.useCallback(()=>{if(!d||d.readyState!==WebSocket.OPEN){Rt.debug("No open socket to close.");return}Rt.debug("Closing chat room socket..."),d.close()},[d]);return je.useEffect(()=>{if(!i){Rt.debug("Chat is disabled, skipping connection.");return}if(!o){Rt.debug("Token not available, skipping connection.");return}return Rt.debug("Initializing connection with token:",o),J(),j(),J},[o,i]),{socket:d,chatIsConnected:m,chatMessageList:g,setChatMessageList:O}},RE=()=>{const t=zu(co),e=zu(fo);return{sendMessage:je.useCallback((i,r)=>{if(!t||!e)return;const s={id:r.id,sendDate:new Date,content:i,action:"SEND_MESSAGE",attributes:r},o=JSON.stringify(s);t.send(o)},[e,t])}},Rm=()=>{const t=xl(ms);return{handleEvent:i=>{var r;if(i.EventName==="senddeletemessage"){const s=JSON.parse((r=i.Attributes)==null?void 0:r.data);t(o=>o.filter(l=>l.id!==s.id))}},handleMessage:i=>{t(r=>[...r,ec(r,i)])}}},FE=t=>{const{eventId:e,userName:n}=t,[i,r]=je.useState(!1),[s,o]=je.useState(),[l,d]=je.useState(),[h,m]=je.useState([]),{handleEvent:y}=Rm(),g=xl(ms),O=j=>{g(J=>[ec(J,j),...J]),r(!1)},_=j=>{var J,z,X;if(y(j),j.EventName==="sendpinmessage"){const ne=JSON.parse((J=j.Attributes)==null?void 0:J.data);o({data:ne.data,id:ne.id,username:ne.username})}if(j.EventName==="sendunpinmessage"&&o(void 0),j.EventName==="sendhighlightproduct"){const ne=JSON.parse((z=j.Attributes)==null?void 0:z.data);d({products:ne.productIds,collection:ne.collection,livestreamingId:ne.idEvent})}if(j.EventName==="sendaddtocart"){const ne=JSON.parse((X=j.Attributes)==null?void 0:X.data);m(oe=>[...oe,{id:ne.id,sessionId:ne.sessionId,productId:ne.productId,productImageUrl:ne.productImageUrl,productName:ne.productName}])}},{socket:S,chatMessageList:E,setChatMessageList:R}=Cm({onMessage:O,onEvent:_,eventId:e,userName:n});return{socket:S,chat:E,showLoader:i,pinnedMessage:s,highlightProduct:l,productsInCart:h,setChat:R,setShowLoader:r,setPinnedMessage:o,setProductsInCart:m}};/**
|
|
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}};/**
|
|
85
183
|
* @license
|
|
86
184
|
* Copyright 2019 Google LLC
|
|
87
185
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
-
*/const
|
|
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;/**
|
|
89
187
|
* @license
|
|
90
188
|
* Copyright 2017 Google LLC
|
|
91
189
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
92
|
-
*/const{is:
|
|
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");/**
|
|
93
191
|
* @license
|
|
94
192
|
* Copyright 2017 Google LLC
|
|
95
193
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
96
|
-
*/const
|
|
97
|
-
\f\r]`,
|
|
98
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
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};/**
|
|
99
197
|
* @license
|
|
100
198
|
* Copyright 2017 Google LLC
|
|
101
199
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/class
|
|
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");/**
|
|
103
201
|
* @license
|
|
104
202
|
* Copyright 2020 Google LLC
|
|
105
203
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
106
|
-
*/const
|
|
204
|
+
*/const bU=t=>t.strings===void 0;/**
|
|
107
205
|
* @license
|
|
108
206
|
* Copyright 2017 Google LLC
|
|
109
207
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
110
|
-
*/const
|
|
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)}}/**
|
|
111
209
|
* @license
|
|
112
210
|
* Copyright 2017 Google LLC
|
|
113
211
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
-
*/const
|
|
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(){}}/**
|
|
115
213
|
* @license
|
|
116
214
|
* Copyright 2020 Google LLC
|
|
117
215
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
|
-
*/const
|
|
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`
|
|
119
217
|
:host {
|
|
120
218
|
width: 100%;
|
|
121
219
|
}
|
|
122
|
-
`);class
|
|
220
|
+
`);class k0{constructor(e,n,r){Pe(this,"renderFn");Pe(this,"logger");Pe(this,"rootId");Pe(this,"element",null);Pe(this,"unmount");Pe(this,"updateProps");this.rootId=e,this.renderFn=n,this.logger=r}async render(e={}){var n;if(this.element)this.updateProps(e);else{const r=await this.renderFn(this.rootId,e);this.element=(n=r==null?void 0:r.element)!=null?n:null,this.updateProps=i=>r==null?void 0:r.updateProps(i),this.unmount=()=>{r==null||r.unmount(),this.element=null}}}}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;
|
|
123
221
|
//# sourceMappingURL=index.cjs.map
|