@n8n/chat 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,8 @@ This is an embeddable Chat widget for n8n. It allows the execution of AI-Powered
4
4
  ## Pre-requisites
5
5
  Create a n8n workflow which you want to execute via chat. The workflow has to be triggered using a **Webhook** node and return data using the **Respond to Webhook** node.
6
6
 
7
+ Open the **Webhook** node and add your domain to the **Domain Allowlist** field. This makes sure that only requests from your domain are accepted.
8
+
7
9
  [See example workflow](/resources/workflow.json)
8
10
 
9
11
  > Make sure the workflow is **Active.**
@@ -19,6 +21,8 @@ We use the `Switch` node to handle the different actions.
19
21
 
20
22
  ## Installation
21
23
 
24
+ Open the **Webhook** node and replace `YOUR_PRODUCTION_WEBHOOK_URL` with your production URL. This is the URL that the Chat widget will use to send requests to.
25
+
22
26
  ### a. CDN Embed
23
27
  Add the following code to your HTML page.
24
28
 
@@ -164,6 +168,48 @@ createChat({
164
168
  - **Description**: Whether to display the "Powered by n8n" footer in the Chat window.
165
169
 
166
170
 
171
+ ## Customization
172
+ The Chat window is entirely customizable using CSS variables.
173
+
174
+ ```css
175
+ :root {
176
+ --chat--color-primary: #e74266;
177
+ --chat--color-primary-shade-50: #db4061;
178
+ --chat--color-primary-shade-100: #cf3c5c;
179
+ --chat--color-secondary: #20b69e;
180
+ --chat--color-secondary-shade-50: #1ca08a;
181
+ --chat--color-white: #ffffff;
182
+ --chat--color-light: #f2f4f8;
183
+ --chat--color-light-shade-50: #e6e9f1;
184
+ --chat--color-light-shade-100: #c2c5cc;
185
+ --chat--color-medium: #d2d4d9;
186
+ --chat--color-dark: #101330;
187
+ --chat--color-disabled: #777980;
188
+ --chat--color-typing: #404040;
189
+
190
+ --chat--spacing: 1rem;
191
+ --chat--border-radius: 0.25rem;
192
+ --chat--transition-duration: 0.15s;
193
+
194
+ --chat--window--width: 400px;
195
+ --chat--window--height: 600px;
196
+
197
+ --chat--textarea--height: 50px;
198
+
199
+ --chat--message--bot--background: var(--chat--color-white);
200
+ --chat--message--bot--color: var(--chat--color-dark);
201
+ --chat--message--user--background: var(--chat--color-secondary);
202
+ --chat--message--user--color: var(--chat--color-white);
203
+ --chat--message--pre--background: rgba(0, 0, 0, 0.05);
204
+
205
+ --chat--toggle--background: var(--chat--color-primary);
206
+ --chat--toggle--hover--background: var(--chat--color-primary-shade-50);
207
+ --chat--toggle--active--background: var(--chat--color-primary-shade-100);
208
+ --chat--toggle--color: var(--chat--color-white);
209
+ --chat--toggle--size: 64px;
210
+ }
211
+ ```
212
+
167
213
  ## Caveats
168
214
 
169
215
  ### Fullscreen mode
package/chat.js CHANGED
@@ -7796,10 +7796,16 @@ const QH = /* @__PURE__ */ ae({
7796
7796
  const { options: e } = ct(), n = xe(() => e.mode === "fullscreen");
7797
7797
  return gn(() => {
7798
7798
  Dt.registerLanguage("xml", GH), Dt.registerLanguage("javascript", YH);
7799
- }), (r, o) => n.value ? (F(), ee(G(Go), { key: 0 })) : (F(), ee(G(HH), { key: 1 }));
7799
+ }), (r, o) => n.value ? (F(), ee(G(Go), {
7800
+ key: 0,
7801
+ class: "n8n-chat"
7802
+ })) : (F(), ee(G(HH), {
7803
+ key: 1,
7804
+ class: "n8n-chat"
7805
+ }));
7800
7806
  }
7801
7807
  });
