(()=>{"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}}let 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}const s={exec:()=>null};function i(e,t=""){let n="string"==typeof e?e:e.source;const s={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(r.caret,"$1"),n=n.replace(e,i),s},getRegex:()=>new RegExp(n,t)};return s}const r={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,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")},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,a=/(?:[*+-]|\d{1,9}[.)])/,l=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,c=i(l).replace(/bull/g,a).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(),h=i(l).replace(/bull/g,a).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(),p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,d=/(?!\s*\])(?:\\.|[^\[\]\\])+/,u=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",d).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g=i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,a).getRegex(),f="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",m=/|$))/,b=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",m).replace("tag",f).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=i(p).replace("hr",o).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[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),w={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",x).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:u,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:b,lheading:c,list:g,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:x,table:s,text:/^[^\n]+/},k=i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).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[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),y={...w,lheading:h,table:k,paragraph:i(p).replace("hr",o).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[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex()},v={...w,html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m).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(p).replace("hr",o).replace("heading"," *#{1,6} *[^\n]").replace("lheading",c).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,$=/[\p{P}\p{S}]/u,L=/[\s\p{P}\p{S}]/u,_=/[^\s\p{P}\p{S}]/u,R=i(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,L).getRegex(),C=/(?!~)[\p{P}\p{S}]/u,O=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T=i(O,"u").replace(/punct/g,$).getRegex(),E=i(O,"u").replace(/punct/g,C).getRegex(),A="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",P=i(A,"gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,L).replace(/punct/g,$).getRegex(),z=i(A,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,C).getRegex(),j=i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,L).replace(/punct/g,$).getRegex(),I=i(/\\(punct)/,"gu").replace(/punct/g,$).getRegex(),N=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(),D=i(m).replace("(?:--\x3e|$)","--\x3e").getRegex(),B=i("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",D).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,F=i(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),q=i(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",d).getRegex(),V=i(/^!?\[(ref)\](?:\[\])?/).replace("ref",d).getRegex(),U={_backpedal:s,anyPunctuation:I,autolink:N,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:s,emStrongLDelim:T,emStrongRDelimAst:P,emStrongRDelimUnd:j,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:F,nolink:V,punctuation:R,reflink:q,reflinkSearch:i("reflink|nolink(?!\\()","g").replace("reflink",q).replace("nolink",V).getRegex(),tag:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Y=e=>G[e];function X(e,t){if(t){if(r.escapeTest.test(e))return e.replace(r.escapeReplace,Y)}else if(r.escapeTestNoEncode.test(e))return e.replace(r.escapeReplaceNoEncode,Y);return e}function W(e){try{e=encodeURI(e).replace(r.percentDecode,"%")}catch{return null}return e}function ee(e,t){const n=e.replace(r.findPipe,((e,t,n)=>{let s=!1,i=t;for(;--i>=0&&"\\"===n[i];)s=!s;return s?"|":" |"})).split(r.splitPipe);let 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.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:te(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const s=e.match(n.other.indentCodeCompensation);if(null===s)return t;const i=s[1];return t.split("\n").map((e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[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){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=te(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:te(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=te(t[0],"\n").split("\n"),n="",s="";const i=[];for(;e.length>0;){let t=!1;const r=[];let o;for(o=0;o1,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:"[*+-]");const r=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let n=!1,s="",a="";if(!(t=r.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):h?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=t[1].length),h&&this.rules.other.blankLine.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),r=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p);for(;e;){const d=e.split("\n",1)[0];let u;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(r.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+u.slice(p);else{if(h)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(r.test(l))break;if(n.test(l))break;a+="\n"+c}h||c.trim()||(h=!0),s+=d+"\n",e=e.substring(d.length+1),l=u.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(s)&&(o=!0));let d,u=null;this.options.gfm&&(u=this.rules.other.listIsTask.exec(a),u&&(d="[ ] "!==u[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:s,task:!!u,checked:d,loose:!1,text:a,tokens:[]}),i.raw+=s}const 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=0;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=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:r.align[t]}))));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const 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){const 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){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const 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){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=te(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const 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){const 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)),ne(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:s?s.replace(this.rules.inline.anyPunctuation,"$1"):s},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))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ne(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s)return;if(s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let i,r,o=n,a=0;const l="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=l.exec(t));){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(r=[...i].length,s[3]||s[4]){o+=r;continue}if((s[5]||s[6])&&n%3&&!((n+r)%3)){a+=r;continue}if(o-=r,o>0)continue;r=Math.min(r,r+o+a);const t=[...s[0]][0].length,l=e.slice(0,n+s.index+t+r);if(Math.min(n,r)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const 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){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const 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){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class ie{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:r,block:Z.normal,inline:Q.normal};this.options.pedantic?(n.block=Z.pedantic,n.inline=Q.pedantic):this.options.gfm&&(n.block=Z.gfm,this.options.breaks?n.inline=Q.breaks:n.inline=Q.gfm),this.tokenizer.rules=n}static get rules(){return{block:Z,inline:Q}}static lex(e,t){return new ie(t).lex(e)}static lexInline(e,t){return new ie(t).inlineTokens(e)}lex(e){e=e.replace(r.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);const 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);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\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);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\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});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=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){const r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+="\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);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+s.raw,n.text+="\n"+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(s)}else if(e){const 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=[]){let n=e,s=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,r="";for(;e;){let s;if(i||(r=""),i=!1,this.options.extensions?.inline?.some((n=>!!(s=n.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0))))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);const n=t.at(-1);"text"===s.type&&"text"===n?.type?(n.raw+=s.raw,n.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,n,r)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(o)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(r=s.raw.slice(-1)),i=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=s.raw,n.text+=s.text):t.push(s)}else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}}class re{options;parser;constructor(e){this.options=e||t}space(e){return""}code({text:e,lang:t,escaped:n}){const s=(t||"").match(r.notSpaceStart)?.[0],i=e.replace(r.endingNewline,"")+"\n";return s?'
'+(n?i:X(i,!0))+"
\n":"
"+(n?i:X(i,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){const t=e.ordered,n=e.start;let s="";for(let t=0;t\n"+s+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+X(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \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){const 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`${X(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),i=W(e);if(null===i)return s;let r='
    ",r}image({href:e,title:t,text:n}){const s=W(e);if(null===s)return X(n);let i=`${n}{const 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){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const 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){const 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'");const 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){const t=this.defaults.renderer||new re(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const 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){const t=this.defaults.tokenizer||new se(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const 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){const t=this.defaults.hooks||new le;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const s=n,i=e.hooks[s],r=t[s];le.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>r.call(t,e)));const n=i.call(t,e);return r.call(t,n)}:t[s]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const 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 ie.lex(e,t??this.defaults)}parser(e,t){return ae.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const 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(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"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const o=i.hooks?i.hooks.provideLexer():e?ie.lex:ie.lexInline,a=i.hooks?i.hooks.provideParser():e?ae.parse:ae.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>o(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(r);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=a(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return r(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+X(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function he(e,t){return ce.parse(e,t)}he.options=he.setOptions=function(e){return ce.setOptions(e),he.defaults=ce.defaults,n(he.defaults),he},he.getDefaults=e,he.defaults=t,he.use=function(...e){return ce.use(...e),he.defaults=ce.defaults,n(he.defaults),he},he.walkTokens=function(e,t){return ce.walkTokens(e,t)},he.parseInline=ce.parseInline,he.Parser=ae,he.parser=ae.parse,he.Renderer=re,he.TextRenderer=oe,he.Lexer=ie,he.lexer=ie.lex,he.Tokenizer=se,he.Hooks=le,he.parse=he;he.options,he.setOptions,he.use,he.walkTokens,he.parseInline,ae.parse,ie.lex;const pe="https://apid.launchstrategies.ru";let de,ue=!1;const ge=new class{report(e){fetch("https://apid.launchstrategies.ru/widget/bug",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}},fe=document.createElement("div");function me(e,t="",n){const s=document.createElement("div");return s.className="flex mb-3"+(n?" justify-end":""),s.innerHTML=`
    ${function(e){return e.replace(/\+?\d[\d\-\(\) ]{9,}\d/g,(e=>`${e}`))}(t)}
    `,e.appendChild(s),e.scrollTop=e.scrollHeight,s}async function be(e,t){const n=document.querySelector("#lswidget-typing-indicator");n?.parentElement?.parentElement&&n.parentElement.parentElement.removeChild(n.parentElement);const s=document.getElementById("chat-input"),i=document.getElementById("wls_chat-messages");if(i){if(s&&(s.value=""),"object"==typeof e&&e instanceof EventSource){let t;return e.addEventListener("textCreated",(()=>{t=me(i)})),e.addEventListener("textDelta",(({data:e})=>{const n=t.querySelector("div");n&&(n.innerHTML=he.parse(n.innerText+e).toString(),i.scrollTop=i.scrollHeight)})),void e.addEventListener("messageDone",(({data:n})=>{const s=t.querySelector("div");if(!s)return;const i=JSON.parse(n);s.innerHTML=he.parse(i.content[0].text.value).toString(),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 fetch(`${pe}/widget/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({thread:o})}).then((e=>e.json())).catch((e=>console.error("error chat notify",e.message)))}(i.content[0].text.value),e.close()}))}("string"!=typeof e&&e?e:[{role:t?"user":"assistant",content:e}]).forEach((t=>{let n="user"==t.role;if(t.content&&me(i,he.parse(t.content).toString(),n),e){const s=localStorage.getItem("aiwi_messages"),i=s?JSON.parse(s):[];i.push({role:n?"user":"assistant",content:t.content}),"string"==typeof e&&localStorage.setItem("aiwi_messages",JSON.stringify(i))}}))}}async function xe(){if(de)return;const e=localStorage.getItem("aiwi_thread_id");e&&(de=new EventSource(`${pe}/widget/listen/`+e),de.addEventListener("operatorMessage",(({data:e})=>{ue=!0,be(e)})),de.addEventListener("operatorDisconnected",(({data:e})=>{ue=!1})))}async function we(){const e=localStorage.getItem("aiwi_thread_id"),t=localStorage.getItem("aiwi_messages");if(e)return t&&(!function(){const e=document.getElementById("wls_chat-messages");e&&(e.innerHTML="")}(),be(JSON.parse(t))),t?null:e;const n=new Headers;n.append("Content-Type","application/json");const s=JSON.stringify({messages:[{role:"assistant",content:"Вас приветствует ИИ ассистент"}],assistant_id:"67e3ecedcfa6c3836c819dc1"}),i=await fetch(`${pe}/assistants/threads`,{method:"POST",headers:n,body:s}).then((e=>e.json())).catch((e=>console.log("error",e)));return i?.id?(localStorage.setItem("aiwi_thread_id",i.id),xe(),i.id):void 0}function ke(){return"Ya"in window?window.Ya._metrika.getCounters()[0].id:null}fe.id="lswidget-typing-indicator",fe.classList.add("typing-indicator"),fe.classList.add("flex"),fe.classList.add("items-center"),fe.classList.add("space-x-1"),fe.innerHTML='
    \n
    \n
    ';class ye{static openChat(){console.log("open chat");const e=ke();e&&"ym"in window&&(console.log("opening chat"),window.ym(e,"reachGoal","LSChat_Client_open_chat"))}static sendMessage(){const e=ke();e&&"ym"in window&&window.ym(e,"reachGoal","LSChat_Client_send_message")}static sendLead(){const e=ke();e&&"ym"in window&&window.ym(e,"reachGoal","LSChat_Client_send_lead")}}const ve=e=>"string"==typeof e,Se=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},$e=e=>null==e?"":""+e,Le=/###/g,_e=e=>e&&e.indexOf("###")>-1?e.replace(Le,"."):e,Re=e=>!e||ve(e),Ce=(e,t,n)=>{const s=ve(t)?t.split("."):t;let i=0;for(;i{const{obj:s,k:i}=Ce(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=Ce(e,o,Object);for(;void 0===a.obj&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=Ce(e,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=n},Te=(e,t)=>{const{obj:n,k:s}=Ce(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},Ee=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?ve(e[s])||e[s]instanceof String||ve(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):Ee(e[s],t[s],n):e[s]=t[s]);return e},Ae=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ze=e=>ve(e)?e.replace(/[&<>"'\/]/g,(e=>Pe[e])):e;const je=[" ",",","?","!",";"],Ie=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),Ne=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";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;e-1&&oe?.replace("_","-"),Be={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 Me{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Be,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{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])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s{let[t,s]=e;for(let e=0;e{let[s,i]=t;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,r=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):ve(n)&&i?o.push(...n.split(i)):o.push(n)));const a=Te(this.data,o);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!a&&r&&ve(n)?Ne(this.data?.[e]?.[t],n,i):a}addResource(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{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.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Oe(this.data,o,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(ve(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){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let a=Te(this.data,o)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Ee(a,n,i):a={...a,...n},Oe(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 Ue={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 He={},Ke=e=>!ve(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Je extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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=Fe.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}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.indexOf(n)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=je.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=Ie.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:ve(i)?[i]:i};const r=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(r[0])>-1)&&(i=r.shift()),e=r.join(s)}return{key:e,namespaces:ve(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof options&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:r,namespaces:o}=this.extractFromKey(e[e.length-1],t),a=o[o.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${a}${e}${r}`,usedKey:r,exactUsedKey:r,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${r}`}return s?{res:r,usedKey:r,exactUsedKey:r,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:r}const h=this.resolve(e,t);let p=h?.res;const d=h?.usedKey||r,u=h?.exactUsedKey||r,g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!ve(t.count),b=Je.hasDefaultValue(t),x=m?this.pluralResolver.getSuffix(l,t.count,t):"",w=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",k=m&&!t.ordinal&&0===t.count,y=k&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${x}`]||t[`defaultValue${w}`]||t.defaultValue;let v=p;f&&!p&&b&&(v=y);const S=Ke(v),$=Object.prototype.toString.apply(v);if(!(f&&v&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf($)<0)||ve(g)&&Array.isArray(v))if(f&&ve(g)&&Array.isArray(p))p=p.join(g),p&&(p=this.extendTranslation(p,e,t,n));else{let s=!1,o=!1;!this.isValidLookup(p)&&b&&(s=!0,p=y),this.isValidLookup(p)||(o=!0,p=r);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,d=b&&y!==p&&this.options.updateMissing;if(o||s||d){if(this.logger.log(d?"updateKey":"missingKey",l,a,r,d?y:p),i){const e=this.resolve(r,{...t,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 n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{const i=b&&s!==p?s:c;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,i,d,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,a,n,i,d,t),this.emit("missingKey",e,a,n,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);k&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{s([e],r+n,t[`defaultValue${n}`]||y)}))})):s(e,r,y))}p=this.extendTranslation(p,e,t,h,n),o&&p===r&&this.options.appendNamespaceToMissingKey&&(p=`${a}:${r}`),(o||s)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${r}`:r,s?p:void 0))}else{if(!t.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(d,v,{...t,ns:o}):`key '${r} (${this.language})' returned an object instead of string.`;return s?(h.res=e,h.usedParams=this.getUsedParamsDetails(t),h):e}if(i){const e=Array.isArray(v),n=e?[]:{},s=e?u:d;for(const e in v)if(Object.prototype.hasOwnProperty.call(v,e)){const r=`${s}${i}${e}`;n[e]=b&&!p?this.translate(r,{...t,defaultValue:Ke(y)?y[e]:void 0,joinArrays:!1,ns:o}):this.translate(r,{...t,joinArrays:!1,ns:o}),n[e]===r&&(n[e]=v[e])}p=n}}return s?(h.res=p,h.usedParams=this.getUsedParamsDetails(t),h):p}extendTranslation(e,t,n,s,i){var r=this;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 o=ve(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=n.replace&&!ve(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(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,(function(){for(var e=arguments.length,s=new Array(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return ve(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,o),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const h=void 0!==o.count&&!ve(o.count),p=h&&!o.ordinal&&0===o.count,d=void 0!==o.context&&(ve(o.context)||"number"==typeof o.context)&&""!==o.context,u=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(r=e,He[`${u[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(He[`${u[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${u.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((n=>{if(this.isValidLookup(t))return;i=n;const r=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,l,n,e,o);else{let e;h&&(e=this.pluralResolver.getSuffix(n,o.count,o));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(r.push(l+e),o.ordinal&&0===e.indexOf(s)&&r.push(l+e.replace(s,this.options.pluralSeparator)),p&&r.push(l+t)),d){const n=`${l}${this.options.contextSeparator}${o.context}`;r.push(n),h&&(r.push(n+e),o.ordinal&&0===e.indexOf(s)&&r.push(n+e.replace(s,this.options.pluralSeparator)),p&&r.push(n+t))}}let a;for(;a=r.pop();)this.isValidLookup(t)||(s=a,t=this.getResource(n,e,a,o))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ve(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){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Ze{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fe.create("languageUtils")}getScriptPartFromCode(e){if(!(e=De(e))||e.indexOf("-")<0)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=De(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ve(e)&&e.indexOf("-")>-1){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.indexOf(e)>-1}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:e.indexOf("-")<0&&s.indexOf("-")<0?void 0:e.indexOf("-")>0&&s.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===s||0===e.indexOf(s)&&s.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),ve(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(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 ve(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("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))):ve(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const Qe={zero:0,one:1,two:2,few:3,many:4,other:5},Ge={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ye{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Fe.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=De("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(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ge;if(!e.match(/-|_/))return Ge;const s=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(s,t)}return this.pluralRulesCache[i]=r,r}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>Qe[e]-Qe[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};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 Xe=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=((e,t,n)=>{const s=Te(e,n);return void 0!==s?s:Te(t,n)})(e,t,n);return!r&&i&&ve(n)&&(r=Ne(e,n,s),void 0===r&&(r=Ne(t,n,s))),r},We=e=>e.replace(/\$/g,"$$$$");class et{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Fe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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:h,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:u,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:ze,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?Ae(i):r||"{{",this.suffix=o?Ae(o):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Ae(p):d||Ae("$t("),this.nestingSuffix=u?Ae(u):g||Ae(")"),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.indexOf(this.formatSeparator)<0){const i=Xe(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(Xe(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...s,...t,interpolationkey:r})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>We(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?We(this.escape(e)):We(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=ve(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))r="";else{if(h){r=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),r=""}else ve(r)||this.useRawValueToEscape||(r=$e(r));const a=t.safeValue(r);if(e=e.replace(i[0],a),h?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t){let n,s,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let r=`{${s[1]}`;e=s[0],r=this.interpolate(r,i);const o=r.match(/'/g),a=r.match(/"/g);((o?.length??0)%2==0&&!a||a.length%2!=0)&&(r=r.replace(/'/g,'"'));try{i=JSON.parse(r),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];i={...r},i=i.replace&&!ve(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),a=e,l=!0}if(s=t(o.call(this,n[1].trim(),i),i),s&&n[0]===e&&!ve(s))return s;ve(s)||(s=$e(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=a.reduce(((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const tt=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(De(s),i),t[o]=a),a(n)}};class nt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Fe.create("formatter"),this.options=e,this.formats={number:tt(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:tt(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:tt(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:tt(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:tt(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=tt(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));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.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):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))}}))}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 st extends qe{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=Fe.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}=Ce(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){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;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.call(this,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){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();ve(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ve(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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";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){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};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 it=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),ve(e[1])&&(t.defaultValue=e[1]),ve(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,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),rt=e=>(ve(e.ns)&&(e.ns=[e.ns]),ve(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ve(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),ot=()=>{};class at extends qe{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=rt(e),this.services={},this.logger=Fe,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(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(ve(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=it();this.options={...s,...this.options,...rt(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?Fe.init(i(this.modules.logger),this.options):Fe.init(null,this.options),t=this.modules.formatter?this.modules.formatter:nt;const n=new Ze(this.options);this.store=new Ve(this.options.resources,this.options);const r=this.services;r.logger=Fe,r.resourceStore=this.store,r.languageUtils=n,r.pluralResolver=new Ye(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(r.formatter=i(t),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new et(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new st(i(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=ot),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((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const r=Se(),o=()=>{const e=(e,t)=>{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),r.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),r}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot;const n=ve(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(n)s(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e)))}this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=Se();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=ot),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&&Ue.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"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=Se();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,o)=>{o?this.isLanguageChangingTo===e&&(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(r,(function(){return n.t(...arguments)}))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=this.services.languageUtils.getBestMatchFromCodes(ve(t)?[t]:t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{r(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const i=function(e,t){let r;if("object"!=typeof t){for(var o=arguments.length,a=new Array(o>2?o-2:0),l=2;l`${r.keyPrefix}${c}${e}`)):r.keyPrefix?`${r.keyPrefix}${c}${e}`:e,s.t(h,r)};return ve(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const 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=Se();return this.options.ns?(ve(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Se();ve(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>s.indexOf(e)<0&&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";const t=this.services?.languageUtils||new Ze(it());return["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"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new at(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new at(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]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});i.store=new Ve(e,s),i.services.resourceStore=i.store}return i.translator=new Je(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;sNumber(e)));const{slice:dt,forEach:ut}=[];const gt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ft={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(!gt.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!gt.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 s}(e,encodeURIComponent(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}};let xt=null;const wt=()=>{if(null!==xt)return xt;try{if(xt="undefined"!=typeof window&&null!==window.localStorage,!xt)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){xt=!1}return xt};var kt={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&wt())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&wt()&&window.localStorage.setItem(n,e)}};let yt=null;const vt=()=>{if(null!==yt)return yt;try{if(yt="undefined"!=typeof window&&null!==window.sessionStorage,!yt)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){yt=!1}return yt};var St={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&vt())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&vt()&&window.sessionStorage.setItem(n,e)}},$t={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}},Lt={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}},_t={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("/","")}},Rt={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 Ct=!1;try{document.cookie,Ct=!0}catch(e){}const Ot=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ct||Ot.splice(1,1);class Tt{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 ut.call(dt.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:Ot,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(mt),this.addDetector(bt),this.addDetector(kt),this.addDetector(St),this.addDetector($t),this.addDetector(Lt),this.addDetector(_t),this.addDetector(Rt)}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.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)})))}}let Et,At;Tt.type="languageDetector",lt.use(Tt).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:"Support Chat",send:"Send",inputMessage:"Enter a message..."}},ru:{translation:{phone:"Телефон",callAsk:"Давайте мы перезвоним вам и все расскажем",thanks:"Благодарим!",waitCall:"Ожидайте звонка!",workTechs:"Работает на технологиях",haveQues:"У вас есть вопросы?",supportChat:"Чат поддержки",send:"Отправить",inputMessage:"Введите сообщение..."}},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:"Tugivestluse chat",send:"Saada",inputMessage:"Sisestage sõnum..."}}},detection:{convertDetectedLanguage:e=>/ru/i.test(e)?"ru":/ee|et/i.test(e)?"ee":"en"}}),function(){const e=document.createElement("style");e.innerHTML="\n #lsw_chat-widget-container *,\n #lsw_chat-widget-container ::after,\n #lsw_chat-widget-container ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n #lsw_chat-widget-container .border-t {\n border-top-width: 1px\n }\n #lsw_chat-widget-container .bg-gray-800 {\n --tw-bg-opacity: 1;\n background-color: rgba(31, 41, 55, var(--tw-bg-opacity))\n }\n #lsw_chat-widget-container .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 #lsw_chat-widget-container .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 #lsw_chat-widget-container .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 #lsw_chat-widget-container .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 #lsw_chat-widget-container .border {\n border-width: 1px\n }\n #lsw_chat-widget-container .border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgba(209, 213, 219, var(--tw-border-opacity))\n }\n #lsw_chat-widget-container .rounded-md {\n border-radius: .375rem\n }\n #lsw_chat-widget-container .px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n }\n #lsw_chat-widget-container .py-2 {\n padding-top: .5rem;\n padding-bottom: .5rem\n }\n #lsw_chat-widget-container .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 #lsw_chat-widget-container .rounded-lg, #lsw_lead_catcher .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 #lsw_chat-widget-container .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 ",document.head.appendChild(e);const t=document.createElement("style");t.innerHTML=' \n #lsw_chat-widget-container {\n position: fixed;\n flex-direction: column;\n z-index: 10000000;\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n }\n #lsw_chat-widget-container p {\n margin: 0;\n }\n #chat-popup {\n height: 70vh;\n max-height: 70vh;\n transition: all 0.3s;\n overflow: hidden;\n width: 28em;\n bottom: 6em;\n -webkit-text-size-adjust: 100%;\n -webkit-appearance: none;\n }\n #chat-popup input{\n -webkit-appearance: none;\n }\n @media (max-width: 600px) {\n #chat-popup {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100vw;\n max-width: 100%;\n height: auto;\n max-height: 100vh;\n border-radius: 0;\n }\n }\n \n @keyframes bounce {\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n }\n \n .typing-indicator .dot {\n animation: bounce 1.4s infinite ease-in-out both;\n }\n \n .typing-indicator .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: rgba(255, 255, 255, 0.5);\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: 300%;\n height: 300%;\n margin-left: -150%;\n margin-top: -150%;\n animation-delay: 0s;\n }\n \n /* Позиционирование второй волны */\n .lsw_waves:nth-child(2) {\n left: 50%;\n top: 50%;\n width: 300%;\n height: 300%;\n margin-left: -150%;\n margin-top: -150%;\n animation-delay: -1s;\n }\n \n /* Позиционирование третьей волны */\n .lsw_waves:nth-child(3) {\n left: 50%;\n top: 50%;\n width: 300%;\n height: 300%;\n margin-left: -150%;\n margin-top: -150%;\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 ',document.head.appendChild(t)}();{let e=function(e){const t=document.createElement("div");t.id="lsw_chat-widget-container",t.style[pt[0]>0?"left":"right"]=Math.abs(pt[0])+"px",t.style[pt[1]>0?"bottom":"top"]=Math.abs(pt[1])+"px",t.style.color="black",t.style.display="flex",t.style.alignItems="flex-end",t.style.flexDirection="row",t.style.gap="10px",t.style.fontSize="100%",document.body.appendChild(t),t.innerHTML=`\n
    \n
    \n
    \n
    \n
    \n \n \n \n
    \n
    \n `;const n=document.createElement("ul");n.style.listStyle="none",n.style.display="flex",n.style.justifyContent="center",n.style.alignItems="center",n.style.flexDirection="column",t.appendChild(n),e?.length&&e.forEach((e=>{e.element&&n.appendChild(e.element)}));const s=document.getElementById("chat-input"),i=document.getElementById("chat-submit"),r=document.getElementById("wls_chat-messages"),o=document.getElementById("chat-bubble"),a=document.getElementById("chat-popup"),l=document.getElementById("close-popup"),c=t.querySelector(".animate");async function h(){a&&(a.classList.toggle("hidden"),a.classList.contains("hidden")?c&&c.classList.add("animate"):(ye.openChat(),c&&c.classList.remove("animate"),s.focus(),await we()&&be("Вас приветствует ИИ ассистент")))}return r&&r.addEventListener("wheel",(e=>{if(!e.target)return;e.preventDefault(),e.stopPropagation();const t=2*e.deltaY;r.scrollBy(0,t)}),{passive:!1}),i&&s&&(i.addEventListener("click",(async function(){if(ht)return;const e=s.value.trim();if(!e)return;ye.sendMessage(),ht=!0,be(e,!0);const t=await async function(e){let t=localStorage.getItem("aiwi_thread_id")||we();if(!t)return"Не могу ответить. Попробуйте позже. ";const n=new Headers;if(n.append("Content-Type","application/json"),ue){const s=await fetch(`${pe}/widget/request`,{method:"POST",headers:n,body:JSON.stringify({thread_id:t,message:e})}).then((e=>e.json())).catch((e=>console.log("error",e)));return s&&404!=s.statusCode||(ue=!1),""}{be();let s=`${pe}/assistants/threads/${t}/messages`;const i=JSON.stringify({role:"user",content:e}),r=await fetch(s,{method:"POST",headers:n,body:i}).then((async e=>{if(console.log("status",e.status),404==e.status){if(localStorage.removeItem("aiwi_thread_id"),t=await we(),!t)throw new Error("error update thread");return s=`${pe}/assistants/threads/${t}/messages`,(await fetch(s,{method:"POST",headers:n,body:i})).json()}return e.json()})).catch((e=>console.log("error",e)));if(r?.id)return new EventSource(`${pe}/assistants/threads/${t}/runs/67e3ecedcfa6c3836c819dc1`);if(r?.sent_at)return"";ge.report({url:s,headers:JSON.stringify(n),body:i,error:r})}return"Что-то идет не так. Попробуйте позже."}(e);ht=!1,t&&be(t)})),s.addEventListener("keyup",(function(e){"Enter"===e.key&&i.click()}))),o&&o.addEventListener("click",(function(){h()})),l&&l.addEventListener("click",(function(){h()})),xe(),we(),[t,pt[0]>0]}([]);Et=e[0],At=e[1]}(function(){const e=document.createElement("style");e.innerHTML='\n #lsw_lead_catcher a{ \n text-decoration:none;\n color:inherit;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher .i-lh-close {\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 10000000;\n }\n #lsw_lead_catcher .i-lh-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n min-width: 350px;\n background: #fff;\n overflow: hidden;\n position: relative;\n display: flex;\n flex-direction: column;\n }\n #lsw_lead_catcher .i-lh-main-desktop {\n min-width: 350px !important;\n }\n #lsw_lead_catcher .i-lh-header {\n font-size: 24px;\n line-height: 1.3 !important;\n margin-bottom: 12px;\n padding-top: 20px;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher .full-width {\n width: 100%;\n }\n #lsw_lead_catcher .i-lh-vertical {\n width: 100%;\n }\n #lsw_lead_catcher .i-lh-form {\n margin-bottom: 10px;\n }\n #lsw_lead_catcher .i-lh-form .i-lh-field {\n vertical-align: top;\n padding-bottom: 10px;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher .i-lh-input-wrapper {\n position: relative;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher .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 #lsw_lead_catcher *,\n #lsw_lead_catcher ::after,\n #lsw_lead_catcher ::before {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: currentColor\n }\n #lsw_lead_catcher .i-lh-input-iconed {\n padding-left: 30px !important;\n }\n #lsw_lead_catcher .agreement-wrapper {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n }\n #lsw_lead_catcher .svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n #lsw_lead_catcher .i-lh-agreement {\n border-collapse: collapse;\n }\n #lsw_lead_catcher .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 #lsw_lead_catcher .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 #lsw_lead_catcher .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 #lsw_lead_catcher .i-lh-footer-text {\n opacity: .3;\n }\n #lsw_lead_catcher .i-lh-footer {\n background: #f3f4f4;\n height: 28px;\n padding: 0 20px;\n font-size: 12px;\n line-height: 28px;\n }\n #lsw_lead_catcher .i-lh-input:focus {\n color: rgba(30, 25, 28);\n outline: 0;\n }\n #lsw_lead_catcher .i-lh-checkbox-wrapper {\n vertical-align: baseline;\n }\n #lsw_lead_catcher .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 ',document.head.appendChild(e);{const t=document.createElement("div");function n(){const e=Number(localStorage.getItem("lsw_lc_lps"));t&&(new Date).valueOf()-e>432e5&&t.classList.remove("hidden"),document.removeEventListener("mousemove",c)}function s(){t&&(t.classList.add("hidden"),localStorage.setItem("lsw_lc_lps",((new Date).valueOf()-432e5+36e4).toString()))}t.id="lsw_lead_catcher",t.classList.add("fixed","inset-0","bg-black","bg-opacity-25","flex","items-center","justify-center","hidden"),t.style.zIndex="100",t.style.boxShadow="-3px -1px 50px 19px rgba(34, 60, 80, 0.25)",t.innerHTML=`\n \x3c!-- Форма --\x3e\n
    \n \x3c!-- Кнопка закрытия --\x3e\n
    \n
    \n
    \n
    ${ct("haveQues")}
    \n
    ${ct("callAsk")}
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    `;const i=t.querySelector("#wls_closeModalBtn");i&&(i.addEventListener("click",(()=>{s()})),window.addEventListener("click",(e=>{e.target===t&&s()})));const r=t.querySelector("#lsw_waitCall");function o(e){const t=e.target;let n=0,s=t.value.replace(/\D/g,"").replace(/^8/,"7");var i,o;r.disabled=s.length<11,t.value="+_ (___) ___-__-__".replace(/./g,(function(e){return/[_\d]/.test(e)&&n=s.length?"":e})),"blur"==e.type?2==t.value.length&&(t.value=""):(i=t,o=t.value.length,i.focus(),i.setSelectionRange&&i.setSelectionRange(o,o))}const a=t.querySelector('input[name="wls_phoneNumber"]');a&&(a.addEventListener("input",o,!1),a.addEventListener("focus",o,!1),a.addEventListener("blur",o,!1),a.addEventListener("keydown",o,!1));const l=t.querySelector('input[name="wls_name"]');r&&r.addEventListener("click",(async e=>{if(ye.sendLead(),await fetch("https://apid.launchstrategies.ru/widget/lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistant:"67e3ecedcfa6c3836c819dc1",phone:a?a.value:"",name:l?l.value:"",url:window.location.origin+window.location.pathname})}).then((e=>e.json())).catch((e=>console.log("error",e)))){localStorage.setItem("lsw_lc_lps",(new Date).valueOf().toString());const e=document.querySelectorAll("#lsw_lead_catcher .i-lh-main-desktop");e?.length&&(e[0].style.display="none",e[1].style.display="")}})),document.body.appendChild(t);const c=e=>{const t=e.clientY,s=!!document.getElementById("stay-on-site-form");t<=10&&!s&&(n(),clearTimeout(h))};document.addEventListener("mousemove",c);const h=setTimeout((()=>{n()}),3e4),p=document.querySelector("#wls_ppach");p&&p.addEventListener("click",(e=>{const t=p.querySelector(".checkbox");t&&t.classList.toggle("checkbox-active")}))}})()})();