@yartsun/hypershadow-widget 0.1.13 → 0.1.16

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.
@@ -1,21 +1,21 @@
1
- "use strict";var ta=Object.defineProperty;var sa=(n,e,t)=>e in n?ta(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var F=(n,e,t)=>sa(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function hi(n){var e,t,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;e<r;e++)n[e]&&(t=hi(n[e]))&&(s&&(s+=" "),s+=t)}else for(t in n)n[t]&&(s&&(s+=" "),s+=t);return s}function gi(){for(var n,e,t=0,s="",r=arguments.length;t<r;t++)(n=arguments[t])&&(e=hi(n))&&(s&&(s+=" "),s+=e);return s}const _r=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Tr=gi,na=(n,e)=>t=>{var s;if((e==null?void 0:e.variants)==null)return Tr(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:i}=e,o=Object.keys(r).map(u=>{const d=t==null?void 0:t[u],g=i==null?void 0:i[u];if(d===null)return null;const p=_r(d)||_r(g);return r[u][p]}),a=t&&Object.entries(t).reduce((u,d)=>{let[g,p]=d;return p===void 0||(u[g]=p),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:g,className:p,...f}=d;return Object.entries(f).every(w=>{let[h,m]=w;return Array.isArray(m)?m.includes({...i,...a}[h]):{...i,...a}[h]===m})?[...u,g,p]:u},[]);return Tr(n,o,c,t==null?void 0:t.class,t==null?void 0:t.className)};function fi(n){return n?n.flatMap(e=>e.type===l.Fragment?fi(e.children):[e]):[]}const ra=l.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:e,slots:t}){return()=>{var c;if(!t.default)return null;const s=fi(t.default()),r=s.findIndex(u=>u.type!==l.Comment);if(r===-1)return s;const i=s[r];(c=i.props)==null||delete c.ref;const o=i.props?l.mergeProps(e,i.props):e,a=l.cloneVNode({...i,props:{}},o);return s.length===1?a:(s[r]=a,s)}}}),ia=["area","img","input"],oa=l.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:e,slots:t}){const s=n.asChild?"template":n.as;return typeof s=="string"&&ia.includes(s)?()=>l.h(s,e):s!=="template"?()=>l.h(n.as,e,{default:t.default}):()=>l.h(ra,e,{default:t.default})}}),aa=(n,e)=>{const t=new Array(n.length+e.length);for(let s=0;s<n.length;s++)t[s]=n[s];for(let s=0;s<e.length;s++)t[n.length+s]=e[s];return t},la=(n,e)=>({classGroupId:n,validator:e}),pi=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),Ns="-",Rr=[],ca="arbitrary..",ua=n=>{const e=ha(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return da(o);const a=o.split(Ns),c=a[0]===""&&a.length>1?1:0;return mi(a,c,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const c=s[o],u=t[o];return c?u?aa(u,c):c:u||Rr}return t[o]||Rr}}},mi=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],i=t.nextPart.get(r);if(i){const u=mi(n,e+1,i);if(u)return u}const o=t.validators;if(o===null)return;const a=e===0?n.join(Ns):n.slice(e).join(Ns),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(a))return d.classGroupId}},da=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),s=e.slice(0,t);return s?ca+s:void 0})(),ha=n=>{const{theme:e,classGroups:t}=n;return ga(t,e)},ga=(n,e)=>{const t=pi();for(const s in n){const r=n[s];Nn(r,t,s,e)}return t},Nn=(n,e,t,s)=>{const r=n.length;for(let i=0;i<r;i++){const o=n[i];fa(o,e,t,s)}},fa=(n,e,t,s)=>{if(typeof n=="string"){pa(n,e,t);return}if(typeof n=="function"){ma(n,e,t,s);return}wa(n,e,t,s)},pa=(n,e,t)=>{const s=n===""?e:wi(e,n);s.classGroupId=t},ma=(n,e,t,s)=>{if(ba(n)){Nn(n(s),e,t,s);return}e.validators===null&&(e.validators=[]),e.validators.push(la(t,n))},wa=(n,e,t,s)=>{const r=Object.entries(n),i=r.length;for(let o=0;o<i;o++){const[a,c]=r[o];Nn(c,wi(e,a),t,s)}},wi=(n,e)=>{let t=n;const s=e.split(Ns),r=s.length;for(let i=0;i<r;i++){const o=s[i];let a=t.nextPart.get(o);a||(a=pi(),t.nextPart.set(o,a)),t=a}return t},ba=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,ya=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),s=Object.create(null);const r=(i,o)=>{t[i]=o,e++,e>n&&(e=0,s=t,t=Object.create(null))};return{get(i){let o=t[i];if(o!==void 0)return o;if((o=s[i])!==void 0)return r(i,o),o},set(i,o){i in t?t[i]=o:r(i,o)}}},yn="!",zr=":",va=[],Br=(n,e,t,s,r)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:s,isExternal:r}),xa=n=>{const{prefix:e,experimentalParseClassName:t}=n;let s=r=>{const i=[];let o=0,a=0,c=0,u;const d=r.length;for(let h=0;h<d;h++){const m=r[h];if(o===0&&a===0){if(m===zr){i.push(r.slice(c,h)),c=h+1;continue}if(m==="/"){u=h;continue}}m==="["?o++:m==="]"?o--:m==="("?a++:m===")"&&a--}const g=i.length===0?r:r.slice(c);let p=g,f=!1;g.endsWith(yn)?(p=g.slice(0,-1),f=!0):g.startsWith(yn)&&(p=g.slice(1),f=!0);const w=u&&u>c?u-c:void 0;return Br(i,f,p,w)};if(e){const r=e+zr,i=s;s=o=>o.startsWith(r)?i(o.slice(r.length)):Br(va,!1,o,void 0,!0)}if(t){const r=s;s=i=>t({className:i,parseClassName:r})}return s},Ca=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,s)=>{e.set(t,1e6+s)}),t=>{const s=[];let r=[];for(let i=0;i<t.length;i++){const o=t[i],a=o[0]==="[",c=e.has(o);a||c?(r.length>0&&(r.sort(),s.push(...r),r=[]),s.push(o)):r.push(o)}return r.length>0&&(r.sort(),s.push(...r)),s}},ka=n=>({cache:ya(n.cacheSize),parseClassName:xa(n),sortModifiers:Ca(n),...ua(n)}),Sa=/\s+/,_a=(n,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:i}=e,o=[],a=n.trim().split(Sa);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:g,modifiers:p,hasImportantModifier:f,baseClassName:w,maybePostfixModifierPosition:h}=t(d);if(g){c=d+(c.length>0?" "+c:c);continue}let m=!!h,v=s(m?w.substring(0,h):w);if(!v){if(!m){c=d+(c.length>0?" "+c:c);continue}if(v=s(w),!v){c=d+(c.length>0?" "+c:c);continue}m=!1}const y=p.length===0?"":p.length===1?p[0]:i(p).join(":"),b=f?y+yn:y,x=b+v;if(o.indexOf(x)>-1)continue;o.push(x);const C=r(v,m);for(let k=0;k<C.length;++k){const R=C[k];o.push(b+R)}c=d+(c.length>0?" "+c:c)}return c},Ta=(...n)=>{let e=0,t,s,r="";for(;e<n.length;)(t=n[e++])&&(s=bi(t))&&(r&&(r+=" "),r+=s);return r},bi=n=>{if(typeof n=="string")return n;let e,t="";for(let s=0;s<n.length;s++)n[s]&&(e=bi(n[s]))&&(t&&(t+=" "),t+=e);return t},Ra=(n,...e)=>{let t,s,r,i;const o=c=>{const u=e.reduce((d,g)=>g(d),n());return t=ka(u),s=t.cache.get,r=t.cache.set,i=a,a(c)},a=c=>{const u=s(c);if(u)return u;const d=_a(c,t);return r(c,d),d};return i=o,(...c)=>i(Ta(...c))},za=[],we=n=>{const e=t=>t[n]||za;return e.isThemeGetter=!0,e},yi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ba=/^\d+\/\d+$/,Ma=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ea=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Aa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Da=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vt=n=>Ba.test(n),H=n=>!!n&&!Number.isNaN(Number(n)),dt=n=>!!n&&Number.isInteger(Number(n)),an=n=>n.endsWith("%")&&H(n.slice(0,-1)),rt=n=>Ma.test(n),Va=()=>!0,$a=n=>Ea.test(n)&&!Aa.test(n),xi=()=>!1,La=n=>Pa.test(n),Oa=n=>Da.test(n),Ia=n=>!V(n)&&!$(n),Na=n=>Yt(n,Si,xi),V=n=>yi.test(n),Ct=n=>Yt(n,_i,$a),ln=n=>Yt(n,Ha,H),Mr=n=>Yt(n,Ci,xi),Fa=n=>Yt(n,ki,Oa),As=n=>Yt(n,Ti,La),$=n=>vi.test(n),rs=n=>Xt(n,_i),Ka=n=>Xt(n,ja),Er=n=>Xt(n,Ci),Wa=n=>Xt(n,Si),Ua=n=>Xt(n,ki),Ps=n=>Xt(n,Ti,!0),Yt=(n,e,t)=>{const s=yi.exec(n);return s?s[1]?e(s[1]):t(s[2]):!1},Xt=(n,e,t=!1)=>{const s=vi.exec(n);return s?s[1]?e(s[1]):t:!1},Ci=n=>n==="position"||n==="percentage",ki=n=>n==="image"||n==="url",Si=n=>n==="length"||n==="size"||n==="bg-size",_i=n=>n==="length",Ha=n=>n==="number",ja=n=>n==="family-name",Ti=n=>n==="shadow",qa=()=>{const n=we("color"),e=we("font"),t=we("text"),s=we("font-weight"),r=we("tracking"),i=we("leading"),o=we("breakpoint"),a=we("container"),c=we("spacing"),u=we("radius"),d=we("shadow"),g=we("inset-shadow"),p=we("text-shadow"),f=we("drop-shadow"),w=we("blur"),h=we("perspective"),m=we("aspect"),v=we("ease"),y=we("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...x(),$,V],k=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],_=()=>[$,V,c],T=()=>[Vt,"full","auto",..._()],A=()=>[dt,"none","subgrid",$,V],M=()=>["auto",{span:["full",dt,$,V]},dt,$,V],I=()=>[dt,"auto",$,V],W=()=>["auto","min","max","fr",$,V],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",..._()],K=()=>[Vt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],D=()=>[n,$,V],L=()=>[...x(),Er,Mr,{position:[$,V]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Wa,Na,{size:[$,V]}],Z=()=>[an,rs,Ct],ie=()=>["","none","full",u,$,V],Q=()=>["",H,rs,Ct],_e=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[H,an,Er,Mr],zs=()=>["","none",w,$,V],He=()=>["none",H,$,V],te=()=>["none",H,$,V],Xe=()=>[H,$,V],ae=()=>[Vt,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rt],breakpoint:[rt],color:[Va],container:[rt],"drop-shadow":[rt],ease:["in","out","in-out"],font:[Ia],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rt],shadow:[rt],spacing:["px",H],text:[rt],"text-shadow":[rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vt,V,$,m]}],container:["container"],columns:[{columns:[H,V,$,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[dt,"auto",$,V]}],basis:[{basis:[Vt,"full","auto",a,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[H,Vt,"auto","initial","none",V]}],grow:[{grow:["",H,$,V]}],shrink:[{shrink:["",H,$,V]}],order:[{order:[dt,"first","last","none",$,V]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[a,"screen",...K()]}],"min-w":[{"min-w":[a,"screen","none",...K()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",t,rs,Ct]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,$,ln]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",an,V]}],"font-family":[{font:[Ka,V,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,$,V]}],"line-clamp":[{"line-clamp":[H,"none",$,ln]}],leading:[{leading:[i,..._()]}],"list-image":[{"list-image":["none",$,V]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,V]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[H,"from-font","auto",$,Ct]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[H,"auto",$,V]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$,V]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$,V]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dt,$,V],radial:["",$,V],conic:[dt,$,V]},Ua,Fa]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[H,$,V]}],"outline-w":[{outline:["",H,rs,Ct]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,Ps,As]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",g,Ps,As]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[H,Ct]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,Ps,As]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[H,$,V]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[$,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,V]}],filter:[{filter:["","none",$,V]}],blur:[{blur:zs()}],brightness:[{brightness:[H,$,V]}],contrast:[{contrast:[H,$,V]}],"drop-shadow":[{"drop-shadow":["","none",f,Ps,As]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",H,$,V]}],"hue-rotate":[{"hue-rotate":[H,$,V]}],invert:[{invert:["",H,$,V]}],saturate:[{saturate:[H,$,V]}],sepia:[{sepia:["",H,$,V]}],"backdrop-filter":[{"backdrop-filter":["","none",$,V]}],"backdrop-blur":[{"backdrop-blur":zs()}],"backdrop-brightness":[{"backdrop-brightness":[H,$,V]}],"backdrop-contrast":[{"backdrop-contrast":[H,$,V]}],"backdrop-grayscale":[{"backdrop-grayscale":["",H,$,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,$,V]}],"backdrop-invert":[{"backdrop-invert":["",H,$,V]}],"backdrop-opacity":[{"backdrop-opacity":[H,$,V]}],"backdrop-saturate":[{"backdrop-saturate":[H,$,V]}],"backdrop-sepia":[{"backdrop-sepia":["",H,$,V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$,V]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[H,"initial",$,V]}],ease:[{ease:["linear","initial",v,$,V]}],delay:[{delay:[H,$,V]}],animate:[{animate:["none",y,$,V]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,$,V]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[$,V,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$,V]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$,V]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[H,rs,Ct,ln]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ga=Ra(qa);function Fn(...n){return Ga(gi(n))}const lt=l.defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(n){const e=n;return(t,s)=>(l.openBlock(),l.createBlock(l.unref(oa),{"data-slot":"button",as:n.as,"as-child":n.asChild,class:l.normalizeClass(l.unref(Fn)(l.unref(Za)({variant:n.variant,size:n.size}),e.class))},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Za=na("tw:inline-flex tw:cursor-pointer tw:items-center tw:justify-center tw:whitespace-nowrap tw:text-sm tw:transition-all disabled:tw:pointer-events-none disabled:tw:opacity-50 [&_svg]:tw:pointer-events-none [&_svg:not([class*='size-'])]:tw:size-4 tw:shrink-0 [&_svg]:tw:shrink-0 tw:outline-none focus-visible:tw:border-ring focus-visible:tw:ring-ring/50 focus-visible:tw:ring-[3px] aria-invalid:tw:ring-destructive/20 dark:aria-invalid:tw:ring-destructive/40 aria-invalid:tw:border-destructive",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow-xs hover:tw:bg-primary/90",destructive:"tw:bg-destructive tw:text-white tw:shadow-xs hover:tw:bg-destructive/90 focus-visible:tw:ring-destructive/20 dark:focus-visible:tw:ring-destructive/40 dark:tw:bg-destructive/60",outlined:"tw:border tw:bg-background tw:shadow-xs hover:tw:bg-accent hover:tw:text-accent-foreground dark:tw:bg-input/30 dark:tw:border-input dark:hover:tw:bg-input/50",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-xs hover:tw:bg-secondary/80",ghost:"hover:tw:bg-accent hover:tw:text-accent-foreground dark:hover:tw:bg-accent/50",link:"tw:text-primary tw:underline-offset-4 hover:tw:underline",filled:"tw:border-transparent tw:bg-primary tw:text-primary-foreground [a&]:hover:tw:bg-primary/90",invisible:"tw:border-transparent tw:p-0! tw:bg-transparent tw:text-primary-foreground [a&]:hover:tw:bg-transparent"},size:{md:"tw:px-2 tw:py-1 tw:text-xs tw:h-6 tw:gap-1",sm:"tw:px-2 tw:py-1 tw:text-xs tw:h-5 tw:gap-1",lg:"tw:px-3 tw:py-1 tw:text-base tw:h-8 tw:gap-1",icon:"tw:size-9"}},defaultVariants:{variant:"default",size:"md"}}),Ya={md:16};function Ri(n){const e=n.getKey("settings.borderRadius")??16;return typeof e!="number"?Ya.md:e}function Xa(n,e=8){if(n<=0)return 0;const t=n-e;return t<=0?4:Math.max(4,t)}function ws(n,e=8){const t=Ri(n);return{borderRadius:`${Xa(t,e)}px`}}const vn=n=>n?n.replace(/<br>/g,"<br />").replace(/\n/g,"<br />"):"",Qa=["innerHTML"],Ja=["innerHTML"],el=["innerHTML"],tl=["width","height"],sl=`
1
+ "use strict";var ta=Object.defineProperty;var sa=(n,e,t)=>e in n?ta(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var I=(n,e,t)=>sa(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function fi(n){var e,t,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;e<r;e++)n[e]&&(t=fi(n[e]))&&(s&&(s+=" "),s+=t)}else for(t in n)n[t]&&(s&&(s+=" "),s+=t);return s}function gi(){for(var n,e,t=0,s="",r=arguments.length;t<r;t++)(n=arguments[t])&&(e=fi(n))&&(s&&(s+=" "),s+=e);return s}const Tr=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Rr=gi,na=(n,e)=>t=>{var s;if((e==null?void 0:e.variants)==null)return Rr(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:i}=e,o=Object.keys(r).map(u=>{const d=t==null?void 0:t[u],f=i==null?void 0:i[u];if(d===null)return null;const p=Tr(d)||Tr(f);return r[u][p]}),a=t&&Object.entries(t).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:f,className:p,...g}=d;return Object.entries(g).every(b=>{let[h,m]=b;return Array.isArray(m)?m.includes({...i,...a}[h]):{...i,...a}[h]===m})?[...u,f,p]:u},[]);return Rr(n,o,c,t==null?void 0:t.class,t==null?void 0:t.className)};function pi(n){return n?n.flatMap(e=>e.type===l.Fragment?pi(e.children):[e]):[]}const ra=l.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(n,{attrs:e,slots:t}){return()=>{var c;if(!t.default)return null;const s=pi(t.default()),r=s.findIndex(u=>u.type!==l.Comment);if(r===-1)return s;const i=s[r];(c=i.props)==null||delete c.ref;const o=i.props?l.mergeProps(e,i.props):e,a=l.cloneVNode({...i,props:{}},o);return s.length===1?a:(s[r]=a,s)}}}),ia=["area","img","input"],oa=l.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(n,{attrs:e,slots:t}){const s=n.asChild?"template":n.as;return typeof s=="string"&&ia.includes(s)?()=>l.h(s,e):s!=="template"?()=>l.h(n.as,e,{default:t.default}):()=>l.h(ra,e,{default:t.default})}}),aa=(n,e)=>{const t=new Array(n.length+e.length);for(let s=0;s<n.length;s++)t[s]=n[s];for(let s=0;s<e.length;s++)t[n.length+s]=e[s];return t},la=(n,e)=>({classGroupId:n,validator:e}),mi=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),Fs="-",zr=[],ca="arbitrary..",ua=n=>{const e=ha(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return da(o);const a=o.split(Fs),c=a[0]===""&&a.length>1?1:0;return wi(a,c,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const c=s[o],u=t[o];return c?u?aa(u,c):c:u||zr}return t[o]||zr}}},wi=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],i=t.nextPart.get(r);if(i){const u=wi(n,e+1,i);if(u)return u}const o=t.validators;if(o===null)return;const a=e===0?n.join(Fs):n.slice(e).join(Fs),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(a))return d.classGroupId}},da=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),s=e.slice(0,t);return s?ca+s:void 0})(),ha=n=>{const{theme:e,classGroups:t}=n;return fa(t,e)},fa=(n,e)=>{const t=mi();for(const s in n){const r=n[s];Fn(r,t,s,e)}return t},Fn=(n,e,t,s)=>{const r=n.length;for(let i=0;i<r;i++){const o=n[i];ga(o,e,t,s)}},ga=(n,e,t,s)=>{if(typeof n=="string"){pa(n,e,t);return}if(typeof n=="function"){ma(n,e,t,s);return}wa(n,e,t,s)},pa=(n,e,t)=>{const s=n===""?e:bi(e,n);s.classGroupId=t},ma=(n,e,t,s)=>{if(ba(n)){Fn(n(s),e,t,s);return}e.validators===null&&(e.validators=[]),e.validators.push(la(t,n))},wa=(n,e,t,s)=>{const r=Object.entries(n),i=r.length;for(let o=0;o<i;o++){const[a,c]=r[o];Fn(c,bi(e,a),t,s)}},bi=(n,e)=>{let t=n;const s=e.split(Fs),r=s.length;for(let i=0;i<r;i++){const o=s[i];let a=t.nextPart.get(o);a||(a=mi(),t.nextPart.set(o,a)),t=a}return t},ba=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,ya=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),s=Object.create(null);const r=(i,o)=>{t[i]=o,e++,e>n&&(e=0,s=t,t=Object.create(null))};return{get(i){let o=t[i];if(o!==void 0)return o;if((o=s[i])!==void 0)return r(i,o),o},set(i,o){i in t?t[i]=o:r(i,o)}}},vn="!",Br=":",va=[],Mr=(n,e,t,s,r)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:s,isExternal:r}),xa=n=>{const{prefix:e,experimentalParseClassName:t}=n;let s=r=>{const i=[];let o=0,a=0,c=0,u;const d=r.length;for(let h=0;h<d;h++){const m=r[h];if(o===0&&a===0){if(m===Br){i.push(r.slice(c,h)),c=h+1;continue}if(m==="/"){u=h;continue}}m==="["?o++:m==="]"?o--:m==="("?a++:m===")"&&a--}const f=i.length===0?r:r.slice(c);let p=f,g=!1;f.endsWith(vn)?(p=f.slice(0,-1),g=!0):f.startsWith(vn)&&(p=f.slice(1),g=!0);const b=u&&u>c?u-c:void 0;return Mr(i,g,p,b)};if(e){const r=e+Br,i=s;s=o=>o.startsWith(r)?i(o.slice(r.length)):Mr(va,!1,o,void 0,!0)}if(t){const r=s;s=i=>t({className:i,parseClassName:r})}return s},Ca=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,s)=>{e.set(t,1e6+s)}),t=>{const s=[];let r=[];for(let i=0;i<t.length;i++){const o=t[i],a=o[0]==="[",c=e.has(o);a||c?(r.length>0&&(r.sort(),s.push(...r),r=[]),s.push(o)):r.push(o)}return r.length>0&&(r.sort(),s.push(...r)),s}},ka=n=>({cache:ya(n.cacheSize),parseClassName:xa(n),sortModifiers:Ca(n),...ua(n)}),Sa=/\s+/,_a=(n,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:i}=e,o=[],a=n.trim().split(Sa);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:f,modifiers:p,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:h}=t(d);if(f){c=d+(c.length>0?" "+c:c);continue}let m=!!h,x=s(m?b.substring(0,h):b);if(!x){if(!m){c=d+(c.length>0?" "+c:c);continue}if(x=s(b),!x){c=d+(c.length>0?" "+c:c);continue}m=!1}const k=p.length===0?"":p.length===1?p[0]:i(p).join(":"),w=g?k+vn:k,C=w+x;if(o.indexOf(C)>-1)continue;o.push(C);const v=r(x,m);for(let y=0;y<v.length;++y){const _=v[y];o.push(w+_)}c=d+(c.length>0?" "+c:c)}return c},Ta=(...n)=>{let e=0,t,s,r="";for(;e<n.length;)(t=n[e++])&&(s=yi(t))&&(r&&(r+=" "),r+=s);return r},yi=n=>{if(typeof n=="string")return n;let e,t="";for(let s=0;s<n.length;s++)n[s]&&(e=yi(n[s]))&&(t&&(t+=" "),t+=e);return t},Ra=(n,...e)=>{let t,s,r,i;const o=c=>{const u=e.reduce((d,f)=>f(d),n());return t=ka(u),s=t.cache.get,r=t.cache.set,i=a,a(c)},a=c=>{const u=s(c);if(u)return u;const d=_a(c,t);return r(c,d),d};return i=o,(...c)=>i(Ta(...c))},za=[],we=n=>{const e=t=>t[n]||za;return e.isThemeGetter=!0,e},vi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ba=/^\d+\/\d+$/,Ma=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ea=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Aa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Da=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kt=n=>Ba.test(n),K=n=>!!n&&!Number.isNaN(Number(n)),pt=n=>!!n&&Number.isInteger(Number(n)),ln=n=>n.endsWith("%")&&K(n.slice(0,-1)),lt=n=>Ma.test(n),Va=()=>!0,$a=n=>Ea.test(n)&&!Aa.test(n),Ci=()=>!1,La=n=>Pa.test(n),Oa=n=>Da.test(n),Ia=n=>!P(n)&&!D(n),Na=n=>ns(n,_i,Ci),P=n=>vi.test(n),Bt=n=>ns(n,Ti,$a),cn=n=>ns(n,Ha,K),Er=n=>ns(n,ki,Ci),Fa=n=>ns(n,Si,Oa),Ps=n=>ns(n,Ri,La),D=n=>xi.test(n),ls=n=>rs(n,Ti),Ka=n=>rs(n,ja),Ar=n=>rs(n,ki),Wa=n=>rs(n,_i),Ua=n=>rs(n,Si),Ds=n=>rs(n,Ri,!0),ns=(n,e,t)=>{const s=vi.exec(n);return s?s[1]?e(s[1]):t(s[2]):!1},rs=(n,e,t=!1)=>{const s=xi.exec(n);return s?s[1]?e(s[1]):t:!1},ki=n=>n==="position"||n==="percentage",Si=n=>n==="image"||n==="url",_i=n=>n==="length"||n==="size"||n==="bg-size",Ti=n=>n==="length",Ha=n=>n==="number",ja=n=>n==="family-name",Ri=n=>n==="shadow",qa=()=>{const n=we("color"),e=we("font"),t=we("text"),s=we("font-weight"),r=we("tracking"),i=we("leading"),o=we("breakpoint"),a=we("container"),c=we("spacing"),u=we("radius"),d=we("shadow"),f=we("inset-shadow"),p=we("text-shadow"),g=we("drop-shadow"),b=we("blur"),h=we("perspective"),m=we("aspect"),x=we("ease"),k=we("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],v=()=>[...C(),D,P],y=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],T=()=>[D,P,c],R=()=>[Kt,"full","auto",...T()],L=()=>[pt,"none","subgrid",D,P],N=()=>["auto",{span:["full",pt,D,P]},pt,D,P],j=()=>[pt,"auto",D,P],Z=()=>["auto","min","max","fr",D,P],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...T()],G=()=>[Kt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],A=()=>[n,D,P],De=()=>[...C(),Ar,Er,{position:[D,P]}],Se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Wa,Na,{size:[D,P]}],F=()=>[ln,ls,Bt],O=()=>["","none","full",u,D,P],ee=()=>["",K,ls,Bt],ue=()=>["solid","dashed","dotted","double"],_t=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[K,ln,Ar,Er],Je=()=>["","none",b,D,P],Ft=()=>["none",K,D,P],qe=()=>["none",K,D,P],Q=()=>[K,D,P],Ge=()=>[Kt,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[Va],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[Ia],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",K],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Kt,P,D,m]}],container:["container"],columns:[{columns:[K,P,D,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[pt,"auto",D,P]}],basis:[{basis:[Kt,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,Kt,"auto","initial","none",P]}],grow:[{grow:["",K,D,P]}],shrink:[{shrink:["",K,D,P]}],order:[{order:[pt,"first","last","none",D,P]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",t,ls,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,D,cn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ln,P]}],"font-family":[{font:[Ka,P,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,D,P]}],"line-clamp":[{"line-clamp":[K,"none",D,cn]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",D,P]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",D,P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",D,Bt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[K,"auto",D,P]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",D,P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",D,P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:De()}],"bg-repeat":[{bg:Se()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pt,D,P],radial:["",D,P],conic:[pt,D,P]},Ua,Fa]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,D,P]}],"outline-w":[{outline:["",K,ls,Bt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,Ds,Ps]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,Ds,Ps]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[K,Bt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",p,Ds,Ps]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[K,D,P]}],"mix-blend":[{"mix-blend":[..._t(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_t()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[D,P]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:De()}],"mask-repeat":[{mask:Se()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",D,P]}],filter:[{filter:["","none",D,P]}],blur:[{blur:Je()}],brightness:[{brightness:[K,D,P]}],contrast:[{contrast:[K,D,P]}],"drop-shadow":[{"drop-shadow":["","none",g,Ds,Ps]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",K,D,P]}],"hue-rotate":[{"hue-rotate":[K,D,P]}],invert:[{invert:["",K,D,P]}],saturate:[{saturate:[K,D,P]}],sepia:[{sepia:["",K,D,P]}],"backdrop-filter":[{"backdrop-filter":["","none",D,P]}],"backdrop-blur":[{"backdrop-blur":Je()}],"backdrop-brightness":[{"backdrop-brightness":[K,D,P]}],"backdrop-contrast":[{"backdrop-contrast":[K,D,P]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,D,P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,D,P]}],"backdrop-invert":[{"backdrop-invert":["",K,D,P]}],"backdrop-opacity":[{"backdrop-opacity":[K,D,P]}],"backdrop-saturate":[{"backdrop-saturate":[K,D,P]}],"backdrop-sepia":[{"backdrop-sepia":["",K,D,P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",D,P]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[K,"initial",D,P]}],ease:[{ease:["linear","initial",x,D,P]}],delay:[{delay:[K,D,P]}],animate:[{animate:["none",k,D,P]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,D,P]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:Ft()}],"rotate-x":[{"rotate-x":Ft()}],"rotate-y":[{"rotate-y":Ft()}],"rotate-z":[{"rotate-z":Ft()}],scale:[{scale:qe()}],"scale-x":[{"scale-x":qe()}],"scale-y":[{"scale-y":qe()}],"scale-z":[{"scale-z":qe()}],"scale-3d":["scale-3d"],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[D,P,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",D,P]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",D,P]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[K,ls,Bt,cn]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ga=Ra(qa);function Kn(...n){return Ga(gi(n))}const ht=l.defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(n){const e=n;return(t,s)=>(l.openBlock(),l.createBlock(l.unref(oa),{"data-slot":"button",as:n.as,"as-child":n.asChild,class:l.normalizeClass(l.unref(Kn)(l.unref(Za)({variant:n.variant,size:n.size}),e.class))},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Za=na("tw:inline-flex tw:cursor-pointer tw:items-center tw:justify-center tw:whitespace-nowrap tw:text-sm tw:transition-all disabled:tw:pointer-events-none disabled:tw:opacity-50 [&_svg]:tw:pointer-events-none [&_svg:not([class*='size-'])]:tw:size-4 tw:shrink-0 [&_svg]:tw:shrink-0 tw:outline-none focus-visible:tw:border-ring focus-visible:tw:ring-ring/50 focus-visible:tw:ring-[3px] aria-invalid:tw:ring-destructive/20 dark:aria-invalid:tw:ring-destructive/40 aria-invalid:tw:border-destructive",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow-xs hover:tw:bg-primary/90",destructive:"tw:bg-destructive tw:text-white tw:shadow-xs hover:tw:bg-destructive/90 focus-visible:tw:ring-destructive/20 dark:focus-visible:tw:ring-destructive/40 dark:tw:bg-destructive/60",outlined:"tw:border tw:bg-background tw:shadow-xs hover:tw:bg-accent hover:tw:text-accent-foreground dark:tw:bg-input/30 dark:tw:border-input dark:hover:tw:bg-input/50",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-xs hover:tw:bg-secondary/80",ghost:"hover:tw:bg-accent hover:tw:text-accent-foreground dark:hover:tw:bg-accent/50",link:"tw:text-primary tw:underline-offset-4 hover:tw:underline",filled:"tw:border-transparent tw:bg-primary tw:text-primary-foreground [a&]:hover:tw:bg-primary/90",invisible:"tw:border-transparent tw:p-0! tw:bg-transparent tw:text-primary-foreground [a&]:hover:tw:bg-transparent"},size:{md:"tw:px-2 tw:py-1 tw:text-xs tw:h-6 tw:gap-1",sm:"tw:px-2 tw:py-1 tw:text-xs tw:h-5 tw:gap-1",lg:"tw:px-3 tw:py-1 tw:text-base tw:h-8 tw:gap-1",icon:"tw:size-9"}},defaultVariants:{variant:"default",size:"md"}}),Ya={md:16};function zi(n){const e=n.getKey("settings.borderRadius")??16;return typeof e!="number"?Ya.md:e}function Xa(n,e=8){if(n<=0)return 0;const t=n-e;return t<=0?4:Math.max(4,t)}function xs(n,e=8){const t=zi(n);return{borderRadius:`${Xa(t,e)}px`}}const xn=n=>n?n.replace(/<br>/g,"<br />").replace(/\n/g,"<br />"):"",Qa=["innerHTML"],Ja=["innerHTML"],el=["innerHTML"],tl=["width","height"],sl=`
2
2
  <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z" fill="currentColor"/>
4
- </svg>`,Ar=l.defineComponent({__name:"ChatError",props:{warningElement:{},headlineText:{},descriptionText:{},resetButtonText:{},type:{},configDesignClass:{},borderOffset:{},restartChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>{var c,u;return(c=e.configDesignClass)!=null&&c.getKey("settings.globalRoundingRadius")?ws(e.configDesignClass,8):{borderRadius:((u=e.warningElement.resetButton)==null?void 0:u.borderRadius)+"px"}}),s=l.computed(()=>{var u;const c=(u=e.configDesignClass)!=null&&u.getKey("settings.globalRoundingRadius")?ws(e.configDesignClass,8):{borderRadius:e.warningElement.content.borderRadius+"px"};return e.warningElement.warningStyle==="gradient"?{...c,"border-bottom-left-radius":"0px !important","border-bottom-right-radius":"0px !important"}:c}),r=l.computed(()=>{const c=e.warningElement.content.bgColor;if(e.warningElement.warningStyle==="gradient"){const u=c==null?void 0:c.match(/rgba?\(([^)]+)\)/);if(u){const[d,g,p]=u[1].split(",").map(f=>f.trim());return{background:`linear-gradient(180deg, ${c} 0%, rgba(${d}, ${g}, ${p}, 0) 100%)`}}else if(c!=null&&c.startsWith("#")){const d=c.replace("#",""),g=parseInt(d.substr(0,2),16),p=parseInt(d.substr(2,2),16),f=parseInt(d.substr(4,2),16);return{background:`linear-gradient(180deg, ${c} 0%, rgba(${g}, ${p}, ${f}, 0) 100%)`}}}else if(e.warningElement.warningStyle==="faded"){const u=c==null?void 0:c.match(/rgba?\(([^)]+)\)/);if(u){const[d,g,p]=u[1].split(",").map(f=>f.trim());return{backgroundColor:`rgba(${d}, ${g}, ${p}, 0.2)`,border:`1px solid ${c}`}}else if(c!=null&&c.startsWith("#")){const d=c.replace("#",""),g=parseInt(d.substr(0,2),16),p=parseInt(d.substr(2,2),16),f=parseInt(d.substr(4,2),16);return{backgroundColor:`rgba(${g}, ${p}, ${f}, 0.2)`,border:`1px solid ${c}`}}}return{backgroundColor:c}}),i=l.computed(()=>{var u,d,g;const c=((g=(d=(u=e.warningElement)==null?void 0:u.content)==null?void 0:d.icon)==null?void 0:g.src)||sl;try{const w=new DOMParser().parseFromString(String(c),"image/svg+xml").documentElement;return w.setAttribute("width","1em"),w.setAttribute("height","1em"),w.querySelectorAll("[fill], [stroke]").forEach(m=>{const v=m.getAttribute("fill");v&&v!=="none"&&!v.startsWith("url(")&&m.setAttribute("fill","currentColor");const y=m.getAttribute("stroke");y&&y!=="none"&&!y.startsWith("url(")&&m.setAttribute("stroke","currentColor")}),w.outerHTML}catch{return String(c)}}),o=l.computed(()=>e.type==="launchIssue"?"24px":"16px"),a=l.computed(()=>e.warningElement.resetButton?{backgroundColor:e.warningElement.resetButton.bgColor,color:e.warningElement.resetButton.color}:{});return(c,u)=>{var d,g,p,f,w,h,m,v,y,b,x;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tw:w-full tw:flex tw:items-center tw:flex-[1_0_0] tw:self-stretch",{"tw:flex-row tw:items-center tw:justify-between":n.type==="connectionIssue"||n.type==="reconnecting","tw:flex-col tw:items-center tw:justify-center tw:h-full":n.type==="launchIssue","tw:p-4":n.warningElement.warningStyle==="gradient","tw:p-2":n.warningElement.warningStyle!=="gradient"}]),style:l.normalizeStyle({...r.value,...s.value,paddingTop:(((d=n.warningElement.content)==null?void 0:d.verticalPadding)||null)+"px",paddingBottom:(((g=n.warningElement.content)==null?void 0:g.verticalPadding)||null)+"px"})},[l.createElementVNode("div",{class:l.normalizeClass(["tw:flex tw:gap-1 tw:items-center svg-inherit",{"tw:flex-row":n.type==="connectionIssue"||n.type==="reconnecting","tw:flex-col ":n.type==="launchIssue"}]),style:l.normalizeStyle({gap:(((p=n.warningElement.content)==null?void 0:p.verticalSpacing)||4)+"px"})},[(f=n.warningElement.content.icon)!=null&&f.showIcon?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({color:((w=n.warningElement.content.icon)==null?void 0:w.color)||n.warningElement.content.color,fontSize:o.value,width:(((h=n.warningElement.content.icon)==null?void 0:h.size)||16)+"px",height:(((m=n.warningElement.content.icon)==null?void 0:m.size)||16)+"px"}),class:l.normalizeClass({"tw:w-4 tw:h-4 tw:animate-spin":n.type==="reconnecting"}),innerHTML:i.value},null,14,Qa)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["tw:transition-all tw:justify-center tw:text-center tw:leading-none",{"tw:text-left tw:text-xs":n.type==="connectionIssue"||n.type==="reconnecting","tw:text-center tw:text-sm":n.type==="launchIssue"}]),innerHTML:l.unref(vn)(n.headlineText),style:l.normalizeStyle({color:((v=n.warningElement.content)==null?void 0:v.headlineColor)||n.warningElement.content.color,fontSize:(((y=n.warningElement.content)==null?void 0:y.headlineTextSize)||n.warningElement.content.fontSize)+"px"})},null,14,Ja),l.createElementVNode("p",{class:"tw:text-center tw:justify-center tw:text-xs tw:leading-none",style:l.normalizeStyle({color:n.warningElement.content.color,fontSize:(((b=n.warningElement.content)==null?void 0:b.subTextSize)||n.warningElement.content.fontSize)+"px"}),innerHTML:l.unref(vn)(n.descriptionText)},null,12,el)],6),n.warningElement.resetButton?(l.openBlock(),l.createBlock(l.unref(lt),{key:0,size:(x=n.warningElement.resetButton)==null?void 0:x.size,class:l.normalizeClass([{"tw:mt-8":n.type==="launchIssue"||n.type==="reconnecting"}]),variant:"default",style:l.normalizeStyle([a.value,t.value]),onClick:n.restartChat},{default:l.withCtx(()=>{var C,k;return[((C=n.warningElement.resetButton)==null?void 0:C.showType)!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.warningElement.resetButton.fontSize?n.warningElement.resetButton.fontSize+4:16,height:n.warningElement.resetButton.fontSize?n.warningElement.resetButton.fontSize+4:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:l.normalizeStyle({fill:n.warningElement.resetButton.color||"#2F2F31"})},[...u[0]||(u[0]=[l.createElementVNode("path",{d:"M10.7935 1.83337H5.20683C2.78016 1.83337 1.3335 3.28004 1.3335 5.70671V11.2867C1.3335 13.72 2.78016 15.1667 5.20683 15.1667H10.7868C13.2135 15.1667 14.6602 13.72 14.6602 11.2934V5.70671C14.6668 3.28004 13.2202 1.83337 10.7935 1.83337ZM8.00016 12.6667C6.80683 12.6667 5.8735 12.0734 5.24016 11.4867V11.96C5.24016 12.2334 5.0135 12.46 4.74016 12.46C4.46683 12.46 4.24016 12.2334 4.24016 11.96V10.1267C4.24016 9.85337 4.46683 9.62671 4.74016 9.62671H6.3935C6.66683 9.62671 6.8935 9.85337 6.8935 10.1267C6.8935 10.4 6.66683 10.6267 6.3935 10.6267H5.7935C6.28683 11.12 7.0535 11.6667 8.00016 11.6667C9.74683 11.6667 11.1668 10.2467 11.1668 8.50004C11.1668 8.22671 11.3935 8.00004 11.6668 8.00004C11.9402 8.00004 12.1668 8.22671 12.1668 8.50004C12.1668 10.8 10.3002 12.6667 8.00016 12.6667ZM12.1668 6.86004C12.1668 6.88004 12.1668 6.90004 12.1668 6.91337C12.1602 6.98671 12.1402 7.05337 12.1068 7.11337C12.0735 7.17337 12.0268 7.22671 11.9668 7.27337C11.9202 7.30671 11.8668 7.33337 11.8068 7.35337C11.7602 7.36671 11.7135 7.37337 11.6668 7.37337H10.0468C9.7735 7.37337 9.54683 7.14671 9.54683 6.87337C9.54683 6.60004 9.7735 6.37337 10.0468 6.37337H10.6002C10.0668 5.88004 9.20683 5.33337 8.0135 5.33337C6.26683 5.33337 4.84683 6.75337 4.84683 8.50004C4.84683 8.77337 4.62016 9.00004 4.34683 9.00004C4.0735 9.00004 3.8335 8.77337 3.8335 8.50004C3.8335 6.20004 5.70016 4.33337 8.00016 4.33337C9.4335 4.33337 10.4868 4.95337 11.1668 5.54671V5.04004C11.1668 4.76671 11.3935 4.54004 11.6668 4.54004C11.9402 4.54004 12.1668 4.76671 12.1668 5.04004V6.86004Z"},null,-1)])],12,tl)):l.createCommentVNode("",!0),((k=n.warningElement.resetButton)==null?void 0:k.showType)!=="icon"?(l.openBlock(),l.createElementBlock("span",{key:1,style:l.normalizeStyle({fontSize:n.warningElement.resetButton.fontSize+"px"})},l.toDisplayString(n.resetButtonText||"Restart"),5)):l.createCommentVNode("",!0)]}),_:1},8,["size","class","style","onClick"])):l.createCommentVNode("",!0)],6)}}});function ot(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function zi(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*!
4
+ </svg>`,Pr=l.defineComponent({__name:"ChatError",props:{warningElement:{},headlineText:{},descriptionText:{},resetButtonText:{},type:{},configDesignClass:{},borderOffset:{},restartChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>{var c,u;return(c=e.configDesignClass)!=null&&c.getKey("settings.globalRoundingRadius")?xs(e.configDesignClass,8):{borderRadius:((u=e.warningElement.resetButton)==null?void 0:u.borderRadius)+"px"}}),s=l.computed(()=>{var u;const c=(u=e.configDesignClass)!=null&&u.getKey("settings.globalRoundingRadius")?xs(e.configDesignClass,8):{borderRadius:e.warningElement.content.borderRadius+"px"};return e.warningElement.warningStyle==="gradient"?{...c,"border-bottom-left-radius":"0px !important","border-bottom-right-radius":"0px !important"}:c}),r=l.computed(()=>{const c=e.warningElement.content.bgColor;if(e.warningElement.warningStyle==="gradient"){const u=c==null?void 0:c.match(/rgba?\(([^)]+)\)/);if(u){const[d,f,p]=u[1].split(",").map(g=>g.trim());return{background:`linear-gradient(180deg, ${c} 0%, rgba(${d}, ${f}, ${p}, 0) 100%)`}}else if(c!=null&&c.startsWith("#")){const d=c.replace("#",""),f=parseInt(d.substr(0,2),16),p=parseInt(d.substr(2,2),16),g=parseInt(d.substr(4,2),16);return{background:`linear-gradient(180deg, ${c} 0%, rgba(${f}, ${p}, ${g}, 0) 100%)`}}}else if(e.warningElement.warningStyle==="faded"){const u=c==null?void 0:c.match(/rgba?\(([^)]+)\)/);if(u){const[d,f,p]=u[1].split(",").map(g=>g.trim());return{backgroundColor:`rgba(${d}, ${f}, ${p}, 0.2)`,border:`1px solid ${c}`}}else if(c!=null&&c.startsWith("#")){const d=c.replace("#",""),f=parseInt(d.substr(0,2),16),p=parseInt(d.substr(2,2),16),g=parseInt(d.substr(4,2),16);return{backgroundColor:`rgba(${f}, ${p}, ${g}, 0.2)`,border:`1px solid ${c}`}}}return{backgroundColor:c}}),i=l.computed(()=>{var u,d,f;const c=((f=(d=(u=e.warningElement)==null?void 0:u.content)==null?void 0:d.icon)==null?void 0:f.src)||sl;try{const b=new DOMParser().parseFromString(String(c),"image/svg+xml").documentElement;return b.setAttribute("width","1em"),b.setAttribute("height","1em"),b.querySelectorAll("[fill], [stroke]").forEach(m=>{const x=m.getAttribute("fill");x&&x!=="none"&&!x.startsWith("url(")&&m.setAttribute("fill","currentColor");const k=m.getAttribute("stroke");k&&k!=="none"&&!k.startsWith("url(")&&m.setAttribute("stroke","currentColor")}),b.outerHTML}catch{return String(c)}}),o=l.computed(()=>e.type==="launchIssue"?"24px":"16px"),a=l.computed(()=>e.warningElement.resetButton?{backgroundColor:e.warningElement.resetButton.bgColor,color:e.warningElement.resetButton.color}:{});return(c,u)=>{var d,f,p,g,b,h,m,x,k,w,C;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tw:w-full tw:flex tw:items-center tw:flex-[1_0_0] tw:self-stretch",{"tw:flex-row tw:items-center tw:justify-between":n.type==="connectionIssue"||n.type==="reconnecting","tw:flex-col tw:items-center tw:justify-center tw:h-full":n.type==="launchIssue","tw:p-4":n.warningElement.warningStyle==="gradient","tw:p-2":n.warningElement.warningStyle!=="gradient"}]),style:l.normalizeStyle({...r.value,...s.value,paddingTop:(((d=n.warningElement.content)==null?void 0:d.verticalPadding)||null)+"px",paddingBottom:(((f=n.warningElement.content)==null?void 0:f.verticalPadding)||null)+"px"})},[l.createElementVNode("div",{class:l.normalizeClass(["tw:flex tw:gap-1 tw:items-center svg-inherit",{"tw:flex-row":n.type==="connectionIssue"||n.type==="reconnecting","tw:flex-col ":n.type==="launchIssue"}]),style:l.normalizeStyle({gap:(((p=n.warningElement.content)==null?void 0:p.verticalSpacing)||4)+"px"})},[(g=n.warningElement.content.icon)!=null&&g.showIcon?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({color:((b=n.warningElement.content.icon)==null?void 0:b.color)||n.warningElement.content.color,fontSize:o.value,width:(((h=n.warningElement.content.icon)==null?void 0:h.size)||16)+"px",height:(((m=n.warningElement.content.icon)==null?void 0:m.size)||16)+"px"}),class:l.normalizeClass({"tw:w-4 tw:h-4 tw:animate-spin":n.type==="reconnecting"}),innerHTML:i.value},null,14,Qa)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["tw:transition-all tw:justify-center tw:text-center tw:leading-none",{"tw:text-left tw:text-xs":n.type==="connectionIssue"||n.type==="reconnecting","tw:text-center tw:text-sm":n.type==="launchIssue"}]),innerHTML:l.unref(xn)(n.headlineText),style:l.normalizeStyle({color:((x=n.warningElement.content)==null?void 0:x.headlineColor)||n.warningElement.content.color,fontSize:(((k=n.warningElement.content)==null?void 0:k.headlineTextSize)||n.warningElement.content.fontSize)+"px"})},null,14,Ja),l.createElementVNode("p",{class:"tw:text-center tw:justify-center tw:text-xs tw:leading-none",style:l.normalizeStyle({color:n.warningElement.content.color,fontSize:(((w=n.warningElement.content)==null?void 0:w.subTextSize)||n.warningElement.content.fontSize)+"px"}),innerHTML:l.unref(xn)(n.descriptionText)},null,12,el)],6),n.warningElement.resetButton?(l.openBlock(),l.createBlock(l.unref(ht),{key:0,size:(C=n.warningElement.resetButton)==null?void 0:C.size,class:l.normalizeClass([{"tw:mt-8":n.type==="launchIssue"||n.type==="reconnecting"}]),variant:"default",style:l.normalizeStyle([a.value,t.value]),onClick:n.restartChat},{default:l.withCtx(()=>{var v,y;return[((v=n.warningElement.resetButton)==null?void 0:v.showType)!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.warningElement.resetButton.fontSize?n.warningElement.resetButton.fontSize+4:16,height:n.warningElement.resetButton.fontSize?n.warningElement.resetButton.fontSize+4:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:l.normalizeStyle({fill:n.warningElement.resetButton.color||"#2F2F31"})},[...u[0]||(u[0]=[l.createElementVNode("path",{d:"M10.7935 1.83337H5.20683C2.78016 1.83337 1.3335 3.28004 1.3335 5.70671V11.2867C1.3335 13.72 2.78016 15.1667 5.20683 15.1667H10.7868C13.2135 15.1667 14.6602 13.72 14.6602 11.2934V5.70671C14.6668 3.28004 13.2202 1.83337 10.7935 1.83337ZM8.00016 12.6667C6.80683 12.6667 5.8735 12.0734 5.24016 11.4867V11.96C5.24016 12.2334 5.0135 12.46 4.74016 12.46C4.46683 12.46 4.24016 12.2334 4.24016 11.96V10.1267C4.24016 9.85337 4.46683 9.62671 4.74016 9.62671H6.3935C6.66683 9.62671 6.8935 9.85337 6.8935 10.1267C6.8935 10.4 6.66683 10.6267 6.3935 10.6267H5.7935C6.28683 11.12 7.0535 11.6667 8.00016 11.6667C9.74683 11.6667 11.1668 10.2467 11.1668 8.50004C11.1668 8.22671 11.3935 8.00004 11.6668 8.00004C11.9402 8.00004 12.1668 8.22671 12.1668 8.50004C12.1668 10.8 10.3002 12.6667 8.00016 12.6667ZM12.1668 6.86004C12.1668 6.88004 12.1668 6.90004 12.1668 6.91337C12.1602 6.98671 12.1402 7.05337 12.1068 7.11337C12.0735 7.17337 12.0268 7.22671 11.9668 7.27337C11.9202 7.30671 11.8668 7.33337 11.8068 7.35337C11.7602 7.36671 11.7135 7.37337 11.6668 7.37337H10.0468C9.7735 7.37337 9.54683 7.14671 9.54683 6.87337C9.54683 6.60004 9.7735 6.37337 10.0468 6.37337H10.6002C10.0668 5.88004 9.20683 5.33337 8.0135 5.33337C6.26683 5.33337 4.84683 6.75337 4.84683 8.50004C4.84683 8.77337 4.62016 9.00004 4.34683 9.00004C4.0735 9.00004 3.8335 8.77337 3.8335 8.50004C3.8335 6.20004 5.70016 4.33337 8.00016 4.33337C9.4335 4.33337 10.4868 4.95337 11.1668 5.54671V5.04004C11.1668 4.76671 11.3935 4.54004 11.6668 4.54004C11.9402 4.54004 12.1668 4.76671 12.1668 5.04004V6.86004Z"},null,-1)])],12,tl)):l.createCommentVNode("",!0),((y=n.warningElement.resetButton)==null?void 0:y.showType)!=="icon"?(l.openBlock(),l.createElementBlock("span",{key:1,style:l.normalizeStyle({fontSize:n.warningElement.resetButton.fontSize+"px"})},l.toDisplayString(n.resetButtonText||"Restart"),5)):l.createCommentVNode("",!0)]}),_:1},8,["size","class","style","onClick"])):l.createCommentVNode("",!0)],6)}}});function ut(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Bi(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*!
5
5
  * GSAP 3.14.2
6
6
  * https://gsap.com
7
7
  *
8
8
  * @license Copyright 2008-2025, GreenSock. All rights reserved.
9
9
  * Subject to the terms at https://gsap.com/standard-license
10
10
  * @author: Jack Doyle, jack@greensock.com
11
- */var Le={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ut={duration:.5,overwrite:!1,delay:0},Kn,ye,oe,Ke=1e8,ne=1/Ke,xn=Math.PI*2,nl=xn/4,rl=0,Bi=Math.sqrt,il=Math.cos,ol=Math.sin,be=function(e){return typeof e=="string"},he=function(e){return typeof e=="function"},ct=function(e){return typeof e=="number"},Wn=function(e){return typeof e>"u"},st=function(e){return typeof e=="object"},Re=function(e){return e!==!1},Un=function(){return typeof window<"u"},Ds=function(e){return he(e)||be(e)},Mi=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ce=Array.isArray,al=/random\([^)]+\)/g,ll=/,\s*/g,Pr=/(?:-?\.?\d|\.)+/gi,Ei=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ot=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,cn=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ai=/[+-]=-?[.\d]+/,cl=/[^,'"\[\]\s]+/gi,ul=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ue,Je,Cn,Hn,Oe={},Fs={},Pi,Di=function(e){return(Fs=Ht(e,Oe))&&Ee},jn=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},bs=function(e,t){return!t&&console.warn(e)},Vi=function(e,t){return e&&(Oe[e]=t)&&Fs&&(Fs[e]=t)||Oe},ys=function(){return 0},dl={suppressEvents:!0,isStart:!0,kill:!1},Ls={suppressEvents:!0,kill:!1},hl={suppressEvents:!0},qn={},pt=[],kn={},$i,Pe={},un={},Dr=30,Os=[],Gn="",Zn=function(e){var t=e[0],s,r;if(st(t)||he(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(r=Os.length;r--&&!Os[r].targetTest(t););s=Os[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new oo(e[r],s)))||e.splice(r,1);return e},Rt=function(e){return e._gsap||Zn(We(e))[0]._gsap},Li=function(e,t,s){return(s=e[t])&&he(s)?e[t]():Wn(s)&&e.getAttribute&&e.getAttribute(t)||s},ze=function(e,t){return(e=e.split(",")).forEach(t)||e},fe=function(e){return Math.round(e*1e5)/1e5||0},ce=function(e){return Math.round(e*1e7)/1e7||0},Ft=function(e,t){var s=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+r:s==="-"?e-r:s==="*"?e*r:e/r},gl=function(e,t){for(var s=t.length,r=0;e.indexOf(t[r])<0&&++r<s;);return r<s},Ks=function(){var e=pt.length,t=pt.slice(0),s,r;for(kn={},pt.length=0,s=0;s<e;s++)r=t[s],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},Yn=function(e){return!!(e._initted||e._startAt||e.add)},Oi=function(e,t,s,r){pt.length&&!ye&&Ks(),e.render(t,s,!!(ye&&t<0&&Yn(e))),pt.length&&!ye&&Ks()},Ii=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(cl).length<2?t:be(e)?e.trim():e},Ni=function(e){return e},Ie=function(e,t){for(var s in t)s in e||(e[s]=t[s]);return e},fl=function(e){return function(t,s){for(var r in s)r in t||r==="duration"&&e||r==="ease"||(t[r]=s[r])}},Ht=function(e,t){for(var s in t)e[s]=t[s];return e},Vr=function n(e,t){for(var s in t)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(e[s]=st(t[s])?n(e[s]||(e[s]={}),t[s]):t[s]);return e},Ws=function(e,t){var s={},r;for(r in e)r in t||(s[r]=e[r]);return s},gs=function(e){var t=e.parent||ue,s=e.keyframes?fl(Ce(e.keyframes)):Ie;if(Re(e.inherit))for(;t;)s(e,t.vars.defaults),t=t.parent||t._dp;return e},pl=function(e,t){for(var s=e.length,r=s===t.length;r&&s--&&e[s]===t[s];);return s<0},Fi=function(e,t,s,r,i){var o=e[r],a;if(i)for(a=t[i];o&&o[i]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[r]=t,t._prev=o,t.parent=t._dp=e,t},Xs=function(e,t,s,r){s===void 0&&(s="_first"),r===void 0&&(r="_last");var i=t._prev,o=t._next;i?i._next=o:e[s]===t&&(e[s]=o),o?o._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},wt=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},zt=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},ml=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Sn=function(e,t,s,r){return e._startAt&&(ye?e._startAt.revert(Ls):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},wl=function n(e){return!e||e._ts&&n(e.parent)},$r=function(e){return e._repeat?jt(e._tTime,e=e.duration()+e._rDelay)*e:0},jt=function(e,t){var s=Math.floor(e=ce(e/t));return e&&s===e?s-1:s},Us=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Qs=function(e){return e._end=ce(e._start+(e._tDur/Math.abs(e._ts||e._rts||ne)||0))},Js=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=ce(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Qs(e),s._dirty||zt(s,e)),e},Ki=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(s=Us(e.rawTime(),t),(!t._dur||_s(0,t.totalDuration(),s)-t._tTime>ne)&&t.render(s,!0)),zt(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(s=e;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-ne}},et=function(e,t,s,r){return t.parent&&wt(t),t._start=ce((ct(s)?s:s||e!==ue?Fe(e,s,t):e._time)+t._delay),t._end=ce(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Fi(e,t,"_first","_last",e._sort?"_start":0),_n(t)||(e._recent=t),r||Ki(e,t),e._ts<0&&Js(e,e._tTime),e},Wi=function(e,t){return(Oe.ScrollTrigger||jn("scrollTrigger",t))&&Oe.ScrollTrigger.create(t,e)},Ui=function(e,t,s,r,i){if(Qn(e,t,i),!e._initted)return 1;if(!s&&e._pt&&!ye&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&$i!==De.frame)return pt.push(e),e._lazy=[i,r],1},bl=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},_n=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},yl=function(e,t,s,r){var i=e.ratio,o=t<0||!t&&(!e._start&&bl(e)&&!(!e._initted&&_n(e))||(e._ts<0||e._dp._ts<0)&&!_n(e))?0:1,a=e._rDelay,c=0,u,d,g;if(a&&e._repeat&&(c=_s(0,e._tDur,t),d=jt(c,a),e._yoyo&&d&1&&(o=1-o),d!==jt(e._tTime,a)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||ye||r||e._zTime===ne||!t&&e._zTime){if(!e._initted&&Ui(e,t,r,s,c))return;for(g=e._zTime,e._zTime=t||(s?ne:0),s||(s=t&&!g),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&Sn(e,t,s,!0),e._onUpdate&&!s&&Ve(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&Ve(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&wt(e,1),!s&&!ye&&(Ve(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},vl=function(e,t,s){var r;if(s>t)for(r=e._first;r&&r._start<=s;){if(r.data==="isPause"&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=s;){if(r.data==="isPause"&&r._start<t)return r;r=r._prev}},qt=function(e,t,s,r){var i=e._repeat,o=ce(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:ce(o*(i+1)+e._rDelay*i):o,a>0&&!r&&Js(e,e._tTime=e._tDur*a),e.parent&&Qs(e),s||zt(e.parent,e),e},Lr=function(e){return e instanceof ke?zt(e):qt(e,e._dur)},xl={_start:0,endTime:ys,totalDuration:ys},Fe=function n(e,t,s){var r=e.labels,i=e._recent||xl,o=e.duration()>=Ke?i.endTime(!1):e._dur,a,c,u;return be(t)&&(isNaN(t)||t in r)?(c=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),c==="<"||c===">"?(a>=0&&(t=t.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?i:s).totalDuration()/100:1)):a<0?(t in r||(r[t]=o),r[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&s&&(c=c/100*(Ce(s)?s[0]:s).totalDuration()),a>1?n(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},fs=function(e,t,s){var r=ct(t[1]),i=(r?2:1)+(e<2?0:1),o=t[i],a,c;if(r&&(o.duration=t[1]),o.parent=s,e){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=Re(c.vars.inherit)&&c.parent;o.immediateRender=Re(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[i-1]}return new me(t[0],o,t[i+1])},vt=function(e,t){return e||e===0?t(e):t},_s=function(e,t,s){return s<e?e:s>t?t:s},xe=function(e,t){return!be(e)||!(t=ul.exec(e))?"":t[1]},Cl=function(e,t,s){return vt(s,function(r){return _s(e,t,r)})},Tn=[].slice,Hi=function(e,t){return e&&st(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&st(e[0]))&&!e.nodeType&&e!==Je},kl=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(r){var i;return be(r)&&!t||Hi(r,1)?(i=s).push.apply(i,We(r)):s.push(r)})||s},We=function(e,t,s){return oe&&!t&&oe.selector?oe.selector(e):be(e)&&!s&&(Cn||!Gt())?Tn.call((t||Hn).querySelectorAll(e),0):Ce(e)?kl(e,s):Hi(e)?Tn.call(e,0):e?[e]:[]},Rn=function(e){return e=We(e)[0]||bs("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return We(t,s.querySelectorAll?s:s===e?bs("Invalid scope")||Hn.createElement("div"):e)}},ji=function(e){return e.sort(function(){return .5-Math.random()})},qi=function(e){if(he(e))return e;var t=st(e)?e:{each:e},s=Bt(t.ease),r=t.from||0,i=parseFloat(t.base)||0,o={},a=r>0&&r<1,c=isNaN(r)||a,u=t.axis,d=r,g=r;return be(r)?d=g={center:.5,edges:.5,end:1}[r]||0:!a&&c&&(d=r[0],g=r[1]),function(p,f,w){var h=(w||t).length,m=o[h],v,y,b,x,C,k,R,_,T;if(!m){if(T=t.grid==="auto"?0:(t.grid||[1,Ke])[1],!T){for(R=-Ke;R<(R=w[T++].getBoundingClientRect().left)&&T<h;);T<h&&T--}for(m=o[h]=[],v=c?Math.min(T,h)*d-.5:r%T,y=T===Ke?0:c?h*g/T-.5:r/T|0,R=0,_=Ke,k=0;k<h;k++)b=k%T-v,x=y-(k/T|0),m[k]=C=u?Math.abs(u==="y"?x:b):Bi(b*b+x*x),C>R&&(R=C),C<_&&(_=C);r==="random"&&ji(m),m.max=R-_,m.min=_,m.v=h=(parseFloat(t.amount)||parseFloat(t.each)*(T>h?h-1:u?u==="y"?h/T:T:Math.max(T,h/T))||0)*(r==="edges"?-1:1),m.b=h<0?i-h:i,m.u=xe(t.amount||t.each)||0,s=s&&h<0?no(s):s}return h=(m[p]-m.min)/m.max||0,ce(m.b+(s?s(h):h)*m.v)+m.u}},zn=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var r=ce(Math.round(parseFloat(s)/e)*e*t);return(r-r%1)/t+(ct(s)?0:xe(s))}},Gi=function(e,t){var s=Ce(e),r,i;return!s&&st(e)&&(r=s=e.radius||Ke,e.values?(e=We(e.values),(i=!ct(e[0]))&&(r*=r)):e=zn(e.increment)),vt(t,s?he(e)?function(o){return i=e(o),Math.abs(i-o)<=r?i:o}:function(o){for(var a=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),u=Ke,d=0,g=e.length,p,f;g--;)i?(p=e[g].x-a,f=e[g].y-c,p=p*p+f*f):p=Math.abs(e[g]-a),p<u&&(u=p,d=g);return d=!r||u<=r?e[d]:o,i||d===o||ct(o)?d:d+xe(o)}:zn(e))},Zi=function(e,t,s,r){return vt(Ce(e)?!t:s===!0?!!(s=0):!r,function(){return Ce(e)?e[~~(Math.random()*e.length)]:(s=s||1e-5)&&(r=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((e-s/2+Math.random()*(t-e+s*.99))/s)*s*r)/r})},Sl=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return function(r){return t.reduce(function(i,o){return o(i)},r)}},_l=function(e,t){return function(s){return e(parseFloat(s))+(t||xe(s))}},Tl=function(e,t,s){return Xi(e,t,0,1,s)},Yi=function(e,t,s){return vt(s,function(r){return e[~~t(r)]})},Rl=function n(e,t,s){var r=t-e;return Ce(e)?Yi(e,n(0,e.length),t):vt(s,function(i){return(r+(i-e)%r)%r+e})},zl=function n(e,t,s){var r=t-e,i=r*2;return Ce(e)?Yi(e,n(0,e.length-1),t):vt(s,function(o){return o=(i+(o-e)%i)%i||0,e+(o>r?i-o:o)})},vs=function(e){return e.replace(al,function(t){var s=t.indexOf("[")+1,r=t.substring(s||7,s?t.indexOf("]"):t.length-1).split(ll);return Zi(s?r:+r[0],s?0:+r[1],+r[2]||1e-5)})},Xi=function(e,t,s,r,i){var o=t-e,a=r-s;return vt(i,function(c){return s+((c-e)/o*a||0)})},Bl=function n(e,t,s,r){var i=isNaN(e+t)?0:function(f){return(1-f)*e+f*t};if(!i){var o=be(e),a={},c,u,d,g,p;if(s===!0&&(r=1)&&(s=null),o)e={p:e},t={p:t};else if(Ce(e)&&!Ce(t)){for(d=[],g=e.length,p=g-2,u=1;u<g;u++)d.push(n(e[u-1],e[u]));g--,i=function(w){w*=g;var h=Math.min(p,~~w);return d[h](w-h)},s=t}else r||(e=Ht(Ce(e)?[]:{},e));if(!d){for(c in t)Xn.call(a,e,c,"get",t[c]);i=function(w){return tr(w,a)||(o?e.p:e)}}}return vt(s,i)},Or=function(e,t,s){var r=e.labels,i=Ke,o,a,c;for(o in r)a=r[o]-t,a<0==!!s&&a&&i>(a=Math.abs(a))&&(c=o,i=a);return c},Ve=function(e,t,s){var r=e.vars,i=r[t],o=oe,a=e._ctx,c,u,d;if(i)return c=r[t+"Params"],u=r.callbackScope||e,s&&pt.length&&Ks(),a&&(oe=a),d=c?i.apply(u,c):i.call(u),oe=o,d},us=function(e){return wt(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ye),e.progress()<1&&Ve(e,"onInterrupt"),e},It,Qi=[],Ji=function(e){if(e)if(e=!e.name&&e.default||e,Un()||e.headless){var t=e.name,s=he(e),r=t&&!s&&e.init?function(){this._props=[]}:e,i={init:ys,render:tr,add:Xn,kill:Hl,modifier:Ul,rawVars:0},o={targetTest:0,get:0,getSetter:er,aliases:{},register:0};if(Gt(),e!==r){if(Pe[t])return;Ie(r,Ie(Ws(e,i),o)),Ht(r.prototype,Ht(i,Ws(e,o))),Pe[r.prop=t]=r,e.targetTest&&(Os.push(r),qn[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Vi(t,r),e.register&&e.register(Ee,r,Be)}else Qi.push(e)},se=255,ds={aqua:[0,se,se],lime:[0,se,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,se],navy:[0,0,128],white:[se,se,se],olive:[128,128,0],yellow:[se,se,0],orange:[se,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[se,0,0],pink:[se,192,203],cyan:[0,se,se],transparent:[se,se,se,0]},dn=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*se+.5|0},eo=function(e,t,s){var r=e?ct(e)?[e>>16,e>>8&se,e&se]:0:ds.black,i,o,a,c,u,d,g,p,f,w;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ds[e])r=ds[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+i+i+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&se,r&se,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&se,e&se]}else if(e.substr(0,3)==="hsl"){if(r=w=e.match(Pr),!t)c=+r[0]%360/360,u=+r[1]/100,d=+r[2]/100,o=d<=.5?d*(u+1):d+u-d*u,i=d*2-o,r.length>3&&(r[3]*=1),r[0]=dn(c+1/3,i,o),r[1]=dn(c,i,o),r[2]=dn(c-1/3,i,o);else if(~e.indexOf("="))return r=e.match(Ei),s&&r.length<4&&(r[3]=1),r}else r=e.match(Pr)||ds.transparent;r=r.map(Number)}return t&&!w&&(i=r[0]/se,o=r[1]/se,a=r[2]/se,g=Math.max(i,o,a),p=Math.min(i,o,a),d=(g+p)/2,g===p?c=u=0:(f=g-p,u=d>.5?f/(2-g-p):f/(g+p),c=g===i?(o-a)/f+(o<a?6:0):g===o?(a-i)/f+2:(i-o)/f+4,c*=60),r[0]=~~(c+.5),r[1]=~~(u*100+.5),r[2]=~~(d*100+.5)),s&&r.length<4&&(r[3]=1),r},to=function(e){var t=[],s=[],r=-1;return e.split(mt).forEach(function(i){var o=i.match(Ot)||[];t.push.apply(t,o),s.push(r+=o.length+1)}),t.c=s,t},Ir=function(e,t,s){var r="",i=(e+r).match(mt),o=t?"hsla(":"rgba(",a=0,c,u,d,g;if(!i)return e;if(i=i.map(function(p){return(p=eo(p,t,1))&&o+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),s&&(d=to(e),c=s.c,c.join(r)!==d.c.join(r)))for(u=e.replace(mt,"1").split(Ot),g=u.length-1;a<g;a++)r+=u[a]+(~c.indexOf(a)?i.shift()||o+"0,0,0,0)":(d.length?d:i.length?i:s).shift());if(!u)for(u=e.split(mt),g=u.length-1;a<g;a++)r+=u[a]+i[a];return r+u[g]},mt=(function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ds)n+="|"+e+"\\b";return new RegExp(n+")","gi")})(),Ml=/hsl[a]?\(/,so=function(e){var t=e.join(" "),s;if(mt.lastIndex=0,mt.test(t))return s=Ml.test(t),e[1]=Ir(e[1],s),e[0]=Ir(e[0],s,to(e[1])),!0},xs,De=(function(){var n=Date.now,e=500,t=33,s=n(),r=s,i=1e3/240,o=i,a=[],c,u,d,g,p,f,w=function h(m){var v=n()-r,y=m===!0,b,x,C,k;if((v>e||v<0)&&(s+=v-t),r+=v,C=r-s,b=C-o,(b>0||y)&&(k=++g.frame,p=C-g.time*1e3,g.time=C=C/1e3,o+=b+(b>=i?4:i-b),x=1),y||(c=u(h)),x)for(f=0;f<a.length;f++)a[f](C,p,k,m)};return g={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(m){return p/(1e3/(m||60))},wake:function(){Pi&&(!Cn&&Un()&&(Je=Cn=window,Hn=Je.document||{},Oe.gsap=Ee,(Je.gsapVersions||(Je.gsapVersions=[])).push(Ee.version),Di(Fs||Je.GreenSockGlobals||!Je.gsap&&Je||{}),Qi.forEach(Ji)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&g.sleep(),u=d||function(m){return setTimeout(m,o-g.time*1e3+1|0)},xs=1,w(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(c),xs=0,u=ys},lagSmoothing:function(m,v){e=m||1/0,t=Math.min(v||33,e)},fps:function(m){i=1e3/(m||240),o=g.time*1e3+i},add:function(m,v,y){var b=v?function(x,C,k,R){m(x,C,k,R),g.remove(b)}:m;return g.remove(m),a[y?"unshift":"push"](b),Gt(),b},remove:function(m,v){~(v=a.indexOf(m))&&a.splice(v,1)&&f>=v&&f--},_listeners:a},g})(),Gt=function(){return!xs&&De.wake()},Y={},El=/^[\d.\-M][\d.\-,\s]/,Al=/["']/g,Pl=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),r=s[0],i=1,o=s.length,a,c,u;i<o;i++)c=s[i],a=i!==o-1?c.lastIndexOf(","):c.length,u=c.substr(0,a),t[r]=isNaN(u)?u.replace(Al,"").trim():+u,r=c.substr(a+1).trim();return t},Dl=function(e){var t=e.indexOf("(")+1,s=e.indexOf(")"),r=e.indexOf("(",t);return e.substring(t,~r&&r<s?e.indexOf(")",s+1):s)},Vl=function(e){var t=(e+"").split("("),s=Y[t[0]];return s&&t.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[Pl(t[1])]:Dl(e).split(",").map(Ii)):Y._CE&&El.test(e)?Y._CE("",e):s},no=function(e){return function(t){return 1-e(1-t)}},ro=function n(e,t){for(var s=e._first,r;s;)s instanceof ke?n(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?n(s.timeline,t):(r=s._ease,s._ease=s._yEase,s._yEase=r,s._yoyo=t)),s=s._next},Bt=function(e,t){return e&&(he(e)?e:Y[e]||Vl(e))||t},At=function(e,t,s,r){s===void 0&&(s=function(c){return 1-t(1-c)}),r===void 0&&(r=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var i={easeIn:t,easeOut:s,easeInOut:r},o;return ze(e,function(a){Y[a]=Oe[a]=i,Y[o=a.toLowerCase()]=s;for(var c in i)Y[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Y[a+"."+c]=i[c]}),i},io=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},hn=function n(e,t,s){var r=t>=1?t:1,i=(s||(e?.3:.45))/(t<1?t:1),o=i/xn*(Math.asin(1/r)||0),a=function(d){return d===1?1:r*Math.pow(2,-10*d)*ol((d-o)*i)+1},c=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:io(a);return i=xn/i,c.config=function(u,d){return n(e,u,d)},c},gn=function n(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},r=e==="out"?s:e==="in"?function(i){return 1-s(1-i)}:io(s);return r.config=function(i){return n(e,i)},r};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;At(n+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});Y.Linear.easeNone=Y.none=Y.Linear.easeIn;At("Elastic",hn("in"),hn("out"),hn());(function(n,e){var t=1/e,s=2*t,r=2.5*t,i=function(a){return a<t?n*a*a:a<s?n*Math.pow(a-1.5/e,2)+.75:a<r?n*(a-=2.25/e)*a+.9375:n*Math.pow(a-2.625/e,2)+.984375};At("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);At("Expo",function(n){return Math.pow(2,10*(n-1))*n+n*n*n*n*n*n*(1-n)});At("Circ",function(n){return-(Bi(1-n*n)-1)});At("Sine",function(n){return n===1?1:-il(n*nl)+1});At("Back",gn("in"),gn("out"),gn());Y.SteppedEase=Y.steps=Oe.SteppedEase={config:function(e,t){e===void 0&&(e=1);var s=1/e,r=e+(t?0:1),i=t?1:0,o=1-ne;return function(a){return((r*_s(0,o,a)|0)+i)*s}}};Ut.ease=Y["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return Gn+=n+","+n+"Params,"});var oo=function(e,t){this.id=rl++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Li,this.set=t?t.getSetter:er},Cs=(function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,qt(this,+t.duration,1,1),this.data=t.data,oe&&(this._ctx=oe,oe.data.push(this)),xs||De.wake()}var e=n.prototype;return e.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},e.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,qt(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,r){if(Gt(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Js(this,s),!i._dp||i.parent||Ki(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&et(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===ne||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Oi(this,s,r)),this},e.time=function(s,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+$r(this))%(this._dur+this._rDelay)||(s?this._dur:0),r):this._time},e.totalProgress=function(s,r){return arguments.length?this.totalTime(this.totalDuration()*s,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(s,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+$r(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,r){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,r):this._repeat?jt(this._tTime,i)+1:1},e.timeScale=function(s,r){if(!arguments.length)return this._rts===-ne?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?Us(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-ne?0:this._rts,this.totalTime(_s(-Math.abs(this._delay),this.totalDuration(),i),r!==!1),Qs(this),ml(this)},e.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Gt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ne&&(this._tTime-=ne)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=ce(s);var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&et(r,this,this._start-this._delay),this}return this._start},e.endTime=function(s){return this._start+(Re(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var r=this.parent||this._dp;return r?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Us(r.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=hl);var r=ye;return ye=s,Yn(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),ye=r,this},e.globalTime=function(s){for(var r=this,i=arguments.length?s:r.rawTime();r;)i=r._start+i/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Lr(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var r=this._time;return this._rDelay=s,Lr(this),r?this.time(r):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,r){return this.totalTime(Fe(this,s),Re(r))},e.restart=function(s,r){return this.play().totalTime(s?-this._delay:0,Re(r)),this._dur||(this._zTime=-ne),this},e.play=function(s,r){return s!=null&&this.seek(s,r),this.reversed(!1).paused(!1)},e.reverse=function(s,r){return s!=null&&this.seek(s||this.totalDuration(),r),this.reversed(!0).paused(!1)},e.pause=function(s,r){return s!=null&&this.seek(s,r),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-ne:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-ne,this},e.isActive=function(){var s=this.parent||this._dp,r=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=r&&i<this.endTime(!0)-ne)},e.eventCallback=function(s,r,i){var o=this.vars;return arguments.length>1?(r?(o[s]=r,i&&(o[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=r)):delete o[s],this):o[s]},e.then=function(s){var r=this,i=r._prom;return new Promise(function(o){var a=he(s)?s:Ni,c=function(){var d=r.then;r.then=null,i&&i(),he(a)&&(a=a(r))&&(a.then||a===r)&&(r.then=d),o(a),r.then=d};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?c():r._prom=c})},e.kill=function(){us(this)},n})();Ie(Cs.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-ne,_prom:0,_ps:!1,_rts:1});var ke=(function(n){zi(e,n);function e(s,r){var i;return s===void 0&&(s={}),i=n.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=Re(s.sortChildren),ue&&et(s.parent||ue,ot(i),r),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&Wi(ot(i),s.scrollTrigger),i}var t=e.prototype;return t.to=function(r,i,o){return fs(0,arguments,this),this},t.from=function(r,i,o){return fs(1,arguments,this),this},t.fromTo=function(r,i,o,a){return fs(2,arguments,this),this},t.set=function(r,i,o){return i.duration=0,i.parent=this,gs(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new me(r,i,Fe(this,o),1),this},t.call=function(r,i,o){return et(this,me.delayedCall(0,r,i),o)},t.staggerTo=function(r,i,o,a,c,u,d){return o.duration=i,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=d,o.parent=this,new me(r,o,Fe(this,c)),this},t.staggerFrom=function(r,i,o,a,c,u,d){return o.runBackwards=1,gs(o).immediateRender=Re(o.immediateRender),this.staggerTo(r,i,o,a,c,u,d)},t.staggerFromTo=function(r,i,o,a,c,u,d,g){return a.startAt=o,gs(a).immediateRender=Re(a.immediateRender),this.staggerTo(r,i,a,c,u,d,g)},t.render=function(r,i,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,u=this._dur,d=r<=0?0:ce(r),g=this._zTime<0!=r<0&&(this._initted||!u),p,f,w,h,m,v,y,b,x,C,k,R;if(this!==ue&&d>c&&r>=0&&(d=c),d!==this._tTime||o||g){if(a!==this._time&&u&&(d+=this._time-a,r+=this._time-a),p=d,x=this._start,b=this._ts,v=!b,g&&(u||(a=this._zTime),(r||!i)&&(this._zTime=r)),this._repeat){if(k=this._yoyo,m=u+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(m*100+r,i,o);if(p=ce(d%m),d===c?(h=this._repeat,p=u):(C=ce(d/m),h=~~C,h&&h===C&&(p=u,h--),p>u&&(p=u)),C=jt(this._tTime,m),!a&&this._tTime&&C!==h&&this._tTime-C*m-this._dur<=0&&(C=h),k&&h&1&&(p=u-p,R=1),h!==C&&!this._lock){var _=k&&C&1,T=_===(k&&h&1);if(h<C&&(_=!_),a=_?0:d%u?u:d,this._lock=1,this.render(a||(R?0:ce(h*m)),i,!u)._lock=0,this._tTime=d,!i&&this.parent&&Ve(this,"onRepeat"),this.vars.repeatRefresh&&!R&&(this.invalidate()._lock=1,C=h),a&&a!==this._time||v!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,c=this._tDur,T&&(this._lock=2,a=_?u:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!R&&this.invalidate()),this._lock=0,!this._ts&&!v)return this;ro(this,R)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=vl(this,ce(a),ce(p)),y&&(d-=p-(p=y._start))),this._tTime=d,this._time=p,this._act=!b,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,a=0),!a&&d&&u&&!i&&!C&&(Ve(this,"onStart"),this._tTime!==d))return this;if(p>=a&&r>=0)for(f=this._first;f;){if(w=f._next,(f._act||p>=f._start)&&f._ts&&y!==f){if(f.parent!==this)return this.render(r,i,o);if(f.render(f._ts>0?(p-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(p-f._start)*f._ts,i,o),p!==this._time||!this._ts&&!v){y=0,w&&(d+=this._zTime=-ne);break}}f=w}else{f=this._last;for(var A=r<0?r:p;f;){if(w=f._prev,(f._act||A<=f._end)&&f._ts&&y!==f){if(f.parent!==this)return this.render(r,i,o);if(f.render(f._ts>0?(A-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(A-f._start)*f._ts,i,o||ye&&Yn(f)),p!==this._time||!this._ts&&!v){y=0,w&&(d+=this._zTime=A?-ne:ne);break}}f=w}}if(y&&!i&&(this.pause(),y.render(p>=a?0:-ne)._zTime=p>=a?1:-1,this._ts))return this._start=x,Qs(this),this.render(r,i,o);this._onUpdate&&!i&&Ve(this,"onUpdate",!0),(d===c&&this._tTime>=this.totalDuration()||!d&&a)&&(x===this._start||Math.abs(b)!==Math.abs(this._ts))&&(this._lock||((r||!u)&&(d===c&&this._ts>0||!d&&this._ts<0)&&wt(this,1),!i&&!(r<0&&!a)&&(d||a||!c)&&(Ve(this,d===c&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(r,i){var o=this;if(ct(i)||(i=Fe(this,i,r)),!(r instanceof Cs)){if(Ce(r))return r.forEach(function(a){return o.add(a,i)}),this;if(be(r))return this.addLabel(r,i);if(he(r))r=me.delayedCall(0,r);else return this}return this!==r?et(this,r,i):this},t.getChildren=function(r,i,o,a){r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ke);for(var c=[],u=this._first;u;)u._start>=a&&(u instanceof me?i&&c.push(u):(o&&c.push(u),r&&c.push.apply(c,u.getChildren(!0,i,o)))),u=u._next;return c},t.getById=function(r){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===r)return i[o]},t.remove=function(r){return be(r)?this.removeLabel(r):he(r)?this.killTweensOf(r):(r.parent===this&&Xs(this,r),r===this._recent&&(this._recent=this._last),zt(this))},t.totalTime=function(r,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ce(De.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,i),this._forcing=0,this):this._tTime},t.addLabel=function(r,i){return this.labels[r]=Fe(this,i),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,i,o){var a=me.delayedCall(0,i||ys,o);return a.data="isPause",this._hasPause=1,et(this,a,Fe(this,r))},t.removePause=function(r){var i=this._first;for(r=Fe(this,r);i;)i._start===r&&i.data==="isPause"&&wt(i),i=i._next},t.killTweensOf=function(r,i,o){for(var a=this.getTweensOf(r,o),c=a.length;c--;)ht!==a[c]&&a[c].kill(r,i);return this},t.getTweensOf=function(r,i){for(var o=[],a=We(r),c=this._first,u=ct(i),d;c;)c instanceof me?gl(c._targets,a)&&(u?(!ht||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&o.push(c):(d=c.getTweensOf(a,i)).length&&o.push.apply(o,d),c=c._next;return o},t.tweenTo=function(r,i){i=i||{};var o=this,a=Fe(o,r),c=i,u=c.startAt,d=c.onStart,g=c.onStartParams,p=c.immediateRender,f,w=me.to(o,Ie({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||ne,onStart:function(){if(o.pause(),!f){var m=i.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());w._dur!==m&&qt(w,m,0,1).render(w._time,!0,!0),f=1}d&&d.apply(w,g||[])}},i));return p?w.render(0):w},t.tweenFromTo=function(r,i,o){return this.tweenTo(i,Ie({startAt:{time:Fe(this,r)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),Or(this,Fe(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),Or(this,Fe(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+ne)},t.shiftChildren=function(r,i,o){o===void 0&&(o=0);var a=this._first,c=this.labels,u;for(r=ce(r);a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(i)for(u in c)c[u]>=o&&(c[u]+=r);return zt(this)},t.invalidate=function(r){var i=this._first;for(this._lock=0;i;)i.invalidate(r),i=i._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),zt(this)},t.totalDuration=function(r){var i=0,o=this,a=o._last,c=Ke,u,d,g;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(g=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),d=a._start,d>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,et(o,a,d-a._delay,1)._lock=0):c=d,d<0&&a._ts&&(i-=d,(!g&&!o._dp||g&&g.smoothChildTiming)&&(o._start+=ce(d/o._ts),o._time-=d,o._tTime-=d),o.shiftChildren(-d,!1,-1/0),c=0),a._end>i&&a._ts&&(i=a._end),a=u;qt(o,o===ue&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(r){if(ue._ts&&(Oi(ue,Us(r,ue)),$i=De.frame),De.frame>=Dr){Dr+=Le.autoSleep||120;var i=ue._first;if((!i||!i._ts)&&Le.autoSleep&&De._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||De.sleep()}}},e})(Cs);Ie(ke.prototype,{_lock:0,_hasPause:0,_forcing:0});var $l=function(e,t,s,r,i,o,a){var c=new Be(this._pt,e,t,0,1,go,null,i),u=0,d=0,g,p,f,w,h,m,v,y;for(c.b=s,c.e=r,s+="",r+="",(v=~r.indexOf("random("))&&(r=vs(r)),o&&(y=[s,r],o(y,e,t),s=y[0],r=y[1]),p=s.match(cn)||[];g=cn.exec(r);)w=g[0],h=r.substring(u,g.index),f?f=(f+1)%5:h.substr(-5)==="rgba("&&(f=1),w!==p[d++]&&(m=parseFloat(p[d-1])||0,c._pt={_next:c._pt,p:h||d===1?h:",",s:m,c:w.charAt(1)==="="?Ft(m,w)-m:parseFloat(w)-m,m:f&&f<4?Math.round:0},u=cn.lastIndex);return c.c=u<r.length?r.substring(u,r.length):"",c.fp=a,(Ai.test(r)||v)&&(c.e=0),this._pt=c,c},Xn=function(e,t,s,r,i,o,a,c,u,d){he(r)&&(r=r(i||0,e,o));var g=e[t],p=s!=="get"?s:he(g)?u?e[t.indexOf("set")||!he(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():g,f=he(g)?u?Fl:uo:Jn,w;if(be(r)&&(~r.indexOf("random(")&&(r=vs(r)),r.charAt(1)==="="&&(w=Ft(p,r)+(xe(p)||0),(w||w===0)&&(r=w))),!d||p!==r||Bn)return!isNaN(p*r)&&r!==""?(w=new Be(this._pt,e,t,+p||0,r-(p||0),typeof g=="boolean"?Wl:ho,0,f),u&&(w.fp=u),a&&w.modifier(a,this,e),this._pt=w):(!g&&!(t in e)&&jn(t,r),$l.call(this,e,t,p,r,f,c||Le.stringFilter,u))},Ll=function(e,t,s,r,i){if(he(e)&&(e=ps(e,i,t,s,r)),!st(e)||e.style&&e.nodeType||Ce(e)||Mi(e))return be(e)?ps(e,i,t,s,r):e;var o={},a;for(a in e)o[a]=ps(e[a],i,t,s,r);return o},ao=function(e,t,s,r,i,o){var a,c,u,d;if(Pe[e]&&(a=new Pe[e]).init(i,a.rawVars?t[e]:Ll(t[e],r,i,o,s),s,r,o)!==!1&&(s._pt=c=new Be(s._pt,i,e,0,1,a.render,a,0,a.priority),s!==It))for(u=s._ptLookup[s._targets.indexOf(i)],d=a._props.length;d--;)u[a._props[d]]=c;return a},ht,Bn,Qn=function n(e,t,s){var r=e.vars,i=r.ease,o=r.startAt,a=r.immediateRender,c=r.lazy,u=r.onUpdate,d=r.runBackwards,g=r.yoyoEase,p=r.keyframes,f=r.autoRevert,w=e._dur,h=e._startAt,m=e._targets,v=e.parent,y=v&&v.data==="nested"?v.vars.targets:m,b=e._overwrite==="auto"&&!Kn,x=e.timeline,C,k,R,_,T,A,M,I,W,ee,P,N,K;if(x&&(!p||!i)&&(i="none"),e._ease=Bt(i,Ut.ease),e._yEase=g?no(Bt(g===!0?i:g,Ut.ease)):0,g&&e._yoyo&&!e._repeat&&(g=e._yEase,e._yEase=e._ease,e._ease=g),e._from=!x&&!!r.runBackwards,!x||p&&!r.stagger){if(I=m[0]?Rt(m[0]).harness:0,N=I&&r[I.prop],C=Ws(r,qn),h&&(h._zTime<0&&h.progress(1),t<0&&d&&a&&!f?h.render(-1,!0):h.revert(d&&w?Ls:dl),h._lazy=0),o){if(wt(e._startAt=me.set(m,Ie({data:"isStart",overwrite:!1,parent:v,immediateRender:!0,lazy:!h&&Re(c),startAt:null,delay:0,onUpdate:u&&function(){return Ve(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(ye||!a&&!f)&&e._startAt.revert(Ls),a&&w&&t<=0&&s<=0){t&&(e._zTime=t);return}}else if(d&&w&&!h){if(t&&(a=!1),R=Ie({overwrite:!1,data:"isFromStart",lazy:a&&!h&&Re(c),immediateRender:a,stagger:0,parent:v},C),N&&(R[I.prop]=N),wt(e._startAt=me.set(m,R)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(ye?e._startAt.revert(Ls):e._startAt.render(-1,!0)),e._zTime=t,!a)n(e._startAt,ne,ne);else if(!t)return}for(e._pt=e._ptCache=0,c=w&&Re(c)||c&&!w,k=0;k<m.length;k++){if(T=m[k],M=T._gsap||Zn(m)[k]._gsap,e._ptLookup[k]=ee={},kn[M.id]&&pt.length&&Ks(),P=y===m?k:y.indexOf(T),I&&(W=new I).init(T,N||C,e,P,y)!==!1&&(e._pt=_=new Be(e._pt,T,W.name,0,1,W.render,W,0,W.priority),W._props.forEach(function(D){ee[D]=_}),W.priority&&(A=1)),!I||N)for(R in C)Pe[R]&&(W=ao(R,C,e,P,T,y))?W.priority&&(A=1):ee[R]=_=Xn.call(e,T,R,"get",C[R],P,y,0,r.stringFilter);e._op&&e._op[k]&&e.kill(T,e._op[k]),b&&e._pt&&(ht=e,ue.killTweensOf(T,ee,e.globalTime(t)),K=!e.parent,ht=0),e._pt&&c&&(kn[M.id]=1)}A&&fo(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!K,p&&t<=0&&x.render(Ke,!0,!0)},Ol=function(e,t,s,r,i,o,a,c){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],d,g,p,f;if(!u)for(u=e._ptCache[t]=[],p=e._ptLookup,f=e._targets.length;f--;){if(d=p[f][t],d&&d.d&&d.d._pt)for(d=d.d._pt;d&&d.p!==t&&d.fp!==t;)d=d._next;if(!d)return Bn=1,e.vars[t]="+=0",Qn(e,a),Bn=0,c?bs(t+" not eligible for reset"):1;u.push(d)}for(f=u.length;f--;)g=u[f],d=g._pt||g,d.s=(r||r===0)&&!i?r:d.s+(r||0)+o*d.c,d.c=s-d.s,g.e&&(g.e=fe(s)+xe(g.e)),g.b&&(g.b=d.s+xe(g.b))},Il=function(e,t){var s=e[0]?Rt(e[0]).harness:0,r=s&&s.aliases,i,o,a,c;if(!r)return t;i=Ht({},t);for(o in r)if(o in i)for(c=r[o].split(","),a=c.length;a--;)i[c[a]]=i[o];return i},Nl=function(e,t,s,r){var i=t.ease||r||"power1.inOut",o,a;if(Ce(t))a=s[e]||(s[e]=[]),t.forEach(function(c,u){return a.push({t:u/(t.length-1)*100,v:c,e:i})});else for(o in t)a=s[o]||(s[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:i})},ps=function(e,t,s,r,i){return he(e)?e.call(t,s,r,i):be(e)&&~e.indexOf("random(")?vs(e):e},lo=Gn+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",co={};ze(lo+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return co[n]=1});var me=(function(n){zi(e,n);function e(s,r,i,o){var a;typeof r=="number"&&(i.duration=r,r=i,i=null),a=n.call(this,o?r:gs(r))||this;var c=a.vars,u=c.duration,d=c.delay,g=c.immediateRender,p=c.stagger,f=c.overwrite,w=c.keyframes,h=c.defaults,m=c.scrollTrigger,v=c.yoyoEase,y=r.parent||ue,b=(Ce(s)||Mi(s)?ct(s[0]):"length"in r)?[s]:We(s),x,C,k,R,_,T,A,M;if(a._targets=b.length?Zn(b):bs("GSAP target "+s+" not found. https://gsap.com",!Le.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=f,w||p||Ds(u)||Ds(d)){if(r=a.vars,x=a.timeline=new ke({data:"nested",defaults:h||{},targets:y&&y.data==="nested"?y.vars.targets:b}),x.kill(),x.parent=x._dp=ot(a),x._start=0,p||Ds(u)||Ds(d)){if(R=b.length,A=p&&qi(p),st(p))for(_ in p)~lo.indexOf(_)&&(M||(M={}),M[_]=p[_]);for(C=0;C<R;C++)k=Ws(r,co),k.stagger=0,v&&(k.yoyoEase=v),M&&Ht(k,M),T=b[C],k.duration=+ps(u,ot(a),C,T,b),k.delay=(+ps(d,ot(a),C,T,b)||0)-a._delay,!p&&R===1&&k.delay&&(a._delay=d=k.delay,a._start+=d,k.delay=0),x.to(T,k,A?A(C,T,b):0),x._ease=Y.none;x.duration()?u=d=0:a.timeline=0}else if(w){gs(Ie(x.vars.defaults,{ease:"none"})),x._ease=Bt(w.ease||r.ease||"none");var I=0,W,ee,P;if(Ce(w))w.forEach(function(N){return x.to(b,N,">")}),x.duration();else{k={};for(_ in w)_==="ease"||_==="easeEach"||Nl(_,w[_],k,w.easeEach);for(_ in k)for(W=k[_].sort(function(N,K){return N.t-K.t}),I=0,C=0;C<W.length;C++)ee=W[C],P={ease:ee.e,duration:(ee.t-(C?W[C-1].t:0))/100*u},P[_]=ee.v,x.to(b,P,I),I+=P.duration;x.duration()<u&&x.to({},{duration:u-x.duration()})}}u||a.duration(u=x.duration())}else a.timeline=0;return f===!0&&!Kn&&(ht=ot(a),ue.killTweensOf(b),ht=0),et(y,ot(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!u&&!w&&a._start===ce(y._time)&&Re(g)&&wl(ot(a))&&y.data!=="nested")&&(a._tTime=-ne,a.render(Math.max(0,-d)||0)),m&&Wi(ot(a),m),a}var t=e.prototype;return t.render=function(r,i,o){var a=this._time,c=this._tDur,u=this._dur,d=r<0,g=r>c-ne&&!d?c:r<ne?0:r,p,f,w,h,m,v,y,b,x;if(!u)yl(this,r,i,o);else if(g!==this._tTime||!r||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==d||this._lazy){if(p=g,b=this.timeline,this._repeat){if(h=u+this._rDelay,this._repeat<-1&&d)return this.totalTime(h*100+r,i,o);if(p=ce(g%h),g===c?(w=this._repeat,p=u):(m=ce(g/h),w=~~m,w&&w===m?(p=u,w--):p>u&&(p=u)),v=this._yoyo&&w&1,v&&(x=this._yEase,p=u-p),m=jt(this._tTime,h),p===a&&!o&&this._initted&&w===m)return this._tTime=g,this;w!==m&&(b&&this._yEase&&ro(b,v),this.vars.repeatRefresh&&!v&&!this._lock&&p!==h&&this._initted&&(this._lock=o=1,this.render(ce(h*w),!0).invalidate()._lock=0))}if(!this._initted){if(Ui(this,d?r:p,o,i,g))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&w!==m))return this;if(u!==this._dur)return this.render(r,i,o)}if(this._tTime=g,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(x||this._ease)(p/u),this._from&&(this.ratio=y=1-y),!a&&g&&!i&&!m&&(Ve(this,"onStart"),this._tTime!==g))return this;for(f=this._pt;f;)f.r(y,f.d),f=f._next;b&&b.render(r<0?r:b._dur*b._ease(p/this._dur),i,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!i&&(d&&Sn(this,r,i,o),Ve(this,"onUpdate")),this._repeat&&w!==m&&this.vars.onRepeat&&!i&&this.parent&&Ve(this,"onRepeat"),(g===this._tDur||!g)&&this._tTime===g&&(d&&!this._onUpdate&&Sn(this,r,!0,!0),(r||!u)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&wt(this,1),!i&&!(d&&!a)&&(g||a||v)&&(Ve(this,g===c?"onComplete":"onReverseComplete",!0),this._prom&&!(g<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),n.prototype.invalidate.call(this,r)},t.resetTo=function(r,i,o,a,c){xs||De.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),d;return this._initted||Qn(this,u),d=this._ease(u/this._dur),Ol(this,r,i,o,a,d,u,c)?this.resetTo(r,i,o,a,1):(Js(this,0),this.parent||Fi(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,i){if(i===void 0&&(i="all"),!r&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?us(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ye),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(r,i,ht&&ht.vars.overwrite!==!0)._first||us(this),this.parent&&o!==this.timeline.totalDuration()&&qt(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=r?We(r):a,u=this._ptLookup,d=this._pt,g,p,f,w,h,m,v;if((!i||i==="all")&&pl(a,c))return i==="all"&&(this._pt=0),us(this);for(g=this._op=this._op||[],i!=="all"&&(be(i)&&(h={},ze(i,function(y){return h[y]=1}),i=h),i=Il(a,i)),v=a.length;v--;)if(~c.indexOf(a[v])){p=u[v],i==="all"?(g[v]=i,w=p,f={}):(f=g[v]=g[v]||{},w=i);for(h in w)m=p&&p[h],m&&((!("kill"in m.d)||m.d.kill(h)===!0)&&Xs(this,m,"_pt"),delete p[h]),f!=="all"&&(f[h]=1)}return this._initted&&!this._pt&&d&&us(this),this},e.to=function(r,i){return new e(r,i,arguments[2])},e.from=function(r,i){return fs(1,arguments)},e.delayedCall=function(r,i,o,a){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(r,i,o){return fs(2,arguments)},e.set=function(r,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(r,i)},e.killTweensOf=function(r,i,o){return ue.killTweensOf(r,i,o)},e})(Cs);Ie(me.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(n){me[n]=function(){var e=new ke,t=Tn.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var Jn=function(e,t,s){return e[t]=s},uo=function(e,t,s){return e[t](s)},Fl=function(e,t,s,r){return e[t](r.fp,s)},Kl=function(e,t,s){return e.setAttribute(t,s)},er=function(e,t){return he(e[t])?uo:Wn(e[t])&&e.setAttribute?Kl:Jn},ho=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Wl=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},go=function(e,t){var s=t._pt,r="";if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;s;)r=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+r,s=s._next;r+=t.c}t.set(t.t,t.p,r,t)},tr=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},Ul=function(e,t,s,r){for(var i=this._pt,o;i;)o=i._next,i.p===r&&i.modifier(e,t,s),i=o},Hl=function(e){for(var t=this._pt,s,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?Xs(this,t,"_pt"):t.dep||(s=1),t=r;return!s},jl=function(e,t,s,r){r.mSet(e,t,r.m.call(r.tween,s,r.mt),r)},fo=function(e){for(var t=e._pt,s,r,i,o;t;){for(s=t._next,r=i;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:o)?t._prev._next=t:i=t,(t._next=r)?r._prev=t:o=t,t=s}e._pt=i},Be=(function(){function n(t,s,r,i,o,a,c,u,d){this.t=s,this.s=i,this.c=o,this.p=r,this.r=a||ho,this.d=c||this,this.set=u||Jn,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(s,r,i){this.mSet=this.mSet||this.set,this.set=jl,this.m=s,this.mt=i,this.tween=r},n})();ze(Gn+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return qn[n]=1});Oe.TweenMax=Oe.TweenLite=me;Oe.TimelineLite=Oe.TimelineMax=ke;ue=new ke({sortChildren:!1,defaults:Ut,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Le.stringFilter=so;var Mt=[],Is={},ql=[],Nr=0,Gl=0,fn=function(e){return(Is[e]||ql).map(function(t){return t()})},Mn=function(){var e=Date.now(),t=[];e-Nr>2&&(fn("matchMediaInit"),Mt.forEach(function(s){var r=s.queries,i=s.conditions,o,a,c,u;for(a in r)o=Je.matchMedia(r[a]).matches,o&&(c=1),o!==i[a]&&(i[a]=o,u=1);u&&(s.revert(),c&&t.push(s))}),fn("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(r){return s.add(null,r)})}),Nr=e,fn("matchMedia"))},po=(function(){function n(t,s){this.selector=s&&Rn(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Gl++,t&&this.add(t)}var e=n.prototype;return e.add=function(s,r,i){he(s)&&(i=r,r=s,s=he);var o=this,a=function(){var u=oe,d=o.selector,g;return u&&u!==o&&u.data.push(o),i&&(o.selector=Rn(i)),oe=o,g=r.apply(o,arguments),he(g)&&o._r.push(g),oe=u,o.selector=d,o.isReverted=!1,g};return o.last=a,s===he?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var r=oe;oe=null,s(this),oe=r},e.getTweens=function(){var s=[];return this.data.forEach(function(r){return r instanceof n?s.push.apply(s,r.getTweens()):r instanceof me&&!(r.parent&&r.parent.data==="nested")&&s.push(r)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,r){var i=this;if(s?(function(){for(var a=i.getTweens(),c=i.data.length,u;c--;)u=i.data[c],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(d){return a.splice(a.indexOf(d),1)}));for(a.map(function(d){return{g:d._dur||d._delay||d._sat&&!d._sat.vars.immediateRender?d.globalTime(0):-1/0,t:d}}).sort(function(d,g){return g.g-d.g||-1/0}).forEach(function(d){return d.t.revert(s)}),c=i.data.length;c--;)u=i.data[c],u instanceof ke?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof me)&&u.revert&&u.revert(s);i._r.forEach(function(d){return d(s,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),r)for(var o=Mt.length;o--;)Mt[o].id===this.id&&Mt.splice(o,1)},e.revert=function(s){this.kill(s||{})},n})(),Zl=(function(){function n(t){this.contexts=[],this.scope=t,oe&&oe.data.push(this)}var e=n.prototype;return e.add=function(s,r,i){st(s)||(s={matches:s});var o=new po(0,i||this.scope),a=o.conditions={},c,u,d;oe&&!o.selector&&(o.selector=oe.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=s;for(u in s)u==="all"?d=1:(c=Je.matchMedia(s[u]),c&&(Mt.indexOf(o)<0&&Mt.push(o),(a[u]=c.matches)&&(d=1),c.addListener?c.addListener(Mn):c.addEventListener("change",Mn)));return d&&r(o,function(g){return o.add(null,g)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(r){return r.kill(s,!0)})},n})(),Hs={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(function(r){return Ji(r)})},timeline:function(e){return new ke(e)},getTweensOf:function(e,t){return ue.getTweensOf(e,t)},getProperty:function(e,t,s,r){be(e)&&(e=We(e)[0]);var i=Rt(e||{}).get,o=s?Ni:Ii;return s==="native"&&(s=""),e&&(t?o((Pe[t]&&Pe[t].get||i)(e,t,s,r)):function(a,c,u){return o((Pe[a]&&Pe[a].get||i)(e,a,c,u))})},quickSetter:function(e,t,s){if(e=We(e),e.length>1){var r=e.map(function(d){return Ee.quickSetter(d,t,s)}),i=r.length;return function(d){for(var g=i;g--;)r[g](d)}}e=e[0]||{};var o=Pe[t],a=Rt(e),c=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(d){var g=new o;It._pt=0,g.init(e,s?d+s:d,It,0,[e]),g.render(1,g),It._pt&&tr(1,It)}:a.set(e,c);return o?u:function(d){return u(e,c,s?d+s:d,a,1)}},quickTo:function(e,t,s){var r,i=Ee.to(e,Ie((r={},r[t]="+=0.1",r.paused=!0,r.stagger=0,r),s||{})),o=function(c,u,d){return i.resetTo(t,c,u,d)};return o.tween=i,o},isTweening:function(e){return ue.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Bt(e.ease,Ut.ease)),Vr(Ut,e||{})},config:function(e){return Vr(Le,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,r=e.plugins,i=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!Pe[a]&&!Oe[a]&&bs(t+" effect requires "+a+" plugin.")}),un[t]=function(a,c,u){return s(We(a),Ie(c||{},i),u)},o&&(ke.prototype[t]=function(a,c,u){return this.add(un[t](a,st(c)?c:(u=c)&&{},this),u)})},registerEase:function(e,t){Y[e]=Bt(t)},parseEase:function(e,t){return arguments.length?Bt(e,t):Y},getById:function(e){return ue.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new ke(e),r,i;for(s.smoothChildTiming=Re(e.smoothChildTiming),ue.remove(s),s._dp=0,s._time=s._tTime=ue._time,r=ue._first;r;)i=r._next,(t||!(!r._dur&&r instanceof me&&r.vars.onComplete===r._targets[0]))&&et(s,r,r._start-r._delay),r=i;return et(ue,s,0),s},context:function(e,t){return e?new po(e,t):oe},matchMedia:function(e){return new Zl(e)},matchMediaRefresh:function(){return Mt.forEach(function(e){var t=e.conditions,s,r;for(r in t)t[r]&&(t[r]=!1,s=1);s&&e.revert()})||Mn()},addEventListener:function(e,t){var s=Is[e]||(Is[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=Is[e],r=s&&s.indexOf(t);r>=0&&s.splice(r,1)},utils:{wrap:Rl,wrapYoyo:zl,distribute:qi,random:Zi,snap:Gi,normalize:Tl,getUnit:xe,clamp:Cl,splitColor:eo,toArray:We,selector:Rn,mapRange:Xi,pipe:Sl,unitize:_l,interpolate:Bl,shuffle:ji},install:Di,effects:un,ticker:De,updateRoot:ke.updateRoot,plugins:Pe,globalTimeline:ue,core:{PropTween:Be,globals:Vi,Tween:me,Timeline:ke,Animation:Cs,getCache:Rt,_removeLinkedListItem:Xs,reverting:function(){return ye},context:function(e){return e&&oe&&(oe.data.push(e),e._ctx=oe),oe},suppressOverwrites:function(e){return Kn=e}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return Hs[n]=me[n]});De.add(ke.updateRoot);It=Hs.to({},{duration:0});var Yl=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},Xl=function(e,t){var s=e._targets,r,i,o;for(r in t)for(i=s.length;i--;)o=e._ptLookup[i][r],o&&(o=o.d)&&(o._pt&&(o=Yl(o,r)),o&&o.modifier&&o.modifier(t[r],e,s[i],r))},pn=function(e,t){return{name:e,headless:1,rawVars:1,init:function(r,i,o){o._onInit=function(a){var c,u;if(be(i)&&(c={},ze(i,function(d){return c[d]=1}),i=c),t){c={};for(u in i)c[u]=t(i[u]);i=c}Xl(a,i)}}}},Ee=Hs.registerPlugin({name:"attr",init:function(e,t,s,r,i){var o,a,c;this.tween=s;for(o in t)c=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(c||0)+"",t[o],r,i,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)ye?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",headless:1,init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},pn("roundProps",zn),pn("modifiers"),pn("snap",Gi))||Hs;me.version=ke.version=Ee.version="3.14.2";Pi=1;Un()&&Gt();Y.Power0;Y.Power1;Y.Power2;Y.Power3;Y.Power4;Y.Linear;Y.Quad;Y.Cubic;Y.Quart;Y.Quint;Y.Strong;Y.Elastic;Y.Back;Y.SteppedEase;Y.Bounce;Y.Sine;Y.Expo;Y.Circ;/*!
11
+ */var Ne={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Xt={duration:.5,overwrite:!1,delay:0},Wn,ve,ie,He=1e8,re=1/He,Cn=Math.PI*2,nl=Cn/4,rl=0,Mi=Math.sqrt,il=Math.cos,ol=Math.sin,ye=function(e){return typeof e=="string"},he=function(e){return typeof e=="function"},ft=function(e){return typeof e=="number"},Un=function(e){return typeof e>"u"},rt=function(e){return typeof e=="object"},Be=function(e){return e!==!1},Hn=function(){return typeof window<"u"},Vs=function(e){return he(e)||ye(e)},Ei=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ke=Array.isArray,al=/random\([^)]+\)/g,ll=/,\s*/g,Dr=/(?:-?\.?\d|\.)+/gi,Ai=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ht=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,un=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Pi=/[+-]=-?[.\d]+/,cl=/[^,'"\[\]\s]+/gi,ul=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,le,tt,kn,jn,Fe={},Ks={},Di,Vi=function(e){return(Ks=Qt(e,Fe))&&Pe},qn=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Cs=function(e,t){return!t&&console.warn(e)},$i=function(e,t){return e&&(Fe[e]=t)&&Ks&&(Ks[e]=t)||Fe},ks=function(){return 0},dl={suppressEvents:!0,isStart:!0,kill:!1},Os={suppressEvents:!0,kill:!1},hl={suppressEvents:!0},Gn={},yt=[],Sn={},Li,$e={},dn={},Vr=30,Is=[],Zn="",Yn=function(e){var t=e[0],s,r;if(rt(t)||he(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(r=Is.length;r--&&!Is[r].targetTest(t););s=Is[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new ao(e[r],s)))||e.splice(r,1);return e},Dt=function(e){return e._gsap||Yn(je(e))[0]._gsap},Oi=function(e,t,s){return(s=e[t])&&he(s)?e[t]():Un(s)&&e.getAttribute&&e.getAttribute(t)||s},Me=function(e,t){return(e=e.split(",")).forEach(t)||e},fe=function(e){return Math.round(e*1e5)/1e5||0},ae=function(e){return Math.round(e*1e7)/1e7||0},Gt=function(e,t){var s=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+r:s==="-"?e-r:s==="*"?e*r:e/r},fl=function(e,t){for(var s=t.length,r=0;e.indexOf(t[r])<0&&++r<s;);return r<s},Ws=function(){var e=yt.length,t=yt.slice(0),s,r;for(Sn={},yt.length=0,s=0;s<e;s++)r=t[s],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},Xn=function(e){return!!(e._initted||e._startAt||e.add)},Ii=function(e,t,s,r){yt.length&&!ve&&Ws(),e.render(t,s,!!(ve&&t<0&&Xn(e))),yt.length&&!ve&&Ws()},Ni=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(cl).length<2?t:ye(e)?e.trim():e},Fi=function(e){return e},Ke=function(e,t){for(var s in t)s in e||(e[s]=t[s]);return e},gl=function(e){return function(t,s){for(var r in s)r in t||r==="duration"&&e||r==="ease"||(t[r]=s[r])}},Qt=function(e,t){for(var s in t)e[s]=t[s];return e},$r=function n(e,t){for(var s in t)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(e[s]=rt(t[s])?n(e[s]||(e[s]={}),t[s]):t[s]);return e},Us=function(e,t){var s={},r;for(r in e)r in t||(s[r]=e[r]);return s},ws=function(e){var t=e.parent||le,s=e.keyframes?gl(ke(e.keyframes)):Ke;if(Be(e.inherit))for(;t;)s(e,t.vars.defaults),t=t.parent||t._dp;return e},pl=function(e,t){for(var s=e.length,r=s===t.length;r&&s--&&e[s]===t[s];);return s<0},Ki=function(e,t,s,r,i){var o=e[r],a;if(i)for(a=t[i];o&&o[i]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[r]=t,t._prev=o,t.parent=t._dp=e,t},Qs=function(e,t,s,r){s===void 0&&(s="_first"),r===void 0&&(r="_last");var i=t._prev,o=t._next;i?i._next=o:e[s]===t&&(e[s]=o),o?o._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},xt=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Vt=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},ml=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},_n=function(e,t,s,r){return e._startAt&&(ve?e._startAt.revert(Os):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},wl=function n(e){return!e||e._ts&&n(e.parent)},Lr=function(e){return e._repeat?Jt(e._tTime,e=e.duration()+e._rDelay)*e:0},Jt=function(e,t){var s=Math.floor(e=ae(e/t));return e&&s===e?s-1:s},Hs=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Js=function(e){return e._end=ae(e._start+(e._tDur/Math.abs(e._ts||e._rts||re)||0))},en=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=ae(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Js(e),s._dirty||Vt(s,e)),e},Wi=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(s=Hs(e.rawTime(),t),(!t._dur||Bs(0,t.totalDuration(),s)-t._tTime>re)&&t.render(s,!0)),Vt(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(s=e;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-re}},st=function(e,t,s,r){return t.parent&&xt(t),t._start=ae((ft(s)?s:s||e!==le?Ue(e,s,t):e._time)+t._delay),t._end=ae(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Ki(e,t,"_first","_last",e._sort?"_start":0),Tn(t)||(e._recent=t),r||Wi(e,t),e._ts<0&&en(e,e._tTime),e},Ui=function(e,t){return(Fe.ScrollTrigger||qn("scrollTrigger",t))&&Fe.ScrollTrigger.create(t,e)},Hi=function(e,t,s,r,i){if(Jn(e,t,i),!e._initted)return 1;if(!s&&e._pt&&!ve&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Li!==Le.frame)return yt.push(e),e._lazy=[i,r],1},bl=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},Tn=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},yl=function(e,t,s,r){var i=e.ratio,o=t<0||!t&&(!e._start&&bl(e)&&!(!e._initted&&Tn(e))||(e._ts<0||e._dp._ts<0)&&!Tn(e))?0:1,a=e._rDelay,c=0,u,d,f;if(a&&e._repeat&&(c=Bs(0,e._tDur,t),d=Jt(c,a),e._yoyo&&d&1&&(o=1-o),d!==Jt(e._tTime,a)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||ve||r||e._zTime===re||!t&&e._zTime){if(!e._initted&&Hi(e,t,r,s,c))return;for(f=e._zTime,e._zTime=t||(s?re:0),s||(s=t&&!f),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&_n(e,t,s,!0),e._onUpdate&&!s&&Oe(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&Oe(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&xt(e,1),!s&&!ve&&(Oe(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},vl=function(e,t,s){var r;if(s>t)for(r=e._first;r&&r._start<=s;){if(r.data==="isPause"&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=s;){if(r.data==="isPause"&&r._start<t)return r;r=r._prev}},es=function(e,t,s,r){var i=e._repeat,o=ae(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:ae(o*(i+1)+e._rDelay*i):o,a>0&&!r&&en(e,e._tTime=e._tDur*a),e.parent&&Js(e),s||Vt(e.parent,e),e},Or=function(e){return e instanceof Te?Vt(e):es(e,e._dur)},xl={_start:0,endTime:ks,totalDuration:ks},Ue=function n(e,t,s){var r=e.labels,i=e._recent||xl,o=e.duration()>=He?i.endTime(!1):e._dur,a,c,u;return ye(t)&&(isNaN(t)||t in r)?(c=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),c==="<"||c===">"?(a>=0&&(t=t.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?i:s).totalDuration()/100:1)):a<0?(t in r||(r[t]=o),r[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&s&&(c=c/100*(ke(s)?s[0]:s).totalDuration()),a>1?n(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},bs=function(e,t,s){var r=ft(t[1]),i=(r?2:1)+(e<2?0:1),o=t[i],a,c;if(r&&(o.duration=t[1]),o.parent=s,e){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=Be(c.vars.inherit)&&c.parent;o.immediateRender=Be(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[i-1]}return new pe(t[0],o,t[i+1])},St=function(e,t){return e||e===0?t(e):t},Bs=function(e,t,s){return s<e?e:s>t?t:s},Ce=function(e,t){return!ye(e)||!(t=ul.exec(e))?"":t[1]},Cl=function(e,t,s){return St(s,function(r){return Bs(e,t,r)})},Rn=[].slice,ji=function(e,t){return e&&rt(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&rt(e[0]))&&!e.nodeType&&e!==tt},kl=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(r){var i;return ye(r)&&!t||ji(r,1)?(i=s).push.apply(i,je(r)):s.push(r)})||s},je=function(e,t,s){return ie&&!t&&ie.selector?ie.selector(e):ye(e)&&!s&&(kn||!ts())?Rn.call((t||jn).querySelectorAll(e),0):ke(e)?kl(e,s):ji(e)?Rn.call(e,0):e?[e]:[]},zn=function(e){return e=je(e)[0]||Cs("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return je(t,s.querySelectorAll?s:s===e?Cs("Invalid scope")||jn.createElement("div"):e)}},qi=function(e){return e.sort(function(){return .5-Math.random()})},Gi=function(e){if(he(e))return e;var t=rt(e)?e:{each:e},s=$t(t.ease),r=t.from||0,i=parseFloat(t.base)||0,o={},a=r>0&&r<1,c=isNaN(r)||a,u=t.axis,d=r,f=r;return ye(r)?d=f={center:.5,edges:.5,end:1}[r]||0:!a&&c&&(d=r[0],f=r[1]),function(p,g,b){var h=(b||t).length,m=o[h],x,k,w,C,v,y,_,T,R;if(!m){if(R=t.grid==="auto"?0:(t.grid||[1,He])[1],!R){for(_=-He;_<(_=b[R++].getBoundingClientRect().left)&&R<h;);R<h&&R--}for(m=o[h]=[],x=c?Math.min(R,h)*d-.5:r%R,k=R===He?0:c?h*f/R-.5:r/R|0,_=0,T=He,y=0;y<h;y++)w=y%R-x,C=k-(y/R|0),m[y]=v=u?Math.abs(u==="y"?C:w):Mi(w*w+C*C),v>_&&(_=v),v<T&&(T=v);r==="random"&&qi(m),m.max=_-T,m.min=T,m.v=h=(parseFloat(t.amount)||parseFloat(t.each)*(R>h?h-1:u?u==="y"?h/R:R:Math.max(R,h/R))||0)*(r==="edges"?-1:1),m.b=h<0?i-h:i,m.u=Ce(t.amount||t.each)||0,s=s&&h<0?ro(s):s}return h=(m[p]-m.min)/m.max||0,ae(m.b+(s?s(h):h)*m.v)+m.u}},Bn=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var r=ae(Math.round(parseFloat(s)/e)*e*t);return(r-r%1)/t+(ft(s)?0:Ce(s))}},Zi=function(e,t){var s=ke(e),r,i;return!s&&rt(e)&&(r=s=e.radius||He,e.values?(e=je(e.values),(i=!ft(e[0]))&&(r*=r)):e=Bn(e.increment)),St(t,s?he(e)?function(o){return i=e(o),Math.abs(i-o)<=r?i:o}:function(o){for(var a=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),u=He,d=0,f=e.length,p,g;f--;)i?(p=e[f].x-a,g=e[f].y-c,p=p*p+g*g):p=Math.abs(e[f]-a),p<u&&(u=p,d=f);return d=!r||u<=r?e[d]:o,i||d===o||ft(o)?d:d+Ce(o)}:Bn(e))},Yi=function(e,t,s,r){return St(ke(e)?!t:s===!0?!!(s=0):!r,function(){return ke(e)?e[~~(Math.random()*e.length)]:(s=s||1e-5)&&(r=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((e-s/2+Math.random()*(t-e+s*.99))/s)*s*r)/r})},Sl=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return function(r){return t.reduce(function(i,o){return o(i)},r)}},_l=function(e,t){return function(s){return e(parseFloat(s))+(t||Ce(s))}},Tl=function(e,t,s){return Qi(e,t,0,1,s)},Xi=function(e,t,s){return St(s,function(r){return e[~~t(r)]})},Rl=function n(e,t,s){var r=t-e;return ke(e)?Xi(e,n(0,e.length),t):St(s,function(i){return(r+(i-e)%r)%r+e})},zl=function n(e,t,s){var r=t-e,i=r*2;return ke(e)?Xi(e,n(0,e.length-1),t):St(s,function(o){return o=(i+(o-e)%i)%i||0,e+(o>r?i-o:o)})},Ss=function(e){return e.replace(al,function(t){var s=t.indexOf("[")+1,r=t.substring(s||7,s?t.indexOf("]"):t.length-1).split(ll);return Yi(s?r:+r[0],s?0:+r[1],+r[2]||1e-5)})},Qi=function(e,t,s,r,i){var o=t-e,a=r-s;return St(i,function(c){return s+((c-e)/o*a||0)})},Bl=function n(e,t,s,r){var i=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!i){var o=ye(e),a={},c,u,d,f,p;if(s===!0&&(r=1)&&(s=null),o)e={p:e},t={p:t};else if(ke(e)&&!ke(t)){for(d=[],f=e.length,p=f-2,u=1;u<f;u++)d.push(n(e[u-1],e[u]));f--,i=function(b){b*=f;var h=Math.min(p,~~b);return d[h](b-h)},s=t}else r||(e=Qt(ke(e)?[]:{},e));if(!d){for(c in t)Qn.call(a,e,c,"get",t[c]);i=function(b){return sr(b,a)||(o?e.p:e)}}}return St(s,i)},Ir=function(e,t,s){var r=e.labels,i=He,o,a,c;for(o in r)a=r[o]-t,a<0==!!s&&a&&i>(a=Math.abs(a))&&(c=o,i=a);return c},Oe=function(e,t,s){var r=e.vars,i=r[t],o=ie,a=e._ctx,c,u,d;if(i)return c=r[t+"Params"],u=r.callbackScope||e,s&&yt.length&&Ws(),a&&(ie=a),d=c?i.apply(u,c):i.call(u),ie=o,d},gs=function(e){return xt(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ve),e.progress()<1&&Oe(e,"onInterrupt"),e},jt,Ji=[],eo=function(e){if(e)if(e=!e.name&&e.default||e,Hn()||e.headless){var t=e.name,s=he(e),r=t&&!s&&e.init?function(){this._props=[]}:e,i={init:ks,render:sr,add:Qn,kill:Hl,modifier:Ul,rawVars:0},o={targetTest:0,get:0,getSetter:tr,aliases:{},register:0};if(ts(),e!==r){if($e[t])return;Ke(r,Ke(Us(e,i),o)),Qt(r.prototype,Qt(i,Us(e,o))),$e[r.prop=t]=r,e.targetTest&&(Is.push(r),Gn[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}$i(t,r),e.register&&e.register(Pe,r,Ee)}else Ji.push(e)},ne=255,ps={aqua:[0,ne,ne],lime:[0,ne,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ne],navy:[0,0,128],white:[ne,ne,ne],olive:[128,128,0],yellow:[ne,ne,0],orange:[ne,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ne,0,0],pink:[ne,192,203],cyan:[0,ne,ne],transparent:[ne,ne,ne,0]},hn=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*ne+.5|0},to=function(e,t,s){var r=e?ft(e)?[e>>16,e>>8&ne,e&ne]:0:ps.black,i,o,a,c,u,d,f,p,g,b;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ps[e])r=ps[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+i+i+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&ne,r&ne,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&ne,e&ne]}else if(e.substr(0,3)==="hsl"){if(r=b=e.match(Dr),!t)c=+r[0]%360/360,u=+r[1]/100,d=+r[2]/100,o=d<=.5?d*(u+1):d+u-d*u,i=d*2-o,r.length>3&&(r[3]*=1),r[0]=hn(c+1/3,i,o),r[1]=hn(c,i,o),r[2]=hn(c-1/3,i,o);else if(~e.indexOf("="))return r=e.match(Ai),s&&r.length<4&&(r[3]=1),r}else r=e.match(Dr)||ps.transparent;r=r.map(Number)}return t&&!b&&(i=r[0]/ne,o=r[1]/ne,a=r[2]/ne,f=Math.max(i,o,a),p=Math.min(i,o,a),d=(f+p)/2,f===p?c=u=0:(g=f-p,u=d>.5?g/(2-f-p):g/(f+p),c=f===i?(o-a)/g+(o<a?6:0):f===o?(a-i)/g+2:(i-o)/g+4,c*=60),r[0]=~~(c+.5),r[1]=~~(u*100+.5),r[2]=~~(d*100+.5)),s&&r.length<4&&(r[3]=1),r},so=function(e){var t=[],s=[],r=-1;return e.split(vt).forEach(function(i){var o=i.match(Ht)||[];t.push.apply(t,o),s.push(r+=o.length+1)}),t.c=s,t},Nr=function(e,t,s){var r="",i=(e+r).match(vt),o=t?"hsla(":"rgba(",a=0,c,u,d,f;if(!i)return e;if(i=i.map(function(p){return(p=to(p,t,1))&&o+(t?p[0]+","+p[1]+"%,"+p[2]+"%,"+p[3]:p.join(","))+")"}),s&&(d=so(e),c=s.c,c.join(r)!==d.c.join(r)))for(u=e.replace(vt,"1").split(Ht),f=u.length-1;a<f;a++)r+=u[a]+(~c.indexOf(a)?i.shift()||o+"0,0,0,0)":(d.length?d:i.length?i:s).shift());if(!u)for(u=e.split(vt),f=u.length-1;a<f;a++)r+=u[a]+i[a];return r+u[f]},vt=(function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ps)n+="|"+e+"\\b";return new RegExp(n+")","gi")})(),Ml=/hsl[a]?\(/,no=function(e){var t=e.join(" "),s;if(vt.lastIndex=0,vt.test(t))return s=Ml.test(t),e[1]=Nr(e[1],s),e[0]=Nr(e[0],s,so(e[1])),!0},_s,Le=(function(){var n=Date.now,e=500,t=33,s=n(),r=s,i=1e3/240,o=i,a=[],c,u,d,f,p,g,b=function h(m){var x=n()-r,k=m===!0,w,C,v,y;if((x>e||x<0)&&(s+=x-t),r+=x,v=r-s,w=v-o,(w>0||k)&&(y=++f.frame,p=v-f.time*1e3,f.time=v=v/1e3,o+=w+(w>=i?4:i-w),C=1),k||(c=u(h)),C)for(g=0;g<a.length;g++)a[g](v,p,y,m)};return f={time:0,frame:0,tick:function(){b(!0)},deltaRatio:function(m){return p/(1e3/(m||60))},wake:function(){Di&&(!kn&&Hn()&&(tt=kn=window,jn=tt.document||{},Fe.gsap=Pe,(tt.gsapVersions||(tt.gsapVersions=[])).push(Pe.version),Vi(Ks||tt.GreenSockGlobals||!tt.gsap&&tt||{}),Ji.forEach(eo)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&f.sleep(),u=d||function(m){return setTimeout(m,o-f.time*1e3+1|0)},_s=1,b(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(c),_s=0,u=ks},lagSmoothing:function(m,x){e=m||1/0,t=Math.min(x||33,e)},fps:function(m){i=1e3/(m||240),o=f.time*1e3+i},add:function(m,x,k){var w=x?function(C,v,y,_){m(C,v,y,_),f.remove(w)}:m;return f.remove(m),a[k?"unshift":"push"](w),ts(),w},remove:function(m,x){~(x=a.indexOf(m))&&a.splice(x,1)&&g>=x&&g--},_listeners:a},f})(),ts=function(){return!_s&&Le.wake()},q={},El=/^[\d.\-M][\d.\-,\s]/,Al=/["']/g,Pl=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),r=s[0],i=1,o=s.length,a,c,u;i<o;i++)c=s[i],a=i!==o-1?c.lastIndexOf(","):c.length,u=c.substr(0,a),t[r]=isNaN(u)?u.replace(Al,"").trim():+u,r=c.substr(a+1).trim();return t},Dl=function(e){var t=e.indexOf("(")+1,s=e.indexOf(")"),r=e.indexOf("(",t);return e.substring(t,~r&&r<s?e.indexOf(")",s+1):s)},Vl=function(e){var t=(e+"").split("("),s=q[t[0]];return s&&t.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[Pl(t[1])]:Dl(e).split(",").map(Ni)):q._CE&&El.test(e)?q._CE("",e):s},ro=function(e){return function(t){return 1-e(1-t)}},io=function n(e,t){for(var s=e._first,r;s;)s instanceof Te?n(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?n(s.timeline,t):(r=s._ease,s._ease=s._yEase,s._yEase=r,s._yoyo=t)),s=s._next},$t=function(e,t){return e&&(he(e)?e:q[e]||Vl(e))||t},It=function(e,t,s,r){s===void 0&&(s=function(c){return 1-t(1-c)}),r===void 0&&(r=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var i={easeIn:t,easeOut:s,easeInOut:r},o;return Me(e,function(a){q[a]=Fe[a]=i,q[o=a.toLowerCase()]=s;for(var c in i)q[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=q[a+"."+c]=i[c]}),i},oo=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},fn=function n(e,t,s){var r=t>=1?t:1,i=(s||(e?.3:.45))/(t<1?t:1),o=i/Cn*(Math.asin(1/r)||0),a=function(d){return d===1?1:r*Math.pow(2,-10*d)*ol((d-o)*i)+1},c=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:oo(a);return i=Cn/i,c.config=function(u,d){return n(e,u,d)},c},gn=function n(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},r=e==="out"?s:e==="in"?function(i){return 1-s(1-i)}:oo(s);return r.config=function(i){return n(e,i)},r};Me("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;It(n+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});q.Linear.easeNone=q.none=q.Linear.easeIn;It("Elastic",fn("in"),fn("out"),fn());(function(n,e){var t=1/e,s=2*t,r=2.5*t,i=function(a){return a<t?n*a*a:a<s?n*Math.pow(a-1.5/e,2)+.75:a<r?n*(a-=2.25/e)*a+.9375:n*Math.pow(a-2.625/e,2)+.984375};It("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);It("Expo",function(n){return Math.pow(2,10*(n-1))*n+n*n*n*n*n*n*(1-n)});It("Circ",function(n){return-(Mi(1-n*n)-1)});It("Sine",function(n){return n===1?1:-il(n*nl)+1});It("Back",gn("in"),gn("out"),gn());q.SteppedEase=q.steps=Fe.SteppedEase={config:function(e,t){e===void 0&&(e=1);var s=1/e,r=e+(t?0:1),i=t?1:0,o=1-re;return function(a){return((r*Bs(0,o,a)|0)+i)*s}}};Xt.ease=q["quad.out"];Me("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return Zn+=n+","+n+"Params,"});var ao=function(e,t){this.id=rl++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Oi,this.set=t?t.getSetter:tr},Ts=(function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,es(this,+t.duration,1,1),this.data=t.data,ie&&(this._ctx=ie,ie.data.push(this)),_s||Le.wake()}var e=n.prototype;return e.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},e.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,es(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,r){if(ts(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(en(this,s),!i._dp||i.parent||Wi(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&st(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===re||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Ii(this,s,r)),this},e.time=function(s,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Lr(this))%(this._dur+this._rDelay)||(s?this._dur:0),r):this._time},e.totalProgress=function(s,r){return arguments.length?this.totalTime(this.totalDuration()*s,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(s,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Lr(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,r){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,r):this._repeat?Jt(this._tTime,i)+1:1},e.timeScale=function(s,r){if(!arguments.length)return this._rts===-re?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?Hs(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-re?0:this._rts,this.totalTime(Bs(-Math.abs(this._delay),this.totalDuration(),i),r!==!1),Js(this),ml(this)},e.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ts(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==re&&(this._tTime-=re)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=ae(s);var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&st(r,this,this._start-this._delay),this}return this._start},e.endTime=function(s){return this._start+(Be(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var r=this.parent||this._dp;return r?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Hs(r.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=hl);var r=ve;return ve=s,Xn(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),ve=r,this},e.globalTime=function(s){for(var r=this,i=arguments.length?s:r.rawTime();r;)i=r._start+i/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Or(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var r=this._time;return this._rDelay=s,Or(this),r?this.time(r):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,r){return this.totalTime(Ue(this,s),Be(r))},e.restart=function(s,r){return this.play().totalTime(s?-this._delay:0,Be(r)),this._dur||(this._zTime=-re),this},e.play=function(s,r){return s!=null&&this.seek(s,r),this.reversed(!1).paused(!1)},e.reverse=function(s,r){return s!=null&&this.seek(s||this.totalDuration(),r),this.reversed(!0).paused(!1)},e.pause=function(s,r){return s!=null&&this.seek(s,r),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-re:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-re,this},e.isActive=function(){var s=this.parent||this._dp,r=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=r&&i<this.endTime(!0)-re)},e.eventCallback=function(s,r,i){var o=this.vars;return arguments.length>1?(r?(o[s]=r,i&&(o[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=r)):delete o[s],this):o[s]},e.then=function(s){var r=this,i=r._prom;return new Promise(function(o){var a=he(s)?s:Fi,c=function(){var d=r.then;r.then=null,i&&i(),he(a)&&(a=a(r))&&(a.then||a===r)&&(r.then=d),o(a),r.then=d};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?c():r._prom=c})},e.kill=function(){gs(this)},n})();Ke(Ts.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-re,_prom:0,_ps:!1,_rts:1});var Te=(function(n){Bi(e,n);function e(s,r){var i;return s===void 0&&(s={}),i=n.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=Be(s.sortChildren),le&&st(s.parent||le,ut(i),r),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&Ui(ut(i),s.scrollTrigger),i}var t=e.prototype;return t.to=function(r,i,o){return bs(0,arguments,this),this},t.from=function(r,i,o){return bs(1,arguments,this),this},t.fromTo=function(r,i,o,a){return bs(2,arguments,this),this},t.set=function(r,i,o){return i.duration=0,i.parent=this,ws(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new pe(r,i,Ue(this,o),1),this},t.call=function(r,i,o){return st(this,pe.delayedCall(0,r,i),o)},t.staggerTo=function(r,i,o,a,c,u,d){return o.duration=i,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=d,o.parent=this,new pe(r,o,Ue(this,c)),this},t.staggerFrom=function(r,i,o,a,c,u,d){return o.runBackwards=1,ws(o).immediateRender=Be(o.immediateRender),this.staggerTo(r,i,o,a,c,u,d)},t.staggerFromTo=function(r,i,o,a,c,u,d,f){return a.startAt=o,ws(a).immediateRender=Be(a.immediateRender),this.staggerTo(r,i,a,c,u,d,f)},t.render=function(r,i,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,u=this._dur,d=r<=0?0:ae(r),f=this._zTime<0!=r<0&&(this._initted||!u),p,g,b,h,m,x,k,w,C,v,y,_;if(this!==le&&d>c&&r>=0&&(d=c),d!==this._tTime||o||f){if(a!==this._time&&u&&(d+=this._time-a,r+=this._time-a),p=d,C=this._start,w=this._ts,x=!w,f&&(u||(a=this._zTime),(r||!i)&&(this._zTime=r)),this._repeat){if(y=this._yoyo,m=u+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(m*100+r,i,o);if(p=ae(d%m),d===c?(h=this._repeat,p=u):(v=ae(d/m),h=~~v,h&&h===v&&(p=u,h--),p>u&&(p=u)),v=Jt(this._tTime,m),!a&&this._tTime&&v!==h&&this._tTime-v*m-this._dur<=0&&(v=h),y&&h&1&&(p=u-p,_=1),h!==v&&!this._lock){var T=y&&v&1,R=T===(y&&h&1);if(h<v&&(T=!T),a=T?0:d%u?u:d,this._lock=1,this.render(a||(_?0:ae(h*m)),i,!u)._lock=0,this._tTime=d,!i&&this.parent&&Oe(this,"onRepeat"),this.vars.repeatRefresh&&!_&&(this.invalidate()._lock=1,v=h),a&&a!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,c=this._tDur,R&&(this._lock=2,a=T?u:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!_&&this.invalidate()),this._lock=0,!this._ts&&!x)return this;io(this,_)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=vl(this,ae(a),ae(p)),k&&(d-=p-(p=k._start))),this._tTime=d,this._time=p,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,a=0),!a&&d&&u&&!i&&!v&&(Oe(this,"onStart"),this._tTime!==d))return this;if(p>=a&&r>=0)for(g=this._first;g;){if(b=g._next,(g._act||p>=g._start)&&g._ts&&k!==g){if(g.parent!==this)return this.render(r,i,o);if(g.render(g._ts>0?(p-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(p-g._start)*g._ts,i,o),p!==this._time||!this._ts&&!x){k=0,b&&(d+=this._zTime=-re);break}}g=b}else{g=this._last;for(var L=r<0?r:p;g;){if(b=g._prev,(g._act||L<=g._end)&&g._ts&&k!==g){if(g.parent!==this)return this.render(r,i,o);if(g.render(g._ts>0?(L-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(L-g._start)*g._ts,i,o||ve&&Xn(g)),p!==this._time||!this._ts&&!x){k=0,b&&(d+=this._zTime=L?-re:re);break}}g=b}}if(k&&!i&&(this.pause(),k.render(p>=a?0:-re)._zTime=p>=a?1:-1,this._ts))return this._start=C,Js(this),this.render(r,i,o);this._onUpdate&&!i&&Oe(this,"onUpdate",!0),(d===c&&this._tTime>=this.totalDuration()||!d&&a)&&(C===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((r||!u)&&(d===c&&this._ts>0||!d&&this._ts<0)&&xt(this,1),!i&&!(r<0&&!a)&&(d||a||!c)&&(Oe(this,d===c&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(r,i){var o=this;if(ft(i)||(i=Ue(this,i,r)),!(r instanceof Ts)){if(ke(r))return r.forEach(function(a){return o.add(a,i)}),this;if(ye(r))return this.addLabel(r,i);if(he(r))r=pe.delayedCall(0,r);else return this}return this!==r?st(this,r,i):this},t.getChildren=function(r,i,o,a){r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),a===void 0&&(a=-He);for(var c=[],u=this._first;u;)u._start>=a&&(u instanceof pe?i&&c.push(u):(o&&c.push(u),r&&c.push.apply(c,u.getChildren(!0,i,o)))),u=u._next;return c},t.getById=function(r){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===r)return i[o]},t.remove=function(r){return ye(r)?this.removeLabel(r):he(r)?this.killTweensOf(r):(r.parent===this&&Qs(this,r),r===this._recent&&(this._recent=this._last),Vt(this))},t.totalTime=function(r,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ae(Le.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,i),this._forcing=0,this):this._tTime},t.addLabel=function(r,i){return this.labels[r]=Ue(this,i),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,i,o){var a=pe.delayedCall(0,i||ks,o);return a.data="isPause",this._hasPause=1,st(this,a,Ue(this,r))},t.removePause=function(r){var i=this._first;for(r=Ue(this,r);i;)i._start===r&&i.data==="isPause"&&xt(i),i=i._next},t.killTweensOf=function(r,i,o){for(var a=this.getTweensOf(r,o),c=a.length;c--;)mt!==a[c]&&a[c].kill(r,i);return this},t.getTweensOf=function(r,i){for(var o=[],a=je(r),c=this._first,u=ft(i),d;c;)c instanceof pe?fl(c._targets,a)&&(u?(!mt||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&o.push(c):(d=c.getTweensOf(a,i)).length&&o.push.apply(o,d),c=c._next;return o},t.tweenTo=function(r,i){i=i||{};var o=this,a=Ue(o,r),c=i,u=c.startAt,d=c.onStart,f=c.onStartParams,p=c.immediateRender,g,b=pe.to(o,Ke({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||re,onStart:function(){if(o.pause(),!g){var m=i.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());b._dur!==m&&es(b,m,0,1).render(b._time,!0,!0),g=1}d&&d.apply(b,f||[])}},i));return p?b.render(0):b},t.tweenFromTo=function(r,i,o){return this.tweenTo(i,Ke({startAt:{time:Ue(this,r)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),Ir(this,Ue(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),Ir(this,Ue(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+re)},t.shiftChildren=function(r,i,o){o===void 0&&(o=0);var a=this._first,c=this.labels,u;for(r=ae(r);a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(i)for(u in c)c[u]>=o&&(c[u]+=r);return Vt(this)},t.invalidate=function(r){var i=this._first;for(this._lock=0;i;)i.invalidate(r),i=i._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Vt(this)},t.totalDuration=function(r){var i=0,o=this,a=o._last,c=He,u,d,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(f=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),d=a._start,d>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,st(o,a,d-a._delay,1)._lock=0):c=d,d<0&&a._ts&&(i-=d,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=ae(d/o._ts),o._time-=d,o._tTime-=d),o.shiftChildren(-d,!1,-1/0),c=0),a._end>i&&a._ts&&(i=a._end),a=u;es(o,o===le&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(r){if(le._ts&&(Ii(le,Hs(r,le)),Li=Le.frame),Le.frame>=Vr){Vr+=Ne.autoSleep||120;var i=le._first;if((!i||!i._ts)&&Ne.autoSleep&&Le._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Le.sleep()}}},e})(Ts);Ke(Te.prototype,{_lock:0,_hasPause:0,_forcing:0});var $l=function(e,t,s,r,i,o,a){var c=new Ee(this._pt,e,t,0,1,go,null,i),u=0,d=0,f,p,g,b,h,m,x,k;for(c.b=s,c.e=r,s+="",r+="",(x=~r.indexOf("random("))&&(r=Ss(r)),o&&(k=[s,r],o(k,e,t),s=k[0],r=k[1]),p=s.match(un)||[];f=un.exec(r);)b=f[0],h=r.substring(u,f.index),g?g=(g+1)%5:h.substr(-5)==="rgba("&&(g=1),b!==p[d++]&&(m=parseFloat(p[d-1])||0,c._pt={_next:c._pt,p:h||d===1?h:",",s:m,c:b.charAt(1)==="="?Gt(m,b)-m:parseFloat(b)-m,m:g&&g<4?Math.round:0},u=un.lastIndex);return c.c=u<r.length?r.substring(u,r.length):"",c.fp=a,(Pi.test(r)||x)&&(c.e=0),this._pt=c,c},Qn=function(e,t,s,r,i,o,a,c,u,d){he(r)&&(r=r(i||0,e,o));var f=e[t],p=s!=="get"?s:he(f)?u?e[t.indexOf("set")||!he(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,g=he(f)?u?Fl:ho:er,b;if(ye(r)&&(~r.indexOf("random(")&&(r=Ss(r)),r.charAt(1)==="="&&(b=Gt(p,r)+(Ce(p)||0),(b||b===0)&&(r=b))),!d||p!==r||Mn)return!isNaN(p*r)&&r!==""?(b=new Ee(this._pt,e,t,+p||0,r-(p||0),typeof f=="boolean"?Wl:fo,0,g),u&&(b.fp=u),a&&b.modifier(a,this,e),this._pt=b):(!f&&!(t in e)&&qn(t,r),$l.call(this,e,t,p,r,g,c||Ne.stringFilter,u))},Ll=function(e,t,s,r,i){if(he(e)&&(e=ys(e,i,t,s,r)),!rt(e)||e.style&&e.nodeType||ke(e)||Ei(e))return ye(e)?ys(e,i,t,s,r):e;var o={},a;for(a in e)o[a]=ys(e[a],i,t,s,r);return o},lo=function(e,t,s,r,i,o){var a,c,u,d;if($e[e]&&(a=new $e[e]).init(i,a.rawVars?t[e]:Ll(t[e],r,i,o,s),s,r,o)!==!1&&(s._pt=c=new Ee(s._pt,i,e,0,1,a.render,a,0,a.priority),s!==jt))for(u=s._ptLookup[s._targets.indexOf(i)],d=a._props.length;d--;)u[a._props[d]]=c;return a},mt,Mn,Jn=function n(e,t,s){var r=e.vars,i=r.ease,o=r.startAt,a=r.immediateRender,c=r.lazy,u=r.onUpdate,d=r.runBackwards,f=r.yoyoEase,p=r.keyframes,g=r.autoRevert,b=e._dur,h=e._startAt,m=e._targets,x=e.parent,k=x&&x.data==="nested"?x.vars.targets:m,w=e._overwrite==="auto"&&!Wn,C=e.timeline,v,y,_,T,R,L,N,j,Z,se,X,E,G;if(C&&(!p||!i)&&(i="none"),e._ease=$t(i,Xt.ease),e._yEase=f?ro($t(f===!0?i:f,Xt.ease)):0,f&&e._yoyo&&!e._repeat&&(f=e._yEase,e._yEase=e._ease,e._ease=f),e._from=!C&&!!r.runBackwards,!C||p&&!r.stagger){if(j=m[0]?Dt(m[0]).harness:0,E=j&&r[j.prop],v=Us(r,Gn),h&&(h._zTime<0&&h.progress(1),t<0&&d&&a&&!g?h.render(-1,!0):h.revert(d&&b?Os:dl),h._lazy=0),o){if(xt(e._startAt=pe.set(m,Ke({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!h&&Be(c),startAt:null,delay:0,onUpdate:u&&function(){return Oe(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(ve||!a&&!g)&&e._startAt.revert(Os),a&&b&&t<=0&&s<=0){t&&(e._zTime=t);return}}else if(d&&b&&!h){if(t&&(a=!1),_=Ke({overwrite:!1,data:"isFromStart",lazy:a&&!h&&Be(c),immediateRender:a,stagger:0,parent:x},v),E&&(_[j.prop]=E),xt(e._startAt=pe.set(m,_)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(ve?e._startAt.revert(Os):e._startAt.render(-1,!0)),e._zTime=t,!a)n(e._startAt,re,re);else if(!t)return}for(e._pt=e._ptCache=0,c=b&&Be(c)||c&&!b,y=0;y<m.length;y++){if(R=m[y],N=R._gsap||Yn(m)[y]._gsap,e._ptLookup[y]=se={},Sn[N.id]&&yt.length&&Ws(),X=k===m?y:k.indexOf(R),j&&(Z=new j).init(R,E||v,e,X,k)!==!1&&(e._pt=T=new Ee(e._pt,R,Z.name,0,1,Z.render,Z,0,Z.priority),Z._props.forEach(function(A){se[A]=T}),Z.priority&&(L=1)),!j||E)for(_ in v)$e[_]&&(Z=lo(_,v,e,X,R,k))?Z.priority&&(L=1):se[_]=T=Qn.call(e,R,_,"get",v[_],X,k,0,r.stringFilter);e._op&&e._op[y]&&e.kill(R,e._op[y]),w&&e._pt&&(mt=e,le.killTweensOf(R,se,e.globalTime(t)),G=!e.parent,mt=0),e._pt&&c&&(Sn[N.id]=1)}L&&po(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!G,p&&t<=0&&C.render(He,!0,!0)},Ol=function(e,t,s,r,i,o,a,c){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],d,f,p,g;if(!u)for(u=e._ptCache[t]=[],p=e._ptLookup,g=e._targets.length;g--;){if(d=p[g][t],d&&d.d&&d.d._pt)for(d=d.d._pt;d&&d.p!==t&&d.fp!==t;)d=d._next;if(!d)return Mn=1,e.vars[t]="+=0",Jn(e,a),Mn=0,c?Cs(t+" not eligible for reset"):1;u.push(d)}for(g=u.length;g--;)f=u[g],d=f._pt||f,d.s=(r||r===0)&&!i?r:d.s+(r||0)+o*d.c,d.c=s-d.s,f.e&&(f.e=fe(s)+Ce(f.e)),f.b&&(f.b=d.s+Ce(f.b))},Il=function(e,t){var s=e[0]?Dt(e[0]).harness:0,r=s&&s.aliases,i,o,a,c;if(!r)return t;i=Qt({},t);for(o in r)if(o in i)for(c=r[o].split(","),a=c.length;a--;)i[c[a]]=i[o];return i},Nl=function(e,t,s,r){var i=t.ease||r||"power1.inOut",o,a;if(ke(t))a=s[e]||(s[e]=[]),t.forEach(function(c,u){return a.push({t:u/(t.length-1)*100,v:c,e:i})});else for(o in t)a=s[o]||(s[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:i})},ys=function(e,t,s,r,i){return he(e)?e.call(t,s,r,i):ye(e)&&~e.indexOf("random(")?Ss(e):e},co=Zn+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",uo={};Me(co+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return uo[n]=1});var pe=(function(n){Bi(e,n);function e(s,r,i,o){var a;typeof r=="number"&&(i.duration=r,r=i,i=null),a=n.call(this,o?r:ws(r))||this;var c=a.vars,u=c.duration,d=c.delay,f=c.immediateRender,p=c.stagger,g=c.overwrite,b=c.keyframes,h=c.defaults,m=c.scrollTrigger,x=c.yoyoEase,k=r.parent||le,w=(ke(s)||Ei(s)?ft(s[0]):"length"in r)?[s]:je(s),C,v,y,_,T,R,L,N;if(a._targets=w.length?Yn(w):Cs("GSAP target "+s+" not found. https://gsap.com",!Ne.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,b||p||Vs(u)||Vs(d)){if(r=a.vars,C=a.timeline=new Te({data:"nested",defaults:h||{},targets:k&&k.data==="nested"?k.vars.targets:w}),C.kill(),C.parent=C._dp=ut(a),C._start=0,p||Vs(u)||Vs(d)){if(_=w.length,L=p&&Gi(p),rt(p))for(T in p)~co.indexOf(T)&&(N||(N={}),N[T]=p[T]);for(v=0;v<_;v++)y=Us(r,uo),y.stagger=0,x&&(y.yoyoEase=x),N&&Qt(y,N),R=w[v],y.duration=+ys(u,ut(a),v,R,w),y.delay=(+ys(d,ut(a),v,R,w)||0)-a._delay,!p&&_===1&&y.delay&&(a._delay=d=y.delay,a._start+=d,y.delay=0),C.to(R,y,L?L(v,R,w):0),C._ease=q.none;C.duration()?u=d=0:a.timeline=0}else if(b){ws(Ke(C.vars.defaults,{ease:"none"})),C._ease=$t(b.ease||r.ease||"none");var j=0,Z,se,X;if(ke(b))b.forEach(function(E){return C.to(w,E,">")}),C.duration();else{y={};for(T in b)T==="ease"||T==="easeEach"||Nl(T,b[T],y,b.easeEach);for(T in y)for(Z=y[T].sort(function(E,G){return E.t-G.t}),j=0,v=0;v<Z.length;v++)se=Z[v],X={ease:se.e,duration:(se.t-(v?Z[v-1].t:0))/100*u},X[T]=se.v,C.to(w,X,j),j+=X.duration;C.duration()<u&&C.to({},{duration:u-C.duration()})}}u||a.duration(u=C.duration())}else a.timeline=0;return g===!0&&!Wn&&(mt=ut(a),le.killTweensOf(w),mt=0),st(k,ut(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(f||!u&&!b&&a._start===ae(k._time)&&Be(f)&&wl(ut(a))&&k.data!=="nested")&&(a._tTime=-re,a.render(Math.max(0,-d)||0)),m&&Ui(ut(a),m),a}var t=e.prototype;return t.render=function(r,i,o){var a=this._time,c=this._tDur,u=this._dur,d=r<0,f=r>c-re&&!d?c:r<re?0:r,p,g,b,h,m,x,k,w,C;if(!u)yl(this,r,i,o);else if(f!==this._tTime||!r||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==d||this._lazy){if(p=f,w=this.timeline,this._repeat){if(h=u+this._rDelay,this._repeat<-1&&d)return this.totalTime(h*100+r,i,o);if(p=ae(f%h),f===c?(b=this._repeat,p=u):(m=ae(f/h),b=~~m,b&&b===m?(p=u,b--):p>u&&(p=u)),x=this._yoyo&&b&1,x&&(C=this._yEase,p=u-p),m=Jt(this._tTime,h),p===a&&!o&&this._initted&&b===m)return this._tTime=f,this;b!==m&&(w&&this._yEase&&io(w,x),this.vars.repeatRefresh&&!x&&!this._lock&&p!==h&&this._initted&&(this._lock=o=1,this.render(ae(h*b),!0).invalidate()._lock=0))}if(!this._initted){if(Hi(this,d?r:p,o,i,f))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&b!==m))return this;if(u!==this._dur)return this.render(r,i,o)}if(this._tTime=f,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=k=(C||this._ease)(p/u),this._from&&(this.ratio=k=1-k),!a&&f&&!i&&!m&&(Oe(this,"onStart"),this._tTime!==f))return this;for(g=this._pt;g;)g.r(k,g.d),g=g._next;w&&w.render(r<0?r:w._dur*w._ease(p/this._dur),i,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!i&&(d&&_n(this,r,i,o),Oe(this,"onUpdate")),this._repeat&&b!==m&&this.vars.onRepeat&&!i&&this.parent&&Oe(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(d&&!this._onUpdate&&_n(this,r,!0,!0),(r||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&xt(this,1),!i&&!(d&&!a)&&(f||a||x)&&(Oe(this,f===c?"onComplete":"onReverseComplete",!0),this._prom&&!(f<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),n.prototype.invalidate.call(this,r)},t.resetTo=function(r,i,o,a,c){_s||Le.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),d;return this._initted||Jn(this,u),d=this._ease(u/this._dur),Ol(this,r,i,o,a,d,u,c)?this.resetTo(r,i,o,a,1):(en(this,0),this.parent||Ki(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,i){if(i===void 0&&(i="all"),!r&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?gs(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ve),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(r,i,mt&&mt.vars.overwrite!==!0)._first||gs(this),this.parent&&o!==this.timeline.totalDuration()&&es(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=r?je(r):a,u=this._ptLookup,d=this._pt,f,p,g,b,h,m,x;if((!i||i==="all")&&pl(a,c))return i==="all"&&(this._pt=0),gs(this);for(f=this._op=this._op||[],i!=="all"&&(ye(i)&&(h={},Me(i,function(k){return h[k]=1}),i=h),i=Il(a,i)),x=a.length;x--;)if(~c.indexOf(a[x])){p=u[x],i==="all"?(f[x]=i,b=p,g={}):(g=f[x]=f[x]||{},b=i);for(h in b)m=p&&p[h],m&&((!("kill"in m.d)||m.d.kill(h)===!0)&&Qs(this,m,"_pt"),delete p[h]),g!=="all"&&(g[h]=1)}return this._initted&&!this._pt&&d&&gs(this),this},e.to=function(r,i){return new e(r,i,arguments[2])},e.from=function(r,i){return bs(1,arguments)},e.delayedCall=function(r,i,o,a){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(r,i,o){return bs(2,arguments)},e.set=function(r,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(r,i)},e.killTweensOf=function(r,i,o){return le.killTweensOf(r,i,o)},e})(Ts);Ke(pe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Me("staggerTo,staggerFrom,staggerFromTo",function(n){pe[n]=function(){var e=new Te,t=Rn.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var er=function(e,t,s){return e[t]=s},ho=function(e,t,s){return e[t](s)},Fl=function(e,t,s,r){return e[t](r.fp,s)},Kl=function(e,t,s){return e.setAttribute(t,s)},tr=function(e,t){return he(e[t])?ho:Un(e[t])&&e.setAttribute?Kl:er},fo=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Wl=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},go=function(e,t){var s=t._pt,r="";if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;s;)r=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+r,s=s._next;r+=t.c}t.set(t.t,t.p,r,t)},sr=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},Ul=function(e,t,s,r){for(var i=this._pt,o;i;)o=i._next,i.p===r&&i.modifier(e,t,s),i=o},Hl=function(e){for(var t=this._pt,s,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?Qs(this,t,"_pt"):t.dep||(s=1),t=r;return!s},jl=function(e,t,s,r){r.mSet(e,t,r.m.call(r.tween,s,r.mt),r)},po=function(e){for(var t=e._pt,s,r,i,o;t;){for(s=t._next,r=i;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:o)?t._prev._next=t:i=t,(t._next=r)?r._prev=t:o=t,t=s}e._pt=i},Ee=(function(){function n(t,s,r,i,o,a,c,u,d){this.t=s,this.s=i,this.c=o,this.p=r,this.r=a||fo,this.d=c||this,this.set=u||er,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(s,r,i){this.mSet=this.mSet||this.set,this.set=jl,this.m=s,this.mt=i,this.tween=r},n})();Me(Zn+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return Gn[n]=1});Fe.TweenMax=Fe.TweenLite=pe;Fe.TimelineLite=Fe.TimelineMax=Te;le=new Te({sortChildren:!1,defaults:Xt,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ne.stringFilter=no;var Lt=[],Ns={},ql=[],Fr=0,Gl=0,pn=function(e){return(Ns[e]||ql).map(function(t){return t()})},En=function(){var e=Date.now(),t=[];e-Fr>2&&(pn("matchMediaInit"),Lt.forEach(function(s){var r=s.queries,i=s.conditions,o,a,c,u;for(a in r)o=tt.matchMedia(r[a]).matches,o&&(c=1),o!==i[a]&&(i[a]=o,u=1);u&&(s.revert(),c&&t.push(s))}),pn("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(r){return s.add(null,r)})}),Fr=e,pn("matchMedia"))},mo=(function(){function n(t,s){this.selector=s&&zn(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Gl++,t&&this.add(t)}var e=n.prototype;return e.add=function(s,r,i){he(s)&&(i=r,r=s,s=he);var o=this,a=function(){var u=ie,d=o.selector,f;return u&&u!==o&&u.data.push(o),i&&(o.selector=zn(i)),ie=o,f=r.apply(o,arguments),he(f)&&o._r.push(f),ie=u,o.selector=d,o.isReverted=!1,f};return o.last=a,s===he?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var r=ie;ie=null,s(this),ie=r},e.getTweens=function(){var s=[];return this.data.forEach(function(r){return r instanceof n?s.push.apply(s,r.getTweens()):r instanceof pe&&!(r.parent&&r.parent.data==="nested")&&s.push(r)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,r){var i=this;if(s?(function(){for(var a=i.getTweens(),c=i.data.length,u;c--;)u=i.data[c],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(d){return a.splice(a.indexOf(d),1)}));for(a.map(function(d){return{g:d._dur||d._delay||d._sat&&!d._sat.vars.immediateRender?d.globalTime(0):-1/0,t:d}}).sort(function(d,f){return f.g-d.g||-1/0}).forEach(function(d){return d.t.revert(s)}),c=i.data.length;c--;)u=i.data[c],u instanceof Te?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof pe)&&u.revert&&u.revert(s);i._r.forEach(function(d){return d(s,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),r)for(var o=Lt.length;o--;)Lt[o].id===this.id&&Lt.splice(o,1)},e.revert=function(s){this.kill(s||{})},n})(),Zl=(function(){function n(t){this.contexts=[],this.scope=t,ie&&ie.data.push(this)}var e=n.prototype;return e.add=function(s,r,i){rt(s)||(s={matches:s});var o=new mo(0,i||this.scope),a=o.conditions={},c,u,d;ie&&!o.selector&&(o.selector=ie.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=s;for(u in s)u==="all"?d=1:(c=tt.matchMedia(s[u]),c&&(Lt.indexOf(o)<0&&Lt.push(o),(a[u]=c.matches)&&(d=1),c.addListener?c.addListener(En):c.addEventListener("change",En)));return d&&r(o,function(f){return o.add(null,f)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(r){return r.kill(s,!0)})},n})(),js={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(function(r){return eo(r)})},timeline:function(e){return new Te(e)},getTweensOf:function(e,t){return le.getTweensOf(e,t)},getProperty:function(e,t,s,r){ye(e)&&(e=je(e)[0]);var i=Dt(e||{}).get,o=s?Fi:Ni;return s==="native"&&(s=""),e&&(t?o(($e[t]&&$e[t].get||i)(e,t,s,r)):function(a,c,u){return o(($e[a]&&$e[a].get||i)(e,a,c,u))})},quickSetter:function(e,t,s){if(e=je(e),e.length>1){var r=e.map(function(d){return Pe.quickSetter(d,t,s)}),i=r.length;return function(d){for(var f=i;f--;)r[f](d)}}e=e[0]||{};var o=$e[t],a=Dt(e),c=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(d){var f=new o;jt._pt=0,f.init(e,s?d+s:d,jt,0,[e]),f.render(1,f),jt._pt&&sr(1,jt)}:a.set(e,c);return o?u:function(d){return u(e,c,s?d+s:d,a,1)}},quickTo:function(e,t,s){var r,i=Pe.to(e,Ke((r={},r[t]="+=0.1",r.paused=!0,r.stagger=0,r),s||{})),o=function(c,u,d){return i.resetTo(t,c,u,d)};return o.tween=i,o},isTweening:function(e){return le.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=$t(e.ease,Xt.ease)),$r(Xt,e||{})},config:function(e){return $r(Ne,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,r=e.plugins,i=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!$e[a]&&!Fe[a]&&Cs(t+" effect requires "+a+" plugin.")}),dn[t]=function(a,c,u){return s(je(a),Ke(c||{},i),u)},o&&(Te.prototype[t]=function(a,c,u){return this.add(dn[t](a,rt(c)?c:(u=c)&&{},this),u)})},registerEase:function(e,t){q[e]=$t(t)},parseEase:function(e,t){return arguments.length?$t(e,t):q},getById:function(e){return le.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new Te(e),r,i;for(s.smoothChildTiming=Be(e.smoothChildTiming),le.remove(s),s._dp=0,s._time=s._tTime=le._time,r=le._first;r;)i=r._next,(t||!(!r._dur&&r instanceof pe&&r.vars.onComplete===r._targets[0]))&&st(s,r,r._start-r._delay),r=i;return st(le,s,0),s},context:function(e,t){return e?new mo(e,t):ie},matchMedia:function(e){return new Zl(e)},matchMediaRefresh:function(){return Lt.forEach(function(e){var t=e.conditions,s,r;for(r in t)t[r]&&(t[r]=!1,s=1);s&&e.revert()})||En()},addEventListener:function(e,t){var s=Ns[e]||(Ns[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=Ns[e],r=s&&s.indexOf(t);r>=0&&s.splice(r,1)},utils:{wrap:Rl,wrapYoyo:zl,distribute:Gi,random:Yi,snap:Zi,normalize:Tl,getUnit:Ce,clamp:Cl,splitColor:to,toArray:je,selector:zn,mapRange:Qi,pipe:Sl,unitize:_l,interpolate:Bl,shuffle:qi},install:Vi,effects:dn,ticker:Le,updateRoot:Te.updateRoot,plugins:$e,globalTimeline:le,core:{PropTween:Ee,globals:$i,Tween:pe,Timeline:Te,Animation:Ts,getCache:Dt,_removeLinkedListItem:Qs,reverting:function(){return ve},context:function(e){return e&&ie&&(ie.data.push(e),e._ctx=ie),ie},suppressOverwrites:function(e){return Wn=e}}};Me("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return js[n]=pe[n]});Le.add(Te.updateRoot);jt=js.to({},{duration:0});var Yl=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},Xl=function(e,t){var s=e._targets,r,i,o;for(r in t)for(i=s.length;i--;)o=e._ptLookup[i][r],o&&(o=o.d)&&(o._pt&&(o=Yl(o,r)),o&&o.modifier&&o.modifier(t[r],e,s[i],r))},mn=function(e,t){return{name:e,headless:1,rawVars:1,init:function(r,i,o){o._onInit=function(a){var c,u;if(ye(i)&&(c={},Me(i,function(d){return c[d]=1}),i=c),t){c={};for(u in i)c[u]=t(i[u]);i=c}Xl(a,i)}}}},Pe=js.registerPlugin({name:"attr",init:function(e,t,s,r,i){var o,a,c;this.tween=s;for(o in t)c=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(c||0)+"",t[o],r,i,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)ve?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",headless:1,init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},mn("roundProps",Bn),mn("modifiers"),mn("snap",Zi))||js;pe.version=Te.version=Pe.version="3.14.2";Di=1;Hn()&&ts();q.Power0;q.Power1;q.Power2;q.Power3;q.Power4;q.Linear;q.Quad;q.Cubic;q.Quart;q.Quint;q.Strong;q.Elastic;q.Back;q.SteppedEase;q.Bounce;q.Sine;q.Expo;q.Circ;/*!
12
12
  * CSSPlugin 3.14.2
13
13
  * https://gsap.com
14
14
  *
15
15
  * Copyright 2008-2025, GreenSock. All rights reserved.
16
16
  * Subject to the terms at https://gsap.com/standard-license
17
17
  * @author: Jack Doyle, jack@greensock.com
18
- */var Fr,gt,Kt,sr,Tt,Kr,nr,Ql=function(){return typeof window<"u"},ut={},_t=180/Math.PI,Wt=Math.PI/180,$t=Math.atan2,Wr=1e8,rr=/([A-Z])/g,Jl=/(left|right|width|margin|padding|x)/i,ec=/[\s,\(]\S/,tt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},En=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},tc=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},sc=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},nc=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rc=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},mo=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},wo=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},ic=function(e,t,s){return e.style[t]=s},oc=function(e,t,s){return e.style.setProperty(t,s)},ac=function(e,t,s){return e._gsap[t]=s},lc=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},cc=function(e,t,s,r,i){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(i,o)},uc=function(e,t,s,r,i){var o=e._gsap;o[t]=s,o.renderTransform(i,o)},de="transform",Me=de+"Origin",dc=function n(e,t){var s=this,r=this.target,i=r.style,o=r._gsap;if(e in ut&&i){if(this.tfm=this.tfm||{},e!=="transform")e=tt[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=at(r,a)}):this.tfm[e]=o.x?o[e]:at(r,e),e===Me&&(this.tfm.zOrigin=o.zOrigin);else return tt.transform.split(",").forEach(function(a){return n.call(s,a,t)});if(this.props.indexOf(de)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Me,t,"")),e=de}(i||t)&&this.props.push(e,t,i[e])},bo=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},hc=function(){var e=this.props,t=this.target,s=t.style,r=t._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?t[e[i]](e[i+2]):t[e[i]]=e[i+2]:e[i+2]?s[e[i]]=e[i+2]:s.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(rr,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)r[o]=this.tfm[o];r.svg&&(r.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),i=nr(),(!i||!i.isStart)&&!s[de]&&(bo(s),r.zOrigin&&s[Me]&&(s[Me]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},yo=function(e,t){var s={target:e,props:[],revert:hc,save:dc};return e._gsap||Ee.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(r){return s.save(r)}),s},vo,An=function(e,t){var s=gt.createElementNS?gt.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):gt.createElement(e);return s&&s.style?s:gt.createElement(e)},$e=function n(e,t,s){var r=getComputedStyle(e);return r[t]||r.getPropertyValue(t.replace(rr,"-$1").toLowerCase())||r.getPropertyValue(t)||!s&&n(e,Zt(t)||t,1)||""},Ur="O,Moz,ms,Ms,Webkit".split(","),Zt=function(e,t,s){var r=t||Tt,i=r.style,o=5;if(e in i&&!s)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(Ur[o]+e in i););return o<0?null:(o===3?"ms":o>=0?Ur[o]:"")+e},Pn=function(){Ql()&&window.document&&(Fr=window,gt=Fr.document,Kt=gt.documentElement,Tt=An("div")||{style:{}},An("div"),de=Zt(de),Me=de+"Origin",Tt.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",vo=!!Zt("perspective"),nr=Ee.core.reverting,sr=1)},Hr=function(e){var t=e.ownerSVGElement,s=An("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=e.cloneNode(!0),i;r.style.display="block",s.appendChild(r),Kt.appendChild(s);try{i=r.getBBox()}catch{}return s.removeChild(r),Kt.removeChild(s),i},jr=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},xo=function(e){var t,s;try{t=e.getBBox()}catch{t=Hr(e),s=1}return t&&(t.width||t.height)||s||(t=Hr(e)),t&&!t.width&&!t.x&&!t.y?{x:+jr(e,["x","cx","x1"])||0,y:+jr(e,["y","cy","y1"])||0,width:0,height:0}:t},Co=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&xo(e))},bt=function(e,t){if(t){var s=e.style,r;t in ut&&t!==Me&&(t=de),s.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(r==="--"?t:t.replace(rr,"-$1").toLowerCase())):s.removeAttribute(t)}},ft=function(e,t,s,r,i,o){var a=new Be(e._pt,t,s,0,1,o?wo:mo);return e._pt=a,a.b=r,a.e=i,e._props.push(s),a},qr={deg:1,rad:1,turn:1},gc={grid:1,flex:1},yt=function n(e,t,s,r){var i=parseFloat(s)||0,o=(s+"").trim().substr((i+"").length)||"px",a=Tt.style,c=Jl.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(c?"Width":"Height"),g=100,p=r==="px",f=r==="%",w,h,m,v;if(r===o||!i||qr[r]||qr[o])return i;if(o!=="px"&&!p&&(i=n(e,t,s,"px")),v=e.getCTM&&Co(e),(f||o==="%")&&(ut[t]||~t.indexOf("adius")))return w=v?e.getBBox()[c?"width":"height"]:e[d],fe(f?i/w*g:i/100*w);if(a[c?"width":"height"]=g+(p?o:r),h=r!=="rem"&&~t.indexOf("adius")||r==="em"&&e.appendChild&&!u?e:e.parentNode,v&&(h=(e.ownerSVGElement||{}).parentNode),(!h||h===gt||!h.appendChild)&&(h=gt.body),m=h._gsap,m&&f&&m.width&&c&&m.time===De.time&&!m.uncache)return fe(i/m.width*g);if(f&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=g+r,w=e[d],y?e.style[t]=y:bt(e,t)}else(f||o==="%")&&!gc[$e(h,"display")]&&(a.position=$e(e,"position")),h===e&&(a.position="static"),h.appendChild(Tt),w=Tt[d],h.removeChild(Tt),a.position="absolute";return c&&f&&(m=Rt(h),m.time=De.time,m.width=h[d]),fe(p?w*i/g:w&&i?g/w*i:0)},at=function(e,t,s,r){var i;return sr||Pn(),t in tt&&t!=="transform"&&(t=tt[t],~t.indexOf(",")&&(t=t.split(",")[0])),ut[t]&&t!=="transform"?(i=Ss(e,r),i=t!=="transformOrigin"?i[t]:i.svg?i.origin:qs($e(e,Me))+" "+i.zOrigin+"px"):(i=e.style[t],(!i||i==="auto"||r||~(i+"").indexOf("calc("))&&(i=js[t]&&js[t](e,t,s)||$e(e,t)||Li(e,t)||(t==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?yt(e,t,i,s)+s:i},fc=function(e,t,s,r){if(!s||s==="none"){var i=Zt(t,e,1),o=i&&$e(e,i,1);o&&o!==s?(t=i,s=o):t==="borderColor"&&(s=$e(e,"borderTopColor"))}var a=new Be(this._pt,e.style,t,0,1,go),c=0,u=0,d,g,p,f,w,h,m,v,y,b,x,C;if(a.b=s,a.e=r,s+="",r+="",r.substring(0,6)==="var(--"&&(r=$e(e,r.substring(4,r.indexOf(")")))),r==="auto"&&(h=e.style[t],e.style[t]=r,r=$e(e,t)||r,h?e.style[t]=h:bt(e,t)),d=[s,r],so(d),s=d[0],r=d[1],p=s.match(Ot)||[],C=r.match(Ot)||[],C.length){for(;g=Ot.exec(r);)m=g[0],y=r.substring(c,g.index),w?w=(w+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(w=1),m!==(h=p[u++]||"")&&(f=parseFloat(h)||0,x=h.substr((f+"").length),m.charAt(1)==="="&&(m=Ft(f,m)+x),v=parseFloat(m),b=m.substr((v+"").length),c=Ot.lastIndex-b.length,b||(b=b||Le.units[t]||x,c===r.length&&(r+=b,a.e+=b)),x!==b&&(f=yt(e,t,h,b)||0),a._pt={_next:a._pt,p:y||u===1?y:",",s:f,c:v-f,m:w&&w<4||t==="zIndex"?Math.round:0});a.c=c<r.length?r.substring(c,r.length):""}else a.r=t==="display"&&r==="none"?wo:mo;return Ai.test(r)&&(a.e=0),this._pt=a,a},Gr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},pc=function(e){var t=e.split(" "),s=t[0],r=t[1]||"50%";return(s==="top"||s==="bottom"||r==="left"||r==="right")&&(e=s,s=r,r=e),t[0]=Gr[s]||s,t[1]=Gr[r]||r,t.join(" ")},mc=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var s=t.t,r=s.style,i=t.u,o=s._gsap,a,c,u;if(i==="all"||i===!0)r.cssText="",c=1;else for(i=i.split(","),u=i.length;--u>-1;)a=i[u],ut[a]&&(c=1,a=a==="transformOrigin"?Me:de),bt(s,a);c&&(bt(s,de),o&&(o.svg&&s.removeAttribute("transform"),r.scale=r.rotate=r.translate="none",Ss(s,1),o.uncache=1,bo(r)))}},js={clearProps:function(e,t,s,r,i){if(i.data!=="isFromStart"){var o=e._pt=new Be(e._pt,t,s,0,0,mc);return o.u=r,o.pr=-10,o.tween=i,e._props.push(s),1}}},ks=[1,0,0,1,0,0],ko={},So=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Zr=function(e){var t=$e(e,de);return So(t)?ks:t.substr(7).match(Ei).map(fe)},ir=function(e,t){var s=e._gsap||Rt(e),r=e.style,i=Zr(e),o,a,c,u;return s.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?ks:i):(i===ks&&!e.offsetParent&&e!==Kt&&!s.svg&&(c=r.display,r.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,a=e.nextElementSibling,Kt.appendChild(e)),i=Zr(e),c?r.display=c:bt(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):Kt.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Dn=function(e,t,s,r,i,o){var a=e._gsap,c=i||ir(e,!0),u=a.xOrigin||0,d=a.yOrigin||0,g=a.xOffset||0,p=a.yOffset||0,f=c[0],w=c[1],h=c[2],m=c[3],v=c[4],y=c[5],b=t.split(" "),x=parseFloat(b[0])||0,C=parseFloat(b[1])||0,k,R,_,T;s?c!==ks&&(R=f*m-w*h)&&(_=x*(m/R)+C*(-h/R)+(h*y-m*v)/R,T=x*(-w/R)+C*(f/R)-(f*y-w*v)/R,x=_,C=T):(k=xo(e),x=k.x+(~b[0].indexOf("%")?x/100*k.width:x),C=k.y+(~(b[1]||b[0]).indexOf("%")?C/100*k.height:C)),r||r!==!1&&a.smooth?(v=x-u,y=C-d,a.xOffset=g+(v*f+y*h)-v,a.yOffset=p+(v*w+y*m)-y):a.xOffset=a.yOffset=0,a.xOrigin=x,a.yOrigin=C,a.smooth=!!r,a.origin=t,a.originIsAbsolute=!!s,e.style[Me]="0px 0px",o&&(ft(o,a,"xOrigin",u,x),ft(o,a,"yOrigin",d,C),ft(o,a,"xOffset",g,a.xOffset),ft(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",x+" "+C)},Ss=function(e,t){var s=e._gsap||new oo(e);if("x"in s&&!t&&!s.uncache)return s;var r=e.style,i=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),u=$e(e,Me)||"0",d,g,p,f,w,h,m,v,y,b,x,C,k,R,_,T,A,M,I,W,ee,P,N,K,D,L,U,ge,Z,ie,Q,_e;return d=g=p=h=m=v=y=b=x=0,f=w=1,s.svg=!!(e.getCTM&&Co(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(r[de]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[de]!=="none"?c[de]:"")),r.scale=r.rotate=r.translate="none"),R=ir(e,s.svg),s.svg&&(s.uncache?(D=e.getBBox(),u=s.xOrigin-D.x+"px "+(s.yOrigin-D.y)+"px",K=""):K=!t&&e.getAttribute("data-svg-origin"),Dn(e,K||u,!!K||s.originIsAbsolute,s.smooth!==!1,R)),C=s.xOrigin||0,k=s.yOrigin||0,R!==ks&&(M=R[0],I=R[1],W=R[2],ee=R[3],d=P=R[4],g=N=R[5],R.length===6?(f=Math.sqrt(M*M+I*I),w=Math.sqrt(ee*ee+W*W),h=M||I?$t(I,M)*_t:0,y=W||ee?$t(W,ee)*_t+h:0,y&&(w*=Math.abs(Math.cos(y*Wt))),s.svg&&(d-=C-(C*M+k*W),g-=k-(C*I+k*ee))):(_e=R[6],ie=R[7],U=R[8],ge=R[9],Z=R[10],Q=R[11],d=R[12],g=R[13],p=R[14],_=$t(_e,Z),m=_*_t,_&&(T=Math.cos(-_),A=Math.sin(-_),K=P*T+U*A,D=N*T+ge*A,L=_e*T+Z*A,U=P*-A+U*T,ge=N*-A+ge*T,Z=_e*-A+Z*T,Q=ie*-A+Q*T,P=K,N=D,_e=L),_=$t(-W,Z),v=_*_t,_&&(T=Math.cos(-_),A=Math.sin(-_),K=M*T-U*A,D=I*T-ge*A,L=W*T-Z*A,Q=ee*A+Q*T,M=K,I=D,W=L),_=$t(I,M),h=_*_t,_&&(T=Math.cos(_),A=Math.sin(_),K=M*T+I*A,D=P*T+N*A,I=I*T-M*A,N=N*T-P*A,M=K,P=D),m&&Math.abs(m)+Math.abs(h)>359.9&&(m=h=0,v=180-v),f=fe(Math.sqrt(M*M+I*I+W*W)),w=fe(Math.sqrt(N*N+_e*_e)),_=$t(P,N),y=Math.abs(_)>2e-4?_*_t:0,x=Q?1/(Q<0?-Q:Q):0),s.svg&&(K=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!So($e(e,de)),K&&e.setAttribute("transform",K))),Math.abs(y)>90&&Math.abs(y)<270&&(i?(f*=-1,y+=h<=0?180:-180,h+=h<=0?180:-180):(w*=-1,y+=y<=0?180:-180)),t=t||s.uncache,s.x=d-((s.xPercent=d&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-d)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=g-((s.yPercent=g&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-g)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=p+o,s.scaleX=fe(f),s.scaleY=fe(w),s.rotation=fe(h)+a,s.rotationX=fe(m)+a,s.rotationY=fe(v)+a,s.skewX=y+a,s.skewY=b+a,s.transformPerspective=x+o,(s.zOrigin=parseFloat(u.split(" ")[2])||!t&&s.zOrigin||0)&&(r[Me]=qs(u)),s.xOffset=s.yOffset=0,s.force3D=Le.force3D,s.renderTransform=s.svg?bc:vo?_o:wc,s.uncache=0,s},qs=function(e){return(e=e.split(" "))[0]+" "+e[1]},mn=function(e,t,s){var r=xe(t);return fe(parseFloat(t)+parseFloat(yt(e,"x",s+"px",r)))+r},wc=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,_o(e,t)},kt="0deg",is="0px",St=") ",_o=function(e,t){var s=t||this,r=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.z,u=s.rotation,d=s.rotationY,g=s.rotationX,p=s.skewX,f=s.skewY,w=s.scaleX,h=s.scaleY,m=s.transformPerspective,v=s.force3D,y=s.target,b=s.zOrigin,x="",C=v==="auto"&&e&&e!==1||v===!0;if(b&&(g!==kt||d!==kt)){var k=parseFloat(d)*Wt,R=Math.sin(k),_=Math.cos(k),T;k=parseFloat(g)*Wt,T=Math.cos(k),o=mn(y,o,R*T*-b),a=mn(y,a,-Math.sin(k)*-b),c=mn(y,c,_*T*-b+b)}m!==is&&(x+="perspective("+m+St),(r||i)&&(x+="translate("+r+"%, "+i+"%) "),(C||o!==is||a!==is||c!==is)&&(x+=c!==is||C?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+St),u!==kt&&(x+="rotate("+u+St),d!==kt&&(x+="rotateY("+d+St),g!==kt&&(x+="rotateX("+g+St),(p!==kt||f!==kt)&&(x+="skew("+p+", "+f+St),(w!==1||h!==1)&&(x+="scale("+w+", "+h+St),y.style[de]=x||"translate(0, 0)"},bc=function(e,t){var s=t||this,r=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.rotation,u=s.skewX,d=s.skewY,g=s.scaleX,p=s.scaleY,f=s.target,w=s.xOrigin,h=s.yOrigin,m=s.xOffset,v=s.yOffset,y=s.forceCSS,b=parseFloat(o),x=parseFloat(a),C,k,R,_,T;c=parseFloat(c),u=parseFloat(u),d=parseFloat(d),d&&(d=parseFloat(d),u+=d,c+=d),c||u?(c*=Wt,u*=Wt,C=Math.cos(c)*g,k=Math.sin(c)*g,R=Math.sin(c-u)*-p,_=Math.cos(c-u)*p,u&&(d*=Wt,T=Math.tan(u-d),T=Math.sqrt(1+T*T),R*=T,_*=T,d&&(T=Math.tan(d),T=Math.sqrt(1+T*T),C*=T,k*=T)),C=fe(C),k=fe(k),R=fe(R),_=fe(_)):(C=g,_=p,k=R=0),(b&&!~(o+"").indexOf("px")||x&&!~(a+"").indexOf("px"))&&(b=yt(f,"x",o,"px"),x=yt(f,"y",a,"px")),(w||h||m||v)&&(b=fe(b+w-(w*C+h*R)+m),x=fe(x+h-(w*k+h*_)+v)),(r||i)&&(T=f.getBBox(),b=fe(b+r/100*T.width),x=fe(x+i/100*T.height)),T="matrix("+C+","+k+","+R+","+_+","+b+","+x+")",f.setAttribute("transform",T),y&&(f.style[de]=T)},yc=function(e,t,s,r,i){var o=360,a=be(i),c=parseFloat(i)*(a&&~i.indexOf("rad")?_t:1),u=c-r,d=r+u+"deg",g,p;return a&&(g=i.split("_")[1],g==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),g==="cw"&&u<0?u=(u+o*Wr)%o-~~(u/o)*o:g==="ccw"&&u>0&&(u=(u-o*Wr)%o-~~(u/o)*o)),e._pt=p=new Be(e._pt,t,s,r,u,tc),p.e=d,p.u="deg",e._props.push(s),p},Yr=function(e,t){for(var s in t)e[s]=t[s];return e},vc=function(e,t,s){var r=Yr({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,u,d,g,p,f,w;r.svg?(u=s.getAttribute("transform"),s.setAttribute("transform",""),o[de]=t,a=Ss(s,1),bt(s,de),s.setAttribute("transform",u)):(u=getComputedStyle(s)[de],o[de]=t,a=Ss(s,1),o[de]=u);for(c in ut)u=r[c],d=a[c],u!==d&&i.indexOf(c)<0&&(f=xe(u),w=xe(d),g=f!==w?yt(s,c,u,w):parseFloat(u),p=parseFloat(d),e._pt=new Be(e._pt,a,c,g,p-g,En),e._pt.u=w||0,e._props.push(c));Yr(a,r)};ze("padding,margin,Width,Radius",function(n,e){var t="Top",s="Right",r="Bottom",i="Left",o=(e<3?[t,s,r,i]:[t+i,t+s,r+s,r+i]).map(function(a){return e<2?n+a:"border"+a+n});js[e>1?"border"+n:n]=function(a,c,u,d,g){var p,f;if(arguments.length<4)return p=o.map(function(w){return at(a,w,u)}),f=p.join(" "),f.split(p[0]).length===5?p[0]:f;p=(d+"").split(" "),f={},o.forEach(function(w,h){return f[w]=p[h]=p[h]||p[(h-1)/2|0]}),a.init(c,f,g)}});var To={name:"css",register:Pn,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,r,i){var o=this._props,a=e.style,c=s.vars.startAt,u,d,g,p,f,w,h,m,v,y,b,x,C,k,R,_,T;sr||Pn(),this.styles=this.styles||yo(e),_=this.styles.props,this.tween=s;for(h in t)if(h!=="autoRound"&&(d=t[h],!(Pe[h]&&ao(h,t,s,r,e,i)))){if(f=typeof d,w=js[h],f==="function"&&(d=d.call(s,r,e,i),f=typeof d),f==="string"&&~d.indexOf("random(")&&(d=vs(d)),w)w(this,e,h,d,s)&&(R=1);else if(h.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(h)+"").trim(),d+="",mt.lastIndex=0,mt.test(u)||(m=xe(u),v=xe(d),v?m!==v&&(u=yt(e,h,u,v)+v):m&&(d+=m)),this.add(a,"setProperty",u,d,r,i,0,0,h),o.push(h),_.push(h,0,a[h]);else if(f!=="undefined"){if(c&&h in c?(u=typeof c[h]=="function"?c[h].call(s,r,e,i):c[h],be(u)&&~u.indexOf("random(")&&(u=vs(u)),xe(u+"")||u==="auto"||(u+=Le.units[h]||xe(at(e,h))||""),(u+"").charAt(1)==="="&&(u=at(e,h))):u=at(e,h),p=parseFloat(u),y=f==="string"&&d.charAt(1)==="="&&d.substr(0,2),y&&(d=d.substr(2)),g=parseFloat(d),h in tt&&(h==="autoAlpha"&&(p===1&&at(e,"visibility")==="hidden"&&g&&(p=0),_.push("visibility",0,a.visibility),ft(this,a,"visibility",p?"inherit":"hidden",g?"inherit":"hidden",!g)),h!=="scale"&&h!=="transform"&&(h=tt[h],~h.indexOf(",")&&(h=h.split(",")[0]))),b=h in ut,b){if(this.styles.save(h),T=d,f==="string"&&d.substring(0,6)==="var(--"){if(d=$e(e,d.substring(4,d.indexOf(")"))),d.substring(0,5)==="calc("){var A=e.style.perspective;e.style.perspective=d,d=$e(e,"perspective"),A?e.style.perspective=A:bt(e,"perspective")}g=parseFloat(d)}if(x||(C=e._gsap,C.renderTransform&&!t.parseTransform||Ss(e,t.parseTransform),k=t.smoothOrigin!==!1&&C.smooth,x=this._pt=new Be(this._pt,a,de,0,1,C.renderTransform,C,0,-1),x.dep=1),h==="scale")this._pt=new Be(this._pt,C,"scaleY",C.scaleY,(y?Ft(C.scaleY,y+g):g)-C.scaleY||0,En),this._pt.u=0,o.push("scaleY",h),h+="X";else if(h==="transformOrigin"){_.push(Me,0,a[Me]),d=pc(d),C.svg?Dn(e,d,0,k,0,this):(v=parseFloat(d.split(" ")[2])||0,v!==C.zOrigin&&ft(this,C,"zOrigin",C.zOrigin,v),ft(this,a,h,qs(u),qs(d)));continue}else if(h==="svgOrigin"){Dn(e,d,1,k,0,this);continue}else if(h in ko){yc(this,C,h,p,y?Ft(p,y+d):d);continue}else if(h==="smoothOrigin"){ft(this,C,"smooth",C.smooth,d);continue}else if(h==="force3D"){C[h]=d;continue}else if(h==="transform"){vc(this,d,e);continue}}else h in a||(h=Zt(h)||h);if(b||(g||g===0)&&(p||p===0)&&!ec.test(d)&&h in a)m=(u+"").substr((p+"").length),g||(g=0),v=xe(d)||(h in Le.units?Le.units[h]:m),m!==v&&(p=yt(e,h,u,v)),this._pt=new Be(this._pt,b?C:a,h,p,(y?Ft(p,y+g):g)-p,!b&&(v==="px"||h==="zIndex")&&t.autoRound!==!1?rc:En),this._pt.u=v||0,b&&T!==d?(this._pt.b=u,this._pt.e=T,this._pt.r=nc):m!==v&&v!=="%"&&(this._pt.b=u,this._pt.r=sc);else if(h in a)fc.call(this,e,h,u,y?y+d:d);else if(h in e)this.add(e,h,u||e[h],y?y+d:d,r,i);else if(h!=="parseTransform"){jn(h,d);continue}b||(h in a?_.push(h,0,a[h]):typeof e[h]=="function"?_.push(h,2,e[h]()):_.push(h,1,u||e[h])),o.push(h)}}R&&fo(this)},render:function(e,t){if(t.tween._time||!nr())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:at,aliases:tt,getSetter:function(e,t,s){var r=tt[t];return r&&r.indexOf(",")<0&&(t=r),t in ut&&t!==Me&&(e._gsap.x||at(e,"x"))?s&&Kr===s?t==="scale"?lc:ac:(Kr=s||{})&&(t==="scale"?cc:uc):e.style&&!Wn(e.style[t])?ic:~t.indexOf("-")?oc:er(e,t)},core:{_removeProperty:bt,_getMatrix:ir}};Ee.utils.checkPrefix=Zt;Ee.core.getStyleSaver=yo;(function(n,e,t,s){var r=ze(n+","+e+","+t,function(i){ut[i]=1});ze(e,function(i){Le.units[i]="deg",ko[i]=1}),tt[r[13]]=n+","+e,ze(s,function(i){var o=i.split(":");tt[o[1]]=r[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ze("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Le.units[n]="px"});Ee.registerPlugin(To);var q=Ee.registerPlugin(To)||Ee;q.core.Tween;const Xr={sm:{fontSize:12,sidePadding:8,verticalSpacing:4,borderRadius:8},md:{fontSize:14,sidePadding:12,verticalSpacing:8,borderRadius:10},lg:{fontSize:16,sidePadding:16,verticalSpacing:12,borderRadius:12}};function Lt(n){if(n!=null)return`${n}px`}function Ro(n){return Math.max(0,Math.min(1,n))}function zo(n){if(!n)return;const e=n.trim();if(/^#([0-9a-fA-F]{3}){1,2}$/.test(e)){let s=0,r=0,i=0;return e.length===4?(s=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(s=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16)),{r:s,g:r,b:i}}const t=e.match(/^rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(t)return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3])}}function wn(n){const t=Math.max(0,Math.min(255,Math.round(n))).toString(16);return t.length===1?`0${t}`:t}function Bo(n){if(n)return`#${wn(n.r)}${wn(n.g)}${wn(n.b)}`}function Qr(n,e=.12){const t=zo(n);if(!t)return n;const s=Ro(e);return Bo({r:t.r+(255-t.r)*s,g:t.g+(255-t.g)*s,b:t.b+(255-t.b)*s})}function Mo(n,e=.12){const t=zo(n);if(!t)return n;const s=Ro(e);return Bo({r:t.r*(1-s),g:t.g*(1-s),b:t.b*(1-s)})}function xc(n,e){if(n)switch(e){case"gradient":{const t=Qr(n,.08)||n,s=Mo(n,.12)||n;return`linear-gradient(180deg, ${t} 0%, ${s} 100%)`}case"bubble":return`radial-gradient(120% 120% at 10% 0%, ${Qr(n,.14)||n} 0%, ${n} 60%)`;default:return n}}function Cc(n,e){return{...n?Xr[n]:Xr.md,...void 0}}function kc(n,e){const t=Cc(n.size),s=n.color,r=xc(n.bgColor??(e==null?void 0:e.fallbackColor),n.bgType),i=Lt(n.fontSize??t.fontSize),o=Lt(n.borderRadius??t.borderRadius),a=Lt(n.verticalPadding),c=Lt(n.sidePadding);let u;n.borderWidth&&n.borderWidth>0?u=`${n.borderWidth}px solid ${n.borderColor||(e==null?void 0:e.fallbackColor)||"currentColor"}`:n.borderColor&&!n.borderWidth&&(u=`1px solid ${n.borderColor}`);const d=n.width?n.width+(n.borderWidth??0):void 0,g=n.height?n.height+(n.borderWidth??0):void 0,p={color:s,background:r,fontSize:i,borderRadius:o,width:Lt(d),height:Lt(g),padding:a&&c?`${a} ${c}`:void 0,border:u},f={};for(const w in p){const h=p[w];h!=null&&h!==""&&(f[w]=String(h))}return f}const Sc=["innerHTML"],_c=["src"],Tc=l.defineComponent({__name:"ChatCollapsed",props:{element:{},toggleChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>e.element),s=l.computed(()=>kc(t.value)),r=l.computed(()=>{const a=e.element.logo;return a?a.includes("<svg"):!1}),i=l.computed(()=>{const a=e.element.logo;return a&&a.replace('width="',"").replace('height="',"").replace('"',""),a}),o=l.computed(()=>{var c;const a=(c=e.element.icon)==null?void 0:c.size;return a?a+"px":void 0});return(a,c)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle([s.value,{"box-sizing":"content-box"}]),class:"chat-collapsed tw:transition-all tw:flex tw:cursor-pointer tw:items-center tw:justify-center",onClick:c[0]||(c[0]=(...u)=>n.toggleChat&&n.toggleChat(...u))},[r.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:"hs-collapsed-logo tw:transition-all",innerHTML:i.value,style:l.normalizeStyle({width:o.value,height:o.value})},null,12,Sc)):i.value?(l.openBlock(),l.createElementBlock("img",{key:1,class:"tw:transition-all",src:i.value,alt:"logo",style:l.normalizeStyle({width:o.value,height:o.value})},null,12,_c)):l.createCommentVNode("",!0)],4))}}),Rc={required:["settings","texts","sections"],version:"3.1"},zc=JSON.parse('{"bottom":{"btnSend":{"bgColor":"#5E4AC6","borderColor":"#595959","borderRadius":100,"borderWidth":0,"color":"#FFFFFF","fontSize":13,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M13.5525 6.38248L7.13245 3.17248C2.81995 1.01248 1.04995 2.78248 3.20995 7.09498L3.86245 8.39998C4.04995 8.78248 4.04995 9.22498 3.86245 9.60748L3.20995 10.905C1.04995 15.2175 2.81245 16.9875 7.13245 14.8275L13.5525 11.6175C16.4325 10.1775 16.4325 7.82248 13.5525 6.38248ZM11.13 9.56248H7.07995C6.77245 9.56248 6.51745 9.30748 6.51745 8.99998C6.51745 8.69248 6.77245 8.43748 7.07995 8.43748H11.13C11.4375 8.43748 11.6925 8.69248 11.6925 8.99998C11.6925 9.30748 11.4375 9.56248 11.13 9.56248Z\\" fill=\\"currentColor\\"/>\\n</svg>\\n"},"showType":"icon","size":"md"},"btnVoice":{"bgColor":"#FFFFFF1A","borderRadius":100,"borderWidth":0,"borderColor":"#595959","color":"#fff","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><path d=\\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\\"></path><path d=\\"M19 10v2a7 7 0 0 1-14 0v-2\\"></path><line x1=\\"12\\" x2=\\"12\\" y1=\\"19\\" y2=\\"22\\"></line></svg>"},"showType":"icon","size":"md"},"disclaimer":{"bgColor":"#FF0000","color":"#4C4C4C","fontSize":9,"height":12},"inputSend":{"bgColor":"#151515","bgType":"plain","borderColor":"#595959","borderRadius":8,"borderWidth":0,"color":"#EEECEC","fontSize":12,"inputStyle":"inside","paddingHorizontal":9,"paddingVertical":10,"sidePadding":7,"size":"lg"},"params":{"disclaimerShow":true,"size":"md"}},"colapsed":{"bgColor":"#7D52F4","borderColor":"rgba(29, 29, 31, 0.90)","borderRadius":50,"borderWidth":8,"color":"#fff","height":56,"icon":{"showIcon":true,"size":18},"logo":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z\\" fill=\\"currentColor\\"/></svg>","width":56},"inside":{"activeSnippet":{"element":{"bgColor":"#292929","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":12,"sidePadding":8,"verticalSpacing":8},"headerChip":{"bgColor":"transparent","bgType":"filled","borderRadius":12,"color":"#595959","fontSize":12,"size":"md"},"noButton":{"bgColor":"#C20E4D","borderRadius":12,"color":"#fff","fontSize":12},"params":{"buttonStyle":"filled","buttonType":"both","size":"md"},"propertyColor":"rgba(255, 255, 255, 0.30)","valueColor":"#fff","yesButton":{"bgColor":"#12A150","borderRadius":12,"color":"#fff","fontSize":12}},"dataAction":{"activeStepColor":"#fff","bodyFillColor":"#424242","headerFillColor":"#0B0A13","headerText":"Talking to the data","pastStepColor":"#515151","strokeColor":"#3F3F3F","strokeWidth":1,"type":"steps"},"messageBot":{"bgColor":"#292929","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"md"},"messageUser":{"bgColor":"#F8F8F933","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":1,"color":"#F9F8F8","fontSize":14,"size":"md"},"params":{"sidePadding":8,"size":"md","verticalPadding":8},"welcomeMessage":{"bgColor":"#101010","bgType":"gradient","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"lg"}},"loader":{"activeStep":{"color":"#FFF","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 20 20\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M7.56943 3.05554C6.22707 3.05554 5.13888 4.14374 5.13888 5.4861C5.13888 5.61121 5.14835 5.73411 5.1666 5.85413C3.97524 6.01056 3.05554 7.02981 3.05554 8.26388C3.05554 8.94394 3.33487 9.55881 3.78506 9.99999C3.33487 10.4412 3.05554 11.056 3.05554 11.7361C3.05554 12.7096 3.62748 13.5489 4.45383 13.937C4.4476 14.0128 4.44443 14.0894 4.44443 14.1667C4.44443 15.7007 5.68808 16.9444 7.22221 16.9444C8.05185 16.9444 8.79658 16.5807 9.30554 16.004V3.78506C8.86436 3.33487 8.24953 3.05554 7.56943 3.05554ZM10.6944 3.78506V16.004C11.2034 16.5807 11.9481 16.9444 12.7778 16.9444C14.3119 16.9444 15.5555 15.7007 15.5555 14.1667C15.5555 14.0894 15.5523 14.0128 15.5462 13.937C16.3725 13.5489 16.9444 12.7096 16.9444 11.7361C16.9444 11.056 16.6651 10.4412 16.2149 9.99999C16.6651 9.55881 16.9444 8.94394 16.9444 8.26388C16.9444 7.02981 16.0247 6.01056 14.8334 5.85413C14.8517 5.73411 14.8611 5.61121 14.8611 5.4861C14.8611 4.14374 13.7729 3.05554 12.4305 3.05554C11.7505 3.05554 11.1356 3.33487 10.6944 3.78506Z\\" fill=\\"currentColor\\"/></svg>"}},"completeStep":{"color":"#8E8E8F","fontSize":12,"icon":{"color":"#8E8E8F","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"16\\" viewBox=\\"0 0 16 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path opacity=\\"0.4\\" d=\\"M7.99967 14.6666C11.6816 14.6666 14.6663 11.6818 14.6663 7.99992C14.6663 4.31802 11.6816 1.33325 7.99967 1.33325C4.31778 1.33325 1.33301 4.31802 1.33301 7.99992C1.33301 11.6818 4.31778 14.6666 7.99967 14.6666Z\\" fill=\\"currentColor\\"></path><path d=\\"M7.05297 10.3867C6.91964 10.3867 6.79297 10.3334 6.69964 10.2401L4.81297 8.3534C4.61964 8.16007 4.61964 7.84007 4.81297 7.64673C5.0063 7.4534 5.3263 7.4534 5.51964 7.64673L7.05297 9.18007L10.4796 5.7534C10.673 5.56007 10.993 5.56007 11.1863 5.7534C11.3796 5.94673 11.3796 6.26673 11.1863 6.46006L7.4063 10.2401C7.31297 10.3334 7.1863 10.3867 7.05297 10.3867Z\\" fill=\\"currentColor\\"></path></svg>"},"verticalSpacing":8},"typingLoader":{"bgColor":"#2F2F31","color":"#8E8E8F"}},"top":{"buttons":{"bgColor":"#2F2F31","borderRadius":12,"color":"#BBBBBD","showType":"icon"},"chipWidgetTitle":{"bgColor":"#5E4AC6","borderRadius":12,"color":"#BFB6E9","showType":"both"},"params":{"bgColor":"#5E4AC6","bgStyle":"invisible","border":{"color":"#991717","width":0},"borderRadius":12,"buttonStyle":"invisible","chipStyle":"filled","paddingHorizontal":0,"paddingVertical":1,"sideMargin":12,"size":"lg"}},"warnings":{"connectionIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z\\" fill=\\"#FFCC77\\"/>\\n</svg>"},"sidePadding":12,"verticalSpacing":8},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"disableInputIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#FFF","showIcon":true,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"}},"warningStyle":"gradient"},"launchIssue":{"content":{"bgColor":"#8A7045","color":"#fff","headlineColor":"#f9c97c","headlineTextSize":12,"icon":{"color":"#FFCC77","showIcon":true,"size":24,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.5 3.35 8.64 4.9L2.24 16.42C1.43 17.89 1.34 19.3 1.99 20.41C2.64 21.52 3.92 22.13 5.6 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5Z\\" fill=\\"currentColor\\"/></svg>"},"sidePadding":8,"subTextSize":12,"verticalSpacing":4},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"reconnectIssue":{"content":{"bgColor":"#8A7045","borderRadius":12,"color":"#fff","icon":{"color":"#FFF","showIcon":true,"size":16,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"},"margin":8,"sidePadding":8,"verticalSpacing":8},"warningStyle":"gradient"}}}'),Bc={bgChat:"#212121",borderRadius:18,container:{gradient:"#34257F",innerBorder:{color:"#000",style:"solid",width:0},outerBorder:{color:"#2929294D",style:"solid",width:0}},fontFamily:"MacPaw Fixel",fontWeight:500,gapMessageLine:12,globalRoundingRadius:!0,launchView:"closed",letterSpacing:-.2,lineHeight:1.2,loader:"dots",logo:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z" fill="currentColor"/></svg>',mode:"collapsed",offset:{x:24,y:36},position:"bottomRight",size:{height:550,width:500},theme:"light"},Mc={disableInputText:"Can’t send a message while processing the previous request",disclaimer:"Disclaimer text",inputPlaceholder:"Type question",issueText:"Something went wrong, please restart",launchIssueText:"Please restart the chat, it should work",launchIssueTitle:"There was a glitch",reconnectText:"Connection issue, trying to reconnect",sendButton:"Send",typingLoader:"AI-Co-pilot typing",welcomeMessage:"👋 Hey there, I’m your AI data assistant. With me you can talk to your data and get instant insights about your leads, deals, clients and everything in-between",widgetTitle:"HyperShadow"},Ec={schema:Rc,sections:zc,settings:Bc,texts:Mc},j=Ec;class Ze{canApply(e){return e.fromVersion===this.appliesTo.from&&e.toVersion===this.appliesTo.to}rollback(e){return{success:!1,errors:[`Rollback not implemented for strategy: ${this.name}`],warnings:[],modified:!1}}createSuccessResult(e,t=[]){return{success:!0,data:e,errors:[],warnings:t,modified:!0}}createErrorResult(e,t){return{success:!1,data:t,errors:e,warnings:[],modified:!1}}}class Ac extends Ze{constructor(){super(...arguments),this.name="AddSettingsFieldsV1toV2",this.description="Добавляет новые поля loader, buttonStyle, buttonType в settings",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[],r={...t.settings,loader:j.settings.loader};return s.push(`Добавлены поля loader: '${r.loader}'`),this.createSuccessResult({...t,settings:r},s)}catch(t){return this.createErrorResult([`Ошибка при добавлении полей settings: ${t}`])}}}class Pc extends Ze{constructor(){super(...arguments),this.name="AddChipStyleV1toV2",this.description="Добавляет поле chipStyle в sections.top.params",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.top.params={...t.sections.top.params,chipStyle:j.sections.top.params.chipStyle},s.push(`Добавлено поле chipStyle: '${j.sections.top.params.chipStyle}' в sections.top.params`),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении chipStyle: ${t}`])}}}class Dc extends Ze{constructor(){super(...arguments),this.name="AddMessageBgTypeV1toV2",this.description="Добавляет поле bgType в messageUser и messageBot",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside.messageUser={...t.sections.inside.messageUser,bgType:j.sections.inside.messageUser.bgType},t.sections.inside.messageBot={...t.sections.inside.messageBot,bgType:j.sections.inside.messageBot.bgType},s.push("Добавлены поля bgType для messageUser и messageBot"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении bgType для сообщений: ${t}`])}}}class Vc extends Ze{constructor(){super(...arguments),this.name="AddActionButtonsV1toV2",this.description="Добавляет кнопки aprooveButton и rejectButton в inside секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside={...t.sections.inside},s.push("Добавлены кнопки aprooveButton и rejectButton"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении кнопок действий: ${t}`])}}}class $c extends Ze{constructor(){super(...arguments),this.name="EnhanceInputSendV1toV2",this.description="Добавляет borderStyle, inputStyle, bgType в inputSend",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom.inputSend={...t.sections.bottom.inputSend,borderStyle:{borderColor:j.sections.bottom.inputSend.borderColor,borderWidth:j.sections.bottom.inputSend.borderWidth},inputStyle:j.sections.bottom.inputSend.inputStyle,bgType:j.sections.bottom.inputSend.bgType},s.push("Расширен inputSend с новыми полями borderStyle, inputStyle, bgType"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении inputSend: ${t}`])}}}class Lc extends Ze{constructor(){super(...arguments),this.name="AddBottomElementsV1toV2",this.description="Добавляет warningAlert и disclaimer в bottom секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom={...t.sections.bottom},s.push("Добавлены warningAlert и disclaimer в bottom секцию"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении элементов bottom: ${t}`])}}}const Oc=[new Ac,new Pc,new Dc,new Vc,new $c,new Lc];class Ic extends Ze{constructor(){super(...arguments),this.name="AddThemeAndContainerV2toV3",this.description="Adds theme and container (innerBorder, outerBorder, gradient) to settings",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i,o,a,c,u,d,g,p,f,w;try{const h={...e.config},m=[];if(h.settings.theme||(h.settings.theme=j.settings.theme,m.push(`Добавлено поле theme: '${h.settings.theme}'`)),h.settings.container||(h.settings.container={innerBorder:{width:((s=(t=j.settings.container)==null?void 0:t.innerBorder)==null?void 0:s.width)||0,color:((i=(r=j.settings.container)==null?void 0:r.innerBorder)==null?void 0:i.color)||"transparent",style:((a=(o=j.settings.container)==null?void 0:o.innerBorder)==null?void 0:a.style)||"solid"},outerBorder:{width:((u=(c=j.settings.container)==null?void 0:c.outerBorder)==null?void 0:u.width)||0,color:((g=(d=j.settings.container)==null?void 0:d.outerBorder)==null?void 0:g.color)||"transparent",style:((f=(p=j.settings.container)==null?void 0:p.outerBorder)==null?void 0:f.style)||"solid"},gradient:((w=j.settings.container)==null?void 0:w.gradient)||"transparent"},m.push("Added container object with innerBorder, outerBorder, gradient")),typeof h.settings.borderRadius=="string"){const v={0:0,sm:4,md:8,lg:12};h.settings.borderRadius=v[h.settings.borderRadius]??12,m.push(`Конвертирован borderRadius из строки в число: ${h.settings.borderRadius}`)}return this.createSuccessResult(h,m)}catch(h){return this.createErrorResult([`Ошибка при добавлении theme и container: ${h}`])}}}class Nc extends Ze{constructor(){super(...arguments),this.name="AddTopParamsV2toV3",this.description="Добавляет border, sideMargin, borderRadius в sections.top.params",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i;try{const o={...e.config},a=[];return(s=(t=o.sections)==null?void 0:t.top)!=null&&s.params||(o.sections.top=o.sections.top||{},o.sections.top.params={}),o.sections.top.params.border||(o.sections.top.params.border={width:((r=j.sections.top.params.border)==null?void 0:r.width)||0,color:((i=j.sections.top.params.border)==null?void 0:i.color)||"transparent"},a.push("Добавлено поле border в sections.top.params")),o.sections.top.params.sideMargin===void 0&&(o.sections.top.params.sideMargin=j.sections.top.params.sideMargin||0,a.push(`Добавлено поле sideMargin: ${o.sections.top.params.sideMargin}`)),o.sections.top.params.borderRadius===void 0&&(o.sections.top.params.borderRadius=j.sections.top.params.borderRadius||12,a.push(`Добавлено поле borderRadius: ${o.sections.top.params.borderRadius}`)),this.createSuccessResult(o,a)}catch(o){return this.createErrorResult([`Ошибка при добавлении полей top.params: ${o}`])}}}class Fc extends Ze{constructor(){super(...arguments),this.name="AddDataActionV2toV3",this.description="Добавляет dataAction в sections.inside",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r;try{const i={...e.config},o=[];(t=i.sections)!=null&&t.inside||(i.sections.inside={});const a=(r=(s=j==null?void 0:j.sections)==null?void 0:s.inside)==null?void 0:r.dataAction,c=a&&typeof a=="object"?a:{type:"steps",headerFillColor:"#595959",headerText:"#fff",bodyFillColor:"#595959",activeStepColor:"#fff",pastStepColor:"#fff",strokeColor:"#595959",strokeWidth:0},u=()=>JSON.parse(JSON.stringify(c)),d=i.sections.inside.dataAction;return d?typeof d=="string"?(i.sections.inside.dataAction={...u(),type:d},o.push(`Upgraded dataAction from string to object (type: '${d}')`)):typeof d=="object"&&(i.sections.inside.dataAction={...u(),...d},i.sections.inside.dataAction.type||(i.sections.inside.dataAction.type=u().type,o.push(`Filled missing dataAction.type with default ('${i.sections.inside.dataAction.type}')`))):(i.sections.inside.dataAction=u(),o.push(`Added dataAction object (type: '${i.sections.inside.dataAction.type}')`)),this.createSuccessResult(i,o)}catch(i){return this.createErrorResult([`Ошибка при добавлении dataAction: ${i}`])}}}class Kc extends Ze{constructor(){super(...arguments),this.name="EnhanceWelcomeMessageV2toV3",this.description="Расширяет welcomeMessage с borderColor и другими полями",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s;try{const r={...e.config},i=[];(s=(t=r.sections)==null?void 0:t.inside)!=null&&s.welcomeMessage||(r.sections.inside.welcomeMessage={});const o=r.sections.inside.welcomeMessage,a=j.sections.inside.welcomeMessage;return!o.borderColor&&a.borderColor&&(o.borderColor=a.borderColor,i.push("Добавлено поле borderColor для welcomeMessage")),!o.bgType&&a.bgType&&(o.bgType=a.bgType,i.push(`Добавлено поле bgType для welcomeMessage: '${o.bgType}'`)),!o.bgColor&&a.bgColor&&(o.bgColor=a.bgColor,i.push("Добавлено поле bgColor для welcomeMessage")),o.borderWidth===void 0&&a.borderWidth!==void 0&&(o.borderWidth=a.borderWidth,i.push("Добавлено поле borderWidth для welcomeMessage")),!o.fontSize&&a.fontSize&&(o.fontSize=a.fontSize,i.push("Добавлено поле fontSize для welcomeMessage")),!o.size&&a.size&&(o.size=a.size,i.push("Добавлено поле size для welcomeMessage")),!o.borderRadius&&a.borderRadius&&(o.borderRadius=a.borderRadius,i.push("Добавлено поле borderRadius для welcomeMessage")),this.createSuccessResult(r,i)}catch(r){return this.createErrorResult([`Ошибка при расширении welcomeMessage: ${r}`])}}}class Wc extends Ze{constructor(){super(...arguments),this.name="AddVoiceButtonV2toV3",this.description="Добавляет btnVoice в sections.bottom",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i,o,a,c,u,d,g;try{const p={...e.config},f=[];return(t=p.sections)!=null&&t.bottom||(p.sections.bottom={}),p.sections.bottom.btnVoice||(p.sections.bottom.btnVoice={color:((s=j.sections.bottom.btnVoice)==null?void 0:s.color)||"#fff",bgColor:((r=j.sections.bottom.btnVoice)==null?void 0:r.bgColor)||"rgba(255, 255, 255, 0.10)",showType:((i=j.sections.bottom.btnVoice)==null?void 0:i.showType)||"icon",borderRadius:((o=j.sections.bottom.btnVoice)==null?void 0:o.borderRadius)||50,borderColor:((a=j.sections.bottom.btnVoice)==null?void 0:a.borderColor)||"#595959",borderWidth:((c=j.sections.bottom.btnVoice)==null?void 0:c.borderWidth)||1,size:((u=j.sections.bottom.btnVoice)==null?void 0:u.size)||"md",fontSize:((d=j.sections.bottom.btnVoice)==null?void 0:d.fontSize)||12,icon:((g=j.sections.bottom.btnVoice)==null?void 0:g.icon)||{showIcon:!0,src:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 1.5C8.20156 1.5 7.5 2.20156 7.5 3V9C7.5 9.79844 8.20156 10.5 9 10.5C9.79844 10.5 10.5 9.79844 10.5 9V3C10.5 2.20156 9.79844 1.5 9 1.5Z" fill="currentColor"/><path d="M13.5 7.5C13.0852 7.5 12.75 7.83516 12.75 8.25V9C12.75 10.2422 11.7422 11.25 10.5 11.25C9.25781 11.25 8.25 10.2422 8.25 9V8.25C8.25 7.83516 7.91484 7.5 7.5 7.5C7.08516 7.5 6.75 7.83516 6.75 8.25V9C6.75 10.8609 8.13906 12.375 9.9375 12.6562V14.25H7.5C7.08516 14.25 6.75 14.5852 6.75 15C6.75 15.4148 7.08516 15.75 7.5 15.75H10.5C10.9148 15.75 11.25 15.4148 11.25 15C11.25 14.5852 10.9148 14.25 10.5 14.25H10.3125V12.6562C12.1109 12.375 13.5 10.8609 13.5 9V8.25C13.5 7.83516 13.1648 7.5 12.75 7.5Z" fill="currentColor"/></svg>',color:"#fff",size:18}},p.sections.bottom.btnVoice.bgColor||(p.sections.bottom.btnVoice.bgColor=j.sections.bottom.btnVoice.bgColor,f.push(`Добавлено поле bgColor для btnVoice: '${p.sections.bottom.btnVoice.bgColor}'`)),f.push("Добавлен btnVoice в sections.bottom")),this.createSuccessResult(p,f)}catch(p){return this.createErrorResult([`Ошибка при добавлении btnVoice: ${p}`])}}}const Jr=[new Ic,new Nc,new Fc,new Kc,new Wc];function ei(n,e){return n==="3.0"&&e==="3.1"?Jr.map(s=>{const r=Object.create(s);return r.appliesTo={from:"3.0",to:"3.1"},r}):[...Oc,...Jr].filter(s=>s.appliesTo.from===n&&s.appliesTo.to===e)}class Uc{constructor(){this.name="DetectVersion",this.description="Определяет версию конфигурации"}execute(e){try{const s=new or().detect(e);return s?{success:!0,data:{version:s,config:e},errors:[],warnings:[],modified:!1}:{success:!1,errors:["Не удалось определить версию конфигурации"],warnings:[],modified:!1}}catch(t){return{success:!1,errors:[`Ошибка при детекции версии: ${t}`],warnings:[],modified:!1}}}}class Hc{constructor(){this.name="ValidateConfig",this.description="Валидирует конфигурацию для указанной версии"}execute(e,t){try{const r=new Gc().validate(e,t.version);return{success:r.isValid,data:{validationResult:r,config:e},errors:r.errors,warnings:r.warnings,modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при валидации: ${s}`],warnings:[],modified:!1}}}}class jc{constructor(){this.name="CleanConfig",this.description="Очищает конфигурацию от неизвестных полей для указанной версии"}execute(e,t){try{return t.preserveUnknown?{success:!0,data:e,errors:[],warnings:["Очистка пропущена - preserveUnknown: true"],modified:!1}:{success:!0,data:this.cleanConfigForVersion(e,t.version),errors:[],warnings:["Конфигурация очищена от неизвестных полей"],modified:!0}}catch(s){return{success:!1,errors:[`Ошибка при очистке конфигурации: ${s}`],warnings:[],modified:!1}}}cleanConfigForVersion(e,t){return{...e}}}class qc{constructor(){this.name="BackupConfig",this.description="Создает резервную копию конфигурации"}execute(e,t){try{const s=t!=null&&t.timestamp?Date.now():void 0;return{success:!0,data:{backup:{original:JSON.parse(JSON.stringify(e)),timestamp:s||Date.now(),version:new or().detect(e)},config:e},errors:[],warnings:[],modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при создании резервной копии: ${s}`],warnings:[],modified:!1}}}}class or{detect(e){var t,s,r,i,o,a,c,u,d;try{return!e||!e.settings||!e.sections?null:((t=e==null?void 0:e.schema)==null?void 0:t.version)==="3.1"?"3.1":[e.settings.theme!==void 0,e.settings.container!==void 0,((s=e.sections.top.params)==null?void 0:s.border)!==void 0,((r=e.sections.top.params)==null?void 0:r.sideMargin)!==void 0,((i=e.sections.top.params)==null?void 0:i.borderRadius)!==void 0,e.sections.inside.dataAction!==void 0,e.sections.bottom.btnVoice!==void 0,((o=e.sections.inside.welcomeMessage)==null?void 0:o.borderColor)!==void 0].filter(Boolean).length>=3?((a=e==null?void 0:e.schema)==null?void 0:a.version)==="3.1"?"3.1":"3.0":[e.settings.loader!==void 0,e.settings.buttonStyle!==void 0,e.settings.buttonType!==void 0,((c=e.sections.top.params)==null?void 0:c.chipStyle)!==void 0,((u=e.sections.inside.messageUser)==null?void 0:u.bgType)!==void 0,e.sections.inside.aprooveButton!==void 0,((d=e.sections.bottom.inputSend)==null?void 0:d.borderStyle)!==void 0,e.sections.bottom.warningAlert!==void 0,e.sections.bottom.disclaimer!==void 0].filter(Boolean).length>=3?"2.0":[e.settings.widgetTitle!==void 0,e.settings.bgChat!==void 0,e.sections.top!==void 0,e.sections.inside!==void 0,e.sections.bottom!==void 0].every(Boolean)?"1.0":null}catch(g){return console.error("Ошибка при детекции версии:",g),null}}}class Gc{validate(e,t){const s=[],r=[];try{if(!e)return s.push("Конфигурация не может быть пустой"),{isValid:!1,errors:s,warnings:r};switch(e.settings||s.push("Отсутствует секция settings"),e.sections||s.push("Отсутствует секция sections"),e.sections&&(e.sections.top||s.push("Отсутствует секция sections.top"),e.sections.inside||s.push("Отсутствует секция sections.inside"),e.sections.bottom||s.push("Отсутствует секция sections.bottom")),t){case"1.0":this.validateV1(e,s,r);break;case"2.0":this.validateV2(e,s,r);break;case"3.0":case"3.1":this.validateV3(e,s,r);break;default:r.push(`Валидация для версии ${t} не реализована`)}return{isValid:s.length===0,errors:s,warnings:r}}catch(i){return s.push(`Ошибка при валидации: ${i}`),{isValid:!1,errors:s,warnings:r}}}validateV1(e,t,s){const r=["settings.widgetTitle","settings.welcomeMessage","settings.bgChat"];for(const i of r)this.getNestedValue(e,i)||t.push(`Отсутствует обязательное поле: ${i}`)}validateV2(e,t,s){this.validateV1(e,t,s);const r=["settings.loader","settings.buttonStyle","sections.inside.aprooveButton","sections.bottom.warningAlert"];for(const i of r)this.getNestedValue(e,i)||s.push(`Рекомендуется добавить поле V2: ${i}`)}validateV3(e,t,s){var i;this.validateV2(e,t,s);const r=["settings.theme","settings.container","sections.top.params.border","sections.top.params.sideMargin","sections.top.params.borderRadius","sections.inside.dataAction","sections.bottom.btnVoice"];for(const o of r)this.getNestedValue(e,o)||s.push(`Рекомендуется добавить поле V3: ${o}`);(i=e.settings)!=null&&i.container&&(e.settings.container.innerBorder||s.push("settings.container.innerBorder рекомендуется добавить"),e.settings.container.outerBorder||s.push("settings.container.outerBorder рекомендуется добавить"),e.settings.container.gradient||s.push("settings.container.gradient is recommended to add"))}getNestedValue(e,t){return t.split(".").reduce((s,r)=>s==null?void 0:s[r],e)}}class Eo{static createCommand(e){const t=this.commands.get(e);return t?t():null}static getAllCommands(){return Array.from(this.commands.keys())}static registerCommand(e,t){this.commands.set(e,t)}}Eo.commands=new Map([["DetectVersion",()=>new Uc],["ValidateConfig",()=>new Hc],["CleanConfig",()=>new jc],["BackupConfig",()=>new qc]]);const Nt=["1.0","2.0","3.0","3.1"],Zc=Nt[Nt.length-1];class Ao{constructor(e=!1){this.verbose=e}info(e,t){this.verbose&&console.log(`[INFO] ${e}`,t?JSON.stringify(t,null,2):"")}warn(e,t){console.warn(`[WARN] ${e}`,t?JSON.stringify(t,null,2):"")}error(e,t){console.error(`[ERROR] ${e}`,t?JSON.stringify(t,null,2):"")}debug(e,t){this.verbose&&console.debug(`[DEBUG] ${e}`,t?JSON.stringify(t,null,2):"")}}class Yc{constructor(e){this.logger=e||new Ao,this.versionDetector=new or}setSchemaVersion(e,t){if(!e||typeof e!="object")return;const s=e.schema;if(!s||typeof s!="object"){e.schema={version:t,required:[]};return}s.version=t,Array.isArray(s.required)||(s.required=[])}async migrate(e,t,s={}){const r=Date.now();this.logger.info(`Начинаем миграцию к версии ${t}`);try{const i=this.versionDetector.detect(e);if(!i)return this.createErrorResult("Не удалось определить версию исходной конфигурации",r);if(this.logger.info(`Определена исходная версия: ${i}`),i===t)return this.logger.info("Конфигурация уже соответствует целевой версии"),this.createSuccessResult(e,i,t,[],r);const o=this.buildMigrationPath(i,t);if(o.length===0)return this.createErrorResult(`Не найден путь миграции с ${i} на ${t}`,r);this.logger.info(`План миграции: ${o.map(g=>`${g.from} -> ${g.to}`).join(" -> ")}`);let a=e;const c=[],u=[];for(const g of o){const p=await this.executeStep(a,g.from,g.to,s);if(!p.success)return this.createErrorResult(`Ошибка на шаге ${g.from} -> ${g.to}: ${p.errors.join(", ")}`,r,p.errors);a=p.data,c.push(...p.appliedStrategies),u.push(...p.warnings)}this.setSchemaVersion(a,t);const d=Eo.createCommand("ValidateConfig");if(d){const g=d.execute(a,{version:t});if(!g.success&&s.strict)return this.createErrorResult(`Валидация не прошла: ${g.errors.join(", ")}`,r,g.errors);u.push(...g.warnings)}return this.logger.info("Миграция успешно завершена"),this.createSuccessResult(a,i,t,c,r,u)}catch(i){return this.logger.error("Критическая ошибка при миграции",i),this.createErrorResult(`Критическая ошибка: ${i}`,r)}}async dryRun(e,t,s={}){const r=Date.now();try{const i=this.versionDetector.detect(e);if(!i)return this.createFailedReport(r,"unknown",t,"Не удалось определить версию");const a=this.buildMigrationPath(i,t).flatMap(c=>ei(c.from,c.to));return{timestamp:new Date,fromVersion:i,toVersion:t,success:!0,duration:Date.now()-r,appliedStrategies:a.map(c=>({name:c.name,success:!0,errors:[],warnings:[]})),totalErrors:0,totalWarnings:0,summary:`Будет применено ${a.length} стратегий для миграции с ${i} на ${t}`}}catch(i){return this.createFailedReport(r,"unknown",t,`Ошибка: ${i}`)}}async executeStep(e,t,s,r){var p,f;const i=Date.now();this.logger.info(`Выполняем шаг: ${t} -> ${s}`);let o=ei(t,s);if((p=r.onlyStrategies)!=null&&p.length&&(o=o.filter(w=>r.onlyStrategies.includes(w.name))),(f=r.excludeStrategies)!=null&&f.length&&(o=o.filter(w=>!r.excludeStrategies.includes(w.name))),o.length===0)return this.createErrorResult(`Не найдено стратегий для миграции ${t} -> ${s}`,i);const a={fromVersion:t,toVersion:s,config:e,options:r};let c={...e};const u=[],d=[],g=[];for(const w of o){if(this.logger.debug(`Применяем стратегию: ${w.name}`),!w.canApply({...a,config:c})){this.logger.debug(`Стратегия ${w.name} не применима, пропускаем`);continue}const h=w.apply({...a,config:c});if(h.success)h.modified&&h.data&&(c=h.data),u.push(w.name),g.push(...h.warnings),this.logger.debug(`Стратегия ${w.name} успешно применена`);else if(this.logger.error(`Стратегия ${w.name} завершилась с ошибкой`,h.errors),d.push(...h.errors),r.strict)return this.createErrorResult(`Стратегия ${w.name} завершилась с ошибкой: ${h.errors.join(", ")}`,i,d)}return this.createSuccessResult(c,t,s,u,i,g,d)}buildMigrationPath(e,t){const s=Nt.indexOf(e),r=Nt.indexOf(t);if(s===-1||r===-1)return[];const i=[];if(s<r)for(let o=s;o<r;o++)i.push({from:Nt[o],to:Nt[o+1]});else if(s>r)return[];return i}createSuccessResult(e,t,s,r,i,o=[],a=[]){return{success:!0,data:e,errors:a,warnings:o,fromVersion:t,toVersion:s,appliedStrategies:r}}createErrorResult(e,t,s=[]){return{success:!1,errors:[e,...s],warnings:[],fromVersion:"unknown",toVersion:"unknown",appliedStrategies:[]}}createFailedReport(e,t,s,r){return{timestamp:new Date,fromVersion:t,toVersion:s,success:!1,duration:Date.now()-e,appliedStrategies:[],totalErrors:1,totalWarnings:0,summary:r}}}class Xc{constructor(e=!0){const t=new Ao(e);this.migrator=new Yc(t)}async migrateV1toV2(e,t){return this.migrator.migrate(e,"2.0",t)}async migrateV2toV3(e,t){return this.migrator.migrate(e,"3.0",t)}async migrateToLatest(e,t){return this.migrator.migrate(e,Zc,t)}async migrate(e,t,s){return this.migrator.migrate(e,t,s)}async preview(e,t,s){return this.migrator.dryRun(e,t,s)}async canMigrate(e,t){try{return(await this.preview(e,t)).success}catch{return!1}}}const Qc=new Xc;async function Jc(n,e){try{const t=await Qc.migrateToLatest(n,e);return t.success?t.data:null}catch{return null}}const Qe=n=>typeof n=="string"&&n.length>=0,ti=n=>typeof n=="number"&&!Number.isNaN(n),os=(n,e)=>typeof n=="string"&&e.includes(n);function eu(n){var u,d,g,p,f,w,h;const e=[];if(!n||typeof n!="object")return{isValid:!1,errors:["config: must be an object"]};const t=n.settings||{};ti(t.letterSpacing)||t.letterSpacing===void 0||e.push("settings.letterSpacing: number"),Qe(t.bgChat)||t.bgChat===void 0||e.push("settings.bgChat: string"),Qe(t.fontFamily)||t.fontFamily===void 0||e.push("settings.fontFamily: string"),ti(t.fontWeight)||t.fontWeight===void 0||e.push("settings.fontWeight: number"),t.logo===void 0||Qe(t.logo)||e.push("settings.logo: string (svg or url)"),t.widgetTitle===void 0||Qe(t.widgetTitle)||e.push("settings.widgetTitle: string"),t.position===void 0&&e.push("settings.position: undefined");const s=n.texts||{};s.launchIssueTitle===void 0||Qe(s.launchIssueTitle)||e.push("texts.launchIssueTitle: string"),s.issueText===void 0||Qe(s.issueText)||e.push("texts.issueText: string"),s.widgetTitle===void 0||Qe(s.widgetTitle)||e.push("texts.widgetTitle: string"),s.hideText===void 0||Qe(s.hideText)||e.push("texts.hideText: string");const r=((u=n.sections)==null?void 0:u.top)||{},i=r.params||{};i.size===void 0||os(i.size,["sm","md","lg"])||e.push("sections.top.params.size: sm|md|lg"),i.chipStyle===void 0||os(i.chipStyle,["filled","outlined","invisible"])||e.push("sections.top.params.chipStyle: filled|outlined|invisible"),i.buttonStyle===void 0||os(i.buttonStyle,["filled","outlined","invisible"])||e.push("sections.top.params.buttonStyle: filled|outlined|invisible"),i.buttonType===void 0||os(i.buttonType,["icon","text","both"])||e.push("sections.top.params.buttonType: icon|text|both"),((d=r==null?void 0:r.chipWidgetTitle)==null?void 0:d.color)===void 0||Qe((g=r==null?void 0:r.chipWidgetTitle)==null?void 0:g.color)||e.push("sections.top.chipWidgetTitle.color: string"),((p=r==null?void 0:r.chipWidgetTitle)==null?void 0:p.bgColor)===void 0||Qe((f=r==null?void 0:r.chipWidgetTitle)==null?void 0:f.bgColor)||e.push("sections.top.chipWidgetTitle.bgColor: string"),(r==null?void 0:r.btnClose)===void 0||typeof(r==null?void 0:r.btnClose)=="object"||e.push("sections.top.btnClose: object");const a=(((w=n.sections)==null?void 0:w.bottom)||{}).params||{};a.size===void 0||os(a.size,["sm","md","lg"])||e.push("sections.bottom.params.size: sm|md|lg");const c=((h=n.sections)==null?void 0:h.warnings)||{};return c.launchIssue===void 0||typeof c.launchIssue=="object"||e.push("sections.warnings.launchIssue: object"),c.connectionIssue===void 0||typeof c.connectionIssue=="object"||e.push("sections.warnings.connectionIssue: object"),{isValid:e.length===0,errors:e}}class tu{constructor(e){F(this,"config");this.config=e}getFlatRecursiveConfig(e,t="",s={}){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const i=e[r],o=t?`${t}.${r}`:r;i!==null&&typeof i=="object"&&!Array.isArray(i)?this.getFlatRecursiveConfig(i,o,s):s[o]=i}return s}get configFlat(){return this.getFlatRecursiveConfig(this.config)}getConfig(){return this.config}getKey(e){return this.configFlat[e]??void 0}getKeyObject(e){return e.split(".").reduce((t,s)=>t&&t[s]!==void 0?t[s]:"undefined",this.config)}}const Vn={sm:"tw:h-[20px] tw:px-1.5 tw:py-0 tw:[font-size:10px] [&_svg]:tw:size-4",md:"tw:h-[24px] tw:px-2 tw:py-1 tw:text-xs [&_svg]:tw:size-4.5",lg:"tw:h-[28px] tw:px-3 tw:py-1 tw:text-sm [&_svg]:tw:size-5"};function $n(n){return n==="sm"||n==="md"||n==="lg"?Vn[n]:Vn.md}function ar(n,e){try{const s={top:"sections.top.params.size",inside:"sections.inside.params.size",bottom:"sections.bottom.params.size"}[e],r=n==null?void 0:n.getKey(s);return $n(r)}catch{return Vn.md}}const su=["aria-expanded"],nu=["innerHTML"],ru=["src","alt"],iu={key:2},ou={key:0,class:"tw:flex tw:items-center tw:w-full tw:justify-end tw:gap-1.5 header-buttons"},au=["width","height"],lu={key:1},cu=["width","height"],uu={key:1},du=l.defineComponent({__name:"ChatHeader",props:{isChatOpen:{type:Boolean},toggleChat:{type:Function},configDesignClass:{},sectionBorderRadius:{},mainBorderRadius:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},restartChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>e.configDesignClass.getKeyObject("sections.top.params")),s=l.computed(()=>ar(e.configDesignClass,"top")),r=(m,v="px")=>typeof m=="number"?`${m}${v}`:m,i=l.computed(()=>{let m="";switch(t.value.bgStyle){case"gradient":m=`linear-gradient(180deg, ${t.value.bgColor} 0%, ${e.configDesignClass.getKey("settings.bgChat")} 100%)`;break;case"filled":m=t.value.bgColor;break;case"invisible":m="transparent";break;default:m="transparent";break}const y=!!e.configDesignClass.getKey("settings.globalRoundingRadius")?`${e.mainBorderRadius}px`:r(t.value.borderRadius),b=e.configDesignClass.getKey("settings.container.gradient"),x=t.value.border,C=(x==null?void 0:x.width)>0?`${x.width}px solid ${x.color}`:"none",k=`${t.value.sideMargin}px`;return{borderTopLeftRadius:t.value.bgStyle==="invisible"?0:y,borderTopRightRadius:t.value.bgStyle==="invisible"?0:y,borderBottomLeftRadius:t.value.bgStyle==="invisible"?0:b&&b!=="transparent"?y:0,borderBottomRightRadius:t.value.bgStyle==="invisible"?0:b&&b!=="transparent"?y:0,background:m,padding:`${t.value.paddingVertical}px ${t.value.paddingHorizontal}px`,margin:k,maxWidth:`calc(100% - ${k} * 2)`,borderBottom:C}}),o=l.computed(()=>{const m=e.configDesignClass.getKey("texts.widgetTitle"),v=e.configDesignClass.getKey("settings.widgetTitle");return m&&m!=="undefined"?m:v&&v!=="undefined"?v:""}),a=l.computed(()=>e.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")),c=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.chipStyle"),v=e.configDesignClass.getKey("sections.top.chipWidgetTitle.color"),y=e.configDesignClass.getKey("sections.top.chipWidgetTitle.bgColor"),b=m==="outlined",x=m==="filled",C=m==="invisible";return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.chipWidgetTitle.borderRadius")+"px",color:v,border:b?`1px solid ${y}`:"none",padding:C?"0px":null,"background-color":x?y:"transparent"}}),u=l.computed(()=>e.configDesignClass.getKey("sections.top.buttons.showType")),d=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.buttons.showType");return m&&m!=="undefined"?m:"icon"}),g=l.computed(()=>{const m=e.configDesignClass.getKeyObject("sections.top.buttons");return{color:(m==null?void 0:m.color)??"#fff",bgColor:(m==null?void 0:m.bgColor)??"#000"}}),p=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.buttonStyle"),v=m==="outlined",y=m==="invisible",b=g.value;return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.buttons.borderRadius")+"px",color:b.color,border:v?`1px solid ${b.bgColor}`:"none",padding:y?"0px":null,"background-color":y?"transparent":m==="filled"?b.bgColor:"transparent"}}),f=l.computed(()=>{const m=e.configDesignClass.getKey("texts.hideText");return m&&m!=="undefined"?m:"Hide"}),w=l.computed(()=>e.configDesignClass.getKey("settings.logo").includes("<svg")),h=l.computed(()=>e.configDesignClass.getKey("settings.logo"));return(m,v)=>(l.openBlock(),l.createElementBlock("div",{onClick:v[0]||(v[0]=(...y)=>n.toggleChat&&n.toggleChat(...y)),class:"chat-action tw:transition-all tw:cursor-pointer tw:flex tw:items-center tw:w-full tw:justify-start",style:l.normalizeStyle(i.value),role:"button","aria-expanded":n.isChatOpen},[l.createVNode(l.unref(lt),{class:l.normalizeClass(["tw:transition-all tw:flex tw:items-center tw:shadow-none header-title",s.value]),variant:a.value,size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(c.value),type:"button","aria-label":o.value,title:o.value},{default:l.withCtx(()=>[w.value&&n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["header-logo",n.configDesignClass.getKey("sections.top.params.size")]),innerHTML:h.value},null,10,nu)):h.value&&n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("img",{key:1,src:h.value,alt:n.configDesignClass.getKey("sections.top.iconWidget.alt"),class:l.normalizeClass(n.configDesignClass.getKey("sections.top.params.size")==="sm"?"tw:w-3 tw:h-3":"tw:w-4 tw:h-4")},null,10,ru)):l.createCommentVNode("",!0),n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="icon"?(l.openBlock(),l.createElementBlock("span",iu,l.toDisplayString(o.value),1)):l.createCommentVNode("",!0)]),_:1},8,["class","variant","size","style","aria-label","title"]),n.isChatOpen?(l.openBlock(),l.createElementBlock("div",ou,[l.createVNode(l.unref(lt),{variant:u.value,class:l.normalizeClass(["tw:transition-all",[s.value]]),size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(p.value),type:"button","aria-label":f.value,title:f.value,onClick:l.withModifiers(n.restartChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...v[1]||(v[1]=[l.createElementVNode("path",{d:"M10.7935 1.33333H5.20683C2.78016 1.33333 1.3335 2.77999 1.3335 5.20666V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7933V5.20666C14.6668 2.77999 13.2202 1.33333 10.7935 1.33333ZM8.00016 12.1667C6.80683 12.1667 5.8735 11.5733 5.24016 10.9867V11.46C5.24016 11.7333 5.0135 11.96 4.74016 11.96C4.46683 11.96 4.24016 11.7333 4.24016 11.46V9.62666C4.24016 9.35333 4.46683 9.12666 4.74016 9.12666H6.3935C6.66683 9.12666 6.8935 9.35333 6.8935 9.62666C6.8935 9.89999 6.66683 10.1267 6.3935 10.1267H5.7935C6.28683 10.62 7.0535 11.1667 8.00016 11.1667C9.74683 11.1667 11.1668 9.74666 11.1668 8C11.1668 7.72666 11.3935 7.5 11.6668 7.5C11.9402 7.5 12.1668 7.72666 12.1668 8C12.1668 10.3 10.3002 12.1667 8.00016 12.1667ZM12.1668 6.35999C12.1668 6.37999 12.1668 6.39999 12.1668 6.41333C12.1602 6.48666 12.1402 6.55333 12.1068 6.61333C12.0735 6.67333 12.0268 6.72666 11.9668 6.77333C11.9202 6.80666 11.8668 6.83333 11.8068 6.85333C11.7602 6.86666 11.7135 6.87333 11.6668 6.87333H10.0468C9.7735 6.87333 9.54683 6.64666 9.54683 6.37333C9.54683 6.1 9.7735 5.87333 10.0468 5.87333H10.6002C10.0668 5.38 9.20683 4.83333 8.0135 4.83333C6.26683 4.83333 4.84683 6.25333 4.84683 8C4.84683 8.27333 4.62016 8.5 4.34683 8.5C4.0735 8.5 3.8335 8.27333 3.8335 8C3.8335 5.7 5.70016 3.83333 8.00016 3.83333C9.4335 3.83333 10.4868 4.45333 11.1668 5.04666V4.53999C11.1668 4.26666 11.3935 4.03999 11.6668 4.03999C11.9402 4.03999 12.1668 4.26666 12.1668 4.53999V6.35999Z",fill:"currentColor"},null,-1)])],8,au)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",lu," Restart ")):l.createCommentVNode("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"]),l.createVNode(l.unref(lt),{variant:u.value,class:l.normalizeClass(["tw:transition-all",[s.value]]),size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(p.value),type:"button","aria-label":f.value,title:f.value,onClick:l.withModifiers(n.toggleChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...v[2]||(v[2]=[l.createElementVNode("path",{d:"M10.7935 1.33337H5.20683C2.78016 1.33337 1.3335 2.78004 1.3335 5.20671V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7934V5.20671C14.6668 2.78004 13.2202 1.33337 10.7935 1.33337ZM12.3335 10.9334C12.3335 11.9334 11.9335 12.3334 10.9335 12.3334H8.40016C7.40016 12.3334 7.00016 11.9334 7.00016 10.9334V9.73337C7.00016 8.73337 7.40016 8.33337 8.40016 8.33337H10.9335C11.9335 8.33337 12.3335 8.73337 12.3335 9.73337V10.9334Z",fill:"currentColor"},null,-1)])],8,cu)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",uu,l.toDisplayString(f.value),1)):l.createCommentVNode("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"])])):l.createCommentVNode("",!0)],12,su))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const hu=n=>typeof n<"u";function gu(n){return JSON.parse(JSON.stringify(n))}function Po(n,e,t,s={}){var r,i,o;const{clone:a=!1,passive:c=!1,eventName:u,deep:d=!1,defaultValue:g,shouldEmit:p}=s,f=l.getCurrentInstance(),w=t||(f==null?void 0:f.emit)||((r=f==null?void 0:f.$emit)==null?void 0:r.bind(f))||((o=(i=f==null?void 0:f.proxy)==null?void 0:i.$emit)==null?void 0:o.bind(f==null?void 0:f.proxy));let h=u;e||(e="modelValue"),h=h||`update:${e.toString()}`;const m=b=>a?typeof a=="function"?a(b):gu(b):b,v=()=>hu(n[e])?m(n[e]):g,y=b=>{p?p(b)&&w(h,b):w(h,b)};if(c){const b=v(),x=l.ref(b);let C=!1;return l.watch(()=>n[e],k=>{C||(C=!0,x.value=m(k),l.nextTick(()=>C=!1))}),l.watch(x,k=>{!C&&(k!==n[e]||d)&&y(k)},{deep:d}),x}else return l.computed({get(){return v()},set(b){y(b)}})}const fu=l.defineComponent({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=Po(t,"modelValue",e,{passive:!0,defaultValue:t.defaultValue});return(i,o)=>l.withDirectives((l.openBlock(),l.createElementBlock("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.isRef(r)?r.value=a:null),style:{resize:"none"},"data-slot":"textarea",class:l.normalizeClass(l.unref(Fn)("tw:md:text-sm",t.class))},null,2)),[[l.vModelText,l.unref(r)]])}}),pu=["innerHTML"],mu=["width","height"],wu=["width","height"],bu=["width","height"],yu={key:4,class:"tw:absolute tw:-top-6 tw:-translate-x-1/2 tw:left-1/2 tw:text-xs tw:text-white tw:bg-red-500 tw:px-2 tw:py-0.5 tw:rounded-full tw:whitespace-nowrap"},si=l.defineComponent({__name:"VoiceButton",props:{isRecording:{type:Boolean},isTranscribing:{type:Boolean},isPreview:{type:Boolean},disabled:{type:Boolean},formattedDuration:{},color:{},bgColor:{},borderRadius:{},iconSrc:{},iconSize:{},type:{},showType:{}},emits:["toggle"],setup(n){const e=n,t=l.computed(()=>{const r=e.iconSize;return typeof r=="number"&&Number.isFinite(r)?Math.max(1,r):r==="sm"?16:r==="lg"?24:20}),s=l.computed(()=>`${t.value}px`);return(r,i)=>(l.openBlock(),l.createBlock(l.unref(lt),{type:"button","data-voice-type":n.type,"data-voice-show-type":n.showType,class:l.normalizeClass(["btn-voice tw:relative tw:shadow-none tw:flex-shrink-0 tw:p-2 tw:transition-all tw:duration-200 hover:tw:brightness-110",{"voice-recording":n.isRecording},{"tw:opacity-50 tw:cursor-not-allowed":(n.isTranscribing||n.disabled)&&!n.isPreview}]),size:"icon",style:l.normalizeStyle({backgroundColor:n.isRecording?"#ef4444":n.bgColor,color:n.isRecording?"#fff":n.color,borderRadius:n.borderRadius}),disabled:n.isTranscribing||n.disabled,onClick:i[0]||(i[0]=o=>r.$emit("toggle")),title:n.isRecording?"Stop recording":"Start voice input"},{default:l.withCtx(()=>[!n.isRecording&&!n.isTranscribing&&n.iconSrc?(l.openBlock(),l.createElementBlock("div",{key:0,class:"svg-icon",style:l.normalizeStyle({width:s.value,height:s.value})},[l.createElementVNode("div",{innerHTML:n.iconSrc,style:l.normalizeStyle({width:s.value,height:s.value})},null,12,pu)],4)):!n.isRecording&&!n.isTranscribing?(l.openBlock(),l.createElementBlock("svg",{key:1,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...i[1]||(i[1]=[l.createElementVNode("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},null,-1),l.createElementVNode("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),l.createElementVNode("line",{x1:"12",x2:"12",y1:"19",y2:"22"},null,-1)])],8,mu)):n.isRecording?(l.openBlock(),l.createElementBlock("svg",{key:2,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"currentColor"},[...i[2]||(i[2]=[l.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)])],8,wu)):(l.openBlock(),l.createElementBlock("svg",{key:3,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",class:"tw:animate-spin"},[...i[3]||(i[3]=[l.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2",opacity:"0.25"},null,-1),l.createElementVNode("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],8,bu)),n.isRecording?(l.openBlock(),l.createElementBlock("span",yu,l.toDisplayString(n.formattedDuration),1)):l.createCommentVNode("",!0)]),_:1},8,["data-voice-type","data-voice-show-type","class","style","disabled","title"]))}});function vu(n){var b;const e=()=>l.unref(n.transcribeUrl),t=l.ref(!1),s=l.ref(!1),r=l.ref(!0),i=l.ref(null),o=l.ref(0);let a=null,c=[],u=null,d=null;const g=n.maxDuration;(typeof navigator>"u"||!((b=navigator.mediaDevices)!=null&&b.getUserMedia))&&(r.value=!1);const p=()=>{const x=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];for(const C of x)if(MediaRecorder.isTypeSupported(C))return C;return"audio/webm"},f=async()=>{var x;if(!(!r.value||t.value))try{i.value=null,c=[],o.value=0,u=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:16e3}});const C=p();a=new MediaRecorder(u,{mimeType:C}),a.ondataavailable=k=>{k.data.size>0&&c.push(k.data)},a.onstop=async()=>{d&&(clearInterval(d),d=null);const k=new Blob(c,{type:C});u&&(u.getTracks().forEach(R=>R.stop()),u=null),await m(k)},a.onerror=()=>{i.value="Recording error",w()},a.start(250),t.value=!0,d=setInterval(()=>{o.value++,o.value>=g&&w()},1e3)}catch(C){C.name==="NotAllowedError"?i.value="Microphone access denied":C.name==="NotFoundError"?i.value="No microphone found":i.value=C.message||"Failed to start recording",i.value&&((x=n.onError)==null||x.call(n,i.value))}},w=()=>{a&&t.value&&(a.stop(),t.value=!1)},h=()=>{t.value?w():f()},m=async x=>{var k,R,_;s.value=!0,i.value=null;const C=e();if(!C){i.value="Transcribe URL not configured",(k=n.onError)==null||k.call(n,i.value),s.value=!1;return}try{const T=new FormData;T.append("audio",x,"recording.webm");const A=await fetch(C,{method:"POST",body:T});if(!A.ok)throw new Error(`HTTP ${A.status}`);const M=await A.json();if(M.success&&M.text)(R=n.onTranscript)==null||R.call(n,M.text);else throw new Error(M.error||"Transcription failed")}catch(T){i.value=T.message||"Transcription failed",i.value&&((_=n.onError)==null||_.call(n,i.value))}finally{s.value=!1}},v=l.computed(()=>{const x=Math.floor(o.value/60),C=o.value%60;return`${x}:${C.toString().padStart(2,"0")}`}),y=l.computed(()=>t.value||s.value);return{isRecording:t,isTranscribing:s,isSupported:r,isBusy:y,error:i,recordingDuration:o,formattedDuration:v,startRecording:f,stopRecording:w,toggleRecording:h}}class xu{constructor(e,t){F(this,"structure");F(this,"options");F(this,"html","");this.structure=e,this.options={escape:(t==null?void 0:t.escape)??!0,whitelistStyles:(t==null?void 0:t.whitelistStyles)??["color","background","borderColor","borderRadius"]}}build(e){return this.html=this.renderLayout(this.structure.layout,this.structure.bindings||{},e),this}buildStyle(e){return Object.entries(e).forEach(([t,s])=>{const r=Object.entries(s.style||{}).map(([o,a])=>`${o}: ${a};`).join(""),i=new RegExp(`(<\\w+)([^>]*)(data-visual="${this.escapeRegExp(t)}")([^>]*)(>)`,"g");this.html=this.html.replace(i,(o,a,c,u,d,g)=>{var b,x;const p=c+d,f=((b=p.match(/class="([^"]*)"/))==null?void 0:b[1])||"",w=((x=p.match(/style="([^"]*)"/))==null?void 0:x[1])||"",h=c.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),m=d.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),v=[f,s.class].filter(Boolean).join(" "),y=[w,r].filter(Boolean).join(" ");return`${a}${h}${m} class="${v}" style="${y}"${g}`})}),this}result(){return this.html}renderLayout(e,t,s){let r=e;return t&&(Object.entries(t).forEach(([i,o])=>{var c,u;const a=new RegExp(`\\{${this.escapeRegExp(i)}\\}`,"g");if(o.type==="text"){const d=(c=s==null?void 0:s[i])==null?void 0:c.text;r=r.replace(a,this.safeText(typeof d=="string"||typeof d=="number"?String(d):""));return}if(o.type==="button"){const d=(u=s==null?void 0:s[i])==null?void 0:u.text;r=r.replace(a,this.safeText(typeof d=="string"||typeof d=="number"?String(d):""));return}if(o.type==="repeater"){const d=Array.isArray(s==null?void 0:s[i])?s[i]:[],g=o.layout||"",p=o.bindings||{},f=d.map(w=>this.renderLayout(g,p,w)).join("");r=r.replace(a,f);return}}),r=r.replace(/style=\"([^\"]*)\"/g,(i,o)=>{const a=o.split(";").map(c=>c.trim()).filter(Boolean).filter(c=>{const[u]=c.split(":");return this.options.whitelistStyles.includes((u||"").trim())}).join("; ");return`style="${this.safeAttr(a)}"`})),r}safeText(e){return this.options.escape?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/'/g,"&#39;"):e}safeAttr(e){return this.safeText(e)}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}const Cu={layout:'<div class="tw:flex tw:items-center tw:justify-between tw:w-full" data-visual="container"><div class="tw:flex tw:flex-col tw:gap-1"><span data-visual="headerChip" style="padding: 0 !important;">Action title</span><div data-visual="title">{title}</div></div><div class="tw:flex tw:gap-2"><button data-cb="confirm" data-visual="actionConfirm" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3337 4L6.00033 11.3333L2.66699 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button data-cb="cancel" data-visual="actionCancel" style="border-radius: 0 !important;" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 4L4 12M4 4L12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>',bindings:{title:{type:"text"},actionConfirm:{type:"button"},actionCancel:{type:"button"}}};function ku(n){const e=l.computed(()=>{const b=n==null?void 0:n.getKeyObject("sections.inside.activeSnippet"),x=n==null?void 0:n.getKeyObject("sections.activeSnippet"),C=b&&b!=="undefined"?b:x;return C&&C!=="undefined"?C:{}}),t=(b,x)=>{if(!x)return b;switch(x){case"outlined":return{color:b.background,background:"transparent",border:`1px solid ${b.borderColor||b.background}`};case"invisible":return{color:b.background,background:"transparent"};default:return b}},s=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.bgColor")),r=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.color")),i=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.sidePadding")),o=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.verticalSpacing")),a=l.computed(()=>(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderWidth"))+"px solid "+(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderColor"))),c=l.computed(()=>{var b,x,C,k,R,_,T,A;return{color:(x=(b=e.value)==null?void 0:b.headerChip)==null?void 0:x.color,background:(k=(C=e.value)==null?void 0:C.headerChip)==null?void 0:k.bgColor,borderColor:(_=(R=e.value)==null?void 0:R.headerChip)==null?void 0:_.borderColor,bgColor:(A=(T=e.value)==null?void 0:T.headerChip)==null?void 0:A.bgColor}}),u=l.computed(()=>{var b,x;return t(c.value,(x=(b=e.value)==null?void 0:b.headerChip)==null?void 0:x.bgType)}),d=l.computed(()=>{var b,x,C,k;return{...u.value,"border-radius":n!=null&&n.getKey("settings.globalRoundingRadius")?ws(n,2).borderRadius:((x=(b=e.value)==null?void 0:b.headerChip)==null?void 0:x.borderRadius)+"px","font-size":((k=(C=e.value)==null?void 0:C.headerChip)==null?void 0:k.fontSize)+"px"}}),g=l.computed(()=>{var b;return(b=e.value)==null?void 0:b.propertyColor}),p=l.computed(()=>{var b;return(b=e.value)==null?void 0:b.valueColor}),f=l.computed(()=>{var b,x,C,k;return{color:(x=(b=e.value)==null?void 0:b.yesButton)==null?void 0:x.color,background:(k=(C=e.value)==null?void 0:C.yesButton)==null?void 0:k.bgColor,borderRadius:"100px"}}),w=l.computed(()=>{var b,x,C,k;return{color:(x=(b=e.value)==null?void 0:b.noButton)==null?void 0:x.color,background:(k=(C=e.value)==null?void 0:C.noButton)==null?void 0:k.bgColor,borderRadius:"100px"}}),h=l.computed(()=>{const b=n==null?void 0:n.getKey("sections.inside.activeSnippet.params.size"),x=n==null?void 0:n.getKey("sections.inside.params.size");return $n(b!=="undefined"?b:x)}),m=l.computed(()=>{const b=n==null?void 0:n.getKey("sections.inside.activeSnippet.headerChip.size");return $n(b)}),v=b=>{const x=(b.id||"").toLowerCase(),k=x==="confirm"||x==="yes"?f.value:w.value,R=n==null?void 0:n.getKey("sections.inside.activeSnippet.params.buttonStyle");return t(k,R)},y=l.computed(()=>n!=null&&n.getKey("settings.globalRoundingRadius")?ws(n,8):{borderRadius:(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px"});return{containerBg:s,containerColor:r,sidePadding:i,verticalSpacing:o,headerChip:d,propertyColor:g,border:a,valueColor:p,yesButton:f,noButton:w,buttonStyle:v,getButtonStyle:t,actionBtnSizeClass:h,buttonRadiusStyle:y,chipSizeClass:m}}const Su=["innerHTML"],_u=l.defineComponent({__name:"DynamicSnippet",props:{structure:{},data:{},message:{},configDesignClass:{}},emits:["action"],setup(n,{emit:e}){const t=n,{containerBg:s,containerColor:r,headerChip:i,yesButton:o,noButton:a,actionBtnSizeClass:c,buttonRadiusStyle:u,verticalSpacing:d,sidePadding:g,valueColor:p,getButtonStyle:f,border:w,chipSizeClass:h}=ku(t.configDesignClass),m=l.computed(()=>{var k;return(k=t.configDesignClass)==null?void 0:k.getKey("sections.inside.activeSnippet.params.buttonStyle")}),v=l.computed(()=>{var k,R;return{background:s.value,color:r.value,"border-radius":(k=t.configDesignClass)!=null&&k.getKey("settings.globalRoundingRadius")?u.value.borderRadius:((R=t.configDesignClass)==null?void 0:R.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px",border:w.value,padding:`${g.value}px`,gap:`${d.value}px`}}),y=l.computed(()=>{var k,R,_;return{container:{style:v.value},headerChip:{style:{...i.value,height:"auto",padding:"0",background:"transparent"},class:h.value},actionConfirm:{class:c.value,style:{...f(o.value,m.value),flex:"1","line-height":"1","border-radius":"100px","font-size":((k=t.configDesignClass)==null?void 0:k.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}},title:{style:{color:p.value,"font-size":((R=t.configDesignClass)==null?void 0:R.getKey("sections.inside.activeSnippet.element.fontSize"))+"px"}},actionCancel:{class:c.value,style:{...f(a.value,m.value),flex:"1","line-height":"1","border-radius":"100px","font-size":((_=t.configDesignClass)==null?void 0:_.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}}}}),b=e,x=l.computed(()=>new xu(t.structure).build(t.data).buildStyle(y.value).result()),C=k=>{var A;const R=k.target;if(!R)return;const _=R.closest("[data-cb]"),T=_==null?void 0:_.getAttribute("data-cb");T&&((A=t.message.snippet)!=null&&A.sequence)&&b("action",T,t.message.snippet.sequence)};return(k,R)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:mt-1 tw:mb-1",onClick:C,innerHTML:x.value},null,8,Su))}}),Tu={key:0,class:"svg-icon"},Ru=["innerHTML"],zu={key:1},bn=120,Bu=l.defineComponent({__name:"ChatBottom",props:{mainBorderRadius:{},isProduction:{type:Boolean},isPreview:{type:Boolean},configDesignClass:{},messageText:{},sendMessage:{type:Function},sectionBorderRadius:{},classSize:{},isInputDisabled:{type:Boolean},showReconnectNotice:{type:Boolean},restartChat:{type:Function},isStreaming:{type:Boolean},transcribeUrl:{},snippet:{}},emits:["update:messageText","trace","snippetAction"],setup(n,{emit:e}){const t=n,s=l.computed(()=>({text:"",isUser:!1,snippet:t.snippet?{sequence:t.snippet.sequence,id:t.snippet.id||"",data:t.snippet.data}:void 0})),r=l.computed(()=>{var L;return t.transcribeUrl||((L=t.configDesignClass)==null?void 0:L.getKey("settings.transcribeUrl"))||""}),i=l.computed(()=>!!r.value),o=l.computed(()=>{var L,U;return((L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.color"))||((U=t.configDesignClass)==null?void 0:U.getKey("sections.bottom.inputSend.color"))||"#fff"}),a=l.computed(()=>{var L;return(L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.bgColor")}),c=l.computed(()=>{var L;return(L=t.configDesignClass)==null?void 0:L.getKeyObject("sections.bottom.inputSend")}),u=l.computed(()=>{var L;return((L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.icon.src"))||null}),d=l.computed(()=>{var L;return(L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.icon.size")}),g=l.computed(()=>{var ge,Z,ie,Q;if(f.value==="icon")return((ge=t.configDesignClass)==null?void 0:ge.getKey("sections.bottom.btnVoice.borderRadius"))+"px";if(!!((Z=t.configDesignClass)!=null&&Z.getKey("settings.globalRoundingRadius")))return(ie=t.sectionBorderRadius)==null?void 0:ie.borderRadius;const U=(Q=t.configDesignClass)==null?void 0:Q.getKey("sections.bottom.btnVoice.borderRadius");return typeof U=="number"?`${U}px`:"9999px"}),p=l.computed(()=>{var L;return(L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.type")}),f=l.computed(()=>{var L;return(L=t.configDesignClass)==null?void 0:L.getKey("sections.bottom.btnVoice.showType")}),{isRecording:w,isTranscribing:h,isSupported:m,formattedDuration:v,toggleRecording:y}=vu({transcribeUrl:r,maxDuration:60,onTranscript:L=>{k.value=L},onError:L=>{console.error("Voice recording error:",L)}}),b=()=>{t.sendMessage()},x=e,C=L=>{var U;(U=t.snippet)!=null&&U.sequence&&x("snippetAction",L,t.snippet.sequence)},k=Po(t,"messageText",x,{passive:!0}),R=l.computed(()=>{var U;const L=(U=t.configDesignClass)==null?void 0:U.getKey("sections.bottom.inputSend.inputStyle");return L==="stacked"||L==="elastic"||L==="inside"?L:"inside"}),_=l.computed(()=>R.value==="stacked"),T=l.computed(()=>R.value==="elastic"),A=l.ref(null),M=()=>{var U;const L=(U=A.value)==null?void 0:U.$el;return L instanceof HTMLTextAreaElement?L:null},I=()=>{if(!T.value)return;const L=M();if(!L)return;L.style.height="auto";const U=Math.min(L.scrollHeight,bn);L.style.height=`${U}px`,L.style.overflowY=L.scrollHeight>bn?"auto":"hidden"},W=()=>{I()};l.watch([k,T],async()=>{await l.nextTick(),requestAnimationFrame(I)},{immediate:!0});const ee=l.computed(()=>t.configDesignClass.getKeyObject("sections.bottom.btnSend")),P=l.computed(()=>ar(ee.value,"bottom")),N=l.computed(()=>t.configDesignClass.getKey("sections.bottom.inputSend.size")),K=l.computed(()=>t.configDesignClass.getKey("sections.bottom.btnSend.icon.showIcon")?t.configDesignClass.getKey("sections.bottom.btnSend.icon.src"):null),D=l.computed(()=>{const L=t.configDesignClass.getKey("texts.disclaimerText"),U=t.configDesignClass.getKey("texts.disclaimer"),ge=L&&L!=="undefined"?L:U,ie=!!t.configDesignClass.getKey("sections.bottom.params.disclaimerShow");return ge&&ge!=="undefined"&&ie?ge:""});return l.onMounted(()=>{}),(L,U)=>(l.openBlock(),l.createElementBlock("div",null,[n.isProduction?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:flex tw:flex-row tw:gap-2",style:l.normalizeStyle({padding:"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createVNode(l.unref(lt),{type:"button",style:l.normalizeStyle({backgroundColor:"#27272A",borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white","aria-label":"Copy last message",title:"Copy last message",onClick:U[0]||(U[0]=l.withModifiers(ge=>L.$emit("trace",{action:"copyLast"}),["stop"]))},{default:l.withCtx(()=>[...U[3]||(U[3]=[l.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H7.5C8.50833 17.5763 9.16667 16.3596 9.16667 15.0013C9.16667 12.7013 7.3 10.8346 5 10.8346C4.05833 10.8346 3.19167 11.143 2.5 11.668V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.084 3.125C12.4292 3.125 12.709 3.40482 12.709 3.75V5.41667C12.709 5.98816 13.1792 6.45833 13.7507 6.45833H15.4173C15.7625 6.45833 16.0423 6.73816 16.0423 7.08333C16.0423 7.42851 15.7625 7.70833 15.4173 7.70833H13.7507C12.4888 7.70833 11.459 6.67851 11.459 5.41667V3.75C11.459 3.40482 11.7388 3.125 12.084 3.125Z",fill:"white"}),l.createElementVNode("path",{d:"M5.00065 10.832C2.70065 10.832 0.833984 12.6987 0.833984 14.9987C0.833984 17.2987 2.70065 19.1654 5.00065 19.1654C7.30065 19.1654 9.16732 17.2987 9.16732 14.9987C9.16732 12.6987 7.30065 10.832 5.00065 10.832ZM4.30065 16.057C4.50899 16.2654 4.50899 16.607 4.30065 16.8237C4.19232 16.932 4.05899 16.982 3.91733 16.982C3.77566 16.982 3.64231 16.932 3.53398 16.8237L2.09233 15.382C1.88399 15.1737 1.88399 14.832 2.09233 14.6153L3.53398 13.1737C3.74231 12.9654 4.08399 12.9654 4.30065 13.1737C4.50899 13.382 4.50899 13.7237 4.30065 13.9403L3.24233 14.9987L4.30065 16.057ZM7.90066 15.382L6.45898 16.8237C6.35065 16.932 6.21733 16.982 6.07566 16.982C5.93399 16.982 5.80064 16.932 5.69231 16.8237C5.48397 16.6154 5.48397 16.2737 5.69231 16.057L6.75066 14.9987L5.69231 13.9403C5.48397 13.732 5.48397 13.3904 5.69231 13.1737C5.90064 12.9654 6.24232 12.9654 6.45898 13.1737L7.90066 14.6153C8.10899 14.832 8.10899 15.1654 7.90066 15.382Z",fill:"white"})],-1),l.createTextVNode(" Log last function call ",-1)])]),_:1},8,["style"]),l.createVNode(l.unref(lt),{type:"button",class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white",style:l.normalizeStyle({backgroundColor:"#27272A",borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),"aria-label":"Copy all",title:"Copy all",onClick:U[1]||(U[1]=l.withModifiers(ge=>L.$emit("trace",{action:"copyAll"}),["stop"]))},{default:l.withCtx(()=>[...U[4]||(U[4]=[l.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H6.66667C3.75 18.3346 2.5 16.668 2.5 14.168V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),l.createElementVNode("path",{d:"M15.4173 7.70833H13.7507C12.484 7.70833 11.459 6.68333 11.459 5.41667V3.75C11.459 3.40833 11.7423 3.125 12.084 3.125C12.4257 3.125 12.709 3.40833 12.709 3.75V5.41667C12.709 5.99167 13.1757 6.45833 13.7507 6.45833H15.4173C15.759 6.45833 16.0423 6.74167 16.0423 7.08333C16.0423 7.425 15.759 7.70833 15.4173 7.70833Z",fill:"white"}),l.createElementVNode("path",{d:"M8.33255 14.7922C8.17422 14.7922 8.01589 14.7339 7.89089 14.6089L6.22422 12.9422C5.98255 12.7006 5.98255 12.3005 6.22422 12.0589L7.89089 10.3922C8.13255 10.1505 8.53255 10.1505 8.77422 10.3922C9.01588 10.6339 9.01588 11.0339 8.77422 11.2756L7.54922 12.5005L8.77422 13.7255C9.01588 13.9672 9.01588 14.3672 8.77422 14.6089C8.64922 14.7339 8.49088 14.7922 8.33255 14.7922Z",fill:"white"}),l.createElementVNode("path",{d:"M11.6659 14.7922C11.5076 14.7922 11.3492 14.7339 11.2242 14.6089C10.9826 14.3672 10.9826 13.9672 11.2242 13.7255L12.4492 12.5005L11.2242 11.2756C10.9826 11.0339 10.9826 10.6339 11.2242 10.3922C11.4659 10.1505 11.8659 10.1505 12.1076 10.3922L13.7742 12.0589C14.0159 12.3005 14.0159 12.7006 13.7742 12.9422L12.1076 14.6089C11.9826 14.7339 11.8242 14.7922 11.6659 14.7922Z",fill:"white"})],-1),l.createTextVNode(" Log all function calls ",-1)])]),_:1},8,["style"])],4)),n.snippet?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:transition-all tw:flex tw:flex-col tw:mt-2",style:l.normalizeStyle({padding:"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",marginBottom:n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createVNode(_u,{structure:l.unref(Cu),data:n.snippet.data,message:s.value,configDesignClass:n.configDesignClass,onAction:C},null,8,["structure","data","message","configDesignClass"])],4)):(l.openBlock(),l.createElementBlock("div",{key:2,class:"tw:transition-all tw:flex tw:flex-col tw:items-center tw:relative tw:mt-2",style:l.normalizeStyle({padding:_.value?"0":"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createElementVNode("div",{class:l.normalizeClass(["message-input tw:transition-all tw:flex-1 tw:w-full tw:p-0 tw:gap-[10px] tw:flex",[T.value?"tw:flex-1 tw:min-h-[56px] tw:items-center":n.classSize,_.value?"tw:flex-col tw:items-stretch tw:justify-between":T.value?"":" tw:items-end",N.value==="sm"?"tw:items-center":""]]),style:l.normalizeStyle({order:T.value?"1":void 0,..._.value?{borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.mainBorderRadius+"px":n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}:{borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"},"background-color":n.configDesignClass.getKey("sections.bottom.inputSend.bgColor"),"margin-bottom":_.value?"0px":n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",border:_.value?"none":`${n.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${n.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`,borderTop:`${n.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${n.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`})},[i.value&&l.unref(m)&&T.value?(l.openBlock(),l.createBlock(si,{key:0,class:"tw:self-end",style:l.normalizeStyle({marginLeft:n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",marginTop:c.value.paddingVertical+"px",marginBottom:c.value.paddingVertical+"px"}),"is-recording":l.unref(w),"is-transcribing":l.unref(h),"is-preview":n.isPreview,disabled:n.isInputDisabled,"formatted-duration":l.unref(v),color:o.value,"bg-color":a.value,"border-radius":g.value,"icon-src":u.value,"icon-size":d.value,type:p.value,"show-type":f.value,onToggle:l.unref(y)},null,8,["style","is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.unref(fu),{class:l.normalizeClass(["tw:transition-all",["tw:w-full tw:outline-none tw:border-0 focus:tw:outline-none",_.value?"tw:h-auto rounded-none":"h-full"]]),placeholder:n.configDesignClass.getKey("texts.inputPlaceholder")||"Type question",rows:T.value?1:N.value==="sm"?2:N.value==="md"?3:4,key:n.configDesignClass.getKey("sections.bottom.inputSend.color"),ref_key:"messageTextareaRef",ref:A,modelValue:l.unref(k),"onUpdate:modelValue":U[2]||(U[2]=ge=>l.isRef(k)?k.value=ge:null),onKeyup:l.withKeys(l.withModifiers(b,["exact"]),["enter"]),onInput:W,style:l.normalizeStyle({alignSelf:_.value?"flex-start":"auto",color:n.configDesignClass.getKey("sections.bottom.inputSend.color"),fontSize:n.configDesignClass.getKey("sections.bottom.inputSend.fontSize")+"px",lineHeight:n.configDesignClass.getKey("settings.lineHeight"),padding:n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px "+n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",...T.value?{minHeight:n.configDesignClass.getKey("sections.bottom.inputSend.height")+"px",maxHeight:bn+"px",overflowY:"hidden",paddingLeft:"0px !important"}:{height:n.configDesignClass.getKey("sections.bottom.inputSend.height")+"px"}})},null,8,["placeholder","rows","modelValue","onKeyup","class","style"])),l.createElementVNode("div",{class:l.normalizeClass([_.value?"tw:flex tw:justify-end tw:items-center tw:gap-2":"tw:flex tw:ml-auto tw:items-center tw:gap-2",T.value?"tw:self-end":""]),style:l.normalizeStyle({marginBottom:n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px",marginLeft:_.value?n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px":"0",marginTop:T.value?n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px":"0",marginRight:n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px"})},[i.value&&l.unref(m)&&!T.value?(l.openBlock(),l.createBlock(si,{key:0,"is-recording":l.unref(w),"is-transcribing":l.unref(h),"is-preview":n.isPreview,disabled:n.isInputDisabled,"formatted-duration":l.unref(v),color:o.value,"bg-color":a.value,"border-radius":g.value,"icon-src":u.value,"icon-size":d.value,type:p.value,"show-type":f.value,onToggle:l.unref(y)},null,8,["is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):l.createCommentVNode("",!0),_.value&&D.value?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:text-[11px] tw:flex tw:items-center tw:text-center tw:w-full tw:justify-center",style:l.normalizeStyle({...n.sectionBorderRadius,fontSize:n.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",height:n.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:n.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(D.value),5)):l.createCommentVNode("",!0),l.createVNode(l.unref(lt),{class:l.normalizeClass(["tw:transition-all",["btn-send tw:bg-transparent tw:shadow-none tw:flex-shrink-0 tw:items-center tw:gap-1",n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"tw:rounded-full":P.value,_.value?"":"tw:ml-auto",{"tw:opacity-50":(l.unref(k).trim()===""||n.isInputDisabled)&&!n.isPreview},{"tw:px-3 tw:py-2":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="md"},{"tw:px-2 tw:py-1":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="sm"},{"tw:px-4 tw:py-3":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="lg"}]]),size:n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"icon":n.configDesignClass.getKey("sections.bottom.params.size"),onClick:b,style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.bottom.btnSend.color"),"background-color":n.configDesignClass.getKey("sections.bottom.btnSend.bgColor"),fontSize:n.configDesignClass.getKey("sections.bottom.btnSend.fontSize")+"px",border:n.configDesignClass.getKey("sections.bottom.btnSend.borderWidth")+"px solid "+n.configDesignClass.getKey("sections.bottom.btnSend.borderColor")}),disabled:n.isInputDisabled},{default:l.withCtx(()=>[K.value?(l.openBlock(),l.createElementBlock("div",Tu,[l.createElementVNode("div",{innerHTML:K.value,style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.bottom.btnSend.color"),width:n.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px",height:n.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px"})},null,12,Ru)])):l.createCommentVNode("",!0),n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="text"||n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="both"?(l.openBlock(),l.createElementBlock("span",zu,l.toDisplayString(n.configDesignClass.getKey("texts.sendButton")),1)):l.createCommentVNode("",!0)]),_:1},8,["size","class","style","disabled"])],6)],6),!_.value&&D.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:px-2 tw:mb-2 tw:flex tw:items-center tw:justify-center",style:l.normalizeStyle({...n.sectionBorderRadius,fontSize:n.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",order:T.value?0:2,height:n.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:n.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(D.value),5)):l.createCommentVNode("",!0)],4))]))}});var le=(n=>(n.Collapsed="collapsed",n.EmptyChat="empty",n.Messages="messages",n.ActionSnippet="action_snippet",n.LaunchIssue="launch_issue",n.ConnectionIssue="connection_issue",n.ReconnectingAttempt="reconnecting_attempt",n.InputBlocked="input_blocked",n.ActionLoader="action_loader",n.TracesMessage="traces_message",n.TracesWithMeta="traces_with_meta",n))(le||{});const Ts=["Received the request","Processing request","Finalizing request"],Mu=`
18
+ */var Kr,wt,Zt,nr,Pt,Wr,rr,Ql=function(){return typeof window<"u"},gt={},At=180/Math.PI,Yt=Math.PI/180,Wt=Math.atan2,Ur=1e8,ir=/([A-Z])/g,Jl=/(left|right|width|margin|padding|x)/i,ec=/[\s,\(]\S/,nt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},An=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},tc=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},sc=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},nc=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rc=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},wo=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},bo=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},ic=function(e,t,s){return e.style[t]=s},oc=function(e,t,s){return e.style.setProperty(t,s)},ac=function(e,t,s){return e._gsap[t]=s},lc=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},cc=function(e,t,s,r,i){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(i,o)},uc=function(e,t,s,r,i){var o=e._gsap;o[t]=s,o.renderTransform(i,o)},ce="transform",Ae=ce+"Origin",dc=function n(e,t){var s=this,r=this.target,i=r.style,o=r._gsap;if(e in gt&&i){if(this.tfm=this.tfm||{},e!=="transform")e=nt[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=dt(r,a)}):this.tfm[e]=o.x?o[e]:dt(r,e),e===Ae&&(this.tfm.zOrigin=o.zOrigin);else return nt.transform.split(",").forEach(function(a){return n.call(s,a,t)});if(this.props.indexOf(ce)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Ae,t,"")),e=ce}(i||t)&&this.props.push(e,t,i[e])},yo=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},hc=function(){var e=this.props,t=this.target,s=t.style,r=t._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?t[e[i]](e[i+2]):t[e[i]]=e[i+2]:e[i+2]?s[e[i]]=e[i+2]:s.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(ir,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)r[o]=this.tfm[o];r.svg&&(r.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),i=rr(),(!i||!i.isStart)&&!s[ce]&&(yo(s),r.zOrigin&&s[Ae]&&(s[Ae]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},vo=function(e,t){var s={target:e,props:[],revert:hc,save:dc};return e._gsap||Pe.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(r){return s.save(r)}),s},xo,Pn=function(e,t){var s=wt.createElementNS?wt.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):wt.createElement(e);return s&&s.style?s:wt.createElement(e)},Ie=function n(e,t,s){var r=getComputedStyle(e);return r[t]||r.getPropertyValue(t.replace(ir,"-$1").toLowerCase())||r.getPropertyValue(t)||!s&&n(e,ss(t)||t,1)||""},Hr="O,Moz,ms,Ms,Webkit".split(","),ss=function(e,t,s){var r=t||Pt,i=r.style,o=5;if(e in i&&!s)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(Hr[o]+e in i););return o<0?null:(o===3?"ms":o>=0?Hr[o]:"")+e},Dn=function(){Ql()&&window.document&&(Kr=window,wt=Kr.document,Zt=wt.documentElement,Pt=Pn("div")||{style:{}},Pn("div"),ce=ss(ce),Ae=ce+"Origin",Pt.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",xo=!!ss("perspective"),rr=Pe.core.reverting,nr=1)},jr=function(e){var t=e.ownerSVGElement,s=Pn("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=e.cloneNode(!0),i;r.style.display="block",s.appendChild(r),Zt.appendChild(s);try{i=r.getBBox()}catch{}return s.removeChild(r),Zt.removeChild(s),i},qr=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},Co=function(e){var t,s;try{t=e.getBBox()}catch{t=jr(e),s=1}return t&&(t.width||t.height)||s||(t=jr(e)),t&&!t.width&&!t.x&&!t.y?{x:+qr(e,["x","cx","x1"])||0,y:+qr(e,["y","cy","y1"])||0,width:0,height:0}:t},ko=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Co(e))},Ct=function(e,t){if(t){var s=e.style,r;t in gt&&t!==Ae&&(t=ce),s.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(r==="--"?t:t.replace(ir,"-$1").toLowerCase())):s.removeAttribute(t)}},bt=function(e,t,s,r,i,o){var a=new Ee(e._pt,t,s,0,1,o?bo:wo);return e._pt=a,a.b=r,a.e=i,e._props.push(s),a},Gr={deg:1,rad:1,turn:1},fc={grid:1,flex:1},kt=function n(e,t,s,r){var i=parseFloat(s)||0,o=(s+"").trim().substr((i+"").length)||"px",a=Pt.style,c=Jl.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(c?"Width":"Height"),f=100,p=r==="px",g=r==="%",b,h,m,x;if(r===o||!i||Gr[r]||Gr[o])return i;if(o!=="px"&&!p&&(i=n(e,t,s,"px")),x=e.getCTM&&ko(e),(g||o==="%")&&(gt[t]||~t.indexOf("adius")))return b=x?e.getBBox()[c?"width":"height"]:e[d],fe(g?i/b*f:i/100*b);if(a[c?"width":"height"]=f+(p?o:r),h=r!=="rem"&&~t.indexOf("adius")||r==="em"&&e.appendChild&&!u?e:e.parentNode,x&&(h=(e.ownerSVGElement||{}).parentNode),(!h||h===wt||!h.appendChild)&&(h=wt.body),m=h._gsap,m&&g&&m.width&&c&&m.time===Le.time&&!m.uncache)return fe(i/m.width*f);if(g&&(t==="height"||t==="width")){var k=e.style[t];e.style[t]=f+r,b=e[d],k?e.style[t]=k:Ct(e,t)}else(g||o==="%")&&!fc[Ie(h,"display")]&&(a.position=Ie(e,"position")),h===e&&(a.position="static"),h.appendChild(Pt),b=Pt[d],h.removeChild(Pt),a.position="absolute";return c&&g&&(m=Dt(h),m.time=Le.time,m.width=h[d]),fe(p?b*i/f:b&&i?f/b*i:0)},dt=function(e,t,s,r){var i;return nr||Dn(),t in nt&&t!=="transform"&&(t=nt[t],~t.indexOf(",")&&(t=t.split(",")[0])),gt[t]&&t!=="transform"?(i=zs(e,r),i=t!=="transformOrigin"?i[t]:i.svg?i.origin:Gs(Ie(e,Ae))+" "+i.zOrigin+"px"):(i=e.style[t],(!i||i==="auto"||r||~(i+"").indexOf("calc("))&&(i=qs[t]&&qs[t](e,t,s)||Ie(e,t)||Oi(e,t)||(t==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?kt(e,t,i,s)+s:i},gc=function(e,t,s,r){if(!s||s==="none"){var i=ss(t,e,1),o=i&&Ie(e,i,1);o&&o!==s?(t=i,s=o):t==="borderColor"&&(s=Ie(e,"borderTopColor"))}var a=new Ee(this._pt,e.style,t,0,1,go),c=0,u=0,d,f,p,g,b,h,m,x,k,w,C,v;if(a.b=s,a.e=r,s+="",r+="",r.substring(0,6)==="var(--"&&(r=Ie(e,r.substring(4,r.indexOf(")")))),r==="auto"&&(h=e.style[t],e.style[t]=r,r=Ie(e,t)||r,h?e.style[t]=h:Ct(e,t)),d=[s,r],no(d),s=d[0],r=d[1],p=s.match(Ht)||[],v=r.match(Ht)||[],v.length){for(;f=Ht.exec(r);)m=f[0],k=r.substring(c,f.index),b?b=(b+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(b=1),m!==(h=p[u++]||"")&&(g=parseFloat(h)||0,C=h.substr((g+"").length),m.charAt(1)==="="&&(m=Gt(g,m)+C),x=parseFloat(m),w=m.substr((x+"").length),c=Ht.lastIndex-w.length,w||(w=w||Ne.units[t]||C,c===r.length&&(r+=w,a.e+=w)),C!==w&&(g=kt(e,t,h,w)||0),a._pt={_next:a._pt,p:k||u===1?k:",",s:g,c:x-g,m:b&&b<4||t==="zIndex"?Math.round:0});a.c=c<r.length?r.substring(c,r.length):""}else a.r=t==="display"&&r==="none"?bo:wo;return Pi.test(r)&&(a.e=0),this._pt=a,a},Zr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},pc=function(e){var t=e.split(" "),s=t[0],r=t[1]||"50%";return(s==="top"||s==="bottom"||r==="left"||r==="right")&&(e=s,s=r,r=e),t[0]=Zr[s]||s,t[1]=Zr[r]||r,t.join(" ")},mc=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var s=t.t,r=s.style,i=t.u,o=s._gsap,a,c,u;if(i==="all"||i===!0)r.cssText="",c=1;else for(i=i.split(","),u=i.length;--u>-1;)a=i[u],gt[a]&&(c=1,a=a==="transformOrigin"?Ae:ce),Ct(s,a);c&&(Ct(s,ce),o&&(o.svg&&s.removeAttribute("transform"),r.scale=r.rotate=r.translate="none",zs(s,1),o.uncache=1,yo(r)))}},qs={clearProps:function(e,t,s,r,i){if(i.data!=="isFromStart"){var o=e._pt=new Ee(e._pt,t,s,0,0,mc);return o.u=r,o.pr=-10,o.tween=i,e._props.push(s),1}}},Rs=[1,0,0,1,0,0],So={},_o=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Yr=function(e){var t=Ie(e,ce);return _o(t)?Rs:t.substr(7).match(Ai).map(fe)},or=function(e,t){var s=e._gsap||Dt(e),r=e.style,i=Yr(e),o,a,c,u;return s.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?Rs:i):(i===Rs&&!e.offsetParent&&e!==Zt&&!s.svg&&(c=r.display,r.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,a=e.nextElementSibling,Zt.appendChild(e)),i=Yr(e),c?r.display=c:Ct(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):Zt.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Vn=function(e,t,s,r,i,o){var a=e._gsap,c=i||or(e,!0),u=a.xOrigin||0,d=a.yOrigin||0,f=a.xOffset||0,p=a.yOffset||0,g=c[0],b=c[1],h=c[2],m=c[3],x=c[4],k=c[5],w=t.split(" "),C=parseFloat(w[0])||0,v=parseFloat(w[1])||0,y,_,T,R;s?c!==Rs&&(_=g*m-b*h)&&(T=C*(m/_)+v*(-h/_)+(h*k-m*x)/_,R=C*(-b/_)+v*(g/_)-(g*k-b*x)/_,C=T,v=R):(y=Co(e),C=y.x+(~w[0].indexOf("%")?C/100*y.width:C),v=y.y+(~(w[1]||w[0]).indexOf("%")?v/100*y.height:v)),r||r!==!1&&a.smooth?(x=C-u,k=v-d,a.xOffset=f+(x*g+k*h)-x,a.yOffset=p+(x*b+k*m)-k):a.xOffset=a.yOffset=0,a.xOrigin=C,a.yOrigin=v,a.smooth=!!r,a.origin=t,a.originIsAbsolute=!!s,e.style[Ae]="0px 0px",o&&(bt(o,a,"xOrigin",u,C),bt(o,a,"yOrigin",d,v),bt(o,a,"xOffset",f,a.xOffset),bt(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",C+" "+v)},zs=function(e,t){var s=e._gsap||new ao(e);if("x"in s&&!t&&!s.uncache)return s;var r=e.style,i=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),u=Ie(e,Ae)||"0",d,f,p,g,b,h,m,x,k,w,C,v,y,_,T,R,L,N,j,Z,se,X,E,G,A,De,Se,V,F,O,ee,ue;return d=f=p=h=m=x=k=w=C=0,g=b=1,s.svg=!!(e.getCTM&&ko(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(r[ce]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ce]!=="none"?c[ce]:"")),r.scale=r.rotate=r.translate="none"),_=or(e,s.svg),s.svg&&(s.uncache?(A=e.getBBox(),u=s.xOrigin-A.x+"px "+(s.yOrigin-A.y)+"px",G=""):G=!t&&e.getAttribute("data-svg-origin"),Vn(e,G||u,!!G||s.originIsAbsolute,s.smooth!==!1,_)),v=s.xOrigin||0,y=s.yOrigin||0,_!==Rs&&(N=_[0],j=_[1],Z=_[2],se=_[3],d=X=_[4],f=E=_[5],_.length===6?(g=Math.sqrt(N*N+j*j),b=Math.sqrt(se*se+Z*Z),h=N||j?Wt(j,N)*At:0,k=Z||se?Wt(Z,se)*At+h:0,k&&(b*=Math.abs(Math.cos(k*Yt))),s.svg&&(d-=v-(v*N+y*Z),f-=y-(v*j+y*se))):(ue=_[6],O=_[7],Se=_[8],V=_[9],F=_[10],ee=_[11],d=_[12],f=_[13],p=_[14],T=Wt(ue,F),m=T*At,T&&(R=Math.cos(-T),L=Math.sin(-T),G=X*R+Se*L,A=E*R+V*L,De=ue*R+F*L,Se=X*-L+Se*R,V=E*-L+V*R,F=ue*-L+F*R,ee=O*-L+ee*R,X=G,E=A,ue=De),T=Wt(-Z,F),x=T*At,T&&(R=Math.cos(-T),L=Math.sin(-T),G=N*R-Se*L,A=j*R-V*L,De=Z*R-F*L,ee=se*L+ee*R,N=G,j=A,Z=De),T=Wt(j,N),h=T*At,T&&(R=Math.cos(T),L=Math.sin(T),G=N*R+j*L,A=X*R+E*L,j=j*R-N*L,E=E*R-X*L,N=G,X=A),m&&Math.abs(m)+Math.abs(h)>359.9&&(m=h=0,x=180-x),g=fe(Math.sqrt(N*N+j*j+Z*Z)),b=fe(Math.sqrt(E*E+ue*ue)),T=Wt(X,E),k=Math.abs(T)>2e-4?T*At:0,C=ee?1/(ee<0?-ee:ee):0),s.svg&&(G=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!_o(Ie(e,ce)),G&&e.setAttribute("transform",G))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(g*=-1,k+=h<=0?180:-180,h+=h<=0?180:-180):(b*=-1,k+=k<=0?180:-180)),t=t||s.uncache,s.x=d-((s.xPercent=d&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-d)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=f-((s.yPercent=f&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-f)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=p+o,s.scaleX=fe(g),s.scaleY=fe(b),s.rotation=fe(h)+a,s.rotationX=fe(m)+a,s.rotationY=fe(x)+a,s.skewX=k+a,s.skewY=w+a,s.transformPerspective=C+o,(s.zOrigin=parseFloat(u.split(" ")[2])||!t&&s.zOrigin||0)&&(r[Ae]=Gs(u)),s.xOffset=s.yOffset=0,s.force3D=Ne.force3D,s.renderTransform=s.svg?bc:xo?To:wc,s.uncache=0,s},Gs=function(e){return(e=e.split(" "))[0]+" "+e[1]},wn=function(e,t,s){var r=Ce(t);return fe(parseFloat(t)+parseFloat(kt(e,"x",s+"px",r)))+r},wc=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,To(e,t)},Mt="0deg",cs="0px",Et=") ",To=function(e,t){var s=t||this,r=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.z,u=s.rotation,d=s.rotationY,f=s.rotationX,p=s.skewX,g=s.skewY,b=s.scaleX,h=s.scaleY,m=s.transformPerspective,x=s.force3D,k=s.target,w=s.zOrigin,C="",v=x==="auto"&&e&&e!==1||x===!0;if(w&&(f!==Mt||d!==Mt)){var y=parseFloat(d)*Yt,_=Math.sin(y),T=Math.cos(y),R;y=parseFloat(f)*Yt,R=Math.cos(y),o=wn(k,o,_*R*-w),a=wn(k,a,-Math.sin(y)*-w),c=wn(k,c,T*R*-w+w)}m!==cs&&(C+="perspective("+m+Et),(r||i)&&(C+="translate("+r+"%, "+i+"%) "),(v||o!==cs||a!==cs||c!==cs)&&(C+=c!==cs||v?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+Et),u!==Mt&&(C+="rotate("+u+Et),d!==Mt&&(C+="rotateY("+d+Et),f!==Mt&&(C+="rotateX("+f+Et),(p!==Mt||g!==Mt)&&(C+="skew("+p+", "+g+Et),(b!==1||h!==1)&&(C+="scale("+b+", "+h+Et),k.style[ce]=C||"translate(0, 0)"},bc=function(e,t){var s=t||this,r=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.rotation,u=s.skewX,d=s.skewY,f=s.scaleX,p=s.scaleY,g=s.target,b=s.xOrigin,h=s.yOrigin,m=s.xOffset,x=s.yOffset,k=s.forceCSS,w=parseFloat(o),C=parseFloat(a),v,y,_,T,R;c=parseFloat(c),u=parseFloat(u),d=parseFloat(d),d&&(d=parseFloat(d),u+=d,c+=d),c||u?(c*=Yt,u*=Yt,v=Math.cos(c)*f,y=Math.sin(c)*f,_=Math.sin(c-u)*-p,T=Math.cos(c-u)*p,u&&(d*=Yt,R=Math.tan(u-d),R=Math.sqrt(1+R*R),_*=R,T*=R,d&&(R=Math.tan(d),R=Math.sqrt(1+R*R),v*=R,y*=R)),v=fe(v),y=fe(y),_=fe(_),T=fe(T)):(v=f,T=p,y=_=0),(w&&!~(o+"").indexOf("px")||C&&!~(a+"").indexOf("px"))&&(w=kt(g,"x",o,"px"),C=kt(g,"y",a,"px")),(b||h||m||x)&&(w=fe(w+b-(b*v+h*_)+m),C=fe(C+h-(b*y+h*T)+x)),(r||i)&&(R=g.getBBox(),w=fe(w+r/100*R.width),C=fe(C+i/100*R.height)),R="matrix("+v+","+y+","+_+","+T+","+w+","+C+")",g.setAttribute("transform",R),k&&(g.style[ce]=R)},yc=function(e,t,s,r,i){var o=360,a=ye(i),c=parseFloat(i)*(a&&~i.indexOf("rad")?At:1),u=c-r,d=r+u+"deg",f,p;return a&&(f=i.split("_")[1],f==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),f==="cw"&&u<0?u=(u+o*Ur)%o-~~(u/o)*o:f==="ccw"&&u>0&&(u=(u-o*Ur)%o-~~(u/o)*o)),e._pt=p=new Ee(e._pt,t,s,r,u,tc),p.e=d,p.u="deg",e._props.push(s),p},Xr=function(e,t){for(var s in t)e[s]=t[s];return e},vc=function(e,t,s){var r=Xr({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,u,d,f,p,g,b;r.svg?(u=s.getAttribute("transform"),s.setAttribute("transform",""),o[ce]=t,a=zs(s,1),Ct(s,ce),s.setAttribute("transform",u)):(u=getComputedStyle(s)[ce],o[ce]=t,a=zs(s,1),o[ce]=u);for(c in gt)u=r[c],d=a[c],u!==d&&i.indexOf(c)<0&&(g=Ce(u),b=Ce(d),f=g!==b?kt(s,c,u,b):parseFloat(u),p=parseFloat(d),e._pt=new Ee(e._pt,a,c,f,p-f,An),e._pt.u=b||0,e._props.push(c));Xr(a,r)};Me("padding,margin,Width,Radius",function(n,e){var t="Top",s="Right",r="Bottom",i="Left",o=(e<3?[t,s,r,i]:[t+i,t+s,r+s,r+i]).map(function(a){return e<2?n+a:"border"+a+n});qs[e>1?"border"+n:n]=function(a,c,u,d,f){var p,g;if(arguments.length<4)return p=o.map(function(b){return dt(a,b,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(b,h){return g[b]=p[h]=p[h]||p[(h-1)/2|0]}),a.init(c,g,f)}});var Ro={name:"css",register:Dn,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,r,i){var o=this._props,a=e.style,c=s.vars.startAt,u,d,f,p,g,b,h,m,x,k,w,C,v,y,_,T,R;nr||Dn(),this.styles=this.styles||vo(e),T=this.styles.props,this.tween=s;for(h in t)if(h!=="autoRound"&&(d=t[h],!($e[h]&&lo(h,t,s,r,e,i)))){if(g=typeof d,b=qs[h],g==="function"&&(d=d.call(s,r,e,i),g=typeof d),g==="string"&&~d.indexOf("random(")&&(d=Ss(d)),b)b(this,e,h,d,s)&&(_=1);else if(h.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(h)+"").trim(),d+="",vt.lastIndex=0,vt.test(u)||(m=Ce(u),x=Ce(d),x?m!==x&&(u=kt(e,h,u,x)+x):m&&(d+=m)),this.add(a,"setProperty",u,d,r,i,0,0,h),o.push(h),T.push(h,0,a[h]);else if(g!=="undefined"){if(c&&h in c?(u=typeof c[h]=="function"?c[h].call(s,r,e,i):c[h],ye(u)&&~u.indexOf("random(")&&(u=Ss(u)),Ce(u+"")||u==="auto"||(u+=Ne.units[h]||Ce(dt(e,h))||""),(u+"").charAt(1)==="="&&(u=dt(e,h))):u=dt(e,h),p=parseFloat(u),k=g==="string"&&d.charAt(1)==="="&&d.substr(0,2),k&&(d=d.substr(2)),f=parseFloat(d),h in nt&&(h==="autoAlpha"&&(p===1&&dt(e,"visibility")==="hidden"&&f&&(p=0),T.push("visibility",0,a.visibility),bt(this,a,"visibility",p?"inherit":"hidden",f?"inherit":"hidden",!f)),h!=="scale"&&h!=="transform"&&(h=nt[h],~h.indexOf(",")&&(h=h.split(",")[0]))),w=h in gt,w){if(this.styles.save(h),R=d,g==="string"&&d.substring(0,6)==="var(--"){if(d=Ie(e,d.substring(4,d.indexOf(")"))),d.substring(0,5)==="calc("){var L=e.style.perspective;e.style.perspective=d,d=Ie(e,"perspective"),L?e.style.perspective=L:Ct(e,"perspective")}f=parseFloat(d)}if(C||(v=e._gsap,v.renderTransform&&!t.parseTransform||zs(e,t.parseTransform),y=t.smoothOrigin!==!1&&v.smooth,C=this._pt=new Ee(this._pt,a,ce,0,1,v.renderTransform,v,0,-1),C.dep=1),h==="scale")this._pt=new Ee(this._pt,v,"scaleY",v.scaleY,(k?Gt(v.scaleY,k+f):f)-v.scaleY||0,An),this._pt.u=0,o.push("scaleY",h),h+="X";else if(h==="transformOrigin"){T.push(Ae,0,a[Ae]),d=pc(d),v.svg?Vn(e,d,0,y,0,this):(x=parseFloat(d.split(" ")[2])||0,x!==v.zOrigin&&bt(this,v,"zOrigin",v.zOrigin,x),bt(this,a,h,Gs(u),Gs(d)));continue}else if(h==="svgOrigin"){Vn(e,d,1,y,0,this);continue}else if(h in So){yc(this,v,h,p,k?Gt(p,k+d):d);continue}else if(h==="smoothOrigin"){bt(this,v,"smooth",v.smooth,d);continue}else if(h==="force3D"){v[h]=d;continue}else if(h==="transform"){vc(this,d,e);continue}}else h in a||(h=ss(h)||h);if(w||(f||f===0)&&(p||p===0)&&!ec.test(d)&&h in a)m=(u+"").substr((p+"").length),f||(f=0),x=Ce(d)||(h in Ne.units?Ne.units[h]:m),m!==x&&(p=kt(e,h,u,x)),this._pt=new Ee(this._pt,w?v:a,h,p,(k?Gt(p,k+f):f)-p,!w&&(x==="px"||h==="zIndex")&&t.autoRound!==!1?rc:An),this._pt.u=x||0,w&&R!==d?(this._pt.b=u,this._pt.e=R,this._pt.r=nc):m!==x&&x!=="%"&&(this._pt.b=u,this._pt.r=sc);else if(h in a)gc.call(this,e,h,u,k?k+d:d);else if(h in e)this.add(e,h,u||e[h],k?k+d:d,r,i);else if(h!=="parseTransform"){qn(h,d);continue}w||(h in a?T.push(h,0,a[h]):typeof e[h]=="function"?T.push(h,2,e[h]()):T.push(h,1,u||e[h])),o.push(h)}}_&&po(this)},render:function(e,t){if(t.tween._time||!rr())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:dt,aliases:nt,getSetter:function(e,t,s){var r=nt[t];return r&&r.indexOf(",")<0&&(t=r),t in gt&&t!==Ae&&(e._gsap.x||dt(e,"x"))?s&&Wr===s?t==="scale"?lc:ac:(Wr=s||{})&&(t==="scale"?cc:uc):e.style&&!Un(e.style[t])?ic:~t.indexOf("-")?oc:tr(e,t)},core:{_removeProperty:Ct,_getMatrix:or}};Pe.utils.checkPrefix=ss;Pe.core.getStyleSaver=vo;(function(n,e,t,s){var r=Me(n+","+e+","+t,function(i){gt[i]=1});Me(e,function(i){Ne.units[i]="deg",So[i]=1}),nt[r[13]]=n+","+e,Me(s,function(i){var o=i.split(":");nt[o[1]]=r[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Me("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Ne.units[n]="px"});Pe.registerPlugin(Ro);var H=Pe.registerPlugin(Ro)||Pe;H.core.Tween;const Qr={sm:{fontSize:12,sidePadding:8,verticalSpacing:4,borderRadius:8},md:{fontSize:14,sidePadding:12,verticalSpacing:8,borderRadius:10},lg:{fontSize:16,sidePadding:16,verticalSpacing:12,borderRadius:12}};function Ut(n){if(n!=null)return`${n}px`}function zo(n){return Math.max(0,Math.min(1,n))}function Bo(n){if(!n)return;const e=n.trim();if(/^#([0-9a-fA-F]{3}){1,2}$/.test(e)){let s=0,r=0,i=0;return e.length===4?(s=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(s=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16)),{r:s,g:r,b:i}}const t=e.match(/^rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(t)return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3])}}function bn(n){const t=Math.max(0,Math.min(255,Math.round(n))).toString(16);return t.length===1?`0${t}`:t}function Mo(n){if(n)return`#${bn(n.r)}${bn(n.g)}${bn(n.b)}`}function Jr(n,e=.12){const t=Bo(n);if(!t)return n;const s=zo(e);return Mo({r:t.r+(255-t.r)*s,g:t.g+(255-t.g)*s,b:t.b+(255-t.b)*s})}function xc(n,e=.12){const t=Bo(n);if(!t)return n;const s=zo(e);return Mo({r:t.r*(1-s),g:t.g*(1-s),b:t.b*(1-s)})}function Cc(n,e){if(n)switch(e){case"gradient":{const t=Jr(n,.08)||n,s=xc(n,.12)||n;return`linear-gradient(180deg, ${t} 0%, ${s} 100%)`}case"bubble":return`radial-gradient(120% 120% at 10% 0%, ${Jr(n,.14)||n} 0%, ${n} 60%)`;default:return n}}function kc(n,e){return{...n?Qr[n]:Qr.md,...void 0}}function Sc(n,e){const t=kc(n.size),s=n.color,r=Cc(n.bgColor??(e==null?void 0:e.fallbackColor),n.bgType),i=Ut(n.fontSize??t.fontSize),o=Ut(n.borderRadius??t.borderRadius),a=Ut(n.verticalPadding),c=Ut(n.sidePadding);let u;n.borderWidth&&n.borderWidth>0?u=`${n.borderWidth}px solid ${n.borderColor||(e==null?void 0:e.fallbackColor)||"currentColor"}`:n.borderColor&&!n.borderWidth&&(u=`1px solid ${n.borderColor}`);const d=n.width?n.width+(n.borderWidth??0):void 0,f=n.height?n.height+(n.borderWidth??0):void 0,p={color:s,background:r,fontSize:i,borderRadius:o,width:Ut(d),height:Ut(f),padding:a&&c?`${a} ${c}`:void 0,border:u},g={};for(const b in p){const h=p[b];h!=null&&h!==""&&(g[b]=String(h))}return g}const _c=["innerHTML"],Tc=["src"],Rc=l.defineComponent({__name:"ChatCollapsed",props:{element:{},toggleChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>e.element),s=l.computed(()=>Sc(t.value)),r=l.computed(()=>{const a=e.element.logo;return a?a.includes("<svg"):!1}),i=l.computed(()=>{const a=e.element.logo;return a&&a.replace('width="',"").replace('height="',"").replace('"',""),a}),o=l.computed(()=>{var c;const a=(c=e.element.icon)==null?void 0:c.size;return a?a+"px":void 0});return(a,c)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle([s.value,{"box-sizing":"content-box"}]),class:"chat-collapsed tw:transition-all tw:flex tw:cursor-pointer tw:items-center tw:justify-center",onClick:c[0]||(c[0]=(...u)=>n.toggleChat&&n.toggleChat(...u))},[r.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:"hs-collapsed-logo tw:transition-all",innerHTML:i.value,style:l.normalizeStyle({width:o.value,height:o.value})},null,12,_c)):i.value?(l.openBlock(),l.createElementBlock("img",{key:1,class:"tw:transition-all",src:i.value,alt:"logo",style:l.normalizeStyle({width:o.value,height:o.value})},null,12,Tc)):l.createCommentVNode("",!0)],4))}}),zc={required:["settings","texts","sections"],version:"3.1"},Bc=JSON.parse('{"bottom":{"btnSend":{"bgColor":"#5E4AC6","borderColor":"#595959","borderRadius":100,"borderWidth":0,"color":"#FFFFFF","fontSize":13,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M13.5525 6.38248L7.13245 3.17248C2.81995 1.01248 1.04995 2.78248 3.20995 7.09498L3.86245 8.39998C4.04995 8.78248 4.04995 9.22498 3.86245 9.60748L3.20995 10.905C1.04995 15.2175 2.81245 16.9875 7.13245 14.8275L13.5525 11.6175C16.4325 10.1775 16.4325 7.82248 13.5525 6.38248ZM11.13 9.56248H7.07995C6.77245 9.56248 6.51745 9.30748 6.51745 8.99998C6.51745 8.69248 6.77245 8.43748 7.07995 8.43748H11.13C11.4375 8.43748 11.6925 8.69248 11.6925 8.99998C11.6925 9.30748 11.4375 9.56248 11.13 9.56248Z\\" fill=\\"currentColor\\"/>\\n</svg>\\n"},"showType":"icon","size":"md"},"btnVoice":{"bgColor":"#FFFFFF1A","borderRadius":100,"borderWidth":0,"borderColor":"#595959","color":"#fff","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":18,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><path d=\\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\\"></path><path d=\\"M19 10v2a7 7 0 0 1-14 0v-2\\"></path><line x1=\\"12\\" x2=\\"12\\" y1=\\"19\\" y2=\\"22\\"></line></svg>"},"showType":"icon","size":"md"},"disclaimer":{"bgColor":"#FF0000","color":"#4C4C4C","fontSize":9,"height":12},"inputSend":{"bgColor":"#151515","bgType":"plain","borderColor":"#595959","borderRadius":8,"borderWidth":0,"color":"#EEECEC","fontSize":12,"inputStyle":"inside","paddingHorizontal":9,"paddingVertical":10,"sidePadding":7,"size":"lg"},"params":{"disclaimerShow":true,"size":"md"}},"colapsed":{"bgColor":"#7D52F4","borderColor":"rgba(29, 29, 31, 0.90)","borderRadius":50,"borderWidth":8,"color":"#fff","height":56,"icon":{"showIcon":true,"size":18},"logo":"<svg width=\\"18\\" height=\\"18\\" viewBox=\\"0 0 18 18\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z\\" fill=\\"currentColor\\"/></svg>","width":56},"inside":{"activeSnippet":{"element":{"bgColor":"#292929","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":12,"sidePadding":8,"verticalSpacing":8},"headerChip":{"bgColor":"transparent","bgType":"filled","borderRadius":12,"color":"#595959","fontSize":12,"size":"md"},"noButton":{"bgColor":"#C20E4D","borderRadius":12,"color":"#fff","fontSize":12},"params":{"buttonStyle":"filled","buttonType":"both","size":"md"},"propertyColor":"rgba(255, 255, 255, 0.30)","valueColor":"#fff","yesButton":{"bgColor":"#12A150","borderRadius":12,"color":"#fff","fontSize":12}},"dataAction":{"activeStepColor":"#fff","bodyFillColor":"#424242","headerFillColor":"#0B0A13","headerText":"Talking to the data","pastStepColor":"#515151","strokeColor":"#3F3F3F","strokeWidth":1,"type":"steps"},"messageBot":{"bgColor":"#292929","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"md"},"messageUser":{"bgColor":"#F8F8F933","bgType":"bubble","borderColor":"#595959","borderRadius":12,"borderWidth":1,"color":"#F9F8F8","fontSize":14,"size":"md"},"params":{"sidePadding":8,"size":"md","verticalPadding":8},"welcomeMessage":{"bgColor":"#101010","bgType":"gradient","borderColor":"#595959","borderRadius":12,"borderWidth":0,"color":"#fff","fontSize":14,"size":"lg"}},"loader":{"activeStep":{"color":"#FFF","fontSize":12,"icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"20\\" height=\\"20\\" viewBox=\\"0 0 20 20\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M7.56943 3.05554C6.22707 3.05554 5.13888 4.14374 5.13888 5.4861C5.13888 5.61121 5.14835 5.73411 5.1666 5.85413C3.97524 6.01056 3.05554 7.02981 3.05554 8.26388C3.05554 8.94394 3.33487 9.55881 3.78506 9.99999C3.33487 10.4412 3.05554 11.056 3.05554 11.7361C3.05554 12.7096 3.62748 13.5489 4.45383 13.937C4.4476 14.0128 4.44443 14.0894 4.44443 14.1667C4.44443 15.7007 5.68808 16.9444 7.22221 16.9444C8.05185 16.9444 8.79658 16.5807 9.30554 16.004V3.78506C8.86436 3.33487 8.24953 3.05554 7.56943 3.05554ZM10.6944 3.78506V16.004C11.2034 16.5807 11.9481 16.9444 12.7778 16.9444C14.3119 16.9444 15.5555 15.7007 15.5555 14.1667C15.5555 14.0894 15.5523 14.0128 15.5462 13.937C16.3725 13.5489 16.9444 12.7096 16.9444 11.7361C16.9444 11.056 16.6651 10.4412 16.2149 9.99999C16.6651 9.55881 16.9444 8.94394 16.9444 8.26388C16.9444 7.02981 16.0247 6.01056 14.8334 5.85413C14.8517 5.73411 14.8611 5.61121 14.8611 5.4861C14.8611 4.14374 13.7729 3.05554 12.4305 3.05554C11.7505 3.05554 11.1356 3.33487 10.6944 3.78506Z\\" fill=\\"currentColor\\"/></svg>"}},"completeStep":{"color":"#8E8E8F","fontSize":12,"icon":{"color":"#8E8E8F","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"16\\" viewBox=\\"0 0 16 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path opacity=\\"0.4\\" d=\\"M7.99967 14.6666C11.6816 14.6666 14.6663 11.6818 14.6663 7.99992C14.6663 4.31802 11.6816 1.33325 7.99967 1.33325C4.31778 1.33325 1.33301 4.31802 1.33301 7.99992C1.33301 11.6818 4.31778 14.6666 7.99967 14.6666Z\\" fill=\\"currentColor\\"></path><path d=\\"M7.05297 10.3867C6.91964 10.3867 6.79297 10.3334 6.69964 10.2401L4.81297 8.3534C4.61964 8.16007 4.61964 7.84007 4.81297 7.64673C5.0063 7.4534 5.3263 7.4534 5.51964 7.64673L7.05297 9.18007L10.4796 5.7534C10.673 5.56007 10.993 5.56007 11.1863 5.7534C11.3796 5.94673 11.3796 6.26673 11.1863 6.46006L7.4063 10.2401C7.31297 10.3334 7.1863 10.3867 7.05297 10.3867Z\\" fill=\\"currentColor\\"></path></svg>"},"verticalSpacing":8},"typingLoader":{"bgColor":"#2F2F31","color":"#8E8E8F"}},"top":{"buttons":{"bgColor":"#2F2F31","borderRadius":12,"color":"#BBBBBD","showType":"icon"},"chipWidgetTitle":{"bgColor":"#5E4AC6","borderRadius":12,"color":"#BFB6E9","showType":"both"},"params":{"bgColor":"#5E4AC6","bgStyle":"invisible","border":{"color":"#991717","width":0},"borderRadius":12,"buttonStyle":"invisible","chipStyle":"filled","paddingHorizontal":0,"paddingVertical":1,"sideMargin":12,"size":"lg"}},"warnings":{"connectionIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#fff","showIcon":true,"size":16,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z\\" fill=\\"#FFCC77\\"/>\\n</svg>"},"sidePadding":12,"verticalSpacing":8},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"disableInputIssue":{"content":{"bgColor":"#8A7045","color":"#fff","icon":{"color":"#FFF","showIcon":true,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"}},"warningStyle":"gradient"},"launchIssue":{"content":{"bgColor":"#8A7045","color":"#fff","headlineColor":"#f9c97c","headlineTextSize":12,"icon":{"color":"#FFCC77","showIcon":true,"size":24,"src":"<svg width=\\"24\\" height=\\"25\\" viewBox=\\"0 0 24 25\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.5 3.35 8.64 4.9L2.24 16.42C1.43 17.89 1.34 19.3 1.99 20.41C2.64 21.52 3.92 22.13 5.6 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5Z\\" fill=\\"currentColor\\"/></svg>"},"sidePadding":8,"subTextSize":12,"verticalSpacing":4},"resetButton":{"bgColor":"#e5e1dd","bgType":"filled","borderRadius":12,"color":"#2e2e30","fontSize":12,"icon":{"color":"#2e2e30","showIcon":true,"size":16,"src":"<svg width=\\"16\\" height=\\"17\\" viewBox=\\"0 0 16 17\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z\\" fill=\\"currentColor\\"/></svg>"},"showType":"both","size":"md"},"warningStyle":"faded"},"reconnectIssue":{"content":{"bgColor":"#8A7045","borderRadius":12,"color":"#fff","icon":{"color":"#FFF","showIcon":true,"size":16,"src":"<svg width=\\"17\\" height=\\"16\\" viewBox=\\"0 0 17 16\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">\\n<path d=\\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\\" stroke=\\"currentColor\\" stroke-width=\\"1.5\\" stroke-miterlimit=\\"10\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"/>\\n</svg>"},"margin":8,"sidePadding":8,"verticalSpacing":8},"warningStyle":"gradient"}}}'),Mc={bgChat:"#212121",borderRadius:18,container:{gradient:"#34257F",innerBorder:{color:"#000",style:"solid",width:0},outerBorder:{color:"#2929294D",style:"solid",width:0}},fontFamily:"MacPaw Fixel",fontWeight:500,gapMessageLine:12,globalRoundingRadius:!0,launchView:"closed",letterSpacing:-.2,lineHeight:1.2,loader:"dots",logo:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z" fill="currentColor"/></svg>',mode:"collapsed",offset:{x:24,y:36},position:"bottomRight",size:{height:550,width:500},theme:"light"},Ec={disableInputText:"Can’t send a message while processing the previous request",disclaimer:"Disclaimer text",inputPlaceholder:"Type question",issueText:"Something went wrong, please restart",launchIssueText:"Please restart the chat, it should work",launchIssueTitle:"There was a glitch",reconnectText:"Connection issue, trying to reconnect",sendButton:"Send",typingLoader:"AI-Co-pilot typing",welcomeMessage:"👋 Hey there, I’m your AI data assistant. With me you can talk to your data and get instant insights about your leads, deals, clients and everything in-between",widgetTitle:"Agent.ai"},Ac={schema:zc,sections:Bc,settings:Mc,texts:Ec},W=Ac;class Xe{canApply(e){return e.fromVersion===this.appliesTo.from&&e.toVersion===this.appliesTo.to}rollback(e){return{success:!1,errors:[`Rollback not implemented for strategy: ${this.name}`],warnings:[],modified:!1}}createSuccessResult(e,t=[]){return{success:!0,data:e,errors:[],warnings:t,modified:!0}}createErrorResult(e,t){return{success:!1,data:t,errors:e,warnings:[],modified:!1}}}class Pc extends Xe{constructor(){super(...arguments),this.name="AddSettingsFieldsV1toV2",this.description="Добавляет новые поля loader, buttonStyle, buttonType в settings",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[],r={...t.settings,loader:W.settings.loader};return s.push(`Добавлены поля loader: '${r.loader}'`),this.createSuccessResult({...t,settings:r},s)}catch(t){return this.createErrorResult([`Ошибка при добавлении полей settings: ${t}`])}}}class Dc extends Xe{constructor(){super(...arguments),this.name="AddChipStyleV1toV2",this.description="Добавляет поле chipStyle в sections.top.params",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.top.params={...t.sections.top.params,chipStyle:W.sections.top.params.chipStyle},s.push(`Добавлено поле chipStyle: '${W.sections.top.params.chipStyle}' в sections.top.params`),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении chipStyle: ${t}`])}}}class Vc extends Xe{constructor(){super(...arguments),this.name="AddMessageBgTypeV1toV2",this.description="Добавляет поле bgType в messageUser и messageBot",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside.messageUser={...t.sections.inside.messageUser,bgType:W.sections.inside.messageUser.bgType},t.sections.inside.messageBot={...t.sections.inside.messageBot,bgType:W.sections.inside.messageBot.bgType},s.push("Добавлены поля bgType для messageUser и messageBot"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении bgType для сообщений: ${t}`])}}}class $c extends Xe{constructor(){super(...arguments),this.name="AddActionButtonsV1toV2",this.description="Добавляет кнопки aprooveButton и rejectButton в inside секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.inside={...t.sections.inside},s.push("Добавлены кнопки aprooveButton и rejectButton"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении кнопок действий: ${t}`])}}}class Lc extends Xe{constructor(){super(...arguments),this.name="EnhanceInputSendV1toV2",this.description="Добавляет borderStyle, inputStyle, bgType в inputSend",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom.inputSend={...t.sections.bottom.inputSend,borderStyle:{borderColor:W.sections.bottom.inputSend.borderColor,borderWidth:W.sections.bottom.inputSend.borderWidth},inputStyle:W.sections.bottom.inputSend.inputStyle,bgType:W.sections.bottom.inputSend.bgType},s.push("Расширен inputSend с новыми полями borderStyle, inputStyle, bgType"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении inputSend: ${t}`])}}}class Oc extends Xe{constructor(){super(...arguments),this.name="AddBottomElementsV1toV2",this.description="Добавляет warningAlert и disclaimer в bottom секцию",this.appliesTo={from:"1.0",to:"2.0"}}apply(e){try{const t={...e.config},s=[];return t.sections.bottom={...t.sections.bottom},s.push("Добавлены warningAlert и disclaimer в bottom секцию"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении элементов bottom: ${t}`])}}}const Ic=[new Pc,new Dc,new Vc,new $c,new Lc,new Oc];class Nc extends Xe{constructor(){super(...arguments),this.name="AddThemeAndContainerV2toV3",this.description="Adds theme and container (innerBorder, outerBorder, gradient) to settings",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i,o,a,c,u,d,f,p,g,b;try{const h={...e.config},m=[];if(h.settings.theme||(h.settings.theme=W.settings.theme,m.push(`Добавлено поле theme: '${h.settings.theme}'`)),h.settings.container||(h.settings.container={innerBorder:{width:((s=(t=W.settings.container)==null?void 0:t.innerBorder)==null?void 0:s.width)||0,color:((i=(r=W.settings.container)==null?void 0:r.innerBorder)==null?void 0:i.color)||"transparent",style:((a=(o=W.settings.container)==null?void 0:o.innerBorder)==null?void 0:a.style)||"solid"},outerBorder:{width:((u=(c=W.settings.container)==null?void 0:c.outerBorder)==null?void 0:u.width)||0,color:((f=(d=W.settings.container)==null?void 0:d.outerBorder)==null?void 0:f.color)||"transparent",style:((g=(p=W.settings.container)==null?void 0:p.outerBorder)==null?void 0:g.style)||"solid"},gradient:((b=W.settings.container)==null?void 0:b.gradient)||"transparent"},m.push("Added container object with innerBorder, outerBorder, gradient")),typeof h.settings.borderRadius=="string"){const x={0:0,sm:4,md:8,lg:12};h.settings.borderRadius=x[h.settings.borderRadius]??12,m.push(`Конвертирован borderRadius из строки в число: ${h.settings.borderRadius}`)}return this.createSuccessResult(h,m)}catch(h){return this.createErrorResult([`Ошибка при добавлении theme и container: ${h}`])}}}class Fc extends Xe{constructor(){super(...arguments),this.name="AddTopParamsV2toV3",this.description="Добавляет border, sideMargin, borderRadius в sections.top.params",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i;try{const o={...e.config},a=[];return(s=(t=o.sections)==null?void 0:t.top)!=null&&s.params||(o.sections.top=o.sections.top||{},o.sections.top.params={}),o.sections.top.params.border||(o.sections.top.params.border={width:((r=W.sections.top.params.border)==null?void 0:r.width)||0,color:((i=W.sections.top.params.border)==null?void 0:i.color)||"transparent"},a.push("Добавлено поле border в sections.top.params")),o.sections.top.params.sideMargin===void 0&&(o.sections.top.params.sideMargin=W.sections.top.params.sideMargin||0,a.push(`Добавлено поле sideMargin: ${o.sections.top.params.sideMargin}`)),o.sections.top.params.borderRadius===void 0&&(o.sections.top.params.borderRadius=W.sections.top.params.borderRadius||12,a.push(`Добавлено поле borderRadius: ${o.sections.top.params.borderRadius}`)),this.createSuccessResult(o,a)}catch(o){return this.createErrorResult([`Ошибка при добавлении полей top.params: ${o}`])}}}class Kc extends Xe{constructor(){super(...arguments),this.name="AddDataActionV2toV3",this.description="Добавляет dataAction в sections.inside",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r;try{const i={...e.config},o=[];(t=i.sections)!=null&&t.inside||(i.sections.inside={});const a=(r=(s=W==null?void 0:W.sections)==null?void 0:s.inside)==null?void 0:r.dataAction,c=a&&typeof a=="object"?a:{type:"steps",headerFillColor:"#595959",headerText:"#fff",bodyFillColor:"#595959",activeStepColor:"#fff",pastStepColor:"#fff",strokeColor:"#595959",strokeWidth:0},u=()=>JSON.parse(JSON.stringify(c)),d=i.sections.inside.dataAction;return d?typeof d=="string"?(i.sections.inside.dataAction={...u(),type:d},o.push(`Upgraded dataAction from string to object (type: '${d}')`)):typeof d=="object"&&(i.sections.inside.dataAction={...u(),...d},i.sections.inside.dataAction.type||(i.sections.inside.dataAction.type=u().type,o.push(`Filled missing dataAction.type with default ('${i.sections.inside.dataAction.type}')`))):(i.sections.inside.dataAction=u(),o.push(`Added dataAction object (type: '${i.sections.inside.dataAction.type}')`)),this.createSuccessResult(i,o)}catch(i){return this.createErrorResult([`Ошибка при добавлении dataAction: ${i}`])}}}class Wc extends Xe{constructor(){super(...arguments),this.name="EnhanceWelcomeMessageV2toV3",this.description="Расширяет welcomeMessage с borderColor и другими полями",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s;try{const r={...e.config},i=[];(s=(t=r.sections)==null?void 0:t.inside)!=null&&s.welcomeMessage||(r.sections.inside.welcomeMessage={});const o=r.sections.inside.welcomeMessage,a=W.sections.inside.welcomeMessage;return!o.borderColor&&a.borderColor&&(o.borderColor=a.borderColor,i.push("Добавлено поле borderColor для welcomeMessage")),!o.bgType&&a.bgType&&(o.bgType=a.bgType,i.push(`Добавлено поле bgType для welcomeMessage: '${o.bgType}'`)),!o.bgColor&&a.bgColor&&(o.bgColor=a.bgColor,i.push("Добавлено поле bgColor для welcomeMessage")),o.borderWidth===void 0&&a.borderWidth!==void 0&&(o.borderWidth=a.borderWidth,i.push("Добавлено поле borderWidth для welcomeMessage")),!o.fontSize&&a.fontSize&&(o.fontSize=a.fontSize,i.push("Добавлено поле fontSize для welcomeMessage")),!o.size&&a.size&&(o.size=a.size,i.push("Добавлено поле size для welcomeMessage")),!o.borderRadius&&a.borderRadius&&(o.borderRadius=a.borderRadius,i.push("Добавлено поле borderRadius для welcomeMessage")),this.createSuccessResult(r,i)}catch(r){return this.createErrorResult([`Ошибка при расширении welcomeMessage: ${r}`])}}}class Uc extends Xe{constructor(){super(...arguments),this.name="AddVoiceButtonV2toV3",this.description="Добавляет btnVoice в sections.bottom",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,r,i,o,a,c,u,d,f;try{const p={...e.config},g=[];return(t=p.sections)!=null&&t.bottom||(p.sections.bottom={}),p.sections.bottom.btnVoice||(p.sections.bottom.btnVoice={color:((s=W.sections.bottom.btnVoice)==null?void 0:s.color)||"#fff",bgColor:((r=W.sections.bottom.btnVoice)==null?void 0:r.bgColor)||"rgba(255, 255, 255, 0.10)",showType:((i=W.sections.bottom.btnVoice)==null?void 0:i.showType)||"icon",borderRadius:((o=W.sections.bottom.btnVoice)==null?void 0:o.borderRadius)||50,borderColor:((a=W.sections.bottom.btnVoice)==null?void 0:a.borderColor)||"#595959",borderWidth:((c=W.sections.bottom.btnVoice)==null?void 0:c.borderWidth)||1,size:((u=W.sections.bottom.btnVoice)==null?void 0:u.size)||"md",fontSize:((d=W.sections.bottom.btnVoice)==null?void 0:d.fontSize)||12,icon:((f=W.sections.bottom.btnVoice)==null?void 0:f.icon)||{showIcon:!0,src:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 1.5C8.20156 1.5 7.5 2.20156 7.5 3V9C7.5 9.79844 8.20156 10.5 9 10.5C9.79844 10.5 10.5 9.79844 10.5 9V3C10.5 2.20156 9.79844 1.5 9 1.5Z" fill="currentColor"/><path d="M13.5 7.5C13.0852 7.5 12.75 7.83516 12.75 8.25V9C12.75 10.2422 11.7422 11.25 10.5 11.25C9.25781 11.25 8.25 10.2422 8.25 9V8.25C8.25 7.83516 7.91484 7.5 7.5 7.5C7.08516 7.5 6.75 7.83516 6.75 8.25V9C6.75 10.8609 8.13906 12.375 9.9375 12.6562V14.25H7.5C7.08516 14.25 6.75 14.5852 6.75 15C6.75 15.4148 7.08516 15.75 7.5 15.75H10.5C10.9148 15.75 11.25 15.4148 11.25 15C11.25 14.5852 10.9148 14.25 10.5 14.25H10.3125V12.6562C12.1109 12.375 13.5 10.8609 13.5 9V8.25C13.5 7.83516 13.1648 7.5 12.75 7.5Z" fill="currentColor"/></svg>',color:"#fff",size:18}},p.sections.bottom.btnVoice.bgColor||(p.sections.bottom.btnVoice.bgColor=W.sections.bottom.btnVoice.bgColor,g.push(`Добавлено поле bgColor для btnVoice: '${p.sections.bottom.btnVoice.bgColor}'`)),g.push("Добавлен btnVoice в sections.bottom")),this.createSuccessResult(p,g)}catch(p){return this.createErrorResult([`Ошибка при добавлении btnVoice: ${p}`])}}}const ei=[new Nc,new Fc,new Kc,new Wc,new Uc];function ti(n,e){return n==="3.0"&&e==="3.1"?ei.map(s=>{const r=Object.create(s);return r.appliesTo={from:"3.0",to:"3.1"},r}):[...Ic,...ei].filter(s=>s.appliesTo.from===n&&s.appliesTo.to===e)}class Hc{constructor(){this.name="DetectVersion",this.description="Определяет версию конфигурации"}execute(e){try{const s=new ar().detect(e);return s?{success:!0,data:{version:s,config:e},errors:[],warnings:[],modified:!1}:{success:!1,errors:["Не удалось определить версию конфигурации"],warnings:[],modified:!1}}catch(t){return{success:!1,errors:[`Ошибка при детекции версии: ${t}`],warnings:[],modified:!1}}}}class jc{constructor(){this.name="ValidateConfig",this.description="Валидирует конфигурацию для указанной версии"}execute(e,t){try{const r=new Zc().validate(e,t.version);return{success:r.isValid,data:{validationResult:r,config:e},errors:r.errors,warnings:r.warnings,modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при валидации: ${s}`],warnings:[],modified:!1}}}}class qc{constructor(){this.name="CleanConfig",this.description="Очищает конфигурацию от неизвестных полей для указанной версии"}execute(e,t){try{return t.preserveUnknown?{success:!0,data:e,errors:[],warnings:["Очистка пропущена - preserveUnknown: true"],modified:!1}:{success:!0,data:this.cleanConfigForVersion(e,t.version),errors:[],warnings:["Конфигурация очищена от неизвестных полей"],modified:!0}}catch(s){return{success:!1,errors:[`Ошибка при очистке конфигурации: ${s}`],warnings:[],modified:!1}}}cleanConfigForVersion(e,t){return{...e}}}class Gc{constructor(){this.name="BackupConfig",this.description="Создает резервную копию конфигурации"}execute(e,t){try{const s=t!=null&&t.timestamp?Date.now():void 0;return{success:!0,data:{backup:{original:JSON.parse(JSON.stringify(e)),timestamp:s||Date.now(),version:new ar().detect(e)},config:e},errors:[],warnings:[],modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при создании резервной копии: ${s}`],warnings:[],modified:!1}}}}class ar{detect(e){var t,s,r,i,o,a,c,u,d;try{return!e||!e.settings||!e.sections?null:((t=e==null?void 0:e.schema)==null?void 0:t.version)==="3.1"?"3.1":[e.settings.theme!==void 0,e.settings.container!==void 0,((s=e.sections.top.params)==null?void 0:s.border)!==void 0,((r=e.sections.top.params)==null?void 0:r.sideMargin)!==void 0,((i=e.sections.top.params)==null?void 0:i.borderRadius)!==void 0,e.sections.inside.dataAction!==void 0,e.sections.bottom.btnVoice!==void 0,((o=e.sections.inside.welcomeMessage)==null?void 0:o.borderColor)!==void 0].filter(Boolean).length>=3?((a=e==null?void 0:e.schema)==null?void 0:a.version)==="3.1"?"3.1":"3.0":[e.settings.loader!==void 0,e.settings.buttonStyle!==void 0,e.settings.buttonType!==void 0,((c=e.sections.top.params)==null?void 0:c.chipStyle)!==void 0,((u=e.sections.inside.messageUser)==null?void 0:u.bgType)!==void 0,e.sections.inside.aprooveButton!==void 0,((d=e.sections.bottom.inputSend)==null?void 0:d.borderStyle)!==void 0,e.sections.bottom.warningAlert!==void 0,e.sections.bottom.disclaimer!==void 0].filter(Boolean).length>=3?"2.0":[e.settings.widgetTitle!==void 0,e.settings.bgChat!==void 0,e.sections.top!==void 0,e.sections.inside!==void 0,e.sections.bottom!==void 0].every(Boolean)?"1.0":null}catch(f){return console.error("Ошибка при детекции версии:",f),null}}}class Zc{validate(e,t){const s=[],r=[];try{if(!e)return s.push("Конфигурация не может быть пустой"),{isValid:!1,errors:s,warnings:r};switch(e.settings||s.push("Отсутствует секция settings"),e.sections||s.push("Отсутствует секция sections"),e.sections&&(e.sections.top||s.push("Отсутствует секция sections.top"),e.sections.inside||s.push("Отсутствует секция sections.inside"),e.sections.bottom||s.push("Отсутствует секция sections.bottom")),t){case"1.0":this.validateV1(e,s,r);break;case"2.0":this.validateV2(e,s,r);break;case"3.0":case"3.1":this.validateV3(e,s,r);break;default:r.push(`Валидация для версии ${t} не реализована`)}return{isValid:s.length===0,errors:s,warnings:r}}catch(i){return s.push(`Ошибка при валидации: ${i}`),{isValid:!1,errors:s,warnings:r}}}validateV1(e,t,s){const r=["settings.widgetTitle","settings.welcomeMessage","settings.bgChat"];for(const i of r)this.getNestedValue(e,i)||t.push(`Отсутствует обязательное поле: ${i}`)}validateV2(e,t,s){this.validateV1(e,t,s);const r=["settings.loader","settings.buttonStyle","sections.inside.aprooveButton","sections.bottom.warningAlert"];for(const i of r)this.getNestedValue(e,i)||s.push(`Рекомендуется добавить поле V2: ${i}`)}validateV3(e,t,s){var i;this.validateV2(e,t,s);const r=["settings.theme","settings.container","sections.top.params.border","sections.top.params.sideMargin","sections.top.params.borderRadius","sections.inside.dataAction","sections.bottom.btnVoice"];for(const o of r)this.getNestedValue(e,o)||s.push(`Рекомендуется добавить поле V3: ${o}`);(i=e.settings)!=null&&i.container&&(e.settings.container.innerBorder||s.push("settings.container.innerBorder рекомендуется добавить"),e.settings.container.outerBorder||s.push("settings.container.outerBorder рекомендуется добавить"),e.settings.container.gradient||s.push("settings.container.gradient is recommended to add"))}getNestedValue(e,t){return t.split(".").reduce((s,r)=>s==null?void 0:s[r],e)}}class Eo{static createCommand(e){const t=this.commands.get(e);return t?t():null}static getAllCommands(){return Array.from(this.commands.keys())}static registerCommand(e,t){this.commands.set(e,t)}}Eo.commands=new Map([["DetectVersion",()=>new Hc],["ValidateConfig",()=>new jc],["CleanConfig",()=>new qc],["BackupConfig",()=>new Gc]]);const qt=["1.0","2.0","3.0","3.1"],Yc=qt[qt.length-1];class Ao{constructor(e=!1){this.verbose=e}info(e,t){this.verbose&&console.log(`[INFO] ${e}`,t?JSON.stringify(t,null,2):"")}warn(e,t){console.warn(`[WARN] ${e}`,t?JSON.stringify(t,null,2):"")}error(e,t){console.error(`[ERROR] ${e}`,t?JSON.stringify(t,null,2):"")}debug(e,t){this.verbose&&console.debug(`[DEBUG] ${e}`,t?JSON.stringify(t,null,2):"")}}class Xc{constructor(e){this.logger=e||new Ao,this.versionDetector=new ar}setSchemaVersion(e,t){if(!e||typeof e!="object")return;const s=e.schema;if(!s||typeof s!="object"){e.schema={version:t,required:[]};return}s.version=t,Array.isArray(s.required)||(s.required=[])}async migrate(e,t,s={}){const r=Date.now();this.logger.info(`Начинаем миграцию к версии ${t}`);try{const i=this.versionDetector.detect(e);if(!i)return this.createErrorResult("Не удалось определить версию исходной конфигурации",r);if(this.logger.info(`Определена исходная версия: ${i}`),i===t)return this.logger.info("Конфигурация уже соответствует целевой версии"),this.createSuccessResult(e,i,t,[],r);const o=this.buildMigrationPath(i,t);if(o.length===0)return this.createErrorResult(`Не найден путь миграции с ${i} на ${t}`,r);this.logger.info(`План миграции: ${o.map(f=>`${f.from} -> ${f.to}`).join(" -> ")}`);let a=e;const c=[],u=[];for(const f of o){const p=await this.executeStep(a,f.from,f.to,s);if(!p.success)return this.createErrorResult(`Ошибка на шаге ${f.from} -> ${f.to}: ${p.errors.join(", ")}`,r,p.errors);a=p.data,c.push(...p.appliedStrategies),u.push(...p.warnings)}this.setSchemaVersion(a,t);const d=Eo.createCommand("ValidateConfig");if(d){const f=d.execute(a,{version:t});if(!f.success&&s.strict)return this.createErrorResult(`Валидация не прошла: ${f.errors.join(", ")}`,r,f.errors);u.push(...f.warnings)}return this.logger.info("Миграция успешно завершена"),this.createSuccessResult(a,i,t,c,r,u)}catch(i){return this.logger.error("Критическая ошибка при миграции",i),this.createErrorResult(`Критическая ошибка: ${i}`,r)}}async dryRun(e,t,s={}){const r=Date.now();try{const i=this.versionDetector.detect(e);if(!i)return this.createFailedReport(r,"unknown",t,"Не удалось определить версию");const a=this.buildMigrationPath(i,t).flatMap(c=>ti(c.from,c.to));return{timestamp:new Date,fromVersion:i,toVersion:t,success:!0,duration:Date.now()-r,appliedStrategies:a.map(c=>({name:c.name,success:!0,errors:[],warnings:[]})),totalErrors:0,totalWarnings:0,summary:`Будет применено ${a.length} стратегий для миграции с ${i} на ${t}`}}catch(i){return this.createFailedReport(r,"unknown",t,`Ошибка: ${i}`)}}async executeStep(e,t,s,r){var p,g;const i=Date.now();this.logger.info(`Выполняем шаг: ${t} -> ${s}`);let o=ti(t,s);if((p=r.onlyStrategies)!=null&&p.length&&(o=o.filter(b=>r.onlyStrategies.includes(b.name))),(g=r.excludeStrategies)!=null&&g.length&&(o=o.filter(b=>!r.excludeStrategies.includes(b.name))),o.length===0)return this.createErrorResult(`Не найдено стратегий для миграции ${t} -> ${s}`,i);const a={fromVersion:t,toVersion:s,config:e,options:r};let c={...e};const u=[],d=[],f=[];for(const b of o){if(this.logger.debug(`Применяем стратегию: ${b.name}`),!b.canApply({...a,config:c})){this.logger.debug(`Стратегия ${b.name} не применима, пропускаем`);continue}const h=b.apply({...a,config:c});if(h.success)h.modified&&h.data&&(c=h.data),u.push(b.name),f.push(...h.warnings),this.logger.debug(`Стратегия ${b.name} успешно применена`);else if(this.logger.error(`Стратегия ${b.name} завершилась с ошибкой`,h.errors),d.push(...h.errors),r.strict)return this.createErrorResult(`Стратегия ${b.name} завершилась с ошибкой: ${h.errors.join(", ")}`,i,d)}return this.createSuccessResult(c,t,s,u,i,f,d)}buildMigrationPath(e,t){const s=qt.indexOf(e),r=qt.indexOf(t);if(s===-1||r===-1)return[];const i=[];if(s<r)for(let o=s;o<r;o++)i.push({from:qt[o],to:qt[o+1]});else if(s>r)return[];return i}createSuccessResult(e,t,s,r,i,o=[],a=[]){return{success:!0,data:e,errors:a,warnings:o,fromVersion:t,toVersion:s,appliedStrategies:r}}createErrorResult(e,t,s=[]){return{success:!1,errors:[e,...s],warnings:[],fromVersion:"unknown",toVersion:"unknown",appliedStrategies:[]}}createFailedReport(e,t,s,r){return{timestamp:new Date,fromVersion:t,toVersion:s,success:!1,duration:Date.now()-e,appliedStrategies:[],totalErrors:1,totalWarnings:0,summary:r}}}class Qc{constructor(e=!0){const t=new Ao(e);this.migrator=new Xc(t)}async migrateV1toV2(e,t){return this.migrator.migrate(e,"2.0",t)}async migrateV2toV3(e,t){return this.migrator.migrate(e,"3.0",t)}async migrateToLatest(e,t){return this.migrator.migrate(e,Yc,t)}async migrate(e,t,s){return this.migrator.migrate(e,t,s)}async preview(e,t,s){return this.migrator.dryRun(e,t,s)}async canMigrate(e,t){try{return(await this.preview(e,t)).success}catch{return!1}}}const Jc=new Qc;async function eu(n,e){try{const t=await Jc.migrateToLatest(n,e);return t.success?t.data:null}catch{return null}}const et=n=>typeof n=="string"&&n.length>=0,si=n=>typeof n=="number"&&!Number.isNaN(n),us=(n,e)=>typeof n=="string"&&e.includes(n);function tu(n){var u,d,f,p,g,b,h;const e=[];if(!n||typeof n!="object")return{isValid:!1,errors:["config: must be an object"]};const t=n.settings||{};si(t.letterSpacing)||t.letterSpacing===void 0||e.push("settings.letterSpacing: number"),et(t.bgChat)||t.bgChat===void 0||e.push("settings.bgChat: string"),et(t.fontFamily)||t.fontFamily===void 0||e.push("settings.fontFamily: string"),si(t.fontWeight)||t.fontWeight===void 0||e.push("settings.fontWeight: number"),t.logo===void 0||et(t.logo)||e.push("settings.logo: string (svg or url)"),t.widgetTitle===void 0||et(t.widgetTitle)||e.push("settings.widgetTitle: string"),t.position===void 0&&e.push("settings.position: undefined");const s=n.texts||{};s.launchIssueTitle===void 0||et(s.launchIssueTitle)||e.push("texts.launchIssueTitle: string"),s.issueText===void 0||et(s.issueText)||e.push("texts.issueText: string"),s.widgetTitle===void 0||et(s.widgetTitle)||e.push("texts.widgetTitle: string"),s.hideText===void 0||et(s.hideText)||e.push("texts.hideText: string");const r=((u=n.sections)==null?void 0:u.top)||{},i=r.params||{};i.size===void 0||us(i.size,["sm","md","lg"])||e.push("sections.top.params.size: sm|md|lg"),i.chipStyle===void 0||us(i.chipStyle,["filled","outlined","invisible"])||e.push("sections.top.params.chipStyle: filled|outlined|invisible"),i.buttonStyle===void 0||us(i.buttonStyle,["filled","outlined","invisible"])||e.push("sections.top.params.buttonStyle: filled|outlined|invisible"),i.buttonType===void 0||us(i.buttonType,["icon","text","both"])||e.push("sections.top.params.buttonType: icon|text|both"),((d=r==null?void 0:r.chipWidgetTitle)==null?void 0:d.color)===void 0||et((f=r==null?void 0:r.chipWidgetTitle)==null?void 0:f.color)||e.push("sections.top.chipWidgetTitle.color: string"),((p=r==null?void 0:r.chipWidgetTitle)==null?void 0:p.bgColor)===void 0||et((g=r==null?void 0:r.chipWidgetTitle)==null?void 0:g.bgColor)||e.push("sections.top.chipWidgetTitle.bgColor: string"),(r==null?void 0:r.btnClose)===void 0||typeof(r==null?void 0:r.btnClose)=="object"||e.push("sections.top.btnClose: object");const a=(((b=n.sections)==null?void 0:b.bottom)||{}).params||{};a.size===void 0||us(a.size,["sm","md","lg"])||e.push("sections.bottom.params.size: sm|md|lg");const c=((h=n.sections)==null?void 0:h.warnings)||{};return c.launchIssue===void 0||typeof c.launchIssue=="object"||e.push("sections.warnings.launchIssue: object"),c.connectionIssue===void 0||typeof c.connectionIssue=="object"||e.push("sections.warnings.connectionIssue: object"),{isValid:e.length===0,errors:e}}class su{constructor(e){I(this,"config");this.config=e}getFlatRecursiveConfig(e,t="",s={}){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const i=e[r],o=t?`${t}.${r}`:r;i!==null&&typeof i=="object"&&!Array.isArray(i)?this.getFlatRecursiveConfig(i,o,s):s[o]=i}return s}get configFlat(){return this.getFlatRecursiveConfig(this.config)}getConfig(){return this.config}getKey(e){return this.configFlat[e]??void 0}getKeyObject(e){return e.split(".").reduce((t,s)=>t&&t[s]!==void 0?t[s]:"undefined",this.config)}}const $n={sm:"tw:h-[20px] tw:px-1.5 tw:py-0 tw:[font-size:10px] [&_svg]:tw:size-4",md:"tw:h-[24px] tw:px-2 tw:py-1 tw:text-xs [&_svg]:tw:size-4.5",lg:"tw:h-[28px] tw:px-3 tw:py-1 tw:text-sm [&_svg]:tw:size-5"};function Ln(n){return n==="sm"||n==="md"||n==="lg"?$n[n]:$n.md}function lr(n,e){try{const s={top:"sections.top.params.size",inside:"sections.inside.params.size",bottom:"sections.bottom.params.size"}[e],r=n==null?void 0:n.getKey(s);return Ln(r)}catch{return $n.md}}const nu=["aria-expanded"],ru=["innerHTML"],iu=["src","alt"],ou={key:2},au={key:0,class:"tw:flex tw:items-center tw:w-full tw:justify-end tw:gap-1.5 header-buttons"},lu=["width","height"],cu={key:1},uu=["width","height"],du={key:1},hu=l.defineComponent({__name:"ChatHeader",props:{isChatOpen:{type:Boolean},toggleChat:{type:Function},configDesignClass:{},sectionBorderRadius:{},mainBorderRadius:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},restartChat:{type:Function}},setup(n){const e=n,t=l.computed(()=>e.configDesignClass.getKeyObject("sections.top.params")),s=l.computed(()=>lr(e.configDesignClass,"top")),r=(m,x="px")=>typeof m=="number"?`${m}${x}`:m,i=l.computed(()=>{let m="";switch(t.value.bgStyle){case"gradient":m=`linear-gradient(180deg, ${t.value.bgColor} 0%, ${e.configDesignClass.getKey("settings.bgChat")} 100%)`;break;case"filled":m=t.value.bgColor;break;case"invisible":m="transparent";break;default:m="transparent";break}const k=!!e.configDesignClass.getKey("settings.globalRoundingRadius")?`${e.mainBorderRadius}px`:r(t.value.borderRadius),w=e.configDesignClass.getKey("settings.container.gradient"),C=t.value.border,v=(C==null?void 0:C.width)>0?`${C.width}px solid ${C.color}`:"none",y=`${t.value.sideMargin}px`;return{borderTopLeftRadius:t.value.bgStyle==="invisible"?0:k,borderTopRightRadius:t.value.bgStyle==="invisible"?0:k,borderBottomLeftRadius:t.value.bgStyle==="invisible"?0:w&&w!=="transparent"?k:0,borderBottomRightRadius:t.value.bgStyle==="invisible"?0:w&&w!=="transparent"?k:0,background:m,padding:`${t.value.paddingVertical}px ${t.value.paddingHorizontal}px`,margin:y,maxWidth:`calc(100% - ${y} * 2)`,borderBottom:v}}),o=l.computed(()=>{const m=e.configDesignClass.getKey("texts.widgetTitle"),x=e.configDesignClass.getKey("settings.widgetTitle");return m&&m!=="undefined"?m:x&&x!=="undefined"?x:""}),a=l.computed(()=>e.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")),c=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.chipStyle"),x=e.configDesignClass.getKey("sections.top.chipWidgetTitle.color"),k=e.configDesignClass.getKey("sections.top.chipWidgetTitle.bgColor"),w=m==="outlined",C=m==="filled",v=m==="invisible";return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.chipWidgetTitle.borderRadius")+"px",color:x,border:w?`1px solid ${k}`:"none",padding:v?"0px":null,"background-color":C?k:"transparent"}}),u=l.computed(()=>e.configDesignClass.getKey("sections.top.buttons.showType")),d=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.buttons.showType");return m&&m!=="undefined"?m:"icon"}),f=l.computed(()=>{const m=e.configDesignClass.getKeyObject("sections.top.buttons");return{color:(m==null?void 0:m.color)??"#fff",bgColor:(m==null?void 0:m.bgColor)??"#000"}}),p=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.buttonStyle"),x=m==="outlined",k=m==="invisible",w=f.value;return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.buttons.borderRadius")+"px",color:w.color,border:x?`1px solid ${w.bgColor}`:"none",padding:k?"0px":null,"background-color":k?"transparent":m==="filled"?w.bgColor:"transparent"}}),g=l.computed(()=>{const m=e.configDesignClass.getKey("texts.hideText");return m&&m!=="undefined"?m:"Hide"}),b=l.computed(()=>e.configDesignClass.getKey("settings.logo").includes("<svg")),h=l.computed(()=>e.configDesignClass.getKey("settings.logo"));return(m,x)=>(l.openBlock(),l.createElementBlock("div",{onClick:x[0]||(x[0]=(...k)=>n.toggleChat&&n.toggleChat(...k)),class:"chat-action tw:transition-all tw:cursor-pointer tw:flex tw:items-center tw:w-full tw:justify-start",style:l.normalizeStyle(i.value),role:"button","aria-expanded":n.isChatOpen},[l.createVNode(l.unref(ht),{class:l.normalizeClass(["tw:transition-all tw:flex tw:items-center tw:shadow-none header-title",s.value]),variant:a.value,size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(c.value),type:"button","aria-label":o.value,title:o.value},{default:l.withCtx(()=>[b.value&&n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["header-logo",n.configDesignClass.getKey("sections.top.params.size")]),innerHTML:h.value},null,10,ru)):h.value&&n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("img",{key:1,src:h.value,alt:n.configDesignClass.getKey("sections.top.iconWidget.alt"),class:l.normalizeClass(n.configDesignClass.getKey("sections.top.params.size")==="sm"?"tw:w-3 tw:h-3":"tw:w-4 tw:h-4")},null,10,iu)):l.createCommentVNode("",!0),n.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="icon"?(l.openBlock(),l.createElementBlock("span",ou,l.toDisplayString(o.value),1)):l.createCommentVNode("",!0)]),_:1},8,["class","variant","size","style","aria-label","title"]),n.isChatOpen?(l.openBlock(),l.createElementBlock("div",au,[l.createVNode(l.unref(ht),{variant:u.value,class:l.normalizeClass(["tw:transition-all",[s.value]]),size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(p.value),type:"button","aria-label":g.value,title:g.value,onClick:l.withModifiers(n.restartChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...x[1]||(x[1]=[l.createElementVNode("path",{d:"M10.7935 1.33333H5.20683C2.78016 1.33333 1.3335 2.77999 1.3335 5.20666V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7933V5.20666C14.6668 2.77999 13.2202 1.33333 10.7935 1.33333ZM8.00016 12.1667C6.80683 12.1667 5.8735 11.5733 5.24016 10.9867V11.46C5.24016 11.7333 5.0135 11.96 4.74016 11.96C4.46683 11.96 4.24016 11.7333 4.24016 11.46V9.62666C4.24016 9.35333 4.46683 9.12666 4.74016 9.12666H6.3935C6.66683 9.12666 6.8935 9.35333 6.8935 9.62666C6.8935 9.89999 6.66683 10.1267 6.3935 10.1267H5.7935C6.28683 10.62 7.0535 11.1667 8.00016 11.1667C9.74683 11.1667 11.1668 9.74666 11.1668 8C11.1668 7.72666 11.3935 7.5 11.6668 7.5C11.9402 7.5 12.1668 7.72666 12.1668 8C12.1668 10.3 10.3002 12.1667 8.00016 12.1667ZM12.1668 6.35999C12.1668 6.37999 12.1668 6.39999 12.1668 6.41333C12.1602 6.48666 12.1402 6.55333 12.1068 6.61333C12.0735 6.67333 12.0268 6.72666 11.9668 6.77333C11.9202 6.80666 11.8668 6.83333 11.8068 6.85333C11.7602 6.86666 11.7135 6.87333 11.6668 6.87333H10.0468C9.7735 6.87333 9.54683 6.64666 9.54683 6.37333C9.54683 6.1 9.7735 5.87333 10.0468 5.87333H10.6002C10.0668 5.38 9.20683 4.83333 8.0135 4.83333C6.26683 4.83333 4.84683 6.25333 4.84683 8C4.84683 8.27333 4.62016 8.5 4.34683 8.5C4.0735 8.5 3.8335 8.27333 3.8335 8C3.8335 5.7 5.70016 3.83333 8.00016 3.83333C9.4335 3.83333 10.4868 4.45333 11.1668 5.04666V4.53999C11.1668 4.26666 11.3935 4.03999 11.6668 4.03999C11.9402 4.03999 12.1668 4.26666 12.1668 4.53999V6.35999Z",fill:"currentColor"},null,-1)])],8,lu)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",cu," Restart ")):l.createCommentVNode("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"]),l.createVNode(l.unref(ht),{variant:u.value,class:l.normalizeClass(["tw:transition-all",[s.value]]),size:n.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(p.value),type:"button","aria-label":g.value,title:g.value,onClick:l.withModifiers(n.toggleChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:n.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...x[2]||(x[2]=[l.createElementVNode("path",{d:"M10.7935 1.33337H5.20683C2.78016 1.33337 1.3335 2.78004 1.3335 5.20671V10.7867C1.3335 13.22 2.78016 14.6667 5.20683 14.6667H10.7868C13.2135 14.6667 14.6602 13.22 14.6602 10.7934V5.20671C14.6668 2.78004 13.2202 1.33337 10.7935 1.33337ZM12.3335 10.9334C12.3335 11.9334 11.9335 12.3334 10.9335 12.3334H8.40016C7.40016 12.3334 7.00016 11.9334 7.00016 10.9334V9.73337C7.00016 8.73337 7.40016 8.33337 8.40016 8.33337H10.9335C11.9335 8.33337 12.3335 8.73337 12.3335 9.73337V10.9334Z",fill:"currentColor"},null,-1)])],8,uu)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",du,l.toDisplayString(g.value),1)):l.createCommentVNode("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"])])):l.createCommentVNode("",!0)],12,nu))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fu=n=>typeof n<"u";function gu(n){return JSON.parse(JSON.stringify(n))}function Po(n,e,t,s={}){var r,i,o;const{clone:a=!1,passive:c=!1,eventName:u,deep:d=!1,defaultValue:f,shouldEmit:p}=s,g=l.getCurrentInstance(),b=t||(g==null?void 0:g.emit)||((r=g==null?void 0:g.$emit)==null?void 0:r.bind(g))||((o=(i=g==null?void 0:g.proxy)==null?void 0:i.$emit)==null?void 0:o.bind(g==null?void 0:g.proxy));let h=u;e||(e="modelValue"),h=h||`update:${e.toString()}`;const m=w=>a?typeof a=="function"?a(w):gu(w):w,x=()=>fu(n[e])?m(n[e]):f,k=w=>{p?p(w)&&b(h,w):b(h,w)};if(c){const w=x(),C=l.ref(w);let v=!1;return l.watch(()=>n[e],y=>{v||(v=!0,C.value=m(y),l.nextTick(()=>v=!1))}),l.watch(C,y=>{!v&&(y!==n[e]||d)&&k(y)},{deep:d}),C}else return l.computed({get(){return x()},set(w){k(w)}})}const pu=l.defineComponent({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=Po(t,"modelValue",e,{passive:!0,defaultValue:t.defaultValue});return(i,o)=>l.withDirectives((l.openBlock(),l.createElementBlock("textarea",{"onUpdate:modelValue":o[0]||(o[0]=a=>l.isRef(r)?r.value=a:null),style:{resize:"none"},"data-slot":"textarea",class:l.normalizeClass(l.unref(Kn)("tw:md:text-sm",t.class))},null,2)),[[l.vModelText,l.unref(r)]])}}),mu=l.defineComponent({__name:"Tooltip",props:{text:{},show:{type:Boolean},position:{default:"top"},maxWidth:{default:"200px"}},setup(n){const e=n,t=l.computed(()=>{const s="tw:absolute tw:pointer-events-none";switch(e.position){case"top":return`${s} tw:bottom-full tw:left-1/2 tw:-translate-x-1/2 tw:mb-2`;case"bottom":return`${s} tw:top-full tw:left-1/2 tw:-translate-x-1/2 tw:mt-2`;case"left":return`${s} tw:right-full tw:top-1/2 tw:-translate-y-1/2 tw:mr-2`;case"right":return`${s} tw:left-full tw:top-1/2 tw:-translate-y-1/2 tw:ml-2`;default:return`${s} tw:bottom-full tw:left-1/2 tw:-translate-x-1/2 tw:mb-2`}});return(s,r)=>n.text?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass([t.value,"tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-[9999]",{"tw:opacity-100":n.show}]),style:l.normalizeStyle({maxWidth:n.maxWidth}),role:"tooltip"},l.toDisplayString(n.text),7)):l.createCommentVNode("",!0)}}),wu=["innerHTML"],bu=["width","height"],yu=["width","height"],vu=["width","height"],xu={key:4,class:"tw:absolute tw:-top-6 tw:-translate-x-1/2 tw:left-1/2 tw:text-xs tw:text-white tw:bg-red-500 tw:px-2 tw:py-0.5 tw:rounded-full tw:whitespace-nowrap"},ni=l.defineComponent({__name:"VoiceButton",props:{isRecording:{type:Boolean},isTranscribing:{type:Boolean},isPreview:{type:Boolean},disabled:{type:Boolean},formattedDuration:{},color:{},bgColor:{},borderRadius:{},iconSrc:{},iconSize:{},type:{},showType:{}},emits:["toggle"],setup(n){const e=n,t=l.computed(()=>{const r=e.iconSize;return typeof r=="number"&&Number.isFinite(r)?Math.max(1,r):r==="sm"?16:r==="lg"?24:20}),s=l.computed(()=>`${t.value}px`);return(r,i)=>(l.openBlock(),l.createBlock(l.unref(ht),{type:"button","data-voice-type":n.type,"data-voice-show-type":n.showType,class:l.normalizeClass(["btn-voice tw:relative tw:shadow-none tw:flex-shrink-0 tw:p-2 tw:transition-all tw:duration-200 hover:tw:brightness-110",{"voice-recording":n.isRecording},{"tw:opacity-50 tw:cursor-not-allowed":(n.isTranscribing||n.disabled)&&!n.isPreview}]),size:"icon",style:l.normalizeStyle({backgroundColor:n.isRecording?"#ef4444":n.bgColor,color:n.isRecording?"#fff":n.color,borderRadius:n.borderRadius}),disabled:n.isTranscribing||n.disabled,onClick:i[0]||(i[0]=o=>r.$emit("toggle")),title:n.isRecording?"Stop recording":"Start voice input"},{default:l.withCtx(()=>[!n.isRecording&&!n.isTranscribing&&n.iconSrc?(l.openBlock(),l.createElementBlock("div",{key:0,class:"svg-icon",style:l.normalizeStyle({width:s.value,height:s.value})},[l.createElementVNode("div",{innerHTML:n.iconSrc,style:l.normalizeStyle({width:s.value,height:s.value})},null,12,wu)],4)):!n.isRecording&&!n.isTranscribing?(l.openBlock(),l.createElementBlock("svg",{key:1,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...i[1]||(i[1]=[l.createElementVNode("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},null,-1),l.createElementVNode("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1),l.createElementVNode("line",{x1:"12",x2:"12",y1:"19",y2:"22"},null,-1)])],8,bu)):n.isRecording?(l.openBlock(),l.createElementBlock("svg",{key:2,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"currentColor"},[...i[2]||(i[2]=[l.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)])],8,yu)):(l.openBlock(),l.createElementBlock("svg",{key:3,width:t.value,height:t.value,viewBox:"0 0 24 24",fill:"none",class:"tw:animate-spin"},[...i[3]||(i[3]=[l.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2",opacity:"0.25"},null,-1),l.createElementVNode("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])],8,vu)),n.isRecording?(l.openBlock(),l.createElementBlock("span",xu,l.toDisplayString(n.formattedDuration),1)):l.createCommentVNode("",!0)]),_:1},8,["data-voice-type","data-voice-show-type","class","style","disabled","title"]))}});function Cu(n){var w;const e=()=>l.unref(n.transcribeUrl),t=l.ref(!1),s=l.ref(!1),r=l.ref(!0),i=l.ref(null),o=l.ref(0);let a=null,c=[],u=null,d=null;const f=n.maxDuration;(typeof navigator>"u"||!((w=navigator.mediaDevices)!=null&&w.getUserMedia))&&(r.value=!1);const p=()=>{const C=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];for(const v of C)if(MediaRecorder.isTypeSupported(v))return v;return"audio/webm"},g=async()=>{var C;if(!(!r.value||t.value))try{i.value=null,c=[],o.value=0,u=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:16e3}});const v=p();a=new MediaRecorder(u,{mimeType:v}),a.ondataavailable=y=>{y.data.size>0&&c.push(y.data)},a.onstop=async()=>{d&&(clearInterval(d),d=null);const y=new Blob(c,{type:v});u&&(u.getTracks().forEach(_=>_.stop()),u=null),await m(y)},a.onerror=()=>{i.value="Recording error",b()},a.start(250),t.value=!0,d=setInterval(()=>{o.value++,o.value>=f&&b()},1e3)}catch(v){v.name==="NotAllowedError"?i.value="Microphone access denied":v.name==="NotFoundError"?i.value="No microphone found":i.value=v.message||"Failed to start recording",i.value&&((C=n.onError)==null||C.call(n,i.value))}},b=()=>{a&&t.value&&(a.stop(),t.value=!1)},h=()=>{t.value?b():g()},m=async C=>{var y,_,T;s.value=!0,i.value=null;const v=e();if(!v){i.value="Transcribe URL not configured",(y=n.onError)==null||y.call(n,i.value),s.value=!1;return}try{const R=new FormData;R.append("audio",C,"recording.webm");const L=await fetch(v,{method:"POST",body:R});if(!L.ok)throw new Error(`HTTP ${L.status}`);const N=await L.json();if(N.success&&N.text)(_=n.onTranscript)==null||_.call(n,N.text);else throw new Error(N.error||"Transcription failed")}catch(R){i.value=R.message||"Transcription failed",i.value&&((T=n.onError)==null||T.call(n,i.value))}finally{s.value=!1}},x=l.computed(()=>{const C=Math.floor(o.value/60),v=o.value%60;return`${C}:${v.toString().padStart(2,"0")}`}),k=l.computed(()=>t.value||s.value);return{isRecording:t,isTranscribing:s,isSupported:r,isBusy:k,error:i,recordingDuration:o,formattedDuration:x,startRecording:g,stopRecording:b,toggleRecording:h}}class ku{constructor(e,t){I(this,"structure");I(this,"options");I(this,"html","");this.structure=e,this.options={escape:(t==null?void 0:t.escape)??!0,whitelistStyles:(t==null?void 0:t.whitelistStyles)??["color","background","borderColor","borderRadius"]}}build(e){return this.html=this.renderLayout(this.structure.layout,this.structure.bindings||{},e),this}buildStyle(e){return Object.entries(e).forEach(([t,s])=>{const r=Object.entries(s.style||{}).map(([o,a])=>`${o}: ${a};`).join(""),i=new RegExp(`(<\\w+)([^>]*)(data-visual="${this.escapeRegExp(t)}")([^>]*)(>)`,"g");this.html=this.html.replace(i,(o,a,c,u,d,f)=>{var w,C;const p=c+d,g=((w=p.match(/class="([^"]*)"/))==null?void 0:w[1])||"",b=((C=p.match(/style="([^"]*)"/))==null?void 0:C[1])||"",h=c.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),m=d.replace(/\s*class="[^"]*"/g,"").replace(/\s*style="[^"]*"/g,""),x=[g,s.class].filter(Boolean).join(" "),k=[b,r].filter(Boolean).join(" ");return`${a}${h}${m} class="${x}" style="${k}"${f}`})}),this}result(){return this.html}renderLayout(e,t,s){let r=e;return t&&(Object.entries(t).forEach(([i,o])=>{var c,u;const a=new RegExp(`\\{${this.escapeRegExp(i)}\\}`,"g");if(o.type==="text"){const d=(c=s==null?void 0:s[i])==null?void 0:c.text;r=r.replace(a,this.safeText(typeof d=="string"||typeof d=="number"?String(d):""));return}if(o.type==="button"){const d=(u=s==null?void 0:s[i])==null?void 0:u.text;r=r.replace(a,this.safeText(typeof d=="string"||typeof d=="number"?String(d):""));return}if(o.type==="repeater"){const d=Array.isArray(s==null?void 0:s[i])?s[i]:[],f=o.layout||"",p=o.bindings||{},g=d.map(b=>this.renderLayout(f,p,b)).join("");r=r.replace(a,g);return}}),r=r.replace(/style=\"([^\"]*)\"/g,(i,o)=>{const a=o.split(";").map(c=>c.trim()).filter(Boolean).filter(c=>{const[u]=c.split(":");return this.options.whitelistStyles.includes((u||"").trim())}).join("; ");return`style="${this.safeAttr(a)}"`})),r}safeText(e){return this.options.escape?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/'/g,"&#39;"):e}safeAttr(e){return this.safeText(e)}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}const Su={layout:'<div class="tw:flex tw:items-center tw:justify-between tw:w-full" data-visual="container"><div class="tw:flex tw:flex-col tw:gap-1"><span data-visual="headerChip" style="padding: 0 !important;">Action title</span><div data-visual="title">{title}</div></div><div class="tw:flex tw:gap-2"><button data-cb="confirm" data-visual="actionConfirm" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3337 4L6.00033 11.3333L2.66699 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button data-cb="cancel" data-visual="actionCancel" style="border-radius: 0 !important;" class="tw:rounded-full tw:w-8 tw:min-h-8 tw:flex tw:items-center tw:justify-center"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 4L4 12M4 4L12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>',bindings:{title:{type:"text"},actionConfirm:{type:"button"},actionCancel:{type:"button"}}};function _u(n){const e=l.computed(()=>{const w=n==null?void 0:n.getKeyObject("sections.inside.activeSnippet"),C=n==null?void 0:n.getKeyObject("sections.activeSnippet"),v=w&&w!=="undefined"?w:C;return v&&v!=="undefined"?v:{}}),t=(w,C)=>{if(!C)return w;switch(C){case"outlined":return{color:w.background,background:"transparent",border:`1px solid ${w.borderColor||w.background}`};case"invisible":return{color:w.background,background:"transparent"};default:return w}},s=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.bgColor")),r=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.color")),i=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.sidePadding")),o=l.computed(()=>n==null?void 0:n.getKey("sections.inside.activeSnippet.element.verticalSpacing")),a=l.computed(()=>(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderWidth"))+"px solid "+(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderColor"))),c=l.computed(()=>{var w,C,v,y,_,T,R,L;return{color:(C=(w=e.value)==null?void 0:w.headerChip)==null?void 0:C.color,background:(y=(v=e.value)==null?void 0:v.headerChip)==null?void 0:y.bgColor,borderColor:(T=(_=e.value)==null?void 0:_.headerChip)==null?void 0:T.borderColor,bgColor:(L=(R=e.value)==null?void 0:R.headerChip)==null?void 0:L.bgColor}}),u=l.computed(()=>{var w,C;return t(c.value,(C=(w=e.value)==null?void 0:w.headerChip)==null?void 0:C.bgType)}),d=l.computed(()=>{var w,C,v,y;return{...u.value,"border-radius":n!=null&&n.getKey("settings.globalRoundingRadius")?xs(n,2).borderRadius:((C=(w=e.value)==null?void 0:w.headerChip)==null?void 0:C.borderRadius)+"px","font-size":((y=(v=e.value)==null?void 0:v.headerChip)==null?void 0:y.fontSize)+"px"}}),f=l.computed(()=>{var w;return(w=e.value)==null?void 0:w.propertyColor}),p=l.computed(()=>{var w;return(w=e.value)==null?void 0:w.valueColor}),g=l.computed(()=>{var w,C,v,y;return{color:(C=(w=e.value)==null?void 0:w.yesButton)==null?void 0:C.color,background:(y=(v=e.value)==null?void 0:v.yesButton)==null?void 0:y.bgColor,borderRadius:"100px"}}),b=l.computed(()=>{var w,C,v,y;return{color:(C=(w=e.value)==null?void 0:w.noButton)==null?void 0:C.color,background:(y=(v=e.value)==null?void 0:v.noButton)==null?void 0:y.bgColor,borderRadius:"100px"}}),h=l.computed(()=>{const w=n==null?void 0:n.getKey("sections.inside.activeSnippet.params.size"),C=n==null?void 0:n.getKey("sections.inside.params.size");return Ln(w!=="undefined"?w:C)}),m=l.computed(()=>{const w=n==null?void 0:n.getKey("sections.inside.activeSnippet.headerChip.size");return Ln(w)}),x=w=>{const C=(w.id||"").toLowerCase(),y=C==="confirm"||C==="yes"?g.value:b.value,_=n==null?void 0:n.getKey("sections.inside.activeSnippet.params.buttonStyle");return t(y,_)},k=l.computed(()=>n!=null&&n.getKey("settings.globalRoundingRadius")?xs(n,8):{borderRadius:(n==null?void 0:n.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px"});return{containerBg:s,containerColor:r,sidePadding:i,verticalSpacing:o,headerChip:d,propertyColor:f,border:a,valueColor:p,yesButton:g,noButton:b,buttonStyle:x,getButtonStyle:t,actionBtnSizeClass:h,buttonRadiusStyle:k,chipSizeClass:m}}const Tu=["innerHTML"],Ru=l.defineComponent({__name:"DynamicSnippet",props:{structure:{},data:{},message:{},configDesignClass:{}},emits:["action"],setup(n,{emit:e}){const t=n,{containerBg:s,containerColor:r,headerChip:i,yesButton:o,noButton:a,actionBtnSizeClass:c,buttonRadiusStyle:u,verticalSpacing:d,sidePadding:f,valueColor:p,getButtonStyle:g,border:b,chipSizeClass:h}=_u(t.configDesignClass),m=l.computed(()=>{var y;return(y=t.configDesignClass)==null?void 0:y.getKey("sections.inside.activeSnippet.params.buttonStyle")}),x=l.computed(()=>{var y,_;return{background:s.value,color:r.value,"border-radius":(y=t.configDesignClass)!=null&&y.getKey("settings.globalRoundingRadius")?u.value.borderRadius:((_=t.configDesignClass)==null?void 0:_.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px",border:b.value,padding:`${f.value}px`,gap:`${d.value}px`}}),k=l.computed(()=>{var y,_,T;return{container:{style:x.value},headerChip:{style:{...i.value,height:"auto",padding:"0",background:"transparent"},class:h.value},actionConfirm:{class:c.value,style:{...g(o.value,m.value),flex:"1","line-height":"1","border-radius":"100px","font-size":((y=t.configDesignClass)==null?void 0:y.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}},title:{style:{color:p.value,"font-size":((_=t.configDesignClass)==null?void 0:_.getKey("sections.inside.activeSnippet.element.fontSize"))+"px"}},actionCancel:{class:c.value,style:{...g(a.value,m.value),flex:"1","line-height":"1","border-radius":"100px","font-size":((T=t.configDesignClass)==null?void 0:T.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}}}}),w=e,C=l.computed(()=>new ku(t.structure).build(t.data).buildStyle(k.value).result()),v=y=>{var L;const _=y.target;if(!_)return;const T=_.closest("[data-cb]"),R=T==null?void 0:T.getAttribute("data-cb");R&&((L=t.message.snippet)!=null&&L.sequence)&&w("action",R,t.message.snippet.sequence)};return(y,_)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:mt-1 tw:mb-1",onClick:v,innerHTML:C.value},null,8,Tu))}}),zu={key:0,class:"svg-icon"},Bu=["innerHTML"],Mu={key:1},yn=120,Eu=l.defineComponent({__name:"ChatBottom",props:{mainBorderRadius:{},isProduction:{type:Boolean},isPreview:{type:Boolean},configDesignClass:{},messageText:{},sendMessage:{type:Function},sectionBorderRadius:{},classSize:{},isInputDisabled:{type:Boolean},showReconnectNotice:{type:Boolean},restartChat:{type:Function},isStreaming:{type:Boolean},transcribeUrl:{},snippet:{}},emits:["update:messageText","trace","snippetAction"],setup(n,{emit:e}){const t=n,s=l.computed(()=>({text:"",isUser:!1,snippet:t.snippet?{sequence:t.snippet.sequence,id:t.snippet.id||"",data:t.snippet.data}:void 0})),r=l.computed(()=>{var V;return t.transcribeUrl||((V=t.configDesignClass)==null?void 0:V.getKey("settings.transcribeUrl"))||""}),i=l.computed(()=>!!r.value),o=l.computed(()=>{var V,F;return((V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.color"))||((F=t.configDesignClass)==null?void 0:F.getKey("sections.bottom.inputSend.color"))||"#fff"}),a=l.computed(()=>{var V;return(V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.bgColor")}),c=l.computed(()=>{var V;return(V=t.configDesignClass)==null?void 0:V.getKeyObject("sections.bottom.inputSend")}),u=l.computed(()=>{var V;return((V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.icon.src"))||null}),d=l.computed(()=>{var V;return(V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.icon.size")}),f=l.computed(()=>{var O,ee,ue,_t;if(g.value==="icon")return((O=t.configDesignClass)==null?void 0:O.getKey("sections.bottom.btnVoice.borderRadius"))+"px";if(!!((ee=t.configDesignClass)!=null&&ee.getKey("settings.globalRoundingRadius")))return(ue=t.sectionBorderRadius)==null?void 0:ue.borderRadius;const F=(_t=t.configDesignClass)==null?void 0:_t.getKey("sections.bottom.btnVoice.borderRadius");return typeof F=="number"?`${F}px`:"9999px"}),p=l.computed(()=>{var V;return(V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.type")}),g=l.computed(()=>{var V;return(V=t.configDesignClass)==null?void 0:V.getKey("sections.bottom.btnVoice.showType")}),{isRecording:b,isTranscribing:h,isSupported:m,formattedDuration:x,toggleRecording:k}=Cu({transcribeUrl:r,maxDuration:60,onTranscript:V=>{y.value=V},onError:V=>{console.error("Voice recording error:",V)}}),w=()=>{t.sendMessage()},C=e,v=V=>{var F;(F=t.snippet)!=null&&F.sequence&&C("snippetAction",V,t.snippet.sequence)},y=Po(t,"messageText",C,{passive:!0}),_=l.computed(()=>{var F;const V=(F=t.configDesignClass)==null?void 0:F.getKey("sections.bottom.inputSend.inputStyle");return V==="stacked"||V==="elastic"||V==="inside"?V:"inside"}),T=l.computed(()=>_.value==="stacked"),R=l.computed(()=>_.value==="elastic"),L=l.ref(null),N=l.ref(!1),j=l.computed(()=>t.isInputDisabled&&N.value),Z=()=>{var F;const V=(F=L.value)==null?void 0:F.$el;return V instanceof HTMLTextAreaElement?V:null},se=()=>{if(!R.value)return;const V=Z();if(!V)return;V.style.height="auto";const F=Math.min(V.scrollHeight,yn);V.style.height=`${F}px`,V.style.overflowY=V.scrollHeight>yn?"auto":"hidden"},X=()=>{se()};l.watch([y,R],async()=>{await l.nextTick(),requestAnimationFrame(se)},{immediate:!0});const E=l.computed(()=>t.configDesignClass.getKeyObject("sections.bottom.btnSend")),G=l.computed(()=>lr(E.value,"bottom")),A=l.computed(()=>t.configDesignClass.getKey("sections.bottom.inputSend.size")),De=l.computed(()=>t.configDesignClass.getKey("sections.bottom.btnSend.icon.showIcon")?t.configDesignClass.getKey("sections.bottom.btnSend.icon.src"):null),Se=l.computed(()=>{const V=t.configDesignClass.getKey("texts.disclaimerText"),F=t.configDesignClass.getKey("texts.disclaimer"),O=V&&V!=="undefined"?V:F,ue=!!t.configDesignClass.getKey("sections.bottom.params.disclaimerShow");return O&&O!=="undefined"&&ue?O:""});return l.onMounted(()=>{}),(V,F)=>(l.openBlock(),l.createElementBlock("div",null,[n.snippet?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:transition-all tw:flex tw:flex-col tw:mt-2",style:l.normalizeStyle({padding:"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",marginBottom:n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createVNode(Ru,{structure:l.unref(Su),data:n.snippet.data,message:s.value,configDesignClass:n.configDesignClass,onAction:v},null,8,["structure","data","message","configDesignClass"])],4)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:transition-all tw:flex tw:flex-col tw:items-center tw:relative tw:mt-2",style:l.normalizeStyle({padding:T.value?"0":"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createElementVNode("div",{class:l.normalizeClass(["message-input tw:transition-all tw:flex-1 tw:w-full tw:p-0 tw:gap-[10px] tw:flex",[R.value?"tw:flex-1 tw:min-h-[56px] tw:items-center":n.classSize,T.value?"tw:flex-col tw:items-stretch tw:justify-between":R.value?"":" tw:items-end",A.value==="sm"?"tw:items-center":""]]),style:l.normalizeStyle({order:R.value?"1":void 0,...T.value?{borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.mainBorderRadius+"px":n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}:{borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"},"background-color":n.configDesignClass.getKey("sections.bottom.inputSend.bgColor"),"margin-bottom":T.value?"0px":n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",border:T.value?"none":`${n.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${n.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`,borderTop:`${n.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${n.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`})},[i.value&&l.unref(m)&&R.value?(l.openBlock(),l.createBlock(ni,{key:0,class:"tw:self-end",style:l.normalizeStyle({marginLeft:n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",marginTop:c.value.paddingVertical+"px",marginBottom:c.value.paddingVertical+"px"}),"is-recording":l.unref(b),"is-transcribing":l.unref(h),"is-preview":n.isPreview,disabled:n.isInputDisabled,"formatted-duration":l.unref(x),color:o.value,"bg-color":a.value,"border-radius":f.value,"icon-src":u.value,"icon-size":d.value,type:p.value,"show-type":g.value,onToggle:l.unref(k)},null,8,["style","is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.unref(pu),{class:l.normalizeClass(["tw:transition-all",["tw:w-full tw:outline-none tw:border-0 focus:tw:outline-none",T.value?"tw:h-auto rounded-none":"h-full"]]),placeholder:n.configDesignClass.getKey("texts.inputPlaceholder")||"Type question",rows:R.value?1:A.value==="sm"?2:A.value==="md"?3:4,key:n.configDesignClass.getKey("sections.bottom.inputSend.color"),ref_key:"messageTextareaRef",ref:L,modelValue:l.unref(y),"onUpdate:modelValue":F[0]||(F[0]=O=>l.isRef(y)?y.value=O:null),onKeyup:l.withKeys(l.withModifiers(w,["exact"]),["enter"]),onInput:X,style:l.normalizeStyle({alignSelf:T.value?"flex-start":"auto",color:n.configDesignClass.getKey("sections.bottom.inputSend.color"),fontSize:n.configDesignClass.getKey("sections.bottom.inputSend.fontSize")+"px",lineHeight:n.configDesignClass.getKey("settings.lineHeight"),padding:n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px "+n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",...R.value?{minHeight:n.configDesignClass.getKey("sections.bottom.inputSend.height")+"px",maxHeight:yn+"px",overflowY:"hidden",paddingLeft:"0px !important"}:{height:n.configDesignClass.getKey("sections.bottom.inputSend.height")+"px"}})},null,8,["placeholder","rows","modelValue","onKeyup","class","style"])),l.createElementVNode("div",{class:l.normalizeClass([T.value?"tw:flex tw:justify-end tw:items-center tw:gap-2":"tw:flex tw:ml-auto tw:items-center tw:gap-2",R.value?"tw:self-end":""]),style:l.normalizeStyle({marginBottom:n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px",marginLeft:T.value?n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px":"0",marginTop:R.value?n.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px":"0",marginRight:n.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px"})},[i.value&&l.unref(m)&&!R.value?(l.openBlock(),l.createBlock(ni,{key:0,"is-recording":l.unref(b),"is-transcribing":l.unref(h),"is-preview":n.isPreview,disabled:n.isInputDisabled,"formatted-duration":l.unref(x),color:o.value,"bg-color":a.value,"border-radius":f.value,"icon-src":u.value,"icon-size":d.value,type:p.value,"show-type":g.value,onToggle:l.unref(k)},null,8,["is-recording","is-transcribing","is-preview","disabled","formatted-duration","color","bg-color","border-radius","icon-src","icon-size","type","show-type","onToggle"])):l.createCommentVNode("",!0),T.value&&Se.value?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:text-[11px] tw:flex tw:items-center tw:text-center tw:w-full tw:justify-center",style:l.normalizeStyle({...n.sectionBorderRadius,fontSize:n.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",height:n.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:n.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(Se.value),5)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"tw:relative tw:flex-shrink-0",onMouseenter:F[1]||(F[1]=O=>N.value=!0),onMouseleave:F[2]||(F[2]=O=>N.value=!1)},[t.isInputDisabled?(l.openBlock(),l.createBlock(l.unref(mu),{key:0,text:"Need to register",show:j.value,position:"top"},null,8,["show"])):l.createCommentVNode("",!0),l.createVNode(l.unref(ht),{class:l.normalizeClass(["tw:transition-all",["btn-send tw:bg-transparent tw:shadow-none tw:flex-shrink-0 tw:items-center tw:gap-1",n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"tw:rounded-full":G.value,T.value?"":"tw:ml-auto",{"tw:opacity-50":(l.unref(y).trim()===""||n.isInputDisabled)&&!n.isPreview},{"tw:px-3 tw:py-2":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="md"},{"tw:px-2 tw:py-1":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="sm"},{"tw:px-4 tw:py-3":n.configDesignClass.getKey("sections.bottom.btnSend.size")==="lg"}]]),size:n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"icon":n.configDesignClass.getKey("sections.bottom.params.size"),onClick:w,style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.bottom.btnSend.color"),"background-color":n.configDesignClass.getKey("sections.bottom.btnSend.bgColor"),fontSize:n.configDesignClass.getKey("sections.bottom.btnSend.fontSize")+"px",border:n.configDesignClass.getKey("sections.bottom.btnSend.borderWidth")+"px solid "+n.configDesignClass.getKey("sections.bottom.btnSend.borderColor"),"pointer-events":n.isInputDisabled?"none":"auto"}),disabled:n.isInputDisabled},{default:l.withCtx(()=>[De.value?(l.openBlock(),l.createElementBlock("div",zu,[l.createElementVNode("div",{innerHTML:De.value,style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.bottom.btnSend.color"),width:n.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px",height:n.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px"})},null,12,Bu)])):l.createCommentVNode("",!0),n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="text"||n.configDesignClass.getKey("sections.bottom.btnSend.showType")==="both"?(l.openBlock(),l.createElementBlock("span",Mu,l.toDisplayString(n.configDesignClass.getKey("texts.sendButton")),1)):l.createCommentVNode("",!0)]),_:1},8,["size","class","style","disabled"])],32)],6)],6),!T.value&&Se.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:px-2 tw:mb-2 tw:flex tw:items-center tw:justify-center",style:l.normalizeStyle({...n.sectionBorderRadius,fontSize:n.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",order:R.value?0:2,height:n.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:n.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(Se.value),5)):l.createCommentVNode("",!0)],4))]))}});var oe=(n=>(n.Collapsed="collapsed",n.EmptyChat="empty",n.Messages="messages",n.ActionSnippet="action_snippet",n.LaunchIssue="launch_issue",n.ConnectionIssue="connection_issue",n.ReconnectingAttempt="reconnecting_attempt",n.InputBlocked="input_blocked",n.ActionLoader="action_loader",n.TracesMessage="traces_message",n.TracesWithMeta="traces_with_meta",n))(oe||{});const Ms=["Received the request","Processing request","Finalizing request"],Au=`
19
19
  <p>Here's a simple Markdown table with 4 columns and 3 rows:</p>
20
20
  <table>
21
21
  <thead>
@@ -45,48 +45,48 @@
45
45
  <td>Data 12</td>
46
46
  </tr>
47
47
  </tbody></table>
48
- <p>You can fill it with any data you like. </p>`;var Do=(n=>(n.UserMessage="Give me some action",n))(Do||{});class Ye{base(e){return{isChatOpen:!0,isChatActive:!0,messages:[],isConnectionError:!1,isProcessError:!1,isReconnectError:!1,isInputDisabled:!1,showWelcome:!1,useTypewriterAnimation:!1,blockSocket:!0,traceLastShown:!1,...e}}}class Eu extends Ye{constructor(){super(...arguments);F(this,"type",le.Collapsed)}getState(){return this.base({isChatOpen:!1})}}class ni extends Ye{constructor(){super(...arguments);F(this,"type",le.EmptyChat)}getState(){return this.base({showWelcome:!0,messages:[]})}}class Au extends Ye{constructor(){super(...arguments);F(this,"type",le.Messages)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!0,messages:[{text:r,isUser:!0},{text:Mu,isUser:!1}]})}}class Pu extends Ye{constructor(){super(...arguments);F(this,"type",le.ActionSnippet)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i={sequence:"38952101547613990",id:"38496103561174822",data:{actionCancel:{text:"Yes"},actionConfirm:{text:"No"},title:{text:"Do you really wanna do this?"}}},a=((s==null?void 0:s.traceSteps)??Ts).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...a,{text:"Here is system’s meaningful response",isUser:!1}],snippet:i})}}class Du extends Ye{constructor(){super(...arguments);F(this,"type",le.LaunchIssue)}getState(){return this.base({isConnectionError:!0})}}class Vu extends Ye{constructor(){super(...arguments);F(this,"type",le.ConnectionIssue)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ts).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isProcessError:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isProcessError:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class $u extends Ye{constructor(){super(...arguments);F(this,"type",le.ReconnectingAttempt)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ts).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class Lu extends Ye{constructor(){super(...arguments);F(this,"type",le.InputBlocked)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ts).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class Ou extends Ye{constructor(){super(...arguments);F(this,"type",le.ActionLoader)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!0,messages:[{text:r,isUser:!0}]})}}class Iu extends Ye{constructor(){super(...arguments);F(this,"type",le.TracesMessage)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",o=((s==null?void 0:s.traceSteps)??Ts).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({showWelcome:!0,messages:[{text:r,isUser:!0}],pendingTraces:o,traceAnimationDelay:s.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...o]})}}class Nu extends Ye{constructor(){super(...arguments);F(this,"type",le.TracesWithMeta)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=(s==null?void 0:s.traceSteps)??["Step One","API Schema Requested","API Call Conducted","API Call Conducted"],o=[{text:i[0],isUser:!1,isSystem:!0,type:"trace",meta:{step:1}},{text:i[1],isUser:!1,isSystem:!0,type:"trace",meta:{step:2,json:{status:"requested",endpoint:"/v1/schema"}}},{text:i[2],isUser:!1,isSystem:!0,type:"trace",meta:{step:3,json:{status:"ok",code:200}}},{text:i[3],isUser:!1,isSystem:!0,type:"trace"}];return s!=null&&s.animateTraces?this.base({showWelcome:!0,messages:[{text:r,isUser:!0}],pendingTraces:o,traceAnimationDelay:s.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...o]})}}class Fu{static create(e){switch(e){case le.Collapsed:case"collapsed":return new Eu;case le.EmptyChat:case"empty":return new ni;case le.Messages:case"messages":return new Au;case le.ActionSnippet:case"action_snippet":return new Pu;case le.LaunchIssue:case"launch_issue":return new Du;case le.ConnectionIssue:case"connection_issue":return new Vu;case le.ReconnectingAttempt:case"reconnecting_attempt":return new $u;case le.InputBlocked:case"input_blocked":return new Lu;case le.ActionLoader:case"action_loader":return new Ou;case le.TracesMessage:case"traces_message":return new Iu;case le.TracesWithMeta:case"traces_with_meta":return new Nu;default:return new ni}}}class ri{static getScenarioFromUrl(){try{return new URLSearchParams(window.location.search).get("scenario")??void 0}catch{return}}static getState(e,t,s){return{...Fu.create(e).getState(t,s),...s??{}}}}function Ku(n){const e=l.ref(!1),t=l.ref(!1),s=l.ref(null);let r=null,i=null;const o=()=>l.unref(n.ttsUrl),a=()=>{r&&(r.pause(),r.src="",r=null),i&&(URL.revokeObjectURL(i),i=null)},c=async f=>{const w=o();if(!w)throw s.value="TTS URL not configured",new Error(s.value);if(!(f!=null&&f.trim()))throw s.value="No text to speak",new Error(s.value);g(),t.value=!0,s.value=null;try{const h=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:f.trim(),voice:n.voice||"nova"})});if(!h.ok){const v=await h.json().catch(()=>({}));throw new Error(v.error||`TTS request failed: ${h.status}`)}const m=await h.blob();return i=URL.createObjectURL(m),new Promise((v,y)=>{r=new Audio(i),r.onplay=()=>{e.value=!0,t.value=!1},r.onended=()=>{e.value=!1,a(),v()},r.onerror=()=>{e.value=!1,t.value=!1,s.value="Audio playback failed",a(),y(s.value)},r.play().catch(b=>{t.value=!1,s.value=b.message,y(b)})})}catch(h){throw t.value=!1,s.value=h.message||"TTS failed",h}},u=()=>{r&&e.value&&(r.pause(),e.value=!1)},d=()=>{r&&!e.value&&(r.play(),e.value=!0)},g=()=>{e.value=!1,t.value=!1,a()},p=f=>{e.value?u():r&&r.paused&&r.currentTime>0?d():f&&c(f)};return l.onUnmounted(()=>{g()}),{isSpeaking:e,isLoading:t,error:s,speak:c,pause:u,resume:d,stop:g,toggle:p}}function lr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pt=lr();function Vo(n){Pt=n}var ms={exec:()=>null};function X(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Se.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var Wu=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Se={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Uu=/^(?:[ \t]*(?:\n|$))+/,Hu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ju=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cr=/(?:[*+-]|\d{1,9}[.)])/,$o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lo=X($o).replace(/bull/g,cr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Gu=X($o).replace(/bull/g,cr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ur=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zu=/^[^\n]+/,dr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yu=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xu=X(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cr).getRegex(),en="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",hr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qu=X("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",hr).replace("tag",en).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Oo=X(ur).replace("hr",Rs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",en).getRegex(),Ju=X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oo).getRegex(),gr={blockquote:Ju,code:Hu,def:Yu,fences:ju,heading:qu,hr:Rs,html:Qu,lheading:Lo,list:Xu,newline:Uu,paragraph:Oo,table:ms,text:Zu},ii=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",en).getRegex(),ed={...gr,lheading:Gu,table:ii,paragraph:X(ur).replace("hr",Rs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ii).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",en).getRegex()},td={...gr,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",hr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ms,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(ur).replace("hr",Rs).replace("heading",` *#{1,6} *[^
49
- ]`).replace("lheading",Lo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Io=/^( {2,}|\\)\n(?!\s*$)/,rd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tn=/[\p{P}\p{S}]/u,fr=/[\s\p{P}\p{S}]/u,No=/[^\s\p{P}\p{S}]/u,id=X(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fr).getRegex(),Fo=/(?!~)[\p{P}\p{S}]/u,od=/(?!~)[\s\p{P}\p{S}]/u,ad=/(?:[^\s\p{P}\p{S}]|~)/u,ld=X(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Wu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ko=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cd=X(Ko,"u").replace(/punct/g,tn).getRegex(),ud=X(Ko,"u").replace(/punct/g,Fo).getRegex(),Wo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dd=X(Wo,"gu").replace(/notPunctSpace/g,No).replace(/punctSpace/g,fr).replace(/punct/g,tn).getRegex(),hd=X(Wo,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,Fo).getRegex(),gd=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,No).replace(/punctSpace/g,fr).replace(/punct/g,tn).getRegex(),fd=X(/\\(punct)/,"gu").replace(/punct/g,tn).getRegex(),pd=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),md=X(hr).replace("(?:-->|$)","-->").getRegex(),wd=X("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",md).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,bd=X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Gs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Uo=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Gs).replace("ref",dr).getRegex(),Ho=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",dr).getRegex(),yd=X("reflink|nolink(?!\\()","g").replace("reflink",Uo).replace("nolink",Ho).getRegex(),oi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pr={_backpedal:ms,anyPunctuation:fd,autolink:pd,blockSkip:ld,br:Io,code:nd,del:ms,emStrongLDelim:cd,emStrongRDelimAst:dd,emStrongRDelimUnd:gd,escape:sd,link:bd,nolink:Ho,punctuation:id,reflink:Uo,reflinkSearch:yd,tag:wd,text:rd,url:ms},vd={...pr,link:X(/^!?\[(label)\]\((.*?)\)/).replace("label",Gs).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gs).getRegex()},Ln={...pr,emStrongRDelimAst:hd,emStrongLDelim:ud,url:X(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oi).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:X(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",oi).getRegex()},xd={...Ln,br:X(Io).replace("{2,}","*").getRegex(),text:X(Ln.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vs={normal:gr,gfm:ed,pedantic:td},as={normal:pr,gfm:Ln,breaks:xd,pedantic:vd},Cd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ai=n=>Cd[n];function it(n,e){if(e){if(Se.escapeTest.test(n))return n.replace(Se.escapeReplace,ai)}else if(Se.escapeTestNoEncode.test(n))return n.replace(Se.escapeReplaceNoEncode,ai);return n}function li(n){try{n=encodeURI(n).replace(Se.percentDecode,"%")}catch{return null}return n}function ci(n,e){var i;let t=n.replace(Se.findPipe,(o,a,c)=>{let u=!1,d=a;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),s=t.split(Se.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Se.slashPipe,"|");return s}function ls(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function kd(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function ui(n,e,t,s,r){let i=e.href,o=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,c}function Sd(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
48
+ <p>You can fill it with any data you like. </p>`;var Do=(n=>(n.UserMessage="Give me some action",n))(Do||{});class Qe{base(e){return{isChatOpen:!0,isChatActive:!0,messages:[],isConnectionError:!1,isProcessError:!1,isReconnectError:!1,isInputDisabled:!1,showWelcome:!1,useTypewriterAnimation:!1,blockSocket:!0,traceLastShown:!1,...e}}}class Pu extends Qe{constructor(){super(...arguments);I(this,"type",oe.Collapsed)}getState(){return this.base({isChatOpen:!1})}}class ri extends Qe{constructor(){super(...arguments);I(this,"type",oe.EmptyChat)}getState(){return this.base({showWelcome:!0,messages:[]})}}class Du extends Qe{constructor(){super(...arguments);I(this,"type",oe.Messages)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!0,messages:[{text:r,isUser:!0},{text:Au,isUser:!1}]})}}class Vu extends Qe{constructor(){super(...arguments);I(this,"type",oe.ActionSnippet)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i={sequence:"38952101547613990",id:"38496103561174822",data:{actionCancel:{text:"Yes"},actionConfirm:{text:"No"},title:{text:"Do you really wanna do this?"}}},a=((s==null?void 0:s.traceSteps)??Ms).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...a,{text:"Here is system’s meaningful response",isUser:!1}],snippet:i})}}class $u extends Qe{constructor(){super(...arguments);I(this,"type",oe.LaunchIssue)}getState(){return this.base({isConnectionError:!0})}}class Lu extends Qe{constructor(){super(...arguments);I(this,"type",oe.ConnectionIssue)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ms).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isProcessError:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isProcessError:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class Ou extends Qe{constructor(){super(...arguments);I(this,"type",oe.ReconnectingAttempt)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ms).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class Iu extends Qe{constructor(){super(...arguments);I(this,"type",oe.InputBlocked)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,a=((s==null?void 0:s.traceSteps)??Ms).map(c=>({text:c,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:i,messages:[{text:r,isUser:!0}],pendingTraces:a,traceAnimationDelay:s.traceAnimationDelay}):this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:i,messages:[{text:r,isUser:!0},...a]})}}class Nu extends Qe{constructor(){super(...arguments);I(this,"type",oe.ActionLoader)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!0,messages:[{text:r,isUser:!0}]})}}class Fu extends Qe{constructor(){super(...arguments);I(this,"type",oe.TracesMessage)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",o=((s==null?void 0:s.traceSteps)??Ms).map(a=>({text:a,isUser:!1,isSystem:!0,type:"trace"}));return s!=null&&s.animateTraces?this.base({showWelcome:!0,messages:[{text:r,isUser:!0}],pendingTraces:o,traceAnimationDelay:s.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...o]})}}class Ku extends Qe{constructor(){super(...arguments);I(this,"type",oe.TracesWithMeta)}getState(t,s){const r=(s==null?void 0:s.userMessageText)??"Give me some action",i=(s==null?void 0:s.traceSteps)??["Step One","API Schema Requested","API Call Conducted","API Call Conducted"],o=[{text:i[0],isUser:!1,isSystem:!0,type:"trace",meta:{step:1}},{text:i[1],isUser:!1,isSystem:!0,type:"trace",meta:{step:2,json:{status:"requested",endpoint:"/v1/schema"}}},{text:i[2],isUser:!1,isSystem:!0,type:"trace",meta:{step:3,json:{status:"ok",code:200}}},{text:i[3],isUser:!1,isSystem:!0,type:"trace"}];return s!=null&&s.animateTraces?this.base({showWelcome:!0,messages:[{text:r,isUser:!0}],pendingTraces:o,traceAnimationDelay:s.traceAnimationDelay}):this.base({showWelcome:!0,messages:[{text:r,isUser:!0},...o]})}}class Wu{static create(e){switch(e){case oe.Collapsed:case"collapsed":return new Pu;case oe.EmptyChat:case"empty":return new ri;case oe.Messages:case"messages":return new Du;case oe.ActionSnippet:case"action_snippet":return new Vu;case oe.LaunchIssue:case"launch_issue":return new $u;case oe.ConnectionIssue:case"connection_issue":return new Lu;case oe.ReconnectingAttempt:case"reconnecting_attempt":return new Ou;case oe.InputBlocked:case"input_blocked":return new Iu;case oe.ActionLoader:case"action_loader":return new Nu;case oe.TracesMessage:case"traces_message":return new Fu;case oe.TracesWithMeta:case"traces_with_meta":return new Ku;default:return new ri}}}class ii{static getScenarioFromUrl(){try{return new URLSearchParams(window.location.search).get("scenario")??void 0}catch{return}}static getState(e,t,s){return{...Wu.create(e).getState(t,s),...s??{}}}}const Uu=l.defineComponent({__name:"ChatDebugButtons",props:{configDesignClass:{},sectionBorderRadius:{}},emits:["trace"],setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:flex tw:flex-row tw:gap-2",style:l.normalizeStyle({padding:"0 "+n.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createVNode(l.unref(ht),{type:"button",style:l.normalizeStyle({backgroundColor:"#27272A",borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white","aria-label":"Copy last message",title:"Copy last message",onClick:t[0]||(t[0]=l.withModifiers(s=>e.$emit("trace",{action:"copyLast"}),["stop"]))},{default:l.withCtx(()=>[...t[2]||(t[2]=[l.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H7.5C8.50833 17.5763 9.16667 16.3596 9.16667 15.0013C9.16667 12.7013 7.3 10.8346 5 10.8346C4.05833 10.8346 3.19167 11.143 2.5 11.668V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.084 3.125C12.4292 3.125 12.709 3.40482 12.709 3.75V5.41667C12.709 5.98816 13.1792 6.45833 13.7507 6.45833H15.4173C15.7625 6.45833 16.0423 6.73816 16.0423 7.08333C16.0423 7.42851 15.7625 7.70833 15.4173 7.70833H13.7507C12.4888 7.70833 11.459 6.67851 11.459 5.41667V3.75C11.459 3.40482 11.7388 3.125 12.084 3.125Z",fill:"white"}),l.createElementVNode("path",{d:"M5.00065 10.832C2.70065 10.832 0.833984 12.6987 0.833984 14.9987C0.833984 17.2987 2.70065 19.1654 5.00065 19.1654C7.30065 19.1654 9.16732 17.2987 9.16732 14.9987C9.16732 12.6987 7.30065 10.832 5.00065 10.832ZM4.30065 16.057C4.50899 16.2654 4.50899 16.607 4.30065 16.8237C4.19232 16.932 4.05899 16.982 3.91733 16.982C3.77566 16.982 3.64231 16.932 3.53398 16.8237L2.09233 15.382C1.88399 15.1737 1.88399 14.832 2.09233 14.6153L3.53398 13.1737C3.74231 12.9654 4.08399 12.9654 4.30065 13.1737C4.50899 13.382 4.50899 13.7237 4.30065 13.9403L3.24233 14.9987L4.30065 16.057ZM7.90066 15.382L6.45898 16.8237C6.35065 16.932 6.21733 16.982 6.07566 16.982C5.93399 16.982 5.80064 16.932 5.69231 16.8237C5.48397 16.6154 5.48397 16.2737 5.69231 16.057L6.75066 14.9987L5.69231 13.9403C5.48397 13.732 5.48397 13.3904 5.69231 13.1737C5.90064 12.9654 6.24232 12.9654 6.45898 13.1737L7.90066 14.6153C8.10899 14.832 8.10899 15.1654 7.90066 15.382Z",fill:"white"})],-1),l.createTextVNode(" Log last function call ",-1)])]),_:1},8,["style"]),l.createVNode(l.unref(ht),{type:"button",class:"tw:flex-shrink-1 tw:flex-grow-1 tw:text-white",style:l.normalizeStyle({backgroundColor:"#27272A",borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),"aria-label":"Copy all",title:"Copy all",onClick:t[1]||(t[1]=l.withModifiers(s=>e.$emit("trace",{action:"copyAll"}),["stop"]))},{default:l.withCtx(()=>[...t[3]||(t[3]=[l.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{opacity:"0.4",d:"M17.5 5.83464V14.168C17.5 16.668 16.25 18.3346 13.3333 18.3346H6.66667C3.75 18.3346 2.5 16.668 2.5 14.168V5.83464C2.5 3.33464 3.75 1.66797 6.66667 1.66797H13.3333C16.25 1.66797 17.5 3.33464 17.5 5.83464Z",fill:"white"}),l.createElementVNode("path",{d:"M15.4173 7.70833H13.7507C12.484 7.70833 11.459 6.68333 11.459 5.41667V3.75C11.459 3.40833 11.7423 3.125 12.084 3.125C12.4257 3.125 12.709 3.40833 12.709 3.75V5.41667C12.709 5.99167 13.1757 6.45833 13.7507 6.45833H15.4173C15.759 6.45833 16.0423 6.74167 16.0423 7.08333C16.0423 7.425 15.759 7.70833 15.4173 7.70833Z",fill:"white"}),l.createElementVNode("path",{d:"M8.33255 14.7922C8.17422 14.7922 8.01589 14.7339 7.89089 14.6089L6.22422 12.9422C5.98255 12.7006 5.98255 12.3005 6.22422 12.0589L7.89089 10.3922C8.13255 10.1505 8.53255 10.1505 8.77422 10.3922C9.01588 10.6339 9.01588 11.0339 8.77422 11.2756L7.54922 12.5005L8.77422 13.7255C9.01588 13.9672 9.01588 14.3672 8.77422 14.6089C8.64922 14.7339 8.49088 14.7922 8.33255 14.7922Z",fill:"white"}),l.createElementVNode("path",{d:"M11.6659 14.7922C11.5076 14.7922 11.3492 14.7339 11.2242 14.6089C10.9826 14.3672 10.9826 13.9672 11.2242 13.7255L12.4492 12.5005L11.2242 11.2756C10.9826 11.0339 10.9826 10.6339 11.2242 10.3922C11.4659 10.1505 11.8659 10.1505 12.1076 10.3922L13.7742 12.0589C14.0159 12.3005 14.0159 12.7006 13.7742 12.9422L12.1076 14.6089C11.9826 14.7339 11.8242 14.7922 11.6659 14.7922Z",fill:"white"})],-1),l.createTextVNode(" Log all function calls ",-1)])]),_:1},8,["style"])],4))}});function cr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=cr();function Vo(n){Nt=n}var vs={exec:()=>null};function Y(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Re.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var Hu=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Re={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ju=/^(?:[ \t]*(?:\n|$))+/,qu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Es=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ur=/(?:[*+-]|\d{1,9}[.)])/,$o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lo=Y($o).replace(/bull/g,ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Yu=Y($o).replace(/bull/g,ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),dr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xu=/^[^\n]+/,hr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qu=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ju=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ur).getRegex(),tn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ed=Y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fr).replace("tag",tn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Oo=Y(dr).replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),td=Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oo).getRegex(),gr={blockquote:td,code:qu,def:Qu,fences:Gu,heading:Zu,hr:Es,html:ed,lheading:Lo,list:Ju,newline:ju,paragraph:Oo,table:vs,text:Xu},oi=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),sd={...gr,lheading:Yu,table:oi,paragraph:Y(dr).replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex()},nd={...gr,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(dr).replace("hr",Es).replace("heading",` *#{1,6} *[^
49
+ ]`).replace("lheading",Lo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Io=/^( {2,}|\\)\n(?!\s*$)/,od=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sn=/[\p{P}\p{S}]/u,pr=/[\s\p{P}\p{S}]/u,No=/[^\s\p{P}\p{S}]/u,ad=Y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pr).getRegex(),Fo=/(?!~)[\p{P}\p{S}]/u,ld=/(?!~)[\s\p{P}\p{S}]/u,cd=/(?:[^\s\p{P}\p{S}]|~)/u,ud=Y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Hu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ko=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dd=Y(Ko,"u").replace(/punct/g,sn).getRegex(),hd=Y(Ko,"u").replace(/punct/g,Fo).getRegex(),Wo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fd=Y(Wo,"gu").replace(/notPunctSpace/g,No).replace(/punctSpace/g,pr).replace(/punct/g,sn).getRegex(),gd=Y(Wo,"gu").replace(/notPunctSpace/g,cd).replace(/punctSpace/g,ld).replace(/punct/g,Fo).getRegex(),pd=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,No).replace(/punctSpace/g,pr).replace(/punct/g,sn).getRegex(),md=Y(/\\(punct)/,"gu").replace(/punct/g,sn).getRegex(),wd=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bd=Y(fr).replace("(?:-->|$)","-->").getRegex(),yd=Y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vd=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Zs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Uo=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",Zs).replace("ref",hr).getRegex(),Ho=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",hr).getRegex(),xd=Y("reflink|nolink(?!\\()","g").replace("reflink",Uo).replace("nolink",Ho).getRegex(),ai=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mr={_backpedal:vs,anyPunctuation:md,autolink:wd,blockSkip:ud,br:Io,code:id,del:vs,emStrongLDelim:dd,emStrongRDelimAst:fd,emStrongRDelimUnd:pd,escape:rd,link:vd,nolink:Ho,punctuation:ad,reflink:Uo,reflinkSearch:xd,tag:yd,text:od,url:vs},Cd={...mr,link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",Zs).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zs).getRegex()},On={...mr,emStrongRDelimAst:gd,emStrongLDelim:hd,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ai).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ai).getRegex()},kd={...On,br:Y(Io).replace("{2,}","*").getRegex(),text:Y(On.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$s={normal:gr,gfm:sd,pedantic:nd},ds={normal:mr,gfm:On,breaks:kd,pedantic:Cd},Sd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},li=n=>Sd[n];function ct(n,e){if(e){if(Re.escapeTest.test(n))return n.replace(Re.escapeReplace,li)}else if(Re.escapeTestNoEncode.test(n))return n.replace(Re.escapeReplaceNoEncode,li);return n}function ci(n){try{n=encodeURI(n).replace(Re.percentDecode,"%")}catch{return null}return n}function ui(n,e){var i;let t=n.replace(Re.findPipe,(o,a,c)=>{let u=!1,d=a;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),s=t.split(Re.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Re.slashPipe,"|");return s}function hs(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function _d(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function di(n,e,t,s,r){let i=e.href,o=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,c}function Td(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
50
50
  `).map(i=>{let o=i.match(t.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
51
- `)}var Zs=class{constructor(n){F(this,"options");F(this,"rules");F(this,"lexer");this.options=n||Pt}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ls(t,`
52
- `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=Sd(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=ls(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:ls(e[0],`
53
- `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=ls(e[0],`
51
+ `)}var Ys=class{constructor(n){I(this,"options");I(this,"rules");I(this,"lexer");this.options=n||Nt}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:hs(t,`
52
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=Td(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=hs(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:hs(e[0],`
53
+ `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=hs(e[0],`
54
54
  `).split(`
55
55
  `),s="",r="",i=[];for(;t.length>0;){let o=!1,a=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))a.push(t[c]),o=!0;else if(!o)a.push(t[c]);else break;t=t.slice(c);let u=a.join(`
56
56
  `),d=u.replace(this.rules.other.blockquoteSetextReplace,`
57
57
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
58
58
  ${u}`:u,r=r?`${r}
59
- ${d}`:d;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=g,t.length===0)break;let p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let f=p,w=f.raw+`
59
+ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,t.length===0)break;let p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let g=p,b=g.raw+`
60
60
  `+t.join(`
61
- `),h=this.blockquote(w);i[i.length-1]=h,s=s.substring(0,s.length-f.raw.length)+h.raw,r=r.substring(0,r.length-f.text.length)+h.text;break}else if((p==null?void 0:p.type)==="list"){let f=p,w=f.raw+`
61
+ `),h=this.blockquote(b);i[i.length-1]=h,s=s.substring(0,s.length-g.raw.length)+h.raw,r=r.substring(0,r.length-g.text.length)+h.text;break}else if((p==null?void 0:p.type)==="list"){let g=p,b=g.raw+`
62
62
  `+t.join(`
63
- `),h=this.list(w);i[i.length-1]=h,s=s.substring(0,s.length-p.raw.length)+h.raw,r=r.substring(0,r.length-f.raw.length)+h.raw,t=w.substring(i.at(-1).raw.length).split(`
64
- `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){var t,s;let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),i=r.length>1,o={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),c=!1;for(;n;){let d=!1,g="",p="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;g=e[0],n=n.substring(g.length);let f=e[2].split(`
65
- `,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),w=n.split(`
66
- `,1)[0],h=!f.trim(),m=0;if(this.options.pedantic?(m=2,p=f.trimStart()):h?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=f.slice(m),m+=e[1].length),h&&this.rules.other.blankLine.test(w)&&(g+=w+`
67
- `,n=n.substring(w.length+1),d=!0),!d){let v=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),b=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),C=this.rules.other.htmlBeginRegex(m);for(;n;){let k=n.split(`
68
- `,1)[0],R;if(w=k,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),R=w):R=w.replace(this.rules.other.tabCharGlobal," "),b.test(w)||x.test(w)||C.test(w)||v.test(w)||y.test(w))break;if(R.search(this.rules.other.nonSpaceChar)>=m||!w.trim())p+=`
69
- `+R.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(f)||x.test(f)||y.test(f))break;p+=`
70
- `+w}!h&&!w.trim()&&(h=!0),g+=k+`
71
- `,n=n.substring(k.length+1),f=R.slice(m)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=g}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((t=d.tokens[0])==null?void 0:t.type)==="text"||((s=d.tokens[0])==null?void 0:s.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(d.raw);if(g){let p={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let g=d.tokens.filter(f=>f.type==="space"),p=g.length>0&&g.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return o}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ci(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
72
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(ci(a,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
73
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=ls(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=kd(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),ui(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return ui(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,o,a=r,c=0,u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(s=u.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){a+=o;continue}else if((s[5]||s[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);let d=[...s[0]][0].length,g=n.slice(0,r+s.index+d+o);if(Math.min(r,o)%2){let f=g.slice(1,-1);return{type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let p=g.slice(2,-2);return{type:"strong",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let s,r;if(e[2]==="@")s=e[0],r="mailto:"+s;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},qe=class On{constructor(e){F(this,"tokens");F(this,"options");F(this,"state");F(this,"inlineQueue");F(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pt,this.options.tokenizer=this.options.tokenizer||new Zs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Se,block:Vs.normal,inline:as.normal};this.options.pedantic?(t.block=Vs.pedantic,t.inline=as.pedantic):this.options.gfm&&(t.block=Vs.gfm,this.options.breaks?t.inline=as.breaks:t.inline=as.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vs,inline:as}}static lex(e,t){return new On(t).lex(e)}static lexInline(e,t){return new On(t).inlineTokens(e)}lex(e){e=e.replace(Se.carriageReturn,`
74
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(Se.tabCharGlobal," ").replace(Se.spaceLine,""));e;){let a;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(u=>(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let u=t.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
63
+ `),h=this.list(b);i[i.length-1]=h,s=s.substring(0,s.length-p.raw.length)+h.raw,r=r.substring(0,r.length-g.raw.length)+h.raw,t=b.substring(i.at(-1).raw.length).split(`
64
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){var t,s;let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),i=r.length>1,o={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),c=!1;for(;n;){let d=!1,f="",p="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;f=e[0],n=n.substring(f.length);let g=e[2].split(`
65
+ `,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),b=n.split(`
66
+ `,1)[0],h=!g.trim(),m=0;if(this.options.pedantic?(m=2,p=g.trimStart()):h?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=g.slice(m),m+=e[1].length),h&&this.rules.other.blankLine.test(b)&&(f+=b+`
67
+ `,n=n.substring(b.length+1),d=!0),!d){let x=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),v=this.rules.other.htmlBeginRegex(m);for(;n;){let y=n.split(`
68
+ `,1)[0],_;if(b=y,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),_=b):_=b.replace(this.rules.other.tabCharGlobal," "),w.test(b)||C.test(b)||v.test(b)||x.test(b)||k.test(b))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!b.trim())p+=`
69
+ `+_.slice(m);else{if(h||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(g)||C.test(g)||k.test(g))break;p+=`
70
+ `+b}!h&&!b.trim()&&(h=!0),f+=y+`
71
+ `,n=n.substring(y.length+1),g=_.slice(m)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=f}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((t=d.tokens[0])==null?void 0:t.type)==="text"||((s=d.tokens[0])==null?void 0:s.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let f=d.tokens.filter(g=>g.type==="space"),p=f.length>0&&f.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ui(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
72
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(ui(a,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
73
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=hs(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=_d(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),di(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return di(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,o,a=r,c=0,u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(s=u.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){a+=o;continue}else if((s[5]||s[6])&&r%3&&!((r+o)%3)){c+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+c);let d=[...s[0]][0].length,f=n.slice(0,r+s.index+d+o);if(Math.min(r,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let s,r;if(e[2]==="@")s=e[0],r="mailto:"+s;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Ze=class In{constructor(e){I(this,"tokens");I(this,"options");I(this,"state");I(this,"inlineQueue");I(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Nt,this.options.tokenizer=this.options.tokenizer||new Ys,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Re,block:$s.normal,inline:ds.normal};this.options.pedantic?(t.block=$s.pedantic,t.inline=ds.pedantic):this.options.gfm&&(t.block=$s.gfm,this.options.breaks?t.inline=ds.breaks:t.inline=ds.gfm),this.tokenizer.rules=t}static get rules(){return{block:$s,inline:ds}}static lex(e,t){return new In(t).lex(e)}static lexInline(e,t){return new In(t).inlineTokens(e)}lex(e){e=e.replace(Re.carriageReturn,`
74
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(Re.tabCharGlobal," ").replace(Re.spaceLine,""));e;){let a;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(u=>(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let u=t.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
75
75
  `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
76
76
  `)?"":`
77
77
  `)+a.raw,u.text+=`
78
78
  `+a.text,this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
79
79
  `)?"":`
80
80
  `)+a.raw,u.text+=`
81
- `+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0,d=e.slice(1),g;this.options.extensions.startBlock.forEach(p=>{g=p.call({lexer:this},d),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(c))){let u=t.at(-1);s&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
81
+ `+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0,d=e.slice(1),f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(c))){let u=t.at(-1);s&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
82
82
  `)?"":`
83
83
  `)+a.raw,u.text+=`
84
84
  `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a),s=c.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
85
85
  `)?"":`
86
86
  `)+a.raw,u.text+=`
87
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,d,g,p;let s=e,r=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)f.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},s))??s;let o=!1,a="";for(;e;){o||(a=""),o=!1;let f;if((g=(d=this.options.extensions)==null?void 0:d.inline)!=null&&g.some(h=>(f=h.call({lexer:this},e,t))?(e=e.substring(f.raw.length),t.push(f),!0):!1))continue;if(f=this.tokenizer.escape(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.tag(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.link(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(f.raw.length);let h=t.at(-1);f.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=f.raw,h.text+=f.text):t.push(f);continue}if(f=this.tokenizer.emStrong(e,s,a)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.codespan(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.br(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.del(e)){e=e.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.autolink(e)){e=e.substring(f.raw.length),t.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(e))){e=e.substring(f.raw.length),t.push(f);continue}let w=e;if((p=this.options.extensions)!=null&&p.startInline){let h=1/0,m=e.slice(1),v;this.options.extensions.startInline.forEach(y=>{v=y.call({lexer:this},m),typeof v=="number"&&v>=0&&(h=Math.min(h,v))}),h<1/0&&h>=0&&(w=e.substring(0,h+1))}if(f=this.tokenizer.inlineText(w)){e=e.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(a=f.raw.slice(-1)),o=!0;let h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=f.raw,h.text+=f.text):t.push(f);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},Ys=class{constructor(n){F(this,"options");F(this,"parser");this.options=n||Pt}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let s=(i=(e||"").match(Se.notSpaceStart))==null?void 0:i[0],r=n.replace(Se.endingNewline,"")+`
88
- `;return s?'<pre><code class="language-'+it(s)+'">'+(t?r:it(r,!0))+`</code></pre>
89
- `:"<pre><code>"+(t?r:it(r,!0))+`</code></pre>
87
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,d,f,p;let s=e,r=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)g.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},s))??s;let o=!1,a="";for(;e;){o||(a=""),o=!1;let g;if((f=(d=this.options.extensions)==null?void 0:d.inline)!=null&&f.some(h=>(g=h.call({lexer:this},e,t))?(e=e.substring(g.raw.length),t.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let h=t.at(-1);g.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=g.raw,h.text+=g.text):t.push(g);continue}if(g=this.tokenizer.emStrong(e,s,a)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.del(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),t.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),t.push(g);continue}let b=e;if((p=this.options.extensions)!=null&&p.startInline){let h=1/0,m=e.slice(1),x;this.options.extensions.startInline.forEach(k=>{x=k.call({lexer:this},m),typeof x=="number"&&x>=0&&(h=Math.min(h,x))}),h<1/0&&h>=0&&(b=e.substring(0,h+1))}if(g=this.tokenizer.inlineText(b)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(a=g.raw.slice(-1)),o=!0;let h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=g.raw,h.text+=g.text):t.push(g);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},Xs=class{constructor(n){I(this,"options");I(this,"parser");this.options=n||Nt}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let s=(i=(e||"").match(Re.notSpaceStart))==null?void 0:i[0],r=n.replace(Re.endingNewline,"")+`
88
+ `;return s?'<pre><code class="language-'+ct(s)+'">'+(t?r:ct(r,!0))+`</code></pre>
89
+ `:"<pre><code>"+(t?r:ct(r,!0))+`</code></pre>
90
90
  `}blockquote({tokens:n}){return`<blockquote>
91
91
  ${this.parser.parse(n)}</blockquote>
92
92
  `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
@@ -102,5 +102,5 @@ ${this.parser.parse(n)}</blockquote>
102
102
  `}tablerow({text:n}){return`<tr>
103
103
  ${n}</tr>
104
104
  `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
105
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${it(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=li(n);if(r===null)return s;n=r;let i='<a href="'+n+'"';return e&&(i+=' title="'+it(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=li(n);if(r===null)return it(t);n=r;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${it(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:it(n.text)}},mr=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Ge=class In{constructor(e){F(this,"options");F(this,"renderer");F(this,"textRenderer");this.options=e||Pt,this.options.renderer=this.options.renderer||new Ys,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new mr}static parse(e,t){return new In(t).parse(e)}static parseInline(e,t){return new In(t).parseInline(e)}parse(e){var s,r;let t="";for(let i=0;i<e.length;i++){let o=e[i];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[o.type]){let c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=u||"";continue}}let a=o;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return t}parseInline(e,t=this.renderer){var r,i;let s="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=u||"";continue}}let c=a;switch(c.type){case"escape":{s+=t.text(c);break}case"html":{s+=t.html(c);break}case"link":{s+=t.link(c);break}case"image":{s+=t.image(c);break}case"checkbox":{s+=t.checkbox(c);break}case"strong":{s+=t.strong(c);break}case"em":{s+=t.em(c);break}case"codespan":{s+=t.codespan(c);break}case"br":{s+=t.br(c);break}case"del":{s+=t.del(c);break}case"text":{s+=t.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}},$s,hs=($s=class{constructor(n){F(this,"options");F(this,"block");this.options=n||Pt}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?qe.lex:qe.lexInline}provideParser(){return this.block?Ge.parse:Ge.parseInline}},F($s,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),F($s,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),$s),_d=class{constructor(...n){F(this,"defaults",lr());F(this,"options",this.setOptions);F(this,"parse",this.parseMarkdown(!0));F(this,"parseInline",this.parseMarkdown(!1));F(this,"Parser",Ge);F(this,"Renderer",Ys);F(this,"TextRenderer",mr);F(this,"Lexer",qe);F(this,"Tokenizer",Zs);F(this,"Hooks",hs);this.use(...n)}walkTokens(n,e){var s,r;let t=[];for(let i of n)switch(t=t.concat(e.call(this,i)),i.type){case"table":{let o=i;for(let a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of o.rows)for(let c of a)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let o=i;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=i;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let c=o[a].flat(1/0);t=t.concat(this.walkTokens(c,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new Ys(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=t.renderer[o],c=r[o];r[o]=(...u)=>{let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Zs(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=t.tokenizer[o],c=r[o];r[o]=(...u)=>{let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new hs;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=t.hooks[o],c=r[o];hs.passThroughHooks.has(i)?r[o]=u=>{if(this.defaults.async&&hs.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await a.call(r,u);return c.call(r,g)})();let d=a.call(r,u);return c.call(r,d)}:r[o]=(...u)=>{if(this.defaults.async)return(async()=>{let g=await a.apply(r,u);return g===!1&&(g=await c.apply(r,u)),g})();let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return qe.lex(n,e??this.defaults)}parser(n,e){return Ge.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer():n?qe.lex:qe.lexInline)(o,r),c=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():n?Ge.parse:Ge.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer():n?qe.lex:qe.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser():n?Ge.parse:Ge.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(n,e){return t=>{if(t.message+=`
106
- Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+it(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Et=new _d;function J(n,e){return Et.parse(n,e)}J.options=J.setOptions=function(n){return Et.setOptions(n),J.defaults=Et.defaults,Vo(J.defaults),J};J.getDefaults=lr;J.defaults=Pt;J.use=function(...n){return Et.use(...n),J.defaults=Et.defaults,Vo(J.defaults),J};J.walkTokens=function(n,e){return Et.walkTokens(n,e)};J.parseInline=Et.parseInline;J.Parser=Ge;J.parser=Ge.parse;J.Renderer=Ys;J.TextRenderer=mr;J.Lexer=qe;J.lexer=qe.lex;J.Tokenizer=Zs;J.Hooks=hs;J.parse=J;J.options;J.setOptions;J.use;J.walkTokens;J.parseInline;Ge.parse;qe.lex;const Td={key:"message",class:"message-text tw:flex tw:items-end tw:gap-1 tw:transition-all"},Rd=["innerHTML"],zd=["aria-label"],Bd={key:1,width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Md=["aria-label","disabled"],Ed={key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ad=l.defineComponent({__name:"MessageBot",props:{message:{},welcomeColor:{},color:{},bgColor:{},size:{},bgType:{},fontSize:{},borderWidth:{},borderColor:{},configDesignClass:{},ttsUrl:{}},setup(n){J.setOptions({breaks:!0,gfm:!0});const e=n,t=l.computed(()=>{var A;return e.ttsUrl||((A=e.configDesignClass)==null?void 0:A.getKey("settings.ttsUrl"))||""}),s=l.computed(()=>!!t.value),{speak:r,stop:i,isSpeaking:o,isLoading:a}=Ku({ttsUrl:t,voice:"nova"}),c=l.ref(null),u=l.ref("idle"),d=l.ref(!1);let g;const p=()=>{g&&(window.clearTimeout(g),g=void 0)},f=(A=1500)=>{p(),g=window.setTimeout(()=>{u.value="idle"},A)},w=l.computed(()=>{var I,W;const A=(I=e.message.chunk)!=null&&I.start?"#2F2F31":e.color,M=(W=e.message.chunk)!=null&&W.start?"transparent":e.bgType==="bubble"?e.bgColor:"transparent";return{color:A,backgroundColor:M,fontSize:e.fontSize+"px",border:e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none","--hsw-message-table-header-bg":M&&M!=="transparent"?`color-mix(in srgb, ${M} 85%, white)`:M}}),h=()=>{var M,I;const A=(I=(M=c.value)==null?void 0:M.innerText)==null?void 0:I.trim();return A||(e.message.text||"").trim()},m=A=>{const M=document.createElement("textarea");M.value=A,M.setAttribute("readonly",""),M.style.position="fixed",M.style.top="-9999px",M.style.left="-9999px",document.body.appendChild(M),M.select();const I=document.execCommand("copy");return document.body.removeChild(M),I},v=async()=>{var M;const A=h();if(A)try{if((M=navigator.clipboard)!=null&&M.writeText)await navigator.clipboard.writeText(A);else if(!m(A))throw new Error("execCommand(copy) failed");u.value="copied",f()}catch(I){console.warn("Copy failed",I),u.value="error",f(2e3)}},y=l.computed(()=>u.value==="copied"?"Copied":u.value==="error"?"Copy failed":"Copy"),b=l.computed(()=>d.value||u.value!=="idle"),x=l.ref(!1),C=l.computed(()=>a.value?"Loading...":o.value?"Stop":"Speak"),k=l.computed(()=>x.value||o.value||a.value);l.onBeforeUnmount(()=>{p()});const R=()=>{o.value?i():e.message.text&&r(e.message.text)},_=l.computed(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),T=l.computed(()=>e.message.text?J.parse(e.message.text):"");return(A,M)=>{var I,W,ee,P,N;return l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-item tw:transition-all tw:text-white tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",[_.value,{"item-primary":!((I=n.message.chunk)!=null&&I.start)}]]),style:l.normalizeStyle(w.value)},[l.createElementVNode("div",Td,[l.createElementVNode("span",{ref_key:"messageTextEl",ref:c,class:"tw:flex-1 tw:max-w-[100%] tw:overflow-x-scroll tw:flex markdown-content tw:flex-col",innerHTML:T.value},null,8,Rd),n.message.text&&!((W=n.message.chunk)!=null&&W.start)&&((ee=n.message.chunk)!=null&&ee.end)?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:M[2]||(M[2]=K=>d.value=!0),onMouseleave:M[3]||(M[3]=K=>d.value=!1)},[l.createElementVNode("span",{class:l.normalizeClass(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":b.value}]),role:"tooltip"},l.toDisplayString(y.value),3),l.createElementVNode("button",{class:"copy-button tw:opacity-80 tw:ml-2 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:opacity-100",onClick:l.withModifiers(v,["stop"]),onFocus:M[0]||(M[0]=K=>d.value=!0),onBlur:M[1]||(M[1]=K=>d.value=!1),"aria-label":y.value,type:"button"},[u.value==="copied"?(l.openBlock(),l.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:l.normalizeStyle({color:n.color,opacity:.7})},[...M[8]||(M[8]=[l.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)):(l.openBlock(),l.createElementBlock("svg",Bd,[...M[9]||(M[9]=[l.createElementVNode("path",{d:"M10.6667 8.60004V11.4C10.6667 13.7334 9.73334 14.6667 7.40001 14.6667H4.60001C2.26668 14.6667 1.33334 13.7334 1.33334 11.4V8.60004C1.33334 6.26671 2.26668 5.33337 4.60001 5.33337H7.40001C9.73334 5.33337 10.6667 6.26671 10.6667 8.60004Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M11.4 1.33337H8.6C6.6793 1.33337 5.71167 1.97031 5.42923 3.49264C5.32764 4.04021 5.79499 4.50004 6.3519 4.50004H7.4C10.2 4.50004 11.5 5.80004 11.5 8.60004V9.64814C11.5 10.205 11.9598 10.6724 12.5074 10.5708C14.0297 10.2884 14.6667 9.32074 14.6667 7.40004V4.60004C14.6667 2.26671 13.7333 1.33337 11.4 1.33337Z",fill:"#A6A6A6"},null,-1)])]))],40,zd)],32)):l.createCommentVNode("",!0),s.value&&n.message.text&&!((P=n.message.chunk)!=null&&P.start)&&((N=n.message.chunk)!=null&&N.end)?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:M[6]||(M[6]=K=>x.value=!0),onMouseleave:M[7]||(M[7]=K=>x.value=!1)},[l.createElementVNode("span",{class:l.normalizeClass(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":k.value}]),role:"tooltip"},l.toDisplayString(C.value),3),l.createElementVNode("button",{class:l.normalizeClass(["tts-button tw:opacity-80 tw:hover:opacity-100 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:bg-white",{"tw:opacity-100":l.unref(o)||l.unref(a),"tts-speaking":l.unref(o),"tts-loading":l.unref(a)}]),onClick:l.withModifiers(R,["stop"]),onFocus:M[4]||(M[4]=K=>x.value=!0),onBlur:M[5]||(M[5]=K=>x.value=!1),"aria-label":C.value,disabled:l.unref(a),type:"button"},[l.unref(o)?(l.openBlock(),l.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:l.normalizeStyle({color:n.color,opacity:.6})},[...M[10]||(M[10]=[l.createElementVNode("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),l.createElementVNode("line",{x1:"23",y1:"9",x2:"17",y2:"15"},null,-1),l.createElementVNode("line",{x1:"17",y1:"9",x2:"23",y2:"15"},null,-1)])],4)):(l.openBlock(),l.createElementBlock("svg",Ed,[...M[11]||(M[11]=[l.createElementVNode("path",{d:"M12 11.1666C11.8933 11.1666 11.7933 11.1333 11.7 11.0666C11.48 10.9 11.4333 10.5866 11.6 10.3666C12.6467 8.97331 12.6467 7.02664 11.6 5.63331C11.4333 5.41331 11.48 5.09998 11.7 4.93331C11.92 4.76665 12.2333 4.81331 12.4 5.03331C13.7067 6.77998 13.7067 9.21998 12.4 10.9666C12.3 11.1 12.1533 11.1666 12 11.1666Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M13.22 12.8334C13.1133 12.8334 13.0133 12.8 12.92 12.7334C12.7 12.5667 12.6533 12.2534 12.82 12.0334C14.6 9.66002 14.6 6.34002 12.82 3.96669C12.6533 3.74669 12.7 3.43335 12.92 3.26669C13.14 3.10002 13.4533 3.14669 13.62 3.36669C15.6667 6.09335 15.6667 9.90669 13.62 12.6334C13.5267 12.7667 13.3733 12.8334 13.22 12.8334Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M9.34668 2.52002C8.60001 2.10669 7.64668 2.21335 6.67334 2.82002L4.72668 4.04002C4.59334 4.12002 4.44001 4.16669 4.28668 4.16669H3.66668H3.33334C1.72001 4.16669 0.833344 5.05335 0.833344 6.66669V9.33335C0.833344 10.9467 1.72001 11.8334 3.33334 11.8334H3.66668H4.28668C4.44001 11.8334 4.59334 11.88 4.72668 11.96L6.67334 13.18C7.26001 13.5467 7.83334 13.7267 8.36668 13.7267C8.71334 13.7267 9.04668 13.6467 9.34668 13.48C10.0867 13.0667 10.5 12.2067 10.5 11.06V4.94002C10.5 3.79335 10.0867 2.93335 9.34668 2.52002Z",fill:"#A6A6A6"},null,-1)])]))],42,Md)],32)):l.createCommentVNode("",!0)])],6)}}}),Pd=l.defineComponent({__name:"MessageUser",props:{message:{},isFirst:{type:Boolean},color:{},bgColor:{},borderWidth:{},borderColor:{},fontSize:{},size:{},bgType:{},configDesignClass:{}},setup(n){const e=n,t=l.computed(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),s=l.computed(()=>e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none");return(r,i)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-item tw:transition-all tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces item-secondary tw:ml-auto",[t.value,{"tw:mt-[5px] !tw:bg-transparent":n.isFirst}]]),style:l.normalizeStyle({color:n.color,"background-color":n.bgType==="bubble"?n.bgColor:"transparent",border:s.value,"font-size":n.fontSize+"px"})},l.toDisplayString(n.message.text),7))}}),Dd=["innerHTML"],Vd={class:"tw:text-sm"},$d=["innerHTML"],Ld=["innerHTML"],Od=["data-text"],Id=l.defineComponent({__name:"LoadingMessage",props:{isProduction:{type:Boolean},borderRadius:{},loader:{},text:{},message:{},configDesignClass:{},paused:{type:Boolean},color:{},bgColor:{},loadingTime:{}},setup(n){const e=n,t=l.ref(null),s=l.ref(!1);let r=null;const i=l.ref(null),o=l.ref(null),a=l.ref(null),c=l.ref(null),u=l.ref(null),d=l.ref(null),g=l.computed(()=>Number(e.configDesignClass.getKey("sections.loader.completeStep.icon.size"))||16),p=()=>{const y=t.value;if(!y)return;const b=y.closest("li");if(!b)return;const x=b.nextElementSibling;if(!x){s.value=!1;return}const C=x.getAttribute("data-component")==="MessageBot"||typeof x.matches=="function"&&x.matches('[data-component="MessageBot"]')||!!x.querySelector('[data-component="MessageBot"]');s.value=C},f=l.computed(()=>e.configDesignClass.getKey("sections.inside.dataAction.type")),w=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction"));l.onMounted(()=>{l.nextTick(p);const y=t.value,b=y==null?void 0:y.closest("ul");b&&(r=new MutationObserver(()=>p()),r.observe(b,{childList:!0,subtree:!0}))}),l.onBeforeUnmount(()=>{r&&r.disconnect()}),l.watch(()=>e.text,()=>l.nextTick(p));const h=l.computed(()=>!!e.paused||s.value),m=()=>!e.loader||e.loader==="dots"?a.value:e.loader==="dots-pulse"?c.value:e.loader==="circle-pulse"?u.value:e.loader==="circle-pulse-1"?d.value:a.value,v=y=>{const b=m(),x=o.value,C=i.value;if(!b||!x||!C)return;const k=.3,R="power2.inOut";y?(q.to(b,{opacity:0,scale:.8,duration:k,ease:R}),q.fromTo(x,{opacity:0,scale:.8},{opacity:1,scale:1,duration:k,ease:R}),q.to(C,{width:g.value,duration:k,ease:R})):(q.to(x,{opacity:0,scale:.8,duration:k,ease:R}),q.fromTo(b,{opacity:0,scale:.8},{opacity:1,scale:1,duration:k,ease:R}),l.nextTick(()=>{const _=b.scrollWidth||g.value;q.to(C,{width:_,duration:k,ease:R})}))};return l.watch(h,(y,b)=>{y!==b&&v(y)}),l.onMounted(()=>{l.nextTick(()=>{const y=i.value,b=m();y&&b&&!h.value&&(y.style.width=b.scrollWidth+"px")})}),(y,b)=>(l.openBlock(),l.createElementBlock("li",{key:"loading",ref_key:"rootRef",ref:t,class:l.normalizeClass(["message-text-loading tw:flex tw:justify-start tw:overflow-hidden tw:flex-wrap",{"tw:flex-col tw:border tw:max-w-xs":f.value==="box","tw:border tw:px-3 tw:py-2.5":f.value==="outline","tw:!rounded-none":f.value==="compact","tw:items-center tw:gap-3":f.value!=="box"}]),style:l.normalizeStyle({borderColor:w.value.strokeColor,borderWidth:w.value.strokeWidth+"px",borderRadius:n.borderRadius})},[f.value==="box"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:px-2 tw:py-2.5 tw:border-b",style:l.normalizeStyle({backgroundColor:w.value.headerFillColor,color:w.value.pastStepColor,borderColor:w.value.strokeColor,borderBottomWidth:w.value.strokeWidth+"px"})},[l.createElementVNode("div",{key:"complete-step-icon",innerHTML:n.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.loader.activeStep.icon.color"),height:n.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px",width:n.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px"})},null,12,Dd),l.createElementVNode("span",Vd,l.toDisplayString(w.value.headerText),1)],4)):l.createCommentVNode("",!0),f.value!=="box"?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"loaderContainerRef",ref:i,class:"loader-container tw:flex tw:items-center tw:justify-center tw:overflow-hidden",style:l.normalizeStyle({height:g.value+"px",minWidth:g.value+"px"})},[h.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"completeIconRef",ref:o,innerHTML:n.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit tw:absolute",style:l.normalizeStyle({color:w.value.activeStepColor,height:g.value+"px",width:g.value+"px"})},null,12,$d)):(l.openBlock(),l.createElementBlock("div",{key:1,ref:"activeIconRef",innerHTML:n.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit tw:absolute",style:l.normalizeStyle({color:w.value.activeStepColor,height:g.value+"px",width:g.value+"px"})},null,12,Ld))],4)):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"fade-text",mode:"out-in"},{default:l.withCtx(()=>{var x,C,k,R;return[(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(["tw:transition-all tw:text-sm",{"typing-shimmer":!h.value,"tw:px-3 tw:py-3":f.value==="box"}]),key:n.text,"data-text":(x=n.message)!=null&&x.text?(C=n.message)==null?void 0:C.text:n.text,style:l.normalizeStyle({color:w.value.activeStepColor,background:f.value==="box"?`linear-gradient(0deg, ${w.value.headerFillColor} 0%, ${l.unref(Mo)(w.value.bodyFillColor,.4)} 100%)`:"transparent"})},l.toDisplayString(h.value?"Thinking completed":(k=n.message)!=null&&k.text?(R=n.message)==null?void 0:R.text:n.text),15,Od))]}),_:1}),n.loadingTime&&n.loadingTime>0&&h.value&&(f.value==="outline"||f.value==="compact")?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["tw:text-xs",{"tw:w-full tw:-mt-2":f.value==="compact","tw:ml-auto":f.value==="outline"}]),style:l.normalizeStyle({color:w.value.pastStepColor})},l.toDisplayString(n.loadingTime)+" seconds total",7)):l.createCommentVNode("",!0)],6))}}),Nd=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},di=Nd(Id,[["__scopeId","data-v-b3a29c8f"]]),Fd=["data-height"],Kd={class:"tw:transition-all tw:relative tw:w-[16px] tw:flex tw:flex-col tw:items-center tw:gap-1 tw:px-1"},Wd={class:"tw:transition-all tw:flex tw:items-center tw:gap-2 tw:leading-none"},Ud=l.defineComponent({__name:"MessageSystem",props:{isProduction:{type:Boolean},message:{},welcomeColor:{},color:{},bgColor:{},size:{},configDesignClass:{},activeMessage:{type:Boolean},bgType:{},isLast:{type:Boolean},traceLastShown:{type:Boolean},index:{}},setup(n){const e=n,t=l.computed(()=>e.index===3&&e.traceLastShown||e.isLast),s=l.computed(()=>{switch(e.size){case"sm":return"tw:text-xs";case"md":return"tw:text-xs";case"lg":return"tw:text-base"}}),r=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction")),i=l.computed(()=>t.value?r.value.activeStepColor:r.value.pastStepColor),o=l.computed(()=>ar(e.configDesignClass,"inside"));return(a,c)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-system tw:text-left tw:relative tw:w-full tw:text-white tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",s.value]),style:l.normalizeStyle([{"margin-bottom":"0px !important"},{"padding-top":n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+"px"}]),"data-height":n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")},[l.createElementVNode("div",{key:"message",class:l.normalizeClass(["message-text flex tw:transition-all tw:space-between tw:gap-3 tw:flex tw:items-center tw:align-center",{"tw:mb-0":n.isLast}])},[l.createElementVNode("div",Kd,[l.createElementVNode("hr",{class:"tw:w-[1px] tw:bg-white tw:opacity-20 tw:absolute",style:l.normalizeStyle([{display:"none"},{height:n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+6+"px",left:"50%",transform:"translateX(-50%)",bottom:"100%"}])},null,4),l.createElementVNode("span",{class:l.normalizeClass(["tw:w-[8px] tw:h-[8px] tw:rounded-full",{"tw:bg-white":t.value}]),style:l.normalizeStyle({backgroundColor:i.value})},null,6)]),l.createElementVNode("div",Wd,[n.message.meta&&!n.isProduction?(l.openBlock(),l.createBlock(l.unref(lt),{key:0,style:l.normalizeStyle({color:e.activeMessage?"rgba(255, 255, 255, 0.60)":"#3F3F46",background:e.activeMessage?"#2F2F31":"#ECEDEE",border:e.activeMessage?"none":"1px solid #fff"}),class:l.normalizeClass(["tw:flex tw:items-center tw:gap-1 tw:rounded-md tw:shadow-xs",o.value])},{default:l.withCtx(()=>[c[0]||(c[0]=l.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{d:"M10.7935 1.33301H5.20683C2.78016 1.33301 1.3335 2.77967 1.3335 5.20634V10.7863C1.3335 13.2197 2.78016 14.6663 5.20683 14.6663H10.7868C13.2135 14.6663 14.6602 13.2197 14.6602 10.793V5.20634C14.6668 2.77967 13.2202 1.33301 10.7935 1.33301ZM6.62683 8.84634C6.1735 9.52634 5.54683 10.0797 4.8135 10.4463C4.74683 10.4797 4.66683 10.4997 4.5935 10.4997C4.40683 10.4997 4.2335 10.3997 4.14683 10.2263C4.02016 9.97967 4.12016 9.67967 4.3735 9.55301C4.9535 9.26634 5.44683 8.82634 5.80016 8.29301C5.92016 8.11301 5.92016 7.88634 5.80016 7.70634C5.44016 7.17301 4.94683 6.73301 4.3735 6.44634C4.12016 6.32634 4.02016 6.02634 4.14683 5.77301C4.26683 5.52634 4.56683 5.42634 4.8135 5.55301C5.54683 5.91967 6.1735 6.47301 6.62683 7.15301C6.9735 7.66634 6.9735 8.33301 6.62683 8.84634ZM11.3335 10.4997H8.66683C8.3935 10.4997 8.16683 10.273 8.16683 9.99967C8.16683 9.72634 8.3935 9.49967 8.66683 9.49967H11.3335C11.6068 9.49967 11.8335 9.72634 11.8335 9.99967C11.8335 10.273 11.6068 10.4997 11.3335 10.4997Z",fill:"currentColor"})],-1)),l.createElementVNode("span",null,l.toDisplayString(n.message.text),1)]),_:1},8,["style","class"])):(l.openBlock(),l.createElementBlock("p",{key:1,style:l.normalizeStyle({color:i.value,"font-size":n.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},l.toDisplayString(n.message.text),5))])],2)],14,Fd))}}),Hd=["innerHTML"],jd=l.defineComponent({__name:"MessageList",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},showWelcome:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage"],setup(n,{emit:e}){const t=l.ref(null),s=n,r=e,i=v=>{v.meta&&r("handleClickMessage",v)},o=l.computed(()=>s.configDesignClass.getKey("sections.inside.dataAction.type")),a=l.computed(()=>s.configDesignClass.getKeyObject("sections.inside.dataAction")),c=l.computed(()=>s.messages.filter((v,y,b)=>{var x;return!s.isProduction||o.value==="steps"?!0:!(v.type==="usageTokensByAI"&&y===b.length-1||v.isSystem&&((x=b[y+1])!=null&&x.isSystem))}));l.watch(s.messages,()=>{d()&&u()},{deep:!0});const u=()=>{l.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})},d=()=>{if(!t.value)return!0;const v=t.value;return v.scrollHeight-v.scrollTop-v.clientHeight<=24},g=()=>{},p=v=>{const y=v.replace("#",""),b=parseInt(y.substr(0,2),16),x=parseInt(y.substr(2,2),16),C=parseInt(y.substr(4,2),16),k=Math.max(0,b-12),R=Math.max(0,x-12),_=Math.max(0,C-12);return`linear-gradient(180deg, rgba(${k}, ${R}, ${_}, 0.95) 0%, rgba(0,0,0, 0) 100%)`},f=l.computed(()=>{switch(s.configDesignClass.getKey("sections.inside.welcomeMessage.size")){case"sm":return"tw:px-1.5 tw:py-2.5";case"md":return"tw:px-3 tw:py-4";case"lg":return"tw:px-4.5 tw:py-5.5"}}),w=l.computed(()=>s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="gradient"?p(s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor")):s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="bubble"?s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor"):"transparent"),h=v=>s.configDesignClass.getKey("settings.globalRoundingRadius")?s.sectionBorderRadius.borderRadius:s.configDesignClass.getKey(v?"sections.inside.messageUser.borderRadius":"sections.inside.messageBot.borderRadius")+"px",m=v=>{var R,_;const y=s.messages.findIndex(T=>T===v);let b=null;if(!v.time)return 0;for(let T=y+1;T<s.messages.length;T++)if((R=s.messages[T])!=null&&R.chunkId&&!((_=s.messages[T])!=null&&_.isUser)){b=s.messages[T];break}if(!(b!=null&&b.time))return 0;const x=T=>T?Date.parse(T):NaN,C=v.time&&(b!=null&&b.time)?x(b.time)-x(v.time):null;return C?Number((T=>T/1e3)(C).toFixed(1)):null};return(v,y)=>(l.openBlock(),l.createElementBlock("ul",{class:"message-list tw:transition-all tw:overflow-y-scroll tw:flex-1 tw:list-none tw:pb-4",ref_key:"messageListRef",ref:t,onScroll:g},[n.showWelcome?(l.openBlock(),l.createElementBlock("li",{key:0,class:l.normalizeClass(["tw:transition-all",["tw:text-"+(n.configDesignClass.getKey("sections.inside.params.size")==="sm"?"xs":n.configDesignClass.getKey("sections.inside.params.size")==="md"?"sm":"base")]]),style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.inside.welcomeMessage.color"),"margin-bottom":`${n.configDesignClass.getKey("settings.gapMessageLine")}px`})},[l.createElementVNode("div",{key:"message",class:l.normalizeClass(["tw:transition-all",f.value]),style:l.normalizeStyle({borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.inside.welcomeMessage.borderRadius")+"px",color:n.configDesignClass.getKey("sections.inside.welcomeMessage.color"),background:w.value,lineHeight:n.configDesignClass.getKey("settings.lineHeight"),fontSize:n.configDesignClass.getKey("sections.inside.welcomeMessage.fontSize")+"px",letterSpacing:n.configDesignClass.getKey("settings.letterSpacing")+"px",border:`${n.configDesignClass.getKey("sections.inside.welcomeMessage.borderWidth")}px solid ${n.configDesignClass.getKey("sections.inside.welcomeMessage.borderColor")}`})},[l.createElementVNode("div",{innerHTML:l.unref(vn)(n.configDesignClass.getKey("texts.welcomeMessage"))},null,8,Hd)],6)],6)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(b,x)=>{var C,k,R;return l.openBlock(),l.createElementBlock(l.Fragment,{key:x},[b.snippet?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(b.isUser?Pd:b.isSystem?n.isProduction&&o.value!=="steps"?di:Ud:Ad),{key:0,message:b,"data-component":b.isSystem?n.isProduction&&o.value!=="steps"?"LoadingMessage":"MessageSystem":"MessageBot",style:l.normalizeStyle({borderRadius:h(b.isUser),"margin-top":`${(C=c.value[x-1])!=null&&C.isSystem&&!b.isSystem?"12px":"0px"}`,"margin-bottom":`${b.isSystem?"2px":n.configDesignClass.getKey("settings.gapMessageLine")+"px"}`,lineHeight:n.configDesignClass.getKey("settings.lineHeight"),letterSpacing:n.configDesignClass.getKey("settings.letterSpacing")+"px"}),loader:n.configDesignClass.getKey("settings.loader"),color:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.color"):n.configDesignClass.getKey("sections.inside.messageBot.color"),welcomeColor:n.configDesignClass.getKey("sections.inside.messageUser.color"),bgType:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.bgType"):n.configDesignClass.getKey("sections.inside.messageBot.bgType"),bgColor:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.bgColor"):n.configDesignClass.getKey("sections.inside.messageBot.bgColor"),size:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.size"):n.configDesignClass.getKey("sections.inside.messageBot.size"),fontSize:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.fontSize"):n.configDesignClass.getKey("sections.inside.messageBot.fontSize"),borderWidth:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.borderWidth"):n.configDesignClass.getKey("sections.inside.messageBot.borderWidth"),borderColor:b.isUser?n.configDesignClass.getKey("sections.inside.messageUser.borderColor"):n.configDesignClass.getKey("sections.inside.messageBot.borderColor"),index:x,isProduction:n.isProduction||!1,loadingTime:b.isUser?0:((k=b.meta)==null?void 0:k.traceLoadingTime)??m(b),traceLastShown:n.traceLastShown,configDesignClass:n.configDesignClass,ttsUrl:n.ttsUrl,activeMessage:n.activeMessage===b,isLast:x===c.value.length-1,paused:(R=b.meta)==null?void 0:R.tracePaused,borderRadius:h(b.isUser),onClick:_=>i(b)},null,8,["message","data-component","style","loader","color","welcomeColor","bgType","bgColor","size","fontSize","borderWidth","borderColor","index","isProduction","loadingTime","traceLastShown","configDesignClass","ttsUrl","activeMessage","isLast","paused","borderRadius","onClick"]))],64)}),128)),n.isLoading?(l.openBlock(),l.createBlock(di,{key:1,class:l.normalizeClass({"tw:mt-8":n.traceLastShown}),borderRadius:h(!1),isProduction:n.isProduction||!1,loader:n.configDesignClass.getKey("settings.loader"),configDesignClass:n.configDesignClass,color:a.value.headerText,bgColor:a.value.headerFillColor,text:n.configDesignClass.getKey("texts.typingLoader")},null,8,["class","borderRadius","isProduction","loader","configDesignClass","color","bgColor","text"])):l.createCommentVNode("",!0),l.renderSlot(v.$slots,"footer")],544))}}),qd=l.defineComponent({__name:"ChatMessagesContainer",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},showWelcome:{type:Boolean},isProcessError:{type:Boolean},restartChat:{type:Function},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage","update:activeMessage"],setup(n,{emit:e}){const t=n,s=l.computed(()=>t.ttsUrl),r=e,i=l.computed({get:()=>t.activeMessage,set:o=>r("update:activeMessage",o)});return(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full tw:min-h-0",style:l.normalizeStyle([{flex:"1 1 0"},{paddingLeft:(n.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingRight:(n.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingTop:(n.configDesignClass.getKey("sections.inside.params.verticalPadding")??8)+"px"}])},[l.createVNode(jd,{messages:n.messages,isPreview:n.isPreview,isEmbedded:n.isEmbedded,configDesignClass:n.configDesignClass,isLoading:n.isLoading,isStreaming:n.isStreaming,isProduction:n.isProduction,sectionBorderRadius:n.sectionBorderRadius,showWelcome:n.showWelcome,ttsUrl:s.value,activeMessage:i.value,"onUpdate:activeMessage":a[0]||(a[0]=c=>i.value=c),traceLastShown:n.traceLastShown,onHandleClickMessage:a[1]||(a[1]=c=>o.$emit("handleClickMessage",c))},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","ttsUrl","activeMessage","traceLastShown"])],4))}}),Gd={key:0,class:"chat tw:w-full tw:h-full tw:flex tw:pt-0 tw:relative",style:{overflow:"hidden"}},Zd={key:0,class:"tw:w-full tw:h-full"},Yd={key:1,class:"messages tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full"},Xd="https://hs-generator.onrender.com/api/transcribe",Qd="https://hs-generator.onrender.com/api/tts",cs=0,Jd=l.defineComponent({__name:"ChatWrapper",props:{link:{},isEmbedded:{type:Boolean},isPreview:{type:Boolean},configWidget:{},configLink:{},scenario:{},scenarioOptions:{},widgetId:{},isProduction:{type:Boolean}},emits:["trace","choose-trace","restart-chat"],setup(n,{expose:e,emit:t}){const s=t,r=l.ref(!1),i=l.ref(!1),o=l.ref(null),a=l.ref(!1),c=l.ref(!1),u=l.ref(!1),d=l.ref(!1),g=l.ref(!0),p=l.ref(!1),f=l.ref(!1),w=l.ref(!1),h=l.ref(0),m=l.ref(!1),v=l.ref(null),y=n,b=async()=>{if(!(y.isPreview||y.scenario))try{s("restart-chat"),Go(),await Bs()}catch(S){console.error("Failed to restart chat connection",S)}},x=l.computed(()=>{const S=P.value.getKey("settings.position"),z=P.value.getKey("settings.offset.x"),B=P.value.getKey("settings.offset.y"),O=Z.value?P.value.getKey("settings.size.width"):P.value.getKey("sections.colapsed.width"),G=Z.value?P.value.getKey("settings.size.height"):P.value.getKey("sections.colapsed.height");return{...{...S==="topLeft"?{top:B+"px",left:z+"px"}:{},...S==="topRight"?{top:B+"px",right:z+"px"}:{},...S==="bottomLeft"?{bottom:B+"px",left:z+"px"}:{},...S==="bottomRight"?{bottom:B+"px",right:z+"px"}:{},...S==="top"?{top:B+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="bottom"?{bottom:B+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="left"?{left:z+"px",top:"50%",transform:"translateY(-50%)"}:{},...S==="right"?{right:z+"px",top:"50%",transform:"translateY(-50%)"}:{}},width:Z.value&&!re.value?O+"px":void 0,height:Z.value||re.value?G+"px":void 0}}),C=()=>{if(y.configLink)return y.configLink;const z=new URLSearchParams(window.location.search).get("config");if(z)return z},k=l.ref(null),R=l.ref(null),_=l.ref(null),T=()=>_.value?_.value:C()?R.value&&typeof R.value=="object"?R.value:j:y.configWidget?y.configWidget:j,A=l.shallowRef(j);l.watchEffect(async S=>{const z=T();let B=!1;S(()=>{B=!0}),console.log("test");const O=await Jc(z,{verbose:!0});if(B)return;const G=O??z,{isValid:pe,errors:ve}=eu(G);if(console.log(G),!pe){console.warn("[HSW] Invalid widget config (after migration), falling back to DEFAULT_CONFIG:",ve),A.value=j;return}A.value=G});const M=S=>{k.value=S,s("choose-trace",{action:S.type,messages:[S]})},I=async()=>{s("choose-trace",{action:"copyAll",messages:te.value})},W=async()=>{if(te.value.length===0){s("choose-trace",{action:"copyLast",messages:[]});return}let S=-1;for(let B=te.value.length-1;B>=0;B--)if(te.value[B].isUser){S=B;break}const z=S>=0?S:0;s("choose-trace",{action:"copyLast",messages:te.value.slice(z)})},ee=async S=>{switch(S.action){case"copyLast":await W();break;case"copyIteration":await W();break;case"copyAll":await I();break}},P=l.computed(()=>new tu(A.value)),N=l.computed(()=>Ri(P.value)),K=l.computed(()=>ws(P.value,8)),D=l.computed(()=>P.value.getConfig().settings.container),L=l.computed(()=>{const S=D.value;if(!S)return!1;const z=S.innerBorder,B=S.outerBorder;return((z==null?void 0:z.width)??0)>0||((B==null?void 0:B.width)??0)>0?(z==null?void 0:z.width)!==0||(B==null?void 0:B.width)!==0:!1}),U=l.computed(()=>{var es,ts,ss,ns,E,Sr;const S=D.value,z=P.value.getKey("settings.bgChat"),B=S==null?void 0:S.gradient,O=B?`linear-gradient(360deg, ${z} 78.99%, ${B} 100%)`:"",G=typeof B=="string"&&B.trim()&&B!=="transparent"?O:z,pe=((es=S==null?void 0:S.innerBorder)==null?void 0:es.width)??0,ve=((ts=S==null?void 0:S.innerBorder)==null?void 0:ts.color)??"transparent",Te=((ss=S==null?void 0:S.innerBorder)==null?void 0:ss.style)??"solid",Dt=((ns=S==null?void 0:S.outerBorder)==null?void 0:ns.width)??0,Ms=((E=S==null?void 0:S.outerBorder)==null?void 0:E.color)??"transparent",Es=((Sr=S==null?void 0:S.outerBorder)==null?void 0:Sr.style)??"solid",je={background:G,borderRadius:`${String(N.value)}px`};return je["--hsw-container-radius"]=`${String(N.value)}px`,je["--hsw-container-inner-width"]=`${pe}px`,je["--hsw-container-inner-color"]=ve,je["--hsw-container-inner-style"]=Te,je["--hsw-container-outer-width"]=`${Dt}px`,je["--hsw-container-outer-color"]=Ms,je["--hsw-container-outer-style"]=Es,je}),ge=l.computed(()=>{switch(P.value.getKey("sections.bottom.params.size")){case"sm":return"tw:min-h-[25px]";case"md":return"tw:min-h-[45px]";case"lg":return"tw:min-h-[60px]"}}),Z=l.ref(!0),ie=()=>{const S=o.value;if(!S)return{width:56,height:56};const z=S.querySelector(".chat-action");if(!z)return{width:56,height:56};const B=z.getBoundingClientRect();return{width:Math.max(1,B.width),height:Math.max(1,B.height)}},Q=l.ref(!1),_e=async S=>{if(Q.value)return;Q.value=!0;const z=o.value;if(!z||S===Z.value)return;const B=z.querySelector(".chatWrapper"),O=B==null?void 0:B.querySelector(".chat");if(S){const G=z.querySelector(".chat-collapsed");G&&(q.killTweensOf(G),q.to(G,{opacity:1,duration:.15,ease:"power2.in"}));const{height:pe,width:ve}=ie();await new Promise(Dt=>setTimeout(Dt,150)),Z.value=!0,await l.nextTick();const Te=Math.max(pe||0,ve||0)||56;q.killTweensOf(z),O&&q.killTweensOf(O),B&&q.killTweensOf(B),q.set(z,{width:Te,height:Te,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),B&&q.set(B,{opacity:0,willChange:"opacity"}),O&&q.set(O,{opacity:0,willChange:"opacity"}),q.set(z,{width:Te,height:Te,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),q.to(z,{width:P.value.getKey("settings.size.width"),height:P.value.getKey("settings.size.height"),opacity:1,duration:.4,ease:"power2.out",onComplete:()=>{q.set(z,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange,opacity"}),Q.value=!1}}),B&&q.to(B,{opacity:1,duration:.3,delay:.35,ease:"power2.out",onComplete:()=>{q.set(B,{clearProps:"willChange,opacity"})}}),O&&q.to(O,{opacity:1,duration:.3,delay:.15,ease:"power2.out",onComplete:()=>{q.set(O,{clearProps:"willChange"})}})}else{const G=P.value.getKey("sections.colapsed.height")+P.value.getKey("sections.colapsed.borderWidth")*2;q.killTweensOf(z),O&&q.killTweensOf(O),B&&q.killTweensOf(B),q.set(z,{width:P.value.getKey("settings.size.width"),height:P.value.getKey("settings.size.height"),overflow:"hidden",willChange:"width, height, opacity"}),B&&(q.set(B,{willChange:"opacity"}),q.to(B,{opacity:0,duration:.5,ease:"power3.inOut",onComplete:()=>{q.set(B,{clearProps:"willChange,opacity"})}})),O&&(q.set(O,{willChange:"opacity"}),q.to(O,{opacity:0,duration:.2,ease:"power2.in",onComplete:()=>{q.set(O,{clearProps:"willChange"})}})),q.to(z,{width:G,height:G,opacity:0,duration:.35,marginTop:0,ease:"power2.inOut",onComplete:()=>{Z.value=!1,l.nextTick().then(()=>{const pe=z.querySelector(".chat-collapsed");pe&&(q.set(pe,{opacity:0}),q.to(pe,{opacity:1,duration:.25,ease:"power2.out"})),q.set(z,{opacity:1})}),q.set(z,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange"}),Q.value=!1}})}},Ue=l.ref(y.isPreview||!1),re=l.ref(y.isEmbedded||!1);l.watch(()=>y.isEmbedded,S=>{re.value=S});const zs=l.ref(!!y.isPreview),He=l.ref(y.widgetId||`hsw-${Math.random().toString(36).slice(2,10)}`),te=l.ref([]),Xe=l.ref("");let ae=null,xt=0;const jo=l.computed(()=>te.value.length>0&&te.value[te.value.length-1].isUser===!0||c.value),Qt=l.ref(null),qo=(S,z)=>{console.log("handleSnippetAction",S,z),yr({action:{sequence:z,command:S,data:{}}}),Qt.value=null},Ne=S=>{var z,B;if(S.chunkId&&S.text){const O=te.value.find(G=>G.chunkId===S.chunkId);O?((z=S.chunk)!=null&&z.start?O.text="":O.text+=S.text,O.chunk.start=!1,O.chunk.end=!!((B=S.chunk)!=null&&B.end)||!1):te.value.push(S)}else te.value.push(S)},Jt=(()=>{if(y.link)return y.link;const z=new URLSearchParams(window.location.search).get("link");if(z)return z;const O=new URLSearchParams(window.location.hash.substring(1)).get("link");if(O)return O;try{const G="ws://localhost:8080/client/widget-chat/v1/ws/?token=zGsb5gku1VnAdz5M2O0Zzjdt-A25JVwxoRvkyBEC5N5nzI2RTcbuo0Wswdx21rXqypzBwUjGPNLy3XgMeyeDL4343ZqYZ8PRzFCneayYEoE-hgGpraSfDk0Rt1f_gd2r5sWwalZPNAtHtC2y9kelWuwWOA";if(G)return G}catch(G){console.warn("Environment variables not available:",G)}return console.log("Using fallback link: ws://localhost:3000"),"ws://localhost:3000"})(),wr=()=>{if(xt>=cs){Ne({text:`Failed to connect after ${cs} attempts. Please check your connection.`,isUser:!1});return}xt++,console.log(`Reconnection attempt ${xt}/${cs}`),setTimeout(()=>{sn()},2e3*xt)},br=()=>{Ne({text:Do.UserMessage,isUser:!0}),Ne({text:"{Agent response message}",isUser:!1})},sn=()=>{try{if(!Jt||typeof Jt!="string"){console.error("Invalid WebSocket link:",Jt),Ne({text:"Error: Invalid WebSocket URL",isUser:!1});return}if(console.log("Attempting to connect to:",Jt),ae=new WebSocket(Jt),!ae){console.error("Failed to create WebSocket instance");return}ae.onmessage=S=>{var z,B,O,G,pe,ve,Te,Dt,Ms,Es,je,es,ts,ss,ns;try{const E=JSON.parse(S.data);if(E.snippet){Qt.value={...E.snippet,data:JSON.parse(E.snippet.data||"{}")};return}if(E.error)return Ne({text:E.error.message,isUser:!1,isSystem:!0,isError:!0});if((z=E==null?void 0:E.textChunk)!=null&&z.start&&(m.value=!0,v.value=(B=E==null?void 0:E.textChunk)==null?void 0:B.start,Ne({text:"",isUser:!1,chunkId:(O=E==null?void 0:E.textChunk)==null?void 0:O.start,time:(G=E==null?void 0:E.textChunk)!=null&&G.time?(pe=E==null?void 0:E.textChunk)==null?void 0:pe.time:new Date().toISOString(),chunk:E==null?void 0:E.textChunk})),(ve=E==null?void 0:E.textChunk)!=null&&ve.end||(Te=E==null?void 0:E.textChunk)!=null&&Te.start){(Dt=E==null?void 0:E.textChunk)!=null&&Dt.end&&v.value&&((Ms=E==null?void 0:E.textChunk)==null?void 0:Ms.end)===v.value&&(m.value=!1,v.value=null,Ne({text:" ",isUser:!1,chunkId:(Es=E==null?void 0:E.textChunk)==null?void 0:Es.end,time:(je=E==null?void 0:E.textChunk)!=null&&je.time?(es=E==null?void 0:E.textChunk)==null?void 0:es.time:new Date().toISOString(),chunk:E==null?void 0:E.textChunk}));return}(ts=E==null?void 0:E.textChunk)!=null&&ts.text&&Ne({text:E.textChunk.text,isUser:!1,chunkId:(ss=E==null?void 0:E.textChunk)==null?void 0:ss.id,chunk:E==null?void 0:E.textChunk}),E!=null&&E.trace&&Ne({text:E.trace.message,isUser:!1,isSystem:!0,meta:E.trace.meta,time:E.trace.time,type:E.trace.type}),(ns=E==null?void 0:E.trace)!=null&&ns.meta&&!y.isProduction&&s("trace",{action:E.trace.type,messages:[E.trace]})}catch(E){console.error("Error parsing WebSocket message:",E),Ne({text:"Error: Failed to parse server response",isUser:!1})}},ae.onopen=()=>{xt=0},ae.onclose=S=>{console.log("Connection closed",S);let z=`Connection closed (${S.code})`;switch(S.code){case 1e3:z="Connection closed normally";break;case 1001:z="Connection closed: going away";break;case 1006:if(d.value=!0,xt<cs&&!Ue.value){wr();return}break;case 1011:z="Connection closed: server error";break;default:u.value=!0}console.log(z)},ae.onerror=S=>{console.error("WebSocket connection error:",S),a.value=!0,Ne({text:"Connection error: Unable to connect to chat server",isUser:!1,isSystem:!0,isError:!0}),xt<cs&&!Ue.value&&wr()}}catch(S){console.error("Error connecting to socket server:",S),Ne({text:`Connection error: ${S instanceof Error?S.message:"Unknown error"}`,isUser:!1,isSystem:!0,isError:!0})}},Go=()=>{ae&&ae.close(),ae=null};l.onUnmounted(()=>{ae&&ae.close()});const nn=S=>{(y.isPreview||y.scenario)&&!S||_e(!Z.value)},Zo=()=>{if(!(y.isPreview||y.scenario)&&Xe.value.trim()!==""){if(y.isProduction&&te.value.length>0){const S=te.value[te.value.length-1];S.isSystem===!0&&!S.isError&&!S.snippet&&te.value.pop()}te.value.push({text:Xe.value,isUser:!0,time:new Date().toISOString()}),m.value=!0,yr({message:Xe.value}),Xe.value=""}},yr=S=>{ae&&ae.send(JSON.stringify(S))},vr=()=>{try{const S=P.value.getKey("settings.fontFamily")||"MacPaw Fixel",z=`https://fonts.googleapis.com/css2?family=${S.replace(/\s+/g,"+")}:wght@300;400;500;600;700&display=swap`,B=document.createElement("link");B.rel="preload",B.as="style",B.href=z,document.head.appendChild(B);const O=document.createElement("link");O.rel="stylesheet",O.href=z,O.setAttribute("data-google-font","true"),document.head.appendChild(O),o.value&&(o.value.style.fontFamily=`"${S}", sans-serif`)}catch(S){console.error("Error loading font:",S)}},xr=()=>{const S=P.value.getKey("settings.fontWeight")||400;o.value&&(o.value.style.fontWeight=S)};i.value=!0,l.watch(()=>P.value.getKey("settings.fontFamily"),()=>{vr()}),l.watch(()=>P.value.getKey("settings.fontWeight"),()=>{xr()});const Yo=async()=>{if(C()){const z=await(await fetch(C()+"config")).json();R.value=z,r.value=!0}else r.value=!0},rn=(S,z,B)=>new Promise(O=>{const G=performance.now(),pe=ve=>{const Te=Math.min(1,(ve-G)/B);h.value=S+(z-S)*Te,Te<1?requestAnimationFrame(pe):O()};requestAnimationFrame(pe)}),Cr=async S=>{w.value=!0,h.value=0,await l.nextTick(),await rn(0,.3,500),S(),await rn(.3,.6,200),h.value=.6,await new Promise(z=>setTimeout(z,100)),await rn(.6,0,500),w.value=!1},Xo=async(S=25)=>{const z=te.value.filter(O=>!O.isUser&&!O.isSystem&&O.text);if(!z.length)return;const B=z.map(O=>O.text||"");z.forEach(O=>O.text="");for(let O=0;O<z.length;O++){const G=z[O],pe=B[O];for(let ve=0;ve<pe.length;ve++)G.text=pe.slice(0,ve+1),await new Promise(Te=>setTimeout(Te,S))}},Qo=async(S,z=2e3)=>{if(!(S!=null&&S.length))return;const B=Math.round(S.length*z/1e3);for(let O=0;O<S.length;O++){const G=S[O];O===S.length-1&&(G.meta={...G.meta,tracePaused:!0,traceLoadingTime:B}),te.value.push(G),await new Promise(ve=>setTimeout(ve,z))}},on=async(S,z)=>{var O;if(S==="preview"){br();return}const B=ri.getState(S,P.value,z||y.scenarioOptions);await Cr(()=>{if(Z.value=B.isChatOpen,te.value=B.messages,c.value=B.traceLastShown,a.value=B.isConnectionError,u.value=B.isProcessError,d.value=B.isReconnectError,p.value=B.isInputDisabled,g.value=B.showWelcome,f.value=B.showReconnectNotice??!1,Qt.value=B.snippet??null,Ue.value=!0,ae){try{ae.close()}catch{}ae=null}}),B.useTypewriterAnimation&&await Xo(),(O=B.pendingTraces)!=null&&O.length&&await Qo(B.pendingTraces,B.traceAnimationDelay??2e3)},Bs=async()=>{await Cr(()=>{Ue.value=zs.value,g.value=!0,p.value=!1,f.value=!1,a.value=!1,u.value=!1,d.value=!1,te.value=[],Ue.value||(!ae||ae.readyState!==1)&&sn()})};l.onBeforeMount(async()=>{await Yo()}),l.onMounted(async()=>{vr(),xr();const S=y.scenario??ri.getScenarioFromUrl();if(S){await on(S);return}if(y.isPreview){br();return}sn()}),l.watch(()=>y.scenario,async S=>{S?await on(S):await Bs()});const Ae={id:He,setScenario:async(S,z)=>{await on(S,z)},clearScenario:async()=>{await Bs()},toggleChat:()=>{nn(!0)},setOpen:S=>{Z.value=S},setActive:S=>{S&&!Z.value&&(Z.value=!0)},setInputDisabled:S=>{p.value=S},setShowReconnectNotice:S=>{f.value=S},setMessages:S=>{te.value=Array.isArray(S)?S:[]},pushMessage:S=>{te.value.push(S)},setSnippet:S=>{Qt.value=S??null},resetToLive:async()=>{await Bs()},setConfig:S=>{_.value=JSON.parse(JSON.stringify(S))},getConfig:()=>A.value},Jo=()=>{const S=window;S.hswWidgets=S.hswWidgets||{},S.hswWidgets[He.value]=Ae,window.dispatchEvent(new CustomEvent("hsw:ready",{detail:{widgetId:He.value}}))},ea=()=>{const S=window;S.hswWidgets&&S.hswWidgets[He.value]&&delete S.hswWidgets[He.value]},kr=async S=>{var G;const z=S,B=(G=z.detail)==null?void 0:G.widgetId;if(B&&B!==He.value)return;const{action:O}=z.detail;switch(O){case"setScenario":await Ae.setScenario(z.detail.payload.type,z.detail.payload.options);break;case"clearScenario":await Ae.clearScenario();break;case"setOpen":Ae.setOpen(z.detail.payload);break;case"setActive":Ae.setActive(z.detail.payload);break;case"setInputDisabled":Ae.setInputDisabled(z.detail.payload);break;case"setShowReconnectNotice":Ae.setShowReconnectNotice(z.detail.payload);break;case"setMessages":Ae.setMessages(z.detail.payload);break;case"pushMessage":Ae.pushMessage(z.detail.payload);break;case"setSnippet":Ae.setSnippet(z.detail.payload);break;case"resetToLive":await Ae.resetToLive();break;case"setConfig":Ae.setConfig(z.detail.payload);break}};return l.onMounted(()=>{Jo(),window.addEventListener("hsw:control",kr)}),l.onUnmounted(()=>{ea(),window.removeEventListener("hsw:control",kr)}),e(Ae),(S,z)=>r.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["tw:z-[999] tw:flex tw:justify-end component-isolator tw:transition-all chatContainer",{"tw:fixed":!re.value,"tw:w-full":Z.value}]),style:l.normalizeStyle({letterSpacing:P.value.getKey("settings.letterSpacing")+"px",...x.value}),ref_key:"chatWrapperRef",ref:o},[l.withDirectives(l.createVNode(Tc,{toggleChat:nn,element:P.value.getKeyObject("sections.colapsed")},null,8,["element"]),[[l.vShow,!Z.value]]),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(["chatWrapper tw:w-full tw:backdrop-blur-[22px] tw:flex tw:items-center tw:border-0 tw:flex-col",[{"chatWrapper--pseudoBorders":L.value,"tw:h-auto tw:shadow-2xl chat-active":Z.value,"tw:shadow-lg tw:w-fit":!Z.value,"chat-embedded tw:w-full tw:h-full tw:static tw:top-0 tw:left-0":re.value}]]),style:l.normalizeStyle(U.value)},[l.createVNode(du,{isChatOpen:Z.value,toggleChat:nn,configDesignClass:P.value,sectionBorderRadius:K.value,mainBorderRadius:N.value,isPreview:Ue.value,isEmbedded:re.value,isProduction:n.isProduction||!1,restartChat:b},null,8,["isChatOpen","configDesignClass","sectionBorderRadius","mainBorderRadius","isPreview","isEmbedded","isProduction"]),Z.value?(l.openBlock(),l.createElementBlock("div",Gd,[a.value?(l.openBlock(),l.createElementBlock("div",Zd,[l.createElementVNode("div",{class:"tw:absolute tw:left-0 tw:top-0 tw:w-full tw:h-full",style:l.normalizeStyle({padding:P.value.getKey("sections.warnings.launchIssue.content.sidePadding")+"px"})},[l.createVNode(Ar,{type:"launchIssue",class:"tw:h-full",headlineText:P.value.getKey("texts.launchIssueTitle"),descriptionText:P.value.getKeyObject("texts.launchIssueText"),warningElement:P.value.getKeyObject("sections.warnings.launchIssue"),configDesignClass:P.value,isProcessError:u.value,restartChat:b},null,8,["headlineText","descriptionText","warningElement","configDesignClass","isProcessError"])],4)])):(l.openBlock(),l.createElementBlock("div",Yd,[l.createVNode(qd,{messages:te.value,isPreview:Ue.value,isEmbedded:re.value,configDesignClass:P.value,isLoading:jo.value,isStreaming:m.value,isProduction:n.isProduction,sectionBorderRadius:K.value,showWelcome:g.value,ttsUrl:Qd,activeMessage:k.value,"onUpdate:activeMessage":z[0]||(z[0]=B=>k.value=B),isProcessError:u.value,traceLastShown:c.value,onHandleClickMessage:M,restartChat:b},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","activeMessage","isProcessError","traceLastShown"]),u.value?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({padding:P.value.getKey("sections.warnings.connectionIssue.content.sidePadding")+"px"})},[l.createVNode(Ar,{type:"connectionIssue",headlineText:P.value.getKey("texts.issueText"),configDesignClass:P.value,warningElement:P.value.getKeyObject("sections.warnings.connectionIssue"),restartChat:b},null,8,["headlineText","configDesignClass","warningElement"])],4)):(l.openBlock(),l.createBlock(Bu,{key:1,messageText:Xe.value,"onUpdate:messageText":z[1]||(z[1]=B=>Xe.value=B),isPreview:Ue.value,isProduction:n.isProduction||!1,configDesignClass:P.value,sectionBorderRadius:K.value,classSize:ge.value,sendMessage:Zo,isInputDisabled:p.value,showReconnectNotice:f.value,restartChat:b,isStreaming:m.value,mainBorderRadius:N.value,transcribeUrl:Xd,snippet:Qt.value,onTrace:ee,onSnippetAction:qo},null,8,["messageText","isPreview","isProduction","configDesignClass","sectionBorderRadius","classSize","isInputDisabled","showReconnectNotice","isStreaming","mainBorderRadius","snippet"]))]))])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[w.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:absolute tw:inset-0 tw:backdrop-blur-[40px] tw:z-[1000]",style:l.normalizeStyle({borderRadius:`${String(N.value)}px`,backgroundColor:`rgba(0,0,0, ${h.value})`})},null,4)):l.createCommentVNode("",!0)]),_:1})],6),[[l.vShow,i.value&&Z.value]])],6)):l.createCommentVNode("",!0)}}),nt=n=>{const e=window,t=n||Object.keys(e.hswWidgets||{})[0];if(!e.hswWidgets||!e.hswWidgets[t])throw new Error("HSW widget API not ready. Wait for hsw:ready event or pass correct widgetId");return e.hswWidgets[t]},e1=async(n,e,t)=>nt(t).setScenario(n,e),t1=async n=>nt(n).clearScenario(),s1=(n,e)=>nt(e).setOpen(n),n1=(n,e)=>nt(e).setActive(n),r1=(n,e)=>nt(e).setInputDisabled(n),i1=(n,e)=>nt(e).setShowReconnectNotice(n),o1=(n,e)=>nt(e).setMessages(n),a1=(n,e)=>nt(e).pushMessage(n),l1=(n,e)=>nt(e).setSnippet(n),c1=async n=>nt(n).resetToLive();exports.ChatWrapper=Jd;exports.clearScenario=t1;exports.cn=Fn;exports.pushMessage=a1;exports.resetToLive=c1;exports.setActive=n1;exports.setInputDisabled=r1;exports.setMessages=o1;exports.setOpen=s1;exports.setScenario=e1;exports.setShowReconnectNotice=i1;exports.setSnippet=l1;
105
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ct(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=ci(n);if(r===null)return s;n=r;let i='<a href="'+n+'"';return e&&(i+=' title="'+ct(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=ci(n);if(r===null)return ct(t);n=r;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${ct(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ct(n.text)}},wr=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Ye=class Nn{constructor(e){I(this,"options");I(this,"renderer");I(this,"textRenderer");this.options=e||Nt,this.options.renderer=this.options.renderer||new Xs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wr}static parse(e,t){return new Nn(t).parse(e)}static parseInline(e,t){return new Nn(t).parseInline(e)}parse(e){var s,r;let t="";for(let i=0;i<e.length;i++){let o=e[i];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[o.type]){let c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=u||"";continue}}let a=o;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return t}parseInline(e,t=this.renderer){var r,i;let s="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=u||"";continue}}let c=a;switch(c.type){case"escape":{s+=t.text(c);break}case"html":{s+=t.html(c);break}case"link":{s+=t.link(c);break}case"image":{s+=t.image(c);break}case"checkbox":{s+=t.checkbox(c);break}case"strong":{s+=t.strong(c);break}case"em":{s+=t.em(c);break}case"codespan":{s+=t.codespan(c);break}case"br":{s+=t.br(c);break}case"del":{s+=t.del(c);break}case"text":{s+=t.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}},Ls,ms=(Ls=class{constructor(n){I(this,"options");I(this,"block");this.options=n||Nt}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Ze.lex:Ze.lexInline}provideParser(){return this.block?Ye.parse:Ye.parseInline}},I(Ls,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),I(Ls,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ls),Rd=class{constructor(...n){I(this,"defaults",cr());I(this,"options",this.setOptions);I(this,"parse",this.parseMarkdown(!0));I(this,"parseInline",this.parseMarkdown(!1));I(this,"Parser",Ye);I(this,"Renderer",Xs);I(this,"TextRenderer",wr);I(this,"Lexer",Ze);I(this,"Tokenizer",Ys);I(this,"Hooks",ms);this.use(...n)}walkTokens(n,e){var s,r;let t=[];for(let i of n)switch(t=t.concat(e.call(this,i)),i.type){case"table":{let o=i;for(let a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of o.rows)for(let c of a)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let o=i;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=i;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let c=o[a].flat(1/0);t=t.concat(this.walkTokens(c,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new Xs(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=t.renderer[o],c=r[o];r[o]=(...u)=>{let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Ys(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=t.tokenizer[o],c=r[o];r[o]=(...u)=>{let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new ms;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=t.hooks[o],c=r[o];ms.passThroughHooks.has(i)?r[o]=u=>{if(this.defaults.async&&ms.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await a.call(r,u);return c.call(r,f)})();let d=a.call(r,u);return c.call(r,d)}:r[o]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await a.apply(r,u);return f===!1&&(f=await c.apply(r,u)),f})();let d=a.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Ze.lex(n,e??this.defaults)}parser(n,e){return Ye.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer():n?Ze.lex:Ze.lexInline)(o,r),c=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():n?Ye.parse:Ye.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer():n?Ze.lex:Ze.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser():n?Ye.parse:Ye.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(n,e){return t=>{if(t.message+=`
106
+ Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+ct(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Ot=new Rd;function J(n,e){return Ot.parse(n,e)}J.options=J.setOptions=function(n){return Ot.setOptions(n),J.defaults=Ot.defaults,Vo(J.defaults),J};J.getDefaults=cr;J.defaults=Nt;J.use=function(...n){return Ot.use(...n),J.defaults=Ot.defaults,Vo(J.defaults),J};J.walkTokens=function(n,e){return Ot.walkTokens(n,e)};J.parseInline=Ot.parseInline;J.Parser=Ye;J.parser=Ye.parse;J.Renderer=Xs;J.TextRenderer=wr;J.Lexer=Ze;J.lexer=Ze.lex;J.Tokenizer=Ys;J.Hooks=ms;J.parse=J;J.options;J.setOptions;J.use;J.walkTokens;J.parseInline;Ye.parse;Ze.lex;function zd(n){const e=l.ref(!1),t=l.ref(!1),s=l.ref(null);let r=null,i=null;const o=()=>l.unref(n.ttsUrl),a=()=>{r&&(r.pause(),r.src="",r=null),i&&(URL.revokeObjectURL(i),i=null)},c=async g=>{const b=o();if(!b)throw s.value="TTS URL not configured",new Error(s.value);if(!(g!=null&&g.trim()))throw s.value="No text to speak",new Error(s.value);f(),t.value=!0,s.value=null;try{const h=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:g.trim(),voice:n.voice||"nova"})});if(!h.ok){const x=await h.json().catch(()=>({}));throw new Error(x.error||`TTS request failed: ${h.status}`)}const m=await h.blob();return i=URL.createObjectURL(m),new Promise((x,k)=>{r=new Audio(i),r.onplay=()=>{e.value=!0,t.value=!1},r.onended=()=>{e.value=!1,a(),x()},r.onerror=()=>{e.value=!1,t.value=!1,s.value="Audio playback failed",a(),k(s.value)},r.play().catch(w=>{t.value=!1,s.value=w.message,k(w)})})}catch(h){throw t.value=!1,s.value=h.message||"TTS failed",h}},u=()=>{r&&e.value&&(r.pause(),e.value=!1)},d=()=>{r&&!e.value&&(r.play(),e.value=!0)},f=()=>{e.value=!1,t.value=!1,a()},p=g=>{e.value?u():r&&r.paused&&r.currentTime>0?d():g&&c(g)};return l.onUnmounted(()=>{f()}),{isSpeaking:e,isLoading:t,error:s,speak:c,pause:u,resume:d,stop:f,toggle:p}}const Bd=["aria-label"],Md={key:1,width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ed=["aria-label","disabled"],Ad={key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pd=l.defineComponent({__name:"MessageBotActions",props:{messageText:{},color:{},ttsUrl:{},ttsEnabled:{type:Boolean},visible:{type:Boolean},textElementRef:{}},setup(n){const e=n,t=l.ref("idle"),s=l.ref(!1);let r;const i=()=>{r&&(window.clearTimeout(r),r=void 0)},o=(v=1500)=>{i(),r=window.setTimeout(()=>{t.value="idle"},v)},a=()=>{var y,_;const v=(_=(y=e.textElementRef)==null?void 0:y.innerText)==null?void 0:_.trim();return v||(e.messageText||"").trim()},c=v=>{const y=document.createElement("textarea");y.value=v,y.setAttribute("readonly",""),y.style.position="fixed",y.style.top="-9999px",y.style.left="-9999px",document.body.appendChild(y),y.select();const _=document.execCommand("copy");return document.body.removeChild(y),_},u=async()=>{var y;const v=a();if(v)try{if((y=navigator.clipboard)!=null&&y.writeText)await navigator.clipboard.writeText(v);else if(!c(v))throw new Error("execCommand(copy) failed");t.value="copied",o()}catch(_){console.warn("Copy failed",_),t.value="error",o(2e3)}},d=l.computed(()=>t.value==="copied"?"Copied":t.value==="error"?"Copy failed":"Copy"),f=l.computed(()=>s.value||t.value!=="idle"),p=l.computed(()=>e.ttsUrl),{speak:g,stop:b,isSpeaking:h,isLoading:m}=zd({ttsUrl:p,voice:"nova"}),x=l.ref(!1),k=l.computed(()=>m.value?"Loading...":h.value?"Stop":"Speak"),w=l.computed(()=>x.value||h.value||m.value),C=()=>{h.value?b():e.messageText&&g(e.messageText)};return l.onBeforeUnmount(()=>{i()}),(v,y)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tw:flex tw:items-center tw:transition-opacity tw:duration-200 tw:gap-1 tw:z-10 tw:justify-end",{"tw:opacity-0":!n.visible}])},[l.createElementVNode("div",{class:"tw:relative tw:flex",onMouseenter:y[2]||(y[2]=_=>s.value=!0),onMouseleave:y[3]||(y[3]=_=>s.value=!1)},[l.createElementVNode("span",{class:l.normalizeClass(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":f.value}]),role:"tooltip"},l.toDisplayString(d.value),3),l.createElementVNode("button",{class:"copy-button tw:opacity-80 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:opacity-100",onClick:l.withModifiers(u,["stop"]),onFocus:y[0]||(y[0]=_=>s.value=!0),onBlur:y[1]||(y[1]=_=>s.value=!1),"aria-label":d.value,type:"button"},[t.value==="copied"?(l.openBlock(),l.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:l.normalizeStyle({color:n.color,opacity:.7})},[...y[8]||(y[8]=[l.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)])],4)):(l.openBlock(),l.createElementBlock("svg",Md,[...y[9]||(y[9]=[l.createElementVNode("path",{d:"M10.6667 8.60004V11.4C10.6667 13.7334 9.73334 14.6667 7.40001 14.6667H4.60001C2.26668 14.6667 1.33334 13.7334 1.33334 11.4V8.60004C1.33334 6.26671 2.26668 5.33337 4.60001 5.33337H7.40001C9.73334 5.33337 10.6667 6.26671 10.6667 8.60004Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M11.4 1.33337H8.6C6.6793 1.33337 5.71167 1.97031 5.42923 3.49264C5.32764 4.04021 5.79499 4.50004 6.3519 4.50004H7.4C10.2 4.50004 11.5 5.80004 11.5 8.60004V9.64814C11.5 10.205 11.9598 10.6724 12.5074 10.5708C14.0297 10.2884 14.6667 9.32074 14.6667 7.40004V4.60004C14.6667 2.26671 13.7333 1.33337 11.4 1.33337Z",fill:"#A6A6A6"},null,-1)])]))],40,Bd)],32),n.ttsEnabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:relative tw:flex",onMouseenter:y[6]||(y[6]=_=>x.value=!0),onMouseleave:y[7]||(y[7]=_=>x.value=!1)},[l.createElementVNode("span",{class:l.normalizeClass(["tw:pointer-events-none tw:absolute tw:bottom-full tw:left-[-50%] tw:mb-2 tw:whitespace-nowrap tw:text-[11px] tw:px-2 tw:py-1 tw:rounded tw:bg-black/80 tw:text-white tw:opacity-0 tw:transition-opacity tw:duration-150 tw:z-10",{"tw:opacity-100":w.value}]),role:"tooltip"},l.toDisplayString(k.value),3),l.createElementVNode("button",{class:l.normalizeClass(["tts-button tw:opacity-80 tw:hover:opacity-100 tw:transition-opacity tw:duration-200 tw:cursor-pointer tw:rounded tw:hover:bg-white",{"tw:opacity-100":l.unref(h)||l.unref(m),"tts-speaking":l.unref(h),"tts-loading":l.unref(m)}]),onClick:l.withModifiers(C,["stop"]),onFocus:y[4]||(y[4]=_=>x.value=!0),onBlur:y[5]||(y[5]=_=>x.value=!1),"aria-label":k.value,disabled:l.unref(m),type:"button"},[l.unref(h)?(l.openBlock(),l.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",class:"tw:w-3.5 tw:h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",style:l.normalizeStyle({color:n.color,opacity:.6})},[...y[10]||(y[10]=[l.createElementVNode("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},null,-1),l.createElementVNode("line",{x1:"23",y1:"9",x2:"17",y2:"15"},null,-1),l.createElementVNode("line",{x1:"17",y1:"9",x2:"23",y2:"15"},null,-1)])],4)):(l.openBlock(),l.createElementBlock("svg",Ad,[...y[11]||(y[11]=[l.createElementVNode("path",{d:"M12 11.1666C11.8933 11.1666 11.7933 11.1333 11.7 11.0666C11.48 10.9 11.4333 10.5866 11.6 10.3666C12.6467 8.97331 12.6467 7.02664 11.6 5.63331C11.4333 5.41331 11.48 5.09998 11.7 4.93331C11.92 4.76665 12.2333 4.81331 12.4 5.03331C13.7067 6.77998 13.7067 9.21998 12.4 10.9666C12.3 11.1 12.1533 11.1666 12 11.1666Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M13.22 12.8334C13.1133 12.8334 13.0133 12.8 12.92 12.7334C12.7 12.5667 12.6533 12.2534 12.82 12.0334C14.6 9.66002 14.6 6.34002 12.82 3.96669C12.6533 3.74669 12.7 3.43335 12.92 3.26669C13.14 3.10002 13.4533 3.14669 13.62 3.36669C15.6667 6.09335 15.6667 9.90669 13.62 12.6334C13.5267 12.7667 13.3733 12.8334 13.22 12.8334Z",fill:"#A6A6A6"},null,-1),l.createElementVNode("path",{d:"M9.34668 2.52002C8.60001 2.10669 7.64668 2.21335 6.67334 2.82002L4.72668 4.04002C4.59334 4.12002 4.44001 4.16669 4.28668 4.16669H3.66668H3.33334C1.72001 4.16669 0.833344 5.05335 0.833344 6.66669V9.33335C0.833344 10.9467 1.72001 11.8334 3.33334 11.8334H3.66668H4.28668C4.44001 11.8334 4.59334 11.88 4.72668 11.96L6.67334 13.18C7.26001 13.5467 7.83334 13.7267 8.36668 13.7267C8.71334 13.7267 9.04668 13.6467 9.34668 13.48C10.0867 13.0667 10.5 12.2067 10.5 11.06V4.94002C10.5 3.79335 10.0867 2.93335 9.34668 2.52002Z",fill:"#A6A6A6"},null,-1)])]))],42,Ed)],32)):l.createCommentVNode("",!0)],2))}}),Dd={key:"message",class:"message-text tw:flex tw:items-end tw:gap-1 tw:transition-all"},Vd=["innerHTML"],$d=l.defineComponent({__name:"MessageBot",props:{message:{},welcomeColor:{},color:{},bgColor:{},size:{},bgType:{},fontSize:{},borderWidth:{},borderColor:{},configDesignClass:{},ttsUrl:{}},setup(n){J.setOptions({breaks:!0,gfm:!0});const e=n,t=l.computed(()=>{var u;return e.ttsUrl||((u=e.configDesignClass)==null?void 0:u.getKey("settings.ttsUrl"))||""}),s=l.computed(()=>!!t.value),r=l.ref(null),i=l.computed(()=>{var u,d;return!!(e.message.text&&!((u=e.message.chunk)!=null&&u.start)&&((d=e.message.chunk)!=null&&d.end))}),o=l.computed(()=>{var f,p;const u=(f=e.message.chunk)!=null&&f.start?"#2F2F31":e.color,d=(p=e.message.chunk)!=null&&p.start?"transparent":e.bgType==="bubble"?e.bgColor:"transparent";return{color:u,backgroundColor:d,fontSize:e.fontSize+"px",border:e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none","--hsw-message-table-header-bg":d&&d!=="transparent"?`color-mix(in srgb, ${d} 85%, white)`:d}}),a=l.computed(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),c=l.computed(()=>e.message.text?J.parse(e.message.text):"");return(u,d)=>{var f;return l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-item tw:flex tw:items-end tw:transition-all tw:text-white tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",[a.value,{"item-primary":!((f=n.message.chunk)!=null&&f.start)}]]),style:l.normalizeStyle(o.value)},[l.createElementVNode("div",Dd,[l.createElementVNode("span",{ref_key:"messageTextEl",ref:r,class:"tw:flex-1 tw:max-w-[100%] tw:overflow-x-scroll tw:flex markdown-content tw:flex-col",innerHTML:c.value},null,8,Vd)]),l.createVNode(Pd,{"message-text":n.message.text||"",color:n.color,"tts-url":t.value,"tts-enabled":s.value,visible:i.value,"text-element-ref":r.value},null,8,["message-text","color","tts-url","tts-enabled","visible","text-element-ref"])],6)}}}),Ld=l.defineComponent({__name:"MessageUser",props:{message:{},isFirst:{type:Boolean},color:{},bgColor:{},borderWidth:{},borderColor:{},fontSize:{},size:{},bgType:{},configDesignClass:{}},setup(n){const e=n,t=l.computed(()=>{switch(e.size){case"sm":return e.bgType==="bubble"?" tw:min-h-[25px] tw:py-1 tw:px-2 ":"";case"md":return e.bgType==="bubble"?" tw:min-h-[33px] tw:py-2 tw:px-3":"";case"lg":return e.bgType==="bubble"?" tw:min-h-[40px] tw:py-3 tw:px-4":""}}),s=l.computed(()=>e.bgType==="bubble"?e.borderWidth+"px solid "+e.borderColor:"none");return(r,i)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-item tw:transition-all tw:max-w-[95%] tw:w-fit tw:whitespace-break-spaces item-secondary tw:ml-auto",[t.value,{"tw:mt-[5px] !tw:bg-transparent":n.isFirst}]]),style:l.normalizeStyle({color:n.color,"background-color":n.bgType==="bubble"?n.bgColor:"transparent",border:s.value,"font-size":n.fontSize+"px"})},l.toDisplayString(n.message.text),7))}}),Od=["innerHTML"],Id=["innerHTML"],Nd=["innerHTML"],Fd=["innerHTML"],Kd=["data-text"],Wd=l.defineComponent({__name:"LoadingMessage",props:{isProduction:{type:Boolean},borderRadius:{},loader:{},text:{},message:{},configDesignClass:{},paused:{type:Boolean},color:{},bgColor:{},loadingTime:{}},setup(n){const e=n,t=l.ref(null),s=l.ref(!1);let r=null;const i=l.ref(null),o=l.ref(null),a=l.ref(null),c=l.ref(null),u=l.ref(null),d=l.ref(null),f=l.computed(()=>Number(e.configDesignClass.getKey("sections.loader.completeStep.icon.size"))||16),p=()=>{const k=t.value;if(!k)return;const w=k.closest("li");if(!w)return;const C=w.nextElementSibling;if(!C){s.value=!1;return}const v=C.getAttribute("data-component")==="MessageBot"||typeof C.matches=="function"&&C.matches('[data-component="MessageBot"]')||!!C.querySelector('[data-component="MessageBot"]');s.value=v},g=l.computed(()=>e.configDesignClass.getKey("sections.inside.dataAction.type")),b=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction"));l.onMounted(()=>{l.nextTick(p);const k=t.value,w=k==null?void 0:k.closest("ul");w&&(r=new MutationObserver(()=>p()),r.observe(w,{childList:!0,subtree:!0}))}),l.onBeforeUnmount(()=>{r&&r.disconnect()});const h=l.computed(()=>!!e.paused||s.value),m=()=>!e.loader||e.loader==="dots"?a.value:e.loader==="dots-pulse"?c.value:e.loader==="circle-pulse"?u.value:e.loader==="circle-pulse-1"?d.value:a.value,x=k=>{const w=m(),C=o.value,v=i.value;if(!w||!C||!v)return;const y=.3,_="power2.inOut";k?(H.to(w,{opacity:0,scale:.8,duration:y,ease:_}),H.fromTo(C,{opacity:0,scale:.8},{opacity:1,scale:1,duration:y,ease:_}),H.to(v,{width:f.value,duration:y,ease:_})):(H.to(C,{opacity:0,scale:.8,duration:y,ease:_}),H.fromTo(w,{opacity:0,scale:.8},{opacity:1,scale:1,duration:y,ease:_}),l.nextTick(()=>{const T=w.scrollWidth||f.value;H.to(v,{width:T,duration:y,ease:_})}))};return l.watch(h,(k,w)=>{k!==w&&x(k)}),l.onMounted(()=>{l.nextTick(()=>{const k=i.value,w=m();k&&w&&!h.value&&(k.style.width=w.scrollWidth+"px")})}),(k,w)=>{var C,v;return(C=n.message)!=null&&C.text?(l.openBlock(),l.createElementBlock("li",{key:"loading",ref_key:"rootRef",ref:t,class:l.normalizeClass(["message-text-loading tw:min-w-0 tw:flex tw:justify-start tw:overflow-hidden tw:flex-wrap tw:border-solid",{"tw:flex-col tw:border tw:max-w-xs":g.value==="box","tw:border tw:px-3 tw:py-2.5":g.value==="outline","tw:!rounded-none":g.value==="compact","tw:items-center tw:gap-2":g.value!=="box"}]),style:l.normalizeStyle({borderColor:b.value.strokeColor,borderWidth:(v=n.message)!=null&&v.text?b.value.strokeWidth+"px":0,borderRadius:n.borderRadius})},[g.value==="box"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:px-2 tw:py-2.5 tw:border-b",style:l.normalizeStyle({backgroundColor:b.value.headerFillColor,color:b.value.pastStepColor,borderColor:b.value.strokeColor,borderBottomWidth:b.value.strokeWidth+"px"})},[h.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"completeIconRef",ref:o,innerHTML:n.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({height:f.value+"px",width:f.value+"px"})},null,12,Od)):(l.openBlock(),l.createElementBlock("div",{key:1,ref:"activeIconRef",innerHTML:n.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({height:f.value+"px",width:f.value+"px"})},null,12,Id)),l.createElementVNode("span",{style:l.normalizeStyle({fontSize:n.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},l.toDisplayString(b.value.headerText),5)],4)):l.createCommentVNode("",!0),g.value!=="box"?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"loaderContainerRef",ref:i,class:"loader-container tw:flex tw:items-center tw:justify-center tw:overflow-hidden",style:l.normalizeStyle({height:f.value+"px",minWidth:f.value+"px"})},[h.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"completeIconRef",ref:o,innerHTML:n.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({color:b.value.activeStepColor,height:f.value+"px",width:f.value+"px"})},null,12,Nd)):(l.openBlock(),l.createElementBlock("div",{key:1,ref:"activeIconRef",innerHTML:n.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({color:b.value.activeStepColor,height:f.value+"px",width:f.value+"px"})},null,12,Fd))],4)):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"fade-text",mode:"out-in"},{default:l.withCtx(()=>{var y,_;return[l.createElementVNode("span",{class:l.normalizeClass(["tw:transition-all tw:leading-none",{"typing-shimmer":!h.value,"tw:px-3 tw:py-3":g.value==="box"}]),"data-text":(y=n.message)!=null&&y.text?(_=n.message)==null?void 0:_.text:"",style:l.normalizeStyle({color:b.value.activeStepColor,fontSize:n.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px",background:g.value==="box"?b.value.bodyFillColor:"transparent"})},l.toDisplayString(h.value?"Thinking completed":n.message.text?n.message.text:""),15,Kd)]}),_:1}),n.loadingTime&&n.loadingTime>0&&h.value&&(g.value==="outline"||g.value==="compact")?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["tw:text-xs",{"tw:w-full tw:-mt-2":g.value==="compact","tw:ml-auto":g.value==="outline"}]),style:l.normalizeStyle({color:b.value.pastStepColor})},l.toDisplayString(n.loadingTime)+" seconds total",7)):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)}}}),Ud=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},hi=Ud(Wd,[["__scopeId","data-v-862f7cdb"]]),Hd=["data-height"],jd={class:"tw:transition-all tw:relative tw:w-[16px] tw:flex tw:flex-col tw:items-center tw:gap-1 tw:px-1"},qd={class:"tw:transition-all tw:flex tw:items-center tw:gap-2 tw:leading-none"},Gd=l.defineComponent({__name:"MessageSystem",props:{isProduction:{type:Boolean},message:{},welcomeColor:{},color:{},bgColor:{},size:{},configDesignClass:{},activeMessage:{type:Boolean},bgType:{},isLast:{type:Boolean},traceLastShown:{type:Boolean},index:{}},setup(n){const e=n,t=l.computed(()=>e.index===3&&e.traceLastShown||e.isLast),s=l.computed(()=>{switch(e.size){case"sm":return"tw:text-xs";case"md":return"tw:text-xs";case"lg":return"tw:text-base"}}),r=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction")),i=l.computed(()=>t.value?r.value.activeStepColor:r.value.pastStepColor),o=l.computed(()=>lr(e.configDesignClass,"inside"));return(a,c)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(["message-system tw:text-left tw:relative tw:w-full tw:text-white tw:w-fit tw:whitespace-break-spaces tw:transition-colors tw:duration-[250ms] tw:ease-[ease]",s.value]),style:l.normalizeStyle([{"margin-bottom":"0px !important"},{"padding-top":n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+"px"}]),"data-height":n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")},[l.createElementVNode("div",{key:"message",class:l.normalizeClass(["message-text flex tw:transition-all tw:space-between tw:gap-3 tw:flex tw:items-center tw:align-center",{"tw:mb-0":n.isLast}])},[l.createElementVNode("div",jd,[l.createElementVNode("hr",{class:"tw:w-[1px] tw:absolute",style:l.normalizeStyle([{display:"none"},{height:n.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+n.configDesignClass.getKey("sections.loader.completeStep.fontSize")/2+6+"px",left:"50%",transform:"translateX(-50%)",bottom:"100%",border:0,backgroundColor:r.value.pastStepColor}])},null,4),l.createElementVNode("span",{class:"tw:w-[8px] tw:h-[8px] tw:rounded-full",style:l.normalizeStyle({backgroundColor:i.value})},null,4)]),l.createElementVNode("div",qd,[n.message.meta&&!n.isProduction?(l.openBlock(),l.createBlock(l.unref(ht),{key:0,style:l.normalizeStyle({color:e.activeMessage?"rgba(255, 255, 255, 0.60)":"#3F3F46",background:e.activeMessage?"#2F2F31":"#ECEDEE",border:e.activeMessage?"none":"1px solid #fff"}),class:l.normalizeClass(["tw:flex tw:items-center tw:gap-1 tw:rounded-md tw:shadow-xs",o.value])},{default:l.withCtx(()=>[c[0]||(c[0]=l.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{d:"M10.7935 1.33301H5.20683C2.78016 1.33301 1.3335 2.77967 1.3335 5.20634V10.7863C1.3335 13.2197 2.78016 14.6663 5.20683 14.6663H10.7868C13.2135 14.6663 14.6602 13.2197 14.6602 10.793V5.20634C14.6668 2.77967 13.2202 1.33301 10.7935 1.33301ZM6.62683 8.84634C6.1735 9.52634 5.54683 10.0797 4.8135 10.4463C4.74683 10.4797 4.66683 10.4997 4.5935 10.4997C4.40683 10.4997 4.2335 10.3997 4.14683 10.2263C4.02016 9.97967 4.12016 9.67967 4.3735 9.55301C4.9535 9.26634 5.44683 8.82634 5.80016 8.29301C5.92016 8.11301 5.92016 7.88634 5.80016 7.70634C5.44016 7.17301 4.94683 6.73301 4.3735 6.44634C4.12016 6.32634 4.02016 6.02634 4.14683 5.77301C4.26683 5.52634 4.56683 5.42634 4.8135 5.55301C5.54683 5.91967 6.1735 6.47301 6.62683 7.15301C6.9735 7.66634 6.9735 8.33301 6.62683 8.84634ZM11.3335 10.4997H8.66683C8.3935 10.4997 8.16683 10.273 8.16683 9.99967C8.16683 9.72634 8.3935 9.49967 8.66683 9.49967H11.3335C11.6068 9.49967 11.8335 9.72634 11.8335 9.99967C11.8335 10.273 11.6068 10.4997 11.3335 10.4997Z",fill:"currentColor"})],-1)),l.createElementVNode("span",null,l.toDisplayString(n.message.text),1)]),_:1},8,["style","class"])):(l.openBlock(),l.createElementBlock("p",{key:1,style:l.normalizeStyle({color:i.value,"font-size":n.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},l.toDisplayString(n.message.text),5))])],2)],14,Hd))}}),Zd=["innerHTML"],Yd=l.defineComponent({__name:"MessageList",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},showWelcome:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage"],setup(n,{emit:e}){const t=l.ref(null),s=n,r=e,i=x=>{x.meta&&r("handleClickMessage",x)},o=l.computed(()=>s.configDesignClass.getKey("sections.inside.dataAction.type")),a=l.computed(()=>s.configDesignClass.getKeyObject("sections.inside.dataAction")),c=l.computed(()=>s.messages.filter((x,k,w)=>{var C,v;return s.isProduction?!(x.type==="usageTokensByAI"&&((C=w[k-1])!=null&&C.chunkId)||x.isSystem&&((v=w[k+1])!=null&&v.isSystem)&&o.value!=="steps"):!0}));l.watch(()=>s.messages,()=>{d()&&u()},{deep:!0}),l.watch(()=>{var x;return(x=s.messages[s.messages.length-1])==null?void 0:x.text},()=>{d()&&u()});const u=()=>{l.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})},d=()=>{if(!t.value)return!0;const x=t.value;return x.scrollHeight-x.scrollTop-x.clientHeight<=24},f=()=>{},p=x=>{const k=x.replace("#",""),w=parseInt(k.substr(0,2),16),C=parseInt(k.substr(2,2),16),v=parseInt(k.substr(4,2),16),y=Math.max(0,w-12),_=Math.max(0,C-12),T=Math.max(0,v-12);return`linear-gradient(180deg, rgba(${y}, ${_}, ${T}, 0.95) 0%, rgba(0,0,0, 0) 100%)`},g=l.computed(()=>{switch(s.configDesignClass.getKey("sections.inside.welcomeMessage.size")){case"sm":return"tw:px-1.5 tw:py-2.5";case"md":return"tw:px-3 tw:py-4";case"lg":return"tw:px-4.5 tw:py-5.5"}}),b=l.computed(()=>s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="gradient"?p(s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor")):s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="bubble"?s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor"):"transparent"),h=x=>s.configDesignClass.getKey("settings.globalRoundingRadius")?s.sectionBorderRadius.borderRadius:s.configDesignClass.getKey(x?"sections.inside.messageUser.borderRadius":"sections.inside.messageBot.borderRadius")+"px",m=(x,k)=>{if(!x.time)return 0;let w=null;for(let y=k-1;y>=0;y--){const _=c.value[y];if(_!=null&&_.isUser&&(_!=null&&_.time)){w=_;break}}if(!(w!=null&&w.time))return 0;const C=Date.parse(x.time)-Date.parse(w.time);if(C<=0)return 0;const v=Number((C/1e3).toFixed(1));return v<=.1?Number((.2+Math.random()*.5).toFixed(1)):v};return(x,k)=>(l.openBlock(),l.createElementBlock("ul",{class:"message-list tw:transition-all tw:overflow-y-scroll tw:flex-1 tw:list-none tw:pb-4",ref_key:"messageListRef",ref:t,onScroll:f},[n.showWelcome?(l.openBlock(),l.createElementBlock("li",{key:0,class:l.normalizeClass(["tw:transition-all",["tw:text-"+(n.configDesignClass.getKey("sections.inside.params.size")==="sm"?"xs":n.configDesignClass.getKey("sections.inside.params.size")==="md"?"sm":"base")]]),style:l.normalizeStyle({color:n.configDesignClass.getKey("sections.inside.welcomeMessage.color"),"margin-bottom":`${n.configDesignClass.getKey("settings.gapMessageLine")}px`})},[l.createElementVNode("div",{key:"message",class:l.normalizeClass(["tw:transition-all",g.value]),style:l.normalizeStyle({borderRadius:n.configDesignClass.getKey("settings.globalRoundingRadius")?n.sectionBorderRadius.borderRadius:n.configDesignClass.getKey("sections.inside.welcomeMessage.borderRadius")+"px",color:n.configDesignClass.getKey("sections.inside.welcomeMessage.color"),background:b.value,lineHeight:n.configDesignClass.getKey("settings.lineHeight"),fontSize:n.configDesignClass.getKey("sections.inside.welcomeMessage.fontSize")+"px",letterSpacing:n.configDesignClass.getKey("settings.letterSpacing")+"px",border:`${n.configDesignClass.getKey("sections.inside.welcomeMessage.borderWidth")}px solid ${n.configDesignClass.getKey("sections.inside.welcomeMessage.borderColor")}`})},[l.createElementVNode("div",{innerHTML:l.unref(xn)(n.configDesignClass.getKey("texts.welcomeMessage"))},null,8,Zd)],6)],6)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(w,C)=>{var v,y,_;return l.openBlock(),l.createElementBlock(l.Fragment,{key:C},[w.snippet?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.isUser?Ld:w.isSystem?n.isProduction&&o.value!=="steps"?hi:Gd:$d),{key:0,message:w,"data-component":w.isSystem?n.isProduction&&o.value!=="steps"?"LoadingMessage":"MessageSystem":"MessageBot",style:l.normalizeStyle({borderRadius:h(w.isUser),"margin-top":`${(v=c.value[C-1])!=null&&v.isSystem&&!w.isSystem?"12px":"0px"}`,"margin-bottom":`${w.isSystem?"2px":n.configDesignClass.getKey("settings.gapMessageLine")+"px"}`,lineHeight:n.configDesignClass.getKey("settings.lineHeight"),letterSpacing:n.configDesignClass.getKey("settings.letterSpacing")+"px"}),loader:n.configDesignClass.getKey("settings.loader"),color:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.color"):n.configDesignClass.getKey("sections.inside.messageBot.color"),welcomeColor:n.configDesignClass.getKey("sections.inside.messageUser.color"),bgType:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.bgType"):n.configDesignClass.getKey("sections.inside.messageBot.bgType"),bgColor:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.bgColor"):n.configDesignClass.getKey("sections.inside.messageBot.bgColor"),size:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.size"):n.configDesignClass.getKey("sections.inside.messageBot.size"),fontSize:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.fontSize"):n.configDesignClass.getKey("sections.inside.messageBot.fontSize"),borderWidth:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.borderWidth"):n.configDesignClass.getKey("sections.inside.messageBot.borderWidth"),borderColor:w.isUser?n.configDesignClass.getKey("sections.inside.messageUser.borderColor"):n.configDesignClass.getKey("sections.inside.messageBot.borderColor"),index:C,isProduction:n.isProduction||!1,loadingTime:((y=w.meta)==null?void 0:y.traceLoadingTime)??m(w,C),traceLastShown:n.traceLastShown,configDesignClass:n.configDesignClass,ttsUrl:n.ttsUrl,activeMessage:n.activeMessage===w,isLast:C===c.value.length-1,paused:(_=w.meta)==null?void 0:_.tracePaused,borderRadius:h(w.isUser),onClick:T=>i(w)},null,8,["message","data-component","style","loader","color","welcomeColor","bgType","bgColor","size","fontSize","borderWidth","borderColor","index","isProduction","loadingTime","traceLastShown","configDesignClass","ttsUrl","activeMessage","isLast","paused","borderRadius","onClick"]))],64)}),128)),n.isLoading?(l.openBlock(),l.createBlock(hi,{key:1,class:l.normalizeClass({"tw:mt-8":n.traceLastShown}),borderRadius:h(!1),isProduction:n.isProduction||!1,loader:n.configDesignClass.getKey("settings.loader"),configDesignClass:n.configDesignClass,color:a.value.headerText,bgColor:a.value.headerFillColor,text:n.configDesignClass.getKey("texts.typingLoader")},null,8,["class","borderRadius","isProduction","loader","configDesignClass","color","bgColor","text"])):l.createCommentVNode("",!0),l.renderSlot(x.$slots,"footer")],544))}}),Xd=l.defineComponent({__name:"ChatMessagesContainer",props:{messages:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},sectionBorderRadius:{},isLoading:{type:Boolean},isStreaming:{type:Boolean},configDesignClass:{},activeMessage:{},showWelcome:{type:Boolean},isProcessError:{type:Boolean},restartChat:{type:Function},traceLastShown:{type:Boolean},isProduction:{type:Boolean},ttsUrl:{}},emits:["handleClickMessage","update:activeMessage"],setup(n,{emit:e}){const t=n,s=l.computed(()=>t.ttsUrl),r=e,i=l.computed({get:()=>t.activeMessage,set:o=>r("update:activeMessage",o)});return(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full tw:min-h-0",style:l.normalizeStyle([{flex:"1 1 0"},{paddingLeft:(n.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingRight:(n.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingTop:(n.configDesignClass.getKey("sections.inside.params.verticalPadding")??8)+"px"}])},[l.createVNode(Yd,{messages:n.messages,isPreview:n.isPreview,isEmbedded:n.isEmbedded,configDesignClass:n.configDesignClass,isLoading:n.isLoading,isStreaming:n.isStreaming,isProduction:n.isProduction,sectionBorderRadius:n.sectionBorderRadius,showWelcome:n.showWelcome,ttsUrl:s.value,activeMessage:i.value,"onUpdate:activeMessage":a[0]||(a[0]=c=>i.value=c),traceLastShown:n.traceLastShown,onHandleClickMessage:a[1]||(a[1]=c=>o.$emit("handleClickMessage",c))},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","ttsUrl","activeMessage","traceLastShown"])],4))}}),Qd={key:0,class:"chat tw:w-full tw:h-full tw:flex tw:pt-0 tw:relative"},Jd={key:0,class:"tw:w-full tw:h-full"},e1={key:1,class:"messages tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full"},t1="https://hs-generator.onrender.com/api/transcribe",s1="https://hs-generator.onrender.com/api/tts",fs=0,n1=l.defineComponent({__name:"ChatWrapper",props:{link:{},isEmbedded:{type:Boolean},isPreview:{type:Boolean},configWidget:{},configLink:{},scenario:{},scenarioOptions:{},widgetId:{},isProduction:{type:Boolean}},emits:["trace","choose-trace","restart-chat"],setup(n,{expose:e,emit:t}){const s=t,r=l.ref(!1),i=l.ref(!1),o=l.ref(null),a=l.ref(!1),c=l.ref(!1),u=l.ref(!1),d=l.ref(!1),f=l.ref(!0),p=l.ref(!1),g=l.ref(!1),b=l.ref(!1),h=l.ref(0),m=l.ref(!1),x=l.ref(null),k=l.ref(!1),w=n,C=async()=>{if(!(w.isPreview||w.scenario))try{s("restart-chat"),Go(),await As()}catch(S){console.error("Failed to restart chat connection",S)}},v=l.computed(()=>{const S=E.value.getKey("settings.position"),z=E.value.getKey("settings.offset.x"),B=E.value.getKey("settings.offset.y"),$=O.value?E.value.getKey("settings.size.width"):E.value.getKey("sections.colapsed.width"),U=O.value?E.value.getKey("settings.size.height"):E.value.getKey("sections.colapsed.height");return{...{...S==="topLeft"?{top:B+"px",left:z+"px"}:{},...S==="topRight"?{top:B+"px",right:z+"px"}:{},...S==="bottomLeft"?{bottom:B+"px",left:z+"px"}:{},...S==="bottomRight"?{bottom:B+"px",right:z+"px"}:{},...S==="top"?{top:B+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="bottom"?{bottom:B+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="left"?{left:z+"px",top:"50%",transform:"translateY(-50%)"}:{},...S==="right"?{right:z+"px",top:"50%",transform:"translateY(-50%)"}:{}},width:O.value&&!Je.value?$+"px":void 0,height:O.value||Je.value?U+"px":void 0}}),y=()=>{if(w.configLink)return w.configLink;const z=new URLSearchParams(window.location.search).get("config");if(z)return z},_=l.ref(null),T=l.ref(null),R=l.ref(null),L=()=>R.value?R.value:y()?T.value&&typeof T.value=="object"?T.value:W:w.configWidget?w.configWidget:W,N=l.shallowRef(W);l.watchEffect(async S=>{const z=L();let B=!1;S(()=>{B=!0}),console.log("test");const $=await eu(z,{verbose:!0});if(B)return;const U=$??z,{isValid:me,errors:ze}=tu(U);if(console.log(U),!me){console.warn("[HSW] Invalid widget config (after migration), falling back to DEFAULT_CONFIG:",ze),N.value=W;return}N.value=U});const j=S=>{_.value=S,s("choose-trace",{action:S.type,messages:[S]})},Z=async()=>{s("choose-trace",{action:"copyAll",messages:Q.value})},se=async()=>{if(Q.value.length===0){s("choose-trace",{action:"copyLast",messages:[]});return}let S=-1;for(let B=Q.value.length-1;B>=0;B--)if(Q.value[B].isUser){S=B;break}const z=S>=0?S:0;s("choose-trace",{action:"copyLast",messages:Q.value.slice(z)})},X=async S=>{switch(console.log("handleHeaderTrace",S),S.action){case"copyLast":await se();break;case"copyIteration":await se();break;case"copyAll":await Z();break}},E=l.computed(()=>new su(N.value)),G=l.computed(()=>zi(E.value)),A=l.computed(()=>xs(E.value,8)),De=l.computed(()=>E.value.getConfig().settings.container),Se=l.computed(()=>{const S=De.value;if(!S)return!1;const z=S.innerBorder,B=S.outerBorder;return((z==null?void 0:z.width)??0)>0||((B==null?void 0:B.width)??0)>0?(z==null?void 0:z.width)!==0||(B==null?void 0:B.width)!==0:!1}),V=l.computed(()=>{var Rt,at,zt,as,M,_r;const S=De.value,z=E.value.getKey("settings.bgChat"),B=S==null?void 0:S.gradient,$=B?`linear-gradient(360deg, ${z} 78.99%, ${B} 100%)`:"",U=typeof B=="string"&&B.trim()&&B!=="transparent"?$:z,me=((Rt=S==null?void 0:S.innerBorder)==null?void 0:Rt.width)??0,ze=((at=S==null?void 0:S.innerBorder)==null?void 0:at.color)??"transparent",_e=((zt=S==null?void 0:S.innerBorder)==null?void 0:zt.style)??"solid",de=((as=S==null?void 0:S.outerBorder)==null?void 0:as.width)??0,ge=((M=S==null?void 0:S.outerBorder)==null?void 0:M.color)??"transparent",ot=((_r=S==null?void 0:S.outerBorder)==null?void 0:_r.style)??"solid",xe={background:U,borderRadius:`${String(G.value)}px`};return xe["--hsw-container-radius"]=`${String(G.value)}px`,xe["--hsw-container-inner-width"]=`${me}px`,xe["--hsw-container-inner-color"]=ze,xe["--hsw-container-inner-style"]=_e,xe["--hsw-container-outer-width"]=`${de}px`,xe["--hsw-container-outer-color"]=ge,xe["--hsw-container-outer-style"]=ot,xe}),F=l.computed(()=>{switch(E.value.getKey("sections.bottom.params.size")){case"sm":return"tw:min-h-[25px]";case"md":return"tw:min-h-[45px]";case"lg":return"tw:min-h-[60px]"}}),O=l.ref(!0),ee=()=>{const S=o.value;if(!S)return{width:56,height:56};const z=S.querySelector(".chat-action");if(!z)return{width:56,height:56};const B=z.getBoundingClientRect();return{width:Math.max(1,B.width),height:Math.max(1,B.height)}},ue=l.ref(!1),_t=async S=>{if(ue.value)return;ue.value=!0;const z=o.value;if(!z||S===O.value)return;const B=z.querySelector(".chatWrapper"),$=B==null?void 0:B.querySelector(".chat");if(S){const U=z.querySelector(".chat-collapsed");U&&(H.killTweensOf(U),H.to(U,{opacity:1,duration:.15,ease:"power2.in"}));const{height:me,width:ze}=ee();await new Promise(de=>setTimeout(de,150)),O.value=!0,await l.nextTick();const _e=Math.max(me||0,ze||0)||56;H.killTweensOf(z),$&&H.killTweensOf($),B&&H.killTweensOf(B),H.set(z,{width:_e,height:_e,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),B&&H.set(B,{opacity:0,willChange:"opacity"}),$&&H.set($,{opacity:0,willChange:"opacity"}),H.set(z,{width:_e,height:_e,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),H.to(z,{width:E.value.getKey("settings.size.width"),height:E.value.getKey("settings.size.height"),opacity:1,duration:.4,ease:"power2.out",onComplete:()=>{H.set(z,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange,opacity"}),ue.value=!1}}),B&&H.to(B,{opacity:1,duration:.3,delay:.35,ease:"power2.out",onComplete:()=>{H.set(B,{clearProps:"willChange,opacity"})}}),$&&H.to($,{opacity:1,duration:.3,delay:.15,ease:"power2.out",onComplete:()=>{H.set($,{clearProps:"willChange"})}})}else{const U=E.value.getKey("sections.colapsed.height")+E.value.getKey("sections.colapsed.borderWidth")*2;H.killTweensOf(z),$&&H.killTweensOf($),B&&H.killTweensOf(B),H.set(z,{width:E.value.getKey("settings.size.width"),height:E.value.getKey("settings.size.height"),overflow:"hidden",willChange:"width, height, opacity"}),B&&(H.set(B,{willChange:"opacity"}),H.to(B,{opacity:0,duration:.5,ease:"power3.inOut",onComplete:()=>{H.set(B,{clearProps:"willChange,opacity"})}})),$&&(H.set($,{willChange:"opacity"}),H.to($,{opacity:0,duration:.2,ease:"power2.in",onComplete:()=>{H.set($,{clearProps:"willChange"})}})),H.to(z,{width:U,height:U,opacity:0,duration:.35,marginTop:0,ease:"power2.inOut",onComplete:()=>{O.value=!1,l.nextTick().then(()=>{const me=z.querySelector(".chat-collapsed");me&&(H.set(me,{opacity:0}),H.to(me,{opacity:1,duration:.25,ease:"power2.out"})),H.set(z,{opacity:1})}),H.set(z,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange"}),ue.value=!1}})}},te=l.ref(w.isPreview||!1),Je=l.ref(w.isEmbedded||!1);l.watch(()=>w.isEmbedded,S=>{Je.value=S});const Ft=l.ref(!!w.isPreview),qe=l.ref(w.widgetId||`hsw-${Math.random().toString(36).slice(2,10)}`),Q=l.ref([]),Ge=l.ref("");let be=null,Tt=0;const jo=l.computed(()=>Q.value.length>0&&Q.value[Q.value.length-1].isUser===!0||c.value),is=l.ref(null),qo=(S,z)=>{console.log("handleSnippetAction",S,z),vr({action:{sequence:z,command:S,data:{}}}),is.value=null},We=S=>{var z,B;if(S.chunkId&&S.text){const $=Q.value.find(U=>U.chunkId===S.chunkId);$?((z=S.chunk)!=null&&z.start?$.text="":$.text+=S.text,$.chunk.start=!1,$.chunk.end=!!((B=S.chunk)!=null&&B.end)||!1):Q.value.push(S)}else Q.value.push(S)},os=(()=>{if(w.link)return w.link;const z=new URLSearchParams(window.location.search).get("link");if(z)return z;const $=new URLSearchParams(window.location.hash.substring(1)).get("link");if($)return $;try{const U="ws://dev.hypershadow.io/client/widget-chat/v1/ws/?token=eCP7dRTOVWWLtqB-UloQbNDzBjl7YtQuVqil-kWBRo_Vfv-ONDS3sIsrB6GuJp6F5KcHXJQ_J8rN8_p7zWgvBlNS8wNPnJ4NCiX0XHfaUKg49I7Fc-sgRUjOMwMnXyyPMhC8HOx0EkpPk1MnMO5GfiS_Sg";if(U)return U}catch(U){console.warn("Environment variables not available:",U)}return console.log("Using fallback link: ws://localhost:3000"),"ws://localhost:3000"})(),br=()=>{if(Tt>=fs){We({text:`Failed to connect after ${fs} attempts. Please check your connection.`,isUser:!1});return}Tt++,console.log(`Reconnection attempt ${Tt}/${fs}`),setTimeout(()=>{nn()},2e3*Tt)},yr=()=>{We({text:Do.UserMessage,isUser:!0}),We({text:"{Agent response message}",isUser:!1})},nn=()=>{try{if(!os||typeof os!="string"){console.error("Invalid WebSocket link:",os),We({text:"Error: Invalid WebSocket URL",isUser:!1});return}if(console.log("Attempting to connect to:",os),be=new WebSocket(os),!be){console.error("Failed to create WebSocket instance");return}be.onmessage=S=>{var z,B,$,U,me,ze,_e,de,ge,ot,xe,Rt,at,zt,as;if(k.value)try{const M=JSON.parse(S.data);if(M.snippet){is.value={...M.snippet,data:JSON.parse(M.snippet.data||"{}")};return}if(M.error)return We({text:M.error.message,isUser:!1,isSystem:!0,isError:!0});if((z=M==null?void 0:M.textChunk)!=null&&z.start&&(m.value=!0,x.value=(B=M==null?void 0:M.textChunk)==null?void 0:B.start,We({text:"",isUser:!1,chunkId:($=M==null?void 0:M.textChunk)==null?void 0:$.start,time:(U=M==null?void 0:M.textChunk)!=null&&U.time?(me=M==null?void 0:M.textChunk)==null?void 0:me.time:new Date().toISOString(),chunk:M==null?void 0:M.textChunk})),(ze=M==null?void 0:M.textChunk)!=null&&ze.end||(_e=M==null?void 0:M.textChunk)!=null&&_e.start){(de=M==null?void 0:M.textChunk)!=null&&de.end&&x.value&&((ge=M==null?void 0:M.textChunk)==null?void 0:ge.end)===x.value&&(m.value=!1,x.value=null,We({text:" ",isUser:!1,chunkId:(ot=M==null?void 0:M.textChunk)==null?void 0:ot.end,time:(xe=M==null?void 0:M.textChunk)!=null&&xe.time?(Rt=M==null?void 0:M.textChunk)==null?void 0:Rt.time:new Date().toISOString(),chunk:M==null?void 0:M.textChunk}));return}(at=M==null?void 0:M.textChunk)!=null&&at.text&&We({text:M.textChunk.text,isUser:!1,chunkId:(zt=M==null?void 0:M.textChunk)==null?void 0:zt.id,chunk:M==null?void 0:M.textChunk}),M!=null&&M.trace&&We({text:M.trace.message,isUser:!1,isSystem:!0,meta:M.trace.meta,time:M.trace.time,type:M.trace.type}),(as=M==null?void 0:M.trace)!=null&&as.meta&&!w.isProduction&&s("trace",{action:M.trace.type,messages:[M.trace]})}catch(M){console.error("Error parsing WebSocket message:",M),We({text:"Error: Failed to parse server response",isUser:!1})}},be.onopen=()=>{Tt=0},be.onclose=S=>{console.log("Connection closed",S);let z=`Connection closed (${S.code})`;switch(S.code){case 1e3:z="Connection closed normally";break;case 1001:z="Connection closed: going away";break;case 1006:if(d.value=!0,Tt<fs&&!te.value){br();return}break;case 1011:z="Connection closed: server error";break;default:u.value=!0}console.log(z)},be.onerror=S=>{console.error("WebSocket connection error:",S),a.value=!0,We({text:"Connection error: Unable to connect to chat server",isUser:!1,isSystem:!0,isError:!0}),Tt<fs&&!te.value&&br()}}catch(S){console.error("Error connecting to socket server:",S),We({text:`Connection error: ${S instanceof Error?S.message:"Unknown error"}`,isUser:!1,isSystem:!0,isError:!0})}},Go=()=>{be&&be.close(),be=null};l.onUnmounted(()=>{be&&be.close()});const rn=S=>{(w.isPreview||w.scenario)&&!S||_t(!O.value)},Zo=()=>{if(!(w.isPreview||w.scenario)&&Ge.value.trim()!==""){if(w.isProduction&&Q.value.length>0){const S=Q.value[Q.value.length-1];S.isSystem===!0&&!S.isError&&!S.snippet&&Q.value.pop()}Q.value.push({text:Ge.value,isUser:!0,time:new Date().toISOString()}),m.value=!0,k.value=!0,vr({message:Ge.value}),Ge.value=""}},vr=S=>{be&&be.send(JSON.stringify(S))},xr=()=>{try{const S=E.value.getKey("settings.fontFamily")||"MacPaw Fixel",z=`https://fonts.googleapis.com/css2?family=${S.replace(/\s+/g,"+")}:wght@300;400;500;600;700&display=swap`,B=document.createElement("link");B.rel="preload",B.as="style",B.href=z,document.head.appendChild(B);const $=document.createElement("link");$.rel="stylesheet",$.href=z,$.setAttribute("data-google-font","true"),document.head.appendChild($),o.value&&(o.value.style.fontFamily=`"${S}", sans-serif`)}catch(S){console.error("Error loading font:",S)}},Cr=()=>{const S=E.value.getKey("settings.fontWeight")||400;o.value&&(o.value.style.fontWeight=S)};i.value=!0,l.watch(()=>E.value.getKey("settings.fontFamily"),()=>{xr()}),l.watch(()=>E.value.getKey("settings.fontWeight"),()=>{Cr()});const Yo=async()=>{if(y()){const z=await(await fetch(y()+"config")).json();T.value=z,r.value=!0}else r.value=!0},on=(S,z,B)=>new Promise($=>{const U=performance.now(),me=ze=>{const _e=Math.min(1,(ze-U)/B);h.value=S+(z-S)*_e,_e<1?requestAnimationFrame(me):$()};requestAnimationFrame(me)}),kr=async S=>{b.value=!0,h.value=0,await l.nextTick(),await on(0,.3,500),S(),await on(.3,.6,200),h.value=.6,await new Promise(z=>setTimeout(z,100)),await on(.6,0,500),b.value=!1},Xo=async(S,z=500,B=25)=>{if(!(S!=null&&S.length))return;let $=0;const me=S.filter(de=>!de.isUser&&!de.isSystem&&de.text).reduce((de,ge)=>{var ot;return de+(((ot=ge.text)==null?void 0:ot.length)||0)*B},0);$=(S.length-1)*z+me;const ze=Math.round($/1e3);let _e=-1;for(let de=S.length-1;de>=0;de--){const ge=S[de];if(ge.isSystem&&ge.type==="trace"){_e=de;break}}for(let de=0;de<S.length;de++){const ge=S[de],ot=!ge.isUser&&!ge.isSystem;if(de===_e&&ge.isSystem&&ge.type==="trace"&&(ge.meta={...ge.meta,tracePaused:!0,traceLoadingTime:ze}),ot&&ge.text){const xe=ge.text;Q.value.push({...ge,text:""});const Rt=Q.value[Q.value.length-1];for(let at=0;at<xe.length;at++)Rt.text=xe.slice(0,at+1),await new Promise(zt=>setTimeout(zt,B))}else Q.value.push(ge);await new Promise(xe=>setTimeout(xe,z))}},Qo=async(S,z=2e3)=>{if(!(S!=null&&S.length))return;const B=Math.round(S.length*z/1e3);for(let $=0;$<S.length;$++){const U=S[$];$===S.length-1&&(U.meta={...U.meta,tracePaused:!0,traceLoadingTime:B}),Q.value.push(U),await new Promise(ze=>setTimeout(ze,z))}},an=async(S,z)=>{var U;if(S==="preview"){yr();return}const B=ii.getState(S,E.value,z||w.scenarioOptions),$=B.useTypewriterAnimation?[...B.messages]:null;await kr(()=>{if(O.value=B.isChatOpen,Q.value=$?[]:B.messages,c.value=B.traceLastShown,a.value=B.isConnectionError,u.value=B.isProcessError,d.value=B.isReconnectError,p.value=B.isInputDisabled,f.value=B.showWelcome,g.value=B.showReconnectNotice??!1,is.value=B.snippet??null,te.value=!0,be){try{be.close()}catch{}be=null}}),$&&await Xo($,B.traceAnimationDelay??500),!$&&((U=B.pendingTraces)!=null&&U.length)&&await Qo(B.pendingTraces,B.traceAnimationDelay??2e3)},As=async()=>{await kr(()=>{te.value=Ft.value,f.value=!0,p.value=!1,g.value=!1,a.value=!1,u.value=!1,d.value=!1,Q.value=[],te.value||(!be||be.readyState!==1)&&nn()})};l.onBeforeMount(async()=>{await Yo()}),l.onMounted(async()=>{xr(),Cr();const S=w.scenario??ii.getScenarioFromUrl();if(S){await an(S);return}if(w.isPreview){yr();return}nn()}),l.watch(()=>w.scenario,async S=>{S?await an(S):await As()});const Ve={id:qe,setScenario:async(S,z)=>{await an(S,z)},clearScenario:async()=>{await As()},toggleChat:()=>{rn(!0)},setOpen:S=>{O.value=S},setActive:S=>{S&&!O.value&&(O.value=!0)},setInputDisabled:S=>{p.value=S},setShowReconnectNotice:S=>{g.value=S},setMessages:S=>{Q.value=Array.isArray(S)?S:[]},pushMessage:S=>{Q.value.push(S)},setSnippet:S=>{is.value=S??null},resetToLive:async()=>{await As()},setConfig:S=>{R.value=JSON.parse(JSON.stringify(S))},getConfig:()=>N.value},Jo=()=>{const S=window;S.hswWidgets=S.hswWidgets||{},S.hswWidgets[qe.value]=Ve,window.dispatchEvent(new CustomEvent("hsw:ready",{detail:{widgetId:qe.value}}))},ea=()=>{const S=window;S.hswWidgets&&S.hswWidgets[qe.value]&&delete S.hswWidgets[qe.value]},Sr=async S=>{var U;const z=S,B=(U=z.detail)==null?void 0:U.widgetId;if(B&&B!==qe.value)return;const{action:$}=z.detail;switch($){case"setScenario":await Ve.setScenario(z.detail.payload.type,z.detail.payload.options);break;case"clearScenario":await Ve.clearScenario();break;case"setOpen":Ve.setOpen(z.detail.payload);break;case"setActive":Ve.setActive(z.detail.payload);break;case"setInputDisabled":Ve.setInputDisabled(z.detail.payload);break;case"setShowReconnectNotice":Ve.setShowReconnectNotice(z.detail.payload);break;case"setMessages":Ve.setMessages(z.detail.payload);break;case"pushMessage":Ve.pushMessage(z.detail.payload);break;case"setSnippet":Ve.setSnippet(z.detail.payload);break;case"resetToLive":await Ve.resetToLive();break;case"setConfig":Ve.setConfig(z.detail.payload);break}};return l.onMounted(()=>{Jo(),window.addEventListener("hsw:control",Sr)}),l.onUnmounted(()=>{ea(),window.removeEventListener("hsw:control",Sr)}),e(Ve),(S,z)=>r.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["tw:z-[999] tw:flex tw:justify-end component-isolator tw:transition-all chatContainer",{"tw:fixed":!Je.value,"tw:w-full":O.value}]),style:l.normalizeStyle({letterSpacing:E.value.getKey("settings.letterSpacing")+"px",...v.value}),ref_key:"chatWrapperRef",ref:o},[l.withDirectives(l.createVNode(Rc,{toggleChat:rn,element:E.value.getKeyObject("sections.colapsed")},null,8,["element"]),[[l.vShow,!O.value]]),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(["chatWrapper tw:w-full tw:backdrop-blur-[22px] tw:flex tw:items-center tw:border-0 tw:flex-col",[{"chatWrapper--pseudoBorders":Se.value,"tw:h-auto tw:shadow-2xl chat-active":O.value,"tw:shadow-lg tw:w-fit":!O.value,"chat-embedded tw:w-full tw:h-full tw:static tw:top-0 tw:left-0":Je.value}]]),style:l.normalizeStyle(V.value)},[l.createVNode(hu,{isChatOpen:O.value,toggleChat:rn,configDesignClass:E.value,sectionBorderRadius:A.value,mainBorderRadius:G.value,isPreview:te.value,isEmbedded:Je.value,isProduction:n.isProduction||!1,restartChat:C},null,8,["isChatOpen","configDesignClass","sectionBorderRadius","mainBorderRadius","isPreview","isEmbedded","isProduction"]),O.value?(l.openBlock(),l.createElementBlock("div",Qd,[a.value?(l.openBlock(),l.createElementBlock("div",Jd,[l.createElementVNode("div",{class:"tw:absolute tw:left-0 tw:top-0 tw:w-full tw:h-full",style:l.normalizeStyle({padding:E.value.getKey("sections.warnings.launchIssue.content.sidePadding")+"px"})},[l.createVNode(Pr,{type:"launchIssue",class:"tw:h-full",headlineText:E.value.getKey("texts.launchIssueTitle"),descriptionText:E.value.getKeyObject("texts.launchIssueText"),warningElement:E.value.getKeyObject("sections.warnings.launchIssue"),configDesignClass:E.value,isProcessError:u.value,restartChat:C},null,8,["headlineText","descriptionText","warningElement","configDesignClass","isProcessError"])],4)])):(l.openBlock(),l.createElementBlock("div",e1,[l.createVNode(Xd,{messages:Q.value,isPreview:te.value,isEmbedded:Je.value,configDesignClass:E.value,isLoading:jo.value,isStreaming:m.value,isProduction:n.isProduction,sectionBorderRadius:A.value,showWelcome:f.value,ttsUrl:s1,activeMessage:_.value,"onUpdate:activeMessage":z[0]||(z[0]=B=>_.value=B),isProcessError:u.value,traceLastShown:c.value,onHandleClickMessage:j,restartChat:C},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","activeMessage","isProcessError","traceLastShown"]),n.isProduction?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Uu,{key:0,configDesignClass:E.value,sectionBorderRadius:A.value,onTrace:X},null,8,["configDesignClass","sectionBorderRadius"])),u.value?(l.openBlock(),l.createElementBlock("div",{key:1,style:l.normalizeStyle({padding:E.value.getKey("sections.warnings.connectionIssue.content.sidePadding")+"px"})},[l.createVNode(Pr,{type:"connectionIssue",headlineText:E.value.getKey("texts.issueText"),configDesignClass:E.value,warningElement:E.value.getKeyObject("sections.warnings.connectionIssue"),restartChat:C},null,8,["headlineText","configDesignClass","warningElement"])],4)):(l.openBlock(),l.createBlock(Eu,{key:2,messageText:Ge.value,"onUpdate:messageText":z[1]||(z[1]=B=>Ge.value=B),isPreview:te.value,isProduction:n.isProduction||!1,configDesignClass:E.value,sectionBorderRadius:A.value,classSize:F.value,sendMessage:Zo,isInputDisabled:p.value||te.value,showReconnectNotice:g.value,restartChat:C,isStreaming:m.value,mainBorderRadius:G.value,transcribeUrl:t1,snippet:is.value,onTrace:X,onSnippetAction:qo},null,8,["messageText","isPreview","isProduction","configDesignClass","sectionBorderRadius","classSize","isInputDisabled","showReconnectNotice","isStreaming","mainBorderRadius","snippet"]))]))])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[b.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:absolute tw:inset-0 tw:backdrop-blur-[40px] tw:z-[1000]",style:l.normalizeStyle({borderRadius:`${String(G.value)}px`,backgroundColor:`rgba(0,0,0, ${h.value})`})},null,4)):l.createCommentVNode("",!0)]),_:1})],6),[[l.vShow,i.value&&O.value]])],6)):l.createCommentVNode("",!0)}}),it=n=>{const e=window,t=n||Object.keys(e.hswWidgets||{})[0];if(!e.hswWidgets||!e.hswWidgets[t])throw new Error("HSW widget API not ready. Wait for hsw:ready event or pass correct widgetId");return e.hswWidgets[t]},r1=async(n,e,t)=>it(t).setScenario(n,e),i1=async n=>it(n).clearScenario(),o1=(n,e)=>it(e).setOpen(n),a1=(n,e)=>it(e).setActive(n),l1=(n,e)=>it(e).setInputDisabled(n),c1=(n,e)=>it(e).setShowReconnectNotice(n),u1=(n,e)=>it(e).setMessages(n),d1=(n,e)=>it(e).pushMessage(n),h1=(n,e)=>it(e).setSnippet(n),f1=async n=>it(n).resetToLive();exports.ChatWrapper=n1;exports.clearScenario=i1;exports.cn=Kn;exports.pushMessage=d1;exports.resetToLive=f1;exports.setActive=a1;exports.setInputDisabled=l1;exports.setMessages=u1;exports.setOpen=o1;exports.setScenario=r1;exports.setShowReconnectNotice=c1;exports.setSnippet=h1;