7802
- function eG(t) {
7808
+ function e8(t) {
7803
7809
  var o, s;
7804
7810
  const e = {
7805
7811
  ...Je,
@@ -7826,5 +7832,5 @@ function eG(t) {
7826
7832
  return r.use(Bs()), r.provide(io, e), r.mount(n), r;
7827
7833
  }
7828
7834
  export {
7829
- eG as createChat
7835
+ e8 as createChat
7830
7836
  };
package/chat.umd.js CHANGED
@@ -26,4 +26,4 @@ This will fail in production.`);i=Be,i._s.has(r)||(s?Tt(r,e,o,i):Nn(r,o,i),proce
26
26
  `);return r},Re.prototype.render=function(t,e,n){var r,o,s,c="",i=this.rules;for(r=0,o=t.length;r<o;r++)s=t[r].type,s==="inline"?c+=this.renderInline(t[r].children,e,n):typeof i[s]<"u"?c+=i[t[r].type](t,r,e,n,this):c+=this.renderToken(t,r,e,n);return c};var $s=Re;function re(){this.__rules__=[],this.__cache__=null}re.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},re.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})},re.prototype.at=function(t,e,n){var r=this.__find__(t),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=o.alt||[],this.__cache__=null},re.prototype.before=function(t,e,n,r){var o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},re.prototype.after=function(t,e,n,r){var o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},re.prototype.push=function(t,e,n){var r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},re.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(r){var o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,n.push(r)},this),this.__cache__=null,n},re.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)},re.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(r){var o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,n.push(r)},this),this.__cache__=null,n},re.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};var Mt=re,zs=/\r\n?|\n/g,Gs=/\0/g,Hs=function(e){var n;n=e.src.replace(zs,`
27
27
  `),n=n.replace(Gs,"�"),e.src=n},js=function(e){var n;e.inlineMode?(n=new e.Token("inline","",0),n.content=e.src,n.map=[0,1],n.children=[],e.tokens.push(n)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},Zs=function(e){var n=e.tokens,r,o,s;for(o=0,s=n.length;o<s;o++)r=n[o],r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)},Ws=F.arrayReplaceAt;function Js(t){return/^<a[>\s]/i.test(t)}function Ks(t){return/^<\/a\s*>/i.test(t)}var Ys=function(e){var n,r,o,s,c,i,a,l,f,p,h,d,y,E,D,C,w=e.tokens,S;if(e.md.options.linkify){for(r=0,o=w.length;r<o;r++)if(!(w[r].type!=="inline"||!e.md.linkify.pretest(w[r].content)))for(s=w[r].children,y=0,n=s.length-1;n>=0;n--){if(i=s[n],i.type==="link_close"){for(n--;s[n].level!==i.level&&s[n].type!=="link_open";)n--;continue}if(i.type==="html_inline"&&(Js(i.content)&&y>0&&y--,Ks(i.content)&&y++),!(y>0)&&i.type==="text"&&e.md.linkify.test(i.content)){for(f=i.content,S=e.md.linkify.match(f),a=[],d=i.level,h=0,l=0;l<S.length;l++)E=S[l].url,D=e.md.normalizeLink(E),e.md.validateLink(D)&&(C=S[l].text,S[l].schema?S[l].schema==="mailto:"&&!/^mailto:/i.test(C)?C=e.md.normalizeLinkText("mailto:"+C).replace(/^mailto:/,""):C=e.md.normalizeLinkText(C):C=e.md.normalizeLinkText("http://"+C).replace(/^http:\/\//,""),p=S[l].index,p>h&&(c=new e.Token("text","",0),c.content=f.slice(h,p),c.level=d,a.push(c)),c=new e.Token("link_open","a",1),c.attrs=[["href",D]],c.level=d++,c.markup="linkify",c.info="auto",a.push(c),c=new e.Token("text","",0),c.content=C,c.level=d,a.push(c),c=new e.Token("link_close","a",-1),c.level=--d,c.markup="linkify",c.info="auto",a.push(c),h=S[l].lastIndex);h<f.length&&(c=new e.Token("text","",0),c.content=f.slice(h),c.level=d,a.push(c)),w[r].children=s=Ws(s,n,a)}}}},tr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Qs=/\((c|tm|r|p)\)/i,Xs=/\((c|tm|r|p)\)/ig,ec={c:"©",r:"®",p:"§",tm:"™"};function tc(t,e){return ec[e.toLowerCase()]}function nc(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!r&&(n.content=n.content.replace(Xs,tc)),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}function rc(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!r&&tr.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}var oc=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(Qs.test(e.tokens[n].content)&&nc(e.tokens[n].children),tr.test(e.tokens[n].content)&&rc(e.tokens[n].children))},nr=F.isWhiteSpace,rr=F.isPunctChar,or=F.isMdAsciiPunct,sc=/['"]/,sr=/['"]/g,cr="’";function ct(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function cc(t,e){var n,r,o,s,c,i,a,l,f,p,h,d,y,E,D,C,w,S,T,R,x;for(T=[],n=0;n<t.length;n++){for(r=t[n],a=t[n].level,w=T.length-1;w>=0&&!(T[w].level<=a);w--);if(T.length=w+1,r.type==="text"){o=r.content,c=0,i=o.length;e:for(;c<i&&(sr.lastIndex=c,s=sr.exec(o),!!s);){if(D=C=!0,c=s.index+1,S=s[0]==="'",f=32,s.index-1>=0)f=o.charCodeAt(s.index-1);else for(w=n-1;w>=0&&!(t[w].type==="softbreak"||t[w].type==="hardbreak");w--)if(t[w].content){f=t[w].content.charCodeAt(t[w].content.length-1);break}if(p=32,c<i)p=o.charCodeAt(c);else for(w=n+1;w<t.length&&!(t[w].type==="softbreak"||t[w].type==="hardbreak");w++)if(t[w].content){p=t[w].content.charCodeAt(0);break}if(h=or(f)||rr(String.fromCharCode(f)),d=or(p)||rr(String.fromCharCode(p)),y=nr(f),E=nr(p),E?D=!1:d&&(y||h||(D=!1)),y?C=!1:h&&(E||d||(C=!1)),p===34&&s[0]==='"'&&f>=48&&f<=57&&(C=D=!1),D&&C&&(D=h,C=d),!D&&!C){S&&(r.content=ct(r.content,s.index,cr));continue}if(C){for(w=T.length-1;w>=0&&(l=T[w],!(T[w].level<a));w--)if(l.single===S&&T[w].level===a){l=T[w],S?(R=e.md.options.quotes[2],x=e.md.options.quotes[3]):(R=e.md.options.quotes[0],x=e.md.options.quotes[1]),r.content=ct(r.content,s.index,x),t[l.token].content=ct(t[l.token].content,l.pos,R),c+=x.length-1,l.token===n&&(c+=R.length-1),o=r.content,i=o.length,T.length=w;continue e}}D?T.push({token:n,pos:s.index,single:S,level:a}):C&&S&&(r.content=ct(r.content,s.index,cr))}}}}var ic=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type!=="inline"||!sc.test(e.tokens[n].content)||cc(e.tokens[n].children,e)};function Ne(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ne.prototype.attrIndex=function(e){var n,r,o;if(!this.attrs)return-1;for(n=this.attrs,r=0,o=n.length;r<o;r++)if(n[r][0]===e)return r;return-1},Ne.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Ne.prototype.attrSet=function(e,n){var r=this.attrIndex(e),o=[e,n];r<0?this.attrPush(o):this.attrs[r]=o},Ne.prototype.attrGet=function(e){var n=this.attrIndex(e),r=null;return n>=0&&(r=this.attrs[n][1]),r},Ne.prototype.attrJoin=function(e,n){var r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};var Bt=Ne,ac=Bt;function ir(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}ir.prototype.Token=ac;var lc=ir,uc=Mt,Ft=[["normalize",Hs],["block",js],["inline",Zs],["linkify",Ys],["replacements",oc],["smartquotes",ic]];function Pt(){this.ruler=new uc;for(var t=0;t<Ft.length;t++)this.ruler.push(Ft[t][0],Ft[t][1])}Pt.prototype.process=function(t){var e,n,r;for(r=this.ruler.getRules(""),e=0,n=r.length;e<n;e++)r[e](t)},Pt.prototype.State=lc;var fc=Pt,Ut=F.isSpace;function Vt(t,e){var n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.substr(n,r-n)}function ar(t){var e=[],n=0,r=t.length,o,s=!1,c=0,i="";for(o=t.charCodeAt(n);n<r;)o===124&&(s?(i+=t.substring(c,n-1),c=n):(e.push(i+t.substring(c,n)),i="",c=n+1)),s=o===92,n++,o=t.charCodeAt(n);return e.push(i+t.substring(c)),e}var pc=function(e,n,r,o){var s,c,i,a,l,f,p,h,d,y,E,D,C,w,S,T,R,x;if(n+2>r||(f=n+1,e.sCount[f]<e.blkIndent)||e.sCount[f]-e.blkIndent>=4||(i=e.bMarks[f]+e.tShift[f],i>=e.eMarks[f])||(R=e.src.charCodeAt(i++),R!==124&&R!==45&&R!==58)||i>=e.eMarks[f]||(x=e.src.charCodeAt(i++),x!==124&&x!==45&&x!==58&&!Ut(x))||R===45&&Ut(x))return!1;for(;i<e.eMarks[f];){if(s=e.src.charCodeAt(i),s!==124&&s!==45&&s!==58&&!Ut(s))return!1;i++}for(c=Vt(e,n+1),p=c.split("|"),y=[],a=0;a<p.length;a++){if(E=p[a].trim(),!E){if(a===0||a===p.length-1)continue;return!1}if(!/^:?-+:?$/.test(E))return!1;E.charCodeAt(E.length-1)===58?y.push(E.charCodeAt(0)===58?"center":"right"):E.charCodeAt(0)===58?y.push("left"):y.push("")}if(c=Vt(e,n).trim(),c.indexOf("|")===-1||e.sCount[n]-e.blkIndent>=4||(p=ar(c),p.length&&p[0]===""&&p.shift(),p.length&&p[p.length-1]===""&&p.pop(),h=p.length,h===0||h!==y.length))return!1;if(o)return!0;for(w=e.parentType,e.parentType="table",T=e.md.block.ruler.getRules("blockquote"),d=e.push("table_open","table",1),d.map=D=[n,0],d=e.push("thead_open","thead",1),d.map=[n,n+1],d=e.push("tr_open","tr",1),d.map=[n,n+1],a=0;a<p.length;a++)d=e.push("th_open","th",1),y[a]&&(d.attrs=[["style","text-align:"+y[a]]]),d=e.push("inline","",0),d.content=p[a].trim(),d.children=[],d=e.push("th_close","th",-1);for(d=e.push("tr_close","tr",-1),d=e.push("thead_close","thead",-1),f=n+2;f<r&&!(e.sCount[f]<e.blkIndent);f++){for(S=!1,a=0,l=T.length;a<l;a++)if(T[a](e,f,r,!0)){S=!0;break}if(S||(c=Vt(e,f).trim(),!c)||e.sCount[f]-e.blkIndent>=4)break;for(p=ar(c),p.length&&p[0]===""&&p.shift(),p.length&&p[p.length-1]===""&&p.pop(),f===n+2&&(d=e.push("tbody_open","tbody",1),d.map=C=[n+2,0]),d=e.push("tr_open","tr",1),d.map=[f,f+1],a=0;a<h;a++)d=e.push("td_open","td",1),y[a]&&(d.attrs=[["style","text-align:"+y[a]]]),d=e.push("inline","",0),d.content=p[a]?p[a].trim():"",d.children=[],d=e.push("td_close","td",-1);d=e.push("tr_close","tr",-1)}return C&&(d=e.push("tbody_close","tbody",-1),C[1]=f),d=e.push("table_close","table",-1),D[1]=f,e.parentType=w,e.line=f,!0},hc=function(e,n,r){var o,s,c;if(e.sCount[n]-e.blkIndent<4)return!1;for(s=o=n+1;o<r;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}return e.line=s,c=e.push("code_block","code",0),c.content=e.getLines(n,s,4+e.blkIndent,!1)+`
28
28
  `,c.map=[n,e.line],!0},dc=function(e,n,r,o){var s,c,i,a,l,f,p,h=!1,d=e.bMarks[n]+e.tShift[n],y=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||d+3>y||(s=e.src.charCodeAt(d),s!==126&&s!==96)||(l=d,d=e.skipChars(d,s),c=d-l,c<3)||(p=e.src.slice(l,d),i=e.src.slice(d,y),s===96&&i.indexOf(String.fromCharCode(s))>=0))return!1;if(o)return!0;for(a=n;a++,!(a>=r||(d=l=e.bMarks[a]+e.tShift[a],y=e.eMarks[a],d<y&&e.sCount[a]<e.blkIndent));)if(e.src.charCodeAt(d)===s&&!(e.sCount[a]-e.blkIndent>=4)&&(d=e.skipChars(d,s),!(d-l<c)&&(d=e.skipSpaces(d),!(d<y)))){h=!0;break}return c=e.sCount[n],e.line=a+(h?1:0),f=e.push("fence","code",0),f.info=i,f.content=e.getLines(n+1,a,c,!0),f.markup=p,f.map=[n,e.line],!0},lr=F.isSpace,gc=function(e,n,r,o){var s,c,i,a,l,f,p,h,d,y,E,D,C,w,S,T,R,x,v,V,$=e.lineMax,m=e.bMarks[n]+e.tShift[n],b=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(m++)!==62)return!1;if(o)return!0;for(a=d=e.sCount[n]+1,e.src.charCodeAt(m)===32?(m++,a++,d++,s=!1,T=!0):e.src.charCodeAt(m)===9?(T=!0,(e.bsCount[n]+d)%4===3?(m++,a++,d++,s=!1):s=!0):T=!1,y=[e.bMarks[n]],e.bMarks[n]=m;m<b&&(c=e.src.charCodeAt(m),lr(c));){c===9?d+=4-(d+e.bsCount[n]+(s?1:0))%4:d++;m++}for(E=[e.bsCount[n]],e.bsCount[n]=e.sCount[n]+1+(T?1:0),f=m>=b,w=[e.sCount[n]],e.sCount[n]=d-a,S=[e.tShift[n]],e.tShift[n]=m-e.bMarks[n],x=e.md.block.ruler.getRules("blockquote"),C=e.parentType,e.parentType="blockquote",h=n+1;h<r&&(V=e.sCount[h]<e.blkIndent,m=e.bMarks[h]+e.tShift[h],b=e.eMarks[h],!(m>=b));h++){if(e.src.charCodeAt(m++)===62&&!V){for(a=d=e.sCount[h]+1,e.src.charCodeAt(m)===32?(m++,a++,d++,s=!1,T=!0):e.src.charCodeAt(m)===9?(T=!0,(e.bsCount[h]+d)%4===3?(m++,a++,d++,s=!1):s=!0):T=!1,y.push(e.bMarks[h]),e.bMarks[h]=m;m<b&&(c=e.src.charCodeAt(m),lr(c));){c===9?d+=4-(d+e.bsCount[h]+(s?1:0))%4:d++;m++}f=m>=b,E.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(T?1:0),w.push(e.sCount[h]),e.sCount[h]=d-a,S.push(e.tShift[h]),e.tShift[h]=m-e.bMarks[h];continue}if(f)break;for(R=!1,i=0,l=x.length;i<l;i++)if(x[i](e,h,r,!0)){R=!0;break}if(R){e.lineMax=h,e.blkIndent!==0&&(y.push(e.bMarks[h]),E.push(e.bsCount[h]),S.push(e.tShift[h]),w.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}y.push(e.bMarks[h]),E.push(e.bsCount[h]),S.push(e.tShift[h]),w.push(e.sCount[h]),e.sCount[h]=-1}for(D=e.blkIndent,e.blkIndent=0,v=e.push("blockquote_open","blockquote",1),v.markup=">",v.map=p=[n,0],e.md.block.tokenize(e,n,h),v=e.push("blockquote_close","blockquote",-1),v.markup=">",e.lineMax=$,e.parentType=C,p[1]=e.line,i=0;i<S.length;i++)e.bMarks[i+n]=y[i],e.tShift[i+n]=S[i],e.sCount[i+n]=w[i],e.bsCount[i+n]=E[i];return e.blkIndent=D,!0},mc=F.isSpace,bc=function(e,n,r,o){var s,c,i,a,l=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(s=e.src.charCodeAt(l++),s!==42&&s!==45&&s!==95))return!1;for(c=1;l<f;){if(i=e.src.charCodeAt(l++),i!==s&&!mc(i))return!1;i===s&&c++}return c<3?!1:(o||(e.line=n+1,a=e.push("hr","hr",0),a.map=[n,e.line],a.markup=Array(c+1).join(String.fromCharCode(s))),!0)},ur=F.isSpace;function fr(t,e){var n,r,o,s;return r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],n=t.src.charCodeAt(r++),n!==42&&n!==45&&n!==43||r<o&&(s=t.src.charCodeAt(r),!ur(s))?-1:r}function pr(t,e){var n,r=t.bMarks[e]+t.tShift[e],o=r,s=t.eMarks[e];if(o+1>=s||(n=t.src.charCodeAt(o++),n<48||n>57))return-1;for(;;){if(o>=s)return-1;if(n=t.src.charCodeAt(o++),n>=48&&n<=57){if(o-r>=10)return-1;continue}if(n===41||n===46)break;return-1}return o<s&&(n=t.src.charCodeAt(o),!ur(n))?-1:o}function _c(t,e){var n,r,o=t.level+2;for(n=e+2,r=t.tokens.length-2;n<r;n++)t.tokens[n].level===o&&t.tokens[n].type==="paragraph_open"&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}var kc=function(e,n,r,o){var s,c,i,a,l,f,p,h,d,y,E,D,C,w,S,T,R,x,v,V,$,m,b,M,G,_,P,I,g=!1,k=!0;if(e.sCount[n]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[n]-e.listIndent>=4&&e.sCount[n]<e.blkIndent)return!1;if(o&&e.parentType==="paragraph"&&e.sCount[n]>=e.blkIndent&&(g=!0),(b=pr(e,n))>=0){if(p=!0,G=e.bMarks[n]+e.tShift[n],C=Number(e.src.slice(G,b-1)),g&&C!==1)return!1}else if((b=fr(e,n))>=0)p=!1;else return!1;if(g&&e.skipSpaces(b)>=e.eMarks[n])return!1;if(D=e.src.charCodeAt(b-1),o)return!0;for(E=e.tokens.length,p?(I=e.push("ordered_list_open","ol",1),C!==1&&(I.attrs=[["start",C]])):I=e.push("bullet_list_open","ul",1),I.map=y=[n,0],I.markup=String.fromCharCode(D),S=n,M=!1,P=e.md.block.ruler.getRules("list"),x=e.parentType,e.parentType="list";S<r;){for(m=b,w=e.eMarks[S],f=T=e.sCount[S]+b-(e.bMarks[n]+e.tShift[n]);m<w;){if(s=e.src.charCodeAt(m),s===9)T+=4-(T+e.bsCount[S])%4;else if(s===32)T++;else break;m++}if(c=m,c>=w?l=1:l=T-f,l>4&&(l=1),a=f+l,I=e.push("list_item_open","li",1),I.markup=String.fromCharCode(D),I.map=h=[n,0],p&&(I.info=e.src.slice(G,b-1)),$=e.tight,V=e.tShift[n],v=e.sCount[n],R=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=a,e.tight=!0,e.tShift[n]=c-e.bMarks[n],e.sCount[n]=T,c>=w&&e.isEmpty(n+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,n,r,!0),(!e.tight||M)&&(k=!1),M=e.line-n>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=R,e.tShift[n]=V,e.sCount[n]=v,e.tight=$,I=e.push("list_item_close","li",-1),I.markup=String.fromCharCode(D),S=n=e.line,h[1]=S,c=e.bMarks[n],S>=r||e.sCount[S]<e.blkIndent||e.sCount[n]-e.blkIndent>=4)break;for(_=!1,i=0,d=P.length;i<d;i++)if(P[i](e,S,r,!0)){_=!0;break}if(_)break;if(p){if(b=pr(e,S),b<0)break;G=e.bMarks[S]+e.tShift[S]}else if(b=fr(e,S),b<0)break;if(D!==e.src.charCodeAt(b-1))break}return p?I=e.push("ordered_list_close","ol",-1):I=e.push("bullet_list_close","ul",-1),I.markup=String.fromCharCode(D),y[1]=S,e.line=S,e.parentType=x,k&&_c(e,E),!0},yc=F.normalizeReference,it=F.isSpace,wc=function(e,n,r,o){var s,c,i,a,l,f,p,h,d,y,E,D,C,w,S,T,R=0,x=e.bMarks[n]+e.tShift[n],v=e.eMarks[n],V=n+1;if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(x)!==91)return!1;for(;++x<v;)if(e.src.charCodeAt(x)===93&&e.src.charCodeAt(x-1)!==92){if(x+1===v||e.src.charCodeAt(x+1)!==58)return!1;break}for(a=e.lineMax,S=e.md.block.ruler.getRules("reference"),y=e.parentType,e.parentType="reference";V<a&&!e.isEmpty(V);V++)if(!(e.sCount[V]-e.blkIndent>3)&&!(e.sCount[V]<0)){for(w=!1,f=0,p=S.length;f<p;f++)if(S[f](e,V,a,!0)){w=!0;break}if(w)break}for(C=e.getLines(n,V,e.blkIndent,!1).trim(),v=C.length,x=1;x<v;x++){if(s=C.charCodeAt(x),s===91)return!1;if(s===93){d=x;break}else s===10?R++:s===92&&(x++,x<v&&C.charCodeAt(x)===10&&R++)}if(d<0||C.charCodeAt(d+1)!==58)return!1;for(x=d+2;x<v;x++)if(s=C.charCodeAt(x),s===10)R++;else if(!it(s))break;if(E=e.md.helpers.parseLinkDestination(C,x,v),!E.ok||(l=e.md.normalizeLink(E.str),!e.md.validateLink(l)))return!1;for(x=E.pos,R+=E.lines,c=x,i=R,D=x;x<v;x++)if(s=C.charCodeAt(x),s===10)R++;else if(!it(s))break;for(E=e.md.helpers.parseLinkTitle(C,x,v),x<v&&D!==x&&E.ok?(T=E.str,x=E.pos,R+=E.lines):(T="",x=c,R=i);x<v&&(s=C.charCodeAt(x),!!it(s));)x++;if(x<v&&C.charCodeAt(x)!==10&&T)for(T="",x=c,R=i;x<v&&(s=C.charCodeAt(x),!!it(s));)x++;return x<v&&C.charCodeAt(x)!==10||(h=yc(C.slice(1,d)),!h)?!1:(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[h]>"u"&&(e.env.references[h]={title:T,href:l}),e.parentType=y,e.line=n+R+1),!0)},xc=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],at={},Ec="[a-zA-Z_:][a-zA-Z0-9:._-]*",vc="[^\"'=<>`\\x00-\\x20]+",Ac="'[^']*'",Cc='"[^"]*"',Sc="(?:"+vc+"|"+Ac+"|"+Cc+")",Dc="(?:\\s+"+Ec+"(?:\\s*=\\s*"+Sc+")?)",hr="<[A-Za-z][A-Za-z0-9\\-]*"+Dc+"*\\s*\\/?>",dr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",qc="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",Tc="<[?][\\s\\S]*?[?]>",Rc="<![A-Z]+\\s+[^>]*>",Nc="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Lc=new RegExp("^(?:"+hr+"|"+dr+"|"+qc+"|"+Tc+"|"+Rc+"|"+Nc+")"),Oc=new RegExp("^(?:"+hr+"|"+dr+")");at.HTML_TAG_RE=Lc,at.HTML_OPEN_CLOSE_TAG_RE=Oc;var Ic=xc,Mc=at.HTML_OPEN_CLOSE_TAG_RE,Le=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Ic.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Mc.source+"\\s*$"),/^$/,!1]],Bc=function(e,n,r,o){var s,c,i,a,l=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(l)!==60)return!1;for(a=e.src.slice(l,f),s=0;s<Le.length&&!Le[s][0].test(a);s++);if(s===Le.length)return!1;if(o)return Le[s][2];if(c=n+1,!Le[s][1].test(a)){for(;c<r&&!(e.sCount[c]<e.blkIndent);c++)if(l=e.bMarks[c]+e.tShift[c],f=e.eMarks[c],a=e.src.slice(l,f),Le[s][1].test(a)){a.length!==0&&c++;break}}return e.line=c,i=e.push("html_block","",0),i.map=[n,c],i.content=e.getLines(n,c,e.blkIndent,!0),!0},gr=F.isSpace,Fc=function(e,n,r,o){var s,c,i,a,l=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(s=e.src.charCodeAt(l),s!==35||l>=f))return!1;for(c=1,s=e.src.charCodeAt(++l);s===35&&l<f&&c<=6;)c++,s=e.src.charCodeAt(++l);return c>6||l<f&&!gr(s)?!1:(o||(f=e.skipSpacesBack(f,l),i=e.skipCharsBack(f,35,l),i>l&&gr(e.src.charCodeAt(i-1))&&(f=i),e.line=n+1,a=e.push("heading_open","h"+String(c),1),a.markup="########".slice(0,c),a.map=[n,e.line],a=e.push("inline","",0),a.content=e.src.slice(l,f).trim(),a.map=[n,e.line],a.children=[],a=e.push("heading_close","h"+String(c),-1),a.markup="########".slice(0,c)),!0)},Pc=function(e,n,r){var o,s,c,i,a,l,f,p,h,d=n+1,y,E=e.md.block.ruler.getRules("paragraph");if(e.sCount[n]-e.blkIndent>=4)return!1;for(y=e.parentType,e.parentType="paragraph";d<r&&!e.isEmpty(d);d++)if(!(e.sCount[d]-e.blkIndent>3)){if(e.sCount[d]>=e.blkIndent&&(l=e.bMarks[d]+e.tShift[d],f=e.eMarks[d],l<f&&(h=e.src.charCodeAt(l),(h===45||h===61)&&(l=e.skipChars(l,h),l=e.skipSpaces(l),l>=f)))){p=h===61?1:2;break}if(!(e.sCount[d]<0)){for(s=!1,c=0,i=E.length;c<i;c++)if(E[c](e,d,r,!0)){s=!0;break}if(s)break}}return p?(o=e.getLines(n,d,e.blkIndent,!1).trim(),e.line=d+1,a=e.push("heading_open","h"+String(p),1),a.markup=String.fromCharCode(h),a.map=[n,e.line],a=e.push("inline","",0),a.content=o,a.map=[n,e.line-1],a.children=[],a=e.push("heading_close","h"+String(p),-1),a.markup=String.fromCharCode(h),e.parentType=y,!0):!1},Uc=function(e,n){var r,o,s,c,i,a,l=n+1,f=e.md.block.ruler.getRules("paragraph"),p=e.lineMax;for(a=e.parentType,e.parentType="paragraph";l<p&&!e.isEmpty(l);l++)if(!(e.sCount[l]-e.blkIndent>3)&&!(e.sCount[l]<0)){for(o=!1,s=0,c=f.length;s<c;s++)if(f[s](e,l,p,!0)){o=!0;break}if(o)break}return r=e.getLines(n,l,e.blkIndent,!1).trim(),e.line=l,i=e.push("paragraph_open","p",1),i.map=[n,e.line],i=e.push("inline","",0),i.content=r,i.map=[n,e.line],i.children=[],i=e.push("paragraph_close","p",-1),e.parentType=a,!0},mr=Bt,lt=F.isSpace;function ie(t,e,n,r){var o,s,c,i,a,l,f,p;for(this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",s=this.src,p=!1,c=i=l=f=0,a=s.length;i<a;i++){if(o=s.charCodeAt(i),!p)if(lt(o)){l++,o===9?f+=4-f%4:f++;continue}else p=!0;(o===10||i===a-1)&&(o!==10&&i++,this.bMarks.push(c),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(f),this.bsCount.push(0),p=!1,l=0,f=0,c=i+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ie.prototype.push=function(t,e,n){var r=new mr(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},ie.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ie.prototype.skipEmptyLines=function(e){for(var n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ie.prototype.skipSpaces=function(e){for(var n,r=this.src.length;e<r&&(n=this.src.charCodeAt(e),!!lt(n));e++);return e},ie.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!lt(this.src.charCodeAt(--e)))return e+1;return e},ie.prototype.skipChars=function(e,n){for(var r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e},ie.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e},ie.prototype.getLines=function(e,n,r,o){var s,c,i,a,l,f,p,h=e;if(e>=n)return"";for(f=new Array(n-e),s=0;h<n;h++,s++){for(c=0,p=a=this.bMarks[h],h+1<n||o?l=this.eMarks[h]+1:l=this.eMarks[h];a<l&&c<r;){if(i=this.src.charCodeAt(a),lt(i))i===9?c+=4-(c+this.bsCount[h])%4:c++;else if(a-p<this.tShift[h])c++;else break;a++}c>r?f[s]=new Array(c-r+1).join(" ")+this.src.slice(a,l):f[s]=this.src.slice(a,l)}return f.join("")},ie.prototype.Token=mr;var Vc=ie,$c=Mt,ut=[["table",pc,["paragraph","reference"]],["code",hc],["fence",dc,["paragraph","reference","blockquote","list"]],["blockquote",gc,["paragraph","reference","blockquote","list"]],["hr",bc,["paragraph","reference","blockquote","list"]],["list",kc,["paragraph","reference","blockquote"]],["reference",wc],["html_block",Bc,["paragraph","reference","blockquote"]],["heading",Fc,["paragraph","reference","blockquote"]],["lheading",Pc],["paragraph",Uc]];function ft(){this.ruler=new $c;for(var t=0;t<ut.length;t++)this.ruler.push(ut[t][0],ut[t][1],{alt:(ut[t][2]||[]).slice()})}ft.prototype.tokenize=function(t,e,n){for(var r,o,s=this.ruler.getRules(""),c=s.length,i=e,a=!1,l=t.md.options.maxNesting;i<n&&(t.line=i=t.skipEmptyLines(i),!(i>=n||t.sCount[i]<t.blkIndent));){if(t.level>=l){t.line=n;break}for(o=0;o<c&&(r=s[o](t,i,n,!1),!r);o++);t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),i=t.line,i<n&&t.isEmpty(i)&&(a=!0,i++,t.line=i)}},ft.prototype.parse=function(t,e,n,r){var o;t&&(o=new this.State(t,e,n,r),this.tokenize(o,o.line,o.lineMax))},ft.prototype.State=Vc;var zc=ft;function Gc(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}for(var Hc=function(e,n){for(var r=e.pos;r<e.posMax&&!Gc(e.src.charCodeAt(r));)r++;return r===e.pos?!1:(n||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)},jc=F.isSpace,Zc=function(e,n){var r,o,s,c=e.pos;if(e.src.charCodeAt(c)!==10)return!1;if(r=e.pending.length-1,o=e.posMax,!n)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){for(s=r-1;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(c++;c<o&&jc(e.src.charCodeAt(c));)c++;return e.pos=c,!0},Wc=F.isSpace,$t=[],br=0;br<256;br++)$t.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){$t[t.charCodeAt(0)]=1});var Jc=function(e,n){var r,o=e.pos,s=e.posMax;if(e.src.charCodeAt(o)!==92)return!1;if(o++,o<s){if(r=e.src.charCodeAt(o),r<256&&$t[r]!==0)return n||(e.pending+=e.src[o]),e.pos+=2,!0;if(r===10){for(n||e.push("hardbreak","br",0),o++;o<s&&(r=e.src.charCodeAt(o),!!Wc(r));)o++;return e.pos=o,!0}}return n||(e.pending+="\\"),e.pos++,!0},Kc=function(e,n){var r,o,s,c,i,a,l,f,p=e.pos,h=e.src.charCodeAt(p);if(h!==96)return!1;for(r=p,p++,o=e.posMax;p<o&&e.src.charCodeAt(p)===96;)p++;if(s=e.src.slice(r,p),l=s.length,e.backticksScanned&&(e.backticks[l]||0)<=r)return n||(e.pending+=s),e.pos+=l,!0;for(i=a=p;(i=e.src.indexOf("`",a))!==-1;){for(a=i+1;a<o&&e.src.charCodeAt(a)===96;)a++;if(f=a-i,f===l)return n||(c=e.push("code_inline","code",0),c.markup=s,c.content=e.src.slice(p,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=a,!0;e.backticks[f]=i}return e.backticksScanned=!0,n||(e.pending+=s),e.pos+=l,!0},pt={};pt.tokenize=function(e,n){var r,o,s,c,i,a=e.pos,l=e.src.charCodeAt(a);if(n||l!==126||(o=e.scanDelims(e.pos,!0),c=o.length,i=String.fromCharCode(l),c<2))return!1;for(c%2&&(s=e.push("text","",0),s.content=i,c--),r=0;r<c;r+=2)s=e.push("text","",0),s.content=i+i,e.delimiters.push({marker:l,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0};function _r(t,e){var n,r,o,s,c,i=[],a=e.length;for(n=0;n<a;n++)o=e[n],o.marker===126&&o.end!==-1&&(s=e[o.end],c=t.tokens[o.token],c.type="s_open",c.tag="s",c.nesting=1,c.markup="~~",c.content="",c=t.tokens[s.token],c.type="s_close",c.tag="s",c.nesting=-1,c.markup="~~",c.content="",t.tokens[s.token-1].type==="text"&&t.tokens[s.token-1].content==="~"&&i.push(s.token-1));for(;i.length;){for(n=i.pop(),r=n+1;r<t.tokens.length&&t.tokens[r].type==="s_close";)r++;r--,n!==r&&(c=t.tokens[r],t.tokens[r]=t.tokens[n],t.tokens[n]=c)}}pt.postProcess=function(e){var n,r=e.tokens_meta,o=e.tokens_meta.length;for(_r(e,e.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&_r(e,r[n].delimiters)};var ht={};ht.tokenize=function(e,n){var r,o,s,c=e.pos,i=e.src.charCodeAt(c);if(n||i!==95&&i!==42)return!1;for(o=e.scanDelims(e.pos,i===42),r=0;r<o.length;r++)s=e.push("text","",0),s.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0};function kr(t,e){var n,r,o,s,c,i,a=e.length;for(n=a-1;n>=0;n--)r=e[n],!(r.marker!==95&&r.marker!==42)&&r.end!==-1&&(o=e[r.end],i=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1,c=String.fromCharCode(r.marker),s=t.tokens[r.token],s.type=i?"strong_open":"em_open",s.tag=i?"strong":"em",s.nesting=1,s.markup=i?c+c:c,s.content="",s=t.tokens[o.token],s.type=i?"strong_close":"em_close",s.tag=i?"strong":"em",s.nesting=-1,s.markup=i?c+c:c,s.content="",i&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}ht.postProcess=function(e){var n,r=e.tokens_meta,o=e.tokens_meta.length;for(kr(e,e.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&kr(e,r[n].delimiters)};var Yc=F.normalizeReference,zt=F.isSpace,Qc=function(e,n){var r,o,s,c,i,a,l,f,p,h="",d="",y=e.pos,E=e.posMax,D=e.pos,C=!0;if(e.src.charCodeAt(e.pos)!==91||(i=e.pos+1,c=e.md.helpers.parseLinkLabel(e,e.pos,!0),c<0))return!1;if(a=c+1,a<E&&e.src.charCodeAt(a)===40){for(C=!1,a++;a<E&&(o=e.src.charCodeAt(a),!(!zt(o)&&o!==10));a++);if(a>=E)return!1;if(D=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok){for(h=e.md.normalizeLink(l.str),e.md.validateLink(h)?a=l.pos:h="",D=a;a<E&&(o=e.src.charCodeAt(a),!(!zt(o)&&o!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<E&&D!==a&&l.ok)for(d=l.str,a=l.pos;a<E&&(o=e.src.charCodeAt(a),!(!zt(o)&&o!==10));a++);}(a>=E||e.src.charCodeAt(a)!==41)&&(C=!0),a++}if(C){if(typeof e.env.references>"u")return!1;if(a<E&&e.src.charCodeAt(a)===91?(D=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?s=e.src.slice(D,a++):a=c+1):a=c+1,s||(s=e.src.slice(i,c)),f=e.env.references[Yc(s)],!f)return e.pos=y,!1;h=f.href,d=f.title}return n||(e.pos=i,e.posMax=c,p=e.push("link_open","a",1),p.attrs=r=[["href",h]],d&&r.push(["title",d]),e.md.inline.tokenize(e),p=e.push("link_close","a",-1)),e.pos=a,e.posMax=E,!0},Xc=F.normalizeReference,Gt=F.isSpace,ei=function(e,n){var r,o,s,c,i,a,l,f,p,h,d,y,E,D="",C=e.pos,w=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(a=e.pos+2,i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),i<0))return!1;if(l=i+1,l<w&&e.src.charCodeAt(l)===40){for(l++;l<w&&(o=e.src.charCodeAt(l),!(!Gt(o)&&o!==10));l++);if(l>=w)return!1;for(E=l,p=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),p.ok&&(D=e.md.normalizeLink(p.str),e.md.validateLink(D)?l=p.pos:D=""),E=l;l<w&&(o=e.src.charCodeAt(l),!(!Gt(o)&&o!==10));l++);if(p=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<w&&E!==l&&p.ok)for(h=p.str,l=p.pos;l<w&&(o=e.src.charCodeAt(l),!(!Gt(o)&&o!==10));l++);else h="";if(l>=w||e.src.charCodeAt(l)!==41)return e.pos=C,!1;l++}else{if(typeof e.env.references>"u")return!1;if(l<w&&e.src.charCodeAt(l)===91?(E=l+1,l=e.md.helpers.parseLinkLabel(e,l),l>=0?c=e.src.slice(E,l++):l=i+1):l=i+1,c||(c=e.src.slice(a,i)),f=e.env.references[Xc(c)],!f)return e.pos=C,!1;D=f.href,h=f.title}return n||(s=e.src.slice(a,i),e.md.inline.parse(s,e.md,e.env,y=[]),d=e.push("image","img",0),d.attrs=r=[["src",D],["alt",""]],d.children=y,d.content=s,h&&r.push(["title",h])),e.pos=l,e.posMax=w,!0},ti=/^([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])?)*)$/,ni=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,ri=function(e,n){var r,o,s,c,i,a,l=e.pos;if(e.src.charCodeAt(l)!==60)return!1;for(i=e.pos,a=e.posMax;;){if(++l>=a||(c=e.src.charCodeAt(l),c===60))return!1;if(c===62)break}return r=e.src.slice(i+1,l),ni.test(r)?(o=e.md.normalizeLink(r),e.md.validateLink(o)?(n||(s=e.push("link_open","a",1),s.attrs=[["href",o]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):ti.test(r)?(o=e.md.normalizeLink("mailto:"+r),e.md.validateLink(o)?(n||(s=e.push("link_open","a",1),s.attrs=[["href",o]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):!1},oi=at.HTML_TAG_RE;function si(t){var e=t|32;return e>=97&&e<=122}var ci=function(e,n){var r,o,s,c,i=e.pos;return!e.md.options.html||(s=e.posMax,e.src.charCodeAt(i)!==60||i+2>=s)||(r=e.src.charCodeAt(i+1),r!==33&&r!==63&&r!==47&&!si(r))||(o=e.src.slice(i).match(oi),!o)?!1:(n||(c=e.push("html_inline","",0),c.content=e.src.slice(i,i+o[0].length)),e.pos+=o[0].length,!0)},yr=Fn,ii=F.has,ai=F.isValidEntityCode,wr=F.fromCodePoint,li=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,ui=/^&([a-z][a-z0-9]{1,31});/i,fi=function(e,n){var r,o,s,c=e.pos,i=e.posMax;if(e.src.charCodeAt(c)!==38)return!1;if(c+1<i){if(r=e.src.charCodeAt(c+1),r===35){if(s=e.src.slice(c).match(li),s)return n||(o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),e.pending+=ai(o)?wr(o):wr(65533)),e.pos+=s[0].length,!0}else if(s=e.src.slice(c).match(ui),s&&ii(yr,s[1]))return n||(e.pending+=yr[s[1]]),e.pos+=s[0].length,!0}return n||(e.pending+="&"),e.pos++,!0};function xr(t,e){var n,r,o,s,c,i,a,l,f={},p=e.length;if(p){var h=0,d=-2,y=[];for(n=0;n<p;n++)if(o=e[n],y.push(0),(e[h].marker!==o.marker||d!==o.token-1)&&(h=n),d=o.token,o.length=o.length||0,!!o.close){for(f.hasOwnProperty(o.marker)||(f[o.marker]=[-1,-1,-1,-1,-1,-1]),c=f[o.marker][(o.open?3:0)+o.length%3],r=h-y[h]-1,i=r;r>c;r-=y[r]+1)if(s=e[r],s.marker===o.marker&&s.open&&s.end<0&&(a=!1,(s.close||o.open)&&(s.length+o.length)%3===0&&(s.length%3!==0||o.length%3!==0)&&(a=!0),!a)){l=r>0&&!e[r-1].open?y[r-1]+1:0,y[n]=n-r+l,y[r]=l,o.open=!1,s.end=n,s.close=!1,i=-1,d=-2;break}i!==-1&&(f[o.marker][(o.open?3:0)+(o.length||0)%3]=i)}}}var pi=function(e){var n,r=e.tokens_meta,o=e.tokens_meta.length;for(xr(e,e.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&xr(e,r[n].delimiters)},hi=function(e){var n,r,o=0,s=e.tokens,c=e.tokens.length;for(n=r=0;n<c;n++)s[n].nesting<0&&o--,s[n].level=o,s[n].nesting>0&&o++,s[n].type==="text"&&n+1<c&&s[n+1].type==="text"?s[n+1].content=s[n].content+s[n+1].content:(n!==r&&(s[r]=s[n]),r++);n!==r&&(s.length=r)},Ht=Bt,Er=F.isWhiteSpace,vr=F.isPunctChar,Ar=F.isMdAsciiPunct;function $e(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}$e.prototype.pushPending=function(){var t=new Ht("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},$e.prototype.push=function(t,e,n){this.pending&&this.pushPending();var r=new Ht(t,e,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},$e.prototype.scanDelims=function(t,e){var n=t,r,o,s,c,i,a,l,f,p,h=!0,d=!0,y=this.posMax,E=this.src.charCodeAt(t);for(r=t>0?this.src.charCodeAt(t-1):32;n<y&&this.src.charCodeAt(n)===E;)n++;return s=n-t,o=n<y?this.src.charCodeAt(n):32,l=Ar(r)||vr(String.fromCharCode(r)),p=Ar(o)||vr(String.fromCharCode(o)),a=Er(r),f=Er(o),f?h=!1:p&&(a||l||(h=!1)),a?d=!1:l&&(f||p||(d=!1)),e?(c=h,i=d):(c=h&&(!d||l),i=d&&(!h||p)),{can_open:c,can_close:i,length:s}},$e.prototype.Token=Ht;var di=$e,Cr=Mt,jt=[["text",Hc],["newline",Zc],["escape",Jc],["backticks",Kc],["strikethrough",pt.tokenize],["emphasis",ht.tokenize],["link",Qc],["image",ei],["autolink",ri],["html_inline",ci],["entity",fi]],Zt=[["balance_pairs",pi],["strikethrough",pt.postProcess],["emphasis",ht.postProcess],["text_collapse",hi]];function ze(){var t;for(this.ruler=new Cr,t=0;t<jt.length;t++)this.ruler.push(jt[t][0],jt[t][1]);for(this.ruler2=new Cr,t=0;t<Zt.length;t++)this.ruler2.push(Zt[t][0],Zt[t][1])}ze.prototype.skipToken=function(t){var e,n,r=t.pos,o=this.ruler.getRules(""),s=o.length,c=t.md.options.maxNesting,i=t.cache;if(typeof i[r]<"u"){t.pos=i[r];return}if(t.level<c)for(n=0;n<s&&(t.level++,e=o[n](t,!0),t.level--,!e);n++);else t.pos=t.posMax;e||t.pos++,i[r]=t.pos},ze.prototype.tokenize=function(t){for(var e,n,r=this.ruler.getRules(""),o=r.length,s=t.posMax,c=t.md.options.maxNesting;t.pos<s;){if(t.level<c)for(n=0;n<o&&(e=r[n](t,!1),!e);n++);if(e){if(t.pos>=s)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},ze.prototype.parse=function(t,e,n,r){var o,s,c,i=new this.State(t,e,n,r);for(this.tokenize(i),s=this.ruler2.getRules(""),c=s.length,o=0;o<c;o++)s[o](i)},ze.prototype.State=di;var gi=ze,Wt,Sr;function mi(){return Sr||(Sr=1,Wt=function(t){var e={};e.src_Any=Zn().source,e.src_Cc=Jn().source,e.src_Z=Qn().source,e.src_P=Rt.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+").|;(?!"+e.src_ZCc+").|\\!+(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),Wt}function Jt(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function dt(t){return Object.prototype.toString.call(t)}function bi(t){return dt(t)==="[object String]"}function _i(t){return dt(t)==="[object Object]"}function ki(t){return dt(t)==="[object RegExp]"}function Dr(t){return dt(t)==="[object Function]"}function yi(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var qr={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function wi(t){return Object.keys(t||{}).reduce(function(e,n){return e||qr.hasOwnProperty(n)},!1)}var xi={"http:":{validate:function(t,e,n){var r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Ei="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",vi="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Ai(t){t.__index__=-1,t.__text_cache__=""}function Ci(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function Tr(){return function(t,e){e.normalize(t)}}function gt(t){var e=t.re=mi()(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(Ei),n.push(e.src_xn),e.src_tlds=n.join("|");function r(i){return i.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var o=[];t.__compiled__={};function s(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(t.__schemas__).forEach(function(i){var a=t.__schemas__[i];if(a!==null){var l={validate:null,link:null};if(t.__compiled__[i]=l,_i(a)){ki(a.validate)?l.validate=Ci(a.validate):Dr(a.validate)?l.validate=a.validate:s(i,a),Dr(a.normalize)?l.normalize=a.normalize:a.normalize?s(i,a):l.normalize=Tr();return}if(bi(a)){o.push(i);return}s(i,a)}}),o.forEach(function(i){t.__compiled__[t.__schemas__[i]]&&(t.__compiled__[i].validate=t.__compiled__[t.__schemas__[i]].validate,t.__compiled__[i].normalize=t.__compiled__[t.__schemas__[i]].normalize)}),t.__compiled__[""]={validate:null,normalize:Tr()};var c=Object.keys(t.__compiled__).filter(function(i){return i.length>0&&t.__compiled__[i]}).map(yi).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),Ai(t)}function Si(t,e){var n=t.__index__,r=t.__last_index__,o=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=o,this.text=o,this.url=o}function Rr(t,e){var n=new Si(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function ee(t,e){if(!(this instanceof ee))return new ee(t,e);e||wi(t)&&(e=t,t={}),this.__opts__=Jt({},qr,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Jt({},xi,t),this.__compiled__={},this.__tlds__=vi,this.__tlds_replaced__=!1,this.re={},gt(this)}ee.prototype.add=function(e,n){return this.__schemas__[e]=n,gt(this),this},ee.prototype.set=function(e){return this.__opts__=Jt(this.__opts__,e),this},ee.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var n,r,o,s,c,i,a,l,f;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(e))!==null;)if(s=this.testSchemaAt(e,n[2],a.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=r.index+r[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(f=e.indexOf("@"),f>=0&&(o=e.match(this.re.email_fuzzy))!==null&&(c=o.index+o[1].length,i=o.index+o[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=i))),this.__index__>=0},ee.prototype.pretest=function(e){return this.re.pretest.test(e)},ee.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0},ee.prototype.match=function(e){var n=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Rr(this,n)),n=this.__last_index__);for(var o=n?e.slice(n):e;this.test(o);)r.push(Rr(this,n)),o=o.slice(this.__last_index__),n+=this.__last_index__;return r.length?r:null},ee.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,o,s){return r!==s[o-1]}).reverse(),gt(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,gt(this),this)},ee.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},ee.prototype.onCompile=function(){};var Di=ee;const Oe=2147483647,ae=36,Kt=1,Ge=26,qi=38,Ti=700,Nr=72,Lr=128,Or="-",Ri=/^xn--/,Ni=/[^\0-\x7E]/,Li=/[\x2E\u3002\uFF0E\uFF61]/g,Oi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Yt=ae-Kt,le=Math.floor,Qt=String.fromCharCode;function xe(t){throw new RangeError(Oi[t])}function Ii(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Ir(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(Li,".");const o=t.split("."),s=Ii(o,e).join(".");return r+s}function Xt(t){const e=[];let n=0;const r=t.length;for(;n<r;){const o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((o&1023)<<10)+(s&1023)+65536):(e.push(o),n--)}else e.push(o)}return e}const Mr=t=>String.fromCodePoint(...t),Mi=function(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:ae},Br=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Fr=function(t,e,n){let r=0;for(t=n?le(t/Ti):t>>1,t+=le(t/e);t>Yt*Ge>>1;r+=ae)t=le(t/Yt);return le(r+(Yt+1)*t/(t+qi))},en=function(t){const e=[],n=t.length;let r=0,o=Lr,s=Nr,c=t.lastIndexOf(Or);c<0&&(c=0);for(let i=0;i<c;++i)t.charCodeAt(i)>=128&&xe("not-basic"),e.push(t.charCodeAt(i));for(let i=c>0?c+1:0;i<n;){let a=r;for(let f=1,p=ae;;p+=ae){i>=n&&xe("invalid-input");const h=Mi(t.charCodeAt(i++));(h>=ae||h>le((Oe-r)/f))&&xe("overflow"),r+=h*f;const d=p<=s?Kt:p>=s+Ge?Ge:p-s;if(h<d)break;const y=ae-d;f>le(Oe/y)&&xe("overflow"),f*=y}const l=e.length+1;s=Fr(r-a,l,a==0),le(r/l)>Oe-o&&xe("overflow"),o+=le(r/l),r%=l,e.splice(r++,0,o)}return String.fromCodePoint(...e)},tn=function(t){const e=[];t=Xt(t);let n=t.length,r=Lr,o=0,s=Nr;for(const a of t)a<128&&e.push(Qt(a));let c=e.length,i=c;for(c&&e.push(Or);i<n;){let a=Oe;for(const f of t)f>=r&&f<a&&(a=f);const l=i+1;a-r>le((Oe-o)/l)&&xe("overflow"),o+=(a-r)*l,r=a;for(const f of t)if(f<r&&++o>Oe&&xe("overflow"),f===r){let p=o;for(let h=ae;;h+=ae){const d=h<=s?Kt:h>=s+Ge?Ge:h-s;if(p<d)break;const y=p-d,E=ae-d;e.push(Qt(Br(d+y%E,0))),p=le(y/E)}e.push(Qt(Br(p,0))),s=Fr(o,l,i===c),o=0,++i}++o,++r}return e.join("")},Pr=function(t){return Ir(t,function(e){return Ri.test(e)?en(e.slice(4).toLowerCase()):e})},Ur=function(t){return Ir(t,function(e){return Ni.test(e)?"xn--"+tn(e):e})},Bi=_s(Object.freeze(Object.defineProperty({__proto__:null,decode:en,default:{version:"2.1.0",ucs2:{decode:Xt,encode:Mr},decode:en,encode:tn,toASCII:Ur,toUnicode:Pr},encode:tn,toASCII:Ur,toUnicode:Pr,ucs2decode:Xt,ucs2encode:Mr},Symbol.toStringTag,{value:"Module"})));var Fi={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Pi={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}},Ui={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}},He=F,Vi=st,$i=$s,zi=fc,Gi=zc,Hi=gi,ji=Di,Ee=Te,Vr=Bi,Zi={default:Fi,zero:Pi,commonmark:Ui},Wi=/^(vbscript|javascript|file|data):/,Ji=/^data:image\/(gif|png|jpeg|webp);/;function Ki(t){var e=t.trim().toLowerCase();return Wi.test(e)?!!Ji.test(e):!0}var $r=["http:","https:","mailto:"];function Yi(t){var e=Ee.parse(t,!0);if(e.hostname&&(!e.protocol||$r.indexOf(e.protocol)>=0))try{e.hostname=Vr.toASCII(e.hostname)}catch{}return Ee.encode(Ee.format(e))}function Qi(t){var e=Ee.parse(t,!0);if(e.hostname&&(!e.protocol||$r.indexOf(e.protocol)>=0))try{e.hostname=Vr.toUnicode(e.hostname)}catch{}return Ee.decode(Ee.format(e),Ee.decode.defaultChars+"%")}function te(t,e){if(!(this instanceof te))return new te(t,e);e||He.isString(t)||(e=t||{},t="default"),this.inline=new Hi,this.block=new Gi,this.core=new zi,this.renderer=new $i,this.linkify=new ji,this.validateLink=Ki,this.normalizeLink=Yi,this.normalizeLinkText=Qi,this.utils=He,this.helpers=He.assign({},Vi),this.options={},this.configure(t),e&&this.set(e)}te.prototype.set=function(t){return He.assign(this.options,t),this},te.prototype.configure=function(t){var e=this,n;if(He.isString(t)&&(n=t,t=Zi[n],!t))throw new Error('Wrong `markdown-it` preset "'+n+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this},te.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},te.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},te.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},te.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},te.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},te.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},te.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var Xi=te,ea=Xi;const ta=Bn(ea);var na=u.defineComponent({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,required:!1}},data:function(){return{md:null}},computed:{content:function(){var t,e=this.source;return(t=this.md)===null||t===void 0?void 0:t.render(e)}},created:function(){var t;this.md=new ta((t=this.options)!==null&&t!==void 0?t:{})},render:function(){return u.h("div",{innerHTML:this.content})}});const ra=na;function zr(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&zr(n)}),t}class Gr{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Hr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ge(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const o in r)n[o]=r[o]}),n}const oa="</span>",jr=t=>!!t.scope,sa=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`};class ca{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Hr(e)}openNode(e){if(!jr(e))return;const n=sa(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){jr(e)&&(this.buffer+=oa)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Zr=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class nn{constructor(){this.rootNode=Zr(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=Zr({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{nn._collapse(n)}))}}class ia extends nn{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new ca(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function je(t){return t?typeof t=="string"?t:t.source:null}function Wr(t){return ve("(?=",t,")")}function aa(t){return ve("(?:",t,")*")}function la(t){return ve("(?:",t,")?")}function ve(...t){return t.map(n=>je(n)).join("")}function ua(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function rn(...t){return"("+(ua(t).capture?"":"?:")+t.map(r=>je(r)).join("|")+")"}function Jr(t){return new RegExp(t.toString()+"|").exec("").length-1}function fa(t,e){const n=t&&t.exec(e);return n&&n.index===0}const pa=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function on(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const o=n;let s=je(r),c="";for(;s.length>0;){const i=pa.exec(s);if(!i){c+=s;break}c+=s.substring(0,i.index),s=s.substring(i.index+i[0].length),i[0][0]==="\\"&&i[1]?c+="\\"+String(Number(i[1])+o):(c+=i[0],i[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(e)}const ha=/\b\B/,Kr="[a-zA-Z]\\w*",sn="[a-zA-Z_]\\w*",Yr="\\b\\d+(\\.\\d+)?",Qr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Xr="\\b(0b[01]+)",da="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ga=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=ve(e,/.*\b/,t.binary,/\b.*/)),ge({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Ze={begin:"\\\\[\\s\\S]",relevance:0},ma={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ze]},ba={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ze]},_a={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},mt=function(t,e,n={}){const r=ge({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=rn("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ve(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ka=mt("//","$"),ya=mt("/\\*","\\*/"),wa=mt("#","$"),xa={scope:"number",begin:Yr,relevance:0},Ea={scope:"number",begin:Qr,relevance:0},va={scope:"number",begin:Xr,relevance:0},Aa={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Ze,{begin:/\[/,end:/\]/,relevance:0,contains:[Ze]}]}]},Ca={scope:"title",begin:Kr,relevance:0},Sa={scope:"title",begin:sn,relevance:0},Da={begin:"\\.\\s*"+sn,relevance:0};var bt=Object.freeze({__proto__:null,MATCH_NOTHING_RE:ha,IDENT_RE:Kr,UNDERSCORE_IDENT_RE:sn,NUMBER_RE:Yr,C_NUMBER_RE:Qr,BINARY_NUMBER_RE:Xr,RE_STARTERS_RE:da,SHEBANG:ga,BACKSLASH_ESCAPE:Ze,APOS_STRING_MODE:ma,QUOTE_STRING_MODE:ba,PHRASAL_WORDS_MODE:_a,COMMENT:mt,C_LINE_COMMENT_MODE:ka,C_BLOCK_COMMENT_MODE:ya,HASH_COMMENT_MODE:wa,NUMBER_MODE:xa,C_NUMBER_MODE:Ea,BINARY_NUMBER_MODE:va,REGEXP_MODE:Aa,TITLE_MODE:Ca,UNDERSCORE_TITLE_MODE:Sa,METHOD_GUARD:Da,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function qa(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Ta(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Ra(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=qa,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Na(t,e){Array.isArray(t.illegal)&&(t.illegal=rn(...t.illegal))}function La(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Oa(t,e){t.relevance===void 0&&(t.relevance=1)}const Ia=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=ve(n.beforeMatch,Wr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ma=["of","and","for","in","not","or","if","then","parent","list","value"],Ba="keyword";function eo(t,e,n=Ba){const r=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(s){Object.assign(r,eo(t[s],e,s))}),r;function o(s,c){e&&(c=c.map(i=>i.toLowerCase())),c.forEach(function(i){const a=i.split("|");r[a[0]]=[s,Fa(a[0],a[1])]})}}function Fa(t,e){return e?Number(e):Pa(t)?0:1}function Pa(t){return Ma.includes(t.toLowerCase())}const to={},Ae=t=>{console.error(t)},no=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Ie=(t,e)=>{to[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),to[`${t}/${e}`]=!0)},_t=new Error;function ro(t,e,{key:n}){let r=0;const o=t[n],s={},c={};for(let i=1;i<=e.length;i++)c[i+r]=o[i],s[i+r]=!0,r+=Jr(e[i-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Ua(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ae("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),_t;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ae("beginScope must be object"),_t;ro(t,t.begin,{key:"beginScope"}),t.begin=on(t.begin,{joinWith:""})}}function Va(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ae("skip, excludeEnd, returnEnd not compatible with endScope: {}"),_t;if(typeof t.endScope!="object"||t.endScope===null)throw Ae("endScope must be object"),_t;ro(t,t.end,{key:"endScope"}),t.end=on(t.end,{joinWith:""})}}function $a(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function za(t){$a(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ua(t),Va(t)}function Ga(t){function e(c,i){return new RegExp(je(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(i?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(i,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,i]),this.matchAt+=Jr(i)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const i=this.regexes.map(a=>a[1]);this.matcherRe=e(on(i,{joinWith:"|"}),!0),this.lastIndex=0}exec(i){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(i);if(!a)return null;const l=a.findIndex((p,h)=>h>0&&p!==void 0),f=this.matchIndexes[l];return a.splice(0,l),Object.assign(a,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(i){if(this.multiRegexes[i])return this.multiRegexes[i];const a=new n;return this.rules.slice(i).forEach(([l,f])=>a.addRule(l,f)),a.compile(),this.multiRegexes[i]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(i,a){this.rules.push([i,a]),a.type==="begin"&&this.count++}exec(i){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let l=a.exec(i);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,l=f.exec(i)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function o(c){const i=new r;return c.contains.forEach(a=>i.addRule(a.begin,{rule:a,type:"begin"})),c.terminatorEnd&&i.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&i.addRule(c.illegal,{type:"illegal"}),i}function s(c,i){const a=c;if(c.isCompiled)return a;[Ta,La,za,Ia].forEach(f=>f(c,i)),t.compilerExtensions.forEach(f=>f(c,i)),c.__beforeBegin=null,[Ra,Na,Oa].forEach(f=>f(c,i)),c.isCompiled=!0;let l=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),l=c.keywords.$pattern,delete c.keywords.$pattern),l=l||/\w+/,c.keywords&&(c.keywords=eo(c.keywords,t.case_insensitive)),a.keywordPatternRe=e(l,!0),i&&(c.begin||(c.begin=/\B|\b/),a.beginRe=e(a.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(a.endRe=e(a.end)),a.terminatorEnd=je(a.end)||"",c.endsWithParent&&i.terminatorEnd&&(a.terminatorEnd+=(c.end?"|":"")+i.terminatorEnd)),c.illegal&&(a.illegalRe=e(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(f){return Ha(f==="self"?c:f)})),c.contains.forEach(function(f){s(f,a)}),c.starts&&s(c.starts,i),a.matcher=o(a),a}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=ge(t.classNameAliases||{}),s(t)}function oo(t){return t?t.endsWithParent||oo(t.starts):!1}function Ha(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return ge(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:oo(t)?ge(t,{starts:t.starts?ge(t.starts):null}):Object.isFrozen(t)?ge(t):t}var ja="11.8.0";class Za extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const cn=Hr,so=ge,co=Symbol("nomatch"),Wa=7,io=function(t){const e=Object.create(null),n=Object.create(null),r=[];let o=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let i={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ia};function a(g){return i.noHighlightRe.test(g)}function l(g){let k=g.className+" ";k+=g.parentNode?g.parentNode.className:"";const L=i.languageDetectRe.exec(k);if(L){const B=$(L[1]);return B||(no(s.replace("{}",L[1])),no("Falling back to no-highlight mode for this block.",g)),B?L[1]:"no-highlight"}return k.split(/\s+/).find(B=>a(B)||$(B))}function f(g,k,L){let B="",H="";typeof k=="object"?(B=g,L=k.ignoreIllegals,H=k.language):(Ie("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ie("10.7.0",`Please use highlight(code, options) instead.
29
- https://github.com/highlightjs/highlight.js/issues/2277`),H=g,B=k),L===void 0&&(L=!0);const Y={code:B,language:H};P("before:highlight",Y);const oe=Y.result?Y.result:p(Y.language,Y.code,L);return oe.code=Y.code,P("after:highlight",oe),oe}function p(g,k,L,B){const H=Object.create(null);function Y(A,q){return A.keywords[q]}function oe(){if(!N.keywords){W.addText(z);return}let A=0;N.keywordPatternRe.lastIndex=0;let q=N.keywordPatternRe.exec(z),O="";for(;q;){O+=z.substring(A,q.index);const U=fe.case_insensitive?q[0].toLowerCase():q[0],K=Y(N,U);if(K){const[he,Ul]=K;if(W.addText(O),O="",H[U]=(H[U]||0)+1,H[U]<=Wa&&(Et+=Ul),he.startsWith("_"))O+=q[0];else{const Vl=fe.classNameAliases[he]||he;ue(q[0],Vl)}}else O+=q[0];A=N.keywordPatternRe.lastIndex,q=N.keywordPatternRe.exec(z)}O+=z.substring(A),W.addText(O)}function wt(){if(z==="")return;let A=null;if(typeof N.subLanguage=="string"){if(!e[N.subLanguage]){W.addText(z);return}A=p(N.subLanguage,z,!0,wo[N.subLanguage]),wo[N.subLanguage]=A._top}else A=d(z,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(Et+=A.relevance),W.__addSublanguage(A._emitter,A.language)}function Q(){N.subLanguage!=null?wt():oe(),z=""}function ue(A,q){A!==""&&(W.startScope(q),W.addText(A),W.endScope())}function bo(A,q){let O=1;const U=q.length-1;for(;O<=U;){if(!A._emit[O]){O++;continue}const K=fe.classNameAliases[A[O]]||A[O],he=q[O];K?ue(he,K):(z=he,oe(),z=""),O++}}function _o(A,q){return A.scope&&typeof A.scope=="string"&&W.openNode(fe.classNameAliases[A.scope]||A.scope),A.beginScope&&(A.beginScope._wrap?(ue(z,fe.classNameAliases[A.beginScope._wrap]||A.beginScope._wrap),z=""):A.beginScope._multi&&(bo(A.beginScope,q),z="")),N=Object.create(A,{parent:{value:N}}),N}function ko(A,q,O){let U=fa(A.endRe,O);if(U){if(A["on:end"]){const K=new Gr(A);A["on:end"](q,K),K.isMatchIgnored&&(U=!1)}if(U){for(;A.endsParent&&A.parent;)A=A.parent;return A}}if(A.endsWithParent)return ko(A.parent,q,O)}function Il(A){return N.matcher.regexIndex===0?(z+=A[0],1):(hn=!0,0)}function Ml(A){const q=A[0],O=A.rule,U=new Gr(O),K=[O.__beforeBegin,O["on:begin"]];for(const he of K)if(he&&(he(A,U),U.isMatchIgnored))return Il(q);return O.skip?z+=q:(O.excludeBegin&&(z+=q),Q(),!O.returnBegin&&!O.excludeBegin&&(z=q)),_o(O,A),O.returnBegin?0:q.length}function Bl(A){const q=A[0],O=k.substring(A.index),U=ko(N,A,O);if(!U)return co;const K=N;N.endScope&&N.endScope._wrap?(Q(),ue(q,N.endScope._wrap)):N.endScope&&N.endScope._multi?(Q(),bo(N.endScope,A)):K.skip?z+=q:(K.returnEnd||K.excludeEnd||(z+=q),Q(),K.excludeEnd&&(z=q));do N.scope&&W.closeNode(),!N.skip&&!N.subLanguage&&(Et+=N.relevance),N=N.parent;while(N!==U.parent);return U.starts&&_o(U.starts,A),K.returnEnd?0:q.length}function Fl(){const A=[];for(let q=N;q!==fe;q=q.parent)q.scope&&A.unshift(q.scope);A.forEach(q=>W.openNode(q))}let xt={};function yo(A,q){const O=q&&q[0];if(z+=A,O==null)return Q(),0;if(xt.type==="begin"&&q.type==="end"&&xt.index===q.index&&O===""){if(z+=k.slice(q.index,q.index+1),!o){const U=new Error(`0 width match regex (${g})`);throw U.languageName=g,U.badRule=xt.rule,U}return 1}if(xt=q,q.type==="begin")return Ml(q);if(q.type==="illegal"&&!L){const U=new Error('Illegal lexeme "'+O+'" for mode "'+(N.scope||"<unnamed>")+'"');throw U.mode=N,U}else if(q.type==="end"){const U=Bl(q);if(U!==co)return U}if(q.type==="illegal"&&O==="")return 1;if(pn>1e5&&pn>q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return z+=O,O.length}const fe=$(g);if(!fe)throw Ae(s.replace("{}",g)),new Error('Unknown language: "'+g+'"');const Pl=Ga(fe);let fn="",N=B||Pl;const wo={},W=new i.__emitter(i);Fl();let z="",Et=0,Ce=0,pn=0,hn=!1;try{if(fe.__emitTokens)fe.__emitTokens(k,W);else{for(N.matcher.considerAll();;){pn++,hn?hn=!1:N.matcher.considerAll(),N.matcher.lastIndex=Ce;const A=N.matcher.exec(k);if(!A)break;const q=k.substring(Ce,A.index),O=yo(q,A);Ce=A.index+O}yo(k.substring(Ce))}return W.finalize(),fn=W.toHTML(),{language:g,value:fn,relevance:Et,illegal:!1,_emitter:W,_top:N}}catch(A){if(A.message&&A.message.includes("Illegal"))return{language:g,value:cn(k),illegal:!0,relevance:0,_illegalBy:{message:A.message,index:Ce,context:k.slice(Ce-100,Ce+100),mode:A.mode,resultSoFar:fn},_emitter:W};if(o)return{language:g,value:cn(k),illegal:!1,relevance:0,errorRaised:A,_emitter:W,_top:N};throw A}}function h(g){const k={value:cn(g),illegal:!1,relevance:0,_top:c,_emitter:new i.__emitter(i)};return k._emitter.addText(g),k}function d(g,k){k=k||i.languages||Object.keys(e);const L=h(g),B=k.filter($).filter(b).map(Q=>p(Q,g,!1));B.unshift(L);const H=B.sort((Q,ue)=>{if(Q.relevance!==ue.relevance)return ue.relevance-Q.relevance;if(Q.language&&ue.language){if($(Q.language).supersetOf===ue.language)return 1;if($(ue.language).supersetOf===Q.language)return-1}return 0}),[Y,oe]=H,wt=Y;return wt.secondBest=oe,wt}function y(g,k,L){const B=k&&n[k]||L;g.classList.add("hljs"),g.classList.add(`language-${B}`)}function E(g){let k=null;const L=l(g);if(a(L))return;if(P("before:highlightElement",{el:g,language:L}),g.children.length>0&&(i.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(g)),i.throwUnescapedHTML))throw new Za("One of your code blocks includes unescaped HTML.",g.innerHTML);k=g;const B=k.textContent,H=L?f(B,{language:L,ignoreIllegals:!0}):d(B);g.innerHTML=H.value,y(g,L,H.language),g.result={language:H.language,re:H.relevance,relevance:H.relevance},H.secondBest&&(g.secondBest={language:H.secondBest.language,relevance:H.secondBest.relevance}),P("after:highlightElement",{el:g,result:H,text:B})}function D(g){i=so(i,g)}const C=()=>{T(),Ie("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){T(),Ie("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function T(){if(document.readyState==="loading"){S=!0;return}document.querySelectorAll(i.cssSelector).forEach(E)}function R(){S&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",R,!1);function x(g,k){let L=null;try{L=k(t)}catch(B){if(Ae("Language definition for '{}' could not be registered.".replace("{}",g)),o)Ae(B);else throw B;L=c}L.name||(L.name=g),e[g]=L,L.rawDefinition=k.bind(null,t),L.aliases&&m(L.aliases,{languageName:g})}function v(g){delete e[g];for(const k of Object.keys(n))n[k]===g&&delete n[k]}function V(){return Object.keys(e)}function $(g){return g=(g||"").toLowerCase(),e[g]||e[n[g]]}function m(g,{languageName:k}){typeof g=="string"&&(g=[g]),g.forEach(L=>{n[L.toLowerCase()]=k})}function b(g){const k=$(g);return k&&!k.disableAutodetect}function M(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=k=>{g["before:highlightBlock"](Object.assign({block:k.el},k))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=k=>{g["after:highlightBlock"](Object.assign({block:k.el},k))})}function G(g){M(g),r.push(g)}function _(g){const k=r.indexOf(g);k!==-1&&r.splice(k,1)}function P(g,k){const L=g;r.forEach(function(B){B[L]&&B[L](k)})}function I(g){return Ie("10.7.0","highlightBlock will be removed entirely in v12.0"),Ie("10.7.0","Please use highlightElement now."),E(g)}Object.assign(t,{highlight:f,highlightAuto:d,highlightAll:T,highlightElement:E,highlightBlock:I,configure:D,initHighlighting:C,initHighlightingOnLoad:w,registerLanguage:x,unregisterLanguage:v,listLanguages:V,getLanguage:$,registerAliases:m,autoDetection:b,inherit:so,addPlugin:G,removePlugin:_}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=ja,t.regex={concat:ve,lookahead:Wr,either:rn,optional:la,anyNumberOfTimes:aa};for(const g in bt)typeof bt[g]=="object"&&zr(bt[g]);return Object.assign(t,bt),t},Me=io({});Me.newInstance=()=>io({});var Ja=Me;Me.HighlightJS=Me,Me.default=Me;const kt=Bn(Ja),an=u.defineComponent({__name:"Message",props:{message:{type:Object,required:!0}},setup(t){const e=t,{message:n}=u.toRefs(e),r=u.computed(()=>({"chat-message-from-user":n.value.sender==="user","chat-message-from-bot":n.value.sender==="bot"})),o={highlight(s,c){if(c&&kt.getLanguage(c))try{return kt.highlight(s,{language:c}).value}catch{}return""}};return(s,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["chat-message",r.value])},[u.renderSlot(s.$slots,"default",{},()=>[u.createVNode(u.unref(ra),{class:"chat-message-markdown",source:u.unref(n).text,options:o},null,8,["source"])])],2))}}),bH="",Ka=u.createElementVNode("div",{class:"chat-message-typing-body"},[u.createElementVNode("span",{class:"chat-message-typing-circle"}),u.createElementVNode("span",{class:"chat-message-typing-circle"}),u.createElementVNode("span",{class:"chat-message-typing-circle"})],-1),Ya=u.defineComponent({__name:"MessageTyping",props:{animation:{type:String,default:"bouncing"}},setup(t){const e=t,n={id:"typing",text:"",sender:"bot",createdAt:""},r=u.computed(()=>({"chat-message-typing":!0,[`chat-message-typing-animation-${e.animation}`]:!0}));return(o,s)=>(u.openBlock(),u.createBlock(u.unref(an),{class:u.normalizeClass(r.value),message:n},{default:u.withCtx(()=>[Ka]),_:1},8,["class"]))}}),_H="";var yt,Qa=new Uint8Array(16);function Xa(){if(!yt&&(yt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!yt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yt(Qa)}const el=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tl(t){return typeof t=="string"&&el.test(t)}for(var Z=[],ln=0;ln<256;++ln)Z.push((ln+256).toString(16).substr(1));function nl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Z[t[e+0]]+Z[t[e+1]]+Z[t[e+2]]+Z[t[e+3]]+"-"+Z[t[e+4]]+Z[t[e+5]]+"-"+Z[t[e+6]]+Z[t[e+7]]+"-"+Z[t[e+8]]+Z[t[e+9]]+"-"+Z[t[e+10]]+Z[t[e+11]]+Z[t[e+12]]+Z[t[e+13]]+Z[t[e+14]]+Z[t[e+15]]).toLowerCase();if(!tl(n))throw TypeError("Stringified UUID is invalid");return n}function We(t,e,n){t=t||{};var r=t.random||(t.rng||Xa)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return nl(r)}async function rl(){return""}async function ao(...t){var r;const e=await rl();return await(await fetch(t[0],{...t[1],mode:"cors",cache:"no-cache",headers:{...e?{authorization:`Bearer ${e}`}:{},...(r=t[1])==null?void 0:r.headers}})).json()}async function lo(t,e={},n={}){let r=t;return Object.keys(e).length>0&&(r=`${r}?${new URLSearchParams(e).toString()}`),ao(r,{...n,method:"GET"})}async function uo(t,e={},n={}){return ao(t,{...n,method:"POST",body:JSON.stringify(e)})}async function ol(t,e){var r,o;return(((r=e.webhookConfig)==null?void 0:r.method)==="POST"?uo:lo)(`${e.webhookUrl}`,{action:"loadPreviousSession",sessionId:t},{headers:(o=e.webhookConfig)==null?void 0:o.headers})}async function sl(t,e,n){var o,s;return(((o=n.webhookConfig)==null?void 0:o.method)==="POST"?uo:lo)(`${n.webhookUrl}`,{action:"sendMessage",sessionId:e,message:t},{headers:(s=n.webhookConfig)==null?void 0:s.headers})}const un=Ko("chat",()=>{const{options:t}=Ve(),e=u.ref([]),n=u.ref(null),r=u.ref(!1),o=u.computed(()=>(t.initialMessages??[]).map(a=>({id:We(),text:a,sender:"bot",createdAt:new Date().toISOString()})));async function s(a){const l={id:We(),text:a,sender:"user",createdAt:new Date().toISOString()};e.value.push(l),r.value=!0,u.nextTick(()=>{ke.emit("scrollToBottom")});const f=await sl(a,n.value,t),p={id:We(),text:f.output,sender:"bot",createdAt:new Date().toISOString()};e.value.push(p),r.value=!1,u.nextTick(()=>{ke.emit("scrollToBottom")})}async function c(){const a=localStorage.getItem(In)??We(),l=await ol(a,t),f=new Date().toISOString();return e.value=((l==null?void 0:l.data)||[]).map((p,h)=>({id:`${h}`,text:p.kwargs.content,sender:p.id.includes("HumanMessage")?"user":"bot",createdAt:f})),e.value.length&&(n.value=a),a}async function i(){n.value=We(),localStorage.setItem(In,n.value)}return{initialMessages:o,messages:e,currentSessionId:n,waitingForResponse:r,loadPreviousSession:c,startNewSession:i,sendMessage:s}}),cl={class:"chat-messages-list"},il=u.defineComponent({__name:"MessagesList",props:{messages:{type:Array,required:!0}},setup(t){const e=un(),{initialMessages:n,waitingForResponse:r}=Ln(e);return(o,s)=>(u.openBlock(),u.createElementBlock("div",cl,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(u.unref(n),c=>(u.openBlock(),u.createBlock(an,{key:c.id,message:c},null,8,["message"]))),128)),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(t.messages,c=>(u.openBlock(),u.createBlock(an,{key:c.id,message:c},null,8,["message"]))),128)),u.unref(r)?(u.openBlock(),u.createBlock(Ya,{key:0})):u.createCommentVNode("",!0)]))}}),kH="",al={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ll=[u.createElementVNode("path",{fill:"currentColor",d:"m2 21l21-9L2 3v7l15 2l-15 2v7Z"},null,-1)];function ul(t,e){return u.openBlock(),u.createElementBlock("svg",al,ll)}const fl={name:"mdi-send",render:ul},pl={class:"chat-input"},hl=["placeholder","onKeydown"],dl=["disabled"],gl=u.defineComponent({__name:"Input",setup(t){const e=un(),{waitingForResponse:n}=Ln(e),{t:r}=tt(),o=u.ref(""),s=u.computed(()=>o.value===""||n.value);async function c(a){if(a.preventDefault(),s.value)return;const l=o.value;o.value="",await e.sendMessage(l)}async function i(a){a.shiftKey||await c(a)}return(a,l)=>(u.openBlock(),u.createElementBlock("div",pl,[u.withDirectives(u.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=f=>o.value=f),rows:"1",placeholder:u.unref(r)("inputPlaceholder"),onKeydown:u.withKeys(i,["enter"])},null,40,hl),[[u.vModelText,o.value]]),u.createElementVNode("button",{disabled:s.value,class:"chat-input-send-button",onClick:c},[u.createVNode(u.unref(fl),{height:"32",width:"32"})],8,dl)]))}}),wH="",fo=u.defineComponent({__name:"Chat",setup(t){const{options:e}=Ve(),{t:n,te:r}=tt(),o=un(),{messages:s,currentSessionId:c}=u.toRefs(o),i=u.computed(()=>!!e.poweredBy||r("footer")||!!c.value);async function a(){await o.loadPreviousSession(),u.nextTick(()=>{ke.emit("scrollToBottom")})}async function l(){o.startNewSession(),u.nextTick(()=>{ke.emit("scrollToBottom")})}return u.onMounted(()=>{a()}),(f,p)=>(u.openBlock(),u.createBlock(cs,{class:"chat-wrapper"},u.createSlots({default:u.withCtx(()=>[u.unref(c)?(u.openBlock(),u.createBlock(il,{key:1,messages:u.unref(s)},null,8,["messages"])):(u.openBlock(),u.createBlock(ls,{key:0,"onClick:button":l}))]),_:2},[u.unref(c)?void 0:{name:"header",fn:u.withCtx(()=>[u.createElementVNode("h1",null,u.toDisplayString(u.unref(n)("title")),1),u.createElementVNode("p",null,u.toDisplayString(u.unref(n)("subtitle")),1)]),key:"0"},i.value?{name:"footer",fn:u.withCtx(()=>[u.unref(c)?(u.openBlock(),u.createBlock(gl,{key:0})):(u.openBlock(),u.createBlock(bs,{key:1}))]),key:"1"}:void 0]),1024))}}),ml={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},bl=[u.createElementVNode("path",{fill:"currentColor",d:"M12 3c5.5 0 10 3.58 10 8s-4.5 8-10 8c-1.24 0-2.43-.18-3.53-.5C5.55 21 2 21 2 21c2.33-2.33 2.7-3.9 2.75-4.5C3.05 15.07 2 13.13 2 11c0-4.42 4.5-8 10-8Z"},null,-1)];function _l(t,e){return u.openBlock(),u.createElementBlock("svg",ml,bl)}const kl={name:"mdi-chat",render:_l},yl={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},wl=[u.createElementVNode("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6l1.41-1.42Z"},null,-1)];function xl(t,e){return u.openBlock(),u.createElementBlock("svg",yl,wl)}const El={name:"mdi-chevron-down",render:xl},vl={class:"chat-window-wrapper"},Al={class:"chat-window"},Cl=u.defineComponent({__name:"ChatWindow",setup(t){const e=u.ref(!1);function n(){e.value=!e.value,e.value&&u.nextTick(()=>{ke.emit("scrollToBottom")})}return(r,o)=>(u.openBlock(),u.createElementBlock("div",vl,[u.createVNode(u.Transition,{name:"chat-window-transition"},{default:u.withCtx(()=>[u.withDirectives(u.createElementVNode("div",Al,[u.createVNode(fo)],512),[[u.vShow,e.value]])]),_:1}),u.createElementVNode("div",{class:"chat-window-toggle",onClick:n},[u.createVNode(u.Transition,{name:"chat-window-toggle-transition",mode:"out-in"},{default:u.withCtx(()=>[e.value?(u.openBlock(),u.createBlock(u.unref(El),{key:1,height:"32",width:"32"})):(u.openBlock(),u.createBlock(u.unref(kl),{key:0,height:"32",width:"32"}))]),_:1})])]))}}),vH="";function Sl(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),i=t.inherit(t.APOS_STRING_MODE,{className:"string"}),a=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,a,i,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,a,i]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const po="[A-Za-z$_][0-9A-Za-z$_]*",Dl=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],ql=["true","false","null","undefined","NaN","Infinity"],ho=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],go=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mo=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rl=[].concat(mo,ho,go);function Nl(t){const e=t.regex,n=(k,{after:L})=>{const B="</"+k[0].slice(1);return k.input.indexOf(B,L)!==-1},r=po,o={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(k,L)=>{const B=k[0].length+k.index,H=k.input[B];if(H==="<"||H===","){L.ignoreMatch();return}H===">"&&(n(k,{after:B})||L.ignoreMatch());let Y;const oe=k.input.substring(B);if(Y=oe.match(/^\s*=/)){L.ignoreMatch();return}if((Y=oe.match(/^\s+extends\s+/))&&Y.index===0){L.ignoreMatch();return}}},i={$pattern:po,keyword:Dl,literal:ql,built_in:Rl,"variable.language":Tl},a="[0-9](_?[0-9])*",l=`\\.(${a})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${f})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,y,E,D,{match:/\$\d+/},p];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(S)});const T=[].concat(w,h.contains),R=T.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(T)}]),x={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:R},v={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ho,...go]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},m={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(k){return e.concat("(?!",k.join("|"),")")}const G={match:e.concat(/\b/,M([...mo,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",g={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,y,E,D,w,{match:/\$\d+/},p,V,{className:"attr",begin:r+e.lookahead(":"),relevance:0},g,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},m,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},G,b,v,P,{match:/\$[(.]/}]}}const Ll=u.defineComponent({__name:"App",props:{},setup(t){const{options:e}=Ve(),n=u.computed(()=>e.mode==="fullscreen");return u.onMounted(()=>{kt.registerLanguage("xml",Sl),kt.registerLanguage("javascript",Nl)}),(r,o)=>n.value?(u.openBlock(),u.createBlock(u.unref(fo),{key:0})):(u.openBlock(),u.createBlock(u.unref(Cl),{key:1}))}});function Ol(t){var o,s;const e={...Ue,...t,webhookConfig:{...Ue.webhookConfig,...t==null?void 0:t.webhookConfig},i18n:{...Ue.i18n,...t==null?void 0:t.i18n,en:{...(o=Ue.i18n)==null?void 0:o.en,...(s=t==null?void 0:t.i18n)==null?void 0:s.en}},theme:{...Ue.theme,...t==null?void 0:t.theme}},n=e.target??is;typeof n=="string"&&ns(n);const r=u.createApp(Ll);return r.use(jo()),r.provide(Mn,e),r.mount(n),r}me.createChat=Ol,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
29
+ https://github.com/highlightjs/highlight.js/issues/2277`),H=g,B=k),L===void 0&&(L=!0);const Y={code:B,language:H};P("before:highlight",Y);const oe=Y.result?Y.result:p(Y.language,Y.code,L);return oe.code=Y.code,P("after:highlight",oe),oe}function p(g,k,L,B){const H=Object.create(null);function Y(A,q){return A.keywords[q]}function oe(){if(!N.keywords){W.addText(z);return}let A=0;N.keywordPatternRe.lastIndex=0;let q=N.keywordPatternRe.exec(z),O="";for(;q;){O+=z.substring(A,q.index);const U=fe.case_insensitive?q[0].toLowerCase():q[0],K=Y(N,U);if(K){const[he,Ul]=K;if(W.addText(O),O="",H[U]=(H[U]||0)+1,H[U]<=Wa&&(Et+=Ul),he.startsWith("_"))O+=q[0];else{const Vl=fe.classNameAliases[he]||he;ue(q[0],Vl)}}else O+=q[0];A=N.keywordPatternRe.lastIndex,q=N.keywordPatternRe.exec(z)}O+=z.substring(A),W.addText(O)}function wt(){if(z==="")return;let A=null;if(typeof N.subLanguage=="string"){if(!e[N.subLanguage]){W.addText(z);return}A=p(N.subLanguage,z,!0,wo[N.subLanguage]),wo[N.subLanguage]=A._top}else A=d(z,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(Et+=A.relevance),W.__addSublanguage(A._emitter,A.language)}function Q(){N.subLanguage!=null?wt():oe(),z=""}function ue(A,q){A!==""&&(W.startScope(q),W.addText(A),W.endScope())}function bo(A,q){let O=1;const U=q.length-1;for(;O<=U;){if(!A._emit[O]){O++;continue}const K=fe.classNameAliases[A[O]]||A[O],he=q[O];K?ue(he,K):(z=he,oe(),z=""),O++}}function _o(A,q){return A.scope&&typeof A.scope=="string"&&W.openNode(fe.classNameAliases[A.scope]||A.scope),A.beginScope&&(A.beginScope._wrap?(ue(z,fe.classNameAliases[A.beginScope._wrap]||A.beginScope._wrap),z=""):A.beginScope._multi&&(bo(A.beginScope,q),z="")),N=Object.create(A,{parent:{value:N}}),N}function ko(A,q,O){let U=fa(A.endRe,O);if(U){if(A["on:end"]){const K=new Gr(A);A["on:end"](q,K),K.isMatchIgnored&&(U=!1)}if(U){for(;A.endsParent&&A.parent;)A=A.parent;return A}}if(A.endsWithParent)return ko(A.parent,q,O)}function Il(A){return N.matcher.regexIndex===0?(z+=A[0],1):(hn=!0,0)}function Ml(A){const q=A[0],O=A.rule,U=new Gr(O),K=[O.__beforeBegin,O["on:begin"]];for(const he of K)if(he&&(he(A,U),U.isMatchIgnored))return Il(q);return O.skip?z+=q:(O.excludeBegin&&(z+=q),Q(),!O.returnBegin&&!O.excludeBegin&&(z=q)),_o(O,A),O.returnBegin?0:q.length}function Bl(A){const q=A[0],O=k.substring(A.index),U=ko(N,A,O);if(!U)return co;const K=N;N.endScope&&N.endScope._wrap?(Q(),ue(q,N.endScope._wrap)):N.endScope&&N.endScope._multi?(Q(),bo(N.endScope,A)):K.skip?z+=q:(K.returnEnd||K.excludeEnd||(z+=q),Q(),K.excludeEnd&&(z=q));do N.scope&&W.closeNode(),!N.skip&&!N.subLanguage&&(Et+=N.relevance),N=N.parent;while(N!==U.parent);return U.starts&&_o(U.starts,A),K.returnEnd?0:q.length}function Fl(){const A=[];for(let q=N;q!==fe;q=q.parent)q.scope&&A.unshift(q.scope);A.forEach(q=>W.openNode(q))}let xt={};function yo(A,q){const O=q&&q[0];if(z+=A,O==null)return Q(),0;if(xt.type==="begin"&&q.type==="end"&&xt.index===q.index&&O===""){if(z+=k.slice(q.index,q.index+1),!o){const U=new Error(`0 width match regex (${g})`);throw U.languageName=g,U.badRule=xt.rule,U}return 1}if(xt=q,q.type==="begin")return Ml(q);if(q.type==="illegal"&&!L){const U=new Error('Illegal lexeme "'+O+'" for mode "'+(N.scope||"<unnamed>")+'"');throw U.mode=N,U}else if(q.type==="end"){const U=Bl(q);if(U!==co)return U}if(q.type==="illegal"&&O==="")return 1;if(pn>1e5&&pn>q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return z+=O,O.length}const fe=$(g);if(!fe)throw Ae(s.replace("{}",g)),new Error('Unknown language: "'+g+'"');const Pl=Ga(fe);let fn="",N=B||Pl;const wo={},W=new i.__emitter(i);Fl();let z="",Et=0,Ce=0,pn=0,hn=!1;try{if(fe.__emitTokens)fe.__emitTokens(k,W);else{for(N.matcher.considerAll();;){pn++,hn?hn=!1:N.matcher.considerAll(),N.matcher.lastIndex=Ce;const A=N.matcher.exec(k);if(!A)break;const q=k.substring(Ce,A.index),O=yo(q,A);Ce=A.index+O}yo(k.substring(Ce))}return W.finalize(),fn=W.toHTML(),{language:g,value:fn,relevance:Et,illegal:!1,_emitter:W,_top:N}}catch(A){if(A.message&&A.message.includes("Illegal"))return{language:g,value:cn(k),illegal:!0,relevance:0,_illegalBy:{message:A.message,index:Ce,context:k.slice(Ce-100,Ce+100),mode:A.mode,resultSoFar:fn},_emitter:W};if(o)return{language:g,value:cn(k),illegal:!1,relevance:0,errorRaised:A,_emitter:W,_top:N};throw A}}function h(g){const k={value:cn(g),illegal:!1,relevance:0,_top:c,_emitter:new i.__emitter(i)};return k._emitter.addText(g),k}function d(g,k){k=k||i.languages||Object.keys(e);const L=h(g),B=k.filter($).filter(b).map(Q=>p(Q,g,!1));B.unshift(L);const H=B.sort((Q,ue)=>{if(Q.relevance!==ue.relevance)return ue.relevance-Q.relevance;if(Q.language&&ue.language){if($(Q.language).supersetOf===ue.language)return 1;if($(ue.language).supersetOf===Q.language)return-1}return 0}),[Y,oe]=H,wt=Y;return wt.secondBest=oe,wt}function y(g,k,L){const B=k&&n[k]||L;g.classList.add("hljs"),g.classList.add(`language-${B}`)}function E(g){let k=null;const L=l(g);if(a(L))return;if(P("before:highlightElement",{el:g,language:L}),g.children.length>0&&(i.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(g)),i.throwUnescapedHTML))throw new Za("One of your code blocks includes unescaped HTML.",g.innerHTML);k=g;const B=k.textContent,H=L?f(B,{language:L,ignoreIllegals:!0}):d(B);g.innerHTML=H.value,y(g,L,H.language),g.result={language:H.language,re:H.relevance,relevance:H.relevance},H.secondBest&&(g.secondBest={language:H.secondBest.language,relevance:H.secondBest.relevance}),P("after:highlightElement",{el:g,result:H,text:B})}function D(g){i=so(i,g)}const C=()=>{T(),Ie("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){T(),Ie("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function T(){if(document.readyState==="loading"){S=!0;return}document.querySelectorAll(i.cssSelector).forEach(E)}function R(){S&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",R,!1);function x(g,k){let L=null;try{L=k(t)}catch(B){if(Ae("Language definition for '{}' could not be registered.".replace("{}",g)),o)Ae(B);else throw B;L=c}L.name||(L.name=g),e[g]=L,L.rawDefinition=k.bind(null,t),L.aliases&&m(L.aliases,{languageName:g})}function v(g){delete e[g];for(const k of Object.keys(n))n[k]===g&&delete n[k]}function V(){return Object.keys(e)}function $(g){return g=(g||"").toLowerCase(),e[g]||e[n[g]]}function m(g,{languageName:k}){typeof g=="string"&&(g=[g]),g.forEach(L=>{n[L.toLowerCase()]=k})}function b(g){const k=$(g);return k&&!k.disableAutodetect}function M(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=k=>{g["before:highlightBlock"](Object.assign({block:k.el},k))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=k=>{g["after:highlightBlock"](Object.assign({block:k.el},k))})}function G(g){M(g),r.push(g)}function _(g){const k=r.indexOf(g);k!==-1&&r.splice(k,1)}function P(g,k){const L=g;r.forEach(function(B){B[L]&&B[L](k)})}function I(g){return Ie("10.7.0","highlightBlock will be removed entirely in v12.0"),Ie("10.7.0","Please use highlightElement now."),E(g)}Object.assign(t,{highlight:f,highlightAuto:d,highlightAll:T,highlightElement:E,highlightBlock:I,configure:D,initHighlighting:C,initHighlightingOnLoad:w,registerLanguage:x,unregisterLanguage:v,listLanguages:V,getLanguage:$,registerAliases:m,autoDetection:b,inherit:so,addPlugin:G,removePlugin:_}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=ja,t.regex={concat:ve,lookahead:Wr,either:rn,optional:la,anyNumberOfTimes:aa};for(const g in bt)typeof bt[g]=="object"&&zr(bt[g]);return Object.assign(t,bt),t},Me=io({});Me.newInstance=()=>io({});var Ja=Me;Me.HighlightJS=Me,Me.default=Me;const kt=Bn(Ja),an=u.defineComponent({__name:"Message",props:{message:{type:Object,required:!0}},setup(t){const e=t,{message:n}=u.toRefs(e),r=u.computed(()=>({"chat-message-from-user":n.value.sender==="user","chat-message-from-bot":n.value.sender==="bot"})),o={highlight(s,c){if(c&&kt.getLanguage(c))try{return kt.highlight(s,{language:c}).value}catch{}return""}};return(s,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["chat-message",r.value])},[u.renderSlot(s.$slots,"default",{},()=>[u.createVNode(u.unref(ra),{class:"chat-message-markdown",source:u.unref(n).text,options:o},null,8,["source"])])],2))}}),bH="",Ka=u.createElementVNode("div",{class:"chat-message-typing-body"},[u.createElementVNode("span",{class:"chat-message-typing-circle"}),u.createElementVNode("span",{class:"chat-message-typing-circle"}),u.createElementVNode("span",{class:"chat-message-typing-circle"})],-1),Ya=u.defineComponent({__name:"MessageTyping",props:{animation:{type:String,default:"bouncing"}},setup(t){const e=t,n={id:"typing",text:"",sender:"bot",createdAt:""},r=u.computed(()=>({"chat-message-typing":!0,[`chat-message-typing-animation-${e.animation}`]:!0}));return(o,s)=>(u.openBlock(),u.createBlock(u.unref(an),{class:u.normalizeClass(r.value),message:n},{default:u.withCtx(()=>[Ka]),_:1},8,["class"]))}}),_H="";var yt,Qa=new Uint8Array(16);function Xa(){if(!yt&&(yt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!yt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yt(Qa)}const el=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tl(t){return typeof t=="string"&&el.test(t)}for(var Z=[],ln=0;ln<256;++ln)Z.push((ln+256).toString(16).substr(1));function nl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Z[t[e+0]]+Z[t[e+1]]+Z[t[e+2]]+Z[t[e+3]]+"-"+Z[t[e+4]]+Z[t[e+5]]+"-"+Z[t[e+6]]+Z[t[e+7]]+"-"+Z[t[e+8]]+Z[t[e+9]]+"-"+Z[t[e+10]]+Z[t[e+11]]+Z[t[e+12]]+Z[t[e+13]]+Z[t[e+14]]+Z[t[e+15]]).toLowerCase();if(!tl(n))throw TypeError("Stringified UUID is invalid");return n}function We(t,e,n){t=t||{};var r=t.random||(t.rng||Xa)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return nl(r)}async function rl(){return""}async function ao(...t){var r;const e=await rl();return await(await fetch(t[0],{...t[1],mode:"cors",cache:"no-cache",headers:{...e?{authorization:`Bearer ${e}`}:{},...(r=t[1])==null?void 0:r.headers}})).json()}async function lo(t,e={},n={}){let r=t;return Object.keys(e).length>0&&(r=`${r}?${new URLSearchParams(e).toString()}`),ao(r,{...n,method:"GET"})}async function uo(t,e={},n={}){return ao(t,{...n,method:"POST",body:JSON.stringify(e)})}async function ol(t,e){var r,o;return(((r=e.webhookConfig)==null?void 0:r.method)==="POST"?uo:lo)(`${e.webhookUrl}`,{action:"loadPreviousSession",sessionId:t},{headers:(o=e.webhookConfig)==null?void 0:o.headers})}async function sl(t,e,n){var o,s;return(((o=n.webhookConfig)==null?void 0:o.method)==="POST"?uo:lo)(`${n.webhookUrl}`,{action:"sendMessage",sessionId:e,message:t},{headers:(s=n.webhookConfig)==null?void 0:s.headers})}const un=Ko("chat",()=>{const{options:t}=Ve(),e=u.ref([]),n=u.ref(null),r=u.ref(!1),o=u.computed(()=>(t.initialMessages??[]).map(a=>({id:We(),text:a,sender:"bot",createdAt:new Date().toISOString()})));async function s(a){const l={id:We(),text:a,sender:"user",createdAt:new Date().toISOString()};e.value.push(l),r.value=!0,u.nextTick(()=>{ke.emit("scrollToBottom")});const f=await sl(a,n.value,t),p={id:We(),text:f.output,sender:"bot",createdAt:new Date().toISOString()};e.value.push(p),r.value=!1,u.nextTick(()=>{ke.emit("scrollToBottom")})}async function c(){const a=localStorage.getItem(In)??We(),l=await ol(a,t),f=new Date().toISOString();return e.value=((l==null?void 0:l.data)||[]).map((p,h)=>({id:`${h}`,text:p.kwargs.content,sender:p.id.includes("HumanMessage")?"user":"bot",createdAt:f})),e.value.length&&(n.value=a),a}async function i(){n.value=We(),localStorage.setItem(In,n.value)}return{initialMessages:o,messages:e,currentSessionId:n,waitingForResponse:r,loadPreviousSession:c,startNewSession:i,sendMessage:s}}),cl={class:"chat-messages-list"},il=u.defineComponent({__name:"MessagesList",props:{messages:{type:Array,required:!0}},setup(t){const e=un(),{initialMessages:n,waitingForResponse:r}=Ln(e);return(o,s)=>(u.openBlock(),u.createElementBlock("div",cl,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(u.unref(n),c=>(u.openBlock(),u.createBlock(an,{key:c.id,message:c},null,8,["message"]))),128)),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(t.messages,c=>(u.openBlock(),u.createBlock(an,{key:c.id,message:c},null,8,["message"]))),128)),u.unref(r)?(u.openBlock(),u.createBlock(Ya,{key:0})):u.createCommentVNode("",!0)]))}}),kH="",al={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ll=[u.createElementVNode("path",{fill:"currentColor",d:"m2 21l21-9L2 3v7l15 2l-15 2v7Z"},null,-1)];function ul(t,e){return u.openBlock(),u.createElementBlock("svg",al,ll)}const fl={name:"mdi-send",render:ul},pl={class:"chat-input"},hl=["placeholder","onKeydown"],dl=["disabled"],gl=u.defineComponent({__name:"Input",setup(t){const e=un(),{waitingForResponse:n}=Ln(e),{t:r}=tt(),o=u.ref(""),s=u.computed(()=>o.value===""||n.value);async function c(a){if(a.preventDefault(),s.value)return;const l=o.value;o.value="",await e.sendMessage(l)}async function i(a){a.shiftKey||await c(a)}return(a,l)=>(u.openBlock(),u.createElementBlock("div",pl,[u.withDirectives(u.createElementVNode("textarea",{"onUpdate:modelValue":l[0]||(l[0]=f=>o.value=f),rows:"1",placeholder:u.unref(r)("inputPlaceholder"),onKeydown:u.withKeys(i,["enter"])},null,40,hl),[[u.vModelText,o.value]]),u.createElementVNode("button",{disabled:s.value,class:"chat-input-send-button",onClick:c},[u.createVNode(u.unref(fl),{height:"32",width:"32"})],8,dl)]))}}),wH="",fo=u.defineComponent({__name:"Chat",setup(t){const{options:e}=Ve(),{t:n,te:r}=tt(),o=un(),{messages:s,currentSessionId:c}=u.toRefs(o),i=u.computed(()=>!!e.poweredBy||r("footer")||!!c.value);async function a(){await o.loadPreviousSession(),u.nextTick(()=>{ke.emit("scrollToBottom")})}async function l(){o.startNewSession(),u.nextTick(()=>{ke.emit("scrollToBottom")})}return u.onMounted(()=>{a()}),(f,p)=>(u.openBlock(),u.createBlock(cs,{class:"chat-wrapper"},u.createSlots({default:u.withCtx(()=>[u.unref(c)?(u.openBlock(),u.createBlock(il,{key:1,messages:u.unref(s)},null,8,["messages"])):(u.openBlock(),u.createBlock(ls,{key:0,"onClick:button":l}))]),_:2},[u.unref(c)?void 0:{name:"header",fn:u.withCtx(()=>[u.createElementVNode("h1",null,u.toDisplayString(u.unref(n)("title")),1),u.createElementVNode("p",null,u.toDisplayString(u.unref(n)("subtitle")),1)]),key:"0"},i.value?{name:"footer",fn:u.withCtx(()=>[u.unref(c)?(u.openBlock(),u.createBlock(gl,{key:0})):(u.openBlock(),u.createBlock(bs,{key:1}))]),key:"1"}:void 0]),1024))}}),ml={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},bl=[u.createElementVNode("path",{fill:"currentColor",d:"M12 3c5.5 0 10 3.58 10 8s-4.5 8-10 8c-1.24 0-2.43-.18-3.53-.5C5.55 21 2 21 2 21c2.33-2.33 2.7-3.9 2.75-4.5C3.05 15.07 2 13.13 2 11c0-4.42 4.5-8 10-8Z"},null,-1)];function _l(t,e){return u.openBlock(),u.createElementBlock("svg",ml,bl)}const kl={name:"mdi-chat",render:_l},yl={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},wl=[u.createElementVNode("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6l1.41-1.42Z"},null,-1)];function xl(t,e){return u.openBlock(),u.createElementBlock("svg",yl,wl)}const El={name:"mdi-chevron-down",render:xl},vl={class:"chat-window-wrapper"},Al={class:"chat-window"},Cl=u.defineComponent({__name:"ChatWindow",setup(t){const e=u.ref(!1);function n(){e.value=!e.value,e.value&&u.nextTick(()=>{ke.emit("scrollToBottom")})}return(r,o)=>(u.openBlock(),u.createElementBlock("div",vl,[u.createVNode(u.Transition,{name:"chat-window-transition"},{default:u.withCtx(()=>[u.withDirectives(u.createElementVNode("div",Al,[u.createVNode(fo)],512),[[u.vShow,e.value]])]),_:1}),u.createElementVNode("div",{class:"chat-window-toggle",onClick:n},[u.createVNode(u.Transition,{name:"chat-window-toggle-transition",mode:"out-in"},{default:u.withCtx(()=>[e.value?(u.openBlock(),u.createBlock(u.unref(El),{key:1,height:"32",width:"32"})):(u.openBlock(),u.createBlock(u.unref(kl),{key:0,height:"32",width:"32"}))]),_:1})])]))}}),vH="";function Sl(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),i=t.inherit(t.APOS_STRING_MODE,{className:"string"}),a=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,a,i,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,a,i]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const po="[A-Za-z$_][0-9A-Za-z$_]*",Dl=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],ql=["true","false","null","undefined","NaN","Infinity"],ho=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],go=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mo=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rl=[].concat(mo,ho,go);function Nl(t){const e=t.regex,n=(k,{after:L})=>{const B="</"+k[0].slice(1);return k.input.indexOf(B,L)!==-1},r=po,o={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(k,L)=>{const B=k[0].length+k.index,H=k.input[B];if(H==="<"||H===","){L.ignoreMatch();return}H===">"&&(n(k,{after:B})||L.ignoreMatch());let Y;const oe=k.input.substring(B);if(Y=oe.match(/^\s*=/)){L.ignoreMatch();return}if((Y=oe.match(/^\s+extends\s+/))&&Y.index===0){L.ignoreMatch();return}}},i={$pattern:po,keyword:Dl,literal:ql,built_in:Rl,"variable.language":Tl},a="[0-9](_?[0-9])*",l=`\\.(${a})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${f})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,y,E,D,{match:/\$\d+/},p];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(S)});const T=[].concat(w,h.contains),R=T.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(T)}]),x={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:R},v={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ho,...go]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},m={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(k){return e.concat("(?!",k.join("|"),")")}const G={match:e.concat(/\b/,M([...mo,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",g={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,y,E,D,w,{match:/\$\d+/},p,V,{className:"attr",begin:r+e.lookahead(":"),relevance:0},g,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},m,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},G,b,v,P,{match:/\$[(.]/}]}}const Ll=u.defineComponent({__name:"App",props:{},setup(t){const{options:e}=Ve(),n=u.computed(()=>e.mode==="fullscreen");return u.onMounted(()=>{kt.registerLanguage("xml",Sl),kt.registerLanguage("javascript",Nl)}),(r,o)=>n.value?(u.openBlock(),u.createBlock(u.unref(fo),{key:0,class:"n8n-chat"})):(u.openBlock(),u.createBlock(u.unref(Cl),{key:1,class:"n8n-chat"}))}});function Ol(t){var o,s;const e={...Ue,...t,webhookConfig:{...Ue.webhookConfig,...t==null?void 0:t.webhookConfig},i18n:{...Ue.i18n,...t==null?void 0:t.i18n,en:{...(o=Ue.i18n)==null?void 0:o.en,...(s=t==null?void 0:t.i18n)==null?void 0:s.en}},theme:{...Ue.theme,...t==null?void 0:t.theme}},n=e.target??is;typeof n=="string"&&ns(n);const r=u.createApp(Ll);return r.use(jo()),r.provide(Mn,e),r.mount(n),r}me.createChat=Ol,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/chat",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "main": "./chat.umd.cjs",
5
5
  "module": "./chat.js",
6
6
  "types": "./types/index.d.ts",
package/style.css CHANGED
@@ -1,10 +1 @@
1
- pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2
- Theme: GitHub
3
- Description: Light theme as seen on github.com
4
- Author: github.com
5
- Maintainer: @Hirse
6
- Updated: 2021-05-15
7
-
8
- Outdated base version: https://github.com/primer/github-syntax-light
9
- Current colors taken from GitHub's CSS
10
- */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}:root{--chat--color-primary: #e74266;--chat--color-primary-shade-50: #db4061;--chat--color-primary-shade-100: #cf3c5c;--chat--color-secondary: #20b69e;--chat--color-secondary-shade-50: #1ca08a;--chat--color-white: #ffffff;--chat--color-light: #f2f4f8;--chat--color-light-shade-50: #e6e9f1;--chat--color-light-shade-100: #c2c5cc;--chat--color-medium: #d2d4d9;--chat--color-dark: #101330;--chat--color-disabled: #777980;--chat--color-typing: #404040;--chat--spacing: 1rem;--chat--border-radius: .25rem;--chat--transition-duration: .15s;--chat--window--width: 400px;--chat--window--height: 600px;--chat--textarea--height: 50px;--chat--message--bot--background: var(--chat--color-white);--chat--message--bot--color: var(--chat--color-dark);--chat--message--user--background: var(--chat--color-secondary);--chat--message--user--color: var(--chat--color-white);--chat--message--pre--background: rgba(0, 0, 0, .05);--chat--toggle--background: var(--chat--color-primary);--chat--toggle--hover--background: var(--chat--color-primary-shade-50);--chat--toggle--active--background: var(--chat--color-primary-shade-100);--chat--toggle--color: var(--chat--color-white);--chat--toggle--size: 64px}.chat-button{display:inline-flex;text-align:center;vertical-align:middle;-webkit-user-select:none;user-select:none;color:var(--chat--button--color, var(--chat--color-light));background-color:var(--chat--button--background, var(--chat--color-primary));border:1px solid transparent;padding:var(--chat--button--padding, calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing));font-size:1rem;line-height:1.5;border-radius:var(--chat--button--border-radius, var(--chat--border-radius));transition:color var(--chat--transition-duration) ease-in-out,background-color var(--chat--transition-duration) ease-in-out,border-color var(--chat--transition-duration) ease-in-out,box-shadow var(--chat--transition-duration) ease-in-out;cursor:pointer}.chat-button:hover{color:var(--chat--button--hover--color, var(--chat--color-light));background-color:var(--chat--button--hover--background, var(--chat--color-primary-shade-50));text-decoration:none}.chat-button:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}.chat-button:disabled{opacity:.65}.chat-layout{width:100%;height:100%;display:flex;overflow-y:auto;flex-direction:column;font-family:var(--chat--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif)}.chat-layout .chat-header{padding:var(--chat--header--padding, var(--chat--spacing));background:var(--chat--header--background, var(--chat--color-dark));color:var(--chat--header--color, var(--chat--color-light))}.chat-layout .chat-body{background:var(--chat--body--background, var(--chat--color-light));flex:1;display:flex;flex-direction:column;overflow-y:auto;position:relative;min-height:100px}.chat-layout .chat-footer{border-top:1px solid var(--chat--color-light-shade-100);background:var(--chat--footer--background, var(--chat--color-light));color:var(--chat--footer--color, var(--chat--color-dark))}.chat-get-started{padding-top:var(--chat--spacing);padding-bottom:var(--chat--spacing);display:flex;justify-content:center;align-items:center;height:100%}.chat-powered-by{text-align:center}.chat-powered-by a{color:var(--chat--color-primary);text-decoration:none}.chat-get-started-footer{padding:var(--chat--spacing)}.chat-message{display:block;max-width:80%;padding:var(--chat--message--padding, var(--chat--spacing));border-radius:var(--chat--message--border-radius, var(--chat--border-radius))}.chat-message+.chat-message{margin-top:var(--chat--message--margin-bottom, calc(var(--chat--spacing) * .5))}.chat-message.chat-message-from-bot{background-color:var(--chat--message--bot--background);color:var(--chat--message--bot--color);border-bottom-left-radius:0}.chat-message.chat-message-from-user{background-color:var(--chat--message--user--background);color:var(--chat--message--user--color);margin-left:auto;border-bottom-right-radius:0}.chat-message>.chat-message-markdown{display:block;box-sizing:border-box}.chat-message>.chat-message-markdown>*:first-child{margin-top:0}.chat-message>.chat-message-markdown>*:last-child{margin-bottom:0}.chat-message>.chat-message-markdown pre{font-family:inherit;font-size:inherit;margin:0;white-space:pre-wrap;box-sizing:border-box;padding:var(--chat--spacing);background:var(--chat--message--pre--background);border-radius:var(--chat--border-radius)}.chat-message-typing{max-width:80px}.chat-message-typing.chat-message-typing-animation-scaling .chat-message-typing-circle{animation:chat-message-typing-animation-scaling .8s ease-in-out infinite;animation-delay:3.6s}.chat-message-typing.chat-message-typing-animation-bouncing .chat-message-typing-circle{animation:chat-message-typing-animation-bouncing .8s ease-in-out infinite;animation-delay:3.6s}.chat-message-typing .chat-message-typing-body{display:flex;justify-content:center;align-items:center}.chat-message-typing .chat-message-typing-circle{display:block;height:10px;width:10px;border-radius:50%;background-color:var(--chat--color-typing);margin:3px}.chat-message-typing .chat-message-typing-circle:nth-child(1){animation-delay:0ms}.chat-message-typing .chat-message-typing-circle:nth-child(2){animation-delay:333ms}.chat-message-typing .chat-message-typing-circle:nth-child(3){animation-delay:666ms}@keyframes chat-message-typing-animation-scaling{0%{transform:scale(1)}33%{transform:scale(1)}50%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes chat-message-typing-animation-bouncing{0%{transform:translateY(0)}33%{transform:translateY(0)}50%{transform:translateY(-10px)}to{transform:translateY(0)}}.chat-messages-list{margin-top:auto;display:block;padding:var(--chat--messages-list--padding, var(--chat--spacing))}.chat-input{display:flex;justify-content:center;align-items:center;width:100%}.chat-input textarea{font-family:inherit;font-size:inherit;width:100%;border:0;padding:var(--chat--spacing);max-height:var(--chat--textarea--height);resize:none}.chat-input .chat-input-send-button{height:var(--chat--textarea--height);width:var(--chat--textarea--height);background:white;cursor:pointer;color:var(--chat--color-secondary);border:0;font-size:24px;display:inline-flex;align-items:center;justify-content:center;transition:color var(--chat--transition-duration) ease}.chat-input .chat-input-send-button:hover,.chat-input .chat-input-send-button:focus{color:var(--chat--color-secondary-shade-50)}.chat-input .chat-input-send-button[disabled]{cursor:default;color:var(--chat--color-disabled)}.chat-window-wrapper{position:fixed;display:flex;flex-direction:column;bottom:var(--chat--window--bottom, var(--chat--spacing));right:var(--chat--window--right, var(--chat--spacing));z-index:var(--chat--window--z-index, 9999);max-width:calc(100% - var(--chat--window--right, var(--chat--spacing)) * 2);max-height:calc(100% - var(--chat--window--bottom, var(--chat--spacing)) * 2)}.chat-window-wrapper .chat-window{display:flex;width:var(--chat--window--width);height:var(--chat--window--height);max-width:100%;max-height:100%;border:var(--chat--window--border, 1px solid var(--chat--color-light-shade-100));border-radius:var(--chat--window--border-radius, var(--chat--border-radius));margin-bottom:var(--chat--window--margin-bottom, var(--chat--spacing));overflow:hidden;transform-origin:bottom right}.chat-window-wrapper .chat-window .chat-layout{width:auto;height:auto;flex:1}.chat-window-wrapper .chat-window-toggle{flex:0 0 auto;background:var(--chat--toggle--background);color:var(--chat--toggle--color);cursor:pointer;width:var(--chat--toggle--width, var(--chat--toggle--size));height:var(--chat--toggle--height, var(--chat--toggle--size));border-radius:var(--chat--toggle--border-radius, 50%);display:inline-flex;align-items:center;justify-content:center;margin-left:auto;transition:transform var(--chat--transition-duration) ease,background var(--chat--transition-duration) ease}.chat-window-wrapper .chat-window-toggle:hover,.chat-window-wrapper .chat-window-toggle:focus{transform:scale(1.05);background:var(--chat--toggle--hover--background)}.chat-window-wrapper .chat-window-toggle:active{transform:scale(.95);background:var(--chat--toggle--active--background)}.chat-window-transition-enter-active,.chat-window-transition-leave-active{transition:transform var(--chat--transition-duration) ease,opacity var(--chat--transition-duration) ease}.chat-window-transition-enter-from,.chat-window-transition-leave-to{transform:scale(0);opacity:0}.chat-window-toggle-transition-enter-active,.chat-window-toggle-transition-leave-active{transition:opacity var(--chat--transition-duration) ease}.chat-window-toggle-transition-enter-from,.chat-window-toggle-transition-leave-to{opacity:0}
1
+ .n8n-chat pre code.hljs{display:block;overflow-x:auto;padding:1em}.n8n-chat code.hljs{padding:3px 5px}.n8n-chat .hljs{color:#24292e;background:#fff}.n8n-chat .hljs-doctag,.n8n-chat .hljs-keyword,.n8n-chat .hljs-meta .hljs-keyword,.n8n-chat .hljs-template-tag,.n8n-chat .hljs-template-variable,.n8n-chat .hljs-type,.n8n-chat .hljs-variable.language_{color:#d73a49}.n8n-chat .hljs-title,.n8n-chat .hljs-title.class_,.n8n-chat .hljs-title.class_.inherited__,.n8n-chat .hljs-title.function_{color:#6f42c1}.n8n-chat .hljs-attr,.n8n-chat .hljs-attribute,.n8n-chat .hljs-literal,.n8n-chat .hljs-meta,.n8n-chat .hljs-number,.n8n-chat .hljs-operator,.n8n-chat .hljs-selector-attr,.n8n-chat .hljs-selector-class,.n8n-chat .hljs-selector-id,.n8n-chat .hljs-variable{color:#005cc5}.n8n-chat .hljs-meta .hljs-string,.n8n-chat .hljs-regexp,.n8n-chat .hljs-string{color:#032f62}.n8n-chat .hljs-built_in,.n8n-chat .hljs-symbol{color:#e36209}.n8n-chat .hljs-code,.n8n-chat .hljs-comment,.n8n-chat .hljs-formula{color:#6a737d}.n8n-chat .hljs-name,.n8n-chat .hljs-quote,.n8n-chat .hljs-selector-pseudo,.n8n-chat .hljs-selector-tag{color:#22863a}.n8n-chat .hljs-subst{color:#24292e}.n8n-chat .hljs-section{color:#005cc5;font-weight:700}.n8n-chat .hljs-bullet{color:#735c0f}.n8n-chat .hljs-emphasis{color:#24292e;font-style:italic}.n8n-chat .hljs-strong{color:#24292e;font-weight:700}.n8n-chat .hljs-addition{color:#22863a;background-color:#f0fff4}.n8n-chat .hljs-deletion{color:#b31d28;background-color:#ffeef0}:root{--chat--color-primary: #e74266;--chat--color-primary-shade-50: #db4061;--chat--color-primary-shade-100: #cf3c5c;--chat--color-secondary: #20b69e;--chat--color-secondary-shade-50: #1ca08a;--chat--color-white: #ffffff;--chat--color-light: #f2f4f8;--chat--color-light-shade-50: #e6e9f1;--chat--color-light-shade-100: #c2c5cc;--chat--color-medium: #d2d4d9;--chat--color-dark: #101330;--chat--color-disabled: #777980;--chat--color-typing: #404040;--chat--spacing: 1rem;--chat--border-radius: .25rem;--chat--transition-duration: .15s;--chat--window--width: 400px;--chat--window--height: 600px;--chat--textarea--height: 50px;--chat--message--bot--background: var(--chat--color-white);--chat--message--bot--color: var(--chat--color-dark);--chat--message--user--background: var(--chat--color-secondary);--chat--message--user--color: var(--chat--color-white);--chat--message--pre--background: rgba(0, 0, 0, .05);--chat--toggle--background: var(--chat--color-primary);--chat--toggle--hover--background: var(--chat--color-primary-shade-50);--chat--toggle--active--background: var(--chat--color-primary-shade-100);--chat--toggle--color: var(--chat--color-white);--chat--toggle--size: 64px}.chat-button{display:inline-flex;text-align:center;vertical-align:middle;-webkit-user-select:none;user-select:none;color:var(--chat--button--color, var(--chat--color-light));background-color:var(--chat--button--background, var(--chat--color-primary));border:1px solid transparent;padding:var(--chat--button--padding, calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing));font-size:1rem;line-height:1.5;border-radius:var(--chat--button--border-radius, var(--chat--border-radius));transition:color var(--chat--transition-duration) ease-in-out,background-color var(--chat--transition-duration) ease-in-out,border-color var(--chat--transition-duration) ease-in-out,box-shadow var(--chat--transition-duration) ease-in-out;cursor:pointer}.chat-button:hover{color:var(--chat--button--hover--color, var(--chat--color-light));background-color:var(--chat--button--hover--background, var(--chat--color-primary-shade-50));text-decoration:none}.chat-button:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}.chat-button:disabled{opacity:.65}.chat-layout{width:100%;height:100%;display:flex;overflow-y:auto;flex-direction:column;font-family:var(--chat--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif)}.chat-layout .chat-header{padding:var(--chat--header--padding, var(--chat--spacing));background:var(--chat--header--background, var(--chat--color-dark));color:var(--chat--header--color, var(--chat--color-light))}.chat-layout .chat-body{background:var(--chat--body--background, var(--chat--color-light));flex:1;display:flex;flex-direction:column;overflow-y:auto;position:relative;min-height:100px}.chat-layout .chat-footer{border-top:1px solid var(--chat--color-light-shade-100);background:var(--chat--footer--background, var(--chat--color-light));color:var(--chat--footer--color, var(--chat--color-dark))}.chat-get-started{padding-top:var(--chat--spacing);padding-bottom:var(--chat--spacing);display:flex;justify-content:center;align-items:center;height:100%}.chat-powered-by{text-align:center}.chat-powered-by a{color:var(--chat--color-primary);text-decoration:none}.chat-get-started-footer{padding:var(--chat--spacing)}.chat-message{display:block;max-width:80%;padding:var(--chat--message--padding, var(--chat--spacing));border-radius:var(--chat--message--border-radius, var(--chat--border-radius))}.chat-message+.chat-message{margin-top:var(--chat--message--margin-bottom, calc(var(--chat--spacing) * .5))}.chat-message.chat-message-from-bot{background-color:var(--chat--message--bot--background);color:var(--chat--message--bot--color);border-bottom-left-radius:0}.chat-message.chat-message-from-user{background-color:var(--chat--message--user--background);color:var(--chat--message--user--color);margin-left:auto;border-bottom-right-radius:0}.chat-message>.chat-message-markdown{display:block;box-sizing:border-box}.chat-message>.chat-message-markdown>*:first-child{margin-top:0}.chat-message>.chat-message-markdown>*:last-child{margin-bottom:0}.chat-message>.chat-message-markdown pre{font-family:inherit;font-size:inherit;margin:0;white-space:pre-wrap;box-sizing:border-box;padding:var(--chat--spacing);background:var(--chat--message--pre--background);border-radius:var(--chat--border-radius)}.chat-message-typing{max-width:80px}.chat-message-typing.chat-message-typing-animation-scaling .chat-message-typing-circle{animation:chat-message-typing-animation-scaling .8s ease-in-out infinite;animation-delay:3.6s}.chat-message-typing.chat-message-typing-animation-bouncing .chat-message-typing-circle{animation:chat-message-typing-animation-bouncing .8s ease-in-out infinite;animation-delay:3.6s}.chat-message-typing .chat-message-typing-body{display:flex;justify-content:center;align-items:center}.chat-message-typing .chat-message-typing-circle{display:block;height:10px;width:10px;border-radius:50%;background-color:var(--chat--color-typing);margin:3px}.chat-message-typing .chat-message-typing-circle:nth-child(1){animation-delay:0ms}.chat-message-typing .chat-message-typing-circle:nth-child(2){animation-delay:333ms}.chat-message-typing .chat-message-typing-circle:nth-child(3){animation-delay:666ms}@keyframes chat-message-typing-animation-scaling{0%{transform:scale(1)}33%{transform:scale(1)}50%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes chat-message-typing-animation-bouncing{0%{transform:translateY(0)}33%{transform:translateY(0)}50%{transform:translateY(-10px)}to{transform:translateY(0)}}.chat-messages-list{margin-top:auto;display:block;padding:var(--chat--messages-list--padding, var(--chat--spacing))}.chat-input{display:flex;justify-content:center;align-items:center;width:100%}.chat-input textarea{font-family:inherit;font-size:inherit;width:100%;border:0;padding:var(--chat--spacing);max-height:var(--chat--textarea--height);resize:none}.chat-input .chat-input-send-button{height:var(--chat--textarea--height);width:var(--chat--textarea--height);background:white;cursor:pointer;color:var(--chat--color-secondary);border:0;font-size:24px;display:inline-flex;align-items:center;justify-content:center;transition:color var(--chat--transition-duration) ease}.chat-input .chat-input-send-button:hover,.chat-input .chat-input-send-button:focus{color:var(--chat--color-secondary-shade-50)}.chat-input .chat-input-send-button[disabled]{cursor:default;color:var(--chat--color-disabled)}.chat-window-wrapper{position:fixed;display:flex;flex-direction:column;bottom:var(--chat--window--bottom, var(--chat--spacing));right:var(--chat--window--right, var(--chat--spacing));z-index:var(--chat--window--z-index, 9999);max-width:calc(100% - var(--chat--window--right, var(--chat--spacing)) * 2);max-height:calc(100% - var(--chat--window--bottom, var(--chat--spacing)) * 2)}.chat-window-wrapper .chat-window{display:flex;width:var(--chat--window--width);height:var(--chat--window--height);max-width:100%;max-height:100%;border:var(--chat--window--border, 1px solid var(--chat--color-light-shade-100));border-radius:var(--chat--window--border-radius, var(--chat--border-radius));margin-bottom:var(--chat--window--margin-bottom, var(--chat--spacing));overflow:hidden;transform-origin:bottom right}.chat-window-wrapper .chat-window .chat-layout{width:auto;height:auto;flex:1}.chat-window-wrapper .chat-window-toggle{flex:0 0 auto;background:var(--chat--toggle--background);color:var(--chat--toggle--color);cursor:pointer;width:var(--chat--toggle--width, var(--chat--toggle--size));height:var(--chat--toggle--height, var(--chat--toggle--size));border-radius:var(--chat--toggle--border-radius, 50%);display:inline-flex;align-items:center;justify-content:center;margin-left:auto;transition:transform var(--chat--transition-duration) ease,background var(--chat--transition-duration) ease}.chat-window-wrapper .chat-window-toggle:hover,.chat-window-wrapper .chat-window-toggle:focus{transform:scale(1.05);background:var(--chat--toggle--hover--background)}.chat-window-wrapper .chat-window-toggle:active{transform:scale(.95);background:var(--chat--toggle--active--background)}.chat-window-transition-enter-active,.chat-window-transition-leave-active{transition:transform var(--chat--transition-duration) ease,opacity var(--chat--transition-duration) ease}.chat-window-transition-enter-from,.chat-window-transition-leave-to{transform:scale(0);opacity:0}.chat-window-toggle-transition-enter-active,.chat-window-toggle-transition-leave-active{transition:opacity var(--chat--transition-duration) ease}.chat-window-toggle-transition-enter-from,.chat-window-toggle-transition-leave-to{opacity:0}