shopify-chatbot-widget 1.0.8 → 1.0.9

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.
@@ -321,7 +321,7 @@ You might need to use a local HTTP server (instead of file://): https://react.de
321
321
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...a){const r=new this(t);return a.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[r3]=this[r3]={accessors:{}}).accessors,o=this.prototype;function u(f){const m=zv(f);r[m]||(r7(o,f),r[m]=!0)}return Xe.isArray(t)?t.forEach(u):u(t),this}};vo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Xe.reduceDescriptors(vo.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[a]=r}}}),Xe.freezeMethods(vo);function ME(e,t){const a=this||$v,r=t||a,o=vo.from(r.headers);let u=r.data;return Xe.forEach(e,function(m){u=m.call(a,u,o.normalize(),t?t.status:void 0)}),o.normalize(),u}function i3(e){return!!(e&&e.__CANCEL__)}function Tm(e,t,a){Cn.call(this,e??"canceled",Cn.ERR_CANCELED,t,a),this.name="CanceledError"}Xe.inherits(Tm,Cn,{__CANCEL__:!0});function o3(e,t,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?e(a):t(new Cn("Request failed with status code "+a.status,[Cn.ERR_BAD_REQUEST,Cn.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function i7(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function o7(e,t){e=e||10;const a=new Array(e),r=new Array(e);let o=0,u=0,f;return t=t!==void 0?t:1e3,function(g){const p=Date.now(),v=r[u];f||(f=p),a[o]=g,r[o]=p;let x=u,E=0;for(;x!==o;)E+=a[x++],x=x%e;if(o=(o+1)%e,o===u&&(u=(u+1)%e),p-f<t)return;const O=v&&p-v;return O?Math.round(E*1e3/O):void 0}}function l7(e,t){let a=0,r=1e3/t,o,u;const f=(p,v=Date.now())=>{a=v,o=null,u&&(clearTimeout(u),u=null),e.apply(null,p)};return[(...p)=>{const v=Date.now(),x=v-a;x>=r?f(p,v):(o=p,u||(u=setTimeout(()=>{u=null,f(o)},r-x)))},()=>o&&f(o)]}const H1=(e,t,a=3)=>{let r=0;const o=o7(50,250);return l7(u=>{const f=u.loaded,m=u.lengthComputable?u.total:void 0,g=f-r,p=o(g),v=f<=m;r=f;const x={loaded:f,total:m,progress:m?f/m:void 0,bytes:g,rate:p||void 0,estimated:p&&m&&v?(m-f)/p:void 0,event:u,lengthComputable:m!=null,[t?"download":"upload"]:!0};e(x)},a)},l3=(e,t)=>{const a=e!=null;return[r=>t[0]({lengthComputable:a,total:e,loaded:r}),t[1]]},s3=e=>(...t)=>Xe.asap(()=>e(...t)),s7=Ci.hasStandardBrowserEnv?((e,t)=>a=>(a=new URL(a,Ci.origin),e.protocol===a.protocol&&e.host===a.host&&(t||e.port===a.port)))(new URL(Ci.origin),Ci.navigator&&/(msie|trident)/i.test(Ci.navigator.userAgent)):()=>!0,c7=Ci.hasStandardBrowserEnv?{write(e,t,a,r,o,u){const f=[e+"="+encodeURIComponent(t)];Xe.isNumber(a)&&f.push("expires="+new Date(a).toGMTString()),Xe.isString(r)&&f.push("path="+r),Xe.isString(o)&&f.push("domain="+o),u===!0&&f.push("secure"),document.cookie=f.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 u7(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function f7(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function c3(e,t,a){let r=!u7(t);return e&&(r||a==!1)?f7(e,t):t}const u3=e=>e instanceof vo?{...e}:e;function Md(e,t){t=t||{};const a={};function r(p,v,x,E){return Xe.isPlainObject(p)&&Xe.isPlainObject(v)?Xe.merge.call({caseless:E},p,v):Xe.isPlainObject(v)?Xe.merge({},v):Xe.isArray(v)?v.slice():v}function o(p,v,x,E){if(Xe.isUndefined(v)){if(!Xe.isUndefined(p))return r(void 0,p,x,E)}else return r(p,v,x,E)}function u(p,v){if(!Xe.isUndefined(v))return r(void 0,v)}function f(p,v){if(Xe.isUndefined(v)){if(!Xe.isUndefined(p))return r(void 0,p)}else return r(void 0,v)}function m(p,v,x){if(x in t)return r(p,v);if(x in e)return r(void 0,p)}const g={url:u,method:u,data:u,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:m,headers:(p,v,x)=>o(u3(p),u3(v),x,!0)};return Xe.forEach(Object.keys(Object.assign({},e,t)),function(v){const x=g[v]||o,E=x(e[v],t[v],v);Xe.isUndefined(E)&&x!==m||(a[v]=E)}),a}const f3=e=>{const t=Md({},e);let{data:a,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:u,headers:f,auth:m}=t;t.headers=f=vo.from(f),t.url=e3(c3(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),m&&f.set("Authorization","Basic "+btoa((m.username||"")+":"+(m.password?unescape(encodeURIComponent(m.password)):"")));let g;if(Xe.isFormData(a)){if(Ci.hasStandardBrowserEnv||Ci.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((g=f.getContentType())!==!1){const[p,...v]=g?g.split(";").map(x=>x.trim()).filter(Boolean):[];f.setContentType([p||"multipart/form-data",...v].join("; "))}}if(Ci.hasStandardBrowserEnv&&(r&&Xe.isFunction(r)&&(r=r(t)),r||r!==!1&&s7(t.url))){const p=o&&u&&c7.read(u);p&&f.set(o,p)}return t},d7=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(a,r){const o=f3(e);let u=o.data;const f=vo.from(o.headers).normalize();let{responseType:m,onUploadProgress:g,onDownloadProgress:p}=o,v,x,E,O,T;function _(){O&&O(),T&&T(),o.cancelToken&&o.cancelToken.unsubscribe(v),o.signal&&o.signal.removeEventListener("abort",v)}let R=new XMLHttpRequest;R.open(o.method.toUpperCase(),o.url,!0),R.timeout=o.timeout;function M(){if(!R)return;const L=vo.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),$={data:!m||m==="text"||m==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:L,config:e,request:R};o3(function(H){a(H),_()},function(H){r(H),_()},$),R=null}"onloadend"in R?R.onloadend=M:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout(M)},R.onabort=function(){R&&(r(new Cn("Request aborted",Cn.ECONNABORTED,e,R)),R=null)},R.onerror=function(){r(new Cn("Network Error",Cn.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let V=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const $=o.transitional||n3;o.timeoutErrorMessage&&(V=o.timeoutErrorMessage),r(new Cn(V,$.clarifyTimeoutError?Cn.ETIMEDOUT:Cn.ECONNABORTED,e,R)),R=null},u===void 0&&f.setContentType(null),"setRequestHeader"in R&&Xe.forEach(f.toJSON(),function(V,$){R.setRequestHeader($,V)}),Xe.isUndefined(o.withCredentials)||(R.withCredentials=!!o.withCredentials),m&&m!=="json"&&(R.responseType=o.responseType),p&&([E,T]=H1(p,!0),R.addEventListener("progress",E)),g&&R.upload&&([x,O]=H1(g),R.upload.addEventListener("progress",x),R.upload.addEventListener("loadend",O)),(o.cancelToken||o.signal)&&(v=L=>{R&&(r(!L||L.type?new Tm(null,e,R):L),R.abort(),R=null)},o.cancelToken&&o.cancelToken.subscribe(v),o.signal&&(o.signal.aborted?v():o.signal.addEventListener("abort",v)));const D=i7(o.url);if(D&&Ci.protocols.indexOf(D)===-1){r(new Cn("Unsupported protocol "+D+":",Cn.ERR_BAD_REQUEST,e));return}R.send(u||null)})},h7=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let r=new AbortController,o;const u=function(p){if(!o){o=!0,m();const v=p instanceof Error?p:this.reason;r.abort(v instanceof Cn?v:new Tm(v instanceof Error?v.message:v))}};let f=t&&setTimeout(()=>{f=null,u(new Cn(`timeout ${t} of ms exceeded`,Cn.ETIMEDOUT))},t);const m=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(u):p.removeEventListener("abort",u)}),e=null)};e.forEach(p=>p.addEventListener("abort",u));const{signal:g}=r;return g.unsubscribe=()=>Xe.asap(m),g}},m7=function*(e,t){let a=e.byteLength;if(a<t){yield e;return}let r=0,o;for(;r<a;)o=r+t,yield e.slice(r,o),r=o},p7=async function*(e,t){for await(const a of g7(e))yield*m7(a,t)},g7=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:a,value:r}=await t.read();if(a)break;yield r}}finally{await t.cancel()}},d3=(e,t,a,r)=>{const o=p7(e,t);let u=0,f,m=g=>{f||(f=!0,r&&r(g))};return new ReadableStream({async pull(g){try{const{done:p,value:v}=await o.next();if(p){m(),g.close();return}let x=v.byteLength;if(a){let E=u+=x;a(E)}g.enqueue(new Uint8Array(v))}catch(p){throw m(p),p}},cancel(g){return m(g),o.return()}},{highWaterMark:2})},B1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",h3=B1&&typeof ReadableStream=="function",v7=B1&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),m3=(e,...t)=>{try{return!!e(...t)}catch{return!1}},y7=h3&&m3(()=>{let e=!1;const t=new Request(Ci.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p3=64*1024,_E=h3&&m3(()=>Xe.isReadableStream(new Response("").body)),I1={stream:_E&&(e=>e.body)};B1&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!I1[t]&&(I1[t]=Xe.isFunction(e[t])?a=>a[t]():(a,r)=>{throw new Cn(`Response type '${t}' is not supported`,Cn.ERR_NOT_SUPPORT,r)})})})(new Response);const b7=async e=>{if(e==null)return 0;if(Xe.isBlob(e))return e.size;if(Xe.isSpecCompliantForm(e))return(await new Request(Ci.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Xe.isArrayBufferView(e)||Xe.isArrayBuffer(e))return e.byteLength;if(Xe.isURLSearchParams(e)&&(e=e+""),Xe.isString(e))return(await v7(e)).byteLength},S7=async(e,t)=>{const a=Xe.toFiniteNumber(e.getContentLength());return a??b7(t)},NE={http:IV,xhr:d7,fetch:B1&&(async e=>{let{url:t,method:a,data:r,signal:o,cancelToken:u,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:p,headers:v,withCredentials:x="same-origin",fetchOptions:E}=f3(e);p=p?(p+"").toLowerCase():"text";let O=h7([o,u&&u.toAbortSignal()],f),T;const _=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let R;try{if(g&&y7&&a!=="get"&&a!=="head"&&(R=await S7(v,r))!==0){let $=new Request(t,{method:"POST",body:r,duplex:"half"}),j;if(Xe.isFormData(r)&&(j=$.headers.get("content-type"))&&v.setContentType(j),$.body){const[H,N]=l3(R,H1(s3(g)));r=d3($.body,p3,H,N)}}Xe.isString(x)||(x=x?"include":"omit");const M="credentials"in Request.prototype;T=new Request(t,{...E,signal:O,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:r,duplex:"half",credentials:M?x:void 0});let D=await fetch(T,E);const L=_E&&(p==="stream"||p==="response");if(_E&&(m||L&&_)){const $={};["status","statusText","headers"].forEach(B=>{$[B]=D[B]});const j=Xe.toFiniteNumber(D.headers.get("content-length")),[H,N]=m&&l3(j,H1(s3(m),!0))||[];D=new Response(d3(D.body,p3,H,()=>{N&&N(),_&&_()}),$)}p=p||"text";let V=await I1[Xe.findKey(I1,p)||"text"](D,e);return!L&&_&&_(),await new Promise(($,j)=>{o3($,j,{data:V,headers:vo.from(D.headers),status:D.status,statusText:D.statusText,config:e,request:T})})}catch(M){throw _&&_(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new Cn("Network Error",Cn.ERR_NETWORK,e,T),{cause:M.cause||M}):Cn.from(M,M&&M.code,e,T)}})};Xe.forEach(NE,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const g3=e=>`- ${e}`,x7=e=>Xe.isFunction(e)||e===null||e===!1,v3={getAdapter:e=>{e=Xe.isArray(e)?e:[e];const{length:t}=e;let a,r;const o={};for(let u=0;u<t;u++){a=e[u];let f;if(r=a,!x7(a)&&(r=NE[(f=String(a)).toLowerCase()],r===void 0))throw new Cn(`Unknown adapter '${f}'`);if(r)break;o[f||"#"+u]=r}if(!r){const u=Object.entries(o).map(([m,g])=>`adapter ${m} `+(g===!1?"is not supported by the environment":"is not available in the build"));let f=t?u.length>1?`since :
322
322
  `+u.map(g3).join(`
