@tryghost/sodo-search 1.8.34 → 1.8.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/umd/sodo-search.min.js +1 -1
package/package.json
CHANGED
package/umd/sodo-search.min.js
CHANGED
|
@@ -14,4 +14,4 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
14
14
|
.ghost-display {
|
|
15
15
|
display: none;
|
|
16
16
|
}
|
|
17
|
-
`,o=this.context.stylesUrl;return o?G.jsxs(G.Fragment,{children:[G.jsx("link",{rel:"stylesheet",href:o}),G.jsx("style",{dangerouslySetInnerHTML:{__html:i}}),G.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]}):G.jsxs(G.Fragment,{children:[G.jsx("style",{dangerouslySetInnerHTML:{__html:i}}),G.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]})}renderFrameContainer(){const i=Wc(),o={...i.frame.common};return G.jsx("div",{style:i.modalContainer,className:"gh-root-frame",children:G.jsxs(Hc,{style:o,title:"portal-popup",head:this.renderFrameStyles(),searchdir:this.context.dir,children:[G.jsx("div",{onClick:l=>this.handlePopupClose(l),className:"absolute top-0 bottom-0 left-0 right-0 block backdrop-blur-[2px] animate-fadein z-0 bg-gradient-to-br from-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.1)]"}),G.jsx(Qc,{})]})})}render(){const{showPopup:i}=this.context;return i?this.renderFrameContainer():null}}var ie;function Ge(r,i,o){const l=typeof o,a=typeof r;if(l!=="undefined"){if(a!=="undefined"){if(o){if(a==="function"&&l===a)return function(v){return r(o(v))};if(i=r.constructor,i===o.constructor){if(i===Array)return o.concat(r);if(i===Map){var d=new Map(o);for(var m of r)d.set(m[0],m[1]);return d}if(i===Set){m=new Set(o);for(d of r.values())m.add(d);return m}}}return r}return o}return a==="undefined"?i:r}function Vn(r,i){return typeof r>"u"?i:r}function Ke(){return Object.create(null)}function $t(r){return typeof r=="string"}function Sr(r){return typeof r=="object"}function kr(r,i){if($t(i))r=r[i];else for(let o=0;r&&o<i.length;o++)r=r[i[o]];return r}const pf=/[^\p{L}\p{N}]+/u,gf=/(\d{3})/g,mf=/(\D)(\d{3})/g,yf=/(\d{3})(\D)/g,Ul=/[\u0300-\u036f]/g;function Hn(r={}){if(!this||this.constructor!==Hn)return new Hn(...arguments);if(arguments.length)for(r=0;r<arguments.length;r++)this.assign(arguments[r]);else this.assign(r)}ie=Hn.prototype,ie.assign=function(r){this.normalize=Ge(r.normalize,!0,this.normalize);let i=r.include,o=i||r.exclude||r.split,l;if(o||o===""){if(typeof o=="object"&&o.constructor!==RegExp){let a="";l=!i,i||(a+="\\p{Z}"),o.letter&&(a+="\\p{L}"),o.number&&(a+="\\p{N}",l=!!i),o.symbol&&(a+="\\p{S}"),o.punctuation&&(a+="\\p{P}"),o.control&&(a+="\\p{C}"),(o=o.char)&&(a+=typeof o=="object"?o.join(""):o);try{this.split=new RegExp("["+(i?"^":"")+a+"]+","u")}catch{this.split=/\s+/}}else this.split=o,l=o===!1||"a1a".split(o).length<2;this.numeric=Ge(r.numeric,l)}else{try{this.split=Ge(this.split,pf)}catch{this.split=/\s+/}this.numeric=Ge(r.numeric,Ge(this.numeric,!0))}if(this.prepare=Ge(r.prepare,null,this.prepare),this.finalize=Ge(r.finalize,null,this.finalize),o=r.filter,this.filter=typeof o=="function"?o:Ge(o&&new Set(o),null,this.filter),this.dedupe=Ge(r.dedupe,!0,this.dedupe),this.matcher=Ge((o=r.matcher)&&new Map(o),null,this.matcher),this.mapper=Ge((o=r.mapper)&&new Map(o),null,this.mapper),this.stemmer=Ge((o=r.stemmer)&&new Map(o),null,this.stemmer),this.replacer=Ge(r.replacer,null,this.replacer),this.minlength=Ge(r.minlength,1,this.minlength),this.maxlength=Ge(r.maxlength,1024,this.maxlength),this.rtl=Ge(r.rtl,!1,this.rtl),(this.cache=o=Ge(r.cache,!0,this.cache))&&(this.F=null,this.L=typeof o=="number"?o:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const a of this.matcher.keys())this.h+=(this.h?"|":"")+a;if(this.stemmer)for(const a of this.stemmer.keys())this.A+=(this.A?"|":"")+a;return this},ie.addStemmer=function(r,i){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(r,i),this.A+=(this.A?"|":"")+r,this.K=null,this.cache&&kn(this),this},ie.addFilter=function(r){return typeof r=="function"?this.filter=r:(this.filter||(this.filter=new Set),this.filter.add(r)),this.cache&&kn(this),this},ie.addMapper=function(r,i){return typeof r=="object"?this.addReplacer(r,i):r.length>1?this.addMatcher(r,i):(this.mapper||(this.mapper=new Map),this.mapper.set(r,i),this.cache&&kn(this),this)},ie.addMatcher=function(r,i){return typeof r=="object"?this.addReplacer(r,i):r.length<2&&(this.dedupe||this.mapper)?this.addMapper(r,i):(this.matcher||(this.matcher=new Map),this.matcher.set(r,i),this.h+=(this.h?"|":"")+r,this.J=null,this.cache&&kn(this),this)},ie.addReplacer=function(r,i){return typeof r=="string"?this.addMatcher(r,i):(this.replacer||(this.replacer=[]),this.replacer.push(r,i),this.cache&&kn(this),this)},ie.encode=function(r,i){if(this.cache&&r.length<=this.H)if(this.F){if(this.B.has(r))return this.B.get(r)}else this.F=setTimeout(kn,50,this);this.normalize&&(typeof this.normalize=="function"?r=this.normalize(r):r=Ul?r.normalize("NFKD").replace(Ul,"").toLowerCase():r.toLowerCase()),this.prepare&&(r=this.prepare(r)),this.numeric&&r.length>3&&(r=r.replace(mf,"$1 $2").replace(yf,"$1 $2").replace(gf,"$1 "));const o=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let l=[],a=Ke(),d,m,v=this.split||this.split===""?r.split(this.split):[r];for(let C=0,E,L;C<v.length;C++)if((E=L=v[C])&&!(E.length<this.minlength||E.length>this.maxlength)){if(i){if(a[E])continue;a[E]=1}else{if(d===E)continue;d=E}if(o)l.push(E);else if(!this.filter||(typeof this.filter=="function"?this.filter(E):!this.filter.has(E))){if(this.cache&&E.length<=this.I)if(this.F){var y=this.D.get(E);if(y||y===""){y&&l.push(y);continue}}else this.F=setTimeout(kn,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let F;for(;F!==E&&E.length>2;)F=E,E=E.replace(this.K,M=>this.stemmer.get(M))}if(E&&(this.mapper||this.dedupe&&E.length>1)){y="";for(let F=0,M="",V,R;F<E.length;F++)V=E.charAt(F),V===M&&this.dedupe||((R=this.mapper&&this.mapper.get(V))||R===""?R===M&&this.dedupe||!(M=R)||(y+=R):y+=M=V);E=y}if(this.matcher&&E.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),E=E.replace(this.J,F=>this.matcher.get(F))),E&&this.replacer)for(y=0;E&&y<this.replacer.length;y+=2)E=E.replace(this.replacer[y],this.replacer[y+1]);if(this.cache&&L.length<=this.I&&(this.D.set(L,E),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),E){if(E!==L)if(i){if(a[E])continue;a[E]=1}else{if(m===E)continue;m=E}l.push(E)}}}return this.finalize&&(l=this.finalize(l)||l),this.cache&&r.length<=this.H&&(this.B.set(r,l),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),l};function kn(r){r.F=null,r.B.clear(),r.D.clear()}function _i(r,i,o){o||(i||typeof r!="object"?typeof i=="object"&&(o=i,i=0):o=r),o&&(r=o.query||r,i=o.limit||i);let l=""+(i||0);o&&(l+=(o.offset||0)+!!o.context+!!o.suggest+(o.resolve!==!1)+(o.resolution||this.resolution)+(o.boost||0)),r=(""+r).toLowerCase(),this.cache||(this.cache=new Cn);let a=this.cache.get(r+l);if(!a){const d=o&&o.cache;d&&(o.cache=!1),a=this.search(r,i,o),d&&(o.cache=d),this.cache.set(r+l,a)}return a}function Cn(r){this.limit=r&&r!==!0?r:1e3,this.cache=new Map,this.h=""}Cn.prototype.set=function(r,i){this.cache.set(this.h=r,i),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},Cn.prototype.get=function(r){const i=this.cache.get(r);return i&&this.h!==r&&(this.cache.delete(r),this.cache.set(this.h=r,i)),i},Cn.prototype.remove=function(r){for(const i of this.cache){const o=i[0];i[1].includes(r)&&this.cache.delete(o)}},Cn.prototype.clear=function(){this.cache.clear(),this.h=""};const Bl={normalize:!1,numeric:!1,dedupe:!1},gs={},Ii=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),Vl=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Hl=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],bl={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var zi={Exact:Bl,Default:gs,Normalize:gs,LatinBalance:{mapper:Ii},LatinAdvanced:{mapper:Ii,matcher:Vl,replacer:Hl},LatinExtra:{mapper:Ii,replacer:Hl.concat([/(?!^)[aeo]/g,""]),matcher:Vl},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(r){for(let o=0;o<r.length;o++){var i=r[o];let l=i.charAt(0),a=bl[l];for(let d=1,m;d<i.length&&(m=i.charAt(d),m==="h"||m==="w"||!(m=bl[m])||m===a||(l+=m,a=m,l.length!==4));d++);r[o]=l}}},CJK:{split:""},LatinExact:Bl,LatinDefault:gs,LatinSimple:gs};function Kl(r,i,o,l){let a=[];for(let d=0,m;d<r.index.length;d++)if(m=r.index[d],i>=m.length)i-=m.length;else{i=m[l?"splice":"slice"](i,o);const v=i.length;if(v&&(a=a.length?a.concat(i):i,o-=v,l&&(r.length-=v),!o))break;i=0}return a}function bn(r){if(!this||this.constructor!==bn)return new bn(r);this.index=r?[r]:[],this.length=r?r.length:0;const i=this;return new Proxy([],{get(o,l){if(l==="length")return i.length;if(l==="push")return function(a){i.index[i.index.length-1].push(a),i.length++};if(l==="pop")return function(){if(i.length)return i.length--,i.index[i.index.length-1].pop()};if(l==="indexOf")return function(a){let d=0;for(let m=0,v,y;m<i.index.length;m++){if(v=i.index[m],y=v.indexOf(a),y>=0)return d+y;d+=v.length}return-1};if(l==="includes")return function(a){for(let d=0;d<i.index.length;d++)if(i.index[d].includes(a))return!0;return!1};if(l==="slice")return function(a,d){return Kl(i,a||0,d||i.length,!1)};if(l==="splice")return function(a,d){return Kl(i,a||0,d||i.length,!0)};if(l==="constructor")return Array;if(typeof l!="symbol")return(o=i.index[l/2**31|0])&&o[l]},set(o,l,a){return o=l/2**31|0,(i.index[o]||(i.index[o]=[]))[l]=a,i.length++,!0}})}bn.prototype.clear=function(){this.index.length=0},bn.prototype.push=function(){};function Pt(r=8){if(!this||this.constructor!==Pt)return new Pt(r);this.index=Ke(),this.h=[],this.size=0,r>32?(this.B=Ql,this.A=BigInt(r)):(this.B=Wl,this.A=r)}Pt.prototype.get=function(r){const i=this.index[this.B(r)];return i&&i.get(r)},Pt.prototype.set=function(r,i){var o=this.B(r);let l=this.index[o];l?(o=l.size,l.set(r,i),(o-=l.size)&&this.size++):(this.index[o]=l=new Map([[r,i]]),this.h.push(l),this.size++)};function Et(r=8){if(!this||this.constructor!==Et)return new Et(r);this.index=Ke(),this.h=[],this.size=0,r>32?(this.B=Ql,this.A=BigInt(r)):(this.B=Wl,this.A=r)}Et.prototype.add=function(r){var i=this.B(r);let o=this.index[i];o?(i=o.size,o.add(r),(i-=o.size)&&this.size++):(this.index[i]=o=new Set([r]),this.h.push(o),this.size++)},ie=Pt.prototype,ie.has=Et.prototype.has=function(r){const i=this.index[this.B(r)];return i&&i.has(r)},ie.delete=Et.prototype.delete=function(r){const i=this.index[this.B(r)];i&&i.delete(r)&&this.size--},ie.clear=Et.prototype.clear=function(){this.index=Ke(),this.h=[],this.size=0},ie.values=Et.prototype.values=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].values())yield i},ie.keys=Et.prototype.keys=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].keys())yield i},ie.entries=Et.prototype.entries=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].entries())yield i};function Wl(r){let i=2**this.A-1;if(typeof r=="number")return r&i;let o=0,l=this.A+1;for(let a=0;a<r.length;a++)o=(o*l^r.charCodeAt(a))&i;return this.A===32?o+2**31:o}function Ql(r){let i=BigInt(2)**this.A-BigInt(1);var o=typeof r;if(o==="bigint")return r&i;if(o==="number")return BigInt(r)&i;o=BigInt(0);let l=this.A+BigInt(1);for(let a=0;a<r.length;a++)o=(o*l^BigInt(r.charCodeAt(a)))&i;return o}let Kn,Cr;async function vf(r){r=r.data;var i=r.task;const o=r.id;let l=r.args;if(i==="init")Cr=r.options||{},(i=r.factory)?(Function("return "+i)()(self),Kn=new self.FlexSearch.Index(Cr),delete self.FlexSearch):Kn=new Ot(Cr),postMessage({id:o});else{let a;i==="export"&&(l[1]?(l[0]=Cr.export,l[2]=0,l[3]=1):l=null),i==="import"?l[0]&&(r=await Cr.import.call(Kn,l[0]),Kn.import(l[0],r)):((a=l&&Kn[i].apply(Kn,l))&&a.then&&(a=await a),a&&a.await&&(a=await a.await),i==="search"&&a.result&&(a=a.result)),postMessage(i==="search"?{id:o,msg:a}:{id:o})}}function Mi(r){Wn.call(r,"add"),Wn.call(r,"append"),Wn.call(r,"search"),Wn.call(r,"update"),Wn.call(r,"remove"),Wn.call(r,"searchCache")}let Fi,Yl,ms;function wf(){Fi=ms=0}function Wn(r){this[r+"Async"]=function(){const i=arguments;var o=i[i.length-1];let l;if(typeof o=="function"&&(l=o,delete i[i.length-1]),Fi?ms||(ms=Date.now()-Yl>=this.priority*this.priority*3):(Fi=setTimeout(wf,0),Yl=Date.now()),ms){const d=this;return new Promise(m=>{setTimeout(function(){m(d[r+"Async"].apply(d,i))},0)})}const a=this[r].apply(this,i);return o=a.then?a:new Promise(d=>d(a)),l&&o.then(l),o}}let Zt=0;function Qn(r={},i){function o(v){function y(C){C=C.data||C;const E=C.id,L=E&&d.h[E];L&&(L(C.msg),delete d.h[E])}if(this.worker=v,this.h=Ke(),this.worker)return a?this.worker.on("message",y):this.worker.onmessage=y,r.config?new Promise(function(C){Zt>1e9&&(Zt=0),d.h[++Zt]=function(){C(d)},d.worker.postMessage({id:Zt,task:"init",factory:l,options:r})}):(this.priority=r.priority||4,this.encoder=i||null,this.worker.postMessage({task:"init",factory:l,options:r}),this)}if(!this||this.constructor!==Qn)return new Qn(r);let l=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;l&&(l=l.toString());const a=typeof window>"u",d=this,m=xf(l,a,r.worker);return m.then?m.then(function(v){return o.call(d,v)}):o.call(this,m)}Gt("add"),Gt("append"),Gt("search"),Gt("update"),Gt("remove"),Gt("clear"),Gt("export"),Gt("import"),Qn.prototype.searchCache=_i,Mi(Qn.prototype);function Gt(r){Qn.prototype[r]=function(){const i=this,o=[].slice.call(arguments);var l=o[o.length-1];let a;return typeof l=="function"&&(a=l,o.pop()),l=new Promise(function(d){r==="export"&&typeof o[0]=="function"&&(o[0]=null),Zt>1e9&&(Zt=0),i.h[++Zt]=d,i.worker.postMessage({task:r,id:Zt,args:o})}),a?(l.then(a),this):l}}function xf(r,i,o){return i?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>rd).then(function(l){return new l.Worker("undefined/node/node.mjs")}):r?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+vf.toString()],{type:"text/javascript"}))):new window.Worker(typeof o=="string"?o:(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Un&&Un.tagName.toUpperCase()==="SCRIPT"&&Un.src||new URL("sodo-search.min.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}$n.prototype.add=function(r,i,o){if(Sr(r)&&(i=r,r=kr(i,this.key)),i&&(r||r===0)){if(!o&&this.reg.has(r))return this.update(r,i);for(let v=0,y;v<this.field.length;v++){y=this.B[v];var l=this.index.get(this.field[v]);if(typeof y=="function"){var a=y(i);a&&l.add(r,a,o,!0)}else a=y.G,(!a||a(i))&&(y.constructor===String?y=[""+y]:$t(y)&&(y=[y]),Ui(i,y,this.D,0,l,r,y[0],o))}if(this.tag)for(l=0;l<this.A.length;l++){var d=this.A[l];a=this.tag.get(this.F[l]);let v=Ke();if(typeof d=="function"){if(d=d(i),!d)continue}else{var m=d.G;if(m&&!m(i))continue;d.constructor===String&&(d=""+d),d=kr(i,d)}if(a&&d){$t(d)&&(d=[d]);for(let y=0,C,E;y<d.length;y++)if(C=d[y],!v[C]&&(v[C]=1,(m=a.get(C))?E=m:a.set(C,E=[]),!o||!E.includes(r))){if(E.length===2**31-1){if(m=new bn(E),this.fastupdate)for(let L of this.reg.values())L.includes(E)&&(L[L.indexOf(E)]=m);a.set(C,E=m)}E.push(r),this.fastupdate&&((m=this.reg.get(r))?m.push(E):this.reg.set(r,[E]))}}}if(this.store&&(!o||!this.store.has(r))){let v;if(this.h){v=Ke();for(let y=0,C;y<this.h.length;y++){if(C=this.h[y],(o=C.G)&&!o(i))continue;let E;if(typeof C=="function"){if(E=C(i),!E)continue;C=[C.O]}else if($t(C)||C.constructor===String){v[C]=i[C];continue}Di(i,v,C,0,C[0],E)}}this.store.set(r,v||i)}this.worker&&(this.fastupdate||this.reg.add(r))}return this};function Di(r,i,o,l,a,d){if(r=r[a],l===o.length-1)i[a]=d||r;else if(r)if(r.constructor===Array)for(i=i[a]=Array(r.length),a=0;a<r.length;a++)Di(r,i,o,l,a);else i=i[a]||(i[a]=Ke()),a=o[++l],Di(r,i,o,l,a)}function Ui(r,i,o,l,a,d,m,v){if(r=r[m])if(l===i.length-1){if(r.constructor===Array){if(o[l]){for(i=0;i<r.length;i++)a.add(d,r[i],!0,!0);return}r=r.join(" ")}a.add(d,r,v,!0)}else if(r.constructor===Array)for(m=0;m<r.length;m++)Ui(r,i,o,l,a,d,m,v);else m=i[++l],Ui(r,i,o,l,a,d,m,v)}function Bi(r,i,o,l){if(!r.length)return r;if(r.length===1)return r=r[0],r=o||r.length>i?r.slice(o,o+i):r,l?Yn.call(this,r):r;let a=[];for(let d=0,m,v;d<r.length;d++)if((m=r[d])&&(v=m.length)){if(o){if(o>=v){o-=v;continue}m=m.slice(o,o+i),v=m.length,o=0}if(v>i&&(m=m.slice(0,i),v=i),!a.length&&v>=i)return l?Yn.call(this,m):m;if(a.push(m),i-=v,!i)break}return a=a.length>1?[].concat.apply([],a):a[0],l?Yn.call(this,a):a}function ys(r,i,o,l){var a=l[0];if(a[0]&&a[0].query)return r[i].apply(r,a);if(!(i!=="and"&&i!=="not"||r.result.length||r.await||a.suggest))return l.length>1&&(a=l[l.length-1]),(l=a.resolve)?r.await||r.result:r;let d=[],m=0,v=0,y,C,E,L,F;for(i=0;i<l.length;i++)if(a=l[i]){var M=void 0;if(a.constructor===Fe)M=a.await||a.result;else if(a.then||a.constructor===Array)M=a;else{m=a.limit||0,v=a.offset||0,E=a.suggest,C=a.resolve,y=((L=a.highlight||r.highlight)||a.enrich)&&C,M=a.queue;let V=a.async||M,R=a.index,O=a.query;if(R?r.index||(r.index=R):R=r.index,O||a.tag){const J=a.field||a.pluck;if(J&&(!O||r.query&&!L||(r.query=O,r.field=J,r.highlight=L),R=R.index.get(J)),M&&(F||r.await)){F=1;let X;const fe=r.C.length,de=new Promise(function(he){X=he});(function(he,ae){de.h=function(){ae.index=null,ae.resolve=!1;let ue=V?he.searchAsync(ae):he.search(ae);return ue.then?ue.then(function(q){return r.C[fe]=q=q.result||q,X(q),q}):(ue=ue.result||ue,X(ue),ue)}})(R,Object.assign({},a)),r.C.push(de),d[i]=de;continue}else a.resolve=!1,a.index=null,M=V?R.searchAsync(a):R.search(a),a.resolve=C,a.index=R}else if(a.and)M=vs(a,"and",R);else if(a.or)M=vs(a,"or",R);else if(a.not)M=vs(a,"not",R);else if(a.xor)M=vs(a,"xor",R);else continue}M.await?(F=1,M=M.await):M.then?(F=1,M=M.then(function(V){return V.result||V})):M=M.result||M,d[i]=M}if(F&&!r.await&&(r.await=new Promise(function(V){r.return=V})),F){const V=Promise.all(d).then(function(R){for(let O=0;O<r.C.length;O++)if(r.C[O]===V){r.C[O]=function(){return o.call(r,R,m,v,y,C,E,L)};break}Vi(r)});r.C.push(V)}else if(r.await)r.C.push(function(){return o.call(r,d,m,v,y,C,E,L)});else return o.call(r,d,m,v,y,C,E,L);return C?r.await||r.result:r}function vs(r,i,o){r=r[i];const l=r[0]||r;return l.index||(l.index=o),o=new Fe(l),r.length>1&&(o=o[i].apply(o,r.slice(1))),o}Fe.prototype.or=function(){return ys(this,"or",Sf,arguments)};function Sf(r,i,o,l,a,d,m){return r.length&&(this.result.length&&r.push(this.result),r.length<2?this.result=r[0]:(this.result=Jl(r,i,o,!1,this.h),o=0)),a&&(this.await=null),a?this.resolve(i,o,l,m):this}Fe.prototype.and=function(){return ys(this,"and",kf,arguments)};function kf(r,i,o,l,a,d,m){if(!d&&!this.result.length)return a?this.result:this;let v;if(r.length)if(this.result.length&&r.unshift(this.result),r.length<2)this.result=r[0];else{let y=0;for(let C=0,E,L;C<r.length;C++)if((E=r[C])&&(L=E.length))y<L&&(y=L);else if(!d){y=0;break}y?(this.result=xs(r,y,i,o,d,this.h,a),v=!0):this.result=[]}else d||(this.result=r);return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}Fe.prototype.xor=function(){return ys(this,"xor",Cf,arguments)};function Cf(r,i,o,l,a,d,m){if(r.length)if(this.result.length&&r.unshift(this.result),r.length<2)this.result=r[0];else{e:{d=o;var v=this.h;const y=[],C=Ke();let E=0;for(let L=0,F;L<r.length;L++)if(F=r[L]){E<F.length&&(E=F.length);for(let M=0,V;M<F.length;M++)if(V=F[M])for(let R=0,O;R<V.length;R++)O=V[R],C[O]=C[O]?2:1}for(let L=0,F,M=0;L<E;L++)for(let V=0,R;V<r.length;V++)if((R=r[V])&&(F=R[L])){for(let O=0,J;O<F.length;O++)if(J=F[O],C[J]===1)if(d)d--;else if(a){if(y.push(J),y.length===i){r=y;break e}}else{const X=L+(V?v:0);if(y[X]||(y[X]=[]),y[X].push(J),++M===i){r=y;break e}}}r=y}this.result=r,v=!0}else d||(this.result=r);return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}Fe.prototype.not=function(){return ys(this,"not",$f,arguments)};function $f(r,i,o,l,a,d,m){if(!d&&!this.result.length)return a?this.result:this;if(r.length&&this.result.length){e:{d=o;var v=[];r=new Set(r.flat().flat());for(let y=0,C,E=0;y<this.result.length;y++)if(C=this.result[y]){for(let L=0,F;L<C.length;L++)if(F=C[L],!r.has(F)){if(d)d--;else if(a){if(v.push(F),v.length===i){r=v;break e}}else if(v[y]||(v[y]=[]),v[y].push(F),++E===i){r=v;break e}}}r=v}this.result=r,v=!0}return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}function ws(r,i,o,l,a){let d,m,v;typeof a=="string"?(d=a,a=""):d=a.template,m=d.indexOf("$1"),v=d.substring(m+2),m=d.substring(0,m);let y=a&&a.boundary,C=!a||a.clip!==!1,E=a&&a.merge&&v&&m&&new RegExp(v+" "+m,"g");a=a&&a.ellipsis;var L=0;if(typeof a=="object"){var F=a.template;L=F.length-2,a=a.pattern}typeof a!="string"&&(a=a===!1?"":"..."),L&&(a=F.replace("$1",a)),F=a.length-L;let M,V;typeof y=="object"&&(M=y.before,M===0&&(M=-1),V=y.after,V===0&&(V=-1),y=y.total||9e5),L=new Map;for(let A=0,Q,me,je;A<i.length;A++){let B;if(l)B=i,je=l;else{var R=i[A];if(je=R.field,!je)continue;B=R.result}me=o.get(je),Q=me.encoder,R=L.get(Q),typeof R!="string"&&(R=Q.encode(r),L.set(Q,R));for(let ee=0;ee<B.length;ee++){var O=B[ee].doc;if(!O||(O=kr(O,je),!O))continue;var J=O.trim().split(/\s+/);if(!J.length)continue;O="";var X=[];let Z=[];for(var fe=-1,de=-1,he=0,ae=0;ae<J.length;ae++){var ue=J[ae],q=Q.encode(ue);q=q.length>1?q.join(" "):q[0];let K;if(q&&ue){for(var oe=ue.length,Pe=(Q.split?ue.replace(Q.split,""):ue).length-q.length,xe="",Ee=0,ke=0;ke<R.length;ke++){var Re=R[ke];if(Re){var ye=Re.length;ye+=Pe<0?0:Pe,Ee&&ye<=Ee||(Re=q.indexOf(Re),Re>-1&&(xe=(Re?ue.substring(0,Re):"")+m+ue.substring(Re,Re+ye)+v+(Re+ye<oe?ue.substring(Re+ye):""),Ee=ye,K=!0))}}xe&&(y&&(fe<0&&(fe=O.length+(O?1:0)),de=O.length+(O?1:0)+xe.length,he+=oe,Z.push(X.length),X.push({match:xe})),O+=(O?" ":"")+xe)}if(!K)ue=J[ae],O+=(O?" ":"")+ue,y&&X.push({text:ue});else if(y&&he>=y)break}if(he=Z.length*(d.length-2),M||V||y&&O.length-he>y)if(he=y+he-F*2,ae=de-fe,M>0&&(ae+=M),V>0&&(ae+=V),ae<=he)J=M?fe-(M>0?M:0):fe-((he-ae)/2|0),X=V?de+(V>0?V:0):J+he,C||(J>0&&O.charAt(J)!==" "&&O.charAt(J-1)!==" "&&(J=O.indexOf(" ",J),J<0&&(J=0)),X<O.length&&O.charAt(X-1)!==" "&&O.charAt(X)!==" "&&(X=O.lastIndexOf(" ",X),X<de?X=de:++X)),O=(J?a:"")+O.substring(J,X)+(X<O.length?a:"");else{for(de=[],fe={},he={},ae={},ue={},q={},xe=Pe=oe=0,ke=Ee=1;;){var De=void 0;for(let K=0,ne;K<Z.length;K++){if(ne=Z[K],xe)if(Pe!==xe){if(ae[K+1])continue;if(ne+=xe,fe[ne]){oe-=F,he[K+1]=1,ae[K+1]=1;continue}if(ne>=X.length-1){if(ne>=X.length){ae[K+1]=1,ne>=J.length&&(he[K+1]=1);continue}oe-=F}if(O=X[ne].text,ye=V&&q[K])if(ye>0){if(O.length>ye)if(ae[K+1]=1,C)O=O.substring(0,ye);else continue;(ye-=O.length)||(ye=-1),q[K]=ye}else{ae[K+1]=1;continue}if(oe+O.length+1<=y)O=" "+O,de[K]+=O;else if(C)De=y-oe-1,De>0&&(O=" "+O.substring(0,De),de[K]+=O),ae[K+1]=1;else{ae[K+1]=1;continue}}else{if(ae[K])continue;if(ne-=Pe,fe[ne]){oe-=F,ae[K]=1,he[K]=1;continue}if(ne<=0){if(ne<0){ae[K]=1,he[K]=1;continue}oe-=F}if(O=X[ne].text,ye=M&&ue[K])if(ye>0){if(O.length>ye)if(ae[K]=1,C)O=O.substring(O.length-ye);else continue;(ye-=O.length)||(ye=-1),ue[K]=ye}else{ae[K]=1;continue}if(oe+O.length+1<=y)O+=" ",de[K]=O+de[K];else if(C)De=O.length+1-(y-oe),De>=0&&De<O.length&&(O=O.substring(De)+" ",de[K]=O+de[K]),ae[K]=1;else{ae[K]=1;continue}}else{O=X[ne].match,M&&(ue[K]=M),V&&(q[K]=V),K&&oe++;let _e;if(ne?!K&&F&&(oe+=F):(he[K]=1,ae[K]=1),ne>=J.length-1||ne<X.length-1&&X[ne+1].match?_e=1:F&&(oe+=F),oe-=d.length-2,!K||oe+O.length<=y)de[K]=O;else{De=Ee=ke=he[K]=0;break}_e&&(he[K+1]=1,ae[K+1]=1)}oe+=O.length,De=fe[ne]=1}if(De)Pe===xe?xe++:Pe++;else{if(Pe===xe?Ee=0:ke=0,!Ee&&!ke)break;Ee?(Pe++,xe=Pe):xe++}}O="";for(let K=0,ne;K<de.length;K++)ne=(he[K]?K?" ":"":(K&&!a?" ":"")+a)+de[K],O+=ne;a&&!he[de.length]&&(O+=a)}E&&(O=O.replace(E," ")),B[ee].highlight=O}if(l)break}return i}function Fe(r,i){if(!this||this.constructor!==Fe)return new Fe(r,i);let o=0,l,a,d,m,v,y;if(r&&r.index){const C=r;if(i=C.index,o=C.boost||0,a=C.query){d=C.field||C.pluck,m=C.highlight;const E=C.resolve;r=C.async||C.queue,C.resolve=!1,C.index=null,r=r?i.searchAsync(C):i.search(C),C.resolve=E,C.index=i,r=r.result||r}else r=[]}if(r&&r.then){const C=this;r=r.then(function(E){C.C[0]=C.result=E.result||E,Vi(C)}),l=[r],r=[],v=new Promise(function(E){y=E})}this.index=i||null,this.result=r||[],this.h=o,this.C=l||[],this.await=v||null,this.return=y||null,this.highlight=m||null,this.query=a||"",this.field=d||""}ie=Fe.prototype,ie.limit=function(r){if(this.await){const i=this;this.C.push(function(){return i.limit(r).result})}else if(this.result.length){const i=[];for(let o=0,l;o<this.result.length;o++)if(l=this.result[o])if(l.length<=r){if(i[o]=l,r-=l.length,!r)break}else{i[o]=l.slice(0,r);break}this.result=i}return this},ie.offset=function(r){if(this.await){const i=this;this.C.push(function(){return i.offset(r).result})}else if(this.result.length){const i=[];for(let o=0,l;o<this.result.length;o++)(l=this.result[o])&&(l.length<=r?r-=l.length:(i[o]=l.slice(r),r=0));this.result=i}return this},ie.boost=function(r){if(this.await){const i=this;this.C.push(function(){return i.boost(r).result})}else this.h+=r;return this};function Vi(r,i){let o=r.result;var l=r.await;r.await=null;for(let a=0,d;a<r.C.length;a++)if(d=r.C[a]){if(typeof d=="function")o=d(),r.C[a]=o=o.result||o,a--;else if(d.h)o=d.h(),r.C[a]=o=o.result||o,a--;else if(d.then)return r.await=l}return l=r.return,r.C=[],r.return=null,i||l(o),o}ie.resolve=function(r,i,o,l,a){let d=this.await?Vi(this,!0):this.result;if(d.then){const m=this;return d.then(function(){return m.resolve(r,i,o,l,a)})}return d.length&&(typeof r=="object"?(l=r.highlight||this.highlight,o=!!l||r.enrich,i=r.offset,r=r.limit):(l=l||this.highlight,o=!!l||o),d=a?o?Yn.call(this.index,d):d:Bi.call(this.index,d,r||100,i,o)),this.finalize(d,l)},ie.finalize=function(r,i){if(r.then){const l=this;return r.then(function(a){return l.finalize(a,i)})}i&&r.length&&this.query&&(r=ws(this.query,r,this.index.index,this.field,i));const o=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",o&&o(r),r};function xs(r,i,o,l,a,d,m){const v=r.length;let y=[],C,E;C=Ke();for(let L=0,F,M,V,R;L<i;L++)for(let O=0;O<v;O++)if(V=r[O],L<V.length&&(F=V[L]))for(let J=0;J<F.length;J++){if(M=F[J],(E=C[M])?C[M]++:(E=0,C[M]=1),R=y[E]||(y[E]=[]),!m){let X=L+(O||!a?0:d||0);R=R[X]||(R[X]=[])}if(R.push(M),m&&o&&E===v-1&&R.length-l===o)return l?R.slice(l):R}if(r=y.length)if(a)y=y.length>1?Jl(y,o,l,m,d):(y=y[0])&&o&&y.length>o||l?y.slice(l,o+l):y;else{if(r<v)return[];if(y=y[r-1],o||l)if(m)(y.length>o||l)&&(y=y.slice(l,o+l));else{a=[];for(let L=0,F;L<y.length;L++)if(F=y[L]){if(l&&F.length>l)l-=F.length;else if((o&&F.length>o||l)&&(F=F.slice(l,o+l),o-=F.length,l&&(l-=F.length)),a.push(F),!o)break}y=a}}return y}function Jl(r,i,o,l,a){const d=[],m=Ke();let v;var y=r.length;let C;if(l){for(a=y-1;a>=0;a--)if(C=(l=r[a])&&l.length){for(y=0;y<C;y++)if(v=l[y],!m[v]){if(m[v]=1,o)o--;else if(d.push(v),d.length===i)return d}}}else for(let E=y-1,L,F=0;E>=0;E--){L=r[E];for(let M=0;M<L.length;M++)if(C=(l=L[M])&&l.length){for(let V=0;V<C;V++)if(v=l[V],!m[v])if(m[v]=1,o)o--;else{let R=(M+(E<y-1&&a||0))/(E+1)|0;if((d[R]||(d[R]=[])).push(v),++F===i)return d}}}return d}function Pf(r,i,o,l,a){const d=Ke(),m=[];for(let v=0,y;v<i.length;v++){y=i[v];for(let C=0;C<y.length;C++)d[y[C]]=1}if(a){for(let v=0,y;v<r.length;v++)if(y=r[v],d[y]){if(l)l--;else if(m.push(y),d[y]=0,o&&--o===0)break}}else for(let v=0,y,C;v<r.result.length;v++)for(y=r.result[v],i=0;i<y.length;i++)C=y[i],d[C]&&((m[v]||(m[v]=[])).push(C),d[C]=0);return m}$n.prototype.search=function(r,i,o,l){o||(!i&&Sr(r)?(o=r,r=""):Sr(i)&&(o=i,i=0));let a=[];var d=[];let m,v,y,C,E,L,F=0,M=!0,V;if(o){o.constructor===Array&&(o={index:o}),r=o.query||r,m=o.pluck,v=o.merge,C=o.boost,L=m||o.field||(L=o.index)&&(L.index?null:L);var R=this.tag&&o.tag;y=o.suggest,M=o.resolve!==!1,E=o.cache,V=M&&this.store&&o.highlight;var O=!!V||M&&this.store&&o.enrich;i=o.limit||i;var J=o.offset||0;if(i||(i=M?100:0),R&&(!this.db||!l)){R.constructor!==Array&&(R=[R]);var X=[];for(let ue=0,q;ue<R.length;ue++)if(q=R[ue],q.field&&q.tag){var fe=q.tag;if(fe.constructor===Array)for(var de=0;de<fe.length;de++)X.push(q.field,fe[de]);else X.push(q.field,fe)}else{fe=Object.keys(q);for(let oe=0,Pe,xe;oe<fe.length;oe++)if(Pe=fe[oe],xe=q[Pe],xe.constructor===Array)for(de=0;de<xe.length;de++)X.push(Pe,xe[de]);else X.push(Pe,xe)}if(R=X,!r){if(d=[],X.length)for(R=0;R<X.length;R+=2){if(this.db){if(l=this.index.get(X[R]),!l)continue;d.push(l=l.db.tag(X[R+1],i,J,O))}else l=Ef.call(this,X[R],X[R+1],i,J,O);a.push(M?{field:X[R],tag:X[R+1],result:l}:[l])}if(d.length){const ue=this;return Promise.all(d).then(function(q){for(let oe=0;oe<q.length;oe++)M?a[oe].result=q[oe]:a[oe]=q[oe];return M?a:new Fe(a.length>1?xs(a,1,0,0,y,C):a[0],ue)})}return M?a:new Fe(a.length>1?xs(a,1,0,0,y,C):a[0],this)}}M||m||!(L=L||this.field)||($t(L)?m=L:(L.constructor===Array&&L.length===1&&(L=L[0]),m=L.field||L.index)),L&&L.constructor!==Array&&(L=[L])}L||(L=this.field);let he;X=(this.worker||this.db)&&!l&&[];for(let ue=0,q,oe,Pe;ue<L.length;ue++){if(oe=L[ue],this.db&&this.tag&&!this.B[ue])continue;let xe;if($t(oe)||(xe=oe,oe=xe.field,r=xe.query||r,i=Vn(xe.limit,i),J=Vn(xe.offset,J),y=Vn(xe.suggest,y),V=M&&this.store&&Vn(xe.highlight,V),O=!!V||M&&this.store&&Vn(xe.enrich,O),E=Vn(xe.cache,E)),l)q=l[ue];else{fe=xe||o||{},de=fe.enrich;var ae=this.index.get(oe);if(R&&(this.db&&(fe.tag=R,fe.field=L,he=ae.db.support_tag_search),!he&&de&&(fe.enrich=!1),he||(fe.limit=0,fe.offset=0)),q=E?ae.searchCache(r,R&&!he?0:i,fe):ae.search(r,R&&!he?0:i,fe),R&&!he&&(fe.limit=i,fe.offset=J),de&&(fe.enrich=de),X){X[ue]=q;continue}}if(Pe=(q=q.result||q)&&q.length,R&&Pe){if(fe=[],de=0,this.db&&l){if(!he)for(ae=L.length;ae<l.length;ae++){let Ee=l[ae];if(Ee&&Ee.length)de++,fe.push(Ee);else if(!y)return M?a:new Fe(a,this)}}else for(let Ee=0,ke,Re;Ee<R.length;Ee+=2){if(ke=this.tag.get(R[Ee]),!ke){if(y)continue;return M?a:new Fe(a,this)}if(Re=(ke=ke&&ke.get(R[Ee+1]))&&ke.length)de++,fe.push(ke);else if(!y)return M?a:new Fe(a,this)}if(de){if(q=Pf(q,fe,i,J,M),Pe=q.length,!Pe&&!y)return M?q:new Fe(q,this);de--}}if(Pe)d[F]=oe,a.push(q),F++;else if(L.length===1)return M?a:new Fe(a,this)}if(X){if(this.db&&R&&R.length&&!he)for(O=0;O<R.length;O+=2){if(d=this.index.get(R[O]),!d){if(y)continue;return M?a:new Fe(a,this)}X.push(d.db.tag(R[O+1],i,J,!1))}const ue=this;return Promise.all(X).then(function(q){return o&&(o.resolve=M),q.length&&(q=ue.search(r,i,o,q)),q})}if(!F)return M?a:new Fe(a,this);if(m&&(!O||!this.store))return a=a[0],M?a:new Fe(a,this);for(X=[],J=0;J<d.length;J++){if(R=a[J],O&&R.length&&typeof R[0].doc>"u"&&(this.db?X.push(R=this.index.get(this.field[0]).db.enrich(R)):R=Yn.call(this,R)),m)return M?V?ws(r,R,this.index,m,V):R:new Fe(R,this);a[J]={field:d[J],result:R}}if(O&&this.db&&X.length){const ue=this;return Promise.all(X).then(function(q){for(let oe=0;oe<q.length;oe++)a[oe].result=q[oe];return V&&(a=ws(r,a,ue.index,m,V)),v?Xl(a):a})}return V&&(a=ws(r,a,this.index,m,V)),v?Xl(a):a};function Xl(r){const i=[],o=Ke(),l=Ke();for(let a=0,d,m,v,y,C,E,L;a<r.length;a++){d=r[a],m=d.field,v=d.result;for(let F=0;F<v.length;F++)C=v[F],typeof C!="object"?C={id:y=C}:y=C.id,(E=o[y])?E.push(m):(C.field=o[y]=[m],i.push(C)),(L=C.highlight)&&(E=l[y],E||(l[y]=E={},C.highlight=E),E[m]=L)}return i}function Ef(r,i,o,l,a){return r=this.tag.get(r),r?(r=r.get(i),r?(i=r.length-l,i>0&&((o&&i>o||l)&&(r=r.slice(l,l+o)),a&&(r=Yn.call(this,r))),r):[]):[]}function Yn(r){if(!this||!this.store)return r;if(this.db)return this.index.get(this.field[0]).db.enrich(r);const i=Array(r.length);for(let o=0,l;o<r.length;o++)l=r[o],i[o]={id:l,doc:this.store.get(l)};return i}function $n(r){if(!this||this.constructor!==$n)return new $n(r);const i=r.document||r.doc||r;let o,l;if(this.B=[],this.field=[],this.D=[],this.key=(o=i.key||i.id)&&Ss(o,this.D)||"id",(l=r.keystore||0)&&(this.keystore=l),this.fastupdate=!!r.fastupdate,this.reg=!this.fastupdate||r.worker||r.db?l?new Et(l):new Set:l?new Pt(l):new Map,this.h=(o=i.store||null)&&o&&o!==!0&&[],this.store=o?l?new Pt(l):new Map:null,this.cache=(o=r.cache||null)&&new Cn(o),r.cache=!1,this.worker=r.worker||!1,this.priority=r.priority||4,this.index=Tf.call(this,r,i),this.tag=null,(o=i.tag)&&(typeof o=="string"&&(o=[o]),o.length)){this.tag=new Map,this.A=[],this.F=[];for(let a=0,d,m;a<o.length;a++){if(d=o[a],m=d.field||d,!m)throw Error("The tag field from the document descriptor is undefined.");d.custom?this.A[a]=d.custom:(this.A[a]=Ss(m,this.D),d.filter&&(typeof this.A[a]=="string"&&(this.A[a]=new String(this.A[a])),this.A[a].G=d.filter)),this.F[a]=m,this.tag.set(m,new Map)}}if(this.worker){this.fastupdate=!1,r=[];for(const a of this.index.values())a.then&&r.push(a);if(r.length){const a=this;return Promise.all(r).then(function(d){let m=0;for(const v of a.index.entries()){const y=v[0];let C=v[1];C.then&&(C=d[m],a.index.set(y,C),m++)}return a})}}else r.db&&(this.fastupdate=!1,this.mount(r.db))}ie=$n.prototype,ie.mount=function(r){let i=this.field;if(this.tag)for(let d=0,m;d<this.F.length;d++){m=this.F[d];var o=void 0;this.index.set(m,o=new Ot({},this.reg)),i===this.field&&(i=i.slice(0)),i.push(m),o.tag=this.tag.get(m)}o=[];const l={db:r.db,type:r.type,fastupdate:r.fastupdate};for(let d=0,m,v;d<i.length;d++){l.field=v=i[d],m=this.index.get(v);const y=new r.constructor(r.id,l);y.id=r.id,o[d]=y.mount(m),m.document=!0,d?m.bypass=!0:m.store=this.store}const a=this;return this.db=Promise.all(o).then(function(){a.db=!0})},ie.commit=async function(){const r=[];for(const i of this.index.values())r.push(i.commit());await Promise.all(r),this.reg.clear()},ie.destroy=function(){const r=[];for(const i of this.index.values())r.push(i.destroy());return Promise.all(r)};function Tf(r,i){const o=new Map;let l=i.index||i.field||i;$t(l)&&(l=[l]);for(let d=0,m,v;d<l.length;d++){if(m=l[d],$t(m)||(v=m,m=m.field),v=Sr(v)?Object.assign({},r,v):r,this.worker){var a=void 0;a=(a=v.encoder)&&a.encode?a:new Hn(typeof a=="string"?zi[a]:a||{}),a=new Qn(v,a),o.set(m,a)}this.worker||o.set(m,new Ot(v,this.reg)),v.custom?this.B[d]=v.custom:(this.B[d]=Ss(m,this.D),v.filter&&(typeof this.B[d]=="string"&&(this.B[d]=new String(this.B[d])),this.B[d].G=v.filter)),this.field[d]=m}if(this.h){r=i.store,$t(r)&&(r=[r]);for(let d=0,m,v;d<r.length;d++)m=r[d],v=m.field||m,m.custom?(this.h[d]=m.custom,m.custom.O=v):(this.h[d]=Ss(v,this.D),m.filter&&(typeof this.h[d]=="string"&&(this.h[d]=new String(this.h[d])),this.h[d].G=m.filter))}return o}function Ss(r,i){const o=r.split(":");let l=0;for(let a=0;a<o.length;a++)r=o[a],r[r.length-1]==="]"&&(r=r.substring(0,r.length-2))&&(i[l]=!0),r&&(o[l++]=r);return l<o.length&&(o.length=l),l>1?o:o[0]}ie.append=function(r,i){return this.add(r,i,!0)},ie.update=function(r,i){return this.remove(r).add(r,i)},ie.remove=function(r){Sr(r)&&(r=kr(r,this.key));for(var i of this.index.values())i.remove(r,!0);if(this.reg.has(r)){if(this.tag&&!this.fastupdate)for(let o of this.tag.values())for(let l of o){i=l[0];const a=l[1],d=a.indexOf(r);d>-1&&(a.length>1?a.splice(d,1):o.delete(i))}this.store&&this.store.delete(r),this.reg.delete(r)}return this.cache&&this.cache.remove(r),this},ie.clear=function(){const r=[];for(const i of this.index.values()){const o=i.clear();o.then&&r.push(o)}if(this.tag)for(const i of this.tag.values())i.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),r.length?Promise.all(r):this},ie.contain=function(r){return this.db?this.index.get(this.field[0]).db.has(r):this.reg.has(r)},ie.cleanup=function(){for(const r of this.index.values())r.cleanup();return this},ie.get=function(r){return this.db?this.index.get(this.field[0]).db.enrich(r).then(function(i){return i[0]&&i[0].doc||null}):this.store.get(r)||null},ie.set=function(r,i){return typeof r=="object"&&(i=r,r=kr(i,this.key)),this.store.set(r,i),this},ie.searchCache=_i,ie.export=jf,ie.import=Nf,Mi($n.prototype);function Hi(r,i=0){let o=[],l=[];i&&(i=25e4/i*5e3|0);for(const a of r.entries())l.push(a),l.length===i&&(o.push(l),l=[]);return l.length&&o.push(l),o}function bi(r,i){i||(i=new Map);for(let o=0,l;o<r.length;o++)l=r[o],i.set(l[0],l[1]);return i}function Zl(r,i=0){let o=[],l=[];i&&(i=25e4/i*1e3|0);for(const a of r.entries())l.push([a[0],Hi(a[1])[0]||[]]),l.length===i&&(o.push(l),l=[]);return l.length&&o.push(l),o}function Gl(r,i){i||(i=new Map);for(let o=0,l,a;o<r.length;o++)l=r[o],a=i.get(l[0]),i.set(l[0],bi(l[1],a));return i}function ql(r){let i=[],o=[];for(const l of r.keys())o.push(l),o.length===25e4&&(i.push(o),o=[]);return o.length&&i.push(o),i}function eu(r,i){i||(i=new Set);for(let o=0;o<r.length;o++)i.add(r[o]);return i}function ks(r,i,o,l,a,d,m=0){const v=l&&l.constructor===Array;var y=v?l.shift():l;if(!y)return this.export(r,i,a,d+1);if((y=r((i?i+".":"")+(m+1)+"."+o,JSON.stringify(y)))&&y.then){const C=this;return y.then(function(){return ks.call(C,r,i,o,v?l:null,a,d,m+1)})}return ks.call(this,r,i,o,v?l:null,a,d,m+1)}function jf(r,i,o=0,l=0){if(o<this.field.length){const m=this.field[o];if((i=this.index.get(m).export(r,m,o,l=1))&&i.then){const v=this;return i.then(function(){return v.export(r,m,o+1)})}return this.export(r,m,o+1)}let a,d;switch(l){case 0:a="reg",d=ql(this.reg),i=null;break;case 1:a="tag",d=this.tag&&Zl(this.tag,this.reg.size),i=null;break;case 2:a="doc",d=this.store&&Hi(this.store),i=null;break;default:return}return ks.call(this,r,i,a,d||null,o,l)}function Nf(r,i){var o=r.split(".");o[o.length-1]==="json"&&o.pop();const l=o.length>2?o[0]:"";if(o=o.length>2?o[2]:o[1],this.worker&&l)return this.index.get(l).import(r);if(i){if(typeof i=="string"&&(i=JSON.parse(i)),l)return this.index.get(l).import(o,i);switch(o){case"reg":this.fastupdate=!1,this.reg=eu(i,this.reg);for(let a=0,d;a<this.field.length;a++)d=this.index.get(this.field[a]),d.fastupdate=!1,d.reg=this.reg;if(this.worker){i=[];for(const a of this.index.values())i.push(a.import(r));return Promise.all(i)}break;case"tag":this.tag=Gl(i,this.tag);break;case"doc":this.store=bi(i,this.store)}}}function tu(r,i){let o="";for(const l of r.entries()){r=l[0];const a=l[1];let d="";for(let m=0,v;m<a.length;m++){v=a[m]||[""];let y="";for(let C=0;C<v.length;C++)y+=(y?",":"")+(i==="string"?'"'+v[C]+'"':v[C]);y="["+y+"]",d+=(d?",":"")+y}d='["'+r+'",['+d+"]]",o+=(o?",":"")+d}return o}Ot.prototype.remove=function(r,i){const o=this.reg.size&&(this.fastupdate?this.reg.get(r):this.reg.has(r));if(o){if(this.fastupdate){for(let l=0,a,d;l<o.length;l++)if((a=o[l])&&(d=a.length))if(a[d-1]===r)a.pop();else{const m=a.indexOf(r);m>=0&&a.splice(m,1)}}else $r(this.map,r),this.depth&&$r(this.ctx,r);i||this.reg.delete(r)}return this.db&&(this.commit_task.push({del:r}),this.M&&iu(this)),this.cache&&this.cache.remove(r),this};function $r(r,i){let o=0;var l=typeof i>"u";if(r.constructor===Array){for(let a=0,d,m,v;a<r.length;a++)if((d=r[a])&&d.length){if(l)return 1;if(m=d.indexOf(i),m>=0){if(d.length>1)return d.splice(m,1),1;if(delete r[a],o)return 1;v=1}else{if(v)return 1;o++}}}else for(let a of r.entries())l=a[0],$r(a[1],i)?o++:r.delete(l);return o}const Af={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};Ot.prototype.add=function(r,i,o,l){if(i&&(r||r===0)){if(!l&&!o&&this.reg.has(r))return this.update(r,i);l=this.depth,i=this.encoder.encode(i,!l);const C=i.length;if(C){const E=Ke(),L=Ke(),F=this.resolution;for(let M=0;M<C;M++){let V=i[this.rtl?C-1-M:M];var a=V.length;if(a&&(l||!L[V])){var d=this.score?this.score(i,V,M,null,0):Cs(F,C,M),m="";switch(this.tokenize){case"tolerant":if(Bt(this,L,V,d,r,o),a>2){for(let R=1,O,J,X,fe;R<a-1;R++)O=V.charAt(R),J=V.charAt(R+1),X=V.substring(0,R)+J,fe=V.substring(R+2),m=X+O+fe,Bt(this,L,m,d,r,o),m=X+fe,Bt(this,L,m,d,r,o);Bt(this,L,V.substring(0,V.length-1),d,r,o)}break;case"full":if(a>2){for(let R=0,O;R<a;R++)for(d=a;d>R;d--){m=V.substring(R,d),O=this.rtl?a-1-R:R;var v=this.score?this.score(i,V,M,m,O):Cs(F,C,M,a,O);Bt(this,L,m,v,r,o)}break}case"bidirectional":case"reverse":if(a>1){for(v=a-1;v>0;v--){m=V[this.rtl?a-1-v:v]+m;var y=this.score?this.score(i,V,M,m,v):Cs(F,C,M,a,v);Bt(this,L,m,y,r,o)}m=""}case"forward":if(a>1){for(v=0;v<a;v++)m+=V[this.rtl?a-1-v:v],Bt(this,L,m,d,r,o);break}default:if(Bt(this,L,V,d,r,o),l&&C>1&&M<C-1)for(a=this.N,m=V,d=Math.min(l+1,this.rtl?M+1:C-M),v=1;v<d;v++){V=i[this.rtl?C-1-M-v:M+v],y=this.bidirectional&&V>m;const R=this.score?this.score(i,m,M,V,v-1):Cs(a+(C/2>a?0:1),C,M,d-1,v-1);Bt(this,E,y?m:V,R,r,o,y?V:m)}}}}this.fastupdate||this.reg.add(r)}}return this.db&&(this.commit_task.push(o?{ins:r}:{del:r}),this.M&&iu(this)),this};function Bt(r,i,o,l,a,d,m){let v,y;if(!(v=i[o])||m&&!v[m]){if(m?(i=v||(i[o]=Ke()),i[m]=1,y=r.ctx,(v=y.get(m))?y=v:y.set(m,y=r.keystore?new Pt(r.keystore):new Map)):(y=r.map,i[o]=1),(v=y.get(o))?y=v:y.set(o,y=v=[]),d){for(let C=0,E;C<v.length;C++)if((E=v[C])&&E.includes(a)){if(C<=l)return;E.splice(E.indexOf(a),1),r.fastupdate&&(i=r.reg.get(a))&&i.splice(i.indexOf(E),1);break}}if(y=y[l]||(y[l]=[]),y.push(a),y.length===2**31-1){if(i=new bn(y),r.fastupdate)for(let C of r.reg.values())C.includes(y)&&(C[C.indexOf(y)]=i);v[l]=y=i}r.fastupdate&&((l=r.reg.get(a))?l.push(y):r.reg.set(a,[y]))}}function Cs(r,i,o,l,a){return o&&r>1?i+(l||0)<=r?o+(a||0):(r-1)/(i+(l||0))*(o+(a||0))+1|0:0}Ot.prototype.search=function(r,i,o){if(o||(i||typeof r!="object"?typeof i=="object"&&(o=i,i=0):(o=r,r="")),o&&o.cache)return o.cache=!1,r=this.searchCache(r,i,o),o.cache=!0,r;let l=[],a,d,m,v=0,y,C,E,L,F;o&&(r=o.query||r,i=o.limit||i,v=o.offset||0,d=o.context,m=o.suggest,F=(y=o.resolve)&&o.enrich,E=o.boost,L=o.resolution,C=this.db&&o.tag),typeof y>"u"&&(y=this.resolve),d=this.depth&&d!==!1;let M=this.encoder.encode(r,!d);if(a=M.length,i=i||(y?100:0),a===1)return ru.call(this,M[0],"",i,v,y,F,C);if(a===2&&d&&!m)return ru.call(this,M[1],M[0],i,v,y,F,C);let V=Ke(),R=0,O;if(d&&(O=M[0],R=1),L||L===0||(L=O?this.N:this.resolution),this.db){if(this.db.search&&(o=this.db.search(this,M,i,v,m,y,F,C),o!==!1))return o;const J=this;return(async function(){for(let X,fe;R<a;R++){if((fe=M[R])&&!V[fe]){if(V[fe]=1,X=await Ki(J,fe,O,0,0,!1,!1),X=su(X,l,m,L)){l=X;break}O&&(m&&X&&l.length||(O=fe))}m&&O&&R===a-1&&!l.length&&(L=J.resolution,O="",R=-1,V=Ke())}return nu(l,L,i,v,m,E,y)})()}for(let J,X;R<a;R++){if((X=M[R])&&!V[X]){if(V[X]=1,J=Ki(this,X,O,0,0,!1,!1),J=su(J,l,m,L)){l=J;break}O&&(m&&J&&l.length||(O=X))}m&&O&&R===a-1&&!l.length&&(L=this.resolution,O="",R=-1,V=Ke())}return nu(l,L,i,v,m,E,y)};function nu(r,i,o,l,a,d,m){let v=r.length,y=r;if(v>1)y=xs(r,i,o,l,a,d,m);else if(v===1)return m?Bi.call(null,r[0],o,l):new Fe(r[0],this);return m?y:new Fe(y,this)}function ru(r,i,o,l,a,d,m){return r=Ki(this,r,i,o,l,a,d,m),this.db?r.then(function(v){return a?v||[]:new Fe(v,this)}):r&&r.length?a?Bi.call(this,r,o,l):new Fe(r,this):a?[]:new Fe([],this)}function su(r,i,o,l){let a=[];if(r&&r.length){if(r.length<=l){i.push(r);return}for(let d=0,m;d<l;d++)(m=r[d])&&(a[d]=m);if(a.length){i.push(a);return}}if(!o)return a}function Ki(r,i,o,l,a,d,m,v){let y;return o&&(y=r.bidirectional&&i>o)&&(y=o,o=i,i=y),r.db?r.db.get(i,o,l,a,d,m,v):(r=o?(r=r.ctx.get(o))&&r.get(i):r.map.get(i),r)}function Ot(r,i){if(!this||this.constructor!==Ot)return new Ot(r);if(r){var o=$t(r)?r:r.preset;o&&(r=Object.assign({},Af[o],r))}else r={};o=r.context;const l=o===!0?{depth:1}:o||{},a=$t(r.encoder)?zi[r.encoder]:r.encode||r.encoder||{};this.encoder=a.encode?a:typeof a=="object"?new Hn(a):{encode:a},this.resolution=r.resolution||9,this.tokenize=o=(o=r.tokenize)&&o!=="default"&&o!=="exact"&&o||"strict",this.depth=o==="strict"&&l.depth||0,this.bidirectional=l.bidirectional!==!1,this.fastupdate=!!r.fastupdate,this.score=r.score||null,(o=r.keystore||0)&&(this.keystore=o),this.map=o?new Pt(o):new Map,this.ctx=o?new Pt(o):new Map,this.reg=i||(this.fastupdate?o?new Pt(o):new Map:o?new Et(o):new Set),this.N=l.resolution||3,this.rtl=a.rtl||r.rtl||!1,this.cache=(o=r.cache||null)&&new Cn(o),this.resolve=r.resolve!==!1,(o=r.db)&&(this.db=this.mount(o)),this.M=r.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=r.priority||4}ie=Ot.prototype,ie.mount=function(r){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),r.mount(this)},ie.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},ie.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function iu(r){r.commit_timer||(r.commit_timer=setTimeout(function(){r.commit_timer=null,r.db.commit(r)},1))}ie.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},ie.append=function(r,i){return this.add(r,i,!0)},ie.contain=function(r){return this.db?this.db.has(r):this.reg.has(r)},ie.update=function(r,i){const o=this,l=this.remove(r);return l&&l.then?l.then(()=>o.add(r,i)):this.add(r,i)},ie.cleanup=function(){return this.fastupdate?($r(this.map),this.depth&&$r(this.ctx),this):this},ie.searchCache=_i,ie.export=function(r,i,o=0,l=0){let a,d;switch(l){case 0:a="reg",d=ql(this.reg);break;case 1:a="cfg",d=null;break;case 2:a="map",d=Hi(this.map,this.reg.size);break;case 3:a="ctx",d=Zl(this.ctx,this.reg.size);break;default:return}return ks.call(this,r,i,a,d,o,l)},ie.import=function(r,i){if(i)switch(typeof i=="string"&&(i=JSON.parse(i)),r=r.split("."),r[r.length-1]==="json"&&r.pop(),r.length===3&&r.shift(),r=r.length>1?r[1]:r[0],r){case"reg":this.fastupdate=!1,this.reg=eu(i,this.reg);break;case"map":this.map=bi(i,this.map);break;case"ctx":this.ctx=Gl(i,this.ctx)}},ie.serialize=function(r=!0){let i="",o="",l="";if(this.reg.size){let d;for(var a of this.reg.keys())d||(d=typeof a),i+=(i?",":"")+(d==="string"?'"'+a+'"':a);i="index.reg=new Set(["+i+"]);",o=tu(this.map,d),o="index.map=new Map(["+o+"]);";for(const m of this.ctx.entries()){a=m[0];let v=tu(m[1],d);v="new Map(["+v+"])",v='["'+a+'",'+v+"]",l+=(l?",":"")+v}l="index.ctx=new Map(["+l+"]);"}return r?"function inject(index){"+i+o+l+"}":i+o+l},Mi(Ot.prototype);const ou=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),$s=["map","ctx","tag","reg","cfg"],Pn=Ke();function Wi(r,i={}){if(!this||this.constructor!==Wi)return new Wi(r,i);typeof r=="object"&&(i=r,r=r.name),r||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(r?":"+r.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=i.field?i.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=i.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}ie=Wi.prototype,ie.mount=function(r){return r.index?r.mount(this):(r.db=this,this.open())},ie.open=function(){if(this.db)return this.db;let r=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Pn[r.id]||(Pn[r.id]=[]),Pn[r.id].push(r.field);const i=ou.open(r.id,1);return i.onupgradeneeded=function(){const o=r.db=this.result;for(let l=0,a;l<$s.length;l++){a=$s[l];for(let d=0,m;d<Pn[r.id].length;d++)m=Pn[r.id][d],o.objectStoreNames.contains(a+(a!=="reg"&&m?":"+m:""))||o.createObjectStore(a+(a!=="reg"&&m?":"+m:""))}},r.db=qt(i,function(o){r.db=o,r.db.onversionchange=function(){r.close()}})},ie.close=function(){this.db&&this.db.close(),this.db=null},ie.destroy=function(){const r=ou.deleteDatabase(this.id);return qt(r)},ie.clear=function(){const r=[];for(let o=0,l;o<$s.length;o++){l=$s[o];for(let a=0,d;a<Pn[this.id].length;a++)d=Pn[this.id][a],r.push(l+(l!=="reg"&&d?":"+d:""))}const i=this.db.transaction(r,"readwrite");for(let o=0;o<r.length;o++)i.objectStore(r[o]).clear();return qt(i)},ie.get=function(r,i,o=0,l=0,a=!0,d=!1){r=this.db.transaction((i?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((i?"ctx":"map")+(this.field?":"+this.field:"")).get(i?i+":"+r:r);const m=this;return qt(r).then(function(v){let y=[];if(!v||!v.length)return y;if(a){if(!o&&!l&&v.length===1)return v[0];for(let C=0,E;C<v.length;C++)if((E=v[C])&&E.length){if(l>=E.length){l-=E.length;continue}const L=o?l+Math.min(E.length-l,o):E.length;for(let F=l;F<L;F++)y.push(E[F]);if(l=0,y.length===o)break}return d?m.enrich(y):y}return v})},ie.tag=function(r,i=0,o=0,l=!1){r=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(r);const a=this;return qt(r).then(function(d){return!d||!d.length||o>=d.length?[]:!i&&!o?d:(d=d.slice(o,o+i),l?a.enrich(d):d)})},ie.enrich=function(r){typeof r!="object"&&(r=[r]);const i=this.db.transaction("reg","readonly").objectStore("reg"),o=[];for(let l=0;l<r.length;l++)o[l]=qt(i.get(r[l]));return Promise.all(o).then(function(l){for(let a=0;a<l.length;a++)l[a]={id:r[a],doc:l[a]?JSON.parse(l[a]):null};return l})},ie.has=function(r){return r=this.db.transaction("reg","readonly").objectStore("reg").getKey(r),qt(r).then(function(i){return!!i})},ie.search=null,ie.info=function(){},ie.transaction=function(r,i,o){r+=r!=="reg"&&this.field?":"+this.field:"";let l=this.h[r+":"+i];if(l)return o.call(this,l);let a=this.db.transaction(r,i);this.h[r+":"+i]=l=a.objectStore(r);const d=o.call(this,l);return this.h[r+":"+i]=null,qt(a).finally(function(){return d})},ie.commit=async function(r){let i=r.commit_task,o=[];r.commit_task=[];for(let l=0,a;l<i.length;l++)a=i[l],a.del&&o.push(a.del);o.length&&await this.remove(o),r.reg.size&&(await this.transaction("map","readwrite",function(l){for(const a of r.map){const d=a[0],m=a[1];m.length&&(l.get(d).onsuccess=function(){let v=this.result;var y;if(v&&v.length){const C=Math.max(v.length,m.length);for(let E=0,L,F;E<C;E++)if((F=m[E])&&F.length){if((L=v[E])&&L.length)for(y=0;y<F.length;y++)L.push(F[y]);else v[E]=F;y=1}}else v=m,y=1;y&&l.put(v,d)})}}),await this.transaction("ctx","readwrite",function(l){for(const a of r.ctx){const d=a[0],m=a[1];for(const v of m){const y=v[0],C=v[1];C.length&&(l.get(d+":"+y).onsuccess=function(){let E=this.result;var L;if(E&&E.length){const F=Math.max(E.length,C.length);for(let M=0,V,R;M<F;M++)if((R=C[M])&&R.length){if((V=E[M])&&V.length)for(L=0;L<R.length;L++)V.push(R[L]);else E[M]=R;L=1}}else E=C,L=1;L&&l.put(E,d+":"+y)})}}}),r.store?await this.transaction("reg","readwrite",function(l){for(const a of r.store){const d=a[0],m=a[1];l.put(typeof m=="object"?JSON.stringify(m):1,d)}}):r.bypass||await this.transaction("reg","readwrite",function(l){for(const a of r.reg.keys())l.put(1,a)}),r.tag&&await this.transaction("tag","readwrite",function(l){for(const a of r.tag){const d=a[0],m=a[1];m.length&&(l.get(d).onsuccess=function(){let v=this.result;v=v&&v.length?v.concat(m):m,l.put(v,d)})}}),r.map.clear(),r.ctx.clear(),r.tag&&r.tag.clear(),r.store&&r.store.clear(),r.document||r.reg.clear())};function Qi(r,i,o){const l=r.value;let a,d=0;for(let m=0,v;m<l.length;m++){if(v=o?l:l[m]){for(let y=0,C,E;y<i.length;y++)if(E=i[y],C=v.indexOf(E),C>=0)if(a=1,v.length>1)v.splice(C,1);else{l[m]=[];break}d+=v.length}if(o)break}d?a&&r.update(l):r.delete(),r.continue()}ie.remove=function(r){return typeof r!="object"&&(r=[r]),Promise.all([this.transaction("map","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r)}}),this.transaction("ctx","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r)}}),this.transaction("tag","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r,!0)}}),this.transaction("reg","readwrite",function(i){for(let o=0;o<r.length;o++)i.delete(r[o])})])};function qt(r,i){return new Promise((o,l)=>{r.onsuccess=r.oncomplete=function(){i&&i(this.result),i=null,o(this.result)},r.onerror=r.onblocked=l,r=null})}const Ps={Encoder:Hn,Document:$n},Lf=zi,Of={finalize:r=>{let i=[];for(const o of r)i.push(..._f(o));return i}};function Rf(r){return r>=19968&&r<=40959||r>=12352&&r<=12543||r>=44032&&r<=55203||r>=13312&&r<=19903||r>=131072&&r<=173791||r>=173824&&r<=191471||r>=196608&&r<=205743||r>=191472&&r<=192095||r>=63744&&r<=64255||r>=194560&&r<=195103}function _f(r){const i=[];let o="";for(const l of r){const a=l.codePointAt(0);Rf(a)?(o&&(i.push(o),o=""),i.push(l)):o+=l}return o&&i.push(o),i}const Yi=new Ps.Encoder(Lf.Default,Of);class If{constructor({adminUrl:i,apiKey:o,dir:l}){const a=l==="rtl",d=l==="rtl"?"reverse":"forward";this.apiUrl=i,this.apiKey=o,this.postsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["title","excerpt"],store:!0},encoder:Yi}),this.authorsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["name"],store:!0},encoder:Yi}),this.tagsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["name"],store:!0},encoder:Yi}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async#t(){const i=await this.#n();i.length>0&&this.#r(i)}async#n(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/posts/?key=${this.apiKey}`;return(await(await fetch(i)).json()).posts}catch(i){return console.error("Error fetching posts:",i),[]}}#r(i){i.forEach(o=>{this.postsIndex.add(o)})}async#s(){const i=await this.#i();i.length>0&&this.#o(i)}async#i(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/authors/?key=${this.apiKey}`;return(await(await fetch(i)).json()).authors}catch(i){return console.error("Error fetching authors:",i),[]}}#o(i){i.forEach(o=>{this.authorsIndex.add(o)})}async#l(){const i=await this.#u();i.length>0&&this.#a(i)}async#u(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/tags/?key=${this.apiKey}`;return(await(await fetch(i)).json()).tags}catch(i){return console.error("Error fetching tags:",i),[]}}#a(i){i.forEach(o=>{this.tagsIndex.add(o)})}async init(){await this.#t(),await this.#s(),await this.#l()}#e(i){const o=[],l={};return i.forEach(a=>{a.result.forEach(d=>{l[d.id]||(o.push(d.doc),l[d.id]=!0)})}),o}search(i){const o=this.postsIndex.search(i,{enrich:!0}),l=this.authorsIndex.search(i,{enrich:!0}),a=this.tagsIndex.search(i,{enrich:!0});return{posts:this.#e(o),authors:this.#e(l),tags:this.#e(a)}}}var En={exports:{}},Jn={exports:{}};const zf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Mf={Authors:"الكتّاب",Cancel:"إلغاء","No matches found":"لا يوجد نتائج مطابقة",Posts:"منشورات","Search posts, tags and authors":"قم بالبحث عن المنشورات، الوسوم و الكتّاب","Show more results":"اظهر المزيد من النتائج",Tags:"الوسوم"},Ff={Authors:"Автори",Cancel:"Отказ","No matches found":"Няма съвпадения",Posts:"Публикации","Search posts, tags and authors":"Търсене в публикации, етикети и автори","Show more results":"Покажи още резултати",Tags:"Етикети"},Df={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Uf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Bf={Authors:"Autors",Cancel:"Cancel·la","No matches found":"No s'ha trobat cap resultat",Posts:"Articles","Search posts, tags and authors":"Cerca articles, etiquetes i autors","Show more results":"Mostra més resultats",Tags:"Etiquetes"},Vf={Authors:"Autoři",Cancel:"Zrušit","No matches found":"Nenalezeno",Posts:"Články","Search posts, tags and authors":"Prohledat články, štítky a autory","Show more results":"Zobrazit více výsledků",Tags:"Štítky"},Hf={Authors:"Forfattere",Cancel:"Annuller","No matches found":"Ingen resultater fundet",Posts:"Indlæg","Search posts, tags and authors":"Søg i indlæg, tags og forfattere","Show more results":"Vis flere resultater",Tags:"Tags"},bf={Authors:"Autoren",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Beiträge","Search posts, tags and authors":"Nach Posts, Tags und Autoren suchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},Kf={Authors:"Autor*innen",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Posts","Search posts, tags and authors":"Posts, Tags und Autor*innen durchsuchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},Wf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Qf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Yf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Jf={Authors:"Autores",Cancel:"Cancelar","No matches found":"No se encontraron resultados",Posts:"Publicaciones","Search posts, tags and authors":"Buscar publicaciones, etiquetas y autores","Show more results":"Mostrar más resultados",Tags:"Etiquetas"},Xf={Authors:"Autorid",Cancel:"Tühista","No matches found":"Vasteid ei leitud",Posts:"Postitused","Search posts, tags and authors":"Otsi postitusi, silte ja autoreid","Show more results":"Näita rohkem tulemusi",Tags:"Sildid"},Zf={Authors:"Autoreak",Cancel:"Utzi","No matches found":"Ez da bat datorren ezer topatu",Posts:"Artikuluak","Search posts, tags and authors":"Bilatu artikuluak, etiketak eta autoreak","Show more results":"Erakutsi emaitza gehiago",Tags:"Etiketak"},Gf={Authors:"نویسندگان",Cancel:"لغو","No matches found":"موردی یافت نشد",Posts:"نوشتهها","Search posts, tags and authors":"جستوجوی نوشتهها، برچسبها و نویسندگان","Show more results":"نمایش نتایج بیشتر",Tags:"برچسبها"},qf={Authors:"Kirjoittajat",Cancel:"Peruuta","No matches found":"Ei hakutuloksia",Posts:"Kirjoitukset","Search posts, tags and authors":"Etsi kirjoituksia, tunnisteita ja kirjoittajia","Show more results":"Näytä enemmän tuloksia",Tags:"Tunnisteet"},eh={Authors:"Auteurs",Cancel:"Annuler","No matches found":"Aucun résultat trouvé",Posts:"Articles","Search posts, tags and authors":"Rechercher des articles, des catégories et des auteurs","Show more results":"Plus de résultats",Tags:"Catégories"},th={Authors:"Ùghdaran",Cancel:"Sguir dheth","No matches found":"Cha deach dad a lorg a fhreagras ris na lorg thu",Posts:"Postaichean","Search posts, tags and authors":"Lorg sna postaichean, tagaichean agus ùghdaran","Show more results":"Seall barrachd thoraidhean",Tags:"Tagaichean"},nh={Authors:"מחברים",Cancel:"ביטול","No matches found":"לא נמצאו התאמות",Posts:"פוסטים","Search posts, tags and authors":"חיפוש פוסטים, תגיות ומחברים","Show more results":"הצגת תוצאות נוספות",Tags:"תגיות"},rh={Authors:"लेखक",Cancel:"रद्द करें","No matches found":"कोई मैच नहीं मिला",Posts:"पोस्ट","Search posts, tags and authors":"पोस्ट, टैग और लेखक की तलाश करें","Show more results":"और परिणाम दिखाएं",Tags:"टैग"},sh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},ih={Authors:"Szerzők",Cancel:"Mégse","No matches found":"Nincs találat",Posts:"Bejegyzések","Search posts, tags and authors":"Keresés a bejegyzések, a címkék és a szerzők között","Show more results":"További találatok megjelenítése",Tags:"Címkék"},oh={Authors:"Penulis",Cancel:"Batalkan","No matches found":"Tidak ada hasil yang ditemukan",Posts:"Postingan","Search posts, tags and authors":"Cari postingan, tag, dan penulis","Show more results":"Tampilkan lebih banyak hasil",Tags:"Tag"},lh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},uh={Authors:"Autori",Cancel:"Annulla","No matches found":"Nessun risultato trovato",Posts:"Articoli","Search posts, tags and authors":"Cerca articoli, tag e autori","Show more results":"Mostra più risultati",Tags:"Tag"},ah={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},ch={Authors:"작성자",Cancel:"취소","No matches found":"일치하는 결과가 없어요",Posts:"게시물","Search posts, tags and authors":"게시물, 태그, 작성자 검색","Show more results":"더 많은 결과 보기",Tags:"태그"},fh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},hh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},dh={Authors:"Autori",Cancel:"Atcelt","No matches found":"Nav atrasta neviena atbilstība",Posts:"Ziņas","Search posts, tags and authors":"Meklēt ziņas, atzīmes un autorus","Show more results":"Rādīt vairāk rezultātu",Tags:"Tagi"},ph={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},gh={Authors:"Нийтлэгчид",Cancel:"Цуцлах","No matches found":"Тохирох хайлтын үр дүн олдсонгүй",Posts:"Нийтлэлүүд","Search posts, tags and authors":"Нийтлэл, ангилал, нийтлэгчдээр хайх","Show more results":"Илүү олон үр дүн харуулах",Tags:"Ангилалууд"},mh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},yh={Authors:"Forfattere",Cancel:"Avbryt","No matches found":"Ingen treff funnet",Posts:"Innlegg","Search posts, tags and authors":"Søk i innlegg, etiketter og forfattere","Show more results":"Vis flere resultater",Tags:"Etiketter"},vh={Authors:"लेखकहरू",Cancel:"रद्द गर्नुहोस्","No matches found":"कुनै परिणाम भेटिएन",Posts:"पोस्टहरू","Search posts, tags and authors":"पोस्टहरू, ट्यागहरू र लेखकहरू खोज्नुहोस्","Show more results":"थप परिणामहरू देखाउनुहोस्",Tags:"ट्यागहरू"},wh={Authors:"Auteurs",Cancel:"Annuleren","No matches found":"Geen resultaten gevonden",Posts:"Berichten","Search posts, tags and authors":"Zoek berichten, tags en auteurs","Show more results":"Meer resultaten weergeven",Tags:"Tags"},xh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Sh={Authors:"ਲੇਖਕ",Cancel:"ਰੱਦ ਕਰੋ","No matches found":"ਕੋਈ ਮੇਲ ਨਹੀਂ ਮਿਲਿਆ",Posts:"ਪੋਸਟਾਂ","Search posts, tags and authors":"ਪੋਸਟਾਂ, ਟੈਗ ਅਤੇ ਲੇਖਕ ਖੋਜੋ","Show more results":"ਹੋਰ ਨਤੀਜੇ ਦਿਖਾਓ",Tags:"ਟੈਗ"},kh={Authors:"Autorzy",Cancel:"Anuluj","No matches found":"Nie znaleziono dopasowań",Posts:"Posty","Search posts, tags and authors":"Szukaj postów, tagów lub autorów","Show more results":"Pokaż więcej wyników",Tags:"Tagi"},Ch={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Buscar posts, tags e autores","Show more results":"Mostrar mais resultados",Tags:"Tags"},$h={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Procurar publicações, marcadores e autores","Show more results":"Mostrar mais resultados",Tags:"Marcadores"},Ph={Authors:"Autori",Cancel:"Anulează","No matches found":"Nu s-au găsit rezultate",Posts:"Postări","Search posts, tags and authors":"Caută postări, etichete și autori","Show more results":"Afișează mai multe rezultate",Tags:"Etichete"},Eh={Authors:"Авторы",Cancel:"Отмена","No matches found":"Совпадений не найдено",Posts:"Записи","Search posts, tags and authors":"Поиск по записям, тегам и авторам","Show more results":"Показать больше результатов",Tags:"Теги"},Th={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},jh={Authors:"Autori",Cancel:"Zrušiť","No matches found":"Nenašli sa žiadne výsledky",Posts:"Príspevky","Search posts, tags and authors":"Vyhľadajte príspevky, tagy a autorov","Show more results":"Zobraziť viac výsledkov",Tags:"Tagy"},Nh={Authors:"Avtorji",Cancel:"Prekliči","No matches found":"Ni najdenih zadetkov",Posts:"Članki","Search posts, tags and authors":"Iščite članke, oznake in avtorje","Show more results":"Prikaži več rezultatov",Tags:"Oznake"},Ah={Authors:"Autorët",Cancel:"Anulo","No matches found":"Nuk u gjet asnjë rezultat",Posts:"Postimet","Search posts, tags and authors":"Kërko postime, etiketa dhe autorë","Show more results":"Shfaq më shumë rezultate",Tags:"Etiketat"},Lh={Authors:"Аутори",Cancel:"Откажите","No matches found":"Нема резултата",Posts:"Објаве","Search posts, tags and authors":"Претражите објаве, tag-ове и ауторе","Show more results":"Прикажите више резултата",Tags:"Tag-ови"},Oh={Authors:"Autori",Cancel:"Otkažite","No matches found":"Nema rezultata",Posts:"Objave","Search posts, tags and authors":"Pretražite objave, tag-ove i autore","Show more results":"Prikažite više rezultata",Tags:"Tag-ovi"},Rh={Authors:"Författare",Cancel:"Avbryt","No matches found":"Inga träffar hittade",Posts:"Inlägg","Search posts, tags and authors":"Sök inlägg, taggar och författare","Show more results":"Visa fler resultat",Tags:"Taggar"},_h={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Ih={Authors:"ஆசிரியர்கள்",Cancel:"ரத்து செய்","No matches found":"பொருத்தங்கள் எதுவும் இல்லை",Posts:"பதிவுகள்","Search posts, tags and authors":"பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்","Show more results":"மேலும் முடிவுகளைக் காட்டு",Tags:"குறிச்சொற்கள்"},zh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Mh={Authors:"Yazarlar",Cancel:"İptal","No matches found":"Eşleşme bulunamadı",Posts:"Yazılar","Search posts, tags and authors":"Yazıları, etiketleri ve yazarları ara","Show more results":"Daha fazla sonuç göster",Tags:"Etiketler"},Fh={Authors:"Автори",Cancel:"Скасувати","No matches found":"Збігів не знайдено",Posts:"Публікації","Search posts, tags and authors":"Шукайте публікацій, теги та авторів","Show more results":"Показати більше результатів",Tags:"Теги"},Dh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Uh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Bh={Authors:"Tác giả",Cancel:"Hủy","No matches found":"Không tìm thấy",Posts:"Bài viết","Search posts, tags and authors":"Tìm bài viết, thẻ và tác giả","Show more results":"Xem thêm kết quả",Tags:"Thẻ"},Vh={Authors:"作者",Cancel:"取消","No matches found":"無相符結果",Posts:"文章","Search posts, tags and authors":"搜尋文章、標籤與作者","Show more results":"更多結果",Tags:"標籤"},Hh={Authors:"作者",Cancel:"取消","No matches found":"未找到匹配项",Posts:"文章","Search posts, tags and authors":"搜索文章、标签和作者","Show more results":"显示更多结果",Tags:"标签"};var lu;function uu(){return lu||(lu={"/ghost/i18n/locales/af/search.json":function(){return zf},"/ghost/i18n/locales/ar/search.json":function(){return Mf},"/ghost/i18n/locales/bg/search.json":function(){return Ff},"/ghost/i18n/locales/bn/search.json":function(){return Df},"/ghost/i18n/locales/bs/search.json":function(){return Uf},"/ghost/i18n/locales/ca/search.json":function(){return Bf},"/ghost/i18n/locales/cs/search.json":function(){return Vf},"/ghost/i18n/locales/da/search.json":function(){return Hf},"/ghost/i18n/locales/de-CH/search.json":function(){return bf},"/ghost/i18n/locales/de/search.json":function(){return Kf},"/ghost/i18n/locales/el/search.json":function(){return Wf},"/ghost/i18n/locales/en/search.json":function(){return Qf},"/ghost/i18n/locales/eo/search.json":function(){return Yf},"/ghost/i18n/locales/es/search.json":function(){return Jf},"/ghost/i18n/locales/et/search.json":function(){return Xf},"/ghost/i18n/locales/eu/search.json":function(){return Zf},"/ghost/i18n/locales/fa/search.json":function(){return Gf},"/ghost/i18n/locales/fi/search.json":function(){return qf},"/ghost/i18n/locales/fr/search.json":function(){return eh},"/ghost/i18n/locales/gd/search.json":function(){return th},"/ghost/i18n/locales/he/search.json":function(){return nh},"/ghost/i18n/locales/hi/search.json":function(){return rh},"/ghost/i18n/locales/hr/search.json":function(){return sh},"/ghost/i18n/locales/hu/search.json":function(){return ih},"/ghost/i18n/locales/id/search.json":function(){return oh},"/ghost/i18n/locales/is/search.json":function(){return lh},"/ghost/i18n/locales/it/search.json":function(){return uh},"/ghost/i18n/locales/ja/search.json":function(){return ah},"/ghost/i18n/locales/ko/search.json":function(){return ch},"/ghost/i18n/locales/kz/search.json":function(){return fh},"/ghost/i18n/locales/lt/search.json":function(){return hh},"/ghost/i18n/locales/lv/search.json":function(){return dh},"/ghost/i18n/locales/mk/search.json":function(){return ph},"/ghost/i18n/locales/mn/search.json":function(){return gh},"/ghost/i18n/locales/ms/search.json":function(){return mh},"/ghost/i18n/locales/nb/search.json":function(){return yh},"/ghost/i18n/locales/ne/search.json":function(){return vh},"/ghost/i18n/locales/nl/search.json":function(){return wh},"/ghost/i18n/locales/nn/search.json":function(){return xh},"/ghost/i18n/locales/pa/search.json":function(){return Sh},"/ghost/i18n/locales/pl/search.json":function(){return kh},"/ghost/i18n/locales/pt-BR/search.json":function(){return Ch},"/ghost/i18n/locales/pt/search.json":function(){return $h},"/ghost/i18n/locales/ro/search.json":function(){return Ph},"/ghost/i18n/locales/ru/search.json":function(){return Eh},"/ghost/i18n/locales/si/search.json":function(){return Th},"/ghost/i18n/locales/sk/search.json":function(){return jh},"/ghost/i18n/locales/sl/search.json":function(){return Nh},"/ghost/i18n/locales/sq/search.json":function(){return Ah},"/ghost/i18n/locales/sr-Cyrl/search.json":function(){return Lh},"/ghost/i18n/locales/sr/search.json":function(){return Oh},"/ghost/i18n/locales/sv/search.json":function(){return Rh},"/ghost/i18n/locales/sw/search.json":function(){return _h},"/ghost/i18n/locales/ta/search.json":function(){return Ih},"/ghost/i18n/locales/th/search.json":function(){return zh},"/ghost/i18n/locales/tr/search.json":function(){return Mh},"/ghost/i18n/locales/uk/search.json":function(){return Fh},"/ghost/i18n/locales/ur/search.json":function(){return Dh},"/ghost/i18n/locales/uz/search.json":function(){return Uh},"/ghost/i18n/locales/vi/search.json":function(){return Bh},"/ghost/i18n/locales/zh-Hant/search.json":function(){return Vh},"/ghost/i18n/locales/zh/search.json":function(){return Hh}})}function au(r){function i(o){var l=cu(o,r);if(l!==null)return uu()[l]();throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return i.resolve=function(o){var l=cu(o,r);return l!==null?l:require.resolve(o)},i}function cu(r,i){var o=bh(r);r=Es(r);var l;r[0]==="/"&&(i="");for(var a=uu(),d=["",".js",".json"];o?l=Es(i+"/node_modules/"+r):l=Es(i+"/"+r),!l.endsWith("/..");){for(var m=0;m<d.length;m++){var v=l+d[m];if(a[v])return v}if(!o)break;var y=Es(i+"/..");if(y===i)break;i=y}return null}function bh(r){var i=r[0];if(i==="/"||i==="\\")return!1;var o=r[1],l=r[2];return!(i==="."&&(!o||o==="/"||o==="\\")||i==="."&&o==="."&&(!l||l==="/"||l==="\\")||o===":"&&(l==="/"||l==="\\"))}function Es(r){r=r.replace(/\\/g,"/");for(var i=r.split("/"),o=i[0]==="",l=1;l<i.length;l++)(i[l]==="."||i[l]==="")&&i.splice(l--,1);for(var l=1;l<i.length;l++)i[l]===".."&&l>0&&i[l-1]!==".."&&i[l-1]!=="."&&(i.splice(--l,2),l--);return r=i.join("/"),o&&r[0]!=="/"?r="/"+r:r.length===0&&(r="."),r}var Ji,fu;function Kh(){if(fu)return Ji;fu=1;const r=S=>typeof S=="string",i=()=>{let S,c;const h=new Promise((g,x)=>{S=g,c=x});return h.resolve=S,h.reject=c,h},o=S=>S==null?"":""+S,l=(S,c,h)=>{S.forEach(g=>{c[g]&&(h[g]=c[g])})},a=/###/g,d=S=>S&&S.indexOf("###")>-1?S.replace(a,"."):S,m=S=>!S||r(S),v=(S,c,h)=>{const g=r(c)?c.split("."):c;let x=0;for(;x<g.length-1;){if(m(S))return{};const k=d(g[x]);!S[k]&&h&&(S[k]=new h),Object.prototype.hasOwnProperty.call(S,k)?S=S[k]:S={},++x}return m(S)?{}:{obj:S,k:d(g[x])}},y=(S,c,h)=>{const{obj:g,k:x}=v(S,c,Object);if(g!==void 0||c.length===1){g[x]=h;return}let k=c[c.length-1],j=c.slice(0,c.length-1),I=v(S,j,Object);for(;I.obj===void 0&&j.length;)k=`${j[j.length-1]}.${k}`,j=j.slice(0,j.length-1),I=v(S,j,Object),I&&I.obj&&typeof I.obj[`${I.k}.${k}`]<"u"&&(I.obj=void 0);I.obj[`${I.k}.${k}`]=h},C=(S,c,h,g)=>{const{obj:x,k}=v(S,c,Object);x[k]=x[k]||[],x[k].push(h)},E=(S,c)=>{const{obj:h,k:g}=v(S,c);if(h)return h[g]},L=(S,c,h)=>{const g=E(S,h);return g!==void 0?g:E(c,h)},F=(S,c,h)=>{for(const g in c)g!=="__proto__"&&g!=="constructor"&&(g in S?r(S[g])||S[g]instanceof String||r(c[g])||c[g]instanceof String?h&&(S[g]=c[g]):F(S[g],c[g],h):S[g]=c[g]);return S},M=S=>S.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var V={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const R=S=>r(S)?S.replace(/[&<>"'\/]/g,c=>V[c]):S;class O{constructor(c){this.capacity=c,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(c){const h=this.regExpMap.get(c);if(h!==void 0)return h;const g=new RegExp(c);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(c,g),this.regExpQueue.push(c),g}}const J=[" ",",","?","!",";"],X=new O(20),fe=(S,c,h)=>{c=c||"",h=h||"";const g=J.filter(j=>c.indexOf(j)<0&&h.indexOf(j)<0);if(g.length===0)return!0;const x=X.getRegExp(`(${g.map(j=>j==="?"?"\\?":j).join("|")})`);let k=!x.test(S);if(!k){const j=S.indexOf(h);j>0&&!x.test(S.substring(0,j))&&(k=!0)}return k},de=function(S,c){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!S)return;if(S[c])return S[c];const g=c.split(h);let x=S;for(let k=0;k<g.length;){if(!x||typeof x!="object")return;let j,I="";for(let z=k;z<g.length;++z)if(z!==k&&(I+=h),I+=g[z],j=x[I],j!==void 0){if(["string","number","boolean"].indexOf(typeof j)>-1&&z<g.length-1)continue;k+=z-k+1;break}x=j}return x},he=S=>S&&S.replace("_","-"),ae={type:"logger",log(S){this.output("log",S)},warn(S){this.output("warn",S)},error(S){this.output("error",S)},output(S,c){console&&console[S]&&console[S].apply(console,c)}};class ue{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(c,h)}init(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=h.prefix||"i18next:",this.logger=c||ae,this.options=h,this.debug=h.debug}log(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"log","",!0)}warn(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"warn","",!0)}error(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"error","")}deprecate(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"warn","WARNING DEPRECATED: ",!0)}forward(c,h,g,x){return x&&!this.debug?null:(r(c[0])&&(c[0]=`${g}${this.prefix} ${c[0]}`),this.logger[h](c))}create(c){return new ue(this.logger,{prefix:`${this.prefix}:${c}:`,...this.options})}clone(c){return c=c||this.options,c.prefix=c.prefix||this.prefix,new ue(this.logger,c)}}var q=new ue;class oe{constructor(){this.observers={}}on(c,h){return c.split(" ").forEach(g=>{this.observers[g]||(this.observers[g]=new Map);const x=this.observers[g].get(h)||0;this.observers[g].set(h,x+1)}),this}off(c,h){if(this.observers[c]){if(!h){delete this.observers[c];return}this.observers[c].delete(h)}}emit(c){for(var h=arguments.length,g=new Array(h>1?h-1:0),x=1;x<h;x++)g[x-1]=arguments[x];this.observers[c]&&Array.from(this.observers[c].entries()).forEach(j=>{let[I,z]=j;for(let b=0;b<z;b++)I(...g)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(j=>{let[I,z]=j;for(let b=0;b<z;b++)I.apply(I,[c,...g])})}}class Pe extends oe{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=c||{},this.options=h,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(c){this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}removeNamespaces(c){const h=this.options.ns.indexOf(c);h>-1&&this.options.ns.splice(h,1)}getResource(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const k=x.keySeparator!==void 0?x.keySeparator:this.options.keySeparator,j=x.ignoreJSONStructure!==void 0?x.ignoreJSONStructure:this.options.ignoreJSONStructure;let I;c.indexOf(".")>-1?I=c.split("."):(I=[c,h],g&&(Array.isArray(g)?I.push(...g):r(g)&&k?I.push(...g.split(k)):I.push(g)));const z=E(this.data,I);return!z&&!h&&!g&&c.indexOf(".")>-1&&(c=I[0],h=I[1],g=I.slice(2).join(".")),z||!j||!r(g)?z:de(this.data&&this.data[c]&&this.data[c][h],g,k)}addResource(c,h,g,x){let k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const j=k.keySeparator!==void 0?k.keySeparator:this.options.keySeparator;let I=[c,h];g&&(I=I.concat(j?g.split(j):g)),c.indexOf(".")>-1&&(I=c.split("."),x=h,h=I[1]),this.addNamespaces(h),y(this.data,I,x),k.silent||this.emit("added",c,h,g,x)}addResources(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const k in g)(r(g[k])||Array.isArray(g[k]))&&this.addResource(c,h,k,g[k],{silent:!0});x.silent||this.emit("added",c,h,g)}addResourceBundle(c,h,g,x,k){let j=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},I=[c,h];c.indexOf(".")>-1&&(I=c.split("."),x=g,g=h,h=I[1]),this.addNamespaces(h);let z=E(this.data,I)||{};j.skipCopy||(g=JSON.parse(JSON.stringify(g))),x?F(z,g,k):z={...z,...g},y(this.data,I,z),j.silent||this.emit("added",c,h,g)}removeResourceBundle(c,h){this.hasResourceBundle(c,h)&&delete this.data[c][h],this.removeNamespaces(h),this.emit("removed",c,h)}hasResourceBundle(c,h){return this.getResource(c,h)!==void 0}getResourceBundle(c,h){return h||(h=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(c,h)}:this.getResource(c,h)}getDataByLanguage(c){return this.data[c]}hasLanguageSomeTranslations(c){const h=this.getDataByLanguage(c);return!!(h&&Object.keys(h)||[]).find(x=>h[x]&&Object.keys(h[x]).length>0)}toJSON(){return this.data}}var xe={processors:{},addPostProcessor(S){this.processors[S.name]=S},handle(S,c,h,g,x){return S.forEach(k=>{this.processors[k]&&(c=this.processors[k].process(c,h,g,x))}),c}};const Ee={};class ke extends oe{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),l(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],c,this),this.options=h,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=q.create("translator")}changeLanguage(c){c&&(this.language=c)}exists(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(c==null)return!1;const g=this.resolve(c,h);return g&&g.res!==void 0}extractFromKey(c,h){let g=h.nsSeparator!==void 0?h.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const x=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator;let k=h.ns||this.options.defaultNS||[];const j=g&&c.indexOf(g)>-1,I=!this.options.userDefinedKeySeparator&&!h.keySeparator&&!this.options.userDefinedNsSeparator&&!h.nsSeparator&&!fe(c,g,x);if(j&&!I){const z=c.match(this.interpolator.nestingRegexp);if(z&&z.length>0)return{key:c,namespaces:r(k)?[k]:k};const b=c.split(g);(g!==x||g===x&&this.options.ns.indexOf(b[0])>-1)&&(k=b.shift()),c=b.join(x)}return{key:c,namespaces:r(k)?[k]:k}}translate(c,h,g){if(typeof h!="object"&&this.options.overloadTranslationOptionHandler&&(h=this.options.overloadTranslationOptionHandler(arguments)),typeof h=="object"&&(h={...h}),h||(h={}),c==null)return"";Array.isArray(c)||(c=[String(c)]);const x=h.returnDetails!==void 0?h.returnDetails:this.options.returnDetails,k=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator,{key:j,namespaces:I}=this.extractFromKey(c[c.length-1],h),z=I[I.length-1],b=h.lng||this.language,Y=h.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(Y){const ze=h.nsSeparator||this.options.nsSeparator;return x?{res:`${z}${ze}${j}`,usedKey:j,exactUsedKey:j,usedLng:b,usedNS:z,usedParams:this.getUsedParamsDetails(h)}:`${z}${ze}${j}`}return x?{res:j,usedKey:j,exactUsedKey:j,usedLng:b,usedNS:z,usedParams:this.getUsedParamsDetails(h)}:j}const re=this.resolve(c,h);let U=re&&re.res;const pe=re&&re.usedKey||j,Le=re&&re.exactUsedKey||j,Ve=Object.prototype.toString.apply(U),Ie=["[object Number]","[object Function]","[object RegExp]"],Je=h.joinArrays!==void 0?h.joinArrays:this.options.joinArrays,Xe=!this.i18nFormat||this.i18nFormat.handleAsObject,Nt=!r(U)&&typeof U!="boolean"&&typeof U!="number";if(Xe&&U&&Nt&&Ie.indexOf(Ve)<0&&!(r(Je)&&Array.isArray(U))){if(!h.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ze=this.options.returnedObjectHandler?this.options.returnedObjectHandler(pe,U,{...h,ns:I}):`key '${j} (${this.language})' returned an object instead of string.`;return x?(re.res=ze,re.usedParams=this.getUsedParamsDetails(h),re):ze}if(k){const ze=Array.isArray(U),lt=ze?[]:{},at=ze?Le:pe;for(const Ze in U)if(Object.prototype.hasOwnProperty.call(U,Ze)){const Xn=`${at}${k}${Ze}`;lt[Ze]=this.translate(Xn,{...h,joinArrays:!1,ns:I}),lt[Ze]===Xn&&(lt[Ze]=U[Ze])}U=lt}}else if(Xe&&r(Je)&&Array.isArray(U))U=U.join(Je),U&&(U=this.extendTranslation(U,c,h,g));else{let ze=!1,lt=!1;const at=h.count!==void 0&&!r(h.count),Ze=ke.hasDefaultValue(h),Xn=at?this.pluralResolver.getSuffix(b,h.count,h):"",Er=h.ordinal&&at?this.pluralResolver.getSuffix(b,h.count,{ordinal:!1}):"",Zn=at&&!h.ordinal&&h.count===0&&this.pluralResolver.shouldUseIntlApi(),Ht=Zn&&h[`defaultValue${this.options.pluralSeparator}zero`]||h[`defaultValue${Xn}`]||h[`defaultValue${Er}`]||h.defaultValue;!this.isValidLookup(U)&&Ze&&(ze=!0,U=Ht),this.isValidLookup(U)||(lt=!0,U=j);const en=(h.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&<?void 0:U,vt=Ze&&Ht!==U&&this.options.updateMissing;if(lt||ze||vt){if(this.logger.log(vt?"updateKey":"missingKey",b,z,j,vt?Ht:U),k){const qe=this.resolve(j,{...h,keySeparator:!1});qe&&qe.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 tn=[];const jn=this.languageUtils.getFallbackCodes(this.options.fallbackLng,h.lng||this.language);if(this.options.saveMissingTo==="fallback"&&jn&&jn[0])for(let qe=0;qe<jn.length;qe++)tn.push(jn[qe]);else this.options.saveMissingTo==="all"?tn=this.languageUtils.toResolveHierarchy(h.lng||this.language):tn.push(h.lng||this.language);const Tr=(qe,_t,bt)=>{const jr=Ze&&bt!==U?bt:en;this.options.missingKeyHandler?this.options.missingKeyHandler(qe,z,_t,jr,vt,h):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(qe,z,_t,jr,vt,h),this.emit("missingKey",qe,z,_t,U)};this.options.saveMissing&&(this.options.saveMissingPlurals&&at?tn.forEach(qe=>{const _t=this.pluralResolver.getSuffixes(qe,h);Zn&&h[`defaultValue${this.options.pluralSeparator}zero`]&&_t.indexOf(`${this.options.pluralSeparator}zero`)<0&&_t.push(`${this.options.pluralSeparator}zero`),_t.forEach(bt=>{Tr([qe],j+bt,h[`defaultValue${bt}`]||Ht)})}):Tr(tn,j,Ht))}U=this.extendTranslation(U,c,h,re,g),lt&&U===j&&this.options.appendNamespaceToMissingKey&&(U=`${z}:${j}`),(lt||ze)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?U=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${z}:${j}`:j,ze?U:void 0):U=this.options.parseMissingKeyHandler(U))}return x?(re.res=U,re.usedParams=this.getUsedParamsDetails(h),re):U}extendTranslation(c,h,g,x,k){var j=this;if(this.i18nFormat&&this.i18nFormat.parse)c=this.i18nFormat.parse(c,{...this.options.interpolation.defaultVariables,...g},g.lng||this.language||x.usedLng,x.usedNS,x.usedKey,{resolved:x});else if(!g.skipInterpolation){g.interpolation&&this.interpolator.init({...g,interpolation:{...this.options.interpolation,...g.interpolation}});const b=r(c)&&(g&&g.interpolation&&g.interpolation.skipOnVariables!==void 0?g.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let Y;if(b){const U=c.match(this.interpolator.nestingRegexp);Y=U&&U.length}let re=g.replace&&!r(g.replace)?g.replace:g;if(this.options.interpolation.defaultVariables&&(re={...this.options.interpolation.defaultVariables,...re}),c=this.interpolator.interpolate(c,re,g.lng||this.language||x.usedLng,g),b){const U=c.match(this.interpolator.nestingRegexp),pe=U&&U.length;Y<pe&&(g.nest=!1)}!g.lng&&this.options.compatibilityAPI!=="v1"&&x&&x.res&&(g.lng=this.language||x.usedLng),g.nest!==!1&&(c=this.interpolator.nest(c,function(){for(var U=arguments.length,pe=new Array(U),Le=0;Le<U;Le++)pe[Le]=arguments[Le];return k&&k[0]===pe[0]&&!g.context?(j.logger.warn(`It seems you are nesting recursively key: ${pe[0]} in key: ${h[0]}`),null):j.translate(...pe,h)},g)),g.interpolation&&this.interpolator.reset()}const I=g.postProcess||this.options.postProcess,z=r(I)?[I]:I;return c!=null&&z&&z.length&&g.applyPostProcessor!==!1&&(c=xe.handle(z,c,h,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...x,usedParams:this.getUsedParamsDetails(g)},...g}:g,this)),c}resolve(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g,x,k,j,I;return r(c)&&(c=[c]),c.forEach(z=>{if(this.isValidLookup(g))return;const b=this.extractFromKey(z,h),Y=b.key;x=Y;let re=b.namespaces;this.options.fallbackNS&&(re=re.concat(this.options.fallbackNS));const U=h.count!==void 0&&!r(h.count),pe=U&&!h.ordinal&&h.count===0&&this.pluralResolver.shouldUseIntlApi(),Le=h.context!==void 0&&(r(h.context)||typeof h.context=="number")&&h.context!=="",Ve=h.lngs?h.lngs:this.languageUtils.toResolveHierarchy(h.lng||this.language,h.fallbackLng);re.forEach(Ie=>{this.isValidLookup(g)||(I=Ie,!Ee[`${Ve[0]}-${Ie}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(I)&&(Ee[`${Ve[0]}-${Ie}`]=!0,this.logger.warn(`key "${x}" for languages "${Ve.join(", ")}" won't get resolved as namespace "${I}" 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!!!")),Ve.forEach(Je=>{if(this.isValidLookup(g))return;j=Je;const Xe=[Y];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(Xe,Y,Je,Ie,h);else{let ze;U&&(ze=this.pluralResolver.getSuffix(Je,h.count,h));const lt=`${this.options.pluralSeparator}zero`,at=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(U&&(Xe.push(Y+ze),h.ordinal&&ze.indexOf(at)===0&&Xe.push(Y+ze.replace(at,this.options.pluralSeparator)),pe&&Xe.push(Y+lt)),Le){const Ze=`${Y}${this.options.contextSeparator}${h.context}`;Xe.push(Ze),U&&(Xe.push(Ze+ze),h.ordinal&&ze.indexOf(at)===0&&Xe.push(Ze+ze.replace(at,this.options.pluralSeparator)),pe&&Xe.push(Ze+lt))}}let Nt;for(;Nt=Xe.pop();)this.isValidLookup(g)||(k=Nt,g=this.getResource(Je,Ie,Nt,h))}))})}),{res:g,usedKey:x,exactUsedKey:k,usedLng:j,usedNS:I}}isValidLookup(c){return c!==void 0&&!(!this.options.returnNull&&c===null)&&!(!this.options.returnEmptyString&&c==="")}getResource(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(c,h,g,x):this.resourceStore.getResource(c,h,g,x)}getUsedParamsDetails(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],g=c.replace&&!r(c.replace);let x=g?c.replace:c;if(g&&typeof c.count<"u"&&(x.count=c.count),this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),!g){x={...x};for(const k of h)delete x[k]}return x}static hasDefaultValue(c){const h="defaultValue";for(const g in c)if(Object.prototype.hasOwnProperty.call(c,g)&&h===g.substring(0,h.length)&&c[g]!==void 0)return!0;return!1}}const Re=S=>S.charAt(0).toUpperCase()+S.slice(1);class ye{constructor(c){this.options=c,this.supportedLngs=this.options.supportedLngs||!1,this.logger=q.create("languageUtils")}getScriptPartFromCode(c){if(c=he(c),!c||c.indexOf("-")<0)return null;const h=c.split("-");return h.length===2||(h.pop(),h[h.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(h.join("-"))}getLanguagePartFromCode(c){if(c=he(c),!c||c.indexOf("-")<0)return c;const h=c.split("-");return this.formatLanguageCode(h[0])}formatLanguageCode(c){if(r(c)&&c.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let x=Intl.getCanonicalLocales(c)[0];if(x&&this.options.lowerCaseLng&&(x=x.toLowerCase()),x)return x}catch{}const h=["hans","hant","latn","cyrl","cans","mong","arab"];let g=c.split("-");return this.options.lowerCaseLng?g=g.map(x=>x.toLowerCase()):g.length===2?(g[0]=g[0].toLowerCase(),g[1]=g[1].toUpperCase(),h.indexOf(g[1].toLowerCase())>-1&&(g[1]=Re(g[1].toLowerCase()))):g.length===3&&(g[0]=g[0].toLowerCase(),g[1].length===2&&(g[1]=g[1].toUpperCase()),g[0]!=="sgn"&&g[2].length===2&&(g[2]=g[2].toUpperCase()),h.indexOf(g[1].toLowerCase())>-1&&(g[1]=Re(g[1].toLowerCase())),h.indexOf(g[2].toLowerCase())>-1&&(g[2]=Re(g[2].toLowerCase()))),g.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?c.toLowerCase():c}isSupportedCode(c){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(c=this.getLanguagePartFromCode(c)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(c)>-1}getBestMatchFromCodes(c){if(!c)return null;let h;return c.forEach(g=>{if(h)return;const x=this.formatLanguageCode(g);(!this.options.supportedLngs||this.isSupportedCode(x))&&(h=x)}),!h&&this.options.supportedLngs&&c.forEach(g=>{if(h)return;const x=this.getLanguagePartFromCode(g);if(this.isSupportedCode(x))return h=x;h=this.options.supportedLngs.find(k=>{if(k===x)return k;if(!(k.indexOf("-")<0&&x.indexOf("-")<0)&&(k.indexOf("-")>0&&x.indexOf("-")<0&&k.substring(0,k.indexOf("-"))===x||k.indexOf(x)===0&&x.length>1))return k})}),h||(h=this.getFallbackCodes(this.options.fallbackLng)[0]),h}getFallbackCodes(c,h){if(!c)return[];if(typeof c=="function"&&(c=c(h)),r(c)&&(c=[c]),Array.isArray(c))return c;if(!h)return c.default||[];let g=c[h];return g||(g=c[this.getScriptPartFromCode(h)]),g||(g=c[this.formatLanguageCode(h)]),g||(g=c[this.getLanguagePartFromCode(h)]),g||(g=c.default),g||[]}toResolveHierarchy(c,h){const g=this.getFallbackCodes(h||this.options.fallbackLng||[],c),x=[],k=j=>{j&&(this.isSupportedCode(j)?x.push(j):this.logger.warn(`rejecting language code not found in supportedLngs: ${j}`))};return r(c)&&(c.indexOf("-")>-1||c.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&k(this.formatLanguageCode(c)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&k(this.getScriptPartFromCode(c)),this.options.load!=="currentOnly"&&k(this.getLanguagePartFromCode(c))):r(c)&&k(this.formatLanguageCode(c)),g.forEach(j=>{x.indexOf(j)<0&&k(this.formatLanguageCode(j))}),x}}let De=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A={1:S=>+(S>1),2:S=>+(S!=1),3:S=>0,4:S=>S%10==1&&S%100!=11?0:S%10>=2&&S%10<=4&&(S%100<10||S%100>=20)?1:2,5:S=>S==0?0:S==1?1:S==2?2:S%100>=3&&S%100<=10?3:S%100>=11?4:5,6:S=>S==1?0:S>=2&&S<=4?1:2,7:S=>S==1?0:S%10>=2&&S%10<=4&&(S%100<10||S%100>=20)?1:2,8:S=>S==1?0:S==2?1:S!=8&&S!=11?2:3,9:S=>+(S>=2),10:S=>S==1?0:S==2?1:S<7?2:S<11?3:4,11:S=>S==1||S==11?0:S==2||S==12?1:S>2&&S<20?2:3,12:S=>+(S%10!=1||S%100==11),13:S=>+(S!==0),14:S=>S==1?0:S==2?1:S==3?2:3,15:S=>S%10==1&&S%100!=11?0:S%10>=2&&(S%100<10||S%100>=20)?1:2,16:S=>S%10==1&&S%100!=11?0:S!==0?1:2,17:S=>S==1||S%10==1&&S%100!=11?0:1,18:S=>S==0?0:S==1?1:2,19:S=>S==1?0:S==0||S%100>1&&S%100<11?1:S%100>10&&S%100<20?2:3,20:S=>S==1?0:S==0||S%100>0&&S%100<20?1:2,21:S=>S%100==1?1:S%100==2?2:S%100==3||S%100==4?3:0,22:S=>S==1?0:S==2?1:(S<0||S>10)&&S%10==0?2:3};const Q=["v1","v2","v3"],me=["v4"],je={zero:0,one:1,two:2,few:3,many:4,other:5},B=()=>{const S={};return De.forEach(c=>{c.lngs.forEach(h=>{S[h]={numbers:c.nr,plurals:A[c.fc]}})}),S};class ee{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=c,this.options=h,this.logger=q.create("pluralResolver"),(!this.options.compatibilityJSON||me.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=B(),this.pluralRulesCache={}}addRule(c,h){this.rules[c]=h}clearCache(){this.pluralRulesCache={}}getRule(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const g=he(c==="dev"?"en":c),x=h.ordinal?"ordinal":"cardinal",k=JSON.stringify({cleanedCode:g,type:x});if(k in this.pluralRulesCache)return this.pluralRulesCache[k];let j;try{j=new Intl.PluralRules(g,{type:x})}catch{if(!c.match(/-|_/))return;const z=this.languageUtils.getLanguagePartFromCode(c);j=this.getRule(z,h)}return this.pluralRulesCache[k]=j,j}return this.rules[c]||this.rules[this.languageUtils.getLanguagePartFromCode(c)]}needsPlural(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const g=this.getRule(c,h);return this.shouldUseIntlApi()?g&&g.resolvedOptions().pluralCategories.length>1:g&&g.numbers.length>1}getPluralFormsOfKey(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(c,g).map(x=>`${h}${x}`)}getSuffixes(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const g=this.getRule(c,h);return g?this.shouldUseIntlApi()?g.resolvedOptions().pluralCategories.sort((x,k)=>je[x]-je[k]).map(x=>`${this.options.prepend}${h.ordinal?`ordinal${this.options.prepend}`:""}${x}`):g.numbers.map(x=>this.getSuffix(c,x,h)):[]}getSuffix(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const x=this.getRule(c,g);return x?this.shouldUseIntlApi()?`${this.options.prepend}${g.ordinal?`ordinal${this.options.prepend}`:""}${x.select(h)}`:this.getSuffixRetroCompatible(x,h):(this.logger.warn(`no plural rule found for: ${c}`),"")}getSuffixRetroCompatible(c,h){const g=c.noAbs?c.plurals(h):c.plurals(Math.abs(h));let x=c.numbers[g];this.options.simplifyPluralSuffix&&c.numbers.length===2&&c.numbers[0]===1&&(x===2?x="plural":x===1&&(x=""));const k=()=>this.options.prepend&&x.toString()?this.options.prepend+x.toString():x.toString();return this.options.compatibilityJSON==="v1"?x===1?"":typeof x=="number"?`_plural_${x.toString()}`:k():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&c.numbers.length===2&&c.numbers[0]===1?k():this.options.prepend&&g.toString()?this.options.prepend+g.toString():g.toString()}shouldUseIntlApi(){return!Q.includes(this.options.compatibilityJSON)}}const Z=function(S,c,h){let g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,k=L(S,c,h);return!k&&x&&r(h)&&(k=de(S,h,g),k===void 0&&(k=de(c,h,g))),k},K=S=>S.replace(/\$/g,"$$$$");class ne{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=q.create("interpolator"),this.options=c,this.format=c.interpolation&&c.interpolation.format||(h=>h),this.init(c)}init(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};c.interpolation||(c.interpolation={escapeValue:!0});const{escape:h,escapeValue:g,useRawValueToEscape:x,prefix:k,prefixEscaped:j,suffix:I,suffixEscaped:z,formatSeparator:b,unescapeSuffix:Y,unescapePrefix:re,nestingPrefix:U,nestingPrefixEscaped:pe,nestingSuffix:Le,nestingSuffixEscaped:Ve,nestingOptionsSeparator:Ie,maxReplaces:Je,alwaysFormat:Xe}=c.interpolation;this.escape=h!==void 0?h:R,this.escapeValue=g!==void 0?g:!0,this.useRawValueToEscape=x!==void 0?x:!1,this.prefix=k?M(k):j||"{{",this.suffix=I?M(I):z||"}}",this.formatSeparator=b||",",this.unescapePrefix=Y?"":re||"-",this.unescapeSuffix=this.unescapePrefix?"":Y||"",this.nestingPrefix=U?M(U):pe||M("$t("),this.nestingSuffix=Le?M(Le):Ve||M(")"),this.nestingOptionsSeparator=Ie||",",this.maxReplaces=Je||1e3,this.alwaysFormat=Xe!==void 0?Xe:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const c=(h,g)=>h&&h.source===g?(h.lastIndex=0,h):new RegExp(g,"g");this.regexp=c(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=c(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=c(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(c,h,g,x){let k,j,I;const z=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},b=pe=>{if(pe.indexOf(this.formatSeparator)<0){const Je=Z(h,z,pe,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Je,void 0,g,{...x,...h,interpolationkey:pe}):Je}const Le=pe.split(this.formatSeparator),Ve=Le.shift().trim(),Ie=Le.join(this.formatSeparator).trim();return this.format(Z(h,z,Ve,this.options.keySeparator,this.options.ignoreJSONStructure),Ie,g,{...x,...h,interpolationkey:Ve})};this.resetRegExp();const Y=x&&x.missingInterpolationHandler||this.options.missingInterpolationHandler,re=x&&x.interpolation&&x.interpolation.skipOnVariables!==void 0?x.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:pe=>K(pe)},{regex:this.regexp,safeValue:pe=>this.escapeValue?K(this.escape(pe)):K(pe)}].forEach(pe=>{for(I=0;k=pe.regex.exec(c);){const Le=k[1].trim();if(j=b(Le),j===void 0)if(typeof Y=="function"){const Ie=Y(c,k,x);j=r(Ie)?Ie:""}else if(x&&Object.prototype.hasOwnProperty.call(x,Le))j="";else if(re){j=k[0];continue}else this.logger.warn(`missed to pass in variable ${Le} for interpolating ${c}`),j="";else!r(j)&&!this.useRawValueToEscape&&(j=o(j));const Ve=pe.safeValue(j);if(c=c.replace(k[0],Ve),re?(pe.regex.lastIndex+=j.length,pe.regex.lastIndex-=k[0].length):pe.regex.lastIndex=0,I++,I>=this.maxReplaces)break}}),c}nest(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x,k,j;const I=(z,b)=>{const Y=this.nestingOptionsSeparator;if(z.indexOf(Y)<0)return z;const re=z.split(new RegExp(`${Y}[ ]*{`));let U=`{${re[1]}`;z=re[0],U=this.interpolate(U,j);const pe=U.match(/'/g),Le=U.match(/"/g);(pe&&pe.length%2===0&&!Le||Le.length%2!==0)&&(U=U.replace(/'/g,'"'));try{j=JSON.parse(U),b&&(j={...b,...j})}catch(Ve){return this.logger.warn(`failed parsing options string in nesting for key ${z}`,Ve),`${z}${Y}${U}`}return j.defaultValue&&j.defaultValue.indexOf(this.prefix)>-1&&delete j.defaultValue,z};for(;x=this.nestingRegexp.exec(c);){let z=[];j={...g},j=j.replace&&!r(j.replace)?j.replace:j,j.applyPostProcessor=!1,delete j.defaultValue;let b=!1;if(x[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(x[1])){const Y=x[1].split(this.formatSeparator).map(re=>re.trim());x[1]=Y.shift(),z=Y,b=!0}if(k=h(I.call(this,x[1].trim(),j),j),k&&x[0]===c&&!r(k))return k;r(k)||(k=o(k)),k||(this.logger.warn(`missed to resolve ${x[1]} for nesting ${c}`),k=""),b&&(k=z.reduce((Y,re)=>this.format(Y,re,g.lng,{...g,interpolationkey:x[1].trim()}),k.trim())),c=c.replace(x[0],k),this.regexp.lastIndex=0}return c}}const _e=S=>{let c=S.toLowerCase().trim();const h={};if(S.indexOf("(")>-1){const g=S.split("(");c=g[0].toLowerCase().trim();const x=g[1].substring(0,g[1].length-1);c==="currency"&&x.indexOf(":")<0?h.currency||(h.currency=x.trim()):c==="relativetime"&&x.indexOf(":")<0?h.range||(h.range=x.trim()):x.split(";").forEach(j=>{if(j){const[I,...z]=j.split(":"),b=z.join(":").trim().replace(/^'+|'+$/g,""),Y=I.trim();h[Y]||(h[Y]=b),b==="false"&&(h[Y]=!1),b==="true"&&(h[Y]=!0),isNaN(b)||(h[Y]=parseInt(b,10))}})}return{formatName:c,formatOptions:h}},Qe=S=>{const c={};return(h,g,x)=>{let k=x;x&&x.interpolationkey&&x.formatParams&&x.formatParams[x.interpolationkey]&&x[x.interpolationkey]&&(k={...k,[x.interpolationkey]:void 0});const j=g+JSON.stringify(k);let I=c[j];return I||(I=S(he(g),x),c[j]=I),I(h)}};class Tt{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=q.create("formatter"),this.options=c,this.formats={number:Qe((h,g)=>{const x=new Intl.NumberFormat(h,{...g});return k=>x.format(k)}),currency:Qe((h,g)=>{const x=new Intl.NumberFormat(h,{...g,style:"currency"});return k=>x.format(k)}),datetime:Qe((h,g)=>{const x=new Intl.DateTimeFormat(h,{...g});return k=>x.format(k)}),relativetime:Qe((h,g)=>{const x=new Intl.RelativeTimeFormat(h,{...g});return k=>x.format(k,g.range||"day")}),list:Qe((h,g)=>{const x=new Intl.ListFormat(h,{...g});return k=>x.format(k)})},this.init(c)}init(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=h.interpolation.formatSeparator||","}add(c,h){this.formats[c.toLowerCase().trim()]=h}addCached(c,h){this.formats[c.toLowerCase().trim()]=Qe(h)}format(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const k=h.split(this.formatSeparator);if(k.length>1&&k[0].indexOf("(")>1&&k[0].indexOf(")")<0&&k.find(I=>I.indexOf(")")>-1)){const I=k.findIndex(z=>z.indexOf(")")>-1);k[0]=[k[0],...k.splice(1,I)].join(this.formatSeparator)}return k.reduce((I,z)=>{const{formatName:b,formatOptions:Y}=_e(z);if(this.formats[b]){let re=I;try{const U=x&&x.formatParams&&x.formatParams[x.interpolationkey]||{},pe=U.locale||U.lng||x.locale||x.lng||g;re=this.formats[b](I,pe,{...Y,...x,...U})}catch(U){this.logger.warn(U)}return re}else this.logger.warn(`there was no format function for ${b}`);return I},c)}}const gt=(S,c)=>{S.pending[c]!==void 0&&(delete S.pending[c],S.pendingCount--)};class Zi extends oe{constructor(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=c,this.store=h,this.services=g,this.languageUtils=g.languageUtils,this.options=x,this.logger=q.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=x.maxParallelReads||10,this.readingCalls=0,this.maxRetries=x.maxRetries>=0?x.maxRetries:5,this.retryTimeout=x.retryTimeout>=1?x.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(g,x.backend,x)}queueLoad(c,h,g,x){const k={},j={},I={},z={};return c.forEach(b=>{let Y=!0;h.forEach(re=>{const U=`${b}|${re}`;!g.reload&&this.store.hasResourceBundle(b,re)?this.state[U]=2:this.state[U]<0||(this.state[U]===1?j[U]===void 0&&(j[U]=!0):(this.state[U]=1,Y=!1,j[U]===void 0&&(j[U]=!0),k[U]===void 0&&(k[U]=!0),z[re]===void 0&&(z[re]=!0)))}),Y||(I[b]=!0)}),(Object.keys(k).length||Object.keys(j).length)&&this.queue.push({pending:j,pendingCount:Object.keys(j).length,loaded:{},errors:[],callback:x}),{toLoad:Object.keys(k),pending:Object.keys(j),toLoadLanguages:Object.keys(I),toLoadNamespaces:Object.keys(z)}}loaded(c,h,g){const x=c.split("|"),k=x[0],j=x[1];h&&this.emit("failedLoading",k,j,h),!h&&g&&this.store.addResourceBundle(k,j,g,void 0,void 0,{skipCopy:!0}),this.state[c]=h?-1:2,h&&g&&(this.state[c]=0);const I={};this.queue.forEach(z=>{C(z.loaded,[k],j),gt(z,c),h&&z.errors.push(h),z.pendingCount===0&&!z.done&&(Object.keys(z.loaded).forEach(b=>{I[b]||(I[b]={});const Y=z.loaded[b];Y.length&&Y.forEach(re=>{I[b][re]===void 0&&(I[b][re]=!0)})}),z.done=!0,z.errors.length?z.callback(z.errors):z.callback())}),this.emit("loaded",I),this.queue=this.queue.filter(z=>!z.done)}read(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,j=arguments.length>5?arguments[5]:void 0;if(!c.length)return j(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:c,ns:h,fcName:g,tried:x,wait:k,callback:j});return}this.readingCalls++;const I=(b,Y)=>{if(this.readingCalls--,this.waitingReads.length>0){const re=this.waitingReads.shift();this.read(re.lng,re.ns,re.fcName,re.tried,re.wait,re.callback)}if(b&&Y&&x<this.maxRetries){setTimeout(()=>{this.read.call(this,c,h,g,x+1,k*2,j)},k);return}j(b,Y)},z=this.backend[g].bind(this.backend);if(z.length===2){try{const b=z(c,h);b&&typeof b.then=="function"?b.then(Y=>I(null,Y)).catch(I):I(null,b)}catch(b){I(b)}return}return z(c,h,I)}prepareLoading(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=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."),x&&x();r(c)&&(c=this.languageUtils.toResolveHierarchy(c)),r(h)&&(h=[h]);const k=this.queueLoad(c,h,g,x);if(!k.toLoad.length)return k.pending.length||x(),null;k.toLoad.forEach(j=>{this.loadOne(j)})}load(c,h,g){this.prepareLoading(c,h,{},g)}reload(c,h,g){this.prepareLoading(c,h,{reload:!0},g)}loadOne(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const g=c.split("|"),x=g[0],k=g[1];this.read(x,k,"read",void 0,void 0,(j,I)=>{j&&this.logger.warn(`${h}loading namespace ${k} for language ${x} failed`,j),!j&&I&&this.logger.log(`${h}loaded namespace ${k} for language ${x}`,I),this.loaded(c,j,I)})}saveMissing(c,h,g,x,k){let j=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},I=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(h)){this.logger.warn(`did not save key "${g}" as the namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(g==null||g==="")){if(this.backend&&this.backend.create){const z={...j,isUpdate:k},b=this.backend.create.bind(this.backend);if(b.length<6)try{let Y;b.length===5?Y=b(c,h,g,x,z):Y=b(c,h,g,x),Y&&typeof Y.then=="function"?Y.then(re=>I(null,re)).catch(I):I(null,Y)}catch(Y){I(Y)}else b(c,h,g,x,I,z)}!c||!c[0]||this.store.addResource(c[0],h,g,x)}}}const Vt=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:S=>{let c={};if(typeof S[1]=="object"&&(c=S[1]),r(S[1])&&(c.defaultValue=S[1]),r(S[2])&&(c.tDescription=S[2]),typeof S[2]=="object"||typeof S[3]=="object"){const h=S[3]||S[2];Object.keys(h).forEach(g=>{c[g]=h[g]})}return c},interpolation:{escapeValue:!0,format:S=>S,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),jt=S=>(r(S.ns)&&(S.ns=[S.ns]),r(S.fallbackLng)&&(S.fallbackLng=[S.fallbackLng]),r(S.fallbackNS)&&(S.fallbackNS=[S.fallbackNS]),S.supportedLngs&&S.supportedLngs.indexOf("cimode")<0&&(S.supportedLngs=S.supportedLngs.concat(["cimode"])),S),Tn=()=>{},Gi=S=>{Object.getOwnPropertyNames(Object.getPrototypeOf(S)).forEach(h=>{typeof S[h]=="function"&&(S[h]=S[h].bind(S))})};class Rt extends oe{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;if(super(),this.options=jt(c),this.services={},this.logger=q,this.modules={external:[]},Gi(this),h&&!this.isInitialized&&!c.isClone){if(!this.options.initImmediate)return this.init(c,h),this;setTimeout(()=>{this.init(c,h)},0)}}init(){var c=this;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof h=="function"&&(g=h,h={}),!h.defaultNS&&h.defaultNS!==!1&&h.ns&&(r(h.ns)?h.defaultNS=h.ns:h.ns.indexOf("translation")<0&&(h.defaultNS=h.ns[0]));const x=Vt();this.options={...x,...this.options,...jt(h)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...x.interpolation,...this.options.interpolation}),h.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=h.keySeparator),h.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=h.nsSeparator);const k=Y=>Y?typeof Y=="function"?new Y:Y:null;if(!this.options.isClone){this.modules.logger?q.init(k(this.modules.logger),this.options):q.init(null,this.options);let Y;this.modules.formatter?Y=this.modules.formatter:typeof Intl<"u"&&(Y=Tt);const re=new ye(this.options);this.store=new Pe(this.options.resources,this.options);const U=this.services;U.logger=q,U.resourceStore=this.store,U.languageUtils=re,U.pluralResolver=new ee(re,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),Y&&(!this.options.interpolation.format||this.options.interpolation.format===x.interpolation.format)&&(U.formatter=k(Y),U.formatter.init(U,this.options),this.options.interpolation.format=U.formatter.format.bind(U.formatter)),U.interpolator=new ne(this.options),U.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},U.backendConnector=new Zi(k(this.modules.backend),U.resourceStore,U,this.options),U.backendConnector.on("*",function(pe){for(var Le=arguments.length,Ve=new Array(Le>1?Le-1:0),Ie=1;Ie<Le;Ie++)Ve[Ie-1]=arguments[Ie];c.emit(pe,...Ve)}),this.modules.languageDetector&&(U.languageDetector=k(this.modules.languageDetector),U.languageDetector.init&&U.languageDetector.init(U,this.options.detection,this.options)),this.modules.i18nFormat&&(U.i18nFormat=k(this.modules.i18nFormat),U.i18nFormat.init&&U.i18nFormat.init(this)),this.translator=new ke(this.services,this.options),this.translator.on("*",function(pe){for(var Le=arguments.length,Ve=new Array(Le>1?Le-1:0),Ie=1;Ie<Le;Ie++)Ve[Ie-1]=arguments[Ie];c.emit(pe,...Ve)}),this.modules.external.forEach(pe=>{pe.init&&pe.init(this)})}if(this.format=this.options.interpolation.format,g||(g=Tn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const Y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Y.length>0&&Y[0]!=="dev"&&(this.options.lng=Y[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(Y=>{this[Y]=function(){return c.store[Y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(Y=>{this[Y]=function(){return c.store[Y](...arguments),c}});const z=i(),b=()=>{const Y=(re,U)=>{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),z.resolve(U),g(re,U)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return Y(null,this.t.bind(this));this.changeLanguage(this.options.lng,Y)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),z}loadResources(c){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tn;const x=r(c)?c:this.language;if(typeof c=="function"&&(g=c),!this.options.resources||this.options.partialBundledLanguages){if(x&&x.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return g();const k=[],j=I=>{if(!I||I==="cimode")return;this.services.languageUtils.toResolveHierarchy(I).forEach(b=>{b!=="cimode"&&k.indexOf(b)<0&&k.push(b)})};x?j(x):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(z=>j(z)),this.options.preload&&this.options.preload.forEach(I=>j(I)),this.services.backendConnector.load(k,this.options.ns,I=>{!I&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),g(I)})}else g(null)}reloadResources(c,h,g){const x=i();return typeof c=="function"&&(g=c,c=void 0),typeof h=="function"&&(g=h,h=void 0),c||(c=this.languages),h||(h=this.options.ns),g||(g=Tn),this.services.backendConnector.reload(c,h,k=>{x.resolve(),g(k)}),x}use(c){if(!c)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!c.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return c.type==="backend"&&(this.modules.backend=c),(c.type==="logger"||c.log&&c.warn&&c.error)&&(this.modules.logger=c),c.type==="languageDetector"&&(this.modules.languageDetector=c),c.type==="i18nFormat"&&(this.modules.i18nFormat=c),c.type==="postProcessor"&&xe.addPostProcessor(c),c.type==="formatter"&&(this.modules.formatter=c),c.type==="3rdParty"&&this.modules.external.push(c),this}setResolvedLanguage(c){if(!(!c||!this.languages)&&!(["cimode","dev"].indexOf(c)>-1))for(let h=0;h<this.languages.length;h++){const g=this.languages[h];if(!(["cimode","dev"].indexOf(g)>-1)&&this.store.hasLanguageSomeTranslations(g)){this.resolvedLanguage=g;break}}}changeLanguage(c,h){var g=this;this.isLanguageChangingTo=c;const x=i();this.emit("languageChanging",c);const k=z=>{this.language=z,this.languages=this.services.languageUtils.toResolveHierarchy(z),this.resolvedLanguage=void 0,this.setResolvedLanguage(z)},j=(z,b)=>{b?(k(b),this.translator.changeLanguage(b),this.isLanguageChangingTo=void 0,this.emit("languageChanged",b),this.logger.log("languageChanged",b)):this.isLanguageChangingTo=void 0,x.resolve(function(){return g.t(...arguments)}),h&&h(z,function(){return g.t(...arguments)})},I=z=>{!c&&!z&&this.services.languageDetector&&(z=[]);const b=r(z)?z:this.services.languageUtils.getBestMatchFromCodes(z);b&&(this.language||k(b),this.translator.language||this.translator.changeLanguage(b),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(b)),this.loadResources(b,Y=>{j(Y,b)})};return!c&&this.services.languageDetector&&!this.services.languageDetector.async?I(this.services.languageDetector.detect()):!c&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(I):this.services.languageDetector.detect(I):I(c),x}getFixedT(c,h,g){var x=this;const k=function(j,I){let z;if(typeof I!="object"){for(var b=arguments.length,Y=new Array(b>2?b-2:0),re=2;re<b;re++)Y[re-2]=arguments[re];z=x.options.overloadTranslationOptionHandler([j,I].concat(Y))}else z={...I};z.lng=z.lng||k.lng,z.lngs=z.lngs||k.lngs,z.ns=z.ns||k.ns,z.keyPrefix!==""&&(z.keyPrefix=z.keyPrefix||g||k.keyPrefix);const U=x.options.keySeparator||".";let pe;return z.keyPrefix&&Array.isArray(j)?pe=j.map(Le=>`${z.keyPrefix}${U}${Le}`):pe=z.keyPrefix?`${z.keyPrefix}${U}${j}`:j,x.t(pe,z)};return r(c)?k.lng=c:k.lngs=c,k.ns=h,k.keyPrefix=g,k}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(c){this.options.defaultNS=c}hasLoadedNamespace(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const g=h.lng||this.resolvedLanguage||this.languages[0],x=this.options?this.options.fallbackLng:!1,k=this.languages[this.languages.length-1];if(g.toLowerCase()==="cimode")return!0;const j=(I,z)=>{const b=this.services.backendConnector.state[`${I}|${z}`];return b===-1||b===0||b===2};if(h.precheck){const I=h.precheck(this,j);if(I!==void 0)return I}return!!(this.hasResourceBundle(g,c)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||j(g,c)&&(!x||j(k,c)))}loadNamespaces(c,h){const g=i();return this.options.ns?(r(c)&&(c=[c]),c.forEach(x=>{this.options.ns.indexOf(x)<0&&this.options.ns.push(x)}),this.loadResources(x=>{g.resolve(),h&&h(x)}),g):(h&&h(),Promise.resolve())}loadLanguages(c,h){const g=i();r(c)&&(c=[c]);const x=this.options.preload||[],k=c.filter(j=>x.indexOf(j)<0&&this.services.languageUtils.isSupportedCode(j));return k.length?(this.options.preload=x.concat(k),this.loadResources(j=>{g.resolve(),h&&h(j)}),g):(h&&h(),Promise.resolve())}dir(c){if(c||(c=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!c)return"rtl";const h=["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"],g=this.services&&this.services.languageUtils||new ye(Vt());return h.indexOf(g.getLanguagePartFromCode(c))>-1||c.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;return new Rt(c,h)}cloneInstance(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tn;const g=c.forkResourceStore;g&&delete c.forkResourceStore;const x={...this.options,...c,isClone:!0},k=new Rt(x);return(c.debug!==void 0||c.prefix!==void 0)&&(k.logger=k.logger.clone(c)),["store","services","language"].forEach(I=>{k[I]=this[I]}),k.services={...this.services},k.services.utils={hasLoadedNamespace:k.hasLoadedNamespace.bind(k)},g&&(k.store=new Pe(this.store.data,x),k.services.resourceStore=k.store),k.translator=new ke(k.services,x),k.translator.on("*",function(I){for(var z=arguments.length,b=new Array(z>1?z-1:0),Y=1;Y<z;Y++)b[Y-1]=arguments[Y];k.emit(I,...b)}),k.init(x,h),k.translator.options=x,k.translator.backendConnector.services.utils={hasLoadedNamespace:k.hasLoadedNamespace.bind(k)},k}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Pr=Rt.createInstance();return Pr.createInstance=Rt.createInstance,Ji=Pr,Ji}const Wh=[{code:"af",label:"Afrikaans"},{code:"ar",label:"Arabic"},{code:"bg",label:"Bulgarian"},{code:"bn",label:"Bengali"},{code:"bs",label:"Bosnian"},{code:"ca",label:"Catalan"},{code:"cs",label:"Czech"},{code:"da",label:"Danish"},{code:"de",label:"German"},{code:"de-CH",label:"Swiss German"},{code:"el",label:"Greek"},{code:"en",label:"English"},{code:"eo",label:"Esperanto"},{code:"es",label:"Spanish"},{code:"et",label:"Estonian"},{code:"eu",label:"Basque"},{code:"fa",label:"Persian/Farsi"},{code:"fi",label:"Finnish"},{code:"fr",label:"French"},{code:"gd",label:"Gaelic (Scottish)"},{code:"he",label:"Hebrew"},{code:"hi",label:"Hindi"},{code:"hr",label:"Croatian"},{code:"hu",label:"Hungarian"},{code:"id",label:"Indonesian"},{code:"is",label:"Icelandic"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"kz",label:"Kazakh"},{code:"lt",label:"Lithuanian"},{code:"lv",label:"Latvian"},{code:"mk",label:"Macedonian"},{code:"mn",label:"Mongolian"},{code:"ms",label:"Malay"},{code:"nb",label:"Norwegian Bokmål"},{code:"ne",label:"Nepali"},{code:"nl",label:"Dutch"},{code:"nn",label:"Norwegian Nynorsk"},{code:"pa",label:"Punjabi"},{code:"pl",label:"Polish"},{code:"pt",label:"Portuguese"},{code:"pt-BR",label:"Portuguese (Brazil)"},{code:"ro",label:"Romanian"},{code:"ru",label:"Russian"},{code:"si",label:"Sinhala"},{code:"sk",label:"Slovak"},{code:"sl",label:"Slovenian"},{code:"sq",label:"Albanian"},{code:"sr",label:"Serbian"},{code:"sr-Cyrl",label:"Serbian (Cyrillic)"},{code:"sv",label:"Swedish"},{code:"sw",label:"Swahili"},{code:"ta",label:"Tamil"},{code:"th",label:"Thai"},{code:"tr",label:"Turkish"},{code:"uk",label:"Ukrainian"},{code:"ur",label:"Urdu"},{code:"uz",label:"Uzbek"},{code:"vi",label:"Vietnamese"},{code:"zh",label:"Chinese"},{code:"zh-Hant",label:"Traditional Chinese"}];var Xi,hu;function Qh(){if(hu)return Xi;hu=1;const r=Kh(),i=Wh,o=i.map(d=>d.code);function l(d,m){return d.reduce((v,y)=>{let C;try{C=au("/ghost/i18n/lib")(`../locales/${y}/${m}.json`)}catch{C=au("/ghost/i18n/lib")(`../locales/en/${m}.json`)}return v[y]={[m]:{...C,...C.default&&typeof C.default=="object"?C.default:{}}},v},{})}function a({generateThemeResources:d}){return(m="en",v="portal",y={})=>{const C=r.createInstance(),E={prefix:"{",suffix:"}"};(v==="theme"||v==="portal")&&(E.escapeValue=!1);let L;return v!=="theme"?L=l(o,v):L=d(m,y),C.init({lng:m,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:v,defaultNS:v,interpolation:E,resources:L}),C}}return Xi={createI18n:a,generateResources:l,LOCALE_DATA:i,SUPPORTED_LOCALES:o},Xi}var du;function Yh(){if(du)return Jn.exports;du=1;const{createI18n:r,generateResources:i,LOCALE_DATA:o,SUPPORTED_LOCALES:l}=Qh();function a(m){return{[m]:{theme:{}}}}const d=r({generateThemeResources:a});return Jn.exports=d,Jn.exports.SUPPORTED_LOCALES=l,Jn.exports.LOCALE_DATA=o,Jn.exports.generateResources=i,Jn.exports}var pu;function Jh(){if(pu)return En.exports;pu=1;const r=Yh();return En.exports=r,En.exports.default=r,En.exports.LOCALE_DATA=r.LOCALE_DATA,En.exports.SUPPORTED_LOCALES=r.SUPPORTED_LOCALES,En.exports.generateResources=r.generateResources,En.exports}var Xh=Jh();const Zh=$i(Xh);class Gh extends Xt.Component{constructor(i){super(i);const o=this.props.locale||"en",l=Zh(o,"search"),a=l.dir()||"ltr",d=new If({adminUrl:i.adminUrl,apiKey:i.apiKey,dir:a});this.state={searchIndex:d,showPopup:!1,indexStarted:!1,indexComplete:!1,t:l.t,dir:a,scrollbarWidth:0},this.inputRef=Xt.createRef()}componentDidMount(){const i=this.getScrollbarWidth();this.setState({scrollbarWidth:i}),this.initSetup()}componentDidUpdate(i,o){if(o.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=window.document?.body?.style?.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue("margin-right"),window.document.body.style.overflow="hidden",this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||"",!this.bodyMargin||this.bodyMargin==="0px"?window.document.body.style.marginRight="":window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==o?.showPopup&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}getScrollbarWidth(){const i=document.createElement("div");i.style.visibility="hidden",i.style.overflow="scroll",document.body.appendChild(i);const o=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),o}setupCustomTriggerButton(){this.clickHandler=i=>{i.preventDefault(),this.setState({showPopup:!0});const o=document.createElement("input");o.style.opacity="0",o.style.position="fixed",o.style.top="0",document.body.appendChild(o),o.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(o)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(i=>{i.removeEventListener("click",this.clickHandler),i.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll("[data-ghost-search]")||[]}handleSearchUrl(){const[i]=window.location.hash.substr(1).split("?");(i==="/search"||i==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){this.getCustomTriggerButtons()?.length&&(this.handleKeyDown=o=>{if(o.key==="k"&&o.metaKey)return this.setState({showPopup:!0}),o.preventDefault(),o.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return G.jsx(nt.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(i,o)=>{i==="update"&&this.setState({...this.state,...o})},t:this.state.t,dir:this.state.dir},children:G.jsx(df,{})})}}const gu="sodo-search-root";function qh(){const r=document.createElement("div");r.id=gu,document.body.appendChild(r)}function ed(){const r=document.querySelector("script[data-sodo-search]");if(r){const i=r.dataset.sodoSearch,o=r.dataset.key,l=r.dataset.styles,a=r.dataset.locale||"en";return{adminUrl:i,apiKey:o,stylesUrl:l,locale:a}}return{}}function td(){qh()}function nd(){const{adminUrl:r,apiKey:i,stylesUrl:o,locale:l}=ed(),a=(r||window.location.origin)?.replace(/\/+$/,"");td(),Uc.render(G.jsx(Xt.StrictMode,{children:G.jsx(Gh,{adminUrl:a,apiKey:i,stylesUrl:o,locale:l})}),document.getElementById(gu))}nd();const rd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}))}));
|
|
17
|
+
`,o=this.context.stylesUrl;return o?G.jsxs(G.Fragment,{children:[G.jsx("link",{rel:"stylesheet",href:o}),G.jsx("style",{dangerouslySetInnerHTML:{__html:i}}),G.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]}):G.jsxs(G.Fragment,{children:[G.jsx("style",{dangerouslySetInnerHTML:{__html:i}}),G.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]})}renderFrameContainer(){const i=Wc(),o={...i.frame.common};return G.jsx("div",{style:i.modalContainer,className:"gh-root-frame",children:G.jsxs(Hc,{style:o,title:"portal-popup",head:this.renderFrameStyles(),searchdir:this.context.dir,children:[G.jsx("div",{onClick:l=>this.handlePopupClose(l),className:"absolute top-0 bottom-0 left-0 right-0 block backdrop-blur-[2px] animate-fadein z-0 bg-gradient-to-br from-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.1)]"}),G.jsx(Qc,{})]})})}render(){const{showPopup:i}=this.context;return i?this.renderFrameContainer():null}}var ie;function Ge(r,i,o){const l=typeof o,a=typeof r;if(l!=="undefined"){if(a!=="undefined"){if(o){if(a==="function"&&l===a)return function(v){return r(o(v))};if(i=r.constructor,i===o.constructor){if(i===Array)return o.concat(r);if(i===Map){var d=new Map(o);for(var m of r)d.set(m[0],m[1]);return d}if(i===Set){m=new Set(o);for(d of r.values())m.add(d);return m}}}return r}return o}return a==="undefined"?i:r}function Vn(r,i){return typeof r>"u"?i:r}function Ke(){return Object.create(null)}function $t(r){return typeof r=="string"}function Sr(r){return typeof r=="object"}function kr(r,i){if($t(i))r=r[i];else for(let o=0;r&&o<i.length;o++)r=r[i[o]];return r}const pf=/[^\p{L}\p{N}]+/u,gf=/(\d{3})/g,mf=/(\D)(\d{3})/g,yf=/(\d{3})(\D)/g,Ul=/[\u0300-\u036f]/g;function Hn(r={}){if(!this||this.constructor!==Hn)return new Hn(...arguments);if(arguments.length)for(r=0;r<arguments.length;r++)this.assign(arguments[r]);else this.assign(r)}ie=Hn.prototype,ie.assign=function(r){this.normalize=Ge(r.normalize,!0,this.normalize);let i=r.include,o=i||r.exclude||r.split,l;if(o||o===""){if(typeof o=="object"&&o.constructor!==RegExp){let a="";l=!i,i||(a+="\\p{Z}"),o.letter&&(a+="\\p{L}"),o.number&&(a+="\\p{N}",l=!!i),o.symbol&&(a+="\\p{S}"),o.punctuation&&(a+="\\p{P}"),o.control&&(a+="\\p{C}"),(o=o.char)&&(a+=typeof o=="object"?o.join(""):o);try{this.split=new RegExp("["+(i?"^":"")+a+"]+","u")}catch{this.split=/\s+/}}else this.split=o,l=o===!1||"a1a".split(o).length<2;this.numeric=Ge(r.numeric,l)}else{try{this.split=Ge(this.split,pf)}catch{this.split=/\s+/}this.numeric=Ge(r.numeric,Ge(this.numeric,!0))}if(this.prepare=Ge(r.prepare,null,this.prepare),this.finalize=Ge(r.finalize,null,this.finalize),o=r.filter,this.filter=typeof o=="function"?o:Ge(o&&new Set(o),null,this.filter),this.dedupe=Ge(r.dedupe,!0,this.dedupe),this.matcher=Ge((o=r.matcher)&&new Map(o),null,this.matcher),this.mapper=Ge((o=r.mapper)&&new Map(o),null,this.mapper),this.stemmer=Ge((o=r.stemmer)&&new Map(o),null,this.stemmer),this.replacer=Ge(r.replacer,null,this.replacer),this.minlength=Ge(r.minlength,1,this.minlength),this.maxlength=Ge(r.maxlength,1024,this.maxlength),this.rtl=Ge(r.rtl,!1,this.rtl),(this.cache=o=Ge(r.cache,!0,this.cache))&&(this.F=null,this.L=typeof o=="number"?o:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const a of this.matcher.keys())this.h+=(this.h?"|":"")+a;if(this.stemmer)for(const a of this.stemmer.keys())this.A+=(this.A?"|":"")+a;return this},ie.addStemmer=function(r,i){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(r,i),this.A+=(this.A?"|":"")+r,this.K=null,this.cache&&kn(this),this},ie.addFilter=function(r){return typeof r=="function"?this.filter=r:(this.filter||(this.filter=new Set),this.filter.add(r)),this.cache&&kn(this),this},ie.addMapper=function(r,i){return typeof r=="object"?this.addReplacer(r,i):r.length>1?this.addMatcher(r,i):(this.mapper||(this.mapper=new Map),this.mapper.set(r,i),this.cache&&kn(this),this)},ie.addMatcher=function(r,i){return typeof r=="object"?this.addReplacer(r,i):r.length<2&&(this.dedupe||this.mapper)?this.addMapper(r,i):(this.matcher||(this.matcher=new Map),this.matcher.set(r,i),this.h+=(this.h?"|":"")+r,this.J=null,this.cache&&kn(this),this)},ie.addReplacer=function(r,i){return typeof r=="string"?this.addMatcher(r,i):(this.replacer||(this.replacer=[]),this.replacer.push(r,i),this.cache&&kn(this),this)},ie.encode=function(r,i){if(this.cache&&r.length<=this.H)if(this.F){if(this.B.has(r))return this.B.get(r)}else this.F=setTimeout(kn,50,this);this.normalize&&(typeof this.normalize=="function"?r=this.normalize(r):r=Ul?r.normalize("NFKD").replace(Ul,"").toLowerCase():r.toLowerCase()),this.prepare&&(r=this.prepare(r)),this.numeric&&r.length>3&&(r=r.replace(mf,"$1 $2").replace(yf,"$1 $2").replace(gf,"$1 "));const o=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let l=[],a=Ke(),d,m,v=this.split||this.split===""?r.split(this.split):[r];for(let C=0,E,L;C<v.length;C++)if((E=L=v[C])&&!(E.length<this.minlength||E.length>this.maxlength)){if(i){if(a[E])continue;a[E]=1}else{if(d===E)continue;d=E}if(o)l.push(E);else if(!this.filter||(typeof this.filter=="function"?this.filter(E):!this.filter.has(E))){if(this.cache&&E.length<=this.I)if(this.F){var y=this.D.get(E);if(y||y===""){y&&l.push(y);continue}}else this.F=setTimeout(kn,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let F;for(;F!==E&&E.length>2;)F=E,E=E.replace(this.K,M=>this.stemmer.get(M))}if(E&&(this.mapper||this.dedupe&&E.length>1)){y="";for(let F=0,M="",V,R;F<E.length;F++)V=E.charAt(F),V===M&&this.dedupe||((R=this.mapper&&this.mapper.get(V))||R===""?R===M&&this.dedupe||!(M=R)||(y+=R):y+=M=V);E=y}if(this.matcher&&E.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),E=E.replace(this.J,F=>this.matcher.get(F))),E&&this.replacer)for(y=0;E&&y<this.replacer.length;y+=2)E=E.replace(this.replacer[y],this.replacer[y+1]);if(this.cache&&L.length<=this.I&&(this.D.set(L,E),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),E){if(E!==L)if(i){if(a[E])continue;a[E]=1}else{if(m===E)continue;m=E}l.push(E)}}}return this.finalize&&(l=this.finalize(l)||l),this.cache&&r.length<=this.H&&(this.B.set(r,l),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),l};function kn(r){r.F=null,r.B.clear(),r.D.clear()}function _i(r,i,o){o||(i||typeof r!="object"?typeof i=="object"&&(o=i,i=0):o=r),o&&(r=o.query||r,i=o.limit||i);let l=""+(i||0);o&&(l+=(o.offset||0)+!!o.context+!!o.suggest+(o.resolve!==!1)+(o.resolution||this.resolution)+(o.boost||0)),r=(""+r).toLowerCase(),this.cache||(this.cache=new Cn);let a=this.cache.get(r+l);if(!a){const d=o&&o.cache;d&&(o.cache=!1),a=this.search(r,i,o),d&&(o.cache=d),this.cache.set(r+l,a)}return a}function Cn(r){this.limit=r&&r!==!0?r:1e3,this.cache=new Map,this.h=""}Cn.prototype.set=function(r,i){this.cache.set(this.h=r,i),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},Cn.prototype.get=function(r){const i=this.cache.get(r);return i&&this.h!==r&&(this.cache.delete(r),this.cache.set(this.h=r,i)),i},Cn.prototype.remove=function(r){for(const i of this.cache){const o=i[0];i[1].includes(r)&&this.cache.delete(o)}},Cn.prototype.clear=function(){this.cache.clear(),this.h=""};const Bl={normalize:!1,numeric:!1,dedupe:!1},gs={},Ii=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),Vl=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Hl=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],bl={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var zi={Exact:Bl,Default:gs,Normalize:gs,LatinBalance:{mapper:Ii},LatinAdvanced:{mapper:Ii,matcher:Vl,replacer:Hl},LatinExtra:{mapper:Ii,replacer:Hl.concat([/(?!^)[aeo]/g,""]),matcher:Vl},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(r){for(let o=0;o<r.length;o++){var i=r[o];let l=i.charAt(0),a=bl[l];for(let d=1,m;d<i.length&&(m=i.charAt(d),m==="h"||m==="w"||!(m=bl[m])||m===a||(l+=m,a=m,l.length!==4));d++);r[o]=l}}},CJK:{split:""},LatinExact:Bl,LatinDefault:gs,LatinSimple:gs};function Kl(r,i,o,l){let a=[];for(let d=0,m;d<r.index.length;d++)if(m=r.index[d],i>=m.length)i-=m.length;else{i=m[l?"splice":"slice"](i,o);const v=i.length;if(v&&(a=a.length?a.concat(i):i,o-=v,l&&(r.length-=v),!o))break;i=0}return a}function bn(r){if(!this||this.constructor!==bn)return new bn(r);this.index=r?[r]:[],this.length=r?r.length:0;const i=this;return new Proxy([],{get(o,l){if(l==="length")return i.length;if(l==="push")return function(a){i.index[i.index.length-1].push(a),i.length++};if(l==="pop")return function(){if(i.length)return i.length--,i.index[i.index.length-1].pop()};if(l==="indexOf")return function(a){let d=0;for(let m=0,v,y;m<i.index.length;m++){if(v=i.index[m],y=v.indexOf(a),y>=0)return d+y;d+=v.length}return-1};if(l==="includes")return function(a){for(let d=0;d<i.index.length;d++)if(i.index[d].includes(a))return!0;return!1};if(l==="slice")return function(a,d){return Kl(i,a||0,d||i.length,!1)};if(l==="splice")return function(a,d){return Kl(i,a||0,d||i.length,!0)};if(l==="constructor")return Array;if(typeof l!="symbol")return(o=i.index[l/2**31|0])&&o[l]},set(o,l,a){return o=l/2**31|0,(i.index[o]||(i.index[o]=[]))[l]=a,i.length++,!0}})}bn.prototype.clear=function(){this.index.length=0},bn.prototype.push=function(){};function Pt(r=8){if(!this||this.constructor!==Pt)return new Pt(r);this.index=Ke(),this.h=[],this.size=0,r>32?(this.B=Ql,this.A=BigInt(r)):(this.B=Wl,this.A=r)}Pt.prototype.get=function(r){const i=this.index[this.B(r)];return i&&i.get(r)},Pt.prototype.set=function(r,i){var o=this.B(r);let l=this.index[o];l?(o=l.size,l.set(r,i),(o-=l.size)&&this.size++):(this.index[o]=l=new Map([[r,i]]),this.h.push(l),this.size++)};function Et(r=8){if(!this||this.constructor!==Et)return new Et(r);this.index=Ke(),this.h=[],this.size=0,r>32?(this.B=Ql,this.A=BigInt(r)):(this.B=Wl,this.A=r)}Et.prototype.add=function(r){var i=this.B(r);let o=this.index[i];o?(i=o.size,o.add(r),(i-=o.size)&&this.size++):(this.index[i]=o=new Set([r]),this.h.push(o),this.size++)},ie=Pt.prototype,ie.has=Et.prototype.has=function(r){const i=this.index[this.B(r)];return i&&i.has(r)},ie.delete=Et.prototype.delete=function(r){const i=this.index[this.B(r)];i&&i.delete(r)&&this.size--},ie.clear=Et.prototype.clear=function(){this.index=Ke(),this.h=[],this.size=0},ie.values=Et.prototype.values=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].values())yield i},ie.keys=Et.prototype.keys=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].keys())yield i},ie.entries=Et.prototype.entries=function*(){for(let r=0;r<this.h.length;r++)for(let i of this.h[r].entries())yield i};function Wl(r){let i=2**this.A-1;if(typeof r=="number")return r&i;let o=0,l=this.A+1;for(let a=0;a<r.length;a++)o=(o*l^r.charCodeAt(a))&i;return this.A===32?o+2**31:o}function Ql(r){let i=BigInt(2)**this.A-BigInt(1);var o=typeof r;if(o==="bigint")return r&i;if(o==="number")return BigInt(r)&i;o=BigInt(0);let l=this.A+BigInt(1);for(let a=0;a<r.length;a++)o=(o*l^BigInt(r.charCodeAt(a)))&i;return o}let Kn,Cr;async function vf(r){r=r.data;var i=r.task;const o=r.id;let l=r.args;if(i==="init")Cr=r.options||{},(i=r.factory)?(Function("return "+i)()(self),Kn=new self.FlexSearch.Index(Cr),delete self.FlexSearch):Kn=new Ot(Cr),postMessage({id:o});else{let a;i==="export"&&(l[1]?(l[0]=Cr.export,l[2]=0,l[3]=1):l=null),i==="import"?l[0]&&(r=await Cr.import.call(Kn,l[0]),Kn.import(l[0],r)):((a=l&&Kn[i].apply(Kn,l))&&a.then&&(a=await a),a&&a.await&&(a=await a.await),i==="search"&&a.result&&(a=a.result)),postMessage(i==="search"?{id:o,msg:a}:{id:o})}}function Mi(r){Wn.call(r,"add"),Wn.call(r,"append"),Wn.call(r,"search"),Wn.call(r,"update"),Wn.call(r,"remove"),Wn.call(r,"searchCache")}let Fi,Yl,ms;function wf(){Fi=ms=0}function Wn(r){this[r+"Async"]=function(){const i=arguments;var o=i[i.length-1];let l;if(typeof o=="function"&&(l=o,delete i[i.length-1]),Fi?ms||(ms=Date.now()-Yl>=this.priority*this.priority*3):(Fi=setTimeout(wf,0),Yl=Date.now()),ms){const d=this;return new Promise(m=>{setTimeout(function(){m(d[r+"Async"].apply(d,i))},0)})}const a=this[r].apply(this,i);return o=a.then?a:new Promise(d=>d(a)),l&&o.then(l),o}}let Zt=0;function Qn(r={},i){function o(v){function y(C){C=C.data||C;const E=C.id,L=E&&d.h[E];L&&(L(C.msg),delete d.h[E])}if(this.worker=v,this.h=Ke(),this.worker)return a?this.worker.on("message",y):this.worker.onmessage=y,r.config?new Promise(function(C){Zt>1e9&&(Zt=0),d.h[++Zt]=function(){C(d)},d.worker.postMessage({id:Zt,task:"init",factory:l,options:r})}):(this.priority=r.priority||4,this.encoder=i||null,this.worker.postMessage({task:"init",factory:l,options:r}),this)}if(!this||this.constructor!==Qn)return new Qn(r);let l=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;l&&(l=l.toString());const a=typeof window>"u",d=this,m=xf(l,a,r.worker);return m.then?m.then(function(v){return o.call(d,v)}):o.call(this,m)}Gt("add"),Gt("append"),Gt("search"),Gt("update"),Gt("remove"),Gt("clear"),Gt("export"),Gt("import"),Qn.prototype.searchCache=_i,Mi(Qn.prototype);function Gt(r){Qn.prototype[r]=function(){const i=this,o=[].slice.call(arguments);var l=o[o.length-1];let a;return typeof l=="function"&&(a=l,o.pop()),l=new Promise(function(d){r==="export"&&typeof o[0]=="function"&&(o[0]=null),Zt>1e9&&(Zt=0),i.h[++Zt]=d,i.worker.postMessage({task:r,id:Zt,args:o})}),a?(l.then(a),this):l}}function xf(r,i,o){return i?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>rd).then(function(l){return new l.Worker("undefined/node/node.mjs")}):r?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+vf.toString()],{type:"text/javascript"}))):new window.Worker(typeof o=="string"?o:(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Un&&Un.tagName.toUpperCase()==="SCRIPT"&&Un.src||new URL("sodo-search.min.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}$n.prototype.add=function(r,i,o){if(Sr(r)&&(i=r,r=kr(i,this.key)),i&&(r||r===0)){if(!o&&this.reg.has(r))return this.update(r,i);for(let v=0,y;v<this.field.length;v++){y=this.B[v];var l=this.index.get(this.field[v]);if(typeof y=="function"){var a=y(i);a&&l.add(r,a,o,!0)}else a=y.G,(!a||a(i))&&(y.constructor===String?y=[""+y]:$t(y)&&(y=[y]),Ui(i,y,this.D,0,l,r,y[0],o))}if(this.tag)for(l=0;l<this.A.length;l++){var d=this.A[l];a=this.tag.get(this.F[l]);let v=Ke();if(typeof d=="function"){if(d=d(i),!d)continue}else{var m=d.G;if(m&&!m(i))continue;d.constructor===String&&(d=""+d),d=kr(i,d)}if(a&&d){$t(d)&&(d=[d]);for(let y=0,C,E;y<d.length;y++)if(C=d[y],!v[C]&&(v[C]=1,(m=a.get(C))?E=m:a.set(C,E=[]),!o||!E.includes(r))){if(E.length===2**31-1){if(m=new bn(E),this.fastupdate)for(let L of this.reg.values())L.includes(E)&&(L[L.indexOf(E)]=m);a.set(C,E=m)}E.push(r),this.fastupdate&&((m=this.reg.get(r))?m.push(E):this.reg.set(r,[E]))}}}if(this.store&&(!o||!this.store.has(r))){let v;if(this.h){v=Ke();for(let y=0,C;y<this.h.length;y++){if(C=this.h[y],(o=C.G)&&!o(i))continue;let E;if(typeof C=="function"){if(E=C(i),!E)continue;C=[C.O]}else if($t(C)||C.constructor===String){v[C]=i[C];continue}Di(i,v,C,0,C[0],E)}}this.store.set(r,v||i)}this.worker&&(this.fastupdate||this.reg.add(r))}return this};function Di(r,i,o,l,a,d){if(r=r[a],l===o.length-1)i[a]=d||r;else if(r)if(r.constructor===Array)for(i=i[a]=Array(r.length),a=0;a<r.length;a++)Di(r,i,o,l,a);else i=i[a]||(i[a]=Ke()),a=o[++l],Di(r,i,o,l,a)}function Ui(r,i,o,l,a,d,m,v){if(r=r[m])if(l===i.length-1){if(r.constructor===Array){if(o[l]){for(i=0;i<r.length;i++)a.add(d,r[i],!0,!0);return}r=r.join(" ")}a.add(d,r,v,!0)}else if(r.constructor===Array)for(m=0;m<r.length;m++)Ui(r,i,o,l,a,d,m,v);else m=i[++l],Ui(r,i,o,l,a,d,m,v)}function Bi(r,i,o,l){if(!r.length)return r;if(r.length===1)return r=r[0],r=o||r.length>i?r.slice(o,o+i):r,l?Yn.call(this,r):r;let a=[];for(let d=0,m,v;d<r.length;d++)if((m=r[d])&&(v=m.length)){if(o){if(o>=v){o-=v;continue}m=m.slice(o,o+i),v=m.length,o=0}if(v>i&&(m=m.slice(0,i),v=i),!a.length&&v>=i)return l?Yn.call(this,m):m;if(a.push(m),i-=v,!i)break}return a=a.length>1?[].concat.apply([],a):a[0],l?Yn.call(this,a):a}function ys(r,i,o,l){var a=l[0];if(a[0]&&a[0].query)return r[i].apply(r,a);if(!(i!=="and"&&i!=="not"||r.result.length||r.await||a.suggest))return l.length>1&&(a=l[l.length-1]),(l=a.resolve)?r.await||r.result:r;let d=[],m=0,v=0,y,C,E,L,F;for(i=0;i<l.length;i++)if(a=l[i]){var M=void 0;if(a.constructor===Fe)M=a.await||a.result;else if(a.then||a.constructor===Array)M=a;else{m=a.limit||0,v=a.offset||0,E=a.suggest,C=a.resolve,y=((L=a.highlight||r.highlight)||a.enrich)&&C,M=a.queue;let V=a.async||M,R=a.index,O=a.query;if(R?r.index||(r.index=R):R=r.index,O||a.tag){const J=a.field||a.pluck;if(J&&(!O||r.query&&!L||(r.query=O,r.field=J,r.highlight=L),R=R.index.get(J)),M&&(F||r.await)){F=1;let X;const fe=r.C.length,de=new Promise(function(he){X=he});(function(he,ae){de.h=function(){ae.index=null,ae.resolve=!1;let ue=V?he.searchAsync(ae):he.search(ae);return ue.then?ue.then(function(q){return r.C[fe]=q=q.result||q,X(q),q}):(ue=ue.result||ue,X(ue),ue)}})(R,Object.assign({},a)),r.C.push(de),d[i]=de;continue}else a.resolve=!1,a.index=null,M=V?R.searchAsync(a):R.search(a),a.resolve=C,a.index=R}else if(a.and)M=vs(a,"and",R);else if(a.or)M=vs(a,"or",R);else if(a.not)M=vs(a,"not",R);else if(a.xor)M=vs(a,"xor",R);else continue}M.await?(F=1,M=M.await):M.then?(F=1,M=M.then(function(V){return V.result||V})):M=M.result||M,d[i]=M}if(F&&!r.await&&(r.await=new Promise(function(V){r.return=V})),F){const V=Promise.all(d).then(function(R){for(let O=0;O<r.C.length;O++)if(r.C[O]===V){r.C[O]=function(){return o.call(r,R,m,v,y,C,E,L)};break}Vi(r)});r.C.push(V)}else if(r.await)r.C.push(function(){return o.call(r,d,m,v,y,C,E,L)});else return o.call(r,d,m,v,y,C,E,L);return C?r.await||r.result:r}function vs(r,i,o){r=r[i];const l=r[0]||r;return l.index||(l.index=o),o=new Fe(l),r.length>1&&(o=o[i].apply(o,r.slice(1))),o}Fe.prototype.or=function(){return ys(this,"or",Sf,arguments)};function Sf(r,i,o,l,a,d,m){return r.length&&(this.result.length&&r.push(this.result),r.length<2?this.result=r[0]:(this.result=Jl(r,i,o,!1,this.h),o=0)),a&&(this.await=null),a?this.resolve(i,o,l,m):this}Fe.prototype.and=function(){return ys(this,"and",kf,arguments)};function kf(r,i,o,l,a,d,m){if(!d&&!this.result.length)return a?this.result:this;let v;if(r.length)if(this.result.length&&r.unshift(this.result),r.length<2)this.result=r[0];else{let y=0;for(let C=0,E,L;C<r.length;C++)if((E=r[C])&&(L=E.length))y<L&&(y=L);else if(!d){y=0;break}y?(this.result=xs(r,y,i,o,d,this.h,a),v=!0):this.result=[]}else d||(this.result=r);return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}Fe.prototype.xor=function(){return ys(this,"xor",Cf,arguments)};function Cf(r,i,o,l,a,d,m){if(r.length)if(this.result.length&&r.unshift(this.result),r.length<2)this.result=r[0];else{e:{d=o;var v=this.h;const y=[],C=Ke();let E=0;for(let L=0,F;L<r.length;L++)if(F=r[L]){E<F.length&&(E=F.length);for(let M=0,V;M<F.length;M++)if(V=F[M])for(let R=0,O;R<V.length;R++)O=V[R],C[O]=C[O]?2:1}for(let L=0,F,M=0;L<E;L++)for(let V=0,R;V<r.length;V++)if((R=r[V])&&(F=R[L])){for(let O=0,J;O<F.length;O++)if(J=F[O],C[J]===1)if(d)d--;else if(a){if(y.push(J),y.length===i){r=y;break e}}else{const X=L+(V?v:0);if(y[X]||(y[X]=[]),y[X].push(J),++M===i){r=y;break e}}}r=y}this.result=r,v=!0}else d||(this.result=r);return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}Fe.prototype.not=function(){return ys(this,"not",$f,arguments)};function $f(r,i,o,l,a,d,m){if(!d&&!this.result.length)return a?this.result:this;if(r.length&&this.result.length){e:{d=o;var v=[];r=new Set(r.flat().flat());for(let y=0,C,E=0;y<this.result.length;y++)if(C=this.result[y]){for(let L=0,F;L<C.length;L++)if(F=C[L],!r.has(F)){if(d)d--;else if(a){if(v.push(F),v.length===i){r=v;break e}}else if(v[y]||(v[y]=[]),v[y].push(F),++E===i){r=v;break e}}}r=v}this.result=r,v=!0}return a&&(this.await=null),a?this.resolve(i,o,l,m,v):this}function ws(r,i,o,l,a){let d,m,v;typeof a=="string"?(d=a,a=""):d=a.template,m=d.indexOf("$1"),v=d.substring(m+2),m=d.substring(0,m);let y=a&&a.boundary,C=!a||a.clip!==!1,E=a&&a.merge&&v&&m&&new RegExp(v+" "+m,"g");a=a&&a.ellipsis;var L=0;if(typeof a=="object"){var F=a.template;L=F.length-2,a=a.pattern}typeof a!="string"&&(a=a===!1?"":"..."),L&&(a=F.replace("$1",a)),F=a.length-L;let M,V;typeof y=="object"&&(M=y.before,M===0&&(M=-1),V=y.after,V===0&&(V=-1),y=y.total||9e5),L=new Map;for(let A=0,Q,me,je;A<i.length;A++){let B;if(l)B=i,je=l;else{var R=i[A];if(je=R.field,!je)continue;B=R.result}me=o.get(je),Q=me.encoder,R=L.get(Q),typeof R!="string"&&(R=Q.encode(r),L.set(Q,R));for(let ee=0;ee<B.length;ee++){var O=B[ee].doc;if(!O||(O=kr(O,je),!O))continue;var J=O.trim().split(/\s+/);if(!J.length)continue;O="";var X=[];let Z=[];for(var fe=-1,de=-1,he=0,ae=0;ae<J.length;ae++){var ue=J[ae],q=Q.encode(ue);q=q.length>1?q.join(" "):q[0];let K;if(q&&ue){for(var oe=ue.length,Pe=(Q.split?ue.replace(Q.split,""):ue).length-q.length,xe="",Ee=0,ke=0;ke<R.length;ke++){var Re=R[ke];if(Re){var ye=Re.length;ye+=Pe<0?0:Pe,Ee&&ye<=Ee||(Re=q.indexOf(Re),Re>-1&&(xe=(Re?ue.substring(0,Re):"")+m+ue.substring(Re,Re+ye)+v+(Re+ye<oe?ue.substring(Re+ye):""),Ee=ye,K=!0))}}xe&&(y&&(fe<0&&(fe=O.length+(O?1:0)),de=O.length+(O?1:0)+xe.length,he+=oe,Z.push(X.length),X.push({match:xe})),O+=(O?" ":"")+xe)}if(!K)ue=J[ae],O+=(O?" ":"")+ue,y&&X.push({text:ue});else if(y&&he>=y)break}if(he=Z.length*(d.length-2),M||V||y&&O.length-he>y)if(he=y+he-F*2,ae=de-fe,M>0&&(ae+=M),V>0&&(ae+=V),ae<=he)J=M?fe-(M>0?M:0):fe-((he-ae)/2|0),X=V?de+(V>0?V:0):J+he,C||(J>0&&O.charAt(J)!==" "&&O.charAt(J-1)!==" "&&(J=O.indexOf(" ",J),J<0&&(J=0)),X<O.length&&O.charAt(X-1)!==" "&&O.charAt(X)!==" "&&(X=O.lastIndexOf(" ",X),X<de?X=de:++X)),O=(J?a:"")+O.substring(J,X)+(X<O.length?a:"");else{for(de=[],fe={},he={},ae={},ue={},q={},xe=Pe=oe=0,ke=Ee=1;;){var De=void 0;for(let K=0,ne;K<Z.length;K++){if(ne=Z[K],xe)if(Pe!==xe){if(ae[K+1])continue;if(ne+=xe,fe[ne]){oe-=F,he[K+1]=1,ae[K+1]=1;continue}if(ne>=X.length-1){if(ne>=X.length){ae[K+1]=1,ne>=J.length&&(he[K+1]=1);continue}oe-=F}if(O=X[ne].text,ye=V&&q[K])if(ye>0){if(O.length>ye)if(ae[K+1]=1,C)O=O.substring(0,ye);else continue;(ye-=O.length)||(ye=-1),q[K]=ye}else{ae[K+1]=1;continue}if(oe+O.length+1<=y)O=" "+O,de[K]+=O;else if(C)De=y-oe-1,De>0&&(O=" "+O.substring(0,De),de[K]+=O),ae[K+1]=1;else{ae[K+1]=1;continue}}else{if(ae[K])continue;if(ne-=Pe,fe[ne]){oe-=F,ae[K]=1,he[K]=1;continue}if(ne<=0){if(ne<0){ae[K]=1,he[K]=1;continue}oe-=F}if(O=X[ne].text,ye=M&&ue[K])if(ye>0){if(O.length>ye)if(ae[K]=1,C)O=O.substring(O.length-ye);else continue;(ye-=O.length)||(ye=-1),ue[K]=ye}else{ae[K]=1;continue}if(oe+O.length+1<=y)O+=" ",de[K]=O+de[K];else if(C)De=O.length+1-(y-oe),De>=0&&De<O.length&&(O=O.substring(De)+" ",de[K]=O+de[K]),ae[K]=1;else{ae[K]=1;continue}}else{O=X[ne].match,M&&(ue[K]=M),V&&(q[K]=V),K&&oe++;let _e;if(ne?!K&&F&&(oe+=F):(he[K]=1,ae[K]=1),ne>=J.length-1||ne<X.length-1&&X[ne+1].match?_e=1:F&&(oe+=F),oe-=d.length-2,!K||oe+O.length<=y)de[K]=O;else{De=Ee=ke=he[K]=0;break}_e&&(he[K+1]=1,ae[K+1]=1)}oe+=O.length,De=fe[ne]=1}if(De)Pe===xe?xe++:Pe++;else{if(Pe===xe?Ee=0:ke=0,!Ee&&!ke)break;Ee?(Pe++,xe=Pe):xe++}}O="";for(let K=0,ne;K<de.length;K++)ne=(he[K]?K?" ":"":(K&&!a?" ":"")+a)+de[K],O+=ne;a&&!he[de.length]&&(O+=a)}E&&(O=O.replace(E," ")),B[ee].highlight=O}if(l)break}return i}function Fe(r,i){if(!this||this.constructor!==Fe)return new Fe(r,i);let o=0,l,a,d,m,v,y;if(r&&r.index){const C=r;if(i=C.index,o=C.boost||0,a=C.query){d=C.field||C.pluck,m=C.highlight;const E=C.resolve;r=C.async||C.queue,C.resolve=!1,C.index=null,r=r?i.searchAsync(C):i.search(C),C.resolve=E,C.index=i,r=r.result||r}else r=[]}if(r&&r.then){const C=this;r=r.then(function(E){C.C[0]=C.result=E.result||E,Vi(C)}),l=[r],r=[],v=new Promise(function(E){y=E})}this.index=i||null,this.result=r||[],this.h=o,this.C=l||[],this.await=v||null,this.return=y||null,this.highlight=m||null,this.query=a||"",this.field=d||""}ie=Fe.prototype,ie.limit=function(r){if(this.await){const i=this;this.C.push(function(){return i.limit(r).result})}else if(this.result.length){const i=[];for(let o=0,l;o<this.result.length;o++)if(l=this.result[o])if(l.length<=r){if(i[o]=l,r-=l.length,!r)break}else{i[o]=l.slice(0,r);break}this.result=i}return this},ie.offset=function(r){if(this.await){const i=this;this.C.push(function(){return i.offset(r).result})}else if(this.result.length){const i=[];for(let o=0,l;o<this.result.length;o++)(l=this.result[o])&&(l.length<=r?r-=l.length:(i[o]=l.slice(r),r=0));this.result=i}return this},ie.boost=function(r){if(this.await){const i=this;this.C.push(function(){return i.boost(r).result})}else this.h+=r;return this};function Vi(r,i){let o=r.result;var l=r.await;r.await=null;for(let a=0,d;a<r.C.length;a++)if(d=r.C[a]){if(typeof d=="function")o=d(),r.C[a]=o=o.result||o,a--;else if(d.h)o=d.h(),r.C[a]=o=o.result||o,a--;else if(d.then)return r.await=l}return l=r.return,r.C=[],r.return=null,i||l(o),o}ie.resolve=function(r,i,o,l,a){let d=this.await?Vi(this,!0):this.result;if(d.then){const m=this;return d.then(function(){return m.resolve(r,i,o,l,a)})}return d.length&&(typeof r=="object"?(l=r.highlight||this.highlight,o=!!l||r.enrich,i=r.offset,r=r.limit):(l=l||this.highlight,o=!!l||o),d=a?o?Yn.call(this.index,d):d:Bi.call(this.index,d,r||100,i,o)),this.finalize(d,l)},ie.finalize=function(r,i){if(r.then){const l=this;return r.then(function(a){return l.finalize(a,i)})}i&&r.length&&this.query&&(r=ws(this.query,r,this.index.index,this.field,i));const o=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",o&&o(r),r};function xs(r,i,o,l,a,d,m){const v=r.length;let y=[],C,E;C=Ke();for(let L=0,F,M,V,R;L<i;L++)for(let O=0;O<v;O++)if(V=r[O],L<V.length&&(F=V[L]))for(let J=0;J<F.length;J++){if(M=F[J],(E=C[M])?C[M]++:(E=0,C[M]=1),R=y[E]||(y[E]=[]),!m){let X=L+(O||!a?0:d||0);R=R[X]||(R[X]=[])}if(R.push(M),m&&o&&E===v-1&&R.length-l===o)return l?R.slice(l):R}if(r=y.length)if(a)y=y.length>1?Jl(y,o,l,m,d):(y=y[0])&&o&&y.length>o||l?y.slice(l,o+l):y;else{if(r<v)return[];if(y=y[r-1],o||l)if(m)(y.length>o||l)&&(y=y.slice(l,o+l));else{a=[];for(let L=0,F;L<y.length;L++)if(F=y[L]){if(l&&F.length>l)l-=F.length;else if((o&&F.length>o||l)&&(F=F.slice(l,o+l),o-=F.length,l&&(l-=F.length)),a.push(F),!o)break}y=a}}return y}function Jl(r,i,o,l,a){const d=[],m=Ke();let v;var y=r.length;let C;if(l){for(a=y-1;a>=0;a--)if(C=(l=r[a])&&l.length){for(y=0;y<C;y++)if(v=l[y],!m[v]){if(m[v]=1,o)o--;else if(d.push(v),d.length===i)return d}}}else for(let E=y-1,L,F=0;E>=0;E--){L=r[E];for(let M=0;M<L.length;M++)if(C=(l=L[M])&&l.length){for(let V=0;V<C;V++)if(v=l[V],!m[v])if(m[v]=1,o)o--;else{let R=(M+(E<y-1&&a||0))/(E+1)|0;if((d[R]||(d[R]=[])).push(v),++F===i)return d}}}return d}function Pf(r,i,o,l,a){const d=Ke(),m=[];for(let v=0,y;v<i.length;v++){y=i[v];for(let C=0;C<y.length;C++)d[y[C]]=1}if(a){for(let v=0,y;v<r.length;v++)if(y=r[v],d[y]){if(l)l--;else if(m.push(y),d[y]=0,o&&--o===0)break}}else for(let v=0,y,C;v<r.result.length;v++)for(y=r.result[v],i=0;i<y.length;i++)C=y[i],d[C]&&((m[v]||(m[v]=[])).push(C),d[C]=0);return m}$n.prototype.search=function(r,i,o,l){o||(!i&&Sr(r)?(o=r,r=""):Sr(i)&&(o=i,i=0));let a=[];var d=[];let m,v,y,C,E,L,F=0,M=!0,V;if(o){o.constructor===Array&&(o={index:o}),r=o.query||r,m=o.pluck,v=o.merge,C=o.boost,L=m||o.field||(L=o.index)&&(L.index?null:L);var R=this.tag&&o.tag;y=o.suggest,M=o.resolve!==!1,E=o.cache,V=M&&this.store&&o.highlight;var O=!!V||M&&this.store&&o.enrich;i=o.limit||i;var J=o.offset||0;if(i||(i=M?100:0),R&&(!this.db||!l)){R.constructor!==Array&&(R=[R]);var X=[];for(let ue=0,q;ue<R.length;ue++)if(q=R[ue],q.field&&q.tag){var fe=q.tag;if(fe.constructor===Array)for(var de=0;de<fe.length;de++)X.push(q.field,fe[de]);else X.push(q.field,fe)}else{fe=Object.keys(q);for(let oe=0,Pe,xe;oe<fe.length;oe++)if(Pe=fe[oe],xe=q[Pe],xe.constructor===Array)for(de=0;de<xe.length;de++)X.push(Pe,xe[de]);else X.push(Pe,xe)}if(R=X,!r){if(d=[],X.length)for(R=0;R<X.length;R+=2){if(this.db){if(l=this.index.get(X[R]),!l)continue;d.push(l=l.db.tag(X[R+1],i,J,O))}else l=Ef.call(this,X[R],X[R+1],i,J,O);a.push(M?{field:X[R],tag:X[R+1],result:l}:[l])}if(d.length){const ue=this;return Promise.all(d).then(function(q){for(let oe=0;oe<q.length;oe++)M?a[oe].result=q[oe]:a[oe]=q[oe];return M?a:new Fe(a.length>1?xs(a,1,0,0,y,C):a[0],ue)})}return M?a:new Fe(a.length>1?xs(a,1,0,0,y,C):a[0],this)}}M||m||!(L=L||this.field)||($t(L)?m=L:(L.constructor===Array&&L.length===1&&(L=L[0]),m=L.field||L.index)),L&&L.constructor!==Array&&(L=[L])}L||(L=this.field);let he;X=(this.worker||this.db)&&!l&&[];for(let ue=0,q,oe,Pe;ue<L.length;ue++){if(oe=L[ue],this.db&&this.tag&&!this.B[ue])continue;let xe;if($t(oe)||(xe=oe,oe=xe.field,r=xe.query||r,i=Vn(xe.limit,i),J=Vn(xe.offset,J),y=Vn(xe.suggest,y),V=M&&this.store&&Vn(xe.highlight,V),O=!!V||M&&this.store&&Vn(xe.enrich,O),E=Vn(xe.cache,E)),l)q=l[ue];else{fe=xe||o||{},de=fe.enrich;var ae=this.index.get(oe);if(R&&(this.db&&(fe.tag=R,fe.field=L,he=ae.db.support_tag_search),!he&&de&&(fe.enrich=!1),he||(fe.limit=0,fe.offset=0)),q=E?ae.searchCache(r,R&&!he?0:i,fe):ae.search(r,R&&!he?0:i,fe),R&&!he&&(fe.limit=i,fe.offset=J),de&&(fe.enrich=de),X){X[ue]=q;continue}}if(Pe=(q=q.result||q)&&q.length,R&&Pe){if(fe=[],de=0,this.db&&l){if(!he)for(ae=L.length;ae<l.length;ae++){let Ee=l[ae];if(Ee&&Ee.length)de++,fe.push(Ee);else if(!y)return M?a:new Fe(a,this)}}else for(let Ee=0,ke,Re;Ee<R.length;Ee+=2){if(ke=this.tag.get(R[Ee]),!ke){if(y)continue;return M?a:new Fe(a,this)}if(Re=(ke=ke&&ke.get(R[Ee+1]))&&ke.length)de++,fe.push(ke);else if(!y)return M?a:new Fe(a,this)}if(de){if(q=Pf(q,fe,i,J,M),Pe=q.length,!Pe&&!y)return M?q:new Fe(q,this);de--}}if(Pe)d[F]=oe,a.push(q),F++;else if(L.length===1)return M?a:new Fe(a,this)}if(X){if(this.db&&R&&R.length&&!he)for(O=0;O<R.length;O+=2){if(d=this.index.get(R[O]),!d){if(y)continue;return M?a:new Fe(a,this)}X.push(d.db.tag(R[O+1],i,J,!1))}const ue=this;return Promise.all(X).then(function(q){return o&&(o.resolve=M),q.length&&(q=ue.search(r,i,o,q)),q})}if(!F)return M?a:new Fe(a,this);if(m&&(!O||!this.store))return a=a[0],M?a:new Fe(a,this);for(X=[],J=0;J<d.length;J++){if(R=a[J],O&&R.length&&typeof R[0].doc>"u"&&(this.db?X.push(R=this.index.get(this.field[0]).db.enrich(R)):R=Yn.call(this,R)),m)return M?V?ws(r,R,this.index,m,V):R:new Fe(R,this);a[J]={field:d[J],result:R}}if(O&&this.db&&X.length){const ue=this;return Promise.all(X).then(function(q){for(let oe=0;oe<q.length;oe++)a[oe].result=q[oe];return V&&(a=ws(r,a,ue.index,m,V)),v?Xl(a):a})}return V&&(a=ws(r,a,this.index,m,V)),v?Xl(a):a};function Xl(r){const i=[],o=Ke(),l=Ke();for(let a=0,d,m,v,y,C,E,L;a<r.length;a++){d=r[a],m=d.field,v=d.result;for(let F=0;F<v.length;F++)C=v[F],typeof C!="object"?C={id:y=C}:y=C.id,(E=o[y])?E.push(m):(C.field=o[y]=[m],i.push(C)),(L=C.highlight)&&(E=l[y],E||(l[y]=E={},C.highlight=E),E[m]=L)}return i}function Ef(r,i,o,l,a){return r=this.tag.get(r),r?(r=r.get(i),r?(i=r.length-l,i>0&&((o&&i>o||l)&&(r=r.slice(l,l+o)),a&&(r=Yn.call(this,r))),r):[]):[]}function Yn(r){if(!this||!this.store)return r;if(this.db)return this.index.get(this.field[0]).db.enrich(r);const i=Array(r.length);for(let o=0,l;o<r.length;o++)l=r[o],i[o]={id:l,doc:this.store.get(l)};return i}function $n(r){if(!this||this.constructor!==$n)return new $n(r);const i=r.document||r.doc||r;let o,l;if(this.B=[],this.field=[],this.D=[],this.key=(o=i.key||i.id)&&Ss(o,this.D)||"id",(l=r.keystore||0)&&(this.keystore=l),this.fastupdate=!!r.fastupdate,this.reg=!this.fastupdate||r.worker||r.db?l?new Et(l):new Set:l?new Pt(l):new Map,this.h=(o=i.store||null)&&o&&o!==!0&&[],this.store=o?l?new Pt(l):new Map:null,this.cache=(o=r.cache||null)&&new Cn(o),r.cache=!1,this.worker=r.worker||!1,this.priority=r.priority||4,this.index=Tf.call(this,r,i),this.tag=null,(o=i.tag)&&(typeof o=="string"&&(o=[o]),o.length)){this.tag=new Map,this.A=[],this.F=[];for(let a=0,d,m;a<o.length;a++){if(d=o[a],m=d.field||d,!m)throw Error("The tag field from the document descriptor is undefined.");d.custom?this.A[a]=d.custom:(this.A[a]=Ss(m,this.D),d.filter&&(typeof this.A[a]=="string"&&(this.A[a]=new String(this.A[a])),this.A[a].G=d.filter)),this.F[a]=m,this.tag.set(m,new Map)}}if(this.worker){this.fastupdate=!1,r=[];for(const a of this.index.values())a.then&&r.push(a);if(r.length){const a=this;return Promise.all(r).then(function(d){let m=0;for(const v of a.index.entries()){const y=v[0];let C=v[1];C.then&&(C=d[m],a.index.set(y,C),m++)}return a})}}else r.db&&(this.fastupdate=!1,this.mount(r.db))}ie=$n.prototype,ie.mount=function(r){let i=this.field;if(this.tag)for(let d=0,m;d<this.F.length;d++){m=this.F[d];var o=void 0;this.index.set(m,o=new Ot({},this.reg)),i===this.field&&(i=i.slice(0)),i.push(m),o.tag=this.tag.get(m)}o=[];const l={db:r.db,type:r.type,fastupdate:r.fastupdate};for(let d=0,m,v;d<i.length;d++){l.field=v=i[d],m=this.index.get(v);const y=new r.constructor(r.id,l);y.id=r.id,o[d]=y.mount(m),m.document=!0,d?m.bypass=!0:m.store=this.store}const a=this;return this.db=Promise.all(o).then(function(){a.db=!0})},ie.commit=async function(){const r=[];for(const i of this.index.values())r.push(i.commit());await Promise.all(r),this.reg.clear()},ie.destroy=function(){const r=[];for(const i of this.index.values())r.push(i.destroy());return Promise.all(r)};function Tf(r,i){const o=new Map;let l=i.index||i.field||i;$t(l)&&(l=[l]);for(let d=0,m,v;d<l.length;d++){if(m=l[d],$t(m)||(v=m,m=m.field),v=Sr(v)?Object.assign({},r,v):r,this.worker){var a=void 0;a=(a=v.encoder)&&a.encode?a:new Hn(typeof a=="string"?zi[a]:a||{}),a=new Qn(v,a),o.set(m,a)}this.worker||o.set(m,new Ot(v,this.reg)),v.custom?this.B[d]=v.custom:(this.B[d]=Ss(m,this.D),v.filter&&(typeof this.B[d]=="string"&&(this.B[d]=new String(this.B[d])),this.B[d].G=v.filter)),this.field[d]=m}if(this.h){r=i.store,$t(r)&&(r=[r]);for(let d=0,m,v;d<r.length;d++)m=r[d],v=m.field||m,m.custom?(this.h[d]=m.custom,m.custom.O=v):(this.h[d]=Ss(v,this.D),m.filter&&(typeof this.h[d]=="string"&&(this.h[d]=new String(this.h[d])),this.h[d].G=m.filter))}return o}function Ss(r,i){const o=r.split(":");let l=0;for(let a=0;a<o.length;a++)r=o[a],r[r.length-1]==="]"&&(r=r.substring(0,r.length-2))&&(i[l]=!0),r&&(o[l++]=r);return l<o.length&&(o.length=l),l>1?o:o[0]}ie.append=function(r,i){return this.add(r,i,!0)},ie.update=function(r,i){return this.remove(r).add(r,i)},ie.remove=function(r){Sr(r)&&(r=kr(r,this.key));for(var i of this.index.values())i.remove(r,!0);if(this.reg.has(r)){if(this.tag&&!this.fastupdate)for(let o of this.tag.values())for(let l of o){i=l[0];const a=l[1],d=a.indexOf(r);d>-1&&(a.length>1?a.splice(d,1):o.delete(i))}this.store&&this.store.delete(r),this.reg.delete(r)}return this.cache&&this.cache.remove(r),this},ie.clear=function(){const r=[];for(const i of this.index.values()){const o=i.clear();o.then&&r.push(o)}if(this.tag)for(const i of this.tag.values())i.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),r.length?Promise.all(r):this},ie.contain=function(r){return this.db?this.index.get(this.field[0]).db.has(r):this.reg.has(r)},ie.cleanup=function(){for(const r of this.index.values())r.cleanup();return this},ie.get=function(r){return this.db?this.index.get(this.field[0]).db.enrich(r).then(function(i){return i[0]&&i[0].doc||null}):this.store.get(r)||null},ie.set=function(r,i){return typeof r=="object"&&(i=r,r=kr(i,this.key)),this.store.set(r,i),this},ie.searchCache=_i,ie.export=jf,ie.import=Nf,Mi($n.prototype);function Hi(r,i=0){let o=[],l=[];i&&(i=25e4/i*5e3|0);for(const a of r.entries())l.push(a),l.length===i&&(o.push(l),l=[]);return l.length&&o.push(l),o}function bi(r,i){i||(i=new Map);for(let o=0,l;o<r.length;o++)l=r[o],i.set(l[0],l[1]);return i}function Zl(r,i=0){let o=[],l=[];i&&(i=25e4/i*1e3|0);for(const a of r.entries())l.push([a[0],Hi(a[1])[0]||[]]),l.length===i&&(o.push(l),l=[]);return l.length&&o.push(l),o}function Gl(r,i){i||(i=new Map);for(let o=0,l,a;o<r.length;o++)l=r[o],a=i.get(l[0]),i.set(l[0],bi(l[1],a));return i}function ql(r){let i=[],o=[];for(const l of r.keys())o.push(l),o.length===25e4&&(i.push(o),o=[]);return o.length&&i.push(o),i}function eu(r,i){i||(i=new Set);for(let o=0;o<r.length;o++)i.add(r[o]);return i}function ks(r,i,o,l,a,d,m=0){const v=l&&l.constructor===Array;var y=v?l.shift():l;if(!y)return this.export(r,i,a,d+1);if((y=r((i?i+".":"")+(m+1)+"."+o,JSON.stringify(y)))&&y.then){const C=this;return y.then(function(){return ks.call(C,r,i,o,v?l:null,a,d,m+1)})}return ks.call(this,r,i,o,v?l:null,a,d,m+1)}function jf(r,i,o=0,l=0){if(o<this.field.length){const m=this.field[o];if((i=this.index.get(m).export(r,m,o,l=1))&&i.then){const v=this;return i.then(function(){return v.export(r,m,o+1)})}return this.export(r,m,o+1)}let a,d;switch(l){case 0:a="reg",d=ql(this.reg),i=null;break;case 1:a="tag",d=this.tag&&Zl(this.tag,this.reg.size),i=null;break;case 2:a="doc",d=this.store&&Hi(this.store),i=null;break;default:return}return ks.call(this,r,i,a,d||null,o,l)}function Nf(r,i){var o=r.split(".");o[o.length-1]==="json"&&o.pop();const l=o.length>2?o[0]:"";if(o=o.length>2?o[2]:o[1],this.worker&&l)return this.index.get(l).import(r);if(i){if(typeof i=="string"&&(i=JSON.parse(i)),l)return this.index.get(l).import(o,i);switch(o){case"reg":this.fastupdate=!1,this.reg=eu(i,this.reg);for(let a=0,d;a<this.field.length;a++)d=this.index.get(this.field[a]),d.fastupdate=!1,d.reg=this.reg;if(this.worker){i=[];for(const a of this.index.values())i.push(a.import(r));return Promise.all(i)}break;case"tag":this.tag=Gl(i,this.tag);break;case"doc":this.store=bi(i,this.store)}}}function tu(r,i){let o="";for(const l of r.entries()){r=l[0];const a=l[1];let d="";for(let m=0,v;m<a.length;m++){v=a[m]||[""];let y="";for(let C=0;C<v.length;C++)y+=(y?",":"")+(i==="string"?'"'+v[C]+'"':v[C]);y="["+y+"]",d+=(d?",":"")+y}d='["'+r+'",['+d+"]]",o+=(o?",":"")+d}return o}Ot.prototype.remove=function(r,i){const o=this.reg.size&&(this.fastupdate?this.reg.get(r):this.reg.has(r));if(o){if(this.fastupdate){for(let l=0,a,d;l<o.length;l++)if((a=o[l])&&(d=a.length))if(a[d-1]===r)a.pop();else{const m=a.indexOf(r);m>=0&&a.splice(m,1)}}else $r(this.map,r),this.depth&&$r(this.ctx,r);i||this.reg.delete(r)}return this.db&&(this.commit_task.push({del:r}),this.M&&iu(this)),this.cache&&this.cache.remove(r),this};function $r(r,i){let o=0;var l=typeof i>"u";if(r.constructor===Array){for(let a=0,d,m,v;a<r.length;a++)if((d=r[a])&&d.length){if(l)return 1;if(m=d.indexOf(i),m>=0){if(d.length>1)return d.splice(m,1),1;if(delete r[a],o)return 1;v=1}else{if(v)return 1;o++}}}else for(let a of r.entries())l=a[0],$r(a[1],i)?o++:r.delete(l);return o}const Af={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};Ot.prototype.add=function(r,i,o,l){if(i&&(r||r===0)){if(!l&&!o&&this.reg.has(r))return this.update(r,i);l=this.depth,i=this.encoder.encode(i,!l);const C=i.length;if(C){const E=Ke(),L=Ke(),F=this.resolution;for(let M=0;M<C;M++){let V=i[this.rtl?C-1-M:M];var a=V.length;if(a&&(l||!L[V])){var d=this.score?this.score(i,V,M,null,0):Cs(F,C,M),m="";switch(this.tokenize){case"tolerant":if(Bt(this,L,V,d,r,o),a>2){for(let R=1,O,J,X,fe;R<a-1;R++)O=V.charAt(R),J=V.charAt(R+1),X=V.substring(0,R)+J,fe=V.substring(R+2),m=X+O+fe,Bt(this,L,m,d,r,o),m=X+fe,Bt(this,L,m,d,r,o);Bt(this,L,V.substring(0,V.length-1),d,r,o)}break;case"full":if(a>2){for(let R=0,O;R<a;R++)for(d=a;d>R;d--){m=V.substring(R,d),O=this.rtl?a-1-R:R;var v=this.score?this.score(i,V,M,m,O):Cs(F,C,M,a,O);Bt(this,L,m,v,r,o)}break}case"bidirectional":case"reverse":if(a>1){for(v=a-1;v>0;v--){m=V[this.rtl?a-1-v:v]+m;var y=this.score?this.score(i,V,M,m,v):Cs(F,C,M,a,v);Bt(this,L,m,y,r,o)}m=""}case"forward":if(a>1){for(v=0;v<a;v++)m+=V[this.rtl?a-1-v:v],Bt(this,L,m,d,r,o);break}default:if(Bt(this,L,V,d,r,o),l&&C>1&&M<C-1)for(a=this.N,m=V,d=Math.min(l+1,this.rtl?M+1:C-M),v=1;v<d;v++){V=i[this.rtl?C-1-M-v:M+v],y=this.bidirectional&&V>m;const R=this.score?this.score(i,m,M,V,v-1):Cs(a+(C/2>a?0:1),C,M,d-1,v-1);Bt(this,E,y?m:V,R,r,o,y?V:m)}}}}this.fastupdate||this.reg.add(r)}}return this.db&&(this.commit_task.push(o?{ins:r}:{del:r}),this.M&&iu(this)),this};function Bt(r,i,o,l,a,d,m){let v,y;if(!(v=i[o])||m&&!v[m]){if(m?(i=v||(i[o]=Ke()),i[m]=1,y=r.ctx,(v=y.get(m))?y=v:y.set(m,y=r.keystore?new Pt(r.keystore):new Map)):(y=r.map,i[o]=1),(v=y.get(o))?y=v:y.set(o,y=v=[]),d){for(let C=0,E;C<v.length;C++)if((E=v[C])&&E.includes(a)){if(C<=l)return;E.splice(E.indexOf(a),1),r.fastupdate&&(i=r.reg.get(a))&&i.splice(i.indexOf(E),1);break}}if(y=y[l]||(y[l]=[]),y.push(a),y.length===2**31-1){if(i=new bn(y),r.fastupdate)for(let C of r.reg.values())C.includes(y)&&(C[C.indexOf(y)]=i);v[l]=y=i}r.fastupdate&&((l=r.reg.get(a))?l.push(y):r.reg.set(a,[y]))}}function Cs(r,i,o,l,a){return o&&r>1?i+(l||0)<=r?o+(a||0):(r-1)/(i+(l||0))*(o+(a||0))+1|0:0}Ot.prototype.search=function(r,i,o){if(o||(i||typeof r!="object"?typeof i=="object"&&(o=i,i=0):(o=r,r="")),o&&o.cache)return o.cache=!1,r=this.searchCache(r,i,o),o.cache=!0,r;let l=[],a,d,m,v=0,y,C,E,L,F;o&&(r=o.query||r,i=o.limit||i,v=o.offset||0,d=o.context,m=o.suggest,F=(y=o.resolve)&&o.enrich,E=o.boost,L=o.resolution,C=this.db&&o.tag),typeof y>"u"&&(y=this.resolve),d=this.depth&&d!==!1;let M=this.encoder.encode(r,!d);if(a=M.length,i=i||(y?100:0),a===1)return ru.call(this,M[0],"",i,v,y,F,C);if(a===2&&d&&!m)return ru.call(this,M[1],M[0],i,v,y,F,C);let V=Ke(),R=0,O;if(d&&(O=M[0],R=1),L||L===0||(L=O?this.N:this.resolution),this.db){if(this.db.search&&(o=this.db.search(this,M,i,v,m,y,F,C),o!==!1))return o;const J=this;return(async function(){for(let X,fe;R<a;R++){if((fe=M[R])&&!V[fe]){if(V[fe]=1,X=await Ki(J,fe,O,0,0,!1,!1),X=su(X,l,m,L)){l=X;break}O&&(m&&X&&l.length||(O=fe))}m&&O&&R===a-1&&!l.length&&(L=J.resolution,O="",R=-1,V=Ke())}return nu(l,L,i,v,m,E,y)})()}for(let J,X;R<a;R++){if((X=M[R])&&!V[X]){if(V[X]=1,J=Ki(this,X,O,0,0,!1,!1),J=su(J,l,m,L)){l=J;break}O&&(m&&J&&l.length||(O=X))}m&&O&&R===a-1&&!l.length&&(L=this.resolution,O="",R=-1,V=Ke())}return nu(l,L,i,v,m,E,y)};function nu(r,i,o,l,a,d,m){let v=r.length,y=r;if(v>1)y=xs(r,i,o,l,a,d,m);else if(v===1)return m?Bi.call(null,r[0],o,l):new Fe(r[0],this);return m?y:new Fe(y,this)}function ru(r,i,o,l,a,d,m){return r=Ki(this,r,i,o,l,a,d,m),this.db?r.then(function(v){return a?v||[]:new Fe(v,this)}):r&&r.length?a?Bi.call(this,r,o,l):new Fe(r,this):a?[]:new Fe([],this)}function su(r,i,o,l){let a=[];if(r&&r.length){if(r.length<=l){i.push(r);return}for(let d=0,m;d<l;d++)(m=r[d])&&(a[d]=m);if(a.length){i.push(a);return}}if(!o)return a}function Ki(r,i,o,l,a,d,m,v){let y;return o&&(y=r.bidirectional&&i>o)&&(y=o,o=i,i=y),r.db?r.db.get(i,o,l,a,d,m,v):(r=o?(r=r.ctx.get(o))&&r.get(i):r.map.get(i),r)}function Ot(r,i){if(!this||this.constructor!==Ot)return new Ot(r);if(r){var o=$t(r)?r:r.preset;o&&(r=Object.assign({},Af[o],r))}else r={};o=r.context;const l=o===!0?{depth:1}:o||{},a=$t(r.encoder)?zi[r.encoder]:r.encode||r.encoder||{};this.encoder=a.encode?a:typeof a=="object"?new Hn(a):{encode:a},this.resolution=r.resolution||9,this.tokenize=o=(o=r.tokenize)&&o!=="default"&&o!=="exact"&&o||"strict",this.depth=o==="strict"&&l.depth||0,this.bidirectional=l.bidirectional!==!1,this.fastupdate=!!r.fastupdate,this.score=r.score||null,(o=r.keystore||0)&&(this.keystore=o),this.map=o?new Pt(o):new Map,this.ctx=o?new Pt(o):new Map,this.reg=i||(this.fastupdate?o?new Pt(o):new Map:o?new Et(o):new Set),this.N=l.resolution||3,this.rtl=a.rtl||r.rtl||!1,this.cache=(o=r.cache||null)&&new Cn(o),this.resolve=r.resolve!==!1,(o=r.db)&&(this.db=this.mount(o)),this.M=r.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=r.priority||4}ie=Ot.prototype,ie.mount=function(r){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),r.mount(this)},ie.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},ie.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function iu(r){r.commit_timer||(r.commit_timer=setTimeout(function(){r.commit_timer=null,r.db.commit(r)},1))}ie.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},ie.append=function(r,i){return this.add(r,i,!0)},ie.contain=function(r){return this.db?this.db.has(r):this.reg.has(r)},ie.update=function(r,i){const o=this,l=this.remove(r);return l&&l.then?l.then(()=>o.add(r,i)):this.add(r,i)},ie.cleanup=function(){return this.fastupdate?($r(this.map),this.depth&&$r(this.ctx),this):this},ie.searchCache=_i,ie.export=function(r,i,o=0,l=0){let a,d;switch(l){case 0:a="reg",d=ql(this.reg);break;case 1:a="cfg",d=null;break;case 2:a="map",d=Hi(this.map,this.reg.size);break;case 3:a="ctx",d=Zl(this.ctx,this.reg.size);break;default:return}return ks.call(this,r,i,a,d,o,l)},ie.import=function(r,i){if(i)switch(typeof i=="string"&&(i=JSON.parse(i)),r=r.split("."),r[r.length-1]==="json"&&r.pop(),r.length===3&&r.shift(),r=r.length>1?r[1]:r[0],r){case"reg":this.fastupdate=!1,this.reg=eu(i,this.reg);break;case"map":this.map=bi(i,this.map);break;case"ctx":this.ctx=Gl(i,this.ctx)}},ie.serialize=function(r=!0){let i="",o="",l="";if(this.reg.size){let d;for(var a of this.reg.keys())d||(d=typeof a),i+=(i?",":"")+(d==="string"?'"'+a+'"':a);i="index.reg=new Set(["+i+"]);",o=tu(this.map,d),o="index.map=new Map(["+o+"]);";for(const m of this.ctx.entries()){a=m[0];let v=tu(m[1],d);v="new Map(["+v+"])",v='["'+a+'",'+v+"]",l+=(l?",":"")+v}l="index.ctx=new Map(["+l+"]);"}return r?"function inject(index){"+i+o+l+"}":i+o+l},Mi(Ot.prototype);const ou=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),$s=["map","ctx","tag","reg","cfg"],Pn=Ke();function Wi(r,i={}){if(!this||this.constructor!==Wi)return new Wi(r,i);typeof r=="object"&&(i=r,r=r.name),r||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(r?":"+r.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=i.field?i.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=i.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}ie=Wi.prototype,ie.mount=function(r){return r.index?r.mount(this):(r.db=this,this.open())},ie.open=function(){if(this.db)return this.db;let r=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Pn[r.id]||(Pn[r.id]=[]),Pn[r.id].push(r.field);const i=ou.open(r.id,1);return i.onupgradeneeded=function(){const o=r.db=this.result;for(let l=0,a;l<$s.length;l++){a=$s[l];for(let d=0,m;d<Pn[r.id].length;d++)m=Pn[r.id][d],o.objectStoreNames.contains(a+(a!=="reg"&&m?":"+m:""))||o.createObjectStore(a+(a!=="reg"&&m?":"+m:""))}},r.db=qt(i,function(o){r.db=o,r.db.onversionchange=function(){r.close()}})},ie.close=function(){this.db&&this.db.close(),this.db=null},ie.destroy=function(){const r=ou.deleteDatabase(this.id);return qt(r)},ie.clear=function(){const r=[];for(let o=0,l;o<$s.length;o++){l=$s[o];for(let a=0,d;a<Pn[this.id].length;a++)d=Pn[this.id][a],r.push(l+(l!=="reg"&&d?":"+d:""))}const i=this.db.transaction(r,"readwrite");for(let o=0;o<r.length;o++)i.objectStore(r[o]).clear();return qt(i)},ie.get=function(r,i,o=0,l=0,a=!0,d=!1){r=this.db.transaction((i?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((i?"ctx":"map")+(this.field?":"+this.field:"")).get(i?i+":"+r:r);const m=this;return qt(r).then(function(v){let y=[];if(!v||!v.length)return y;if(a){if(!o&&!l&&v.length===1)return v[0];for(let C=0,E;C<v.length;C++)if((E=v[C])&&E.length){if(l>=E.length){l-=E.length;continue}const L=o?l+Math.min(E.length-l,o):E.length;for(let F=l;F<L;F++)y.push(E[F]);if(l=0,y.length===o)break}return d?m.enrich(y):y}return v})},ie.tag=function(r,i=0,o=0,l=!1){r=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(r);const a=this;return qt(r).then(function(d){return!d||!d.length||o>=d.length?[]:!i&&!o?d:(d=d.slice(o,o+i),l?a.enrich(d):d)})},ie.enrich=function(r){typeof r!="object"&&(r=[r]);const i=this.db.transaction("reg","readonly").objectStore("reg"),o=[];for(let l=0;l<r.length;l++)o[l]=qt(i.get(r[l]));return Promise.all(o).then(function(l){for(let a=0;a<l.length;a++)l[a]={id:r[a],doc:l[a]?JSON.parse(l[a]):null};return l})},ie.has=function(r){return r=this.db.transaction("reg","readonly").objectStore("reg").getKey(r),qt(r).then(function(i){return!!i})},ie.search=null,ie.info=function(){},ie.transaction=function(r,i,o){r+=r!=="reg"&&this.field?":"+this.field:"";let l=this.h[r+":"+i];if(l)return o.call(this,l);let a=this.db.transaction(r,i);this.h[r+":"+i]=l=a.objectStore(r);const d=o.call(this,l);return this.h[r+":"+i]=null,qt(a).finally(function(){return d})},ie.commit=async function(r){let i=r.commit_task,o=[];r.commit_task=[];for(let l=0,a;l<i.length;l++)a=i[l],a.del&&o.push(a.del);o.length&&await this.remove(o),r.reg.size&&(await this.transaction("map","readwrite",function(l){for(const a of r.map){const d=a[0],m=a[1];m.length&&(l.get(d).onsuccess=function(){let v=this.result;var y;if(v&&v.length){const C=Math.max(v.length,m.length);for(let E=0,L,F;E<C;E++)if((F=m[E])&&F.length){if((L=v[E])&&L.length)for(y=0;y<F.length;y++)L.push(F[y]);else v[E]=F;y=1}}else v=m,y=1;y&&l.put(v,d)})}}),await this.transaction("ctx","readwrite",function(l){for(const a of r.ctx){const d=a[0],m=a[1];for(const v of m){const y=v[0],C=v[1];C.length&&(l.get(d+":"+y).onsuccess=function(){let E=this.result;var L;if(E&&E.length){const F=Math.max(E.length,C.length);for(let M=0,V,R;M<F;M++)if((R=C[M])&&R.length){if((V=E[M])&&V.length)for(L=0;L<R.length;L++)V.push(R[L]);else E[M]=R;L=1}}else E=C,L=1;L&&l.put(E,d+":"+y)})}}}),r.store?await this.transaction("reg","readwrite",function(l){for(const a of r.store){const d=a[0],m=a[1];l.put(typeof m=="object"?JSON.stringify(m):1,d)}}):r.bypass||await this.transaction("reg","readwrite",function(l){for(const a of r.reg.keys())l.put(1,a)}),r.tag&&await this.transaction("tag","readwrite",function(l){for(const a of r.tag){const d=a[0],m=a[1];m.length&&(l.get(d).onsuccess=function(){let v=this.result;v=v&&v.length?v.concat(m):m,l.put(v,d)})}}),r.map.clear(),r.ctx.clear(),r.tag&&r.tag.clear(),r.store&&r.store.clear(),r.document||r.reg.clear())};function Qi(r,i,o){const l=r.value;let a,d=0;for(let m=0,v;m<l.length;m++){if(v=o?l:l[m]){for(let y=0,C,E;y<i.length;y++)if(E=i[y],C=v.indexOf(E),C>=0)if(a=1,v.length>1)v.splice(C,1);else{l[m]=[];break}d+=v.length}if(o)break}d?a&&r.update(l):r.delete(),r.continue()}ie.remove=function(r){return typeof r!="object"&&(r=[r]),Promise.all([this.transaction("map","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r)}}),this.transaction("ctx","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r)}}),this.transaction("tag","readwrite",function(i){i.openCursor().onsuccess=function(){const o=this.result;o&&Qi(o,r,!0)}}),this.transaction("reg","readwrite",function(i){for(let o=0;o<r.length;o++)i.delete(r[o])})])};function qt(r,i){return new Promise((o,l)=>{r.onsuccess=r.oncomplete=function(){i&&i(this.result),i=null,o(this.result)},r.onerror=r.onblocked=l,r=null})}const Ps={Encoder:Hn,Document:$n},Lf=zi,Of={finalize:r=>{let i=[];for(const o of r)i.push(..._f(o));return i}};function Rf(r){return r>=19968&&r<=40959||r>=12352&&r<=12543||r>=44032&&r<=55203||r>=13312&&r<=19903||r>=131072&&r<=173791||r>=173824&&r<=191471||r>=196608&&r<=205743||r>=191472&&r<=192095||r>=63744&&r<=64255||r>=194560&&r<=195103}function _f(r){const i=[];let o="";for(const l of r){const a=l.codePointAt(0);Rf(a)?(o&&(i.push(o),o=""),i.push(l)):o+=l}return o&&i.push(o),i}const Yi=new Ps.Encoder(Lf.Default,Of);class If{constructor({adminUrl:i,apiKey:o,dir:l}){const a=l==="rtl",d=l==="rtl"?"reverse":"forward";this.apiUrl=i,this.apiKey=o,this.postsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["title","excerpt"],store:!0},encoder:Yi}),this.authorsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["name"],store:!0},encoder:Yi}),this.tagsIndex=new Ps.Document({tokenize:d,rtl:a,document:{id:"id",index:["name"],store:!0},encoder:Yi}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async#t(){const i=await this.#n();i.length>0&&this.#r(i)}async#n(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/posts/?key=${this.apiKey}`;return(await(await fetch(i)).json()).posts}catch(i){return console.error("Error fetching posts:",i),[]}}#r(i){i.forEach(o=>{this.postsIndex.add(o)})}async#s(){const i=await this.#i();i.length>0&&this.#o(i)}async#i(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/authors/?key=${this.apiKey}`;return(await(await fetch(i)).json()).authors}catch(i){return console.error("Error fetching authors:",i),[]}}#o(i){i.forEach(o=>{this.authorsIndex.add(o)})}async#l(){const i=await this.#u();i.length>0&&this.#a(i)}async#u(){try{const i=`${this.apiUrl}/ghost/api/content/search-index/tags/?key=${this.apiKey}`;return(await(await fetch(i)).json()).tags}catch(i){return console.error("Error fetching tags:",i),[]}}#a(i){i.forEach(o=>{this.tagsIndex.add(o)})}async init(){await this.#t(),await this.#s(),await this.#l()}#e(i){const o=[],l={};return i.forEach(a=>{a.result.forEach(d=>{l[d.id]||(o.push(d.doc),l[d.id]=!0)})}),o}search(i){const o=this.postsIndex.search(i,{enrich:!0}),l=this.authorsIndex.search(i,{enrich:!0}),a=this.tagsIndex.search(i,{enrich:!0});return{posts:this.#e(o),authors:this.#e(l),tags:this.#e(a)}}}var En={exports:{}},Jn={exports:{}};const zf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Mf={Authors:"الكتّاب",Cancel:"إلغاء","No matches found":"لا يوجد نتائج مطابقة",Posts:"منشورات","Search posts, tags and authors":"قم بالبحث عن المنشورات، الوسوم و الكتّاب","Show more results":"اظهر المزيد من النتائج",Tags:"الوسوم"},Ff={Authors:"Автори",Cancel:"Отказ","No matches found":"Няма съвпадения",Posts:"Публикации","Search posts, tags and authors":"Търсене в публикации, етикети и автори","Show more results":"Покажи още резултати",Tags:"Етикети"},Df={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Uf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Bf={Authors:"Autors",Cancel:"Cancel·la","No matches found":"No s'ha trobat cap resultat",Posts:"Articles","Search posts, tags and authors":"Cerca articles, etiquetes i autors","Show more results":"Mostra més resultats",Tags:"Etiquetes"},Vf={Authors:"Autoři",Cancel:"Zrušit","No matches found":"Nenalezeno",Posts:"Články","Search posts, tags and authors":"Prohledat články, štítky a autory","Show more results":"Zobrazit více výsledků",Tags:"Štítky"},Hf={Authors:"Forfattere",Cancel:"Annuller","No matches found":"Ingen resultater fundet",Posts:"Indlæg","Search posts, tags and authors":"Søg i indlæg, tags og forfattere","Show more results":"Vis flere resultater",Tags:"Tags"},bf={Authors:"Autoren",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Beiträge","Search posts, tags and authors":"Nach Posts, Tags und Autoren suchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},Kf={Authors:"Autor*innen",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Posts","Search posts, tags and authors":"Posts, Tags und Autor*innen durchsuchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},Wf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Qf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Yf={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Jf={Authors:"Autores",Cancel:"Cancelar","No matches found":"No se encontraron resultados",Posts:"Publicaciones","Search posts, tags and authors":"Buscar publicaciones, etiquetas y autores","Show more results":"Mostrar más resultados",Tags:"Etiquetas"},Xf={Authors:"Autorid",Cancel:"Tühista","No matches found":"Vasteid ei leitud",Posts:"Postitused","Search posts, tags and authors":"Otsi postitusi, silte ja autoreid","Show more results":"Näita rohkem tulemusi",Tags:"Sildid"},Zf={Authors:"Autoreak",Cancel:"Utzi","No matches found":"Ez da bat datorren ezer topatu",Posts:"Artikuluak","Search posts, tags and authors":"Bilatu artikuluak, etiketak eta autoreak","Show more results":"Erakutsi emaitza gehiago",Tags:"Etiketak"},Gf={Authors:"نویسندگان",Cancel:"لغو","No matches found":"موردی یافت نشد",Posts:"نوشتهها","Search posts, tags and authors":"جستوجوی نوشتهها، برچسبها و نویسندگان","Show more results":"نمایش نتایج بیشتر",Tags:"برچسبها"},qf={Authors:"Kirjoittajat",Cancel:"Peruuta","No matches found":"Ei hakutuloksia",Posts:"Kirjoitukset","Search posts, tags and authors":"Etsi kirjoituksia, tunnisteita ja kirjoittajia","Show more results":"Näytä enemmän tuloksia",Tags:"Tunnisteet"},eh={Authors:"Auteurs",Cancel:"Annuler","No matches found":"Aucun résultat trouvé",Posts:"Articles","Search posts, tags and authors":"Rechercher des articles, des catégories et des auteurs","Show more results":"Plus de résultats",Tags:"Catégories"},th={Authors:"Ùghdaran",Cancel:"Sguir dheth","No matches found":"Cha deach dad a lorg a fhreagras ris na lorg thu",Posts:"Postaichean","Search posts, tags and authors":"Lorg sna postaichean, tagaichean agus ùghdaran","Show more results":"Seall barrachd thoraidhean",Tags:"Tagaichean"},nh={Authors:"מחברים",Cancel:"ביטול","No matches found":"לא נמצאו התאמות",Posts:"פוסטים","Search posts, tags and authors":"חיפוש פוסטים, תגיות ומחברים","Show more results":"הצגת תוצאות נוספות",Tags:"תגיות"},rh={Authors:"लेखक",Cancel:"रद्द करें","No matches found":"कोई मैच नहीं मिला",Posts:"पोस्ट","Search posts, tags and authors":"पोस्ट, टैग और लेखक की तलाश करें","Show more results":"और परिणाम दिखाएं",Tags:"टैग"},sh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},ih={Authors:"Szerzők",Cancel:"Mégse","No matches found":"Nincs találat",Posts:"Bejegyzések","Search posts, tags and authors":"Keresés a bejegyzések, a címkék és a szerzők között","Show more results":"További találatok megjelenítése",Tags:"Címkék"},oh={Authors:"Penulis",Cancel:"Batalkan","No matches found":"Tidak ada hasil yang ditemukan",Posts:"Postingan","Search posts, tags and authors":"Cari postingan, tag, dan penulis","Show more results":"Tampilkan lebih banyak hasil",Tags:"Tag"},lh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},uh={Authors:"Autori",Cancel:"Annulla","No matches found":"Nessun risultato trovato",Posts:"Articoli","Search posts, tags and authors":"Cerca articoli, tag e autori","Show more results":"Mostra più risultati",Tags:"Tag"},ah={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},ch={Authors:"작성자",Cancel:"취소","No matches found":"일치하는 결과가 없어요",Posts:"게시물","Search posts, tags and authors":"게시물, 태그, 작성자 검색","Show more results":"더 많은 결과 보기",Tags:"태그"},fh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},hh={Authors:"Autoriai",Cancel:"Atšaukti","No matches found":"Atitikmenų nerasta",Posts:"Įrašai","Search posts, tags and authors":"Ieškoti įrašų, žymų ir autorių","Show more results":"Rodyti daugiau rezultatų",Tags:"Žymos"},dh={Authors:"Autori",Cancel:"Atcelt","No matches found":"Nav atrasta neviena atbilstība",Posts:"Ziņas","Search posts, tags and authors":"Meklēt ziņas, atzīmes un autorus","Show more results":"Rādīt vairāk rezultātu",Tags:"Tagi"},ph={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},gh={Authors:"Нийтлэгчид",Cancel:"Цуцлах","No matches found":"Тохирох хайлтын үр дүн олдсонгүй",Posts:"Нийтлэлүүд","Search posts, tags and authors":"Нийтлэл, ангилал, нийтлэгчдээр хайх","Show more results":"Илүү олон үр дүн харуулах",Tags:"Ангилалууд"},mh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},yh={Authors:"Forfattere",Cancel:"Avbryt","No matches found":"Ingen treff funnet",Posts:"Innlegg","Search posts, tags and authors":"Søk i innlegg, etiketter og forfattere","Show more results":"Vis flere resultater",Tags:"Etiketter"},vh={Authors:"लेखकहरू",Cancel:"रद्द गर्नुहोस्","No matches found":"कुनै परिणाम भेटिएन",Posts:"पोस्टहरू","Search posts, tags and authors":"पोस्टहरू, ट्यागहरू र लेखकहरू खोज्नुहोस्","Show more results":"थप परिणामहरू देखाउनुहोस्",Tags:"ट्यागहरू"},wh={Authors:"Auteurs",Cancel:"Annuleren","No matches found":"Geen resultaten gevonden",Posts:"Berichten","Search posts, tags and authors":"Zoek berichten, tags en auteurs","Show more results":"Meer resultaten weergeven",Tags:"Tags"},xh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Sh={Authors:"ਲੇਖਕ",Cancel:"ਰੱਦ ਕਰੋ","No matches found":"ਕੋਈ ਮੇਲ ਨਹੀਂ ਮਿਲਿਆ",Posts:"ਪੋਸਟਾਂ","Search posts, tags and authors":"ਪੋਸਟਾਂ, ਟੈਗ ਅਤੇ ਲੇਖਕ ਖੋਜੋ","Show more results":"ਹੋਰ ਨਤੀਜੇ ਦਿਖਾਓ",Tags:"ਟੈਗ"},kh={Authors:"Autorzy",Cancel:"Anuluj","No matches found":"Nie znaleziono dopasowań",Posts:"Posty","Search posts, tags and authors":"Szukaj postów, tagów lub autorów","Show more results":"Pokaż więcej wyników",Tags:"Tagi"},Ch={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Buscar posts, tags e autores","Show more results":"Mostrar mais resultados",Tags:"Tags"},$h={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Procurar publicações, marcadores e autores","Show more results":"Mostrar mais resultados",Tags:"Marcadores"},Ph={Authors:"Autori",Cancel:"Anulează","No matches found":"Nu s-au găsit rezultate",Posts:"Postări","Search posts, tags and authors":"Caută postări, etichete și autori","Show more results":"Afișează mai multe rezultate",Tags:"Etichete"},Eh={Authors:"Авторы",Cancel:"Отмена","No matches found":"Совпадений не найдено",Posts:"Записи","Search posts, tags and authors":"Поиск по записям, тегам и авторам","Show more results":"Показать больше результатов",Tags:"Теги"},Th={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},jh={Authors:"Autori",Cancel:"Zrušiť","No matches found":"Nenašli sa žiadne výsledky",Posts:"Príspevky","Search posts, tags and authors":"Vyhľadajte príspevky, tagy a autorov","Show more results":"Zobraziť viac výsledkov",Tags:"Tagy"},Nh={Authors:"Avtorji",Cancel:"Prekliči","No matches found":"Ni najdenih zadetkov",Posts:"Članki","Search posts, tags and authors":"Iščite članke, oznake in avtorje","Show more results":"Prikaži več rezultatov",Tags:"Oznake"},Ah={Authors:"Autorët",Cancel:"Anulo","No matches found":"Nuk u gjet asnjë rezultat",Posts:"Postimet","Search posts, tags and authors":"Kërko postime, etiketa dhe autorë","Show more results":"Shfaq më shumë rezultate",Tags:"Etiketat"},Lh={Authors:"Аутори",Cancel:"Откажите","No matches found":"Нема резултата",Posts:"Објаве","Search posts, tags and authors":"Претражите објаве, tag-ове и ауторе","Show more results":"Прикажите више резултата",Tags:"Tag-ови"},Oh={Authors:"Autori",Cancel:"Otkažite","No matches found":"Nema rezultata",Posts:"Objave","Search posts, tags and authors":"Pretražite objave, tag-ove i autore","Show more results":"Prikažite više rezultata",Tags:"Tag-ovi"},Rh={Authors:"Författare",Cancel:"Avbryt","No matches found":"Inga träffar hittade",Posts:"Inlägg","Search posts, tags and authors":"Sök inlägg, taggar och författare","Show more results":"Visa fler resultat",Tags:"Taggar"},_h={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Ih={Authors:"ஆசிரியர்கள்",Cancel:"ரத்து செய்","No matches found":"பொருத்தங்கள் எதுவும் இல்லை",Posts:"பதிவுகள்","Search posts, tags and authors":"பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்","Show more results":"மேலும் முடிவுகளைக் காட்டு",Tags:"குறிச்சொற்கள்"},zh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Mh={Authors:"Yazarlar",Cancel:"İptal","No matches found":"Eşleşme bulunamadı",Posts:"Yazılar","Search posts, tags and authors":"Yazıları, etiketleri ve yazarları ara","Show more results":"Daha fazla sonuç göster",Tags:"Etiketler"},Fh={Authors:"Автори",Cancel:"Скасувати","No matches found":"Збігів не знайдено",Posts:"Публікації","Search posts, tags and authors":"Шукайте публікацій, теги та авторів","Show more results":"Показати більше результатів",Tags:"Теги"},Dh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Uh={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Bh={Authors:"Tác giả",Cancel:"Hủy","No matches found":"Không tìm thấy",Posts:"Bài viết","Search posts, tags and authors":"Tìm bài viết, thẻ và tác giả","Show more results":"Xem thêm kết quả",Tags:"Thẻ"},Vh={Authors:"作者",Cancel:"取消","No matches found":"無相符結果",Posts:"文章","Search posts, tags and authors":"搜尋文章、標籤與作者","Show more results":"更多結果",Tags:"標籤"},Hh={Authors:"作者",Cancel:"取消","No matches found":"未找到匹配项",Posts:"文章","Search posts, tags and authors":"搜索文章、标签和作者","Show more results":"显示更多结果",Tags:"标签"};var lu;function uu(){return lu||(lu={"/ghost/i18n/locales/af/search.json":function(){return zf},"/ghost/i18n/locales/ar/search.json":function(){return Mf},"/ghost/i18n/locales/bg/search.json":function(){return Ff},"/ghost/i18n/locales/bn/search.json":function(){return Df},"/ghost/i18n/locales/bs/search.json":function(){return Uf},"/ghost/i18n/locales/ca/search.json":function(){return Bf},"/ghost/i18n/locales/cs/search.json":function(){return Vf},"/ghost/i18n/locales/da/search.json":function(){return Hf},"/ghost/i18n/locales/de-CH/search.json":function(){return bf},"/ghost/i18n/locales/de/search.json":function(){return Kf},"/ghost/i18n/locales/el/search.json":function(){return Wf},"/ghost/i18n/locales/en/search.json":function(){return Qf},"/ghost/i18n/locales/eo/search.json":function(){return Yf},"/ghost/i18n/locales/es/search.json":function(){return Jf},"/ghost/i18n/locales/et/search.json":function(){return Xf},"/ghost/i18n/locales/eu/search.json":function(){return Zf},"/ghost/i18n/locales/fa/search.json":function(){return Gf},"/ghost/i18n/locales/fi/search.json":function(){return qf},"/ghost/i18n/locales/fr/search.json":function(){return eh},"/ghost/i18n/locales/gd/search.json":function(){return th},"/ghost/i18n/locales/he/search.json":function(){return nh},"/ghost/i18n/locales/hi/search.json":function(){return rh},"/ghost/i18n/locales/hr/search.json":function(){return sh},"/ghost/i18n/locales/hu/search.json":function(){return ih},"/ghost/i18n/locales/id/search.json":function(){return oh},"/ghost/i18n/locales/is/search.json":function(){return lh},"/ghost/i18n/locales/it/search.json":function(){return uh},"/ghost/i18n/locales/ja/search.json":function(){return ah},"/ghost/i18n/locales/ko/search.json":function(){return ch},"/ghost/i18n/locales/kz/search.json":function(){return fh},"/ghost/i18n/locales/lt/search.json":function(){return hh},"/ghost/i18n/locales/lv/search.json":function(){return dh},"/ghost/i18n/locales/mk/search.json":function(){return ph},"/ghost/i18n/locales/mn/search.json":function(){return gh},"/ghost/i18n/locales/ms/search.json":function(){return mh},"/ghost/i18n/locales/nb/search.json":function(){return yh},"/ghost/i18n/locales/ne/search.json":function(){return vh},"/ghost/i18n/locales/nl/search.json":function(){return wh},"/ghost/i18n/locales/nn/search.json":function(){return xh},"/ghost/i18n/locales/pa/search.json":function(){return Sh},"/ghost/i18n/locales/pl/search.json":function(){return kh},"/ghost/i18n/locales/pt-BR/search.json":function(){return Ch},"/ghost/i18n/locales/pt/search.json":function(){return $h},"/ghost/i18n/locales/ro/search.json":function(){return Ph},"/ghost/i18n/locales/ru/search.json":function(){return Eh},"/ghost/i18n/locales/si/search.json":function(){return Th},"/ghost/i18n/locales/sk/search.json":function(){return jh},"/ghost/i18n/locales/sl/search.json":function(){return Nh},"/ghost/i18n/locales/sq/search.json":function(){return Ah},"/ghost/i18n/locales/sr-Cyrl/search.json":function(){return Lh},"/ghost/i18n/locales/sr/search.json":function(){return Oh},"/ghost/i18n/locales/sv/search.json":function(){return Rh},"/ghost/i18n/locales/sw/search.json":function(){return _h},"/ghost/i18n/locales/ta/search.json":function(){return Ih},"/ghost/i18n/locales/th/search.json":function(){return zh},"/ghost/i18n/locales/tr/search.json":function(){return Mh},"/ghost/i18n/locales/uk/search.json":function(){return Fh},"/ghost/i18n/locales/ur/search.json":function(){return Dh},"/ghost/i18n/locales/uz/search.json":function(){return Uh},"/ghost/i18n/locales/vi/search.json":function(){return Bh},"/ghost/i18n/locales/zh-Hant/search.json":function(){return Vh},"/ghost/i18n/locales/zh/search.json":function(){return Hh}})}function au(r){function i(o){var l=cu(o,r);if(l!==null)return uu()[l]();throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return i.resolve=function(o){var l=cu(o,r);return l!==null?l:require.resolve(o)},i}function cu(r,i){var o=bh(r);r=Es(r);var l;r[0]==="/"&&(i="");for(var a=uu(),d=["",".js",".json"];o?l=Es(i+"/node_modules/"+r):l=Es(i+"/"+r),!l.endsWith("/..");){for(var m=0;m<d.length;m++){var v=l+d[m];if(a[v])return v}if(!o)break;var y=Es(i+"/..");if(y===i)break;i=y}return null}function bh(r){var i=r[0];if(i==="/"||i==="\\")return!1;var o=r[1],l=r[2];return!(i==="."&&(!o||o==="/"||o==="\\")||i==="."&&o==="."&&(!l||l==="/"||l==="\\")||o===":"&&(l==="/"||l==="\\"))}function Es(r){r=r.replace(/\\/g,"/");for(var i=r.split("/"),o=i[0]==="",l=1;l<i.length;l++)(i[l]==="."||i[l]==="")&&i.splice(l--,1);for(var l=1;l<i.length;l++)i[l]===".."&&l>0&&i[l-1]!==".."&&i[l-1]!=="."&&(i.splice(--l,2),l--);return r=i.join("/"),o&&r[0]!=="/"?r="/"+r:r.length===0&&(r="."),r}var Ji,fu;function Kh(){if(fu)return Ji;fu=1;const r=S=>typeof S=="string",i=()=>{let S,c;const h=new Promise((g,x)=>{S=g,c=x});return h.resolve=S,h.reject=c,h},o=S=>S==null?"":""+S,l=(S,c,h)=>{S.forEach(g=>{c[g]&&(h[g]=c[g])})},a=/###/g,d=S=>S&&S.indexOf("###")>-1?S.replace(a,"."):S,m=S=>!S||r(S),v=(S,c,h)=>{const g=r(c)?c.split("."):c;let x=0;for(;x<g.length-1;){if(m(S))return{};const k=d(g[x]);!S[k]&&h&&(S[k]=new h),Object.prototype.hasOwnProperty.call(S,k)?S=S[k]:S={},++x}return m(S)?{}:{obj:S,k:d(g[x])}},y=(S,c,h)=>{const{obj:g,k:x}=v(S,c,Object);if(g!==void 0||c.length===1){g[x]=h;return}let k=c[c.length-1],j=c.slice(0,c.length-1),I=v(S,j,Object);for(;I.obj===void 0&&j.length;)k=`${j[j.length-1]}.${k}`,j=j.slice(0,j.length-1),I=v(S,j,Object),I&&I.obj&&typeof I.obj[`${I.k}.${k}`]<"u"&&(I.obj=void 0);I.obj[`${I.k}.${k}`]=h},C=(S,c,h,g)=>{const{obj:x,k}=v(S,c,Object);x[k]=x[k]||[],x[k].push(h)},E=(S,c)=>{const{obj:h,k:g}=v(S,c);if(h)return h[g]},L=(S,c,h)=>{const g=E(S,h);return g!==void 0?g:E(c,h)},F=(S,c,h)=>{for(const g in c)g!=="__proto__"&&g!=="constructor"&&(g in S?r(S[g])||S[g]instanceof String||r(c[g])||c[g]instanceof String?h&&(S[g]=c[g]):F(S[g],c[g],h):S[g]=c[g]);return S},M=S=>S.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var V={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const R=S=>r(S)?S.replace(/[&<>"'\/]/g,c=>V[c]):S;class O{constructor(c){this.capacity=c,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(c){const h=this.regExpMap.get(c);if(h!==void 0)return h;const g=new RegExp(c);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(c,g),this.regExpQueue.push(c),g}}const J=[" ",",","?","!",";"],X=new O(20),fe=(S,c,h)=>{c=c||"",h=h||"";const g=J.filter(j=>c.indexOf(j)<0&&h.indexOf(j)<0);if(g.length===0)return!0;const x=X.getRegExp(`(${g.map(j=>j==="?"?"\\?":j).join("|")})`);let k=!x.test(S);if(!k){const j=S.indexOf(h);j>0&&!x.test(S.substring(0,j))&&(k=!0)}return k},de=function(S,c){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!S)return;if(S[c])return S[c];const g=c.split(h);let x=S;for(let k=0;k<g.length;){if(!x||typeof x!="object")return;let j,I="";for(let z=k;z<g.length;++z)if(z!==k&&(I+=h),I+=g[z],j=x[I],j!==void 0){if(["string","number","boolean"].indexOf(typeof j)>-1&&z<g.length-1)continue;k+=z-k+1;break}x=j}return x},he=S=>S&&S.replace("_","-"),ae={type:"logger",log(S){this.output("log",S)},warn(S){this.output("warn",S)},error(S){this.output("error",S)},output(S,c){console&&console[S]&&console[S].apply(console,c)}};class ue{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(c,h)}init(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=h.prefix||"i18next:",this.logger=c||ae,this.options=h,this.debug=h.debug}log(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"log","",!0)}warn(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"warn","",!0)}error(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"error","")}deprecate(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return this.forward(h,"warn","WARNING DEPRECATED: ",!0)}forward(c,h,g,x){return x&&!this.debug?null:(r(c[0])&&(c[0]=`${g}${this.prefix} ${c[0]}`),this.logger[h](c))}create(c){return new ue(this.logger,{prefix:`${this.prefix}:${c}:`,...this.options})}clone(c){return c=c||this.options,c.prefix=c.prefix||this.prefix,new ue(this.logger,c)}}var q=new ue;class oe{constructor(){this.observers={}}on(c,h){return c.split(" ").forEach(g=>{this.observers[g]||(this.observers[g]=new Map);const x=this.observers[g].get(h)||0;this.observers[g].set(h,x+1)}),this}off(c,h){if(this.observers[c]){if(!h){delete this.observers[c];return}this.observers[c].delete(h)}}emit(c){for(var h=arguments.length,g=new Array(h>1?h-1:0),x=1;x<h;x++)g[x-1]=arguments[x];this.observers[c]&&Array.from(this.observers[c].entries()).forEach(j=>{let[I,z]=j;for(let b=0;b<z;b++)I(...g)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(j=>{let[I,z]=j;for(let b=0;b<z;b++)I.apply(I,[c,...g])})}}class Pe extends oe{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=c||{},this.options=h,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(c){this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}removeNamespaces(c){const h=this.options.ns.indexOf(c);h>-1&&this.options.ns.splice(h,1)}getResource(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const k=x.keySeparator!==void 0?x.keySeparator:this.options.keySeparator,j=x.ignoreJSONStructure!==void 0?x.ignoreJSONStructure:this.options.ignoreJSONStructure;let I;c.indexOf(".")>-1?I=c.split("."):(I=[c,h],g&&(Array.isArray(g)?I.push(...g):r(g)&&k?I.push(...g.split(k)):I.push(g)));const z=E(this.data,I);return!z&&!h&&!g&&c.indexOf(".")>-1&&(c=I[0],h=I[1],g=I.slice(2).join(".")),z||!j||!r(g)?z:de(this.data&&this.data[c]&&this.data[c][h],g,k)}addResource(c,h,g,x){let k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const j=k.keySeparator!==void 0?k.keySeparator:this.options.keySeparator;let I=[c,h];g&&(I=I.concat(j?g.split(j):g)),c.indexOf(".")>-1&&(I=c.split("."),x=h,h=I[1]),this.addNamespaces(h),y(this.data,I,x),k.silent||this.emit("added",c,h,g,x)}addResources(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const k in g)(r(g[k])||Array.isArray(g[k]))&&this.addResource(c,h,k,g[k],{silent:!0});x.silent||this.emit("added",c,h,g)}addResourceBundle(c,h,g,x,k){let j=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},I=[c,h];c.indexOf(".")>-1&&(I=c.split("."),x=g,g=h,h=I[1]),this.addNamespaces(h);let z=E(this.data,I)||{};j.skipCopy||(g=JSON.parse(JSON.stringify(g))),x?F(z,g,k):z={...z,...g},y(this.data,I,z),j.silent||this.emit("added",c,h,g)}removeResourceBundle(c,h){this.hasResourceBundle(c,h)&&delete this.data[c][h],this.removeNamespaces(h),this.emit("removed",c,h)}hasResourceBundle(c,h){return this.getResource(c,h)!==void 0}getResourceBundle(c,h){return h||(h=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(c,h)}:this.getResource(c,h)}getDataByLanguage(c){return this.data[c]}hasLanguageSomeTranslations(c){const h=this.getDataByLanguage(c);return!!(h&&Object.keys(h)||[]).find(x=>h[x]&&Object.keys(h[x]).length>0)}toJSON(){return this.data}}var xe={processors:{},addPostProcessor(S){this.processors[S.name]=S},handle(S,c,h,g,x){return S.forEach(k=>{this.processors[k]&&(c=this.processors[k].process(c,h,g,x))}),c}};const Ee={};class ke extends oe{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),l(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],c,this),this.options=h,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=q.create("translator")}changeLanguage(c){c&&(this.language=c)}exists(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(c==null)return!1;const g=this.resolve(c,h);return g&&g.res!==void 0}extractFromKey(c,h){let g=h.nsSeparator!==void 0?h.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const x=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator;let k=h.ns||this.options.defaultNS||[];const j=g&&c.indexOf(g)>-1,I=!this.options.userDefinedKeySeparator&&!h.keySeparator&&!this.options.userDefinedNsSeparator&&!h.nsSeparator&&!fe(c,g,x);if(j&&!I){const z=c.match(this.interpolator.nestingRegexp);if(z&&z.length>0)return{key:c,namespaces:r(k)?[k]:k};const b=c.split(g);(g!==x||g===x&&this.options.ns.indexOf(b[0])>-1)&&(k=b.shift()),c=b.join(x)}return{key:c,namespaces:r(k)?[k]:k}}translate(c,h,g){if(typeof h!="object"&&this.options.overloadTranslationOptionHandler&&(h=this.options.overloadTranslationOptionHandler(arguments)),typeof h=="object"&&(h={...h}),h||(h={}),c==null)return"";Array.isArray(c)||(c=[String(c)]);const x=h.returnDetails!==void 0?h.returnDetails:this.options.returnDetails,k=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator,{key:j,namespaces:I}=this.extractFromKey(c[c.length-1],h),z=I[I.length-1],b=h.lng||this.language,Y=h.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(Y){const ze=h.nsSeparator||this.options.nsSeparator;return x?{res:`${z}${ze}${j}`,usedKey:j,exactUsedKey:j,usedLng:b,usedNS:z,usedParams:this.getUsedParamsDetails(h)}:`${z}${ze}${j}`}return x?{res:j,usedKey:j,exactUsedKey:j,usedLng:b,usedNS:z,usedParams:this.getUsedParamsDetails(h)}:j}const re=this.resolve(c,h);let U=re&&re.res;const pe=re&&re.usedKey||j,Le=re&&re.exactUsedKey||j,Ve=Object.prototype.toString.apply(U),Ie=["[object Number]","[object Function]","[object RegExp]"],Je=h.joinArrays!==void 0?h.joinArrays:this.options.joinArrays,Xe=!this.i18nFormat||this.i18nFormat.handleAsObject,Nt=!r(U)&&typeof U!="boolean"&&typeof U!="number";if(Xe&&U&&Nt&&Ie.indexOf(Ve)<0&&!(r(Je)&&Array.isArray(U))){if(!h.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ze=this.options.returnedObjectHandler?this.options.returnedObjectHandler(pe,U,{...h,ns:I}):`key '${j} (${this.language})' returned an object instead of string.`;return x?(re.res=ze,re.usedParams=this.getUsedParamsDetails(h),re):ze}if(k){const ze=Array.isArray(U),lt=ze?[]:{},at=ze?Le:pe;for(const Ze in U)if(Object.prototype.hasOwnProperty.call(U,Ze)){const Xn=`${at}${k}${Ze}`;lt[Ze]=this.translate(Xn,{...h,joinArrays:!1,ns:I}),lt[Ze]===Xn&&(lt[Ze]=U[Ze])}U=lt}}else if(Xe&&r(Je)&&Array.isArray(U))U=U.join(Je),U&&(U=this.extendTranslation(U,c,h,g));else{let ze=!1,lt=!1;const at=h.count!==void 0&&!r(h.count),Ze=ke.hasDefaultValue(h),Xn=at?this.pluralResolver.getSuffix(b,h.count,h):"",Er=h.ordinal&&at?this.pluralResolver.getSuffix(b,h.count,{ordinal:!1}):"",Zn=at&&!h.ordinal&&h.count===0&&this.pluralResolver.shouldUseIntlApi(),Ht=Zn&&h[`defaultValue${this.options.pluralSeparator}zero`]||h[`defaultValue${Xn}`]||h[`defaultValue${Er}`]||h.defaultValue;!this.isValidLookup(U)&&Ze&&(ze=!0,U=Ht),this.isValidLookup(U)||(lt=!0,U=j);const en=(h.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&<?void 0:U,vt=Ze&&Ht!==U&&this.options.updateMissing;if(lt||ze||vt){if(this.logger.log(vt?"updateKey":"missingKey",b,z,j,vt?Ht:U),k){const qe=this.resolve(j,{...h,keySeparator:!1});qe&&qe.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 tn=[];const jn=this.languageUtils.getFallbackCodes(this.options.fallbackLng,h.lng||this.language);if(this.options.saveMissingTo==="fallback"&&jn&&jn[0])for(let qe=0;qe<jn.length;qe++)tn.push(jn[qe]);else this.options.saveMissingTo==="all"?tn=this.languageUtils.toResolveHierarchy(h.lng||this.language):tn.push(h.lng||this.language);const Tr=(qe,_t,bt)=>{const jr=Ze&&bt!==U?bt:en;this.options.missingKeyHandler?this.options.missingKeyHandler(qe,z,_t,jr,vt,h):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(qe,z,_t,jr,vt,h),this.emit("missingKey",qe,z,_t,U)};this.options.saveMissing&&(this.options.saveMissingPlurals&&at?tn.forEach(qe=>{const _t=this.pluralResolver.getSuffixes(qe,h);Zn&&h[`defaultValue${this.options.pluralSeparator}zero`]&&_t.indexOf(`${this.options.pluralSeparator}zero`)<0&&_t.push(`${this.options.pluralSeparator}zero`),_t.forEach(bt=>{Tr([qe],j+bt,h[`defaultValue${bt}`]||Ht)})}):Tr(tn,j,Ht))}U=this.extendTranslation(U,c,h,re,g),lt&&U===j&&this.options.appendNamespaceToMissingKey&&(U=`${z}:${j}`),(lt||ze)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?U=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${z}:${j}`:j,ze?U:void 0):U=this.options.parseMissingKeyHandler(U))}return x?(re.res=U,re.usedParams=this.getUsedParamsDetails(h),re):U}extendTranslation(c,h,g,x,k){var j=this;if(this.i18nFormat&&this.i18nFormat.parse)c=this.i18nFormat.parse(c,{...this.options.interpolation.defaultVariables,...g},g.lng||this.language||x.usedLng,x.usedNS,x.usedKey,{resolved:x});else if(!g.skipInterpolation){g.interpolation&&this.interpolator.init({...g,interpolation:{...this.options.interpolation,...g.interpolation}});const b=r(c)&&(g&&g.interpolation&&g.interpolation.skipOnVariables!==void 0?g.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let Y;if(b){const U=c.match(this.interpolator.nestingRegexp);Y=U&&U.length}let re=g.replace&&!r(g.replace)?g.replace:g;if(this.options.interpolation.defaultVariables&&(re={...this.options.interpolation.defaultVariables,...re}),c=this.interpolator.interpolate(c,re,g.lng||this.language||x.usedLng,g),b){const U=c.match(this.interpolator.nestingRegexp),pe=U&&U.length;Y<pe&&(g.nest=!1)}!g.lng&&this.options.compatibilityAPI!=="v1"&&x&&x.res&&(g.lng=this.language||x.usedLng),g.nest!==!1&&(c=this.interpolator.nest(c,function(){for(var U=arguments.length,pe=new Array(U),Le=0;Le<U;Le++)pe[Le]=arguments[Le];return k&&k[0]===pe[0]&&!g.context?(j.logger.warn(`It seems you are nesting recursively key: ${pe[0]} in key: ${h[0]}`),null):j.translate(...pe,h)},g)),g.interpolation&&this.interpolator.reset()}const I=g.postProcess||this.options.postProcess,z=r(I)?[I]:I;return c!=null&&z&&z.length&&g.applyPostProcessor!==!1&&(c=xe.handle(z,c,h,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...x,usedParams:this.getUsedParamsDetails(g)},...g}:g,this)),c}resolve(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g,x,k,j,I;return r(c)&&(c=[c]),c.forEach(z=>{if(this.isValidLookup(g))return;const b=this.extractFromKey(z,h),Y=b.key;x=Y;let re=b.namespaces;this.options.fallbackNS&&(re=re.concat(this.options.fallbackNS));const U=h.count!==void 0&&!r(h.count),pe=U&&!h.ordinal&&h.count===0&&this.pluralResolver.shouldUseIntlApi(),Le=h.context!==void 0&&(r(h.context)||typeof h.context=="number")&&h.context!=="",Ve=h.lngs?h.lngs:this.languageUtils.toResolveHierarchy(h.lng||this.language,h.fallbackLng);re.forEach(Ie=>{this.isValidLookup(g)||(I=Ie,!Ee[`${Ve[0]}-${Ie}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(I)&&(Ee[`${Ve[0]}-${Ie}`]=!0,this.logger.warn(`key "${x}" for languages "${Ve.join(", ")}" won't get resolved as namespace "${I}" 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!!!")),Ve.forEach(Je=>{if(this.isValidLookup(g))return;j=Je;const Xe=[Y];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(Xe,Y,Je,Ie,h);else{let ze;U&&(ze=this.pluralResolver.getSuffix(Je,h.count,h));const lt=`${this.options.pluralSeparator}zero`,at=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(U&&(Xe.push(Y+ze),h.ordinal&&ze.indexOf(at)===0&&Xe.push(Y+ze.replace(at,this.options.pluralSeparator)),pe&&Xe.push(Y+lt)),Le){const Ze=`${Y}${this.options.contextSeparator}${h.context}`;Xe.push(Ze),U&&(Xe.push(Ze+ze),h.ordinal&&ze.indexOf(at)===0&&Xe.push(Ze+ze.replace(at,this.options.pluralSeparator)),pe&&Xe.push(Ze+lt))}}let Nt;for(;Nt=Xe.pop();)this.isValidLookup(g)||(k=Nt,g=this.getResource(Je,Ie,Nt,h))}))})}),{res:g,usedKey:x,exactUsedKey:k,usedLng:j,usedNS:I}}isValidLookup(c){return c!==void 0&&!(!this.options.returnNull&&c===null)&&!(!this.options.returnEmptyString&&c==="")}getResource(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(c,h,g,x):this.resourceStore.getResource(c,h,g,x)}getUsedParamsDetails(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],g=c.replace&&!r(c.replace);let x=g?c.replace:c;if(g&&typeof c.count<"u"&&(x.count=c.count),this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),!g){x={...x};for(const k of h)delete x[k]}return x}static hasDefaultValue(c){const h="defaultValue";for(const g in c)if(Object.prototype.hasOwnProperty.call(c,g)&&h===g.substring(0,h.length)&&c[g]!==void 0)return!0;return!1}}const Re=S=>S.charAt(0).toUpperCase()+S.slice(1);class ye{constructor(c){this.options=c,this.supportedLngs=this.options.supportedLngs||!1,this.logger=q.create("languageUtils")}getScriptPartFromCode(c){if(c=he(c),!c||c.indexOf("-")<0)return null;const h=c.split("-");return h.length===2||(h.pop(),h[h.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(h.join("-"))}getLanguagePartFromCode(c){if(c=he(c),!c||c.indexOf("-")<0)return c;const h=c.split("-");return this.formatLanguageCode(h[0])}formatLanguageCode(c){if(r(c)&&c.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let x=Intl.getCanonicalLocales(c)[0];if(x&&this.options.lowerCaseLng&&(x=x.toLowerCase()),x)return x}catch{}const h=["hans","hant","latn","cyrl","cans","mong","arab"];let g=c.split("-");return this.options.lowerCaseLng?g=g.map(x=>x.toLowerCase()):g.length===2?(g[0]=g[0].toLowerCase(),g[1]=g[1].toUpperCase(),h.indexOf(g[1].toLowerCase())>-1&&(g[1]=Re(g[1].toLowerCase()))):g.length===3&&(g[0]=g[0].toLowerCase(),g[1].length===2&&(g[1]=g[1].toUpperCase()),g[0]!=="sgn"&&g[2].length===2&&(g[2]=g[2].toUpperCase()),h.indexOf(g[1].toLowerCase())>-1&&(g[1]=Re(g[1].toLowerCase())),h.indexOf(g[2].toLowerCase())>-1&&(g[2]=Re(g[2].toLowerCase()))),g.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?c.toLowerCase():c}isSupportedCode(c){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(c=this.getLanguagePartFromCode(c)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(c)>-1}getBestMatchFromCodes(c){if(!c)return null;let h;return c.forEach(g=>{if(h)return;const x=this.formatLanguageCode(g);(!this.options.supportedLngs||this.isSupportedCode(x))&&(h=x)}),!h&&this.options.supportedLngs&&c.forEach(g=>{if(h)return;const x=this.getLanguagePartFromCode(g);if(this.isSupportedCode(x))return h=x;h=this.options.supportedLngs.find(k=>{if(k===x)return k;if(!(k.indexOf("-")<0&&x.indexOf("-")<0)&&(k.indexOf("-")>0&&x.indexOf("-")<0&&k.substring(0,k.indexOf("-"))===x||k.indexOf(x)===0&&x.length>1))return k})}),h||(h=this.getFallbackCodes(this.options.fallbackLng)[0]),h}getFallbackCodes(c,h){if(!c)return[];if(typeof c=="function"&&(c=c(h)),r(c)&&(c=[c]),Array.isArray(c))return c;if(!h)return c.default||[];let g=c[h];return g||(g=c[this.getScriptPartFromCode(h)]),g||(g=c[this.formatLanguageCode(h)]),g||(g=c[this.getLanguagePartFromCode(h)]),g||(g=c.default),g||[]}toResolveHierarchy(c,h){const g=this.getFallbackCodes(h||this.options.fallbackLng||[],c),x=[],k=j=>{j&&(this.isSupportedCode(j)?x.push(j):this.logger.warn(`rejecting language code not found in supportedLngs: ${j}`))};return r(c)&&(c.indexOf("-")>-1||c.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&k(this.formatLanguageCode(c)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&k(this.getScriptPartFromCode(c)),this.options.load!=="currentOnly"&&k(this.getLanguagePartFromCode(c))):r(c)&&k(this.formatLanguageCode(c)),g.forEach(j=>{x.indexOf(j)<0&&k(this.formatLanguageCode(j))}),x}}let De=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A={1:S=>+(S>1),2:S=>+(S!=1),3:S=>0,4:S=>S%10==1&&S%100!=11?0:S%10>=2&&S%10<=4&&(S%100<10||S%100>=20)?1:2,5:S=>S==0?0:S==1?1:S==2?2:S%100>=3&&S%100<=10?3:S%100>=11?4:5,6:S=>S==1?0:S>=2&&S<=4?1:2,7:S=>S==1?0:S%10>=2&&S%10<=4&&(S%100<10||S%100>=20)?1:2,8:S=>S==1?0:S==2?1:S!=8&&S!=11?2:3,9:S=>+(S>=2),10:S=>S==1?0:S==2?1:S<7?2:S<11?3:4,11:S=>S==1||S==11?0:S==2||S==12?1:S>2&&S<20?2:3,12:S=>+(S%10!=1||S%100==11),13:S=>+(S!==0),14:S=>S==1?0:S==2?1:S==3?2:3,15:S=>S%10==1&&S%100!=11?0:S%10>=2&&(S%100<10||S%100>=20)?1:2,16:S=>S%10==1&&S%100!=11?0:S!==0?1:2,17:S=>S==1||S%10==1&&S%100!=11?0:1,18:S=>S==0?0:S==1?1:2,19:S=>S==1?0:S==0||S%100>1&&S%100<11?1:S%100>10&&S%100<20?2:3,20:S=>S==1?0:S==0||S%100>0&&S%100<20?1:2,21:S=>S%100==1?1:S%100==2?2:S%100==3||S%100==4?3:0,22:S=>S==1?0:S==2?1:(S<0||S>10)&&S%10==0?2:3};const Q=["v1","v2","v3"],me=["v4"],je={zero:0,one:1,two:2,few:3,many:4,other:5},B=()=>{const S={};return De.forEach(c=>{c.lngs.forEach(h=>{S[h]={numbers:c.nr,plurals:A[c.fc]}})}),S};class ee{constructor(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=c,this.options=h,this.logger=q.create("pluralResolver"),(!this.options.compatibilityJSON||me.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=B(),this.pluralRulesCache={}}addRule(c,h){this.rules[c]=h}clearCache(){this.pluralRulesCache={}}getRule(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const g=he(c==="dev"?"en":c),x=h.ordinal?"ordinal":"cardinal",k=JSON.stringify({cleanedCode:g,type:x});if(k in this.pluralRulesCache)return this.pluralRulesCache[k];let j;try{j=new Intl.PluralRules(g,{type:x})}catch{if(!c.match(/-|_/))return;const z=this.languageUtils.getLanguagePartFromCode(c);j=this.getRule(z,h)}return this.pluralRulesCache[k]=j,j}return this.rules[c]||this.rules[this.languageUtils.getLanguagePartFromCode(c)]}needsPlural(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const g=this.getRule(c,h);return this.shouldUseIntlApi()?g&&g.resolvedOptions().pluralCategories.length>1:g&&g.numbers.length>1}getPluralFormsOfKey(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(c,g).map(x=>`${h}${x}`)}getSuffixes(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const g=this.getRule(c,h);return g?this.shouldUseIntlApi()?g.resolvedOptions().pluralCategories.sort((x,k)=>je[x]-je[k]).map(x=>`${this.options.prepend}${h.ordinal?`ordinal${this.options.prepend}`:""}${x}`):g.numbers.map(x=>this.getSuffix(c,x,h)):[]}getSuffix(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const x=this.getRule(c,g);return x?this.shouldUseIntlApi()?`${this.options.prepend}${g.ordinal?`ordinal${this.options.prepend}`:""}${x.select(h)}`:this.getSuffixRetroCompatible(x,h):(this.logger.warn(`no plural rule found for: ${c}`),"")}getSuffixRetroCompatible(c,h){const g=c.noAbs?c.plurals(h):c.plurals(Math.abs(h));let x=c.numbers[g];this.options.simplifyPluralSuffix&&c.numbers.length===2&&c.numbers[0]===1&&(x===2?x="plural":x===1&&(x=""));const k=()=>this.options.prepend&&x.toString()?this.options.prepend+x.toString():x.toString();return this.options.compatibilityJSON==="v1"?x===1?"":typeof x=="number"?`_plural_${x.toString()}`:k():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&c.numbers.length===2&&c.numbers[0]===1?k():this.options.prepend&&g.toString()?this.options.prepend+g.toString():g.toString()}shouldUseIntlApi(){return!Q.includes(this.options.compatibilityJSON)}}const Z=function(S,c,h){let g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,k=L(S,c,h);return!k&&x&&r(h)&&(k=de(S,h,g),k===void 0&&(k=de(c,h,g))),k},K=S=>S.replace(/\$/g,"$$$$");class ne{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=q.create("interpolator"),this.options=c,this.format=c.interpolation&&c.interpolation.format||(h=>h),this.init(c)}init(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};c.interpolation||(c.interpolation={escapeValue:!0});const{escape:h,escapeValue:g,useRawValueToEscape:x,prefix:k,prefixEscaped:j,suffix:I,suffixEscaped:z,formatSeparator:b,unescapeSuffix:Y,unescapePrefix:re,nestingPrefix:U,nestingPrefixEscaped:pe,nestingSuffix:Le,nestingSuffixEscaped:Ve,nestingOptionsSeparator:Ie,maxReplaces:Je,alwaysFormat:Xe}=c.interpolation;this.escape=h!==void 0?h:R,this.escapeValue=g!==void 0?g:!0,this.useRawValueToEscape=x!==void 0?x:!1,this.prefix=k?M(k):j||"{{",this.suffix=I?M(I):z||"}}",this.formatSeparator=b||",",this.unescapePrefix=Y?"":re||"-",this.unescapeSuffix=this.unescapePrefix?"":Y||"",this.nestingPrefix=U?M(U):pe||M("$t("),this.nestingSuffix=Le?M(Le):Ve||M(")"),this.nestingOptionsSeparator=Ie||",",this.maxReplaces=Je||1e3,this.alwaysFormat=Xe!==void 0?Xe:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const c=(h,g)=>h&&h.source===g?(h.lastIndex=0,h):new RegExp(g,"g");this.regexp=c(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=c(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=c(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(c,h,g,x){let k,j,I;const z=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},b=pe=>{if(pe.indexOf(this.formatSeparator)<0){const Je=Z(h,z,pe,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Je,void 0,g,{...x,...h,interpolationkey:pe}):Je}const Le=pe.split(this.formatSeparator),Ve=Le.shift().trim(),Ie=Le.join(this.formatSeparator).trim();return this.format(Z(h,z,Ve,this.options.keySeparator,this.options.ignoreJSONStructure),Ie,g,{...x,...h,interpolationkey:Ve})};this.resetRegExp();const Y=x&&x.missingInterpolationHandler||this.options.missingInterpolationHandler,re=x&&x.interpolation&&x.interpolation.skipOnVariables!==void 0?x.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:pe=>K(pe)},{regex:this.regexp,safeValue:pe=>this.escapeValue?K(this.escape(pe)):K(pe)}].forEach(pe=>{for(I=0;k=pe.regex.exec(c);){const Le=k[1].trim();if(j=b(Le),j===void 0)if(typeof Y=="function"){const Ie=Y(c,k,x);j=r(Ie)?Ie:""}else if(x&&Object.prototype.hasOwnProperty.call(x,Le))j="";else if(re){j=k[0];continue}else this.logger.warn(`missed to pass in variable ${Le} for interpolating ${c}`),j="";else!r(j)&&!this.useRawValueToEscape&&(j=o(j));const Ve=pe.safeValue(j);if(c=c.replace(k[0],Ve),re?(pe.regex.lastIndex+=j.length,pe.regex.lastIndex-=k[0].length):pe.regex.lastIndex=0,I++,I>=this.maxReplaces)break}}),c}nest(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x,k,j;const I=(z,b)=>{const Y=this.nestingOptionsSeparator;if(z.indexOf(Y)<0)return z;const re=z.split(new RegExp(`${Y}[ ]*{`));let U=`{${re[1]}`;z=re[0],U=this.interpolate(U,j);const pe=U.match(/'/g),Le=U.match(/"/g);(pe&&pe.length%2===0&&!Le||Le.length%2!==0)&&(U=U.replace(/'/g,'"'));try{j=JSON.parse(U),b&&(j={...b,...j})}catch(Ve){return this.logger.warn(`failed parsing options string in nesting for key ${z}`,Ve),`${z}${Y}${U}`}return j.defaultValue&&j.defaultValue.indexOf(this.prefix)>-1&&delete j.defaultValue,z};for(;x=this.nestingRegexp.exec(c);){let z=[];j={...g},j=j.replace&&!r(j.replace)?j.replace:j,j.applyPostProcessor=!1,delete j.defaultValue;let b=!1;if(x[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(x[1])){const Y=x[1].split(this.formatSeparator).map(re=>re.trim());x[1]=Y.shift(),z=Y,b=!0}if(k=h(I.call(this,x[1].trim(),j),j),k&&x[0]===c&&!r(k))return k;r(k)||(k=o(k)),k||(this.logger.warn(`missed to resolve ${x[1]} for nesting ${c}`),k=""),b&&(k=z.reduce((Y,re)=>this.format(Y,re,g.lng,{...g,interpolationkey:x[1].trim()}),k.trim())),c=c.replace(x[0],k),this.regexp.lastIndex=0}return c}}const _e=S=>{let c=S.toLowerCase().trim();const h={};if(S.indexOf("(")>-1){const g=S.split("(");c=g[0].toLowerCase().trim();const x=g[1].substring(0,g[1].length-1);c==="currency"&&x.indexOf(":")<0?h.currency||(h.currency=x.trim()):c==="relativetime"&&x.indexOf(":")<0?h.range||(h.range=x.trim()):x.split(";").forEach(j=>{if(j){const[I,...z]=j.split(":"),b=z.join(":").trim().replace(/^'+|'+$/g,""),Y=I.trim();h[Y]||(h[Y]=b),b==="false"&&(h[Y]=!1),b==="true"&&(h[Y]=!0),isNaN(b)||(h[Y]=parseInt(b,10))}})}return{formatName:c,formatOptions:h}},Qe=S=>{const c={};return(h,g,x)=>{let k=x;x&&x.interpolationkey&&x.formatParams&&x.formatParams[x.interpolationkey]&&x[x.interpolationkey]&&(k={...k,[x.interpolationkey]:void 0});const j=g+JSON.stringify(k);let I=c[j];return I||(I=S(he(g),x),c[j]=I),I(h)}};class Tt{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=q.create("formatter"),this.options=c,this.formats={number:Qe((h,g)=>{const x=new Intl.NumberFormat(h,{...g});return k=>x.format(k)}),currency:Qe((h,g)=>{const x=new Intl.NumberFormat(h,{...g,style:"currency"});return k=>x.format(k)}),datetime:Qe((h,g)=>{const x=new Intl.DateTimeFormat(h,{...g});return k=>x.format(k)}),relativetime:Qe((h,g)=>{const x=new Intl.RelativeTimeFormat(h,{...g});return k=>x.format(k,g.range||"day")}),list:Qe((h,g)=>{const x=new Intl.ListFormat(h,{...g});return k=>x.format(k)})},this.init(c)}init(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=h.interpolation.formatSeparator||","}add(c,h){this.formats[c.toLowerCase().trim()]=h}addCached(c,h){this.formats[c.toLowerCase().trim()]=Qe(h)}format(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const k=h.split(this.formatSeparator);if(k.length>1&&k[0].indexOf("(")>1&&k[0].indexOf(")")<0&&k.find(I=>I.indexOf(")")>-1)){const I=k.findIndex(z=>z.indexOf(")")>-1);k[0]=[k[0],...k.splice(1,I)].join(this.formatSeparator)}return k.reduce((I,z)=>{const{formatName:b,formatOptions:Y}=_e(z);if(this.formats[b]){let re=I;try{const U=x&&x.formatParams&&x.formatParams[x.interpolationkey]||{},pe=U.locale||U.lng||x.locale||x.lng||g;re=this.formats[b](I,pe,{...Y,...x,...U})}catch(U){this.logger.warn(U)}return re}else this.logger.warn(`there was no format function for ${b}`);return I},c)}}const gt=(S,c)=>{S.pending[c]!==void 0&&(delete S.pending[c],S.pendingCount--)};class Zi extends oe{constructor(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=c,this.store=h,this.services=g,this.languageUtils=g.languageUtils,this.options=x,this.logger=q.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=x.maxParallelReads||10,this.readingCalls=0,this.maxRetries=x.maxRetries>=0?x.maxRetries:5,this.retryTimeout=x.retryTimeout>=1?x.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(g,x.backend,x)}queueLoad(c,h,g,x){const k={},j={},I={},z={};return c.forEach(b=>{let Y=!0;h.forEach(re=>{const U=`${b}|${re}`;!g.reload&&this.store.hasResourceBundle(b,re)?this.state[U]=2:this.state[U]<0||(this.state[U]===1?j[U]===void 0&&(j[U]=!0):(this.state[U]=1,Y=!1,j[U]===void 0&&(j[U]=!0),k[U]===void 0&&(k[U]=!0),z[re]===void 0&&(z[re]=!0)))}),Y||(I[b]=!0)}),(Object.keys(k).length||Object.keys(j).length)&&this.queue.push({pending:j,pendingCount:Object.keys(j).length,loaded:{},errors:[],callback:x}),{toLoad:Object.keys(k),pending:Object.keys(j),toLoadLanguages:Object.keys(I),toLoadNamespaces:Object.keys(z)}}loaded(c,h,g){const x=c.split("|"),k=x[0],j=x[1];h&&this.emit("failedLoading",k,j,h),!h&&g&&this.store.addResourceBundle(k,j,g,void 0,void 0,{skipCopy:!0}),this.state[c]=h?-1:2,h&&g&&(this.state[c]=0);const I={};this.queue.forEach(z=>{C(z.loaded,[k],j),gt(z,c),h&&z.errors.push(h),z.pendingCount===0&&!z.done&&(Object.keys(z.loaded).forEach(b=>{I[b]||(I[b]={});const Y=z.loaded[b];Y.length&&Y.forEach(re=>{I[b][re]===void 0&&(I[b][re]=!0)})}),z.done=!0,z.errors.length?z.callback(z.errors):z.callback())}),this.emit("loaded",I),this.queue=this.queue.filter(z=>!z.done)}read(c,h,g){let x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,j=arguments.length>5?arguments[5]:void 0;if(!c.length)return j(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:c,ns:h,fcName:g,tried:x,wait:k,callback:j});return}this.readingCalls++;const I=(b,Y)=>{if(this.readingCalls--,this.waitingReads.length>0){const re=this.waitingReads.shift();this.read(re.lng,re.ns,re.fcName,re.tried,re.wait,re.callback)}if(b&&Y&&x<this.maxRetries){setTimeout(()=>{this.read.call(this,c,h,g,x+1,k*2,j)},k);return}j(b,Y)},z=this.backend[g].bind(this.backend);if(z.length===2){try{const b=z(c,h);b&&typeof b.then=="function"?b.then(Y=>I(null,Y)).catch(I):I(null,b)}catch(b){I(b)}return}return z(c,h,I)}prepareLoading(c,h){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=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."),x&&x();r(c)&&(c=this.languageUtils.toResolveHierarchy(c)),r(h)&&(h=[h]);const k=this.queueLoad(c,h,g,x);if(!k.toLoad.length)return k.pending.length||x(),null;k.toLoad.forEach(j=>{this.loadOne(j)})}load(c,h,g){this.prepareLoading(c,h,{},g)}reload(c,h,g){this.prepareLoading(c,h,{reload:!0},g)}loadOne(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const g=c.split("|"),x=g[0],k=g[1];this.read(x,k,"read",void 0,void 0,(j,I)=>{j&&this.logger.warn(`${h}loading namespace ${k} for language ${x} failed`,j),!j&&I&&this.logger.log(`${h}loaded namespace ${k} for language ${x}`,I),this.loaded(c,j,I)})}saveMissing(c,h,g,x,k){let j=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},I=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(h)){this.logger.warn(`did not save key "${g}" as the namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(g==null||g==="")){if(this.backend&&this.backend.create){const z={...j,isUpdate:k},b=this.backend.create.bind(this.backend);if(b.length<6)try{let Y;b.length===5?Y=b(c,h,g,x,z):Y=b(c,h,g,x),Y&&typeof Y.then=="function"?Y.then(re=>I(null,re)).catch(I):I(null,Y)}catch(Y){I(Y)}else b(c,h,g,x,I,z)}!c||!c[0]||this.store.addResource(c[0],h,g,x)}}}const Vt=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:S=>{let c={};if(typeof S[1]=="object"&&(c=S[1]),r(S[1])&&(c.defaultValue=S[1]),r(S[2])&&(c.tDescription=S[2]),typeof S[2]=="object"||typeof S[3]=="object"){const h=S[3]||S[2];Object.keys(h).forEach(g=>{c[g]=h[g]})}return c},interpolation:{escapeValue:!0,format:S=>S,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),jt=S=>(r(S.ns)&&(S.ns=[S.ns]),r(S.fallbackLng)&&(S.fallbackLng=[S.fallbackLng]),r(S.fallbackNS)&&(S.fallbackNS=[S.fallbackNS]),S.supportedLngs&&S.supportedLngs.indexOf("cimode")<0&&(S.supportedLngs=S.supportedLngs.concat(["cimode"])),S),Tn=()=>{},Gi=S=>{Object.getOwnPropertyNames(Object.getPrototypeOf(S)).forEach(h=>{typeof S[h]=="function"&&(S[h]=S[h].bind(S))})};class Rt extends oe{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;if(super(),this.options=jt(c),this.services={},this.logger=q,this.modules={external:[]},Gi(this),h&&!this.isInitialized&&!c.isClone){if(!this.options.initImmediate)return this.init(c,h),this;setTimeout(()=>{this.init(c,h)},0)}}init(){var c=this;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof h=="function"&&(g=h,h={}),!h.defaultNS&&h.defaultNS!==!1&&h.ns&&(r(h.ns)?h.defaultNS=h.ns:h.ns.indexOf("translation")<0&&(h.defaultNS=h.ns[0]));const x=Vt();this.options={...x,...this.options,...jt(h)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...x.interpolation,...this.options.interpolation}),h.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=h.keySeparator),h.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=h.nsSeparator);const k=Y=>Y?typeof Y=="function"?new Y:Y:null;if(!this.options.isClone){this.modules.logger?q.init(k(this.modules.logger),this.options):q.init(null,this.options);let Y;this.modules.formatter?Y=this.modules.formatter:typeof Intl<"u"&&(Y=Tt);const re=new ye(this.options);this.store=new Pe(this.options.resources,this.options);const U=this.services;U.logger=q,U.resourceStore=this.store,U.languageUtils=re,U.pluralResolver=new ee(re,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),Y&&(!this.options.interpolation.format||this.options.interpolation.format===x.interpolation.format)&&(U.formatter=k(Y),U.formatter.init(U,this.options),this.options.interpolation.format=U.formatter.format.bind(U.formatter)),U.interpolator=new ne(this.options),U.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},U.backendConnector=new Zi(k(this.modules.backend),U.resourceStore,U,this.options),U.backendConnector.on("*",function(pe){for(var Le=arguments.length,Ve=new Array(Le>1?Le-1:0),Ie=1;Ie<Le;Ie++)Ve[Ie-1]=arguments[Ie];c.emit(pe,...Ve)}),this.modules.languageDetector&&(U.languageDetector=k(this.modules.languageDetector),U.languageDetector.init&&U.languageDetector.init(U,this.options.detection,this.options)),this.modules.i18nFormat&&(U.i18nFormat=k(this.modules.i18nFormat),U.i18nFormat.init&&U.i18nFormat.init(this)),this.translator=new ke(this.services,this.options),this.translator.on("*",function(pe){for(var Le=arguments.length,Ve=new Array(Le>1?Le-1:0),Ie=1;Ie<Le;Ie++)Ve[Ie-1]=arguments[Ie];c.emit(pe,...Ve)}),this.modules.external.forEach(pe=>{pe.init&&pe.init(this)})}if(this.format=this.options.interpolation.format,g||(g=Tn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const Y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Y.length>0&&Y[0]!=="dev"&&(this.options.lng=Y[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(Y=>{this[Y]=function(){return c.store[Y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(Y=>{this[Y]=function(){return c.store[Y](...arguments),c}});const z=i(),b=()=>{const Y=(re,U)=>{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),z.resolve(U),g(re,U)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return Y(null,this.t.bind(this));this.changeLanguage(this.options.lng,Y)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),z}loadResources(c){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tn;const x=r(c)?c:this.language;if(typeof c=="function"&&(g=c),!this.options.resources||this.options.partialBundledLanguages){if(x&&x.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return g();const k=[],j=I=>{if(!I||I==="cimode")return;this.services.languageUtils.toResolveHierarchy(I).forEach(b=>{b!=="cimode"&&k.indexOf(b)<0&&k.push(b)})};x?j(x):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(z=>j(z)),this.options.preload&&this.options.preload.forEach(I=>j(I)),this.services.backendConnector.load(k,this.options.ns,I=>{!I&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),g(I)})}else g(null)}reloadResources(c,h,g){const x=i();return typeof c=="function"&&(g=c,c=void 0),typeof h=="function"&&(g=h,h=void 0),c||(c=this.languages),h||(h=this.options.ns),g||(g=Tn),this.services.backendConnector.reload(c,h,k=>{x.resolve(),g(k)}),x}use(c){if(!c)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!c.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return c.type==="backend"&&(this.modules.backend=c),(c.type==="logger"||c.log&&c.warn&&c.error)&&(this.modules.logger=c),c.type==="languageDetector"&&(this.modules.languageDetector=c),c.type==="i18nFormat"&&(this.modules.i18nFormat=c),c.type==="postProcessor"&&xe.addPostProcessor(c),c.type==="formatter"&&(this.modules.formatter=c),c.type==="3rdParty"&&this.modules.external.push(c),this}setResolvedLanguage(c){if(!(!c||!this.languages)&&!(["cimode","dev"].indexOf(c)>-1))for(let h=0;h<this.languages.length;h++){const g=this.languages[h];if(!(["cimode","dev"].indexOf(g)>-1)&&this.store.hasLanguageSomeTranslations(g)){this.resolvedLanguage=g;break}}}changeLanguage(c,h){var g=this;this.isLanguageChangingTo=c;const x=i();this.emit("languageChanging",c);const k=z=>{this.language=z,this.languages=this.services.languageUtils.toResolveHierarchy(z),this.resolvedLanguage=void 0,this.setResolvedLanguage(z)},j=(z,b)=>{b?(k(b),this.translator.changeLanguage(b),this.isLanguageChangingTo=void 0,this.emit("languageChanged",b),this.logger.log("languageChanged",b)):this.isLanguageChangingTo=void 0,x.resolve(function(){return g.t(...arguments)}),h&&h(z,function(){return g.t(...arguments)})},I=z=>{!c&&!z&&this.services.languageDetector&&(z=[]);const b=r(z)?z:this.services.languageUtils.getBestMatchFromCodes(z);b&&(this.language||k(b),this.translator.language||this.translator.changeLanguage(b),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(b)),this.loadResources(b,Y=>{j(Y,b)})};return!c&&this.services.languageDetector&&!this.services.languageDetector.async?I(this.services.languageDetector.detect()):!c&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(I):this.services.languageDetector.detect(I):I(c),x}getFixedT(c,h,g){var x=this;const k=function(j,I){let z;if(typeof I!="object"){for(var b=arguments.length,Y=new Array(b>2?b-2:0),re=2;re<b;re++)Y[re-2]=arguments[re];z=x.options.overloadTranslationOptionHandler([j,I].concat(Y))}else z={...I};z.lng=z.lng||k.lng,z.lngs=z.lngs||k.lngs,z.ns=z.ns||k.ns,z.keyPrefix!==""&&(z.keyPrefix=z.keyPrefix||g||k.keyPrefix);const U=x.options.keySeparator||".";let pe;return z.keyPrefix&&Array.isArray(j)?pe=j.map(Le=>`${z.keyPrefix}${U}${Le}`):pe=z.keyPrefix?`${z.keyPrefix}${U}${j}`:j,x.t(pe,z)};return r(c)?k.lng=c:k.lngs=c,k.ns=h,k.keyPrefix=g,k}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(c){this.options.defaultNS=c}hasLoadedNamespace(c){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const g=h.lng||this.resolvedLanguage||this.languages[0],x=this.options?this.options.fallbackLng:!1,k=this.languages[this.languages.length-1];if(g.toLowerCase()==="cimode")return!0;const j=(I,z)=>{const b=this.services.backendConnector.state[`${I}|${z}`];return b===-1||b===0||b===2};if(h.precheck){const I=h.precheck(this,j);if(I!==void 0)return I}return!!(this.hasResourceBundle(g,c)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||j(g,c)&&(!x||j(k,c)))}loadNamespaces(c,h){const g=i();return this.options.ns?(r(c)&&(c=[c]),c.forEach(x=>{this.options.ns.indexOf(x)<0&&this.options.ns.push(x)}),this.loadResources(x=>{g.resolve(),h&&h(x)}),g):(h&&h(),Promise.resolve())}loadLanguages(c,h){const g=i();r(c)&&(c=[c]);const x=this.options.preload||[],k=c.filter(j=>x.indexOf(j)<0&&this.services.languageUtils.isSupportedCode(j));return k.length?(this.options.preload=x.concat(k),this.loadResources(j=>{g.resolve(),h&&h(j)}),g):(h&&h(),Promise.resolve())}dir(c){if(c||(c=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!c)return"rtl";const h=["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"],g=this.services&&this.services.languageUtils||new ye(Vt());return h.indexOf(g.getLanguagePartFromCode(c))>-1||c.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;return new Rt(c,h)}cloneInstance(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tn;const g=c.forkResourceStore;g&&delete c.forkResourceStore;const x={...this.options,...c,isClone:!0},k=new Rt(x);return(c.debug!==void 0||c.prefix!==void 0)&&(k.logger=k.logger.clone(c)),["store","services","language"].forEach(I=>{k[I]=this[I]}),k.services={...this.services},k.services.utils={hasLoadedNamespace:k.hasLoadedNamespace.bind(k)},g&&(k.store=new Pe(this.store.data,x),k.services.resourceStore=k.store),k.translator=new ke(k.services,x),k.translator.on("*",function(I){for(var z=arguments.length,b=new Array(z>1?z-1:0),Y=1;Y<z;Y++)b[Y-1]=arguments[Y];k.emit(I,...b)}),k.init(x,h),k.translator.options=x,k.translator.backendConnector.services.utils={hasLoadedNamespace:k.hasLoadedNamespace.bind(k)},k}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Pr=Rt.createInstance();return Pr.createInstance=Rt.createInstance,Ji=Pr,Ji}const Wh=[{code:"af",label:"Afrikaans"},{code:"ar",label:"Arabic"},{code:"bg",label:"Bulgarian"},{code:"bn",label:"Bengali"},{code:"bs",label:"Bosnian"},{code:"ca",label:"Catalan"},{code:"cs",label:"Czech"},{code:"da",label:"Danish"},{code:"de",label:"German"},{code:"de-CH",label:"Swiss German"},{code:"el",label:"Greek"},{code:"en",label:"English"},{code:"eo",label:"Esperanto"},{code:"es",label:"Spanish"},{code:"et",label:"Estonian"},{code:"eu",label:"Basque"},{code:"fa",label:"Persian/Farsi"},{code:"fi",label:"Finnish"},{code:"fr",label:"French"},{code:"gd",label:"Gaelic (Scottish)"},{code:"he",label:"Hebrew"},{code:"hi",label:"Hindi"},{code:"hr",label:"Croatian"},{code:"hu",label:"Hungarian"},{code:"id",label:"Indonesian"},{code:"is",label:"Icelandic"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"kz",label:"Kazakh"},{code:"lt",label:"Lithuanian"},{code:"lv",label:"Latvian"},{code:"mk",label:"Macedonian"},{code:"mn",label:"Mongolian"},{code:"ms",label:"Malay"},{code:"nb",label:"Norwegian Bokmål"},{code:"ne",label:"Nepali"},{code:"nl",label:"Dutch"},{code:"nn",label:"Norwegian Nynorsk"},{code:"pa",label:"Punjabi"},{code:"pl",label:"Polish"},{code:"pt",label:"Portuguese"},{code:"pt-BR",label:"Portuguese (Brazil)"},{code:"ro",label:"Romanian"},{code:"ru",label:"Russian"},{code:"si",label:"Sinhala"},{code:"sk",label:"Slovak"},{code:"sl",label:"Slovenian"},{code:"sq",label:"Albanian"},{code:"sr",label:"Serbian"},{code:"sr-Cyrl",label:"Serbian (Cyrillic)"},{code:"sv",label:"Swedish"},{code:"sw",label:"Swahili"},{code:"ta",label:"Tamil"},{code:"th",label:"Thai"},{code:"tr",label:"Turkish"},{code:"uk",label:"Ukrainian"},{code:"ur",label:"Urdu"},{code:"uz",label:"Uzbek"},{code:"vi",label:"Vietnamese"},{code:"zh",label:"Chinese"},{code:"zh-Hant",label:"Traditional Chinese"}];var Xi,hu;function Qh(){if(hu)return Xi;hu=1;const r=Kh(),i=Wh,o=i.map(d=>d.code);function l(d,m){return d.reduce((v,y)=>{let C;try{C=au("/ghost/i18n/lib")(`../locales/${y}/${m}.json`)}catch{C=au("/ghost/i18n/lib")(`../locales/en/${m}.json`)}return v[y]={[m]:{...C,...C.default&&typeof C.default=="object"?C.default:{}}},v},{})}function a({generateThemeResources:d}){return(m="en",v="portal",y={})=>{const C=r.createInstance(),E={prefix:"{",suffix:"}"};(v==="theme"||v==="portal")&&(E.escapeValue=!1);let L;return v!=="theme"?L=l(o,v):L=d(m,y),C.init({lng:m,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:{no:["nb","en"],default:["en"]},ns:v,defaultNS:v,interpolation:E,resources:L}),C}}return Xi={createI18n:a,generateResources:l,LOCALE_DATA:i,SUPPORTED_LOCALES:o},Xi}var du;function Yh(){if(du)return Jn.exports;du=1;const{createI18n:r,generateResources:i,LOCALE_DATA:o,SUPPORTED_LOCALES:l}=Qh();function a(m){return{[m]:{theme:{}}}}const d=r({generateThemeResources:a});return Jn.exports=d,Jn.exports.SUPPORTED_LOCALES=l,Jn.exports.LOCALE_DATA=o,Jn.exports.generateResources=i,Jn.exports}var pu;function Jh(){if(pu)return En.exports;pu=1;const r=Yh();return En.exports=r,En.exports.default=r,En.exports.LOCALE_DATA=r.LOCALE_DATA,En.exports.SUPPORTED_LOCALES=r.SUPPORTED_LOCALES,En.exports.generateResources=r.generateResources,En.exports}var Xh=Jh();const Zh=$i(Xh);class Gh extends Xt.Component{constructor(i){super(i);const o=this.props.locale||"en",l=Zh(o,"search"),a=l.dir()||"ltr",d=new If({adminUrl:i.adminUrl,apiKey:i.apiKey,dir:a});this.state={searchIndex:d,showPopup:!1,indexStarted:!1,indexComplete:!1,t:l.t,dir:a,scrollbarWidth:0},this.inputRef=Xt.createRef()}componentDidMount(){const i=this.getScrollbarWidth();this.setState({scrollbarWidth:i}),this.initSetup()}componentDidUpdate(i,o){if(o.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=window.document?.body?.style?.overflow,this.bodyMargin=window.getComputedStyle(document.body).getPropertyValue("margin-right"),window.document.body.style.overflow="hidden",this.state.scrollbarWidth&&document.body.scrollHeight>window.innerHeight&&(window.document.body.style.marginRight=`calc(${this.bodyMargin} + ${this.state.scrollbarWidth}px)`)):(window.document.body.style.overflow=this.bodyScroll||"",!this.bodyMargin||this.bodyMargin==="0px"?window.document.body.style.marginRight="":window.document.body.style.marginRight=this.bodyMargin)}catch{}this.state.showPopup!==o?.showPopup&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}getScrollbarWidth(){const i=document.createElement("div");i.style.visibility="hidden",i.style.overflow="scroll",document.body.appendChild(i);const o=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),o}setupCustomTriggerButton(){this.clickHandler=i=>{i.preventDefault(),this.setState({showPopup:!0});const o=document.createElement("input");o.style.opacity="0",o.style.position="fixed",o.style.top="0",document.body.appendChild(o),o.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(o)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(i=>{i.removeEventListener("click",this.clickHandler),i.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){return document.querySelectorAll("[data-ghost-search]")||[]}handleSearchUrl(){const[i]=window.location.hash.substr(1).split("?");(i==="/search"||i==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){this.getCustomTriggerButtons()?.length&&(this.handleKeyDown=o=>{if(o.key==="k"&&o.metaKey)return this.setState({showPopup:!0}),o.preventDefault(),o.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return G.jsx(nt.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(i,o)=>{i==="update"&&this.setState({...this.state,...o})},t:this.state.t,dir:this.state.dir},children:G.jsx(df,{})})}}const gu="sodo-search-root";function qh(){const r=document.createElement("div");r.id=gu,document.body.appendChild(r)}function ed(){const r=document.querySelector("script[data-sodo-search]");if(r){const i=r.dataset.sodoSearch,o=r.dataset.key,l=r.dataset.styles,a=r.dataset.locale||"en";return{adminUrl:i,apiKey:o,stylesUrl:l,locale:a}}return{}}function td(){qh()}function nd(){const{adminUrl:r,apiKey:i,stylesUrl:o,locale:l}=ed(),a=(r||window.location.origin)?.replace(/\/+$/,"");td(),Uc.render(G.jsx(Xt.StrictMode,{children:G.jsx(Gh,{adminUrl:a,apiKey:i,stylesUrl:o,locale:l})}),document.getElementById(gu))}nd();const rd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}))}));
|