@yartsun/hypershadow-widget 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.cjs.js +75 -45
- package/dist/lib/index.es.js +3481 -3319
- package/dist/lib/style.css +1 -1
- package/dist/standalone/hs-widget.css +1 -1
- package/dist/standalone/hs-widget.es.js +8501 -8259
- package/dist/standalone/hs-widget.iife.js +99 -69
- package/dist/static/widget/v1/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-BYUUyq1B.js +106 -0
- package/dist/{widget/chat/assets/__federation_expose_Chat-B-cuBP_G.js → static/widget/v1/chat/assets/federation-expose-Chat-Xz4ujhml.js} +1 -1
- package/dist/static/widget/v1/chat/assets/federation-expose-Utils-BEpxBLK-.js +1 -0
- package/dist/static/widget/v1/chat/assets/{federation-import-CxlH6xnb.js → federation-import-bOe-N7Y_.js} +1 -1
- package/dist/static/widget/v1/chat/assets/federation-shared-vue-ElFYw5cl.js +23 -0
- package/dist/static/widget/v1/chat/assets/index-D6FIEbUe.js +5 -0
- package/dist/static/widget/v1/chat/assets/remoteChat.js +1 -1
- package/dist/static/widget/v1/chat/assets/style-DxPu28t-.css +1 -0
- package/dist/static/widget/v1/chat/index.html +5 -5
- package/package.json +2 -2
- package/types/message.types.ts +1 -0
- package/dist/static/widget/v1/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-Cgm8_td1.js +0 -76
- package/dist/static/widget/v1/chat/assets/federation-expose-Chat-DeARWUZA.js +0 -1
- package/dist/static/widget/v1/chat/assets/federation-expose-Utils-BmSDJTj0.js +0 -1
- package/dist/static/widget/v1/chat/assets/federation-shared-vue-MGgX2WkV.js +0 -22
- package/dist/static/widget/v1/chat/assets/index-Begpz7o5.js +0 -5
- package/dist/static/widget/v1/chat/assets/style-DL26ESls.css +0 -1
- package/dist/widget/chat/assets/ChatWrapper.vue_vue_type_style_index_0_lang-CSxaiIok.js +0 -3
- package/dist/widget/chat/assets/__federation_fn_import-CxlH6xnb.js +0 -1
- package/dist/widget/chat/assets/__federation_shared_vue-MGgX2WkV.js +0 -22
- package/dist/widget/chat/assets/federation-utils-DDIHa9Ih.js +0 -1
- package/dist/widget/chat/assets/index-DN9zikYF.js +0 -5
- package/dist/widget/chat/assets/remoteChat.js +0 -1
- package/dist/widget/chat/assets/style-GHzhDfDI.css +0 -1
- package/dist/widget/chat/index.html +0 -22
- package/dist/widget/chat/init.js +0 -28
- package/dist/widget/chat/vite.svg +0 -1
package/dist/lib/index.cjs.js
CHANGED
|
@@ -1,76 +1,106 @@
|
|
|
1
|
-
"use strict";var Yo=Object.defineProperty;var Qo=(r,e,t)=>e in r?Yo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var K=(r,e,t)=>Qo(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function ci(r){var e,t,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=ci(r[e]))&&(s&&(s+=" "),s+=t)}else for(t in r)r[t]&&(s&&(s+=" "),s+=t);return s}function ui(){for(var r,e,t=0,s="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=ci(r))&&(s&&(s+=" "),s+=e);return s}const Rr=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,zr=ui,Jo=(r,e)=>t=>{var s;if((e==null?void 0:e.variants)==null)return zr(r,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:n,defaultVariants:i}=e,o=Object.keys(n).map(u=>{const d=t==null?void 0:t[u],h=i==null?void 0:i[u];if(d===null)return null;const f=Rr(d)||Rr(h);return n[u][f]}),a=t&&Object.entries(t).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:h,className:f,...g}=d;return Object.entries(g).every(w=>{let[p,m]=w;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...u,h,f]:u},[]);return zr(r,o,c,t==null?void 0:t.class,t==null?void 0:t.className)};function di(r){return r?r.flatMap(e=>e.type===l.Fragment?di(e.children):[e]):[]}const ea=l.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(r,{attrs:e,slots:t}){return()=>{var c;if(!t.default)return null;const s=di(t.default()),n=s.findIndex(u=>u.type!==l.Comment);if(n===-1)return s;const i=s[n];(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[n]=a,s)}}}),ta=["area","img","input"],sa=l.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(r,{attrs:e,slots:t}){const s=r.asChild?"template":r.as;return typeof s=="string"&&ta.includes(s)?()=>l.h(s,e):s!=="template"?()=>l.h(r.as,e,{default:t.default}):()=>l.h(ea,e,{default:t.default})}}),Nn="-",na=r=>{const e=ia(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const a=o.split(Nn);return a[0]===""&&a.length!==1&&a.shift(),pi(a,e)||ra(o)},getConflictingClassGroupIds:(o,a)=>{const c=t[o]||[];return a&&s[o]?[...c,...s[o]]:c}}},pi=(r,e)=>{var o;if(r.length===0)return e.classGroupId;const t=r[0],s=e.nextPart.get(t),n=s?pi(r.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const i=r.join(Nn);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Br=/^\[(.+)\]$/,ra=r=>{if(Br.test(r)){const e=Br.exec(r)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},ia=r=>{const{theme:e,classGroups:t}=r,s={nextPart:new Map,validators:[]};for(const n in t)gn(t[n],s,n,e);return s},gn=(r,e,t,s)=>{r.forEach(n=>{if(typeof n=="string"){const i=n===""?e:Mr(e,n);i.classGroupId=t;return}if(typeof n=="function"){if(oa(n)){gn(n(s),e,t,s);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([i,o])=>{gn(o,Mr(e,i),t,s)})})},Mr=(r,e)=>{let t=r;return e.split(Nn).forEach(s=>{t.nextPart.has(s)||t.nextPart.set(s,{nextPart:new Map,validators:[]}),t=t.nextPart.get(s)}),t},oa=r=>r.isThemeGetter,aa=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,s=new Map;const n=(i,o)=>{t.set(i,o),e++,e>r&&(e=0,s=t,t=new Map)};return{get(i){let o=t.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return n(i,o),o},set(i,o){t.has(i)?t.set(i,o):n(i,o)}}},fn="!",mn=":",la=mn.length,ca=r=>{const{prefix:e,experimentalParseClassName:t}=r;let s=n=>{const i=[];let o=0,a=0,c=0,u;for(let w=0;w<n.length;w++){let p=n[w];if(o===0&&a===0){if(p===mn){i.push(n.slice(c,w)),c=w+la;continue}if(p==="/"){u=w;continue}}p==="["?o++:p==="]"?o--:p==="("?a++:p===")"&&a--}const d=i.length===0?n:n.substring(c),h=ua(d),f=h!==d,g=u&&u>c?u-c:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:g}};if(e){const n=e+mn,i=s;s=o=>o.startsWith(n)?i(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const n=s;s=i=>t({className:i,parseClassName:n})}return s},ua=r=>r.endsWith(fn)?r.substring(0,r.length-1):r.startsWith(fn)?r.substring(1):r,da=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let i=[];return s.forEach(o=>{o[0]==="["||e[o]?(n.push(...i.sort(),o),i=[]):i.push(o)}),n.push(...i.sort()),n}},pa=r=>({cache:aa(r.cacheSize),parseClassName:ca(r),sortModifiers:da(r),...na(r)}),ha=/\s+/,ga=(r,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:i}=e,o=[],a=r.trim().split(ha);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:f,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:p}=t(d);if(h){c=d+(c.length>0?" "+c:c);continue}let m=!!p,b=s(m?w.substring(0,p):w);if(!b){if(!m){c=d+(c.length>0?" "+c:c);continue}if(b=s(w),!b){c=d+(c.length>0?" "+c:c);continue}m=!1}const v=i(f).join(":"),y=g?v+fn:v,C=y+b;if(o.includes(C))continue;o.push(C);const k=n(b,m);for(let x=0;x<k.length;++x){const R=k[x];o.push(y+R)}c=d+(c.length>0?" "+c:c)}return c};function fa(){let r=0,e,t,s="";for(;r<arguments.length;)(e=arguments[r++])&&(t=hi(e))&&(s&&(s+=" "),s+=t);return s}const hi=r=>{if(typeof r=="string")return r;let e,t="";for(let s=0;s<r.length;s++)r[s]&&(e=hi(r[s]))&&(t&&(t+=" "),t+=e);return t};function ma(r,...e){let t,s,n,i=o;function o(c){const u=e.reduce((d,h)=>h(d),r());return t=pa(u),s=t.cache.get,n=t.cache.set,i=a,a(c)}function a(c){const u=s(c);if(u)return u;const d=ga(c,t);return n(c,d),d}return function(){return i(fa.apply(null,arguments))}}const me=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},gi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wa=/^\d+\/\d+$/,ba=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ya=/\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$/,va=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ca=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ka=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dt=r=>wa.test(r),W=r=>!!r&&!Number.isNaN(Number(r)),dt=r=>!!r&&Number.isInteger(Number(r)),tn=r=>r.endsWith("%")&&W(r.slice(0,-1)),rt=r=>ba.test(r),xa=()=>!0,_a=r=>ya.test(r)&&!va.test(r),mi=()=>!1,Sa=r=>Ca.test(r),Ta=r=>ka.test(r),Ra=r=>!D(r)&&!$(r),za=r=>Xt(r,yi,mi),D=r=>gi.test(r),Ct=r=>Xt(r,vi,_a),sn=r=>Xt(r,Pa,W),Er=r=>Xt(r,wi,mi),Ba=r=>Xt(r,bi,Ta),Rs=r=>Xt(r,Ci,Sa),$=r=>fi.test(r),es=r=>Yt(r,vi),Ma=r=>Yt(r,Va),Ar=r=>Yt(r,wi),Ea=r=>Yt(r,yi),Aa=r=>Yt(r,bi),zs=r=>Yt(r,Ci,!0),Xt=(r,e,t)=>{const s=gi.exec(r);return s?s[1]?e(s[1]):t(s[2]):!1},Yt=(r,e,t=!1)=>{const s=fi.exec(r);return s?s[1]?e(s[1]):t:!1},wi=r=>r==="position"||r==="percentage",bi=r=>r==="image"||r==="url",yi=r=>r==="length"||r==="size"||r==="bg-size",vi=r=>r==="length",Pa=r=>r==="number",Va=r=>r==="family-name",Ci=r=>r==="shadow",Da=()=>{const r=me("color"),e=me("font"),t=me("text"),s=me("font-weight"),n=me("tracking"),i=me("leading"),o=me("breakpoint"),a=me("container"),c=me("spacing"),u=me("radius"),d=me("shadow"),h=me("inset-shadow"),f=me("text-shadow"),g=me("drop-shadow"),w=me("blur"),p=me("perspective"),m=me("aspect"),b=me("ease"),v=me("animate"),y=()=>["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"],k=()=>[...C(),$,D],x=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],T=()=>[$,D,c],z=()=>[Dt,"full","auto",...T()],A=()=>[dt,"none","subgrid",$,D],M=()=>["auto",{span:["full",dt,$,D]},dt,$,D],I=()=>[dt,"auto",$,D],F=()=>["auto","min","max","fr",$,D],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...T()],q=()=>[Dt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],V=()=>[r,$,D],_=()=>[...C(),Ar,Er,{position:[$,D]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",Ea,za,{size:[$,D]}],j=()=>[tn,es,Ct],re=()=>["","none","full",u,$,D],ee=()=>["",W,es,Ct],_e=()=>["solid","dashed","dotted","double"],We=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[W,tn,Ar,Er],xs=()=>["","none",w,$,D],Ue=()=>["none",W,$,D],te=()=>["none",W,$,D],Xe=()=>[W,$,D],oe=()=>[Dt,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rt],breakpoint:[rt],color:[xa],container:[rt],"drop-shadow":[rt],ease:["in","out","in-out"],font:[Ra],"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",W],text:[rt],"text-shadow":[rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dt,D,$,m]}],container:["container"],columns:[{columns:[W,D,$,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:k()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[dt,"auto",$,D]}],basis:[{basis:[Dt,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,Dt,"auto","initial","none",D]}],grow:[{grow:["",W,$,D]}],shrink:[{shrink:["",W,$,D]}],order:[{order:[dt,"first","last","none",$,D]}],"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":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",t,es,Ct]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,$,sn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tn,D]}],"font-family":[{font:[Ma,D,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:[n,$,D]}],"line-clamp":[{"line-clamp":[W,"none",$,sn]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",$,D]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[W,"from-font","auto",$,Ct]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[W,"auto",$,D]}],"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]}],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]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dt,$,D],radial:["",$,D],conic:[dt,$,D]},Aa,Ba]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"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:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[W,$,D]}],"outline-w":[{outline:["",W,es,Ct]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,zs,Rs]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",h,zs,Rs]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[W,Ct]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",f,zs,Rs]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[W,$,D]}],"mix-blend":[{"mix-blend":[...We(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":We()}],"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":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[$,D]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,D]}],filter:[{filter:["","none",$,D]}],blur:[{blur:xs()}],brightness:[{brightness:[W,$,D]}],contrast:[{contrast:[W,$,D]}],"drop-shadow":[{"drop-shadow":["","none",g,zs,Rs]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",W,$,D]}],"hue-rotate":[{"hue-rotate":[W,$,D]}],invert:[{invert:["",W,$,D]}],saturate:[{saturate:[W,$,D]}],sepia:[{sepia:["",W,$,D]}],"backdrop-filter":[{"backdrop-filter":["","none",$,D]}],"backdrop-blur":[{"backdrop-blur":xs()}],"backdrop-brightness":[{"backdrop-brightness":[W,$,D]}],"backdrop-contrast":[{"backdrop-contrast":[W,$,D]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,$,D]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,$,D]}],"backdrop-invert":[{"backdrop-invert":["",W,$,D]}],"backdrop-opacity":[{"backdrop-opacity":[W,$,D]}],"backdrop-saturate":[{"backdrop-saturate":[W,$,D]}],"backdrop-sepia":[{"backdrop-sepia":["",W,$,D]}],"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]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",$,D]}],ease:[{ease:["linear","initial",b,$,D]}],delay:[{delay:[W,$,D]}],animate:[{animate:["none",v,$,D]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,$,D]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Ue()}],"rotate-x":[{"rotate-x":Ue()}],"rotate-y":[{"rotate-y":Ue()}],"rotate-z":[{"rotate-z":Ue()}],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:[$,D,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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]}],"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]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[W,es,Ct,sn]}],stroke:[{stroke:["none",...V()]}],"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"]}},$a=ma(Da);function Kn(...r){return $a(ui(r))}const lt=l.defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{type:[String,Object,Function],default:"button"}},setup(r){const e=r;return(t,s)=>(l.openBlock(),l.createBlock(l.unref(sa),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:l.normalizeClass(l.unref(Kn)(l.unref(La)({variant:t.variant,size:t.size}),e.class))},{default:l.withCtx(()=>[l.renderSlot(t.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),La=Jo("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"}}),Ia={md:16};function ki(r){const e=r.getKey("settings.borderRadius")??16;return typeof e!="number"?Ia.md:e}function Oa(r,e=8){if(r<=0)return 0;const t=r-e;return t<=0?4:Math.max(4,t)}function hs(r,e=8){const t=ki(r);return{borderRadius:`${Oa(t,e)}px`}}const wn=r=>r?r.replace(/<br>/g,"<br />").replace(/\n/g,"<br />"):"",Na=["innerHTML"],Ka=["innerHTML"],Fa=["innerHTML"],Wa=["width","height"],Ua=`
|
|
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=`
|
|
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>`,
|
|
5
|
-
* GSAP 3.
|
|
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}/*!
|
|
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 $e={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ut={duration:.5,overwrite:!1,delay:0},Fn,be,ie,tt=1e8,ve=1/tt,yn=Math.PI*2,Ha=yn/4,ja=0,_i=Math.sqrt,Ga=Math.cos,qa=Math.sin,we=function(e){return typeof e=="string"},ue=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"},Bs=function(e){return ue(e)||we(e)},Si=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ce=Array.isArray,vn=/(?:-?\.?\d|\.)+/gi,Ti=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,It=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,nn=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ri=/[+-]=-?[.\d]+/,zi=/[^,'"\[\]\s]+/gi,Za=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,le,Qe,Cn,Hn,Le={},Ds={},Bi,Mi=function(e){return(Ds=Ht(e,Le))&&Ee},jn=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},gs=function(e,t){return!t&&console.warn(e)},Ei=function(e,t){return e&&(Le[e]=t)&&Ds&&(Ds[e]=t)||Le},fs=function(){return 0},Xa={suppressEvents:!0,isStart:!0,kill:!1},As={suppressEvents:!0,kill:!1},Ya={suppressEvents:!0},Gn={},ft=[],kn={},Ai,Pe={},rn={},Pr=30,Ps=[],qn="",Zn=function(e){var t=e[0],s,n;if(st(t)||ue(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(n=Ps.length;n--&&!Ps[n].targetTest(t););s=Ps[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new so(e[n],s)))||e.splice(n,1);return e},Tt=function(e){return e._gsap||Zn(Ke(e))[0]._gsap},Pi=function(e,t,s){return(s=e[t])&&ue(s)?e[t]():Wn(s)&&e.getAttribute&&e.getAttribute(t)||s},ze=function(e,t){return(e=e.split(",")).forEach(t)||e},pe=function(e){return Math.round(e*1e5)/1e5||0},ge=function(e){return Math.round(e*1e7)/1e7||0},Kt=function(e,t){var s=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+n:s==="-"?e-n:s==="*"?e*n:e/n},Qa=function(e,t){for(var s=t.length,n=0;e.indexOf(t[n])<0&&++n<s;);return n<s},$s=function(){var e=ft.length,t=ft.slice(0),s,n;for(kn={},ft.length=0,s=0;s<e;s++)n=t[s],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Xn=function(e){return!!(e._initted||e._startAt||e.add)},Vi=function(e,t,s,n){ft.length&&!be&&$s(),e.render(t,s,!!(be&&t<0&&Xn(e))),ft.length&&!be&&$s()},Di=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(zi).length<2?t:we(e)?e.trim():e},$i=function(e){return e},Ie=function(e,t){for(var s in t)s in e||(e[s]=t[s]);return e},Ja=function(e){return function(t,s){for(var n in s)n in t||n==="duration"&&e||n==="ease"||(t[n]=s[n])}},Ht=function(e,t){for(var s in t)e[s]=t[s];return e},Vr=function r(e,t){for(var s in t)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(e[s]=st(t[s])?r(e[s]||(e[s]={}),t[s]):t[s]);return e},Ls=function(e,t){var s={},n;for(n in e)n in t||(s[n]=e[n]);return s},cs=function(e){var t=e.parent||le,s=e.keyframes?Ja(Ce(e.keyframes)):Ie;if(Re(e.inherit))for(;t;)s(e,t.vars.defaults),t=t.parent||t._dp;return e},el=function(e,t){for(var s=e.length,n=s===t.length;n&&s--&&e[s]===t[s];);return s<0},Li=function(e,t,s,n,i){var o=e[n],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[n]=t,t._prev=o,t.parent=t._dp=e,t},Hs=function(e,t,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var i=t._prev,o=t._next;i?i._next=o:e[s]===t&&(e[s]=o),o?o._prev=i:e[n]===t&&(e[n]=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},Rt=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},tl=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},xn=function(e,t,s,n){return e._startAt&&(be?e._startAt.revert(As):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},sl=function r(e){return!e||e._ts&&r(e.parent)},Dr=function(e){return e._repeat?jt(e._tTime,e=e.duration()+e._rDelay)*e:0},jt=function(e,t){var s=Math.floor(e=ge(e/t));return e&&s===e?s-1:s},Is=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=ge(e._start+(e._tDur/Math.abs(e._ts||e._rts||ve)||0))},Gs=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=ge(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),js(e),s._dirty||Rt(s,e)),e},Ii=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(s=Is(e.rawTime(),t),(!t._dur||Cs(0,t.totalDuration(),s)-t._tTime>ve)&&t.render(s,!0)),Rt(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=-1e-8}},Je=function(e,t,s,n){return t.parent&&wt(t),t._start=ge((ct(s)?s:s||e!==le?Ne(e,s,t):e._time)+t._delay),t._end=ge(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Li(e,t,"_first","_last",e._sort?"_start":0),_n(t)||(e._recent=t),n||Ii(e,t),e._ts<0&&Gs(e,e._tTime),e},Oi=function(e,t){return(Le.ScrollTrigger||jn("scrollTrigger",t))&&Le.ScrollTrigger.create(t,e)},Ni=function(e,t,s,n,i){if(Qn(e,t,i),!e._initted)return 1;if(!s&&e._pt&&!be&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Ai!==Ve.frame)return ft.push(e),e._lazy=[i,n],1},nl=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},_n=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},rl=function(e,t,s,n){var i=e.ratio,o=t<0||!t&&(!e._start&&nl(e)&&!(!e._initted&&_n(e))||(e._ts<0||e._dp._ts<0)&&!_n(e))?0:1,a=e._rDelay,c=0,u,d,h;if(a&&e._repeat&&(c=Cs(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||be||n||e._zTime===ve||!t&&e._zTime){if(!e._initted&&Ni(e,t,n,s,c))return;for(h=e._zTime,e._zTime=t||(s?ve:0),s||(s=t&&!h),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&&xn(e,t,s,!0),e._onUpdate&&!s&&De(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&De(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&wt(e,1),!s&&!be&&(De(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},il=function(e,t,s){var n;if(s>t)for(n=e._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},Gt=function(e,t,s,n){var i=e._repeat,o=ge(t)||0,a=e._tTime/e._tDur;return a&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:ge(o*(i+1)+e._rDelay*i):o,a>0&&!n&&Gs(e,e._tTime=e._tDur*a),e.parent&&js(e),s||Rt(e.parent,e),e},$r=function(e){return e instanceof ke?Rt(e):Gt(e,e._dur)},ol={_start:0,endTime:fs,totalDuration:fs},Ne=function r(e,t,s){var n=e.labels,i=e._recent||ol,o=e.duration()>=tt?i.endTime(!1):e._dur,a,c,u;return we(t)&&(isNaN(t)||t in n)?(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 n||(n[t]=o),n[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&s&&(c=c/100*(Ce(s)?s[0]:s).totalDuration()),a>1?r(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},us=function(e,t,s){var n=ct(t[1]),i=(n?2:1)+(e<2?0:1),o=t[i],a,c;if(n&&(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 he(t[0],o,t[i+1])},yt=function(e,t){return e||e===0?t(e):t},Cs=function(e,t,s){return s<e?e:s>t?t:s},ye=function(e,t){return!we(e)||!(t=Za.exec(e))?"":t[1]},al=function(e,t,s){return yt(s,function(n){return Cs(e,t,n)})},Sn=[].slice,Ki=function(e,t){return e&&st(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&st(e[0]))&&!e.nodeType&&e!==Qe},ll=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(n){var i;return we(n)&&!t||Ki(n,1)?(i=s).push.apply(i,Ke(n)):s.push(n)})||s},Ke=function(e,t,s){return ie&&!t&&ie.selector?ie.selector(e):we(e)&&!s&&(Cn||!qt())?Sn.call((t||Hn).querySelectorAll(e),0):Ce(e)?ll(e,s):Ki(e)?Sn.call(e,0):e?[e]:[]},Tn=function(e){return e=Ke(e)[0]||gs("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return Ke(t,s.querySelectorAll?s:s===e?gs("Invalid scope")||Hn.createElement("div"):e)}},Fi=function(e){return e.sort(function(){return .5-Math.random()})},Wi=function(e){if(ue(e))return e;var t=st(e)?e:{each:e},s=zt(t.ease),n=t.from||0,i=parseFloat(t.base)||0,o={},a=n>0&&n<1,c=isNaN(n)||a,u=t.axis,d=n,h=n;return we(n)?d=h={center:.5,edges:.5,end:1}[n]||0:!a&&c&&(d=n[0],h=n[1]),function(f,g,w){var p=(w||t).length,m=o[p],b,v,y,C,k,x,R,T,z;if(!m){if(z=t.grid==="auto"?0:(t.grid||[1,tt])[1],!z){for(R=-1e8;R<(R=w[z++].getBoundingClientRect().left)&&z<p;);z<p&&z--}for(m=o[p]=[],b=c?Math.min(z,p)*d-.5:n%z,v=z===tt?0:c?p*h/z-.5:n/z|0,R=0,T=tt,x=0;x<p;x++)y=x%z-b,C=v-(x/z|0),m[x]=k=u?Math.abs(u==="y"?C:y):_i(y*y+C*C),k>R&&(R=k),k<T&&(T=k);n==="random"&&Fi(m),m.max=R-T,m.min=T,m.v=p=(parseFloat(t.amount)||parseFloat(t.each)*(z>p?p-1:u?u==="y"?p/z:z:Math.max(z,p/z))||0)*(n==="edges"?-1:1),m.b=p<0?i-p:i,m.u=ye(t.amount||t.each)||0,s=s&&p<0?Ji(s):s}return p=(m[f]-m.min)/m.max||0,ge(m.b+(s?s(p):p)*m.v)+m.u}},Rn=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var n=ge(Math.round(parseFloat(s)/e)*e*t);return(n-n%1)/t+(ct(s)?0:ye(s))}},Ui=function(e,t){var s=Ce(e),n,i;return!s&&st(e)&&(n=s=e.radius||tt,e.values?(e=Ke(e.values),(i=!ct(e[0]))&&(n*=n)):e=Rn(e.increment)),yt(t,s?ue(e)?function(o){return i=e(o),Math.abs(i-o)<=n?i:o}:function(o){for(var a=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),u=tt,d=0,h=e.length,f,g;h--;)i?(f=e[h].x-a,g=e[h].y-c,f=f*f+g*g):f=Math.abs(e[h]-a),f<u&&(u=f,d=h);return d=!n||u<=n?e[d]:o,i||d===o||ct(o)?d:d+ye(o)}:Rn(e))},Hi=function(e,t,s,n){return yt(Ce(e)?!t:s===!0?!!(s=0):!n,function(){return Ce(e)?e[~~(Math.random()*e.length)]:(s=s||1e-5)&&(n=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((e-s/2+Math.random()*(t-e+s*.99))/s)*s*n)/n})},cl=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return function(n){return t.reduce(function(i,o){return o(i)},n)}},ul=function(e,t){return function(s){return e(parseFloat(s))+(t||ye(s))}},dl=function(e,t,s){return Gi(e,t,0,1,s)},ji=function(e,t,s){return yt(s,function(n){return e[~~t(n)]})},pl=function r(e,t,s){var n=t-e;return Ce(e)?ji(e,r(0,e.length),t):yt(s,function(i){return(n+(i-e)%n)%n+e})},hl=function r(e,t,s){var n=t-e,i=n*2;return Ce(e)?ji(e,r(0,e.length-1),t):yt(s,function(o){return o=(i+(o-e)%i)%i||0,e+(o>n?i-o:o)})},ms=function(e){for(var t=0,s="",n,i,o,a;~(n=e.indexOf("random(",t));)o=e.indexOf(")",n),a=e.charAt(n+7)==="[",i=e.substr(n+7,o-n-7).match(a?zi:vn),s+=e.substr(t,n-t)+Hi(a?i:+i[0],a?0:+i[1],+i[2]||1e-5),t=o+1;return s+e.substr(t,e.length-t)},Gi=function(e,t,s,n,i){var o=t-e,a=n-s;return yt(i,function(c){return s+((c-e)/o*a||0)})},gl=function r(e,t,s,n){var i=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!i){var o=we(e),a={},c,u,d,h,f;if(s===!0&&(n=1)&&(s=null),o)e={p:e},t={p:t};else if(Ce(e)&&!Ce(t)){for(d=[],h=e.length,f=h-2,u=1;u<h;u++)d.push(r(e[u-1],e[u]));h--,i=function(w){w*=h;var p=Math.min(f,~~w);return d[p](w-p)},s=t}else n||(e=Ht(Ce(e)?[]:{},e));if(!d){for(c in t)Yn.call(a,e,c,"get",t[c]);i=function(w){return tr(w,a)||(o?e.p:e)}}}return yt(s,i)},Lr=function(e,t,s){var n=e.labels,i=tt,o,a,c;for(o in n)a=n[o]-t,a<0==!!s&&a&&i>(a=Math.abs(a))&&(c=o,i=a);return c},De=function(e,t,s){var n=e.vars,i=n[t],o=ie,a=e._ctx,c,u,d;if(i)return c=n[t+"Params"],u=n.callbackScope||e,s&&ft.length&&$s(),a&&(ie=a),d=c?i.apply(u,c):i.call(u),ie=o,d},os=function(e){return wt(e),e.scrollTrigger&&e.scrollTrigger.kill(!!be),e.progress()<1&&De(e,"onInterrupt"),e},Ot,qi=[],Zi=function(e){if(e)if(e=!e.name&&e.default||e,Un()||e.headless){var t=e.name,s=ue(e),n=t&&!s&&e.init?function(){this._props=[]}:e,i={init:fs,render:tr,add:Yn,kill:Ml,modifier:Bl,rawVars:0},o={targetTest:0,get:0,getSetter:er,aliases:{},register:0};if(qt(),e!==n){if(Pe[t])return;Ie(n,Ie(Ls(e,i),o)),Ht(n.prototype,Ht(i,Ls(e,o))),Pe[n.prop=t]=n,e.targetTest&&(Ps.push(n),Gn[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Ei(t,n),e.register&&e.register(Ee,n,Be)}else qi.push(e)},se=255,as={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]},on=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},Xi=function(e,t,s){var n=e?ct(e)?[e>>16,e>>8&se,e&se]:0:as.black,i,o,a,c,u,d,h,f,g,w;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),as[e])n=as[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 n=parseInt(e.substr(1,6),16),[n>>16,n>>8&se,n&se,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&se,e&se]}else if(e.substr(0,3)==="hsl"){if(n=w=e.match(vn),!t)c=+n[0]%360/360,u=+n[1]/100,d=+n[2]/100,o=d<=.5?d*(u+1):d+u-d*u,i=d*2-o,n.length>3&&(n[3]*=1),n[0]=on(c+1/3,i,o),n[1]=on(c,i,o),n[2]=on(c-1/3,i,o);else if(~e.indexOf("="))return n=e.match(Ti),s&&n.length<4&&(n[3]=1),n}else n=e.match(vn)||as.transparent;n=n.map(Number)}return t&&!w&&(i=n[0]/se,o=n[1]/se,a=n[2]/se,h=Math.max(i,o,a),f=Math.min(i,o,a),d=(h+f)/2,h===f?c=u=0:(g=h-f,u=d>.5?g/(2-h-f):g/(h+f),c=h===i?(o-a)/g+(o<a?6:0):h===o?(a-i)/g+2:(i-o)/g+4,c*=60),n[0]=~~(c+.5),n[1]=~~(u*100+.5),n[2]=~~(d*100+.5)),s&&n.length<4&&(n[3]=1),n},Yi=function(e){var t=[],s=[],n=-1;return e.split(mt).forEach(function(i){var o=i.match(It)||[];t.push.apply(t,o),s.push(n+=o.length+1)}),t.c=s,t},Ir=function(e,t,s){var n="",i=(e+n).match(mt),o=t?"hsla(":"rgba(",a=0,c,u,d,h;if(!i)return e;if(i=i.map(function(f){return(f=Xi(f,t,1))&&o+(t?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),s&&(d=Yi(e),c=s.c,c.join(n)!==d.c.join(n)))for(u=e.replace(mt,"1").split(It),h=u.length-1;a<h;a++)n+=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),h=u.length-1;a<h;a++)n+=u[a]+i[a];return n+u[h]},mt=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in as)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),fl=/hsl[a]?\(/,Qi=function(e){var t=e.join(" "),s;if(mt.lastIndex=0,mt.test(t))return s=fl.test(t),e[1]=Ir(e[1],s),e[0]=Ir(e[0],s,Yi(e[1])),!0},ws,Ve=function(){var r=Date.now,e=500,t=33,s=r(),n=s,i=1e3/240,o=i,a=[],c,u,d,h,f,g,w=function p(m){var b=r()-n,v=m===!0,y,C,k,x;if((b>e||b<0)&&(s+=b-t),n+=b,k=n-s,y=k-o,(y>0||v)&&(x=++h.frame,f=k-h.time*1e3,h.time=k=k/1e3,o+=y+(y>=i?4:i-y),C=1),v||(c=u(p)),C)for(g=0;g<a.length;g++)a[g](k,f,x,m)};return h={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(m){return f/(1e3/(m||60))},wake:function(){Bi&&(!Cn&&Un()&&(Qe=Cn=window,Hn=Qe.document||{},Le.gsap=Ee,(Qe.gsapVersions||(Qe.gsapVersions=[])).push(Ee.version),Mi(Ds||Qe.GreenSockGlobals||!Qe.gsap&&Qe||{}),qi.forEach(Zi)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&h.sleep(),u=d||function(m){return setTimeout(m,o-h.time*1e3+1|0)},ws=1,w(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(c),ws=0,u=fs},lagSmoothing:function(m,b){e=m||1/0,t=Math.min(b||33,e)},fps:function(m){i=1e3/(m||240),o=h.time*1e3+i},add:function(m,b,v){var y=b?function(C,k,x,R){m(C,k,x,R),h.remove(y)}:m;return h.remove(m),a[v?"unshift":"push"](y),qt(),y},remove:function(m,b){~(b=a.indexOf(m))&&a.splice(b,1)&&g>=b&&g--},_listeners:a},h}(),qt=function(){return!ws&&Ve.wake()},G={},ml=/^[\d.\-M][\d.\-,\s]/,wl=/["']/g,bl=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),n=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[n]=isNaN(u)?u.replace(wl,"").trim():+u,n=c.substr(a+1).trim();return t},yl=function(e){var t=e.indexOf("(")+1,s=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<s?e.indexOf(")",s+1):s)},vl=function(e){var t=(e+"").split("("),s=G[t[0]];return s&&t.length>1&&s.config?s.config.apply(null,~e.indexOf("{")?[bl(t[1])]:yl(e).split(",").map(Di)):G._CE&&ml.test(e)?G._CE("",e):s},Ji=function(e){return function(t){return 1-e(1-t)}},eo=function r(e,t){for(var s=e._first,n;s;)s instanceof ke?r(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?r(s.timeline,t):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=t)),s=s._next},zt=function(e,t){return e&&(ue(e)?e:G[e]||vl(e))||t},At=function(e,t,s,n){s===void 0&&(s=function(c){return 1-t(1-c)}),n===void 0&&(n=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var i={easeIn:t,easeOut:s,easeInOut:n},o;return ze(e,function(a){G[a]=Le[a]=i,G[o=a.toLowerCase()]=s;for(var c in i)G[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=G[a+"."+c]=i[c]}),i},to=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},an=function r(e,t,s){var n=t>=1?t:1,i=(s||(e?.3:.45))/(t<1?t:1),o=i/yn*(Math.asin(1/n)||0),a=function(d){return d===1?1:n*Math.pow(2,-10*d)*qa((d-o)*i)+1},c=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:to(a);return i=yn/i,c.config=function(u,d){return r(e,u,d)},c},ln=function r(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},n=e==="out"?s:e==="in"?function(i){return 1-s(1-i)}:to(s);return n.config=function(i){return r(e,i)},n};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;At(r+",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})});G.Linear.easeNone=G.none=G.Linear.easeIn;At("Elastic",an("in"),an("out"),an());(function(r,e){var t=1/e,s=2*t,n=2.5*t,i=function(a){return a<t?r*a*a:a<s?r*Math.pow(a-1.5/e,2)+.75:a<n?r*(a-=2.25/e)*a+.9375:r*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(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});At("Circ",function(r){return-(_i(1-r*r)-1)});At("Sine",function(r){return r===1?1:-Ga(r*Ha)+1});At("Back",ln("in"),ln("out"),ln());G.SteppedEase=G.steps=Le.SteppedEase={config:function(e,t){e===void 0&&(e=1);var s=1/e,n=e+(t?0:1),i=t?1:0,o=1-ve;return function(a){return((n*Cs(0,o,a)|0)+i)*s}}};Ut.ease=G["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return qn+=r+","+r+"Params,"});var so=function(e,t){this.id=ja++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Pi,this.set=t?t.getSetter:er},bs=function(){function r(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,Gt(this,+t.duration,1,1),this.data=t.data,ie&&(this._ctx=ie,ie.data.push(this)),ws||Ve.wake()}var e=r.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,Gt(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,n){if(qt(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Gs(this,s),!i._dp||i.parent||Ii(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)&&Je(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===ve||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Vi(this,s,n)),this},e.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Dr(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},e.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Dr(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,n):this._repeat?jt(this._tTime,i)+1:1},e.timeScale=function(s,n){if(!arguments.length)return this._rts===-1e-8?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?Is(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-1e-8?0:this._rts,this.totalTime(Cs(-Math.abs(this._delay),this.totalDuration(),i),n!==!1),js(this),tl(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):(qt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ve&&(this._tTime-=ve)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Je(n,this,s-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 n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Is(n.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=Ya);var n=be;return be=s,Xn(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),be=n,this},e.globalTime=function(s){for(var n=this,i=arguments.length?s:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._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,$r(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,$r(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,n){return this.totalTime(Ne(this,s),Re(n))},e.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,Re(n)),this._dur||(this._zTime=-1e-8),this},e.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},e.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(s,n){return s!=null&&this.seek(s,n),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?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var s=this.parent||this._dp,n=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=n&&i<this.endTime(!0)-ve)},e.eventCallback=function(s,n,i){var o=this.vars;return arguments.length>1?(n?(o[s]=n,i&&(o[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},e.then=function(s){var n=this;return new Promise(function(i){var o=ue(s)?s:$i,a=function(){var u=n.then;n.then=null,ue(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=u),i(o),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},e.kill=function(){os(this)},r}();Ie(bs.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:-1e-8,_prom:0,_ps:!1,_rts:1});var ke=function(r){xi(e,r);function e(s,n){var i;return s===void 0&&(s={}),i=r.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=Re(s.sortChildren),le&&Je(s.parent||le,ot(i),n),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&Oi(ot(i),s.scrollTrigger),i}var t=e.prototype;return t.to=function(n,i,o){return us(0,arguments,this),this},t.from=function(n,i,o){return us(1,arguments,this),this},t.fromTo=function(n,i,o,a){return us(2,arguments,this),this},t.set=function(n,i,o){return i.duration=0,i.parent=this,cs(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new he(n,i,Ne(this,o),1),this},t.call=function(n,i,o){return Je(this,he.delayedCall(0,n,i),o)},t.staggerTo=function(n,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 he(n,o,Ne(this,c)),this},t.staggerFrom=function(n,i,o,a,c,u,d){return o.runBackwards=1,cs(o).immediateRender=Re(o.immediateRender),this.staggerTo(n,i,o,a,c,u,d)},t.staggerFromTo=function(n,i,o,a,c,u,d,h){return a.startAt=o,cs(a).immediateRender=Re(a.immediateRender),this.staggerTo(n,i,a,c,u,d,h)},t.render=function(n,i,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,u=this._dur,d=n<=0?0:ge(n),h=this._zTime<0!=n<0&&(this._initted||!u),f,g,w,p,m,b,v,y,C,k,x,R;if(this!==le&&d>c&&n>=0&&(d=c),d!==this._tTime||o||h){if(a!==this._time&&u&&(d+=this._time-a,n+=this._time-a),f=d,C=this._start,y=this._ts,b=!y,h&&(u||(a=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(x=this._yoyo,m=u+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(m*100+n,i,o);if(f=ge(d%m),d===c?(p=this._repeat,f=u):(k=ge(d/m),p=~~k,p&&p===k&&(f=u,p--),f>u&&(f=u)),k=jt(this._tTime,m),!a&&this._tTime&&k!==p&&this._tTime-k*m-this._dur<=0&&(k=p),x&&p&1&&(f=u-f,R=1),p!==k&&!this._lock){var T=x&&k&1,z=T===(x&&p&1);if(p<k&&(T=!T),a=T?0:d%u?u:d,this._lock=1,this.render(a||(R?0:ge(p*m)),i,!u)._lock=0,this._tTime=d,!i&&this.parent&&De(this,"onRepeat"),this.vars.repeatRefresh&&!R&&(this.invalidate()._lock=1),a&&a!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,c=this._tDur,z&&(this._lock=2,a=T?u:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!R&&this.invalidate()),this._lock=0,!this._ts&&!b)return this;eo(this,R)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=il(this,ge(a),ge(f)),v&&(d-=f-(f=v._start))),this._tTime=d,this._time=f,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&d&&!i&&!k&&(De(this,"onStart"),this._tTime!==d))return this;if(f>=a&&n>=0)for(g=this._first;g;){if(w=g._next,(g._act||f>=g._start)&&g._ts&&v!==g){if(g.parent!==this)return this.render(n,i,o);if(g.render(g._ts>0?(f-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(f-g._start)*g._ts,i,o),f!==this._time||!this._ts&&!b){v=0,w&&(d+=this._zTime=-1e-8);break}}g=w}else{g=this._last;for(var A=n<0?n:f;g;){if(w=g._prev,(g._act||A<=g._end)&&g._ts&&v!==g){if(g.parent!==this)return this.render(n,i,o);if(g.render(g._ts>0?(A-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(A-g._start)*g._ts,i,o||be&&Xn(g)),f!==this._time||!this._ts&&!b){v=0,w&&(d+=this._zTime=A?-1e-8:ve);break}}g=w}}if(v&&!i&&(this.pause(),v.render(f>=a?0:-1e-8)._zTime=f>=a?1:-1,this._ts))return this._start=C,js(this),this.render(n,i,o);this._onUpdate&&!i&&De(this,"onUpdate",!0),(d===c&&this._tTime>=this.totalDuration()||!d&&a)&&(C===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(d===c&&this._ts>0||!d&&this._ts<0)&&wt(this,1),!i&&!(n<0&&!a)&&(d||a||!c)&&(De(this,d===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var o=this;if(ct(i)||(i=Ne(this,i,n)),!(n instanceof bs)){if(Ce(n))return n.forEach(function(a){return o.add(a,i)}),this;if(we(n))return this.addLabel(n,i);if(ue(n))n=he.delayedCall(0,n);else return this}return this!==n?Je(this,n,i):this},t.getChildren=function(n,i,o,a){n===void 0&&(n=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),a===void 0&&(a=-1e8);for(var c=[],u=this._first;u;)u._start>=a&&(u instanceof he?i&&c.push(u):(o&&c.push(u),n&&c.push.apply(c,u.getChildren(!0,i,o)))),u=u._next;return c},t.getById=function(n){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===n)return i[o]},t.remove=function(n){return we(n)?this.removeLabel(n):ue(n)?this.killTweensOf(n):(n.parent===this&&Hs(this,n),n===this._recent&&(this._recent=this._last),Rt(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ge(Ve.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=Ne(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,o){var a=he.delayedCall(0,i||fs,o);return a.data="isPause",this._hasPause=1,Je(this,a,Ne(this,n))},t.removePause=function(n){var i=this._first;for(n=Ne(this,n);i;)i._start===n&&i.data==="isPause"&&wt(i),i=i._next},t.killTweensOf=function(n,i,o){for(var a=this.getTweensOf(n,o),c=a.length;c--;)pt!==a[c]&&a[c].kill(n,i);return this},t.getTweensOf=function(n,i){for(var o=[],a=Ke(n),c=this._first,u=ct(i),d;c;)c instanceof he?Qa(c._targets,a)&&(u?(!pt||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(n,i){i=i||{};var o=this,a=Ne(o,n),c=i,u=c.startAt,d=c.onStart,h=c.onStartParams,f=c.immediateRender,g,w=he.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())||ve,onStart:function(){if(o.pause(),!g){var m=i.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());w._dur!==m&&Gt(w,m,0,1).render(w._time,!0,!0),g=1}d&&d.apply(w,h||[])}},i));return f?w.render(0):w},t.tweenFromTo=function(n,i,o){return this.tweenTo(i,Ie({startAt:{time:Ne(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Lr(this,Ne(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Lr(this,Ne(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+ve)},t.shiftChildren=function(n,i,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,u;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(i)for(u in c)c[u]>=o&&(c[u]+=n);return Rt(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!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),n&&(this.labels={}),Rt(this)},t.totalDuration=function(n){var i=0,o=this,a=o._last,c=tt,u,d,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(h=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),d=a._start,d>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,Je(o,a,d-a._delay,1)._lock=0):c=d,d<0&&a._ts&&(i-=d,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=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;Gt(o,o===le&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(le._ts&&(Vi(le,Is(n,le)),Ai=Ve.frame),Ve.frame>=Pr){Pr+=$e.autoSleep||120;var i=le._first;if((!i||!i._ts)&&$e.autoSleep&&Ve._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Ve.sleep()}}},e}(bs);Ie(ke.prototype,{_lock:0,_hasPause:0,_forcing:0});var Cl=function(e,t,s,n,i,o,a){var c=new Be(this._pt,e,t,0,1,lo,null,i),u=0,d=0,h,f,g,w,p,m,b,v;for(c.b=s,c.e=n,s+="",n+="",(b=~n.indexOf("random("))&&(n=ms(n)),o&&(v=[s,n],o(v,e,t),s=v[0],n=v[1]),f=s.match(nn)||[];h=nn.exec(n);)w=h[0],p=n.substring(u,h.index),g?g=(g+1)%5:p.substr(-5)==="rgba("&&(g=1),w!==f[d++]&&(m=parseFloat(f[d-1])||0,c._pt={_next:c._pt,p:p||d===1?p:",",s:m,c:w.charAt(1)==="="?Kt(m,w)-m:parseFloat(w)-m,m:g&&g<4?Math.round:0},u=nn.lastIndex);return c.c=u<n.length?n.substring(u,n.length):"",c.fp=a,(Ri.test(n)||b)&&(c.e=0),this._pt=c,c},Yn=function(e,t,s,n,i,o,a,c,u,d){ue(n)&&(n=n(i||0,e,o));var h=e[t],f=s!=="get"?s:ue(h)?u?e[t.indexOf("set")||!ue(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():h,g=ue(h)?u?Tl:oo:Jn,w;if(we(n)&&(~n.indexOf("random(")&&(n=ms(n)),n.charAt(1)==="="&&(w=Kt(f,n)+(ye(f)||0),(w||w===0)&&(n=w))),!d||f!==n||zn)return!isNaN(f*n)&&n!==""?(w=new Be(this._pt,e,t,+f||0,n-(f||0),typeof h=="boolean"?zl:ao,0,g),u&&(w.fp=u),a&&w.modifier(a,this,e),this._pt=w):(!h&&!(t in e)&&jn(t,n),Cl.call(this,e,t,f,n,g,c||$e.stringFilter,u))},kl=function(e,t,s,n,i){if(ue(e)&&(e=ds(e,i,t,s,n)),!st(e)||e.style&&e.nodeType||Ce(e)||Si(e))return we(e)?ds(e,i,t,s,n):e;var o={},a;for(a in e)o[a]=ds(e[a],i,t,s,n);return o},no=function(e,t,s,n,i,o){var a,c,u,d;if(Pe[e]&&(a=new Pe[e]).init(i,a.rawVars?t[e]:kl(t[e],n,i,o,s),s,n,o)!==!1&&(s._pt=c=new Be(s._pt,i,e,0,1,a.render,a,0,a.priority),s!==Ot))for(u=s._ptLookup[s._targets.indexOf(i)],d=a._props.length;d--;)u[a._props[d]]=c;return a},pt,zn,Qn=function r(e,t,s){var n=e.vars,i=n.ease,o=n.startAt,a=n.immediateRender,c=n.lazy,u=n.onUpdate,d=n.runBackwards,h=n.yoyoEase,f=n.keyframes,g=n.autoRevert,w=e._dur,p=e._startAt,m=e._targets,b=e.parent,v=b&&b.data==="nested"?b.vars.targets:m,y=e._overwrite==="auto"&&!Fn,C=e.timeline,k,x,R,T,z,A,M,I,F,J,P,H,q;if(C&&(!f||!i)&&(i="none"),e._ease=zt(i,Ut.ease),e._yEase=h?Ji(zt(h===!0?i:h,Ut.ease)):0,h&&e._yoyo&&!e._repeat&&(h=e._yEase,e._yEase=e._ease,e._ease=h),e._from=!C&&!!n.runBackwards,!C||f&&!n.stagger){if(I=m[0]?Tt(m[0]).harness:0,H=I&&n[I.prop],k=Ls(n,Gn),p&&(p._zTime<0&&p.progress(1),t<0&&d&&a&&!g?p.render(-1,!0):p.revert(d&&w?As:Xa),p._lazy=0),o){if(wt(e._startAt=he.set(m,Ie({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!p&&Re(c),startAt:null,delay:0,onUpdate:u&&function(){return De(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(be||!a&&!g)&&e._startAt.revert(As),a&&w&&t<=0&&s<=0){t&&(e._zTime=t);return}}else if(d&&w&&!p){if(t&&(a=!1),R=Ie({overwrite:!1,data:"isFromStart",lazy:a&&!p&&Re(c),immediateRender:a,stagger:0,parent:b},k),H&&(R[I.prop]=H),wt(e._startAt=he.set(m,R)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(be?e._startAt.revert(As):e._startAt.render(-1,!0)),e._zTime=t,!a)r(e._startAt,ve,ve);else if(!t)return}for(e._pt=e._ptCache=0,c=w&&Re(c)||c&&!w,x=0;x<m.length;x++){if(z=m[x],M=z._gsap||Zn(m)[x]._gsap,e._ptLookup[x]=J={},kn[M.id]&&ft.length&&$s(),P=v===m?x:v.indexOf(z),I&&(F=new I).init(z,H||k,e,P,v)!==!1&&(e._pt=T=new Be(e._pt,z,F.name,0,1,F.render,F,0,F.priority),F._props.forEach(function(V){J[V]=T}),F.priority&&(A=1)),!I||H)for(R in k)Pe[R]&&(F=no(R,k,e,P,z,v))?F.priority&&(A=1):J[R]=T=Yn.call(e,z,R,"get",k[R],P,v,0,n.stringFilter);e._op&&e._op[x]&&e.kill(z,e._op[x]),y&&e._pt&&(pt=e,le.killTweensOf(z,J,e.globalTime(t)),q=!e.parent,pt=0),e._pt&&c&&(kn[M.id]=1)}A&&co(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!q,f&&t<=0&&C.render(tt,!0,!0)},xl=function(e,t,s,n,i,o,a,c){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],d,h,f,g;if(!u)for(u=e._ptCache[t]=[],f=e._ptLookup,g=e._targets.length;g--;){if(d=f[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 zn=1,e.vars[t]="+=0",Qn(e,a),zn=0,c?gs(t+" not eligible for reset"):1;u.push(d)}for(g=u.length;g--;)h=u[g],d=h._pt||h,d.s=(n||n===0)&&!i?n:d.s+(n||0)+o*d.c,d.c=s-d.s,h.e&&(h.e=pe(s)+ye(h.e)),h.b&&(h.b=d.s+ye(h.b))},_l=function(e,t){var s=e[0]?Tt(e[0]).harness:0,n=s&&s.aliases,i,o,a,c;if(!n)return t;i=Ht({},t);for(o in n)if(o in i)for(c=n[o].split(","),a=c.length;a--;)i[c[a]]=i[o];return i},Sl=function(e,t,s,n){var i=t.ease||n||"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})},ds=function(e,t,s,n,i){return ue(e)?e.call(t,s,n,i):we(e)&&~e.indexOf("random(")?ms(e):e},ro=qn+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",io={};ze(ro+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return io[r]=1});var he=function(r){xi(e,r);function e(s,n,i,o){var a;typeof n=="number"&&(i.duration=n,n=i,i=null),a=r.call(this,o?n:cs(n))||this;var c=a.vars,u=c.duration,d=c.delay,h=c.immediateRender,f=c.stagger,g=c.overwrite,w=c.keyframes,p=c.defaults,m=c.scrollTrigger,b=c.yoyoEase,v=n.parent||le,y=(Ce(s)||Si(s)?ct(s[0]):"length"in n)?[s]:Ke(s),C,k,x,R,T,z,A,M;if(a._targets=y.length?Zn(y):gs("GSAP target "+s+" not found. https://gsap.com",!$e.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,w||f||Bs(u)||Bs(d)){if(n=a.vars,C=a.timeline=new ke({data:"nested",defaults:p||{},targets:v&&v.data==="nested"?v.vars.targets:y}),C.kill(),C.parent=C._dp=ot(a),C._start=0,f||Bs(u)||Bs(d)){if(R=y.length,A=f&&Wi(f),st(f))for(T in f)~ro.indexOf(T)&&(M||(M={}),M[T]=f[T]);for(k=0;k<R;k++)x=Ls(n,io),x.stagger=0,b&&(x.yoyoEase=b),M&&Ht(x,M),z=y[k],x.duration=+ds(u,ot(a),k,z,y),x.delay=(+ds(d,ot(a),k,z,y)||0)-a._delay,!f&&R===1&&x.delay&&(a._delay=d=x.delay,a._start+=d,x.delay=0),C.to(z,x,A?A(k,z,y):0),C._ease=G.none;C.duration()?u=d=0:a.timeline=0}else if(w){cs(Ie(C.vars.defaults,{ease:"none"})),C._ease=zt(w.ease||n.ease||"none");var I=0,F,J,P;if(Ce(w))w.forEach(function(H){return C.to(y,H,">")}),C.duration();else{x={};for(T in w)T==="ease"||T==="easeEach"||Sl(T,w[T],x,w.easeEach);for(T in x)for(F=x[T].sort(function(H,q){return H.t-q.t}),I=0,k=0;k<F.length;k++)J=F[k],P={ease:J.e,duration:(J.t-(k?F[k-1].t:0))/100*u},P[T]=J.v,C.to(y,P,I),I+=P.duration;C.duration()<u&&C.to({},{duration:u-C.duration()})}}u||a.duration(u=C.duration())}else a.timeline=0;return g===!0&&!Fn&&(pt=ot(a),le.killTweensOf(y),pt=0),Je(v,ot(a),i),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(h||!u&&!w&&a._start===ge(v._time)&&Re(h)&&sl(ot(a))&&v.data!=="nested")&&(a._tTime=-1e-8,a.render(Math.max(0,-d)||0)),m&&Oi(ot(a),m),a}var t=e.prototype;return t.render=function(n,i,o){var a=this._time,c=this._tDur,u=this._dur,d=n<0,h=n>c-ve&&!d?c:n<ve?0:n,f,g,w,p,m,b,v,y,C;if(!u)rl(this,n,i,o);else if(h!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==d||this._lazy){if(f=h,y=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&d)return this.totalTime(p*100+n,i,o);if(f=ge(h%p),h===c?(w=this._repeat,f=u):(m=ge(h/p),w=~~m,w&&w===m?(f=u,w--):f>u&&(f=u)),b=this._yoyo&&w&1,b&&(C=this._yEase,f=u-f),m=jt(this._tTime,p),f===a&&!o&&this._initted&&w===m)return this._tTime=h,this;w!==m&&(y&&this._yEase&&eo(y,b),this.vars.repeatRefresh&&!b&&!this._lock&&f!==p&&this._initted&&(this._lock=o=1,this.render(ge(p*w),!0).invalidate()._lock=0))}if(!this._initted){if(Ni(this,d?n:f,o,i,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&w!==m))return this;if(u!==this._dur)return this.render(n,i,o)}if(this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(C||this._ease)(f/u),this._from&&(this.ratio=v=1-v),!a&&h&&!i&&!m&&(De(this,"onStart"),this._tTime!==h))return this;for(g=this._pt;g;)g.r(v,g.d),g=g._next;y&&y.render(n<0?n:y._dur*y._ease(f/this._dur),i,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(d&&xn(this,n,i,o),De(this,"onUpdate")),this._repeat&&w!==m&&this.vars.onRepeat&&!i&&this.parent&&De(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(d&&!this._onUpdate&&xn(this,n,!0,!0),(n||!u)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&wt(this,1),!i&&!(d&&!a)&&(h||a||b)&&(De(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,o,a,c){ws||Ve.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),xl(this,n,i,o,a,d,u,c)?this.resetTo(n,i,o,a,1):(Gs(this,0),this.parent||Li(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?os(this):this.scrollTrigger&&this.scrollTrigger.kill(!!be),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,pt&&pt.vars.overwrite!==!0)._first||os(this),this.parent&&o!==this.timeline.totalDuration()&&Gt(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=n?Ke(n):a,u=this._ptLookup,d=this._pt,h,f,g,w,p,m,b;if((!i||i==="all")&&el(a,c))return i==="all"&&(this._pt=0),os(this);for(h=this._op=this._op||[],i!=="all"&&(we(i)&&(p={},ze(i,function(v){return p[v]=1}),i=p),i=_l(a,i)),b=a.length;b--;)if(~c.indexOf(a[b])){f=u[b],i==="all"?(h[b]=i,w=f,g={}):(g=h[b]=h[b]||{},w=i);for(p in w)m=f&&f[p],m&&((!("kill"in m.d)||m.d.kill(p)===!0)&&Hs(this,m,"_pt"),delete f[p]),g!=="all"&&(g[p]=1)}return this._initted&&!this._pt&&d&&os(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return us(1,arguments)},e.delayedCall=function(n,i,o,a){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(n,i,o){return us(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,o){return le.killTweensOf(n,i,o)},e}(bs);Ie(he.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(r){he[r]=function(){var e=new ke,t=Sn.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var Jn=function(e,t,s){return e[t]=s},oo=function(e,t,s){return e[t](s)},Tl=function(e,t,s,n){return e[t](n.fp,s)},Rl=function(e,t,s){return e.setAttribute(t,s)},er=function(e,t){return ue(e[t])?oo:Wn(e[t])&&e.setAttribute?Rl:Jn},ao=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},zl=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},lo=function(e,t){var s=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+n,s=s._next;n+=t.c}t.set(t.t,t.p,n,t)},tr=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},Bl=function(e,t,s,n){for(var i=this._pt,o;i;)o=i._next,i.p===n&&i.modifier(e,t,s),i=o},Ml=function(e){for(var t=this._pt,s,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?Hs(this,t,"_pt"):t.dep||(s=1),t=n;return!s},El=function(e,t,s,n){n.mSet(e,t,n.m.call(n.tween,s,n.mt),n)},co=function(e){for(var t=e._pt,s,n,i,o;t;){for(s=t._next,n=i;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:o)?t._prev._next=t:i=t,(t._next=n)?n._prev=t:o=t,t=s}e._pt=i},Be=function(){function r(t,s,n,i,o,a,c,u,d){this.t=s,this.s=i,this.c=o,this.p=n,this.r=a||ao,this.d=c||this,this.set=u||Jn,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(s,n,i){this.mSet=this.mSet||this.set,this.set=El,this.m=s,this.mt=i,this.tween=n},r}();ze(qn+"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(r){return Gn[r]=1});Le.TweenMax=Le.TweenLite=he;Le.TimelineLite=Le.TimelineMax=ke;le=new ke({sortChildren:!1,defaults:Ut,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});$e.stringFilter=Qi;var Bt=[],Vs={},Al=[],Or=0,Pl=0,cn=function(e){return(Vs[e]||Al).map(function(t){return t()})},Bn=function(){var e=Date.now(),t=[];e-Or>2&&(cn("matchMediaInit"),Bt.forEach(function(s){var n=s.queries,i=s.conditions,o,a,c,u;for(a in n)o=Qe.matchMedia(n[a]).matches,o&&(c=1),o!==i[a]&&(i[a]=o,u=1);u&&(s.revert(),c&&t.push(s))}),cn("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),Or=e,cn("matchMedia"))},uo=function(){function r(t,s){this.selector=s&&Tn(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Pl++,t&&this.add(t)}var e=r.prototype;return e.add=function(s,n,i){ue(s)&&(i=n,n=s,s=ue);var o=this,a=function(){var u=ie,d=o.selector,h;return u&&u!==o&&u.data.push(o),i&&(o.selector=Tn(i)),ie=o,h=n.apply(o,arguments),ue(h)&&o._r.push(h),ie=u,o.selector=d,o.isReverted=!1,h};return o.last=a,s===ue?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var n=ie;ie=null,s(this),ie=n},e.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof r?s.push.apply(s,n.getTweens()):n instanceof he&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,n){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,h){return h.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 he)&&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(),n)for(var o=Bt.length;o--;)Bt[o].id===this.id&&Bt.splice(o,1)},e.revert=function(s){this.kill(s||{})},r}(),Vl=function(){function r(t){this.contexts=[],this.scope=t,ie&&ie.data.push(this)}var e=r.prototype;return e.add=function(s,n,i){st(s)||(s={matches:s});var o=new uo(0,i||this.scope),a=o.conditions={},c,u,d;ie&&!o.selector&&(o.selector=ie.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(u in s)u==="all"?d=1:(c=Qe.matchMedia(s[u]),c&&(Bt.indexOf(o)<0&&Bt.push(o),(a[u]=c.matches)&&(d=1),c.addListener?c.addListener(Bn):c.addEventListener("change",Bn)));return d&&n(o,function(h){return o.add(null,h)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},r}(),Os={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(function(n){return Zi(n)})},timeline:function(e){return new ke(e)},getTweensOf:function(e,t){return le.getTweensOf(e,t)},getProperty:function(e,t,s,n){we(e)&&(e=Ke(e)[0]);var i=Tt(e||{}).get,o=s?$i:Di;return s==="native"&&(s=""),e&&(t?o((Pe[t]&&Pe[t].get||i)(e,t,s,n)):function(a,c,u){return o((Pe[a]&&Pe[a].get||i)(e,a,c,u))})},quickSetter:function(e,t,s){if(e=Ke(e),e.length>1){var n=e.map(function(d){return Ee.quickSetter(d,t,s)}),i=n.length;return function(d){for(var h=i;h--;)n[h](d)}}e=e[0]||{};var o=Pe[t],a=Tt(e),c=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(d){var h=new o;Ot._pt=0,h.init(e,s?d+s:d,Ot,0,[e]),h.render(1,h),Ot._pt&&tr(1,Ot)}: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 n,i=Ee.to(e,Ie((n={},n[t]="+=0.1",n.paused=!0,n.stagger=0,n),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=zt(e.ease,Ut.ease)),Vr(Ut,e||{})},config:function(e){return Vr($e,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,n=e.plugins,i=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!Pe[a]&&!Le[a]&&gs(t+" effect requires "+a+" plugin.")}),rn[t]=function(a,c,u){return s(Ke(a),Ie(c||{},i),u)},o&&(ke.prototype[t]=function(a,c,u){return this.add(rn[t](a,st(c)?c:(u=c)&&{},this),u)})},registerEase:function(e,t){G[e]=zt(t)},parseEase:function(e,t){return arguments.length?zt(e,t):G},getById:function(e){return le.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new ke(e),n,i;for(s.smoothChildTiming=Re(e.smoothChildTiming),le.remove(s),s._dp=0,s._time=s._tTime=le._time,n=le._first;n;)i=n._next,(t||!(!n._dur&&n instanceof he&&n.vars.onComplete===n._targets[0]))&&Je(s,n,n._start-n._delay),n=i;return Je(le,s,0),s},context:function(e,t){return e?new uo(e,t):ie},matchMedia:function(e){return new Vl(e)},matchMediaRefresh:function(){return Bt.forEach(function(e){var t=e.conditions,s,n;for(n in t)t[n]&&(t[n]=!1,s=1);s&&e.revert()})||Bn()},addEventListener:function(e,t){var s=Vs[e]||(Vs[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=Vs[e],n=s&&s.indexOf(t);n>=0&&s.splice(n,1)},utils:{wrap:pl,wrapYoyo:hl,distribute:Wi,random:Hi,snap:Ui,normalize:dl,getUnit:ye,clamp:al,splitColor:Xi,toArray:Ke,selector:Tn,mapRange:Gi,pipe:cl,unitize:ul,interpolate:gl,shuffle:Fi},install:Mi,effects:rn,ticker:Ve,updateRoot:ke.updateRoot,plugins:Pe,globalTimeline:le,core:{PropTween:Be,globals:Ei,Tween:he,Timeline:ke,Animation:bs,getCache:Tt,_removeLinkedListItem:Hs,reverting:function(){return be},context:function(e){return e&&ie&&(ie.data.push(e),e._ctx=ie),ie},suppressOverwrites:function(e){return Fn=e}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Os[r]=he[r]});Ve.add(ke.updateRoot);Ot=Os.to({},{duration:0});var Dl=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},$l=function(e,t){var s=e._targets,n,i,o;for(n in t)for(i=s.length;i--;)o=e._ptLookup[i][n],o&&(o=o.d)&&(o._pt&&(o=Dl(o,n)),o&&o.modifier&&o.modifier(t[n],e,s[i],n))},un=function(e,t){return{name:e,headless:1,rawVars:1,init:function(n,i,o){o._onInit=function(a){var c,u;if(we(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}$l(a,i)}}}},Ee=Os.registerPlugin({name:"attr",init:function(e,t,s,n,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],n,i,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)be?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)}},un("roundProps",Rn),un("modifiers"),un("snap",Ui))||Os;he.version=ke.version=Ee.version="3.13.0";Bi=1;Un()&&qt();G.Power0;G.Power1;G.Power2;G.Power3;G.Power4;G.Linear;G.Quad;G.Cubic;G.Quart;G.Quint;G.Strong;G.Elastic;G.Back;G.SteppedEase;G.Bounce;G.Sine;G.Expo;G.Circ;/*!
|
|
12
|
-
* CSSPlugin 3.
|
|
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;/*!
|
|
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 Nr,ht,Ft,sr,St,Kr,nr,Ll=function(){return typeof window<"u"},ut={},_t=180/Math.PI,Wt=Math.PI/180,$t=Math.atan2,Fr=1e8,rr=/([A-Z])/g,Il=/(left|right|width|margin|padding|x)/i,Ol=/[\s,\(]\S/,et={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Mn=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Nl=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)},Kl=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)},Fl=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},po=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},ho=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},Wl=function(e,t,s){return e.style[t]=s},Ul=function(e,t,s){return e.style.setProperty(t,s)},Hl=function(e,t,s){return e._gsap[t]=s},jl=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},Gl=function(e,t,s,n,i){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(i,o)},ql=function(e,t,s,n,i){var o=e._gsap;o[t]=s,o.renderTransform(i,o)},ce="transform",Me=ce+"Origin",Zl=function r(e,t){var s=this,n=this.target,i=n.style,o=n._gsap;if(e in ut&&i){if(this.tfm=this.tfm||{},e!=="transform")e=et[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=at(n,a)}):this.tfm[e]=o.x?o[e]:at(n,e),e===Me&&(this.tfm.zOrigin=o.zOrigin);else return et.transform.split(",").forEach(function(a){return r.call(s,a,t)});if(this.props.indexOf(ce)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Me,t,"")),e=ce}(i||t)&&this.props.push(e,t,i[e])},go=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Xl=function(){var e=this.props,t=this.target,s=t.style,n=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)n[o]=this.tfm[o];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),i=nr(),(!i||!i.isStart)&&!s[ce]&&(go(s),n.zOrigin&&s[Me]&&(s[Me]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},fo=function(e,t){var s={target:e,props:[],revert:Xl,save:Zl};return e._gsap||Ee.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(n){return s.save(n)}),s},mo,En=function(e,t){var s=ht.createElementNS?ht.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):ht.createElement(e);return s&&s.style?s:ht.createElement(e)},Fe=function r(e,t,s){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(rr,"-$1").toLowerCase())||n.getPropertyValue(t)||!s&&r(e,Zt(t)||t,1)||""},Wr="O,Moz,ms,Ms,Webkit".split(","),Zt=function(e,t,s){var n=t||St,i=n.style,o=5;if(e in i&&!s)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(Wr[o]+e in i););return o<0?null:(o===3?"ms":o>=0?Wr[o]:"")+e},An=function(){Ll()&&window.document&&(Nr=window,ht=Nr.document,Ft=ht.documentElement,St=En("div")||{style:{}},En("div"),ce=Zt(ce),Me=ce+"Origin",St.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",mo=!!Zt("perspective"),nr=Ee.core.reverting,sr=1)},Ur=function(e){var t=e.ownerSVGElement,s=En("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=e.cloneNode(!0),i;n.style.display="block",s.appendChild(n),Ft.appendChild(s);try{i=n.getBBox()}catch{}return s.removeChild(n),Ft.removeChild(s),i},Hr=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},wo=function(e){var t,s;try{t=e.getBBox()}catch{t=Ur(e),s=1}return t&&(t.width||t.height)||s||(t=Ur(e)),t&&!t.width&&!t.x&&!t.y?{x:+Hr(e,["x","cx","x1"])||0,y:+Hr(e,["y","cy","y1"])||0,width:0,height:0}:t},bo=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&wo(e))},Mt=function(e,t){if(t){var s=e.style,n;t in ut&&t!==Me&&(t=ce),s.removeProperty?(n=t.substr(0,2),(n==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(n==="--"?t:t.replace(rr,"-$1").toLowerCase())):s.removeAttribute(t)}},gt=function(e,t,s,n,i,o){var a=new Be(e._pt,t,s,0,1,o?ho:po);return e._pt=a,a.b=n,a.e=i,e._props.push(s),a},jr={deg:1,rad:1,turn:1},Yl={grid:1,flex:1},bt=function r(e,t,s,n){var i=parseFloat(s)||0,o=(s+"").trim().substr((i+"").length)||"px",a=St.style,c=Il.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(c?"Width":"Height"),h=100,f=n==="px",g=n==="%",w,p,m,b;if(n===o||!i||jr[n]||jr[o])return i;if(o!=="px"&&!f&&(i=r(e,t,s,"px")),b=e.getCTM&&bo(e),(g||o==="%")&&(ut[t]||~t.indexOf("adius")))return w=b?e.getBBox()[c?"width":"height"]:e[d],pe(g?i/w*h:i/100*w);if(a[c?"width":"height"]=h+(f?o:n),p=n!=="rem"&&~t.indexOf("adius")||n==="em"&&e.appendChild&&!u?e:e.parentNode,b&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===ht||!p.appendChild)&&(p=ht.body),m=p._gsap,m&&g&&m.width&&c&&m.time===Ve.time&&!m.uncache)return pe(i/m.width*h);if(g&&(t==="height"||t==="width")){var v=e.style[t];e.style[t]=h+n,w=e[d],v?e.style[t]=v:Mt(e,t)}else(g||o==="%")&&!Yl[Fe(p,"display")]&&(a.position=Fe(e,"position")),p===e&&(a.position="static"),p.appendChild(St),w=St[d],p.removeChild(St),a.position="absolute";return c&&g&&(m=Tt(p),m.time=Ve.time,m.width=p[d]),pe(f?w*i/h:w&&i?h/w*i:0)},at=function(e,t,s,n){var i;return sr||An(),t in et&&t!=="transform"&&(t=et[t],~t.indexOf(",")&&(t=t.split(",")[0])),ut[t]&&t!=="transform"?(i=vs(e,n),i=t!=="transformOrigin"?i[t]:i.svg?i.origin:Ks(Fe(e,Me))+" "+i.zOrigin+"px"):(i=e.style[t],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=Ns[t]&&Ns[t](e,t,s)||Fe(e,t)||Pi(e,t)||(t==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?bt(e,t,i,s)+s:i},Ql=function(e,t,s,n){if(!s||s==="none"){var i=Zt(t,e,1),o=i&&Fe(e,i,1);o&&o!==s?(t=i,s=o):t==="borderColor"&&(s=Fe(e,"borderTopColor"))}var a=new Be(this._pt,e.style,t,0,1,lo),c=0,u=0,d,h,f,g,w,p,m,b,v,y,C,k;if(a.b=s,a.e=n,s+="",n+="",n.substring(0,6)==="var(--"&&(n=Fe(e,n.substring(4,n.indexOf(")")))),n==="auto"&&(p=e.style[t],e.style[t]=n,n=Fe(e,t)||n,p?e.style[t]=p:Mt(e,t)),d=[s,n],Qi(d),s=d[0],n=d[1],f=s.match(It)||[],k=n.match(It)||[],k.length){for(;h=It.exec(n);)m=h[0],v=n.substring(c,h.index),w?w=(w+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(w=1),m!==(p=f[u++]||"")&&(g=parseFloat(p)||0,C=p.substr((g+"").length),m.charAt(1)==="="&&(m=Kt(g,m)+C),b=parseFloat(m),y=m.substr((b+"").length),c=It.lastIndex-y.length,y||(y=y||$e.units[t]||C,c===n.length&&(n+=y,a.e+=y)),C!==y&&(g=bt(e,t,p,y)||0),a._pt={_next:a._pt,p:v||u===1?v:",",s:g,c:b-g,m:w&&w<4||t==="zIndex"?Math.round:0});a.c=c<n.length?n.substring(c,n.length):""}else a.r=t==="display"&&n==="none"?ho:po;return Ri.test(n)&&(a.e=0),this._pt=a,a},Gr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Jl=function(e){var t=e.split(" "),s=t[0],n=t[1]||"50%";return(s==="top"||s==="bottom"||n==="left"||n==="right")&&(e=s,s=n,n=e),t[0]=Gr[s]||s,t[1]=Gr[n]||n,t.join(" ")},ec=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var s=t.t,n=s.style,i=t.u,o=s._gsap,a,c,u;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),u=i.length;--u>-1;)a=i[u],ut[a]&&(c=1,a=a==="transformOrigin"?Me:ce),Mt(s,a);c&&(Mt(s,ce),o&&(o.svg&&s.removeAttribute("transform"),n.scale=n.rotate=n.translate="none",vs(s,1),o.uncache=1,go(n)))}},Ns={clearProps:function(e,t,s,n,i){if(i.data!=="isFromStart"){var o=e._pt=new Be(e._pt,t,s,0,0,ec);return o.u=n,o.pr=-10,o.tween=i,e._props.push(s),1}}},ys=[1,0,0,1,0,0],yo={},vo=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},qr=function(e){var t=Fe(e,ce);return vo(t)?ys:t.substr(7).match(Ti).map(pe)},ir=function(e,t){var s=e._gsap||Tt(e),n=e.style,i=qr(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"?ys:i):(i===ys&&!e.offsetParent&&e!==Ft&&!s.svg&&(c=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,a=e.nextElementSibling,Ft.appendChild(e)),i=qr(e),c?n.display=c:Mt(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):Ft.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Pn=function(e,t,s,n,i,o){var a=e._gsap,c=i||ir(e,!0),u=a.xOrigin||0,d=a.yOrigin||0,h=a.xOffset||0,f=a.yOffset||0,g=c[0],w=c[1],p=c[2],m=c[3],b=c[4],v=c[5],y=t.split(" "),C=parseFloat(y[0])||0,k=parseFloat(y[1])||0,x,R,T,z;s?c!==ys&&(R=g*m-w*p)&&(T=C*(m/R)+k*(-p/R)+(p*v-m*b)/R,z=C*(-w/R)+k*(g/R)-(g*v-w*b)/R,C=T,k=z):(x=wo(e),C=x.x+(~y[0].indexOf("%")?C/100*x.width:C),k=x.y+(~(y[1]||y[0]).indexOf("%")?k/100*x.height:k)),n||n!==!1&&a.smooth?(b=C-u,v=k-d,a.xOffset=h+(b*g+v*p)-b,a.yOffset=f+(b*w+v*m)-v):a.xOffset=a.yOffset=0,a.xOrigin=C,a.yOrigin=k,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!s,e.style[Me]="0px 0px",o&&(gt(o,a,"xOrigin",u,C),gt(o,a,"yOrigin",d,k),gt(o,a,"xOffset",h,a.xOffset),gt(o,a,"yOffset",f,a.yOffset)),e.setAttribute("data-svg-origin",C+" "+k)},vs=function(e,t){var s=e._gsap||new so(e);if("x"in s&&!t&&!s.uncache)return s;var n=e.style,i=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),u=Fe(e,Me)||"0",d,h,f,g,w,p,m,b,v,y,C,k,x,R,T,z,A,M,I,F,J,P,H,q,V,_,N,de,j,re,ee,_e;return d=h=f=p=m=b=v=y=C=0,g=w=1,s.svg=!!(e.getCTM&&bo(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[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]:"")),n.scale=n.rotate=n.translate="none"),R=ir(e,s.svg),s.svg&&(s.uncache?(V=e.getBBox(),u=s.xOrigin-V.x+"px "+(s.yOrigin-V.y)+"px",q=""):q=!t&&e.getAttribute("data-svg-origin"),Pn(e,q||u,!!q||s.originIsAbsolute,s.smooth!==!1,R)),k=s.xOrigin||0,x=s.yOrigin||0,R!==ys&&(M=R[0],I=R[1],F=R[2],J=R[3],d=P=R[4],h=H=R[5],R.length===6?(g=Math.sqrt(M*M+I*I),w=Math.sqrt(J*J+F*F),p=M||I?$t(I,M)*_t:0,v=F||J?$t(F,J)*_t+p:0,v&&(w*=Math.abs(Math.cos(v*Wt))),s.svg&&(d-=k-(k*M+x*F),h-=x-(k*I+x*J))):(_e=R[6],re=R[7],N=R[8],de=R[9],j=R[10],ee=R[11],d=R[12],h=R[13],f=R[14],T=$t(_e,j),m=T*_t,T&&(z=Math.cos(-T),A=Math.sin(-T),q=P*z+N*A,V=H*z+de*A,_=_e*z+j*A,N=P*-A+N*z,de=H*-A+de*z,j=_e*-A+j*z,ee=re*-A+ee*z,P=q,H=V,_e=_),T=$t(-F,j),b=T*_t,T&&(z=Math.cos(-T),A=Math.sin(-T),q=M*z-N*A,V=I*z-de*A,_=F*z-j*A,ee=J*A+ee*z,M=q,I=V,F=_),T=$t(I,M),p=T*_t,T&&(z=Math.cos(T),A=Math.sin(T),q=M*z+I*A,V=P*z+H*A,I=I*z-M*A,H=H*z-P*A,M=q,P=V),m&&Math.abs(m)+Math.abs(p)>359.9&&(m=p=0,b=180-b),g=pe(Math.sqrt(M*M+I*I+F*F)),w=pe(Math.sqrt(H*H+_e*_e)),T=$t(P,H),v=Math.abs(T)>2e-4?T*_t:0,C=ee?1/(ee<0?-ee:ee):0),s.svg&&(q=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!vo(Fe(e,ce)),q&&e.setAttribute("transform",q))),Math.abs(v)>90&&Math.abs(v)<270&&(i?(g*=-1,v+=p<=0?180:-180,p+=p<=0?180:-180):(w*=-1,v+=v<=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=h-((s.yPercent=h&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=f+o,s.scaleX=pe(g),s.scaleY=pe(w),s.rotation=pe(p)+a,s.rotationX=pe(m)+a,s.rotationY=pe(b)+a,s.skewX=v+a,s.skewY=y+a,s.transformPerspective=C+o,(s.zOrigin=parseFloat(u.split(" ")[2])||!t&&s.zOrigin||0)&&(n[Me]=Ks(u)),s.xOffset=s.yOffset=0,s.force3D=$e.force3D,s.renderTransform=s.svg?sc:mo?Co:tc,s.uncache=0,s},Ks=function(e){return(e=e.split(" "))[0]+" "+e[1]},dn=function(e,t,s){var n=ye(t);return pe(parseFloat(t)+parseFloat(bt(e,"x",s+"px",n)))+n},tc=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Co(e,t)},kt="0deg",ts="0px",xt=") ",Co=function(e,t){var s=t||this,n=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.z,u=s.rotation,d=s.rotationY,h=s.rotationX,f=s.skewX,g=s.skewY,w=s.scaleX,p=s.scaleY,m=s.transformPerspective,b=s.force3D,v=s.target,y=s.zOrigin,C="",k=b==="auto"&&e&&e!==1||b===!0;if(y&&(h!==kt||d!==kt)){var x=parseFloat(d)*Wt,R=Math.sin(x),T=Math.cos(x),z;x=parseFloat(h)*Wt,z=Math.cos(x),o=dn(v,o,R*z*-y),a=dn(v,a,-Math.sin(x)*-y),c=dn(v,c,T*z*-y+y)}m!==ts&&(C+="perspective("+m+xt),(n||i)&&(C+="translate("+n+"%, "+i+"%) "),(k||o!==ts||a!==ts||c!==ts)&&(C+=c!==ts||k?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+xt),u!==kt&&(C+="rotate("+u+xt),d!==kt&&(C+="rotateY("+d+xt),h!==kt&&(C+="rotateX("+h+xt),(f!==kt||g!==kt)&&(C+="skew("+f+", "+g+xt),(w!==1||p!==1)&&(C+="scale("+w+", "+p+xt),v.style[ce]=C||"translate(0, 0)"},sc=function(e,t){var s=t||this,n=s.xPercent,i=s.yPercent,o=s.x,a=s.y,c=s.rotation,u=s.skewX,d=s.skewY,h=s.scaleX,f=s.scaleY,g=s.target,w=s.xOrigin,p=s.yOrigin,m=s.xOffset,b=s.yOffset,v=s.forceCSS,y=parseFloat(o),C=parseFloat(a),k,x,R,T,z;c=parseFloat(c),u=parseFloat(u),d=parseFloat(d),d&&(d=parseFloat(d),u+=d,c+=d),c||u?(c*=Wt,u*=Wt,k=Math.cos(c)*h,x=Math.sin(c)*h,R=Math.sin(c-u)*-f,T=Math.cos(c-u)*f,u&&(d*=Wt,z=Math.tan(u-d),z=Math.sqrt(1+z*z),R*=z,T*=z,d&&(z=Math.tan(d),z=Math.sqrt(1+z*z),k*=z,x*=z)),k=pe(k),x=pe(x),R=pe(R),T=pe(T)):(k=h,T=f,x=R=0),(y&&!~(o+"").indexOf("px")||C&&!~(a+"").indexOf("px"))&&(y=bt(g,"x",o,"px"),C=bt(g,"y",a,"px")),(w||p||m||b)&&(y=pe(y+w-(w*k+p*R)+m),C=pe(C+p-(w*x+p*T)+b)),(n||i)&&(z=g.getBBox(),y=pe(y+n/100*z.width),C=pe(C+i/100*z.height)),z="matrix("+k+","+x+","+R+","+T+","+y+","+C+")",g.setAttribute("transform",z),v&&(g.style[ce]=z)},nc=function(e,t,s,n,i){var o=360,a=we(i),c=parseFloat(i)*(a&&~i.indexOf("rad")?_t:1),u=c-n,d=n+u+"deg",h,f;return a&&(h=i.split("_")[1],h==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-360)),h==="cw"&&u<0?u=(u+o*Fr)%o-~~(u/o)*o:h==="ccw"&&u>0&&(u=(u-o*Fr)%o-~~(u/o)*o)),e._pt=f=new Be(e._pt,t,s,n,u,Nl),f.e=d,f.u="deg",e._props.push(s),f},Zr=function(e,t){for(var s in t)e[s]=t[s];return e},rc=function(e,t,s){var n=Zr({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,u,d,h,f,g,w;n.svg?(u=s.getAttribute("transform"),s.setAttribute("transform",""),o[ce]=t,a=vs(s,1),Mt(s,ce),s.setAttribute("transform",u)):(u=getComputedStyle(s)[ce],o[ce]=t,a=vs(s,1),o[ce]=u);for(c in ut)u=n[c],d=a[c],u!==d&&i.indexOf(c)<0&&(g=ye(u),w=ye(d),h=g!==w?bt(s,c,u,w):parseFloat(u),f=parseFloat(d),e._pt=new Be(e._pt,a,c,h,f-h,Mn),e._pt.u=w||0,e._props.push(c));Zr(a,n)};ze("padding,margin,Width,Radius",function(r,e){var t="Top",s="Right",n="Bottom",i="Left",o=(e<3?[t,s,n,i]:[t+i,t+s,n+s,n+i]).map(function(a){return e<2?r+a:"border"+a+r});Ns[e>1?"border"+r:r]=function(a,c,u,d,h){var f,g;if(arguments.length<4)return f=o.map(function(w){return at(a,w,u)}),g=f.join(" "),g.split(f[0]).length===5?f[0]:g;f=(d+"").split(" "),g={},o.forEach(function(w,p){return g[w]=f[p]=f[p]||f[(p-1)/2|0]}),a.init(c,g,h)}});var ko={name:"css",register:An,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,n,i){var o=this._props,a=e.style,c=s.vars.startAt,u,d,h,f,g,w,p,m,b,v,y,C,k,x,R,T;sr||An(),this.styles=this.styles||fo(e),T=this.styles.props,this.tween=s;for(p in t)if(p!=="autoRound"&&(d=t[p],!(Pe[p]&&no(p,t,s,n,e,i)))){if(g=typeof d,w=Ns[p],g==="function"&&(d=d.call(s,n,e,i),g=typeof d),g==="string"&&~d.indexOf("random(")&&(d=ms(d)),w)w(this,e,p,d,s)&&(R=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),d+="",mt.lastIndex=0,mt.test(u)||(m=ye(u),b=ye(d)),b?m!==b&&(u=bt(e,p,u,b)+b):m&&(d+=m),this.add(a,"setProperty",u,d,n,i,0,0,p),o.push(p),T.push(p,0,a[p]);else if(g!=="undefined"){if(c&&p in c?(u=typeof c[p]=="function"?c[p].call(s,n,e,i):c[p],we(u)&&~u.indexOf("random(")&&(u=ms(u)),ye(u+"")||u==="auto"||(u+=$e.units[p]||ye(at(e,p))||""),(u+"").charAt(1)==="="&&(u=at(e,p))):u=at(e,p),f=parseFloat(u),v=g==="string"&&d.charAt(1)==="="&&d.substr(0,2),v&&(d=d.substr(2)),h=parseFloat(d),p in et&&(p==="autoAlpha"&&(f===1&&at(e,"visibility")==="hidden"&&h&&(f=0),T.push("visibility",0,a.visibility),gt(this,a,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),p!=="scale"&&p!=="transform"&&(p=et[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in ut,y){if(this.styles.save(p),g==="string"&&d.substring(0,6)==="var(--"&&(d=Fe(e,d.substring(4,d.indexOf(")"))),h=parseFloat(d)),C||(k=e._gsap,k.renderTransform&&!t.parseTransform||vs(e,t.parseTransform),x=t.smoothOrigin!==!1&&k.smooth,C=this._pt=new Be(this._pt,a,ce,0,1,k.renderTransform,k,0,-1),C.dep=1),p==="scale")this._pt=new Be(this._pt,k,"scaleY",k.scaleY,(v?Kt(k.scaleY,v+h):h)-k.scaleY||0,Mn),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){T.push(Me,0,a[Me]),d=Jl(d),k.svg?Pn(e,d,0,x,0,this):(b=parseFloat(d.split(" ")[2])||0,b!==k.zOrigin&>(this,k,"zOrigin",k.zOrigin,b),gt(this,a,p,Ks(u),Ks(d)));continue}else if(p==="svgOrigin"){Pn(e,d,1,x,0,this);continue}else if(p in yo){nc(this,k,p,f,v?Kt(f,v+d):d);continue}else if(p==="smoothOrigin"){gt(this,k,"smooth",k.smooth,d);continue}else if(p==="force3D"){k[p]=d;continue}else if(p==="transform"){rc(this,d,e);continue}}else p in a||(p=Zt(p)||p);if(y||(h||h===0)&&(f||f===0)&&!Ol.test(d)&&p in a)m=(u+"").substr((f+"").length),h||(h=0),b=ye(d)||(p in $e.units?$e.units[p]:m),m!==b&&(f=bt(e,p,u,b)),this._pt=new Be(this._pt,y?k:a,p,f,(v?Kt(f,v+h):h)-f,!y&&(b==="px"||p==="zIndex")&&t.autoRound!==!1?Fl:Mn),this._pt.u=b||0,m!==b&&b!=="%"&&(this._pt.b=u,this._pt.r=Kl);else if(p in a)Ql.call(this,e,p,u,v?v+d:d);else if(p in e)this.add(e,p,u||e[p],v?v+d:d,n,i);else if(p!=="parseTransform"){jn(p,d);continue}y||(p in a?T.push(p,0,a[p]):typeof e[p]=="function"?T.push(p,2,e[p]()):T.push(p,1,u||e[p])),o.push(p)}}R&&co(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:et,getSetter:function(e,t,s){var n=et[t];return n&&n.indexOf(",")<0&&(t=n),t in ut&&t!==Me&&(e._gsap.x||at(e,"x"))?s&&Kr===s?t==="scale"?jl:Hl:(Kr=s||{})&&(t==="scale"?Gl:ql):e.style&&!Wn(e.style[t])?Wl:~t.indexOf("-")?Ul:er(e,t)},core:{_removeProperty:Mt,_getMatrix:ir}};Ee.utils.checkPrefix=Zt;Ee.core.getStyleSaver=fo;(function(r,e,t,s){var n=ze(r+","+e+","+t,function(i){ut[i]=1});ze(e,function(i){$e.units[i]="deg",yo[i]=1}),et[n[13]]=r+","+e,ze(s,function(i){var o=i.split(":");et[o[1]]=n[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(r){$e.units[r]="px"});Ee.registerPlugin(ko);var X=Ee.registerPlugin(ko)||Ee;X.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(r){if(r!=null)return`${r}px`}function xo(r){return Math.max(0,Math.min(1,r))}function _o(r){if(!r)return;const e=r.trim();if(/^#([0-9a-fA-F]{3}){1,2}$/.test(e)){let s=0,n=0,i=0;return e.length===4?(s=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(s=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16)),{r:s,g:n,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 pn(r){const t=Math.max(0,Math.min(255,Math.round(r))).toString(16);return t.length===1?`0${t}`:t}function So(r){if(r)return`#${pn(r.r)}${pn(r.g)}${pn(r.b)}`}function Vn(r,e=.12){const t=_o(r);if(!t)return r;const s=xo(e);return So({r:t.r+(255-t.r)*s,g:t.g+(255-t.g)*s,b:t.b+(255-t.b)*s})}function To(r,e=.12){const t=_o(r);if(!t)return r;const s=xo(e);return So({r:t.r*(1-s),g:t.g*(1-s),b:t.b*(1-s)})}function ic(r,e){if(r)switch(e){case"gradient":{const t=Vn(r,.08)||r,s=To(r,.12)||r;return`linear-gradient(180deg, ${t} 0%, ${s} 100%)`}case"bubble":return`radial-gradient(120% 120% at 10% 0%, ${Vn(r,.14)||r} 0%, ${r} 60%)`;default:return r}}function oc(r,e){return{...r?Xr[r]:Xr.md,...void 0}}function ac(r,e){const t=oc(r.size),s=r.color,n=ic(r.bgColor??(e==null?void 0:e.fallbackColor),r.bgType),i=Lt(r.fontSize??t.fontSize),o=Lt(r.borderRadius??t.borderRadius),a=Lt(r.verticalPadding),c=Lt(r.sidePadding);let u;r.borderWidth&&r.borderWidth>0?u=`${r.borderWidth}px solid ${r.borderColor||(e==null?void 0:e.fallbackColor)||"currentColor"}`:r.borderColor&&!r.borderWidth&&(u=`1px solid ${r.borderColor}`);const d=r.width?r.width+(r.borderWidth??0):void 0,h=r.height?r.height+(r.borderWidth??0):void 0,f={color:s,background:n,fontSize:i,borderRadius:o,width:Lt(d),height:Lt(h),padding:a&&c?`${a} ${c}`:void 0,border:u},g={};for(const w in f){const p=f[w];p!=null&&p!==""&&(g[w]=String(p))}return g}const lc=["innerHTML"],cc=["src"],uc=l.defineComponent({__name:"ChatCollapsed",props:{element:{},toggleChat:{type:Function}},setup(r){const e=r,t=l.computed(()=>e.element),s=l.computed(()=>ac(t.value)),n=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)=>a.toggleChat&&a.toggleChat(...u))},[n.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,lc)):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,cc)):l.createCommentVNode("",!0)],4))}}),dc={required:["settings","texts","sections"],version:"1.0"},pc=JSON.parse('{"bottom":{"btnSend":{"bgColor":"#5E4AC6","borderColor":"#595959","borderRadius":50,"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":50,"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":"#373739","borderColor":"#595959","borderRadius":12,"borderWidth":1,"color":"#fff","fontSize":12,"sidePadding":8,"verticalSpacing":8},"headerChip":{"bgColor":"#69696A","bgType":"filled","borderRadius":12,"color":"#fff","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":"#595959","headerFillColor":"#fff","headerText":"#12D8D8","pastStepColor":"#515151","strokeColor":"#aaa","strokeWidth":0,"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":"#fff","showType":"both"},"params":{"bgColor":"#5E4AC6","bgStyle":"invisible","border":{"color":"#991717","width":0},"borderRadius":12,"buttonStyle":"invisible","chipStyle":"filled","paddingHorizontal":0,"paddingVertical":1,"sideMargin":8,"size":"md"}},"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":8,"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"}}}'),hc={bgChat:"#212121",borderRadius:25,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:0,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:450,width:435},theme:"light"},gc={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"},fc={schema:dc,sections:pc,settings:hc,texts:gc},U=fc;class qe{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 mc extends qe{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=[],n={...t.settings,loader:U.settings.loader};return s.push(`Добавлены поля loader: '${n.loader}'`),this.createSuccessResult({...t,settings:n},s)}catch(t){return this.createErrorResult([`Ошибка при добавлении полей settings: ${t}`])}}}class wc extends qe{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:U.sections.top.params.chipStyle},s.push(`Добавлено поле chipStyle: '${U.sections.top.params.chipStyle}' в sections.top.params`),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении chipStyle: ${t}`])}}}class bc extends qe{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:U.sections.inside.messageUser.bgType},t.sections.inside.messageBot={...t.sections.inside.messageBot,bgType:U.sections.inside.messageBot.bgType},s.push("Добавлены поля bgType для messageUser и messageBot"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при добавлении bgType для сообщений: ${t}`])}}}class yc extends qe{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 vc extends qe{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:U.sections.bottom.inputSend.borderColor,borderWidth:U.sections.bottom.inputSend.borderWidth},inputStyle:U.sections.bottom.inputSend.inputStyle,bgType:U.sections.bottom.inputSend.bgType},s.push("Расширен inputSend с новыми полями borderStyle, inputStyle, bgType"),this.createSuccessResult(t,s)}catch(t){return this.createErrorResult([`Ошибка при расширении inputSend: ${t}`])}}}class Cc extends qe{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 kc=[new mc,new wc,new bc,new yc,new vc,new Cc];class xc extends qe{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,n,i,o,a,c,u,d,h,f,g,w;try{const p={...e.config},m=[];if(p.settings.theme||(p.settings.theme=U.settings.theme,m.push(`Добавлено поле theme: '${p.settings.theme}'`)),p.settings.container||(p.settings.container={innerBorder:{width:((s=(t=U.settings.container)==null?void 0:t.innerBorder)==null?void 0:s.width)||0,color:((i=(n=U.settings.container)==null?void 0:n.innerBorder)==null?void 0:i.color)||"transparent",style:((a=(o=U.settings.container)==null?void 0:o.innerBorder)==null?void 0:a.style)||"solid"},outerBorder:{width:((u=(c=U.settings.container)==null?void 0:c.outerBorder)==null?void 0:u.width)||0,color:((h=(d=U.settings.container)==null?void 0:d.outerBorder)==null?void 0:h.color)||"transparent",style:((g=(f=U.settings.container)==null?void 0:f.outerBorder)==null?void 0:g.style)||"solid"},gradient:((w=U.settings.container)==null?void 0:w.gradient)||"transparent"},m.push("Added container object with innerBorder, outerBorder, gradient")),typeof p.settings.borderRadius=="string"){const b={0:0,sm:4,md:8,lg:12};p.settings.borderRadius=b[p.settings.borderRadius]??12,m.push(`Конвертирован borderRadius из строки в число: ${p.settings.borderRadius}`)}return this.createSuccessResult(p,m)}catch(p){return this.createErrorResult([`Ошибка при добавлении theme и container: ${p}`])}}}class _c extends qe{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,n,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:((n=U.sections.top.params.border)==null?void 0:n.width)||0,color:((i=U.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=U.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=U.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 Sc extends qe{constructor(){super(...arguments),this.name="AddDataActionV2toV3",this.description="Добавляет dataAction в sections.inside",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,n;try{const i={...e.config},o=[];(t=i.sections)!=null&&t.inside||(i.sections.inside={});const a=(n=(s=U==null?void 0:U.sections)==null?void 0:s.inside)==null?void 0:n.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 Tc extends qe{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 n={...e.config},i=[];(s=(t=n.sections)==null?void 0:t.inside)!=null&&s.welcomeMessage||(n.sections.inside.welcomeMessage={});const o=n.sections.inside.welcomeMessage,a=U.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(n,i)}catch(n){return this.createErrorResult([`Ошибка при расширении welcomeMessage: ${n}`])}}}class Rc extends qe{constructor(){super(...arguments),this.name="AddVoiceButtonV2toV3",this.description="Добавляет btnVoice в sections.bottom",this.appliesTo={from:"2.0",to:"3.0"}}apply(e){var t,s,n,i,o,a,c,u,d,h;try{const f={...e.config},g=[];return(t=f.sections)!=null&&t.bottom||(f.sections.bottom={}),f.sections.bottom.btnVoice||(f.sections.bottom.btnVoice={color:((s=U.sections.bottom.btnVoice)==null?void 0:s.color)||"#fff",bgColor:((n=U.sections.bottom.btnVoice)==null?void 0:n.bgColor)||"rgba(255, 255, 255, 0.10)",showType:((i=U.sections.bottom.btnVoice)==null?void 0:i.showType)||"icon",borderRadius:((o=U.sections.bottom.btnVoice)==null?void 0:o.borderRadius)||50,borderColor:((a=U.sections.bottom.btnVoice)==null?void 0:a.borderColor)||"#595959",borderWidth:((c=U.sections.bottom.btnVoice)==null?void 0:c.borderWidth)||1,size:((u=U.sections.bottom.btnVoice)==null?void 0:u.size)||"md",fontSize:((d=U.sections.bottom.btnVoice)==null?void 0:d.fontSize)||12,icon:((h=U.sections.bottom.btnVoice)==null?void 0:h.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}},f.sections.bottom.btnVoice.bgColor||(f.sections.bottom.btnVoice.bgColor=U.sections.bottom.btnVoice.bgColor,g.push(`Добавлено поле bgColor для btnVoice: '${f.sections.bottom.btnVoice.bgColor}'`)),g.push("Добавлен btnVoice в sections.bottom")),this.createSuccessResult(f,g)}catch(f){return this.createErrorResult([`Ошибка при добавлении btnVoice: ${f}`])}}}const Yr=[new xc,new _c,new Sc,new Tc,new Rc];function Qr(r,e){return r==="3.0"&&e==="3.1"?Yr.map(s=>{const n=Object.create(s);return n.appliesTo={from:"3.0",to:"3.1"},n}):[...kc,...Yr].filter(s=>s.appliesTo.from===r&&s.appliesTo.to===e)}class zc{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 Bc{constructor(){this.name="ValidateConfig",this.description="Валидирует конфигурацию для указанной версии"}execute(e,t){try{const n=new Ac().validate(e,t.version);return{success:n.isValid,data:{validationResult:n,config:e},errors:n.errors,warnings:n.warnings,modified:!1}}catch(s){return{success:!1,errors:[`Ошибка при валидации: ${s}`],warnings:[],modified:!1}}}}class Mc{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 Ec{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,n,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,((n=e.sections.top.params)==null?void 0:n.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(h){return console.error("Ошибка при детекции версии:",h),null}}}class Ac{validate(e,t){const s=[],n=[];try{if(!e)return s.push("Конфигурация не может быть пустой"),{isValid:!1,errors:s,warnings:n};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,n);break;case"2.0":this.validateV2(e,s,n);break;case"3.0":case"3.1":this.validateV3(e,s,n);break;default:n.push(`Валидация для версии ${t} не реализована`)}return{isValid:s.length===0,errors:s,warnings:n}}catch(i){return s.push(`Ошибка при валидации: ${i}`),{isValid:!1,errors:s,warnings:n}}}validateV1(e,t,s){const n=["settings.widgetTitle","settings.welcomeMessage","settings.bgChat"];for(const i of n)this.getNestedValue(e,i)||t.push(`Отсутствует обязательное поле: ${i}`)}validateV2(e,t,s){this.validateV1(e,t,s);const n=["settings.loader","settings.buttonStyle","sections.inside.aprooveButton","sections.bottom.warningAlert"];for(const i of n)this.getNestedValue(e,i)||s.push(`Рекомендуется добавить поле V2: ${i}`)}validateV3(e,t,s){var i;this.validateV2(e,t,s);const n=["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 n)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,n)=>s==null?void 0:s[n],e)}}class Ro{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)}}Ro.commands=new Map([["DetectVersion",()=>new zc],["ValidateConfig",()=>new Bc],["CleanConfig",()=>new Mc],["BackupConfig",()=>new Ec]]);const Nt=["1.0","2.0","3.0","3.1"],Pc=Nt[Nt.length-1];class zo{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 Vc{constructor(e){this.logger=e||new zo,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 n=Date.now();this.logger.info(`Начинаем миграцию к версии ${t}`);try{const i=this.versionDetector.detect(e);if(!i)return this.createErrorResult("Не удалось определить версию исходной конфигурации",n);if(this.logger.info(`Определена исходная версия: ${i}`),i===t)return this.logger.info("Конфигурация уже соответствует целевой версии"),this.createSuccessResult(e,i,t,[],n);const o=this.buildMigrationPath(i,t);if(o.length===0)return this.createErrorResult(`Не найден путь миграции с ${i} на ${t}`,n);this.logger.info(`План миграции: ${o.map(h=>`${h.from} -> ${h.to}`).join(" -> ")}`);let a=e;const c=[],u=[];for(const h of o){const f=await this.executeStep(a,h.from,h.to,s);if(!f.success)return this.createErrorResult(`Ошибка на шаге ${h.from} -> ${h.to}: ${f.errors.join(", ")}`,n,f.errors);a=f.data,c.push(...f.appliedStrategies),u.push(...f.warnings)}this.setSchemaVersion(a,t);const d=Ro.createCommand("ValidateConfig");if(d){const h=d.execute(a,{version:t});if(!h.success&&s.strict)return this.createErrorResult(`Валидация не прошла: ${h.errors.join(", ")}`,n,h.errors);u.push(...h.warnings)}return this.logger.info("Миграция успешно завершена"),this.createSuccessResult(a,i,t,c,n,u)}catch(i){return this.logger.error("Критическая ошибка при миграции",i),this.createErrorResult(`Критическая ошибка: ${i}`,n)}}async dryRun(e,t,s={}){const n=Date.now();try{const i=this.versionDetector.detect(e);if(!i)return this.createFailedReport(n,"unknown",t,"Не удалось определить версию");const a=this.buildMigrationPath(i,t).flatMap(c=>Qr(c.from,c.to));return{timestamp:new Date,fromVersion:i,toVersion:t,success:!0,duration:Date.now()-n,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(n,"unknown",t,`Ошибка: ${i}`)}}async executeStep(e,t,s,n){var f,g;const i=Date.now();this.logger.info(`Выполняем шаг: ${t} -> ${s}`);let o=Qr(t,s);if((f=n.onlyStrategies)!=null&&f.length&&(o=o.filter(w=>n.onlyStrategies.includes(w.name))),(g=n.excludeStrategies)!=null&&g.length&&(o=o.filter(w=>!n.excludeStrategies.includes(w.name))),o.length===0)return this.createErrorResult(`Не найдено стратегий для миграции ${t} -> ${s}`,i);const a={fromVersion:t,toVersion:s,config:e,options:n};let c={...e};const u=[],d=[],h=[];for(const w of o){if(this.logger.debug(`Применяем стратегию: ${w.name}`),!w.canApply({...a,config:c})){this.logger.debug(`Стратегия ${w.name} не применима, пропускаем`);continue}const p=w.apply({...a,config:c});if(p.success)p.modified&&p.data&&(c=p.data),u.push(w.name),h.push(...p.warnings),this.logger.debug(`Стратегия ${w.name} успешно применена`);else if(this.logger.error(`Стратегия ${w.name} завершилась с ошибкой`,p.errors),d.push(...p.errors),n.strict)return this.createErrorResult(`Стратегия ${w.name} завершилась с ошибкой: ${p.errors.join(", ")}`,i,d)}return this.createSuccessResult(c,t,s,u,i,h,d)}buildMigrationPath(e,t){const s=Nt.indexOf(e),n=Nt.indexOf(t);if(s===-1||n===-1)return[];const i=[];if(s<n)for(let o=s;o<n;o++)i.push({from:Nt[o],to:Nt[o+1]});else if(s>n)return[];return i}createSuccessResult(e,t,s,n,i,o=[],a=[]){return{success:!0,data:e,errors:a,warnings:o,fromVersion:t,toVersion:s,appliedStrategies:n}}createErrorResult(e,t,s=[]){return{success:!1,errors:[e,...s],warnings:[],fromVersion:"unknown",toVersion:"unknown",appliedStrategies:[]}}createFailedReport(e,t,s,n){return{timestamp:new Date,fromVersion:t,toVersion:s,success:!1,duration:Date.now()-e,appliedStrategies:[],totalErrors:1,totalWarnings:0,summary:n}}}class Dc{constructor(e=!0){const t=new zo(e);this.migrator=new Vc(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,Pc,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 $c=new Dc;async function Lc(r,e){try{const t=await $c.migrateToLatest(r,e);return t.success?t.data:null}catch{return null}}const Ye=r=>typeof r=="string"&&r.length>=0,Jr=r=>typeof r=="number"&&!Number.isNaN(r),ss=(r,e)=>typeof r=="string"&&e.includes(r);function Ic(r){var u,d,h,f,g,w,p;const e=[];if(!r||typeof r!="object")return{isValid:!1,errors:["config: must be an object"]};const t=r.settings||{};Jr(t.letterSpacing)||t.letterSpacing===void 0||e.push("settings.letterSpacing: number"),Ye(t.bgChat)||t.bgChat===void 0||e.push("settings.bgChat: string"),Ye(t.fontFamily)||t.fontFamily===void 0||e.push("settings.fontFamily: string"),Jr(t.fontWeight)||t.fontWeight===void 0||e.push("settings.fontWeight: number"),t.logo===void 0||Ye(t.logo)||e.push("settings.logo: string (svg or url)"),t.widgetTitle===void 0||Ye(t.widgetTitle)||e.push("settings.widgetTitle: string"),t.position===void 0&&e.push("settings.position: undefined");const s=r.texts||{};s.launchIssueTitle===void 0||Ye(s.launchIssueTitle)||e.push("texts.launchIssueTitle: string"),s.issueText===void 0||Ye(s.issueText)||e.push("texts.issueText: string"),s.widgetTitle===void 0||Ye(s.widgetTitle)||e.push("texts.widgetTitle: string"),s.hideText===void 0||Ye(s.hideText)||e.push("texts.hideText: string");const n=((u=r.sections)==null?void 0:u.top)||{},i=n.params||{};i.size===void 0||ss(i.size,["sm","md","lg"])||e.push("sections.top.params.size: sm|md|lg"),i.chipStyle===void 0||ss(i.chipStyle,["filled","outlined","invisible"])||e.push("sections.top.params.chipStyle: filled|outlined|invisible"),i.buttonStyle===void 0||ss(i.buttonStyle,["filled","outlined","invisible"])||e.push("sections.top.params.buttonStyle: filled|outlined|invisible"),i.buttonType===void 0||ss(i.buttonType,["icon","text","both"])||e.push("sections.top.params.buttonType: icon|text|both"),((d=n==null?void 0:n.chipWidgetTitle)==null?void 0:d.color)===void 0||Ye((h=n==null?void 0:n.chipWidgetTitle)==null?void 0:h.color)||e.push("sections.top.chipWidgetTitle.color: string"),((f=n==null?void 0:n.chipWidgetTitle)==null?void 0:f.bgColor)===void 0||Ye((g=n==null?void 0:n.chipWidgetTitle)==null?void 0:g.bgColor)||e.push("sections.top.chipWidgetTitle.bgColor: string"),(n==null?void 0:n.btnClose)===void 0||typeof(n==null?void 0:n.btnClose)=="object"||e.push("sections.top.btnClose: object");const a=(((w=r.sections)==null?void 0:w.bottom)||{}).params||{};a.size===void 0||ss(a.size,["sm","md","lg"])||e.push("sections.bottom.params.size: sm|md|lg");const c=((p=r.sections)==null?void 0:p.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 Oc{constructor(e){K(this,"config");this.config=e}getFlatRecursiveConfig(e,t="",s={}){for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const i=e[n],o=t?`${t}.${n}`:n;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 Dn={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(r){return r==="sm"||r==="md"||r==="lg"?Dn[r]:Dn.md}function ar(r,e){try{const s={top:"sections.top.params.size",inside:"sections.inside.params.size",bottom:"sections.bottom.params.size"}[e],n=r==null?void 0:r.getKey(s);return $n(n)}catch{return Dn.md}}const Nc=["aria-expanded"],Kc=["innerHTML"],Fc=["src","alt"],Wc={key:2},Uc={key:0,class:"tw:flex tw:items-center tw:w-full tw:justify-end tw:gap-1.5 header-buttons"},Hc=["width","height"],jc={key:1},Gc=["width","height"],qc={key:1},Zc=l.defineComponent({__name:"ChatHeader",props:{isChatOpen:{type:Boolean},toggleChat:{type:Function},configDesignClass:{},sectionBorderRadius:{},mainBorderRadius:{},isPreview:{type:Boolean},isEmbedded:{type:Boolean},restartChat:{type:Function}},setup(r){const e=r,t=l.computed(()=>e.configDesignClass.getKeyObject("sections.top.params")),s=l.computed(()=>ar(e.configDesignClass,"top")),n=(m,b="px")=>typeof m=="number"?`${m}${b}`: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 v=!!e.configDesignClass.getKey("settings.globalRoundingRadius")?`${e.mainBorderRadius}px`:n(t.value.borderRadius),y=e.configDesignClass.getKey("settings.container.gradient"),C=t.value.border,k=(C==null?void 0:C.width)>0?`${C.width}px solid ${C.color}`:"none",x=`${t.value.sideMargin}px`;return{borderTopLeftRadius:t.value.bgStyle==="invisible"?0:v,borderTopRightRadius:t.value.bgStyle==="invisible"?0:v,borderBottomLeftRadius:t.value.bgStyle==="invisible"?0:y&&y!=="transparent"?v:0,borderBottomRightRadius:t.value.bgStyle==="invisible"?0:y&&y!=="transparent"?v:0,background:m,padding:`${t.value.paddingVertical}px ${t.value.paddingHorizontal}px`,margin:x,maxWidth:`calc(100% - ${x} * 2)`,borderBottom:k}}),o=l.computed(()=>{const m=e.configDesignClass.getKey("texts.widgetTitle"),b=e.configDesignClass.getKey("settings.widgetTitle");return m&&m!=="undefined"?m:b&&b!=="undefined"?b:""}),a=l.computed(()=>e.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")),c=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.chipStyle"),b=e.configDesignClass.getKey("sections.top.chipWidgetTitle.color"),v=e.configDesignClass.getKey("sections.top.chipWidgetTitle.bgColor"),y=m==="outlined",C=m==="filled",k=m==="invisible";return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.chipWidgetTitle.borderRadius")+"px",color:b,border:y?`1px solid ${v}`:"none",padding:k?"0px":null,"background-color":C?v:"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"}),h=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"}}),f=l.computed(()=>{const m=e.configDesignClass.getKey("sections.top.params.buttonStyle"),b=m==="outlined",v=m==="invisible",y=h.value;return{borderRadius:e.configDesignClass.getKey("settings.globalRoundingRadius")?e.sectionBorderRadius.borderRadius:e.configDesignClass.getKey("sections.top.buttons.borderRadius")+"px",color:y.color,border:b?`1px solid ${y.bgColor}`:"none",padding:v?"0px":null,"background-color":v?"transparent":m==="filled"?y.bgColor:"transparent"}}),g=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")),p=l.computed(()=>e.configDesignClass.getKey("settings.logo"));return(m,b)=>(l.openBlock(),l.createElementBlock("div",{onClick:b[0]||(b[0]=(...v)=>m.toggleChat&&m.toggleChat(...v)),class:"chat-action tw:transition-all tw:cursor-pointer tw:flex tw:items-center tw:w-full tw:justify-start tw:overflow-hidden",style:l.normalizeStyle(i.value),role:"button","aria-expanded":m.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:m.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&&m.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["header-logo",m.configDesignClass.getKey("sections.top.params.size")]),innerHTML:p.value},null,10,Kc)):p.value&&m.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="text"?(l.openBlock(),l.createElementBlock("img",{key:1,src:p.value,alt:m.configDesignClass.getKey("sections.top.iconWidget.alt"),class:l.normalizeClass(m.configDesignClass.getKey("sections.top.params.size")==="sm"?"tw:w-3 tw:h-3":"tw:w-4 tw:h-4")},null,10,Fc)):l.createCommentVNode("",!0),m.configDesignClass.getKey("sections.top.chipWidgetTitle.showType")!=="icon"?(l.openBlock(),l.createElementBlock("span",Wc,l.toDisplayString(o.value),1)):l.createCommentVNode("",!0)]),_:1},8,["class","variant","size","style","aria-label","title"]),m.isChatOpen?(l.openBlock(),l.createElementBlock("div",Uc,[l.createVNode(l.unref(lt),{variant:u.value,class:l.normalizeClass(["tw:transition-all",[s.value]]),size:m.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(f.value),type:"button","aria-label":g.value,title:g.value,onClick:l.withModifiers(m.restartChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:m.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:m.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b[1]||(b[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,Hc)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",jc," 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:m.configDesignClass.getKey("sections.top.params.size"),style:l.normalizeStyle(f.value),type:"button","aria-label":g.value,title:g.value,onClick:l.withModifiers(m.toggleChat,["stop"])},{default:l.withCtx(()=>[d.value!=="text"?(l.openBlock(),l.createElementBlock("svg",{key:0,width:m.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",height:m.configDesignClass.getKey("sections.top.params.size")==="sm"?"12":"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b[2]||(b[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,Gc)):l.createCommentVNode("",!0),d.value!=="icon"?(l.openBlock(),l.createElementBlock("span",qc,l.toDisplayString(g.value),1)):l.createCommentVNode("",!0)]),_:1},8,["variant","class","size","style","aria-label","title","onClick"])])):l.createCommentVNode("",!0)],12,Nc))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xc=r=>typeof r<"u";function Yc(r){return JSON.parse(JSON.stringify(r))}function Bo(r,e,t,s={}){var n,i,o;const{clone:a=!1,passive:c=!1,eventName:u,deep:d=!1,defaultValue:h,shouldEmit:f}=s,g=l.getCurrentInstance(),w=t||(g==null?void 0:g.emit)||((n=g==null?void 0:g.$emit)==null?void 0:n.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 p=u;e||(e="modelValue"),p=p||`update:${e.toString()}`;const m=y=>a?typeof a=="function"?a(y):Yc(y):y,b=()=>Xc(r[e])?m(r[e]):h,v=y=>{f?f(y)&&w(p,y):w(p,y)};if(c){const y=b(),C=l.ref(y);let k=!1;return l.watch(()=>r[e],x=>{k||(k=!0,C.value=m(x),l.nextTick(()=>k=!1))}),l.watch(C,x=>{!k&&(x!==r[e]||d)&&v(x)},{deep:d}),C}else return l.computed({get(){return b()},set(y){v(y)}})}const Qc=l.defineComponent({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=Bo(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(n)?n.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(n)]])}});function Jc(r){var y;const e=()=>l.unref(r.transcribeUrl),t=l.ref(!1),s=l.ref(!1),n=l.ref(!0),i=l.ref(null),o=l.ref(0);let a=null,c=[],u=null,d=null;const h=r.maxDuration;(typeof navigator>"u"||!((y=navigator.mediaDevices)!=null&&y.getUserMedia))&&(n.value=!1);const f=()=>{const C=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];for(const k of C)if(MediaRecorder.isTypeSupported(k))return k;return"audio/webm"},g=async()=>{var C;if(!(!n.value||t.value))try{i.value=null,c=[],o.value=0,u=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:16e3}});const k=f();a=new MediaRecorder(u,{mimeType:k}),a.ondataavailable=x=>{x.data.size>0&&c.push(x.data)},a.onstop=async()=>{d&&(clearInterval(d),d=null);const x=new Blob(c,{type:k});u&&(u.getTracks().forEach(R=>R.stop()),u=null),await m(x)},a.onerror=()=>{i.value="Recording error",w()},a.start(250),t.value=!0,d=setInterval(()=>{o.value++,o.value>=h&&w()},1e3)}catch(k){k.name==="NotAllowedError"?i.value="Microphone access denied":k.name==="NotFoundError"?i.value="No microphone found":i.value=k.message||"Failed to start recording",i.value&&((C=r.onError)==null||C.call(r,i.value))}},w=()=>{a&&t.value&&(a.stop(),t.value=!1)},p=()=>{t.value?w():g()},m=async C=>{var x,R,T;s.value=!0,i.value=null;const k=e();if(!k){i.value="Transcribe URL not configured",(x=r.onError)==null||x.call(r,i.value),s.value=!1;return}try{const z=new FormData;z.append("audio",C,"recording.webm");const A=await fetch(k,{method:"POST",body:z});if(!A.ok)throw new Error(`HTTP ${A.status}`);const M=await A.json();if(M.success&&M.text)(R=r.onTranscript)==null||R.call(r,M.text);else throw new Error(M.error||"Transcription failed")}catch(z){i.value=z.message||"Transcription failed",i.value&&((T=r.onError)==null||T.call(r,i.value))}finally{s.value=!1}},b=l.computed(()=>{const C=Math.floor(o.value/60),k=o.value%60;return`${C}:${k.toString().padStart(2,"0")}`}),v=l.computed(()=>t.value||s.value);return{isRecording:t,isTranscribing:s,isSupported:n,isBusy:v,error:i,recordingDuration:o,formattedDuration:b,startRecording:g,stopRecording:w,toggleRecording:p}}const eu={key:0,class:"tw:transition-all tw:w-full"},tu=["innerHTML"],su=["width","height"],nu=["width","height"],ru=["width","height"],iu={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"},ou={key:0,class:"svg-icon"},au=["innerHTML"],lu={key:1},hn=120,cu=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:{}},emits:["update:messageText","trace"],setup(r,{emit:e}){const t=r,s=l.computed(()=>{var _;return t.transcribeUrl||((_=t.configDesignClass)==null?void 0:_.getKey("settings.transcribeUrl"))||""}),n=l.computed(()=>!!s.value),i=l.computed(()=>{var _,N;return((_=t.configDesignClass)==null?void 0:_.getKey("sections.bottom.btnVoice.color"))||((N=t.configDesignClass)==null?void 0:N.getKey("sections.bottom.inputSend.color"))||"#fff"}),o=l.computed(()=>{var _;return(_=t.configDesignClass)==null?void 0:_.getKey("sections.bottom.btnVoice.bgColor")}),a=l.computed(()=>{var _;return((_=t.configDesignClass)==null?void 0:_.getKey("sections.bottom.btnVoice.icon.src"))||null}),c=l.computed(()=>{var N;const _=(N=t.configDesignClass)==null?void 0:N.getKey("sections.bottom.btnVoice.icon.size");return typeof _=="number"&&Number.isFinite(_)?Math.max(1,_):_==="sm"?16:_==="lg"?24:20}),u=l.computed(()=>`${c.value}px`),d=l.computed(()=>{var de,j,re;if(!!((de=t.configDesignClass)!=null&&de.getKey("settings.globalRoundingRadius")))return(j=t.sectionBorderRadius)==null?void 0:j.borderRadius;const N=(re=t.configDesignClass)==null?void 0:re.getKey("sections.bottom.btnVoice.borderRadius");return typeof N=="number"?`${N}px`:"9999px"}),h=l.computed(()=>{var _;return(_=t.configDesignClass)==null?void 0:_.getKey("sections.bottom.btnVoice.type")}),f=l.computed(()=>{var _;return(_=t.configDesignClass)==null?void 0:_.getKey("sections.bottom.btnVoice.showType")}),{isRecording:g,isTranscribing:w,isSupported:p,formattedDuration:m,toggleRecording:b}=Jc({transcribeUrl:s,maxDuration:60,onTranscript:_=>{C.value=_},onError:_=>{console.error("Voice recording error:",_)}}),v=()=>{t.sendMessage()},C=Bo(t,"messageText",e,{passive:!0}),k=l.computed(()=>{var N;const _=(N=t.configDesignClass)==null?void 0:N.getKey("sections.bottom.inputSend.inputStyle");return _==="stacked"||_==="elastic"||_==="inside"?_:"inside"}),x=l.computed(()=>k.value==="stacked"),R=l.computed(()=>k.value==="elastic"),T=l.ref(null),z=()=>{var N;const _=(N=T.value)==null?void 0:N.$el;return _ instanceof HTMLTextAreaElement?_:null},A=()=>{if(!R.value)return;const _=z();if(!_)return;_.style.height="auto";const N=Math.min(_.scrollHeight,hn);_.style.height=`${N}px`,_.style.overflowY=_.scrollHeight>hn?"auto":"hidden"},M=()=>{A()};l.watch([C,R],async()=>{await l.nextTick(),requestAnimationFrame(A)},{immediate:!0});const I=l.computed(()=>ar(t.configDesignClass,"bottom")),F=l.computed(()=>{const _=t.configDesignClass.getKey("texts.topWarningText");return _&&_!=="undefined"?_:""}),J=l.computed(()=>{const _=t.configDesignClass.getKey("texts.disableInputText");return _&&_!=="undefined"?_:""}),P=l.computed(()=>t.configDesignClass.getKey("sections.bottom.inputSend.size")),H=l.computed(()=>t.isInputDisabled&&J.value?J.value:F.value||t.configDesignClass.getKey("texts.reconnectText")||"Reconnecting..."),q=l.computed(()=>t.configDesignClass.getKey("sections.bottom.btnSend.icon.showIcon")?t.configDesignClass.getKey("sections.bottom.btnSend.icon.src"):null),V=l.computed(()=>{const _=t.configDesignClass.getKey("texts.disclaimerText"),N=t.configDesignClass.getKey("texts.disclaimer"),de=_&&_!=="undefined"?_:N,re=!!t.configDesignClass.getKey("sections.bottom.params.disclaimerShow");return de&&de!=="undefined"&&re?de:""});return l.onMounted(()=>{}),(_,N)=>(l.openBlock(),l.createElementBlock("div",null,[_.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 "+_.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[l.createVNode(l.unref(lt),{type:"button",style:l.normalizeStyle({backgroundColor:"#27272A",borderRadius:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.sectionBorderRadius.borderRadius:_.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:N[0]||(N[0]=l.withModifiers(de=>_.$emit("trace",{action:"copyLast"}),["stop"]))},{default:l.withCtx(()=>N[3]||(N[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,__:[3]},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:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.sectionBorderRadius.borderRadius:_.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"}),"aria-label":"Copy all",title:"Copy all",onClick:N[1]||(N[1]=l.withModifiers(de=>_.$emit("trace",{action:"copyAll"}),["stop"]))},{default:l.withCtx(()=>N[4]||(N[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,__:[4]},8,["style"])],4)),l.createElementVNode("div",{class:"tw:transition-all tw:flex tw:flex-col tw:items-center tw:relative tw:mt-2",style:l.normalizeStyle({padding:x.value?"0":"0 "+_.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px"})},[_.showReconnectNotice||F.value||_.isInputDisabled?(l.openBlock(),l.createElementBlock("div",eu,[l.createVNode(bn,{class:"tw:rounded-b-none tw:mx-0 tw:flex tw:justify-center tw:item s-center tw:px-2 tw:py-2",type:"reconnecting",configDesignClass:_.configDesignClass,headlineText:H.value,restartChat:_.restartChat,warningElement:_.isInputDisabled?_.configDesignClass.getKeyObject("sections.warnings.disableInputIssue"):_.configDesignClass.getKeyObject("sections.warnings.reconnectIssue")},null,8,["configDesignClass","headlineText","restartChat","warningElement"])])):l.createCommentVNode("",!0),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-[42px] tw:items-center":_.classSize,x.value?"tw:flex-col tw:items-stretch tw:justify-between":R.value?"":" tw:items-end",P.value==="sm"?"tw:items-center":""]]),style:l.normalizeStyle({order:R.value?"1":void 0,...x.value?{borderRadius:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.mainBorderRadius+"px":_.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px",borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}:{borderRadius:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.sectionBorderRadius.borderRadius:_.configDesignClass.getKey("sections.bottom.inputSend.borderRadius")+"px"},"background-color":_.configDesignClass.getKey("sections.bottom.inputSend.bgColor"),"margin-bottom":x.value?"0px":_.configDesignClass.getKey("sections.bottom.inputSend.sidePadding")+"px",border:x.value?"none":`${_.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${_.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`,borderTop:`${_.configDesignClass.getKey("sections.bottom.inputSend.borderWidth")}px solid ${_.configDesignClass.getKey("sections.bottom.inputSend.borderColor")}`})},[(l.openBlock(),l.createBlock(l.unref(Qc),{class:l.normalizeClass(["tw:transition-all",["tw:w-full tw:outline-none tw:border-0 focus:tw:outline-none",x.value?"tw:h-auto rounded-none":"h-full"]]),placeholder:_.configDesignClass.getKey("texts.inputPlaceholder")||"Type question",rows:R.value?1:P.value==="sm"?2:P.value==="md"?3:4,key:_.configDesignClass.getKey("sections.bottom.inputSend.color"),ref_key:"messageTextareaRef",ref:T,modelValue:l.unref(C),"onUpdate:modelValue":N[2]||(N[2]=de=>l.isRef(C)?C.value=de:null),onKeyup:l.withKeys(l.withModifiers(v,["exact"]),["enter"]),onInput:M,style:l.normalizeStyle({alignSelf:x.value?"flex-start":"auto",color:_.configDesignClass.getKey("sections.bottom.inputSend.color"),fontSize:_.configDesignClass.getKey("sections.bottom.inputSend.fontSize")+"px",lineHeight:_.configDesignClass.getKey("settings.lineHeight"),padding:_.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px "+_.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px",...R.value?{minHeight:_.configDesignClass.getKey("sections.bottom.inputSend.height")+"px",maxHeight:hn+"px",overflowY:"hidden"}:{height:_.configDesignClass.getKey("sections.bottom.inputSend.height")+"px"}})},null,8,["placeholder","rows","modelValue","onKeyup","class","style"])),l.createElementVNode("div",{class:l.normalizeClass([x.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:_.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px",marginLeft:x.value?_.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px":"0",marginTop:R.value?_.configDesignClass.getKey("sections.bottom.inputSend.paddingVertical")+"px":"0",marginRight:_.configDesignClass.getKey("sections.bottom.inputSend.paddingHorizontal")+"px"})},[n.value&&l.unref(p)?(l.openBlock(),l.createBlock(l.unref(lt),{key:0,type:"button","data-voice-type":h.value,"data-voice-show-type":f.value,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":l.unref(g)},{"tw:opacity-50 tw:cursor-not-allowed":(l.unref(w)||_.isInputDisabled)&&!_.isPreview}]),size:"icon",style:l.normalizeStyle({backgroundColor:l.unref(g)?"#ef4444":o.value,color:l.unref(g)?"#fff":i.value,borderRadius:d.value}),disabled:l.unref(w)||_.isInputDisabled,onClick:l.unref(b),title:l.unref(g)?"Stop recording":"Start voice input"},{default:l.withCtx(()=>[!l.unref(g)&&!l.unref(w)&&a.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"svg-icon",style:l.normalizeStyle({width:u.value,height:u.value})},[l.createElementVNode("div",{innerHTML:a.value,style:l.normalizeStyle({width:u.value,height:u.value})},null,12,tu)],4)):!l.unref(g)&&!l.unref(w)?(l.openBlock(),l.createElementBlock("svg",{key:1,width:c.value,height:c.value,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},N[5]||(N[5]=[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,su)):l.unref(g)?(l.openBlock(),l.createElementBlock("svg",{key:2,width:c.value,height:c.value,viewBox:"0 0 24 24",fill:"currentColor"},N[6]||(N[6]=[l.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)]),8,nu)):(l.openBlock(),l.createElementBlock("svg",{key:3,width:c.value,height:c.value,viewBox:"0 0 24 24",fill:"none",class:"tw:animate-spin"},N[7]||(N[7]=[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,ru)),l.unref(g)?(l.openBlock(),l.createElementBlock("span",iu,l.toDisplayString(l.unref(m)),1)):l.createCommentVNode("",!0)]),_:1},8,["data-voice-type","data-voice-show-type","class","style","disabled","onClick","title"])):l.createCommentVNode("",!0),x.value&&V.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({..._.sectionBorderRadius,fontSize:_.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",height:_.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:_.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(V.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",_.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"tw:rounded-full":I.value,x.value?"":"tw:ml-auto",{"tw:opacity-50":(l.unref(C).trim()===""||_.isInputDisabled)&&!_.isPreview},{"tw:px-3 tw:py-2":_.configDesignClass.getKey("sections.bottom.btnSend.size")==="md"},{"tw:px-2 tw:py-1":_.configDesignClass.getKey("sections.bottom.btnSend.size")==="sm"},{"tw:px-4 tw:py-3":_.configDesignClass.getKey("sections.bottom.btnSend.size")==="lg"}]]),size:_.configDesignClass.getKey("sections.bottom.btnSend.showType")==="icon"?"icon":_.configDesignClass.getKey("sections.bottom.params.size"),onClick:v,style:l.normalizeStyle({..._.configDesignClass.getKey("sections.bottom.btnSend.type")==="icon"?{borderRadius:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.sectionBorderRadius.borderRadius:_.configDesignClass.getKey("sections.bottom.btnSend.borderRadius")+"px"}:{borderRadius:_.configDesignClass.getKey("settings.globalRoundingRadius")?_.sectionBorderRadius.borderRadius:_.configDesignClass.getKey("sections.bottom.btnSend.borderRadius")+"px"},color:_.configDesignClass.getKey("sections.bottom.btnSend.color"),"background-color":_.configDesignClass.getKey("sections.bottom.btnSend.bgColor"),fontSize:_.configDesignClass.getKey("sections.bottom.btnSend.fontSize")+"px",border:_.configDesignClass.getKey("sections.bottom.btnSend.borderWidth")+"px solid "+_.configDesignClass.getKey("sections.bottom.btnSend.borderColor")}),disabled:_.isInputDisabled},{default:l.withCtx(()=>[q.value?(l.openBlock(),l.createElementBlock("div",ou,[l.createElementVNode("div",{innerHTML:q.value,style:l.normalizeStyle({color:_.configDesignClass.getKey("sections.bottom.btnSend.color"),width:_.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px",height:_.configDesignClass.getKey("sections.bottom.btnSend.icon.size")+"px"})},null,12,au)])):l.createCommentVNode("",!0),_.configDesignClass.getKey("sections.bottom.btnSend.showType")==="text"||_.configDesignClass.getKey("sections.bottom.btnSend.showType")==="both"?(l.openBlock(),l.createElementBlock("span",lu,l.toDisplayString(_.configDesignClass.getKey("texts.sendButton")),1)):l.createCommentVNode("",!0)]),_:1},8,["size","class","style","disabled"])],6)],6),!x.value&&V.value?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:px-2 tw:mb-2 tw:flex tw:items-center tw:justify-center",style:l.normalizeStyle({..._.sectionBorderRadius,fontSize:_.configDesignClass.getKey("sections.bottom.disclaimer.fontSize")+"px",order:2,height:_.configDesignClass.getKey("sections.bottom.disclaimer.height")+"px",color:_.configDesignClass.getKey("sections.bottom.disclaimer.color")})},l.toDisplayString(V.value),5)):l.createCommentVNode("",!0)],4)]))}});var ae=(r=>(r.Collapsed="collapsed",r.EmptyChat="empty",r.Messages="messages",r.ActionSnippet="action_snippet",r.LaunchIssue="launch_issue",r.ConnectionIssue="connection_issue",r.ReconnectingAttempt="reconnecting_attempt",r.InputBlocked="input_blocked",r.ActionLoader="action_loader",r.TracesMessage="traces_message",r.TracesWithMeta="traces_with_meta",r))(ae||{}),Mo=(r=>(r.UserMessage="Give me some action",r))(Mo||{});class Ze{base(e){return{isChatOpen:!0,isChatActive:!0,messages:[],isConnectionError:!1,isProcessError:!1,isReconnectError:!1,isInputDisabled:!1,showWelcome:!1,blockSocket:!0,traceLastShown:!1,...e}}}class uu extends Ze{constructor(){super(...arguments);K(this,"type",ae.Collapsed)}getState(){return this.base({isChatOpen:!1})}}class ei extends Ze{constructor(){super(...arguments);K(this,"type",ae.EmptyChat)}getState(){return this.base({showWelcome:!0,messages:[]})}}class du extends Ze{constructor(){super(...arguments);K(this,"type",ae.Messages)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action",i=(s==null?void 0:s.botMessageText)??"What sort of action do you want?";return this.base({showWelcome:!0,messages:[{text:n,isUser:!0},{text:i,isUser:!1},{text:"Sort of action",isUser:!0}]})}}class pu extends Ze{constructor(){super(...arguments);K(this,"type",ae.ActionSnippet)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!1,messages:[{text:n,isUser:!0},{snippet:{sequence:"38952101547613990",id:"38496103561174822",data:{actionCancel:{text:"Cancel"},actionConfirm:{text:"Confirm"},title:{text:"Do you really want to get the available contacts list?"}}},isUser:!1}]})}}class hu extends Ze{constructor(){super(...arguments);K(this,"type",ae.LaunchIssue)}getState(){return this.base({isConnectionError:!0})}}class gu extends Ze{constructor(){super(...arguments);K(this,"type",ae.ConnectionIssue)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,o=(s==null?void 0:s.traceSteps)??["Step One","Step Two","Step three"];return this.base({isProcessError:!0,showWelcome:i,messages:[{text:n,isUser:!0},{text:o[0],isUser:!1,isSystem:!0,type:"trace"},{text:o[1],isUser:!1,isSystem:!0,type:"trace"},{text:o[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class fu extends Ze{constructor(){super(...arguments);K(this,"type",ae.ReconnectingAttempt)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,o=(s==null?void 0:s.traceSteps)??["Step One","Step Two","Step three"];return this.base({isReconnectError:!0,showReconnectNotice:!0,showWelcome:i,messages:[{text:n,isUser:!0},{text:o[0],isUser:!1,isSystem:!0,type:"trace"},{text:o[1],isUser:!1,isSystem:!0,type:"trace"},{text:o[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class mu extends Ze{constructor(){super(...arguments);K(this,"type",ae.InputBlocked)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action",i=!0,o=(s==null?void 0:s.traceSteps)??["Step One","Step Two","Step three"];return this.base({isReconnectError:!0,showReconnectNotice:!0,isInputDisabled:!0,showWelcome:i,messages:[{text:n,isUser:!0},{text:o[0],isUser:!1,isSystem:!0,type:"trace"},{text:o[1],isUser:!1,isSystem:!0,type:"trace"},{text:o[2],isUser:!1,isSystem:!0,type:"trace"}]})}}class wu extends Ze{constructor(){super(...arguments);K(this,"type",ae.ActionLoader)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action";return this.base({showWelcome:!0,messages:[{text:n,isUser:!0}]})}}class bu extends Ze{constructor(){super(...arguments);K(this,"type",ae.TracesMessage)}getState(t,s){const n=(s==null?void 0:s.userMessageText)??"Give me some action",i=(s==null?void 0:s.traceSteps)??["Step One","Step Two","Step three"],o=[{text:n,isUser:!0},{text:i[0],isUser:!1,isSystem:!0,type:"trace"},{text:i[1],isUser:!1,isSystem:!0,type:"trace"},{text:i[2],isUser:!1,isSystem:!0,type:"trace"}];return this.base({showWelcome:!0,messages:o})}}class yu extends Ze{constructor(){super(...arguments);K(this,"type",ae.TracesWithMeta)}getState(t,s){const n=(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:n,isUser:!0},{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 this.base({showWelcome:!0,messages:o})}}class vu{static create(e){switch(e){case ae.Collapsed:case"collapsed":return new uu;case ae.EmptyChat:case"empty":return new ei;case ae.Messages:case"messages":return new du;case ae.ActionSnippet:case"action_snippet":return new pu;case ae.LaunchIssue:case"launch_issue":return new hu;case ae.ConnectionIssue:case"connection_issue":return new gu;case ae.ReconnectingAttempt:case"reconnecting_attempt":return new fu;case ae.InputBlocked:case"input_blocked":return new mu;case ae.ActionLoader:case"action_loader":return new wu;case ae.TracesMessage:case"traces_message":return new bu;case ae.TracesWithMeta:case"traces_with_meta":return new yu;default:return new ei}}}class ti{static getScenarioFromUrl(){try{return new URLSearchParams(window.location.search).get("scenario")??void 0}catch{return}}static getState(e,t,s){return{...vu.create(e).getState(t,s),...s??{}}}}function Cu(r){const e=l.ref(!1),t=l.ref(!1),s=l.ref(null);let n=null,i=null;const o=()=>l.unref(r.ttsUrl),a=()=>{n&&(n.pause(),n.src="",n=null),i&&(URL.revokeObjectURL(i),i=null)},c=async g=>{const w=o();if(!w)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);h(),t.value=!0,s.value=null;try{const p=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:g.trim(),voice:r.voice||"nova"})});if(!p.ok){const b=await p.json().catch(()=>({}));throw new Error(b.error||`TTS request failed: ${p.status}`)}const m=await p.blob();return i=URL.createObjectURL(m),new Promise((b,v)=>{n=new Audio(i),n.onplay=()=>{e.value=!0,t.value=!1},n.onended=()=>{e.value=!1,a(),b()},n.onerror=()=>{e.value=!1,t.value=!1,s.value="Audio playback failed",a(),v(s.value)},n.play().catch(y=>{t.value=!1,s.value=y.message,v(y)})})}catch(p){throw t.value=!1,s.value=p.message||"TTS failed",p}},u=()=>{n&&e.value&&(n.pause(),e.value=!1)},d=()=>{n&&!e.value&&(n.play(),e.value=!0)},h=()=>{e.value=!1,t.value=!1,a()},f=g=>{e.value?u():n&&n.paused&&n.currentTime>0?d():g&&c(g)};return l.onUnmounted(()=>{h()}),{isSpeaking:e,isLoading:t,error:s,speak:c,pause:u,resume:d,stop:h,toggle:f}}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 Eo(r){Pt=r}var ps={exec:()=>null};function Z(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),t=t.replace(n,o),s},getRegex:()=>new RegExp(t,e)};return s}var ku=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),xe={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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},xu=/^(?:[ \t]*(?:\n|$))+/,_u=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Su=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ks=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cr=/(?:[*+-]|\d{1,9}[.)])/,Ao=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Po=Z(Ao).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(),Ru=Z(Ao).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]|[^\[\]\\])+/,Bu=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mu=Z(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cr).getRegex(),qs="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",pr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Eu=Z("^ {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",pr).replace("tag",qs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vo=Z(ur).replace("hr",ks).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",qs).getRegex(),Au=Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vo).getRegex(),hr={blockquote:Au,code:_u,def:Bu,fences:Su,heading:Tu,hr:ks,html:Eu,lheading:Po,list:Mu,newline:xu,paragraph:Vo,table:ps,text:zu},si=Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ks).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",qs).getRegex(),Pu={...hr,lheading:Ru,table:si,paragraph:Z(ur).replace("hr",ks).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).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",qs).getRegex()},Vu={...hr,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pr).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:ps,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(ur).replace("hr",ks).replace("heading",` *#{1,6} *[^
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/'/g,"'"):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=`
|
|
19
|
+
<p>Here's a simple Markdown table with 4 columns and 3 rows:</p>
|
|
20
|
+
<table>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Column 1</th>
|
|
24
|
+
<th>Column 2</th>
|
|
25
|
+
<th>Column 3</th>
|
|
26
|
+
<th>Column 4</th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody><tr>
|
|
30
|
+
<td>Data 1</td>
|
|
31
|
+
<td>Data 2</td>
|
|
32
|
+
<td>Data 3</td>
|
|
33
|
+
<td>Data 4</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td>Data 5</td>
|
|
37
|
+
<td>Data 6</td>
|
|
38
|
+
<td>Data 7</td>
|
|
39
|
+
<td>Data 8</td>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td>Data 9</td>
|
|
43
|
+
<td>Data 10</td>
|
|
44
|
+
<td>Data 11</td>
|
|
45
|
+
<td>Data 12</td>
|
|
46
|
+
</tr>
|
|
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={"&":"&","<":"<",">":">",'"':""","'":"'"},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(`
|
|
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],`
|
|
24
54
|
`).split(`
|
|
25
|
-
`),s="",
|
|
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(`
|
|
26
56
|
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
27
57
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
28
|
-
${u}`:u,
|
|
29
|
-
${d}`:d;let
|
|
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+`
|
|
30
60
|
`+t.join(`
|
|
31
|
-
`),
|
|
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+`
|
|
32
62
|
`+t.join(`
|
|
33
|
-
`),
|
|
34
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:
|
|
35
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
36
|
-
`,1)[0],
|
|
37
|
-
`,
|
|
38
|
-
`,1)[0],R;if(w=
|
|
39
|
-
`+R.slice(m);else{if(
|
|
40
|
-
`+w}!
|
|
41
|
-
`,
|
|
42
|
-
`):[],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
|
|
43
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(
|
|
44
|
-
`),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
|
|
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+=`
|
|
45
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(`
|
|
46
76
|
`)?"":`
|
|
47
77
|
`)+a.raw,u.text+=`
|
|
48
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(`
|
|
49
79
|
`)?"":`
|
|
50
80
|
`)+a.raw,u.text+=`
|
|
51
|
-
`+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),
|
|
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(`
|
|
52
82
|
`)?"":`
|
|
53
83
|
`)+a.raw,u.text+=`
|
|
54
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(`
|
|
55
85
|
`)?"":`
|
|
56
86
|
`)+a.raw,u.text+=`
|
|
57
|
-
`+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,
|
|
58
|
-
`;return s?'<pre><code class="language-'+it(s)+'">'+(t?
|
|
59
|
-
`:"<pre><code>"+(t?
|
|
60
|
-
`}blockquote({tokens:
|
|
61
|
-
${this.parser.parse(
|
|
62
|
-
`}html({text:
|
|
63
|
-
`}hr(
|
|
64
|
-
`}list(
|
|
65
|
-
`+s+"</"+
|
|
66
|
-
`}listitem(
|
|
67
|
-
`}checkbox({checked:
|
|
68
|
-
`}table(
|
|
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>
|
|
90
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
91
|
+
${this.parser.parse(n)}</blockquote>
|
|
92
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
93
|
+
`}hr(n){return`<hr>
|
|
94
|
+
`}list(n){let e=n.ordered,t=n.start,s="";for(let o=0;o<n.items.length;o++){let a=n.items[o];s+=this.listitem(a)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
|
|
95
|
+
`+s+"</"+r+`>
|
|
96
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
97
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
98
|
+
`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){let i=n.rows[r];t="";for(let o=0;o<i.length;o++)t+=this.tablecell(i[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
69
99
|
<thead>
|
|
70
100
|
`+e+`</thead>
|
|
71
101
|
`+s+`</table>
|
|
72
|
-
`}tablerow({text:
|
|
73
|
-
${
|
|
74
|
-
`}tablecell(
|
|
75
|
-
`}strong({tokens:
|
|
76
|
-
Please report this to https://github.com/markedjs/marked.`,r){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 rd;function Q(r,e){return Et.parse(r,e)}Q.options=Q.setOptions=function(r){return Et.setOptions(r),Q.defaults=Et.defaults,Eo(Q.defaults),Q};Q.getDefaults=lr;Q.defaults=Pt;Q.use=function(...r){return Et.use(...r),Q.defaults=Et.defaults,Eo(Q.defaults),Q};Q.walkTokens=function(r,e){return Et.walkTokens(r,e)};Q.parseInline=Et.parseInline;Q.Parser=Ge;Q.parser=Ge.parse;Q.Renderer=Us;Q.TextRenderer=mr;Q.Lexer=je;Q.lexer=je.lex;Q.Tokenizer=Ws;Q.Hooks=ls;Q.parse=Q;Q.options;Q.setOptions;Q.use;Q.walkTokens;Q.parseInline;Ge.parse;je.lex;const id={key:"message",class:"message-text tw:flex tw:items-end tw:gap-1 tw:transition-all"},od=["innerHTML"],ad=["aria-label"],ld={key:1,width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cd=["aria-label","disabled"],ud={key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dd=l.defineComponent({__name:"MessageBot",props:{message:{},welcomeColor:{},color:{},bgColor:{},size:{},bgType:{},fontSize:{},borderWidth:{},borderColor:{},configDesignClass:{},ttsUrl:{}},setup(r){Q.setOptions({breaks:!0,gfm:!0});const e=r,t=l.computed(()=>{var A;return e.ttsUrl||((A=e.configDesignClass)==null?void 0:A.getKey("settings.ttsUrl"))||""}),s=l.computed(()=>!!t.value),{speak:n,stop:i,isSpeaking:o,isLoading:a}=Cu({ttsUrl:t,voice:"nova"}),c=l.ref(null),u=l.ref("idle"),d=l.ref(!1);let h;const f=()=>{h&&(window.clearTimeout(h),h=void 0)},g=(A=1500)=>{f(),h=window.setTimeout(()=>{u.value="idle"},A)},w=l.computed(()=>{var I,F;const A=(I=e.message.chunk)!=null&&I.start?"#2F2F31":e.color,M=(F=e.message.chunk)!=null&&F.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"?Vn(M,.5):M}}),p=()=>{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},b=async()=>{var M;const A=p();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",g()}catch(I){console.warn("Copy failed",I),u.value="error",g(2e3)}},v=l.computed(()=>u.value==="copied"?"Copied":u.value==="error"?"Copy failed":"Copy"),y=l.computed(()=>d.value||u.value!=="idle"),C=l.ref(!1),k=l.computed(()=>a.value?"Loading...":o.value?"Stop":"Speak"),x=l.computed(()=>C.value||o.value||a.value);l.onBeforeUnmount(()=>{f()});const R=()=>{o.value?i():e.message.text&&n(e.message.text)},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":""}}),z=l.computed(()=>e.message.text?Q.parse(e.message.text):"");return(A,M)=>{var I,F,J;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]",[T.value,{"item-primary":!((I=A.message.chunk)!=null&&I.start)}]]),style:l.normalizeStyle(w.value)},[l.createElementVNode("div",id,[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:z.value},null,8,od),A.message.text&&!((F=A.message.chunk)!=null&&F.start)?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:M[2]||(M[2]=P=>d.value=!0),onMouseleave:M[3]||(M[3]=P=>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":y.value}]),role:"tooltip"},l.toDisplayString(v.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(b,["stop"]),onFocus:M[0]||(M[0]=P=>d.value=!0),onBlur:M[1]||(M[1]=P=>d.value=!1),"aria-label":v.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:A.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",ld,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,ad)],32)):l.createCommentVNode("",!0),s.value&&A.message.text&&!((J=A.message.chunk)!=null&&J.start)?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tw:relative tw:flex-shrink-0 tw:self-end tw:flex",onMouseenter:M[6]||(M[6]=P=>C.value=!0),onMouseleave:M[7]||(M[7]=P=>C.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":x.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(o)||l.unref(a),"tts-speaking":l.unref(o),"tts-loading":l.unref(a)}]),onClick:l.withModifiers(R,["stop"]),onFocus:M[4]||(M[4]=P=>C.value=!0),onBlur:M[5]||(M[5]=P=>C.value=!1),"aria-label":k.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:A.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",ud,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,cd)],32)):l.createCommentVNode("",!0)])],6)}}}),pd=l.defineComponent({__name:"MessageUser",props:{message:{},isFirst:{type:Boolean},color:{},bgColor:{},borderWidth:{},borderColor:{},fontSize:{},size:{},bgType:{},configDesignClass:{}},setup(r){const e=r,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(n,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))}}),hd=["innerHTML"],gd={class:"tw:text-sm"},fd=["innerHTML"],md={key:"dots",class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:h-4"},wd={key:"dots-pulse",class:"tw:flex tw:items-center tw:justify-start tw:gap-1 tw:h-4"},bd={key:"circle-pulse",class:"circle-pulse"},yd={key:"circle-pulse-1",class:"circle-pulse-1"},vd=["data-text"],li=l.defineComponent({__name:"LoadingMessage",props:{isProduction:{type:Boolean},loader:{},text:{},message:{},configDesignClass:{},paused:{type:Boolean},color:{},bgColor:{},loadingTime:{}},setup(r){const e=r,t=l.ref(null),s=l.ref(!1);let n=null;const i=()=>{const u=t.value;if(!u)return;const d=u.closest("li");if(!d)return;const h=d.nextElementSibling;if(!h){s.value=!1;return}const f=h.getAttribute("data-component")==="MessageBot"||typeof h.matches=="function"&&h.matches('[data-component="MessageBot"]')||!!h.querySelector('[data-component="MessageBot"]');s.value=f},o=l.computed(()=>e.configDesignClass.getKey("sections.inside.dataAction.type")),a=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction"));l.onMounted(()=>{l.nextTick(i);const u=t.value,d=u==null?void 0:u.closest("ul");d&&(n=new MutationObserver(()=>i()),n.observe(d,{childList:!0,subtree:!0}))}),l.onBeforeUnmount(()=>{n&&n.disconnect()}),l.watch(()=>e.text,()=>l.nextTick(i));const c=l.computed(()=>!!e.paused||s.value);return(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:"loading",ref_key:"rootRef",ref:t,class:l.normalizeClass(["message-text-loading tw:flex tw:justify-start tw:max-w-xs tw:overflow-hidden tw:flex-wrap",{"tw:flex-col tw:border":o.value==="box","tw:border tw:px-3 tw:py-2.5":o.value==="outline","tw:!rounded-none":o.value==="compact","tw:items-center tw:gap-3":o.value!=="box"}]),style:l.normalizeStyle({borderColor:a.value.strokeColor,borderWidth:a.value.strokeWidth+"px"})},[o.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:a.value.headerFillColor,color:a.value.pastStepColor,borderColor:a.value.strokeColor})},[l.createElementVNode("div",{key:"complete-step-icon",innerHTML:u.configDesignClass.getKey("sections.loader.activeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({color:u.configDesignClass.getKey("sections.loader.activeStep.icon.color"),height:u.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px",width:u.configDesignClass.getKey("sections.loader.activeStep.icon.size")+"px"})},null,12,hd),l.createElementVNode("span",gd,l.toDisplayString(a.value.headerText),1)],4)):l.createCommentVNode("",!0),o.value!=="box"?(l.openBlock(),l.createBlock(l.Transition,{key:1,name:"fade",mode:"out-in"},{default:l.withCtx(()=>[c.value?(l.openBlock(),l.createElementBlock("div",{key:"complete-step-icon",innerHTML:u.configDesignClass.getKey("sections.loader.completeStep.icon.src"),class:"svg-inherit",style:l.normalizeStyle({color:u.configDesignClass.getKey("sections.loader.completeStep.icon.color"),height:u.configDesignClass.getKey("sections.loader.completeStep.icon.size")+"px",width:u.configDesignClass.getKey("sections.loader.completeStep.icon.size")+"px"})},null,12,fd)):!u.loader||u.loader==="dots"?(l.openBlock(),l.createElementBlock("div",md,[d[0]||(d[0]=l.createElementVNode("div",{class:"loading-dot tw:rounded-full"},null,-1)),l.createElementVNode("div",{style:l.normalizeStyle({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-1 tw:rounded-full"},null,4),l.createElementVNode("div",{style:l.normalizeStyle({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-2 tw:rounded-full"},null,4),l.createElementVNode("div",{style:l.normalizeStyle({backgroundColor:a.value.activeStepColor}),class:"loading-dot loading-dot-delay-3 tw:rounded-full"},null,4)])):u.loader==="dots-pulse"?(l.openBlock(),l.createElementBlock("div",wd,d[1]||(d[1]=[l.createElementVNode("span",{class:"dot-pulse dot-1"},null,-1),l.createElementVNode("span",{class:"dot-pulse dot-2"},null,-1),l.createElementVNode("span",{class:"dot-pulse dot-3"},null,-1)]))):u.loader==="circle-pulse"?(l.openBlock(),l.createElementBlock("div",bd,d[2]||(d[2]=[l.createElementVNode("span",{class:"ring ring-1"},null,-1),l.createElementVNode("span",{class:"ring ring-2"},null,-1)]))):u.loader==="circle-pulse-1"?(l.openBlock(),l.createElementBlock("div",yd,d[3]||(d[3]=[l.createElementVNode("span",{class:"ripple r1"},null,-1),l.createElementVNode("span",{class:"ripple r2"},null,-1),l.createElementVNode("span",{class:"center"},null,-1)]))):l.createCommentVNode("",!0)]),_:1})):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"fade-text",mode:"out-in"},{default:l.withCtx(()=>{var h,f,g,w;return[(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(["tw:transition-all tw:text-sm",{"typing-shimmer":!c.value,"tw:px-3 tw:py-3":o.value==="box"}]),key:u.text,"data-text":(h=u.message)!=null&&h.text?(f=u.message)==null?void 0:f.text:u.text,style:l.normalizeStyle({color:a.value.activeStepColor,background:o.value==="box"?`linear-gradient(0deg, ${a.value.headerFillColor} 0%, ${l.unref(To)(a.value.bodyFillColor,.4)} 100%)`:"transparent"})},l.toDisplayString(c.value?"Thinking completed":(g=u.message)!=null&&g.text?(w=u.message)==null?void 0:w.text:u.text),15,vd))]}),_:1}),u.loadingTime&&c.value&&o.value==="outline"||o.value==="compact"?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["tw:text-xs",{"tw:w-full tw:-mt-2":o.value==="compact","tw:ml-auto":o.value==="outline"}]),style:l.normalizeStyle({color:a.value.pastStepColor})},l.toDisplayString(u.loadingTime)+" seconds total",7)):l.createCommentVNode("",!0)],6))}}),Cd=["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"},xd={class:"tw:transition-all tw:flex tw:items-center tw:gap-2 tw:leading-none"},_d=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(r){const e=r,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"}}),n=l.computed(()=>e.configDesignClass.getKeyObject("sections.inside.dataAction")),i=l.computed(()=>t.value?n.value.activeStepColor:n.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":a.configDesignClass.getKey("sections.loader.completeStep.verticalSpacing")+"px"}]),"data-height":a.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":a.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:a.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",xd,[a.message.meta&&!a.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(a.message.text),1)]),_:1,__:[0]},8,["style","class"])):(l.openBlock(),l.createElementBlock("p",{key:1,style:l.normalizeStyle({color:i.value,"font-size":a.configDesignClass.getKey("sections.loader.completeStep.fontSize")+"px"})},l.toDisplayString(a.message.text),5))])],2)],14,Cd))}});class Sd{constructor(e,t){K(this,"structure");K(this,"options");K(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 n=new RegExp(`data-visual="${this.escapeRegExp(t)}"`,"g"),i=Object.entries(s.style).map(([o,a])=>`${o}: ${a};`).join("");this.html=this.html.replace(n,`class="${s.class}" style="${i}"`)}),this}result(){return this.html}renderLayout(e,t,s){let n=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;n=n.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;n=n.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]:[],h=o.layout||"",f=o.bindings||{},g=d.map(w=>this.renderLayout(h,f,w)).join("");n=n.replace(a,g);return}}),n=n.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)}"`})),n}safeText(e){return this.options.escape?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/'/g,"'"):e}safeAttr(e){return this.safeText(e)}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}const Td={layout:'<div class="tw:flex tw:flex-col" data-visual="container"><div><span data-visual="headerChip">Action</span></div><div class="tw:flex tw:mb-2 tw:mt-2 tw:text-xs"><div data-visual="title">{title}</div></div><div class="tw:flex tw:gap-1"><button data-cb="confirm" data-visual="actionConfirm" class="tw:flex-1">{actionConfirm}</button><button data-cb="cancel" data-visual="actionCancel" class="tw:flex-1">{actionCancel}</button></div></div>',bindings:{title:{type:"text"},actionConfirm:{type:"button"},actionCancel:{type:"button"}}};function Rd(r){const e=l.computed(()=>{const y=r==null?void 0:r.getKeyObject("sections.inside.activeSnippet"),C=r==null?void 0:r.getKeyObject("sections.activeSnippet"),k=y&&y!=="undefined"?y:C;return k&&k!=="undefined"?k:{}}),t=(y,C)=>{if(!C)return y;switch(C){case"outlined":return{color:y.background,background:"transparent",border:`1px solid ${y.borderColor||y.background}`};case"invisible":return{color:y.background,background:"transparent"};default:return y}},s=l.computed(()=>r==null?void 0:r.getKey("sections.inside.activeSnippet.element.bgColor")),n=l.computed(()=>r==null?void 0:r.getKey("sections.inside.activeSnippet.element.color")),i=l.computed(()=>r==null?void 0:r.getKey("sections.inside.activeSnippet.element.sidePadding")),o=l.computed(()=>r==null?void 0:r.getKey("sections.inside.activeSnippet.element.verticalSpacing")),a=l.computed(()=>(r==null?void 0:r.getKey("sections.inside.activeSnippet.element.borderWidth"))+"px solid "+(r==null?void 0:r.getKey("sections.inside.activeSnippet.element.borderColor"))),c=l.computed(()=>{var y,C,k,x,R,T,z,A;return{color:(C=(y=e.value)==null?void 0:y.headerChip)==null?void 0:C.color,background:(x=(k=e.value)==null?void 0:k.headerChip)==null?void 0:x.bgColor,borderColor:(T=(R=e.value)==null?void 0:R.headerChip)==null?void 0:T.borderColor,bgColor:(A=(z=e.value)==null?void 0:z.headerChip)==null?void 0:A.bgColor}}),u=l.computed(()=>{var y,C;return t(c.value,(C=(y=e.value)==null?void 0:y.headerChip)==null?void 0:C.bgType)}),d=l.computed(()=>{var y,C,k,x;return{...u.value,"border-radius":r!=null&&r.getKey("settings.globalRoundingRadius")?hs(r,2).borderRadius:((C=(y=e.value)==null?void 0:y.headerChip)==null?void 0:C.borderRadius)+"px","font-size":((x=(k=e.value)==null?void 0:k.headerChip)==null?void 0:x.fontSize)+"px"}}),h=l.computed(()=>{var y;return(y=e.value)==null?void 0:y.propertyColor}),f=l.computed(()=>{var y;return(y=e.value)==null?void 0:y.valueColor}),g=l.computed(()=>{var y,C,k,x;return{color:(C=(y=e.value)==null?void 0:y.yesButton)==null?void 0:C.color,background:(x=(k=e.value)==null?void 0:k.yesButton)==null?void 0:x.bgColor}}),w=l.computed(()=>{var y,C,k,x;return{color:(C=(y=e.value)==null?void 0:y.noButton)==null?void 0:C.color,background:(x=(k=e.value)==null?void 0:k.noButton)==null?void 0:x.bgColor}}),p=l.computed(()=>{const y=r==null?void 0:r.getKey("sections.inside.activeSnippet.params.size"),C=r==null?void 0:r.getKey("sections.inside.params.size");return $n(y!=="undefined"?y:C)}),m=l.computed(()=>{const y=r==null?void 0:r.getKey("sections.inside.activeSnippet.headerChip.size");return $n(y)}),b=y=>{const C=(y.id||"").toLowerCase(),x=C==="confirm"||C==="yes"?g.value:w.value,R=r==null?void 0:r.getKey("sections.inside.activeSnippet.params.buttonStyle");return t(x,R)},v=l.computed(()=>r!=null&&r.getKey("settings.globalRoundingRadius")?hs(r,8):{borderRadius:(r==null?void 0:r.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px"});return{containerBg:s,containerColor:n,sidePadding:i,verticalSpacing:o,headerChip:d,propertyColor:h,border:a,valueColor:f,yesButton:g,noButton:w,buttonStyle:b,getButtonStyle:t,actionBtnSizeClass:p,buttonRadiusStyle:v,chipSizeClass:m}}const zd=["innerHTML"],Bd=l.defineComponent({__name:"DynamicSnippet",props:{structure:{},data:{},message:{},configDesignClass:{}},emits:["action"],setup(r,{emit:e}){const t=r,{containerBg:s,containerColor:n,headerChip:i,yesButton:o,noButton:a,actionBtnSizeClass:c,buttonRadiusStyle:u,verticalSpacing:d,sidePadding:h,valueColor:f,getButtonStyle:g,border:w,chipSizeClass:p}=Rd(t.configDesignClass),m=l.computed(()=>{var x;return(x=t.configDesignClass)==null?void 0:x.getKey("sections.inside.activeSnippet.params.buttonStyle")}),b=l.computed(()=>{var x,R;return{background:s.value,color:n.value,"border-radius":(x=t.configDesignClass)!=null&&x.getKey("settings.globalRoundingRadius")?u.value.borderRadius:((R=t.configDesignClass)==null?void 0:R.getKey("sections.inside.activeSnippet.element.borderRadius"))+"px",border:w.value,padding:`${h.value}px`,gap:`${d.value}px`}}),v=l.computed(()=>{var x,R,T,z,A,M,I;return{container:{style:b.value},headerChip:{style:i.value,class:p.value},actionConfirm:{class:c.value,style:{...g(o.value,m.value),flex:"1","line-height":"1","border-radius":(x=t.configDesignClass)!=null&&x.getKey("settings.globalRoundingRadius")?u.value.borderRadius:((R=t.configDesignClass)==null?void 0:R.getKey("sections.inside.activeSnippet.yesButton.borderRadius"))+"px","font-size":((T=t.configDesignClass)==null?void 0:T.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}},title:{style:{color:f.value,"font-size":((z=t.configDesignClass)==null?void 0:z.getKey("sections.inside.activeSnippet.element.fontSize"))+"px"}},actionCancel:{class:c.value,style:{...g(a.value,m.value),flex:"1","line-height":"1","border-radius":(A=t.configDesignClass)!=null&&A.getKey("settings.globalRoundingRadius")?u.value.borderRadius:((M=t.configDesignClass)==null?void 0:M.getKey("sections.inside.activeSnippet.yesButton.borderRadius"))+"px","font-size":((I=t.configDesignClass)==null?void 0:I.getKey("sections.inside.activeSnippet.yesButton.fontSize"))+"px"}}}}),y=e,C=l.computed(()=>new Sd(t.structure).build(t.data).buildStyle(v.value).result()),k=x=>{var A;const R=x.target;if(!R)return;const T=R.closest("[data-cb]"),z=T==null?void 0:T.getAttribute("data-cb");z&&((A=t.message.snippet)!=null&&A.sequence)&&y("action",z,t.message.snippet.sequence)};return(x,R)=>(l.openBlock(),l.createElementBlock("div",{class:"tw:mt-1 tw:mb-1 tw:max-w-[65%]",onClick:k,innerHTML:C.value},null,8,zd))}}),Md=["innerHTML"],Ed=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","handleSnippetAction"],setup(r,{emit:e}){const t=l.ref(null),s=r,n=e,i=b=>{b.meta&&n("handleClickMessage",b)},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((b,v,y)=>{var C;return!s.isProduction||o.value==="steps"?!0:!(b.type==="usageTokensByAI"&&v===y.length-1||b.isSystem&&((C=y[v+1])!=null&&C.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 b=t.value;return b.scrollHeight-b.scrollTop-b.clientHeight<=24},h=()=>{},f=b=>{const v=b.replace("#",""),y=parseInt(v.substr(0,2),16),C=parseInt(v.substr(2,2),16),k=parseInt(v.substr(4,2),16),x=Math.max(0,y-12),R=Math.max(0,C-12),T=Math.max(0,k-12);return`linear-gradient(180deg, rgba(${x}, ${R}, ${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"}}),w=l.computed(()=>s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="gradient"?f(s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor")):s.configDesignClass.getKey("sections.inside.welcomeMessage.bgType")==="bubble"?s.configDesignClass.getKey("sections.inside.welcomeMessage.bgColor"):"transparent"),p=b=>s.configDesignClass.getKey("settings.globalRoundingRadius")?s.sectionBorderRadius.borderRadius:s.configDesignClass.getKey(b?"sections.inside.messageUser.borderRadius":"sections.inside.messageBot.borderRadius")+"px",m=b=>{var R,T;const v=s.messages.findIndex(z=>z===b);let y=null;if(!b.time)return 0;for(let z=v+1;z<s.messages.length;z++)if((R=s.messages[z])!=null&&R.chunkId&&!((T=s.messages[z])!=null&&T.isUser)){y=s.messages[z];break}if(!(y!=null&&y.time))return 0;const C=z=>z?Date.parse(z):NaN,k=b.time&&(y!=null&&y.time)?C(y.time)-C(b.time):null;return k?Number((z=>z/1e3)(k).toFixed(1)):null};return(b,v)=>(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:h},[b.showWelcome?(l.openBlock(),l.createElementBlock("li",{key:0,class:l.normalizeClass(["tw:transition-all",["tw:text-"+(b.configDesignClass.getKey("sections.inside.params.size")==="sm"?"xs":b.configDesignClass.getKey("sections.inside.params.size")==="md"?"sm":"base")]]),style:l.normalizeStyle({color:b.configDesignClass.getKey("sections.inside.welcomeMessage.color"),"margin-bottom":`${b.configDesignClass.getKey("settings.gapMessageLine")}px`})},[l.createElementVNode("div",{key:"message",class:l.normalizeClass(["tw:transition-all",g.value]),style:l.normalizeStyle({borderRadius:b.configDesignClass.getKey("settings.globalRoundingRadius")?b.sectionBorderRadius.borderRadius:b.configDesignClass.getKey("sections.inside.welcomeMessage.borderRadius")+"px",color:b.configDesignClass.getKey("sections.inside.welcomeMessage.color"),background:w.value,lineHeight:b.configDesignClass.getKey("settings.lineHeight"),fontSize:b.configDesignClass.getKey("sections.inside.welcomeMessage.fontSize")+"px",letterSpacing:b.configDesignClass.getKey("settings.letterSpacing")+"px",border:`${b.configDesignClass.getKey("sections.inside.welcomeMessage.borderWidth")}px solid ${b.configDesignClass.getKey("sections.inside.welcomeMessage.borderColor")}`})},[l.createElementVNode("div",{innerHTML:l.unref(wn)(b.configDesignClass.getKey("texts.welcomeMessage"))},null,8,Md)],6)],6)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(y,C)=>{var k;return l.openBlock(),l.createElementBlock(l.Fragment,{key:C},[y.snippet?(l.openBlock(),l.createBlock(Bd,{key:0,structure:l.unref(Td),data:y.snippet.data,message:y,configDesignClass:b.configDesignClass,onAction:v[0]||(v[0]=(x,R)=>n("handleSnippetAction",x,R))},null,8,["structure","data","message","configDesignClass"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.isUser?pd:y.isSystem?b.isProduction&&o.value!=="steps"?li:_d:dd),{key:1,message:y,"data-component":y.isSystem?b.isProduction&&o.value!=="steps"?"LoadingMessage":"MessageSystem":"MessageBot",style:l.normalizeStyle({borderRadius:p(y.isUser),"margin-top":`${(k=c.value[C-1])!=null&&k.isSystem&&!y.isSystem?"12px":"0px"}`,"margin-bottom":`${y.isSystem?"2px":b.configDesignClass.getKey("settings.gapMessageLine")+"px"}`,lineHeight:b.configDesignClass.getKey("settings.lineHeight"),letterSpacing:b.configDesignClass.getKey("settings.letterSpacing")+"px"}),loader:b.configDesignClass.getKey("settings.loader"),color:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.color"):b.configDesignClass.getKey("sections.inside.messageBot.color"),welcomeColor:b.configDesignClass.getKey("sections.inside.messageUser.color"),bgType:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.bgType"):b.configDesignClass.getKey("sections.inside.messageBot.bgType"),bgColor:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.bgColor"):b.configDesignClass.getKey("sections.inside.messageBot.bgColor"),size:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.size"):b.configDesignClass.getKey("sections.inside.messageBot.size"),fontSize:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.fontSize"):b.configDesignClass.getKey("sections.inside.messageBot.fontSize"),borderWidth:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.borderWidth"):b.configDesignClass.getKey("sections.inside.messageBot.borderWidth"),borderColor:y.isUser?b.configDesignClass.getKey("sections.inside.messageUser.borderColor"):b.configDesignClass.getKey("sections.inside.messageBot.borderColor"),index:C,isProduction:b.isProduction||!1,loadingTime:y.isUser?0:m(y),traceLastShown:b.traceLastShown,configDesignClass:b.configDesignClass,ttsUrl:b.ttsUrl,activeMessage:b.activeMessage===y,isLast:C===c.value.length-1,onClick:x=>i(y)},null,8,["message","data-component","style","loader","color","welcomeColor","bgType","bgColor","size","fontSize","borderWidth","borderColor","index","isProduction","loadingTime","traceLastShown","configDesignClass","ttsUrl","activeMessage","isLast","onClick"]))],64)}),128)),b.isLoading?(l.openBlock(),l.createBlock(li,{key:1,class:l.normalizeClass({"tw:mt-8":b.traceLastShown}),isProduction:b.isProduction||!1,loader:b.configDesignClass.getKey("settings.loader"),configDesignClass:b.configDesignClass,color:a.value.headerText,bgColor:a.value.headerFillColor,text:b.configDesignClass.getKey("texts.typingLoader")},null,8,["class","isProduction","loader","configDesignClass","color","bgColor","text"])):l.createCommentVNode("",!0),l.renderSlot(b.$slots,"footer")],544))}}),Ad=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","handleSnippetAction"],setup(r,{emit:e}){const t=r,s=l.computed(()=>t.ttsUrl),n=e,i=l.computed({get:()=>t.activeMessage,set:o=>n("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:(o.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingRight:(o.configDesignClass.getKey("sections.inside.params.sidePadding")??8)+"px",paddingTop:(o.configDesignClass.getKey("sections.inside.params.verticalPadding")??8)/2+"px"}])},[l.createVNode(Ed,{messages:o.messages,isPreview:o.isPreview,isEmbedded:o.isEmbedded,configDesignClass:o.configDesignClass,isLoading:o.isLoading,isStreaming:o.isStreaming,isProduction:o.isProduction,sectionBorderRadius:o.sectionBorderRadius,showWelcome:o.showWelcome,ttsUrl:s.value,activeMessage:i.value,"onUpdate:activeMessage":a[0]||(a[0]=c=>i.value=c),traceLastShown:o.traceLastShown,onHandleClickMessage:a[1]||(a[1]=c=>o.$emit("handleClickMessage",c)),onHandleSnippetAction:a[2]||(a[2]=(c,u)=>n("handleSnippetAction",c,u))},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","ttsUrl","activeMessage","traceLastShown"])],4))}}),Pd={key:0,class:"chat tw:w-full tw:h-full tw:flex tw:pt-0 tw:relative",style:{overflow:"hidden"}},Vd={key:0,class:"tw:w-full tw:h-full"},Dd={key:1,class:"messages tw:transition-all tw:flex tw:flex-col tw:justify-between tw:w-full"},$d="https://hs-generator.onrender.com/api/transcribe",Ld="https://hs-generator.onrender.com/api/tts",is=0,Id=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(r,{expose:e,emit:t}){const s=t,n=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),h=l.ref(!0),f=l.ref(!1),g=l.ref(!1),w=l.ref(!1),p=l.ref(0),m=l.ref(!1),b=l.ref(null),v=r,y=async()=>{if(!(v.isPreview||v.scenario))try{s("restart-chat"),Ho(),await _s()}catch(S){console.error("Failed to restart chat connection",S)}},C=l.computed(()=>{const S=P.value.getKey("settings.position"),B=P.value.getKey("settings.offset.x"),E=P.value.getKey("settings.offset.y"),O=j.value?P.value.getKey("settings.size.width"):P.value.getKey("sections.colapsed.width"),Y=j.value?P.value.getKey("settings.size.height"):P.value.getKey("sections.colapsed.height");return{...{...S==="topLeft"?{top:E+"px",left:B+"px"}:{},...S==="topRight"?{top:E+"px",right:B+"px"}:{},...S==="bottomLeft"?{bottom:E+"px",left:B+"px"}:{},...S==="bottomRight"?{bottom:E+"px",right:B+"px"}:{},...S==="top"?{top:E+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="bottom"?{bottom:E+"px",left:"50%",transform:"translateX(-50%)"}:{},...S==="left"?{left:B+"px",top:"50%",transform:"translateY(-50%)"}:{},...S==="right"?{right:B+"px",top:"50%",transform:"translateY(-50%)"}:{}},width:j.value&&!ne.value?O+"px":void 0,height:j.value||ne.value?Y+"px":void 0}}),k=()=>{if(v.configLink)return v.configLink;const B=new URLSearchParams(window.location.search).get("config");if(B)return B},x=l.ref(null),R=l.ref(null),T=l.ref(null),z=()=>T.value?T.value:k()?R.value&&typeof R.value=="object"?R.value:U:v.configWidget?v.configWidget:U,A=l.shallowRef(U);l.watchEffect(async S=>{const B=z();let E=!1;S(()=>{E=!0}),console.log("test");const O=await Lc(B,{verbose:!0});if(E)return;const Y=O??B,{isValid:fe,errors:Se}=Ic(Y);if(console.log(Y),!fe){console.warn("[HSW] Invalid widget config (after migration), falling back to DEFAULT_CONFIG:",Se),A.value=U;return}A.value=Y});const M=S=>{x.value=S,s("choose-trace",{action:S.type,messages:[S]})},I=async()=>{s("choose-trace",{action:"copyAll",messages:te.value})},F=async()=>{if(te.value.length===0){s("choose-trace",{action:"copyLast",messages:[]});return}let S=-1;for(let E=te.value.length-1;E>=0;E--)if(te.value[E].isUser){S=E;break}const B=S>=0?S:0;s("choose-trace",{action:"copyLast",messages:te.value.slice(B)})},J=async S=>{switch(S.action){case"copyLast":await F();break;case"copyIteration":await F();break;case"copyAll":await I();break}},P=l.computed(()=>new Oc(A.value)),H=l.computed(()=>ki(P.value)),q=l.computed(()=>hs(P.value,8)),V=l.computed(()=>P.value.getConfig().settings.container),_=l.computed(()=>{const S=V.value;if(!S)return!1;const B=S.innerBorder,E=S.outerBorder;return((B==null?void 0:B.width)??0)>0||((E==null?void 0:E.width)??0)>0?(B==null?void 0:B.width)!==0||(E==null?void 0:E.width)!==0:!1}),N=l.computed(()=>{var Jt,L,xr,_r,Sr,Tr;const S=V.value,B=P.value.getKey("settings.bgChat"),E=S==null?void 0:S.gradient,O=E?`linear-gradient(360deg, ${B} 78.99%, ${E} 100%)`:"",Y=typeof E=="string"&&E.trim()&&E!=="transparent"?O:B,fe=((Jt=S==null?void 0:S.innerBorder)==null?void 0:Jt.width)??0,Se=((L=S==null?void 0:S.innerBorder)==null?void 0:L.color)??"transparent",Te=((xr=S==null?void 0:S.innerBorder)==null?void 0:xr.style)??"solid",Vt=((_r=S==null?void 0:S.outerBorder)==null?void 0:_r.width)??0,Ss=((Sr=S==null?void 0:S.outerBorder)==null?void 0:Sr.color)??"transparent",Ts=((Tr=S==null?void 0:S.outerBorder)==null?void 0:Tr.style)??"solid",He={background:Y,borderRadius:`${String(H.value)}px`};return He["--hsw-container-radius"]=`${String(H.value)}px`,He["--hsw-container-inner-width"]=`${fe}px`,He["--hsw-container-inner-color"]=Se,He["--hsw-container-inner-style"]=Te,He["--hsw-container-outer-width"]=`${Vt}px`,He["--hsw-container-outer-color"]=Ss,He["--hsw-container-outer-style"]=Ts,He}),de=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]"}}),j=l.ref(!0),re=()=>{const S=o.value;if(!S)return{width:56,height:56};const B=S.querySelector(".chat-action");if(!B)return{width:56,height:56};const E=B.getBoundingClientRect();return{width:Math.max(1,E.width),height:Math.max(1,E.height)}},ee=l.ref(!1),_e=async S=>{if(ee.value)return;ee.value=!0;const B=o.value;if(!B||S===j.value)return;const E=B.querySelector(".chatWrapper"),O=E==null?void 0:E.querySelector(".chat");if(S){const Y=B.querySelector(".chat-collapsed");Y&&(X.killTweensOf(Y),X.to(Y,{opacity:1,duration:.15,ease:"power2.in"}));const{height:fe,width:Se}=re();await new Promise(Vt=>setTimeout(Vt,150)),j.value=!0,await l.nextTick();const Te=Math.max(fe||0,Se||0)||56;X.killTweensOf(B),O&&X.killTweensOf(O),E&&X.killTweensOf(E),X.set(B,{width:Te,height:Te,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),E&&X.set(E,{opacity:0,willChange:"opacity"}),O&&X.set(O,{opacity:0,willChange:"opacity"}),X.set(B,{width:Te,height:Te,overflow:"hidden",opacity:0,willChange:"width, height, opacity"}),X.to(B,{width:P.value.getKey("settings.size.width"),height:P.value.getKey("settings.size.height"),opacity:1,duration:.4,ease:"power2.out",onComplete:()=>{X.set(B,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange,opacity"}),ee.value=!1}}),E&&X.to(E,{opacity:1,duration:.3,delay:.35,ease:"power2.out",onComplete:()=>{X.set(E,{clearProps:"willChange,opacity"})}}),O&&X.to(O,{opacity:1,duration:.3,delay:.15,ease:"power2.out",onComplete:()=>{X.set(O,{clearProps:"willChange"})}})}else{const Y=P.value.getKey("sections.colapsed.height")+P.value.getKey("sections.colapsed.borderWidth")*2;X.killTweensOf(B),O&&X.killTweensOf(O),E&&X.killTweensOf(E),X.set(B,{width:P.value.getKey("settings.size.width"),height:P.value.getKey("settings.size.height"),overflow:"hidden",willChange:"width, height, opacity"}),E&&(X.set(E,{willChange:"opacity"}),X.to(E,{opacity:0,duration:.5,ease:"power3.inOut",onComplete:()=>{X.set(E,{clearProps:"willChange,opacity"})}})),O&&(X.set(O,{willChange:"opacity"}),X.to(O,{opacity:0,duration:.2,ease:"power2.in",onComplete:()=>{X.set(O,{clearProps:"willChange"})}})),X.to(B,{width:Y,height:Y,opacity:0,duration:.35,marginTop:0,ease:"power2.inOut",onComplete:()=>{j.value=!1,l.nextTick().then(()=>{const fe=B.querySelector(".chat-collapsed");fe&&(X.set(fe,{opacity:0}),X.to(fe,{opacity:1,duration:.25,ease:"power2.out"})),X.set(B,{opacity:1})}),X.set(B,{clearProps:"overflow,position,left,top,xPercent,yPercent,marginTop,willChange"}),ee.value=!1}})}},We=l.ref(v.isPreview||!1),ne=l.ref(v.isEmbedded||!1);l.watch(()=>v.isEmbedded,S=>{ne.value=S});const xs=l.ref(!!v.isPreview),Ue=l.ref(v.widgetId||`hsw-${Math.random().toString(36).slice(2,10)}`),te=l.ref([]),Xe=l.ref("");let oe=null,vt=0;const Fo=l.computed(()=>te.value.length>0&&te.value[te.value.length-1].isUser===!0||c.value),Xs=l.ref(null),Wo=(S,B)=>{console.log("handleSnippetAction",S,B),br({action:{sequence:B,command:S,data:{}}})},Oe=S=>{var B;if(S.chunkId&&S.text){const E=te.value[te.value.length-1];E.chunkId===S.chunkId?((B=S.chunk)!=null&&B.start?E.text="":E.text+=S.text,E.chunk.start=!1):te.value.push(S)}else te.value.push(S)},Qt=(()=>{if(v.link)return v.link;const B=new URLSearchParams(window.location.search).get("link");if(B)return B;const O=new URLSearchParams(window.location.hash.substring(1)).get("link");if(O)return O;try{const Y="ws://localhost:8080/client/widget-chat/v1/ws/?token=T5JFw1oz4SNp6XVjv3nc8CU6X3oQ3wi-WZpRmCeWIQ7n8aLwLF_Om6bGDAP1DKr3Qzfu3r6z1IsNIg19cO0yl9rZQeW9ZlHGztdcUKTnukc-QFGJaHk7yEE0K7P4ofUqKaQZLnHqAGA7c4MLizAQpHM2KWo";if(Y)return Y}catch(Y){console.warn("Environment variables not available:",Y)}return console.log("Using fallback link: ws://localhost:3000"),"ws://localhost:3000"})(),wr=()=>{if(vt>=is){Oe({text:`Failed to connect after ${is} attempts. Please check your connection.`,isUser:!1});return}vt++,console.log(`Reconnection attempt ${vt}/${is}`),setTimeout(()=>{Ys()},2e3*vt)},Uo=()=>{Oe({text:Mo.UserMessage,isUser:!0}),Oe({text:"{Agent response message}",isUser:!1})},Ys=()=>{try{if(!Qt||typeof Qt!="string"){console.error("Invalid WebSocket link:",Qt),Oe({text:"Error: Invalid WebSocket URL",isUser:!1});return}if(console.log("Attempting to connect to:",Qt),oe=new WebSocket(Qt),!oe){console.error("Failed to create WebSocket instance");return}oe.onmessage=S=>{var B,E,O,Y,fe,Se,Te,Vt,Ss,Ts,He,Jt;try{const L=JSON.parse(S.data);if(L.snippet)return Oe({snippet:{...L.snippet,data:JSON.parse(L.snippet.data||"{}")},isUser:!1,isSystem:!0,isError:!1});if(L.error)return Oe({text:L.error.message,isUser:!1,isSystem:!0,isError:!0});if((B=L==null?void 0:L.textChunk)!=null&&B.start&&(m.value=!0,b.value=(E=L==null?void 0:L.textChunk)==null?void 0:E.start,Oe({text:"",isUser:!1,chunkId:(O=L==null?void 0:L.textChunk)==null?void 0:O.start,time:(Y=L==null?void 0:L.textChunk)!=null&&Y.time?(fe=L==null?void 0:L.textChunk)==null?void 0:fe.time:new Date().toISOString(),chunk:L==null?void 0:L.textChunk})),(Se=L==null?void 0:L.textChunk)!=null&&Se.end||(Te=L==null?void 0:L.textChunk)!=null&&Te.start){(Vt=L==null?void 0:L.textChunk)!=null&&Vt.end&&b.value&&((Ss=L==null?void 0:L.textChunk)==null?void 0:Ss.end)===b.value&&(m.value=!1,b.value=null);return}(Ts=L==null?void 0:L.textChunk)!=null&&Ts.text&&Oe({text:L.textChunk.text,isUser:!1,chunkId:(He=L==null?void 0:L.textChunk)==null?void 0:He.id}),L!=null&&L.trace&&Oe({text:L.trace.message,isUser:!1,isSystem:!0,meta:L.trace.meta,time:L.trace.time,type:L.trace.type}),(Jt=L==null?void 0:L.trace)!=null&&Jt.meta&&!v.isProduction&&s("trace",{action:L.trace.type,messages:[L.trace]})}catch(L){console.error("Error parsing WebSocket message:",L),Oe({text:"Error: Failed to parse server response",isUser:!1})}},oe.onopen=()=>{vt=0},oe.onclose=S=>{console.log("Connection closed",S);let B=`Connection closed (${S.code})`;switch(S.code){case 1e3:B="Connection closed normally";break;case 1001:B="Connection closed: going away";break;case 1006:if(d.value=!0,vt<is&&!We.value){wr();return}break;case 1011:B="Connection closed: server error";break;default:u.value=!0}console.log(B)},oe.onerror=S=>{console.error("WebSocket connection error:",S),a.value=!0,Oe({text:"Connection error: Unable to connect to chat server",isUser:!1,isSystem:!0,isError:!0}),vt<is&&!We.value&&wr()}}catch(S){console.error("Error connecting to socket server:",S),Oe({text:`Connection error: ${S instanceof Error?S.message:"Unknown error"}`,isUser:!1,isSystem:!0,isError:!0})}},Ho=()=>{oe&&oe.close(),oe=null};l.onUnmounted(()=>{oe&&oe.close()});const Qs=S=>{(v.isPreview||v.scenario)&&!S||_e(!j.value)},jo=()=>{if(!(v.isPreview||v.scenario)&&Xe.value.trim()!==""){if(v.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,br({message:Xe.value}),Xe.value=""}},br=S=>{oe&&oe.send(JSON.stringify(S))},yr=()=>{try{const S=P.value.getKey("settings.fontFamily")||"MacPaw Fixel",B=`https://fonts.googleapis.com/css2?family=${S.replace(/\s+/g,"+")}:wght@300;400;500;600;700&display=swap`,E=document.createElement("link");E.rel="preload",E.as="style",E.href=B,document.head.appendChild(E);const O=document.createElement("link");O.rel="stylesheet",O.href=B,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)}},vr=()=>{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"),()=>{yr()}),l.watch(()=>P.value.getKey("settings.fontWeight"),()=>{vr()});const Go=async()=>{if(k()){const B=await(await fetch(k()+"config")).json();R.value=B,n.value=!0}else n.value=!0},Js=(S,B,E)=>new Promise(O=>{const Y=performance.now(),fe=Se=>{const Te=Math.min(1,(Se-Y)/E);p.value=S+(B-S)*Te,Te<1?requestAnimationFrame(fe):O()};requestAnimationFrame(fe)}),Cr=async S=>{w.value=!0,p.value=0,await l.nextTick(),await Js(0,.3,500),S(),await Js(.3,.6,200),p.value=.6,await new Promise(B=>setTimeout(B,100)),await Js(.6,0,500),w.value=!1},qo=async(S=25)=>{const B=te.value.filter(O=>!O.isUser&&!O.isSystem&&O.text);if(!B.length)return;const E=B.map(O=>O.text||"");B.forEach(O=>O.text="");for(let O=0;O<B.length;O++){const Y=B[O],fe=E[O];for(let Se=0;Se<fe.length;Se++)Y.text=fe.slice(0,Se+1),await new Promise(Te=>setTimeout(Te,S))}},en=async(S,B)=>{await Cr(()=>{const E=ti.getState(S,P.value,B||v.scenarioOptions);if(j.value=E.isChatOpen,te.value=E.messages,c.value=E.traceLastShown,a.value=E.isConnectionError,u.value=E.isProcessError,d.value=E.isReconnectError,f.value=E.isInputDisabled,h.value=E.showWelcome,g.value=E.showReconnectNotice??!1,Xs.value=E.snippet??null,We.value=!0,oe){try{oe.close()}catch{}oe=null}}),qo()},_s=async()=>{await Cr(()=>{We.value=xs.value,h.value=!0,f.value=!1,g.value=!1,a.value=!1,u.value=!1,d.value=!1,te.value=[],We.value||(!oe||oe.readyState!==1)&&Ys()})};l.onBeforeMount(async()=>{await Go()}),l.onMounted(async()=>{yr(),vr();const S=v.scenario??ti.getScenarioFromUrl();if(S){await en(S);return}if(v.isPreview){Uo();return}Ys()}),l.watch(()=>v.scenario,async S=>{S?await en(S):await _s()});const Ae={id:Ue,setScenario:async(S,B)=>{await en(S,B)},clearScenario:async()=>{await _s()},toggleChat:()=>{Qs(!0)},setOpen:S=>{j.value=S},setActive:S=>{S&&!j.value&&(j.value=!0)},setInputDisabled:S=>{f.value=S},setShowReconnectNotice:S=>{g.value=S},setMessages:S=>{te.value=Array.isArray(S)?S:[]},pushMessage:S=>{te.value.push(S)},setSnippet:S=>{Xs.value=S??null},resetToLive:async()=>{await _s()},setConfig:S=>{T.value=JSON.parse(JSON.stringify(S))},getConfig:()=>A.value},Zo=()=>{const S=window;S.hswWidgets=S.hswWidgets||{},S.hswWidgets[Ue.value]=Ae,window.dispatchEvent(new CustomEvent("hsw:ready",{detail:{widgetId:Ue.value}}))},Xo=()=>{const S=window;S.hswWidgets&&S.hswWidgets[Ue.value]&&delete S.hswWidgets[Ue.value]},kr=async S=>{var Y;const B=S,E=(Y=B.detail)==null?void 0:Y.widgetId;if(E&&E!==Ue.value)return;const{action:O}=B.detail;switch(O){case"setScenario":await Ae.setScenario(B.detail.payload.type,B.detail.payload.options);break;case"clearScenario":await Ae.clearScenario();break;case"setOpen":Ae.setOpen(B.detail.payload);break;case"setActive":Ae.setActive(B.detail.payload);break;case"setInputDisabled":Ae.setInputDisabled(B.detail.payload);break;case"setShowReconnectNotice":Ae.setShowReconnectNotice(B.detail.payload);break;case"setMessages":Ae.setMessages(B.detail.payload);break;case"pushMessage":Ae.pushMessage(B.detail.payload);break;case"setSnippet":Ae.setSnippet(B.detail.payload);break;case"resetToLive":await Ae.resetToLive();break;case"setConfig":Ae.setConfig(B.detail.payload);break}};return l.onMounted(()=>{Zo(),window.addEventListener("hsw:control",kr)}),l.onUnmounted(()=>{Xo(),window.removeEventListener("hsw:control",kr)}),e(Ae),(S,B)=>n.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":!ne.value,"tw:w-full":j.value}]),style:l.normalizeStyle({letterSpacing:P.value.getKey("settings.letterSpacing")+"px",...C.value}),ref_key:"chatWrapperRef",ref:o},[l.withDirectives(l.createVNode(uc,{toggleChat:Qs,element:P.value.getKeyObject("sections.colapsed")},null,8,["element"]),[[l.vShow,!j.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":_.value,"tw:h-auto tw:shadow-2xl chat-active":j.value,"tw:shadow-lg tw:w-fit":!j.value,"chat-embedded tw:w-full tw:h-full tw:static tw:top-0 tw:left-0":ne.value}]]),style:l.normalizeStyle(N.value)},[l.createVNode(Zc,{isChatOpen:j.value,toggleChat:Qs,configDesignClass:P.value,sectionBorderRadius:q.value,mainBorderRadius:H.value,isPreview:We.value,isEmbedded:ne.value,isProduction:S.isProduction||!1,restartChat:y},null,8,["isChatOpen","configDesignClass","sectionBorderRadius","mainBorderRadius","isPreview","isEmbedded","isProduction"]),j.value?(l.openBlock(),l.createElementBlock("div",Pd,[a.value?(l.openBlock(),l.createElementBlock("div",Vd,[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(bn,{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:y},null,8,["headlineText","descriptionText","warningElement","configDesignClass","isProcessError"])],4)])):(l.openBlock(),l.createElementBlock("div",Dd,[l.createVNode(Ad,{messages:te.value,isPreview:We.value,isEmbedded:ne.value,configDesignClass:P.value,isLoading:Fo.value,isStreaming:m.value,isProduction:S.isProduction,sectionBorderRadius:q.value,showWelcome:h.value,ttsUrl:Ld,activeMessage:x.value,"onUpdate:activeMessage":B[0]||(B[0]=E=>x.value=E),isProcessError:u.value,snippet:Xs.value,traceLastShown:c.value,onHandleClickMessage:M,onHandleSnippetAction:Wo,restartChat:y},null,8,["messages","isPreview","isEmbedded","configDesignClass","isLoading","isStreaming","isProduction","sectionBorderRadius","showWelcome","activeMessage","isProcessError","snippet","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(bn,{type:"connectionIssue",headlineText:P.value.getKey("texts.issueText"),configDesignClass:P.value,warningElement:P.value.getKeyObject("sections.warnings.connectionIssue"),restartChat:y},null,8,["headlineText","configDesignClass","warningElement"])],4)):(l.openBlock(),l.createBlock(cu,{key:1,messageText:Xe.value,"onUpdate:messageText":B[1]||(B[1]=E=>Xe.value=E),isPreview:We.value,isProduction:S.isProduction||!1,configDesignClass:P.value,sectionBorderRadius:q.value,classSize:de.value,sendMessage:jo,isInputDisabled:f.value,showReconnectNotice:g.value,restartChat:y,isStreaming:m.value,mainBorderRadius:H.value,transcribeUrl:$d,onTrace:J},null,8,["messageText","isPreview","isProduction","configDesignClass","sectionBorderRadius","classSize","isInputDisabled","showReconnectNotice","isStreaming","mainBorderRadius"]))]))])):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(H.value)}px`,backgroundColor:`rgba(0,0,0, ${p.value})`})},null,4)):l.createCommentVNode("",!0)]),_:1})],6),[[l.vShow,i.value&&j.value]])],6)):l.createCommentVNode("",!0)}}),nt=r=>{const e=window,t=r||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]},Od=async(r,e,t)=>nt(t).setScenario(r,e),Nd=async r=>nt(r).clearScenario(),Kd=(r,e)=>nt(e).setOpen(r),Fd=(r,e)=>nt(e).setActive(r),Wd=(r,e)=>nt(e).setInputDisabled(r),Ud=(r,e)=>nt(e).setShowReconnectNotice(r),Hd=(r,e)=>nt(e).setMessages(r),jd=(r,e)=>nt(e).pushMessage(r),Gd=(r,e)=>nt(e).setSnippet(r),qd=async r=>nt(r).resetToLive();exports.ChatWrapper=Id;exports.clearScenario=Nd;exports.cn=Kn;exports.pushMessage=jd;exports.resetToLive=qd;exports.setActive=Fd;exports.setInputDisabled=Wd;exports.setMessages=Hd;exports.setOpen=Kd;exports.setScenario=Od;exports.setShowReconnectNotice=Ud;exports.setSnippet=Gd;
|
|
102
|
+
`}tablerow({text:n}){return`<tr>
|
|
103
|
+
${n}</tr>
|
|
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;
|