\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`${n}>\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${se(e,!0)}`}br(e){return" "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),i=ie(e);if(null===i)return s;let r='"+s+"",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=ie(e);if(null===i)return se(n);let r=`",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:se(e.text)}},ue=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ge=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new he,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ue}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n{let i=e[s].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new he(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let s=n,i=e.renderer[s],r=t[s];t[s]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new pe(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let s=n,i=e.tokenizer[s],r=t[s];t[s]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fe;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let s=n,i=e.hooks[s],r=t[s];fe.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return r.call(t,n)})();let s=i.call(t,e);return r.call(t,s)}:t[s]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await r.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return de.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===s.async)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return r(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,s=await(i.hooks?await i.hooks.provideLexer(e):e?de.lex:de.lexInline)(n,i),r=i.hooks?await i.hooks.processAllTokens(s):s;i.walkTokens&&await Promise.all(this.walkTokens(r,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ge.parse:ge.parseInline)(r,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(r);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?de.lex:de.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let s=(i.hooks?i.hooks.provideParser(e):e?ge.parse:ge.parseInline)(n,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return r(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="
An error occurred:
"+se(n.message+"",!0)+"
";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function be(e,t){return me.parse(e,t)}be.options=be.setOptions=function(e){return me.setOptions(e),be.defaults=me.defaults,n(be.defaults),be},be.getDefaults=e,be.defaults=t,be.use=function(...e){return me.use(...e),be.defaults=me.defaults,n(be.defaults),be},be.walkTokens=function(e,t){return me.walkTokens(e,t)},be.parseInline=me.parseInline,be.Parser=ge,be.parser=ge.parse,be.Renderer=he,be.TextRenderer=ue,be.Lexer=de,be.lexer=de.lex,be.Tokenizer=pe,be.Hooks=fe,be.parse=be;be.options,be.setOptions,be.use,be.walkTokens,be.parseInline,ge.parse,de.lex;const xe="https://api.ls-ai.ru";let ye=null,we=null,ke=3e3;const Ae=[],ve=new Set,Se=new Set;function Ce(e){return ve.add(e),()=>ve.delete(e)}function Le(e){we&&(clearTimeout(we),we=null),we=setTimeout((()=>{we=null,Ee()}),e)}function Ee(){if(ye&&(ye.readyState===WebSocket.CONNECTING||ye.readyState===WebSocket.OPEN))return;const e=`${xe.replace(/^http:/i,"ws:").replace(/^https:/i,"wss:").replace(/\/$/,"")}/ws/widget?api_key=${encodeURIComponent("sk-7310279610ea83158fbf086de07ac9cf8c7aa27c1626822e4b70d2f4f13dd83e")}`;try{ye=new WebSocket(e)}catch(e){return console.error("WidgetWebSocket: failed to create",e),void Le(ke)}ye.onopen=()=>{ke=3e3,function(){if(ye&&ye.readyState===WebSocket.OPEN)for(;Ae.length;){const e=Ae.shift();if(e)try{ye.send(e)}catch{Ae.unshift(e);break}}}(),function(){for(const e of Se)try{e()}catch(e){console.error("WidgetWs onOpen handler error",e)}}()},ye.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}"system"!==t.domain||"ping"!==t.type?function(e){for(const t of ve)try{t(e)}catch(e){console.error("WidgetWs listener error",e)}}(t):Re("system","pong",{})},ye.onerror=()=>{},ye.onclose=e=>{ye=null,4001===e.code?(ke=Math.min(2*ke,12e4),Le(Math.max(ke,6e4))):Le(ke)}}function Re(e,t,n){const s=JSON.stringify({v:1,domain:e,type:t,payload:n??{},ts:(new Date).toISOString()});if(ye?.readyState===WebSocket.OPEN)try{ye.send(s)}catch{Ae.push(s)}else Ae.push(s)}function Te(e,t,n,s=25e3){const i=()=>new Promise(((i,r)=>{let o=!1,a=null;const l=setTimeout((()=>{o||(o=!0,a?.(),r(new Error("Widget WS timeout")))}),s);a=Ce((e=>{if("widget"===e.domain){if(e.type===n){if(o)return;return o=!0,clearTimeout(l),a?.(),void i()}if("error"===e.type){if(o)return;o=!0,clearTimeout(l),a?.(),r(new Error(String(e.payload?.message??"error")))}}})),Re("widget",e,t)})),r=Ne.then((()=>i()),(()=>i()));return Ne=r.catch((()=>{})),r}function $e(e,t,n,s=25e3){const i=()=>new Promise(((i,r)=>{let o=!1,a=null;const l=setTimeout((()=>{o||(o=!0,a?.(),r(new Error("Widget WS timeout")))}),s);a=Ce((e=>{if("widget"===e.domain){if(e.type===n){if(o)return;return o=!0,clearTimeout(l),a?.(),void i(e.payload??{})}if("error"===e.type){if(o)return;o=!0,clearTimeout(l),a?.(),r(new Error(String(e.payload?.message??"error")))}}})),Re("widget",e,t)})),r=Ne.then((()=>i()),(()=>i()));return Ne=r.catch((()=>{})),r}let Ne=Promise.resolve();function Pe(e){const t={};if(null==e)return t;if("string"==typeof e)return t.payload=e,t;for(const[n,s]of Object.entries(e))t[n]="string"==typeof s?s:JSON.stringify(s);return t}const Oe=e=>"string"==typeof e,_e=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},Ie=e=>null==e?"":String(e),je=/###/g,ze=e=>e&&e.includes("###")?e.replace(je,"."):e,De=e=>!e||Oe(e),Be=(e,t,n)=>{const s=Oe(t)?t.split("."):t;let i=0;for(;i{const{obj:s,k:i}=Be(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let r=t[t.length-1],o=t.slice(0,t.length-1),a=Be(e,o,Object);for(;void 0===a.obj&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=Be(e,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=n},He=(e,t)=>{const{obj:n,k:s}=Be(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},Fe=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?Oe(e[s])||e[s]instanceof String||Oe(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):Fe(e[s],t[s],n):e[s]=t[s]);return e},qe=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Ve={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Ue=e=>Oe(e)?e.replace(/[&<>"'\/]/g,(e=>Ve[e])):e;const We=[" ",",","?","!",";"],Qe=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ke=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;ee?.replace(/_/g,"-"),Je={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 Ge{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Je,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(Oe(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ge(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ge(this.logger,e)}}var Xe=new Ge;class Ye{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,n])=>{for(let s=0;s{for(let i=0;i-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,r=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Oe(n)&&i?o.push(...n.split(i)):o.push(n)));const a=He(this.data,o);return a||t||n||!e.includes(".")||(e=o[0],t=o[1],n=o.slice(2).join(".")),!a&&r&&Oe(n)?Ke(this.data?.[e]?.[t],n,i):a}addResource(e,t,n,s,i={silent:!1}){const r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(r?n.split(r):n)),e.includes(".")&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Me(this.data,o,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const s in n)(Oe(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i,r={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let a=He(this.data,o)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Fe(a,n,i):a={...a,...n},Me(this.data,o,a),r.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var tt={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const nt=Symbol("i18next/PATH_KEY");function st(e,t){const{[nt]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(s,i)=>(n?.revoke?.(),i===nt?e:(e.push(i),n=Proxy.revocable(s,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),s=t?.keySeparator??".",i=t?.nsSeparator??":";if(n.length>1&&i){const e=t?.ns,r=Array.isArray(e)?e:null;if(r&&r.length>1&&r.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(s)}`}return n.join(s)}const it=e=>!Oe(e)&&"boolean"!=typeof e&&"number"!=typeof e;class rt extends Ye{constructor(e,t={}){super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Xe.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const s=this.resolve(e,n);if(void 0===s?.res)return!1;const i=it(s.res);return!1!==n.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const r=n&&e.includes(n),o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=We.filter((e=>!t.includes(e)&&!n.includes(e)));if(0===s.length)return!0;const i=Qe.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let r=!i.test(e);if(!r){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(r=!0)}return r})(e,n,s));if(r&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Oe(i)?[i]:i};const r=e.split(n);(n!==s||n===s&&this.options.ns.includes(r[0]))&&(i=r.shift()),e=r.join(s)}return{key:e,namespaces:Oe(i)?[i]:i}}translate(e,t,n){let s="object"==typeof t?{...t}:t;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==e)return"";"function"==typeof e&&(e=st(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]),e=e.map((e=>"function"==typeof e?st(e,{...this.options,...s}):String(e)));const i=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],s),l=a[a.length-1];let c=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return d?i?{res:`${l}${c}${o}`,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${c}${o}`:i?{res:o,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let u=h?.res;const g=h?.usedKey||o,f=h?.exactUsedKey||o,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==s.count&&!Oe(s.count),y=rt.hasDefaultValue(s),w=x?this.pluralResolver.getSuffix(p,s.count,s):"",k=s.ordinal&&x?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",A=x&&!s.ordinal&&0===s.count,v=A&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${w}`]||s[`defaultValue${k}`]||s.defaultValue;let S=u;b&&!u&&y&&(S=v);const C=it(S),L=Object.prototype.toString.apply(S);if(!(b&&S&&C)||["[object Number]","[object Function]","[object RegExp]"].includes(L)||Oe(m)&&Array.isArray(S))if(b&&Oe(m)&&Array.isArray(u))u=u.join(m),u&&(u=this.extendTranslation(u,e,s,n));else{let t=!1,i=!1;!this.isValidLookup(u)&&y&&(t=!0,u=v),this.isValidLookup(u)||(i=!0,u=o);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:u,d=y&&v!==u&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",p,l,o,d?v:u),r){const e=this.resolve(o,{...s,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n{const i=y&&n!==u?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,s),this.emit("missingKey",e,l,t,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,s);A&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],o+t,s[`defaultValue${t}`]||v)}))})):n(e,o,v))}u=this.extendTranslation(u,e,s,h,n),i&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${l}${c}${o}`),(i||t)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${o}`:o,t?u:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,S,{...s,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(s),h):e}if(r){const e=Array.isArray(S),t=e?[]:{},n=e?f:g;for(const e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const i=`${n}${r}${e}`;t[e]=y&&!u?this.translate(i,{...s,defaultValue:it(v)?v[e]:void 0,joinArrays:!1,ns:a}):this.translate(i,{...s,joinArrays:!1,ns:a}),t[e]===i&&(t[e]=S[e])}u=t}}return i?(h.res=u,h.usedParams=this.getUsedParamsDetails(s),h):u}extendTranslation(e,t,n,s,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=Oe(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(r){const t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let a=n.replace&&!Oe(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||s.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,o=Oe(r)?[r]:r;return null!=e&&o?.length&&!1!==n.applyPostProcessor&&(e=tt.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,i,r,o;return Oe(e)&&(e=[e]),Array.isArray(e)&&(e=e.map((e=>"function"==typeof e?st(e,{...this.options,...t}):e))),e.forEach((e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;s=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==t.count&&!Oe(t.count),d=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Oe(t.context)||"number"==typeof t.context)&&""!==t.context,u=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach((e=>{this.isValidLookup(n)||(o=e,this.checkedLoadedFor[`${u[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(this.checkedLoadedFor[`${u[0]}-${e}`]=!0,this.logger.warn(`key "${s}" for languages "${u.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((s=>{if(this.isValidLookup(n))return;r=s;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&e.startsWith(i)&&o.push(l+e.replace(i,this.options.pluralSeparator)),o.push(l+e),d&&o.push(l+n)),h){const s=`${l}${this.options.contextSeparator||"_"}${t.context}`;o.push(s),p&&(t.ordinal&&e.startsWith(i)&&o.push(s+e.replace(i,this.options.pluralSeparator)),o.push(s+e),d&&o.push(s+n))}}let a;for(;a=o.pop();)this.isValidLookup(n)||(i=a,n=this.getResource(s,e,a,t))})))}))})),{res:n,usedKey:s,exactUsedKey:i,usedLng:r,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Oe(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class ot{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xe.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ze(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Ze(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Oe(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const s=this.getLanguagePartFromCode(e);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find((e=>e===s||!(!e.includes("-")&&!s.includes("-"))&&(!(!e.includes("-")||s.includes("-")||e.slice(0,e.indexOf("-"))!==s)||!!(e.startsWith(s)&&s.length>1))))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Oe(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Oe(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):Oe(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.includes(e)||i(this.formatLanguageCode(e))})),s}}const at={zero:0,one:1,two:2,few:3,many:4,other:5},lt={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ct{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Xe.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ze("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let r;try{r=new Intl.PluralRules(n,{type:s})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),lt;if(!e.match(/-|_/))return lt;const s=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(s,t)}return this.pluralRulesCache[i]=r,r}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>at[e]-at[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const pt=(e,t,n,s=".",i=!0)=>{let r=((e,t,n)=>{const s=He(e,n);return void 0!==s?s:He(t,n)})(e,t,n);return!r&&i&&Oe(n)&&(r=Ke(e,n,s),void 0===r&&(r=Ke(t,n,s))),r},dt=e=>e.replace(/\$/g,"$$$$");class ht{constructor(e={}){this.logger=Xe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:r,suffix:o,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:p,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:u,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:Ue,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?qe(i):r||"{{",this.suffix=o?qe(o):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?qe(d):h||qe("$t("),this.nestingSuffix=u?qe(u):g||qe(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,r,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const i=pt(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),r=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(pt(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...s,...t,interpolationkey:r})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>dt(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?dt(this.escape(e)):dt(e)}].forEach((t=>{for(o=0;i=t.regex.exec(e);){const n=i[1].trim();if(r=l(n),void 0===r)if("function"==typeof c){const t=c(e,i,s);r=Oe(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))r="";else{if(p){r=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),r=""}else Oe(r)||this.useRawValueToEscape||(r=Ie(r));const a=t.safeValue(r);if(e=e.replace(i[0],a),p?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t,n={}){let s,i,r;const o=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const s=e.split(new RegExp(`${qe(n)}[ ]*{`));let i=`{${s[1]}`;e=s[0],i=this.interpolate(i,r);const o=i.match(/'/g),a=i.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(i=i.replace(/'/g,'"'));try{r=JSON.parse(i),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return r.defaultValue&&r.defaultValue.includes(this.prefix)&&delete r.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let a=[];r={...n},r=r.replace&&!Oe(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const l=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==l&&(a=s[1].slice(l).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),s[1]=s[1].slice(0,l)),i=t(o.call(this,s[1].trim(),r),r),i&&s[0]===e&&!Oe(i))return i;Oe(i)||(i=Ie(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),a.length&&(i=a.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:s[1].trim()})),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const ut=e=>{const t={};return(n,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=t[o];return a||(a=e(Ze(s),i),t[o]=a),a(n)}},gt=e=>(t,n,s)=>e(Ze(n),s)(t);class ft{constructor(e={}){this.logger=Xe.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ut:gt;this.formats={number:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:n(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:n(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:n(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ut(t)}format(e,t,n,s={}){if(!t)return e;if(null==e)return e;const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&!i[0].includes(")")&&i.find((e=>e.includes(")")))){const e=i.findIndex((e=>e.includes(")")));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:r}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].slice(0,-1);"currency"!==t||i.includes(":")?"relativetime"!==t||i.includes(":")?i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();n[r]||(n[r]=i),"false"===i&&(n[r]=!1),"true"===i&&(n[r]=!0),isNaN(i)||(n[r]=parseInt(i,10))}})):n.range||(n.range=i.trim()):n.currency||(n.currency=i.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const o=s?.formatParams?.[s.interpolationkey]||{},a=o.locale||o.lng||s.locale||s.lng||n;t=this.formats[i](e,a,{...r,...s,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class mt extends Ye{constructor(e,t,n,s={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=Xe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},r={},o={},a={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,s=!1,void 0===r[o]&&(r[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===a[t]&&(a[t]=!0)))})),s||(o[e]=!0)})),(Object.keys(i).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const s=e.split("|"),i=s[0],r=s[1];t&&this.emit("failedLoading",i,r,t),!t&&n&&this.store.addResourceBundle(i,r,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=Be(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],r),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,s=0,i=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:r});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&a&&s{this.read(e,t,n,s+1,2*i,r)}),i):r(o,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,o);try{const n=a(e,t);n&&"function"==typeof n.then?n.then((e=>o(null,e))).catch(o):o(null,n)}catch(e){o(e)}}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Oe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Oe(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,r)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&r&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,r),this.loaded(e,n,r)}))}saveMissing(e,t,n,s,i,r={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const a={...r,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,a):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>o(null,e))).catch(o):o(null,i)}catch(e){o(e)}else l(e,t,n,s,o,a)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const bt=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Oe(e[1])&&(t.defaultValue=e[1]),Oe(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),xt=e=>(Oe(e.ns)&&(e.ns=[e.ns]),Oe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Oe(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),yt=()=>{};class wt extends Ye{constructor(e={},t){var n;if(super(),this.options=xt(e),this.services={},this.logger=Xe,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Oe(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=bt();this.options={...n,...this.options,...xt(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const s=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Xe.init(s(this.modules.logger),this.options):Xe.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ft;const t=new ot(this.options);this.store=new et(this.options.resources,this.options);const n=this.services;n.logger=Xe,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new ct(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=s(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new ht(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new mt(s(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(n.languageDetector=s(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=s(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new rt(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=yt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const i=_e(),r=()=>{const e=(e,n)=>{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),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),i}loadResources(e,t=yt){let n=t;const s=Oe(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&(e.includes(t)||e.push(t))}))};if(s)t(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,n){const s=_e();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=yt),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&tt.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,r)=>{r?this.isLanguageChangingTo===e&&(s(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(i,((...e)=>this.t(...e)))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Oe(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Oe(t)?[t]:t);r&&(this.language||s(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,(e=>{i(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const s=(e,t,...i)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},r.lng=r.lng||s.lng,r.lngs=r.lngs||s.lngs,r.ns=r.ns||s.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||s.keyPrefix);const o={...this.options,...r};"function"==typeof r.keyPrefix&&(r.keyPrefix=st(r.keyPrefix,o));const a=this.options.keySeparator||".";let l;return r.keyPrefix&&Array.isArray(e)?l=e.map((e=>("function"==typeof e&&(e=st(e,o)),`${r.keyPrefix}${a}${e}`))):("function"==typeof e&&(e=st(e,o)),l=r.keyPrefix?`${r.keyPrefix}${a}${e}`:e),this.t(l,r)};return Oe(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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 n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const r=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,r);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(n,e)||s&&!r(i,e)))}loadNamespaces(e,t){const n=_e();return this.options.ns?(Oe(e)&&(e=[e]),e.forEach((e=>{this.options.ns.includes(e)||this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=_e();Oe(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>!s.includes(e)&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new ot(bt());return e.toLowerCase().indexOf("-latn")>1?"ltr":["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"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new wt(e,t);return n.createInstance=wt.createInstance,n}cloneInstance(e={},t=yt){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new wt(s);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),e[t]),e)),{});i.store=new et(e,s),i.services.resourceStore=i.store}if(e.interpolation){const t={...bt().interpolation,...this.options.interpolation,...e.interpolation},n={...s,interpolation:t};i.services.interpolator=new ht(n)}return i.translator=new rt(i.services,s),i.translator.on("*",((e,...t)=>{i.emit(e,...t)})),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const kt=wt.createInstance(),At=(kt.createInstance,kt.dir,kt.init,kt.loadResources,kt.reloadResources,kt.use,kt.changeLanguage,kt.getFixedT,kt.t);kt.exists,kt.setDefaultNamespace,kt.hasLoadedNamespace,kt.loadNamespaces,kt.loadLanguages;let vt;const St=class{author;constructor(e="Support"){this.author=e}newMessageNotify(e){const t=document.createElement("div");t.style.fontFamily='"Helvetica Neue",Arial,Helvetica,sans-serif',t.style.position="absolute",t.style.display="flex",t.style.width="300px",t.style.height="6rem",t.style.overflow="hidden",t.style.backgroundColor="white",t.style.boxShadow="0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",t.style.maxWidth="24rem",t.style.borderRadius="0.75rem",t.style.bottom="19px",t.style.right="0";const n=document.createElement("div");n.style.marginLeft="0.625rem",n.style.marginRight="0.625rem",n.style.overflow="hidden",n.style.width="100%",n.style.cursor="pointer",n.addEventListener("click",(()=>{ln(),vt&&vt.removeChild(t)}));const s=document.createElement("p");s.textContent=At("support"),s.style.marginTop="0.375rem",s.style.fontSize="1rem",s.style.fontWeight="bold",s.style.color="peru",s.style.lineHeight="2rem",s.style.marginRight="0.75rem",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.style.whiteSpace="nowrap",s.style.marginBottom="0";const i=document.createElement("p");i.innerHTML=e,i.style.overflow="hidden",i.style.lineHeight="1.25rem",i.style.wordBreak="break-word",i.style.color="#7f7f7f",i.style.maxHeight="2.5rem",i.style.fontSize="small",i.style.marginTop="0";const r=document.createElement("button");r.style.width="4rem",r.style.cursor="pointer",r.style.outline="none",r.style.border="none",r.style.background="none";const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke","rgba(31,41,55)"),o.setAttribute("fill","none"),o.style.width="1.75rem",o.style.height="1.75rem";const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","M6 18L18 6M6 6l12 12"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-linecap","round"),o.appendChild(a),r.appendChild(o),n.appendChild(s),n.appendChild(i),t.appendChild(n),t.appendChild(r);const l=document.querySelector("#lsw_chat_popup");vt&&l&&"none"==l.style.display&&(vt.appendChild(t),setTimeout((()=>{vt&&vt.removeChild(t)}),5e3)),r.addEventListener("click",(()=>{vt&&vt.removeChild(t)}))}};let Ct=!1,Lt=!1;function Et(){Lt||(Lt=!0,Ce((e=>{if("widget"===e.domain){if("operator_message"===e.type){const t=e.payload?.threadId,n=localStorage.getItem("aiwi_thread_id");if(t&&n&&t!==n)return;Ct=!0;const s=String(e.payload?.text??"");return Nt.newMessageNotify(s),void It(s)}if("operator_disconnected"!==e.type){if("admin_presence"===e.type){const t=Boolean(e.payload?.online);window.dispatchEvent(new CustomEvent("lsw-widget-admin-presence",{detail:{online:t}}))}}else Ct=!1}})))}let Rt=null;function Tt(e){if(null==e||"object"!=typeof e)return"";if(!("data"in e))return"";const t=e.data;return"string"==typeof t?t:null!=t?String(t):""}class $t{_lsAiWsStream=!0;closed=!1;removeGlobal=null;listeners=new Map;constructor(){Rt&&Rt.close(),Rt=this,this.removeGlobal=Ce((e=>{if(this.closed||Rt!==this)return;if("widget"!==e.domain)return;if("ai_stream_end"===e.type)return Rt===this&&(Rt=null),this.closed=!0,this.removeGlobal?.(),this.removeGlobal=null,void this.listeners.clear();if("ai_stream"!==e.type)return;const t=String(e.payload?.event??""),n=e.payload.data,s={data:null==n?"":"string"==typeof n?n:JSON.stringify(n)};for(const e of this.listeners.get(t)??[])try{e(s)}catch(e){console.error(e)}}))}addEventListener(e,t){if(!t||"function"!=typeof t)return;const n=this.listeners.get(e)??[];n.push(t),this.listeners.set(e,n)}close(){this.closed||(this.closed=!0,Rt===this&&(Rt=null),this.removeGlobal?.(),this.removeGlobal=null,this.listeners.clear())}}let Nt=new St;const Pt=new class{report(e){let t={};if("string"==typeof e.headers)try{t=JSON.parse(e.headers)}catch{t={}}else e.headers&&"object"==typeof e.headers&&(t=e.headers);Te("bug_report",{url:String(e.url??""),headers:t,body:Pe(e.body),error:void 0!==e.error&&null!==e.error?"string"==typeof e.error?e.error:JSON.stringify(e.error):""},"bug_report_ok",15e3).catch((()=>{}))}},Ot=document.createElement("div");function _t(e,t="",n){let s="";if("object"==typeof t){if(t.date){let e=new Date(t.date);s=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}t=t.text||""}const i=document.createElement("div");i.style.position="relative",i.style.marginBottom="2em",i.className="flex";const r=document.createElement("div");r.style.position="relative",r.style.paddingRight="3em",r.classList.add("py-2","px-4","max-w-[70%]"),n?(i.style.justifyContent="flex-end",r.classList.add("me-message")):r.classList.add("you-message"),r.innerHTML=function(e){return e.replace(/\+?\d[\d\-\(\) ]{9,}\d/g,(e=>`${e}`))}(t),i.appendChild(r),e.appendChild(i),e.scrollTop=e.scrollHeight;const o=document.createElement("div");return o.innerHTML=s,o.classList.add("clock"),r.appendChild(o),i}async function It(e,t){const n=Kt;if(n){if(Zt&&(Zt.value=""),"object"==typeof e&&null!==e&&function(e){return"object"==typeof e&&null!==e&&("undefined"!=typeof EventSource&&e instanceof EventSource||!0===e._lsAiWsStream)}(e)){let t,s;return e.addEventListener("textCreated",(()=>{t=_t(n)})),e.addEventListener("typing",(()=>{s=_t(n,Ot.outerHTML)})),e.addEventListener("textDelta",(e=>{const s=Tt(e),i=t.querySelector("div");i&&(i.innerHTML=be.parse(i.innerText+s).toString(),n.scrollTop=n.scrollHeight)})),void e.addEventListener("messageDone",(i=>{s?.parentNode&&s.parentNode.removeChild(s),e.close();const r=Tt(i);if(r)try{const e=JSON.parse(r);let s="";if(!e?.content?.length)return;if((s=e.content[0].text.value)||(s="Что-то пошло не так. Попробуйте позже пожалуйста."),/\[spam\]/.test(s))return void console.log("stop spam!");0,t?.querySelector("div")?t.querySelector("div").innerHTML=be.parse(s).toString():t=_t(n,{text:s,date:(new Date).valueOf()}),Nt.newMessageNotify(s),async function(e,t){let n=!1;const s="string"==typeof e?e:e.content,i=localStorage.getItem("aiwi_messages"),r=i?JSON.parse(i):[];r.length&&(n=!0),r.push({role:t?"user":"assistant",content:s,date:"string"==typeof e?(new Date).valueOf():e.date}),localStorage.setItem("aiwi_messages",JSON.stringify(r));const o=localStorage.getItem("aiwi_thread_id");n&&o&&await Te("chat_notify",{thread:o},"chat_notify_ok",2e4).catch((e=>console.error("error chat notify",e)))}(s)}catch(e){console.error("error processing message",e)}}))}("string"!=typeof e&&e?e:[{role:t?"user":"assistant",content:e,date:(new Date).valueOf()}]).forEach((t=>{let s="user"==t.role;if(t.content){if(!s&&/\[spam\]/.test(t.content))return void console.log("stop spam!");0,_t(n,{text:be.parse(t.content).toString(),date:t.date},s)}if(e){const n=localStorage.getItem("aiwi_messages"),i=n?JSON.parse(n):[];i.push({role:s?"user":"assistant",content:t.content,date:(new Date).valueOf()}),"string"==typeof e&&localStorage.setItem("aiwi_messages",JSON.stringify(i))}}))}else console.log("chatMessages div not found")}function jt(){Et();const e=localStorage.getItem("aiwi_thread_id");e&&Re("widget","thread_subscribe",{thread_id:e})}async function zt(){const e=localStorage.getItem("aiwi_thread_id"),t=localStorage.getItem("aiwi_messages");if(e)return t&&(Kt&&(Kt.innerHTML=""),It(JSON.parse(t))),t?null:e;const n="Здравствуйте! Чем могу помочь?",s={};let i;n&&(s.messages=[{role:"assistant",content:n}]),"undefined"!=typeof document&&document.referrer&&(s.referer=document.referrer),"undefined"!=typeof navigator&&(s.userAgent=navigator.userAgent);try{i=await $e("thread_create",s,"thread_create_ok",6e4)}catch(e){return void console.error("createThread:",e)}if(i?.id){const e=localStorage.getItem("aiwi_thread_id");return e&&e!==i.id&&Re("widget","thread_unsubscribe",{}),localStorage.setItem("aiwi_thread_id",i.id),jt(),i.id}}async function Dt(e,t){const n=new $t;try{const s=await $e("ai_user_message",{thread_id:e,content:t},"ai_message_ok",12e4);if("relay_only"===s.mode)return n.close(),"";if("stream"===s.mode)return n;n.close()}catch(e){throw n.close(),e}return""}Ot.classList.add("typing-indicator"),Ot.classList.add("flex"),Ot.classList.add("items-center"),Ot.classList.add("space-x-1"),Ot.innerHTML='\n \n ';class Bt{static sendEvent(e){const t="Ya"in window?window.Ya._metrika.getCounters().map((e=>e.id)):null;t?.length&&t.map((t=>{"ym"in window&&window.ym(t,"reachGoal",e)}))}static openChat(e="LSChat_Client_open_chat"){this.sendEvent(e)}static sendMessage(e="LSChat_Client_send_message"){this.sendEvent(e)}static sendLead(e="LSChat_Client_send_lead"){this.sendEvent(e)}static sendWhatsapp(e="LSChat_Client_click_whatsapp"){this.sendEvent(e)}static sendVk(e="LSChat_Client_click_vk"){this.sendEvent(e)}static sendPhone(e="LSChat_Client_click_phone"){this.sendEvent(e)}static sendTelegram(e="LSChat_Client_click_telegram"){this.sendEvent(e)}async sendPayload(e,t,n={}){const s=JSON.stringify(t),i={"Content-Type":"application/json"};n.projectKey&&n.projectKeyHeaderName&&(i[n.projectKeyHeaderName]=n.projectKey);try{if(n.useBeacon&&navigator.sendBeacon){const t=new Blob([s],{type:"application/json"});return navigator.sendBeacon(e,t),{ok:!0,beacon:!0}}const t=await fetch(e,{method:"POST",body:s,headers:i,keepalive:!!n.keepalive});return{ok:t.ok,status:t.status,text:await t.text().catch((()=>null))}}catch(e){return{ok:!1,error:e||String(e)}}}}Reflect.defineProperty((function(e,t=!1){const n=document.createElement("style");n.innerHTML=`\n .lswa-widget-button-popup-show {\n display: block;\n -webkit-animation: show .4s linear forwards;\n animation: show .4s linear forwards;\n }\n .lswa-widget-button-popup-btn-hide {\n position: absolute;\n top: 4px;\n right: 4px;\n display: inline-block;\n height: 20px;\n width: 20px;\n background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2210%22%20height%3D%2210%22%20viewBox%3D%220%200%2010%2010%22%3E%3Cpath%20fill%3D%22%23525C68%22%20fill-rule%3D%22evenodd%22%20d%3D%22M6.41%205.07l2.867-2.864-1.34-1.34L5.07%203.73%202.207.867l-1.34%201.34L3.73%205.07.867%207.938l1.34%201.34L5.07%206.41l2.867%202.867%201.34-1.34L6.41%205.07z%22/%3E%3C/svg%3E');\n background-repeat: no-repeat;\n background-position: center;\n opacity: .2;\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n cursor: pointer;\n }\n .lswa-widget-button-popup-inner {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-flow: row;\n flex-flow: row;\n }\n .lswa-widget-button-popup-image {\n margin: 0 10px 0 0;\n width: 42px;\n text-align: center;\n }\n .lswa-widget-button-popup-image-item {\n display: inline-block;\n width: 42px;\n height: 42px;\n border-radius: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n background-image: url(${Ht});\n }\n .lswa-widget-button-popup-name {\n font: bold 14px "Helvetica Neue",Arial,Helvetica,sans-serif;\n color: #000;\n }\n .lswa-widget-button-popup-description {\n margin: 4px 0 0 0;\n font: 13px "Helvetica Neue",Arial,Helvetica,sans-serif;\n color: #424956;\n }\n .lswa-widget-button-popup-triangle {\n position: absolute;\n display: block;\n width: 8px;\n height: 8px;\n background: #fff;\n border-right: 1px solid #aaaaaa82;\n border-bottom: 1px solid #aaaaaa82;\n bottom: 20px;\n }\n .lswa-widget-button-popup {\n padding: 12px 20px 12px 14px;\n max-width: 312px;\n border: 1px solid #aaaaaa82;\n background: #fff;\n border-radius: 15px;\n box-sizing: border-box;\n z-index: 1;\n cursor: pointer;\n }\n `,e.append(n),Mt.style.display="none",Mt.style.position="relative",Mt.classList.add("lswa-widget-button-popup","lswa-widget-button-popup-show");const s=document.createElement("span");s.classList.add("lswa-widget-button-popup-btn-hide"),s.addEventListener("click",(()=>{Mt.style.display="none"})),Mt.innerHTML=`\n