PageSourceSearch

https://v2.sallt.io/_next/static/chunks/93207bbf90505593.js?dpl=dpl_FYL35AzfiXFBnpJLfiQta3twgpQC

js sallt.io collected 2026-09-24 14:23:10 UTC 159,751 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="97a06bdc-68ce-a3f7-4804-4ed3b29944da")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,383627,e=>{"use strict";let{slice:t,forEach:n}=[],r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"},i=encodeURIComponent(t),o=`${e}=${i}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!r.test(n.domain))throw TypeError("option domain is invalid");o+=`; Domain=${n.domain}`}if(n.path){if(!r.test(n.path))throw TypeError("option path is invalid");o+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw TypeError("option expires is invalid");o+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"none":o+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return n.partitioned&&(o+="; Partitioned"),o},o={create(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=i(e,t,o)},read(e){let t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let r=n[e];for(;" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var a={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return o.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&"undefined"!=typeof document&&o.create(n,e,r,i,a)}},s={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));let r=e.substring(1).split("&");for(let e=0;e<r.length;e++){let i=r[e].indexOf("=");i>0&&r[e].substring(0,i)===n&&(t=r[e].substring(i+1))}}return t}},u={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:r}=e;if("undefined"!=typeof window){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(n){let e=i.split("&");for(let r=0;r<e.length;r++){let i=e[r].indexOf("=");i>0&&e[r].substring(0,i)===n&&(t=e[r].substring(i+1))}}if(t)return t;if(!t&&r>-1){let t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;return t["number"==typeof r?r:0]?.replace("/","")}}}return t}};let l=null,c=()=>{if(null!==l)return l;try{if(!(l="undefined"!=typeof window&&null!==window.localStorage))return!1;let e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){l=!1}return l};var h={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&c())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&c()&&window.localStorage.setItem(n,e)}};let d=null,f=()=>{if(null!==d)return d;try{if(!(d="undefined"!=typeof window&&null!==window.sessionStorage))return!1;let e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){d=!1}return d};var p={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&f())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&f()&&window.sessionStorage.setItem(n,e)}},g={name:"navigator",lookup(e){let t=[];if("undefined"!=typeof navigator){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);
2n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},y={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e,r=n||("undefined"!=typeof document?document.documentElement:null);return r&&"function"==typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},m={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n["number"==typeof t?t:0]?.replace("/","")}},v={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n["number"==typeof t?t+1:1]}};let b=!1;try{document.cookie,b=!0}catch(e){}let w=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];b||w.splice(1,1);class x{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return n.call(t.call(arguments,1),t=>{if(t)for(let n in t)void 0===e[n]&&(e[n]=t[n])}),e}(r,this.options||{},{order:w,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(a),this.addDetector(s),this.addDetector(h),this.addDetector(p),this.addDetector(g),this.addDetector(y),this.addDetector(m),this.addDetector(v),this.addDetector(u)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return(e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>null!=e&&!("string"==typeof e&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)))).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes)?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;!t||this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})}}x.type="languageDetector";var k=e.i(369530),_=e.i(449728),S=e.i(885601),O=e.i(319646),C=e.i(242305),A=e.i(251055),P=e.i(804786),E=e.i(13954),j=e.i(278942),D=e.i(619237),I=e.i(927994),R=e.i(110394),K=e.i(849230),L=e.i(870572),T=e.i(122469);let N=e=>"string"==typeof e,B=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},$=e=>null==e?"":""+e,q=/###/g,F=e=>e&&e.indexOf("###")>-1?e.replace(q,"."):e,M=e=>!e||N(e),U=(e,t,n)=>{let r=N(t)?t.split("."):t,i=0;for(;i<r.length-1;){if(M(e))return{};let t=F(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return M(e)?{}:{obj:e,k:F(r[i])}},V=(e,t,n)=>{let{obj:r,k:i}=U(e,t,Object);if(void 0!==r||1===t.length){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=U(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,s=U(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},z=(e,t)=>{let{obj:n,k:r}=U(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},H=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?N(e[r])||e[r]instanceof String||N(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):H(e[r],t[r],n):e[r]=t[r]);return e};var W={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let Y=e=>N(e)?e.replace(/[&<>
2"'\/]/g,e=>W[e]):e,Q=[" ",",","?","!",";"],G=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),J=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),i=e;for(let e=0;e<r.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let a=e;a<r.length;++a)if(a!==e&&(o+=n),o+=r[a],void 0!==(t=i[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}i=t}return i},X=e=>e?.replace("_","-"),Z={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ee{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Z,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(N(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ee(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ee(this.logger,e)}}var et=new ee;class en{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(t=>{let[r,i]=t;for(let t=0;t<i;t++)r.apply(r,[e,...n])})}}class er extends en{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):N(n)&&o?r.push(...n.split(o)):r.push(n)));let s=z(this.data,r);return(!s&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),!s&&a&&N(n))?J(this.data?.[e]?.[t],n,o):s}addResource(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=[e,t];
2n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),V(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let r in n)(N(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=z(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?H(s,n,i):s={...s,...n},V(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var ei={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}};let eo={},ea=e=>!N(e)&&"boolean"!=typeof e&&"number"!=typeof e;class es extends en{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
2i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=et.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let n=this.resolve(e,t);return n?.res!==void 0}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=Q.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let i=G.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r);if(o&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:N(i)?[i]:i};let o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(r)}return{key:e,namespaces:N(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode"){if(l){let e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${o}`}return r?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:o}let c=this.resolve(e,t),h=c?.res,d=c?.usedKey||o,f=c?.exactUsedKey||o,p=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==t.count&&!N(t.count),m=es.hasDefaultValue(t),v=y?this.pluralResolver.getSuffix(u,t.count,t):"",b=t.ordinal&&y?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",w=y&&!t.ordinal&&0===t.count,x=w&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${v}`]||t[`defaultValue${b}`]||t.defaultValue,k=h;g&&!h&&m&&(k=x);let _=ea(k),S=Object.prototype.toString.apply(k);if(g&&k&&_&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(S)&&!(N(p)&&Array.isArray(k))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,k,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(i){let e=Array.isArray(k),n=e?[]:{},r=e?f:d;for(let e in k)if(Object.prototype.hasOwnProperty.call(k,e)){let o=`${r}${i}${e}`;m&&!h?n[e]=this.translate(o,{...t,defaultValue:ea(x)?x[e]:void 0,...{joinArrays:!1,ns:a}}):n[e]=this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=k[e])}h=n}}else if(g&&N(p)&&Array.isArray(h))(h=h.join(p))&&(h=this.extendTranslation(h,e,t,n));else{let r=!1,a=!1;!this.isValidLookup(h)&&m&&(r=!0,h=x),this.isValidLookup(h)||(a=!0,h=o);let l=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:h,d=m&&x!==h&&this.options.updateMissing;if(a||r||d){if(this.logger.log(d?"updateKey":"missingKey",u,s,o,d?x:h),i){let e=this.resolve(o,{...t,keySeparator:!1});e&&e.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 e=[],n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);let r=(e,n,r)=>{let i=m&&r!==h?r:l;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,i,d,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,s,n,i,d,t),this.emit
2("missingKey",e,s,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{let n=this.pluralResolver.getSuffixes(e,t);w&&t[`defaultValue${this.options.pluralSeparator}zero`]&&0>n.indexOf(`${this.options.pluralSeparator}zero`)&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],o+n,t[`defaultValue${n}`]||x)})}):r(e,o,x))}h=this.extendTranslation(h,e,t,c,n),a&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${s}:${o}`),(a||r)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${o}`:o,r?h:void 0))}return r?(c.res=h,c.usedParams=this.getUsedParamsDetails(t),c):h}extendTranslation(e,t,n,r,i){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let s=N(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let u=n.replace&&!N(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),s){let t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return i?.[0]!==r[0]||n.context?o.translate(...r,t):(o.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null)},n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,s=N(a)?[a]:a;return null!=e&&s?.length&&!1!==n.applyPostProcessor&&(e=ei.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let s=this.extractFromKey(e,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));
2let c=void 0!==a.count&&!N(a.count),h=c&&!a.ordinal&&0===a.count,d=void 0!==a.context&&(N(a.context)||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(o=e,!eo[`${f[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(eo[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),f.forEach(n=>{let o;if(this.isValidLookup(t))return;i=n;let s=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,u,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));let t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(s.push(u+e),a.ordinal&&0===e.indexOf(r)&&s.push(u+e.replace(r,this.options.pluralSeparator)),h&&s.push(u+t)),d){let n=`${u}${this.options.contextSeparator}${a.context}`;s.push(n),c&&(s.push(n+e),a.ordinal&&0===e.indexOf(r)&&s.push(n+e.replace(r,this.options.pluralSeparator)),h&&s.push(n+t))}}for(;o=s.pop();)this.isValidLookup(t)||(r=o,t=this.getResource(n,e,o,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&!N(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class eu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=et.create("languageUtils")}getScriptPartFromCode(e){if(!(e=X(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=X(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(N(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),N(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];
2return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return N(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):N(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&i(this.formatLanguageCode(e))}),r}}let el={zero:0,one:1,two:2,few:3,many:4,other:5},ec={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class eh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=et.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=X("dev"===e?"en":e),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{t=new Intl.PluralRules(r,{type:i})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ec;if(!e.match(/-|_/))return ec;let r=this.languageUtils.getLanguagePartFromCode(e);t=this.getRule(r,n)}return this.pluralRulesCache[o]=t,t}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>el[e]-el[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let ed=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=void 0!==(r=z(e,n))?r:z(t,n);return!a&&o&&N(n)&&void 0===(a=J(e,n,i))&&(a=J(t,n,i)),a};class ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=et.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:h,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:Y,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):d||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>
2e?.source===t?(e.lastIndex=0,e):RegExp(t,"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,t,n,r){let i,o,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(0>e.indexOf(this.formatSeparator)){let i=ed(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(ed(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:o})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(a=0;i=t.regex.exec(e);){let n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof l){let t=l(e,i,r);o=N(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else if(c){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o="";else N(o)||this.useRawValueToEscape||(o=$(o));let s=t.safeValue(o);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),o=`{${r[1]}`;e=r[0];let a=(o=this.interpolate(o,i)).match(/'/g),s=o.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];(i=(i={...o}).replace&&!N(i.replace)?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){let e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),s=e,u=!0}if((r=t(a.call(this,n[1].trim(),i),i))&&n[0]===e&&!N(r))return r;N(r)||(r=$(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=s.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}let ep=e=>{let t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let a=r+JSON.stringify(o),s=t[a];return s||(s=e(X(r),i),t[a]=s),s(n)}};class eg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=et.create("formatter"),this.options=e,this.formats={number:ep((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:ep((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:ep((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:ep((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:ep((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ep(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(e=>e.indexOf(")")>-1)){let e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>
2{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);"currency"===t&&0>i.indexOf(":")?n.currency||(n.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?n.range||(n.range=i.trim()):i.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{let a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...o,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class ey extends en{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=et.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?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},o={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,r=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let a={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:i,k:o}=U(e,t,Object);i[o]=i[o]||[],i[o].push(n)}
2)(n.loaded,[i],o),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:o});this.readingCalls++;let a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,o)},i):o(a,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?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();N(e)&&(e=this.languageUtils.toResolveHierarchy(e)),N(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...o,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let i;(i=5===u.length?u(e,t,n,r,s):u(e,t,n,r))&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let em=()=>({debug:!1,initAsync:!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:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),N(e[1])&&(t.defaultValue=e[1]),N(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ev=e=>(N(e.ns)&&(e.ns=[e.ns]),N(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),N(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),eb=()=>{};class ew extends en{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=ev(e),this.services={},this.logger=et,this.modules={external:[]},(e=>
2{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(N(t.ns)?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let r=em();this.options={...r,...this.options,...ev(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);let i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?et.init(i(this.modules.logger),this.options):et.init(null,this.options),t=this.modules.formatter?this.modules.formatter:eg;let n=new eu(this.options);this.store=new er(this.options.resources,this.options);let o=this.services;o.logger=et,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new eh(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(o.formatter=i(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new ef(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new ey(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)}),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new es(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=eb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[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(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let o=B(),a=()=>{let e=(e,t)=>{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),o.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eb,n=t,r=N(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e
2=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=B();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=eb),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ei.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=B();this.emit("languageChanging",e);let i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n=N(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,e=>{o(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;let i=function(e,t){let o,a;if("object"!=typeof t){for(var s=arguments.length,u=Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([e,t].concat(u))}else o={...t};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);let c=r.options.keySeparator||".";return a=o.keyPrefix&&Array.isArray(e)?e.map(e=>`${o.keyPrefix}${c}${e}`):o.keyPrefix?`${o.keyPrefix}${c}${e}`:e,r.t(a,o)};return N(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
2if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let o=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!r||o(i,e)))}loadNamespaces(e,t){let n=B();return this.options.ns?(N(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=B();N(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){return(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),e)?["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"].indexOf((this.services?.languageUtils||new eu(em())).getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ew(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eb,n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},i=new ew(r);return(void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new er(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),{})),{}),r),i.services.resourceStore=i.store),i.translator=new es(i.services,r),i.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit(e,...n)}),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let ex=ew.createInstance();ex.createInstance=ew.createInstance,ex.createInstance,ex.dir,ex.init,ex.loadResources,ex.reloadResources,ex.use,ex.changeLanguage,ex.getFixedT,ex.t,ex.exists,ex.setDefaultNamespace,ex.hasLoadedNamespace,ex.loadNamespaces,ex.loadLanguages,e.i(158708);var ek=e.i(25086);let e_={en:{translation:k.default,common:_.default,faq:S.default,terms:O.default,privacy:C.default},ko:{translation:A.default,common:P.default,faq:E.default,terms:j.default,privacy:D.default},"zh-CN":{translation:I.default,common:R.default,faq:K.default,terms:L.default,privacy:T.default}},eS=localStorage.getItem("i18nextLng");if(!ex.isInitialized){let e=ex.createInstance();e.use(x),e.use(ek.initReactI18next).init({resources:e_,lng:eS||"en",fallbackLng:"en",ns:["translation","common","faq","terms","privacy"],defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]},react:{useSuspense:!1}}),Object.assign(ex,e)}e.s(["default",0,ex],383627)},392602,(e,t,n)=>{e.e,t.exports=function(){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]}
2)instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)},n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g,o=Object.keys,a=Array.isArray;function s(e,t){return"object"!=typeof t||o(t).forEach(function(n){e[n]=t[n]}),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,l={}.hasOwnProperty;function c(e,t){return l.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(u(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach(function(n){f(e,n,t[n])})}var d=Object.defineProperty;function f(e,t,n,r){d(e,t,s(n&&c(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function p(e){return{from:function(t){return e.prototype=Object.create(t.prototype),f(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}var g=Object.getOwnPropertyDescriptor,y=[].slice;function m(e,t,n){return y.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function x(e,t){if("string"==typeof t&&c(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=x(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:x(s,t.substr(a+1))}}function k(e,t,n){if(e&&void 0!==t&&!("isFrozen"in Object&&Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)k(e,t[r],n[r])}else{var o,s,u=t.indexOf(".");-1!==u?(o=t.substr(0,u),""===(s=t.substr(u+1))?void 0===n?a(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:k(u=(u=e[o])&&c(e,o)?u:e[o]={},s,n)):void 0===n?a(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function _(e){var t,n={};for(t in e)c(e,t)&&(n[t]=e[t]);return n}var S=[].concat;function O(e){return S.apply([],e)}var C="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(O([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return i[e]}),A=new Set(C.map(function(e){return i[e]})),P=null;function E(e){return P=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=P.get(t);if(n)return n;if(a(t)){n=[],P.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(A.has(t.constructor))n=t;else{var o,s=u(t);for(o in n=s===Object.prototype?{}:Object.create(s),P.set(t,n),t)c(t,o)&&(n[o]=e(t[o]))}return n}(e),P=null,e}var j={}.toString;function D(e){return j.call(e).slice(8,-1)}var I="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",R="symbol"==typeof I?function(e){var t;return null!=e&&(t=e[I])&&t.apply(e)}:function(){return null};function K(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var L={};function T(e){var t,n,r,i;if(1==arguments.length){if(a(e))return e.slice();if(this===L&&"string"==typeof e)return[e];if(i=R(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e||"number"!=typeof(t=e.length))return[e];for(n=Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var N="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},B=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],$=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(B),q={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 F(e,t){this.name=e,this.message=t}function M(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function U(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=M(e,t)}function V(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=M(e,this.failures)}p(F).from(Error).extend({toString:function(){return this.name+": "+this.message}}),p(U).from(F),p(V).from(F);var z=$.reduce(function(e,t){return e[t]=t+"Error",e},{}),H=$.reduce(function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=q[t]||n,this.inner=null)}return p(r).from(F),e[t]=r,e},{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var W=B.reduce(function(e,t){return e[t+"Error"]=H[t],e},{}),Y=$.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=H[t]),e},{});function Q(){}function G(e){return e}function J(e,t){return null==e||e===G?t:function(n){return t(e(n))}}function X(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Z(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;
2var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?X(r,this.onsuccess):r),i&&(this.onerror=this.onerror?X(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===Q?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?X(n,this.onsuccess):n),r&&(this.onerror=this.onerror?X(r,this.onerror):r)}}function et(e,t){return e===Q?t:function(n){var r=e.apply(this,arguments);s(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?X(i,this.onsuccess):i),o&&(this.onerror=this.onerror?X(o,this.onerror):o),void 0===r?void 0===n?void 0:n:s(r,n)}}function en(e,t){return e===Q?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function er(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}Y.ModifyError=U,Y.DexieError=F,Y.BulkError=V;var ei="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),eo={},C="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,u(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,u(t),e]}(),B=C[0],$=C[1],C=C[2],$=$&&$.then,ea=B&&B.constructor,es=!!C,eu=function(e,t){ey.push([e,t]),ec&&(queueMicrotask(eC),ec=!1)},el=!0,ec=!0,eh=[],ed=[],ef=G,ep={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Q,pgp:!1,env:{},finalize:Q},eg=ep,ey=[],em=0,ev=[];function eb(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=eg;if("function"!=typeof e){if(e!==eo)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ek(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eA();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof eb?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,e_(t)),r&&eP()}},ek.bind(null,t))}catch(e){ek(t,e)}}(this,e)}var ew={get:function(){var e=eg,t=eT;function n(n,r){var i=this,o=!e.global&&(e!==eg||t!==eT),a=o&&!eq(),s=new eb(function(t,s){eS(i,new ex(eH(n,e,o,a),eH(r,e,o,a),t,s,e))});return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=eo,n},set:function(e){f(this,"then",e&&e.prototype===eo?ew:{get:function(){return e},set:ew.set})}};function ex(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function ek(e,t){var n;ed.push(t),null===e._state&&(n=e._lib&&eA(),t=ef(t),e._state=!1,e._value=t,eh.some(function(t){return t._value===e._value})||eh.push(e),e_(e),n&&eP())}function e_(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)eS(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===em&&(++em,eu(function(){0==--em&&eE()},[]))}function eS(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++em,eu(eO,[n,e,t])}else e._listeners.push(t)}function eO(e,t,n){try{var r,i=t._value;!t._state&&ed.length&&(ed=[]),r=ei&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),t._state||-1!==ed.indexOf(i)||function(e){for(var t=eh.length;t;)if(eh[--t]._value===e._value)return eh.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--em&&eE(),--n.psd.ref||n.psd.finalize()}}function eC(){ez(ep,function(){eA()&&eP()})}function eA(){var e=el;return ec=el=!1,e}function eP(){var e,t,n;do for(;0<ey.length;)for(e=ey,ey=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<ey.length)ec=el=!0}function eE(){var e=eh;eh=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=ev.slice(0),n=t.length;n;)t[--n]()}function ej(e){return new eb(eo,!1,e)}function eD(e,t){var n=eg;return function(){var r=eA(),i=eg;
2try{return eU(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{eU(i,!1),r&&eP()}}}h(eb.prototype,{then:ew,_then:function(e,t){eS(this,new ex(null,null,e,t,eg))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[1];return"function"==typeof e?this.then(null,function(n){return(n instanceof e?t:ej)(n)}):this.then(null,function(n){return(n&&n.name===e?t:ej)(n)})},finally:function(e){return this.then(function(t){return eb.resolve(e()).then(function(){return t})},function(t){return eb.resolve(e()).then(function(){return ej(t)})})},timeout:function(e,t){var n=this;return e<1/0?new eb(function(r,i){var o=setTimeout(function(){return i(new H.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&f(eb.prototype,Symbol.toStringTag,"Dexie.Promise"),ep.env=eV(),h(eb,{all:function(){var e=T.apply(null,arguments).map(eF);return new eb(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return eb.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof eb?e:e&&"function"==typeof e.then?new eb(function(t,n){e.then(t,n)}):new eb(eo,!0,e)},reject:ej,race:function(){var e=T.apply(null,arguments).map(eF);return new eb(function(t,n){e.map(function(e){return eb.resolve(e).then(t,n)})})},PSD:{get:function(){return eg},set:function(e){return eg=e}},totalEchoes:{get:function(){return eT}},newPSD:eB,usePSD:ez,scheduler:{get:function(){return eu},set:function(e){eu=e}},rejectionMapper:{get:function(){return ef},set:function(e){ef=e}},follow:function(e,t){return new eb(function(n,r){return eB(function(t,n){var r=eg;r.unhandleds=[],r.onunhandled=n,r.finalize=X(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},ev.push(function t(){e(),ev.splice(ev.indexOf(t),1)}),++em,eu(function(){0==--em&&eE()},[])},r.finalize),e()},t,n,r)})}}),ea&&(ea.allSettled&&f(eb,"allSettled",function(){var e=T.apply(null,arguments).map(eF);return new eb(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return eb.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),ea.any&&"undefined"!=typeof AggregateError&&f(eb,"any",function(){var e=T.apply(null,arguments).map(eF);return new eb(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,o){return eb.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(AggregateError(i))})})})}),ea.withResolvers&&(eb.withResolvers=ea.withResolvers));var eI={awaits:0,echoes:0,id:0},eR=0,eK=[],eL=0,eT=0,eN=0;function eB(e,t,n,r){var i=eg,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++eN,ep.env,o.env=es?{Promise:eb,PromiseProp:{value:eb,configurable:!0,writable:!0},all:eb.all,race:eb.race,allSettled:eb.allSettled,any:eb.any,resolve:eb.resolve,reject:eb.reject}:{},t&&s(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=ez(o,e,n,r),0===o.ref&&o.finalize(),r}function e$(){return eI.id||(eI.id=++eR),++eI.awaits,eI.echoes+=100,eI.id}function eq(){return!!eI.awaits&&(0==--eI.awaits&&(eI.id=0),eI.echoes=100*eI.awaits,!0)}function eF(e){return eI.echoes&&e&&e.constructor===ea?(e$(),e.then(function(e){return eq(),e},function(e){return eq(),eY(e)})):e}function eM(){var e=eK[eK.length-1];eK.pop(),eU(e,!1)}function eU(e,t){var n,r=eg;(t?!eI.echoes||eL++&&e===eg:!eL||--eL&&e===eg)||queueMicrotask(t?(function(e){++eT,eI.echoes&&0!=--eI.echoes||(eI.echoes=eI.awaits=eI.id=0),eK.push(eg),eU(e,!0)}).bind(null,e):eM),e!==eg&&(eg=e,r===ep&&(ep.env=eV()),es&&(n=ep.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function eV(){var e=i.Promise;return es?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function ez(e,t,n,r,i){var o=eg;try{return eU(e,!0),t(n,r,i)}finally{eU(o,!1)}}function eH(e,t,n,r){return"function"!=typeof e?e:function(){var i=eg;n&&e$(),eU(t,!0);try{return e.apply(this,arguments)}finally{eU(i,!1),r&&queueMicrotask(eq)}}}function eW(e){Promise===ea&&0===eI.echoes?0===eL?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+$).indexOf("[native code]")&&(e$=eq=Q);var eY=eb.reject,eQ=String.fromCharCode(65535),eG="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>
2.",eJ="String expected.",eX=[],eZ="__dbnames",e0="readonly",e1="readwrite";function e2(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var e3={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function e8(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=E(t))[e],t}}function e4(){throw H.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function e5(e,t){try{var n=e9(e),r=e9(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(e6(e),e6(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var a=e5(e[o],t[o]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function e9(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=D(e))?"binary":e}function e6(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function e7(e,t,n){var r=e.schema.yProps;return r?(t&&0<n.numFailures&&(t=t.filter(function(e,t){return!n.failures[t]})),Promise.all(r.map(function(n){return n=n.updatesTable,t?e.db.table(n).where("k").anyOf(t).delete():e.db.table(n).clear()})).then(function(){return n})):n}var te=(tt.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(a(n))return r(r([],a(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(a(i))return a(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw TypeError("Invalid subtrahend ".concat(i))}return(n=null==(n=t.replacePrefix)?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},tt);function tt(e){this["@@propmod"]=e}function tn(e,t){for(var n=o(t),r=n.length,i=!1,a=0;a<r;++a){var s=n[a],u=t[s],l=x(e,s);u instanceof te?(k(e,s,u.execute(l)),i=!0):l!==u&&(k(e,s,u),i=!0)}return i}var tr=(ti.prototype._trans=function(e,t,n){var r=this._tx||eg.trans,i=this.name,o=ei&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function a(e,n,r){if(!r.schema[i])throw new H.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var s=eA();try{var u=r&&r.db._novip===this.db._novip?r===eg.trans?r._promise(e,a,n):eB(function(){return r._promise(e,a,n)},{trans:r,transless:eg.transless||eg}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||eg.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===z.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,i)})):eY(o)}return o._promise(n,function(e,t){return eB(function(){return eg.trans=o,i(e,t,o)})}).then(function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then(function(){return e})})}if(t._state.openComplete)return eY(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return eY(new H.DatabaseClosed);t.open().catch(Q)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],a);return o&&(u._consoleTask=o,u=u.catch(function(e){return console.trace(e),eY(e)})),u}finally{s&&eP()}},ti.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?eY(new H.Type("Invalid argument to Table.get()")):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)}
2)}).then(t)},ti.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(a(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==eQ){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}!n&&ei&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var i=this.schema.idxByName,s=t.reduce(function(t,n){var r=t[0],o=t[1],t=i[n],s=e[n];return[r||t,r||!t?e2(o,t&&t.multi?function(e){return a(e=x(e,n))&&e.some(function(e){return 0===e5(s,e)})}:function(e){return 0===e5(s,x(e,n))}):o]},[null,null]),r=s[0],s=s[1];return r?this.where(r.name).equals(e[r.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")},ti.prototype.filter=function(e){return this.toCollection().and(e)},ti.prototype.count=function(e){return this.toCollection().count(e)},ti.prototype.offset=function(e){return this.toCollection().offset(e)},ti.prototype.limit=function(e){return this.toCollection().limit(e)},ti.prototype.each=function(e){return this.toCollection().each(e)},ti.prototype.toArray=function(e){return this.toCollection().toArray(e)},ti.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ti.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,a(e)?"[".concat(e.join("+"),"]"):e))},ti.prototype.reverse=function(){return this.toCollection().reverse()},ti.prototype.mapToClass=function(e){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof e4&&(function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=e),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},e=o);for(var a=new Set,s=e.prototype;s;s=u(s))Object.getOwnPropertyNames(s).forEach(function(e){return a.add(e)});function l(t){if(!t)return t;var n,r=Object.create(e.prototype);for(n in t)if(!a.has(n))try{r[n]=t[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=l,this.hook("reading",l),e},ti.prototype.defineClass=function(){return this.mapToClass(function(e){s(this,e)})},ti.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=e8(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})}).then(function(e){return e.numFailures?eb.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{k(e,o,t)}catch(e){}return t})},ti.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans("readwrite",function(i){return n.core.get({trans:i,key:e}).then(function(o){var a=null!=o?o:{};return tn(a,t),r&&k(a,r,e),n.core.mutate({trans:i,type:"put",values:[a],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then(function(e){return e.numFailures?eb.reject(e.failures[0]):!!o})})})},ti.prototype.update=function(e,t){return"object"!=typeof e||a(e)?this.where(":id").equals(e).modify(t):void 0===(e=x(e,this.schema.primKey.keyPath))?eY(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},ti.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,a=e;return o&&i&&(a=e8(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?eb.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{k(e,o,t)}catch(e){}return t})},ti.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",ke
2ys:[e]}).then(function(n){return e7(t,[e],n)}).then(function(e){return e.numFailures?eb.reject(e.failures[0]):void 0})})},ti.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:e3}).then(function(t){return e7(e,null,t)})}).then(function(e){return e.numFailures?eb.reject(e.failures[0]):void 0})},ti.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},ti.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,n=n.keyPath;if(n&&i)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,n=n&&a?e.map(e8(n)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:n,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,e=e.failures;if(0===t)return o?n:i;throw new V("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)})})},ti.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,a=n.auto,n=n.keyPath;if(n&&i)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,n=n&&a?e.map(e8(n)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:n,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,e=e.failures;if(0===t)return o?n:i;throw new V("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)})})},ti.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),i=e.map(function(e){return e.changes}),o=[];return this._trans("readwrite",function(a){return n.getMany({trans:a,keys:r,cache:"clone"}).then(function(s){var u=[],l=[];e.forEach(function(e,n){var r=e.key,i=e.changes,a=s[n];if(a){for(var c=0,h=Object.keys(i);c<h.length;c++){var d=h[c],f=i[d];if(d===t.schema.primKey.keyPath){if(0!==e5(f,r))throw new H.Constraint("Cannot update primary key in bulkUpdate()")}else k(a,d,f)}o.push(n),u.push(r),l.push(a)}});var c=u.length;return n.mutate({trans:a,type:"put",keys:u,values:l,updates:{keys:r,changeSpecs:i}}).then(function(e){var n=e.numFailures,r=e.failures;if(0===n)return c;for(var i=0,a=Object.keys(r);i<a.length;i++){var s,u=a[i],l=o[Number(u)];null!=l&&(s=r[u],delete r[u],r[l]=s)}throw new V("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(c," operations failed"),r)})})})},ti.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e}).then(function(n){return e7(t,e,n)})}).then(function(e){var r=e.numFailures,i=e.lastResult,e=e.failures;if(0===r)return i;throw new V("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)})},ti);function ti(){}function to(e){function t(t,r){if(r){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return t;function s(e,r,i){if("object"!=typeof e){r=r||en;var u={subscribers:[],fire:i=i||Q,subscribe:function(e){-1===u.subscribers.indexOf(e)&&(u.subscribers.push(e),u.fire=r(u.fire,e))},unsubscribe:function(e){u.subscribers=u.subscribers.filter(function(t){return t!==e}),u.fire=u.subscribers.reduce(r,i)}};return n[e]=t[e]=u}o(e).forEach(function(t){var n=e[t];if(a(n))s(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new H.InvalidArgument("Invalid event config");var r=s(t,G,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];
2r.subscribers.forEach(function(e){w(function(){e.apply(null,t)})})})}})}}function ta(e,t){return p(t).from({prototype:e}),t}function ts(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function tu(e,t){e.filter=e2(e.filter,t)}function tl(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return e2(r(),t())}:t,e.justLimit=n&&!r}function tc(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new H.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function th(e,t,n){var r=tc(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function td(e,t,n,r){var i=e.replayFilter?e2(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,n,r){var a,s;i&&!i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||("[object ArrayBuffer]"==(s=""+(a=n.primaryKey))&&(s=""+new Uint8Array(a)),c(o,s)||(o[s]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(a,n),tf(th(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return tf(th(e,r,n),e2(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function tf(e,t,n,r){var i=eD(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=Q},function(t){e.fail(t),n=Q})||i(e.value,e,function(e){return n=e}),n()})})}var tp=(tg.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,eY.bind(null,n.error)):n.table._trans("readonly",e).then(t)},tg.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,eY.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},tg.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=e2(t.algorithm,e)},tg.prototype._iterate=function(e,t){return td(this._ctx,e,t,this._ctx.table.core)},tg.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&s(n,e),t._ctx=n,t},tg.prototype.raw=function(){return this._ctx.valueMapper=null,this},tg.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return td(t,e,n,t.table.core)})},tg.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(ts(n,!0))return r.count({trans:e,query:{index:tc(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return td(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},tg.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){return e5(o(e,i),o(t,i))*a}return this.toArray(function(e){return e.sort(s)}).then(t)},tg.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&ts(n,!0)&&0<n.limit){var r=n.valueMapper,i=tc(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){return e=e.result,r?e.map(r):e})}var o=[];return td(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},tg.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,ts(t)?tl(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):tl(t,function(){var t=e;return function(){return--t<0}})),this},tg.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tl(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},tg.prototype.until=function(e,t){return tu(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},tg.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},tg.prototype.last=function(e){return this.reverse().first(e)},tg.prototype.filter=function(e){var t;return tu(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=e2(t.isMatch,e),this},tg.prototype.and=function(e){return this.filter(e)},tg.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},tg.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},tg.prototype.desc=function(){return this.reverse()},tg.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},tg.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},tg.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},tg.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},tg.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&ts(t,!0)&&0<t.limit)return this._read(function(e){var n=tc(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},tg.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},tg.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},tg.prototype.lastKey=function(e){return this.reverse().firstKey(e)},tg.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return tu(this._ctx,function(e){var n=e.primaryKey.toString(),e=c(t,n);return t[n]=!0,!e}),this},tg.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var i="function"==typeof e?e:function(t){return tn(t,e)},a=n.table.core,s=a.schema.primaryKey,u=s.outbound,l=s.extractKey,c=200,s=t.db._options.modifyChunkSize;function h(e,t){var n=t.failures,t=t.numFailures;f+=e-t;for(var r=0,i=o(n);r<i.length;r++){var a=i[r];d.push(n[a])}}s&&(c="object"==typeof s?s[a.name]||s["*"]||200:s);var d=[],f=0,p=[],g=e===ty;return t.clone().primaryKeys().then(function(t){var o=ts(n)&&n.limit===1/0&&("function"!=typeof e||g)&&{index:n.index,range:n.range};return(function s(d){var f=Math.min(c,t.length-d),p=t.slice(d,d+f);return(g?Promise.resolve([]):a.getMany({trans:r,keys:p,cache:"immutable"})).then(function(y){var m=[],v=[],b=u?[]:null,w=g?p:[];if(!g)for(var x=0;x<f;++x){var k=y[x],_={value:E(k),primKey:t[d+x]};!1!==i.call(_,_.value,_)&&(null==_.value?w.push(t[d+x]):u||0===e5(l(k),l(_.value))?(v.pu
2sh(_.value),u&&b.push(t[d+x])):(w.push(t[d+x]),m.push(_.value)))}return Promise.resolve(0<m.length&&a.mutate({trans:r,type:"add",values:m}).then(function(e){for(var t in e.failures)w.splice(parseInt(t),1);h(m.length,e)})).then(function(){return(0<v.length||o&&"object"==typeof e)&&a.mutate({trans:r,type:"put",keys:b,values:v,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<d}).then(function(e){return h(v.length,e)})}).then(function(){return(0<w.length||o&&g)&&a.mutate({trans:r,type:"delete",keys:w,criteria:o,isAdditionalChunk:0<d}).then(function(e){return e7(n.table,w,e)}).then(function(e){return h(w.length,e)})}).then(function(){return t.length>d+f&&s(d+c)})})})(0).then(function(){if(0<d.length)throw new U("Error modifying one or more objects",d,f,p);return t.length})})})},tg.prototype.delete=function(){var e=this._ctx,t=e.range;return ts(e)&&!e.table.schema.yProps&&(e.isPrimKey||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures,e=e.numFailures;if(e)throw new U("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-e);return r-e})})}):this.modify(ty)},tg);function tg(){}var ty=function(e,t){return t.value=null};function tm(e,t){return e<t?-1:+(e!==t)}function tv(e,t){return t<e?-1:+(e!==t)}function tb(e,t,n){return(e=e instanceof tS?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function tw(e){return new e.Collection(e,function(){return t_("")}).limit(0)}function tx(e,t,n,r){var i,o,a,s,u,l,c,h=n.length;if(!n.every(function(e){return"string"==typeof e}))return tb(e,eJ);function d(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},a="next"===e?tm:tv;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),u=t.map(function(e){return e.lower}),c="next"===(l=e)?"":r}d("next"),(e=new e.Collection(e,function(){return tk(s[0],u[h-1]+r)}))._ondirectionchange=function(e){d(e)};var f=0;return e._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var d=o(i);if(t(d,u,f))return!0;for(var p=null,g=f;g<h;++g){var y=function(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var l=t[u];if(l!==r[u])return 0>i(e[u],n[u])?e.substr(0,u)+n[u]+n.substr(u+1):0>i(e[u],r[u])?e.substr(0,u)+r[u]+n.substr(u+1):0<=s?e.substr(0,s)+t[s]+n.substr(s+1):null;0>i(e[u],l)&&(s=u)}return a<r.length&&"next"===o?e+n.substr(e.length):a<e.length&&"prev"===o?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}(i,d,s[g],u[g],a,l);null===y&&null===p?f=g+1:(null===p||0<a(p,y))&&(p=y)}return n(null!==p?function(){e.continue(p+c)}:r),!1}),e}function tk(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function t_(e){return{type:1,lower:e,upper:e}}var tS=(Object.defineProperty(tO.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),tO.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?tw(this):new this.Collection(this,function(){return tk(e,t,!n,!r)})}catch(e){return tb(this,eG)}},tO.prototype.equals=function(e){return null==e?tb(this,eG):new this.Collection(this,function(){return t_(e)})},tO.prototype.above=function(e){return null==e?tb(this,eG):new this.Collection(this,function(){return tk(e,void 0,!0)})},tO.prototype.aboveOrEqual=function(e){return null==e?tb(this,eG):new this.Collection(this,function(){return tk(e,void 0,!1)})},tO.prototype.below=function(e){return null==e?tb(this,eG):new this.Collection(this,function(){return tk(void 0,e,!1,!0)})},tO.prototype.belowOrEqual=function(e){return null==e?tb(this,eG):new this.Collection(this,function(){return tk(void 0,e)})},tO.prototype.startsWith=function(e){return"string"!=typeof e?tb(this,eJ):this.between(e,e+eQ,!0,!0)},tO.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tx(this,function(e,t){return 0===e.indexOf(t[0])},[e],eQ)},tO.prototype.equalsIgnoreCase=function(e){return tx(this,function(e,t){return e===t[0]},[e],"")},tO.prototype.anyOfIgnoreCase=function(){var e=T.apply(L,arguments);return 0===e.length?tw(this):tx(this,function(e,t){return -1!==t.indexOf(e)},e,"")},tO.prototype.startsWithAnyOfIgnoreCase=function(){var e=T.apply(L,arguments);return 0===e.length?tw(this):tx(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,eQ)},tO.prototype.anyOf=function(){var e=this,t=T.apply(L,arguments),n=this._cmp;try{t.sort(n)}catch(e){return tb(this,eG)}if(0===t.length)return tw(this);var r=new this.Collection(this,function(){return tk(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var a=e.key;0<n(a,t[i]);)if(++i===t.length)return r(o),!1;
2return 0===n(a,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},tO.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},tO.prototype.noneOf=function(){var e=T.apply(L,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return tb(this,eG)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},tO.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return tw(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=i(e[0],e[1])}))return tb(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var u,l=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,h=i;function d(e,t){return h(e[0],t[0])}try{(u=e.reduce(function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(0>r(t[0],o[1])&&0<r(t[1],o[0])){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return tb(this,eG)}var f=0,p=c?function(e){return 0<i(e,u[f][1])}:function(e){return 0<=i(e,u[f][1])},g=l?function(e){return 0<o(e,u[f][0])}:function(e){return 0<=o(e,u[f][0])},y=p,e=new this.Collection(this,function(){return tk(u[0][0],u[u.length-1][1],!l,!c)});return e._ondirectionchange=function(e){h="next"===e?(y=p,i):(y=g,o),u.sort(d)},e._addAlgorithm(function(e,t,r){for(var o=e.key;y(o);)if(++f===u.length)return t(r),!1;return!p(o)&&!g(o)||(0===n._cmp(o,u[f][1])||0===n._cmp(o,u[f][0])||t(function(){h===i?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),e},tO.prototype.startsWithAnyOf=function(){var e=T.apply(L,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?tw(this):this.inAnyRange(e.map(function(e){return[e,e+eQ]})):tb(this,"startsWithAnyOf() only works with strings")},tO);function tO(){}function tC(e){return eD(function(t){return tA(t),e(t.target.error),!1})}function tA(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tP="storagemutated",tE="x-storagemutated-1",tj=to(null,tP),tD=(tI.prototype._lock=function(){return b(!eg.global),++this._reculock,1!==this._reculock||eg.global||(eg.lockOwnerFor=this),this},tI.prototype._unlock=function(){if(b(!eg.global),0==--this._reculock)for(eg.global||(eg.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{ez(e[1],e[0])}catch(e){}}return this},tI.prototype._locked=function(){return this._reculock&&eg.lockOwnerFor!==this},tI.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new H.DatabaseClosed(r);case"MissingAPIError":throw new H.MissingAPI(r.message,r);default:throw new H.OpenFailed(r)}if(!this.active)throw new H.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=eD(function(n){tA(n),t._reject(e.error)}),e.onabort=eD(function(n){tA(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eD(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&tj.storagemutated.fire(e.mutatedParts)}),this},tI.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return eY(new H.ReadOnly("Transaction is readonly"));if(!this.active)return eY(new H.TransactionInactive);if(this._locked())return new eb(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},eg])});if(n)return eB(function(){var e=new eb(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new eb(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},tI.prototype._root=function(){return this.parent?this.parent._root():this},tI.prototype.waitFor=function(e){var t,n=this._root(),r=eb.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new eb(function(e,t){r.then(function(t){return n._waitingQueue.push(eD(e.bind(null,t)))},function(e){return n._waitingQueue.push(eD(t.bind(null,e)))}).finally(function(){n._waitingFor===i&&(n._waitingFor=null)})})},tI.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new H.Abort))},tI.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(c(t,e))return t[e];var n=this.schema[e];if(!n)throw new H.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},tI);function tI(){}function tR(e,t,n,r,i,o,a,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+tK(t),type:s}}function tK(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function tL(e,t,n){var r;return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e},{}))}}var tT=function(e){try{return e.only([[]]),tT=function(){return[[]]},[[]]}catch(e){return tT=function(){return eQ},eQ}};function tN(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return x(t,e)}:function(t){return x(t,e)}}function tB(e){return[].slice.call(e)}var t$=0;function tq(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function tF(e,t){var r,i,o,s,u=t.db,t=(r=e._middlewares,i=e._deps,o=t,s=i.IDBKeyRange,i.indexedDB,{dbcore:(o=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen,e=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}var i,o,s=(i=n,o=tB(e.objectStoreNames),{schema:{name:e.name,tables:o.map(function(e){return i.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=a(t),i={},n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:tN(t)},indexes:tB(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,e=e.keyPath,r={name:t,compound:a(e),keyPath:e,unique:n,multiEntry:r,extractKey:tN(e)};return i[tq(e)]=r}),getIndexByKeyPath:function(e){return i[tq(e)]}};return i[":id"]=n.primaryKey,null!=t&&(i[tq(t)]=n.primaryKey),n})},hasGetAll:0<o.length&&"getAll"in i.objectStore(o[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),n=s.schema,u=s.hasGetAll,s=n.tables.map(function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,i=e.type,o=e.keys,a=e.values,s=e.range;return new Promise(function(e,u){e=eD(e);var l=n.objectStore(t),c=null==l.keyPath,h="put"===i||"add"===i;if(!h&&"delete"!==i&&"deleteRange"!==i)throw Error("Invalid operation type: "+i);var d,f=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw Error("Given keys array must have same length as given values array.");if(0===f)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function p(e){++m,tA(e)}var g=[],y=[],m=0;if("deleteRange"===i){if(4===s.type)return e({numFailures:m,failures:y,results:[],lastResult:void 0});3===s.type?g.push(d=l.clear()):g.push(d=l.delete(r(s)))}else{var c=h?c?[a,o]:[a,null]:[o,null],v=c[0],b=c[1];if(h)for(var w=0;w<f;
2++w)g.push(d=b&&void 0!==b[w]?l[i](v[w],b[w]):l[i](v[w])),d.onerror=p;else for(w=0;w<f;++w)g.push(d=l[i](v[w])),d.onerror=p}function x(t){t=t.target.result,g.forEach(function(e,t){return null!=e.error&&(y[t]=e.error)}),e({numFailures:m,failures:y,results:"delete"===i?o:g.map(function(e){return e.result}),lastResult:t})}d.onerror=function(e){p(e),x(e)},d.onsuccess=x})},getMany:function(e){var n=e.trans,r=e.keys;return new Promise(function(e,i){e=eD(e);for(var o,a=n.objectStore(t),s=r.length,u=Array(s),l=0,c=0,h=function(t){u[(t=t.target)._pos]=t.result,++c===l&&e(u)},d=tC(i),f=0;f<s;++f)null!=r[f]&&((o=a.get(r[f]))._pos=f,o.onsuccess=h,o.onerror=d,++l);0===l&&e(u)})},get:function(e){var n=e.trans,r=e.key;return new Promise(function(e,i){e=eD(e);var o=n.objectStore(t).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=tC(i)})},query:function(e){return new Promise(function(n,i){n=eD(n);var o,a,s,l=e.trans,c=e.values,h=e.limit,d=e.query,f=h===1/0?void 0:h,p=d.index,d=d.range,l=l.objectStore(t),p=p.isPrimaryKey?l:l.index(p.name),d=r(d);if(0===h)return n({result:[]});u?((f=c?p.getAll(d,f):p.getAllKeys(d,f)).onsuccess=function(e){return n({result:e.target.result})},f.onerror=tC(i)):(o=0,a=!c&&"openKeyCursor"in p?p.openKeyCursor(d):p.openCursor(d),s=[],a.onsuccess=function(e){var t=a.result;return t?(s.push(c?t.value:t.primaryKey),++o===h?n({result:s}):void t.continue()):n({result:s})},a.onerror=tC(i))})},openCursor:function(e){var n=e.trans,i=e.values,o=e.query,a=e.reverse,s=e.unique;return new Promise(function(e,u){e=eD(e);var l=o.index,c=o.range,h=n.objectStore(t),h=l.isPrimaryKey?h:h.index(l.name),l=a?s?"prevunique":"prev":s?"nextunique":"next",d=!i&&"openKeyCursor"in h?h.openKeyCursor(r(c),l):h.openCursor(r(c),l);d.onerror=tC(u),d.onsuccess=eD(function(t){var r,i,o,a,s=d.result;s?(s.___id=++t$,s.done=!1,r=s.continue.bind(s),i=(i=s.continuePrimaryKey)&&i.bind(s),o=s.advance.bind(s),a=function(){throw Error("Cursor not stopped")},s.trans=n,s.stop=s.continue=s.continuePrimaryKey=s.advance=function(){throw Error("Cursor not started")},s.fail=eD(u),s.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},s.start=function(e){function t(){if(d.result)try{e()}catch(e){s.fail(e)}else s.done=!0,s.start=function(){throw Error("Cursor behind last entry")},s.stop()}var n=new Promise(function(e,t){e=eD(e),d.onerror=tC(t),s.fail=t,s.stop=function(t){s.stop=s.continue=s.continuePrimaryKey=s.advance=a,e(t)}});return d.onsuccess=eD(function(e){d.onsuccess=t,t()}),s.continue=r,s.continuePrimaryKey=i,s.advance=o,t(),n},e(s)):e(null)},u)})},count:function(e){var n=e.query,i=e.trans,o=n.index,a=n.range;return new Promise(function(e,n){var s=i.objectStore(t),u=o.isPrimaryKey?s:s.index(o.name),s=r(a),u=s?u.count(s):u.count();u.onsuccess=eD(function(t){return e(t.target.result)}),u.onerror=tC(n)})}}}),l={};return s.forEach(function(e){return l[e.name]=e}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!l[e])throw Error("Table '".concat(e,"' not found"));return l[e]},MIN_KEY:-1/0,MAX_KEY:tT(t),schema:n}}(u,s,o),r.dbcore.reduce(function(e,t){return t=t.create,n(n({},e),t(e))},o))});e.core=t.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function tM(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=function e(t,n){return g(t,n)||(t=u(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?f(t,n,{get:function(){return this.table(n)},set:function(e){d(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function tU(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function tV(e,t){return e._cfg.version-t._cfg.version}function tz(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var a={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)a.recreate=!0,r.change.push(a);else{var s=i.idxByName,u=o.idxByName,l=void 0;for(l in s)u[l]||a.del.push(l);for(l in u){var c=s[l],h=u[l];c?c.src!==h.src&&a.change.push(h):a.add.push(h)}(0<a.del.length||0<a.add.length||0<a.change.length)&&r.change.push(a)}}
2else r.add.push([n,o])}return r}function tH(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return tY(i,e)}),i}function tW(e,t){o(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(ei&&console.debug("Dexie: Creating missing table",n),tH(t,n,e[n].primKey,e[n].indexes))})}function tY(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function tQ(e,t,n){var r={};return m(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=tR(tK(u=t.keyPath),u||"",!0,!1,!!t.autoIncrement,u&&"string"!=typeof u,!0),o=[],a=0;a<t.indexNames.length;++a){var s=t.index(t.indexNames[a]),u=s.keyPath,s=tR(s.name,u,!!s.unique,!!s.multiEntry,!1,u&&"string"!=typeof u,!1);o.push(s)}r[e]=tL(e,i,o)}),r}function tG(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var a=r[o],s=n.objectStore(a);e._hasGetAll="getAll"in s;for(var u=0;u<s.indexNames.length;++u){var l=s.indexNames[u],c=s.index(l).keyPath,h="string"==typeof c?c:"["+m(c).join("+")+"]";!t[a]||(c=t[a].idxByName[h])&&(c.name=l,delete t[a].idxByName[h],t[a].idxByName[l]=c)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function tJ(e){return e.split(",").map(function(e,t){var n=e.split(":"),r=null==(i=n[1])?void 0:i.trim(),i=(e=n[0].trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(i)?i.match(/^\[(.*)\]$/)[1].split("+"):i;return tR(i,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),a(n),0===t,r)})}var tX=(tZ.prototype._createTableSchema=tL,tZ.prototype._parseIndexSyntax=tJ,tZ.prototype._parseStoresSpec=function(e,t){var n=this;o(e).forEach(function(r){if(null!==e[r]){var i=n._parseIndexSyntax(e[r]),o=i.shift();if(!o)throw new H.Schema("Invalid schema for table "+r+": "+e[r]);if(o.unique=!0,o.multi)throw new H.Schema("Primary key cannot be multiEntry*");i.forEach(function(e){if(e.auto)throw new H.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new H.Schema("Index must have a name and cannot be an empty string")}),i=n._createTableSchema(r,o,i),t[r]=i}})},tZ.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?s(this._cfg.storesSource,e):e;var e=t._versions,n={},r={};return e.forEach(function(e){s(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,tU(t,[t._allTables,t,t.Transaction.prototype]),tM(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},tZ.prototype.upgrade=function(e){return this._cfg.contentUpgrade=er(this._cfg.contentUpgrade||Q,e),this},tZ);function tZ(){}function t0(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new nC(eZ,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function t1(e){return e&&"function"==typeof e.databases}function t2(e){return eB(function(){return eg.letThrough=!0,e()})}function t3(e){return!("from"in e)}var t8=function(e,t){if(!this){var n=new t8;return e&&"d"in e&&s(n,e),n}s(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function t4(e,t,n){var r=e5(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(t3(e))return s(e,{from:t,to:n,d:1});var i=e.l,r=e.r;if(0>e5(n,e.from))return i?t4(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},t7(e);if(0<e5(t,e.to))return r?t4(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},t7(e);0>e5(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<e5(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&t5(e,i),r&&n&&t5(e,r)}}function t5(e,t){t3(t)||function e(t,n){var r=n.from,i=n.to,o=n.l,n=n.r;t4(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function t9(e,t){var n=t6(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=t6(e),a=o.next(i.from),s=a.value;!r.done&&!a.done;){if(0>=e5(s.from,i.to)&&0<=e5(s.to,i.from))return!0;0>e5(i.from,s.from)?i=(r=n.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function t6(e){var t=t3(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>e5(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=e5(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function t7(e){var t,r,i=((null==(t=e.r)?void 0:t.d)||0)-((null==(r=e.l)?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(t="r"==o?"l":"r",r=n({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[t],(e[t]=r).d=ne(r)),e.d=ne(e)}function ne(e){var t=e.r,e=e.l;return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function nt(e,t){return o(t).forEach(function(n){e[n]?t5(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)c(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||A.has(r.constructor)?r:e(r));return i}(t[n])}),e}function nn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&t9(t[n],e[n])})}h(t8.prototype,(($={add:function(e){return t5(this,e),this},addKey:function(e){return t4(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return t4(t,e,e)}),this},hasKey:function(e){var t=t6(this).next(e).value;return t&&0>=e5(t.from,e)&&0<=e5(t.to,e)}})[I]=function(){return t6(this)},$));var nr={},ni={},no=!1;function na(e){nt(ni,e),no||(no=!0,setTimeout(function(){no=!1,ns(ni,(ni={},!1))},0))}function ns(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(nr);r<i.length;r++)nu(a=i[r],e,n,t);else for(var o in e){var a,s=/^idb\:\/\/(.*)\/(.*)\//.exec(o);s&&(o=s[1],s=s[2],(a=nr["idb://".concat(o,"/").concat(s)])&&nu(a,e,n,t))}n.forEach(function(e){return e()})}function nu(e,t,n,r){for(var i=[],o=0,a=Object.entries(e.queries.query
vendor: 4,465 bytes, line 2
2);o<a.length;o++){for(var s=a[o],u=s[0],l=[],c=0,h=s[1];c<h.length;c++){var d=h[c];nn(t,d.obsSet)?d.subscribers.forEach(function(e){return n.add(e)}):r&&l.push(d)}r&&i.push([u,l])}if(r)for(var f=0;f<i.length;f++){var p=i[f],u=p[0],l=p[1];e.queries.query[u]=l}}function nl(e){function t(t){return e.next(t)}var n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var i=e(t),t=i.value;return i.done?t:t&&"function"==typeof t.then?t.then(n,r):a(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function nc(e,t,n){for(var r=a(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var nh={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return n(n({},e),{table:function(t){var r=e.table(t),i=r.schema,o={},a=[];function s(e,t,r){var i=tq(e),u=o[i]=o[i]||[],l=null==e?0:"string"==typeof e?1:e.length,c=0<t,c=n(n({},r),{name:c?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:c,keyTail:t,keyLength:l,extractKey:tN(e),unique:!c&&r.unique});return u.push(c),c.isPrimaryKey||a.push(c),1<l&&s(2===l?e[0]:e.slice(0,l-1),t+1,r),u.sort(function(e,t){return e.keyTail-t.keyTail}),c}t=s(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[t];for(var u=0,l=i.indexes;u<l.length;u++){var c=l[u];s(c.keyPath,0,c)}function h(t){var r,i=t.query.index;return i.isVirtual?n(n({},t),{query:{index:i.lowLevelIndex,range:(r=t.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:nc(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:nc(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):t}return n(n({},r),{schema:n(n({},i),{primaryKey:t,indexes:a,getIndexByKeyPath:function(e){return(e=o[tq(e)])&&e[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;return o?r.openCursor(h(t)).then(function(n){var r;return n&&Object.create(r=n,{continue:{value:function(n){null!=n?r.continue(nc(n,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?r.continue(r.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(nc(t,e.MAX_KEY,i),n)}},primaryKey:{get:function(){return r.primaryKey}},key:{get:function(){var e=r.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return r.value}}})}):r.openCursor(t)}})}})}};function nd(e,t,n,r){return n=n||{},r=r||"",o(e).forEach(function(i){var o,a,s;c(t,i)?(o=e[i],a=t[i],"object"==typeof o&&"object"==typeof a&&o&&a?(s=D(o))!==D(a)?n[r+i]=t[i]:"Object"===s?nd(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i]):o!==a&&(n[r+i]=t[i])):n[r+i]=void 0}),o(t).forEach(function(i){c(e,i)||(n[r+i]=t[i])}),n}function nf(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var np={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return n(n({},e),{table:function(t){var i=e.table(t),o=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var a=eg.trans,s=a.table(t).hook,u=s.deleting,l=s.creating,h=s.updating;switch(e.type){case"add":if(l.fire===Q)break;return a._promise("readwrite",function(){return d(e)},!0);case"put":if(l.fire===Q&&h.fire===Q)break;return a._promise("readwrite",function(){return d(e)},!0);case"delete":if(u.fire===Q)break;return a._promise("readwrite",function(){return d(e)},!0);case"deleteRange":if(u.fire===Q)break;return a._promise("readwrite",function(){return function e(t,r,a){return i.query({trans:t,values:!1,query:{index:o,range:r},limit:a}).then(function(i){var o=i.result;return d({type:"delete",keys:o,trans:t}).then(function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<a?{failures:[],numFailures:0,lastResult:void 0}:e(t,n(n({},r),{lower:o[o.length-1],lowerOpen:!0}),a)})})}(e.trans,e.range,1e4)},!0)}return i.mutate(e);function d(e){var t,a=eg.trans,s=e.keys||nf(o,e);if(!s)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?n(n({},e),{keys:s}):n({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),("add"===(t=e).type?Promise.resolve([]):i.getMany({trans:t.trans,keys:s,cache:"immutable"})).then(function(t){var n=s.map(function(n,r){var i,s,d,f=t[r],p={onerror:null,onsuccess:null};return"delete"===e.type?u.fire.call(p,n,f,a):"add"===e.type||void 0===f?(i=l.fire.call(p,n,e.values[r],a),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||k(e.values[r],o.keyPath,n))):(i=nd(f,e.values[r]),(s=h.fire.call(p,i,n,f,a))&&(d=e.values[r],Object.keys(s).forEac
2h(function(e){c(d,e)?d[e]=s[e]:k(d,e,s[e])}))),p});return i.mutate(e).then(function(r){for(var i=r.failures,o=r.results,a=r.numFailures,r=r.lastResult,u=0;u<s.length;++u){var l=(o||s)[u],c=n[u];null==l?c.onerror&&c.onerror(i[u]):c.onsuccess&&c.onsuccess("put"===e.type&&t[u]?e.values[u]:l)}return{failures:i,results:o,numFailures:a,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}}})}})}};function ng(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===e5(t.keys[i],e[o])&&(r.push(n?E(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var ny={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var r=e.table(t);return n(n({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=ng(e.keys,e.trans._cache,"clone"===e.cache);return t?eb.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?E(t):t},t})},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function nm(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function nv(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var nb={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,r=new t8(e.MIN_KEY,e.MAX_KEY);return n(n({},e),{transaction:function(t,n,r){if(eg.subscr&&"readonly"!==n)throw new H.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(eg.querier));return e.transaction(t,n,r)},table:function(i){var s=e.table(i),u=s.schema,l=u.primaryKey,c=u.indexes,h=l.extractKey,d=l.outbound,f=l.autoIncrement&&c.filter(function(e){return e.compound&&e.keyPath.includes(l.keyPath)}),p=n(n({},s),{mutate:function(n){function o(e){return p[e="idb://".concat(t,"/").concat(i,"/").concat(e)]||(p[e]=new t8)}var c,h,d=n.trans,p=n.mutatedParts||(n.mutatedParts={}),g=o(""),y=o(":dels"),m=n.type,v="deleteRange"===n.type?[n.range]:"delete"===n.type?[n.
2keys]:n.values.length<50?[nf(l,n).filter(function(e){return e}),n.values]:[],b=v[0],w=v[1],v=n.trans._cache;return a(b)?(g.addKeys(b),(v="delete"===m||b.length===w.length?ng(b,v):null)||y.addKeys(b),(v||w)&&(c=v,h=w,u.indexes.forEach(function(e){var t=o(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&a(n)?n.forEach(function(e){return t.addKey(e)}):t.addKey(n)}(c||h).forEach(function(e,t){var i=c&&n(c[t]),t=h&&n(h[t]);0!==e5(i,t)&&(null!=i&&r(i),null!=t&&r(t))})}))):b?(w={from:null!=(w=b.lower)?w:e.MIN_KEY,to:null!=(w=b.upper)?w:e.MAX_KEY},y.add(w),g.add(w)):(g.add(r),y.add(r),u.indexes.forEach(function(e){return o(e.name).add(r)})),s.mutate(n).then(function(e){return!b||"add"!==n.type&&"put"!==n.type||(g.addKeys(e.results),f&&f.forEach(function(t){for(var r=n.values.map(function(e){return t.extractKey(e)}),i=t.keyPath.findIndex(function(e){return e===l.keyPath}),a=0,s=e.results.length;a<s;++a)r[a][i]=e.results[a];o(t.name).addKeys(r)})),d.mutatedParts=nt(d.mutatedParts||{},p),e})}}),c=function(t){var n=t.query,t=n.index,n=n.range;return[t,new t8(null!=(t=n.lower)?t:e.MIN_KEY,null!=(n=n.upper)?n:e.MAX_KEY)]},g={get:function(e){return[l,new t8(e.key)]},getMany:function(e){return[l,(new t8).addKeys(e.keys)]},count:c,query:c,openCursor:c};return o(g).forEach(function(e){p[e]=function(o){var a=eg.subscr,u=!!a,l=nm(eg,s)&&nv(e,o)?o.obsSet={}:a;if(u){var c=function(e){return l[e="idb://".concat(t,"/").concat(i,"/").concat(e)]||(l[e]=new t8)},f=c(""),p=c(":dels"),a=g[e](o),u=a[0],a=a[1];if(("query"===e&&u.isPrimaryKey&&!o.values?p:c(u.name||"")).add(a),!u.isPrimaryKey){if("count"!==e){var y="query"===e&&d&&o.values&&s.query(n(n({},o),{values:!1}));return s[e].apply(this,arguments).then(function(t){if("query"===e){if(d&&o.values)return y.then(function(e){return e=e.result,f.addKeys(e),t});var n=o.values?t.result.map(h):t.result;(o.values?f:p).addKeys(n)}else if("openCursor"===e){var r=o.values;return t&&Object.create(t,{key:{get:function(){return p.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return p.addKey(e),e}},value:{get:function(){return r&&f.addKey(t.primaryKey),t.value}}})}return t})}p.add(r)}}return s[e].apply(this,arguments)}}),p}})}};function nw(e,t,r){if(0===r.numFailures)return t;if("deleteRange"===t.type)return null;var i=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;return r.numFailures===i?null:(a((t=n({},t)).keys)&&(t.keys=t.keys.filter(function(e,t){return!(t in r.failures)})),"values"in t&&a(t.values)&&(t.values=t.values.filter(function(e,t){return!(t in r.failures)})),t)}function nx(e,t){return(void 0===t.lower||(t.lowerOpen?0<e5(e,t.lower):0<=e5(e,t.lower)))&&(void 0===t.upper||(t.upperOpen?0>e5(e,t.upper):0>=e5(e,t.upper)))}function nk(e,t,n,r,i,o){if(!n||0===n.length)return e;var s=t.query.index,u=s.multiEntry,l=t.query.range,c=r.schema.primaryKey.extractKey,h=s.extractKey,d=(s.lowLevelIndex||s).extractKey,n=n.reduce(function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new t8,s=n.values.length-1;0<=s;--s){var d,f=n.values[s],p=c(f);o.hasKey(p)||(d=h(f),(u&&a(d)?d.some(function(e){return nx(e,l)}):nx(d,l))&&(o.addKey(p),i.push(f)))}switch(n.type){case"add":var g=(new t8).addKeys(t.values?e.map(function(e){return c(e)}):e),r=e.concat(t.values?i.filter(function(e){return e=c(e),!g.hasKey(e)&&(g.addKey(e),!0)}):i.map(function(e){return c(e)}).filter(function(e){return!g.hasKey(e)&&(g.addKey(e),!0)}));break;case"put":var y=(new t8).addKeys(n.values.map(function(e){return c(e)}));r=e.filter(function(e){return!y.hasKey(t.values?c(e):e)}).concat(t.values?i:i.map(function(e){return c(e)}));break;case"delete":var m=(new t8).addKeys(n.keys);r=e.filter(function(e){return!m.hasKey(t.values?c(e):e)});break;case"deleteRange":var v=n.range;r=e.filter(function(e){return!nx(c(e),v)})}return r},e);return n===e?e:(n.sort(function(e,t){return e5(d(e),d(t))||e5(c(e),c(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function n_(e,t){return 0===e5(e.lower,t.lower)&&0===e5(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}var nS={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name;return n(n({},e),{transaction:function(n,r,i){var o,a,s=e.transaction(n,r,i);return"readwrite"===r&&(a=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var a=new Set,u=0;u<n.length;u++){var l=n[u],c=nr["idb://".concat(t,"/").concat(l)];if(c){var h=e.table(l),d=c.optimisticOps.filter(function(e){return e.trans===s});if(s._explicit&&i&&s.mutatedParts)for(var f=0,p=Object.values(c.queries.query
2);f<p.length;f++)for(var g=0,y=(b=p[f]).slice();g<y.length;g++)nn((w=y[g]).obsSet,s.mutatedParts)&&(K(b,w),w.subscribers.forEach(function(e){return a.add(e)}));else if(0<d.length){c.optimisticOps=c.optimisticOps.filter(function(e){return e.trans!==s});for(var m=0,v=Object.values(c.queries.query);m<v.length;m++)for(var b,w,x,k=0,_=(b=v[m]).slice();k<_.length;k++)null!=(w=_[k]).res&&s.mutatedParts&&(i&&!w.dirty?(x=Object.isFrozen(w.res),x=nk(w.res,w.req,d,h,w,x),w.dirty?(K(b,w),w.subscribers.forEach(function(e){return a.add(e)})):x!==w.res&&(w.res=x,w.promise=eb.resolve({result:x}))):(w.dirty&&K(b,w),w.subscribers.forEach(function(e){return a.add(e)})))}}}a.forEach(function(e){return e()})}}},s.addEventListener("abort",i(!1),{signal:a}),s.addEventListener("error",i(!1),{signal:a}),s.addEventListener("complete",i(!0),{signal:a})),s},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var a=eg.trans;if(o.outbound||"disabled"===a.db._options.cache||a.explicit||"readwrite"!==a.idbtrans.mode)return i.mutate(e);var s=nr["idb://".concat(t,"/").concat(r)];return s?(a=i.mutate(e),("add"===e.type||"put"===e.type)&&(50<=e.values.length||nf(o,e).some(function(e){return null==e}))?a.then(function(t){var r=nw(0,n(n({},e),{values:e.values.map(function(e,r){var i;return t.failures[r]||k(e=null!=(i=o.keyPath)&&i.includes(".")?E(e):n({},e),o.keyPath,t.results[r]),e})}),t);s.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&na(e.mutatedParts)})}):(s.optimisticOps.push(e),e.mutatedParts&&na(e.mutatedParts),a.then(function(t){0<t.numFailures&&(K(s.optimisticOps,e),(t=nw(0,e,t))&&s.optimisticOps.push(t),e.mutatedParts&&na(e.mutatedParts))}),a.catch(function(){K(s.optimisticOps,e),e.mutatedParts&&na(e.mutatedParts)})),a):i.mutate(e)},query:function(e){if(!nm(eg,i)||!nv("query",e))return i.query(e);var n,o,a="immutable"===(null==(c=eg.trans)?void 0:c.db._options.cache),s=eg,u=s.requery,l=s.signal,c=function(e,t,n,r){var i=nr["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var a=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&n_(e.req.query.range,r.query.range)});return a?[a,!0,i,o]:[o.find(function(e){var t,n;return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&(t=e.req.query.range,n=r.query.range,0>=function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=e5(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return -1}return t}(t.lower,n.lower,t.lowerOpen,n.lowerOpen)&&0<=function(e,t,n,r){if(void 0===e)return+(void 0!==t);if(void 0===t)return -1;if(0===(t=e5(e,t))){if(n&&r)return 0;if(n)return -1;if(r)return 1}return t}(t.upper,n.upper,t.upperOpen,n.upperOpen))}),!1,i,o];case"count":return[a=o.find(function(e){return n_(e.req.query.range,r.query.range)}),!!a,i,o]}}(t,r,"query",e),h=c[0],s=c[1],d=c[2],f=c[3];return h&&s?h.obsSet=e.obsSet:(s=i.query(e).then(function(e){var t=e.result;if(h&&(h.res=t),a){for(var n=0,r=t.length;n<r;++n)Object.freeze(t[n]);Object.freeze(t)}else e.result=E(t);return e}).catch(function(e){return f&&h&&K(f,h),Promise.reject(e)}),h={obsSet:e.obsSet,promise:s,subscribers:new Set,type:"query",req:e,dirty:!1},f?f.push(h):(f=[h],(d=d||(nr["idb://".concat(t,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=f)),n=h,o=f,n.subscribers.add(u),l.addEventListener("abort",function(){n.subscribers.delete(u),0===n.subscribers.size&&setTimeout(function(){0===n.subscribers.size&&K(o,n)},3e3)}),h.promise.then(function(t){return{result:nk(t.result,e,null==d?void 0:d.optimisticOps,i,h,a)}})}})}})}};function nO(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var nC=(nA.prototype.version=function(e){if(isNaN(e)||e<.1)throw new H.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new H.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(tV),n.stores({}),this._state.autoSchema=!1,n)},nA.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||eg.letThrough||this._vip)?e():new eb(function(e,n){if(t._state.openComplete)return n(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new H.DatabaseClosed);t.open().catch(Q)}t._state.dbReadyPromise.then(e,n)}).then(e)},nA.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort(function(e,t){return e.level-t.level}),this},nA.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},nA.prototype.open=function(){var e=this;return ez(ep,function(){return function(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?eY(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),a=!1;function s(){if(t.openCanceller!==r)throw new H.DatabaseClosed("db.open() was cancelled")}var u,l=t.dbReadyResolve,c=null,h=!1;return eb.race([r,("undefined"==typeof navigator?eb.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}u=setInterval(t,100),t()}).finally(function(){return clearInterval(u)}):Promise.resolve()).then(function r(){return new eb(function(u,l){if(s(),!n)throw new H.MissingAPI;var d=e.name,f=t.autoSchema||!i?n.open(d):n.open(d,i);if(!f)throw new H.MissingAPI;f.onerror=tC(l),f.onblocked=eD(e._fireOnBlocked),f.onupgradeneeded=eD(function(r){var i,s,u,p,g,y,m;c=f.transaction,t.autoSchema&&!e._options.allowEmptyDB?(f.onerror=tA,c.abort(),f.result.close(),(i=n.deleteDatabase(d)).onsuccess=i.onerror=eD(function(){l(new H.NoSuchDatabase("Database ".concat(d," doesnt exist")))})):(c.onerror=tC(l),h=(r=r.oldVersion>0x4000000000000000?0:r.oldVersion)<1,e.idbdb=f.result,a&&function(e,t){tW(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.ver
2sion/10-1),"version");var n=tQ(0,e.idbdb,t);tG(e,e._dbSchema,t);for(var r=0,i=tz(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){ei&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),tY(n,t)})}(i[r]);if("object"==typeof o)return o.value}}(e,c),s=r/10,u=c,p=e._dbSchema,u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=tL("$meta",tJ("")[0],[]),e._storeNames.push("$meta")),(g=e._createTransaction("readwrite",e._storeNames,p)).create(u),g._completion.catch(l),y=g._reject.bind(g),m=eg.transless||eg,eB(function(){return eg.trans=g,eg.transless=m,0!==s?(tF(e,u),(g.storeNames.includes("$meta")?g.table("$meta").get("version").then(function(e){return null!=e?e:s}):eb.resolve(s)).then(function(t){var n,r,i;return n=t,r=[],t=e._versions,i=e._dbSchema=tQ(0,e.idbdb,u),0!==(t=t.filter(function(e){return e._cfg.version>=n})).length?(t.forEach(function(t){r.push(function(){var r=i,a=t._cfg.dbschema;tG(e,r,u),tG(e,a,u),i=e._dbSchema=a;var s=tz(r,a);s.add.forEach(function(e){tH(u,e[0],e[1].primKey,e[1].indexes)}),s.change.forEach(function(e){if(e.recreate)throw new H.Upgrade("Not yet support for changing primary key");var t=u.objectStore(e.name);e.add.forEach(function(e){return tY(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),tY(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var l=t._cfg.contentUpgrade;if(l&&t._cfg.version>n){tF(e,u),g._memoizedTables={};var c=_(a);s.del.forEach(function(e){c[e]=r[e]}),tU(e,[e.Transaction.prototype]),tM(e,[e.Transaction.prototype],o(c),c),g.schema=c;var h,d=N(l);return d&&e$(),s=eb.follow(function(){var e;(h=l(g))&&d&&(e=eq.bind(null,null),h.then(e,e))}),h&&"function"==typeof h.then?eb.resolve(h):s.then(function(){return h})}}),r.push(function(n){var r=t._cfg.dbschema;[].slice.call(n.db.objectStoreNames).forEach(function(e){return null==r[e]&&n.db.deleteObjectStore(e)}),tU(e,[e.Transaction.prototype]),tM(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),g.schema=e._dbSchema}),r.push(function(n){e.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(e.idbdb.version/10)===t._cfg.version?(e.idbdb.deleteObjectStore("$meta"),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter(function(e){return"$meta"!==e})):n.objectStore("$meta").put(t._cfg.version,"version"))})}),(function e(){return r.length?eb.resolve(r.shift()(g.idbtrans)).then(e):eb.resolve()})().then(function(){tW(i,u)})):eb.resolve()}).catch(y)):(o(p).forEach(function(e){tH(u,e,p[e].primKey,p[e].indexes)}),tF(e,u),void eb.follow(function(){return e.on.populate.fire(g)}).catch(y))}))},l),f.onsuccess=eD(function(){c=null;var n,s,l,p=e.idbdb=f.result,g=m(p.objectStoreNames);if(0<g.length)try{var y=p.transaction(1===g.length?g[0]:g,"readonly");if(t.autoSchema)n=p,s=y,e.verno=n.version/10,s=e._dbSchema=tQ(0,n,s),e._storeNames=m(n.objectStoreNames,0),tM(e,[e._allTables],o(s),s);else if(tG(e,e._dbSchema,y),((l=tz(tQ(0,(l=e).idbdb,y),l._dbSchema)).add.length||l.change.some(function(e){return e.add.length||e.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."),p.close(),i=p.version+1,a=!0,u(r());tF(e,y)}catch(e){}eX.push(e),p.onversionchange=eD(function(n){t.vcFired=!0,e.on("versionchange").fire(n)}),p.onclose=eD(function(){e.close({disableAutoOpen:!1})}),h&&(l=e._deps,y=d,p=l.indexedDB,l=l.IDBKeyRange,t1(p)||y===eZ||t0(p,l).put({name:y}).catch(Q)),u()},l)}).catch(function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),r();break;case"VersionError":if(0<i)return i=0,r()}return eb.reject(e)})})]).then(function(){return s(),t.onReadyBeingFired=[],eb.resolve(t2(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(er,Q);return t.onReadyBeingFired=[],eb.resolve(t2(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{c&&c.abort()}catch(e){}return r===t.openCanceller&&e._close(),eY(n)}).finally(function(){t.openComplete=!0,l()}).then(function(){var t;return h&&(t={}
2,e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new t8(-1/0,[[[]]]))}),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new t8(-1/0,[[[]]])}),tj(tP).fire(t),ns(t,!0)),e})}(e)})},nA.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var e=this._state,t=eX.indexOf(this);if(0<=t&&eX.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new eb(function(t){e.dbReadyResolve=t}),e.openCanceller=new eb(function(t,n){e.cancelOpen=n}))},nA.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen,e=this._state;t?(e.isBeingOpened&&e.cancelOpen(new H.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new H.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nA.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new eb(function(i,o){function a(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=eD(function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,t1(r)||n===eZ||t0(r,e).delete(n).catch(Q),i()}),n.onerror=tC(o),n.onblocked=t._fireOnBlocked}if(n)throw new H.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},nA.prototype.backendDB=function(){return this.idbdb},nA.prototype.isOpen=function(){return null!==this.idbdb},nA.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nA.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nA.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nA.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),nA.prototype.transaction=function(){var e=(function(e,t,n){var r=arguments.length;if(r<2)throw new H.InvalidArgument("Too few arguments");for(var i=Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,O(i),n]}).apply(this,arguments);return this._transaction.apply(this,e)},nA.prototype._transaction=function(e,t,n){var r=this,i=eg.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map(function(e){if(e=e instanceof r.Table?e.name:e,"string"!=typeof e)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==e||e===e0)o=e0;else{if("rw"!=e&&e!=e1)throw new H.InvalidArgument("Invalid transaction mode: "+e);o=e1}if(i){if(i.mode===e0&&o===e1){if(!s)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach(function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new H.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),s&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,function(t,n){n(e)}):eY(e)}var u=(function e(t,n,r,i,o){return eb.resolve().then(function(){var a=eg.transless||eg,s=t._createTransaction(n,r,t._dbSchema,i);if(s.explicit=!0,a={trans:s,transless:a},i)s.idbtrans=i.idbtrans;else try{s.create(),s.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(i){return i.name===z.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,o)})):eY(i)}var u,l=N(o);return l&&e$(),a=eb.follow(function(){var e;(u=o.call(s,s))&&(l?(e=eq.bind(null,null),u.then(e,e)):"function"==typeof u.next&&"function"==typeof u.throw&&(u=nl(u)))},a),(u&&"function"==typeof u.then?eb.resolve(u).then(function(e){return s.active?e:eY(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):a.then(function(){return u})).then(function(e){return i&&s._resolve(),s._completion.then(function(){return e})}).catch(function(e){return s._reject(e),eY(e)})})}).bind(null,this,o,a,i,n);return i?i._promise(o,u,"lock"):eg.trans?ez(eg.transless,function(){return r._whenReady(u)}):this._whenReady(u)},nA.prototype.table=function(e){if(!c(this._allTables,e))throw new H.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nA);function nA(e,t){var r=this;this._middlewares={},this.verno=0;var i=nA.dependencies;
2this._options=t=n({addons:nA.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange},i=t.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,a,s,u,l,c={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Q,dbReadyPromise:null,cancelOpen:Q,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};c.dbReadyPromise=new eb(function(e){c.dbReadyResolve=e}),c.openCanceller=new eb(function(e,t){c.cancelOpen=t}),this._state=c,this.name=e,this.on=to(this,"populate","blocked","versionchange","close",{ready:[er,Q]}),this.once=function(e,t){var n=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r.on(e).unsubscribe(n),t.apply(r,i)};return r.on(e,n)},this.on.ready.subscribe=v(this.on.ready.subscribe,function(e){return function(t,n){nA.vip(function(){var i=r._state;i.openComplete?(i.dbOpenError||eb.resolve().then(t),n&&e(t)):i.onReadyBeingFired?(i.onReadyBeingFired.push(t),n&&e(t)):(e(t),n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))})}}),this.Collection=(o=this,ta(tp.prototype,function(e,t){this.db=o;var n=e3,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx,t=i.table,e=t.hook.reading.fire;this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==G?e:null}})),this.Table=(a=this,ta(tr.prototype,function(e,t,n){this.db=a,this._tx=n,this.name=e,this.schema=t,this.hook=a._allTables[e]?a._allTables[e].hook:to(null,{creating:[Z,Q],reading:[J,G],updating:[et,Q],deleting:[ee,Q]})})),this.Transaction=(s=this,ta(tD.prototype,function(e,t,n,r,i){var o=this;"readonly"!==e&&t.forEach(function(e){(e=null==(e=n[e])?void 0:e.yProps)&&(t=t.concat(e.map(function(e){return e.updatesTable})))}),this.db=s,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=to(this,"complete","error","abort"),this.parent=i||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 eb(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),eY(e)})})),this.Version=(u=this,ta(tX.prototype,function(e){this.db=u,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(l=this,ta(tS.prototype,function(e,t,n){if(this.db=l,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=e5,this._descending=function(e,t){return e5(t,e)},this._max=function(e,t){return 0<e5(e,t)?e:t},this._min=function(e,t){return 0>e5(e,t)?e:t},this._IDBKeyRange=l._deps.IDBKeyRange,!this._IDBKeyRange)throw new H.MissingAPI})),this.on("versionchange",function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})}),this.on("blocked",function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))}),this._maxKey=tT(t.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),eX.filter(function(e){return e.name===r.name&&e!==r&&!e._state.vcFired}).map(function(t){return t.on("versionchange").fire(e)})},this.use(ny),this.use(nS),this.use(nb),this.use(nh),this.use(np);var h=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;
2if("table"===t)return function(e){return nO(r.table(e),h)};var i=Reflect.get(e,t,n);return i instanceof tr?nO(i,h):"tables"===t?i.map(function(e){return nO(e,h)}):"_createTransaction"===t?function(){return nO(i.apply(this,arguments),h)}:i}});this.vip=h,i.forEach(function(e){return e(r)})}var nP,$="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nE=(nj.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},nj.prototype[$]=function(){return this},nj);function nj(e){this._subscribe=e}try{nP={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(e){nP={indexedDB:null,IDBKeyRange:null}}function nD(e){var t,n=!1,r=new nE(function(r){var i,o=N(e),a=!1,s={},u={},l={get closed(){return a},unsubscribe:function(){a||(a=!0,i&&i.abort(),h&&tj.storagemutated.unsubscribe(f))}};r.start&&r.start(l);var h=!1,d=function(){return eW(p)},f=function(e){nt(s,e),nn(u,s)&&d()},p=function(){var l,p;!a&&nP.indexedDB&&(s={},l={},i&&i.abort(),Promise.resolve(function(t){var n=eA();try{o&&e$();var r=eB(e,t);return r=o?r.finally(eq):r}finally{n&&eP()}}(p={subscr:l,signal:(i=new AbortController).signal,requery:d,querier:e,trans:null})).then(function(e){n=!0,t=e,a||p.signal.aborted||(s={},function(e){for(var t in e)if(c(e,t))return;return 1}(u=l)||h||(tj(tP,f),h=!0),eW(function(){return!a&&r.next&&r.next(e)}))},function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||a||eW(function(){a||r.error&&r.error(e)})}))};return setTimeout(d,0),l});return r.hasValue=function(){return n},r.getValue=function(){return t},r}function nI(e){var t=nK;try{nK=!0,tj.storagemutated.fire(e),ns(e,!0)}finally{nK=t}}h(nC,n(n({},Y),{delete:function(e){return new nC(e,{addons:[]}).delete()},exists:function(e){return new nC(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){var t,n;try{return n=(t=nC.dependencies).indexedDB,t=t.IDBKeyRange,(t1(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==eZ})}):t0(n,t).toCollection().primaryKeys()).then(e)}catch(e){return eY(new H.MissingAPI)}},defineClass:function(){return function(e){s(this,e)}},ignoreTransaction:function(e){return eg.trans?ez(eg.transless,e):e()},vip:t2,async:function(e){return function(){try{var t=nl(e.apply(this,arguments));return t&&"function"==typeof t.then?t:eb.resolve(t)}catch(e){return eY(e)}}},spawn:function(e,t,n){try{var r=nl(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:eb.resolve(r)}catch(e){return eY(e)}},currentTransaction:{get:function(){return eg.trans||null}},waitFor:function(e,t){return t=eb.resolve("function"==typeof e?nC.ignoreTransaction(e):e).timeout(t||6e4),eg.trans?eg.trans.waitFor(t):t},Promise:eb,debug:{get:function(){return ei},set:function(e){ei=e}},derive:p,extend:s,props:h,override:v,Events:to,on:tj,liveQuery:nD,extendObservabilitySet:nt,getByKeyPath:x,setByKeyPath:k,delByKeyPath:function(e,t){"string"==typeof t?k(e,t,void 0):"length"in t&&[].map.call(t,function(t){k(e,t,void 0)})},shallowClone:_,deepClone:E,getObjectDiff:nd,cmp:e5,asap:w,minKey:-1/0,addons:[],connections:eX,errnames:z,dependencies:nP,cache:nr,semVer:"4.2.1",version:"4.2.1".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nC.maxKey=tT(nC.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(tj(tP,function(e){nK||(e=new CustomEvent(tE,{detail:e}),nK=!0,dispatchEvent(e),nK=!1)}),addEventListener(tE,function(e){e=e.detail,nK||nI(e)}));var nR,nK=!1,nL=function(){};return"undefined"!=typeof BroadcastChannel&&((nL=function(){(nR=new BroadcastChannel(tE)).onmessage=function(e){return e.data&&nI(e.data)}})(),"function"==typeof nR.unref&&nR.unref(),tj(tP,function(e){nK||nR.postMessage(e)})),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",function(e){if(!nC.disableBfCache&&e.persisted){ei&&console.debug("Dexie: handling persisted pagehide"),null!=nR&&nR.close();for(var t=0;t<eX.length;t++)eX[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!nC.disableBfCache&&e.persisted&&(ei&&console.debug("Dexie: handling persisted pageshow"),nL(),nI({all:new t8(-1/0,[[]])}))})),eb.rejectionMapper=function(e,t){return!e||e instanceof F||e instanceof TypeError||e instanceof SyntaxError||!e.name||!W[e.name]?e:(t=new W[e.name](t||e.message,e),"stack"in e&&f(t,"stack",{get:function(){return this.inner.stack}}),t)},n(nC,Object.freeze({__proto__:null,Dexie:nC,liveQuery:nD,Entity:e4,cmp:e5,PropModification:te,replacePrefix:function(e,t){return new te({replacePrefix:[e,t]})},add:function(e){return new te({add:e})},remove:function(e){return new te({remove:e})},default:nC,RangeSet:t8,mergeRanges:t5,rangesOverlap:t9}),{default:nC}),nC}()},998480,51234,e=>{"use strict";var t=e.i(392602);let n=Symbol.for("Dexie"),r=globalThis[n]||(globalThis[n]=t.default);if(t.default.semVer!==r.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${t.default.semVer} and ${r.semVer}`);let{liveQuery:i,mergeRanges:o,rangesOverlap:a,RangeSet:s,cmp:u,Entity:l,PropModification:c,replacePrefix:h,add:d,remove:f,DexieYProvider:p}=r,g=r;e.s(["Dexie",()=>r,"default",0,g],51234);var y=e.i(383627);let m={eth:{mainnet:"ethereum",testnet:"sepolia"},ethereum:{mainnet:"ethereum",testnet:"sepolia"},matic:{mainnet:"polygon",testnet:"polygonAmoy"},polygon:{mainnet:"polygon",testnet:"polygonAmoy"},pol:{mainnet:"polygon",testnet:"polygonAmoy"},bnb:{mainnet:"bsc",testnet:"bscTestnet"},bsc:{mainnet:"bsc",testnet:"bscTestnet"},"bnb smart chain":{mainnet:"bsc",testnet:"bscTestnet"},tron:{mainnet:"tron",testnet:"nile"},trx:{mainnet:"tron",testnet:"nile"},sym:{mainnet:"mainnet",testnet:"testnet"},symverse:{mainnet:"mainnet",testnet:"testnet"},solana:{mainnet:"solana",testnet:"solana-devnet"},sol:{mainnet:"solana",testnet:"solana-devnet"}};function v(e){var t;let n,r=(n=m[(t=e.chain).toLowerCase()])||{mainnet:t,testnet:`${t}-testnet`};return{...e,mainnetNetwork:r.mainnet,testnetNetwork:r.testnet}}let b=[{id:"portfolio",icon:"ph ph-wallet",labelKey:"common:portfolio",path:"/dashboard/portfolio",color:"bg-blue-500/20",iconColor:"text-blue-400"},{id:"settings",icon:"ph ph-gear-six",labelKey:"common:settings",path:"/dashboard/settings",color:"bg-gray-500/20",iconColor:"text-gray-400"},{id:"send",icon:"ph ph-paper-plane-right",labelKey:"common:send",path:"/dashboard/portfolio/SYM/send",color:"bg-green-500/20",iconColor:"text-green-400"},{id:"receive",icon:"ph ph-qr-code",labelKey:"common:receive",path:"/dashboard/receive",color:"bg-orange-500/20",iconColor:"text-orange-400"}
2],w=b.slice(0,3),x=new class extends g{wallets;selectedWallet;lockState;mnemonics;recentSendsAccounts;addressBook;invalidChains;coins;activatedCoins;userDeactivatedCoins;priceCache;dashboardLayout;quickActionsSettings;transactionHistory;constructor(){super("SymverseWalletBox"),this.version(1).stores({wallets:"symId, name, createdAt, updatedAt, ethereum.address, bitcoin.address, tron.address",selectedWallet:"symId, selectedAt, lastUsed",lockState:"id",mnemonics:"++id, encryptedMnemonic",recentSendsAccounts:"++id, fromAddress, chain, [fromAddress+chain], [fromAddress+toAddress], lastUsedAt",addressBook:"++id, chain, address, name, createdAt",invalidChains:"++id, symId, chain, [symId+chain], detectedAt",coins:"currencyId, chain, display_order, id",activatedCoins:"currencyId, activatedAt, sortOrder",priceCache:"++id, cacheKey, coinGeckoId, currency, timestamp",dashboardLayout:"id, updatedAt",quickActionsSettings:"id, updatedAt",transactionHistory:"++id, txHash, fromAddress, chain, [fromAddress+chain], toAddress, timestamp, currencyId, network"}),this.version(2).stores({wallets:"symId, name, createdAt, updatedAt, ethereum.address, bitcoin.address, tron.address, solana.address"}),this.version(3).stores({userDeactivatedCoins:"currencyId, deactivatedAt"}),this.version(4).stores({priceCache:"++id, currencyId, timestamp"}).upgrade(async e=>{await e.table("priceCache").clear()})}async initialize(){await this.open()}normalizeSymId(e){return e.trim().toLowerCase()}async addWallet(e){let t=await this.getAllWallets();if(t.length>=10)throw Error(`Maximum account limit reached. (Max: 10, Current: ${t.length})`);let n=this.normalizeSymId(e.symId),r=await this.getWallet(n),i={...e,symId:n,updatedAt:Date.now()};return r?await this.wallets.put(i):await this.wallets.add(i),!0}async getAllWallets(){return await this.wallets.orderBy("createdAt").toArray()}async getWallet(e){let t=this.normalizeSymId(e),n=await this.wallets.get(t);return n||t===e||(n=await this.wallets.get(e)),n||null}async updateWallet(e,t){let n=await this.wallets.get(e);if(!n)throw Error(`Wallet not found: ${e}`);let r={...n,...t,updatedAt:Date.now()};return await this.wallets.put(r),!0}async deleteWallet(e){return await this.transaction("rw",[this.wallets,this.selectedWallet],async()=>{await this.wallets.delete(e),await this.selectedWallet.delete(e)}),!0}async selectWallet(e){let t=await this.wallets.get(e);if(!t)throw Error(`Wallet not found: ${e}`);return await this.selectedWallet.put({symId:e,name:t.name,selectedAt:Date.now(),lastUsed:Date.now()}),!0}async getSelectedWallet(){return await this.selectedWallet.orderBy("selectedAt").reverse().first()||null}async setLockState(e){await this.lockState.put({id:"current",isLocked:e})}async getLockState(){let e=await this.lockState.get("current");return e?.isLocked??!1}async addMnemonicGroup(e){await this.mnemonics.where({encryptedMnemonic:e}).first()||await this.mnemonics.add({encryptedMnemonic:e,lastIndex:0})}async getMnemonicGroup(e){return await this.mnemonics.where({encryptedMnemonic:e}).first()}async updateMnemonicLastIndex(e,t){let n=await this.getMnemonicGroup(e);n?await this.mnemonics.update(Number(n.id),{lastIndex:t}):await this.addMnemonicGroup(e)}async getCommonMnemonicGroup(){return await this.mnemonics.orderBy("id").first()}async updateMnemonicGroupPassword(e,t){let n=await this.mnemonics.where({encryptedMnemonic:e}).first();n&&await this.mnemonics.update(Number(n.id),{encryptedMnemonic:t})}async updateRecentSendsAccountEntry(e,t,n,r){let i=await this.recentSendsAccounts.where("[fromAddress+toAddress]").equals([e,n]).and(e=>e.chain===t).first();i?await this.recentSendsAccounts.update(Number(i.id),{lastUsedAt:Date.now(),usageCount:i.usageCount+1,...r&&{label:r}}):await this.recentSendsAccounts.add({fromAddress:e,chain:t,toAddress:n,label:r,firstUsedAt:Date.now(),lastUsedAt:Date.now(),usageCount:1})}async getAllRecentSendsAccounts(){return await this.recentSendsAccounts.orderBy("lastUsedAt").reverse().toArray()}async deleteRecentSendsAccountEntry(e){if(!await this.recentSendsAccounts.get(e))throw Error(`Recent sends entry not found: ${e}`);return await this.recentSendsAccounts.delete(e),!0}async addAddressBookEntry(e,t,n){if(await this.addressBook.where({chain:n,address:t}).first())throw Error(y.default.t("addressBookEntryExists"));return await this.addressBook.add({name:e,address:t,chain:n,createdAt:Date.now(),updatedAt:Date.now()}),!0}async getAllAddressBookEntries(){return await this.addressBook.orderBy("createdAt").reverse().toArray()}async updateAddressBookEntry(e,t){let n=await this.addressBook.get(e);if(!n)throw Error(`Address book entry not found: ${e}`);if(t.address||t.chain){let r=t.address||n.address,i=t.chain||n.chain;if(await this.addressBook.where({chain:i,address:r}).and(t=>
2t.id!==e).first())throw Error(y.default.t("addressBookEntryExists"))}return await this.addressBook.update(e,{...t,updatedAt:Date.now()}),!0}async deleteAddressBookEntry(e){if(!await this.addressBook.get(e))throw Error(`Address book entry not found: ${e}`);return await this.addressBook.delete(e),!0}async addInvalidChainInfo(e,t,n,r){let i=await this.invalidChains.where("[symId+chain]").equals([e,t]).first();i?await this.invalidChains.update(Number(i.id),{storedAddress:n,generatedAddress:r,detectedAt:Date.now()}):await this.invalidChains.add({symId:e,chain:t,storedAddress:n,generatedAddress:r,detectedAt:Date.now()})}async getInvalidChainsBySymId(e){return await this.invalidChains.where({symId:e}).toArray()}async getAllInvalidChains(){return await this.invalidChains.toArray()}async clearInvalidChainsForSymId(e){await this.invalidChains.where({symId:e}).delete()}async clearAllInvalidChains(){await this.invalidChains.clear()}async saveCoins(e){await this.transaction("rw",this.coins,async()=>{await this.coins.clear();let t=e.map(v);await this.coins.bulkAdd(t)})}async getAllCoins(){return await this.coins.orderBy("display_order").toArray()}async getCoinById(e){return await this.coins.get(e)}async getCoinsByChain(e){return await this.coins.where({chain:e}).toArray()}async getActiveCoins(){return await this.coins.where({active:!0}).toArray()}async getPriorityCoins(){return await this.coins.where({priority:!0}).toArray()}async clearCoins(){await this.coins.clear()}async toggleActivatedCoin(e){if(await this.activatedCoins.get(e)){await this.activatedCoins.delete(e);let t=await this.coins.get(e);t?.priority===!0&&await this.userDeactivatedCoins.put({currencyId:e,deactivatedAt:Date.now()})}else await this.activatedCoins.add({currencyId:e,activatedAt:Date.now()}),await this.userDeactivatedCoins.delete(e)}async activateCoins(e){let t=new Set(await this.activatedCoins.toCollection().primaryKeys()),n=e.filter(e=>!t.has(e)).map(e=>({currencyId:e,activatedAt:Date.now()}));n.length>0&&await this.activatedCoins.bulkAdd(n)}async deactivateCoins(e){await this.activatedCoins.bulkDelete(e)}async getActivatedCoinIds(){return(await this.activatedCoins.toArray()).map(e=>e.currencyId)}async isCoinActivated(e){return!!await this.activatedCoins.get(e)}async clearActivatedCoins(){await this.activatedCoins.clear()}async reorderActivatedCoins(e){await this.transaction("rw",this.activatedCoins,async()=>{for(let t=0;t<e.length;t++)await this.activatedCoins.update(e[t],{sortOrder:t})})}async cleanupOrphanedActivatedCoins(){let e=await this.getActivatedCoinIds(),t=new Set(await this.coins.toCollection().primaryKeys()),n=e.filter(e=>!t.has(e));return n.length>0&&await this.activatedCoins.bulkDelete(n),n}async activatePriorityCoins(){let e=(await this.coins.toArray()).filter(e=>!0===e.priority);if(0===e.length)return[];let t=new Set(await this.getActivatedCoinIds()),n=new Set((await this.userDeactivatedCoins.toArray()).map(e=>e.currencyId)),r=e.filter(e=>!t.has(e.currencyId)&&!n.has(e.currencyId)).map(e=>({currencyId:e.currencyId,activatedAt:Date.now()}));return r.length>0&&await this.activatedCoins.bulkAdd(r),r.map(e=>e.currencyId)}async savePriceCacheBulk(e){let t=Date.now();for(let[n,r]of Object.entries(e)){let e=await this.priceCache.where({currencyId:n}).first();e?await this.priceCache.update(Number(e.id),{priceData:JSON.stringify(r),timestamp:t}):await this.priceCache.add({currencyId:n,priceData:JSON.stringify(r),timestamp:t})}}async getPriceCacheBulk(e){let t={},n=[];for(let r of e){let e=await this.priceCache.where({currencyId:r}).first();e?t[r]={data:JSON.parse(e.priceData),timestamp:e.timestamp}:n.push(r)}return{cached:t,missing:n}}async saveDashboardLayout(e,t){await this.dashboardLayout.put({id:e,sections:t,updatedAt:Date.now()})}async getDashboardLayout(e){return await this.dashboardLayout.get(e)||null}async clearDashboardLayout(){await this.dashboardLayout.clear()}async saveQuickActions(e){await this.quickActionsSettings.put({id:"settings",actions:e,updatedAt:Date.now()})}async getQuickActions(){return this.quickActionsSettings.get("settings")}async clearQuickActions(){await this.quickActionsSettings.clear()}async addTransactionHistory(e){return await this.transactionHistory.add(e)}async getTransactionHistory(e,t){let n=this.transactionHistory.where({fromAddress:e});t?.chain&&(n=this.transactionHistory.where("[fromAddress+chain]").equals([e,t.chain]));let r=n.reverse().sortBy("timestamp"),i=await r,o=i;t?.network&&(o=i.filter(e=>e.network===t.network));let a=t?.offset||0,s=t?.limit;return void 0!==s?o.slice(a,a+s):o.slice(a)}async getTransactionByHash(e){return await this.transactionHistory.where({txHash:e}).first()}async deleteOldTransactions(e){let t=await this.transactionHistory.where("timestamp").below(e).toArray();if(t.length>0){let e=t.map(e=>e.id).filter(e=>void 0!==e);await this.transactionHistory.bulkDelete(e)}return t.length}async getRecentTransactions(e,t=0){return await this.transactionHistory.orderBy("timestamp").reverse().offset(t).limit(e).toArray()}async getTransactionHistoryForAddresses(e,t){if(0===e.length)return[];let n=[];for(let t of e){let e=await this.transactionHistory.where({fromAddress:t}).toArray();n.push(...e)}n.sort((e,t)=>
2t.timestamp-e.timestamp);let r=t?.offset||0,i=t?.limit;return void 0!==i?n.slice(r,r+i):n.slice(r)}async clearTransactionHistory(){await this.transactionHistory.clear()}async getTransactionCount(e,t){let n=this.transactionHistory.where({fromAddress:e});t?.chain&&(n=this.transactionHistory.where("[fromAddress+chain]").equals([e,t.chain]));let r=await n.toArray();return t?.network&&(r=r.filter(e=>e.network===t.network)),r.length}async forceReset(){return this.close(),await this.deleteDatabase(),await this.initialize(),!0}async deleteDatabase(){return new Promise((e,t)=>{if(!window.indexedDB)return void e();let n=indexedDB.deleteDatabase(this.name);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{setTimeout(()=>e(),3e3)}})}};e.s(["ALL_QUICK_ACTIONS",0,b,"DEFAULT_QUICK_ACTIONS",0,w,"MAX_WALLETS",0,10,"db",0,x],998480)}]);
3
4//# debugId=97a06bdc-68ce-a3f7-4804-4ed3b29944da

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.