323
323
  `):" "+g3(u[0]):"as no adapter specified";throw new Cn("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return r},adapters:NE};function DE(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tm(null,e)}function y3(e){return DE(e),e.headers=vo.from(e.headers),e.data=ME.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),v3.getAdapter(e.adapter||$v.adapter)(e).then(function(r){return DE(e),r.data=ME.call(e,e.transformResponse,r),r.headers=vo.from(r.headers),r},function(r){return i3(r)||(DE(e),r&&r.response&&(r.response.data=ME.call(e,e.transformResponse,r.response),r.response.headers=vo.from(r.response.headers))),Promise.reject(r)})}const b3="1.10.0",U1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{U1[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const S3={};U1.transitional=function(t,a,r){function o(u,f){return"[Axios v"+b3+"] Transitional option '"+u+"'"+f+(r?". "+r:"")}return(u,f,m)=>{if(t===!1)throw new Cn(o(f," has been removed"+(a?" in "+a:"")),Cn.ERR_DEPRECATED);return a&&!S3[f]&&(S3[f]=!0,console.warn(o(f," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(u,f,m):!0}},U1.spelling=function(t){return(a,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function C7(e,t,a){if(typeof e!="object")throw new Cn("options must be an object",Cn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const u=r[o],f=t[u];if(f){const m=e[u],g=m===void 0||f(m,u,e);if(g!==!0)throw new Cn("option "+u+" must be "+g,Cn.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Cn("Unknown option "+u,Cn.ERR_BAD_OPTION)}}const k1={assertOptions:C7,validators:U1},Ys=k1.validators;let _d=class{constructor(t){this.defaults=t||{},this.interceptors={request:new t3,response:new t3}}async request(t,a){try{return await this._request(t,a)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const u=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?u&&!String(r.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(r.stack+=`
