@leatcom/portal-sessions 0.0.81 → 0.0.82
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.
|
@@ -5126,7 +5126,7 @@ function nA(e) {
|
|
|
5126
5126
|
shop_uuid: e.shopUuid,
|
|
5127
5127
|
contact_uuid: e.contactUuid
|
|
5128
5128
|
};
|
|
5129
|
-
return e.cameraService && (a.camera_service = e.cameraService), e.cameraFacingMode && (a.
|
|
5129
|
+
return e.cameraService && (a.camera_service = e.cameraService), e.cameraFacingMode && (a.facing_mode = e.cameraFacingMode), e.amountInCents && (a.amount_in_cents = e.amountInCents), e.allowMultipleGiftcards && (a.allow_multiple_giftcards = e.allowMultipleGiftcards), e.enableRegistration && (a.enable_registration = e.enableRegistration), e.enableEmailIdentification && (a.enable_email_identification = e.enableEmailIdentification), e.enableOnScreenKeyboard && (a.enable_on_screen_keyboard = e.enableOnScreenKeyboard), e.primaryIdentificationMethod && (a.primary_identification_method = e.primaryIdentificationMethod), a;
|
|
5130
5130
|
}, s = () => {
|
|
5131
5131
|
o.post("/", i(), {
|
|
5132
5132
|
baseURL: `${e.host}/api/v1/portal-sessions`,
|
|
@@ -48,7 +48,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
48
48
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[N1]=this[N1]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=ea(s);r[a]||(i3(o,s),r[a]=!0)}return fe.isArray(t)?t.forEach(i):i(t),this}}Jn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),fe.reduceDescriptors(Jn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),fe.freezeMethods(Jn);function Id(e,t){const n=this||Zs,r=t||n,o=Jn.from(r.headers);let i=r.data;return fe.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function B1(e){return!!(e&&e.__CANCEL__)}function Yi(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(Yi,Xe,{__CANCEL__:!0});function M1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function s3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function a3(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[i];s||(s=u),n[o]=c,r[o]=u;let h=i,f=0;for(;h!==o;)f+=n[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s<t)return;const p=d&&u-d;return p?Math.round(f*1e3/p):void 0}}function c3(e,t){let n=0,r=1e3/t,o,i;const s=(u,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-n;h>=r?s(u,d):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-h)))},()=>o&&s(o)]}const Oc=(e,t,n=3)=>{let r=0;const o=a3(50,250);return c3(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-r,u=o(c),d=s<=a;r=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},n)},D1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},L1=e=>(...t)=>fe.asap(()=>e(...t)),u3=Lr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const a=fe.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),l3=Lr.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];fe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),fe.isString(r)&&s.push("path="+r),fe.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function d3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function f3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function F1(e,t){return e&&!d3(t)?f3(e,t):t}const j1=e=>e instanceof Jn?{...e}:e;function gi(e,t){t=t||{};const n={};function r(u,d,h){return fe.isPlainObject(u)&&fe.isPlainObject(d)?fe.merge.call({caseless:h},u,d):fe.isPlainObject(d)?fe.merge({},d):fe.isArray(d)?d.slice():d}function o(u,d,h){if(fe.isUndefined(d)){if(!fe.isUndefined(u))return r(void 0,u,h)}else return r(u,d,h)}function i(u,d){if(!fe.isUndefined(d))return r(void 0,d)}function s(u,d){if(fe.isUndefined(d)){if(!fe.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function a(u,d,h){if(h in t)return r(u,d);if(h in e)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d)=>o(j1(u),j1(d),!0)};return fe.forEach(Object.keys(Object.assign({},e,t)),function(d){const h=c[d]||o,f=h(e[d],t[d],d);fe.isUndefined(f)&&h!==a||(n[d]=f)}),n}const V1=e=>{const t=gi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;t.headers=s=Jn.from(s),t.url=k1(F1(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(fe.isFormData(n)){if(Lr.hasStandardBrowserEnv||Lr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Lr.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&u3(t.url))){const u=o&&i&&l3.read(i);u&&s.set(o,u)}return t},h3=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=V1(e);let i=o.data;const s=Jn.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,h,f,p,l;function m(){p&&p(),l&&l(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function g(){if(!y)return;const b=Jn.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:e,request:y};M1(function(T){n(T),m()},function(T){r(T),m()},C),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Xe("Network Error",Xe.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||P1;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new Xe(E,C.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,y)),y=null},i===void 0&&s.setContentType(null),"setRequestHeader"in y&&fe.forEach(s.toJSON(),function(E,C){y.setRequestHeader(C,E)}),fe.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),u&&([f,l]=Oc(u,!0),y.addEventListener("progress",f)),c&&y.upload&&([h,p]=Oc(c),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(d=b=>{y&&(r(!b||b.type?new Yi(null,e,y):b),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const v=s3(o.url);if(v&&Lr.protocols.indexOf(v)===-1){r(new Xe("Unsupported protocol "+v+":",Xe.ERR_BAD_REQUEST,e));return}y.send(i||null)})},p3=(e,t)=>{let n=new AbortController,r;const o=function(c){if(!r){r=!0,s();const u=c instanceof Error?c:this.reason;n.abort(u instanceof Xe?u:new Yi(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{o(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",o):c.unsubscribe(o))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{i&&clearTimeout(i),i=null}]},m3=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},g3=async function*(e,t,n){for await(const r of e)yield*m3(ArrayBuffer.isView(r)?r:await n(String(r)),t)},U1=(e,t,n,r,o)=>{const i=g3(e,t,o);let s=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:h}=await i.next();if(d){c(),u.close();return}let f=h.byteLength;if(n){let p=s+=f;n(p)}u.enqueue(new Uint8Array(h))}catch(d){throw c(d),d}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},Pc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",H1=Pc&&typeof ReadableStream=="function",Td=Pc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),G1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},y3=H1&&G1(()=>{let e=!1;const t=new Request(Lr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),q1=64*1024,xd=H1&&G1(()=>fe.isReadableStream(new Response("").body)),Rc={stream:xd&&(e=>e.body)};Pc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Rc[t]&&(Rc[t]=fe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Xe(`Response type '${t}' is not supported`,Xe.ERR_NOT_SUPPORT,r)})})})(new Response);const v3=async e=>{if(e==null)return 0;if(fe.isBlob(e))return e.size;if(fe.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(fe.isArrayBufferView(e)||fe.isArrayBuffer(e))return e.byteLength;if(fe.isURLSearchParams(e)&&(e=e+""),fe.isString(e))return(await Td(e)).byteLength},w3=async(e,t)=>{const n=fe.toFiniteNumber(e.getContentLength());return n??v3(t)},kd={http:H4,xhr:h3,fetch:Pc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:f}=V1(e);u=u?(u+"").toLowerCase():"text";let[p,l]=o||i||s?p3([o,i],s):[],m,y;const g=()=>{!m&&setTimeout(()=>{p&&p.unsubscribe()}),m=!0};let v;try{if(c&&y3&&n!=="get"&&n!=="head"&&(v=await w3(d,r))!==0){let A=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(fe.isFormData(r)&&(T=A.headers.get("content-type"))&&d.setContentType(T),A.body){const[x,R]=D1(v,Oc(L1(c)));r=U1(A.body,q1,x,R,Td)}}fe.isString(h)||(h=h?"include":"omit"),y=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:h});let b=await fetch(y);const E=xd&&(u==="stream"||u==="response");if(xd&&(a||E)){const A={};["status","statusText","headers"].forEach(B=>{A[B]=b[B]});const T=fe.toFiniteNumber(b.headers.get("content-length")),[x,R]=a&&D1(T,Oc(L1(a),!0))||[];b=new Response(U1(b.body,q1,x,()=>{R&&R(),E&&g()},Td),A)}u=u||"text";let C=await Rc[fe.findKey(Rc,u)||"text"](b,e);return!E&&g(),l&&l(),await new Promise((A,T)=>{M1(A,T,{data:C,headers:Jn.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:y})})}catch(b){throw g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,e,y),{cause:b.cause||b}):Xe.from(b,b&&b.code,e,y)}})};fe.forEach(kd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $1=e=>`- ${e}`,b3=e=>fe.isFunction(e)||e===null||e===!1,W1={getAdapter:e=>{e=fe.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!b3(n)&&(r=kd[(s=String(n)).toLowerCase()],r===void 0))throw new Xe(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
|
|
49
49
|
`+i.map($1).join(`
|
|
50
50
|
`):" "+$1(i[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:kd};function Od(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yi(null,e)}function Y1(e){return Od(e),e.headers=Jn.from(e.headers),e.data=Id.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),W1.getAdapter(e.adapter||Zs.adapter)(e).then(function(r){return Od(e),r.data=Id.call(e,e.transformResponse,r),r.headers=Jn.from(r.headers),r},function(r){return B1(r)||(Od(e),r&&r.response&&(r.response.data=Id.call(e,e.transformResponse,r.response),r.response.headers=Jn.from(r.response.headers))),Promise.reject(r)})}const z1="1.7.4",Pd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const K1={};Pd.transitional=function(t,n,r){function o(i,s){return"[Axios v"+z1+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(t===!1)throw new Xe(o(s," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!K1[s]&&(K1[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,a):!0}};function E3(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const a=e[i],c=a===void 0||s(a,i,e);if(c!==!0)throw new Xe("option "+i+" must be "+c,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+i,Xe.ERR_BAD_OPTION)}}const Rd={assertOptions:E3,validators:Pd},Do=Rd.validators;class yi{constructor(t){this.defaults=t,this.interceptors={request:new O1,response:new O1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
51
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=gi(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Rd.assertOptions(r,{silentJSONParsing:Do.transitional(Do.boolean),forcedJSONParsing:Do.transitional(Do.boolean),clarifyTimeoutError:Do.transitional(Do.boolean)},!1),o!=null&&(fe.isFunction(o)?n.paramsSerializer={serialize:o}:Rd.assertOptions(o,{encode:Do.function,serialize:Do.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&fe.merge(i.common,i[n.method]);i&&fe.forEach(["delete","get","head","post","put","patch","common"],l=>{delete i[l]}),n.headers=Jn.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,f;if(!c){const l=[Y1.bind(this),void 0];for(l.unshift.apply(l,a),l.push.apply(l,u),f=l.length,d=Promise.resolve(n);h<f;)d=d.then(l[h++],l[h++]);return d}f=a.length;let p=n;for(h=0;h<f;){const l=a[h++],m=a[h++];try{p=l(p)}catch(y){m.call(this,y);break}}try{d=Y1.call(this,p)}catch(l){return Promise.reject(l)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=gi(this.defaults,t);const n=F1(t.baseURL,t.url);return k1(n,t.params,t.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(t){yi.prototype[t]=function(n,r){return this.request(gi(r||{},{method:t,url:n,data:(r||{}).data}))}}),fe.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,a){return this.request(gi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}yi.prototype[t]=n(),yi.prototype[t+"Form"]=n(!0)});class Nd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new Yi(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Nd(function(o){t=o}),cancel:t}}}function C3(e){return function(n){return e.apply(null,n)}}function _3(e){return fe.isObject(e)&&e.isAxiosError===!0}const Bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Bd).forEach(([e,t])=>{Bd[t]=e});function X1(e){const t=new yi(e),n=h1(yi.prototype.request,t);return fe.extend(n,yi.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return X1(gi(e,o))},n}const en=X1(Zs);en.Axios=yi,en.CanceledError=Yi,en.CancelToken=Nd,en.isCancel=B1,en.VERSION=z1,en.toFormData=xc,en.AxiosError=Xe,en.Cancel=en.CanceledError,en.all=function(t){return Promise.all(t)},en.spread=C3,en.isAxiosError=_3,en.mergeConfig=gi,en.AxiosHeaders=Jn,en.formToJSON=e=>R1(fe.isHTMLForm(e)?new FormData(e):e),en.getAdapter=W1.getAdapter,en.HttpStatusCode=Bd,en.default=en;const S3={UNAUTHORIZED:401,MAINTENANCE_MODE:503},A3=e=>{var n,r;const t=(n=e.response)==null?void 0:n.status;if(t&&t!==S3.UNAUTHORIZED){const o=(r=e.response)==null?void 0:r.data;console.table(o)}return Promise.reject(e)};function I3(){const e=k.useContext(rd);if(!e)throw new Error("Only use 'useApiContext' within a ApiContext Provider");return e}function Gt(){const{apiKey:e,host:t}=I3(),n=(a,c={},u={})=>s("GET",a,c,u),r=(a,c={},u={})=>s("POST",a,c,u),o=(a,c={},u={})=>s("PUT",a,c,u),i=(a,c={})=>s("DELETE",a,c),s=(a,c,u={},d={})=>{const h=en.create({baseURL:`${t??"https://api.piggy.eu"}/api/v1/portal-sessions`,headers:{Authorization:`Bearer ${e}`},...d});return h.interceptors.response.use(void 0,A3),h.request({method:a,url:c,params:a=="GET"?u:{},data:u})};return{get:n,post:r,put:o,destroy:i}}function Q1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Q1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Q1(e))&&(r&&(r+=" "),r+=t);return r}const ta=e=>typeof e=="number"&&!isNaN(e),vi=e=>typeof e=="string",fr=e=>typeof e=="function",Nc=e=>vi(e)||fr(e)?e:null,Md=e=>k.isValidElement(e)||vi(e)||fr(e)||ta(e);function T3(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Bc(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:c,preventExitTransition:u,done:d,nodeRef:h,isIn:f,playToast:p}=s;const l=r?`${t}--${c}`:t,m=r?`${n}--${c}`:n,y=k.useRef(0);return k.useLayoutEffect(()=>{const g=h.current,v=l.split(" "),b=E=>{E.target===h.current&&(p(),g.removeEventListener("animationend",b),g.removeEventListener("animationcancel",b),y.current===0&&E.type!=="animationcancel"&&g.classList.remove(...v))};g.classList.add(...v),g.addEventListener("animationend",b),g.addEventListener("animationcancel",b)},[]),k.useEffect(()=>{const g=h.current,v=()=>{g.removeEventListener("animationend",v),o?T3(g,d,i):d()};f||(u?v():(y.current=1,g.className+=` ${m}`,g.addEventListener("animationend",v)))},[f]),k.createElement(k.Fragment,null,a)}}function J1(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const jn=new Map;let na=[];const Dd=new Set,x3=e=>Dd.forEach(t=>t(e)),Z1=()=>jn.size>0;function e0(e,t){var n;if(t)return!((n=jn.get(t))==null||!n.isToastActive(e));let r=!1;return jn.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function t0(e,t){Md(e)&&(Z1()||na.push({content:e,options:t}),jn.forEach(n=>{n.buildToast(e,t)}))}function n0(e,t){jn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function k3(e){const{subscribe:t,getSnapshot:n,setProps:r}=k.useRef(function(i){const s=i.containerId||1;return{subscribe(a){const c=function(d,h,f){let p=1,l=0,m=[],y=[],g=[],v=h;const b=new Map,E=new Set,C=()=>{g=Array.from(b.values()),E.forEach(x=>x())},A=x=>{y=x==null?[]:y.filter(R=>R!==x),C()},T=x=>{const{toastId:R,onOpen:B,updateId:F,children:j}=x.props,G=F==null;x.staleId&&b.delete(x.staleId),b.set(R,x),y=[...y,x.props.toastId].filter(H=>H!==x.staleId),C(),f(J1(x,G?"added":"updated")),G&&fr(B)&&B(k.isValidElement(j)&&j.props)};return{id:d,props:v,observe:x=>(E.add(x),()=>E.delete(x)),toggle:(x,R)=>{b.forEach(B=>{R!=null&&R!==B.props.toastId||fr(B.toggle)&&B.toggle(x)})},removeToast:A,toasts:b,clearQueue:()=>{l-=m.length,m=[]},buildToast:(x,R)=>{if((we=>{let{containerId:de,toastId:Ee,updateId:ve}=we;const $=de?de!==d:d!==1,W=b.has(Ee)&&ve==null;return $||W})(R))return;const{toastId:B,updateId:F,data:j,staleId:G,delay:H}=R,P=()=>{A(B)},V=F==null;V&&l++;const z={...v,style:v.toastStyle,key:p++,...Object.fromEntries(Object.entries(R).filter(we=>{let[de,Ee]=we;return Ee!=null})),toastId:B,updateId:F,data:j,closeToast:P,isIn:!1,className:Nc(R.className||v.toastClassName),bodyClassName:Nc(R.bodyClassName||v.bodyClassName),progressClassName:Nc(R.progressClassName||v.progressClassName),autoClose:!R.isLoading&&(X=R.autoClose,re=v.autoClose,X===!1||ta(X)&&X>0?X:re),deleteToast(){const we=b.get(B),{onClose:de,children:Ee}=we.props;fr(de)&&de(k.isValidElement(Ee)&&Ee.props),f(J1(we,"removed")),b.delete(B),l--,l<0&&(l=0),m.length>0?T(m.shift()):C()}};var X,re;z.closeButton=v.closeButton,R.closeButton===!1||Md(R.closeButton)?z.closeButton=R.closeButton:R.closeButton===!0&&(z.closeButton=!Md(v.closeButton)||v.closeButton);let oe=x;k.isValidElement(x)&&!vi(x.type)?oe=k.cloneElement(x,{closeToast:P,toastProps:z,data:j}):fr(x)&&(oe=x({closeToast:P,toastProps:z,data:j}));const ce={content:oe,props:z,staleId:G};v.limit&&v.limit>0&&l>v.limit&&V?m.push(ce):ta(H)?setTimeout(()=>{T(ce)},H):T(ce)},setProps(x){v=x},setToggle:(x,R)=>{b.get(x).toggle=R},isToastActive:x=>y.some(R=>R===x),getSnapshot:()=>v.newestOnTop?g.reverse():g}}(s,i,x3);jn.set(s,c);const u=c.observe(a);return na.forEach(d=>t0(d.content,d.options)),na=[],()=>{u(),jn.delete(s)}},setProps(a){var c;(c=jn.get(s))==null||c.setProps(a)},getSnapshot(){var a;return(a=jn.get(s))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const o=k.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!o)return[];const s=new Map;return o.forEach(a=>{const{position:c}=a.props;s.has(c)||s.set(c,[]),s.get(c).push(a)}),Array.from(s,a=>i(a[0],a[1]))},isToastActive:e0,count:o==null?void 0:o.length}}function O3(e){const[t,n]=k.useState(!1),[r,o]=k.useState(!1),i=k.useRef(null),s=k.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:u,onClick:d,closeOnClick:h}=e;var f,p;function l(){n(!0)}function m(){n(!1)}function y(b){const E=i.current;s.canDrag&&E&&(s.didMove=!0,t&&m(),s.delta=e.draggableDirection==="x"?b.clientX-s.start:b.clientY-s.start,s.start!==b.clientX&&(s.canCloseOnClick=!1),E.style.transform=`translate3d(${e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,E.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function g(){document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",g);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(p=jn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||p.setToggle(f.id,f.fn),k.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",l),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",l),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(b){if(e.draggable===!0||e.draggable===b.pointerType){s.didMove=!1,document.addEventListener("pointermove",y),document.addEventListener("pointerup",g);const E=i.current;s.canCloseOnClick=!0,s.canDrag=!0,E.style.transition="none",e.draggableDirection==="x"?(s.start=b.clientX,s.removalDistance=E.offsetWidth*(e.draggablePercent/100)):(s.start=b.clientY,s.removalDistance=E.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(b){const{top:E,bottom:C,left:A,right:T}=i.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&e.pauseOnHover&&b.clientX>=A&&b.clientX<=T&&b.clientY>=E&&b.clientY<=C?m():l()}};return a&&c&&(v.onMouseEnter=m,e.stacked||(v.onMouseLeave=l)),h&&(v.onClick=b=>{d&&d(b),s.canCloseOnClick&&u()}),{playToast:l,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:v}}function P3(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:s,style:a,controlledProgress:c,progress:u,rtl:d,isIn:h,theme:f}=e;const p=i||c&&u===0,l={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(l.transform=`scaleX(${u})`);const m=Lo("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":d}),y=fr(s)?s({rtl:d,type:o,defaultClassName:m}):Lo(m,s),g={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{h&&r()}};return k.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},k.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${o}`}),k.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:y,style:l,...g}))}let R3=1;const r0=()=>""+R3++;function N3(e){return e&&(vi(e.toastId)||ta(e.toastId))?e.toastId:r0()}function ra(e,t){return t0(e,t),t.toastId}function Mc(e,t){return{...t,type:t&&t.type||e,toastId:N3(t)}}function Dc(e){return(t,n)=>ra(t,Mc(e,n))}function Tt(e,t){return ra(e,Mc("default",t))}Tt.loading=(e,t)=>ra(e,Mc("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Tt.promise=function(e,t,n){let r,{pending:o,error:i,success:s}=t;o&&(r=vi(o)?Tt.loading(o,n):Tt.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(d,h,f)=>{if(h==null)return void Tt.dismiss(r);const p={type:d,...a,...n,data:f},l=vi(h)?{render:h}:h;return r?Tt.update(r,{...p,...l}):Tt(l.render,{...p,...l}),f},u=fr(e)?e():e;return u.then(d=>c("success",s,d)).catch(d=>c("error",i,d)),u},Tt.success=Dc("success"),Tt.info=Dc("info"),Tt.error=Dc("error"),Tt.warning=Dc("warning"),Tt.warn=Tt.warning,Tt.dark=(e,t)=>ra(e,Mc("default",{theme:"dark",...t})),Tt.dismiss=function(e){(function(t){var n;if(Z1()){if(t==null||vi(n=t)||ta(n))jn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=jn.get(t.containerId);r?r.removeToast(t.id):jn.forEach(o=>{o.removeToast(t.id)})}}else na=na.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Tt.clearWaitingQueue=function(e){e===void 0&&(e={}),jn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Tt.isActive=e0,Tt.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var i;let{containerId:s}=o;return(i=jn.get(s||1))==null?void 0:i.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:r0()};i.toastId!==e&&(i.staleId=e);const s=i.render||o;delete i.render,ra(s,i)}},Tt.done=e=>{Tt.update(e,{progress:1})},Tt.onChange=function(e){return Dd.add(e),()=>{Dd.delete(e)}},Tt.play=e=>n0(!0,e),Tt.pause=e=>n0(!1,e);const B3=typeof window<"u"?k.useLayoutEffect:k.useEffect,Lc=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return k.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},Ld={info:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return k.createElement("div",{className:"Toastify__spinner"})}},M3=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:i}=O3(e),{closeButton:s,children:a,autoClose:c,onClick:u,type:d,hideProgressBar:h,closeToast:f,transition:p,position:l,className:m,style:y,bodyClassName:g,bodyStyle:v,progressClassName:b,progressStyle:E,updateId:C,role:A,progress:T,rtl:x,toastId:R,deleteToast:B,isIn:F,isLoading:j,closeOnClick:G,theme:H}=e,P=Lo("Toastify__toast",`Toastify__toast-theme--${H}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":G}),V=fr(m)?m({rtl:x,position:l,type:d,defaultClassName:P}):Lo(P,m),z=function(ce){let{theme:we,type:de,isLoading:Ee,icon:ve}=ce,$=null;const W={theme:we,type:de};return ve===!1||(fr(ve)?$=ve({...W,isLoading:Ee}):k.isValidElement(ve)?$=k.cloneElement(ve,W):Ee?$=Ld.spinner():(Z=>Z in Ld)(de)&&($=Ld[de](W))),$}(e),X=!!T||!c,re={closeToast:f,type:d,theme:H};let oe=null;return s===!1||(oe=fr(s)?s(re):k.isValidElement(s)?k.cloneElement(s,re):function(ce){let{closeToast:we,theme:de,ariaLabel:Ee="close"}=ce;return k.createElement("button",{className:`Toastify__close-button Toastify__close-button--${de}`,type:"button",onClick:ve=>{ve.stopPropagation(),we(ve)},"aria-label":Ee},k.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},k.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(re)),k.createElement(p,{isIn:F,done:B,position:l,preventExitTransition:n,nodeRef:r,playToast:i},k.createElement("div",{id:R,onClick:u,"data-in":F,className:V,...o,style:y,ref:r},k.createElement("div",{...F&&{role:A},className:fr(g)?g({type:d}):Lo("Toastify__toast-body",g),style:v},z!=null&&k.createElement("div",{className:Lo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!j})},z),k.createElement("div",null,a)),oe,k.createElement(P3,{...C&&!X?{key:`pb-${C}`}:{},rtl:x,theme:H,delay:c,isRunning:t,isIn:F,closeToast:f,hide:h,type:d,style:E,className:b,controlledProgress:X,progress:T||0})))},Fc=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},D3=Bc(Fc("bounce",!0));Bc(Fc("slide",!0)),Bc(Fc("zoom")),Bc(Fc("flip"));const L3={position:"top-right",transition:D3,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function F3(e){let t={...L3,...e};const n=e.stacked,[r,o]=k.useState(!0),i=k.useRef(null),{getToastToRender:s,isToastActive:a,count:c}=k3(t),{className:u,style:d,rtl:h,containerId:f}=t;function p(m){const y=Lo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":h});return fr(u)?u({position:m,rtl:h,defaultClassName:y}):Lo(y,Nc(u))}function l(){n&&(o(!0),Tt.play())}return B3(()=>{if(n){var m;const y=i.current.querySelectorAll('[data-in="true"]'),g=12,v=(m=t.position)==null?void 0:m.includes("top");let b=0,E=0;Array.from(y).reverse().forEach((C,A)=>{const T=C;T.classList.add("Toastify__toast--stacked"),A>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=v?"top":"bot");const x=b*(r?.2:1)+(r?0:g*A);T.style.setProperty("--y",`${v?x:-1*x}px`),T.style.setProperty("--g",`${g}`),T.style.setProperty("--s",""+(1-(r?E:0))),b+=T.offsetHeight,E+=.025})}},[r,c,n]),k.createElement("div",{ref:i,className:"Toastify",id:f,onMouseEnter:()=>{n&&(o(!1),Tt.pause())},onMouseLeave:l},s((m,y)=>{const g=y.length?{...d}:{...d,pointerEvents:"none"};return k.createElement("div",{className:p(m),style:g,key:`container-${m}`},y.map(v=>{let{content:b,props:E}=v;return k.createElement(M3,{...E,stacked:n,collapseAll:l,isIn:a(E.toastId,E.containerId),style:E.style,key:`toast-${E.key}`},b)}))}))}const j3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_15_20)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23E7FBF4'/%3e%3cpath%20d='M10.6668%2017.3333L14.6668%2020L21.3335%2012'%20stroke='%23039855'%20stroke-width='1.6875'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_15_20'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",V3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_95)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FEF3F2'/%3e%3cpath%20d='M12.0003%2012L20.0003%2020M12.0003%2020L20.0003%2012'%20stroke='%23E02731'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_95'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",U3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_99)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FFFAEB'/%3e%3cpath%20d='M16.0002%2017.3333V13.3333M16.0002%2020V20.0067M23.0353%2019.3333L17.942%2010.456C17.0833%208.95867%2014.9167%208.95867%2014.058%2010.456L8.96533%2019.3333C8.11266%2020.8187%209.18933%2022.6667%2010.9073%2022.6667H21.0933C22.8107%2022.6667%2023.8873%2020.8187%2023.0353%2019.3333Z'%20stroke='%23CFAA25'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_99'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200C24.8366%200%2032%207.16344%2032%2016C32%2024.8366%2024.8366%2032%2016%2032C7.16344%2032%200%2024.8366%200%2016Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function H3(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const o0={};function Fd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&o0[t[0]]||(typeof t[0]=="string"&&(o0[t[0]]=new Date),H3(...t))}const i0=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function s0(e,t,n){e.loadNamespaces(t,i0(e,n))}function a0(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,i0(e,r))}function G3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],o=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=t.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!o||s(i,e)))}function q3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Fd("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(o,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!i(o.isLanguageChangingTo,e))return!1}}):G3(e,t,n)}const $3=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,W3={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Y3=e=>W3[e];let jd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace($3,Y3)};function z3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jd={...jd,...e}}function K3(){return jd}let c0;function X3(e){c0=e}function Q3(){return c0}const J3={type:"3rdParty",init(e){z3(e.options.react),X3(e)}},Z3=k.createContext();class eC{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const tC=(e,t)=>{const n=k.useRef();return k.useEffect(()=>{n.current=e},[e,t]),n.current};function u0(e,t,n,r){return e.getFixedT(t,n,r)}function nC(e,t,n,r){return k.useCallback(u0(e,t,n,r),[e,t,n,r])}function $e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:o}=k.useContext(Z3)||{},i=n||r||Q3();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new eC),!i){Fd("You will need to pass in an i18next instance by using initReactI18next");const E=(A,T)=>typeof T=="string"?T:T&&typeof T=="object"&&typeof T.defaultValue=="string"?T.defaultValue:Array.isArray(A)?A[A.length-1]:A,C=[E,{},!1];return C.t=E,C.i18n={},C.ready=!1,C}i.options.react&&i.options.react.wait!==void 0&&Fd("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...K3(),...i.options.react,...t},{useSuspense:a,keyPrefix:c}=s;let u=o||i.options&&i.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(E=>q3(E,i,s)),h=nC(i,t.lng||null,s.nsMode==="fallback"?u:u[0],c),f=()=>h,p=()=>u0(i,t.lng||null,s.nsMode==="fallback"?u:u[0],c),[l,m]=k.useState(f);let y=u.join();t.lng&&(y=`${t.lng}${y}`);const g=tC(y),v=k.useRef(!0);k.useEffect(()=>{const{bindI18n:E,bindI18nStore:C}=s;v.current=!0,!d&&!a&&(t.lng?a0(i,t.lng,u,()=>{v.current&&m(p)}):s0(i,u,()=>{v.current&&m(p)})),d&&g&&g!==y&&v.current&&m(p);function A(){v.current&&m(p)}return E&&i&&i.on(E,A),C&&i&&i.store.on(C,A),()=>{v.current=!1,E&&i&&E.split(" ").forEach(T=>i.off(T,A)),C&&i&&C.split(" ").forEach(T=>i.store.off(T,A))}},[i,y]),k.useEffect(()=>{v.current&&d&&m(f)},[i,c,d]);const b=[l,i,d];if(b.t=l,b.i18n=i,b.ready=d,d||!d&&!a)return b;throw new Promise(E=>{t.lng?a0(i,t.lng,u,()=>E()):s0(i,u,()=>E())})}function tn(){const{t:e}=$e(),n={closeButton:!1,icon:a=>a.type==="success"?w.jsx("img",{src:j3,alt:"success"}):a.type==="error"?w.jsx("img",{src:V3,alt:"error"}):w.jsx("img",{src:U3,alt:"warning"})},r=(a,c)=>{if(a==="success")return o(c);s(c)},o=(a=e("success"),c={})=>{Tt.success(a,{...n,...c})},i=(a=e("warning"))=>{Tt.warning(a,n)},s=(a=e("somethingWentWrong"))=>{var d,h;const c=(d=a.response)==null?void 0:d.data.errors,u=w.jsxs("div",{children:[w.jsx("p",{children:(h=a.response)==null?void 0:h.data.message}),c&&Object.keys(c).map(f=>c[f].map(p=>w.jsx("li",{children:p},p)))]});Tt.error(u,n)};return{toast:r,successToast:o,warningToast:i,errorToast:s}}const _r=e=>{const t=Gt(),{errorToast:n}=tn(),r=u=>t.get(u,e.params),{data:o,error:i,isLoading:s,isValidating:a,mutate:c}=n4(e.url,r,{shouldRetryOnError:!1,revalidateIfStale:!1});return k.useEffect(()=>{o&&e.onData&&e.onData(o==null?void 0:o.data.data,o==null?void 0:o.data.meta)},[o]),k.useEffect(()=>{i&&n(i)},[i]),{data:o,pending:a,error:i,isLoading:s,isValidating:a,mutate:c}};var l0=(e=>(e[e.CREDIT_RECEPTION=1]="CREDIT_RECEPTION",e[e.PHYSICAL_REWARD_RECEPTION=2]="PHYSICAL_REWARD_RECEPTION",e[e.DIGITAL_REWARD_RECEPTION=3]="DIGITAL_REWARD_RECEPTION",e))(l0||{}),zi=(e=>(e.IDENTIFIER="identifier",e.EMAIL="email",e))(zi||{}),d0=(e=>(e.OPT_OUT="OPT_OUT",e.OPT_IN="OPT_IN",e.DOUBLE_OPT_IN="DOUBLE_OPT_IN",e.FUNCTIONAL="FUNCTIONAL",e))(d0||{}),oa=(e=>(e.INACTIVE="INACTIVE",e.ACTIVE="ACTIVE",e.EXPIRED="EXPIRED",e.LOCKED="LOCKED",e.REDEEMED="REDEEMED",e.DEACTIVATED="DEACTIVATED",e))(oa||{});function f0({uuid:e,children:t}){const[n,r]=k.useState(new bc),{mutate:o,error:i}=_r({url:e,onData:a=>{const c=new bc;c.type=a.type,c.uuid=a.uuid,c.contact=a.contact,c.currency=a.currency,c.events=a.events,c.inputData=a.input_data,c.loyaltyProgram=a.loyalty_program,c.results=a.results,r(c)}}),s=k.useMemo(()=>({uuid:e,portalSession:n,mutate:o,error:i}),[n,o,i]);return w.jsx(Zp.Provider,{value:s,children:t})}var nn=(e=>(e.GENERIC="GENERIC",e.GIFTCARD="GIFTCARD",e.REDEEM_GIFTCARD="REDEEM_GIFTCARD",e.TOP_UP_GIFTCARD="TOP_UP_GIFTCARD",e.PORTAL="PORTAL",e.PREPAID="PREPAID",e.PAY_PREPAID="PAY_PREPAID",e.TOP_UP_PREPAID="TOP_UP_PREPAID",e.POINTS_TRANSACTION="POINTS_TRANSACTION",e.VOUCHER="VOUCHER",e))(nn||{}),je=(e=>(e.GENERIC="/generic",e.GIFTCARD="/giftcard",e.PORTAL="/portal",e.PREPAID="/prepaid",e.PAY_PREPAID="/pay-prepaid",e.TOP_UP_PREPAID="/top-up-prepaid",e.POINTS_TRANSACTION="/points-transaction",e.VOUCHER="/voucher",e))(je||{}),Fo=(e=>(e.CREDIT_RECEPTION="credit_reception",e.GIFTCARD_TRANSACTION="giftcard_transaction",e.VOUCHER_REDEEMED="voucher_redeemed",e.REWARD_RECEPTION="reward_reception",e.PREPAID_TRANSACTION="prepaid_transaction",e))(Fo||{}),jc=(e=>(e[e.INPUT_INVALID=1003]="INPUT_INVALID",e[e.CONTACT_NOT_FOUND=55031]="CONTACT_NOT_FOUND",e))(jc||{}),Zn=(e=>(e.USER="user",e.ENVIRONMENT="environment",e))(Zn||{});const rC={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Vc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||rC,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Vc(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Vc(this.logger,t)}}var Qr=new Vc;class Uc{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a.apply(a,[t,...r])})}}function ia(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function h0(e){return e==null?"":""+e}function oC(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}const iC=/###/g;function sa(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(iC,"."):a}function o(){return!e||typeof e=="string"}const i=typeof t!="string"?t:t.split(".");let s=0;for(;s<i.length-1;){if(o())return{};const a=r(i[s]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++s}return o()?{}:{obj:e,k:r(i[s])}}function p0(e,t,n){const{obj:r,k:o}=sa(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=sa(e,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=sa(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n}function sC(e,t,n,r){const{obj:o,k:i}=sa(e,t,Object);o[i]=o[i]||[],o[i].push(n)}function Hc(e,t){const{obj:n,k:r}=sa(e,t);if(n)return n[r]}function aC(e,t,n){const r=Hc(e,n);return r!==void 0?r:Hc(t,n)}function m0(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):m0(e[r],t[r],n):e[r]=t[r]);return e}function Ki(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function uC(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>cC[t]):e}class lC{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const dC=[" ",",","?","!",";"],fC=new lC(20);function hC(e,t,n){t=t||"",n=n||"";const r=dC.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=fC.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(e);if(!i){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function Vd(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let s,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=n),a+=r[c],s=o[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&c<r.length-1)continue;i+=c-i+1;break}o=s}return o}function Gc(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class g0 extends Uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&i?a.push(...r.split(i)):a.push(r)));const c=Hc(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!s||typeof r!="string"?c:Vd(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,n,r,o){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),o=n,n=a[1]),this.addNamespaces(n),p0(this.data,a,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),o=r,r=n,n=a[1]),this.addNamespaces(n);let c=Hc(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?m0(c,r,i):c={...c,...r},p0(this.data,a,c),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var y0={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,o))}),t}};const v0={};class qc extends Uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Qr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!hC(t,r,o);if(s&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:i};const u=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(o)}return typeof i=="string"&&(i=[i]),{key:t,namespaces:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const E=n.nsSeparator||this.options.nsSeparator;return o?{res:`${c}${E}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${E}${s}`}return o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:s}const h=this.resolve(t,n);let f=h&&h.res;const p=h&&h.usedKey||s,l=h&&h.exactUsedKey||s,m=Object.prototype.toString.apply(f),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&y.indexOf(m)<0&&!(typeof g=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(h.res=E,h.usedParams=this.getUsedParamsDetails(n),h):E}if(i){const E=Array.isArray(f),C=E?[]:{},A=E?l:p;for(const T in f)if(Object.prototype.hasOwnProperty.call(f,T)){const x=`${A}${i}${T}`;C[T]=this.translate(x,{...n,joinArrays:!1,ns:a}),C[T]===x&&(C[T]=f[T])}f=C}}else if(v&&typeof g=="string"&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,n,r));else{let E=!1,C=!1;const A=n.count!==void 0&&typeof n.count!="string",T=qc.hasDefaultValue(n),x=A?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&A?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",B=A&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),F=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${x}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(f)&&T&&(E=!0,f=F),this.isValidLookup(f)||(C=!0,f=s);const G=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:f,H=T&&F!==f&&this.options.updateMissing;if(C||E||H){if(this.logger.log(H?"updateKey":"missingKey",u,c,s,H?F:f),i){const X=this.resolve(s,{...n,keySeparator:!1});X&&X.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 P=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let X=0;X<V.length;X++)P.push(V[X]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(n.lng||this.language):P.push(n.lng||this.language);const z=(X,re,oe)=>{const ce=T&&oe!==f?oe:G;this.options.missingKeyHandler?this.options.missingKeyHandler(X,c,re,ce,H,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(X,c,re,ce,H,n),this.emit("missingKey",X,c,re,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?P.forEach(X=>{const re=this.pluralResolver.getSuffixes(X,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&re.indexOf(`${this.options.pluralSeparator}zero`)<0&&re.push(`${this.options.pluralSeparator}zero`),re.forEach(oe=>{z([X],s+oe,n[`defaultValue${oe}`]||F)})}):z(P,s,F))}f=this.extendTranslation(f,t,n,h,r),C&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${s}`),(C||E)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${s}`:s,E?f:void 0):f=this.options.parseMissingKeyHandler(f))}return o?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(t,n,r,o,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let h=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;d<p&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(r.lng=o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,p=new Array(f),l=0;l<f;l++)p[l]=arguments[l];return i&&i[0]===p[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):s.translate(...p,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=typeof a=="string"?[a]:a;return t!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(t=y0.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,i,s,a;return typeof t=="string"&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;o=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),l=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(y=>{this.isValidLookup(r)||(a=y,!v0[`${m[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(v0[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${o}" for languages "${m.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!!!")),m.forEach(g=>{if(this.isValidLookup(r))return;s=g;const v=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,d,g,y,n);else{let E;f&&(E=this.pluralResolver.getSuffix(g,n.count,n));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(d+E),n.ordinal&&E.indexOf(A)===0&&v.push(d+E.replace(A,this.options.pluralSeparator)),p&&v.push(d+C)),l){const T=`${d}${this.options.contextSeparator}${n.context}`;v.push(T),f&&(v.push(T+E),n.ordinal&&E.indexOf(A)===0&&v.push(T+E.replace(A,this.options.pluralSeparator)),p&&v.push(T+C))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(i=b,r=this.getResource(g,y,b,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function Ud(e){return e.charAt(0).toUpperCase()+e.slice(1)}class w0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Qr.create("languageUtils")}getScriptPartFromCode(t){if(t=Gc(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Gc(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ud(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ud(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Ud(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(i=>{if(i===o)return i;if(!(i.indexOf("-")<0&&o.indexOf("-")<0)&&(i.indexOf("-")>0&&o.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===o||i.indexOf(o)===0&&o.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):typeof t=="string"&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}}let pC=[{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}],mC={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const gC=["v1","v2","v3"],yC=["v4"],b0={zero:0,one:1,two:2,few:3,many:4,other:5};function vC(){const e={};return pC.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:mC[t.fc]}})}),e}class wC{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Qr.create("pluralResolver"),(!this.options.compatibilityJSON||yC.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=vC()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Gc(t==="dev"?"en":t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,i)=>b0[o]-b0[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const i=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!gC.includes(this.options.compatibilityJSON)}}function E0(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=aC(e,t,n);return!i&&o&&typeof n=="string"&&(i=Vd(e,n,r),i===void 0&&(i=Vd(t,n,r))),i}class bC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:l,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:uC,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Ki(i):s||"{{",this.suffix=a?Ki(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Ki(f):p||Ki("$t("),this.nestingSuffix=l?Ki(l):m||Ki(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let i,s,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(l){return l.replace(/\$/g,"$$$$")}const d=l=>{if(l.indexOf(this.formatSeparator)<0){const v=E0(n,c,l,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...o,...n,interpolationkey:l}):v}const m=l.split(this.formatSeparator),y=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(E0(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:y})};this.resetRegExp();const h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:l=>u(l)},{regex:this.regexp,safeValue:l=>this.escapeValue?u(this.escape(l)):u(l)}].forEach(l=>{for(a=0;i=l.regex.exec(t);){const m=i[1].trim();if(s=d(m),s===void 0)if(typeof h=="function"){const g=h(t,i,o);s=typeof g=="string"?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,m))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=h0(s));const y=l.safeValue(s);if(t=t.replace(i[0],y),f?(l.regex.lastIndex+=s.length,l.regex.lastIndex-=i[0].length):l.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,s;function a(c,u){const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const h=c.split(new RegExp(`${d}[ ]*{`));let f=`{${h[1]}`;c=h[0],f=this.interpolate(f,s);const p=f.match(/'/g),l=f.match(/"/g);(p&&p.length%2===0&&!l||l.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${d}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,c}for(;o=this.nestingRegexp.exec(t);){let c=[];s={...r},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const d=o[1].split(this.formatSeparator).map(h=>h.trim());o[1]=d.shift(),c=d,u=!0}if(i=n(a.call(this,o[1].trim(),s),s),i&&o[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=h0(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),u&&(i=c.reduce((d,h)=>this.format(d,h,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}function EC(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[a,...c]=s.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}}function Xi(e){const t={};return function(r,o,i){const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(Gc(o),i),t[s]=a),a(r)}}class CC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qr.create("formatter"),this.options=t,this.formats={number:Xi((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return i=>o.format(i)}),currency:Xi((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>o.format(i)}),datetime:Xi((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return i=>o.format(i)}),relativetime:Xi((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return i=>o.format(i,r.range||"day")}),list:Xi((n,r)=>{const o=new Intl.ListFormat(n,{...r});return i=>o.format(i)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Xi(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,c)=>{const{formatName:u,formatOptions:d}=EC(c);if(this.formats[u]){let h=a;try{const f=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},p=f.locale||f.lng||o.locale||o.lng||r;h=this.formats[u](a,p,{...d,...o,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}function _C(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class SC extends Uc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const i={},s={},a={},c={};return t.forEach(u=>{let d=!0;n.forEach(h=>{const f=`${u}|${h}`;!r.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,d=!1,s[f]===void 0&&(s[f]=!0),i[f]===void 0&&(i[f]=!0),c[h]===void 0&&(c[h]=!0)))}),d||(a[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2;const a={};this.queue.forEach(c=>{sC(c.loaded,[i],s),_C(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,i*2,s)},i);return}s(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...s,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,o,c):d=u(t,n,r,o),d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}else u(t,n,r,o,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}function C0(){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(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(o=>{n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function _0(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $c(){}function AC(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class aa extends Uc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=_0(t),this.services={},this.logger=Qr,this.modules={external:[]},AC(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=C0();this.options={...o,...this.options,..._0(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Qr.init(i(this.modules.logger),this.options):Qr.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=CC);const h=new w0(this.options);this.store=new g0(this.options.resources,this.options);const f=this.services;f.logger=Qr,f.resourceStore=this.store,f.languageUtils=h,f.pluralResolver=new wC(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(f.formatter=i(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new bC(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new SC(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var l=arguments.length,m=new Array(l>1?l-1:0),y=1;y<l;y++)m[y-1]=arguments[y];t.emit(p,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new qc(this.services,this.options),this.translator.on("*",function(p){for(var l=arguments.length,m=new Array(l>1?l-1:0),y=1;y<l;y++)m[y-1]=arguments[y];t.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=$c),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const c=ia(),u=()=>{const d=(h,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(h,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$c;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>s(c)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const o=ia();return t||(t=this.languages),n||(n=this.options.ns),r||(r=$c),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&y0.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=ia();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},s=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{s(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&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(t),o}getFixedT(t,n,r){var o=this;const i=function(s,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),h=2;h<u;h++)d[h-2]=arguments[h];c=o.options.overloadTranslationOptionHandler([s,a].concat(d))}else c={...a};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix=c.keyPrefix||r||i.keyPrefix;const f=o.options.keySeparator||".";let p;return c.keyPrefix&&Array.isArray(s)?p=s.map(l=>`${c.keyPrefix}${f}${l}`):p=c.keyPrefix?`${c.keyPrefix}${f}${s}`:s,o.t(p,c)};return typeof t=="string"?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){const r=ia();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ia();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],i=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new w0(C0());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new aa(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$c;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new aa(o);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new g0(this.store.data,o),i.services.resourceStore=i.store),i.translator=new qc(i.services,o),i.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];i.emit(a,...u)}),i.init(o,n),i.translator.options=o,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 ln=aa.createInstance();ln.createInstance=aa.createInstance,ln.createInstance,ln.dir,ln.init,ln.loadResources,ln.reloadResources,ln.use,ln.changeLanguage,ln.getFixedT,ln.t,ln.exists,ln.setDefaultNamespace,ln.hasLoadedNamespace,ln.loadNamespaces,ln.loadLanguages;const Qi=(e,t="EUR")=>new Intl.NumberFormat(ln.language,{style:"currency",currency:t??"EUR"}).format(e/100),IC=e=>0 .toLocaleString(ln.language,{style:"currency",currency:e??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}).replace(/\d/g,"").trim(),TC=e=>{window.parent.postMessage(e,"*")},S0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24))),A0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*7))),I0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*365.25)));function xC(e){const{errorToast:t}=tn(),[n,r]=k.useState(),o=Gt(),i=()=>{const a={type:e.type??nn.PORTAL,api_key:e.apiKey,shop_uuid:e.shopUuid,contact_uuid:e.contactUuid};return e.cameraService&&(a.camera_service=e.cameraService),e.cameraFacingMode&&(a.camera_facing_mode=e.cameraFacingMode),e.amountInCents&&(a.amount_in_cents=e.amountInCents),e.allowMultipleGiftcards&&(a.allow_multiple_giftcards=e.allowMultipleGiftcards),e.enableRegistration&&(a.enable_registration=e.enableRegistration),e.enableEmailIdentification&&(a.enable_email_identification=e.enableEmailIdentification),e.enableOnScreenKeyboard&&(a.enable_on_screen_keyboard=e.enableOnScreenKeyboard),e.primaryIdentificationMethod&&(a.primary_identification_method=e.primaryIdentificationMethod),a},s=()=>{o.post("/",i(),{baseURL:`${e.host}/api/v1/portal-sessions`,headers:{Authorization:`Bearer ${e.apiKey}`}}).then(a=>{const c=new bc;c.type=a.data.data.type,c.uuid=a.data.data.uuid,c.contact=a.data.data.contact,c.currency=a.data.data.currency,c.events=a.data.data.events,c.inputData=a.data.data.input_data,c.loyaltyProgram=a.data.data.loyalty_program,c.results=a.data.data.results,r(c)}).catch(t)};return k.useEffect(()=>s(),[]),{portalSession:n}}var T0={exports:{}};/*!
|
|
51
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=gi(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Rd.assertOptions(r,{silentJSONParsing:Do.transitional(Do.boolean),forcedJSONParsing:Do.transitional(Do.boolean),clarifyTimeoutError:Do.transitional(Do.boolean)},!1),o!=null&&(fe.isFunction(o)?n.paramsSerializer={serialize:o}:Rd.assertOptions(o,{encode:Do.function,serialize:Do.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&fe.merge(i.common,i[n.method]);i&&fe.forEach(["delete","get","head","post","put","patch","common"],l=>{delete i[l]}),n.headers=Jn.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,f;if(!c){const l=[Y1.bind(this),void 0];for(l.unshift.apply(l,a),l.push.apply(l,u),f=l.length,d=Promise.resolve(n);h<f;)d=d.then(l[h++],l[h++]);return d}f=a.length;let p=n;for(h=0;h<f;){const l=a[h++],m=a[h++];try{p=l(p)}catch(y){m.call(this,y);break}}try{d=Y1.call(this,p)}catch(l){return Promise.reject(l)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=gi(this.defaults,t);const n=F1(t.baseURL,t.url);return k1(n,t.params,t.paramsSerializer)}}fe.forEach(["delete","get","head","options"],function(t){yi.prototype[t]=function(n,r){return this.request(gi(r||{},{method:t,url:n,data:(r||{}).data}))}}),fe.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,a){return this.request(gi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}yi.prototype[t]=n(),yi.prototype[t+"Form"]=n(!0)});class Nd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new Yi(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Nd(function(o){t=o}),cancel:t}}}function C3(e){return function(n){return e.apply(null,n)}}function _3(e){return fe.isObject(e)&&e.isAxiosError===!0}const Bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Bd).forEach(([e,t])=>{Bd[t]=e});function X1(e){const t=new yi(e),n=h1(yi.prototype.request,t);return fe.extend(n,yi.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return X1(gi(e,o))},n}const en=X1(Zs);en.Axios=yi,en.CanceledError=Yi,en.CancelToken=Nd,en.isCancel=B1,en.VERSION=z1,en.toFormData=xc,en.AxiosError=Xe,en.Cancel=en.CanceledError,en.all=function(t){return Promise.all(t)},en.spread=C3,en.isAxiosError=_3,en.mergeConfig=gi,en.AxiosHeaders=Jn,en.formToJSON=e=>R1(fe.isHTMLForm(e)?new FormData(e):e),en.getAdapter=W1.getAdapter,en.HttpStatusCode=Bd,en.default=en;const S3={UNAUTHORIZED:401,MAINTENANCE_MODE:503},A3=e=>{var n,r;const t=(n=e.response)==null?void 0:n.status;if(t&&t!==S3.UNAUTHORIZED){const o=(r=e.response)==null?void 0:r.data;console.table(o)}return Promise.reject(e)};function I3(){const e=k.useContext(rd);if(!e)throw new Error("Only use 'useApiContext' within a ApiContext Provider");return e}function Gt(){const{apiKey:e,host:t}=I3(),n=(a,c={},u={})=>s("GET",a,c,u),r=(a,c={},u={})=>s("POST",a,c,u),o=(a,c={},u={})=>s("PUT",a,c,u),i=(a,c={})=>s("DELETE",a,c),s=(a,c,u={},d={})=>{const h=en.create({baseURL:`${t??"https://api.piggy.eu"}/api/v1/portal-sessions`,headers:{Authorization:`Bearer ${e}`},...d});return h.interceptors.response.use(void 0,A3),h.request({method:a,url:c,params:a=="GET"?u:{},data:u})};return{get:n,post:r,put:o,destroy:i}}function Q1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Q1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Q1(e))&&(r&&(r+=" "),r+=t);return r}const ta=e=>typeof e=="number"&&!isNaN(e),vi=e=>typeof e=="string",fr=e=>typeof e=="function",Nc=e=>vi(e)||fr(e)?e:null,Md=e=>k.isValidElement(e)||vi(e)||fr(e)||ta(e);function T3(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Bc(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:c,preventExitTransition:u,done:d,nodeRef:h,isIn:f,playToast:p}=s;const l=r?`${t}--${c}`:t,m=r?`${n}--${c}`:n,y=k.useRef(0);return k.useLayoutEffect(()=>{const g=h.current,v=l.split(" "),b=E=>{E.target===h.current&&(p(),g.removeEventListener("animationend",b),g.removeEventListener("animationcancel",b),y.current===0&&E.type!=="animationcancel"&&g.classList.remove(...v))};g.classList.add(...v),g.addEventListener("animationend",b),g.addEventListener("animationcancel",b)},[]),k.useEffect(()=>{const g=h.current,v=()=>{g.removeEventListener("animationend",v),o?T3(g,d,i):d()};f||(u?v():(y.current=1,g.className+=` ${m}`,g.addEventListener("animationend",v)))},[f]),k.createElement(k.Fragment,null,a)}}function J1(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const jn=new Map;let na=[];const Dd=new Set,x3=e=>Dd.forEach(t=>t(e)),Z1=()=>jn.size>0;function e0(e,t){var n;if(t)return!((n=jn.get(t))==null||!n.isToastActive(e));let r=!1;return jn.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function t0(e,t){Md(e)&&(Z1()||na.push({content:e,options:t}),jn.forEach(n=>{n.buildToast(e,t)}))}function n0(e,t){jn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function k3(e){const{subscribe:t,getSnapshot:n,setProps:r}=k.useRef(function(i){const s=i.containerId||1;return{subscribe(a){const c=function(d,h,f){let p=1,l=0,m=[],y=[],g=[],v=h;const b=new Map,E=new Set,C=()=>{g=Array.from(b.values()),E.forEach(x=>x())},A=x=>{y=x==null?[]:y.filter(R=>R!==x),C()},T=x=>{const{toastId:R,onOpen:B,updateId:F,children:j}=x.props,G=F==null;x.staleId&&b.delete(x.staleId),b.set(R,x),y=[...y,x.props.toastId].filter(H=>H!==x.staleId),C(),f(J1(x,G?"added":"updated")),G&&fr(B)&&B(k.isValidElement(j)&&j.props)};return{id:d,props:v,observe:x=>(E.add(x),()=>E.delete(x)),toggle:(x,R)=>{b.forEach(B=>{R!=null&&R!==B.props.toastId||fr(B.toggle)&&B.toggle(x)})},removeToast:A,toasts:b,clearQueue:()=>{l-=m.length,m=[]},buildToast:(x,R)=>{if((we=>{let{containerId:de,toastId:Ee,updateId:ve}=we;const $=de?de!==d:d!==1,W=b.has(Ee)&&ve==null;return $||W})(R))return;const{toastId:B,updateId:F,data:j,staleId:G,delay:H}=R,P=()=>{A(B)},V=F==null;V&&l++;const z={...v,style:v.toastStyle,key:p++,...Object.fromEntries(Object.entries(R).filter(we=>{let[de,Ee]=we;return Ee!=null})),toastId:B,updateId:F,data:j,closeToast:P,isIn:!1,className:Nc(R.className||v.toastClassName),bodyClassName:Nc(R.bodyClassName||v.bodyClassName),progressClassName:Nc(R.progressClassName||v.progressClassName),autoClose:!R.isLoading&&(X=R.autoClose,re=v.autoClose,X===!1||ta(X)&&X>0?X:re),deleteToast(){const we=b.get(B),{onClose:de,children:Ee}=we.props;fr(de)&&de(k.isValidElement(Ee)&&Ee.props),f(J1(we,"removed")),b.delete(B),l--,l<0&&(l=0),m.length>0?T(m.shift()):C()}};var X,re;z.closeButton=v.closeButton,R.closeButton===!1||Md(R.closeButton)?z.closeButton=R.closeButton:R.closeButton===!0&&(z.closeButton=!Md(v.closeButton)||v.closeButton);let oe=x;k.isValidElement(x)&&!vi(x.type)?oe=k.cloneElement(x,{closeToast:P,toastProps:z,data:j}):fr(x)&&(oe=x({closeToast:P,toastProps:z,data:j}));const ce={content:oe,props:z,staleId:G};v.limit&&v.limit>0&&l>v.limit&&V?m.push(ce):ta(H)?setTimeout(()=>{T(ce)},H):T(ce)},setProps(x){v=x},setToggle:(x,R)=>{b.get(x).toggle=R},isToastActive:x=>y.some(R=>R===x),getSnapshot:()=>v.newestOnTop?g.reverse():g}}(s,i,x3);jn.set(s,c);const u=c.observe(a);return na.forEach(d=>t0(d.content,d.options)),na=[],()=>{u(),jn.delete(s)}},setProps(a){var c;(c=jn.get(s))==null||c.setProps(a)},getSnapshot(){var a;return(a=jn.get(s))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const o=k.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!o)return[];const s=new Map;return o.forEach(a=>{const{position:c}=a.props;s.has(c)||s.set(c,[]),s.get(c).push(a)}),Array.from(s,a=>i(a[0],a[1]))},isToastActive:e0,count:o==null?void 0:o.length}}function O3(e){const[t,n]=k.useState(!1),[r,o]=k.useState(!1),i=k.useRef(null),s=k.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:u,onClick:d,closeOnClick:h}=e;var f,p;function l(){n(!0)}function m(){n(!1)}function y(b){const E=i.current;s.canDrag&&E&&(s.didMove=!0,t&&m(),s.delta=e.draggableDirection==="x"?b.clientX-s.start:b.clientY-s.start,s.start!==b.clientX&&(s.canCloseOnClick=!1),E.style.transform=`translate3d(${e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,E.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function g(){document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",g);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(p=jn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||p.setToggle(f.id,f.fn),k.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",l),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",l),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(b){if(e.draggable===!0||e.draggable===b.pointerType){s.didMove=!1,document.addEventListener("pointermove",y),document.addEventListener("pointerup",g);const E=i.current;s.canCloseOnClick=!0,s.canDrag=!0,E.style.transition="none",e.draggableDirection==="x"?(s.start=b.clientX,s.removalDistance=E.offsetWidth*(e.draggablePercent/100)):(s.start=b.clientY,s.removalDistance=E.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(b){const{top:E,bottom:C,left:A,right:T}=i.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&e.pauseOnHover&&b.clientX>=A&&b.clientX<=T&&b.clientY>=E&&b.clientY<=C?m():l()}};return a&&c&&(v.onMouseEnter=m,e.stacked||(v.onMouseLeave=l)),h&&(v.onClick=b=>{d&&d(b),s.canCloseOnClick&&u()}),{playToast:l,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:v}}function P3(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:s,style:a,controlledProgress:c,progress:u,rtl:d,isIn:h,theme:f}=e;const p=i||c&&u===0,l={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(l.transform=`scaleX(${u})`);const m=Lo("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":d}),y=fr(s)?s({rtl:d,type:o,defaultClassName:m}):Lo(m,s),g={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{h&&r()}};return k.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},k.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${o}`}),k.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:y,style:l,...g}))}let R3=1;const r0=()=>""+R3++;function N3(e){return e&&(vi(e.toastId)||ta(e.toastId))?e.toastId:r0()}function ra(e,t){return t0(e,t),t.toastId}function Mc(e,t){return{...t,type:t&&t.type||e,toastId:N3(t)}}function Dc(e){return(t,n)=>ra(t,Mc(e,n))}function Tt(e,t){return ra(e,Mc("default",t))}Tt.loading=(e,t)=>ra(e,Mc("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Tt.promise=function(e,t,n){let r,{pending:o,error:i,success:s}=t;o&&(r=vi(o)?Tt.loading(o,n):Tt.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(d,h,f)=>{if(h==null)return void Tt.dismiss(r);const p={type:d,...a,...n,data:f},l=vi(h)?{render:h}:h;return r?Tt.update(r,{...p,...l}):Tt(l.render,{...p,...l}),f},u=fr(e)?e():e;return u.then(d=>c("success",s,d)).catch(d=>c("error",i,d)),u},Tt.success=Dc("success"),Tt.info=Dc("info"),Tt.error=Dc("error"),Tt.warning=Dc("warning"),Tt.warn=Tt.warning,Tt.dark=(e,t)=>ra(e,Mc("default",{theme:"dark",...t})),Tt.dismiss=function(e){(function(t){var n;if(Z1()){if(t==null||vi(n=t)||ta(n))jn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=jn.get(t.containerId);r?r.removeToast(t.id):jn.forEach(o=>{o.removeToast(t.id)})}}else na=na.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Tt.clearWaitingQueue=function(e){e===void 0&&(e={}),jn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Tt.isActive=e0,Tt.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var i;let{containerId:s}=o;return(i=jn.get(s||1))==null?void 0:i.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:r0()};i.toastId!==e&&(i.staleId=e);const s=i.render||o;delete i.render,ra(s,i)}},Tt.done=e=>{Tt.update(e,{progress:1})},Tt.onChange=function(e){return Dd.add(e),()=>{Dd.delete(e)}},Tt.play=e=>n0(!0,e),Tt.pause=e=>n0(!1,e);const B3=typeof window<"u"?k.useLayoutEffect:k.useEffect,Lc=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return k.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},Ld={info:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return k.createElement(Lc,{...e},k.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return k.createElement("div",{className:"Toastify__spinner"})}},M3=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:i}=O3(e),{closeButton:s,children:a,autoClose:c,onClick:u,type:d,hideProgressBar:h,closeToast:f,transition:p,position:l,className:m,style:y,bodyClassName:g,bodyStyle:v,progressClassName:b,progressStyle:E,updateId:C,role:A,progress:T,rtl:x,toastId:R,deleteToast:B,isIn:F,isLoading:j,closeOnClick:G,theme:H}=e,P=Lo("Toastify__toast",`Toastify__toast-theme--${H}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":G}),V=fr(m)?m({rtl:x,position:l,type:d,defaultClassName:P}):Lo(P,m),z=function(ce){let{theme:we,type:de,isLoading:Ee,icon:ve}=ce,$=null;const W={theme:we,type:de};return ve===!1||(fr(ve)?$=ve({...W,isLoading:Ee}):k.isValidElement(ve)?$=k.cloneElement(ve,W):Ee?$=Ld.spinner():(Z=>Z in Ld)(de)&&($=Ld[de](W))),$}(e),X=!!T||!c,re={closeToast:f,type:d,theme:H};let oe=null;return s===!1||(oe=fr(s)?s(re):k.isValidElement(s)?k.cloneElement(s,re):function(ce){let{closeToast:we,theme:de,ariaLabel:Ee="close"}=ce;return k.createElement("button",{className:`Toastify__close-button Toastify__close-button--${de}`,type:"button",onClick:ve=>{ve.stopPropagation(),we(ve)},"aria-label":Ee},k.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},k.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(re)),k.createElement(p,{isIn:F,done:B,position:l,preventExitTransition:n,nodeRef:r,playToast:i},k.createElement("div",{id:R,onClick:u,"data-in":F,className:V,...o,style:y,ref:r},k.createElement("div",{...F&&{role:A},className:fr(g)?g({type:d}):Lo("Toastify__toast-body",g),style:v},z!=null&&k.createElement("div",{className:Lo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!j})},z),k.createElement("div",null,a)),oe,k.createElement(P3,{...C&&!X?{key:`pb-${C}`}:{},rtl:x,theme:H,delay:c,isRunning:t,isIn:F,closeToast:f,hide:h,type:d,style:E,className:b,controlledProgress:X,progress:T||0})))},Fc=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},D3=Bc(Fc("bounce",!0));Bc(Fc("slide",!0)),Bc(Fc("zoom")),Bc(Fc("flip"));const L3={position:"top-right",transition:D3,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function F3(e){let t={...L3,...e};const n=e.stacked,[r,o]=k.useState(!0),i=k.useRef(null),{getToastToRender:s,isToastActive:a,count:c}=k3(t),{className:u,style:d,rtl:h,containerId:f}=t;function p(m){const y=Lo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":h});return fr(u)?u({position:m,rtl:h,defaultClassName:y}):Lo(y,Nc(u))}function l(){n&&(o(!0),Tt.play())}return B3(()=>{if(n){var m;const y=i.current.querySelectorAll('[data-in="true"]'),g=12,v=(m=t.position)==null?void 0:m.includes("top");let b=0,E=0;Array.from(y).reverse().forEach((C,A)=>{const T=C;T.classList.add("Toastify__toast--stacked"),A>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=v?"top":"bot");const x=b*(r?.2:1)+(r?0:g*A);T.style.setProperty("--y",`${v?x:-1*x}px`),T.style.setProperty("--g",`${g}`),T.style.setProperty("--s",""+(1-(r?E:0))),b+=T.offsetHeight,E+=.025})}},[r,c,n]),k.createElement("div",{ref:i,className:"Toastify",id:f,onMouseEnter:()=>{n&&(o(!1),Tt.pause())},onMouseLeave:l},s((m,y)=>{const g=y.length?{...d}:{...d,pointerEvents:"none"};return k.createElement("div",{className:p(m),style:g,key:`container-${m}`},y.map(v=>{let{content:b,props:E}=v;return k.createElement(M3,{...E,stacked:n,collapseAll:l,isIn:a(E.toastId,E.containerId),style:E.style,key:`toast-${E.key}`},b)}))}))}const j3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_15_20)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23E7FBF4'/%3e%3cpath%20d='M10.6668%2017.3333L14.6668%2020L21.3335%2012'%20stroke='%23039855'%20stroke-width='1.6875'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_15_20'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",V3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_95)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FEF3F2'/%3e%3cpath%20d='M12.0003%2012L20.0003%2020M12.0003%2020L20.0003%2012'%20stroke='%23E02731'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_95'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",U3="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_99)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FFFAEB'/%3e%3cpath%20d='M16.0002%2017.3333V13.3333M16.0002%2020V20.0067M23.0353%2019.3333L17.942%2010.456C17.0833%208.95867%2014.9167%208.95867%2014.058%2010.456L8.96533%2019.3333C8.11266%2020.8187%209.18933%2022.6667%2010.9073%2022.6667H21.0933C22.8107%2022.6667%2023.8873%2020.8187%2023.0353%2019.3333Z'%20stroke='%23CFAA25'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_99'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200C24.8366%200%2032%207.16344%2032%2016C32%2024.8366%2024.8366%2032%2016%2032C7.16344%2032%200%2024.8366%200%2016Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function H3(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const o0={};function Fd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&o0[t[0]]||(typeof t[0]=="string"&&(o0[t[0]]=new Date),H3(...t))}const i0=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function s0(e,t,n){e.loadNamespaces(t,i0(e,n))}function a0(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,i0(e,r))}function G3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],o=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=t.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!o||s(i,e)))}function q3(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Fd("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(o,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!i(o.isLanguageChangingTo,e))return!1}}):G3(e,t,n)}const $3=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,W3={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Y3=e=>W3[e];let jd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace($3,Y3)};function z3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jd={...jd,...e}}function K3(){return jd}let c0;function X3(e){c0=e}function Q3(){return c0}const J3={type:"3rdParty",init(e){z3(e.options.react),X3(e)}},Z3=k.createContext();class eC{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const tC=(e,t)=>{const n=k.useRef();return k.useEffect(()=>{n.current=e},[e,t]),n.current};function u0(e,t,n,r){return e.getFixedT(t,n,r)}function nC(e,t,n,r){return k.useCallback(u0(e,t,n,r),[e,t,n,r])}function $e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:o}=k.useContext(Z3)||{},i=n||r||Q3();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new eC),!i){Fd("You will need to pass in an i18next instance by using initReactI18next");const E=(A,T)=>typeof T=="string"?T:T&&typeof T=="object"&&typeof T.defaultValue=="string"?T.defaultValue:Array.isArray(A)?A[A.length-1]:A,C=[E,{},!1];return C.t=E,C.i18n={},C.ready=!1,C}i.options.react&&i.options.react.wait!==void 0&&Fd("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...K3(),...i.options.react,...t},{useSuspense:a,keyPrefix:c}=s;let u=o||i.options&&i.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(E=>q3(E,i,s)),h=nC(i,t.lng||null,s.nsMode==="fallback"?u:u[0],c),f=()=>h,p=()=>u0(i,t.lng||null,s.nsMode==="fallback"?u:u[0],c),[l,m]=k.useState(f);let y=u.join();t.lng&&(y=`${t.lng}${y}`);const g=tC(y),v=k.useRef(!0);k.useEffect(()=>{const{bindI18n:E,bindI18nStore:C}=s;v.current=!0,!d&&!a&&(t.lng?a0(i,t.lng,u,()=>{v.current&&m(p)}):s0(i,u,()=>{v.current&&m(p)})),d&&g&&g!==y&&v.current&&m(p);function A(){v.current&&m(p)}return E&&i&&i.on(E,A),C&&i&&i.store.on(C,A),()=>{v.current=!1,E&&i&&E.split(" ").forEach(T=>i.off(T,A)),C&&i&&C.split(" ").forEach(T=>i.store.off(T,A))}},[i,y]),k.useEffect(()=>{v.current&&d&&m(f)},[i,c,d]);const b=[l,i,d];if(b.t=l,b.i18n=i,b.ready=d,d||!d&&!a)return b;throw new Promise(E=>{t.lng?a0(i,t.lng,u,()=>E()):s0(i,u,()=>E())})}function tn(){const{t:e}=$e(),n={closeButton:!1,icon:a=>a.type==="success"?w.jsx("img",{src:j3,alt:"success"}):a.type==="error"?w.jsx("img",{src:V3,alt:"error"}):w.jsx("img",{src:U3,alt:"warning"})},r=(a,c)=>{if(a==="success")return o(c);s(c)},o=(a=e("success"),c={})=>{Tt.success(a,{...n,...c})},i=(a=e("warning"))=>{Tt.warning(a,n)},s=(a=e("somethingWentWrong"))=>{var d,h;const c=(d=a.response)==null?void 0:d.data.errors,u=w.jsxs("div",{children:[w.jsx("p",{children:(h=a.response)==null?void 0:h.data.message}),c&&Object.keys(c).map(f=>c[f].map(p=>w.jsx("li",{children:p},p)))]});Tt.error(u,n)};return{toast:r,successToast:o,warningToast:i,errorToast:s}}const _r=e=>{const t=Gt(),{errorToast:n}=tn(),r=u=>t.get(u,e.params),{data:o,error:i,isLoading:s,isValidating:a,mutate:c}=n4(e.url,r,{shouldRetryOnError:!1,revalidateIfStale:!1});return k.useEffect(()=>{o&&e.onData&&e.onData(o==null?void 0:o.data.data,o==null?void 0:o.data.meta)},[o]),k.useEffect(()=>{i&&n(i)},[i]),{data:o,pending:a,error:i,isLoading:s,isValidating:a,mutate:c}};var l0=(e=>(e[e.CREDIT_RECEPTION=1]="CREDIT_RECEPTION",e[e.PHYSICAL_REWARD_RECEPTION=2]="PHYSICAL_REWARD_RECEPTION",e[e.DIGITAL_REWARD_RECEPTION=3]="DIGITAL_REWARD_RECEPTION",e))(l0||{}),zi=(e=>(e.IDENTIFIER="identifier",e.EMAIL="email",e))(zi||{}),d0=(e=>(e.OPT_OUT="OPT_OUT",e.OPT_IN="OPT_IN",e.DOUBLE_OPT_IN="DOUBLE_OPT_IN",e.FUNCTIONAL="FUNCTIONAL",e))(d0||{}),oa=(e=>(e.INACTIVE="INACTIVE",e.ACTIVE="ACTIVE",e.EXPIRED="EXPIRED",e.LOCKED="LOCKED",e.REDEEMED="REDEEMED",e.DEACTIVATED="DEACTIVATED",e))(oa||{});function f0({uuid:e,children:t}){const[n,r]=k.useState(new bc),{mutate:o,error:i}=_r({url:e,onData:a=>{const c=new bc;c.type=a.type,c.uuid=a.uuid,c.contact=a.contact,c.currency=a.currency,c.events=a.events,c.inputData=a.input_data,c.loyaltyProgram=a.loyalty_program,c.results=a.results,r(c)}}),s=k.useMemo(()=>({uuid:e,portalSession:n,mutate:o,error:i}),[n,o,i]);return w.jsx(Zp.Provider,{value:s,children:t})}var nn=(e=>(e.GENERIC="GENERIC",e.GIFTCARD="GIFTCARD",e.REDEEM_GIFTCARD="REDEEM_GIFTCARD",e.TOP_UP_GIFTCARD="TOP_UP_GIFTCARD",e.PORTAL="PORTAL",e.PREPAID="PREPAID",e.PAY_PREPAID="PAY_PREPAID",e.TOP_UP_PREPAID="TOP_UP_PREPAID",e.POINTS_TRANSACTION="POINTS_TRANSACTION",e.VOUCHER="VOUCHER",e))(nn||{}),je=(e=>(e.GENERIC="/generic",e.GIFTCARD="/giftcard",e.PORTAL="/portal",e.PREPAID="/prepaid",e.PAY_PREPAID="/pay-prepaid",e.TOP_UP_PREPAID="/top-up-prepaid",e.POINTS_TRANSACTION="/points-transaction",e.VOUCHER="/voucher",e))(je||{}),Fo=(e=>(e.CREDIT_RECEPTION="credit_reception",e.GIFTCARD_TRANSACTION="giftcard_transaction",e.VOUCHER_REDEEMED="voucher_redeemed",e.REWARD_RECEPTION="reward_reception",e.PREPAID_TRANSACTION="prepaid_transaction",e))(Fo||{}),jc=(e=>(e[e.INPUT_INVALID=1003]="INPUT_INVALID",e[e.CONTACT_NOT_FOUND=55031]="CONTACT_NOT_FOUND",e))(jc||{}),Zn=(e=>(e.USER="user",e.ENVIRONMENT="environment",e))(Zn||{});const rC={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Vc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||rC,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Vc(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Vc(this.logger,t)}}var Qr=new Vc;class Uc{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[a,c]=s;for(let u=0;u<c;u++)a.apply(a,[t,...r])})}}function ia(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function h0(e){return e==null?"":""+e}function oC(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}const iC=/###/g;function sa(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(iC,"."):a}function o(){return!e||typeof e=="string"}const i=typeof t!="string"?t:t.split(".");let s=0;for(;s<i.length-1;){if(o())return{};const a=r(i[s]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++s}return o()?{}:{obj:e,k:r(i[s])}}function p0(e,t,n){const{obj:r,k:o}=sa(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),a=sa(e,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=sa(e,s,Object),a&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n}function sC(e,t,n,r){const{obj:o,k:i}=sa(e,t,Object);o[i]=o[i]||[],o[i].push(n)}function Hc(e,t){const{obj:n,k:r}=sa(e,t);if(n)return n[r]}function aC(e,t,n){const r=Hc(e,n);return r!==void 0?r:Hc(t,n)}function m0(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):m0(e[r],t[r],n):e[r]=t[r]);return e}function Ki(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function uC(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>cC[t]):e}class lC{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const dC=[" ",",","?","!",";"],fC=new lC(20);function hC(e,t,n){t=t||"",n=n||"";const r=dC.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=fC.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(e);if(!i){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function Vd(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||typeof o!="object")return;let s,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=n),a+=r[c],s=o[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&c<r.length-1)continue;i+=c-i+1;break}o=s}return o}function Gc(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class g0 extends Uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&i?a.push(...r.split(i)):a.push(r)));const c=Hc(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!s||typeof r!="string"?c:Vd(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,n,r,o){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),o=n,n=a[1]),this.addNamespaces(n),p0(this.data,a,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),o=r,r=n,n=a[1]),this.addNamespaces(n);let c=Hc(this.data,a)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?m0(c,r,i):c={...c,...r},p0(this.data,a,c),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var y0={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,o))}),t}};const v0={};class qc extends Uc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Qr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!hC(t,r,o);if(s&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:i};const u=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(o)}return typeof i=="string"&&(i=[i]),{key:t,namespaces:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const E=n.nsSeparator||this.options.nsSeparator;return o?{res:`${c}${E}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${E}${s}`}return o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:s}const h=this.resolve(t,n);let f=h&&h.res;const p=h&&h.usedKey||s,l=h&&h.exactUsedKey||s,m=Object.prototype.toString.apply(f),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&y.indexOf(m)<0&&!(typeof g=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(h.res=E,h.usedParams=this.getUsedParamsDetails(n),h):E}if(i){const E=Array.isArray(f),C=E?[]:{},A=E?l:p;for(const T in f)if(Object.prototype.hasOwnProperty.call(f,T)){const x=`${A}${i}${T}`;C[T]=this.translate(x,{...n,joinArrays:!1,ns:a}),C[T]===x&&(C[T]=f[T])}f=C}}else if(v&&typeof g=="string"&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,n,r));else{let E=!1,C=!1;const A=n.count!==void 0&&typeof n.count!="string",T=qc.hasDefaultValue(n),x=A?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&A?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",B=A&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),F=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${x}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(f)&&T&&(E=!0,f=F),this.isValidLookup(f)||(C=!0,f=s);const G=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:f,H=T&&F!==f&&this.options.updateMissing;if(C||E||H){if(this.logger.log(H?"updateKey":"missingKey",u,c,s,H?F:f),i){const X=this.resolve(s,{...n,keySeparator:!1});X&&X.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 P=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let X=0;X<V.length;X++)P.push(V[X]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(n.lng||this.language):P.push(n.lng||this.language);const z=(X,re,oe)=>{const ce=T&&oe!==f?oe:G;this.options.missingKeyHandler?this.options.missingKeyHandler(X,c,re,ce,H,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(X,c,re,ce,H,n),this.emit("missingKey",X,c,re,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?P.forEach(X=>{const re=this.pluralResolver.getSuffixes(X,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&re.indexOf(`${this.options.pluralSeparator}zero`)<0&&re.push(`${this.options.pluralSeparator}zero`),re.forEach(oe=>{z([X],s+oe,n[`defaultValue${oe}`]||F)})}):z(P,s,F))}f=this.extendTranslation(f,t,n,h,r),C&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${s}`),(C||E)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${s}`:s,E?f:void 0):f=this.options.parseMissingKeyHandler(f))}return o?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(t,n,r,o,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let h=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;d<p&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(r.lng=o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,p=new Array(f),l=0;l<f;l++)p[l]=arguments[l];return i&&i[0]===p[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):s.translate(...p,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=typeof a=="string"?[a]:a;return t!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(t=y0.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,i,s,a;return typeof t=="string"&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;o=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),l=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(y=>{this.isValidLookup(r)||(a=y,!v0[`${m[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(v0[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${o}" for languages "${m.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!!!")),m.forEach(g=>{if(this.isValidLookup(r))return;s=g;const v=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,d,g,y,n);else{let E;f&&(E=this.pluralResolver.getSuffix(g,n.count,n));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(d+E),n.ordinal&&E.indexOf(A)===0&&v.push(d+E.replace(A,this.options.pluralSeparator)),p&&v.push(d+C)),l){const T=`${d}${this.options.contextSeparator}${n.context}`;v.push(T),f&&(v.push(T+E),n.ordinal&&E.indexOf(A)===0&&v.push(T+E.replace(A,this.options.pluralSeparator)),p&&v.push(T+C))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(i=b,r=this.getResource(g,y,b,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function Ud(e){return e.charAt(0).toUpperCase()+e.slice(1)}class w0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Qr.create("languageUtils")}getScriptPartFromCode(t){if(t=Gc(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Gc(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ud(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Ud(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Ud(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(i=>{if(i===o)return i;if(!(i.indexOf("-")<0&&o.indexOf("-")<0)&&(i.indexOf("-")>0&&o.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===o||i.indexOf(o)===0&&o.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):typeof t=="string"&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}}let pC=[{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}],mC={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const gC=["v1","v2","v3"],yC=["v4"],b0={zero:0,one:1,two:2,few:3,many:4,other:5};function vC(){const e={};return pC.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:mC[t.fc]}})}),e}class wC{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Qr.create("pluralResolver"),(!this.options.compatibilityJSON||yC.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=vC()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Gc(t==="dev"?"en":t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,i)=>b0[o]-b0[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const i=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!gC.includes(this.options.compatibilityJSON)}}function E0(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=aC(e,t,n);return!i&&o&&typeof n=="string"&&(i=Vd(e,n,r),i===void 0&&(i=Vd(t,n,r))),i}class bC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:l,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:uC,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Ki(i):s||"{{",this.suffix=a?Ki(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Ki(f):p||Ki("$t("),this.nestingSuffix=l?Ki(l):m||Ki(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let i,s,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(l){return l.replace(/\$/g,"$$$$")}const d=l=>{if(l.indexOf(this.formatSeparator)<0){const v=E0(n,c,l,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...o,...n,interpolationkey:l}):v}const m=l.split(this.formatSeparator),y=m.shift().trim(),g=m.join(this.formatSeparator).trim();return this.format(E0(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:y})};this.resetRegExp();const h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:l=>u(l)},{regex:this.regexp,safeValue:l=>this.escapeValue?u(this.escape(l)):u(l)}].forEach(l=>{for(a=0;i=l.regex.exec(t);){const m=i[1].trim();if(s=d(m),s===void 0)if(typeof h=="function"){const g=h(t,i,o);s=typeof g=="string"?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,m))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=h0(s));const y=l.safeValue(s);if(t=t.replace(i[0],y),f?(l.regex.lastIndex+=s.length,l.regex.lastIndex-=i[0].length):l.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,s;function a(c,u){const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const h=c.split(new RegExp(`${d}[ ]*{`));let f=`{${h[1]}`;c=h[0],f=this.interpolate(f,s);const p=f.match(/'/g),l=f.match(/"/g);(p&&p.length%2===0&&!l||l.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${d}${f}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,c}for(;o=this.nestingRegexp.exec(t);){let c=[];s={...r},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const d=o[1].split(this.formatSeparator).map(h=>h.trim());o[1]=d.shift(),c=d,u=!0}if(i=n(a.call(this,o[1].trim(),s),s),i&&o[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=h0(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),u&&(i=c.reduce((d,h)=>this.format(d,h,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}function EC(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[a,...c]=s.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}}function Xi(e){const t={};return function(r,o,i){const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(Gc(o),i),t[s]=a),a(r)}}class CC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qr.create("formatter"),this.options=t,this.formats={number:Xi((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return i=>o.format(i)}),currency:Xi((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>o.format(i)}),datetime:Xi((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return i=>o.format(i)}),relativetime:Xi((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return i=>o.format(i,r.range||"day")}),list:Xi((n,r)=>{const o=new Intl.ListFormat(n,{...r});return i=>o.format(i)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Xi(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,c)=>{const{formatName:u,formatOptions:d}=EC(c);if(this.formats[u]){let h=a;try{const f=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},p=f.locale||f.lng||o.locale||o.lng||r;h=this.formats[u](a,p,{...d,...o,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}function _C(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class SC extends Uc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const i={},s={},a={},c={};return t.forEach(u=>{let d=!0;n.forEach(h=>{const f=`${u}|${h}`;!r.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,d=!1,s[f]===void 0&&(s[f]=!0),i[f]===void 0&&(i[f]=!0),c[h]===void 0&&(c[h]=!0)))}),d||(a[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2;const a={};this.queue.forEach(c=>{sC(c.loaded,[i],s),_C(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,i*2,s)},i);return}s(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,o,i){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...s,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,o,c):d=u(t,n,r,o),d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}else u(t,n,r,o,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}function C0(){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(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(o=>{n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function _0(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $c(){}function AC(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class aa extends Uc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=_0(t),this.services={},this.logger=Qr,this.modules={external:[]},AC(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=C0();this.options={...o,...this.options,..._0(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Qr.init(i(this.modules.logger),this.options):Qr.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=CC);const h=new w0(this.options);this.store=new g0(this.options.resources,this.options);const f=this.services;f.logger=Qr,f.resourceStore=this.store,f.languageUtils=h,f.pluralResolver=new wC(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(f.formatter=i(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new bC(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new SC(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var l=arguments.length,m=new Array(l>1?l-1:0),y=1;y<l;y++)m[y-1]=arguments[y];t.emit(p,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new qc(this.services,this.options),this.translator.on("*",function(p){for(var l=arguments.length,m=new Array(l>1?l-1:0),y=1;y<l;y++)m[y-1]=arguments[y];t.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=$c),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const c=ia(),u=()=>{const d=(h,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(h,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$c;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>s(c)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const o=ia();return t||(t=this.languages),n||(n=this.options.ns),r||(r=$c),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&y0.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=ia();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},s=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{s(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&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(t),o}getFixedT(t,n,r){var o=this;const i=function(s,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),h=2;h<u;h++)d[h-2]=arguments[h];c=o.options.overloadTranslationOptionHandler([s,a].concat(d))}else c={...a};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix=c.keyPrefix||r||i.keyPrefix;const f=o.options.keySeparator||".";let p;return c.keyPrefix&&Array.isArray(s)?p=s.map(l=>`${c.keyPrefix}${f}${l}`):p=c.keyPrefix?`${c.keyPrefix}${f}${s}`:s,o.t(p,c)};return typeof t=="string"?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){const r=ia();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ia();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],i=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new w0(C0());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new aa(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$c;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new aa(o);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new g0(this.store.data,o),i.services.resourceStore=i.store),i.translator=new qc(i.services,o),i.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];i.emit(a,...u)}),i.init(o,n),i.translator.options=o,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 ln=aa.createInstance();ln.createInstance=aa.createInstance,ln.createInstance,ln.dir,ln.init,ln.loadResources,ln.reloadResources,ln.use,ln.changeLanguage,ln.getFixedT,ln.t,ln.exists,ln.setDefaultNamespace,ln.hasLoadedNamespace,ln.loadNamespaces,ln.loadLanguages;const Qi=(e,t="EUR")=>new Intl.NumberFormat(ln.language,{style:"currency",currency:t??"EUR"}).format(e/100),IC=e=>0 .toLocaleString(ln.language,{style:"currency",currency:e??"EUR",minimumFractionDigits:0,maximumFractionDigits:0}).replace(/\d/g,"").trim(),TC=e=>{window.parent.postMessage(e,"*")},S0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24))),A0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*7))),I0=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*365.25)));function xC(e){const{errorToast:t}=tn(),[n,r]=k.useState(),o=Gt(),i=()=>{const a={type:e.type??nn.PORTAL,api_key:e.apiKey,shop_uuid:e.shopUuid,contact_uuid:e.contactUuid};return e.cameraService&&(a.camera_service=e.cameraService),e.cameraFacingMode&&(a.facing_mode=e.cameraFacingMode),e.amountInCents&&(a.amount_in_cents=e.amountInCents),e.allowMultipleGiftcards&&(a.allow_multiple_giftcards=e.allowMultipleGiftcards),e.enableRegistration&&(a.enable_registration=e.enableRegistration),e.enableEmailIdentification&&(a.enable_email_identification=e.enableEmailIdentification),e.enableOnScreenKeyboard&&(a.enable_on_screen_keyboard=e.enableOnScreenKeyboard),e.primaryIdentificationMethod&&(a.primary_identification_method=e.primaryIdentificationMethod),a},s=()=>{o.post("/",i(),{baseURL:`${e.host}/api/v1/portal-sessions`,headers:{Authorization:`Bearer ${e.apiKey}`}}).then(a=>{const c=new bc;c.type=a.data.data.type,c.uuid=a.data.data.uuid,c.contact=a.data.data.contact,c.currency=a.data.data.currency,c.events=a.data.data.events,c.inputData=a.data.data.input_data,c.loyaltyProgram=a.data.data.loyalty_program,c.results=a.data.data.results,r(c)}).catch(t)};return k.useEffect(()=>s(),[]),{portalSession:n}}var T0={exports:{}};/*!
|
|
52
52
|
Copyright (c) 2018 Jed Watson.
|
|
53
53
|
Licensed under the MIT License (MIT), see
|
|
54
54
|
http://jedwatson.github.io/classnames
|