(()=>{"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function n(e){t=e}var s={exec:()=>null};function i(e,t=""){let n="string"==typeof e?e:e.source,s={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(o.caret,"$1"),n=n.replace(e,i),s},getRegex:()=>new RegExp(n,t)};return s}var r=(()=>{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)}}>`)},a=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,c=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,p=i(c).replace(/bull/g,l).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(),d=i(c).replace(/bull/g,l).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(),h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,u=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,g=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",u).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f=i(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,l).getRegex(),m="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",b=/|$))/,x=i("^ {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",b).replace("tag",m).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y=i(h).replace("hr",a).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",m).getRegex(),w={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",y).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:g,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:a,html:x,lheading:p,list:f,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:y,table:s,text:/^[^\n]+/},k=i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",a).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",m).getRegex(),A={...w,lheading:d,table:k,paragraph:i(h).replace("hr",a).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k).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",m).getRegex()},v={...w,html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",b).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:s,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:i(h).replace("hr",a).replace("heading"," *#{1,6} *[^\n]").replace("lheading",p).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,C=/[\p{P}\p{S}]/u,L=/[\s\p{P}\p{S}]/u,E=/[^\s\p{P}\p{S}]/u,R=i(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,L).getRegex(),T=/(?!~)[\p{P}\p{S}]/u,$=i(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",r?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),N=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,P=i(N,"u").replace(/punct/g,C).getRegex(),O=i(N,"u").replace(/punct/g,T).getRegex(),_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I=i(_,"gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,L).replace(/punct/g,C).getRegex(),j=i(_,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,T).getRegex(),z=i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,L).replace(/punct/g,C).getRegex(),D=i(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,C).getRegex(),B=i("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,L).replace(/punct/g,C).getRegex(),M=i(/\\(punct)/,"gu").replace(/punct/g,C).getRegex(),H=i(/^<(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(),F=i(b).replace("(?:--\x3e|$)","--\x3e").getRegex(),q=i("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",F).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,U=i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),W=i(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",u).getRegex(),Q=i(/^!?\[(ref)\](?:\[\])?/).replace("ref",u).getRegex(),K=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Z={_backpedal:s,anyPunctuation:M,autolink:H,blockSkip:$,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:s,delLDelim:s,delRDelim:s,emStrongLDelim:P,emStrongRDelimAst:I,emStrongRDelimUnd:z,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:U,nolink:Q,punctuation:R,reflink:W,reflinkSearch:i("reflink|nolink(?!\\()","g").replace("reflink",W).replace("nolink",Q).getRegex(),tag:q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},ne=e=>te[e];function se(e,t){if(t){if(o.escapeTest.test(e))return e.replace(o.escapeReplace,ne)}else if(o.escapeTestNoEncode.test(e))return e.replace(o.escapeReplaceNoEncode,ne);return e}function ie(e){try{e=encodeURI(e).replace(o.percentDecode,"%")}catch{return null}return e}function re(e,t){let n=e.replace(o.findPipe,((e,t,n)=>{let s=!1,i=t;for(;--i>=0&&"\\"===n[i];)s=!s;return s?"|":" |"})).split(o.splitPipe),s=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 le(e,t=0){let n=t,s="";for(let t of e)if("\t"===t){let e=4-n%4;s+=" ".repeat(e),n+=e}else s+=t,n++;return s}function ce(e,t,n,s,i){let r=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:r,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}var pe=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]:ae(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=function(e,t,n){let s=e.match(n.other.indentCodeCompensation);if(null===s)return t;let i=s[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[s]=t;return s.length>=i.length?e.slice(i.length):e})).join("\n")}(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=oe(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:oe(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:oe(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=oe(t[0],"\n").split("\n"),n="",s="",i=[];for(;e.length>0;){let t,r=!1,o=[];for(t=0;t1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,s="",a="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let l=le(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)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),r=this.rules.other.headingBeginRegex(d),o=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," "),i.test(c)||r.test(c)||o.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||i.test(l)||r.test(l)||n.test(l))break;a+="\n"+c}p=!c.trim(),s+=g+"\n",e=e.substring(g.length+1),l=u.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(s)&&(o=!0)),i.items.push({type:"list_item",raw:s,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]}),i.raw+=s}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e of i.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,i.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(!i.loose){let t=e.tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ae(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"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:oe(t[0],"\n"),href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=re(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],r={type:"table",raw:oe(t[0],"\n"),header:[],align:[],rows:[]};if(n.length===s.length){for(let e of s)this.rules.other.tableAlignRight.test(e)?r.align.push("right"):this.rules.other.tableAlignCenter.test(e)?r.align.push("center"):this.rules.other.tableAlignLeft.test(e)?r.align.push("left"):r.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:r.align[t]}))));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:oe(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=oe(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s0?-2:-1}(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],s="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],s=e[3])}else s=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)),ce(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.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 ce(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(s&&(s[1]||s[2]||s[3]||s[4])&&(!s[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!s[1]&&!s[3]||!n||this.rules.inline.punctuation.exec(n))){let n,i,r=[...s[0]].length-1,o=r,a=0,l="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!==(s=l.exec(t));){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(i=[...n].length,s[3]||s[4]){o+=i;continue}if((s[5]||s[6])&&r%3&&!((r+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...s[0]][0].length,l=e.slice(0,r+s.index+t+i);if(Math.min(r,i)%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),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&s&&(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 s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let n,i,r=[...s[0]].length-1,o=r,a=this.rules.inline.delRDelim;for(a.lastIndex=0,t=t.slice(-1*e.length+r);null!==(s=a.exec(t));){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(i=[...n].length,i!==r))continue;if(s[3]||s[4]){o+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o);let t=[...s[0]][0].length,a=e.slice(0,r+s.index+t+i),l=a.slice(r,-r);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 s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(s!==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}}}},de=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 pe,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 n={other:o,block:Y.normal,inline:ee.normal};this.options.pedantic?(n.block=Y.pedantic,n.inline=ee.pedantic):this.options.gfm&&(n.block=Y.gfm,this.options.breaks?n.inline=ee.breaks:n.inline=ee.gfm),this.tokenizer.rules=n}static get rules(){return{block:Y,inline:ee}}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(o.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let n=t.at(-1);1===s.raw.length&&void 0!==n?n.raw+="\n":t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+s.raw,n.text+="\n"+s.text,this.inlineQueue.at(-1).src=n.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+s.raw,n.text+="\n"+s.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,s=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},s),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+s.raw,r.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s),n=i.length!==e.length,e=e.substring(s.raw.length)}else if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+s.raw,n.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(s)}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,s=e,i=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(i=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(i=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(i=this.tokenizer.rules.inline.blockSkip.exec(s));)n=i[2]?i[2].length:0,s=s.slice(0,i.index+n)+"["+"a".repeat(i[0].length-n-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,o="";for(;e;){let n;if(r||(o=""),r=!1,this.options.extensions?.inline?.some((s=>!!(n=s.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 s=t.at(-1);"text"===n.type&&"text"===s?.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,o)){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,s,o)){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 i=e;if(this.options.extensions?.startInline){let t,n=1/0,s=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},s),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),r=!0;let s=t.at(-1);"text"===s?.type?(s.raw+=n.raw,s.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}},he=class{options;parser;constructor(e){this.options=e||t}space(e){return""}code({text:e,lang:t,escaped:n}){let s=(t||"").match(o.notSpaceStart)?.[0],i=e.replace(o.endingNewline,"")+"\n";return s?'
'+(n?i:se(i,!0))+"
\n":"
"+(n?i:se(i,!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,s="";for(let t=0;t\n"+s+"\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${s}`),"\n\n"+t+"\n"+s+"
    \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`${se(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),i=ie(e);if(null===i)return s;let r='
    ",r}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=ie(e);if(null===i)return se(n);let r=`${se(n)}{let i=e[s].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new he(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let s=n,i=e.renderer[s],r=t[s];t[s]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new pe(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let s=n,i=e.tokenizer[s],r=t[s];t[s]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fe;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let s=n,i=e.hooks[s],r=t[s];fe.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return r.call(t,n)})();let s=i.call(t,e);return r.call(t,s)}:t[s]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await r.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return de.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===s.async)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return r(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,s=await(i.hooks?await i.hooks.provideLexer(e):e?de.lex:de.lexInline)(n,i),r=i.hooks?await i.hooks.processAllTokens(s):s;i.walkTokens&&await Promise.all(this.walkTokens(r,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ge.parse:ge.parseInline)(r,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(r);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?de.lex:de.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let s=(i.hooks?i.hooks.provideParser(e):e?ge.parse:ge.parseInline)(n,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(e){return r(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="

    An error occurred:

    "+se(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function be(e,t){return me.parse(e,t)}be.options=be.setOptions=function(e){return me.setOptions(e),be.defaults=me.defaults,n(be.defaults),be},be.getDefaults=e,be.defaults=t,be.use=function(...e){return me.use(...e),be.defaults=me.defaults,n(be.defaults),be},be.walkTokens=function(e,t){return me.walkTokens(e,t)},be.parseInline=me.parseInline,be.Parser=ge,be.parser=ge.parse,be.Renderer=he,be.TextRenderer=ue,be.Lexer=de,be.lexer=de.lex,be.Tokenizer=pe,be.Hooks=fe,be.parse=be;be.options,be.setOptions,be.use,be.walkTokens,be.parseInline,ge.parse,de.lex;const xe="https://api.ls-ai.ru";let ye=null,we=null,ke=3e3;const Ae=[],ve=new Set,Se=new Set;function Ce(e){return ve.add(e),()=>ve.delete(e)}function Le(e){we&&(clearTimeout(we),we=null),we=setTimeout((()=>{we=null,Ee()}),e)}function Ee(){if(ye&&(ye.readyState===WebSocket.CONNECTING||ye.readyState===WebSocket.OPEN))return;const e=`${xe.replace(/^http:/i,"ws:").replace(/^https:/i,"wss:").replace(/\/$/,"")}/ws/widget?api_key=${encodeURIComponent("sk-7310279610ea83158fbf086de07ac9cf8c7aa27c1626822e4b70d2f4f13dd83e")}`;try{ye=new WebSocket(e)}catch(e){return console.error("WidgetWebSocket: failed to create",e),void Le(ke)}ye.onopen=()=>{ke=3e3,function(){if(ye&&ye.readyState===WebSocket.OPEN)for(;Ae.length;){const e=Ae.shift();if(e)try{ye.send(e)}catch{Ae.unshift(e);break}}}(),function(){for(const e of Se)try{e()}catch(e){console.error("WidgetWs onOpen handler error",e)}}()},ye.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}"system"!==t.domain||"ping"!==t.type?function(e){for(const t of ve)try{t(e)}catch(e){console.error("WidgetWs listener error",e)}}(t):Re("system","pong",{})},ye.onerror=()=>{},ye.onclose=e=>{ye=null,4001===e.code?(ke=Math.min(2*ke,12e4),Le(Math.max(ke,6e4))):Le(ke)}}function Re(e,t,n){const s=JSON.stringify({v:1,domain:e,type:t,payload:n??{},ts:(new Date).toISOString()});if(ye?.readyState===WebSocket.OPEN)try{ye.send(s)}catch{Ae.push(s)}else Ae.push(s)}function Te(e,t,n,s=25e3){const i=()=>new Promise(((i,r)=>{let o=!1,a=null;const l=setTimeout((()=>{o||(o=!0,a?.(),r(new Error("Widget WS timeout")))}),s);a=Ce((e=>{if("widget"===e.domain){if(e.type===n){if(o)return;return o=!0,clearTimeout(l),a?.(),void i()}if("error"===e.type){if(o)return;o=!0,clearTimeout(l),a?.(),r(new Error(String(e.payload?.message??"error")))}}})),Re("widget",e,t)})),r=Ne.then((()=>i()),(()=>i()));return Ne=r.catch((()=>{})),r}function $e(e,t,n,s=25e3){const i=()=>new Promise(((i,r)=>{let o=!1,a=null;const l=setTimeout((()=>{o||(o=!0,a?.(),r(new Error("Widget WS timeout")))}),s);a=Ce((e=>{if("widget"===e.domain){if(e.type===n){if(o)return;return o=!0,clearTimeout(l),a?.(),void i(e.payload??{})}if("error"===e.type){if(o)return;o=!0,clearTimeout(l),a?.(),r(new Error(String(e.payload?.message??"error")))}}})),Re("widget",e,t)})),r=Ne.then((()=>i()),(()=>i()));return Ne=r.catch((()=>{})),r}let Ne=Promise.resolve();function Pe(e){const t={};if(null==e)return t;if("string"==typeof e)return t.payload=e,t;for(const[n,s]of Object.entries(e))t[n]="string"==typeof s?s:JSON.stringify(s);return t}const Oe=e=>"string"==typeof e,_e=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},Ie=e=>null==e?"":String(e),je=/###/g,ze=e=>e&&e.includes("###")?e.replace(je,"."):e,De=e=>!e||Oe(e),Be=(e,t,n)=>{const s=Oe(t)?t.split("."):t;let i=0;for(;i{const{obj:s,k:i}=Be(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let r=t[t.length-1],o=t.slice(0,t.length-1),a=Be(e,o,Object);for(;void 0===a.obj&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=Be(e,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=n},He=(e,t)=>{const{obj:n,k:s}=Be(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},Fe=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?Oe(e[s])||e[s]instanceof String||Oe(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):Fe(e[s],t[s],n):e[s]=t[s]);return e},qe=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Ve={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Ue=e=>Oe(e)?e.replace(/[&<>"'\/]/g,(e=>Ve[e])):e;const We=[" ",",","?","!",";"],Qe=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ke=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;ee?.replace(/_/g,"-"),Je={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Ge{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Je,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(Oe(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ge(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ge(this.logger,e)}}var Xe=new Ge;class Ye{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){const n=(...s)=>{t(...s),this.off(e,n)};return this.on(e,n),this}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,n])=>{for(let s=0;s{for(let i=0;i-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,r=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Oe(n)&&i?o.push(...n.split(i)):o.push(n)));const a=He(this.data,o);return a||t||n||!e.includes(".")||(e=o[0],t=o[1],n=o.slice(2).join(".")),!a&&r&&Oe(n)?Ke(this.data?.[e]?.[t],n,i):a}addResource(e,t,n,s,i={silent:!1}){const r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(r?n.split(r):n)),e.includes(".")&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Me(this.data,o,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const s in n)(Oe(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i,r={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let a=He(this.data,o)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Fe(a,n,i):a={...a,...n},Me(this.data,o,a),r.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var tt={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const nt=Symbol("i18next/PATH_KEY");function st(e,t){const{[nt]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(s,i)=>(n?.revoke?.(),i===nt?e:(e.push(i),n=Proxy.revocable(s,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),s=t?.keySeparator??".",i=t?.nsSeparator??":";if(n.length>1&&i){const e=t?.ns,r=Array.isArray(e)?e:null;if(r&&r.length>1&&r.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(s)}`}return n.join(s)}const it=e=>!Oe(e)&&"boolean"!=typeof e&&"number"!=typeof e;class rt extends Ye{constructor(e,t={}){super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Xe.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const s=this.resolve(e,n);if(void 0===s?.res)return!1;const i=it(s.res);return!1!==n.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const r=n&&e.includes(n),o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=We.filter((e=>!t.includes(e)&&!n.includes(e)));if(0===s.length)return!0;const i=Qe.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let r=!i.test(e);if(!r){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(r=!0)}return r})(e,n,s));if(r&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Oe(i)?[i]:i};const r=e.split(n);(n!==s||n===s&&this.options.ns.includes(r[0]))&&(i=r.shift()),e=r.join(s)}return{key:e,namespaces:Oe(i)?[i]:i}}translate(e,t,n){let s="object"==typeof t?{...t}:t;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==e)return"";"function"==typeof e&&(e=st(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]),e=e.map((e=>"function"==typeof e?st(e,{...this.options,...s}):String(e)));const i=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],s),l=a[a.length-1];let c=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return d?i?{res:`${l}${c}${o}`,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${c}${o}`:i?{res:o,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let u=h?.res;const g=h?.usedKey||o,f=h?.exactUsedKey||o,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==s.count&&!Oe(s.count),y=rt.hasDefaultValue(s),w=x?this.pluralResolver.getSuffix(p,s.count,s):"",k=s.ordinal&&x?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",A=x&&!s.ordinal&&0===s.count,v=A&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${w}`]||s[`defaultValue${k}`]||s.defaultValue;let S=u;b&&!u&&y&&(S=v);const C=it(S),L=Object.prototype.toString.apply(S);if(!(b&&S&&C)||["[object Number]","[object Function]","[object RegExp]"].includes(L)||Oe(m)&&Array.isArray(S))if(b&&Oe(m)&&Array.isArray(u))u=u.join(m),u&&(u=this.extendTranslation(u,e,s,n));else{let t=!1,i=!1;!this.isValidLookup(u)&&y&&(t=!0,u=v),this.isValidLookup(u)||(i=!0,u=o);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:u,d=y&&v!==u&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",p,l,o,d?v:u),r){const e=this.resolve(o,{...s,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n{const i=y&&n!==u?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,s),this.emit("missingKey",e,l,t,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,s);A&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],o+t,s[`defaultValue${t}`]||v)}))})):n(e,o,v))}u=this.extendTranslation(u,e,s,h,n),i&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${l}${c}${o}`),(i||t)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${o}`:o,t?u:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,S,{...s,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(s),h):e}if(r){const e=Array.isArray(S),t=e?[]:{},n=e?f:g;for(const e in S)if(Object.prototype.hasOwnProperty.call(S,e)){const i=`${n}${r}${e}`;t[e]=y&&!u?this.translate(i,{...s,defaultValue:it(v)?v[e]:void 0,joinArrays:!1,ns:a}):this.translate(i,{...s,joinArrays:!1,ns:a}),t[e]===i&&(t[e]=S[e])}u=t}}return i?(h.res=u,h.usedParams=this.getUsedParamsDetails(s),h):u}extendTranslation(e,t,n,s,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=Oe(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(r){const t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let a=n.replace&&!Oe(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||s.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,o=Oe(r)?[r]:r;return null!=e&&o?.length&&!1!==n.applyPostProcessor&&(e=tt.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,i,r,o;return Oe(e)&&(e=[e]),Array.isArray(e)&&(e=e.map((e=>"function"==typeof e?st(e,{...this.options,...t}):e))),e.forEach((e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;s=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==t.count&&!Oe(t.count),d=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Oe(t.context)||"number"==typeof t.context)&&""!==t.context,u=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach((e=>{this.isValidLookup(n)||(o=e,this.checkedLoadedFor[`${u[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(this.checkedLoadedFor[`${u[0]}-${e}`]=!0,this.logger.warn(`key "${s}" for languages "${u.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((s=>{if(this.isValidLookup(n))return;r=s;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&e.startsWith(i)&&o.push(l+e.replace(i,this.options.pluralSeparator)),o.push(l+e),d&&o.push(l+n)),h){const s=`${l}${this.options.contextSeparator||"_"}${t.context}`;o.push(s),p&&(t.ordinal&&e.startsWith(i)&&o.push(s+e.replace(i,this.options.pluralSeparator)),o.push(s+e),d&&o.push(s+n))}}let a;for(;a=o.pop();)this.isValidLookup(n)||(i=a,n=this.getResource(s,e,a,t))})))}))})),{res:n,usedKey:s,exactUsedKey:i,usedLng:r,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Oe(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class ot{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xe.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ze(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Ze(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Oe(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const s=this.getLanguagePartFromCode(e);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find((e=>e===s||!(!e.includes("-")&&!s.includes("-"))&&(!(!e.includes("-")||s.includes("-")||e.slice(0,e.indexOf("-"))!==s)||!!(e.startsWith(s)&&s.length>1))))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Oe(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Oe(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):Oe(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.includes(e)||i(this.formatLanguageCode(e))})),s}}const at={zero:0,one:1,two:2,few:3,many:4,other:5},lt={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ct{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Xe.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ze("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let r;try{r=new Intl.PluralRules(n,{type:s})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),lt;if(!e.match(/-|_/))return lt;const s=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(s,t)}return this.pluralRulesCache[i]=r,r}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>at[e]-at[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const pt=(e,t,n,s=".",i=!0)=>{let r=((e,t,n)=>{const s=He(e,n);return void 0!==s?s:He(t,n)})(e,t,n);return!r&&i&&Oe(n)&&(r=Ke(e,n,s),void 0===r&&(r=Ke(t,n,s))),r},dt=e=>e.replace(/\$/g,"$$$$");class ht{constructor(e={}){this.logger=Xe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:r,suffix:o,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:p,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:u,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:Ue,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?qe(i):r||"{{",this.suffix=o?qe(o):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?qe(d):h||qe("$t("),this.nestingSuffix=u?qe(u):g||qe(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,r,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const i=pt(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),r=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(pt(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...s,...t,interpolationkey:r})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>dt(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?dt(this.escape(e)):dt(e)}].forEach((t=>{for(o=0;i=t.regex.exec(e);){const n=i[1].trim();if(r=l(n),void 0===r)if("function"==typeof c){const t=c(e,i,s);r=Oe(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))r="";else{if(p){r=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),r=""}else Oe(r)||this.useRawValueToEscape||(r=Ie(r));const a=t.safeValue(r);if(e=e.replace(i[0],a),p?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t,n={}){let s,i,r;const o=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const s=e.split(new RegExp(`${qe(n)}[ ]*{`));let i=`{${s[1]}`;e=s[0],i=this.interpolate(i,r);const o=i.match(/'/g),a=i.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(i=i.replace(/'/g,'"'));try{r=JSON.parse(i),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return r.defaultValue&&r.defaultValue.includes(this.prefix)&&delete r.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let a=[];r={...n},r=r.replace&&!Oe(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const l=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==l&&(a=s[1].slice(l).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),s[1]=s[1].slice(0,l)),i=t(o.call(this,s[1].trim(),r),r),i&&s[0]===e&&!Oe(i))return i;Oe(i)||(i=Ie(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),a.length&&(i=a.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:s[1].trim()})),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const ut=e=>{const t={};return(n,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=t[o];return a||(a=e(Ze(s),i),t[o]=a),a(n)}},gt=e=>(t,n,s)=>e(Ze(n),s)(t);class ft{constructor(e={}){this.logger=Xe.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ut:gt;this.formats={number:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:n(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:n(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:n(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ut(t)}format(e,t,n,s={}){if(!t)return e;if(null==e)return e;const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&!i[0].includes(")")&&i.find((e=>e.includes(")")))){const e=i.findIndex((e=>e.includes(")")));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:r}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].slice(0,-1);"currency"!==t||i.includes(":")?"relativetime"!==t||i.includes(":")?i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();n[r]||(n[r]=i),"false"===i&&(n[r]=!1),"true"===i&&(n[r]=!0),isNaN(i)||(n[r]=parseInt(i,10))}})):n.range||(n.range=i.trim()):n.currency||(n.currency=i.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const o=s?.formatParams?.[s.interpolationkey]||{},a=o.locale||o.lng||s.locale||s.lng||n;t=this.formats[i](e,a,{...r,...s,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class mt extends Ye{constructor(e,t,n,s={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=Xe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},r={},o={},a={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,s=!1,void 0===r[o]&&(r[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===a[t]&&(a[t]=!0)))})),s||(o[e]=!0)})),(Object.keys(i).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const s=e.split("|"),i=s[0],r=s[1];t&&this.emit("failedLoading",i,r,t),!t&&n&&this.store.addResourceBundle(i,r,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=Be(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],r),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,s=0,i=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:r});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&a&&s{this.read(e,t,n,s+1,2*i,r)}),i):r(o,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,o);try{const n=a(e,t);n&&"function"==typeof n.then?n.then((e=>o(null,e))).catch(o):o(null,n)}catch(e){o(e)}}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Oe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Oe(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,r)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&r&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,r),this.loaded(e,n,r)}))}saveMissing(e,t,n,s,i,r={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const a={...r,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,a):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>o(null,e))).catch(o):o(null,i)}catch(e){o(e)}else l(e,t,n,s,o,a)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const bt=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Oe(e[1])&&(t.defaultValue=e[1]),Oe(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),xt=e=>(Oe(e.ns)&&(e.ns=[e.ns]),Oe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Oe(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),yt=()=>{};class wt extends Ye{constructor(e={},t){var n;if(super(),this.options=xt(e),this.services={},this.logger=Xe,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Oe(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=bt();this.options={...n,...this.options,...xt(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const s=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Xe.init(s(this.modules.logger),this.options):Xe.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ft;const t=new ot(this.options);this.store=new et(this.options.resources,this.options);const n=this.services;n.logger=Xe,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new ct(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=s(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new ht(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new mt(s(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(n.languageDetector=s(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=s(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new rt(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=yt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const i=_e(),r=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),i}loadResources(e,t=yt){let n=t;const s=Oe(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&(e.includes(t)||e.push(t))}))};if(s)t(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,n){const s=_e();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=yt),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&tt.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,r)=>{r?this.isLanguageChangingTo===e&&(s(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(i,((...e)=>this.t(...e)))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Oe(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Oe(t)?[t]:t);r&&(this.language||s(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,(e=>{i(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const s=(e,t,...i)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},r.lng=r.lng||s.lng,r.lngs=r.lngs||s.lngs,r.ns=r.ns||s.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||s.keyPrefix);const o={...this.options,...r};"function"==typeof r.keyPrefix&&(r.keyPrefix=st(r.keyPrefix,o));const a=this.options.keySeparator||".";let l;return r.keyPrefix&&Array.isArray(e)?l=e.map((e=>("function"==typeof e&&(e=st(e,o)),`${r.keyPrefix}${a}${e}`))):("function"==typeof e&&(e=st(e,o)),l=r.keyPrefix?`${r.keyPrefix}${a}${e}`:e),this.t(l,r)};return Oe(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const r=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,r);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(n,e)||s&&!r(i,e)))}loadNamespaces(e,t){const n=_e();return this.options.ns?(Oe(e)&&(e=[e]),e.forEach((e=>{this.options.ns.includes(e)||this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=_e();Oe(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>!s.includes(e)&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new ot(bt());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new wt(e,t);return n.createInstance=wt.createInstance,n}cloneInstance(e={},t=yt){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new wt(s);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),e[t]),e)),{});i.store=new et(e,s),i.services.resourceStore=i.store}if(e.interpolation){const t={...bt().interpolation,...this.options.interpolation,...e.interpolation},n={...s,interpolation:t};i.services.interpolator=new ht(n)}return i.translator=new rt(i.services,s),i.translator.on("*",((e,...t)=>{i.emit(e,...t)})),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const kt=wt.createInstance(),At=(kt.createInstance,kt.dir,kt.init,kt.loadResources,kt.reloadResources,kt.use,kt.changeLanguage,kt.getFixedT,kt.t);kt.exists,kt.setDefaultNamespace,kt.hasLoadedNamespace,kt.loadNamespaces,kt.loadLanguages;let vt;const St=class{author;constructor(e="Support"){this.author=e}newMessageNotify(e){const t=document.createElement("div");t.style.fontFamily='"Helvetica Neue",Arial,Helvetica,sans-serif',t.style.position="absolute",t.style.display="flex",t.style.width="300px",t.style.height="6rem",t.style.overflow="hidden",t.style.backgroundColor="white",t.style.boxShadow="0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",t.style.maxWidth="24rem",t.style.borderRadius="0.75rem",t.style.bottom="19px",t.style.right="0";const n=document.createElement("div");n.style.marginLeft="0.625rem",n.style.marginRight="0.625rem",n.style.overflow="hidden",n.style.width="100%",n.style.cursor="pointer",n.addEventListener("click",(()=>{ln(),vt&&vt.removeChild(t)}));const s=document.createElement("p");s.textContent=At("support"),s.style.marginTop="0.375rem",s.style.fontSize="1rem",s.style.fontWeight="bold",s.style.color="peru",s.style.lineHeight="2rem",s.style.marginRight="0.75rem",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.style.whiteSpace="nowrap",s.style.marginBottom="0";const i=document.createElement("p");i.innerHTML=e,i.style.overflow="hidden",i.style.lineHeight="1.25rem",i.style.wordBreak="break-word",i.style.color="#7f7f7f",i.style.maxHeight="2.5rem",i.style.fontSize="small",i.style.marginTop="0";const r=document.createElement("button");r.style.width="4rem",r.style.cursor="pointer",r.style.outline="none",r.style.border="none",r.style.background="none";const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke","rgba(31,41,55)"),o.setAttribute("fill","none"),o.style.width="1.75rem",o.style.height="1.75rem";const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","M6 18L18 6M6 6l12 12"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-linecap","round"),o.appendChild(a),r.appendChild(o),n.appendChild(s),n.appendChild(i),t.appendChild(n),t.appendChild(r);const l=document.querySelector("#lsw_chat_popup");vt&&l&&"none"==l.style.display&&(vt.appendChild(t),setTimeout((()=>{vt&&vt.removeChild(t)}),5e3)),r.addEventListener("click",(()=>{vt&&vt.removeChild(t)}))}};let Ct=!1,Lt=!1;function Et(){Lt||(Lt=!0,Ce((e=>{if("widget"===e.domain){if("operator_message"===e.type){const t=e.payload?.threadId,n=localStorage.getItem("aiwi_thread_id");if(t&&n&&t!==n)return;Ct=!0;const s=String(e.payload?.text??"");return Nt.newMessageNotify(s),void It(s)}if("operator_disconnected"!==e.type){if("admin_presence"===e.type){const t=Boolean(e.payload?.online);window.dispatchEvent(new CustomEvent("lsw-widget-admin-presence",{detail:{online:t}}))}}else Ct=!1}})))}let Rt=null;function Tt(e){if(null==e||"object"!=typeof e)return"";if(!("data"in e))return"";const t=e.data;return"string"==typeof t?t:null!=t?String(t):""}class $t{_lsAiWsStream=!0;closed=!1;removeGlobal=null;listeners=new Map;constructor(){Rt&&Rt.close(),Rt=this,this.removeGlobal=Ce((e=>{if(this.closed||Rt!==this)return;if("widget"!==e.domain)return;if("ai_stream_end"===e.type)return Rt===this&&(Rt=null),this.closed=!0,this.removeGlobal?.(),this.removeGlobal=null,void this.listeners.clear();if("ai_stream"!==e.type)return;const t=String(e.payload?.event??""),n=e.payload.data,s={data:null==n?"":"string"==typeof n?n:JSON.stringify(n)};for(const e of this.listeners.get(t)??[])try{e(s)}catch(e){console.error(e)}}))}addEventListener(e,t){if(!t||"function"!=typeof t)return;const n=this.listeners.get(e)??[];n.push(t),this.listeners.set(e,n)}close(){this.closed||(this.closed=!0,Rt===this&&(Rt=null),this.removeGlobal?.(),this.removeGlobal=null,this.listeners.clear())}}let Nt=new St;const Pt=new class{report(e){let t={};if("string"==typeof e.headers)try{t=JSON.parse(e.headers)}catch{t={}}else e.headers&&"object"==typeof e.headers&&(t=e.headers);Te("bug_report",{url:String(e.url??""),headers:t,body:Pe(e.body),error:void 0!==e.error&&null!==e.error?"string"==typeof e.error?e.error:JSON.stringify(e.error):""},"bug_report_ok",15e3).catch((()=>{}))}},Ot=document.createElement("div");function _t(e,t="",n){let s="";if("object"==typeof t){if(t.date){let e=new Date(t.date);s=`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}t=t.text||""}const i=document.createElement("div");i.style.position="relative",i.style.marginBottom="2em",i.className="flex";const r=document.createElement("div");r.style.position="relative",r.style.paddingRight="3em",r.classList.add("py-2","px-4","max-w-[70%]"),n?(i.style.justifyContent="flex-end",r.classList.add("me-message")):r.classList.add("you-message"),r.innerHTML=function(e){return e.replace(/\+?\d[\d\-\(\) ]{9,}\d/g,(e=>`
    ${e}`))}(t),i.appendChild(r),e.appendChild(i),e.scrollTop=e.scrollHeight;const o=document.createElement("div");return o.innerHTML=s,o.classList.add("clock"),r.appendChild(o),i}async function It(e,t){const n=Kt;if(n){if(Zt&&(Zt.value=""),"object"==typeof e&&null!==e&&function(e){return"object"==typeof e&&null!==e&&("undefined"!=typeof EventSource&&e instanceof EventSource||!0===e._lsAiWsStream)}(e)){let t,s;return e.addEventListener("textCreated",(()=>{t=_t(n)})),e.addEventListener("typing",(()=>{s=_t(n,Ot.outerHTML)})),e.addEventListener("textDelta",(e=>{const s=Tt(e),i=t.querySelector("div");i&&(i.innerHTML=be.parse(i.innerText+s).toString(),n.scrollTop=n.scrollHeight)})),void e.addEventListener("messageDone",(i=>{s?.parentNode&&s.parentNode.removeChild(s),e.close();const r=Tt(i);if(r)try{const e=JSON.parse(r);let s="";if(!e?.content?.length)return;if((s=e.content[0].text.value)||(s="Что-то пошло не так. Попробуйте позже пожалуйста."),/\[spam\]/.test(s))return void console.log("stop spam!");0,t?.querySelector("div")?t.querySelector("div").innerHTML=be.parse(s).toString():t=_t(n,{text:s,date:(new Date).valueOf()}),Nt.newMessageNotify(s),async function(e,t){let n=!1;const s="string"==typeof e?e:e.content,i=localStorage.getItem("aiwi_messages"),r=i?JSON.parse(i):[];r.length&&(n=!0),r.push({role:t?"user":"assistant",content:s,date:"string"==typeof e?(new Date).valueOf():e.date}),localStorage.setItem("aiwi_messages",JSON.stringify(r));const o=localStorage.getItem("aiwi_thread_id");n&&o&&await Te("chat_notify",{thread:o},"chat_notify_ok",2e4).catch((e=>console.error("error chat notify",e)))}(s)}catch(e){console.error("error processing message",e)}}))}("string"!=typeof e&&e?e:[{role:t?"user":"assistant",content:e,date:(new Date).valueOf()}]).forEach((t=>{let s="user"==t.role;if(t.content){if(!s&&/\[spam\]/.test(t.content))return void console.log("stop spam!");0,_t(n,{text:be.parse(t.content).toString(),date:t.date},s)}if(e){const n=localStorage.getItem("aiwi_messages"),i=n?JSON.parse(n):[];i.push({role:s?"user":"assistant",content:t.content,date:(new Date).valueOf()}),"string"==typeof e&&localStorage.setItem("aiwi_messages",JSON.stringify(i))}}))}else console.log("chatMessages div not found")}function jt(){Et();const e=localStorage.getItem("aiwi_thread_id");e&&Re("widget","thread_subscribe",{thread_id:e})}async function zt(){const e=localStorage.getItem("aiwi_thread_id"),t=localStorage.getItem("aiwi_messages");if(e)return t&&(Kt&&(Kt.innerHTML=""),It(JSON.parse(t))),t?null:e;const n="Здравствуйте! Чем могу помочь?",s={};let i;n&&(s.messages=[{role:"assistant",content:n}]),"undefined"!=typeof document&&document.referrer&&(s.referer=document.referrer),"undefined"!=typeof navigator&&(s.userAgent=navigator.userAgent);try{i=await $e("thread_create",s,"thread_create_ok",6e4)}catch(e){return void console.error("createThread:",e)}if(i?.id){const e=localStorage.getItem("aiwi_thread_id");return e&&e!==i.id&&Re("widget","thread_unsubscribe",{}),localStorage.setItem("aiwi_thread_id",i.id),jt(),i.id}}async function Dt(e,t){const n=new $t;try{const s=await $e("ai_user_message",{thread_id:e,content:t},"ai_message_ok",12e4);if("relay_only"===s.mode)return n.close(),"";if("stream"===s.mode)return n;n.close()}catch(e){throw n.close(),e}return""}Ot.classList.add("typing-indicator"),Ot.classList.add("flex"),Ot.classList.add("items-center"),Ot.classList.add("space-x-1"),Ot.innerHTML='
    \n
    \n
    ';class Bt{static sendEvent(e){const t="Ya"in window?window.Ya._metrika.getCounters().map((e=>e.id)):null;t?.length&&t.map((t=>{"ym"in window&&window.ym(t,"reachGoal",e)}))}static openChat(e="LSChat_Client_open_chat"){this.sendEvent(e)}static sendMessage(e="LSChat_Client_send_message"){this.sendEvent(e)}static sendLead(e="LSChat_Client_send_lead"){this.sendEvent(e)}static sendWhatsapp(e="LSChat_Client_click_whatsapp"){this.sendEvent(e)}static sendVk(e="LSChat_Client_click_vk"){this.sendEvent(e)}static sendPhone(e="LSChat_Client_click_phone"){this.sendEvent(e)}static sendTelegram(e="LSChat_Client_click_telegram"){this.sendEvent(e)}async sendPayload(e,t,n={}){const s=JSON.stringify(t),i={"Content-Type":"application/json"};n.projectKey&&n.projectKeyHeaderName&&(i[n.projectKeyHeaderName]=n.projectKey);try{if(n.useBeacon&&navigator.sendBeacon){const t=new Blob([s],{type:"application/json"});return navigator.sendBeacon(e,t),{ok:!0,beacon:!0}}const t=await fetch(e,{method:"POST",body:s,headers:i,keepalive:!!n.keepalive});return{ok:t.ok,status:t.status,text:await t.text().catch((()=>null))}}catch(e){return{ok:!1,error:e||String(e)}}}}Reflect.defineProperty((function(e,t=!1){const n=document.createElement("style");n.innerHTML=`\n .lswa-widget-button-popup-show {\n display: block;\n -webkit-animation: show .4s linear forwards;\n animation: show .4s linear forwards;\n }\n .lswa-widget-button-popup-btn-hide {\n position: absolute;\n top: 4px;\n right: 4px;\n display: inline-block;\n height: 20px;\n width: 20px;\n background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2210%22%20height%3D%2210%22%20viewBox%3D%220%200%2010%2010%22%3E%3Cpath%20fill%3D%22%23525C68%22%20fill-rule%3D%22evenodd%22%20d%3D%22M6.41%205.07l2.867-2.864-1.34-1.34L5.07%203.73%202.207.867l-1.34%201.34L3.73%205.07.867%207.938l1.34%201.34L5.07%206.41l2.867%202.867%201.34-1.34L6.41%205.07z%22/%3E%3C/svg%3E');\n background-repeat: no-repeat;\n background-position: center;\n opacity: .2;\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n cursor: pointer;\n }\n .lswa-widget-button-popup-inner {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-flow: row;\n flex-flow: row;\n }\n .lswa-widget-button-popup-image {\n margin: 0 10px 0 0;\n width: 42px;\n text-align: center;\n }\n .lswa-widget-button-popup-image-item {\n display: inline-block;\n width: 42px;\n height: 42px;\n border-radius: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n background-image: url(${Ht});\n }\n .lswa-widget-button-popup-name {\n font: bold 14px "Helvetica Neue",Arial,Helvetica,sans-serif;\n color: #000;\n }\n .lswa-widget-button-popup-description {\n margin: 4px 0 0 0;\n font: 13px "Helvetica Neue",Arial,Helvetica,sans-serif;\n color: #424956;\n }\n .lswa-widget-button-popup-triangle {\n position: absolute;\n display: block;\n width: 8px;\n height: 8px;\n background: #fff;\n border-right: 1px solid #aaaaaa82;\n border-bottom: 1px solid #aaaaaa82;\n bottom: 20px;\n }\n .lswa-widget-button-popup {\n padding: 12px 20px 12px 14px;\n max-width: 312px;\n border: 1px solid #aaaaaa82;\n background: #fff;\n border-radius: 15px;\n box-sizing: border-box;\n z-index: 1;\n cursor: pointer;\n }\n `,e.append(n),Mt.style.display="none",Mt.style.position="relative",Mt.classList.add("lswa-widget-button-popup","lswa-widget-button-popup-show");const s=document.createElement("span");s.classList.add("lswa-widget-button-popup-btn-hide"),s.addEventListener("click",(()=>{Mt.style.display="none"})),Mt.innerHTML=`\n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    `,Mt.appendChild(s);const i=setTimeout((()=>{const e=document.querySelector("lsw_chat_popup");e&&"none"!=e.style.display||(Mt.style.display="block")}),5e3);return t?e.appendChild(Mt):e.insertBefore(Mt,e.querySelector("div")),{element:Mt,timeout:i}}),"name",{value:"default",configurable:!0});let Mt=document.createElement("div");const Ht="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=";Reflect.defineProperty(yn,"name",{value:"default",configurable:!0});let Ft=new St;const qt="-35,101".split(",").map((e=>Number(e))),Vt="#1976d2",Ut=Boolean(void 0);let Wt;const Qt=new Map,Kt=document.createElement("div"),Zt=document.createElement("textarea"),Jt="#F5F7FA",Gt='\n\n\n';let Xt,Yt;const en=document.createElement("input");en.type="email",en.placeholder="Email",en.id="contact-email";const tn=document.createElement("input");tn.id="contact-phone",tn.type="tel";const nn=document.createElement("button");let sn=0;const rn=void 0,on=rn?null:function(){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}),!Ut){const e=document.createElement("li");let n=window.matchMedia("(hover: none) and (pointer: coarse)").matches,s=!1;e.addEventListener("click",(e=>{if(!n)return ln(),void(s=!1);s?(s=!1,ln()):(cn(),s=!0,e.preventDefault())})),Object.assign(e.style,{backgroundColor:Vt,borderRadius:"9999px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",width:"4em",height:"4em",position:"absolute",zIndex:100});const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg");r.setAttribute("xmlns",i),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","2"),Object.assign(r.style,{width:"2.5em",height:"2.5em",color:Jt});const o=document.createElementNS(i,"path");o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),o.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"),r.appendChild(o),e.appendChild(r),t.appendChild(e)}return e.appendChild(t),e}(),an=document.createElement("div");async function ln(){if(!Ut)if(an.style.display="none"==an.style.display?"flex":"none","none"!=an.style.display){sn=0,Mt.style.display="none",Bt.openChat(),on&&on.classList.remove("animate"),Zt.focus();const e=await zt();Kt.childNodes.length&&!e||It("Здравствуйте! Чем могу помочь?")}else on&&on.classList.add("animate")}function cn(){if(Wt)for(let e=1;e{t.style.opacity="1",t.style.transform="translateY(0) scale(1)"}),10))}function mn(){const e=an.querySelector("#extra-contact-fields"),t=an.querySelector("#contact-name"),n=an.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 bn(){console.log("hide contact form");const e=an.querySelector("#contact-form-popup");e.style.opacity="0",e.style.transform="translateY(10px) scale(0.95)",setTimeout((()=>{e.style.display="none";pn()||(an.querySelector("#contact-name").value="",an.querySelector("#contact-email").value="",an.querySelector("#contact-phone").value="",mn(),un())}),300)}async function xn(){const e=an.querySelector("#contact-form-popup button"),t=an.querySelector("#contact-name"),n=an.querySelector("#contact-email"),s=an.querySelector("#contact-phone");e.disabled=!0,e.style.cursor="not-allowed";const i=e.textContent;e.textContent="Отправка...";const r={name:t.value.trim(),email:n.value.trim(),phone:s.value.trim(),timestamp:(new Date).toISOString(),chat:!0};dn(r);try{await Te("lead",{assistant:"68dbc9eab486669c29a9ac62",name:r.name,email:r.email,phone:r.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"),bn()}catch(e){console.error("Failed to save contact data:",e),bn()}finally{e.textContent=i,e.disabled=!1,e.style.cursor="pointer"}}function yn(e,t){const n=document.createElement("button"),s=document.createElement("div");Object.assign(s.style,{[qt[0]>0?"left":"right"]:Math.abs(qt[0])+"px",[qt[1]>0?"bottom":"top"]:Math.abs(qt[1])+"px",color:"black",display:"flex",alignItems:"flex-end",flexDirection:"row",gap:"10px",fontSize:"100%",zIndex:"10000000"}),rn||(s.style.position="fixed",document.body.appendChild(s));const i=s.attachShadow({mode:"closed"}),r=(()=>{if(an.id="lsw_chat_popup",Ut)return Object.assign(an.style,{display:"none",position:"fixed",visibility:"hidden",pointerEvents:"none"}),an;Object.assign(an.style,{fontSize:".875em",backgroundColor:Jt,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"}),rn||(Object.assign(an.style,{position:"fixed",display:"none"}),qt[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 t=document.createElement("div");Object.assign(t.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=At("supportChat"),Object.assign(s.style,{marginTop:"10px",fontSize:"1.125em",lineHeight:"1.75em"});const i=document.createElement("div");i.id="chat-avatar",Object.assign(i.style,{width:"50px",height:"50px",margin:"10px",borderRadius:"50%",backgroundSize:"contain",backgroundImage:`url(${Ht})`,cursor:"pointer",transition:"transform 0.2s"}),i.addEventListener("click",(()=>{const e=pn();console.log("avatar click",e),e&&fn(!0)})),i.addEventListener("mouseenter",(()=>{i.style.transform="scale(1.05)"})),i.addEventListener("mouseleave",(()=>{i.style.transform="scale(1)"}));const r=document.createElement("div");Object.assign(r.style,{color:"#38E040",fontSize:"x-small"}),r.innerText=At("online"),window.addEventListener("lsw-widget-admin-presence",(e=>{const t=e;"boolean"==typeof t.detail?.online&&(t.detail.online?(r.innerText=At("online"),r.style.color="#38E040"):(r.innerText="—",r.style.color="#9ca3af"))}));const o=document.createElement("div");if(Object.assign(o.style,{display:"flex",flexDirection:"column"}),o.appendChild(s),o.appendChild(r),t.appendChild(i),t.appendChild(o),function(e){e.style.position="relative",[{top:"0px",right:"8px",background:"#FB7C7E"},{top:"10px",right:"-15px",background:"#C6DCF9"},{top:"38px",right:"-15px",background:"#FB7C7E"},{top:"31px",right:"9px",background:"#C6DCF9"}].forEach((({top:t,right:n,background:s})=>{const i=document.createElement("div");Object.assign(i.style,{position:"absolute",width:"40px",height:"6px",top:t,right:n,background:s,borderRadius:"100px",transform:"rotate(-15deg)"}),e.appendChild(i)}))}(e),e.appendChild(t),!rn){const t=document.createElement("button");t.id="close-popup",Object.assign(t.style,{background:"transparent",position:"absolute",top:"14px",right:"14px",border:"none",color:Jt,cursor:"pointer",padding:"0",zIndex:"1",filter:"drop-shadow(2px 2px 2px rgba(0, 0, 0, .8))"}),t.addEventListener("click",(function(){ln()}));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 s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d","M6 18L18 6M6 6l12 12"),n.appendChild(s),t.appendChild(n),e.appendChild(t)}Kt.classList.add("message-block"),Kt.addEventListener("wheel",(e=>{if(!e.target)return;e.preventDefault(),e.stopPropagation();const t=2*e.deltaY;Kt.scrollBy(0,t)}),{passive:!1});const a=document.createElement("div");a.id="chat-input-container",Object.assign(a.style,{padding:"1rem",borderTop:"1px solid #e5e7eb",margin:"5px 15px 0",borderRadius:"24px",backgroundColor:"white",boxShadow:"0px 0px 12px 0px #00000012"});const l=document.createElement("div");Object.assign(l.style,{display:"flex",alignItems:"center",gap:"1rem"}),Zt.placeholder=At("inputMessage"),Object.assign(Zt.style,{flex:"1",leadingTrim:"NONE",lineHeight:"16px",letterSpacing:"0%",padding:"0.5rem 1rem",outline:"none",backgroundColor:"white",resize:"none",fontSize:"16px",border:0}),n.classList.add("chat-submit"),n.innerHTML=Gt,Object.assign(n.style,{backgroundColor:Vt,color:Jt,borderRadius:"100px",cursor:"pointer",border:"none",width:"40px",height:"40px",padding:"14px 6px"}),l.appendChild(Zt),l.appendChild(n),a.appendChild(l);const c=document.createElement("div");Object.assign(c.style,{textAlign:"center",padding:"8px 0 5px 0",fontSize:"0.75em",color:"#6b7280",opacity:"0.7"});const p=document.createElement("a");return p.href="https://ls-ai.ru",p.target="_blank",p.textContent=At("createdAt"),Object.assign(p.style,{color:"#6b7280",textDecoration:"none",transition:"opacity 0.2s"}),p.addEventListener("mouseenter",(()=>{p.style.opacity="1"})),p.addEventListener("mouseleave",(()=>{p.style.opacity="0.7"})),c.appendChild(p),an.appendChild(e),an.appendChild(Kt),an.appendChild(a),an.appendChild(c),function(e){const t=document.createElement("div");t.id="contact-form-popup",Object.assign(t.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 n=document.createElement("div");Object.assign(n.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))"}),t.appendChild(n);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(),bn()})),t.appendChild(s);const i=document.createElement("div");i.textContent=At("askNames"),Object.assign(i.style,{fontSize:"1.1em",fontWeight:"600",marginBottom:"5px",color:"#111827"}),t.appendChild(i);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"}),t.appendChild(r);const o=document.createElement("div");Object.assign(o.style,{marginBottom:"0",transition:"margin-bottom 0.3s ease"});const a=document.createElement("input");a.type="text",a.placeholder=At("yourName"),a.id="contact-name",Object.assign(a.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",transition:"all 0.2s",boxSizing:"border-box"}),a.addEventListener("focus",(()=>{a.style.borderColor=Vt||"#3b82f6",a.style.boxShadow=`0 0 0 3px ${Vt||"#3b82f6"}20`,gn()})),a.addEventListener("blur",(()=>{a.style.borderColor="#e5e7eb",a.style.boxShadow="none"})),a.addEventListener("input",un),o.appendChild(a),t.appendChild(o);const l=document.createElement("div");l.id="extra-contact-fields",Object.assign(l.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(en.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",marginTop:"12px",transition:"all 0.2s",boxSizing:"border-box"}),en.addEventListener("focus",(()=>{en.style.borderColor=Vt||"#3b82f6",en.style.boxShadow=`0 0 0 3px ${Vt||"#3b82f6"}20`})),en.addEventListener("blur",(()=>{en.style.borderColor="#e5e7eb",en.style.boxShadow="none"})),en.addEventListener("input",un),tn.placeholder=At("phone"),Object.assign(tn.style,{width:"100%",padding:"12px",border:"1px solid #e5e7eb",borderRadius:"12px",fontSize:"14px",outline:"none",marginTop:"12px",transition:"all 0.2s",boxSizing:"border-box"}),tn.addEventListener("focus",(()=>{tn.style.borderColor=Vt||"#3b82f6",tn.style.boxShadow=`0 0 0 3px ${Vt||"#3b82f6"}20`})),tn.addEventListener("blur",(()=>{tn.style.borderColor="#e5e7eb",tn.style.boxShadow="none"})),tn.addEventListener("input",un),l.appendChild(en),l.appendChild(tn),t.appendChild(l);const c=[];Xt=c[0],Yt=c[1],nn.textContent=At("send"),nn.disabled=!0,Object.assign(nn.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"}),nn.addEventListener("click",xn),t.appendChild(nn),e.appendChild(t),e.addEventListener("click",(t=>{const n=e.querySelector("#contact-form-popup"),s=e.querySelector("#chat-avatar"),i=pn();n&&"none"!==n.style.display&&i&&t.target instanceof Node&&(n.contains(t.target)||s.contains(t.target)||bn())})),Zt.addEventListener("focus",(async()=>{const t=e.querySelector("#contact-form-popup"),n=pn();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 hn():mn()}}))}(an),an})();on&&i.appendChild(on),i.appendChild(r);const o=document.createElement("ul");if(o.style.listStyle="none",o.style.display="none",o.style.justifyContent="center",o.style.alignItems="center",o.style.flexDirection="column",i.appendChild(o),e?.length&&on){const n=on.querySelector("ul");if(n){if(Ut){const[t,...s]=e;t?.element&&(a=t.element,Object.assign(a.style,{width:"4em",height:"4em",position:"absolute",zIndex:"100",margin:"0"}),n.appendChild(t.element)),s.forEach((e=>{e.element&&n.appendChild(e.element)}))}else e.forEach((e=>{e.element&&n.appendChild(e.element)}));Wt=n.querySelectorAll("li"),Wt?.length>1&&(n.addEventListener("mouseenter",(()=>{t?.value&&(t.value.element.style.display="none",clearTimeout(t.value.timeout)),cn()})),n.addEventListener("mouseleave",(()=>{if(Wt)for(let e=1;e{Wt&&(Wt[e].style.transform="translateX(0)")}),500))})))}}var a;return!Ut&&n&&Zt&&(n.addEventListener("click",(async function(){const e=Zt.value.trim();if(!e)return;const t=pn();sn++,t||(console.log("need show contact form"),fn()),Bt.sendMessage(),It(e,!0);const n=await async function(e){let t=localStorage.getItem("aiwi_thread_id")||await zt();if(!t)return"Не могу ответить. Попробуйте позже. ";if(Ct){try{await Te("message_to_admin",{thread_id:t,message:e},"message_to_admin_ok",25e3)}catch{Ct=!1}return""}It();try{return await Dt(t,e)}catch(n){const s=n instanceof Error?n.message:String(n);if(/not found|Thread not found|404/i.test(s)||/Чат устарел|устарел/i.test(s)){if(localStorage.removeItem("aiwi_thread_id"),t=await zt(),!t)return"Не могу ответить. Попробуйте позже. ";try{return await Dt(t,e)}catch(n){Pt.report({url:"ws:ai_user_message",headers:"{}",body:{thread_id:t,content:e},error:n})}}else Pt.report({url:"ws:ai_user_message",headers:"{}",body:{thread_id:t,content:e},error:n})}return"Что-то идет не так. Попробуйте позже."}(e);n&&("string"==typeof n&&Ft.newMessageNotify(n),It(n))})),Zt.addEventListener("keyup",(function(e){"Enter"===e.key&&n.click()}))),Ut||(jt(),zt()),[i,qt[0]>0]}let wn,kn;function An(){const e=document.createElement("input"),t=document.createElement("button"),n=()=>{t.disabled=e.value.replace(/\D/g,"").length<11,t.style.cursor=t.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 i=document.createElement("div");Object.assign(i.style,{width:"400px",backgroundColor:"#f5f7fa",padding:"1.5rem",paddingBottom:"0.6em",borderRadius:"24px",position:"relative"}),i.className="shadow-lg";const r=document.createElement("div");r.className="i-lh-close";const o=document.createElement("div");o.id="wls_closeModalBtn",o.className="i-lh-close-cross",r.appendChild(o),i.appendChild(r);const a=()=>{s.host.remove(),localStorage.setItem("lsw_lc_lps",((new Date).valueOf()-432e5+36e4).toString())};r.addEventListener("click",(()=>{a()}));let l=!0;s.addEventListener("click",(e=>{l=!1})),s.host.addEventListener("click",(e=>{console.log("click on host",l),l?a():l=!0}));const c=document.createElement("div");c.className="i-lh-wrapper",c.style.fontFamily="Open-Sans, sans-serif",c.style.width="unset",c.style.height="unset";const p=document.createElement("div");p.className="i-lh-main-desktop";const d=document.createElement("div");d.className="i-lh-header",d.style.cssText="text-align: center; line-height: 38px; color: rgb(30, 25, 28); font-size: 30px;",d.textContent=At("haveQues");const h=document.createElement("div");h.className="i-lh-description",h.style.cssText="text-align: center; line-height: 20px; color: rgb(127, 127, 127); font-size: 15px; margin: 10px auto; width: 340px;",h.textContent=At("callAsk");const u=document.createElement("div");u.className="i-lh-form i-lh-vertical full-width";const g=document.createElement("div");g.className="i-lh-field";const f=document.createElement("div");f.className="i-lh-input-wrapper lsw_vertical";const m=document.createElement("div");m.className="i-lh-icon-wrapper",m.style.color="rgb(30, 25, 28)",m.innerHTML='\n ',e.name="wls_phoneNumber",e.placeholder=At("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(m),f.appendChild(e),g.appendChild(f),u.appendChild(g);const b=document.createElement("div");b.className="i-lh-field";const x=document.createElement("div");x.className="button-wrapper",t.id="lsw_waitCall",t.disabled=!0,t.textContent=At("callMe")+" →",x.appendChild(t),b.appendChild(x);const y=[];wn=y[0],kn=y[1],e.addEventListener("input",(()=>n())),u.appendChild(b);const w=e=>{const t=e.target;let s=0,i=t.value.replace(/\D/g,"").replace(/^8/,"7");var r,o;n(),t.value="+_ (___) ___-__-__".replace(/./g,(function(e){return/[_\d]/.test(e)&&s=i.length?"":e})),"blur"==e.type?2==t.value.length&&(t.value=""):(r=t,o=t.value.length,r.focus(),r.setSelectionRange&&r.setSelectionRange(o,o))};e.addEventListener("input",w,!1),e.addEventListener("focus",w,!1),e.addEventListener("blur",w,!1),e.addEventListener("keydown",w,!1);const k=document.createElement("div");t.addEventListener("click",(async()=>{t.disabled=!0,Bt.sendLead();try{await Te("lead",{assistant:"68dbc9eab486669c29a9ac62",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()),p.style.display="none",k.style.display=""}catch(e){console.log("error",e),t.disabled=!1}})),p.appendChild(d),p.appendChild(h),p.appendChild(u),k.className="i-lh-main-desktop",k.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=At("thanks");const v=document.createElement("div");v.style.cssText="text-align: center; line-height: 20px; color: rgb(127, 127, 127); font-size: 15px; margin: 10px auto; width: 340px;",v.textContent=At("waitCall"),k.appendChild(A),k.appendChild(v);const S=document.createElement("div");S.className="i-lh-footer";const C=document.createElement("div");return C.className="i-lh-footer-text",C.innerHTML=`${At("workTechs")} Ls-ai.ru`,S.appendChild(C),c.appendChild(p),c.appendChild(k),c.appendChild(S),i.appendChild(c),i})(s))}const i=()=>{document.removeEventListener("mousemove",o);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((()=>{i()}),3e4),o=e=>{e.clientY<=10&&(i(),clearTimeout(r))};document.addEventListener("mousemove",o)}Reflect.defineProperty(An,"name",{value:"default",configurable:!0}),Reflect.defineProperty(Cn,"name",{value:"default",configurable:!0});const vn=void 0,Sn="-35,101".split(",").map((e=>Number(e)));function Cn(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 s=document.createElement("style");s.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: ${vn?"100%":"28em"};\n max-width: 100vw;\n word-break: break-word;\n box-sizing: border-box;\n height: ${vn?"100%":"600px"};\n max-height: 100vh;\n ${Sn[0]>0?"left":"right"}: 15px;\n bottom: ${vn?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: ${vn?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: ${vn?"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: #6CA4EF;\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(s)}Reflect.defineProperty(En,"name",{value:"default",configurable:!0});const Ln="#1976d2";function En(e){const t=document.createElement("style");t.innerHTML=`\n .lsw_contact_btn {\n background-color: ${Ln};\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:Rn,forEach:Tn}=[];const $n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nn={create(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),s&&(i.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!$n.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!$n.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s}(e,t,i)},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 s=e.substring(1).split("&");for(let e=0;e0){s[e].substring(0,i)===n&&(t=s[e].substring(i+1))}}}return t}},_n={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:s}=e;if("undefined"!=typeof window){const{hash:e}=window.location;if(e&&e.length>2){const i=e.substring(1);if(n){const e=i.split("&");for(let s=0;s0){e[s].substring(0,i)===n&&(t=e[s].substring(i+1))}}}if(t)return t;if(!t&&s>-1){const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;const n="number"==typeof s?s:0;return t[n]?.replace("/","")}}}return t}};let In=null;const jn=()=>{if(null!==In)return In;try{if(In="undefined"!=typeof window&&null!==window.localStorage,!In)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){In=!1}return In};var zn={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&jn())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&jn()&&window.localStorage.setItem(n,e)}};let Dn=null;const Bn=()=>{if(null!==Dn)return Dn;try{if(Dn="undefined"!=typeof window&&null!==window.sessionStorage,!Dn)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Dn=!1}return Dn};var Mn={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Bn())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Bn()&&window.sessionStorage.setItem(n,e)}},Hn={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n0?t:void 0}},Fn={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},qn={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 s="number"==typeof t?t:0;return n[s]?.replace("/","")}},Vn={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let Un=!1;try{document.cookie,Un=!0}catch(e){}const Wn=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Un||Wn.splice(1,1);class Qn{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=function(e){return Tn.call(Rn.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:Wn,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"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(Pn),this.addDetector(On),this.addDetector(zn),this.addDetector(Mn),this.addDetector(Hn),this.addDetector(Fn),this.addDetector(qn),this.addDetector(Vn),this.addDetector(_n)}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=>{return null!=e&&!("string"==typeof(t=e)&&[/<\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((e=>e.test(t))));var t})).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)})))}}Qn.type="languageDetector";const Kn={value:null};var Zn;function Jn(e){return Boolean(e)}kt.use(Qn).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"}}),Ee(),Et(),Zn=()=>{const e=localStorage.getItem("aiwi_thread_id");e&&Re("widget","thread_subscribe",{thread_id:e})},Se.add(Zn),function(){if(vt)return vt;const e="-35,101".split(",").map((e=>Number(e)));e[1]+=73,vt=document.createElement("div"),vt.style.display="flex",vt.style.flexDirection="column",vt.style[e[0]>0?"left":"right"]=Math.abs(e[0])+"px",vt.style[e[1]>0?"bottom":"top"]=Math.abs(e[1])+"px",vt.style.position="fixed",vt.style.zIndex="500",document.body.appendChild(vt)}();Jn(!0);let Gn,Xn,Yn=[];if(!Jn(void 0)||Yn.length>0){let e=yn(Yn,Kn);Gn=e[0],Cn(Gn),En(Gn),Xn=e[1]}An()})();