ode-explorer 1.3.2-dev.202401241042 → 1.3.2-dev.202401241102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- var Nt=Object.defineProperty;var At=(r,e,t)=>e in r?Nt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var te=(r,e,t)=>(At(r,typeof e!="symbol"?e+"":e,t),t);import{u as Ft,a as G,j as m,I as $t,b as _t,c as z,d as Q,e as X,f as kt,g as Ut,L as H,F as Bt,h as qt,S as Vt,D as se,i as Mt,T as Ht,B as Kt,k as zt,l as Qe,A as Qt,m as Jt,G as Ae,n as Wt,Q as Xt,o as Gt,p as Yt,O as Zt,q as es}from"./edifice-react.js";import{c as ue,g as ht,i as ts,a as ss,r as v,b as rs,u as oe}from"./react.js";import{s as ns,t as is,f as os,u as as}from"./edifice-icons.js";import{odeServices as V,FOLDER as q,APP as Fe}from"/assets/js/edifice-ts-client/index.js";function ls(r,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in r)){const i=Object.getOwnPropertyDescriptor(s,n);i&&Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:()=>s[n]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();const us="modulepreload",cs=function(r){return"/"+r},Je={},k=function(e,t,s){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=cs(i),i in Je)return;Je[i]=!0;const o=i.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!s)for(let f=n.length-1;f>=0;f--){const d=n[f];if(d.href===i&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":us,o||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),o)return new Promise((f,d)=>{c.addEventListener("load",f),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},fs={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){console&&console[r]&&console[r].apply(console,e)}};class Se{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fs,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Se(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Se(this.logger,e)}}var K=new Se;class Ee{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]=this.observers[s]||[],this.observers[s].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(s=>s!==t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(o=>{o(...s)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[e,...s])})}}function le(){let r,e;const t=new Promise((s,n)=>{r=s,e=n});return t.resolve=r,t.reject=e,t}function We(r){return r==null?"":""+r}function ds(r,e,t){r.forEach(s=>{e[s]&&(t[s]=e[s])})}function Ve(r,e,t){function s(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function n(){return!r||typeof r=="string"}const i=typeof e!="string"?[].concat(e):e.split(".");for(;i.length>1;){if(n())return{};const o=s(i.shift());!r[o]&&t&&(r[o]=new t),Object.prototype.hasOwnProperty.call(r,o)?r=r[o]:r={}}return n()?{}:{obj:r,k:s(i.shift())}}function Xe(r,e,t){const{obj:s,k:n}=Ve(r,e,Object);s[n]=t}function hs(r,e,t,s){const{obj:n,k:i}=Ve(r,e,Object);n[i]=n[i]||[],s&&(n[i]=n[i].concat(t)),s||n[i].push(t)}function ve(r,e){const{obj:t,k:s}=Ve(r,e);if(t)return t[s]}function ps(r,e,t){const s=ve(r,t);return s!==void 0?s:ve(e,t)}function pt(r,e,t){for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in r?typeof r[s]=="string"||r[s]instanceof String||typeof e[s]=="string"||e[s]instanceof String?t&&(r[s]=e[s]):pt(r[s],e[s],t):r[s]=e[s]);return r}function re(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var gs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ms(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,e=>gs[e]):r}const ys=[" ",",","?","!",";"];function bs(r,e,t){e=e||"",t=t||"";const s=ys.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(s.length===0)return!0;const n=new RegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!n.test(r);if(!i){const o=r.indexOf(t);o>0&&!n.test(r.substring(0,o))&&(i=!0)}return i}function we(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[e])return r[e];const s=e.split(t);let n=r;for(let i=0;i<s.length;++i){if(!n||typeof n[s[i]]=="string"&&i+1<s.length)return;if(n[s[i]]===void 0){let o=2,a=s.slice(i,i+o).join(t),l=n[a];for(;l===void 0&&s.length>i+o;)o++,a=s.slice(i,i+o).join(t),l=n[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}const c=s.slice(i+o).join(t);return c?we(l,c,t):void 0}n=n[s[i]]}return n}function Oe(r){return r&&r.indexOf("_")>0?r.replace("_","-"):r}class Ge extends Ee{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,o=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a=[e,t];s&&typeof s!="string"&&(a=a.concat(s)),s&&typeof s=="string"&&(a=a.concat(i?s.split(i):s)),e.indexOf(".")>-1&&(a=e.split("."));const l=ve(this.data,a);return l||!o||typeof s!="string"?l:we(this.data&&this.data[e]&&this.data[e][t],s,i)}addResource(e,t,s,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),Xe(this.data,a,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in s)(typeof s[i]=="string"||Object.prototype.toString.apply(s[i])==="[object Array]")&&this.addResource(e,t,i,s[i],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=s,s=t,t=a[1]),this.addNamespaces(t);let l=ve(this.data,a)||{};n?pt(l,s,i):l={...l,...s},Xe(this.data,a,l),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var gt={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,s,n){return r.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,t,s,n))}),e}};const Ye={};class Re extends Ee{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),ds(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=K.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=s&&e.indexOf(s)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!bs(e,s,n);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};const c=e.split(s);(s!==n||s===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const n=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],c=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(f){const O=t.nsSeparator||this.options.nsSeparator;return n?{res:`${l}${O}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${O}${o}`}return n?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let u=d&&d.res;const p=d&&d.usedKey||o,g=d&&d.exactUsedKey||o,b=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],w=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject;if(P&&u&&(typeof u!="string"&&typeof u!="boolean"&&typeof u!="number")&&x.indexOf(b)<0&&!(typeof w=="string"&&b==="[object Array]")){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,u,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return n?(d.res=O,d.usedParams=this.getUsedParamsDetails(t),d):O}if(i){const O=b==="[object Array]",C=O?[]:{},L=O?g:p;for(const E in u)if(Object.prototype.hasOwnProperty.call(u,E)){const T=`${L}${i}${E}`;C[E]=this.translate(T,{...t,joinArrays:!1,ns:a}),C[E]===T&&(C[E]=u[E])}u=C}}else if(P&&typeof w=="string"&&b==="[object Array]")u=u.join(w),u&&(u=this.extendTranslation(u,e,t,s));else{let O=!1,C=!1;const L=t.count!==void 0&&typeof t.count!="string",E=Re.hasDefaultValue(t),T=L?this.pluralResolver.getSuffix(c,t.count,t):"",N=t.ordinal&&L?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",Y=t[`defaultValue${T}`]||t[`defaultValue${N}`]||t.defaultValue;!this.isValidLookup(u)&&E&&(O=!0,u=Y),this.isValidLookup(u)||(C=!0,u=o);const B=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:u,Z=E&&Y!==u&&this.options.updateMissing;if(C||O||Z){if(this.logger.log(Z?"updateKey":"missingKey",c,l,o,Z?Y:u),i){const S=this.resolve(o,{...t,keySeparator:!1});S&&S.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 J=[];const h=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&h&&h[0])for(let S=0;S<h.length;S++)J.push(h[S]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(t.lng||this.language):J.push(t.lng||this.language);const y=(S,I,j)=>{const R=E&&j!==u?j:B;this.options.missingKeyHandler?this.options.missingKeyHandler(S,l,I,R,Z,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(S,l,I,R,Z,t),this.emit("missingKey",S,l,I,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&L?J.forEach(S=>{this.pluralResolver.getSuffixes(S,t).forEach(I=>{y([S],o+I,t[`defaultValue${I}`]||Y)})}):y(J,o,Y))}u=this.extendTranslation(u,e,t,d,s),C&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${o}`),(C||O)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,O?u:void 0):u=this.options.parseMissingKeyHandler(u))}return n?(d.res=u,d.usedParams=this.getUsedParamsDetails(t),d):u}extendTranslation(e,t,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=typeof e=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const u=e.match(this.interpolator.nestingRegexp);f=u&&u.length}let d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,s.lng||this.language,s),c){const u=e.match(this.interpolator.nestingRegexp),p=u&&u.length;f<p&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(s.lng=n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var u=arguments.length,p=new Array(u),g=0;g<u;g++)p[g]=arguments[g];return i&&i[0]===p[0]&&!s.context?(o.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):o.translate(...p,t)},s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,l=typeof a=="string"?[a]:a;return e!=null&&l&&l.length&&s.applyPostProcessor!==!1&&(e=gt.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,n,i,o,a;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(l,t),f=c.key;n=f;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const u=t.count!==void 0&&typeof t.count!="string",p=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),g=t.context!==void 0&&(typeof t.context=="string"||typeof t.context=="number")&&t.context!=="",b=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);d.forEach(x=>{this.isValidLookup(s)||(a=x,!Ye[`${b[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Ye[`${b[0]}-${x}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(w=>{if(this.isValidLookup(s))return;o=w;const P=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(P,f,w,x,t);else{let O;u&&(O=this.pluralResolver.getSuffix(w,t.count,t));const C=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(P.push(f+O),t.ordinal&&O.indexOf(L)===0&&P.push(f+O.replace(L,this.options.pluralSeparator)),p&&P.push(f+C)),g){const E=`${f}${this.options.contextSeparator}${t.context}`;P.push(E),u&&(P.push(E+O),t.ordinal&&O.indexOf(L)===0&&P.push(E+O.replace(L,this.options.pluralSeparator)),p&&P.push(E+C))}}let D;for(;D=P.pop();)this.isValidLookup(s)||(i=D,s=this.getResource(w,x,D,t))}))})}),{res:s,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&typeof e.replace!="string";let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const i of t)delete n[i]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}function $e(r){return r.charAt(0).toUpperCase()+r.slice(1)}class Ze{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create("languageUtils")}getScriptPartFromCode(e){if(e=Oe(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Oe(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(n=>n.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=$e(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=$e(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=$e(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getLanguagePartFromCode(s);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(i=>{if(i===n)return i;if(!(i.indexOf("-")<0&&n.indexOf("-")<0)&&i.indexOf(n)===0)return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],i=o=>{o&&(this.isSupportedCode(o)?n.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),s.forEach(o=>{n.indexOf(o)<0&&i(this.formatLanguageCode(o))}),n}}let xs=[{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}],Ss={1:function(r){return+(r>1)},2:function(r){return+(r!=1)},3:function(r){return 0},4:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},5:function(r){return r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5},6:function(r){return r==1?0:r>=2&&r<=4?1:2},7:function(r){return r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},8:function(r){return r==1?0:r==2?1:r!=8&&r!=11?2:3},9:function(r){return+(r>=2)},10:function(r){return r==1?0:r==2?1:r<7?2:r<11?3:4},11:function(r){return r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3},12:function(r){return+(r%10!=1||r%100==11)},13:function(r){return+(r!==0)},14:function(r){return r==1?0:r==2?1:r==3?2:3},15:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2},16:function(r){return r%10==1&&r%100!=11?0:r!==0?1:2},17:function(r){return r==1||r%10==1&&r%100!=11?0:1},18:function(r){return r==0?0:r==1?1:2},19:function(r){return r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3},20:function(r){return r==1?0:r==0||r%100>0&&r%100<20?1:2},21:function(r){return r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0},22:function(r){return r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3}};const vs=["v1","v2","v3"],ws=["v4"],et={zero:0,one:1,two:2,few:3,many:4,other:5};function Os(){const r={};return xs.forEach(e=>{e.lngs.forEach(t=>{r[t]={numbers:e.nr,plurals:Ss[e.fc]}})}),r}class Rs{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=K.create("pluralResolver"),(!this.options.compatibilityJSON||ws.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=Os()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Oe(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((n,i)=>et[n]-et[i]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):s.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(e,s);return n?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:this.getSuffixRetroCompatible(n,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let n=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!vs.includes(this.options.compatibilityJSON)}}function tt(r,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=ps(r,e,t);return!i&&n&&typeof t=="string"&&(i=we(r,t,s),i===void 0&&(i=we(e,t,s))),i}class Ps{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=K.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=t.escape!==void 0?t.escape:ms,this.escapeValue=t.escapeValue!==void 0?t.escapeValue:!0,this.useRawValueToEscape=t.useRawValueToEscape!==void 0?t.useRawValueToEscape:!1,this.prefix=t.prefix?re(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?re(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?re(t.nestingPrefix):t.nestingPrefixEscaped||re("$t("),this.nestingSuffix=t.nestingSuffix?re(t.nestingSuffix):t.nestingSuffixEscaped||re(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=t.alwaysFormat!==void 0?t.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(e,t,s,n){let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const f=g=>{if(g.indexOf(this.formatSeparator)<0){const P=tt(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(P,void 0,s,{...n,...t,interpolationkey:g}):P}const b=g.split(this.formatSeparator),x=b.shift().trim(),w=b.join(this.formatSeparator).trim();return this.format(tt(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,s,{...n,...t,interpolationkey:x})};this.resetRegExp();const d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(a=0;i=g.regex.exec(e);){const b=i[1].trim();if(o=f(b),o===void 0)if(typeof d=="function"){const w=d(e,i,n);o=typeof w=="string"?w:""}else if(n&&Object.prototype.hasOwnProperty.call(n,b))o="";else if(u){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=We(o));const x=g.safeValue(o);if(e=e.replace(i[0],x),u?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,i,o;function a(l,c){const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const d=l.split(new RegExp(`${f}[ ]*{`));let u=`{${d[1]}`;l=d[0],u=this.interpolate(u,o);const p=u.match(/'/g),g=u.match(/"/g);(p&&p.length%2===0&&!g||g.length%2!==0)&&(u=u.replace(/'/g,'"'));try{o=JSON.parse(u),c&&(o={...c,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,b),`${l}${f}${u}`}return delete o.defaultValue,l}for(;n=this.nestingRegexp.exec(e);){let l=[];o={...s},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const f=n[1].split(this.formatSeparator).map(d=>d.trim());n[1]=f.shift(),l=f,c=!0}if(i=t(a.call(this,n[1].trim(),o),o),i&&n[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=We(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),c&&(i=l.reduce((f,d)=>this.format(f,d,s.lng,{...s,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}function Is(r){let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const s=r.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(o=>{if(!o)return;const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");t[a.trim()]||(t[a.trim()]=c),c==="false"&&(t[a.trim()]=!1),c==="true"&&(t[a.trim()]=!0),isNaN(c)||(t[a.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:t}}function ne(r){const e={};return function(s,n,i){const o=n+JSON.stringify(i);let a=e[o];return a||(a=r(Oe(n),i),e[o]=a),a(s)}}class Es{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=K.create("formatter"),this.options=e,this.formats={number:ne((t,s)=>{const n=new Intl.NumberFormat(t,{...s});return i=>n.format(i)}),currency:ne((t,s)=>{const n=new Intl.NumberFormat(t,{...s,style:"currency"});return i=>n.format(i)}),datetime:ne((t,s)=>{const n=new Intl.DateTimeFormat(t,{...s});return i=>n.format(i)}),relativetime:ne((t,s)=>{const n=new Intl.RelativeTimeFormat(t,{...s});return i=>n.format(i,s.range||"day")}),list:ne((t,s)=>{const n=new Intl.ListFormat(t,{...s});return i=>n.format(i)})},this.init(e)}init(e){const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=s.formatSeparator?s.formatSeparator:s.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ne(t)}format(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return t.split(this.formatSeparator).reduce((a,l)=>{const{formatName:c,formatOptions:f}=Is(l);if(this.formats[c]){let d=a;try{const u=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},p=u.locale||u.lng||n.locale||n.lng||s;d=this.formats[c](a,p,{...f,...n,...u})}catch(u){this.logger.warn(u)}return d}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}function Ls(r,e){r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)}class js extends Ee{constructor(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=K.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,n.backend,n)}queueLoad(e,t,s,n){const i={},o={},a={},l={};return e.forEach(c=>{let f=!0;t.forEach(d=>{const u=`${c}|${d}`;!s.reload&&this.store.hasResourceBundle(c,d)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?o[u]===void 0&&(o[u]=!0):(this.state[u]=1,f=!1,o[u]===void 0&&(o[u]=!0),i[u]===void 0&&(i[u]=!0),l[d]===void 0&&(l[d]=!0)))}),f||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),s&&this.store.addResourceBundle(i,o,s),this.state[e]=t?-1:2;const a={};this.queue.forEach(l=>{hs(l.loaded,[i],o),Ls(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const f=l.loaded[c];f.length&&f.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:o});return}this.readingCalls++;const a=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&f&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,n+1,i*2,o)},i);return}o(c,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>a(null,f)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,t,a)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=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."),n&&n();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof t=="string"&&(t=[t]);const i=this.queueLoad(e,t,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,a),this.loaded(e,o,a)})}saveMissing(e,t,s,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let f;c.length===5?f=c(e,t,s,n,l):f=c(e,t,s,n),f&&typeof f.then=="function"?f.then(d=>a(null,d)).catch(a):a(null,f)}catch(f){a(f)}else c(e,t,s,n,a,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}function st(){return{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:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(n=>{t[n]=s[n]})}return t},interpolation:{escapeValue:!0,format:(r,e,t,s)=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function rt(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function be(){}function Cs(r){Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})}class ce extends Ee{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=rt(e),this.services={},this.logger=K,this.modules={external:[]},Cs(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(typeof t.ns=="string"?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=st();this.options={...n,...this.options,...rt(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);function i(f){return f?typeof f=="function"?new f:f:null}if(!this.options.isClone){this.modules.logger?K.init(i(this.modules.logger),this.options):K.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=Es);const d=new Ze(this.options);this.store=new Ge(this.options.resources,this.options);const u=this.services;u.logger=K,u.resourceStore=this.store,u.languageUtils=d,u.pluralResolver=new Rs(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=i(f),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Ps(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new js(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(p){for(var g=arguments.length,b=new Array(g>1?g-1:0),x=1;x<g;x++)b[x-1]=arguments[x];e.emit(p,...b)}),this.modules.languageDetector&&(u.languageDetector=i(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=i(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Re(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,b=new Array(g>1?g-1:0),x=1;x<g;x++)b[x-1]=arguments[x];e.emit(p,...b)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,s||(s=be),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const l=le(),c=()=>{const f=(d,u)=>{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),l.resolve(u),s(d,u)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;const n=typeof e=="string"?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};n?o(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(a)})}else s(null)}reloadResources(e,t,s){const n=le();return e||(e=this.languages),t||(t=this.options.ns),s||(s=be),this.services.backendConnector.reload(e,t,i=>{n.resolve(),s(i)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&gt.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const n=le();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve(function(){return s.t(...arguments)}),t&&t(l,function(){return s.t(...arguments)})},a=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,f=>{o(f,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,s){var n=this;const i=function(o,a){let l;if(typeof a!="object"){for(var c=arguments.length,f=new Array(c>2?c-2:0),d=2;d<c;d++)f[d-2]=arguments[d];l=n.options.overloadTranslationOptionHandler([o,a].concat(f))}else l={...a};l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix=l.keyPrefix||s||i.keyPrefix;const u=n.options.keySeparator||".";let p;return l.keyPrefix&&Array.isArray(o)?p=o.map(g=>`${l.keyPrefix}${u}${g}`):p=l.keyPrefix?`${l.keyPrefix}${u}${o}`:o,n.t(p,l)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=s,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=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 s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!n||o(i,e)))}loadNamespaces(e,t){const s=le();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=le();typeof e=="string"&&(e=[e]);const n=this.options.preload||[],i=e.filter(o=>n.indexOf(o)<0);return i.length?(this.options.preload=n.concat(i),this.loadResources(o=>{s.resolve(),t&&t(o)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["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"],s=this.services&&this.services.languageUtils||new Ze(st());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ce(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new ce(n);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s&&(i.store=new Ge(this.store.data,n),i.services.resourceStore=i.store),i.translator=new Re(i.services,n),i.translator.on("*",function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];i.emit(a,...c)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const F=ce.createInstance();F.createInstance=ce.createInstance;F.createInstance;F.dir;F.init;F.loadResources;F.reloadResources;F.use;F.changeLanguage;F.getFixedT;const _=F.t;F.exists;F.setDefaultNamespace;F.hasLoadedNamespace;F.loadNamespaces;F.loadLanguages;function ke(r){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(r)}var mt=[],Ds=mt.forEach,Ts=mt.slice;function Ue(r){return Ds.call(Ts.call(arguments,1),function(e){if(e)for(var t in e)r[t]===void 0&&(r[t]=e[t])}),r}function yt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":ke(XMLHttpRequest))==="object"}function Ns(r){return!!r&&typeof r.then=="function"}function As(r){return Ns(r)?r:Promise.resolve(r)}function Fs(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Be={exports:{}},xe={exports:{}},nt;function $s(){return nt||(nt=1,function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ue<"u"&&ue,s=function(){function i(){this.fetch=!1,this.DOMException=t.DOMException}return i.prototype=t,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(h){return h&&DataView.prototype.isPrototypeOf(h)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function u(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}function p(h){return typeof h!="string"&&(h=String(h)),h}function g(h){var y={next:function(){var S=h.shift();return{done:S===void 0,value:S}}};return l.iterable&&(y[Symbol.iterator]=function(){return y}),y}function b(h){this.map={},h instanceof b?h.forEach(function(y,S){this.append(S,y)},this):Array.isArray(h)?h.forEach(function(y){this.append(y[0],y[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(y){this.append(y,h[y])},this)}b.prototype.append=function(h,y){h=u(h),y=p(y);var S=this.map[h];this.map[h]=S?S+", "+y:y},b.prototype.delete=function(h){delete this.map[u(h)]},b.prototype.get=function(h){return h=u(h),this.has(h)?this.map[h]:null},b.prototype.has=function(h){return this.map.hasOwnProperty(u(h))},b.prototype.set=function(h,y){this.map[u(h)]=p(y)},b.prototype.forEach=function(h,y){for(var S in this.map)this.map.hasOwnProperty(S)&&h.call(y,this.map[S],S,this)},b.prototype.keys=function(){var h=[];return this.forEach(function(y,S){h.push(S)}),g(h)},b.prototype.values=function(){var h=[];return this.forEach(function(y){h.push(y)}),g(h)},b.prototype.entries=function(){var h=[];return this.forEach(function(y,S){h.push([S,y])}),g(h)},l.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function w(h){return new Promise(function(y,S){h.onload=function(){y(h.result)},h.onerror=function(){S(h.error)}})}function P(h){var y=new FileReader,S=w(y);return y.readAsArrayBuffer(h),S}function D(h){var y=new FileReader,S=w(y);return y.readAsText(h),S}function O(h){for(var y=new Uint8Array(h),S=new Array(y.length),I=0;I<y.length;I++)S[I]=String.fromCharCode(y[I]);return S.join("")}function C(h){if(h.slice)return h.slice(0);var y=new Uint8Array(h.byteLength);return y.set(new Uint8Array(h)),y.buffer}function L(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:l.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:l.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():l.arrayBuffer&&l.blob&&c(h)?(this._bodyArrayBuffer=C(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||d(h))?this._bodyArrayBuffer=C(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=x(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(P)}),this.text=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return D(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(Y)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function T(h){var y=h.toUpperCase();return E.indexOf(y)>-1?y:h}function N(h,y){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');y=y||{};var S=y.body;if(h instanceof N){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,y.headers||(this.headers=new b(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!S&&h._bodyInit!=null&&(S=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=y.credentials||this.credentials||"same-origin",(y.headers||!this.headers)&&(this.headers=new b(y.headers)),this.method=T(y.method||this.method||"GET"),this.mode=y.mode||this.mode||null,this.signal=y.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&S)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(S),(this.method==="GET"||this.method==="HEAD")&&(y.cache==="no-store"||y.cache==="no-cache")){var I=/([?&])_=[^&]*/;if(I.test(this.url))this.url=this.url.replace(I,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function Y(h){var y=new FormData;return h.trim().split("&").forEach(function(S){if(S){var I=S.split("="),j=I.shift().replace(/\+/g," "),R=I.join("=").replace(/\+/g," ");y.append(decodeURIComponent(j),decodeURIComponent(R))}}),y}function ze(h){var y=new b,S=h.replace(/\r?\n[\t ]+/g," ");return S.split("\r").map(function(I){return I.indexOf(`
2
- `)===0?I.substr(1,I.length):I}).forEach(function(I){var j=I.split(":"),R=j.shift().trim();if(R){var me=j.join(":").trim();y.append(R,me)}}),y}L.call(N.prototype);function B(h,y){if(!(this instanceof B))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');y||(y={}),this.type="default",this.status=y.status===void 0?200:y.status,this.ok=this.status>=200&&this.status<300,this.statusText=y.statusText===void 0?"":""+y.statusText,this.headers=new b(y.headers),this.url=y.url||"",this._initBody(h)}L.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},B.error=function(){var h=new B(null,{status:0,statusText:""});return h.type="error",h};var Z=[301,302,303,307,308];B.redirect=function(h,y){if(Z.indexOf(y)===-1)throw new RangeError("Invalid status code");return new B(null,{status:y,headers:{location:h}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(y,S){this.message=y,this.name=S;var I=Error(y);this.stack=I.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function J(h,y){return new Promise(function(S,I){var j=new N(h,y);if(j.signal&&j.signal.aborted)return I(new o.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function me(){R.abort()}R.onload=function(){var M={status:R.status,statusText:R.statusText,headers:ze(R.getAllResponseHeaders()||"")};M.url="responseURL"in R?R.responseURL:M.headers.get("X-Request-URL");var ye="response"in R?R.response:R.responseText;setTimeout(function(){S(new B(ye,M))},0)},R.onerror=function(){setTimeout(function(){I(new TypeError("Network request failed"))},0)},R.ontimeout=function(){setTimeout(function(){I(new TypeError("Network request failed"))},0)},R.onabort=function(){setTimeout(function(){I(new o.DOMException("Aborted","AbortError"))},0)};function Tt(M){try{return M===""&&a.location.href?a.location.href:M}catch{return M}}R.open(j.method,Tt(j.url),!0),j.credentials==="include"?R.withCredentials=!0:j.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&(l.blob?R.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(R.responseType="arraybuffer")),y&&typeof y.headers=="object"&&!(y.headers instanceof b)?Object.getOwnPropertyNames(y.headers).forEach(function(M){R.setRequestHeader(M,p(y.headers[M]))}):j.headers.forEach(function(M,ye){R.setRequestHeader(ye,M)}),j.signal&&(j.signal.addEventListener("abort",me),R.onreadystatechange=function(){R.readyState===4&&j.signal.removeEventListener("abort",me)}),R.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return J.polyfill=!0,a.fetch||(a.fetch=J,a.Headers=b,a.Request=N,a.Response=B),o.Headers=b,o.Request=N,o.Response=B,o.fetch=J,o})({})})(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var n=t.fetch?t:s;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e}(xe,xe.exports)),xe.exports}(function(r,e){var t;if(typeof fetch=="function"&&(typeof ue<"u"&&ue.fetch?t=ue.fetch:typeof window<"u"&&window.fetch?t=window.fetch:t=fetch),typeof Fs<"u"&&(typeof window>"u"||typeof window.document>"u")){var s=t||$s();s.default&&(s=s.default),e.default=s,r.exports=e.default}})(Be,Be.exports);var bt=Be.exports;const xt=ht(bt),it=ls({__proto__:null,default:xt},[bt]);function Pe(r){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(r)}var W;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?W=global.fetch:typeof window<"u"&&window.fetch?W=window.fetch:W=fetch);var fe;yt()&&(typeof global<"u"&&global.XMLHttpRequest?fe=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(fe=window.XMLHttpRequest));var Ie;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ie=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ie=window.ActiveXObject));!W&&it&&!fe&&!Ie&&(W=xt||it);typeof W!="function"&&(W=void 0);var qe=function(e,t){if(t&&Pe(t)==="object"){var s="";for(var n in t)s+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!s)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+s.slice(1)}return e},ot=function(e,t,s){var n=function(o){if(!o.ok)return s(o.statusText||"Error",{status:o.status});o.text().then(function(a){s(null,{status:o.status,data:a})}).catch(s)};typeof fetch=="function"?fetch(e,t).then(n).catch(s):W(e,t).then(n).catch(s)},at=!1,_s=function(e,t,s,n){e.queryStringParams&&(t=qe(t,e.queryStringParams));var i=Ue({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),s&&(i["Content-Type"]="application/json");var o=typeof e.requestOptions=="function"?e.requestOptions(s):e.requestOptions,a=Ue({method:s?"POST":"GET",body:s?e.stringify(s):void 0,headers:i},at?{}:o);try{ot(t,a,n)}catch(l){if(!o||Object.keys(o).length===0||!l.message||l.message.indexOf("not implemented")<0)return n(l);try{Object.keys(o).forEach(function(c){delete a[c]}),ot(t,a,n),at=!0}catch(c){n(c)}}},ks=function(e,t,s,n){s&&Pe(s)==="object"&&(s=qe("",s).slice(1)),e.queryStringParams&&(t=qe(t,e.queryStringParams));try{var i;fe?i=new fe:i=new Ie("MSXML2.XMLHTTP.3.0"),i.open(s?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,s&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=e.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)i.setRequestHeader(a,o[a]);i.onreadystatechange=function(){i.readyState>3&&n(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(s)}catch(l){console&&console.log(l)}},Us=function(e,t,s,n){if(typeof s=="function"&&(n=s,s=void 0),n=n||function(){},W&&t.indexOf("file:")!==0)return _s(e,t,s,n);if(yt()||typeof ActiveXObject=="function")return ks(e,t,s,n);n(new Error("No fetch and no xhr implementation found!"))};function de(r){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(r)}function Bs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function lt(r,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,St(s.key),s)}}function qs(r,e,t){return e&&lt(r.prototype,e),t&&lt(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Vs(r,e,t){return e=St(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function St(r){var e=Ms(r,"string");return de(e)==="symbol"?e:String(e)}function Ms(r,e){if(de(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var s=t.call(r,e||"default");if(de(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Hs=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,s,n){return Vs({},s,n||"")},parseLoadPayload:function(t,s){},request:Us,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},vt=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Bs(this,r),this.services=e,this.options=t,this.allOptions=s,this.type="backend",this.init(e,t,s)}return qs(r,[{key:"init",value:function(t){var s=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ue(n,this.options||{},Hs()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return s.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,s,n){this._readAny(t,t,s,s,n)}},{key:"read",value:function(t,s,n){this._readAny([t],t,[s],s,n)}},{key:"_readAny",value:function(t,s,n,i,o){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(t,n)),l=As(l),l.then(function(c){if(!c)return o(null,{});var f=a.services.interpolator.interpolate(c,{lng:t.join("+"),ns:n.join("+")});a.loadUrl(f,o,s,i)})}},{key:"loadUrl",value:function(t,s,n,i){var o=this,a=typeof n=="string"?[n]:n,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(a,l);this.options.request(this.options,t,c,function(f,d){if(d&&(d.status>=500&&d.status<600||!d.status))return s("failed loading "+t+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return s("failed loading "+t+"; status code: "+d.status,!1);if(!d&&f&&f.message&&f.message.indexOf("Failed to fetch")>-1)return s("failed loading "+t+": "+f.message,!0);if(f)return s(f,!1);var u,p;try{typeof d.data=="string"?u=o.options.parse(d.data,n,i):u=d.data}catch{p="failed parsing "+t+" to json"}if(p)return s(p,!1);s(null,u)})}},{key:"create",value:function(t,s,n,i,o){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var l=this.options.parsePayload(s,n,i),c=0,f=[],d=[];t.forEach(function(u){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(u,s));var g=a.services.interpolator.interpolate(p,{lng:u,ns:s});a.options.request(a.options,g,l,function(b,x){c+=1,f.push(b),d.push(x),c===t.length&&typeof o=="function"&&o(f,d)})})}}},{key:"reload",value:function(){var t=this,s=this.services,n=s.backendConnector,i=s.languageUtils,o=s.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],c=function(d){var u=i.toResolveHierarchy(d);u.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(f){return c(f)}),l.forEach(function(f){t.allOptions.ns.forEach(function(d){n.read(f,d,"read",null,null,function(u,p){u&&o.warn("loading namespace ".concat(d," for language ").concat(f," failed"),u),!u&&p&&o.log("loaded namespace ".concat(d," for language ").concat(f),p),n.loaded("".concat(f,"|").concat(d),u,p)})})})}}}]),r}();vt.type="backend";F.use(vt).use(ts).init({backend:{loadPath:(r,e)=>e.map(s=>s==="common"?"/i18n":`/${s}/i18n`),parse:r=>JSON.parse(r)},defaultNS:"common",ns:["common"],fallbackLng:"fr",lng:"fr",interpolation:{escapeValue:!1,prefix:"[[",suffix:"]]"},debug:!1});var Ks=function(){return null},wt,ut=ss;wt=ut.createRoot,ut.hydrateRoot;const ee=document.querySelector("[data-explorer-config]");let ct;function zs(){var r;if((r=ee==null?void 0:ee.dataset)!=null&&r.explorerConfig){const{explorerConfig:e}=ee.dataset;try{const t=JSON.parse(e);ct=Object.assign({},t)}catch(t){console.error("[Explorer Config] could not parse app params from root data attributes:",ee==null?void 0:ee.dataset,t)}}return ct}const ft=r=>{let e;const t=new Set,s=(l,c)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const d=e;e=c??typeof f!="object"?f:Object.assign({},e,f),t.forEach(u=>u(e,d))}},n=()=>e,a={setState:s,getState:n,subscribe:l=>(t.add(l),()=>t.delete(l)),destroy:()=>{t.clear()}};return e=r(s,n,a),a},Qs=r=>r?ft(r):ft;var Ot={exports:{}},Rt={},Pt={exports:{}},It={};/**
1
+ var Tt=Object.defineProperty;var Nt=(r,e,t)=>e in r?Tt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var te=(r,e,t)=>(Nt(r,typeof e!="symbol"?e+"":e,t),t);import{u as At,a as G,j as m,I as Ft,b as $t,c as z,d as Q,e as X,f as _t,g as kt,L as H,F as Ut,h as Bt,S as qt,D as se,i as Vt,T as Mt,B as Ht,k as Kt,l as ze,A as zt,m as Qt,G as Ae,n as Jt,Q as Wt,o as Xt,p as Gt,O as Yt,q as Zt}from"./edifice-react.js";import{c as ue,g as dt,i as es,a as ts,r as v,b as ss,u as oe}from"./react.js";import{s as rs,t as ns,f as is,u as os}from"./edifice-icons.js";import{odeServices as V,FOLDER as q}from"/assets/js/edifice-ts-client/index.js";function as(r,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in r)){const i=Object.getOwnPropertyDescriptor(s,n);i&&Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:()=>s[n]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();const ls="modulepreload",us=function(r){return"/"+r},Qe={},k=function(e,t,s){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=us(i),i in Qe)return;Qe[i]=!0;const o=i.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!s)for(let f=n.length-1;f>=0;f--){const d=n[f];if(d.href===i&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":ls,o||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),o)return new Promise((f,d)=>{c.addEventListener("load",f),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},cs={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){console&&console[r]&&console[r].apply(console,e)}};class Se{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||cs,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Se(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Se(this.logger,e)}}var K=new Se;class Ee{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]=this.observers[s]||[],this.observers[s].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(s=>s!==t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(o=>{o(...s)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[e,...s])})}}function le(){let r,e;const t=new Promise((s,n)=>{r=s,e=n});return t.resolve=r,t.reject=e,t}function Je(r){return r==null?"":""+r}function fs(r,e,t){r.forEach(s=>{e[s]&&(t[s]=e[s])})}function qe(r,e,t){function s(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function n(){return!r||typeof r=="string"}const i=typeof e!="string"?[].concat(e):e.split(".");for(;i.length>1;){if(n())return{};const o=s(i.shift());!r[o]&&t&&(r[o]=new t),Object.prototype.hasOwnProperty.call(r,o)?r=r[o]:r={}}return n()?{}:{obj:r,k:s(i.shift())}}function We(r,e,t){const{obj:s,k:n}=qe(r,e,Object);s[n]=t}function ds(r,e,t,s){const{obj:n,k:i}=qe(r,e,Object);n[i]=n[i]||[],s&&(n[i]=n[i].concat(t)),s||n[i].push(t)}function ve(r,e){const{obj:t,k:s}=qe(r,e);if(t)return t[s]}function hs(r,e,t){const s=ve(r,t);return s!==void 0?s:ve(e,t)}function ht(r,e,t){for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in r?typeof r[s]=="string"||r[s]instanceof String||typeof e[s]=="string"||e[s]instanceof String?t&&(r[s]=e[s]):ht(r[s],e[s],t):r[s]=e[s]);return r}function re(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ps={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function gs(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,e=>ps[e]):r}const ms=[" ",",","?","!",";"];function ys(r,e,t){e=e||"",t=t||"";const s=ms.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(s.length===0)return!0;const n=new RegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!n.test(r);if(!i){const o=r.indexOf(t);o>0&&!n.test(r.substring(0,o))&&(i=!0)}return i}function we(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[e])return r[e];const s=e.split(t);let n=r;for(let i=0;i<s.length;++i){if(!n||typeof n[s[i]]=="string"&&i+1<s.length)return;if(n[s[i]]===void 0){let o=2,a=s.slice(i,i+o).join(t),l=n[a];for(;l===void 0&&s.length>i+o;)o++,a=s.slice(i,i+o).join(t),l=n[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}const c=s.slice(i+o).join(t);return c?we(l,c,t):void 0}n=n[s[i]]}return n}function Oe(r){return r&&r.indexOf("_")>0?r.replace("_","-"):r}class Xe extends Ee{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,o=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a=[e,t];s&&typeof s!="string"&&(a=a.concat(s)),s&&typeof s=="string"&&(a=a.concat(i?s.split(i):s)),e.indexOf(".")>-1&&(a=e.split("."));const l=ve(this.data,a);return l||!o||typeof s!="string"?l:we(this.data&&this.data[e]&&this.data[e][t],s,i)}addResource(e,t,s,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),We(this.data,a,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in s)(typeof s[i]=="string"||Object.prototype.toString.apply(s[i])==="[object Array]")&&this.addResource(e,t,i,s[i],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=s,s=t,t=a[1]),this.addNamespaces(t);let l=ve(this.data,a)||{};n?ht(l,s,i):l={...l,...s},We(this.data,a,l),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var pt={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,s,n){return r.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,t,s,n))}),e}};const Ge={};class Re extends Ee{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),fs(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=K.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=s&&e.indexOf(s)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ys(e,s,n);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};const c=e.split(s);(s!==n||s===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const n=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],c=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(f){const O=t.nsSeparator||this.options.nsSeparator;return n?{res:`${l}${O}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${O}${o}`}return n?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let u=d&&d.res;const p=d&&d.usedKey||o,g=d&&d.exactUsedKey||o,b=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],w=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject;if(P&&u&&(typeof u!="string"&&typeof u!="boolean"&&typeof u!="number")&&x.indexOf(b)<0&&!(typeof w=="string"&&b==="[object Array]")){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,u,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return n?(d.res=O,d.usedParams=this.getUsedParamsDetails(t),d):O}if(i){const O=b==="[object Array]",D=O?[]:{},L=O?g:p;for(const E in u)if(Object.prototype.hasOwnProperty.call(u,E)){const T=`${L}${i}${E}`;D[E]=this.translate(T,{...t,joinArrays:!1,ns:a}),D[E]===T&&(D[E]=u[E])}u=D}}else if(P&&typeof w=="string"&&b==="[object Array]")u=u.join(w),u&&(u=this.extendTranslation(u,e,t,s));else{let O=!1,D=!1;const L=t.count!==void 0&&typeof t.count!="string",E=Re.hasDefaultValue(t),T=L?this.pluralResolver.getSuffix(c,t.count,t):"",N=t.ordinal&&L?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",Y=t[`defaultValue${T}`]||t[`defaultValue${N}`]||t.defaultValue;!this.isValidLookup(u)&&E&&(O=!0,u=Y),this.isValidLookup(u)||(D=!0,u=o);const B=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:u,Z=E&&Y!==u&&this.options.updateMissing;if(D||O||Z){if(this.logger.log(Z?"updateKey":"missingKey",c,l,o,Z?Y:u),i){const S=this.resolve(o,{...t,keySeparator:!1});S&&S.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 J=[];const h=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&h&&h[0])for(let S=0;S<h.length;S++)J.push(h[S]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(t.lng||this.language):J.push(t.lng||this.language);const y=(S,I,j)=>{const R=E&&j!==u?j:B;this.options.missingKeyHandler?this.options.missingKeyHandler(S,l,I,R,Z,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(S,l,I,R,Z,t),this.emit("missingKey",S,l,I,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&L?J.forEach(S=>{this.pluralResolver.getSuffixes(S,t).forEach(I=>{y([S],o+I,t[`defaultValue${I}`]||Y)})}):y(J,o,Y))}u=this.extendTranslation(u,e,t,d,s),D&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${o}`),(D||O)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,O?u:void 0):u=this.options.parseMissingKeyHandler(u))}return n?(d.res=u,d.usedParams=this.getUsedParamsDetails(t),d):u}extendTranslation(e,t,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=typeof e=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const u=e.match(this.interpolator.nestingRegexp);f=u&&u.length}let d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,s.lng||this.language,s),c){const u=e.match(this.interpolator.nestingRegexp),p=u&&u.length;f<p&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(s.lng=n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var u=arguments.length,p=new Array(u),g=0;g<u;g++)p[g]=arguments[g];return i&&i[0]===p[0]&&!s.context?(o.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):o.translate(...p,t)},s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,l=typeof a=="string"?[a]:a;return e!=null&&l&&l.length&&s.applyPostProcessor!==!1&&(e=pt.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,n,i,o,a;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(l,t),f=c.key;n=f;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const u=t.count!==void 0&&typeof t.count!="string",p=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),g=t.context!==void 0&&(typeof t.context=="string"||typeof t.context=="number")&&t.context!=="",b=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);d.forEach(x=>{this.isValidLookup(s)||(a=x,!Ge[`${b[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Ge[`${b[0]}-${x}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(w=>{if(this.isValidLookup(s))return;o=w;const P=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(P,f,w,x,t);else{let O;u&&(O=this.pluralResolver.getSuffix(w,t.count,t));const D=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(P.push(f+O),t.ordinal&&O.indexOf(L)===0&&P.push(f+O.replace(L,this.options.pluralSeparator)),p&&P.push(f+D)),g){const E=`${f}${this.options.contextSeparator}${t.context}`;P.push(E),u&&(P.push(E+O),t.ordinal&&O.indexOf(L)===0&&P.push(E+O.replace(L,this.options.pluralSeparator)),p&&P.push(E+D))}}let C;for(;C=P.pop();)this.isValidLookup(s)||(i=C,s=this.getResource(w,x,C,t))}))})}),{res:s,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&typeof e.replace!="string";let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const i of t)delete n[i]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}function Fe(r){return r.charAt(0).toUpperCase()+r.slice(1)}class Ye{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create("languageUtils")}getScriptPartFromCode(e){if(e=Oe(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Oe(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(n=>n.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Fe(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Fe(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=Fe(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getLanguagePartFromCode(s);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(i=>{if(i===n)return i;if(!(i.indexOf("-")<0&&n.indexOf("-")<0)&&i.indexOf(n)===0)return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],i=o=>{o&&(this.isSupportedCode(o)?n.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),s.forEach(o=>{n.indexOf(o)<0&&i(this.formatLanguageCode(o))}),n}}let bs=[{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}],xs={1:function(r){return+(r>1)},2:function(r){return+(r!=1)},3:function(r){return 0},4:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},5:function(r){return r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5},6:function(r){return r==1?0:r>=2&&r<=4?1:2},7:function(r){return r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},8:function(r){return r==1?0:r==2?1:r!=8&&r!=11?2:3},9:function(r){return+(r>=2)},10:function(r){return r==1?0:r==2?1:r<7?2:r<11?3:4},11:function(r){return r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3},12:function(r){return+(r%10!=1||r%100==11)},13:function(r){return+(r!==0)},14:function(r){return r==1?0:r==2?1:r==3?2:3},15:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2},16:function(r){return r%10==1&&r%100!=11?0:r!==0?1:2},17:function(r){return r==1||r%10==1&&r%100!=11?0:1},18:function(r){return r==0?0:r==1?1:2},19:function(r){return r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3},20:function(r){return r==1?0:r==0||r%100>0&&r%100<20?1:2},21:function(r){return r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0},22:function(r){return r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3}};const Ss=["v1","v2","v3"],vs=["v4"],Ze={zero:0,one:1,two:2,few:3,many:4,other:5};function ws(){const r={};return bs.forEach(e=>{e.lngs.forEach(t=>{r[t]={numbers:e.nr,plurals:xs[e.fc]}})}),r}class Os{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=K.create("pluralResolver"),(!this.options.compatibilityJSON||vs.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=ws()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Oe(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((n,i)=>Ze[n]-Ze[i]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):s.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(e,s);return n?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:this.getSuffixRetroCompatible(n,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let n=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!Ss.includes(this.options.compatibilityJSON)}}function et(r,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=hs(r,e,t);return!i&&n&&typeof t=="string"&&(i=we(r,t,s),i===void 0&&(i=we(e,t,s))),i}class Rs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=K.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=t.escape!==void 0?t.escape:gs,this.escapeValue=t.escapeValue!==void 0?t.escapeValue:!0,this.useRawValueToEscape=t.useRawValueToEscape!==void 0?t.useRawValueToEscape:!1,this.prefix=t.prefix?re(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?re(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?re(t.nestingPrefix):t.nestingPrefixEscaped||re("$t("),this.nestingSuffix=t.nestingSuffix?re(t.nestingSuffix):t.nestingSuffixEscaped||re(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=t.alwaysFormat!==void 0?t.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(e,t,s,n){let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const f=g=>{if(g.indexOf(this.formatSeparator)<0){const P=et(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(P,void 0,s,{...n,...t,interpolationkey:g}):P}const b=g.split(this.formatSeparator),x=b.shift().trim(),w=b.join(this.formatSeparator).trim();return this.format(et(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,s,{...n,...t,interpolationkey:x})};this.resetRegExp();const d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(a=0;i=g.regex.exec(e);){const b=i[1].trim();if(o=f(b),o===void 0)if(typeof d=="function"){const w=d(e,i,n);o=typeof w=="string"?w:""}else if(n&&Object.prototype.hasOwnProperty.call(n,b))o="";else if(u){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=Je(o));const x=g.safeValue(o);if(e=e.replace(i[0],x),u?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,i,o;function a(l,c){const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const d=l.split(new RegExp(`${f}[ ]*{`));let u=`{${d[1]}`;l=d[0],u=this.interpolate(u,o);const p=u.match(/'/g),g=u.match(/"/g);(p&&p.length%2===0&&!g||g.length%2!==0)&&(u=u.replace(/'/g,'"'));try{o=JSON.parse(u),c&&(o={...c,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,b),`${l}${f}${u}`}return delete o.defaultValue,l}for(;n=this.nestingRegexp.exec(e);){let l=[];o={...s},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const f=n[1].split(this.formatSeparator).map(d=>d.trim());n[1]=f.shift(),l=f,c=!0}if(i=t(a.call(this,n[1].trim(),o),o),i&&n[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=Je(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),c&&(i=l.reduce((f,d)=>this.format(f,d,s.lng,{...s,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}function Ps(r){let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const s=r.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(o=>{if(!o)return;const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");t[a.trim()]||(t[a.trim()]=c),c==="false"&&(t[a.trim()]=!1),c==="true"&&(t[a.trim()]=!0),isNaN(c)||(t[a.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:t}}function ne(r){const e={};return function(s,n,i){const o=n+JSON.stringify(i);let a=e[o];return a||(a=r(Oe(n),i),e[o]=a),a(s)}}class Is{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=K.create("formatter"),this.options=e,this.formats={number:ne((t,s)=>{const n=new Intl.NumberFormat(t,{...s});return i=>n.format(i)}),currency:ne((t,s)=>{const n=new Intl.NumberFormat(t,{...s,style:"currency"});return i=>n.format(i)}),datetime:ne((t,s)=>{const n=new Intl.DateTimeFormat(t,{...s});return i=>n.format(i)}),relativetime:ne((t,s)=>{const n=new Intl.RelativeTimeFormat(t,{...s});return i=>n.format(i,s.range||"day")}),list:ne((t,s)=>{const n=new Intl.ListFormat(t,{...s});return i=>n.format(i)})},this.init(e)}init(e){const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=s.formatSeparator?s.formatSeparator:s.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ne(t)}format(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return t.split(this.formatSeparator).reduce((a,l)=>{const{formatName:c,formatOptions:f}=Ps(l);if(this.formats[c]){let d=a;try{const u=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},p=u.locale||u.lng||n.locale||n.lng||s;d=this.formats[c](a,p,{...f,...n,...u})}catch(u){this.logger.warn(u)}return d}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}function Es(r,e){r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)}class Ls extends Ee{constructor(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=K.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,n.backend,n)}queueLoad(e,t,s,n){const i={},o={},a={},l={};return e.forEach(c=>{let f=!0;t.forEach(d=>{const u=`${c}|${d}`;!s.reload&&this.store.hasResourceBundle(c,d)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?o[u]===void 0&&(o[u]=!0):(this.state[u]=1,f=!1,o[u]===void 0&&(o[u]=!0),i[u]===void 0&&(i[u]=!0),l[d]===void 0&&(l[d]=!0)))}),f||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),s&&this.store.addResourceBundle(i,o,s),this.state[e]=t?-1:2;const a={};this.queue.forEach(l=>{ds(l.loaded,[i],o),Es(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const f=l.loaded[c];f.length&&f.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:o});return}this.readingCalls++;const a=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&f&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,n+1,i*2,o)},i);return}o(c,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>a(null,f)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,t,a)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=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."),n&&n();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof t=="string"&&(t=[t]);const i=this.queueLoad(e,t,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,a),this.loaded(e,o,a)})}saveMissing(e,t,s,n,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let f;c.length===5?f=c(e,t,s,n,l):f=c(e,t,s,n),f&&typeof f.then=="function"?f.then(d=>a(null,d)).catch(a):a(null,f)}catch(f){a(f)}else c(e,t,s,n,a,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}function tt(){return{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:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(n=>{t[n]=s[n]})}return t},interpolation:{escapeValue:!0,format:(r,e,t,s)=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function st(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function be(){}function js(r){Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})}class ce extends Ee{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=st(e),this.services={},this.logger=K,this.modules={external:[]},js(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(typeof t.ns=="string"?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=tt();this.options={...n,...this.options,...st(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);function i(f){return f?typeof f=="function"?new f:f:null}if(!this.options.isClone){this.modules.logger?K.init(i(this.modules.logger),this.options):K.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=Is);const d=new Ye(this.options);this.store=new Xe(this.options.resources,this.options);const u=this.services;u.logger=K,u.resourceStore=this.store,u.languageUtils=d,u.pluralResolver=new Os(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=i(f),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Rs(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Ls(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(p){for(var g=arguments.length,b=new Array(g>1?g-1:0),x=1;x<g;x++)b[x-1]=arguments[x];e.emit(p,...b)}),this.modules.languageDetector&&(u.languageDetector=i(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=i(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Re(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,b=new Array(g>1?g-1:0),x=1;x<g;x++)b[x-1]=arguments[x];e.emit(p,...b)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,s||(s=be),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const l=le(),c=()=>{const f=(d,u)=>{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),l.resolve(u),s(d,u)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;const n=typeof e=="string"?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};n?o(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(a)})}else s(null)}reloadResources(e,t,s){const n=le();return e||(e=this.languages),t||(t=this.options.ns),s||(s=be),this.services.backendConnector.reload(e,t,i=>{n.resolve(),s(i)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&pt.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const n=le();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve(function(){return s.t(...arguments)}),t&&t(l,function(){return s.t(...arguments)})},a=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,f=>{o(f,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,s){var n=this;const i=function(o,a){let l;if(typeof a!="object"){for(var c=arguments.length,f=new Array(c>2?c-2:0),d=2;d<c;d++)f[d-2]=arguments[d];l=n.options.overloadTranslationOptionHandler([o,a].concat(f))}else l={...a};l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix=l.keyPrefix||s||i.keyPrefix;const u=n.options.keySeparator||".";let p;return l.keyPrefix&&Array.isArray(o)?p=o.map(g=>`${l.keyPrefix}${u}${g}`):p=l.keyPrefix?`${l.keyPrefix}${u}${o}`:o,n.t(p,l)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=s,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=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 s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!n||o(i,e)))}loadNamespaces(e,t){const s=le();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=le();typeof e=="string"&&(e=[e]);const n=this.options.preload||[],i=e.filter(o=>n.indexOf(o)<0);return i.length?(this.options.preload=n.concat(i),this.loadResources(o=>{s.resolve(),t&&t(o)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["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"],s=this.services&&this.services.languageUtils||new Ye(tt());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ce(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new ce(n);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s&&(i.store=new Xe(this.store.data,n),i.services.resourceStore=i.store),i.translator=new Re(i.services,n),i.translator.on("*",function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];i.emit(a,...c)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const F=ce.createInstance();F.createInstance=ce.createInstance;F.createInstance;F.dir;F.init;F.loadResources;F.reloadResources;F.use;F.changeLanguage;F.getFixedT;const _=F.t;F.exists;F.setDefaultNamespace;F.hasLoadedNamespace;F.loadNamespaces;F.loadLanguages;function _e(r){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(r)}var gt=[],Ds=gt.forEach,Cs=gt.slice;function ke(r){return Ds.call(Cs.call(arguments,1),function(e){if(e)for(var t in e)r[t]===void 0&&(r[t]=e[t])}),r}function mt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_e(XMLHttpRequest))==="object"}function Ts(r){return!!r&&typeof r.then=="function"}function Ns(r){return Ts(r)?r:Promise.resolve(r)}function As(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ue={exports:{}},xe={exports:{}},rt;function Fs(){return rt||(rt=1,function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ue<"u"&&ue,s=function(){function i(){this.fetch=!1,this.DOMException=t.DOMException}return i.prototype=t,new i}();(function(i){(function(o){var a=typeof i<"u"&&i||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(h){return h&&DataView.prototype.isPrototypeOf(h)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function u(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}function p(h){return typeof h!="string"&&(h=String(h)),h}function g(h){var y={next:function(){var S=h.shift();return{done:S===void 0,value:S}}};return l.iterable&&(y[Symbol.iterator]=function(){return y}),y}function b(h){this.map={},h instanceof b?h.forEach(function(y,S){this.append(S,y)},this):Array.isArray(h)?h.forEach(function(y){this.append(y[0],y[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(y){this.append(y,h[y])},this)}b.prototype.append=function(h,y){h=u(h),y=p(y);var S=this.map[h];this.map[h]=S?S+", "+y:y},b.prototype.delete=function(h){delete this.map[u(h)]},b.prototype.get=function(h){return h=u(h),this.has(h)?this.map[h]:null},b.prototype.has=function(h){return this.map.hasOwnProperty(u(h))},b.prototype.set=function(h,y){this.map[u(h)]=p(y)},b.prototype.forEach=function(h,y){for(var S in this.map)this.map.hasOwnProperty(S)&&h.call(y,this.map[S],S,this)},b.prototype.keys=function(){var h=[];return this.forEach(function(y,S){h.push(S)}),g(h)},b.prototype.values=function(){var h=[];return this.forEach(function(y){h.push(y)}),g(h)},b.prototype.entries=function(){var h=[];return this.forEach(function(y,S){h.push([S,y])}),g(h)},l.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function w(h){return new Promise(function(y,S){h.onload=function(){y(h.result)},h.onerror=function(){S(h.error)}})}function P(h){var y=new FileReader,S=w(y);return y.readAsArrayBuffer(h),S}function C(h){var y=new FileReader,S=w(y);return y.readAsText(h),S}function O(h){for(var y=new Uint8Array(h),S=new Array(y.length),I=0;I<y.length;I++)S[I]=String.fromCharCode(y[I]);return S.join("")}function D(h){if(h.slice)return h.slice(0);var y=new Uint8Array(h.byteLength);return y.set(new Uint8Array(h)),y.buffer}function L(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:l.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:l.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():l.arrayBuffer&&l.blob&&c(h)?(this._bodyArrayBuffer=D(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||d(h))?this._bodyArrayBuffer=D(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=x(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(P)}),this.text=function(){var h=x(this);if(h)return h;if(this._bodyBlob)return C(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(Y)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function T(h){var y=h.toUpperCase();return E.indexOf(y)>-1?y:h}function N(h,y){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');y=y||{};var S=y.body;if(h instanceof N){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,y.headers||(this.headers=new b(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!S&&h._bodyInit!=null&&(S=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=y.credentials||this.credentials||"same-origin",(y.headers||!this.headers)&&(this.headers=new b(y.headers)),this.method=T(y.method||this.method||"GET"),this.mode=y.mode||this.mode||null,this.signal=y.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&S)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(S),(this.method==="GET"||this.method==="HEAD")&&(y.cache==="no-store"||y.cache==="no-cache")){var I=/([?&])_=[^&]*/;if(I.test(this.url))this.url=this.url.replace(I,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function Y(h){var y=new FormData;return h.trim().split("&").forEach(function(S){if(S){var I=S.split("="),j=I.shift().replace(/\+/g," "),R=I.join("=").replace(/\+/g," ");y.append(decodeURIComponent(j),decodeURIComponent(R))}}),y}function Ke(h){var y=new b,S=h.replace(/\r?\n[\t ]+/g," ");return S.split("\r").map(function(I){return I.indexOf(`
2
+ `)===0?I.substr(1,I.length):I}).forEach(function(I){var j=I.split(":"),R=j.shift().trim();if(R){var me=j.join(":").trim();y.append(R,me)}}),y}L.call(N.prototype);function B(h,y){if(!(this instanceof B))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');y||(y={}),this.type="default",this.status=y.status===void 0?200:y.status,this.ok=this.status>=200&&this.status<300,this.statusText=y.statusText===void 0?"":""+y.statusText,this.headers=new b(y.headers),this.url=y.url||"",this._initBody(h)}L.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},B.error=function(){var h=new B(null,{status:0,statusText:""});return h.type="error",h};var Z=[301,302,303,307,308];B.redirect=function(h,y){if(Z.indexOf(y)===-1)throw new RangeError("Invalid status code");return new B(null,{status:y,headers:{location:h}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(y,S){this.message=y,this.name=S;var I=Error(y);this.stack=I.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function J(h,y){return new Promise(function(S,I){var j=new N(h,y);if(j.signal&&j.signal.aborted)return I(new o.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function me(){R.abort()}R.onload=function(){var M={status:R.status,statusText:R.statusText,headers:Ke(R.getAllResponseHeaders()||"")};M.url="responseURL"in R?R.responseURL:M.headers.get("X-Request-URL");var ye="response"in R?R.response:R.responseText;setTimeout(function(){S(new B(ye,M))},0)},R.onerror=function(){setTimeout(function(){I(new TypeError("Network request failed"))},0)},R.ontimeout=function(){setTimeout(function(){I(new TypeError("Network request failed"))},0)},R.onabort=function(){setTimeout(function(){I(new o.DOMException("Aborted","AbortError"))},0)};function Ct(M){try{return M===""&&a.location.href?a.location.href:M}catch{return M}}R.open(j.method,Ct(j.url),!0),j.credentials==="include"?R.withCredentials=!0:j.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&(l.blob?R.responseType="blob":l.arrayBuffer&&j.headers.get("Content-Type")&&j.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(R.responseType="arraybuffer")),y&&typeof y.headers=="object"&&!(y.headers instanceof b)?Object.getOwnPropertyNames(y.headers).forEach(function(M){R.setRequestHeader(M,p(y.headers[M]))}):j.headers.forEach(function(M,ye){R.setRequestHeader(ye,M)}),j.signal&&(j.signal.addEventListener("abort",me),R.onreadystatechange=function(){R.readyState===4&&j.signal.removeEventListener("abort",me)}),R.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return J.polyfill=!0,a.fetch||(a.fetch=J,a.Headers=b,a.Request=N,a.Response=B),o.Headers=b,o.Request=N,o.Response=B,o.fetch=J,o})({})})(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var n=t.fetch?t:s;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e}(xe,xe.exports)),xe.exports}(function(r,e){var t;if(typeof fetch=="function"&&(typeof ue<"u"&&ue.fetch?t=ue.fetch:typeof window<"u"&&window.fetch?t=window.fetch:t=fetch),typeof As<"u"&&(typeof window>"u"||typeof window.document>"u")){var s=t||Fs();s.default&&(s=s.default),e.default=s,r.exports=e.default}})(Ue,Ue.exports);var yt=Ue.exports;const bt=dt(yt),nt=as({__proto__:null,default:bt},[yt]);function Pe(r){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(r)}var W;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?W=global.fetch:typeof window<"u"&&window.fetch?W=window.fetch:W=fetch);var fe;mt()&&(typeof global<"u"&&global.XMLHttpRequest?fe=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(fe=window.XMLHttpRequest));var Ie;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ie=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ie=window.ActiveXObject));!W&&nt&&!fe&&!Ie&&(W=bt||nt);typeof W!="function"&&(W=void 0);var Be=function(e,t){if(t&&Pe(t)==="object"){var s="";for(var n in t)s+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!s)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+s.slice(1)}return e},it=function(e,t,s){var n=function(o){if(!o.ok)return s(o.statusText||"Error",{status:o.status});o.text().then(function(a){s(null,{status:o.status,data:a})}).catch(s)};typeof fetch=="function"?fetch(e,t).then(n).catch(s):W(e,t).then(n).catch(s)},ot=!1,$s=function(e,t,s,n){e.queryStringParams&&(t=Be(t,e.queryStringParams));var i=ke({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),s&&(i["Content-Type"]="application/json");var o=typeof e.requestOptions=="function"?e.requestOptions(s):e.requestOptions,a=ke({method:s?"POST":"GET",body:s?e.stringify(s):void 0,headers:i},ot?{}:o);try{it(t,a,n)}catch(l){if(!o||Object.keys(o).length===0||!l.message||l.message.indexOf("not implemented")<0)return n(l);try{Object.keys(o).forEach(function(c){delete a[c]}),it(t,a,n),ot=!0}catch(c){n(c)}}},_s=function(e,t,s,n){s&&Pe(s)==="object"&&(s=Be("",s).slice(1)),e.queryStringParams&&(t=Be(t,e.queryStringParams));try{var i;fe?i=new fe:i=new Ie("MSXML2.XMLHTTP.3.0"),i.open(s?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,s&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=e.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)i.setRequestHeader(a,o[a]);i.onreadystatechange=function(){i.readyState>3&&n(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(s)}catch(l){console&&console.log(l)}},ks=function(e,t,s,n){if(typeof s=="function"&&(n=s,s=void 0),n=n||function(){},W&&t.indexOf("file:")!==0)return $s(e,t,s,n);if(mt()||typeof ActiveXObject=="function")return _s(e,t,s,n);n(new Error("No fetch and no xhr implementation found!"))};function de(r){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(r)}function Us(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function at(r,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,xt(s.key),s)}}function Bs(r,e,t){return e&&at(r.prototype,e),t&&at(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function qs(r,e,t){return e=xt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xt(r){var e=Vs(r,"string");return de(e)==="symbol"?e:String(e)}function Vs(r,e){if(de(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var s=t.call(r,e||"default");if(de(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ms=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,s,n){return qs({},s,n||"")},parseLoadPayload:function(t,s){},request:ks,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},St=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Us(this,r),this.services=e,this.options=t,this.allOptions=s,this.type="backend",this.init(e,t,s)}return Bs(r,[{key:"init",value:function(t){var s=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=ke(n,this.options||{},Ms()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return s.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,s,n){this._readAny(t,t,s,s,n)}},{key:"read",value:function(t,s,n){this._readAny([t],t,[s],s,n)}},{key:"_readAny",value:function(t,s,n,i,o){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(t,n)),l=Ns(l),l.then(function(c){if(!c)return o(null,{});var f=a.services.interpolator.interpolate(c,{lng:t.join("+"),ns:n.join("+")});a.loadUrl(f,o,s,i)})}},{key:"loadUrl",value:function(t,s,n,i){var o=this,a=typeof n=="string"?[n]:n,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(a,l);this.options.request(this.options,t,c,function(f,d){if(d&&(d.status>=500&&d.status<600||!d.status))return s("failed loading "+t+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return s("failed loading "+t+"; status code: "+d.status,!1);if(!d&&f&&f.message&&f.message.indexOf("Failed to fetch")>-1)return s("failed loading "+t+": "+f.message,!0);if(f)return s(f,!1);var u,p;try{typeof d.data=="string"?u=o.options.parse(d.data,n,i):u=d.data}catch{p="failed parsing "+t+" to json"}if(p)return s(p,!1);s(null,u)})}},{key:"create",value:function(t,s,n,i,o){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var l=this.options.parsePayload(s,n,i),c=0,f=[],d=[];t.forEach(function(u){var p=a.options.addPath;typeof a.options.addPath=="function"&&(p=a.options.addPath(u,s));var g=a.services.interpolator.interpolate(p,{lng:u,ns:s});a.options.request(a.options,g,l,function(b,x){c+=1,f.push(b),d.push(x),c===t.length&&typeof o=="function"&&o(f,d)})})}}},{key:"reload",value:function(){var t=this,s=this.services,n=s.backendConnector,i=s.languageUtils,o=s.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],c=function(d){var u=i.toResolveHierarchy(d);u.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(f){return c(f)}),l.forEach(function(f){t.allOptions.ns.forEach(function(d){n.read(f,d,"read",null,null,function(u,p){u&&o.warn("loading namespace ".concat(d," for language ").concat(f," failed"),u),!u&&p&&o.log("loaded namespace ".concat(d," for language ").concat(f),p),n.loaded("".concat(f,"|").concat(d),u,p)})})})}}}]),r}();St.type="backend";F.use(St).use(es).init({backend:{loadPath:(r,e)=>e.map(s=>s==="common"?"/i18n":`/${s}/i18n`),parse:r=>JSON.parse(r)},defaultNS:"common",ns:["common"],fallbackLng:"fr",lng:"fr",interpolation:{escapeValue:!1,prefix:"[[",suffix:"]]"},debug:!1});var Hs=function(){return null},vt,lt=ts;vt=lt.createRoot,lt.hydrateRoot;const ee=document.querySelector("[data-explorer-config]");let ut;function Ks(){var r;if((r=ee==null?void 0:ee.dataset)!=null&&r.explorerConfig){const{explorerConfig:e}=ee.dataset;try{const t=JSON.parse(e);ut=Object.assign({},t)}catch(t){console.error("[Explorer Config] could not parse app params from root data attributes:",ee==null?void 0:ee.dataset,t)}}return ut}const ct=r=>{let e;const t=new Set,s=(l,c)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const d=e;e=c??typeof f!="object"?f:Object.assign({},e,f),t.forEach(u=>u(e,d))}},n=()=>e,a={setState:s,getState:n,subscribe:l=>(t.add(l),()=>t.delete(l)),destroy:()=>{t.clear()}};return e=r(s,n,a),a},zs=r=>r?ct(r):ct;var wt={exports:{}},Ot={},Rt={exports:{}},Pt={};/**
3
3
  * @license React
4
4
  * use-sync-external-store-shim.production.min.js
5
5
  *
@@ -7,7 +7,7 @@ var Nt=Object.defineProperty;var At=(r,e,t)=>e in r?Nt(r,e,{enumerable:!0,config
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var ie=v;function Js(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var Ws=typeof Object.is=="function"?Object.is:Js,Xs=ie.useState,Gs=ie.useEffect,Ys=ie.useLayoutEffect,Zs=ie.useDebugValue;function er(r,e){var t=e(),s=Xs({inst:{value:t,getSnapshot:e}}),n=s[0].inst,i=s[1];return Ys(function(){n.value=t,n.getSnapshot=e,_e(n)&&i({inst:n})},[r,t,e]),Gs(function(){return _e(n)&&i({inst:n}),r(function(){_e(n)&&i({inst:n})})},[r]),Zs(t),t}function _e(r){var e=r.getSnapshot;r=r.value;try{var t=e();return!Ws(r,t)}catch{return!0}}function tr(r,e){return e()}var sr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tr:er;It.useSyncExternalStore=ie.useSyncExternalStore!==void 0?ie.useSyncExternalStore:sr;Pt.exports=It;var rr=Pt.exports;/**
10
+ */var ie=v;function Qs(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var Js=typeof Object.is=="function"?Object.is:Qs,Ws=ie.useState,Xs=ie.useEffect,Gs=ie.useLayoutEffect,Ys=ie.useDebugValue;function Zs(r,e){var t=e(),s=Ws({inst:{value:t,getSnapshot:e}}),n=s[0].inst,i=s[1];return Gs(function(){n.value=t,n.getSnapshot=e,$e(n)&&i({inst:n})},[r,t,e]),Xs(function(){return $e(n)&&i({inst:n}),r(function(){$e(n)&&i({inst:n})})},[r]),Ys(t),t}function $e(r){var e=r.getSnapshot;r=r.value;try{var t=e();return!Js(r,t)}catch{return!0}}function er(r,e){return e()}var tr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?er:Zs;Pt.useSyncExternalStore=ie.useSyncExternalStore!==void 0?ie.useSyncExternalStore:tr;Rt.exports=Pt;var sr=Rt.exports;/**
11
11
  * @license React
12
12
  * use-sync-external-store-shim/with-selector.production.min.js
13
13
  *
@@ -15,4 +15,4 @@ var Nt=Object.defineProperty;var At=(r,e,t)=>e in r?Nt(r,e,{enumerable:!0,config
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Le=v,nr=rr;function ir(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var or=typeof Object.is=="function"?Object.is:ir,ar=nr.useSyncExternalStore,lr=Le.useRef,ur=Le.useEffect,cr=Le.useMemo,fr=Le.useDebugValue;Rt.useSyncExternalStoreWithSelector=function(r,e,t,s,n){var i=lr(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cr(function(){function l(p){if(!c){if(c=!0,f=p,p=s(p),n!==void 0&&o.hasValue){var g=o.value;if(n(g,p))return d=g}return d=p}if(g=d,or(f,p))return g;var b=s(p);return n!==void 0&&n(g,b)?g:(f=p,d=b)}var c=!1,f,d,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,s,n]);var a=ar(r,i[0],i[1]);return ur(function(){o.hasValue=!0,o.value=a},[a]),fr(a),a};Ot.exports=Rt;var dr=Ot.exports;const hr=ht(dr),{useDebugValue:pr}=rs,{useSyncExternalStoreWithSelector:gr}=hr;function mr(r,e=r.getState,t){const s=gr(r.subscribe,r.getState,r.getServerState||r.getState,e,t);return pr(s),s}const dt=r=>{const e=typeof r=="function"?Qs(r):r,t=(s,n)=>mr(e,s,n);return Object.assign(t,e),t},yr=r=>r?dt(r):dt,Et=async r=>{const e=await V.resource(r.application).searchContext(r);return{...e,folders:e.folders.filter(t=>!t.trashed)}},br=async({searchParams:r,name:e,parentId:t})=>{const s={name:e,parentId:t,application:r.application,type:r.types[0]};return await V.resource(r.application).createFolder(s)},xr=async({folderId:r,searchParams:e,parentId:t,name:s})=>{const n={folderId:r,name:s,parentId:t,application:e.application,type:e.types[0]};return await V.resource(e.application).updateFolder(n)},Sr=async({searchParams:r,resourceIds:e,useAssetIds:t,folderIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:s};return await V.resource(r.application).trashAll(n,t)},vr=async({searchParams:r,resourceIds:e,useAssetIds:t,folderIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:s};return await V.resource(r.application).deleteAll(n,t)},wr=async({searchParams:r,resourceIds:e,folderIds:t,useAssetIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:t};return await V.resource(r.application).restoreAll(n,s)},Or=async({searchParams:r,resourceIds:e,folderId:t,folderIds:s,useAssetIds:n})=>{const i={application:r.application,folderId:t,resourceIds:e,folderIds:s};return await V.resource(r.application).moveToFolder(i,n)},Rr=async({searchParams:r,resourceId:e,rights:t})=>await V.share().saveRights(r.application,e,t),Pr=async({searchParams:r,params:e})=>await V.resource(r.application).update(e),Ir=async r=>await V.rights().sessionHasWorkflowRights(r),Er=({searchParams:r,assetId:e})=>{const t=V.resource(r.application).getViewUrl(e);window.open(t,"_self")},Lr=({searchParams:r,params:e})=>V.resource(r.application).create(e),jr=({searchParams:r,assetId:e})=>{const t=V.resource(r.application).getPrintUrl(e);return window.open(t,"_blank")};function Me(r){return r.filter((e,t)=>r.indexOf(e)===t)}function he(r,e){var s,n;let t;return(e==null?void 0:e.id)===r?e:((s=e==null?void 0:e.children)!=null&&s.length&&((n=e==null?void 0:e.children)==null||n.every(i=>(t=he(r,i),t===void 0))),t)}function Cr(r,e){var s;const t=he(r,e);return(s=t==null?void 0:t.folder)!=null&&s.ancestors?[...(t==null?void 0:t.folder.ancestors)||[],r]:r===q.BIN?[q.BIN]:[q.DEFAULT]}function Lt(r,e){return e.id===r&&e.children?e.children.length>0:e.children?e.children.some(t=>Lt(e.id,t)):!1}function pe(r,e){return jt(r,e)||r}function jt(r,e,t){var n;const s=e(r,t);if((n=s==null?void 0:s.children)!=null&&n.length){const i=[];for(const o of(s==null?void 0:s.children)||[]){const a=jt(o,e,s);a&&i.push(a)}return{...s,children:i}}return s}class je{constructor(e){te(this,"id");te(this,"name");te(this,"childNumber");te(this,"section",!1);te(this,"children",[]);this.folder=e,this.id=e.id,this.name=e.name,this.childNumber=e.childNumber}}const Ct=(r,e,t)=>pe(r,s=>(s.id===t&&(s.children=e==null?void 0:e.map(n=>new je(n))),s)),A=yr()((r,e)=>({config:null,searchConfig:{minLength:1},searchParams:{filters:{folder:"default",owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:"desc"},application:"",types:[],pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:{id:q.DEFAULT,name:_("explorer.filters.mine"),section:!0,children:[]},selectedNodesIds:["default"],currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceActionDisable:!1,status:void 0,updaters:{setConfig:t=>r({config:t}),setSearchConfig:t=>r(s=>({searchConfig:{...s.searchConfig,...t}})),setTreeData:t=>r(()=>({treeData:t})),setSearchParams:t=>{r(s=>{const{searchParams:n}=s;return n.search!==t.search?t.search?{...s,selectedFolders:[],selectedNodesIds:[],selectedResources:[],currentFolder:void 0,searchParams:{...n,...t,trashed:!1,filters:{...n.filters,folder:void 0}}}:{...s,selectedFolders:[],selectedNodesIds:["default"],selectedResources:[],currentFolder:{id:"default"},searchParams:{...n,...t,trashed:!1,filters:{...n.filters}}}:{searchParams:{...n,...t}}})},setSelectedFolders:t=>r(()=>({selectedFolders:t})),setSelectedResources:t=>r(()=>({selectedResources:t})),setFolderIds:t=>r(()=>({folderIds:t})),setResourceIds:t=>r(()=>({resourceIds:t})),setResourceIsTrash:t=>r(()=>({resourceIsTrash:t})),setResourceActionDisable:t=>r(()=>({resourceActionDisable:t})),setCurrentFolder:t=>r(()=>({currentFolder:t})),clearSelectedItems:()=>r(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>r(()=>({resourceIds:[],folderIds:[]})),openResource:t=>{try{const{searchParams:s}=e();Er({searchParams:s,assetId:t.assetId})}catch(s){console.error("explorer open failed: ",s)}},printSelectedResource:()=>{try{const{searchParams:t,selectedResources:s,resourceIds:n}=e();if(s.length!==1)throw new Error("Cannot open more than 1 resource");const i=s.find(o=>o.id===n[0]);jr({searchParams:t,assetId:i.assetId})}catch(t){console.error("explorer print failed: ",t)}},openFolder:({folderId:t,folder:s})=>{const{searchParams:n,treeData:i}=e(),o=n.filters.folder,a=Cr(t,i),l=Me([...a,t]);o!==t&&r(c=>({...c,folderIds:[],resourceIds:[],selectedNodesIds:l,currentFolder:s||{id:t},searchParams:{...n,search:void 0,filters:{...n.filters,folder:t},trashed:t===q.BIN}}))},foldTreeItem:()=>r(t=>({...t,status:"fold"})),unfoldTreeItem:async(t,s)=>{const{treeData:n,searchParams:i}=e();if(r(o=>({...o,status:"unfold"})),!Lt(t,n)){await s.prefetchInfiniteQuery({initialPageParam:0,queryKey:["prefetchContext",{folderId:t,trashed:!1}],queryFn:async()=>await Et({...i,filters:{...i.filters,folder:t}})});const o=s.getQueryData(["prefetchContext",{folderId:t,trashed:!1}]);r(a=>{var l;return{...a,treeData:Ct(n,(l=o==null?void 0:o.pages[0])==null?void 0:l.folders,t||q.DEFAULT)}})}},selectTreeItem:t=>{const{treeData:s}=e(),{openFolder:n}=e().updaters,i=he(t,s);Ft()(),r(a=>({...a,searchParams:{...a.searchParams,search:void 0},status:"select",selectedResources:[]})),n({folder:i,folderId:t})},gotoPreviousFolder:()=>{const{selectedNodesIds:t,treeData:s}=e(),{openFolder:n}=e().updaters,i=t.length;if(i<2)return;const o=he(t[i-2],s);n({folder:o,folderId:(o==null?void 0:o.id)||q.DEFAULT})},goToTrash:()=>r(t=>({...t,selectedNodesIds:[],selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...t.searchParams,search:void 0,filters:{folder:q.BIN},trashed:!0},currentFolder:{id:q.BIN}}))}})),U=()=>A(r=>r.searchParams),He=()=>A(r=>r.selectedNodesIds),ae=()=>A(r=>r.treeData),vn=()=>A(r=>r.selectedFolders),wn=()=>A(r=>r.selectedResources),Dr=()=>A(r=>r.searchConfig),Ce=()=>A(r=>r.folderIds),De=()=>A(r=>r.resourceIds),Te=()=>A(r=>r.selectedResources.map(e=>e.assetId)),Ne=()=>A(r=>r.selectedResources.filter(e=>e.assetId===e.id)),ge=()=>A(r=>r.currentFolder),$=()=>A(r=>r.updaters),Ke=()=>{const r=ge();return(r==null?void 0:r.id)===q.BIN},Tr=()=>A(r=>r.resourceIsTrash),Nr=()=>A(r=>r.resourceActionDisable),Ar=()=>{const r=ge();return(r==null?void 0:r.id)==="default"},Fr=()=>He().length>1,$r=()=>A(r=>r.status),Dt=()=>{const r=U(),[e,t]=v.useState(""),s=Dr(),n=$r(),i=v.useRef(null),{setSearchParams:o}=$(),a=f=>{const d=f.target.value;t(d.toString())},l=f=>{(f.key==="Enter"||f.key==="Return")&&(f.preventDefault(),o({search:e||void 0}))},c=f=>{f.preventDefault(),o({search:e||void 0})};return v.useEffect(()=>{const d=e.length==0||e.length>=s.minLength?{search:e||void 0}:{};o({...r,...d})},[e,s.minLength]),v.useEffect(()=>{n==="select"&&t("")},[n]),v.useEffect(()=>{t(()=>{var f;return((f=r.search)==null?void 0:f.toString())??""})},[r]),{formRef:i,inputSearch:e,handleInputSearchChange:a,handleKeyPress:l,handleSearchSubmit:c}};function _r(){const{appCode:r}=G(),{gotoPreviousFolder:e}=$(),{t}=oe(),{inputSearch:s}=Dt(),n=He(),i=Ke(),o=ge(),a=t("explorer.tree.trash"),l=t("explorer.tree.search"),c=t("explorer.filters.mine",{ns:r}),f=(o==null?void 0:o.name)||c;return m.jsx("div",{className:"py-16",children:n.length>1&&!i?m.jsxs("div",{className:"d-flex align-items-center gap-8",children:[m.jsx($t,{icon:m.jsx(ns,{}),variant:"ghost",color:"tertiary","aria-label":t("back"),className:"ms-n16",onClick:e}),m.jsx("p",{className:"body py-8 text-truncate",children:m.jsx("strong",{children:f})})]}):m.jsx("h2",{className:"body py-8 fw-bold",children:s.length!==0?l:i?a:c})})}const kr=()=>{const r=Nr(),{clearSelectedIds:e,setResourceActionDisable:t,clearSelectedItems:s}=$();return{isActionDisableModalOpen:r,onActionDisableCancel:()=>{e(),s(),t(!1)}}},Ur=()=>{const r=Tr(),{clearSelectedIds:e,setResourceIsTrash:t,clearSelectedItems:s}=$();return{isTrashedModalOpen:r,onTrashedCancel:()=>{e(),s(),t(!1)}}};function Br(r,{parentId:e,newFolder:t}){return pe(r,s=>{var n;if(s.id===e){const i=[...((n=s.folder)==null?void 0:n.ancestors)||[]],o=Me([...i,s.id]);return{...s,children:[...s.children||[],new je({...t,ancestors:o})]}}else return s})}function qr(r,{folders:e}){return pe(r,t=>{if(!e.includes(t.id))return t})}function Vr(r,{destinationId:e,folders:t}){return pe(r,(s,n)=>{var i,o;if(e===s.id){const a=[...((i=s.folder)==null?void 0:i.ancestors)||[]],l=Me([...a,s.id]),c=[...s.children||[]],f=((o=s.children)==null?void 0:o.map(u=>u.id))||[];for(const u of t)if(!f.includes(u)){const p=he(u,r);p&&c.push({...p,folder:{...p==null?void 0:p.folder,ancestors:l}})}return{...s,children:c}}else return t.includes(s.id)&&e!==(n==null?void 0:n.id)?void 0:s})}function Mr(r,{folderId:e,newFolder:t}){return pe(r,s=>s.id===e?new je(t):s)}const Hr=()=>{const r=A(e=>e.config);return _t({queryKey:["actions"],queryFn:async()=>{const e=r==null?void 0:r.actions.map(s=>s.workflow);return await Ir(e)},select:e=>r==null?void 0:r.actions.map(t=>({...t,available:e[t.workflow]})),staleTime:1/0,enabled:!!r})},Kr=()=>{const r=A(o=>o.config),e=U(),{filters:t,trashed:s,search:n}=e,i=["context",{folderId:t.folder,filters:t,trashed:s,search:n}];return Ut({queryKey:i,queryFn:async({pageParam:o})=>await Et({...e,application:r==null?void 0:r.app,types:r==null?void 0:r.types,pagination:{...e.pagination,startIdx:o}}),initialPageParam:0,enabled:!!r,retry:!1,getNextPageParam:o=>o.pagination.startIdx+o.pagination.pageSize})},On=()=>{const r=z(),e=Q(),t=U(),s=ae(),n=Ce(),i=Te(),o=De(),a=Ne().length>0,l=a?i:o,{clearSelectedItems:c,clearSelectedIds:f,setTreeData:d,setSearchParams:u}=$(),{filters:p,trashed:g}=t,b=["context",{folderId:p.folder,filters:p,trashed:g}];return X({mutationFn:async()=>await Sr({searchParams:t,folderIds:n,resourceIds:l,useAssetIds:a}),onError(x){typeof x=="string"&&r.error(_(x))},onSuccess:async x=>{if(await e.cancelQueries({queryKey:b}),e.getQueryData(b))return r.success(_("explorer.trash.title")),e.setQueryData(b,P=>{var D;if(P){const O={...P,pages:P==null?void 0:P.pages.map(L=>{var E;return{...L,folders:L.folders.filter(T=>!n.includes(T.id)),pagination:{...L.pagination,maxIdx:((E=L==null?void 0:L.pagination)==null?void 0:E.maxIdx)-x.resources.length},resources:L.resources.filter(T=>a?!i.includes(T.assetId):!l.includes(T.id))}})},C=qr(s,{folders:n});return d(C),u({...t,pagination:{...t.pagination,maxIdx:((D=t.pagination)==null?void 0:D.maxIdx)-x.resources.length}}),O}})},onSettled:()=>{c(),f()}})},Rn=()=>{const r=z(),e=Q(),t=U(),s=Ce(),n=Te(),i=De(),o=Ne().length>0,a=o?n:i,{setFolderIds:l,setResourceIds:c,setSelectedResources:f,setSelectedFolders:d}=$(),{filters:u,trashed:p}=t,g=["context",{folderId:u.folder,filters:u,trashed:p}];return X({mutationFn:async()=>await wr({searchParams:t,folderIds:s,resourceIds:a,useAssetIds:o}),onError(b){typeof b=="string"&&r.error(_(b))},onSuccess:async()=>{if(await e.cancelQueries({queryKey:g}),e.getQueryData(g))return r.success(_("explorer.trash.toast")),e.setQueryData(g,x=>{if(x)return{...x,pages:x==null?void 0:x.pages.map(w=>({...w,folders:w.folders.filter(P=>!s.includes(P.id)),resources:w.resources.filter(P=>o?!n.includes(P.assetId):!a.includes(P.id))}))}})},onSettled:()=>{c([]),f([]),l([]),d([])}})},Pn=()=>{const r=z(),e=Q(),t=U(),s=Ce(),n=Te(),i=De(),o=Ne().length>0,a=o?n:i,{clearSelectedItems:l,clearSelectedIds:c}=$(),{filters:f,trashed:d}=t,u=["context",{folderId:f.folder,filters:f,trashed:d}];return X({mutationFn:async()=>await vr({searchParams:t,folderIds:s,resourceIds:a,useAssetIds:o}),onError(p){typeof p=="string"&&r.error(_(p))},onSuccess:async()=>{if(await e.cancelQueries({queryKey:u}),e.getQueryData(u))return r.success(_("explorer.removed.from.trash")),e.setQueryData(u,g=>{if(g)return{...g,pages:g==null?void 0:g.pages.map(x=>({...x,folders:x.folders.filter(w=>!s.includes(w.id)),resources:x.resources.filter(w=>o?!n.includes(w.assetId):!a.includes(w.id))}))}})},onSettled:()=>{l(),c()}})},In=()=>{const r=z(),e=Q(),t=U(),s=ae(),n=Ce(),i=Te(),o=De(),a=Ne().length>0,l=a?i:o,{clearSelectedIds:c,clearSelectedItems:f,setTreeData:d,setSearchParams:u}=$(),{filters:p,trashed:g}=t,b=["context",{folderId:p.folder,filters:p,trashed:g}];return X({mutationFn:async x=>await Or({searchParams:t,folderId:x,folderIds:n,resourceIds:l,useAssetIds:a}),onError(x){typeof x=="string"&&r.error(_(x))},onSuccess:async(x,w)=>{if(e.getQueryData(b))return e.setQueryData(b,D=>{var O;if(D){const C=Vr(s,{destinationId:w,folders:n}),L={...D,pages:D==null?void 0:D.pages.map(E=>{var T;return{...E,folders:E.folders.filter(N=>!n.includes(N.id)),pagination:{...E.pagination,maxIdx:((T=E.pagination)==null?void 0:T.maxIdx)-x.resources.length},resources:E.resources.filter(N=>a?!i.includes(N.assetId):!l.includes(N.id))}})};return d(C),u({...t,pagination:{...t.pagination,maxIdx:((O=t.pagination)==null?void 0:O.maxIdx)-x.resources.length}}),L}})},onSettled:()=>{f(),c()}})},En=()=>{const r=z(),e=Q(),t=U(),s=ae(),{setTreeData:n}=$(),{filters:i,trashed:o}=t,a=["context",{folderId:i.folder,filters:i,trashed:o}];return X({mutationFn:async({name:l,parentId:c})=>await br({searchParams:t,name:l,parentId:c}),onError(l){typeof l=="string"&&r.error(_(l))},onSuccess:async(l,c)=>{await e.cancelQueries({queryKey:a});const f=e.getQueryData(a),d={...l,parentId:c.parentId,children:[],rights:[`creator:${l==null?void 0:l.creator_id}`]};if(f)return e.setQueryData(a,u=>{if(u){const p={...u,pages:u==null?void 0:u.pages.map(b=>({...b,folders:[...b.folders,d]}))},g=Br(s,{parentId:c.parentId,newFolder:d});return n(g),p}})}})},Ln=()=>{const r=z(),e=Q(),t=U(),s=ae(),{setFolderIds:n,setSelectedFolders:i,setTreeData:o}=$(),{filters:a,trashed:l}=t,c=["context",{folderId:a.folder,filters:a,trashed:l}];return X({mutationFn:async({folderId:f,name:d,parentId:u})=>await xr({searchParams:t,folderId:f,parentId:u,name:d}),onError(f){typeof f=="string"&&r.error(_(f))},onSuccess:async(f,d)=>{if(await e.cancelQueries({queryKey:c}),e.getQueryData(c))return e.setQueryData(c,p=>{if(p){const g={...p,pages:p==null?void 0:p.pages.map(x=>({...x,folders:x.folders.map(w=>w.id===f.id?{...f,parentId:d.parentId,rights:w.rights}:w)}))},b=Mr(s,{folderId:d.folderId,newFolder:f});return o(b),g}})},onSettled:()=>{n([]),i([])}})},jn=()=>{const r=z(),e=Q(),t=U(),{setResourceIds:s,setSelectedResources:n}=$(),{filters:i,trashed:o}=t,a=["context",{folderId:i.folder,filters:i,trashed:o}];return X({mutationFn:async({resourceId:l,rights:c})=>await Rr({searchParams:t,resourceId:l,rights:c}),onError(l){typeof l=="string"&&r.error(_("explorer.shared.status.error"))},onSuccess:async(l,c)=>{if(await e.cancelQueries({queryKey:a}),e.getQueryData(a))return r.success(_("explorer.shared.status.saved")),e.setQueryData(a,d=>{if(d)return{...d,pages:d==null?void 0:d.pages.map(u=>({...u,resources:u.resources.map(p=>{if(p.assetId===(c==null?void 0:c.resourceId)){let g=[`creator:${p.creatorId}`];return(c==null?void 0:c.rights.length)>=1&&(g=[...g,...c.rights.flatMap(b=>b.actions.map(x=>`${b.type}:${b.id}:${x.id}`))]),{...p,rights:g}}else return p})}))}})},onSettled:()=>{s([]),n([])}})},Cn=()=>{const r=z(),e=Q(),t=U(),{filters:s,trashed:n}=t,i=["context",{folderId:s.folder,filters:s,trashed:n}];return X({mutationFn:async o=>await Pr({searchParams:t,params:o}),onError(o){typeof o=="string"&&r.error(_(o))},onSuccess:async(o,a)=>{if(await e.cancelQueries({queryKey:i}),e.getQueryData(i))return e.setQueryData(i,c=>{if(c)return{...c,pages:c==null?void 0:c.pages.map(f=>({...f,resources:f.resources.map(d=>{if(d.assetId===(a==null?void 0:a.entId)){const{name:u,thumbnail:p,public:g,description:b,slug:x,...w}=a;return{...d,...w,name:u,thumbnail:typeof p=="string"?p:URL.createObjectURL(p),public:g,description:b,slug:x}}else return d})}))}})}})},Dn=()=>{const r=z(),e=Q(),t=U(),{user:s}=kt(),{appCode:n}=G(),i=["context",{folderId:t.filters.folder,filters:t.filters,trashed:t.trashed}];return X({mutationFn:async o=>await Lr({searchParams:t,params:o}),onError(o){typeof o=="string"&&r.error(_(o))},onSuccess:async(o,a)=>{var d,u,p;await e.cancelQueries({queryKey:i});const l=e.getQueryData(i),{thumbnail:c}=a,f={...a,thumbnail:c?URL.createObjectURL(c):"",application:n,assetId:o._id||o.entId||"",id:o._id||o.entId||"",creatorId:s==null?void 0:s.userId,creatorName:s==null?void 0:s.username,createdAt:Date.now(),slug:a.slug||"",modifiedAt:((d=o.modified)==null?void 0:d.$date)||"",modifierId:((u=o.author)==null?void 0:u.userId)||"",modifierName:((p=o.author)==null?void 0:p.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${s==null?void 0:s.userId}`]};if(l)return e.setQueryData(i,g=>{if(g)return{...g,pages:g==null?void 0:g.pages.map(b=>({...b,resources:[f,...b.resources]}))}})}})},zr=v.lazy(async()=>await k(()=>import("./EmptyScreenApp.js"),["EmptyScreenApp.js","edifice-react.js","react.js","edifice-icons.js"])),Qr=v.lazy(async()=>await k(()=>import("./EmptyScreenSearch.js"),["EmptyScreenSearch.js","edifice-react.js","react.js","edifice-icons.js"])),Jr=v.lazy(async()=>await k(()=>import("./EmptyScreenError.js"),["EmptyScreenError.js","edifice-react.js","react.js","edifice-icons.js"])),Wr=v.lazy(async()=>await k(()=>import("./EmptyScreenNoContentInFolder.js"),["EmptyScreenNoContentInFolder.js","edifice-react.js","react.js","edifice-icons.js"])),Xr=v.lazy(async()=>await k(()=>import("./EmptyScreenTrash.js"),["EmptyScreenTrash.js","edifice-react.js","react.js","edifice-icons.js"])),Gr=v.lazy(async()=>await k(()=>import("./FoldersList.js"),["FoldersList.js","edifice-react.js","react.js","edifice-icons.js"])),Yr=v.lazy(async()=>await k(()=>import("./ResourcesList.js"),["ResourcesList.js","edifice-react.js","react.js","edifice-icons.js"])),Zr=()=>{const r=Ar(),e=Ke(),t=Fr(),s=U(),n=ge(),i=ae(),o=z(),{appCode:a}=G(),{t:l}=oe(),{setSearchParams:c,setSearchConfig:f,setTreeData:d}=$(),{data:u,isError:p,error:g,isLoading:b,isFetching:x,fetchNextPage:w}=Kr(),P=(u==null?void 0:u.pages[0].folders.length)===0,D=(u==null?void 0:u.pages[0].resources.length)===0,O=P&&D;return v.useEffect(()=>{var C,L,E;if(u){const T=[...((C=u==null?void 0:u.pages[0])==null?void 0:C.folders)??[]];(L=u==null?void 0:u.pages[0])!=null&&L.searchConfig&&f(u.pages[0].searchConfig),s.search||((n==null?void 0:n.id)==="default"?d({id:q.DEFAULT,section:!0,children:T.map(N=>new je(N)),name:l("explorer.filters.mine",{ns:a})}):d(Ct(i,T,s.filters.folder||q.DEFAULT))),c({...s,pagination:(E=u==null?void 0:u.pages[(u==null?void 0:u.pages.length)-1])==null?void 0:E.pagination})}},[u]),v.useEffect(()=>{g&&typeof g=="string"&&o.error(l(g))},[g]),b?m.jsx(H,{}):p?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Jr,{})}):s.search&&O?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Qr,{})}):r&&O?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(zr,{})}):t&&O&&!e?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Wr,{})}):e&&(u==null?void 0:u.pages[0].resources.length)===0?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Xr,{})}):m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(Gr,{data:u,isFetching:x}),m.jsx(Yr,{data:u,isFetching:x,fetchNextPage:w})]})},en=()=>{const{appCode:r,currentApp:e}=G(),{t}=oe(),[s,n]=v.useState(""),i=f=>{if(f==="0"){n("");return}n(f)},o=ge(),a=U(),{setSearchParams:l}=$();v.useEffect(()=>{const f=()=>s.includes("1")?!0:void 0,d=()=>s.includes("2")?!0:void 0,u=()=>s.includes("7")?!0:void 0;l({...a,filters:{owner:f(),public:u(),shared:d(),folder:o?o.id:"default"}})},[o,l,s]);const c=[{label:t("explorer.filter.all",{ns:r}),value:"0"},{label:t("explorer.filter.owner",{ns:r}),value:"1"},{label:t("explorer.filter.shared",{ns:r}),value:"2"},...(e==null?void 0:e.displayName)==Fe.EXERCIZER?[{label:"Exercices interactifs",value:"3"}]:[],...(e==null?void 0:e.displayName)==Fe.EXERCIZER?[{label:"Exercices à rendre",value:"4"}]:[],...(e==null?void 0:e.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(e==null?void 0:e.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(e==null?void 0:e.displayName)==Fe.BLOG?[{label:t("explorer.filter.public",{ns:r}),value:"7"}]:[]];return{selectedFilters:s,options:c,handleOnSelectFilter:i}},tn=()=>{const{appCode:r}=G(),{t:e}=oe(),{selectedFilters:t,options:s,handleOnSelectFilter:n}=en(),{formRef:i,inputSearch:o,handleInputSearchChange:a,handleKeyPress:l,handleSearchSubmit:c}=Dt(),f=t.length>0?t.length:void 0;return m.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8",ref:i,children:[m.jsxs(Bt,{id:"search",className:"input-group",children:[m.jsx(qt,{type:"search",placeholder:e("explorer.label.search",{ns:r}),size:"lg",noValidationIcon:!0,value:o,onChange:a,onKeyDown:l}),m.jsx(Vt,{type:"submit","aria-label":e("explorer.label.search",{ns:r}),onClick:c})]}),m.jsxs(se,{placement:"bottom-end",children:[m.jsx(se.Trigger,{label:e("explorer.filters"),icon:m.jsx(is,{width:20}),variant:"ghost",badgeContent:f}),m.jsx(se.Menu,{children:s.map(d=>d.value==="0"?m.jsxs(v.Fragment,{children:[m.jsx(se.RadioItem,{value:d.value,model:t,onChange:()=>n(d.value),children:d.label}),m.jsx(se.Separator,{})]},"0"):m.jsx(se.RadioItem,{value:d.value,model:t,onChange:()=>n(d.value),children:d.label},d.value))})]})]})},sn=({id:r,selected:e,onSelect:t})=>{const{t:s}=oe();return m.jsx("div",{className:"treeview",children:m.jsx("ul",{role:"tree",className:"m-0 p-0",children:m.jsx("li",{id:r,role:"treeitem","aria-selected":e,children:m.jsx("div",{children:m.jsx("div",{className:"action-container",children:m.jsx("div",{onClick:t,role:"button",tabIndex:0,children:m.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[m.jsx(os,{width:"20",height:"20"}),m.jsx("span",{children:s("explorer.tree.trash")})]})})})})})})})},rn=v.lazy(async()=>await k(()=>import("./FolderModal.js"),["FolderModal.js","edifice-react.js","react.js","edifice-icons.js"])),nn=()=>{const r=Q(),[e,t]=Mt(),s=ae(),n=Ke(),i=He(),{appCode:o}=G(),{t:a}=oe(["common",o]),{goToTrash:l,selectTreeItem:c,unfoldTreeItem:f,foldTreeItem:d,clearSelectedItems:u,clearSelectedIds:p}=$(),g=async x=>{await f(x,r)},b=()=>{u(),p(),t()};return m.jsxs(m.Fragment,{children:[m.jsx(Ht,{data:s,selectedNodesIds:i,onTreeItemSelect:c,onTreeItemFold:d,onTreeItemUnfold:g}),m.jsx(sn,{id:q.BIN,selected:n,onSelect:l}),m.jsx("div",{className:"d-grid my-16",children:m.jsx(Kt,{disabled:n,type:"button",color:"primary",variant:"outline",leftIcon:m.jsx(as,{}),onClick:b,children:a("explorer.folder.new")})}),m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:e&&m.jsx(rn,{edit:!1,isOpen:e,onSuccess:t,onCancel:t})})]})},on=v.lazy(async()=>await k(()=>import("./AppAction.js"),["AppAction.js","edifice-react.js","react.js","edifice-icons.js"])),an=v.lazy(async()=>await k(()=>import("./Library.js"),["Library.js","edifice-react.js","react.js","edifice-icons.js"])),ln=v.lazy(async()=>await k(()=>import("./ActionBarContainer.js"),["ActionBarContainer.js","edifice-react.js","react.js","edifice-icons.js"])),un=v.lazy(async()=>await k(()=>import("./DisableModal.js"),["DisableModal.js","edifice-react.js","react.js","edifice-icons.js"])),cn=v.lazy(async()=>await k(()=>import("./TrashModal.js"),["TrashModal.js","edifice-react.js","react.js","edifice-icons.js"])),fn=v.lazy(async()=>await k(()=>import("./OnboardingModal.js"),["OnboardingModal.js","edifice-react.js","react.js","edifice-icons.js"])),dn=({config:r})=>{const e=U(),{setConfig:t,setSearchParams:s}=$();v.useEffect(()=>{t(r||{}),s({...e,application:r.app,types:r.types})},[r]);const{currentApp:n}=G(),{data:i}=Hr(),{isTrashedModalOpen:o,onTrashedCancel:a}=Ur(),{isActionDisableModalOpen:l,onActionDisableCancel:c}=kr();zt();const f=Qe("publish",i),d=Qe("create",i);return r&&m.jsxs(m.Fragment,{children:[m.jsx(Qt,{render:()=>d?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(on,{})}):null,children:m.jsx(Jt,{app:n})}),m.jsxs(Ae,{className:"flex-grow-1",children:[m.jsx(Ae.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(nn,{}),f&&m.jsx(an,{})]})}),m.jsxs(Ae.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[m.jsx(tn,{}),m.jsx(_r,{}),m.jsx(Zr,{})]}),m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(ln,{}),m.jsx(fn,{id:"showOnboardingTrash",items:[{src:"onboarding/illu-trash-menu.svg",alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:"onboarding/illu-trash-notif.svg",alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:"onboarding/illu-trash-delete.svg",alt:"explorer.modal.onboarding.trash.screen3.alt",text:"explorer.modal.onboarding.trash.screen3.title"}],modalOptions:{title:"explorer.modal.onboarding.trash.title",prevText:"explorer.modal.onboarding.trash.prev",nextText:"explorer.modal.onboarding.trash.next",closeText:"explorer.modal.onboarding.trash.close"}}),o&&m.jsx(cn,{isOpen:o,onCancel:a}),l&&m.jsx(un,{isOpen:l,onCancel:c})]})]})]})};function hn(){const{init:r}=G(),e=zs();return r?m.jsx(Wt,{children:m.jsx(dn,{config:e})}):m.jsx(H,{position:!1})}const pn=document.getElementById("root"),gn=new Xt({queryCache:new Gt({onError:r=>{typeof r=="string"&&r==="0090"&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});wt(pn).render(m.jsx(v.StrictMode,{children:m.jsxs(Yt,{client:gn,children:[m.jsx(Zt,{params:{app:"blog"},children:m.jsx(es,{children:m.jsx(hn,{})})}),m.jsx(Ks,{initialIsOpen:!1})]})}));export{k as _,Hr as a,ge as b,Dn as c,Ke as d,A as e,De as f,wn as g,vn as h,Ce as i,Rn as j,Tr as k,jn as l,Cn as m,U as n,En as o,Ln as p,Pn as q,On as r,In as s,ae as t,$ as u};
18
+ */var Le=v,rr=sr;function nr(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var ir=typeof Object.is=="function"?Object.is:nr,or=rr.useSyncExternalStore,ar=Le.useRef,lr=Le.useEffect,ur=Le.useMemo,cr=Le.useDebugValue;Ot.useSyncExternalStoreWithSelector=function(r,e,t,s,n){var i=ar(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=ur(function(){function l(p){if(!c){if(c=!0,f=p,p=s(p),n!==void 0&&o.hasValue){var g=o.value;if(n(g,p))return d=g}return d=p}if(g=d,ir(f,p))return g;var b=s(p);return n!==void 0&&n(g,b)?g:(f=p,d=b)}var c=!1,f,d,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,s,n]);var a=or(r,i[0],i[1]);return lr(function(){o.hasValue=!0,o.value=a},[a]),cr(a),a};wt.exports=Ot;var fr=wt.exports;const dr=dt(fr),{useDebugValue:hr}=ss,{useSyncExternalStoreWithSelector:pr}=dr;function gr(r,e=r.getState,t){const s=pr(r.subscribe,r.getState,r.getServerState||r.getState,e,t);return hr(s),s}const ft=r=>{const e=typeof r=="function"?zs(r):r,t=(s,n)=>gr(e,s,n);return Object.assign(t,e),t},mr=r=>r?ft(r):ft,It=async r=>{const e=await V.resource(r.application).searchContext(r);return{...e,folders:e.folders.filter(t=>!t.trashed)}},yr=async({searchParams:r,name:e,parentId:t})=>{const s={name:e,parentId:t,application:r.application,type:r.types[0]};return await V.resource(r.application).createFolder(s)},br=async({folderId:r,searchParams:e,parentId:t,name:s})=>{const n={folderId:r,name:s,parentId:t,application:e.application,type:e.types[0]};return await V.resource(e.application).updateFolder(n)},xr=async({searchParams:r,resourceIds:e,useAssetIds:t,folderIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:s};return await V.resource(r.application).trashAll(n,t)},Sr=async({searchParams:r,resourceIds:e,useAssetIds:t,folderIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:s};return await V.resource(r.application).deleteAll(n,t)},vr=async({searchParams:r,resourceIds:e,folderIds:t,useAssetIds:s})=>{const n={application:r.application,resourceType:r.types[0],resourceIds:e,folderIds:t};return await V.resource(r.application).restoreAll(n,s)},wr=async({searchParams:r,resourceIds:e,folderId:t,folderIds:s,useAssetIds:n})=>{const i={application:r.application,folderId:t,resourceIds:e,folderIds:s};return await V.resource(r.application).moveToFolder(i,n)},Or=async({searchParams:r,resourceId:e,rights:t})=>await V.share().saveRights(r.application,e,t),Rr=async({searchParams:r,params:e})=>await V.resource(r.application).update(e),Pr=async r=>await V.rights().sessionHasWorkflowRights(r),Ir=({searchParams:r,assetId:e})=>{const t=V.resource(r.application).getViewUrl(e);window.open(t,"_self")},Er=({searchParams:r,params:e})=>V.resource(r.application).create(e),Lr=({searchParams:r,assetId:e})=>{const t=V.resource(r.application).getPrintUrl(e);return window.open(t,"_blank")};function Ve(r){return r.filter((e,t)=>r.indexOf(e)===t)}function he(r,e){var s,n;let t;return(e==null?void 0:e.id)===r?e:((s=e==null?void 0:e.children)!=null&&s.length&&((n=e==null?void 0:e.children)==null||n.every(i=>(t=he(r,i),t===void 0))),t)}function jr(r,e){var s;const t=he(r,e);return(s=t==null?void 0:t.folder)!=null&&s.ancestors?[...(t==null?void 0:t.folder.ancestors)||[],r]:r===q.BIN?[q.BIN]:[q.DEFAULT]}function Et(r,e){return e.id===r&&e.children?e.children.length>0:e.children?e.children.some(t=>Et(e.id,t)):!1}function pe(r,e){return Lt(r,e)||r}function Lt(r,e,t){var n;const s=e(r,t);if((n=s==null?void 0:s.children)!=null&&n.length){const i=[];for(const o of(s==null?void 0:s.children)||[]){const a=Lt(o,e,s);a&&i.push(a)}return{...s,children:i}}return s}class je{constructor(e){te(this,"id");te(this,"name");te(this,"childNumber");te(this,"section",!1);te(this,"children",[]);this.folder=e,this.id=e.id,this.name=e.name,this.childNumber=e.childNumber}}const jt=(r,e,t)=>pe(r,s=>(s.id===t&&(s.children=e==null?void 0:e.map(n=>new je(n))),s)),A=mr()((r,e)=>({config:null,searchConfig:{minLength:1},searchParams:{filters:{folder:"default",owner:void 0,shared:void 0,public:void 0},orders:{updatedAt:"desc"},application:"",types:[],pagination:{startIdx:0,pageSize:48,maxIdx:0},trashed:!1},treeData:{id:q.DEFAULT,name:_("explorer.filters.mine"),section:!0,children:[]},selectedNodesIds:["default"],currentFolder:{id:"default"},selectedFolders:[],selectedResources:[],folderIds:[],resourceIds:[],resourceIsTrash:!1,resourceActionDisable:!1,status:void 0,updaters:{setConfig:t=>r({config:t}),setSearchConfig:t=>r(s=>({searchConfig:{...s.searchConfig,...t}})),setTreeData:t=>r(()=>({treeData:t})),setSearchParams:t=>{r(s=>{const{searchParams:n}=s;return n.search!==t.search?t.search?{...s,selectedFolders:[],selectedNodesIds:[],selectedResources:[],currentFolder:void 0,searchParams:{...n,...t,trashed:!1,filters:{...n.filters,folder:void 0}}}:{...s,selectedFolders:[],selectedNodesIds:["default"],selectedResources:[],currentFolder:{id:"default"},searchParams:{...n,...t,trashed:!1,filters:{...n.filters}}}:{searchParams:{...n,...t}}})},setSelectedFolders:t=>r(()=>({selectedFolders:t})),setSelectedResources:t=>r(()=>({selectedResources:t})),setFolderIds:t=>r(()=>({folderIds:t})),setResourceIds:t=>r(()=>({resourceIds:t})),setResourceIsTrash:t=>r(()=>({resourceIsTrash:t})),setResourceActionDisable:t=>r(()=>({resourceActionDisable:t})),setCurrentFolder:t=>r(()=>({currentFolder:t})),clearSelectedItems:()=>r(()=>({selectedFolders:[],selectedResources:[]})),clearSelectedIds:()=>r(()=>({resourceIds:[],folderIds:[]})),openResource:t=>{try{const{searchParams:s}=e();Ir({searchParams:s,assetId:t.assetId})}catch(s){console.error("explorer open failed: ",s)}},printSelectedResource:()=>{try{const{searchParams:t,selectedResources:s,resourceIds:n}=e();if(s.length!==1)throw new Error("Cannot open more than 1 resource");const i=s.find(o=>o.id===n[0]);Lr({searchParams:t,assetId:i.assetId})}catch(t){console.error("explorer print failed: ",t)}},openFolder:({folderId:t,folder:s})=>{const{searchParams:n,treeData:i}=e(),o=n.filters.folder,a=jr(t,i),l=Ve([...a,t]);o!==t&&r(c=>({...c,folderIds:[],resourceIds:[],selectedNodesIds:l,currentFolder:s||{id:t},searchParams:{...n,search:void 0,filters:{...n.filters,folder:t},trashed:t===q.BIN}}))},foldTreeItem:()=>r(t=>({...t,status:"fold"})),unfoldTreeItem:async(t,s)=>{const{treeData:n,searchParams:i}=e();if(r(o=>({...o,status:"unfold"})),!Et(t,n)){await s.prefetchInfiniteQuery({initialPageParam:0,queryKey:["prefetchContext",{folderId:t,trashed:!1}],queryFn:async()=>await It({...i,filters:{...i.filters,folder:t}})});const o=s.getQueryData(["prefetchContext",{folderId:t,trashed:!1}]);r(a=>{var l;return{...a,treeData:jt(n,(l=o==null?void 0:o.pages[0])==null?void 0:l.folders,t||q.DEFAULT)}})}},selectTreeItem:t=>{const{treeData:s}=e(),{openFolder:n}=e().updaters,i=he(t,s);At()(),r(a=>({...a,searchParams:{...a.searchParams,search:void 0},status:"select",selectedResources:[]})),n({folder:i,folderId:t})},gotoPreviousFolder:()=>{const{selectedNodesIds:t,treeData:s}=e(),{openFolder:n}=e().updaters,i=t.length;if(i<2)return;const o=he(t[i-2],s);n({folder:o,folderId:(o==null?void 0:o.id)||q.DEFAULT})},goToTrash:()=>r(t=>({...t,selectedNodesIds:[],selectedResources:[],resourceIds:[],folderIds:[],status:"select",searchParams:{...t.searchParams,search:void 0,filters:{folder:q.BIN},trashed:!0},currentFolder:{id:q.BIN}}))}})),U=()=>A(r=>r.searchParams),Me=()=>A(r=>r.selectedNodesIds),ae=()=>A(r=>r.treeData),Sn=()=>A(r=>r.selectedFolders),vn=()=>A(r=>r.selectedResources),Dr=()=>A(r=>r.searchConfig),De=()=>A(r=>r.folderIds),Ce=()=>A(r=>r.resourceIds),Te=()=>A(r=>r.selectedResources.map(e=>e.assetId)),Ne=()=>A(r=>r.selectedResources.filter(e=>e.assetId===e.id)),ge=()=>A(r=>r.currentFolder),$=()=>A(r=>r.updaters),He=()=>{const r=ge();return(r==null?void 0:r.id)===q.BIN},Cr=()=>A(r=>r.resourceIsTrash),Tr=()=>A(r=>r.resourceActionDisable),Nr=()=>{const r=ge();return(r==null?void 0:r.id)==="default"},Ar=()=>Me().length>1,Fr=()=>A(r=>r.status),Dt=()=>{const r=U(),[e,t]=v.useState(""),s=Dr(),n=Fr(),i=v.useRef(null),{setSearchParams:o}=$(),a=f=>{const d=f.target.value;t(d.toString())},l=f=>{(f.key==="Enter"||f.key==="Return")&&(f.preventDefault(),o({search:e||void 0}))},c=f=>{f.preventDefault(),o({search:e||void 0})};return v.useEffect(()=>{const d=e.length==0||e.length>=s.minLength?{search:e||void 0}:{};o({...r,...d})},[e,s.minLength]),v.useEffect(()=>{n==="select"&&t("")},[n]),v.useEffect(()=>{t(()=>{var f;return((f=r.search)==null?void 0:f.toString())??""})},[r]),{formRef:i,inputSearch:e,handleInputSearchChange:a,handleKeyPress:l,handleSearchSubmit:c}};function $r(){const{appCode:r}=G(),{gotoPreviousFolder:e}=$(),{t}=oe(),{inputSearch:s}=Dt(),n=Me(),i=He(),o=ge(),a=t("explorer.tree.trash"),l=t("explorer.tree.search"),c=t("explorer.filters.mine",{ns:r}),f=(o==null?void 0:o.name)||c;return m.jsx("div",{className:"py-16",children:n.length>1&&!i?m.jsxs("div",{className:"d-flex align-items-center gap-8",children:[m.jsx(Ft,{icon:m.jsx(rs,{}),variant:"ghost",color:"tertiary","aria-label":t("back"),className:"ms-n16",onClick:e}),m.jsx("p",{className:"body py-8 text-truncate",children:m.jsx("strong",{children:f})})]}):m.jsx("h2",{className:"body py-8 fw-bold",children:s.length!==0?l:i?a:c})})}const _r=()=>{const r=Tr(),{clearSelectedIds:e,setResourceActionDisable:t,clearSelectedItems:s}=$();return{isActionDisableModalOpen:r,onActionDisableCancel:()=>{e(),s(),t(!1)}}},kr=()=>{const r=Cr(),{clearSelectedIds:e,setResourceIsTrash:t,clearSelectedItems:s}=$();return{isTrashedModalOpen:r,onTrashedCancel:()=>{e(),s(),t(!1)}}};function Ur(r,{parentId:e,newFolder:t}){return pe(r,s=>{var n;if(s.id===e){const i=[...((n=s.folder)==null?void 0:n.ancestors)||[]],o=Ve([...i,s.id]);return{...s,children:[...s.children||[],new je({...t,ancestors:o})]}}else return s})}function Br(r,{folders:e}){return pe(r,t=>{if(!e.includes(t.id))return t})}function qr(r,{destinationId:e,folders:t}){return pe(r,(s,n)=>{var i,o;if(e===s.id){const a=[...((i=s.folder)==null?void 0:i.ancestors)||[]],l=Ve([...a,s.id]),c=[...s.children||[]],f=((o=s.children)==null?void 0:o.map(u=>u.id))||[];for(const u of t)if(!f.includes(u)){const p=he(u,r);p&&c.push({...p,folder:{...p==null?void 0:p.folder,ancestors:l}})}return{...s,children:c}}else return t.includes(s.id)&&e!==(n==null?void 0:n.id)?void 0:s})}function Vr(r,{folderId:e,newFolder:t}){return pe(r,s=>s.id===e?new je(t):s)}const Mr=()=>{const r=A(e=>e.config);return $t({queryKey:["actions"],queryFn:async()=>{const e=r==null?void 0:r.actions.map(s=>s.workflow);return await Pr(e)},select:e=>r==null?void 0:r.actions.map(t=>({...t,available:e[t.workflow]})),staleTime:1/0,enabled:!!r})},Hr=()=>{const r=A(o=>o.config),e=U(),{filters:t,trashed:s,search:n}=e,i=["context",{folderId:t.folder,filters:t,trashed:s,search:n}];return kt({queryKey:i,queryFn:async({pageParam:o})=>await It({...e,application:r==null?void 0:r.app,types:r==null?void 0:r.types,pagination:{...e.pagination,startIdx:o}}),initialPageParam:0,enabled:!!r,retry:!1,getNextPageParam:o=>o.pagination.startIdx+o.pagination.pageSize})},wn=()=>{const r=z(),e=Q(),t=U(),s=ae(),n=De(),i=Te(),o=Ce(),a=Ne().length>0,l=a?i:o,{clearSelectedItems:c,clearSelectedIds:f,setTreeData:d,setSearchParams:u}=$(),{filters:p,trashed:g}=t,b=["context",{folderId:p.folder,filters:p,trashed:g}];return X({mutationFn:async()=>await xr({searchParams:t,folderIds:n,resourceIds:l,useAssetIds:a}),onError(x){typeof x=="string"&&r.error(_(x))},onSuccess:async x=>{if(await e.cancelQueries({queryKey:b}),e.getQueryData(b))return r.success(_("explorer.trash.title")),e.setQueryData(b,P=>{var C;if(P){const O={...P,pages:P==null?void 0:P.pages.map(L=>{var E;return{...L,folders:L.folders.filter(T=>!n.includes(T.id)),pagination:{...L.pagination,maxIdx:((E=L==null?void 0:L.pagination)==null?void 0:E.maxIdx)-x.resources.length},resources:L.resources.filter(T=>a?!i.includes(T.assetId):!l.includes(T.id))}})},D=Br(s,{folders:n});return d(D),u({...t,pagination:{...t.pagination,maxIdx:((C=t.pagination)==null?void 0:C.maxIdx)-x.resources.length}}),O}})},onSettled:()=>{c(),f()}})},On=()=>{const r=z(),e=Q(),t=U(),s=De(),n=Te(),i=Ce(),o=Ne().length>0,a=o?n:i,{setFolderIds:l,setResourceIds:c,setSelectedResources:f,setSelectedFolders:d}=$(),{filters:u,trashed:p}=t,g=["context",{folderId:u.folder,filters:u,trashed:p}];return X({mutationFn:async()=>await vr({searchParams:t,folderIds:s,resourceIds:a,useAssetIds:o}),onError(b){typeof b=="string"&&r.error(_(b))},onSuccess:async()=>{if(await e.cancelQueries({queryKey:g}),e.getQueryData(g))return r.success(_("explorer.trash.toast")),e.setQueryData(g,x=>{if(x)return{...x,pages:x==null?void 0:x.pages.map(w=>({...w,folders:w.folders.filter(P=>!s.includes(P.id)),resources:w.resources.filter(P=>o?!n.includes(P.assetId):!a.includes(P.id))}))}})},onSettled:()=>{c([]),f([]),l([]),d([])}})},Rn=()=>{const r=z(),e=Q(),t=U(),s=De(),n=Te(),i=Ce(),o=Ne().length>0,a=o?n:i,{clearSelectedItems:l,clearSelectedIds:c}=$(),{filters:f,trashed:d}=t,u=["context",{folderId:f.folder,filters:f,trashed:d}];return X({mutationFn:async()=>await Sr({searchParams:t,folderIds:s,resourceIds:a,useAssetIds:o}),onError(p){typeof p=="string"&&r.error(_(p))},onSuccess:async()=>{if(await e.cancelQueries({queryKey:u}),e.getQueryData(u))return r.success(_("explorer.removed.from.trash")),e.setQueryData(u,g=>{if(g)return{...g,pages:g==null?void 0:g.pages.map(x=>({...x,folders:x.folders.filter(w=>!s.includes(w.id)),resources:x.resources.filter(w=>o?!n.includes(w.assetId):!a.includes(w.id))}))}})},onSettled:()=>{l(),c()}})},Pn=()=>{const r=z(),e=Q(),t=U(),s=ae(),n=De(),i=Te(),o=Ce(),a=Ne().length>0,l=a?i:o,{clearSelectedIds:c,clearSelectedItems:f,setTreeData:d,setSearchParams:u}=$(),{filters:p,trashed:g}=t,b=["context",{folderId:p.folder,filters:p,trashed:g}];return X({mutationFn:async x=>await wr({searchParams:t,folderId:x,folderIds:n,resourceIds:l,useAssetIds:a}),onError(x){typeof x=="string"&&r.error(_(x))},onSuccess:async(x,w)=>{if(e.getQueryData(b))return e.setQueryData(b,C=>{var O;if(C){const D=qr(s,{destinationId:w,folders:n}),L={...C,pages:C==null?void 0:C.pages.map(E=>{var T;return{...E,folders:E.folders.filter(N=>!n.includes(N.id)),pagination:{...E.pagination,maxIdx:((T=E.pagination)==null?void 0:T.maxIdx)-x.resources.length},resources:E.resources.filter(N=>a?!i.includes(N.assetId):!l.includes(N.id))}})};return d(D),u({...t,pagination:{...t.pagination,maxIdx:((O=t.pagination)==null?void 0:O.maxIdx)-x.resources.length}}),L}})},onSettled:()=>{f(),c()}})},In=()=>{const r=z(),e=Q(),t=U(),s=ae(),{setTreeData:n}=$(),{filters:i,trashed:o}=t,a=["context",{folderId:i.folder,filters:i,trashed:o}];return X({mutationFn:async({name:l,parentId:c})=>await yr({searchParams:t,name:l,parentId:c}),onError(l){typeof l=="string"&&r.error(_(l))},onSuccess:async(l,c)=>{await e.cancelQueries({queryKey:a});const f=e.getQueryData(a),d={...l,parentId:c.parentId,children:[],rights:[`creator:${l==null?void 0:l.creator_id}`]};if(f)return e.setQueryData(a,u=>{if(u){const p={...u,pages:u==null?void 0:u.pages.map(b=>({...b,folders:[...b.folders,d]}))},g=Ur(s,{parentId:c.parentId,newFolder:d});return n(g),p}})}})},En=()=>{const r=z(),e=Q(),t=U(),s=ae(),{setFolderIds:n,setSelectedFolders:i,setTreeData:o}=$(),{filters:a,trashed:l}=t,c=["context",{folderId:a.folder,filters:a,trashed:l}];return X({mutationFn:async({folderId:f,name:d,parentId:u})=>await br({searchParams:t,folderId:f,parentId:u,name:d}),onError(f){typeof f=="string"&&r.error(_(f))},onSuccess:async(f,d)=>{if(await e.cancelQueries({queryKey:c}),e.getQueryData(c))return e.setQueryData(c,p=>{if(p){const g={...p,pages:p==null?void 0:p.pages.map(x=>({...x,folders:x.folders.map(w=>w.id===f.id?{...f,parentId:d.parentId,rights:w.rights}:w)}))},b=Vr(s,{folderId:d.folderId,newFolder:f});return o(b),g}})},onSettled:()=>{n([]),i([])}})},Ln=()=>{const r=z(),e=Q(),t=U(),{setResourceIds:s,setSelectedResources:n}=$(),{filters:i,trashed:o}=t,a=["context",{folderId:i.folder,filters:i,trashed:o}];return X({mutationFn:async({resourceId:l,rights:c})=>await Or({searchParams:t,resourceId:l,rights:c}),onError(l){typeof l=="string"&&r.error(_("explorer.shared.status.error"))},onSuccess:async(l,c)=>{if(await e.cancelQueries({queryKey:a}),e.getQueryData(a))return r.success(_("explorer.shared.status.saved")),e.setQueryData(a,d=>{if(d)return{...d,pages:d==null?void 0:d.pages.map(u=>({...u,resources:u.resources.map(p=>{if(p.assetId===(c==null?void 0:c.resourceId)){let g=[`creator:${p.creatorId}`];return(c==null?void 0:c.rights.length)>=1&&(g=[...g,...c.rights.flatMap(b=>b.actions.map(x=>`${b.type}:${b.id}:${x.id}`))]),{...p,rights:g}}else return p})}))}})},onSettled:()=>{s([]),n([])}})},jn=()=>{const r=z(),e=Q(),t=U(),{filters:s,trashed:n}=t,i=["context",{folderId:s.folder,filters:s,trashed:n}];return X({mutationFn:async o=>await Rr({searchParams:t,params:o}),onError(o){typeof o=="string"&&r.error(_(o))},onSuccess:async(o,a)=>{if(await e.cancelQueries({queryKey:i}),e.getQueryData(i))return e.setQueryData(i,c=>{if(c)return{...c,pages:c==null?void 0:c.pages.map(f=>({...f,resources:f.resources.map(d=>{if(d.assetId===(a==null?void 0:a.entId)){const{name:u,thumbnail:p,public:g,description:b,slug:x,...w}=a;return{...d,...w,name:u,thumbnail:typeof p=="string"?p:URL.createObjectURL(p),public:g,description:b,slug:x}}else return d})}))}})}})},Dn=()=>{const r=z(),e=Q(),t=U(),{user:s}=_t(),{appCode:n}=G(),i=["context",{folderId:t.filters.folder,filters:t.filters,trashed:t.trashed}];return X({mutationFn:async o=>await Er({searchParams:t,params:o}),onError(o){typeof o=="string"&&r.error(_(o))},onSuccess:async(o,a)=>{var d,u,p;await e.cancelQueries({queryKey:i});const l=e.getQueryData(i),{thumbnail:c}=a,f={...a,thumbnail:c?URL.createObjectURL(c):"",application:n,assetId:o._id||o.entId||"",id:o._id||o.entId||"",creatorId:s==null?void 0:s.userId,creatorName:s==null?void 0:s.username,createdAt:Date.now(),slug:a.slug||"",modifiedAt:((d=o.modified)==null?void 0:d.$date)||"",modifierId:((u=o.author)==null?void 0:u.userId)||"",modifierName:((p=o.author)==null?void 0:p.username)||"",updatedAt:Date.now(),trashed:!1,rights:[`creator:${s==null?void 0:s.userId}`]};if(l)return e.setQueryData(i,g=>{if(g)return{...g,pages:g==null?void 0:g.pages.map(b=>({...b,resources:[f,...b.resources]}))}})}})},Kr=v.lazy(async()=>await k(()=>import("./EmptyScreenApp.js"),["EmptyScreenApp.js","edifice-react.js","react.js","edifice-icons.js"])),zr=v.lazy(async()=>await k(()=>import("./EmptyScreenSearch.js"),["EmptyScreenSearch.js","edifice-react.js","react.js","edifice-icons.js"])),Qr=v.lazy(async()=>await k(()=>import("./EmptyScreenError.js"),["EmptyScreenError.js","edifice-react.js","react.js","edifice-icons.js"])),Jr=v.lazy(async()=>await k(()=>import("./EmptyScreenNoContentInFolder.js"),["EmptyScreenNoContentInFolder.js","edifice-react.js","react.js","edifice-icons.js"])),Wr=v.lazy(async()=>await k(()=>import("./EmptyScreenTrash.js"),["EmptyScreenTrash.js","edifice-react.js","react.js","edifice-icons.js"])),Xr=v.lazy(async()=>await k(()=>import("./FoldersList.js"),["FoldersList.js","edifice-react.js","react.js","edifice-icons.js"])),Gr=v.lazy(async()=>await k(()=>import("./ResourcesList.js"),["ResourcesList.js","edifice-react.js","react.js","edifice-icons.js"])),Yr=()=>{const r=Nr(),e=He(),t=Ar(),s=U(),n=ge(),i=ae(),o=z(),{appCode:a}=G(),{t:l}=oe(),{setSearchParams:c,setSearchConfig:f,setTreeData:d}=$(),{data:u,isError:p,error:g,isLoading:b,isFetching:x,fetchNextPage:w}=Hr(),P=(u==null?void 0:u.pages[0].folders.length)===0,C=(u==null?void 0:u.pages[0].resources.length)===0,O=P&&C;return v.useEffect(()=>{var D,L,E;if(u){const T=[...((D=u==null?void 0:u.pages[0])==null?void 0:D.folders)??[]];(L=u==null?void 0:u.pages[0])!=null&&L.searchConfig&&f(u.pages[0].searchConfig),s.search||((n==null?void 0:n.id)==="default"?d({id:q.DEFAULT,section:!0,children:T.map(N=>new je(N)),name:l("explorer.filters.mine",{ns:a})}):d(jt(i,T,s.filters.folder||q.DEFAULT))),c({...s,pagination:(E=u==null?void 0:u.pages[(u==null?void 0:u.pages.length)-1])==null?void 0:E.pagination})}},[u]),v.useEffect(()=>{g&&typeof g=="string"&&o.error(l(g))},[g]),b?m.jsx(H,{}):p?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Qr,{})}):s.search&&O?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(zr,{})}):r&&O?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Kr,{})}):t&&O&&!e?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Jr,{})}):e&&(u==null?void 0:u.pages[0].resources.length)===0?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(Wr,{})}):m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(Xr,{data:u,isFetching:x}),m.jsx(Gr,{data:u,isFetching:x,fetchNextPage:w})]})},Zr=()=>{const{appCode:r,currentApp:e}=G(),{t}=oe(),[s,n]=v.useState(""),i=f=>{if(f==="0"){n("");return}n(f)},o=ge(),a=U(),{setSearchParams:l}=$();v.useEffect(()=>{const f=()=>s.includes("1")?!0:void 0,d=()=>s.includes("2")?!0:void 0,u=()=>s.includes("7")?!0:void 0;l({...a,filters:{owner:f(),public:u(),shared:d(),folder:o?o.id:"default"}})},[o,l,s]);const c=[{label:t("explorer.filter.all",{ns:r}),value:"0"},{label:t("explorer.filter.owner",{ns:r}),value:"1"},{label:t("explorer.filter.shared",{ns:r}),value:"2"},...(e==null?void 0:e.displayName)=="exercizer"?[{label:"Exercices interactifs",value:"3"}]:[],...(e==null?void 0:e.displayName)=="exercizer"?[{label:"Exercices à rendre",value:"4"}]:[],...(e==null?void 0:e.displayName)=="pages"?[{label:"Projets publics",value:"5"}]:[],...(e==null?void 0:e.displayName)=="pages"?[{label:"Projets internes",value:"6"}]:[],...(e==null?void 0:e.displayName)=="blog"?[{label:t("explorer.filter.public",{ns:r}),value:"7"}]:[]];return{selectedFilters:s,options:c,handleOnSelectFilter:i}},en=()=>{const{appCode:r}=G(),{t:e}=oe(),{selectedFilters:t,options:s,handleOnSelectFilter:n}=Zr(),{formRef:i,inputSearch:o,handleInputSearchChange:a,handleKeyPress:l,handleSearchSubmit:c}=Dt(),f=t.length>0?t.length:void 0;return m.jsxs("form",{noValidate:!0,className:"bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative z-3 d-flex gap-8",ref:i,children:[m.jsxs(Ut,{id:"search",className:"input-group",children:[m.jsx(Bt,{type:"search",placeholder:e("explorer.label.search",{ns:r}),size:"lg",noValidationIcon:!0,value:o,onChange:a,onKeyDown:l}),m.jsx(qt,{type:"submit","aria-label":e("explorer.label.search",{ns:r}),onClick:c})]}),m.jsxs(se,{placement:"bottom-end",children:[m.jsx(se.Trigger,{label:e("explorer.filters"),icon:m.jsx(ns,{width:20}),variant:"ghost",badgeContent:f}),m.jsx(se.Menu,{children:s.map(d=>d.value==="0"?m.jsxs(v.Fragment,{children:[m.jsx(se.RadioItem,{value:d.value,model:t,onChange:()=>n(d.value),children:d.label}),m.jsx(se.Separator,{})]},"0"):m.jsx(se.RadioItem,{value:d.value,model:t,onChange:()=>n(d.value),children:d.label},d.value))})]})]})},tn=({id:r,selected:e,onSelect:t})=>{const{t:s}=oe();return m.jsx("div",{className:"treeview",children:m.jsx("ul",{role:"tree",className:"m-0 p-0",children:m.jsx("li",{id:r,role:"treeitem","aria-selected":e,children:m.jsx("div",{children:m.jsx("div",{className:"action-container",children:m.jsx("div",{onClick:t,role:"button",tabIndex:0,children:m.jsxs("div",{className:"d-flex align-items-center gap-8 py-8 ps-24",children:[m.jsx(is,{width:"20",height:"20"}),m.jsx("span",{children:s("explorer.tree.trash")})]})})})})})})})},sn=v.lazy(async()=>await k(()=>import("./FolderModal.js"),["FolderModal.js","edifice-react.js","react.js","edifice-icons.js"])),rn=()=>{const r=Q(),[e,t]=Vt(),s=ae(),n=He(),i=Me(),{appCode:o}=G(),{t:a}=oe(["common",o]),{goToTrash:l,selectTreeItem:c,unfoldTreeItem:f,foldTreeItem:d,clearSelectedItems:u,clearSelectedIds:p}=$(),g=async x=>{await f(x,r)},b=()=>{u(),p(),t()};return m.jsxs(m.Fragment,{children:[m.jsx(Mt,{data:s,selectedNodesIds:i,onTreeItemSelect:c,onTreeItemFold:d,onTreeItemUnfold:g}),m.jsx(tn,{id:q.BIN,selected:n,onSelect:l}),m.jsx("div",{className:"d-grid my-16",children:m.jsx(Ht,{disabled:n,type:"button",color:"primary",variant:"outline",leftIcon:m.jsx(os,{}),onClick:b,children:a("explorer.folder.new")})}),m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:e&&m.jsx(sn,{edit:!1,isOpen:e,onSuccess:t,onCancel:t})})]})},nn=v.lazy(async()=>await k(()=>import("./AppAction.js"),["AppAction.js","edifice-react.js","react.js","edifice-icons.js"])),on=v.lazy(async()=>await k(()=>import("./Library.js"),["Library.js","edifice-react.js","react.js","edifice-icons.js"])),an=v.lazy(async()=>await k(()=>import("./ActionBarContainer.js"),["ActionBarContainer.js","edifice-react.js","react.js","edifice-icons.js"])),ln=v.lazy(async()=>await k(()=>import("./DisableModal.js"),["DisableModal.js","edifice-react.js","react.js","edifice-icons.js"])),un=v.lazy(async()=>await k(()=>import("./TrashModal.js"),["TrashModal.js","edifice-react.js","react.js","edifice-icons.js"])),cn=v.lazy(async()=>await k(()=>import("./OnboardingModal.js"),["OnboardingModal.js","edifice-react.js","react.js","edifice-icons.js"])),fn=({config:r})=>{const e=U(),{setConfig:t,setSearchParams:s}=$();v.useEffect(()=>{t(r||{}),s({...e,application:r.app,types:r.types})},[r]);const{currentApp:n}=G(),{data:i}=Mr(),{isTrashedModalOpen:o,onTrashedCancel:a}=kr(),{isActionDisableModalOpen:l,onActionDisableCancel:c}=_r();Kt();const f=ze("publish",i),d=ze("create",i);return r&&m.jsxs(m.Fragment,{children:[m.jsx(zt,{render:()=>d?m.jsx(v.Suspense,{fallback:m.jsx(H,{}),children:m.jsx(nn,{})}):null,children:m.jsx(Qt,{app:n})}),m.jsxs(Ae,{className:"flex-grow-1",children:[m.jsx(Ae.Col,{sm:"3",lg:"2",xl:"3",className:"border-end pt-16 pe-16 d-none d-lg-block",as:"aside",children:m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(rn,{}),f&&m.jsx(on,{})]})}),m.jsxs(Ae.Col,{sm:"4",md:"8",lg:"6",xl:"9",children:[m.jsx(en,{}),m.jsx($r,{}),m.jsx(Yr,{})]}),m.jsxs(v.Suspense,{fallback:m.jsx(H,{}),children:[m.jsx(an,{}),m.jsx(cn,{id:"showOnboardingTrash",items:[{src:"onboarding/illu-trash-menu.svg",alt:"explorer.modal.onboarding.trash.screen1.alt",text:"explorer.modal.onboarding.trash.screen1.title"},{src:"onboarding/illu-trash-notif.svg",alt:"explorer.modal.onboarding.trash.screen2.alt",text:"explorer.modal.onboarding.trash.screen2.alt"},{src:"onboarding/illu-trash-delete.svg",alt:"explorer.modal.onboarding.trash.screen3.alt",text:"explorer.modal.onboarding.trash.screen3.title"}],modalOptions:{title:"explorer.modal.onboarding.trash.title",prevText:"explorer.modal.onboarding.trash.prev",nextText:"explorer.modal.onboarding.trash.next",closeText:"explorer.modal.onboarding.trash.close"}}),o&&m.jsx(un,{isOpen:o,onCancel:a}),l&&m.jsx(ln,{isOpen:l,onCancel:c})]})]})]})};function dn(){const{init:r}=G(),e=Ks();return r?m.jsx(Jt,{children:m.jsx(fn,{config:e})}):m.jsx(H,{position:!1})}const hn=document.getElementById("root"),pn=new Wt({queryCache:new Xt({onError:r=>{typeof r=="string"&&r==="0090"&&window.location.replace("/auth/login")}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});vt(hn).render(m.jsx(v.StrictMode,{children:m.jsxs(Gt,{client:pn,children:[m.jsx(Yt,{params:{app:"blog"},children:m.jsx(Zt,{children:m.jsx(dn,{})})}),m.jsx(Hs,{initialIsOpen:!1})]})}));export{k as _,Mr as a,ge as b,Dn as c,He as d,A as e,Ce as f,vn as g,Sn as h,De as i,On as j,Cr as k,Ln as l,jn as m,U as n,In as o,En as p,Rn as q,wn as r,Pn as s,ae as t,$ as u};
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 24/01/2024 10:42:41
1
+ ode-explorer=1.0-b2school-SNAPSHOT 24/01/2024 11:02:44