(()=>{"use strict";var __webpack_modules__={608(e,t,n){n.d(t,{A:()=>i});class i{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 i=JSON.stringify(t),s={"Content-Type":"application/json"};n.projectKey&&n.projectKeyHeaderName&&(s[n.projectKeyHeaderName]=n.projectKey);try{if(n.useBeacon&&navigator.sendBeacon){const t=new Blob([i],{type:"application/json"});return navigator.sendBeacon(e,t),{ok:!0,beacon:!0}}const t=await fetch(e,{method:"POST",body:i,headers:s,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)}}}}},742(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__}),Reflect.defineProperty(__WEBPACK_DEFAULT_EXPORT__,"name",{value:"default",configurable:!0});var _api_metric_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(608);const iconSize="2.1em";function __WEBPACK_DEFAULT_EXPORT__(cfg){const capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),telegramIcon=``,whatsappIcon=`\n \n `,vkIcon=`\n \n `,maxIcon=` `,phoneIcon=`\n \n `,instagramIcon='\n \n ',twitterIcon='\n \n ',linkIcon='\n \n \n ',linkedInIcon='\n \n ',otherMessengerIcon='\n \n ',skypeIcon='\n \n ',steamIcon='\n \n \n ',weChatIcon='\n \n \n ';class ButtonConstructor{config;div=null;constructor(e){this.config=e,this.div=this.btnDiv(e.type,e.link)}get element(){return this.div}btnDiv(type,link=""){if(!link)return null;const div=document.createElement("li");Object.assign(div.style,{borderRadius:"9999px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",width:"3.6em",height:"3.6em",position:"absolute",margin:"0.2em",padding:"0",transition:"transform 0.5s ease"}),div.style.boxShadow="0 10px 10px rgba(0, 0, 0, 0.1)";const a=document.createElement("a");a.href=link,a.target="blank",a.style.display="flex";const tooltip=document.createElement("span");div.addEventListener("mouseenter",(()=>{Object.assign(tooltip.style,{top:"-45px",opacity:"1",visibility:"visible"})})),div.addEventListener("click",(()=>{if(this.config.event&&eval(this.config.event),this.config.yaEvent)_api_metric_service__WEBPACK_IMPORTED_MODULE_0__.A.sendEvent(this.config.yaEvent);else switch(type){case"vk":_api_metric_service__WEBPACK_IMPORTED_MODULE_0__.A.sendVk();break;case"phone":_api_metric_service__WEBPACK_IMPORTED_MODULE_0__.A.sendPhone();break;case"whatsapp":_api_metric_service__WEBPACK_IMPORTED_MODULE_0__.A.sendWhatsapp();break;case"telegram":_api_metric_service__WEBPACK_IMPORTED_MODULE_0__.A.sendTelegram()}})),div.addEventListener("mouseleave",(()=>{Object.assign(tooltip.style,{top:"0",opacity:"0",visibility:"hidden"})}));const triangle=document.createElement("div");triangle.style.position="absolute",triangle.style.height="8px",triangle.style.width="8px",triangle.style.bottom="-3px",triangle.style.left="50%",triangle.style.transform="translate(-50%) rotate(45deg)",triangle.style.transition="all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55)",triangle.style.boxShadow="0 0 2px rgba(0,0,0,0.1)",Object.assign(tooltip.style,{boxShadow:"0 10px 10px rgba(0, 0, 0, 0.1)",pointerEvents:"none",transition:"all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55)",opacity:"0",borderRadius:"5px",padding:"5px 8px",fontSize:"14px",position:"absolute",top:"0",color:"#fff"}),div.appendChild(tooltip);let icon="";if("telegram"===type)a.ariaLabel="Telegram",a.dataset.social="telegram",icon=telegramIcon,div.style.backgroundColor="#27a6e6",tooltip.innerText="Telegram",tooltip.style.backgroundColor="#27a6e6",triangle.style.background="#27a6e6";else if("whatsapp"==type)a.ariaLabel="Whatsapp",a.dataset.social="whatsapp",icon=whatsappIcon,div.style.backgroundColor="#25d366",tooltip.innerText="Whatsapp",tooltip.style.backgroundColor="#25d366",triangle.style.background="#25d366";else if("phone"==type)a.ariaLabel="Phone",a.dataset.social="phone",icon=phoneIcon,div.style.backgroundColor="#e51a22",tooltip.innerText="Phone",tooltip.style.backgroundColor="#e51a22",triangle.style.background="#e51a22";else if("vk"==type)a.ariaLabel="VK",a.dataset.social="vk",icon=vkIcon,div.style.backgroundColor="#0077ff",tooltip.innerText="VK",tooltip.style.backgroundColor="#0077ff",triangle.style.background="#0077ff";else{if("max"!=type)return null;a.ariaLabel="MAX",a.dataset.social="max",icon=maxIcon,div.style.backgroundColor="#9631cb",tooltip.innerText="Max",tooltip.style.backgroundColor="#9631cb",triangle.style.background="#9631cb"}return tooltip.appendChild(triangle),a.innerHTML=a.innerHTML+icon,div.appendChild(a),div}}return cfg.map((e=>new ButtonConstructor(e)))}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};function z(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=z();function G(e){T=e}var _={exec:()=>null};function k(e,t=""){let n="string"==typeof e?e:e.source,i={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(m.caret,"$1"),n=n.replace(e,s),i},getRegex:()=>new RegExp(n,t)};return i}var Re=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Te=/^(?:[ \t]*(?:\n|$))+/,Oe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,we=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ye=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Q=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=k(ie).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Pe=k(ie).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Se=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$e=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Le=k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Q).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/|$))/,_e=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",U).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=k(j).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Me=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),K={blockquote:Me,code:Oe,def:$e,fences:we,heading:ye,hr:C,html:_e,lheading:oe,list:Le,newline:Te,paragraph:ae,table:_,text:Se},re=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),ze={...K,lheading:Pe,table:re,paragraph:k(j).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},Ee={...K,html:k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(j).replace("hr",C).replace("heading"," *#{1,6} *[^\n]").replace("lheading",oe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ie=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ae=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,le=/^( {2,}|\\)\n(?!\s*$)/,Ce=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Re?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,He=k(pe,"u").replace(/punct/g,E).getRegex(),Ze=k(pe,"u").replace(/punct/g,ue).getRegex(),ce="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ge=k(ce,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,E).getRegex(),Ne=k(ce,"gu").replace(/notPunctSpace/g,qe).replace(/punctSpace/g,De).replace(/punct/g,ue).getRegex(),Qe=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,E).getRegex(),je=k(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,E).getRegex(),Fe="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ue=k(Fe,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,H).replace(/punct/g,E).getRegex(),Ke=k(/\\(punct)/,"gu").replace(/punct/g,E).getRegex(),We=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xe=k(U).replace("(?:--\x3e|$)","--\x3e").getRegex(),Je=k("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Xe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ve=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),he=k(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",F).getRegex(),ke=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),Ye=k("reflink|nolink(?!\\()","g").replace("reflink",he).replace("nolink",ke).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:_,anyPunctuation:Ke,autolink:We,blockSkip:ve,br:le,code:Ae,del:_,delLDelim:_,delRDelim:_,emStrongLDelim:He,emStrongRDelimAst:Ge,emStrongRDelimUnd:Qe,escape:Ie,link:Ve,nolink:ke,punctuation:Be,reflink:he,reflinkSearch:Ye,tag:Je,text:Ce,url:_},et={...X,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...X,emStrongRDelimAst:Ne,emStrongLDelim:Ze,delLDelim:je,delRDelim:Ue,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},de=e=>nt[e];function O(e,t){if(t){if(m.escapeTest.test(e))return e.replace(m.escapeReplace,de)}else if(m.escapeTestNoEncode.test(e))return e.replace(m.escapeReplaceNoEncode,de);return e}function J(e){try{e=encodeURI(e).replace(m.percentDecode,"%")}catch{return null}return e}function V(e,t){let n=e.replace(m.findPipe,((e,t,n)=>{let i=!1,s=t;for(;--s>=0&&"\\"===n[s];)i=!i;return i?"|":" |"})).split(m.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length=0&&!t[n].trim();)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function ge(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let i=0;i0?-2:-1}function fe(e,t=0){let n=t,i="";for(let t of e)if("\t"===t){let e=4-n%4;i+=" ".repeat(e),n+=e}else i+=t,n++;return i}function me(e,t,n,i,s){let o=t.href,r=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:o,title:r,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function rt(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(null===i)return t;let s=i[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[i]=t;return i.length>=s.length?e.slice(s.length):e})).join("\n")}var w=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Y(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=rt(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=$(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:$(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:$(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=$(t[0],"\n").split("\n"),n="",i="",s=[];for(;e.length>0;){let t,o=!1,r=[];for(t=0;t1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let o=this.rules.other.listItemRegex(n),r=!1;for(;e;){let n=!1,i="",a="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let l=fe(t[2].split("\n",1)[0],t[1].length),c=e.split("\n",1)[0],p=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):p?d=t[1].length+1:(d=l.search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),p&&this.rules.other.blankLine.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),s=this.rules.other.fencesBeginRegex(d),o=this.rules.other.headingBeginRegex(d),r=this.rules.other.htmlBeginRegex(d),h=this.rules.other.blockquoteBeginRegex(d);for(;e;){let u,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),s.test(c)||o.test(c)||r.test(c)||h.test(c)||t.test(c)||n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+u.slice(d);else{if(p||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||s.test(l)||o.test(l)||n.test(l))break;a+="\n"+c}p=!c.trim(),i+=g+"\n",e=e.substring(g.length+1),l=u.slice(d)}}s.loose||(r?s.loose=!0:this.rules.other.doubleBlankLine.test(i)&&(r=!0)),s.items.push({type:"list_item",raw:i,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]}),s.raw+=i}let a=s.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e of s.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),"text"===e.tokens[0]?.type||"paragraph"===e.tokens[0]?.type){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,s.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!s.loose){let t=e.tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));s.loose=n}}if(s.loose)for(let e of s.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Y(t[0]);return{type:"html",block:!0,raw:e,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:$(t[0],"\n"),href:n,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:$(t[0],"\n"),header:[],align:[],rows:[]};if(n.length===i.length){for(let e of i)this.rules.other.tableAlignRight.test(e)?o.align.push("right"):this.rules.other.tableAlignCenter.test(e)?o.align.push("center"):this.rules.other.tableAlignLeft.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]}))));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:$(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=$(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=ge(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],i=e[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),me(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return me(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(i&&(i[1]||i[2]||i[3]||i[4])&&(!i[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[3]||!n||this.rules.inline.punctuation.exec(n))){let n,s,o=[...i[0]].length-1,r=o,a=0,l="*"===i[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+o);null!==(i=l.exec(t));){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(s=[...n].length,i[3]||i[4]){r+=s;continue}if((i[5]||i[6])&&o%3&&!((o+s)%3)){a+=s;continue}if(r-=s,r>0)continue;s=Math.min(s,s+r+a);let t=[...i[0]][0].length,l=e.slice(0,o+i.index+t+s);if(Math.min(o,s)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let n,s,o=[...i[0]].length-1,r=o,a=this.rules.inline.delRDelim;for(a.lastIndex=0,t=t.slice(-1*e.length+o);null!==(i=a.exec(t));){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n||(s=[...n].length,s!==o))continue;if(i[3]||i[4]){r+=s;continue}if(r-=s,r>0)continue;s=Math.min(s,s+r);let t=[...i[0]][0].length,a=e.slice(0,o+i.index+t+s),l=a.slice(o,-o);return{type:"del",raw:a,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let i;do{i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(i!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},x=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new w,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:B.normal,inline:I.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:I}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(m.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0))))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);1===i.raw.length&&void 0!==n?n.raw+="\n":t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,i=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},i),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let o=t.at(-1);n&&"paragraph"===o?.type?(o.raw+=(o.raw.endsWith("\n")?"":"\n")+i.raw,o.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i),n=s.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n,i=e,s=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(s=this.tokenizer.rules.inline.reflinkSearch.exec(i));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(s=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(s=this.tokenizer.rules.inline.blockSkip.exec(i));)n=s[2]?s[2].length:0,i=i.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,r="";for(;e;){let n;if(o||(r=""),o=!1,this.options.extensions?.inline?.some((i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let i=t.at(-1);"text"===n.type&&"text"===i?.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,i,r)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e,i,r)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let s=e;if(this.options.extensions?.startInline){let t,n=1/0,i=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},i),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(s)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(r=n.raw.slice(-1)),o=!0;let i=t.at(-1);"text"===i?.type?(i.raw+=n.raw,i.text+=n.text):t.push(n)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},y=class{options;parser;constructor(e){this.options=e||T}space(e){return""}code({text:e,lang:t,escaped:n}){let i=(t||"").match(m.notSpaceStart)?.[0],s=e.replace(m.endingNewline,"")+"\n";return i?'
'+(n?s:O(s,!0))+"
\n":"
"+(n?s:O(s,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){let t=e.ordered,n=e.start,i="";for(let t=0;t\n"+i+"\n"}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • \n`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${i}`),"\n\n"+t+"\n"+i+"
    \n"}tablerow({text:e}){return`\n${e}\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`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${O(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),s=J(e);if(null===s)return i;let o='
    ",o}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=J(e);if(null===s)return O(n);let o=`${O(n)}{let s=e[i].flat(1/0);n=n.concat(this.walkTokens(s,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 i=e.renderer.apply(this,t);return!1===i&&(i=n.apply(this,t)),i}: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 y(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 i=n,s=e.renderer[i],o=t[i];t[i]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new w(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 i=n,s=e.tokenizer[i],o=t[i];t[i]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new P;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 i=n,s=e.hooks[i],o=t[i];P.passThroughHooks.has(n)?t[i]=e=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await s.call(t,e);return o.call(t,n)})();let i=s.call(t,e);return o.call(t,i)}:t[i]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await s.apply(t,e);return!1===n&&(n=await o.apply(t,e)),n})();let n=s.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,i=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(i.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 x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return o(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 o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(t):t,i=await(s.hooks?await s.hooks.provideLexer(e):e?x.lex:x.lexInline)(n,s),o=s.hooks?await s.hooks.processAllTokens(i):i;s.walkTokens&&await Promise.all(this.walkTokens(o,s.walkTokens));let r=await(s.hooks?await s.hooks.provideParser(e):e?b.parse:b.parseInline)(o,s);return s.hooks?await s.hooks.postprocess(r):r})().catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let n=(s.hooks?s.hooks.provideLexer(e):e?x.lex:x.lexInline)(t,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let i=(s.hooks?s.hooks.provideParser(e):e?b.parse:b.parseInline)(n,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return o(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="

    An error occurred:

    "+O(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},M=new D;function g(e,t){return M.parse(e,t)}g.options=g.setOptions=function(e){return M.setOptions(e),g.defaults=M.defaults,G(g.defaults),g},g.getDefaults=z,g.defaults=T,g.use=function(...e){return M.use(...e),g.defaults=M.defaults,G(g.defaults),g},g.walkTokens=function(e,t){return M.walkTokens(e,t)},g.parseInline=M.parseInline,g.Parser=b,g.parser=b.parse,g.Renderer=y,g.TextRenderer=L,g.Lexer=x,g.lexer=x.lex,g.Tokenizer=w,g.Hooks=P,g.parse=g;var jt=g.options,Ft=g.setOptions,Ut=g.use,Kt=g.walkTokens,Wt=g.parseInline,Xt=null,Jt=b.parse,Vt=x.lex;const API_URL="https://api.ls-ai.ru",WIDGET_WS_PATH="/ws/widget",WIDGET_API_KEY="sk-dcf035645ae2ba0972e26cc543c39ba4614e89fd0e113e998c78754f9218fb72";function httpOriginToWsBase(){return API_URL.replace(/^http:/i,"ws:").replace(/^https:/i,"wss:").replace(/\/$/,"")}let ws=null,reconnectTimer=null,reconnectDelayMs=3e3;const pendingOutgoing=[],messageListeners=new Set,openListeners=new Set;function subscribeWidgetWs(e){return messageListeners.add(e),()=>messageListeners.delete(e)}function onWidgetSocketOpen(e){return openListeners.add(e),()=>openListeners.delete(e)}function dispatch(e){for(const t of messageListeners)try{t(e)}catch(e){console.error("WidgetWs listener error",e)}}function flushPending(){if(ws&&ws.readyState===WebSocket.OPEN)for(;pendingOutgoing.length;){const e=pendingOutgoing.shift();if(e)try{ws.send(e)}catch{pendingOutgoing.unshift(e);break}}}function notifyOpen(){for(const e of openListeners)try{e()}catch(e){console.error("WidgetWs onOpen handler error",e)}}function clearReconnectTimer(){reconnectTimer&&(clearTimeout(reconnectTimer),reconnectTimer=null)}function scheduleReconnect(e){clearReconnectTimer(),reconnectTimer=setTimeout((()=>{reconnectTimer=null,connectInternal()}),e)}function connectInternal(){if(ws&&(ws.readyState===WebSocket.CONNECTING||ws.readyState===WebSocket.OPEN))return;const e=`${httpOriginToWsBase()}${WIDGET_WS_PATH}?api_key=${encodeURIComponent(WIDGET_API_KEY)}`;try{ws=new WebSocket(e)}catch(e){return console.error("WidgetWebSocket: failed to create",e),void scheduleReconnect(reconnectDelayMs)}ws.onopen=()=>{reconnectDelayMs=3e3,flushPending(),notifyOpen()},ws.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}"system"!==t.domain||"ping"!==t.type?dispatch(t):sendWidgetEnvelope("system","pong",{})},ws.onerror=()=>{},ws.onclose=e=>{ws=null,4001===e.code?(reconnectDelayMs=Math.min(2*reconnectDelayMs,12e4),scheduleReconnect(Math.max(reconnectDelayMs,6e4))):scheduleReconnect(reconnectDelayMs)}}function initWidgetWebSocket(){connectInternal()}function sendWidgetEnvelope(e,t,n){const i=JSON.stringify({v:1,domain:e,type:t,payload:n??{},ts:(new Date).toISOString()});if(ws?.readyState===WebSocket.OPEN)try{ws.send(i)}catch{pendingOutgoing.push(i)}else pendingOutgoing.push(i)}function widgetWsRpc(e,t,n,i=25e3){const s=()=>new Promise(((s,o)=>{let r=!1,a=null;const l=setTimeout((()=>{r||(r=!0,a?.(),o(new Error("Widget WS timeout")))}),i);a=subscribeWidgetWs((e=>{if("widget"===e.domain){if(e.type===n){if(r)return;return r=!0,clearTimeout(l),a?.(),void s()}if("error"===e.type){if(r)return;r=!0,clearTimeout(l),a?.(),o(new Error(String(e.payload?.message??"error")))}}})),sendWidgetEnvelope("widget",e,t)})),o=rpcTail.then((()=>s()),(()=>s()));return rpcTail=o.catch((()=>{})),o}function widgetWsRpcResult(e,t,n,i=25e3){const s=()=>new Promise(((s,o)=>{let r=!1,a=null;const l=setTimeout((()=>{r||(r=!0,a?.(),o(new Error("Widget WS timeout")))}),i);a=subscribeWidgetWs((e=>{if("widget"===e.domain){if(e.type===n){if(r)return;return r=!0,clearTimeout(l),a?.(),void s(e.payload??{})}if("error"===e.type){if(r)return;r=!0,clearTimeout(l),a?.(),o(new Error(String(e.payload?.message??"error")))}}})),sendWidgetEnvelope("widget",e,t)})),o=rpcTail.then((()=>s()),(()=>s()));return rpcTail=o.catch((()=>{})),o}let rpcTail=Promise.resolve();function getWidgetSocketReadyState(){return ws?.readyState??null}function normalizeBugBody(e){const t={};if(null==e)return t;if("string"==typeof e)return t.payload=e,t;for(const[n,i]of Object.entries(e))t[n]="string"==typeof i?i:JSON.stringify(i);return t}class BugReport{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);widgetWsRpc("bug_report",{url:String(e.url??""),headers:t,body:normalizeBugBody(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((()=>{}))}}const isString=e=>"string"==typeof e,defer=()=>{let e,t;const n=new Promise(((n,i)=>{e=n,t=i}));return n.resolve=e,n.reject=t,n},makeString=e=>null==e?"":String(e),copy=(e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))},lastOfPathSeparatorRegExp=/###/g,cleanKey=e=>e&&e.includes("###")?e.replace(lastOfPathSeparatorRegExp,"."):e,canNotTraverseDeeper=e=>!e||isString(e),getLastOfPath=(e,t,n)=>{const i=isString(t)?t.split("."):t;let s=0;for(;s{const{obj:i,k:s}=getLastOfPath(e,t,Object);if(void 0!==i||1===t.length)return void(i[s]=n);let o=t[t.length-1],r=t.slice(0,t.length-1),a=getLastOfPath(e,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=getLastOfPath(e,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},pushPath=(e,t,n,i)=>{const{obj:s,k:o}=getLastOfPath(e,t,Object);s[o]=s[o]||[],s[o].push(n)},getPath=(e,t)=>{const{obj:n,k:i}=getLastOfPath(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},getPathWithDefaults=(e,t,n)=>{const i=getPath(e,n);return void 0!==i?i:getPath(t,n)},deepExtend=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?isString(e[i])||e[i]instanceof String||isString(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):deepExtend(e[i],t[i],n):e[i]=t[i]);return e},regexEscape=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),_entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i18next_escape=e=>isString(e)?e.replace(/[&<>"'\/]/g,(e=>_entityMap[e])):e;class RegExpCache{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}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20),looksLikeObjectPath=(e,t,n)=>{t=t||"",n=n||"";const i=chars.filter((e=>!t.includes(e)&&!n.includes(e)));if(0===i.length)return!0;const s=looksLikeObjectPathRegExpCache.getRegExp(`(${i.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!s.test(e);if(!o){const t=e.indexOf(n);t>0&&!s.test(e.substring(0,t))&&(o=!0)}return o},deepFind=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const i=t.split(n);let s=e;for(let e=0;ee?.replace(/_/g,"-"),consoleLogger={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 Logger{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||consoleLogger,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,i){return i&&!this.debug?null:(isString(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Logger(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Logger(this.logger,e)}}var baseLogger=new Logger;class EventEmitter{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=(...i)=>{t(...i),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 i=0;i{for(let s=0;s-1&&this.options.ns.splice(t,1)}getResource(e,t,n,i={}){const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;e.includes(".")?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):isString(n)&&s?r.push(...n.split(s)):r.push(n)));const a=getPath(this.data,r);return a||t||n||!e.includes(".")||(e=r[0],t=r[1],n=r.slice(2).join(".")),!a&&o&&isString(n)?deepFind(this.data?.[e]?.[t],n,s):a}addResource(e,t,n,i,s={silent:!1}){const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let r=[e,t];n&&(r=r.concat(o?n.split(o):n)),e.includes(".")&&(r=e.split("."),i=t,t=r[1]),this.addNamespaces(t),setPath(this.data,r,i),s.silent||this.emit("added",e,t,n,i)}addResources(e,t,n,i={silent:!1}){for(const i in n)(isString(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,i,s,o={silent:!1,skipCopy:!1}){let r=[e,t];e.includes(".")&&(r=e.split("."),i=n,n=t,t=r[1]),this.addNamespaces(t);let a=getPath(this.data,r)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?deepExtend(a,n,s):a={...a,...n},setPath(this.data,r,a),o.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 postProcessor={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,s){return e.forEach((e=>{t=this.processors[e]?.process(t,n,i,s)??t})),t}};const PATH_KEY=Symbol("i18next/PATH_KEY");function createProxy(){const e=[],t=Object.create(null);let n;return t.get=(i,s)=>(n?.revoke?.(),s===PATH_KEY?e:(e.push(s),n=Proxy.revocable(i,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function keysFromSelector(e,t){const{[PATH_KEY]:n}=e(createProxy()),i=t?.keySeparator??".",s=t?.nsSeparator??":";if(n.length>1&&s){const e=t?.ns,o=Array.isArray(e)?e:null;if(o&&o.length>1&&o.slice(1).includes(n[0]))return`${n[0]}${s}${n.slice(1).join(i)}`}return n.join(i)}const shouldHandleAsObject=e=>!isString(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Translator extends EventEmitter{constructor(e,t={}){super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const i=this.resolve(e,n);if(void 0===i?.res)return!1;const s=shouldHandleAsObject(i.res);return!1!==n.returnObjects||!s}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let s=t.ns||this.options.defaultNS||[];const o=n&&e.includes(n),r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||looksLikeObjectPath(e,n,i));if(o&&!r){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:isString(s)?[s]:s};const o=e.split(n);(n!==i||n===i&&this.options.ns.includes(o[0]))&&(s=o.shift()),e=o.join(i)}return{key:e,namespaces:isString(s)?[s]:s}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=keysFromSelector(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map((e=>"function"==typeof e?keysFromSelector(e,{...this.options,...i}):String(e)));const s=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(e[e.length-1],i),l=a[a.length-1];let c=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=i.lng||this.language,d=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return d?s?{res:`${l}${c}${r}`,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${c}${r}`:s?{res:r,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:r;const h=this.resolve(e,i);let u=h?.res;const g=h?.usedKey||r,m=h?.exactUsedKey||r,f=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==i.count&&!isString(i.count),y=Translator.hasDefaultValue(i),w=x?this.pluralResolver.getSuffix(p,i.count,i):"",k=i.ordinal&&x?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",v=x&&!i.ordinal&&0===i.count,A=v&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${w}`]||i[`defaultValue${k}`]||i.defaultValue;let S=u;b&&!u&&y&&(S=A);const C=shouldHandleAsObject(S),L=Object.prototype.toString.apply(S);if(!(b&&S&&C)||["[object Number]","[object Function]","[object RegExp]"].includes(L)||isString(f)&&Array.isArray(S))if(b&&isString(f)&&Array.isArray(u))u=u.join(f),u&&(u=this.extendTranslation(u,e,i,n));else{let t=!1,s=!1;!this.isValidLookup(u)&&y&&(t=!0,u=A),this.isValidLookup(u)||(s=!0,u=r);const a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:u,d=y&&A!==u&&this.options.updateMissing;if(s||t||d){if(this.logger.log(d?"updateKey":"missingKey",p,l,r,d?A:u),o){const e=this.resolve(r,{...i,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,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n{const s=y&&n!==u?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,s,d,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,s,d,i),this.emit("missingKey",e,l,t,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,i);v&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],r+t,i[`defaultValue${t}`]||A)}))})):n(e,r,A))}u=this.extendTranslation(u,e,i,h,n),s&&u===r&&this.options.appendNamespaceToMissingKey&&(u=`${l}${c}${r}`),(s||t)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${r}`:r,t?u:void 0,i))}else{if(!i.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,{...i,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return s?(h.res=e,h.usedParams=this.getUsedParamsDetails(i),h):e}if(o){const e=Array.isArray(S),t=e?[]:{},n=e?m:g;for(const e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const s=`${n}${o}${e}`;t[e]=y&&!u?this.translate(s,{...i,defaultValue:shouldHandleAsObject(A)?A[e]:void 0,joinArrays:!1,ns:a}):this.translate(s,{...i,joinArrays:!1,ns:a}),t[e]===s&&(t[e]=S[e])}u=t}}return s?(h.res=u,h.usedParams=this.getUsedParamsDetails(i),h):u}extendTranslation(e,t,n,i,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=isString(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(o){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let a=n.replace&&!isString(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||i.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>s?.[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 o=n.postProcess||this.options.postProcess,r=isString(o)?[o]:o;return null!=e&&r?.length&&!1!==n.applyPostProcessor&&(e=postProcessor.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,s,o,r;return isString(e)&&(e=[e]),Array.isArray(e)&&(e=e.map((e=>"function"==typeof e?keysFromSelector(e,{...this.options,...t}):e))),e.forEach((e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;i=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==t.count&&!isString(t.count),d=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(isString(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)||(r=e,this.checkedLoadedFor[`${u[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(this.checkedLoadedFor[`${u[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${u.join(", ")}" won't get resolved as namespace "${r}" 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((i=>{if(this.isValidLookup(n))return;o=i;const r=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,l,i,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(i,t.count,t));const n=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&e.startsWith(s)&&r.push(l+e.replace(s,this.options.pluralSeparator)),r.push(l+e),d&&r.push(l+n)),h){const i=`${l}${this.options.contextSeparator||"_"}${t.context}`;r.push(i),p&&(t.ordinal&&e.startsWith(s)&&r.push(i+e.replace(s,this.options.pluralSeparator)),r.push(i+e),d&&r.push(i+n))}}let a;for(;a=r.pop();)this.isValidLookup(n)||(s=a,n=this.getResource(i,e,a,t))})))}))})),{res:n,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!isString(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}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 LanguageUtil{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(e){if(!(e=getCleanedCode(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=getCleanedCode(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(isString(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 i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find((e=>e===i||!(!e.includes("-")&&!i.includes("-"))&&(!(!e.includes("-")||i.includes("-")||e.slice(0,e.indexOf("-"))!==i)||!!(e.startsWith(i)&&i.length>1))))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),isString(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),i=[],s=e=>{e&&(this.isSupportedCode(e)?i.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return isString(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):isString(e)&&s(this.formatLanguageCode(e)),n.forEach((e=>{i.includes(e)||s(this.formatLanguageCode(e))})),i}}const suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5},dummyRule={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class PluralResolver{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=baseLogger.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=getCleanedCode("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(n,{type:i})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),dummyRule;if(!e.match(/-|_/))return dummyRule;const i=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(i,t)}return this.pluralRulesCache[s]=o,o}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)=>suffixesOrder[e]-suffixesOrder[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const deepFindWithDefaults=(e,t,n,i=".",s=!0)=>{let o=getPathWithDefaults(e,t,n);return!o&&s&&isString(n)&&(o=deepFind(e,n,i),void 0===o&&(o=deepFind(t,n,i))),o},regexSafe=e=>e.replace(/\$/g,"$$$$");class Interpolator{constructor(e={}){this.logger=baseLogger.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:i,prefix:s,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:p,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:u,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:f,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:i18next_escape,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==i&&i,this.prefix=s?regexEscape(s):o||"{{",this.suffix=r?regexEscape(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?regexEscape(d):h||regexEscape("$t("),this.nestingSuffix=u?regexEscape(u):g||regexEscape(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=f||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,i){let s,o,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const s=deepFindWithDefaults(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,{...i,...t,interpolationkey:e}):s}const s=e.split(this.formatSeparator),o=s.shift().trim(),r=s.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(t,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...i,...t,interpolationkey:o})};this.resetRegExp();const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>regexSafe(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?regexSafe(this.escape(e)):regexSafe(e)}].forEach((t=>{for(r=0;s=t.regex.exec(e);){const n=s[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,s,i);o=isString(t)?t:""}else if(i&&Object.prototype.hasOwnProperty.call(i,n))o="";else{if(p){o=s[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else isString(o)||this.useRawValueToEscape||(o=makeString(o));const a=t.safeValue(o);if(e=e.replace(s[0],a),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=s[0].length):t.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),e}nest(e,t,n={}){let i,s,o;const r=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const i=e.split(new RegExp(`${regexEscape(n)}[ ]*{`));let s=`{${i[1]}`;e=i[0],s=this.interpolate(s,o);const r=s.match(/'/g),a=s.match(/"/g);((r?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(s=s.replace(/'/g,'"'));try{o=JSON.parse(s),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${s}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,e};for(;i=this.nestingRegexp.exec(e);){let a=[];o={...n},o=o.replace&&!isString(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(-1!==l&&(a=i[1].slice(l).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),i[1]=i[1].slice(0,l)),s=t(r.call(this,i[1].trim(),o),o),s&&i[0]===e&&!isString(s))return s;isString(s)||(s=makeString(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),a.length&&(s=a.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:i[1].trim()})),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const parseFormatStr=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const s=i[1].slice(0,-1);if("currency"!==t||s.includes(":"))if("relativetime"!==t||s.includes(":")){s.split(";").forEach((e=>{if(e){const[t,...i]=e.split(":"),s=i.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=s),"false"===s&&(n[o]=!1),"true"===s&&(n[o]=!0),isNaN(s)||(n[o]=parseInt(s,10))}}))}else n.range||(n.range=s.trim());else n.currency||(n.currency=s.trim())}return{formatName:t,formatOptions:n}},createCachedFormatter=e=>{const t={};return(n,i,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const r=i+JSON.stringify(o);let a=t[r];return a||(a=e(getCleanedCode(i),s),t[r]=a),a(n)}},createNonCachedFormatter=e=>(t,n,i)=>e(getCleanedCode(n),i)(t);class Formatter{constructor(e={}){this.logger=baseLogger.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?createCachedFormatter:createNonCachedFormatter;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()]=createCachedFormatter(t)}format(e,t,n,i={}){if(!t)return e;if(null==e)return e;const s=t.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&!s[0].includes(")")&&s.find((e=>e.includes(")")))){const e=s.findIndex((e=>e.includes(")")));s[0]=[s[0],...s.splice(1,e)].join(this.formatSeparator)}return s.reduce(((e,t)=>{const{formatName:s,formatOptions:o}=parseFormatStr(t);if(this.formats[s]){let t=e;try{const r=i?.formatParams?.[i.interpolationkey]||{},a=r.locale||r.lng||i.locale||i.lng||n;t=this.formats[s](e,a,{...o,...i,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${s}`),e}),e)}}const removePending=(e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)};class Connector extends EventEmitter{constructor(e,t,n,i={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(e,t,n,i){const s={},o={},r={},a={};return e.forEach((e=>{let i=!0;t.forEach((t=>{const r=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,i=!1,void 0===o[r]&&(o[r]=!0),void 0===s[r]&&(s[r]=!0),void 0===a[t]&&(a[t]=!0)))})),i||(r[e]=!0)})),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const i=e.split("|"),s=i[0],o=i[1];t&&this.emit("failedLoading",s,o,t),!t&&n&&this.store.addResourceBundle(s,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const r={};this.queue.forEach((n=>{pushPath(n.loaded,[s],o),removePending(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{r[e]||(r[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===r[e][t]&&(r[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,i=0,s=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:s,callback:o});this.readingCalls++;const r=(r,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)}r&&a&&i{this.read(e,t,n,i+1,2*s,o)}),s):o(r,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const n=a(e,t);n&&"function"==typeof n.then?n.then((e=>r(null,e))).catch(r):r(null,n)}catch(e){r(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();isString(e)&&(e=this.languageUtils.toResolveHierarchy(e)),isString(t)&&(t=[t]);const s=this.queueLoad(e,t,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.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("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${s} for language ${i}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,i,s,o={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const a={...o,isUpdate:s},l=this.backend.create.bind(this.backend);if(l.length<6)try{let s;s=5===l.length?l(e,t,n,i,a):l(e,t,n,i),s&&"function"==typeof s.then?s.then((e=>r(null,e))).catch(r):r(null,s)}catch(e){r(e)}else l(e,t,n,i,r,a)}e&&e[0]&&this.store.addResource(e[0],t,n,i)}}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 get=()=>({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]),isString(e[1])&&(t.defaultValue=e[1]),isString(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}),transformOptions=e=>(isString(e.ns)&&(e.ns=[e.ns]),isString(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),isString(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),noop=()=>{},bindMemberFunctions=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))};class I18n extends EventEmitter{constructor(e={},t){if(super(),this.options=transformOptions(e),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),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&&(isString(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=get();this.options={...n,...this.options,...transformOptions(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 i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?baseLogger.init(i(this.modules.logger),this.options):baseLogger.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Formatter;const t=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const n=this.services;n.logger=baseLogger,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new PluralResolver(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=i(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Interpolator(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Connector(i(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(n.languageDetector=i(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=i(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Translator(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=noop),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 s=defer(),o=()=>{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),s.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?o():setTimeout(o,0),s}loadResources(e,t=noop){let n=t;const i=isString(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.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(i)t(i);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 i=defer();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=noop),this.services.backendConnector.reload(e,t,(e=>{i.resolve(),n(e)})),i}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&&postProcessor.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)},s=(s,o)=>{o?this.isLanguageChangingTo===e&&(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(s,((...e)=>this.t(...e)))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=isString(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(isString(t)?[t]:t);o&&(this.language||i(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,(e=>{s(e,o)}))};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(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const i=(e,t,...s)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const r={...this.options,...o};"function"==typeof o.keyPrefix&&(o.keyPrefix=keysFromSelector(o.keyPrefix,r));const a=this.options.keySeparator||".";let l;return o.keyPrefix&&Array.isArray(e)?l=e.map((e=>("function"==typeof e&&(e=keysFromSelector(e,r)),`${o.keyPrefix}${a}${e}`))):("function"==typeof e&&(e=keysFromSelector(e,r)),l=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(l,o)};return isString(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}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],i=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(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,o);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(s,e)))}loadNamespaces(e,t){const n=defer();return this.options.ns?(isString(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=defer();isString(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter((e=>!i.includes(e)&&this.services.languageUtils.isSupportedCode(e)));return s.length?(this.options.preload=i.concat(s),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 LanguageUtil(get());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 I18n(e,t);return n.createInstance=I18n.createInstance,n}cloneInstance(e={},t=noop){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new I18n(i);void 0===e.debug&&void 0===e.prefix||(s.logger=s.logger.clone(e));if(["store","services","language"].forEach((e=>{s[e]=this[e]})),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},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,i)=>(n[i]={...e[t][i]},n)),e[t]),e)),{});s.store=new ResourceStore(e,i),s.services.resourceStore=s.store}if(e.interpolation){const t={...get().interpolation,...this.options.interpolation,...e.interpolation},n={...i,interpolation:t};s.services.interpolator=new Interpolator(n)}return s.translator=new Translator(s.services,i),s.translator.on("*",((e,...t)=>{s.emit(e,...t)})),s.init(i,t),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance(),createInstance=instance.createInstance,dir=instance.dir,init=instance.init,loadResources=instance.loadResources,reloadResources=instance.reloadResources,use=instance.use,changeLanguage=instance.changeLanguage,getFixedT=instance.getFixedT,t=instance.t,exists=instance.exists,setDefaultNamespace=instance.setDefaultNamespace,hasLoadedNamespace=instance.hasLoadedNamespace,loadNamespaces=instance.loadNamespaces,loadLanguages=instance.loadLanguages;let notifyBox;const LSWMessageNotifier=class{author;constructor(e="Support"){this.author=e}newMessageNotify(e){const n=document.createElement("div");n.style.fontFamily='"Helvetica Neue",Arial,Helvetica,sans-serif',n.style.position="absolute",n.style.display="flex",n.style.width="300px",n.style.height="6rem",n.style.overflow="hidden",n.style.backgroundColor="white",n.style.boxShadow="0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",n.style.maxWidth="24rem",n.style.borderRadius="0.75rem",n.style.bottom="19px",n.style.right="0";const i=document.createElement("div");i.style.marginLeft="0.625rem",i.style.marginRight="0.625rem",i.style.overflow="hidden",i.style.width="100%",i.style.cursor="pointer",i.addEventListener("click",(()=>{togglePopup(),notifyBox&¬ifyBox.removeChild(n)}));const s=document.createElement("p");s.textContent=t("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 o=document.createElement("p");o.innerHTML=e,o.style.overflow="hidden",o.style.lineHeight="1.25rem",o.style.wordBreak="break-word",o.style.color="#7f7f7f",o.style.maxHeight="2.5rem",o.style.fontSize="small",o.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 a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("viewBox","0 0 24 24"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke","rgba(31,41,55)"),a.setAttribute("fill","none"),a.style.width="1.75rem",a.style.height="1.75rem";const l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("d","M6 18L18 6M6 6l12 12"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("stroke-linecap","round"),a.appendChild(l),r.appendChild(a),i.appendChild(s),i.appendChild(o),n.appendChild(i),n.appendChild(r);const c=document.querySelector("#lsw_chat_popup");notifyBox&&c&&"none"==c.style.display&&(notifyBox.appendChild(n),setTimeout((()=>{notifyBox&¬ifyBox.removeChild(n)}),5e3)),r.addEventListener("click",(()=>{notifyBox&¬ifyBox.removeChild(n)}))}};function createNotifyBox(){if(notifyBox)return notifyBox;const e="-20,63".split(",").map((e=>Number(e)));return e[1]+=73,notifyBox=document.createElement("div"),notifyBox.style.display="flex",notifyBox.style.flexDirection="column",notifyBox.style[e[0]>0?"left":"right"]=Math.abs(e[0])+"px",notifyBox.style[e[1]>0?"bottom":"top"]=Math.abs(e[1])+"px",notifyBox.style.position="fixed",notifyBox.style.zIndex="500",document.body.appendChild(notifyBox),notifyBox}const messageNotifier=LSWMessageNotifier,assistant_service_API_URL=null;let operatorOnline=!1,tunnelHandlersInstalled=!1;function installTunnelHandlers(){tunnelHandlersInstalled||(tunnelHandlersInstalled=!0,subscribeWidgetWs((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;operatorOnline=!0;const i=String(e.payload?.text??"");return assistant_service_messageNotifier.newMessageNotify(i),void addMessage(i)}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 operatorOnline=!1}})))}function bootstrapWidgetSocketIntegration(){installTunnelHandlers(),onWidgetSocketOpen((()=>{const e=localStorage.getItem("aiwi_thread_id");e&&sendWidgetEnvelope("widget","thread_subscribe",{thread_id:e})}))}let activeRunStream=null;function streamEventDataString(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 AssistantRunStream{_lsAiWsStream=!0;closed=!1;removeGlobal=null;listeners=new Map;constructor(){activeRunStream&&activeRunStream.close(),activeRunStream=this,this.removeGlobal=subscribeWidgetWs((e=>{if(this.closed||activeRunStream!==this)return;if("widget"!==e.domain)return;if("ai_stream_end"===e.type)return activeRunStream===this&&(activeRunStream=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,i={data:null==n?"":"string"==typeof n?n:JSON.stringify(n)};for(const e of this.listeners.get(t)??[])try{e(i)}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,activeRunStream===this&&(activeRunStream=null),this.removeGlobal?.(),this.removeGlobal=null,this.listeners.clear())}}function isRunStreamSource(e){return"object"==typeof e&&null!==e&&("undefined"!=typeof EventSource&&e instanceof EventSource||!0===e._lsAiWsStream)}let assistant_service_messageNotifier=new messageNotifier;const bugReport=new BugReport,typingIndicatorDiv=document.createElement("div");function replacePhoneNumbers(e){return e.replace(/\+?\d[\d\-\(\) ]{9,}\d/g,(e=>`
    ${e}`))}function addReplyElement(e,t="",n){let i="";if("object"==typeof t){if(t.date){let e=new Date(t.date);i=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}t=t.text||""}const s=document.createElement("div");s.style.position="relative",s.style.marginBottom="2em",s.className="flex";const o=document.createElement("div");o.style.position="relative",o.style.paddingRight="3em",o.classList.add("py-2","px-4","max-w-[70%]"),n?(s.style.justifyContent="flex-end",o.classList.add("me-message")):o.classList.add("you-message"),o.innerHTML=replacePhoneNumbers(t),s.appendChild(o),e.appendChild(s),e.scrollTop=e.scrollHeight;const r=document.createElement("div");return r.innerHTML=i,r.classList.add("clock"),o.appendChild(r),s}async function addMessageToStorage(e,t){let n=!1;const i="string"==typeof e?e:e.content,s=localStorage.getItem("aiwi_messages"),o=s?JSON.parse(s):[];o.length&&(n=!0),o.push({role:t?"user":"assistant",content:i,date:"string"==typeof e?(new Date).valueOf():e.date}),localStorage.setItem("aiwi_messages",JSON.stringify(o));const r=localStorage.getItem("aiwi_thread_id");return n&&r&&await widgetWsRpc("chat_notify",{thread:r},"chat_notify_ok",2e4).catch((e=>console.error("error chat notify",e))),n}async function addMessage(e,t){const n=messages;if(n){if(inputTextInChat&&(inputTextInChat.value=""),"object"==typeof e&&null!==e&&isRunStreamSource(e)){let t,i;return e.addEventListener("textCreated",(()=>{t=addReplyElement(n)})),e.addEventListener("typing",(()=>{i=addReplyElement(n,typingIndicatorDiv.outerHTML)})),e.addEventListener("textDelta",(e=>{const i=streamEventDataString(e),s=t.querySelector("div");s&&(s.innerHTML=g.parse(s.innerText+i).toString(),n.scrollTop=n.scrollHeight)})),void e.addEventListener("messageDone",(s=>{i?.parentNode&&i.parentNode.removeChild(i),e.close();const o=streamEventDataString(s);if(o)try{const e=JSON.parse(o);let i="";if(!e?.content?.length)return;if((i=e.content[0].text.value)||(i="Что-то пошло не так. Попробуйте позже пожалуйста."),/\[spam\]/.test(i))return void console.log("stop spam!");0,t?.querySelector("div")?t.querySelector("div").innerHTML=g.parse(i).toString():t=addReplyElement(n,{text:i,date:(new Date).valueOf()}),assistant_service_messageNotifier.newMessageNotify(i),addMessageToStorage(i)}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 i="user"==t.role;if(t.content){if(!i&&/\[spam\]/.test(t.content))return void console.log("stop spam!");0,addReplyElement(n,{text:g.parse(t.content).toString(),date:t.date},i)}if(e){const n=localStorage.getItem("aiwi_messages"),s=n?JSON.parse(n):[];s.push({role:i?"user":"assistant",content:t.content,date:(new Date).valueOf()}),"string"==typeof e&&localStorage.setItem("aiwi_messages",JSON.stringify(s))}}))}else console.log("chatMessages div not found")}function createTonnel(){installTunnelHandlers();const e=localStorage.getItem("aiwi_thread_id");e&&sendWidgetEnvelope("widget","thread_subscribe",{thread_id:e})}function clearChat(){messages&&(messages.innerHTML="")}async function createThread(){const e=localStorage.getItem("aiwi_thread_id"),t=localStorage.getItem("aiwi_messages");if(e)return t&&(clearChat(),addMessage(JSON.parse(t))),t?null:e;const n="Здравствуйте, могу проконсультировать по услугам",i={};let s;n&&(i.messages=[{role:"assistant",content:n}]),"undefined"!=typeof document&&document.referrer&&(i.referer=document.referrer),"undefined"!=typeof navigator&&(i.userAgent=navigator.userAgent);try{s=await widgetWsRpcResult("thread_create",i,"thread_create_ok",6e4)}catch(e){return void console.error("createThread:",e)}if(s?.id){const e=localStorage.getItem("aiwi_thread_id");return e&&e!==s.id&&sendWidgetEnvelope("widget","thread_unsubscribe",{}),localStorage.setItem("aiwi_thread_id",s.id),createTonnel(),s.id}}async function getMessages(){const e=localStorage.getItem("aiwi_thread_id");if(!e)return"Проблема ;(";const t=await fetch(`${assistant_service_API_URL}/assistants/threads/${e}/messages`).then((e=>e.json())).catch((e=>console.log("error",e)));return t?.body?.data?.length&&"assistant"==t.body.data[0].role?t.body.data[0].content[0].text.value:"Что-то произошло. Не смогу ответить ("}function sendMessageByThread(e){}async function tryAiUserMessage(e,t){const n=new AssistantRunStream;try{const i=await widgetWsRpcResult("ai_user_message",{thread_id:e,content:t},"ai_message_ok",12e4);if("relay_only"===i.mode)return n.close(),"";if("stream"===i.mode)return n;n.close()}catch(e){throw n.close(),e}return""}async function sendMessage(e){let t=localStorage.getItem("aiwi_thread_id")||await createThread();if(!t)return"Не могу ответить. Попробуйте позже. ";if(operatorOnline){try{await widgetWsRpc("message_to_admin",{thread_id:t,message:e},"message_to_admin_ok",25e3)}catch{operatorOnline=!1}return""}addMessage();try{const n=await tryAiUserMessage(t,e);return n}catch(n){const i=n instanceof Error?n.message:String(n);if(/not found|Thread not found|404/i.test(i)||/Чат устарел|устарел/i.test(i)){if(localStorage.removeItem("aiwi_thread_id"),t=await createThread(),!t)return"Не могу ответить. Попробуйте позже. ";try{const n=await tryAiUserMessage(t,e);return n}catch(n){bugReport.report({url:"ws:ai_user_message",headers:"{}",body:{thread_id:t,content:e},error:n})}}else bugReport.report({url:"ws:ai_user_message",headers:"{}",body:{thread_id:t,content:e},error:n})}return"Что-то идет не так. Попробуйте позже."}typingIndicatorDiv.classList.add("typing-indicator"),typingIndicatorDiv.classList.add("flex"),typingIndicatorDiv.classList.add("items-center"),typingIndicatorDiv.classList.add("space-x-1"),typingIndicatorDiv.innerHTML='
    \n
    \n
    ';var metric_service=__webpack_require__(608);Reflect.defineProperty(attention,"name",{value:"default",configurable:!0});let atDiv=document.createElement("div");const defaultImg="data:image/webp;base64,UklGRq4JAABXRUJQVlA4WAoAAAAgAAAAOwAAOwAASUNDUKACAAAAAAKgbGNtcwQwAABtbnRyUkdCIFhZWiAH6QADABIADAAtADRhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1kZXNjAAABIAAAAEBjcHJ0AAABYAAAADZ3dHB0AAABmAAAABRjaGFkAAABrAAAACxyWFlaAAAB2AAAABRiWFlaAAAB7AAAABRnWFlaAAACAAAAABRyVFJDAAACFAAAACBnVFJDAAACFAAAACBiVFJDAAACFAAAACBjaHJtAAACNAAAACRkbW5kAAACWAAAACRkbWRkAAACfAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACQAAAAcAEcASQBNAFAAIABiAHUAaQBsAHQALQBpAG4AIABzAFIARwBCbWx1YwAAAAAAAAABAAAADGVuVVMAAAAaAAAAHABQAHUAYgBsAGkAYwAgAEQAbwBtAGEAaQBuAABYWVogAAAAAAAA9tYAAQAAAADTLXNmMzIAAAAAAAEMQgAABd7///MlAAAHkwAA/ZD///uh///9ogAAA9wAAMBuWFlaIAAAAAAAAG+gAAA49QAAA5BYWVogAAAAAAAAJJ8AAA+EAAC2xFhZWiAAAAAAAABilwAAt4cAABjZcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltjaHJtAAAAAAADAAAAAKPXAABUfAAATM0AAJmaAAAmZwAAD1xtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAEcASQBNAFBtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJWUDgg6AYAAPAfAJ0BKjwAPAA+MRaIQyIhIRULNdAgAwSxAFYc4GnfKXNDv/uzccHT5yB5uPNvOM8wDnMeYDoG+bN1G3oAeXB7Kv91/ID2qrnB4O/hnzP92/JX8btML+I/bD8B9pOoGfzX+7/kp+XnH4gA/JP6r/mfzC/r3Od9ZfRB/HP8t+X3vH4R1AD8p/6T09M7jzl/1v8n8Av8k/o/+z/uP+D/6f7/+LL9o/Zx/XljrYn+C3gEh0ML4rFlX45jHpjObF7XZuatouDySqWL0yYDeRy7zcgGoSjc14cgbzkGpmrXeqUn4ioc+W5ymAfgnX7EsmWIOS6lSFZ7IFtcQgweqID/TWhOER5P9V0vFAD+/N2Mtf68pUjU6PYquQp9/vhWiW2MdULKXrheAsfv53sKXI8TEi/uw+FDiJ55dbJ0a0E0QV+T26+9g7WNaY6hobYNjCMHLEQf7nwidb2qINm2uMsExISPr0p+COa6ZHEYegJegQu2v9c0h52aT9B6x6F7XbtHVvG4fWyKDOucMcIle3NJIt9kk2oqTA0MZrqY7CQmabfUFaYxIlLNtNRzTx9UPMVnTDFmHzM0xRieTHP93jl6UI2pd/D+dHF4Nszbbiv7+/WNHSZa+wf7mZvKrE4dVV1bJXpAHRB0r4Aa2FEbznjaADygVagrTq5CACmqRqgXfXZR9Ibdc+yPGC89+bkZAab/ipLsmonMZXX1KcLOmMuX21rnX4EeZkHRhB41PrhoJjDUzAv/+nX4uso3k0E5UuP99f/7wyw9O57/Iy69fmE43gJFTDFVxYHJDa678ZNymQKqomsRL6IUZF8NYqQ0uz98jHmwfYPlcK1m5TlM3NiuUdd+obhHBx69KDy8SulqP3oGPK/1/8RiFg5I82PixgUPo/XLe7f+Sket5DJBwdvu/77Cev8k41d/8NpR5vhhf8rlXbXQSnJ3SK6SCRVQuHJ4/oR4b3H0UpOO/yA/AL8cjPIks4jlI3iJvYij3eUgTlfCBQrIOiRXIR6hXVjV29lFSBWqzdaQLIHMnmcuck6Csw3DSbMGx+CsQXsY26IvmHhvMGxfzlA2imDwXf8TT7KW+KI4mJQEDGrs6fZB9hQfmYNNzeznJ2tYfaSKV0mJK88kMJV9sB1KD7/oXA2tlRY43GRlQYzo654vNqSpuU8ZgL1PnKSq2gppyiN/eH7A+WoZ7kwulTI1cn9hMvLk0b73lnqYIBg3zEmwOZbW7YLBrXBjWpgw9YvwO7cUJO6U9yehRJ//AuBDgYT+LGV/K9bMfVEv2ippR0fmihzwgBIDqH9k4kirK4ge+giPkbnboXiaQuyWgMzwefJQsCMIQNmNiw4Hzf2FU99gIEO1pg1uPDMI9Yn7xRrMzFMm4e6REtvLfW5/5nrjrazpsM+x04RAAIDciW1McfqpamzToD9xd1NG/3/0dx8FZno+u650V3n5RDaMjo16Credu2LN5yaQ6AolaDv1QGIiw6OuLfccvDSyq7Brj0T62ReARZW11EIsBXo8/l60Jtat09nsCKqwPCJ3W043bV6+oi+X+ntaeTcq8m58qLf4iTd7nnelWHuiisaLMQIedVTHWR/RfcX0L9d/BPSyWDH8h3rlvWL+jTRt3ZqZD84EoWrYvklzrGUUgG7e6UuwQUJq/06jTd1tG2E/jRHPYADqZ5QnaFKkqVZQM1SVIsBjKR49XDFHqxgm0GH1XMNLjp5oDpp6LcGa//Qzz4gAQ7R45Naqa81iPaSbpg/mlHU5Naq5Ns93vx2RWGGiKFYHafKKXRuk/4GS78Sf2Vz6AiRyDgoOo0oeZNTjEPkYN2SKBNQ/nHukbz3KRIQxqDKf9Qj//HGoxYyp1fGih7tbB8nNgke7cC9Dm5db+a3EouDIFhPP9NICiBq3fgD9Pt2H4uZIel7LLA8nDV7NQtNGUSnwfWtJedjtR9Z2QKWyKR7ixmMcTPIqyEe7OERCaWWsOH6pmus1SjGsXpeHqj4UZ1Y8xIvZTlVnAux19HV/w0MUJykUxI/8zuYqP9gKEnsEBeIPZyIX/vueeytWYBuKF/F+LZe69tUPhmNAqG37l7iGRfbuFzAHdF9gFdm0i4pF381+K1XPGYukEq4+taVRab1MIkAOUv+uHYf+CyFZKUTdmvsRnNxPPW6DB6uk0ceq2X11Vn5q5uQfpn/TH/PVSPH8045BRwOOKaFErF2/a1cHaaPiSZFAQ+ptdmSriqLxhd8do3SNP0EViTzu2uEXqQfXvAobtR6EW+InVTwWkMXQCybpFk3nK0eoCTT8etYmwJgVdmJn+v/WvNhEqPjxZ613ljxxcKD7+WL3mR5HCttjhPSXR4WLFUfzZsQWjlS4gAA=";function attention(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(${defaultImg});\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),atDiv.style.display="none",atDiv.style.position="relative",atDiv.classList.add("lswa-widget-button-popup","lswa-widget-button-popup-show");const i=document.createElement("span");i.classList.add("lswa-widget-button-popup-btn-hide"),i.addEventListener("click",(()=>{atDiv.style.display="none"})),atDiv.innerHTML=`\n
    \n
    \n \n
    \n
    \n
    Алексей
    \n
    Добрый день! Напишите мне!
    \n
    \n
    \n
    `,atDiv.appendChild(i);const s=setTimeout((()=>{const e=document.querySelector("lsw_chat_popup");e&&"none"!=e.style.display||(atDiv.style.display="block")}),5e3);return t?e.appendChild(atDiv):e.insertBefore(atDiv,e.querySelector("div")),{element:atDiv,timeout:s}}const policyWrapper=(e,n)=>{const i="https://ls-ai.ru/policy/data/67a697f21eacd1219e1bab31",s=void 0;const o=document.createElement("div");o.className="i-lh-policy-wrapper",o.style.cssText="margin: 10px 10px; font-size: 13px; color: rgb(178, 178, 178); text-align: center;";const r=document.createElement("input"),a=document.createElement("input"),l="true"===localStorage.getItem("ls_policy");let c=!l;const p=()=>{if(o.innerHTML="",c){if(i){const e=document.createElement("label");e.style.cssText="\n display: flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 6px;\n line-height: 1.4;\n cursor: pointer;\n font-size: smaller;\n ",r.type="checkbox",r.checked=l,r.style.cssText="\n flex-shrink: 0;\n cursor: pointer;\n width: 12px;\n height: 12px;\n accent-color: rgb(52, 59, 67);\n ";const s=document.createElement("span");s.innerHTML=t("policyText",{link:i});const a=s.querySelector("a");a&&(a.style.color="rgb(178, 178, 178)"),e.appendChild(r),e.appendChild(s),o.appendChild(e),r.addEventListener("change",(()=>{r.checked?localStorage.setItem("ls_policy",(new Date).valueOf().toString()):localStorage.removeItem("ls_policy"),n()}))}s,n()}else{const e=document.createElement("div");e.innerHTML='Отправляя данные, вы соглашаетесь с политиками конфиденциальности.',e.querySelector("a").addEventListener("click",(e=>{e.preventDefault(),c=!0,p()})),o.appendChild(e)}};return p(),e.appendChild(o),[r,a]};Reflect.defineProperty(widget,"name",{value:"default",configurable:!0});let widget_messageNotifier=new messageNotifier;const mainBtnCoords="-20,63".split(",").map((e=>Number(e))),themeColor="#223c6f",chatDisabled=Boolean(void 0);let contactsLis;const timeouts=new Map,messages=document.createElement("div"),inputTextInChat=document.createElement("textarea"),mainColor="#F5F7FA",sendIcon='\n\n\n';let policyCheckbox,policyClientCheckbox;const emailInput=document.createElement("input");emailInput.type="email",emailInput.placeholder="Email",emailInput.id="contact-email";const phoneInput=document.createElement("input");phoneInput.id="contact-phone",phoneInput.type="tel";const submitBtn=document.createElement("button");let messagesCounterAfterOpenChat=0;const defaultAvatar=null;function createAttachButton(e){const t=document.createElement("div");return t.innerHTML='',t}function styleMainContactFab(e){Object.assign(e.style,{width:"4em",height:"4em",position:"absolute",zIndex:"100",margin:"0"})}function createChatButtonWithWaves(){const e=document.createElement("div");Object.assign(e.style,{position:"relative",height:"4em",width:"4em"}),e.classList.add("animate");for(let t=0;t<3;t++){const t=document.createElement("div");t.classList.add("lsw_waves"),e.appendChild(t)}const t=document.createElement("ul");if(Object.assign(t.style,{padding:0,margin:0}),!chatDisabled){const e=document.createElement("li");let n=window.matchMedia("(hover: none) and (pointer: coarse)").matches,i=!1;e.addEventListener("click",(e=>{if(!n)return togglePopup(),void(i=!1);i?(i=!1,togglePopup()):(showButtons(),i=!0,e.preventDefault())})),Object.assign(e.style,{backgroundColor:themeColor,borderRadius:"9999px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",width:"4em",height:"4em",position:"absolute",zIndex:100});const s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg");o.setAttribute("xmlns",s),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),Object.assign(o.style,{width:"2.5em",height:"2.5em",color:mainColor});const r=document.createElementNS(s,"path");r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("d","M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"),o.appendChild(r),e.appendChild(o),t.appendChild(e)}return e.appendChild(t),e}const fixedChat=void 0,animateBubble=fixedChat?null:createChatButtonWithWaves(),popup=document.createElement("div");async function togglePopup(){if(!chatDisabled)if(popup.style.display="none"==popup.style.display?"flex":"none","none"!=popup.style.display){messagesCounterAfterOpenChat=0,atDiv.style.display="none",metric_service.A.openChat(),animateBubble&&animateBubble.classList.remove("animate"),inputTextInChat.focus();const e=await createThread();messages.childNodes.length&&!e||addMessage("Здравствуйте, могу проконсультировать по услугам")}else animateBubble&&animateBubble.classList.add("animate")}function showButtons(){if(contactsLis)for(let e=1;e{const s=document.createElement("div");Object.assign(s.style,{position:"absolute",width:"40px",height:"6px",top:t,right:n,background:i,borderRadius:"100px",transform:"rotate(-15deg)"}),e.appendChild(s)}))}async function autoSubmitContactForm(){const e=popup.querySelector("#contact-name"),n=popup.querySelector("#contact-phone"),i=popup.querySelector("#contact-form-popup button");i.style.backgroundColor=themeColor||"#3b82f6",i.textContent=t("sending"),i.disabled=!0;const s={name:e.value.trim(),email:emailInput.value.trim(),phone:n.value.trim(),timestamp:(new Date).toISOString()};saveContactData(s);try{(await fetch("/api/save-contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).ok&&console.log("Contact data auto-saved successfully")}catch(e){console.error("Failed to auto-save contact data:",e)}hideContactForm()}function checkFormValidity(){const e=policyCheckbox?.checked&&!0;(emailInput.value.trim()||phoneInput.value.trim())&&e?(submitBtn.disabled=!1,submitBtn.style.backgroundColor=themeColor||"#3b82f6",submitBtn.style.cursor="pointer",submitBtn.style.opacity="1"):(submitBtn.disabled=!0,submitBtn.style.backgroundColor="#d1d5db",submitBtn.style.cursor="not-allowed",submitBtn.style.opacity="0.6")}function expandForm(){const e=popup.querySelector("#extra-contact-fields"),t=e.previousElementSibling,n=popup.querySelector("#contact-form-subtitle");t.style.marginBottom="0",e.style.maxHeight="200px",e.style.opacity="1",n.style.maxHeight="30px",n.style.opacity="1",n.style.marginBottom="16px"}function showContactForm(e=!1){console.log("go to show");const t=popup.querySelector("#contact-form-popup"),n=getContactData(),i=popup.querySelector("#contact-name"),s=popup.querySelector("#contact-email"),o=popup.querySelector("#contact-phone");e&&n&&(i&&(i.value=n.name||""),s&&(s.value=n.email||""),o&&(o.value=n.phone||""),expandForm(),checkFormValidity()),t&&(t.style.display="block",setTimeout((()=>{t.style.opacity="1",t.style.transform="translateY(0) scale(1)"}),10))}function collapseForm(){const e=popup.querySelector("#extra-contact-fields"),t=popup.querySelector("#contact-name"),n=popup.querySelector("#contact-form-subtitle");t.value.trim()||(e.style.maxHeight="0",e.style.opacity="0",n.style.maxHeight="0",n.style.opacity="0",n.style.marginBottom="0")}function hideContactForm(){console.log("hide contact form");const e=popup.querySelector("#contact-form-popup");e.style.opacity="0",e.style.transform="translateY(10px) scale(0.95)",setTimeout((()=>{e.style.display="none";getContactData()||(popup.querySelector("#contact-name").value="",popup.querySelector("#contact-email").value="",popup.querySelector("#contact-phone").value="",collapseForm(),checkFormValidity())}),300)}async function submitContactForm(){const e=popup.querySelector("#contact-form-popup button"),t=popup.querySelector("#contact-name"),n=popup.querySelector("#contact-email"),i=popup.querySelector("#contact-phone");e.disabled=!0,e.style.cursor="not-allowed";const s=e.textContent;e.textContent="Отправка...";const o={name:t.value.trim(),email:n.value.trim(),phone:i.value.trim(),timestamp:(new Date).toISOString(),chat:!0};saveContactData(o);try{await widgetWsRpc("lead",{assistant:"67a697f21eacd1219e1bab31",name:o.name,email:o.email,phone:o.phone,chat:!0,url:window.location.origin+window.location.pathname,thread:localStorage.getItem("aiwi_thread_id")||"",referer:document.referrer||void 0,userAgent:navigator.userAgent},"lead_ok",3e4),console.log("Contact data saved successfully"),hideContactForm()}catch(e){console.error("Failed to save contact data:",e),hideContactForm()}finally{e.textContent=s,e.disabled=!1,e.style.cursor="pointer"}}function createContactForm(e){const n=document.createElement("div");n.id="contact-form-popup",Object.assign(n.style,{position:"absolute",top:"90px",left:"11px",backgroundColor:"white",borderRadius:"16px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"20px",minWidth:"280px",maxWidth:"320px",display:"none",opacity:"0",transform:"translateY(10px) scale(0.95)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:"1000"});const i=document.createElement("div");Object.assign(i.style,{position:"absolute",top:"-8px",left:"30px",width:"0",height:"0",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:"8px solid white",filter:"drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1))"}),n.appendChild(i);const s=document.createElement("button");s.type="button",s.innerHTML="×",s.setAttribute("aria-label","Close"),Object.assign(s.style,{position:"absolute",top:"10px",right:"10px",width:"28px",height:"28px",borderRadius:"50%",border:"none",background:"transparent",color:"#6b7280",fontSize:"20px",lineHeight:"28px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease, color 0.2s ease"}),s.addEventListener("mouseenter",(()=>{s.style.backgroundColor="#f3f4f6",s.style.color="#111827"})),s.addEventListener("mouseleave",(()=>{s.style.backgroundColor="transparent",s.style.color="#6b7280"})),s.addEventListener("click",(e=>{e.stopPropagation(),hideContactForm()})),n.appendChild(s);const o=document.createElement("div");o.textContent=t("askNames"),Object.assign(o.style,{fontSize:"1.1em",fontWeight:"600",marginBottom:"5px",color:"#111827"}),n.appendChild(o);const r=document.createElement("div");r.id="contact-form-subtitle",r.textContent="Укажите email или телефон",Object.assign(r.style,{fontSize:"0.85em",color:"#6b7280",marginBottom:"16px",maxHeight:"0",overflow:"hidden",opacity:"0",transition:"max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease"}),n.appendChild(r);const a=document.createElement("div");Object.assign(a.style,{marginBottom:"0",transition:"margin-bottom 0.3s ease"});const l=document.createElement("input");l.type="text",l.placeholder=t("yourName"),l.id="contact-name",Object.assign(l.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",transition:"all 0.2s",boxSizing:"border-box"}),l.addEventListener("focus",(()=>{l.style.borderColor=themeColor||"#3b82f6",l.style.boxShadow=`0 0 0 3px ${themeColor||"#3b82f6"}20`,expandForm()})),l.addEventListener("blur",(()=>{l.style.borderColor="#e5e7eb",l.style.boxShadow="none"})),l.addEventListener("input",checkFormValidity),a.appendChild(l),n.appendChild(a);const c=document.createElement("div");c.id="extra-contact-fields",Object.assign(c.style,{maxHeight:"0",overflow:"hidden",transition:"max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease",opacity:"0"}),Object.assign(emailInput.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",marginTop:"12px",transition:"all 0.2s",boxSizing:"border-box"}),emailInput.addEventListener("focus",(()=>{emailInput.style.borderColor=themeColor||"#3b82f6",emailInput.style.boxShadow=`0 0 0 3px ${themeColor||"#3b82f6"}20`})),emailInput.addEventListener("blur",(()=>{emailInput.style.borderColor="#e5e7eb",emailInput.style.boxShadow="none"})),emailInput.addEventListener("input",checkFormValidity),phoneInput.placeholder=t("phone"),Object.assign(phoneInput.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",marginTop:"12px",transition:"all 0.2s",boxSizing:"border-box"}),phoneInput.addEventListener("focus",(()=>{phoneInput.style.borderColor=themeColor||"#3b82f6",phoneInput.style.boxShadow=`0 0 0 3px ${themeColor||"#3b82f6"}20`})),phoneInput.addEventListener("blur",(()=>{phoneInput.style.borderColor="#e5e7eb",phoneInput.style.boxShadow="none"})),phoneInput.addEventListener("input",checkFormValidity),c.appendChild(emailInput),c.appendChild(phoneInput),n.appendChild(c);const p=policyWrapper(n,checkFormValidity);policyCheckbox=p[0],policyClientCheckbox=p[1],submitBtn.textContent=t("send"),submitBtn.disabled=!0,Object.assign(submitBtn.style,{width:"100%",padding:"12px",backgroundColor:"#d1d5db",color:"white",border:"none",borderRadius:"12px",fontSize:"14px",fontWeight:"600",cursor:"not-allowed",transition:"all 0.2s",opacity:"0.6"}),submitBtn.addEventListener("click",submitContactForm),n.appendChild(submitBtn),e.appendChild(n),e.addEventListener("click",(t=>{const n=e.querySelector("#contact-form-popup"),i=e.querySelector("#chat-avatar"),s=getContactData();n&&"none"!==n.style.display&&s&&t.target instanceof Node&&(n.contains(t.target)||i.contains(t.target)||hideContactForm())})),inputTextInChat.addEventListener("focus",(async()=>{const t=e.querySelector("#contact-form-popup"),n=getContactData();if(t&&"none"!==t.style.display&&!n){const t=e.querySelector("#contact-email"),n=e.querySelector("#contact-phone");t?.value.trim()||n?.value.trim()?await autoSubmitContactForm():collapseForm()}}))}function widget(e,n){const i=document.createElement("button"),s=document.createElement("div");Object.assign(s.style,{[mainBtnCoords[0]>0?"left":"right"]:Math.abs(mainBtnCoords[0])+"px",[mainBtnCoords[1]>0?"bottom":"top"]:Math.abs(mainBtnCoords[1])+"px",color:"black",display:"flex",alignItems:"flex-end",flexDirection:"row",gap:"10px",fontSize:"100%",zIndex:"10000000"}),fixedChat||(s.style.position="fixed",document.body.appendChild(s));const o=s.attachShadow({mode:"closed"}),r=(()=>{if(popup.id="lsw_chat_popup",chatDisabled)return Object.assign(popup.style,{display:"none",position:"fixed",visibility:"hidden",pointerEvents:"none"}),popup;Object.assign(popup.style,{fontSize:".875em",backgroundColor:mainColor,boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",transition:"all 0.3s",overflow:"hidden",WebkitTextSizeAdjust:"100%",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif',fontWeight:"500",letterSpacing:"-0.01em",lineHeight:"1.3"}),fixedChat||(Object.assign(popup.style,{position:"fixed",display:"none"}),mainBtnCoords[0]);const e=document.createElement("div");e.id="chat-header",e.style.padding="1em",e.style.display="flex",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.height="4.5em";const n=document.createElement("div");Object.assign(n.style,{position:"absolute",backgroundColor:"white",width:"83%",borderRadius:"28px",height:"70px",color:"black",top:"15px",left:"15px",display:"flex",boxShadow:"0px 0px 12px 0px #00000012"});const s=document.createElement("div");s.textContent="Алексей",Object.assign(s.style,{marginTop:"10px",fontSize:"1.125em",lineHeight:"1.75em"});const o=document.createElement("div");o.id="chat-avatar",Object.assign(o.style,{width:"50px",height:"50px",margin:"10px",borderRadius:"50%",backgroundSize:"contain",backgroundImage:`url(${defaultImg})`,cursor:"pointer",transition:"transform 0.2s"}),o.addEventListener("click",(()=>{const e=getContactData();console.log("avatar click",e),e&&showContactForm(!0)})),o.addEventListener("mouseenter",(()=>{o.style.transform="scale(1.05)"})),o.addEventListener("mouseleave",(()=>{o.style.transform="scale(1)"}));const r=document.createElement("div");Object.assign(r.style,{color:"#38E040",fontSize:"x-small"}),r.innerText=t("online"),window.addEventListener("lsw-widget-admin-presence",(e=>{const n=e;"boolean"==typeof n.detail?.online&&(n.detail.online?(r.innerText=t("online"),r.style.color="#38E040"):(r.innerText="—",r.style.color="#9ca3af"))}));const a=document.createElement("div");if(Object.assign(a.style,{display:"flex",flexDirection:"column"}),a.appendChild(s),a.appendChild(r),n.appendChild(o),n.appendChild(a),createHeaderRectangles(e),e.appendChild(n),!fixedChat){const t=document.createElement("button");t.id="close-popup",Object.assign(t.style,{background:"transparent",position:"absolute",top:"14px",right:"14px",border:"none",color:mainColor,cursor:"pointer",padding:"0",zIndex:"1",filter:"drop-shadow(2px 2px 2px rgba(0, 0, 0, .8))"}),t.addEventListener("click",(function(){togglePopup()}));const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2"),n.style.width="1.5rem",n.style.height="1.5rem";const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("d","M6 18L18 6M6 6l12 12"),n.appendChild(i),t.appendChild(n),e.appendChild(t)}messages.classList.add("message-block"),messages.addEventListener("wheel",(e=>{if(!e.target)return;e.preventDefault(),e.stopPropagation();const t=2*e.deltaY;messages.scrollBy(0,t)}),{passive:!1});const l=document.createElement("div");l.id="chat-input-container",Object.assign(l.style,{padding:"1rem",borderTop:"1px solid #e5e7eb",margin:"5px 15px 0",borderRadius:"24px",backgroundColor:"white",boxShadow:"0px 0px 12px 0px #00000012"});const c=document.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:"1rem"}),inputTextInChat.placeholder=t("inputMessage"),Object.assign(inputTextInChat.style,{flex:"1",leadingTrim:"NONE",lineHeight:"16px",letterSpacing:"0%",padding:"0.5rem 1rem",outline:"none",backgroundColor:"white",resize:"none",fontSize:"16px",border:0}),i.classList.add("chat-submit"),i.innerHTML=sendIcon,Object.assign(i.style,{backgroundColor:themeColor,color:mainColor,borderRadius:"100px",cursor:"pointer",border:"none",width:"40px",height:"40px",padding:"14px 6px"}),c.appendChild(inputTextInChat),c.appendChild(i),l.appendChild(c);const p=document.createElement("div");Object.assign(p.style,{textAlign:"center",padding:"8px 0 5px 0",fontSize:"0.75em",color:"#6b7280",opacity:"0.7"});const d=document.createElement("a");return d.href="https://ls-ai.ru",d.target="_blank",d.textContent=t("createdAt"),Object.assign(d.style,{color:"#6b7280",textDecoration:"none",transition:"opacity 0.2s"}),d.addEventListener("mouseenter",(()=>{d.style.opacity="1"})),d.addEventListener("mouseleave",(()=>{d.style.opacity="0.7"})),p.appendChild(d),popup.appendChild(e),popup.appendChild(messages),popup.appendChild(l),popup.appendChild(p),createContactForm(popup),popup})();animateBubble&&o.appendChild(animateBubble),o.appendChild(r);const a=document.createElement("ul");if(a.style.listStyle="none",a.style.display="none",a.style.justifyContent="center",a.style.alignItems="center",a.style.flexDirection="column",o.appendChild(a),e?.length&&animateBubble){const t=animateBubble.querySelector("ul");if(t){if(chatDisabled){const[n,...i]=e;n?.element&&(styleMainContactFab(n.element),t.appendChild(n.element)),i.forEach((e=>{e.element&&t.appendChild(e.element)}))}else e.forEach((e=>{e.element&&t.appendChild(e.element)}));contactsLis=t.querySelectorAll("li"),contactsLis?.length>1&&(t.addEventListener("mouseenter",(()=>{n?.value&&(n.value.element.style.display="none",clearTimeout(n.value.timeout)),showButtons()})),t.addEventListener("mouseleave",(()=>{if(contactsLis)for(let e=1;e{contactsLis&&(contactsLis[e].style.transform="translateX(0)")}),500))})))}}return!chatDisabled&&i&&inputTextInChat&&(i.addEventListener("click",(async function(){const e=inputTextInChat.value.trim();if(!e)return;const t=getContactData();messagesCounterAfterOpenChat++,t||(console.log("need show contact form"),showContactForm()),metric_service.A.sendMessage(),addMessage(e,!0);const n=await sendMessage(e);n&&("string"==typeof n&&widget_messageNotifier.newMessageNotify(n),addMessage(n))})),inputTextInChat.addEventListener("keyup",(function(e){"Enter"===e.key&&i.click()}))),chatDisabled||(createTonnel(),createThread()),[o,mainBtnCoords[0]>0]}let leadCatcher_policyCheckbox,leadCatcher_policyClientCheckbox;function leadCatcher(){const e=document.createElement("input"),n=document.createElement("button"),i=()=>{const t=leadCatcher_policyCheckbox?.checked&&!0;n.disabled=!t||e.value.replace(/\D/g,"").length<11,n.style.cursor=n.disabled?"default":"pointer"};function s(s){s.append((()=>{const e=document.createElement("style");return e.innerHTML='\n a { \n text-decoration:none;\n color:inherit;\n }\n \n #lsw_waitCall:disabled {\n background: rgb(71, 141, 235, 38%);\n }\n \n #lsw_waitCall {\n border-radius: 3px; \n font-size: 16px; \n height: 44px; \n color: rgb(255, 255, 255); \n background: rgb(71, 141, 235); \n font-family: OpenSans, sans-serif; \n width: 300px; \n margin-top: 8px;\n }\n \n .i-lh-close-cross {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n -webkit-box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n -moz-box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n box-shadow: inset 0 0 2px -2px hsla(0,0%,40%,.8),0 0 6px -2px rgb(241 242 243);\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAABkUlEQVQ4je2SMWvbQBiGn4sQyNVyHjMbSglETRzlZzTbQUct9pYYOpRC90LJYDvZjAeDhw7a46HpLyg2mkTbP9D1piTYwtfBElUcWZbn5N3uvuPhu+974CVpRP7QarXeA6+11pdhGN5XASilavV6/eNyufwzHA6/Zfd7+UfGmAPgTErZV0rVqkCllH1jzDshxJt87RE4SZIvwE+gKaW8brfbrzZBgyBwpJRdoAlEQoiv+bqVP0RRlHie98OyrEPgBDj2ff92Op0u1qG2bfcAP4VeDAaDu43gKvAqUFhbXkFXXeA0A8zn82UVaCkY/i+H1Rxn6XUTmGmtO2XmPBlFPnEcJ57nfU/H4gP7aaed8XhcquNeWTGX0p8VpbRjpVTNdd0rVkucAX+BY+Bto9G4jeM42RkcBIHjum4vhUZCiM5isbjJxuI4TrNIxVLwJqWqel4I3uZpVbi1C3QX+CMrbNv+nEJnWuvzTfIDjEajB631B1ZLPQI+5evruv0CJtvkzxKG4b3WugNMjDG/t71/pvkHkaHKyfDtLb4AAAAASUVORK5CYII=");\n background-position-x: 0%;\n background-position-y: 0%;\n background-repeat: repeat;\n background-size: auto;\n background-size: 16px;\n background-repeat: no-repeat;\n background-position: 50%;\n }\n .i-lh-close {\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 10000000;\n }\n .i-lh-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 350px;\n overflow: hidden;\n position: relative;\n display: flex;\n flex-direction: column;\n }\n .i-lh-main-desktop {\n min-width: 350px !important;\n }\n .i-lh-header {\n font-size: 24px;\n line-height: 1.3 !important;\n margin-bottom: 12px;\n }\n .i-lh-description {\n font-size: 16px;\n line-height: 1.4 !important;\n color: #475155;\n margin-bottom: 20px;\n width: 300px;\n }\n .bg-black {\n --tw-bg-opacity: 1;\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity))\n }\n \n .inset-0 {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0\n }\n .full-width {\n width: 100%;\n }\n .i-lh-vertical {\n width: 100%;\n }\n .i-lh-form {\n margin-bottom: 0;\n }\n .i-lh-form .i-lh-field {\n vertical-align: top;\n }\n .bg-opacity-25 {\n --tw-bg-opacity: 0.25\n }\n .lsw_vertical {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 300px;\n margin: 0 auto;\n }\n .i-lh-input-wrapper {\n position: relative;\n }\n .i-lh-icon-wrapper {\n position: absolute;\n display: flex;\n height: 100%;\n align-items: center;\n left: 9px;\n font-size: 14px;\n }\n \n .i-lh-input {\n padding: 0 10px;\n padding-left: 10px;\n min-width: 216px;\n width: 100%;\n height: 40px;\n background: #fff;\n border-radius: 4px;\n border: 1px solid rgba(27,42,48,.2);\n border-top-width: 1px;\n border-top-color: rgba(27, 42, 48, 0.2);\n border-right-width: 1px;\n border-right-color: rgba(27, 42, 48, 0.2);\n border-bottom-width: 1px;\n border-bottom-color: rgba(27, 42, 48, 0.2);\n border-left-width: 1px;\n border-left-color: rgba(27, 42, 48, 0.2);\n font-size: 15px;\n }\n *,\n ::after,\n ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n .i-lh-input-iconed {\n padding-left: 30px !important;\n }\n .agreement-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n }\n .button-wrapper {\n position: relative;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 300px;\n margin: 0 auto;\n max-width: 100%;\n }\n svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n }\n .svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n .i-lh-agreement {\n border-collapse: collapse;\n }\n .checkbox {\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 3px;\n margin-top: 3px;\n border: 1px solid grey;\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n }\n .i-lh-agreement .i-lh-text {\n font-size: 12px;\n line-height: 16px;\n color: #bbb;\n padding: 2px 0 0 6px;\n cursor: pointer;\n white-space: normal;\n text-align: justify;\n }\n .i-lh-input.i-lh-material {\n box-shadow: none !important;\n background: transparent !important;\n border-radius: 0 !important;\n border-top-color: transparent !important;\n border-right-color: transparent !important;\n border-left-color: transparent !important;\n }\n .i-lh-footer-text {\n opacity: .3;\n }\n .i-lh-footer {\n height: 28px;\n padding: 5px 0 10px;\n font-size: 12px;\n line-height: 28px;\n color: rgba(127, 127, 127, 0.7); \n line-height: 8px; \n height: 8px; \n text-align: center;\n }\n .i-lh-input:focus {\n color: rgba(30, 25, 28);\n outline: 0;\n }\n .i-lh-checkbox-wrapper {\n vertical-align: baseline;\n }\n .checkbox-active {\n background: #3c87fd;\n color: #fff;\n font-size: 11px;\n text-align: center;\n padding: 1px;\n border: none;\n border-radius: 3px;\n color: rgb(255, 255, 255);\n background: rgb(54 56 59);\n }\n \n .i-lh-policy-wrapper a {\n text-decoration: underline;\n }\n \n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n ',e})(),(s=>{const o=document.createElement("div");Object.assign(o.style,{width:"400px",backgroundColor:"#f5f7fa",padding:"1.5rem",paddingBottom:"0.6em",borderRadius:"24px",position:"relative"}),o.className="shadow-lg";const r=document.createElement("div");r.className="i-lh-close";const a=document.createElement("div");a.id="wls_closeModalBtn",a.className="i-lh-close-cross",r.appendChild(a),o.appendChild(r);const l=()=>{s.host.remove(),localStorage.setItem("lsw_lc_lps",((new Date).valueOf()-432e5+36e4).toString())};r.addEventListener("click",(()=>{l()}));let c=!0;s.addEventListener("click",(e=>{c=!1})),s.host.addEventListener("click",(e=>{console.log("click on host",c),c?l():c=!0}));const p=document.createElement("div");p.className="i-lh-wrapper",p.style.fontFamily="Open-Sans, sans-serif",p.style.width="unset",p.style.height="unset";const d=document.createElement("div");d.className="i-lh-main-desktop";const h=document.createElement("div");h.className="i-lh-header",h.style.cssText="text-align: center; line-height: 38px; color: rgb(30, 25, 28); font-size: 30px;",h.textContent=t("haveQues");const u=document.createElement("div");u.className="i-lh-description",u.style.cssText="text-align: center; line-height: 20px; color: rgb(127, 127, 127); font-size: 15px; margin: 10px auto; width: 340px;",u.textContent=t("callAsk");const g=document.createElement("div");g.className="i-lh-form i-lh-vertical full-width";const m=document.createElement("div");m.className="i-lh-field";const f=document.createElement("div");f.className="i-lh-input-wrapper lsw_vertical";const b=document.createElement("div");b.className="i-lh-icon-wrapper",b.style.color="rgb(30, 25, 28)",b.innerHTML='\n ',e.name="wls_phoneNumber",e.placeholder=t("phone"),e.type="tel",e.className="i-lh-input i-lh-input-iconed i-lh-material",e.style.cssText="border-radius: 3px; color: rgba(30, 25, 28); background: rgb(255, 255, 255); border-color: rgb(30, 25, 28); font-family: OpenSans, sans-serif; border-width: 1px; width: 100%;",e.required=!0,f.appendChild(b),f.appendChild(e),m.appendChild(f),g.appendChild(m);const x=document.createElement("div");x.className="i-lh-field";const y=document.createElement("div");y.className="button-wrapper",n.id="lsw_waitCall",n.disabled=!0,n.textContent=t("callMe")+" →",y.appendChild(n),x.appendChild(y);const w=policyWrapper(g,i);leadCatcher_policyCheckbox=w[0],leadCatcher_policyClientCheckbox=w[1],e.addEventListener("input",(()=>i())),g.appendChild(x);const k=e=>{const t=e.target;let n=0,s=t.value.replace(/\D/g,"").replace(/^8/,"7");var o,r;i(),t.value="+_ (___) ___-__-__".replace(/./g,(function(e){return/[_\d]/.test(e)&&n=s.length?"":e})),"blur"==e.type?2==t.value.length&&(t.value=""):(o=t,r=t.value.length,o.focus(),o.setSelectionRange&&o.setSelectionRange(r,r))};e.addEventListener("input",k,!1),e.addEventListener("focus",k,!1),e.addEventListener("blur",k,!1),e.addEventListener("keydown",k,!1);const v=document.createElement("div");n.addEventListener("click",(async()=>{n.disabled=!0,metric_service.A.sendLead();try{await widgetWsRpc("lead",{assistant:"67a697f21eacd1219e1bab31",phone:e.value,name:"",email:"",chat:!1,url:window.location.origin+window.location.pathname,thread:localStorage.getItem("aiwi_thread_id")||"",referer:document.referrer||void 0,userAgent:navigator.userAgent},"lead_ok",3e4),localStorage.setItem("lsw_lc_lps",(new Date).valueOf().toString()),d.style.display="none",v.style.display=""}catch(e){console.log("error",e),n.disabled=!1}})),d.appendChild(h),d.appendChild(u),d.appendChild(g),v.className="i-lh-main-desktop",v.style.cssText="display: none;";const A=document.createElement("div");A.className="i-lh-header",A.style.cssText="text-align: center; line-height: 38px; color: rgb(30, 25, 28); font-size: 30px;",A.textContent=t("thanks");const S=document.createElement("div");S.style.cssText="text-align: center; line-height: 20px; color: rgb(127, 127, 127); font-size: 15px; margin: 10px auto; width: 340px;",S.textContent=t("waitCall"),v.appendChild(A),v.appendChild(S);const C=document.createElement("div");C.className="i-lh-footer";const L=document.createElement("div");return L.className="i-lh-footer-text",L.innerHTML=`${t("workTechs")} Ls-ai.ru`,C.appendChild(L),p.appendChild(d),p.appendChild(v),p.appendChild(C),o.appendChild(p),o})(s))}const o=()=>{document.removeEventListener("mousemove",a);const e=Number(localStorage.getItem("lsw_lc_lps"));if(!((new Date).valueOf()-e>432e5))return;const t=document.createElement("div");Object.assign(t.style,{zIndex:"100",position:"fixed",alignItems:"center",display:"flex",inset:0,backgroundColor:"rgba(0, 0, 0, 0.25)",justifyContent:"center"}),document.body.appendChild(t);s(t.attachShadow({mode:"closed"}))},r=setTimeout((()=>{o()}),3e4),a=e=>{e.clientY<=10&&(o(),clearTimeout(r))};document.addEventListener("mousemove",a)}Reflect.defineProperty(leadCatcher,"name",{value:"default",configurable:!0}),Reflect.defineProperty(styles,"name",{value:"default",configurable:!0});const styles_fixedChat=void 0,styles_mainBtnCoords="-20,63".split(",").map((e=>Number(e)));function styles(e){let t="lsw_chat_popup";console.log("add styles",e);const n=document.createElement("style");n.innerHTML=`\n *,\n ::after,\n ::before,\n #${t} *,\n #${t} ::after,\n #${t} ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n \n \n \n .border-t, #${t} .border-t {\n border-top-width: 1px\n }\n .bg-gray-800, #${t} .bg-gray-800{\n --tw-bg-opacity: 1;\n background-color: rgba(31, 41, 55, var(--tw-bg-opacity))\n }\n .text-white, #${t} .text-white {\n --tw-text-opacity: 1;\n color: rgba(255, 255, 255, var(--tw-text-opacity))\n }\n .flex {\n display:flex\n }\n .m-0 {\n margin: 0\n }\n .bg-transparent {\n background-color: transparent\n }\n .h-6 {\n height: 1.5rem\n }\n .flex-1 {\n flex: 1 1 0%\n }\n .p-4 {\n padding: 1rem\n }\n .bg-white {\n --tw-bg-opacity: 1;\n background-color: rgba(255, 255, 255, var(--tw-bg-opacity))\n }\n .justify-center {\n justify-content: center\n }\n .rounded-full, #${t} .rounded-full{\n border-radius: 9999px\n }\n .items-center {\n align-items: center\n }\n .cursor-pointer {\n cursor: pointer\n }\n .absolute {\n position: absolute\n }\n .right-0 {\n right: 0\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n }\n .flex-col {\n flex-direction: column\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms\n }\n .justify-between {\n justify-content: space-between\n }\n .border-none, #${t} .border-none{\n border-style: none\n }\n .w-6 {\n width: 1.5rem\n }\n .overflow-y-auto {\n overflow-y: auto\n }\n .scroll-smooth {\n scroll-behavior: smooth;\n }\n .border-t {\n border-top-width: 1px\n }\n .border-gray-200, #${t} .border-gray-200{\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity))\n }\n .space-x-4>:not([hidden])~:not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(1rem * var(--tw-space-x-reverse));\n margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)))\n }\n .border, #${t} .border{\n border-width: 1px\n }\n .border-gray-300, #${t} .border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgba(209, 213, 219, var(--tw-border-opacity))\n }\n .rounded-md, #${t} .rounded-md {\n border-radius: .375rem\n }\n .px-4, #${t} .px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n }\n .py-2, #${t} .py-2{\n padding-top: .5rem;\n padding-bottom: .5rem\n }\n .outline-none, #${t} .outline-none{\n outline: 2px solid transparent;\n outline-offset: 2px\n }\n .w-3\\/4 {\n width: 75%\n }\n .p-6 {\n padding: 1.5rem\n }\n .rounded-lg, #lsw_lead_catcher .rounded-lg, #${t} .rounded-lg{\n border-radius: .5rem\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)\n }\n .relative {\n position: relative\n }\n .bg-gray-200, #${t} .bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgba(229, 231, 235, var(--tw-bg-opacity))\n }\n .fixed {\n position: fixed\n }\n .inset-0 {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0\n }\n .bg-black {\n --tw-bg-opacity: 1;\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity))\n }\n .bg-opacity-25 {\n --tw-bg-opacity: 0.25\n }\n .mb-3 {\n margin-bottom: .75rem\n }\n \n // #chat-popup button {\n // padding: 0\n // }\n #chat-header button:hover {\n background-color: transparent;\n }\n `,e.append(n);const i=document.createElement("style");i.innerHTML=` \n \n :root{\n /* поменяйте на нужный вам цвет */\n --scrollbar-color: #ff6b6b;\n /* желаемая ширина (по умолчанию ~16px, здесь взято ~8px) */\n --scrollbar-size: 8px;\n }\n \n /* =========================\n WebKit (Chrome, Edge, Safari)\n ========================= */\n ::-webkit-scrollbar {\n width: var(--scrollbar-size);\n height: var(--scrollbar-size);\n }\n \n ::-webkit-scrollbar-track {\n background: transparent; /* прозрачный фон трека */\n border-radius: 999px; /* округлые края трека */\n margin: 2px 0; /* немного отступа, чтобы концы thumb выглядели округлыми */\n }\n \n ::-webkit-scrollbar-thumb {\n background-color: var(--scrollbar-color); /* цвет палки */\n border-radius: 999px; /* полностью округлённый */\n min-height: 24px; /* чтобы маленькие скроллы были удобнее захватывать */\n border: 0; /* без обводки */\n }\n \n /* убрать стрелочки (кнопки) */\n ::-webkit-scrollbar-button {\n display: none;\n width: 0;\n height: 0;\n }\n \n /* =========================\n Firefox\n ========================= */\n * {\n /* 'thin' примерно соответствует ~8px в FF, цвет задаём ниже */\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-color) transparent; /* thumb и track */\n }\n \n #${t} {\n flex-direction: column;\n z-index: 10000000;\n width: ${styles_fixedChat?"100%":"28em"};\n max-width: 100vw;\n word-break: break-word;\n box-sizing: border-box;\n height: ${styles_fixedChat?"100%":"600px"};\n max-height: 100vh;\n ${styles_mainBtnCoords[0]>0?"left":"right"}: 15px;\n bottom: ${styles_fixedChat?0:"6em"};\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n border-radius: ${styles_fixedChat?0:"24px"};\n }\n p, #${t} p {\n margin: 0;\n }\n \n \n @media (max-width: 600px) {\n #${t} {\n // position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: 100%;\n height: ${styles_fixedChat?"100%":"auto"};\n max-height: 100vh;\n border-radius: 0;\n }\n }\n \n @keyframes lsw_typing {\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n }\n \n .clock {\n position: absolute;\n width: 29px;\n height: 16px;\n bottom: -20px;\n font-style: normal;\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n letter-spacing: -0.04em;\n color: #BEBEC2;\n white-space: nowrap\n }\n \n .message-block {\n margin-top: 20px;\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n scroll-behavior: smooth;\n display: flex;\n flex-direction: column;\n justify-content: safe flex-end;\n scrollbar-color: #5385c799 #ffffff00;\n }\n \n \n .me-message > .clock {\n right: 6px;\n }\n \n textarea {\n font-family: Arial;\n font-weight: 500;\n letter-spacing: -0.01em;\n color: #969696;\n }\n \n textarea::placeholder {\n color: #C2CCD9;\n opacity: 1;\n }\n \n .me-message {\n border-radius: .5rem;\n color: white;\n border-bottom-right-radius: 0;\n background-color: #3B82F6;\n box-shadow: 3px 3px 5px 0px #00000021;\n }\n \n .me-message::after {\n content: "";\n position: absolute;\n bottom: 0;\n right: -10px;\n width: 10px;\n height: 14px;\n background: url("data:image/svg+xml;utf8,") no-repeat;\n }\n \n .you-message {\n border-radius: .5rem;\n color: #7A8799;\n border-bottom-left-radius: 0;\n background-color: #E9ECF2;\n box-shadow: -3px 3px 5px 0px #00000021;\n }\n \n .you-message::after {\n content: "";\n position: absolute;\n bottom: 0;\n left: -10px;\n width: 10px;\n height: 14px;\n background: url("data:image/svg+xml;utf8,") no-repeat;\n }\n \n .lsw_chat_dot {\n width: 6px;\n height: 6px;\n background-color: black;\n }\n \n .typing-indicator .lsw_chat_dot {\n animation: lsw_typing 1.4s infinite ease-in-out both;\n }\n \n .typing-indicator .lsw_chat_dot:nth-child(1) {\n animation-delay: -0.32s;\n }\n \n .typing-indicator .dot:nth-child(2) {\n animation-delay: -0.16s;\n }\n \n .typing-indicator .dot:nth-child(3) {\n animation-delay: 0s;\n }\n \n .hidden {\n display: none;\n }\n\n .lsw_waves {\n position: absolute;\n border-radius: 50%;\n background: rgb(26 56 194);\n \n transform: scale(0);\n }\n \n .animate .lsw_waves {\n animation: wave-animation 4s linear infinite;\n }\n \n .lsw_waves:nth-child(1) {\n left: 50%;\n top: 50%;\n width: 150%;\n height: 150%;\n margin-left: -75%;\n margin-top: -75%;\n animation-delay: 0s;\n }\n \n /* Позиционирование второй волны */\n .lsw_waves:nth-child(2) {\n left: 50%;\n top: 50%;\n width: 150%;\n height: 150%;\n margin-left: -75%;\n margin-top: -75%;\n animation-delay: -1s;\n }\n \n /* Позиционирование третьей волны */\n .lsw_waves:nth-child(3) {\n left: 50%;\n top: 50%;\n width: 150%;\n height: 150%;\n margin-left: -75%;\n margin-top: -75%;\n animation-delay: -2s;\n }\n \n @keyframes wave-animation {\n 0% {\n transform: scale(0);\n opacity: 0.5;\n }\n 100% {\n transform: scale(1);\n opacity: 0.0;\n }\n }\n .chat-submit:hover {\n background-color: rgba(0, 0, 0);\n }\n `,e.append(i)}var buttonConstructor=__webpack_require__(742);Reflect.defineProperty(contacts,"name",{value:"default",configurable:!0});const contacts_themeColor="#223c6f";function contacts(e){const t=document.createElement("style");t.innerHTML=`\n .lsw_contact_btn {\n background-color: ${contacts_themeColor};\n border-radius: 9999px; \n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n width: 4em;\n height: 4em;\n position: absolute;\n margin: 0;\n padding: 0;\n transition: transform 0.5s ease;\n }\n \n .lsw_contact_btn > svg {\n width: 2.5em;\n height: 2.5em;\n }\n `,e.append(t)}const{slice,forEach}=[];function defaults(e){return forEach.call(slice.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}function hasXSS(e){if("string"!=typeof e)return!1;return[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(e)))}const fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let i=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!fieldContentRegExp.test(n.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${n.domain}`}if(n.path){if(!fieldContentRegExp.test(n.path))throw new TypeError("option path is invalid");i+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");i+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n.partitioned&&(i+="; Partitioned"),i},cookie={create(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+60*n*1e3)),i&&(s.domain=i),document.cookie=serializeCookie(e,t,s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const i=e.substring(1).split("&");for(let e=0;e0){i[e].substring(0,s)===n&&(t=i[e].substring(s+1))}}}return t}},hash={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:i}=e;if("undefined"!=typeof window){const{hash:e}=window.location;if(e&&e.length>2){const s=e.substring(1);if(n){const e=s.split("&");for(let i=0;i0){e[i].substring(0,s)===n&&(t=e[i].substring(s+1))}}}if(t)return t;if(!t&&i>-1){const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;const n="number"==typeof i?i:0;return t[n]?.replace("/","")}}}return t}};let hasLocalStorageSupport=null;const localStorageAvailable=()=>{if(null!==hasLocalStorageSupport)return hasLocalStorageSupport;try{if(hasLocalStorageSupport="undefined"!=typeof window&&null!==window.localStorage,!hasLocalStorageSupport)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){hasLocalStorageSupport=!1}return hasLocalStorageSupport};var i18nextBrowserLanguageDetector_localStorage={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&localStorageAvailable())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&localStorageAvailable()&&window.localStorage.setItem(n,e)}};let hasSessionStorageSupport=null;const sessionStorageAvailable=()=>{if(null!==hasSessionStorageSupport)return hasSessionStorageSupport;try{if(hasSessionStorageSupport="undefined"!=typeof window&&null!==window.sessionStorage,!hasSessionStorageSupport)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){hasSessionStorageSupport=!1}return hasSessionStorageSupport};var sessionStorage={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&sessionStorageAvailable())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&sessionStorageAvailable()&&window.sessionStorage.setItem(n,e)}},navigator$1={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:i}=navigator;if(e)for(let n=0;n0?t:void 0}},htmlTag={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const i=n||("undefined"!=typeof document?document.documentElement:null);return i&&"function"==typeof i.getAttribute&&(t=i.getAttribute("lang")),t}},path={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const i="number"==typeof t?t:0;return n[i]?.replace("/","")}},subdomain={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,i="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[n]}};let canCookies=!1;try{document.cookie,canCookies=!0}catch(e){}const order=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];canCookies||order.splice(1,1);const getDefaults=()=>({order,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Browser{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=defaults(t,this.options||{},getDefaults()),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(i18nextBrowserLanguageDetector_localStorage),this.addDetector(sessionStorage),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path),this.addDetector(subdomain),this.addDetector(hash)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.filter((e=>null!=e&&!hasXSS(e))).map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}Browser.type="languageDetector";const attentionDiv={value:null};function envSet(e){return Boolean(e)}instance.use(Browser).init({resources:{en:{translation:{phone:"Phone",callAsk:"Let us call you back and explain everything",thanks:"Thank you!",waitCall:"Awaiting call!",workTechs:"Powered by technologies",haveQues:"Do you have any questions?",supportChat:"AI Agent",send:"Send",inputMessage:"Enter a message...",callMe:"Call me",support:"Support",online:"On-line",createdAt:"Powered by ls-ai.ru",askNames:"Please introduce yourself",yourName:"Your name",policyText:"I agree with the website's Privacy Policy",clientPolicyText:"I agree with the Client Data Processing Policy"}},ru:{translation:{phone:"Телефон",callAsk:"Давайте мы перезвоним вам и все расскажем",thanks:"Благодарим!",waitCall:"Ожидайте звонка!",workTechs:"Работает на технологиях",haveQues:"У вас есть вопросы?",supportChat:"ИИ агент",online:"В сети",send:"Отправить",inputMessage:"Введите сообщение...",callMe:"Жду звонка",support:"Поддержка",createdAt:"При поддержке ls-ai.ru",askNames:"Представьтесь, пожалуйста",yourName:"Ваше имя",askEmailOrPhone:"Укажите email или телефон",sending:"Отправка...",policyText:"Согласен с Политикой обработки данных",clientPolicyText:"Согласен с Политикой обработки клиентских данных"}},ee:{translation:{telefon:"Telefon",callAsk:"Lubame teile tagasi helistada ja kõik selgeks rääkida",thanks:"Täname!",waitCall:"Oodake kõnet!",workTechs:"Töötab tehnoloogiatel",haveQues:"Kas teil on küsimusi?",supportChat:"Tehisintellekti agent",send:"Saada",inputMessage:"Sisestage sõnum...",callMe:"Helista mulle",support:"Tugi",online:"Veebis",createdAt:"Toetab ls-ai.ru",askNames:"Palun tutvustage ennast",yourName:"Teie nimi",policyText:"Nõustun andmetöötluspoliitikaga",clientPolicyText:"Nõustun kliendiandmete töötlemise poliitikaga"}},es:{translation:{phone:"Teléfono",callAsk:"Déjenos llamarle y explicarle todo",thanks:"¡Gracias!",waitCall:"¡Espere la llamada!",workTechs:"Funciona con tecnologías",haveQues:"¿Tiene preguntas?",supportChat:"Agente IA",online:"En línea",send:"Enviar",inputMessage:"Escriba un mensaje...",callMe:"Espero la llamada",support:"Soporte",createdAt:"Con el apoyo de ls-ai.ru",askNames:"Preséntese, por favor",yourName:"Su nombre",policyText:"Acepto la Política de tratamiento de datos",clientPolicyText:"Acepto la Política de Tratamiento de Datos de Clientes"}},de:{translation:{phone:"Telefon",callAsk:"Lassen Sie uns Sie zurückrufen und alles erklären",thanks:"Vielen Dank!",waitCall:"Bitte warten Sie auf den Anruf!",workTechs:"Arbeitet mit Technologien",haveQues:"Haben Sie Fragen?",supportChat:"KI-Agent",online:"Online",send:"Senden",inputMessage:"Nachricht eingeben...",callMe:"Ich warte auf den Anruf",support:"Support",createdAt:"Mit Unterstützung von ls-ai.ru",askNames:"Bitte stellen Sie sich vor",yourName:"Ihr Name",policyText:"Ich stimme der Datenverarbeitungspolitik zu",clientPolicyText:"Ich stimme der Richtlinie zur Verarbeitung von Kundendaten zu"}},fr:{translation:{phone:"Téléphone",callAsk:"Laissez-nous vous rappeler et tout vous expliquer",thanks:"Merci beaucoup !",waitCall:"Attendez l'appel !",workTechs:"Fonctionne avec des technologies",haveQues:"Vous avez des questions ?",supportChat:"Agent IA",online:"En ligne",send:"Envoyer",inputMessage:"Entrez un message...",callMe:"J’attends l’appel",support:"Support",createdAt:"Avec le soutien de ls-ai.ru",askNames:"Veuillez vous présenter",yourName:"Votre nom",policyText:"J'accepte la politique de traitement des données",clientPolicyText:"J'accepte la Politique de Traitement des Données Clients"}}},detection:{convertDetectedLanguage:e=>/ru/i.test(e)?"ru":/ee|et/i.test(e)?"ee":/es/i.test(e)?"es":/de/i.test(e)?"de":/fr/i.test(e)?"fr":"en"}}),initWidgetWebSocket(),bootstrapWidgetSocketIntegration(),createNotifyBox();const contactsBlockDisabled=envSet(void 0),main_chatDisabled=envSet(void 0);let chatWidgetContainer,left,contactButtons=[];if(!contactsBlockDisabled)try{const e=JSON.parse('[{"type":"vk","link":"https://vk.com/launchstrategies"},{"type":"whatsapp","link":"https://wa.me/79278886692?text=Здравствуйте!"},{"type":"site","link":"https://launchstrategies.ru"},{"type":"phone","link":"tel:+79278886692"},{"type":"telegram","link":"https://t.me/Launchstrategies_ru"}]');e.length&&contactButtons.push(...(0,buttonConstructor.A)(e))}catch(e){console.error("error add buttons",e)}const mountWidget=!main_chatDisabled||contactButtons.length>0;if(mountWidget){let e=widget(contactButtons,attentionDiv);chatWidgetContainer=e[0],styles(chatWidgetContainer),contacts(chatWidgetContainer),left=e[1]}leadCatcher(),chatWidgetContainer&&(attentionDiv.value=attention(chatWidgetContainer,left))})();