324
- `+u):r.stack=u}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=Md(this.defaults,a);const{transitional:r,paramsSerializer:o,headers:u}=a;r!==void 0&&k1.assertOptions(r,{silentJSONParsing:Ys.transitional(Ys.boolean),forcedJSONParsing:Ys.transitional(Ys.boolean),clarifyTimeoutError:Ys.transitional(Ys.boolean)},!1),o!=null&&(Xe.isFunction(o)?a.paramsSerializer={serialize:o}:k1.assertOptions(o,{encode:Ys.function,serialize:Ys.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),k1.assertOptions(a,{baseUrl:Ys.spelling("baseURL"),withXsrfToken:Ys.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let f=u&&Xe.merge(u.common,u[a.method]);u&&Xe.forEach(["delete","get","head","post","put","patch","common"],T=>{delete u[T]}),a.headers=vo.concat(f,u);const m=[];let g=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(a)===!1||(g=g&&_.synchronous,m.unshift(_.fulfilled,_.rejected))});const p=[];this.interceptors.response.forEach(function(_){p.push(_.fulfilled,_.rejected)});let v,x=0,E;if(!g){const T=[y3.bind(this),void 0];for(T.unshift.apply(T,m),T.push.apply(T,p),E=T.length,v=Promise.resolve(a);x<E;)v=v.then(T[x++],T[x++]);return v}E=m.length;let O=a;for(x=0;x<E;){const T=m[x++],_=m[x++];try{O=T(O)}catch(R){_.call(this,R);break}}try{v=y3.call(this,O)}catch(T){return Promise.reject(T)}for(x=0,E=p.length;x<E;)v=v.then(p[x++],p[x++]);return v}getUri(t){t=Md(this.defaults,t);const a=c3(t.baseURL,t.url,t.allowAbsoluteUrls);return e3(a,t.params,t.paramsSerializer)}};Xe.forEach(["delete","get","head","options"],function(t){_d.prototype[t]=function(a,r){return this.request(Md(r||{},{method:t,url:a,data:(r||{}).data}))}}),Xe.forEach(["post","put","patch"],function(t){function a(r){return function(u,f,m){return this.request(Md(m||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:u,data:f}))}}_d.prototype[t]=a(),_d.prototype[t+"Form"]=a(!0)});let E7=class UL{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(u){a=u});const r=this;this.promise.then(o=>{if(!r._listeners)return;let u=r._listeners.length;for(;u-- >0;)r._listeners[u](o);r._listeners=null}),this.promise.then=o=>{let u;const f=new Promise(m=>{r.subscribe(m),u=m}).then(o);return f.cancel=function(){r.unsubscribe(u)},f},t(function(u,f,m){r.reason||(r.reason=new Tm(u,f,m),a(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 a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new UL(function(o){t=o}),cancel:t}}};function w7(e){return function(a){return e.apply(null,a)}}function O7(e){return Xe.isObject(e)&&e.isAxiosError===!0}const $E={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($E).forEach(([e,t])=>{$E[t]=e});function x3(e){const t=new _d(e),a=HM(_d.prototype.request,t);return Xe.extend(a,_d.prototype,t,{allOwnKeys:!0}),Xe.extend(a,t,null,{allOwnKeys:!0}),a.create=function(o){return x3(Md(e,o))},a}const Ca=x3($v);Ca.Axios=_d,Ca.CanceledError=Tm,Ca.CancelToken=E7,Ca.isCancel=i3,Ca.VERSION=b3,Ca.toFormData=V1,Ca.AxiosError=Cn,Ca.Cancel=Ca.CanceledError,Ca.all=function(t){return Promise.all(t)},Ca.spread=w7,Ca.isAxiosError=O7,Ca.mergeConfig=Md,Ca.AxiosHeaders=vo,Ca.formToJSON=e=>a3(Xe.isHTMLForm(e)?new FormData(e):e),Ca.getAdapter=v3.getAdapter,Ca.HttpStatusCode=$E,Ca.default=Ca;const{Axios:dle,AxiosError:hle,CanceledError:mle,isCancel:ple,CancelToken:gle,VERSION:vle,all:yle,Cancel:ble,isAxiosError:Sle,spread:xle,toFormData:Cle,AxiosHeaders:Ele,HttpStatusCode:wle,formToJSON:Ole,getAdapter:Tle,mergeConfig:Rle}=Ca,Kr={apiUrl:"https://jawebcrm.onrender.com/api/",websocketUrl:"wss://jawebcrm.onrender.com/ws"},sn=e=>typeof e=="string",jv=()=>{let e,t;const a=new Promise((r,o)=>{e=r,t=o});return a.resolve=e,a.reject=t,a},C3=e=>e==null?"":""+e,T7=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},R7=/###/g,E3=e=>e&&e.indexOf("###")>-1?e.replace(R7,"."):e,w3=e=>!e||sn(e),Lv=(e,t,a)=>{const r=sn(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(w3(e))return{};const u=E3(r[o]);!e[u]&&a&&(e[u]=new a),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={},++o}return w3(e)?{}:{obj:e,k:E3(r[o])}},O3=(e,t,a)=>{const{obj:r,k:o}=Lv(e,t,Object);if(r!==void 0||t.length===1){r[o]=a;return}let u=t[t.length-1],f=t.slice(0,t.length-1),m=Lv(e,f,Object);for(;m.obj===void 0&&f.length;)u=`${f[f.length-1]}.${u}`,f=f.slice(0,f.length-1),m=Lv(e,f,Object),m?.obj&&typeof m.obj[`${m.k}.${u}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${u}`]=a},A7=(e,t,a,r)=>{const{obj:o,k:u}=Lv(e,t,Object);o[u]=o[u]||[],o[u].push(a)},F1=(e,t)=>{const{obj:a,k:r}=Lv(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},M7=(e,t,a)=>{const r=F1(e,a);return r!==void 0?r:F1(t,a)},T3=(e,t,a)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?sn(e[r])||e[r]instanceof String||sn(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):T3(e[r],t[r],a):e[r]=t[r]);return e},Rm=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const N7=e=>sn(e)?e.replace(/[&<>"'\/]/g,t=>_7[t]):e;class D7{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;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 $7=[" ",",","?","!",";"],z7=new D7(20),j7=(e,t,a)=>{t=t||"",a=a||"";const r=$7.filter(f=>t.indexOf(f)<0&&a.indexOf(f)<0);if(r.length===0)return!0;const o=z7.getRegExp(`(${r.map(f=>f==="?"?"\\?":f).join("|")})`);let u=!o.test(e);if(!u){const f=e.indexOf(a);f>0&&!o.test(e.substring(0,f))&&(u=!0)}return u},zE=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(a);let o=e;for(let u=0;u<r.length;){if(!o||typeof o!="object")return;let f,m="";for(let g=u;g<r.length;++g)if(g!==u&&(m+=a),m+=r[g],f=o[m],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<r.length-1)continue;u+=g-u+1;break}o=f}return o},Vv=e=>e?.replace("_","-"),L7={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class G1{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||L7,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,r,o){return o&&!this.debug?null:(sn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new G1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new G1(this.logger,t)}}var Ws=new G1;class q1{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(a)||0;this.observers[r].set(a,o+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,u])=>{for(let f=0;f<u;f++)o(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let f=0;f<u;f++)o.apply(o,[t,...a])})}}class R3 extends q1{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,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 a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,f=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;t.indexOf(".")>-1?m=t.split("."):(m=[t,a],r&&(Array.isArray(r)?m.push(...r):sn(r)&&u?m.push(...r.split(u)):m.push(r)));const g=F1(this.data,m);return!g&&!a&&!r&&t.indexOf(".")>-1&&(t=m[0],a=m[1],r=m.slice(2).join(".")),g||!f||!sn(r)?g:zE(this.data?.[t]?.[a],r,u)}addResource(t,a,r,o,u={silent:!1}){const f=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let m=[t,a];r&&(m=m.concat(f?r.split(f):r)),t.indexOf(".")>-1&&(m=t.split("."),o=a,a=m[1]),this.addNamespaces(a),O3(this.data,m,o),u.silent||this.emit("added",t,a,r,o)}addResources(t,a,r,o={silent:!1}){for(const u in r)(sn(r[u])||Array.isArray(r[u]))&&this.addResource(t,a,u,r[u],{silent:!0});o.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,o,u,f={silent:!1,skipCopy:!1}){let m=[t,a];t.indexOf(".")>-1&&(m=t.split("."),o=r,r=a,a=m[1]),this.addNamespaces(a);let g=F1(this.data,m)||{};f.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?T3(g,r,u):g={...g,...r},O3(this.data,m,g),f.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}}var A3={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,o){return e.forEach(u=>{t=this.processors[u]?.process(t,a,r,o)??t}),t}};const M3={},_3=e=>!sn(e)&&typeof e!="boolean"&&typeof e!="number";class X1 extends q1{constructor(t,a={}){super(),T7(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ws.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const r={...a};return t==null?!1:this.resolve(t,r)?.res!==void 0}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let u=a.ns||this.options.defaultNS||[];const f=r&&t.indexOf(r)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!j7(t,r,o);if(f&&!m){const g=t.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:t,namespaces:sn(u)?[u]:u};const p=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(p[0])>-1)&&(u=p.shift()),t=p.join(o)}return{key:t,namespaces:sn(u)?[u]:u}}translate(t,a,r){let o=typeof a=="object"?{...a}:a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,f=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(t[t.length-1],o),p=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const x=o.lng||this.language,E=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return E?u?{res:`${p}${v}${m}`,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${v}${m}`:u?{res:m,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:m;const O=this.resolve(t,o);let T=O?.res;const _=O?.usedKey||m,R=O?.exactUsedKey||m,M=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,V=o.count!==void 0&&!sn(o.count),$=X1.hasDefaultValue(o),j=V?this.pluralResolver.getSuffix(x,o.count,o):"",H=o.ordinal&&V?this.pluralResolver.getSuffix(x,o.count,{ordinal:!1}):"",N=V&&!o.ordinal&&o.count===0,B=N&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${j}`]||o[`defaultValue${H}`]||o.defaultValue;let P=T;L&&!T&&$&&(P=B);const Z=_3(P),Y=Object.prototype.toString.apply(P);if(L&&P&&Z&&M.indexOf(Y)<0&&!(sn(D)&&Array.isArray(P))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,P,{...o,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return u?(O.res=K,O.usedParams=this.getUsedParamsDetails(o),O):K}if(f){const K=Array.isArray(P),Q=K?[]:{},se=K?R:_;for(const q in P)if(Object.prototype.hasOwnProperty.call(P,q)){const F=`${se}${f}${q}`;$&&!T?Q[q]=this.translate(F,{...o,defaultValue:_3(B)?B[q]:void 0,joinArrays:!1,ns:g}):Q[q]=this.translate(F,{...o,joinArrays:!1,ns:g}),Q[q]===F&&(Q[q]=P[q])}T=Q}}else if(L&&sn(D)&&Array.isArray(T))T=T.join(D),T&&(T=this.extendTranslation(T,t,o,r));else{let K=!1,Q=!1;!this.isValidLookup(T)&&$&&(K=!0,T=B),this.isValidLookup(T)||(Q=!0,T=m);const q=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Q?void 0:T,F=$&&B!==T&&this.options.updateMissing;if(Q||K||F){if(this.logger.log(F?"updateKey":"missingKey",x,p,m,F?B:T),f){const U=this.resolve(m,{...o,keySeparator:!1});U&&U.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 ee=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let U=0;U<ce.length;U++)ee.push(ce[U]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(o.lng||this.language):ee.push(o.lng||this.language);const G=(U,J,re)=>{const ne=$&&re!==T?re:q;this.options.missingKeyHandler?this.options.missingKeyHandler(U,p,J,ne,F,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(U,p,J,ne,F,o),this.emit("missingKey",U,p,J,T)};this.options.saveMissing&&(this.options.saveMissingPlurals&&V?ee.forEach(U=>{const J=this.pluralResolver.getSuffixes(U,o);N&&o[`defaultValue${this.options.pluralSeparator}zero`]&&J.indexOf(`${this.options.pluralSeparator}zero`)<0&&J.push(`${this.options.pluralSeparator}zero`),J.forEach(re=>{G([U],m+re,o[`defaultValue${re}`]||B)})}):G(ee,m,B))}T=this.extendTranslation(T,t,o,O,r),Q&&T===m&&this.options.appendNamespaceToMissingKey&&(T=`${p}${v}${m}`),(Q||K)&&this.options.parseMissingKeyHandler&&(T=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${v}${m}`:m,K?T:void 0,o))}return u?(O.res=T,O.usedParams=this.getUsedParamsDetails(o),O):T}extendTranslation(t,a,r,o,u){if(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 g=sn(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(g){const x=t.match(this.interpolator.nestingRegexp);p=x&&x.length}let v=r.replace&&!sn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,r.lng||this.language||o.usedLng,r),g){const x=t.match(this.interpolator.nestingRegexp),E=x&&x.length;p<E&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>u?.[0]===x[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${a[0]}`),null):this.translate(...x,a),r)),r.interpolation&&this.interpolator.reset()}const f=r.postProcess||this.options.postProcess,m=sn(f)?[f]:f;return t!=null&&m?.length&&r.applyPostProcessor!==!1&&(t=A3.handle(m,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,a={}){let r,o,u,f,m;return sn(t)&&(t=[t]),t.forEach(g=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(g,a),v=p.key;o=v;let x=p.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const E=a.count!==void 0&&!sn(a.count),O=E&&!a.ordinal&&a.count===0,T=a.context!==void 0&&(sn(a.context)||typeof a.context=="number")&&a.context!=="",_=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);x.forEach(R=>{this.isValidLookup(r)||(m=R,!M3[`${_[0]}-${R}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(M3[`${_[0]}-${R}`]=!0,this.logger.warn(`key "${o}" for languages "${_.join(", ")}" won't get resolved as namespace "${m}" 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!!!")),_.forEach(M=>{if(this.isValidLookup(r))return;f=M;const D=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(D,v,M,R,a);else{let V;E&&(V=this.pluralResolver.getSuffix(M,a.count,a));const $=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(E&&(D.push(v+V),a.ordinal&&V.indexOf(j)===0&&D.push(v+V.replace(j,this.options.pluralSeparator)),O&&D.push(v+$)),T){const H=`${v}${this.options.contextSeparator}${a.context}`;D.push(H),E&&(D.push(H+V),a.ordinal&&V.indexOf(j)===0&&D.push(H+V.replace(j,this.options.pluralSeparator)),O&&D.push(H+$))}}let L;for(;L=D.pop();)this.isValidLookup(r)||(u=L,r=this.getResource(M,R,L,a))}))})}),{res:r,usedKey:o,exactUsedKey:u,usedLng:f,usedNS:m}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,r,o):this.resourceStore.getResource(t,a,r,o)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!sn(t.replace);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 u of a)delete o[u]}return o}static hasDefaultValue(t){const a="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}}class N3{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ws.create("languageUtils")}getScriptPartFromCode(t){if(t=Vv(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Vv(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(sn(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}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 a;return t.forEach(r=>{if(a)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return a=o;const u=this.getLanguagePartFromCode(r);if(this.isSupportedCode(u))return a=u;a=this.options.supportedLngs.find(f=>{if(f===u)return f;if(!(f.indexOf("-")<0&&u.indexOf("-")<0)&&(f.indexOf("-")>0&&u.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===u||f.indexOf(u)===0&&u.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),sn(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),o=[],u=f=>{f&&(this.isSupportedCode(f)?o.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return sn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(t))):sn(t)&&u(this.formatLanguageCode(t)),r.forEach(f=>{o.indexOf(f)<0&&u(this.formatLanguageCode(f))}),o}}const D3={zero:0,one:1,two:2,few:3,many:4,other:5},$3={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class V7{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Ws.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const r=Vv(t==="dev"?"en":t),o=a.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:r,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let f;try{f=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),$3;if(!t.match(/-|_/))return $3;const g=this.languageUtils.getLanguagePartFromCode(t);f=this.getRule(g,a)}return this.pluralRulesCache[u]=f,f}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(o=>`${a}${o}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((o,u)=>D3[o]-D3[u]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,a,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}}const z3=(e,t,a,r=".",o=!0)=>{let u=M7(e,t,a);return!u&&o&&sn(a)&&(u=zE(e,a,r),u===void 0&&(u=zE(t,a,r))),u},jE=e=>e.replace(/\$/g,"$$$$");class P7{constructor(t={}){this.logger=Ws.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:o,prefix:u,prefixEscaped:f,suffix:m,suffixEscaped:g,formatSeparator:p,unescapeSuffix:v,unescapePrefix:x,nestingPrefix:E,nestingPrefixEscaped:O,nestingSuffix:T,nestingSuffixEscaped:_,nestingOptionsSeparator:R,maxReplaces:M,alwaysFormat:D}=t.interpolation;this.escape=a!==void 0?a:N7,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Rm(u):f||"{{",this.suffix=m?Rm(m):g||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=E?Rm(E):O||Rm("$t("),this.nestingSuffix=T?Rm(T):_||Rm(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=M||1e3,this.alwaysFormat=D!==void 0?D:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,r)=>a?.source===r?(a.lastIndex=0,a):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,a,r,o){let u,f,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=O=>{if(O.indexOf(this.formatSeparator)<0){const M=z3(a,g,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,r,{...o,...a,interpolationkey:O}):M}const T=O.split(this.formatSeparator),_=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(z3(a,g,_,this.options.keySeparator,this.options.ignoreJSONStructure),R,r,{...o,...a,interpolationkey:_})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>jE(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?jE(this.escape(O)):jE(O)}].forEach(O=>{for(m=0;u=O.regex.exec(t);){const T=u[1].trim();if(f=p(T),f===void 0)if(typeof v=="function"){const R=v(t,u,o);f=sn(R)?R:""}else if(o&&Object.prototype.hasOwnProperty.call(o,T))f="";else if(x){f=u[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${t}`),f="";else!sn(f)&&!this.useRawValueToEscape&&(f=C3(f));const _=O.safeValue(f);if(t=t.replace(u[0],_),x?(O.regex.lastIndex+=f.length,O.regex.lastIndex-=u[0].length):O.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),t}nest(t,a,r={}){let o,u,f;const m=(g,p)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const x=g.split(new RegExp(`${v}[ ]*{`));let E=`{${x[1]}`;g=x[0],E=this.interpolate(E,f);const O=E.match(/'/g),T=E.match(/"/g);((O?.length??0)%2===0&&!T||T.length%2!==0)&&(E=E.replace(/'/g,'"'));try{f=JSON.parse(E),p&&(f={...p,...f})}catch(_){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,_),`${g}${v}${E}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;o=this.nestingRegexp.exec(t);){let g=[];f={...r},f=f.replace&&!sn(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const p=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(p!==-1&&(g=o[1].slice(p).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,p)),u=a(m.call(this,o[1].trim(),f),f),u&&o[0]===t&&!sn(u))return u;sn(u)||(u=C3(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),u=""),g.length&&(u=g.reduce((v,x)=>this.format(v,x,r.lng,{...r,interpolationkey:o[1].trim()}),u.trim())),t=t.replace(o[0],u),this.regexp.lastIndex=0}return t}}const H7=e=>{let t=e.toLowerCase().trim();const a={};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?a.currency||(a.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(f=>{if(f){const[m,...g]=f.split(":"),p=g.join(":").trim().replace(/^'+|'+$/g,""),v=m.trim();a[v]||(a[v]=p),p==="false"&&(a[v]=!1),p==="true"&&(a[v]=!0),isNaN(p)||(a[v]=parseInt(p,10))}})}return{formatName:t,formatOptions:a}},j3=e=>{const t={};return(a,r,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const f=r+JSON.stringify(u);let m=t[f];return m||(m=e(Vv(r),o),t[f]=m),m(a)}},B7=e=>(t,a,r)=>e(Vv(a),r)(t);class I7{constructor(t={}){this.logger=Ws.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?j3:B7;this.formats={number:r((o,u)=>{const f=new Intl.NumberFormat(o,{...u});return m=>f.format(m)}),currency:r((o,u)=>{const f=new Intl.NumberFormat(o,{...u,style:"currency"});return m=>f.format(m)}),datetime:r((o,u)=>{const f=new Intl.DateTimeFormat(o,{...u});return m=>f.format(m)}),relativetime:r((o,u)=>{const f=new Intl.RelativeTimeFormat(o,{...u});return m=>f.format(m,u.range||"day")}),list:r((o,u)=>{const f=new Intl.ListFormat(o,{...u});return m=>f.format(m)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=j3(a)}format(t,a,r,o={}){const u=a.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(m=>m.indexOf(")")>-1)){const m=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,m)].join(this.formatSeparator)}return u.reduce((m,g)=>{const{formatName:p,formatOptions:v}=H7(g);if(this.formats[p]){let x=m;try{const E=o?.formatParams?.[o.interpolationkey]||{},O=E.locale||E.lng||o.locale||o.lng||r;x=this.formats[p](m,O,{...v,...o,...E})}catch(E){this.logger.warn(E)}return x}else this.logger.warn(`there was no format function for ${p}`);return m},t)}}const U7=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class k7 extends q1{constructor(t,a,r,o={}){super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Ws.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?.init?.(r,o.backend,o)}queueLoad(t,a,r,o){const u={},f={},m={},g={};return t.forEach(p=>{let v=!0;a.forEach(x=>{const E=`${p}|${x}`;!r.reload&&this.store.hasResourceBundle(p,x)?this.state[E]=2:this.state[E]<0||(this.state[E]===1?f[E]===void 0&&(f[E]=!0):(this.state[E]=1,v=!1,f[E]===void 0&&(f[E]=!0),u[E]===void 0&&(u[E]=!0),g[x]===void 0&&(g[x]=!0)))}),v||(m[p]=!0)}),(Object.keys(u).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(f),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(t,a,r){const o=t.split("|"),u=o[0],f=o[1];a&&this.emit("failedLoading",u,f,a),!a&&r&&this.store.addResourceBundle(u,f,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);const m={};this.queue.forEach(g=>{A7(g.loaded,[u],f),U7(g,t),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(p=>{m[p]||(m[p]={});const v=g.loaded[p];v.length&&v.forEach(x=>{m[p][x]===void 0&&(m[p][x]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(t,a,r,o=0,u=this.retryTimeout,f){if(!t.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:o,wait:u,callback:f});return}this.readingCalls++;const m=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(p&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,o+1,u*2,f)},u);return}f(p,v)},g=this.backend[r].bind(this.backend);if(g.length===2){try{const p=g(t,a);p&&typeof p.then=="function"?p.then(v=>m(null,v)).catch(m):m(null,p)}catch(p){m(p)}return}return g(t,a,m)}prepareLoading(t,a,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();sn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),sn(a)&&(a=[a]);const u=this.queueLoad(t,a,r,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(f=>{this.loadOne(f)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){const r=t.split("|"),o=r[0],u=r[1];this.read(o,u,"read",void 0,void 0,(f,m)=>{f&&this.logger.warn(`${a}loading namespace ${u} for language ${o} failed`,f),!f&&m&&this.logger.log(`${a}loaded namespace ${u} for language ${o}`,m),this.loaded(t,f,m)})}saveMissing(t,a,r,o,u,f={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the 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!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const g={...f,isUpdate:u},p=this.backend.create.bind(this.backend);if(p.length<6)try{let v;p.length===5?v=p(t,a,r,o,g):v=p(t,a,r,o),v&&typeof v.then=="function"?v.then(x=>m(null,x)).catch(m):m(null,v)}catch(v){m(v)}else p(t,a,r,o,m,g)}!t||!t[0]||this.store.addResource(t[0],a,r,o)}}}const L3=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),sn(e[1])&&(t.defaultValue=e[1]),sn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),V3=e=>(sn(e.ns)&&(e.ns=[e.ns]),sn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),sn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Y1=()=>{},F7=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class Pv extends q1{constructor(t={},a){if(super(),this.options=V3(t),this.services={},this.logger=Ws,this.modules={external:[]},F7(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(sn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=L3();this.options={...r,...this.options,...V3(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ws.init(o(this.modules.logger),this.options):Ws.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=I7;const v=new N3(this.options);this.store=new R3(this.options.resources,this.options);const x=this.services;x.logger=Ws,x.resourceStore=this.store,x.languageUtils=v,x.pluralResolver=new V7(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(x.formatter=o(p),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new P7(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new k7(o(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(O,...T)=>{this.emit(O,...T)}),this.modules.languageDetector&&(x.languageDetector=o(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=o(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new X1(this.services,this.options),this.translator.on("*",(O,...T)=>{this.emit(O,...T)}),this.modules.external.forEach(O=>{O.init&&O.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Y1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(p=>{this[p]=(...v)=>this.store[p](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...v)=>(this.store[p](...v),this)});const m=jv(),g=()=>{const p=(v,x)=>{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),m.resolve(x),a(v,x)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(t,a=Y1){let r=a;const o=sn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const u=[],f=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&u.indexOf(p)<0&&u.push(p)})};o?f(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>f(g)),this.options.preload?.forEach?.(m=>f(m)),this.services.backendConnector.load(u,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(m)})}else r(null)}reloadResources(t,a,r){const o=jv();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=Y1),this.services.backendConnector.reload(t,a,u=>{o.resolve(),r(u)}),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"&&A3.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 a=0;a<this.languages.length;a++){const r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const r=jv();this.emit("languageChanging",t);const o=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},u=(m,g)=>{g?this.isLanguageChangingTo===t&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,r.resolve((...p)=>this.t(...p)),a&&a(m,(...p)=>this.t(...p))},f=m=>{!t&&!m&&this.services.languageDetector&&(m=[]);const g=sn(m)?m:m&&m[0],p=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(sn(m)?[m]:m);p&&(this.language||o(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,v=>{u(v,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(t),r}getFixedT(t,a,r){const o=(u,f,...m)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([u,f].concat(m)):g={...f},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||r||o.keyPrefix);const p=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(x=>`${g.keyPrefix}${p}${x}`):v=g.keyPrefix?`${g.keyPrefix}${p}${u}`:u,this.t(v,g)};return sn(t)?o.lng=t:o.lngs=t,o.ns=a,o.keyPrefix=r,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){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=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const f=(m,g)=>{const p=this.services.backendConnector.state[`${m}|${g}`];return p===-1||p===0||p===2};if(a.precheck){const m=a.precheck(this,f);if(m!==void 0)return m}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(r,t)&&(!o||f(u,t)))}loadNamespaces(t,a){const r=jv();return this.options.ns?(sn(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),a&&a(o)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){const r=jv();sn(t)&&(t=[t]);const o=this.options.preload||[],u=t.filter(f=>o.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return u.length?(this.options.preload=o.concat(u),this.loadResources(f=>{r.resolve(),a&&a(f)}),r):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const a=["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?.languageUtils||new N3(L3());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){return new Pv(t,a)}cloneInstance(t={},a=Y1){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},u=new Pv(o);if((t.debug!==void 0||t.prefix!==void 0)&&(u.logger=u.logger.clone(t)),["store","services","language"].forEach(m=>{u[m]=this[m]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},r){const m=Object.keys(this.store.data).reduce((g,p)=>(g[p]={...this.store.data[p]},g[p]=Object.keys(g[p]).reduce((v,x)=>(v[x]={...g[p][x]},v),g[p]),g),{});u.store=new R3(m,o),u.services.resourceStore=u.store}return u.translator=new X1(u.services,o),u.translator.on("*",(m,...g)=>{u.emit(m,...g)}),u.init(o,a),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Zr=Pv.createInstance();Zr.createInstance=Pv.createInstance,Zr.createInstance,Zr.dir,Zr.init,Zr.loadResources,Zr.reloadResources,Zr.use,Zr.changeLanguage,Zr.getFixedT,Zr.t,Zr.exists,Zr.setDefaultNamespace,Zr.hasLoadedNamespace,Zr.loadNamespaces,Zr.loadLanguages;const G7=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,q7={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},X7=e=>q7[e];let P3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(G7,X7)};const Y7=(e={})=>{P3={...P3,...e}},W7={type:"3rdParty",init(e){Y7(e.options.react)}},K7={en:{translation:{welcome:"Hi there, you’re speaking with Jaweb AI Assistant."}},ar:{translation:{welcome:"مرحبًا، أنت تتحدث إلى مساعد Jaweb AI."}}};Zr.use(W7).init({resources:K7,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const Z7=3,Q7=3e3,J7=()=>{const[e,t]=S.useState(!0),[a,r]=S.useState(!0),[o,u]=S.useState(""),[f,m]=S.useState(""),[g,p]=S.useState(!1),[v,x]=S.useState(!1),[E,O]=S.useState(""),[T,_]=S.useState(""),[R,M]=S.useState(null),[D,L]=S.useState(""),[V,$]=S.useState([]),[j,H]=S.useState([]),[N,B]=S.useState(""),[P,Z]=S.useState(!1),[Y,K]=S.useState(!0),[Q,se]=S.useState(""),q=async(F=0)=>{const ee=localStorage.getItem("company_username");t(!0);const ce={headers:{"Content-Type":"application/json",Accept:"application/json"},params:{username:ee}};try{const U=(await Ca.get(`${Kr.apiUrl}chatbot-details/`,ce)).data.data;U.language==="Arabic"?Zr.changeLanguage("ar"):Zr.changeLanguage("en"),r(U.chatbot_form),u(U.chatbot_color),m(U.chatbot_logo),p(U.disable_chatbot_globally),x(U.remove_powered_by_jaweb),O(U.chatbot_initial_msg),_(U.status),B(U.mode),M(U.calendly_link??null),Z(U.disable_checkout),se(U.chatbot_name),K(U.enable_try_on),U.calendly_link&&M(U.calendly_link),U.phone_number_id&&L(`+${U.phone_number_id}`);const J=await Ca.get(`${Kr.apiUrl}chatbot-plugin-suggestions/`,ce);let re=[];Array.isArray(J.data.data)?re=J.data.data:Array.isArray(J.data.user_questions)&&(re=J.data.user_questions),re.length>0?($(re.slice(0,3)),H(re.slice(3))):($([]),H([])),t(!1)}catch(G){console.error("Error fetching data:",G),F<Z7?setTimeout(()=>q(F+1),Q7):console.error("Max retries reached. Could not fetch data.")}};return S.useEffect(()=>{q()},[]),{isFetchingDetails:e,disableForm:a,colorCode:o,chatbotLogo:f,disableChatbotGlobally:g,removePoweredByJaweb:v,initialMessageText:E,subscription:T,calendly:R,merchantPhone:D,messagesSuggestions:V,setMessagesSuggestions:$,restSuggestions:j,userType:N,disbleCheckout:P,chatbotName:Q,enableTryOn:Y}};var LE={exports:{}};/*!
324
+ `+u):r.stack=u}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=Md(this.defaults,a);const{transitional:r,paramsSerializer:o,headers:u}=a;r!==void 0&&k1.assertOptions(r,{silentJSONParsing:Ys.transitional(Ys.boolean),forcedJSONParsing:Ys.transitional(Ys.boolean),clarifyTimeoutError:Ys.transitional(Ys.boolean)},!1),o!=null&&(Xe.isFunction(o)?a.paramsSerializer={serialize:o}:k1.assertOptions(o,{encode:Ys.function,serialize:Ys.function},!0)),a.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?a.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:a.allowAbsoluteUrls=!0),k1.assertOptions(a,{baseUrl:Ys.spelling("baseURL"),withXsrfToken:Ys.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let f=u&&Xe.merge(u.common,u[a.method]);u&&Xe.forEach(["delete","get","head","post","put","patch","common"],T=>{delete u[T]}),a.headers=vo.concat(f,u);const m=[];let g=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(a)===!1||(g=g&&_.synchronous,m.unshift(_.fulfilled,_.rejected))});const p=[];this.interceptors.response.forEach(function(_){p.push(_.fulfilled,_.rejected)});let v,x=0,E;if(!g){const T=[y3.bind(this),void 0];for(T.unshift.apply(T,m),T.push.apply(T,p),E=T.length,v=Promise.resolve(a);x<E;)v=v.then(T[x++],T[x++]);return v}E=m.length;let O=a;for(x=0;x<E;){const T=m[x++],_=m[x++];try{O=T(O)}catch(R){_.call(this,R);break}}try{v=y3.call(this,O)}catch(T){return Promise.reject(T)}for(x=0,E=p.length;x<E;)v=v.then(p[x++],p[x++]);return v}getUri(t){t=Md(this.defaults,t);const a=c3(t.baseURL,t.url,t.allowAbsoluteUrls);return e3(a,t.params,t.paramsSerializer)}};Xe.forEach(["delete","get","head","options"],function(t){_d.prototype[t]=function(a,r){return this.request(Md(r||{},{method:t,url:a,data:(r||{}).data}))}}),Xe.forEach(["post","put","patch"],function(t){function a(r){return function(u,f,m){return this.request(Md(m||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:u,data:f}))}}_d.prototype[t]=a(),_d.prototype[t+"Form"]=a(!0)});let E7=class UL{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(u){a=u});const r=this;this.promise.then(o=>{if(!r._listeners)return;let u=r._listeners.length;for(;u-- >0;)r._listeners[u](o);r._listeners=null}),this.promise.then=o=>{let u;const f=new Promise(m=>{r.subscribe(m),u=m}).then(o);return f.cancel=function(){r.unsubscribe(u)},f},t(function(u,f,m){r.reason||(r.reason=new Tm(u,f,m),a(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 a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new UL(function(o){t=o}),cancel:t}}};function w7(e){return function(a){return e.apply(null,a)}}function O7(e){return Xe.isObject(e)&&e.isAxiosError===!0}const $E={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($E).forEach(([e,t])=>{$E[t]=e});function x3(e){const t=new _d(e),a=HM(_d.prototype.request,t);return Xe.extend(a,_d.prototype,t,{allOwnKeys:!0}),Xe.extend(a,t,null,{allOwnKeys:!0}),a.create=function(o){return x3(Md(e,o))},a}const Ca=x3($v);Ca.Axios=_d,Ca.CanceledError=Tm,Ca.CancelToken=E7,Ca.isCancel=i3,Ca.VERSION=b3,Ca.toFormData=V1,Ca.AxiosError=Cn,Ca.Cancel=Ca.CanceledError,Ca.all=function(t){return Promise.all(t)},Ca.spread=w7,Ca.isAxiosError=O7,Ca.mergeConfig=Md,Ca.AxiosHeaders=vo,Ca.formToJSON=e=>a3(Xe.isHTMLForm(e)?new FormData(e):e),Ca.getAdapter=v3.getAdapter,Ca.HttpStatusCode=$E,Ca.default=Ca;const{Axios:dle,AxiosError:hle,CanceledError:mle,isCancel:ple,CancelToken:gle,VERSION:vle,all:yle,Cancel:ble,isAxiosError:Sle,spread:xle,toFormData:Cle,AxiosHeaders:Ele,HttpStatusCode:wle,formToJSON:Ole,getAdapter:Tle,mergeConfig:Rle}=Ca,Kr={apiUrl:"https://api.jaweb.me/api/",websocketUrl:"wss://api.jaweb.me/ws"},sn=e=>typeof e=="string",jv=()=>{let e,t;const a=new Promise((r,o)=>{e=r,t=o});return a.resolve=e,a.reject=t,a},C3=e=>e==null?"":""+e,T7=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},R7=/###/g,E3=e=>e&&e.indexOf("###")>-1?e.replace(R7,"."):e,w3=e=>!e||sn(e),Lv=(e,t,a)=>{const r=sn(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(w3(e))return{};const u=E3(r[o]);!e[u]&&a&&(e[u]=new a),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={},++o}return w3(e)?{}:{obj:e,k:E3(r[o])}},O3=(e,t,a)=>{const{obj:r,k:o}=Lv(e,t,Object);if(r!==void 0||t.length===1){r[o]=a;return}let u=t[t.length-1],f=t.slice(0,t.length-1),m=Lv(e,f,Object);for(;m.obj===void 0&&f.length;)u=`${f[f.length-1]}.${u}`,f=f.slice(0,f.length-1),m=Lv(e,f,Object),m?.obj&&typeof m.obj[`${m.k}.${u}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${u}`]=a},A7=(e,t,a,r)=>{const{obj:o,k:u}=Lv(e,t,Object);o[u]=o[u]||[],o[u].push(a)},F1=(e,t)=>{const{obj:a,k:r}=Lv(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},M7=(e,t,a)=>{const r=F1(e,a);return r!==void 0?r:F1(t,a)},T3=(e,t,a)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?sn(e[r])||e[r]instanceof String||sn(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):T3(e[r],t[r],a):e[r]=t[r]);return e},Rm=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const N7=e=>sn(e)?e.replace(/[&<>"'\/]/g,t=>_7[t]):e;class D7{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;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 $7=[" ",",","?","!",";"],z7=new D7(20),j7=(e,t,a)=>{t=t||"",a=a||"";const r=$7.filter(f=>t.indexOf(f)<0&&a.indexOf(f)<0);if(r.length===0)return!0;const o=z7.getRegExp(`(${r.map(f=>f==="?"?"\\?":f).join("|")})`);let u=!o.test(e);if(!u){const f=e.indexOf(a);f>0&&!o.test(e.substring(0,f))&&(u=!0)}return u},zE=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(a);let o=e;for(let u=0;u<r.length;){if(!o||typeof o!="object")return;let f,m="";for(let g=u;g<r.length;++g)if(g!==u&&(m+=a),m+=r[g],f=o[m],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<r.length-1)continue;u+=g-u+1;break}o=f}return o},Vv=e=>e?.replace("_","-"),L7={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class G1{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||L7,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,r,o){return o&&!this.debug?null:(sn(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new G1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new G1(this.logger,t)}}var Ws=new G1;class q1{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(a)||0;this.observers[r].set(a,o+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,u])=>{for(let f=0;f<u;f++)o(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let f=0;f<u;f++)o.apply(o,[t,...a])})}}class R3 extends q1{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,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 a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,o={}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,f=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;t.indexOf(".")>-1?m=t.split("."):(m=[t,a],r&&(Array.isArray(r)?m.push(...r):sn(r)&&u?m.push(...r.split(u)):m.push(r)));const g=F1(this.data,m);return!g&&!a&&!r&&t.indexOf(".")>-1&&(t=m[0],a=m[1],r=m.slice(2).join(".")),g||!f||!sn(r)?g:zE(this.data?.[t]?.[a],r,u)}addResource(t,a,r,o,u={silent:!1}){const f=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let m=[t,a];r&&(m=m.concat(f?r.split(f):r)),t.indexOf(".")>-1&&(m=t.split("."),o=a,a=m[1]),this.addNamespaces(a),O3(this.data,m,o),u.silent||this.emit("added",t,a,r,o)}addResources(t,a,r,o={silent:!1}){for(const u in r)(sn(r[u])||Array.isArray(r[u]))&&this.addResource(t,a,u,r[u],{silent:!0});o.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,o,u,f={silent:!1,skipCopy:!1}){let m=[t,a];t.indexOf(".")>-1&&(m=t.split("."),o=r,r=a,a=m[1]),this.addNamespaces(a);let g=F1(this.data,m)||{};f.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?T3(g,r,u):g={...g,...r},O3(this.data,m,g),f.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}}var A3={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,o){return e.forEach(u=>{t=this.processors[u]?.process(t,a,r,o)??t}),t}};const M3={},_3=e=>!sn(e)&&typeof e!="boolean"&&typeof e!="number";class X1 extends q1{constructor(t,a={}){super(),T7(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ws.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const r={...a};return t==null?!1:this.resolve(t,r)?.res!==void 0}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let u=a.ns||this.options.defaultNS||[];const f=r&&t.indexOf(r)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!j7(t,r,o);if(f&&!m){const g=t.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:t,namespaces:sn(u)?[u]:u};const p=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(p[0])>-1)&&(u=p.shift()),t=p.join(o)}return{key:t,namespaces:sn(u)?[u]:u}}translate(t,a,r){let o=typeof a=="object"?{...a}:a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,f=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(t[t.length-1],o),p=g[g.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const x=o.lng||this.language,E=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return E?u?{res:`${p}${v}${m}`,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${v}${m}`:u?{res:m,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:m;const O=this.resolve(t,o);let T=O?.res;const _=O?.usedKey||m,R=O?.exactUsedKey||m,M=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,V=o.count!==void 0&&!sn(o.count),$=X1.hasDefaultValue(o),j=V?this.pluralResolver.getSuffix(x,o.count,o):"",H=o.ordinal&&V?this.pluralResolver.getSuffix(x,o.count,{ordinal:!1}):"",N=V&&!o.ordinal&&o.count===0,B=N&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${j}`]||o[`defaultValue${H}`]||o.defaultValue;let P=T;L&&!T&&$&&(P=B);const Z=_3(P),Y=Object.prototype.toString.apply(P);if(L&&P&&Z&&M.indexOf(Y)<0&&!(sn(D)&&Array.isArray(P))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,P,{...o,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return u?(O.res=K,O.usedParams=this.getUsedParamsDetails(o),O):K}if(f){const K=Array.isArray(P),Q=K?[]:{},se=K?R:_;for(const q in P)if(Object.prototype.hasOwnProperty.call(P,q)){const F=`${se}${f}${q}`;$&&!T?Q[q]=this.translate(F,{...o,defaultValue:_3(B)?B[q]:void 0,joinArrays:!1,ns:g}):Q[q]=this.translate(F,{...o,joinArrays:!1,ns:g}),Q[q]===F&&(Q[q]=P[q])}T=Q}}else if(L&&sn(D)&&Array.isArray(T))T=T.join(D),T&&(T=this.extendTranslation(T,t,o,r));else{let K=!1,Q=!1;!this.isValidLookup(T)&&$&&(K=!0,T=B),this.isValidLookup(T)||(Q=!0,T=m);const q=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Q?void 0:T,F=$&&B!==T&&this.options.updateMissing;if(Q||K||F){if(this.logger.log(F?"updateKey":"missingKey",x,p,m,F?B:T),f){const U=this.resolve(m,{...o,keySeparator:!1});U&&U.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 ee=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let U=0;U<ce.length;U++)ee.push(ce[U]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(o.lng||this.language):ee.push(o.lng||this.language);const G=(U,J,re)=>{const ne=$&&re!==T?re:q;this.options.missingKeyHandler?this.options.missingKeyHandler(U,p,J,ne,F,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(U,p,J,ne,F,o),this.emit("missingKey",U,p,J,T)};this.options.saveMissing&&(this.options.saveMissingPlurals&&V?ee.forEach(U=>{const J=this.pluralResolver.getSuffixes(U,o);N&&o[`defaultValue${this.options.pluralSeparator}zero`]&&J.indexOf(`${this.options.pluralSeparator}zero`)<0&&J.push(`${this.options.pluralSeparator}zero`),J.forEach(re=>{G([U],m+re,o[`defaultValue${re}`]||B)})}):G(ee,m,B))}T=this.extendTranslation(T,t,o,O,r),Q&&T===m&&this.options.appendNamespaceToMissingKey&&(T=`${p}${v}${m}`),(Q||K)&&this.options.parseMissingKeyHandler&&(T=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${v}${m}`:m,K?T:void 0,o))}return u?(O.res=T,O.usedParams=this.getUsedParamsDetails(o),O):T}extendTranslation(t,a,r,o,u){if(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 g=sn(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(g){const x=t.match(this.interpolator.nestingRegexp);p=x&&x.length}let v=r.replace&&!sn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,r.lng||this.language||o.usedLng,r),g){const x=t.match(this.interpolator.nestingRegexp),E=x&&x.length;p<E&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>u?.[0]===x[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${a[0]}`),null):this.translate(...x,a),r)),r.interpolation&&this.interpolator.reset()}const f=r.postProcess||this.options.postProcess,m=sn(f)?[f]:f;return t!=null&&m?.length&&r.applyPostProcessor!==!1&&(t=A3.handle(m,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,a={}){let r,o,u,f,m;return sn(t)&&(t=[t]),t.forEach(g=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(g,a),v=p.key;o=v;let x=p.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const E=a.count!==void 0&&!sn(a.count),O=E&&!a.ordinal&&a.count===0,T=a.context!==void 0&&(sn(a.context)||typeof a.context=="number")&&a.context!=="",_=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);x.forEach(R=>{this.isValidLookup(r)||(m=R,!M3[`${_[0]}-${R}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(M3[`${_[0]}-${R}`]=!0,this.logger.warn(`key "${o}" for languages "${_.join(", ")}" won't get resolved as namespace "${m}" 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!!!")),_.forEach(M=>{if(this.isValidLookup(r))return;f=M;const D=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(D,v,M,R,a);else{let V;E&&(V=this.pluralResolver.getSuffix(M,a.count,a));const $=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(E&&(D.push(v+V),a.ordinal&&V.indexOf(j)===0&&D.push(v+V.replace(j,this.options.pluralSeparator)),O&&D.push(v+$)),T){const H=`${v}${this.options.contextSeparator}${a.context}`;D.push(H),E&&(D.push(H+V),a.ordinal&&V.indexOf(j)===0&&D.push(H+V.replace(j,this.options.pluralSeparator)),O&&D.push(H+$))}}let L;for(;L=D.pop();)this.isValidLookup(r)||(u=L,r=this.getResource(M,R,L,a))}))})}),{res:r,usedKey:o,exactUsedKey:u,usedLng:f,usedNS:m}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,r,o):this.resourceStore.getResource(t,a,r,o)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!sn(t.replace);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 u of a)delete o[u]}return o}static hasDefaultValue(t){const a="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}}class N3{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ws.create("languageUtils")}getScriptPartFromCode(t){if(t=Vv(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Vv(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(sn(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}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 a;return t.forEach(r=>{if(a)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return a=o;const u=this.getLanguagePartFromCode(r);if(this.isSupportedCode(u))return a=u;a=this.options.supportedLngs.find(f=>{if(f===u)return f;if(!(f.indexOf("-")<0&&u.indexOf("-")<0)&&(f.indexOf("-")>0&&u.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===u||f.indexOf(u)===0&&u.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),sn(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),o=[],u=f=>{f&&(this.isSupportedCode(f)?o.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return sn(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(t))):sn(t)&&u(this.formatLanguageCode(t)),r.forEach(f=>{o.indexOf(f)<0&&u(this.formatLanguageCode(f))}),o}}const D3={zero:0,one:1,two:2,few:3,many:4,other:5},$3={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class V7{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Ws.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const r=Vv(t==="dev"?"en":t),o=a.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:r,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let f;try{f=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),$3;if(!t.match(/-|_/))return $3;const g=this.languageUtils.getLanguagePartFromCode(t);f=this.getRule(g,a)}return this.pluralRulesCache[u]=f,f}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(o=>`${a}${o}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((o,u)=>D3[o]-D3[u]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,a,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}}const z3=(e,t,a,r=".",o=!0)=>{let u=M7(e,t,a);return!u&&o&&sn(a)&&(u=zE(e,a,r),u===void 0&&(u=zE(t,a,r))),u},jE=e=>e.replace(/\$/g,"$$$$");class P7{constructor(t={}){this.logger=Ws.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:o,prefix:u,prefixEscaped:f,suffix:m,suffixEscaped:g,formatSeparator:p,unescapeSuffix:v,unescapePrefix:x,nestingPrefix:E,nestingPrefixEscaped:O,nestingSuffix:T,nestingSuffixEscaped:_,nestingOptionsSeparator:R,maxReplaces:M,alwaysFormat:D}=t.interpolation;this.escape=a!==void 0?a:N7,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Rm(u):f||"{{",this.suffix=m?Rm(m):g||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=E?Rm(E):O||Rm("$t("),this.nestingSuffix=T?Rm(T):_||Rm(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=M||1e3,this.alwaysFormat=D!==void 0?D:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,r)=>a?.source===r?(a.lastIndex=0,a):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,a,r,o){let u,f,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=O=>{if(O.indexOf(this.formatSeparator)<0){const M=z3(a,g,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,r,{...o,...a,interpolationkey:O}):M}const T=O.split(this.formatSeparator),_=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(z3(a,g,_,this.options.keySeparator,this.options.ignoreJSONStructure),R,r,{...o,...a,interpolationkey:_})};this.resetRegExp();const v=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>jE(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?jE(this.escape(O)):jE(O)}].forEach(O=>{for(m=0;u=O.regex.exec(t);){const T=u[1].trim();if(f=p(T),f===void 0)if(typeof v=="function"){const R=v(t,u,o);f=sn(R)?R:""}else if(o&&Object.prototype.hasOwnProperty.call(o,T))f="";else if(x){f=u[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${t}`),f="";else!sn(f)&&!this.useRawValueToEscape&&(f=C3(f));const _=O.safeValue(f);if(t=t.replace(u[0],_),x?(O.regex.lastIndex+=f.length,O.regex.lastIndex-=u[0].length):O.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),t}nest(t,a,r={}){let o,u,f;const m=(g,p)=>{const v=this.nestingOptionsSeparator;if(g.indexOf(v)<0)return g;const x=g.split(new RegExp(`${v}[ ]*{`));let E=`{${x[1]}`;g=x[0],E=this.interpolate(E,f);const O=E.match(/'/g),T=E.match(/"/g);((O?.length??0)%2===0&&!T||T.length%2!==0)&&(E=E.replace(/'/g,'"'));try{f=JSON.parse(E),p&&(f={...p,...f})}catch(_){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,_),`${g}${v}${E}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;o=this.nestingRegexp.exec(t);){let g=[];f={...r},f=f.replace&&!sn(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const p=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(p!==-1&&(g=o[1].slice(p).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),o[1]=o[1].slice(0,p)),u=a(m.call(this,o[1].trim(),f),f),u&&o[0]===t&&!sn(u))return u;sn(u)||(u=C3(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),u=""),g.length&&(u=g.reduce((v,x)=>this.format(v,x,r.lng,{...r,interpolationkey:o[1].trim()}),u.trim())),t=t.replace(o[0],u),this.regexp.lastIndex=0}return t}}const H7=e=>{let t=e.toLowerCase().trim();const a={};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?a.currency||(a.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(f=>{if(f){const[m,...g]=f.split(":"),p=g.join(":").trim().replace(/^'+|'+$/g,""),v=m.trim();a[v]||(a[v]=p),p==="false"&&(a[v]=!1),p==="true"&&(a[v]=!0),isNaN(p)||(a[v]=parseInt(p,10))}})}return{formatName:t,formatOptions:a}},j3=e=>{const t={};return(a,r,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const f=r+JSON.stringify(u);let m=t[f];return m||(m=e(Vv(r),o),t[f]=m),m(a)}},B7=e=>(t,a,r)=>e(Vv(a),r)(t);class I7{constructor(t={}){this.logger=Ws.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?j3:B7;this.formats={number:r((o,u)=>{const f=new Intl.NumberFormat(o,{...u});return m=>f.format(m)}),currency:r((o,u)=>{const f=new Intl.NumberFormat(o,{...u,style:"currency"});return m=>f.format(m)}),datetime:r((o,u)=>{const f=new Intl.DateTimeFormat(o,{...u});return m=>f.format(m)}),relativetime:r((o,u)=>{const f=new Intl.RelativeTimeFormat(o,{...u});return m=>f.format(m,u.range||"day")}),list:r((o,u)=>{const f=new Intl.ListFormat(o,{...u});return m=>f.format(m)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=j3(a)}format(t,a,r,o={}){const u=a.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(m=>m.indexOf(")")>-1)){const m=u.findIndex(g=>g.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,m)].join(this.formatSeparator)}return u.reduce((m,g)=>{const{formatName:p,formatOptions:v}=H7(g);if(this.formats[p]){let x=m;try{const E=o?.formatParams?.[o.interpolationkey]||{},O=E.locale||E.lng||o.locale||o.lng||r;x=this.formats[p](m,O,{...v,...o,...E})}catch(E){this.logger.warn(E)}return x}else this.logger.warn(`there was no format function for ${p}`);return m},t)}}const U7=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class k7 extends q1{constructor(t,a,r,o={}){super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Ws.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?.init?.(r,o.backend,o)}queueLoad(t,a,r,o){const u={},f={},m={},g={};return t.forEach(p=>{let v=!0;a.forEach(x=>{const E=`${p}|${x}`;!r.reload&&this.store.hasResourceBundle(p,x)?this.state[E]=2:this.state[E]<0||(this.state[E]===1?f[E]===void 0&&(f[E]=!0):(this.state[E]=1,v=!1,f[E]===void 0&&(f[E]=!0),u[E]===void 0&&(u[E]=!0),g[x]===void 0&&(g[x]=!0)))}),v||(m[p]=!0)}),(Object.keys(u).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(f),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(t,a,r){const o=t.split("|"),u=o[0],f=o[1];a&&this.emit("failedLoading",u,f,a),!a&&r&&this.store.addResourceBundle(u,f,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);const m={};this.queue.forEach(g=>{A7(g.loaded,[u],f),U7(g,t),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(p=>{m[p]||(m[p]={});const v=g.loaded[p];v.length&&v.forEach(x=>{m[p][x]===void 0&&(m[p][x]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(t,a,r,o=0,u=this.retryTimeout,f){if(!t.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:o,wait:u,callback:f});return}this.readingCalls++;const m=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(p&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,o+1,u*2,f)},u);return}f(p,v)},g=this.backend[r].bind(this.backend);if(g.length===2){try{const p=g(t,a);p&&typeof p.then=="function"?p.then(v=>m(null,v)).catch(m):m(null,p)}catch(p){m(p)}return}return g(t,a,m)}prepareLoading(t,a,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();sn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),sn(a)&&(a=[a]);const u=this.queueLoad(t,a,r,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(f=>{this.loadOne(f)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){const r=t.split("|"),o=r[0],u=r[1];this.read(o,u,"read",void 0,void 0,(f,m)=>{f&&this.logger.warn(`${a}loading namespace ${u} for language ${o} failed`,f),!f&&m&&this.logger.log(`${a}loaded namespace ${u} for language ${o}`,m),this.loaded(t,f,m)})}saveMissing(t,a,r,o,u,f={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the 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!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const g={...f,isUpdate:u},p=this.backend.create.bind(this.backend);if(p.length<6)try{let v;p.length===5?v=p(t,a,r,o,g):v=p(t,a,r,o),v&&typeof v.then=="function"?v.then(x=>m(null,x)).catch(m):m(null,v)}catch(v){m(v)}else p(t,a,r,o,m,g)}!t||!t[0]||this.store.addResource(t[0],a,r,o)}}}const L3=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),sn(e[1])&&(t.defaultValue=e[1]),sn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),V3=e=>(sn(e.ns)&&(e.ns=[e.ns]),sn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),sn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Y1=()=>{},F7=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class Pv extends q1{constructor(t={},a){if(super(),this.options=V3(t),this.services={},this.logger=Ws,this.modules={external:[]},F7(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(sn(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=L3();this.options={...r,...this.options,...V3(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ws.init(o(this.modules.logger),this.options):Ws.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=I7;const v=new N3(this.options);this.store=new R3(this.options.resources,this.options);const x=this.services;x.logger=Ws,x.resourceStore=this.store,x.languageUtils=v,x.pluralResolver=new V7(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(x.formatter=o(p),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new P7(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new k7(o(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(O,...T)=>{this.emit(O,...T)}),this.modules.languageDetector&&(x.languageDetector=o(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=o(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new X1(this.services,this.options),this.translator.on("*",(O,...T)=>{this.emit(O,...T)}),this.modules.external.forEach(O=>{O.init&&O.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Y1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(p=>{this[p]=(...v)=>this.store[p](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...v)=>(this.store[p](...v),this)});const m=jv(),g=()=>{const p=(v,x)=>{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),m.resolve(x),a(v,x)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(t,a=Y1){let r=a;const o=sn(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const u=[],f=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&u.indexOf(p)<0&&u.push(p)})};o?f(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>f(g)),this.options.preload?.forEach?.(m=>f(m)),this.services.backendConnector.load(u,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(m)})}else r(null)}reloadResources(t,a,r){const o=jv();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=Y1),this.services.backendConnector.reload(t,a,u=>{o.resolve(),r(u)}),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"&&A3.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 a=0;a<this.languages.length;a++){const r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const r=jv();this.emit("languageChanging",t);const o=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},u=(m,g)=>{g?this.isLanguageChangingTo===t&&(o(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,r.resolve((...p)=>this.t(...p)),a&&a(m,(...p)=>this.t(...p))},f=m=>{!t&&!m&&this.services.languageDetector&&(m=[]);const g=sn(m)?m:m&&m[0],p=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(sn(m)?[m]:m);p&&(this.language||o(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,v=>{u(v,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(t),r}getFixedT(t,a,r){const o=(u,f,...m)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([u,f].concat(m)):g={...f},g.lng=g.lng||o.lng,g.lngs=g.lngs||o.lngs,g.ns=g.ns||o.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||r||o.keyPrefix);const p=this.options.keySeparator||".";let v;return g.keyPrefix&&Array.isArray(u)?v=u.map(x=>`${g.keyPrefix}${p}${x}`):v=g.keyPrefix?`${g.keyPrefix}${p}${u}`:u,this.t(v,g)};return sn(t)?o.lng=t:o.lngs=t,o.ns=a,o.keyPrefix=r,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){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=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const f=(m,g)=>{const p=this.services.backendConnector.state[`${m}|${g}`];return p===-1||p===0||p===2};if(a.precheck){const m=a.precheck(this,f);if(m!==void 0)return m}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(r,t)&&(!o||f(u,t)))}loadNamespaces(t,a){const r=jv();return this.options.ns?(sn(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),a&&a(o)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){const r=jv();sn(t)&&(t=[t]);const o=this.options.preload||[],u=t.filter(f=>o.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return u.length?(this.options.preload=o.concat(u),this.loadResources(f=>{r.resolve(),a&&a(f)}),r):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const u=o.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const a=["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?.languageUtils||new N3(L3());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){return new Pv(t,a)}cloneInstance(t={},a=Y1){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},u=new Pv(o);if((t.debug!==void 0||t.prefix!==void 0)&&(u.logger=u.logger.clone(t)),["store","services","language"].forEach(m=>{u[m]=this[m]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},r){const m=Object.keys(this.store.data).reduce((g,p)=>(g[p]={...this.store.data[p]},g[p]=Object.keys(g[p]).reduce((v,x)=>(v[x]={...g[p][x]},v),g[p]),g),{});u.store=new R3(m,o),u.services.resourceStore=u.store}return u.translator=new X1(u.services,o),u.translator.on("*",(m,...g)=>{u.emit(m,...g)}),u.init(o,a),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Zr=Pv.createInstance();Zr.createInstance=Pv.createInstance,Zr.createInstance,Zr.dir,Zr.init,Zr.loadResources,Zr.reloadResources,Zr.use,Zr.changeLanguage,Zr.getFixedT,Zr.t,Zr.exists,Zr.setDefaultNamespace,Zr.hasLoadedNamespace,Zr.loadNamespaces,Zr.loadLanguages;const G7=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,q7={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},X7=e=>q7[e];let P3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(G7,X7)};const Y7=(e={})=>{P3={...P3,...e}},W7={type:"3rdParty",init(e){Y7(e.options.react)}},K7={en:{translation:{welcome:"Hi there, you’re speaking with Jaweb AI Assistant."}},ar:{translation:{welcome:"مرحبًا، أنت تتحدث إلى مساعد Jaweb AI."}}};Zr.use(W7).init({resources:K7,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const Z7=3,Q7=3e3,J7=()=>{const[e,t]=S.useState(!0),[a,r]=S.useState(!0),[o,u]=S.useState(""),[f,m]=S.useState(""),[g,p]=S.useState(!1),[v,x]=S.useState(!1),[E,O]=S.useState(""),[T,_]=S.useState(""),[R,M]=S.useState(null),[D,L]=S.useState(""),[V,$]=S.useState([]),[j,H]=S.useState([]),[N,B]=S.useState(""),[P,Z]=S.useState(!1),[Y,K]=S.useState(!0),[Q,se]=S.useState(""),q=async(F=0)=>{const ee=localStorage.getItem("company_username");t(!0);const ce={headers:{"Content-Type":"application/json",Accept:"application/json"},params:{username:ee}};try{const U=(await Ca.get(`${Kr.apiUrl}chatbot-details/`,ce)).data.data;U.language==="Arabic"?Zr.changeLanguage("ar"):Zr.changeLanguage("en"),r(U.chatbot_form),u(U.chatbot_color),m(U.chatbot_logo),p(U.disable_chatbot_globally),x(U.remove_powered_by_jaweb),O(U.chatbot_initial_msg),_(U.status),B(U.mode),M(U.calendly_link??null),Z(U.disable_checkout),se(U.chatbot_name),K(U.enable_try_on),U.calendly_link&&M(U.calendly_link),U.phone_number_id&&L(`+${U.phone_number_id}`);const J=await Ca.get(`${Kr.apiUrl}chatbot-plugin-suggestions/`,ce);let re=[];Array.isArray(J.data.data)?re=J.data.data:Array.isArray(J.data.user_questions)&&(re=J.data.user_questions),re.length>0?($(re.slice(0,3)),H(re.slice(3))):($([]),H([])),t(!1)}catch(G){console.error("Error fetching data:",G),F<Z7?setTimeout(()=>q(F+1),Q7):console.error("Max retries reached. Could not fetch data.")}};return S.useEffect(()=>{q()},[]),{isFetchingDetails:e,disableForm:a,colorCode:o,chatbotLogo:f,disableChatbotGlobally:g,removePoweredByJaweb:v,initialMessageText:E,subscription:T,calendly:R,merchantPhone:D,messagesSuggestions:V,setMessagesSuggestions:$,restSuggestions:j,userType:N,disbleCheckout:P,chatbotName:Q,enableTryOn:Y}};var LE={exports:{}};/*!
325
325
  Copyright (c) 2018 Jed Watson.
326
326
  Licensed under the MIT License (MIT), see
327
327
  http://jedwatson.github.io/classnames
package/home.html CHANGED
@@ -7,7 +7,7 @@
7
7
  </head>
8
8
  <body>
9
9
  <iframe
10
- src="https://jawebcrm.onrender.com/static/widget-hero.html"
10
+ src="https://api.jaweb.me/static/widget-hero.html"
11
11
 
12
12
  height="600"
13
13
  style="border:none; ">
package/jawebDirect.js CHANGED
@@ -5,7 +5,7 @@
5
5
  const company = (currentScript.getAttribute('data-company') || '').trim();
6
6
  if (!company) return console.error('[Jaweb] data-company is required');
7
7
 
8
- const apiBase = currentScript.getAttribute('data-src') || 'https://jawebcrm.onrender.com/api/proxy/iframe';
8
+ const apiBase = currentScript.getAttribute('data-src') || 'https://api.jaweb.me/api/proxy/iframe';
9
9
  const corner = currentScript.getAttribute('data-corner') || 'right'; // 'right' | 'left'
10
10
  const openWidth = currentScript.getAttribute('data-open-width') || '400px';
11
11
  const openHeight = currentScript.getAttribute('data-open-height') || '95%';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shopify-chatbot-widget",
3
3
  "private": false,
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,8 +1,8 @@
1
1
 
2
2
 
3
3
  const config = {
4
- apiUrl:'https://jawebcrm.onrender.com/api/',
5
- websocketUrl:'wss://jawebcrm.onrender.com/ws' ,
4
+ apiUrl:'https://api.jaweb.me/api/',
5
+ websocketUrl:'wss://api.jaweb.me/ws' ,
6
6
 
7
7
  // apiUrl:'http://localhost:8000/api/',
8
8
  // websocketUrl:'ws://localhost:8000/ws',