@inploi/plugin-chatbot 3.29.0 → 3.31.0

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/cdn/index.js CHANGED
@@ -1,45 +1,5 @@
1
- var Km=Object.defineProperty;var Gm=(Qe,_e,Pe)=>_e in Qe?Km(Qe,_e,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Qe[_e]=Pe;var Zs=(Qe,_e,Pe)=>(Gm(Qe,typeof _e!="symbol"?_e+"":_e,Pe),Pe);(function(){"use strict";var Qe=e=>e,_e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js=Array.isArray,Zr=Js,Qs=typeof _e=="object"&&_e&&_e.Object===Object&&_e,ec=Qs,tc=ec,rc=typeof self=="object"&&self&&self.Object===Object&&self,nc=tc||rc||Function("return this")(),Jr=nc,oc=Jr,ic=oc.Symbol,Qr=ic,xo=Qr,ko=Object.prototype,ac=ko.hasOwnProperty,sc=ko.toString,Nt=xo?xo.toStringTag:void 0;function cc(e){var t=ac.call(e,Nt),r=e[Nt];try{e[Nt]=void 0;var n=!0}catch{}var o=sc.call(e);return n&&(t?e[Nt]=r:delete e[Nt]),o}var lc=cc,uc=Object.prototype,dc=uc.toString;function fc(e){return dc.call(e)}var hc=fc,$o=Qr,pc=lc,vc=hc,mc="[object Null]",gc="[object Undefined]",So=$o?$o.toStringTag:void 0;function bc(e){return e==null?e===void 0?gc:mc:So&&So in Object(e)?pc(e):vc(e)}var Co=bc;function yc(e){return e!=null&&typeof e=="object"}var _c=yc,wc=Co,xc=_c,kc="[object Symbol]";function $c(e){return typeof e=="symbol"||xc(e)&&wc(e)==kc}var en=$c,Sc=Zr,Cc=en,Ec=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tc=/^\w*$/;function Oc(e,t){if(Sc(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Cc(e)?!0:Tc.test(e)||!Ec.test(e)||t!=null&&e in Object(t)}var Ic=Oc;function Ac(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Eo=Ac,Pc=Co,Nc=Eo,Dc="[object AsyncFunction]",Mc="[object Function]",Fc="[object GeneratorFunction]",Lc="[object Proxy]";function Rc(e){if(!Nc(e))return!1;var t=Pc(e);return t==Mc||t==Fc||t==Dc||t==Lc}var jc=Rc,Vc=Jr,Bc=Vc["__core-js_shared__"],zc=Bc,tn=zc,To=function(){var e=/[^.]+$/.exec(tn&&tn.keys&&tn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Uc(e){return!!To&&To in e}var Hc=Uc,qc=Function.prototype,Wc=qc.toString;function Kc(e){if(e!=null){try{return Wc.call(e)}catch{}try{return e+""}catch{}}return""}var Gc=Kc,Yc=jc,Xc=Hc,Zc=Eo,Jc=Gc,Qc=/[\\^$.*+?()[\]{}|]/g,el=/^\[object .+?Constructor\]$/,tl=Function.prototype,rl=Object.prototype,nl=tl.toString,ol=rl.hasOwnProperty,il=RegExp("^"+nl.call(ol).replace(Qc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function al(e){if(!Zc(e)||Xc(e))return!1;var t=Yc(e)?il:el;return t.test(Jc(e))}var sl=al;function cl(e,t){return e==null?void 0:e[t]}var ll=cl,ul=sl,dl=ll;function fl(e,t){var r=dl(e,t);return ul(r)?r:void 0}var Oo=fl,hl=Oo,pl=hl(Object,"create"),nr=pl,Io=nr;function vl(){this.__data__=Io?Io(null):{},this.size=0}var ml=vl;function gl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var bl=gl,yl=nr,_l="__lodash_hash_undefined__",wl=Object.prototype,xl=wl.hasOwnProperty;function kl(e){var t=this.__data__;if(yl){var r=t[e];return r===_l?void 0:r}return xl.call(t,e)?t[e]:void 0}var $l=kl,Sl=nr,Cl=Object.prototype,El=Cl.hasOwnProperty;function Tl(e){var t=this.__data__;return Sl?t[e]!==void 0:El.call(t,e)}var Ol=Tl,Il=nr,Al="__lodash_hash_undefined__";function Pl(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Il&&t===void 0?Al:t,this}var Nl=Pl,Dl=ml,Ml=bl,Fl=$l,Ll=Ol,Rl=Nl;function ht(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ht.prototype.clear=Dl,ht.prototype.delete=Ml,ht.prototype.get=Fl,ht.prototype.has=Ll,ht.prototype.set=Rl;var jl=ht;function Vl(){this.__data__=[],this.size=0}var Bl=Vl;function zl(e,t){return e===t||e!==e&&t!==t}var Ul=zl,Hl=Ul;function ql(e,t){for(var r=e.length;r--;)if(Hl(e[r][0],t))return r;return-1}var or=ql,Wl=or,Kl=Array.prototype,Gl=Kl.splice;function Yl(e){var t=this.__data__,r=Wl(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Gl.call(t,r,1),--this.size,!0}var Xl=Yl,Zl=or;function Jl(e){var t=this.__data__,r=Zl(t,e);return r<0?void 0:t[r][1]}var Ql=Jl,eu=or;function tu(e){return eu(this.__data__,e)>-1}var ru=tu,nu=or;function ou(e,t){var r=this.__data__,n=nu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var iu=ou,au=Bl,su=Xl,cu=Ql,lu=ru,uu=iu;function pt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}pt.prototype.clear=au,pt.prototype.delete=su,pt.prototype.get=cu,pt.prototype.has=lu,pt.prototype.set=uu;var du=pt,fu=Oo,hu=Jr,pu=fu(hu,"Map"),vu=pu,Ao=jl,mu=du,gu=vu;function bu(){this.size=0,this.__data__={hash:new Ao,map:new(gu||mu),string:new Ao}}var yu=bu;function _u(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var wu=_u,xu=wu;function ku(e,t){var r=e.__data__;return xu(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ir=ku,$u=ir;function Su(e){var t=$u(this,e).delete(e);return this.size-=t?1:0,t}var Cu=Su,Eu=ir;function Tu(e){return Eu(this,e).get(e)}var Ou=Tu,Iu=ir;function Au(e){return Iu(this,e).has(e)}var Pu=Au,Nu=ir;function Du(e,t){var r=Nu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Mu=Du,Fu=yu,Lu=Cu,Ru=Ou,ju=Pu,Vu=Mu;function vt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}vt.prototype.clear=Fu,vt.prototype.delete=Lu,vt.prototype.get=Ru,vt.prototype.has=ju,vt.prototype.set=Vu;var Bu=vt,Po=Bu,zu="Expected a function";function rn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(zu);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(rn.Cache||Po),r}rn.Cache=Po;var Uu=rn,Hu=Uu,qu=500;function Wu(e){var t=Hu(e,function(n){return r.size===qu&&r.clear(),n}),r=t.cache;return t}var Ku=Wu,Gu=Ku,Yu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xu=/\\(\\)?/g,Zu=Gu(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Yu,function(r,n,o,i){t.push(o?i.replace(Xu,"$1"):n||r)}),t}),Ju=Zu;function Qu(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var ed=Qu,No=Qr,td=ed,rd=Zr,nd=en,od=1/0,Do=No?No.prototype:void 0,Mo=Do?Do.toString:void 0;function Fo(e){if(typeof e=="string")return e;if(rd(e))return td(e,Fo)+"";if(nd(e))return Mo?Mo.call(e):"";var t=e+"";return t=="0"&&1/e==-od?"-0":t}var id=Fo,ad=id;function sd(e){return e==null?"":ad(e)}var cd=sd,ld=Zr,ud=Ic,dd=Ju,fd=cd;function hd(e,t){return ld(e)?e:ud(e,t)?[e]:dd(fd(e))}var pd=hd,vd=en,md=1/0;function gd(e){if(typeof e=="string"||vd(e))return e;var t=e+"";return t=="0"&&1/e==-md?"-0":t}var bd=gd,yd=pd,_d=bd;function wd(e,t){t=yd(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[_d(t[r++])];return r&&r==n?e:void 0}var xd=wd,kd=xd;function $d(e,t,r){var n=e==null?void 0:kd(e,t);return n===void 0?r:n}var Sd=$d;const Dt=Pe(Sd);var Mt,S,Lo,Ro,et,jo,Vo,nn,Bo,mt={},zo=[],Cd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ar=Array.isArray;function Ne(e,t){for(var r in t)e[r]=t[r];return e}function Uo(e){var t=e.parentNode;t&&t.removeChild(e)}function D(e,t,r){var n,o,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Mt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Ft(e,a,n,o,null)}function Ft(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++Lo};return o==null&&S.vnode!=null&&S.vnode(i),i}function Ho(){return{current:null}}function Y(e){return e.children}function we(e,t){this.props=e,this.context=t}function sr(e,t){if(t==null)return e.__?sr(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?sr(e):null}function qo(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return qo(e)}}function on(e){(!e.__d&&(e.__d=!0)&&et.push(e)&&!cr.__r++||jo!==S.debounceRendering)&&((jo=S.debounceRendering)||Vo)(cr)}function cr(){var e,t,r,n,o,i,a,s,c;for(et.sort(nn);e=et.shift();)e.__d&&(t=et.length,n=void 0,o=void 0,i=void 0,s=(a=(r=e).__v).__e,(c=r.__P)&&(n=[],o=[],(i=Ne({},a)).__v=a.__v+1,an(c,a,i,r.__n,c.ownerSVGElement!==void 0,a.__h!=null?[s]:null,n,s??sr(a),a.__h,o),Jo(n,a,o),a.__e!=s&&qo(a)),et.length>t&&et.sort(nn));cr.__r=0}function Wo(e,t,r,n,o,i,a,s,c,u,f){var l,p,m,g,v,_,x,w,T,I,O=0,H=n&&n.__k||zo,W=H.length,M=W,F=t.length;for(r.__k=[],l=0;l<F;l++)(g=r.__k[l]=(g=t[l])==null||typeof g=="boolean"||typeof g=="function"?null:typeof g=="string"||typeof g=="number"||typeof g=="bigint"?Ft(null,g,null,null,g):ar(g)?Ft(Y,{children:g},null,null,null):g.__b>0?Ft(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)!=null&&(g.__=r,g.__b=r.__b+1,(w=Ed(g,H,x=l+O,M))===-1?m=mt:(m=H[w]||mt,H[w]=void 0,M--),an(e,g,m,o,i,a,s,c,u,f),v=g.__e,(p=g.ref)&&m.ref!=p&&(m.ref&&sn(m.ref,null,g),f.push(p,g.__c||v,g)),v!=null&&(_==null&&(_=v),I=!(T=m===mt||m.__v===null)&&w===x,T?w==-1&&O--:w!==x&&(w===x+1?(O++,I=!0):w>x?M>F-x?(O+=w-x,I=!0):O--:O=w<x&&w==x-1?w-x:0),x=l+O,I=I||w==l&&!T,typeof g.type!="function"||w===x&&m.__k!==g.__k?typeof g.type=="function"||I?g.__d!==void 0?(c=g.__d,g.__d=void 0):c=v.nextSibling:c=Go(e,v,c):c=Ko(g,c,e),typeof r.type=="function"&&(r.__d=c)));for(r.__e=_,l=W;l--;)H[l]!=null&&(typeof r.type=="function"&&H[l].__e!=null&&H[l].__e==r.__d&&(r.__d=H[l].__e.nextSibling),Qo(H[l],H[l]))}function Ko(e,t,r){for(var n,o=e.__k,i=0;o&&i<o.length;i++)(n=o[i])&&(n.__=e,t=typeof n.type=="function"?Ko(n,t,r):Go(r,n.__e,t));return t}function De(e,t){return t=t||[],e==null||typeof e=="boolean"||(ar(e)?e.some(function(r){De(r,t)}):t.push(e)),t}function Go(e,t,r){return r==null||r.parentNode!==e?e.insertBefore(t,null):t==r&&t.parentNode!=null||e.insertBefore(t,r),t.nextSibling}function Ed(e,t,r,n){var o=e.key,i=e.type,a=r-1,s=r+1,c=t[r];if(c===null||c&&o==c.key&&i===c.type)return r;if(n>(c!=null?1:0))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&o==c.key&&i===c.type)return s;s++}}return-1}function Td(e,t,r,n,o){var i;for(i in r)i==="children"||i==="key"||i in t||lr(e,i,null,r[i],n);for(i in t)o&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||r[i]===t[i]||lr(e,i,t[i],r[i],n)}function Yo(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Cd.test(t)?r:r+"px"}function lr(e,t,r,n,o){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Yo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Yo(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n||e.addEventListener(t,i?Zo:Xo,i):e.removeEventListener(t,i?Zo:Xo,i);else if(t!=="dangerouslySetInnerHTML"){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function Xo(e){return this.l[e.type+!1](S.event?S.event(e):e)}function Zo(e){return this.l[e.type+!0](S.event?S.event(e):e)}function an(e,t,r,n,o,i,a,s,c,u){var f,l,p,m,g,v,_,x,w,T,I,O,H,W,M,F=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(c=r.__h,s=t.__e=r.__e,t.__h=null,i=[s]),(f=S.__b)&&f(t);try{e:if(typeof F=="function"){if(x=t.props,w=(f=F.contextType)&&n[f.__c],T=f?w?w.props.value:f.__:n,r.__c?_=(l=t.__c=r.__c).__=l.__E:("prototype"in F&&F.prototype.render?t.__c=l=new F(x,T):(t.__c=l=new we(x,T),l.constructor=F,l.render=Id),w&&w.sub(l),l.props=x,l.state||(l.state={}),l.context=T,l.__n=n,p=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ne({},l.__s)),Ne(l.__s,F.getDerivedStateFromProps(x,l.__s))),m=l.props,g=l.state,l.__v=t,p)F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F.getDerivedStateFromProps==null&&x!==m&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(x,T),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(x,l.__s,T)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=x,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(ae){ae&&(ae.__=t)}),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(x,l.__s,T),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(m,g,v)})}if(l.context=T,l.props=x,l.__P=e,l.__e=!1,O=S.__r,H=0,"prototype"in F&&F.prototype.render){for(l.state=l.__s,l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),W=0;W<l._sb.length;W++)l.__h.push(l._sb[W]);l._sb=[]}else do l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++H<25);l.state=l.__s,l.getChildContext!=null&&(n=Ne(Ne({},n),l.getChildContext())),p||l.getSnapshotBeforeUpdate==null||(v=l.getSnapshotBeforeUpdate(m,g)),Wo(e,ar(M=f!=null&&f.type===Y&&f.key==null?f.props.children:f)?M:[M],t,r,n,o,i,a,s,c,u),l.base=t.__e,t.__h=null,l.__h.length&&a.push(l),_&&(l.__E=l.__=null)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Od(r.__e,t,r,n,o,i,a,c,u);(f=S.diffed)&&f(t)}catch(ae){t.__v=null,(c||i!=null)&&(t.__e=s,t.__h=!!c,i[i.indexOf(s)]=null),S.__e(ae,t,r)}}function Jo(e,t,r){for(var n=0;n<r.length;n++)sn(r[n],r[++n],r[++n]);S.__c&&S.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){S.__e(i,o.__v)}})}function Od(e,t,r,n,o,i,a,s,c){var u,f,l,p=r.props,m=t.props,g=t.type,v=0;if(g==="svg"&&(o=!0),i!=null){for(;v<i.length;v++)if((u=i[v])&&"setAttribute"in u==!!g&&(g?u.localName===g:u.nodeType===3)){e=u,i[v]=null;break}}if(e==null){if(g===null)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,m.is&&m),i=null,s=!1}if(g===null)p===m||s&&e.data===m||(e.data=m);else{if(i=i&&Mt.call(e.childNodes),f=(p=r.props||mt).dangerouslySetInnerHTML,l=m.dangerouslySetInnerHTML,!s){if(i!=null)for(p={},v=0;v<e.attributes.length;v++)p[e.attributes[v].name]=e.attributes[v].value;(l||f)&&(l&&(f&&l.__html==f.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(Td(e,m,p,o,s),l)t.__k=[];else if(Wo(e,ar(v=t.props.children)?v:[v],t,r,n,o&&g!=="foreignObject",i,a,i?i[0]:r.__k&&sr(r,0),s,c),i!=null)for(v=i.length;v--;)i[v]!=null&&Uo(i[v]);s||("value"in m&&(v=m.value)!==void 0&&(v!==e.value||g==="progress"&&!v||g==="option"&&v!==p.value)&&lr(e,"value",v,p.value,!1),"checked"in m&&(v=m.checked)!==void 0&&v!==e.checked&&lr(e,"checked",v,p.checked,!1))}return e}function sn(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){S.__e(n,r)}}function Qo(e,t,r){var n,o;if(S.unmount&&S.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||sn(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){S.__e(i,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&Qo(n[o],t,r||typeof e.type!="function");r||e.__e==null||Uo(e.__e),e.__=e.__e=e.__d=void 0}function Id(e,t,r){return this.constructor(e,r)}function gt(e,t,r){var n,o,i,a;S.__&&S.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],an(t,e=(!n&&r||t).__k=D(Y,null,[e]),o||mt,mt,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?Mt.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),Jo(i,e,a)}function ei(e,t){gt(e,t,ei)}function Ad(e,t,r){var n,o,i,a,s=Ne({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?Mt.call(arguments,2):r),Ft(e.type,s,n||e.key,o||e.ref,null)}function Lt(e,t){var r={__c:t="__cC"+Bo++,__:e,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(s){s.__e=!0,on(s)})},this.sub=function(a){o.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),s&&s.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Mt=zo.slice,S={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},Lo=0,Ro=function(e){return e!=null&&e.constructor===void 0},we.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ne({},this.state),typeof e=="function"&&(e=e(Ne({},r),this.props)),e&&Ne(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),on(this))},we.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),on(this))},we.prototype.render=Y,et=[],Vo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nn=function(e,t){return e.__v.__b-t.__v.__b},cr.__r=0,Bo=0;var ur=class extends Error{constructor(t){super(t[0].message);Zs(this,"issues");this.name="ValiError",this.issues=t}};function ti(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function Rt(e){return{issues:e}}function ue(e){return{output:e}}function Pd(e,t){return{reason:e==null?void 0:e.reason,validation:t.validation,origin:(e==null?void 0:e.origin)||"value",message:t.message,input:t.input,path:t.path,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}}function Nd(e,t){return{reason:t,origin:e==null?void 0:e.origin,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}}function ze(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return ue(e);let o,i,a=e;for(const s of t){const c=s._parse(a);if(c.issues){o=o||Nd(r,n);for(const u of c.issues){const f=Pd(o,u);i?i.push(f):i=[f]}if(o.abortEarly||o.abortPipeEarly)break}else a=c.output}return i?Rt(i):ue(a)}function Ue(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function ri(e){return typeof e=="function"?e():e}function He(e,t,r,n){return Rt([{validation:e,message:ri(t),input:r,requirement:n}])}function ni(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[i,a]=Ue(t,r);return[e,i,a]}const[n,o]=Ue(e,t);return[void 0,n,o]}function Me(e,t,r,n,o,i){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:ri(n),input:o,issues:i,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}]}}function oi(e){return typeof e.default=="function"?e.default():e.default}function Dd(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return ze(t,this.pipe,r,"any")}}}function ii(e,t,r){const[n="Invalid type",o]=Ue(t,r);return{type:"array",async:!1,item:e,message:n,pipe:o,_parse(i,a){if(!Array.isArray(i))return Me(a,"type","array",this.message,i);let s;const c=[];for(let u=0;u<i.length;u++){const f=i[u],l=this.item._parse(f,a);if(l.issues){const p={type:"array",input:i,key:u,value:f};for(const m of l.issues)m.path?m.path.unshift(p):m.path=[p],s==null||s.push(m);if(s||(s=l.issues),a!=null&&a.abortEarly)break}else c.push(l.output)}return s?Rt(s):ze(c,this.pipe,a,"array")}}}function ai(e,t){const[r="Invalid type",n]=Ue(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="boolean"?Me(i,"type","boolean",this.message,o):ze(o,this.pipe,i,"boolean")}}}function si(e,t="Invalid type"){return{type:"literal",async:!1,literal:e,message:t,_parse(r,n){return r!==this.literal?Me(n,"type","literal",this.message,r):ue(r)}}}function Md(e,t){return{type:"nullable",async:!1,wrapped:e,default:t,_parse(r,n){if(r===null){const o=oi(this);if(o===void 0)return ue(r);r=o}return this.wrapped._parse(r,n)}}}function cn(e,t){const[r="Invalid type",n]=Ue(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="number"||isNaN(o)?Me(i,"type","number",this.message,o):ze(o,this.pipe,i,"number")}}}function de(e,t,r,n){const[o,i="Invalid type",a]=ni(t,r,n);let s;return{type:"object",async:!1,entries:e,rest:o,message:i,pipe:a,_parse(c,u){if(!c||typeof c!="object")return Me(u,"type","object",this.message,c);s=s||Object.entries(this.entries);let f;const l={};for(const[p,m]of s){const g=c[p],v=m._parse(g,u);if(v.issues){const _={type:"object",input:c,key:p,value:g};for(const x of v.issues)x.path?x.path.unshift(_):x.path=[_],f==null||f.push(x);if(f||(f=v.issues),u!=null&&u.abortEarly)break}else(v.output!==void 0||p in c)&&(l[p]=v.output)}if(this.rest&&!(u!=null&&u.abortEarly&&f)){for(const p in c)if(!(p in this.entries)){const m=c[p],g=this.rest._parse(m,u);if(g.issues){const v={type:"object",input:c,key:p,value:m};for(const _ of g.issues)_.path?_.path.unshift(v):_.path=[v],f==null||f.push(_);if(f||(f=g.issues),u!=null&&u.abortEarly)break}else l[p]=g.output}}return f?Rt(f):ze(l,this.pipe,u,"object")}}}function jt(e,t){return{type:"optional",async:!1,wrapped:e,default:t,_parse(r,n){if(r===void 0){const o=oi(this);if(o===void 0)return ue(r);r=o}return this.wrapped._parse(r,n)}}}function Fd(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?ue(r):Me(n,"type","picklist",this.message,r)}}}function se(e,t){const[r="Invalid type",n]=Ue(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="string"?Me(i,"type","string",this.message,o):ze(o,this.pipe,i,"string")}}}function Ld(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[a,s]=Ue(r,n);return[e,t,a,s]}const[o,i]=Ue(t,r);return[se(),e,o,i]}var Rd=["__proto__","prototype","constructor"];function ci(e,t,r,n){const[o,i,a="Invalid type",s]=Ld(e,t,r,n);return{type:"record",async:!1,key:o,value:i,message:a,pipe:s,_parse(c,u){if(!c||typeof c!="object")return Me(u,"type","record",this.message,c);let f;const l={};for(const[p,m]of Object.entries(c))if(!Rd.includes(p)){let g;const v=this.key._parse(p,{origin:"key",abortEarly:u==null?void 0:u.abortEarly,abortPipeEarly:u==null?void 0:u.abortPipeEarly,skipPipe:u==null?void 0:u.skipPipe});if(v.issues){g={type:"record",input:c,key:p,value:m};for(const x of v.issues)x.path=[g],f==null||f.push(x);if(f||(f=v.issues),u!=null&&u.abortEarly)break}const _=this.value._parse(m,u);if(_.issues){g=g||{type:"record",input:c,key:p,value:m};for(const x of _.issues)x.path?x.path.unshift(g):x.path=[g],f==null||f.push(x);if(f||(f=_.issues),u!=null&&u.abortEarly)break}!v.issues&&!_.issues&&(l[v.output]=_.output)}return f?Rt(f):ze(l,this.pipe,u,"record")}}}function jd(e,t="Invalid type"){return{type:"union",async:!1,options:e,message:t,_parse(r,n){let o,i;for(const a of this.options){const s=a._parse(r,n);if(s.issues)if(o)for(const c of s.issues)o.push(c);else o=s.issues;else{i=[s.output];break}}return i?ue(i[0]):Me(n,"type","union",this.message,r,o)}}}function dr(e,t,r){const n=e._parse(t,r);if(n.issues)throw new ur(n.issues);return n.output}async function Vd(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new ur(n.issues);return n.output}function Bd(e,t,r,n){const[o,i,a]=ni(t,r,n);return de(Object.entries(e.entries).reduce((s,[c,u])=>({...s,[c]:jt(u)}),{}),o,i,a)}function zd(e,t,r){const n=e._parse(t,r);return n.issues?{success:!1,error:new ur(n.issues),issues:n.issues}:{success:!0,data:n.output,output:n.output}}function li(e,t,r){return{...e,_parse(n,o){const i=e._parse(n,o);if(i.issues)return i;const a=t(i.output);return r&&!Array.isArray(r)?r._parse(a,o):ze(a,r,o,typeof a)}}}var Ud=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function Hd(e,t="Invalid input"){return{type:"custom",async:!1,message:t,requirement:e,_parse(r){return this.requirement(r)?ue(r):He(this.type,this.message,r,this.requirement)}}}function qd(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:Ud,_parse(t){return this.requirement.test(t)?ue(t):He(this.type,this.message,t,this.requirement)}}}function fr(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?He(this.type,this.message,r,this.requirement):ue(r)}}}function Wd(e,t="Invalid value"){return{type:"max_value",async:!1,message:t,requirement:e,_parse(r){return r>this.requirement?He(this.type,this.message,r,this.requirement):ue(r)}}}function hr(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?He(this.type,this.message,r,this.requirement):ue(r)}}}function Kd(e,t="Invalid value"){return{type:"min_value",async:!1,message:t,requirement:e,_parse(r){return r<this.requirement?He(this.type,this.message,r,this.requirement):ue(r)}}}function ui(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?ue(r):He(this.type,this.message,r,this.requirement)}}}function Gd(e="Invalid URL"){return{type:"url",async:!1,message:e,requirement(t){try{return new URL(t),!0}catch{return!1}},_parse(t){return this.requirement(t)?ue(t):He(this.type,this.message,t,this.requirement)}}}function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(this,arguments)}var Fe,z,ln,di,bt=0,fi=[],pr=[],hi=S.__b,pi=S.__r,vi=S.diffed,mi=S.__c,gi=S.unmount;function tt(e,t){S.__h&&S.__h(z,e,bt||t),bt=0;var r=z.__H||(z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:pr}),r.__[e]}function K(e){return bt=1,vr(xi,e)}function vr(e,t,r){var n=tt(Fe++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):xi(void 0,t),function(s){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,s);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=z,!z.u)){var o=function(s,c,u){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(p){return p.__c});if(f.every(function(p){return!p.__N}))return!i||i.call(this,s,c,u);var l=!1;return f.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(l=!0)}}),!(!l&&n.__c.props===s)&&(!i||i.call(this,s,c,u))};z.u=!0;var i=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(s,c,u){if(this.__e){var f=i;i=void 0,o(s,c,u),i=f}a&&a.call(this,s,c,u)},z.shouldComponentUpdate=o}return n.__N||n.__}function V(e,t){var r=tt(Fe++,3);!S.__s&&dn(r.__H,t)&&(r.__=e,r.i=t,z.__H.__h.push(r))}function pe(e,t){var r=tt(Fe++,4);!S.__s&&dn(r.__H,t)&&(r.__=e,r.i=t,z.__h.push(r))}function L(e){return bt=5,ve(function(){return{current:e}},[])}function bi(e,t,r){bt=6,pe(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ve(e,t){var r=tt(Fe++,7);return dn(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function be(e,t){return bt=8,ve(function(){return e},t)}function mr(e){var t=z.context[e.__c],r=tt(Fe++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(z)),t.props.value):e.__}function yi(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function Yd(e){var t=tt(Fe++,10),r=K();return t.__=e,z.componentDidCatch||(z.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function _i(){var e=tt(Fe++,11);if(!e.__){for(var t=z.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Xd(){for(var e;e=fi.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gr),e.__H.__h.forEach(un),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){z=null,hi&&hi(e)},S.__r=function(e){pi&&pi(e),Fe=0;var t=(z=e.__c).__H;t&&(ln===z?(t.__h=[],z.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=pr,r.__N=r.i=void 0})):(t.__h.forEach(gr),t.__h.forEach(un),t.__h=[],Fe=0)),ln=z},S.diffed=function(e){vi&&vi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fi.push(t)!==1&&di===S.requestAnimationFrame||((di=S.requestAnimationFrame)||Zd)(Xd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==pr&&(r.__=r.__V),r.i=void 0,r.__V=pr})),ln=z=null},S.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gr),r.__h=r.__h.filter(function(n){return!n.__||un(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(n,r.__v)}}),mi&&mi(e,t)},S.unmount=function(e){gi&&gi(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gr(n)}catch(o){t=o}}),r.__H=void 0,t&&S.__e(t,r.__v))};var wi=typeof requestAnimationFrame=="function";function Zd(e){var t,r=function(){clearTimeout(n),wi&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);wi&&(t=requestAnimationFrame(r))}function gr(e){var t=z,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),z=t}function un(e){var t=z;e.__c=e.__(),z=t}function dn(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function xi(e,t){return typeof t=="function"?t(e):t}function ki(e,t){for(var r in t)e[r]=t[r];return e}function fn(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function hn(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function br(e){this.props=e}function $i(e,t){function r(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!a:fn(this.props,o)}function n(o){return this.shouldComponentUpdate=r,D(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(br.prototype=new we).isPureReactComponent=!0,br.prototype.shouldComponentUpdate=function(e,t){return fn(this.props,e)||fn(this.state,t)};var Si=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Si&&Si(e)};var Jd=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function re(e){function t(r){var n=ki({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Jd,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ci=function(e,t){return e==null?null:De(De(e).map(t))},Le={map:Ci,forEach:Ci,count:function(e){return e?De(e).length:0},only:function(e){var t=De(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:De},Qd=S.__e;S.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Qd(e,t,r,n)};var Ei=S.unmount;function Ti(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=ki({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Ti(n,t,r)})),e}function Oi(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Oi(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=r)),e}function yt(){this.__u=0,this.t=null,this.__b=null}function Ii(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function pn(e){var t,r,n;function o(i){if(t||(t=e()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw t;return D(r,i)}return o.displayName="Lazy",o.__f=!0,o}function _t(){this.u=null,this.o=null}S.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Ei&&Ei(e)},(yt.prototype=new we).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=Ii(n.__v),i=!1,a=function(){i||(i=!0,r.__R=null,o?o(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Oi(u,u.__c.__P,u.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.t.pop();)f.forceUpdate()}},c=t.__h===!0;n.__u++||c||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},yt.prototype.componentWillUnmount=function(){this.t=[]},yt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Ti(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&D(Y,null,e.fallback);return o&&(o.__h=null),[D(Y,null,t.__a?null:e.children),o]};var Ai=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function ef(e){return this.getChildContext=function(){return e.context},e.children}function tf(e){var t=this,r=e.i;t.componentWillUnmount=function(){gt(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,o){this.childNodes.push(n),t.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n)}}),gt(D(ef,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Pi(e,t){var r=D(tf,{__v:e,i:t});return r.containerInfo=t,r}(_t.prototype=new we).__a=function(e){var t=this,r=Ii(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Ai(t,e,n)):o()};r?r(i):i()}},_t.prototype.render=function(e){this.u=null,this.o=new Map;var t=De(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},_t.prototype.componentDidUpdate=_t.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Ai(e,r,t)})};var Ni=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,rf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,nf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,of=/[A-Z0-9]/g,af=typeof document<"u",sf=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Di(e,t,r){return t.__k==null&&(t.textContent=""),gt(e,t),typeof r=="function"&&r(),e?e.__c:null}function Mi(e,t,r){return ei(e,t),typeof r=="function"&&r(),e?e.__c:null}we.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(we.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Fi=S.event;function cf(){}function lf(){return this.cancelBubble}function uf(){return this.defaultPrevented}S.event=function(e){return Fi&&(e=Fi(e)),e.persist=cf,e.isPropagationStopped=lf,e.isDefaultPrevented=uf,e.nativeEvent=e};var vn,df={enumerable:!1,configurable:!0,get:function(){return this.class}},Li=S.vnode;S.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={};for(var i in r){var a=r[i];if(!(i==="value"&&"defaultValue"in r&&a==null||af&&i==="children"&&n==="noscript"||i==="class"||i==="className")){var s=i.toLowerCase();i==="defaultValue"&&"value"in r&&r.value==null?i="value":i==="download"&&a===!0?a="":s==="ondoubleclick"?i="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||sf(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":nf.test(i)?i=s:n.indexOf("-")===-1&&rf.test(i)?i=i.replace(of,"-$&").toLowerCase():a===null&&(a=void 0):s=i="oninput",s==="oninput"&&o[i=s]&&(i="oninputCapture"),o[i]=a}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=De(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=De(r.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",df)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Ni,Li&&Li(e)};var Ri=S.__r;S.__r=function(e){Ri&&Ri(e),vn=e.__c};var ji=S.diffed;S.diffed=function(e){ji&&ji(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),vn=null};var Vi={ReactCurrentDispatcher:{current:{readContext:function(e){return vn.__n[e.__c].props.value}}}},ff="17.0.2";function Bi(e){return D.bind(null,e)}function rt(e){return!!e&&e.$$typeof===Ni}function wt(e){return rt(e)?Ad.apply(null,arguments):e}function zi(e){return!!e.__k&&(gt(null,e),!0)}function Ui(e){return e&&(e.base||e.nodeType===1&&e)||null}var Hi=function(e,t){return e(t)},yr=function(e,t){return e(t)},qi=Y;function mn(e){e()}function Wi(e){return e}function Ki(){return[!1,mn]}var Gi=pe;function Yi(e,t){var r=t(),n=K({h:{__:r,v:t}}),o=n[0].h,i=n[1];return pe(function(){o.__=r,o.v=t,hn(o.__,t())||i({h:o})},[e,r,t]),V(function(){return hn(o.__,o.v())||i({h:o}),e(function(){hn(o.__,o.v())||i({h:o})})},[e]),r}var $e={useState:K,useId:_i,useReducer:vr,useEffect:V,useLayoutEffect:pe,useInsertionEffect:Gi,useTransition:Ki,useDeferredValue:Wi,useSyncExternalStore:Yi,startTransition:mn,useRef:L,useImperativeHandle:bi,useMemo:ve,useCallback:be,useContext:mr,useDebugValue:yi,version:"17.0.2",Children:Le,render:Di,hydrate:Mi,unmountComponentAtNode:zi,createPortal:Pi,createElement:D,createContext:Lt,createFactory:Bi,cloneElement:wt,createRef:Ho,Fragment:Y,isValidElement:rt,findDOMNode:Ui,Component:we,PureComponent:br,memo:$i,forwardRef:re,flushSync:yr,unstable_batchedUpdates:Hi,StrictMode:qi,Suspense:yt,SuspenseList:_t,lazy:pn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Vi};const hf=Object.freeze(Object.defineProperty({__proto__:null,Children:Le,Component:we,Fragment:Y,PureComponent:br,StrictMode:qi,Suspense:yt,SuspenseList:_t,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Vi,cloneElement:wt,createContext:Lt,createElement:D,createFactory:Bi,createPortal:Pi,createRef:Ho,default:$e,findDOMNode:Ui,flushSync:yr,forwardRef:re,hydrate:Mi,isValidElement:rt,lazy:pn,memo:$i,render:Di,startTransition:mn,unmountComponentAtNode:zi,unstable_batchedUpdates:Hi,useCallback:be,useContext:mr,useDebugValue:yi,useDeferredValue:Wi,useEffect:V,useErrorBoundary:Yd,useId:_i,useImperativeHandle:bi,useInsertionEffect:Gi,useLayoutEffect:pe,useMemo:ve,useReducer:vr,useRef:L,useState:K,useSyncExternalStore:Yi,useTransition:Ki,version:ff},Symbol.toStringTag,{value:"Module"}));function xt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function pf(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Xi(...e){return t=>e.forEach(r=>pf(r,t))}function Vt(...e){return be(Xi(...e),e)}function vf(e,t=[]){let r=[];function n(i,a){const s=Lt(a),c=r.length;r=[...r,a];function u(l){const{scope:p,children:m,...g}=l,v=(p==null?void 0:p[e][c])||s,_=ve(()=>g,Object.values(g));return D(v.Provider,{value:_},m)}function f(l,p){const m=(p==null?void 0:p[e][c])||s,g=mr(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const o=()=>{const i=r.map(a=>Lt(a));return function(s){const c=(s==null?void 0:s[e])||i;return ve(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[n,mf(o,...t)]}function mf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=n.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return ve(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}const gn=globalThis!=null&&globalThis.document?pe:()=>{},gf=hf["useId".toString()]||(()=>{});let bf=0;function bn(e){const[t,r]=K(gf());return gn(()=>{e||r(n=>n??String(bf++))},[e]),e||(t?`radix-${t}`:"")}function nt(e){const t=L(e);return V(()=>{t.current=e}),ve(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function yf({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=_f({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:n,s=nt(r),c=be(u=>{if(i){const l=typeof u=="function"?u(e):u;l!==e&&s(l)}else o(u)},[i,e,o,s]);return[a,c]}function _f({defaultProp:e,onChange:t}){const r=K(e),[n]=r,o=L(n),i=nt(t);return V(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),r}const yn=re((e,t)=>{const{children:r,...n}=e,o=Le.toArray(r),i=o.find(xf);if(i){const a=i.props.children,s=o.map(c=>c===i?Le.count(a)>1?Le.only(null):rt(a)?a.props.children:null:c);return D(_n,he({},n,{ref:t}),rt(a)?wt(a,void 0,s):null)}return D(_n,he({},n,{ref:t}),r)});yn.displayName="Slot";const _n=re((e,t)=>{const{children:r,...n}=e;return rt(r)?wt(r,{...kf(n,r.props),ref:t?Xi(t,r.ref):r.ref}):Le.count(r)>1?Le.only(null):null});_n.displayName="SlotClone";const wf=({children:e})=>D(Y,null,e);function xf(e){return rt(e)&&e.type===wf}function kf(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...s)=>{i(...s),o(...s)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const wn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const r=re((n,o)=>{const{asChild:i,...a}=n,s=i?yn:t;return V(()=>{window[Symbol.for("radix-ui")]=!0},[]),D(s,he({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $f(e,t){e&&yr(()=>e.dispatchEvent(t))}function Sf(e,t=globalThis==null?void 0:globalThis.document){const r=nt(e);V(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const xn="dismissableLayer.update",Cf="dismissableLayer.pointerDownOutside",Ef="dismissableLayer.focusOutside";let Zi;const Tf=Lt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Of=re((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...u}=e,f=mr(Tf),[l,p]=K(null),m=(r=l==null?void 0:l.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=K({}),v=Vt(t,M=>p(M)),_=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=_.indexOf(x),T=l?_.indexOf(l):-1,I=f.layersWithOutsidePointerEventsDisabled.size>0,O=T>=w,H=If(M=>{const F=M.target,ae=[...f.branches].some(te=>te.contains(F));!O||ae||(i==null||i(M),s==null||s(M),M.defaultPrevented||c==null||c())},m),W=Af(M=>{const F=M.target;[...f.branches].some(te=>te.contains(F))||(a==null||a(M),s==null||s(M),M.defaultPrevented||c==null||c())},m);return Sf(M=>{T===f.layers.size-1&&(o==null||o(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))},m),V(()=>{if(l)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Zi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),Ji(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zi)}},[l,m,n,f]),V(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),Ji())},[l,f]),V(()=>{const M=()=>g({});return document.addEventListener(xn,M),()=>document.removeEventListener(xn,M)},[]),D(wn.div,he({},u,{ref:v,style:{pointerEvents:I?O?"auto":"none":void 0,...e.style},onFocusCapture:xt(e.onFocusCapture,W.onFocusCapture),onBlurCapture:xt(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:xt(e.onPointerDownCapture,H.onPointerDownCapture)}))});function If(e,t=globalThis==null?void 0:globalThis.document){const r=nt(e),n=L(!1),o=L(()=>{});return V(()=>{const i=s=>{if(s.target&&!n.current){let u=function(){Qi(Cf,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Af(e,t=globalThis==null?void 0:globalThis.document){const r=nt(e),n=L(!1);return V(()=>{const o=i=>{i.target&&!n.current&&Qi(Ef,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ji(){const e=new CustomEvent(xn);document.dispatchEvent(e)}function Qi(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?$f(o,i):o.dispatchEvent(i)}const kn="focusScope.autoFocusOnMount",$n="focusScope.autoFocusOnUnmount",ea={bubbles:!1,cancelable:!0},Pf=re((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,c]=K(null),u=nt(o),f=nt(i),l=L(null),p=Vt(t,v=>c(v)),m=L({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(n){let v=function(T){if(m.paused||!s)return;const I=T.target;s.contains(I)?l.current=I:qe(l.current,{select:!0})},_=function(T){if(m.paused||!s)return;const I=T.relatedTarget;I!==null&&(s.contains(I)||qe(l.current,{select:!0}))},x=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&qe(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",_);const w=new MutationObserver(x);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",_),w.disconnect()}}},[n,s,m.paused]),V(()=>{if(s){na.add(m);const v=document.activeElement;if(!s.contains(v)){const x=new CustomEvent(kn,ea);s.addEventListener(kn,u),s.dispatchEvent(x),x.defaultPrevented||(Nf(Rf(ta(s)),{select:!0}),document.activeElement===v&&qe(s))}return()=>{s.removeEventListener(kn,u),setTimeout(()=>{const x=new CustomEvent($n,ea);s.addEventListener($n,f),s.dispatchEvent(x),x.defaultPrevented||qe(v??document.body,{select:!0}),s.removeEventListener($n,f),na.remove(m)},0)}}},[s,u,f,m]);const g=be(v=>{if(!r&&!n||m.paused)return;const _=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(_&&x){const w=v.currentTarget,[T,I]=Df(w);T&&I?!v.shiftKey&&x===I?(v.preventDefault(),r&&qe(T,{select:!0})):v.shiftKey&&x===T&&(v.preventDefault(),r&&qe(I,{select:!0})):x===w&&v.preventDefault()}},[r,n,m.paused]);return D(wn.div,he({tabIndex:-1},a,{ref:p,onKeyDown:g}))});function Nf(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function Df(e){const t=ta(e),r=ra(t,e),n=ra(t.reverse(),e);return[r,n]}function ta(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ra(e,t){for(const r of e)if(!Mf(r,{upTo:t}))return r}function Mf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ff(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Ff(e)&&t&&e.select()}}const na=Lf();function Lf(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=oa(e,t),e.unshift(t)},remove(t){var r;e=oa(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function oa(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Rf(e){return e.filter(t=>t.tagName!=="A")}function jf(e,t){return vr((r,n)=>{const o=t[r][n];return o??r},e)}const Sn=e=>{const{present:t,children:r}=e,n=Vf(t),o=typeof r=="function"?r({present:n.isPresent}):Le.only(r),i=Vt(n.ref,o.ref);return typeof r=="function"||n.isPresent?wt(o,{ref:i}):null};Sn.displayName="Presence";function Vf(e){const[t,r]=K(),n=L({}),o=L(e),i=L("none"),a=e?"mounted":"unmounted",[s,c]=jf(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const u=_r(n.current);i.current=s==="mounted"?u:"none"},[s]),gn(()=>{const u=n.current,f=o.current;if(f!==e){const p=i.current,m=_r(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),gn(()=>{if(t){const u=l=>{const m=_r(n.current).includes(l.animationName);l.target===t&&m&&yr(()=>c("ANIMATION_END"))},f=l=>{l.target===t&&(i.current=_r(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:be(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function _r(e){return(e==null?void 0:e.animationName)||"none"}let Cn=0;function Bf(){V(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:ia()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:ia()),Cn++,()=>{Cn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Cn--}},[])}function ia(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Ee=function(){return Ee=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ee.apply(this,arguments)};function aa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function zf(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var wr="right-scroll-bar-position",xr="width-before-scroll-bar",Uf="with-scroll-bars-hidden",Hf="--removed-body-scroll-bar-size";function qf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Wf(e,t){var r=K(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function Kf(e,t){return Wf(t||null,function(r){return e.forEach(function(n){return qf(n,r)})})}function Gf(e){return e}function Yf(e,t){t===void 0&&(t=Gf);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,n);return r.push(a),function(){r=r.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(n=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){n=!0;var a=[];if(r.length){var s=r;r=[],s.forEach(i),a=r}var c=function(){var f=a;a=[],f.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),r}}}};return o}function Xf(e){e===void 0&&(e={});var t=Yf(null);return t.options=Ee({async:!0,ssr:!1},e),t}var sa=function(e){var t=e.sideCar,r=aa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return D(n,Ee({},r))};sa.isSideCarExport=!0;function Zf(e,t){return e.useMedium(t),sa}var ca=Xf(),En=function(){},kr=re(function(e,t){var r=L(null),n=K({onScrollCapture:En,onWheelCapture:En,onTouchMoveCapture:En}),o=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,l=e.shards,p=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,_=e.as,x=_===void 0?"div":_,w=aa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=p,I=Kf([r,t]),O=Ee(Ee({},w),o);return D(Y,null,f&&D(T,{sideCar:ca,removeScrollBar:u,shards:l,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:r}),a?wt(Le.only(s),Ee(Ee({},O),{ref:I})):D(x,Ee({},O,{className:c,ref:I}),s))});kr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},kr.classNames={fullWidth:xr,zeroRight:wr};var la,Jf=function(){if(la)return la;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Qf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jf();return t&&e.setAttribute("nonce",t),e}function eh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function th(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rh=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Qf())&&(eh(t,r),th(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nh=function(){var e=rh();return function(t,r){V(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ua=function(){var e=nh(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},oh={left:0,top:0,right:0,gap:0},Tn=function(e){return parseInt(e||"",10)||0},ih=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Tn(r),Tn(n),Tn(o)]},ah=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oh;var t=ih(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},sh=ua(),ch=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
2
- .`.concat(Uf,` {
3
- overflow: hidden `).concat(n,`;
4
- padding-right: `).concat(s,"px ").concat(n,`;
5
- }
6
- body {
7
- overflow: hidden `).concat(n,`;
8
- overscroll-behavior: contain;
9
- `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
10
- padding-left: `.concat(o,`px;
11
- padding-top: `).concat(i,`px;
12
- padding-right: `).concat(a,`px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: `).concat(s,"px ").concat(n,`;
16
- `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
17
- }
18
-
19
- .`).concat(wr,` {
20
- right: `).concat(s,"px ").concat(n,`;
21
- }
22
-
23
- .`).concat(xr,` {
24
- margin-right: `).concat(s,"px ").concat(n,`;
25
- }
26
-
27
- .`).concat(wr," .").concat(wr,` {
28
- right: 0 `).concat(n,`;
29
- }
30
-
31
- .`).concat(xr," .").concat(xr,` {
32
- margin-right: 0 `).concat(n,`;
33
- }
34
-
35
- body {
36
- `).concat(Hf,": ").concat(s,`px;
37
- }
38
- `)},lh=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=ve(function(){return ah(o)},[o]);return D(sh,{styles:ch(i,!t,o,r?"":"!important")})},On=!1;if(typeof window<"u")try{var $r=Object.defineProperty({},"passive",{get:function(){return On=!0,!0}});window.addEventListener("test",$r,$r),window.removeEventListener("test",$r,$r)}catch{On=!1}var kt=On?{passive:!1}:!1,uh=function(e){return e.tagName==="TEXTAREA"},da=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!uh(e)&&r[t]==="visible")},dh=function(e){return da(e,"overflowY")},fh=function(e){return da(e,"overflowX")},fa=function(e,t){var r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=ha(e,r);if(n){var o=pa(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},hh=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},ph=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ha=function(e,t){return e==="v"?dh(t):fh(t)},pa=function(e,t){return e==="v"?hh(t):ph(t)},vh=function(e,t){return e==="h"&&t==="rtl"?-1:1},mh=function(e,t,r,n,o){var i=vh(e,window.getComputedStyle(t).direction),a=i*n,s=r.target,c=t.contains(s),u=!1,f=a>0,l=0,p=0;do{var m=pa(e,s),g=m[0],v=m[1],_=m[2],x=v-_-i*g;(g||x)&&ha(e,s)&&(l+=x,p+=g),s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(f&&(o&&l===0||!o&&a>l)||!f&&(o&&p===0||!o&&-a>p))&&(u=!0),u},Sr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},va=function(e){return[e.deltaX,e.deltaY]},ma=function(e){return e&&"current"in e?e.current:e},gh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bh=function(e){return`
39
- .block-interactivity-`.concat(e,` {pointer-events: none;}
40
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},yh=0,$t=[];function _h(e){var t=L([]),r=L([0,0]),n=L(),o=K(yh++)[0],i=K(function(){return ua()})[0],a=L(e);V(function(){a.current=e},[e]),V(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=zf([e.lockRef.current],(e.shards||[]).map(ma),!0).filter(Boolean);return v.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=be(function(v,_){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var x=Sr(v),w=r.current,T="deltaX"in v?v.deltaX:w[0]-x[0],I="deltaY"in v?v.deltaY:w[1]-x[1],O,H=v.target,W=Math.abs(T)>Math.abs(I)?"h":"v";if("touches"in v&&W==="h"&&H.type==="range")return!1;var M=fa(W,H);if(!M)return!0;if(M?O=W:(O=W==="v"?"h":"v",M=fa(W,H)),!M)return!1;if(!n.current&&"changedTouches"in v&&(T||I)&&(n.current=O),!O)return!0;var F=n.current||O;return mh(F,_,v,F==="h"?T:I,!0)},[]),c=be(function(v){var _=v;if(!(!$t.length||$t[$t.length-1]!==i)){var x="deltaY"in _?va(_):Sr(_),w=t.current.filter(function(O){return O.name===_.type&&O.target===_.target&&gh(O.delta,x)})[0];if(w&&w.should){_.cancelable&&_.preventDefault();return}if(!w){var T=(a.current.shards||[]).map(ma).filter(Boolean).filter(function(O){return O.contains(_.target)}),I=T.length>0?s(_,T[0]):!a.current.noIsolation;I&&_.cancelable&&_.preventDefault()}}},[]),u=be(function(v,_,x,w){var T={name:v,delta:_,target:x,should:w};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(I){return I!==T})},1)},[]),f=be(function(v){r.current=Sr(v),n.current=void 0},[]),l=be(function(v){u(v.type,va(v),v.target,s(v,e.lockRef.current))},[]),p=be(function(v){u(v.type,Sr(v),v.target,s(v,e.lockRef.current))},[]);V(function(){return $t.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:p}),document.addEventListener("wheel",c,kt),document.addEventListener("touchmove",c,kt),document.addEventListener("touchstart",f,kt),function(){$t=$t.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,kt),document.removeEventListener("touchmove",c,kt),document.removeEventListener("touchstart",f,kt)}},[]);var m=e.removeScrollBar,g=e.inert;return D(Y,null,g?D(i,{styles:bh(o)}):null,m?D(lh,{gapMode:"margin"}):null)}const wh=Zf(ca,_h);var ga=re(function(e,t){return D(kr,Ee({},e,{ref:t,sideCar:wh}))});ga.classNames=kr.classNames;const xh=ga;var kh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},St=new WeakMap,Cr=new WeakMap,Er={},In=0,ba=function(e){return e&&(e.host||ba(e.parentNode))},$h=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=ba(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Sh=function(e,t,r,n){var o=$h(t,Array.isArray(e)?e:[e]);Er[r]||(Er[r]=new WeakMap);var i=Er[r],a=[],s=new Set,c=new Set(o),u=function(l){!l||s.has(l)||(s.add(l),u(l.parentNode))};o.forEach(u);var f=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(p){if(s.has(p))f(p);else{var m=p.getAttribute(n),g=m!==null&&m!=="false",v=(St.get(p)||0)+1,_=(i.get(p)||0)+1;St.set(p,v),i.set(p,_),a.push(p),v===1&&g&&Cr.set(p,!0),_===1&&p.setAttribute(r,"true"),g||p.setAttribute(n,"true")}})};return f(t),s.clear(),In++,function(){a.forEach(function(l){var p=St.get(l)-1,m=i.get(l)-1;St.set(l,p),i.set(l,m),p||(Cr.has(l)||l.removeAttribute(n),Cr.delete(l)),m||l.removeAttribute(r)}),In--,In||(St=new WeakMap,St=new WeakMap,Cr=new WeakMap,Er={})}},Ch=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||kh(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),Sh(n,o,r,"aria-hidden")):function(){return null}};const ya="Dialog",[_a,Xm]=vf(ya),[Eh,Ct]=_a(ya),Th=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=L(null),c=L(null),[u=!1,f]=yf({prop:n,defaultProp:o,onChange:i});return D(Eh,{scope:t,triggerRef:s,contentRef:c,contentId:bn(),titleId:bn(),descriptionId:bn(),open:u,onOpenChange:f,onOpenToggle:be(()=>f(l=>!l),[f]),modal:a},r)},Oh="DialogPortal",[Zm,wa]=_a(Oh,{forceMount:void 0}),An="DialogOverlay",Ih=re((e,t)=>{const r=wa(An,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ct(An,e.__scopeDialog);return i.modal?D(Sn,{present:n||i.open},D(Ah,he({},o,{ref:t}))):null}),Ah=re((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ct(An,r);return D(xh,{as:yn,allowPinchZoom:!0,shards:[o.contentRef]},D(wn.div,he({"data-state":ka(o.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),Bt="DialogContent",Ph=re((e,t)=>{const r=wa(Bt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=Ct(Bt,e.__scopeDialog);return D(Sn,{present:n||i.open},i.modal?D(Nh,he({},o,{ref:t})):D(Dh,he({},o,{ref:t})))}),Nh=re((e,t)=>{const r=Ct(Bt,e.__scopeDialog),n=L(null),o=Vt(t,r.contentRef,n);return V(()=>{const i=n.current;if(i)return Ch(i)},[]),D(xa,he({},e,{ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xt(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:xt(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:xt(e.onFocusOutside,i=>i.preventDefault())}))}),Dh=re((e,t)=>{const r=Ct(Bt,e.__scopeDialog),n=L(!1),o=L(!1);return D(xa,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,i),!i.defaultPrevented){var s;n.current||(s=r.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}n.current=!1,o.current=!1},onInteractOutside:i=>{var a,s;(a=e.onInteractOutside)===null||a===void 0||a.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=i.target;((s=r.triggerRef.current)===null||s===void 0?void 0:s.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),xa=re((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Ct(Bt,r),c=L(null),u=Vt(t,c);return Bf(),D(Y,null,D(Pf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i},D(Of,he({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ka(s.open)},a,{ref:u,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function ka(e){return e?"open":"closed"}const Mh=Th,Fh=Ih,Lh=Ph;function $a(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=$a(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ot(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=$a(e))&&(n&&(n+=" "),n+=t);return n}const Sa=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Ca=ot,Tr=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ca(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(u=>{const f=r==null?void 0:r[u],l=i==null?void 0:i[u];if(f===null)return null;const p=Sa(f)||Sa(l);return o[u][p]}),s=r&&Object.entries(r).reduce((u,f)=>{let[l,p]=f;return p===void 0||(u[l]=p),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:l,className:p,...m}=f;return Object.entries(m).every(g=>{let[v,_]=g;return Array.isArray(_)?_.includes({...i,...s}[v]):{...i,...s}[v]===_})?[...u,l,p]:u},[]);return Ca(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},me=Symbol.for("@ts-pattern/matcher"),Ea=Symbol.for("@ts-pattern/isVariadic"),Or="@ts-pattern/anonymous-select-key",Pn=e=>!!(e&&typeof e=="object"),Ir=e=>e&&!!e[me],ne=(e,t,r)=>{if(Ir(e)){const n=e[me](),{matched:o,selections:i}=n.match(t);return o&&i&&Object.keys(i).forEach(a=>r(a,i[a])),o}if(Pn(e)){if(!Pn(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],o=[],i=[];for(const a of e.keys()){const s=e[a];Ir(s)&&s[Ea]?i.push(s):i.length?o.push(s):n.push(s)}if(i.length){if(i.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+o.length)return!1;const a=t.slice(0,n.length),s=o.length===0?[]:t.slice(-o.length),c=t.slice(n.length,o.length===0?1/0:-o.length);return n.every((u,f)=>ne(u,a[f],r))&&o.every((u,f)=>ne(u,s[f],r))&&(i.length===0||ne(i[0],c,r))}return e.length===t.length&&e.every((a,s)=>ne(a,t[s],r))}return Object.keys(e).every(n=>{const o=e[n];return(n in t||Ir(i=o)&&i[me]().matcherType==="optional")&&ne(o,t[n],r);var i})}return Object.is(t,e)},ye=e=>{var t,r,n;return Pn(e)?Ir(e)?(t=(r=(n=e[me]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?zt(e,ye):zt(Object.values(e),ye):[]},zt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function Rh(...e){if(e.length===1){const[t]=e;return r=>ne(t,r,()=>{})}if(e.length===2){const[t,r]=e;return ne(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function ce(e){return Object.assign(e,{optional:()=>Dn(e),and:t=>G(e,t),or:t=>Ta(e,t),select:t=>t===void 0?Ut(e):Ut(t,e)})}function Nn(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Ea]:!0})}}))(e),{optional:()=>Nn(Dn(e)),select:t=>Nn(t===void 0?Ut(e):Ut(t,e))})}function Dn(e){return ce({[me]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return t===void 0?(ye(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:ne(e,t,n),selections:r}},getSelectionKeys:()=>ye(e),matcherType:"optional"})})}const jh=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},Vh=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function G(...e){return ce({[me]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return{matched:e.every(o=>ne(o,t,n)),selections:r}},getSelectionKeys:()=>zt(e,ye),matcherType:"and"})})}function Ta(...e){return ce({[me]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return zt(e,ye).forEach(o=>n(o,void 0)),{matched:e.some(o=>ne(o,t,n)),selections:r}},getSelectionKeys:()=>zt(e,ye),matcherType:"or"})})}function j(e){return{[me]:()=>({match:t=>({matched:!!e(t)})})}}function Ut(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return ce({[me]:()=>({match:n=>{let o={[t??Or]:n};return{matched:r===void 0||ne(r,n,(i,a)=>{o[i]=a}),selections:o}},getSelectionKeys:()=>[t??Or].concat(r===void 0?[]:ye(r))})})}function Te(e){return typeof e=="number"}function it(e){return typeof e=="string"}function We(e){return typeof e=="bigint"}const Oa=ce(j(function(e){return!0})),Bh=Oa,at=e=>Object.assign(ce(e),{startsWith:t=>{return at(G(e,(r=t,j(n=>it(n)&&n.startsWith(r)))));var r},endsWith:t=>{return at(G(e,(r=t,j(n=>it(n)&&n.endsWith(r)))));var r},minLength:t=>at(G(e,(r=>j(n=>it(n)&&n.length>=r))(t))),maxLength:t=>at(G(e,(r=>j(n=>it(n)&&n.length<=r))(t))),includes:t=>{return at(G(e,(r=t,j(n=>it(n)&&n.includes(r)))));var r},regex:t=>{return at(G(e,(r=t,j(n=>it(n)&&!!n.match(r)))));var r}}),zh=at(j(it)),Oe=e=>Object.assign(ce(e),{between:(t,r)=>Oe(G(e,((n,o)=>j(i=>Te(i)&&n<=i&&o>=i))(t,r))),lt:t=>Oe(G(e,(r=>j(n=>Te(n)&&n<r))(t))),gt:t=>Oe(G(e,(r=>j(n=>Te(n)&&n>r))(t))),lte:t=>Oe(G(e,(r=>j(n=>Te(n)&&n<=r))(t))),gte:t=>Oe(G(e,(r=>j(n=>Te(n)&&n>=r))(t))),int:()=>Oe(G(e,j(t=>Te(t)&&Number.isInteger(t)))),finite:()=>Oe(G(e,j(t=>Te(t)&&Number.isFinite(t)))),positive:()=>Oe(G(e,j(t=>Te(t)&&t>0))),negative:()=>Oe(G(e,j(t=>Te(t)&&t<0)))}),Uh=Oe(j(Te)),Ke=e=>Object.assign(ce(e),{between:(t,r)=>Ke(G(e,((n,o)=>j(i=>We(i)&&n<=i&&o>=i))(t,r))),lt:t=>Ke(G(e,(r=>j(n=>We(n)&&n<r))(t))),gt:t=>Ke(G(e,(r=>j(n=>We(n)&&n>r))(t))),lte:t=>Ke(G(e,(r=>j(n=>We(n)&&n<=r))(t))),gte:t=>Ke(G(e,(r=>j(n=>We(n)&&n>=r))(t))),positive:()=>Ke(G(e,j(t=>We(t)&&t>0))),negative:()=>Ke(G(e,j(t=>We(t)&&t<0)))}),Hh=Ke(j(We)),qh=ce(j(function(e){return typeof e=="boolean"})),Wh=ce(j(function(e){return typeof e=="symbol"})),Kh=ce(j(function(e){return e==null}));var N={__proto__:null,matcher:me,optional:Dn,array:function(...e){return Nn({[me]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let n={};if(t.length===0)return ye(r).forEach(i=>{n[i]=[]}),{matched:!0,selections:n};const o=(i,a)=>{n[i]=(n[i]||[]).concat([a])};return{matched:t.every(i=>ne(r,i,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:ye(e[0])})})},set:function(...e){return ce({[me]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const n=(i,a)=>{r[i]=(r[i]||[]).concat([a])},o=e[0];return{matched:jh(t,i=>ne(o,i,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:ye(e[0])})})},map:function(...e){return ce({[me]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(s,c)=>{r[s]=(r[s]||[]).concat([c])};if(e.length===0)return{matched:!0};var o;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(o=e[0])==null?void 0:o.toString()}`);const[i,a]=e;return{matched:Vh(t,(s,c)=>{const u=ne(i,c,n),f=ne(a,s,n);return u&&f}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...ye(e[0]),...ye(e[1])]})})},intersection:G,union:Ta,not:function(e){return ce({[me]:()=>({match:t=>({matched:!ne(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:j,select:Ut,any:Oa,_:Bh,string:zh,number:Uh,bigint:Hh,boolean:qh,symbol:Wh,nullish:Kh,instanceOf:function(e){return ce(j(function(t){return r=>r instanceof t}(e)))},shape:function(e){return ce(j(Rh(e)))}};const Mn={matched:!1,value:void 0};function st(e){return new Ar(e,Mn)}class Ar{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],n=[t[0]];let o;t.length===3&&typeof t[1]=="function"?o=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let i=!1,a={};const s=(u,f)=>{i=!0,a[u]=f},c=!n.some(u=>ne(u,this.input,s))||o&&!o(this.input)?Mn:{matched:!0,value:r(i?Or in a?a[Or]:a:this.input,this.input)};return new Ar(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new Ar(this.input,n?{matched:!0,value:r(this.input,this.input)}:Mn)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}}const Jm="";function Se(e,t){if(!e)throw new Error(t)}function Pr(){throw new Error("Cycle detected")}var Gh=Symbol.for("preact-signals");function Fn(){if(Et>1)Et--;else{for(var e,t=!1;Ht!==void 0;){var r=Ht;for(Ht=void 0,Ln++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Aa(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Ln=0,Et--,t)throw e}}var X=void 0,Ht=void 0,Et=0,Ln=0,Nr=0;function Ia(e){if(X!==void 0){var t=e.n;if(t===void 0||t.t!==X)return t={i:0,S:e,p:X.s,n:void 0,t:X,e:void 0,x:void 0,r:t},X.s!==void 0&&(X.s.n=t),X.s=t,e.n=t,32&X.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=X.s,t.n=void 0,X.s.n=t,X.s=t),t}}function oe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}oe.prototype.brand=Gh,oe.prototype.h=function(){return!0},oe.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},oe.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}},oe.prototype.subscribe=function(e){var t=this;return jn(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},oe.prototype.valueOf=function(){return this.value},oe.prototype.toString=function(){return this.value+""},oe.prototype.toJSON=function(){return this.value},oe.prototype.peek=function(){return this.v},Object.defineProperty(oe.prototype,"value",{get:function(){var e=Ia(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(X instanceof Ye&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Ln>100&&Pr(),this.v=e,this.i++,Nr++,Et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Fn()}}}});function Ge(e){return new oe(e)}function Aa(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Pa(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Na(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Ye(e){oe.call(this,void 0),this.x=e,this.s=void 0,this.g=Nr-1,this.f=4}(Ye.prototype=new oe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Nr))return!0;if(this.g=Nr,this.f|=1,this.i>0&&!Aa(this))return this.f&=-2,!0;var e=X;try{Pa(this),X=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return X=e,Na(this),this.f&=-2,!0},Ye.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}oe.prototype.S.call(this,e)},Ye.prototype.U=function(e){if(this.t!==void 0&&(oe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ye.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Ye.prototype.peek=function(){if(this.h()||Pr(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ye.prototype,"value",{get:function(){1&this.f&&Pr();var e=Ia(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Yh(e){return new Ye(e)}function Da(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Et++;var r=X;X=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Rn(e),n}finally{X=r,Fn()}}}function Rn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Da(e)}function Xh(e){if(X!==this)throw new Error("Out-of-order effect");Na(this),X=e,this.f&=-2,8&this.f&&Rn(this),Fn()}function qt(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}qt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},qt.prototype.S=function(){1&this.f&&Pr(),this.f|=1,this.f&=-9,Da(this),Pa(this),Et++;var e=X;return X=this,Xh.bind(this,e)},qt.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ht,Ht=this)},qt.prototype.d=function(){this.f|=8,1&this.f||Rn(this)};function jn(e){var t=new qt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Vn;function Tt(e,t){S[e]=t.bind(null,S[e]||function(){})}function Dr(e){Vn&&Vn(),Vn=e&&e.S()}function Ma(e){var t=this,r=e.data,n=Jh(r);n.value=r;var o=ve(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ro(o.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},Yh(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return o.value}Ma.displayName="_st",Object.defineProperties(oe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ma},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Tt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof oe&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)}),Tt("__r",function(e,t){Dr();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return jn(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),Dr(r),e(t)}),Tt("__e",function(e,t,r,n){Dr(),e(t,r,n)}),Tt("diffed",function(e,t){Dr();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props;if(n){var i=r.U;if(i)for(var a in i){var s=i[a];s!==void 0&&!(a in n)&&(s.d(),i[a]=void 0)}else r.U=i={};for(var c in n){var u=i[c],f=n[c];u===void 0?(u=Zh(r,c,f,o),i[c]=u):u.o(f,o)}}}e(t)});function Zh(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=Ge(r);return{o:function(a,s){i.value=a,n=s},d:jn(function(){var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Tt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)}),Tt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),we.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};function Jh(e){return ve(function(){return Ge(e)},[])}const Bn=(e,t)=>t.some(r=>e instanceof r);let Fa,La;function Qh(){return Fa||(Fa=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ep(){return La||(La=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zn=new WeakMap,Un=new WeakMap,Mr=new WeakMap;function tp(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{r(ct(e.result)),o()},a=()=>{n(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return Mr.set(t,e),t}function rp(e){if(zn.has(e))return;const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{r(),o()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});zn.set(e,t)}let Hn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return zn.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ct(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Ra(e){Hn=e(Hn)}function np(e){return ep().includes(e)?function(...t){return e.apply(qn(this),t),ct(this.request)}:function(...t){return ct(e.apply(qn(this),t))}}function op(e){return typeof e=="function"?np(e):(e instanceof IDBTransaction&&rp(e),Bn(e,Qh())?new Proxy(e,Hn):e)}function ct(e){if(e instanceof IDBRequest)return tp(e);if(Un.has(e))return Un.get(e);const t=op(e);return t!==e&&(Un.set(e,t),Mr.set(t,e)),t}const qn=e=>Mr.get(e);function ip(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=ct(a);return n&&a.addEventListener("upgradeneeded",c=>{n(ct(a.result),c.oldVersion,c.newVersion,ct(a.transaction),c)}),r&&a.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),s.then(c=>{i&&c.addEventListener("close",()=>i()),o&&c.addEventListener("versionchange",u=>o(u.oldVersion,u.newVersion,u))}).catch(()=>{}),s}const ap=["get","getKey","getAll","getAllKeys","count"],sp=["put","add","delete","clear"],Wn=new Map;function ja(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Wn.get(t))return Wn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=sp.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||ap.includes(r)))return;const i=async function(a,...s){const c=this.transaction(a,o?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(s.shift())),(await Promise.all([u[r](...s),o&&c.done]))[0]};return Wn.set(t,i),i}Ra(e=>({...e,get:(t,r,n)=>ja(t,r)||e.get(t,r,n),has:(t,r)=>!!ja(t,r)||e.has(t,r)}));const cp=["continue","continuePrimaryKey","advance"],Va={},Kn=new WeakMap,Ba=new WeakMap,lp={get(e,t){if(!cp.includes(t))return e[t];let r=Va[t];return r||(r=Va[t]=function(...n){Kn.set(this,Ba.get(this)[t](...n))}),r}};async function*up(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,lp);for(Ba.set(r,t),Mr.set(r,qn(t));t;)yield r,t=await(Kn.get(r)||t.continue()),Kn.delete(r)}function za(e,t){return t===Symbol.asyncIterator&&Bn(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Bn(e,[IDBIndex,IDBObjectStore])}Ra(e=>({...e,get(t,r,n){return za(t,r)?up:e.get(t,r,n)},has(t,r){return za(t,r)||e.has(t,r)}}));const Wt=e=>st(e).with(N.number.lte(1e3),()=>`${Math.round(e)}KB`).with(N.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),Ua=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},dp=e=>Object.entries(e).reduce((r,[n,o])=>(r[n]=o.value,r),{}),Kt=e=>t=>t?t.type===e:!1;class Gt extends Error{constructor(){super("Aborted")}}function fp(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const Ha=e=>typeof e=="string",hp=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),qa=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:hp()}),pp=e=>st(e).with({nativeEvent:{submitter:N.select(N.union(N.instanceOf(HTMLButtonElement),N.instanceOf(HTMLInputElement)))}},t=>t).otherwise(()=>{throw new Error("invalid submitter")}),Wa=typeof window>"u"?void 0:ip("inploi-chatbot",3,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Yt={getStateData:async(e,t)=>{var n;const r=Ka({...e,flowKeys:t});return(n=await Wa)==null?void 0:n.get("state",r)},setStateData:fp(async e=>{var r;const t=Ka(e);return(r=await Wa)==null?void 0:r.put("state",e.data,t)},1e3)},Fr=(e,t,r,n=0)=>{if(!t.nextId)return r(t.id,{stepsMade:n,remainingSteps:0}),{stepsMade:n,remainingSteps:0};const o=e.find(u=>u.id===t.nextId);if(o===void 0)return{stepsMade:n,remainingSteps:0};const i=t.type==="if-block"?t.branchId:void 0,a=e.find(u=>u.id===i),s=t.type.includes("question")?1:0;if(a){const u=s+Math.max(Fr(e,o,r,n+s).remainingSteps,Fr(e,a,r,n+s).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const c=s+Fr(e,o,r,n+s).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:c}),{stepsMade:n,remainingSteps:c}},vp=e=>{const t={},r=e.find(n=>n.isHead);return r&&Fr(e,r,(n,o)=>{t[n]=o}),t},Ka=e=>[...e.flowKeys,e.id,e.version].join("/"),Xe=Ge({state:"idle"}),Xt=e=>{const{state:t,flow:r}=Xe.value;if(t!=="loaded")return;Se(r,"No flow to update");const n=e(r.data);r.data=n,Xe.value={state:t,flow:r},Yt.setStateData(r)},P={current$:Xe,viewState$:Ge("closed"),inputHeight$:Ge(53),startFlow:async({flow:e,context:t={},flowKeys:r,title:n,analytics:o,job:i})=>{const s={data:await Yt.getStateData(e,r)??qa(),startedAt:new Date,nodeIdToProgress:vp(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n,analytics:o,job:i};Xe.value={state:"loaded",flow:s},Yt.setStateData(s)},cancelCurrentFlow:()=>{Xe.value={state:"idle"},P.viewState$.value="closed"},markAsFinished:()=>Xt(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Xt(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=Xe.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=qa();Xe.value={state:e,flow:{...t,data:r,startedAt:new Date}},Yt.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Xt(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=Xe.value;Se(t==="loaded","Application not loaded");const n=r.data.messages.filter(o=>!o.groupId||!e.includes(o.groupId));r.data.messages=n,Yt.setStateData(r)},setSubmission:(e,t)=>Xt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Xt(t=>({...t,currentInput:e??null}))};var mp=0;function d(e,t,r,n,o,i){var a,s,c={};for(s in t)s=="ref"?a=t[s]:c[s]=t[s];var u={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--mp,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)c[s]===void 0&&(c[s]=a[s]);return S.vnode&&S.vnode(u),u}const gp=({message:e})=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:[d("svg",{class:"text-error-9 h-16 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round",viewBox:"0 0 96 96",children:[d("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",fill:"#fff"}),d("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"}),d("line",{x1:"36.7",y1:"39.3",x2:"44.8",y2:"47.4"}),d("line",{x1:"52.2",y1:"39.3",x2:"60.3",y2:"47.4"}),d("line",{x1:"44.7",y1:"39.2",x2:"36.6",y2:"47.3"}),d("line",{x1:"60.2",y1:"39.2",x2:"52.1",y2:"47.3"}),d("path",{d:"M38 56h19"})]}),d("div",{class:"flex flex-col gap-2 text-center",children:[d("p",{class:"text-error-11 font-bold",children:"Something unexpected happened"}),e&&d("p",{class:"text-neutral-9 text-sm",children:e})]})]}),Ga=e=>d("svg",{role:"img",viewBox:"0 0 24 24",...e,children:[d("title",{children:"Loading"}),d("style",{children:"#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}"}),d("g",{id:"s1",transform:"translate(12,0)",children:d("g",{id:"s2",transform:"scale(0,0)",children:d("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),d("g",{id:"s3",transform:"translate(12,12)",children:d("g",{id:"s4",transform:"scale(1,1)",children:d("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),d("g",{id:"s5",transform:"translate(12,0)",children:d("g",{id:"s6",transform:"scale(0,0)",children:d("path",{d:"M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",transform:"translate(-6.5,-6.5)","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})})}),d("g",{id:"s7",transform:"translate(12,0)",children:d("g",{id:"s8",transform:"scale(0,0)",children:d("path",{d:"M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",transform:"translate(-6.5,-9.25)",fill:"currentColor"})})})]}),Ya=()=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Ga,{class:"text-neutral-6 h-8 w-8"})}),bp=e=>{const r=e/100,n=1.3;return e<0?"0%":e>100?"100%":`${Math.round((1-(1-.1)*Math.pow(1-r,n))*100)}%`},Lr=({class:e,children:t,...r})=>d("button",{class:ot("touch-hitbox text-interactive-copy hover:text-interactive-copy-hover active:text-interactive-copy-active hover:bg-interactive-bg-hover active:bg-interactive-bg-active fr relative rounded-full p-2 transition-all",e),...r,children:d("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",xmlns:"http://www.w3.org/2000/svg",children:t})}),yp=()=>{if(P.current$.value.state!=="loaded")return null;const e=P.current$.value.flow.nodeIdToProgress,t=P.current$.value.flow.data.nodeHistory.at(-1);if(t===void 0)return null;const r=e[t];if(r===void 0)return null;const n=100*(r.stepsMade/(r.remainingSteps+r.stepsMade));return d("div",{class:"bg-accent-3",children:d("div",{style:{width:bp(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},_p=({children:e})=>{const t=P.viewState$;return d(Y,{children:d("header",{class:"ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",children:[d("div",{class:"flex h-[var(--header-height)] gap-2",children:[d("p",{id:"chatbot-status-bar",class:"sr-only",children:e}),d("button",{tabIndex:-1,onClick:()=>{t.value==="minimised"?t.value="maximised":t.value="minimised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1",onTouchStart:Gn,children:d("p",{"aria-hidden":!0,class:"text-neutral-12 truncate text-sm font-bold tracking-tight",children:e})}),d("div",{class:"flex flex-shrink-0 items-center gap-3 p-1.5",children:t.value==="minimised"?d(Y,{children:[d(Lr,{class:"view-switch",onTouchStart:Gn,"aria-label":"Maximise job application",onClick:()=>t.value="maximised",children:d("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),d(Lr,{"aria-label":"Close application",onClick:P.cancelCurrentFlow,children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):d(Y,{children:[P.current$.value.state==="loaded"&&d(Lr,{"aria-label":"Restart",onClick:()=>{P.restart()},children:[d("path",{d:"M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"}),d("path",{d:"M8 7L10 4.5L8 2.5"})]},"restart"),d(Lr,{class:"view-switch",onTouchStart:Gn,"aria-label":"Minimise application",onClick:()=>t.value="minimised",children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),d(yp,{})]})})};function Gn(){}const wp=pn(()=>Promise.resolve().then(()=>jm).then(e=>e.ChatbotBody)),xp=Tr("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none [&:has(.view-switch:active)]:scale-[0.98] transition-all duration-1000 ease-expo-out",{variants:{view:{closed:"hidden",minimised:"h-[var(--header-height)] animate-slide-in-bottom",maximised:"h-[var(--content-height)] animate-maximise"}}}),kp=({logger:e,apiClient:t,analytics:r})=>{const{state:n,flow:o,error:i}=P.current$.value,a=P.viewState$.value,s=n!=="idle"&&a==="maximised",c=L(null);return d(Mh,{open:s,modal:s,children:[d(Fh,{class:"bg-overlay animate-fade-in pointer-events-none fixed inset-0 isolate"}),d(Lh,{forceMount:!0,asChild:!0,children:d("div",{ref:c,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:xp({view:a}),children:d("div",{class:"outline-neutral-3 bg-neutral-1 relative flex h-full flex-col overflow-hidden rounded-3xl outline outline-1",children:[d(_p,{children:o==null?void 0:o.title}),st({state:n,view:a}).with({view:"closed"},()=>null).with({view:"minimised"},()=>null).with({state:"idle"},()=>null).with({state:"loading"},()=>d(Ya,{},"loading")).with({state:"loaded"},()=>d(yt,{fallback:d(Ya,{},"loading"),children:d(wp,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>d(gp,{message:i})).exhaustive()]})})})]})},Xa=de({id:ti(se(),String),version:cn(),build:cn(),nodes:ii(Dd()),context_schema:jt(Md(ci(se(),de({required:ai(),type:jd([si("string"),si("number")])}))))}),$p=de({flow:Xa}),Sp=de({company:de({name:se()}),flow:Xa,job:de({id:ti(se(),String),title:se()})}),Cp=`#isdk{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;z-index:99999;font-size:16px;font-family:sans-serif;--i-lowest: 0 0% 100%;--i-e-1: 340 100% 99%;--i-e-2: 353 100% 98%;--i-e-3: 351 91% 96%;--i-e-4: 351 100% 93%;--i-e-5: 350 100% 90%;--i-e-6: 351 80% 86%;--i-e-7: 349 68% 81%;--i-e-8: 348 61% 74%;--i-e-9: 348 75% 59%;--i-e-10: 347 70% 55%;--i-e-11: 345 70% 47%;--i-e-12: 344 63% 24%;--header-height: 44px;--content-height:calc(100vh - 64px);--content-height:calc(100svh - 64px)}@media screen and (min-width: 768px){#isdk{--content-height: min(640px, calc(100vh - 16px));--content-height: min(640px, calc(100svh - 16px)) }}#isdk{--tw-content: "";font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#isdk em{font-style:italic}#isdk strong{font-weight:700}#isdk *{font-weight:inherit;font-style:inherit;box-sizing:border-box;font-family:inherit;border-style:solid;border-width:0;-webkit-tap-highlight-color:transparent}#isdk :before,#isdk :after{box-sizing:border-box}#isdk :is(ul,ol){list-style:none;padding:0;margin:0}#isdk :is(p){margin:0;padding:0}#isdk :is(li){margin:0;padding:0;list-style:none}#isdk :is(button){margin:0;padding:0;border:unset;background:unset;text-align:unset}#isdk *,#isdk :before,#isdk :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#isdk ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#isdk .container{width:100%}@media (min-width: 640px){#isdk .container{max-width:640px}}@media (min-width: 768px){#isdk .container{max-width:768px}}@media (min-width: 1024px){#isdk .container{max-width:1024px}}@media (min-width: 1280px){#isdk .container{max-width:1280px}}@media (min-width: 1536px){#isdk .container{max-width:1536px}}#isdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#isdk .pointer-events-none{pointer-events:none}#isdk .visible{visibility:visible}#isdk .collapse{visibility:collapse}#isdk .static{position:static}#isdk .fixed{position:fixed}#isdk .absolute{position:absolute}#isdk .relative{position:relative}#isdk .sticky{position:sticky}#isdk .inset-0{top:0;right:0;bottom:0;left:0}#isdk .bottom-0{bottom:0}#isdk .bottom-2{bottom:.5rem}#isdk .bottom-2\\.5{bottom:.625rem}#isdk .left-0{left:0}#isdk .left-2{left:.5rem}#isdk .right-0{right:0}#isdk .right-2{right:.5rem}#isdk .top-0{top:0}#isdk .isolate{isolation:isolate}#isdk .z-20{z-index:20}#isdk .m-0{margin:0}#isdk .mx-auto{margin-left:auto;margin-right:auto}#isdk .mb-1{margin-bottom:.25rem}#isdk .ml-auto{margin-left:auto}#isdk .mt-auto{margin-top:auto}#isdk .block{display:block}#isdk .inline-block{display:inline-block}#isdk .inline{display:inline}#isdk .flex{display:flex}#isdk .inline-flex{display:inline-flex}#isdk .table{display:table}#isdk .table-row{display:table-row}#isdk .flow-root{display:flow-root}#isdk .grid{display:grid}#isdk .inline-grid{display:inline-grid}#isdk .contents{display:contents}#isdk .list-item{display:list-item}#isdk .\\!hidden{display:none!important}#isdk .hidden{display:none}#isdk .h-1{height:.25rem}#isdk .h-1\\.5{height:.375rem}#isdk .h-16{height:4rem}#isdk .h-4{height:1rem}#isdk .h-48{height:12rem}#isdk .h-8{height:2rem}#isdk .h-\\[3px\\]{height:3px}#isdk .h-\\[var\\(--content-height\\)\\]{height:var(--content-height)}#isdk .h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}#isdk .h-full{height:100%}#isdk .max-h-full{max-height:100%}#isdk .min-h-\\[36px\\]{min-height:36px}#isdk .w-1{width:.25rem}#isdk .w-1\\.5{width:.375rem}#isdk .w-16{width:4rem}#isdk .w-24{width:6rem}#isdk .w-4{width:1rem}#isdk .w-8{width:2rem}#isdk .w-full{width:100%}#isdk .min-w-0{min-width:0px}#isdk .min-w-\\[2rem\\]{min-width:2rem}#isdk .max-w-\\[450px\\]{max-width:450px}#isdk .max-w-\\[min\\(100\\%\\,24rem\\)\\]{max-width:min(100%,24rem)}#isdk .max-w-full{max-width:100%}#isdk .flex-1{flex:1 1 0%}#isdk .flex-none{flex:none}#isdk .flex-shrink{flex-shrink:1}#isdk .flex-shrink-0{flex-shrink:0}#isdk .shrink{flex-shrink:1}#isdk .flex-grow,#isdk .grow{flex-grow:1}#isdk .border-collapse{border-collapse:collapse}#isdk .translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#isdk .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}#isdk .animate-bounce{animation:bounce 1s infinite}@keyframes bubble-in{0%{transform:translateY(100%) scale(.8);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}#isdk .animate-bubble-in{animation:bubble-in .3s cubic-bezier(.34,1.56,.64,1)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}#isdk .animate-fade-in{animation:fade-in .5s cubic-bezier(.16,1,.3,1) both}@keyframes maximise{0%{transform:translateY(50%) scaleX(.7)}to{transform:translateY(0)}}#isdk .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes slide-in-bottom{0%{transform:translateY(-100%) scaleX(.82)}to{transform:translateY(0)}}#isdk .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.175,.885,.32,1.275)}#isdk .cursor-pointer{cursor:pointer}#isdk .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#isdk .select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}#isdk .resize{resize:both}#isdk .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#isdk .flex-col{flex-direction:column}#isdk .flex-wrap{flex-wrap:wrap}#isdk .items-center{align-items:center}#isdk .items-stretch{align-items:stretch}#isdk .justify-end{justify-content:flex-end}#isdk .justify-center{justify-content:center}#isdk .gap-0{gap:0px}#isdk .gap-1{gap:.25rem}#isdk .gap-1\\.5{gap:.375rem}#isdk .gap-2{gap:.5rem}#isdk .gap-3{gap:.75rem}#isdk .gap-4{gap:1rem}#isdk .gap-px{gap:1px}#isdk .overflow-hidden{overflow:hidden}#isdk .overflow-y-auto{overflow-y:auto}#isdk .overflow-y-scroll{overflow-y:scroll}#isdk .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#isdk .text-ellipsis{text-overflow:ellipsis}#isdk .whitespace-nowrap{white-space:nowrap}#isdk .break-words{overflow-wrap:break-word}#isdk .rounded{border-radius:.25rem}#isdk .rounded-2xl{border-radius:1rem}#isdk .rounded-3xl{border-radius:1.5rem}#isdk .rounded-\\[18px\\]{border-radius:18px}#isdk .rounded-full{border-radius:9999px}#isdk .rounded-lg{border-radius:.5rem}#isdk .rounded-md{border-radius:.375rem}#isdk .rounded-xl{border-radius:.75rem}#isdk .rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}#isdk .rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}#isdk .rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}#isdk .rounded-bl-md{border-bottom-left-radius:.375rem}#isdk .rounded-br-md{border-bottom-right-radius:.375rem}#isdk .border{border-width:1px}#isdk .border-b{border-bottom-width:1px}#isdk .border-t{border-top-width:1px}#isdk .border-solid{border-style:solid}#isdk .border-dashed{border-style:dashed}#isdk .border-accent-9{border-color:var(--i-color-a-9)}#isdk .border-divider{border-color:var(--i-color-divider)}#isdk .border-neutral-5{border-color:var(--i-color-n-5)}#isdk .border-neutral-8{border-color:var(--i-color-n-8)}#isdk .border-transparent{border-color:transparent}#isdk .border-b-neutral-3{border-bottom-color:var(--i-color-n-3)}#isdk .border-b-neutral-5{border-bottom-color:var(--i-color-n-5)}#isdk .border-b-transparent{border-bottom-color:transparent}#isdk .bg-accent-1{background-color:var(--i-color-a-1)}#isdk .bg-accent-3{background-color:var(--i-color-a-3)}#isdk .bg-accent-9{background-color:var(--i-color-a-9)}#isdk .bg-bubble-weak-bg{background-color:var(--i-bubble-weak-bg)}#isdk .bg-lowest{background-color:var(--i-color-lowest)}#isdk .bg-neutral-1{background-color:var(--i-color-n-1)}#isdk .bg-neutral-2{background-color:var(--i-color-n-2)}#isdk .bg-neutral-3{background-color:var(--i-color-n-3)}#isdk .bg-overlay{background-color:var(--i-overlay-bg)}#isdk .bg-statusbar{background-color:var(--i-status-bar-bg)}#isdk .bg-transparent{background-color:transparent}#isdk .bg-none{background-image:none}#isdk .p-1{padding:.25rem}#isdk .p-1\\.5{padding:.375rem}#isdk .p-2{padding:.5rem}#isdk .p-2\\.5{padding:.625rem}#isdk .p-4{padding:1rem}#isdk .px-1{padding-left:.25rem;padding-right:.25rem}#isdk .px-2{padding-left:.5rem;padding-right:.5rem}#isdk .px-2\\.5{padding-left:.625rem;padding-right:.625rem}#isdk .px-3{padding-left:.75rem;padding-right:.75rem}#isdk .px-4{padding-left:1rem;padding-right:1rem}#isdk .px-5{padding-left:1.25rem;padding-right:1.25rem}#isdk .py-0{padding-top:0;padding-bottom:0}#isdk .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}#isdk .py-1{padding-top:.25rem;padding-bottom:.25rem}#isdk .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}#isdk .py-2{padding-top:.5rem;padding-bottom:.5rem}#isdk .py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}#isdk .py-3{padding-top:.75rem;padding-bottom:.75rem}#isdk .py-\\[6px\\]{padding-top:6px;padding-bottom:6px}#isdk .pb-2{padding-bottom:.5rem}#isdk .pb-6{padding-bottom:1.5rem}#isdk .pl-1{padding-left:.25rem}#isdk .pl-1\\.5{padding-left:.375rem}#isdk .pl-2{padding-left:.5rem}#isdk .pl-4{padding-left:1rem}#isdk .pr-1{padding-right:.25rem}#isdk .pr-2{padding-right:.5rem}#isdk .pr-2\\.5{padding-right:.625rem}#isdk .pr-3{padding-right:.75rem}#isdk .pr-4{padding-right:1rem}#isdk .pt-2{padding-top:.5rem}#isdk .pt-2\\.5{padding-top:.625rem}#isdk .pt-3{padding-top:.75rem}#isdk .pt-5{padding-top:1.25rem}#isdk .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\]{padding-top:calc(var(--header-height) + 1rem)}#isdk .text-center{text-align:center}#isdk .text-right{text-align:right}#isdk .text-justify{text-align:justify}#isdk .text-\\[10px\\]{font-size:10px}#isdk .text-\\[11px\\]{font-size:11px}#isdk .text-base{font-size:1rem;line-height:1.5rem}#isdk .text-sm{font-size:.875rem;line-height:1.25rem}#isdk .text-xs{font-size:.75rem;line-height:1rem}#isdk .font-bold{font-weight:700}#isdk .font-medium{font-weight:500}#isdk .uppercase{text-transform:uppercase}#isdk .lowercase{text-transform:lowercase}#isdk .capitalize{text-transform:capitalize}#isdk .italic{font-style:italic}#isdk .ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}#isdk .leading-3{line-height:.75rem}#isdk .leading-snug{line-height:1.375}#isdk .tracking-\\[-0\\.01em\\]{letter-spacing:-.01em}#isdk .tracking-tight{letter-spacing:-.025em}#isdk .tracking-wide{letter-spacing:.025em}#isdk .tracking-widest{letter-spacing:.1em}#isdk .text-\\[\\#4CAF50\\]{--tw-text-opacity: 1;color:rgb(76 175 80 / var(--tw-text-opacity))}#isdk .text-\\[\\#FFC107\\]{--tw-text-opacity: 1;color:rgb(255 193 7 / var(--tw-text-opacity))}#isdk .text-accent-10{color:var(--i-color-a-10)}#isdk .text-accent-11{color:var(--i-color-a-11)}#isdk .text-accent-12{color:var(--i-color-a-12)}#isdk .text-accent-9{color:var(--i-color-a-9)}#isdk .text-error-11{color:var(--i-color-e-11)}#isdk .text-error-9{color:var(--i-color-e-9)}#isdk .text-interactive-copy{color:var(--i-interactive-copy)}#isdk .text-neutral-10{color:var(--i-color-n-10)}#isdk .text-neutral-11{color:var(--i-color-n-11)}#isdk .text-neutral-12{color:var(--i-color-n-12)}#isdk .text-neutral-6{color:var(--i-color-n-6)}#isdk .text-neutral-8{color:var(--i-color-n-8)}#isdk .text-neutral-9{color:var(--i-color-n-9)}#isdk .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#isdk .underline{text-decoration-line:underline}#isdk .no-underline{text-decoration-line:none}#isdk .underline-offset-2{text-underline-offset:2px}#isdk .caret-accent-9{caret-color:var(--i-color-a-9)}#isdk .opacity-0{opacity:0}#isdk .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-surface-md{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 6px 4px 0px oklch(0% 0 0 / .01);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-surface-sm{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 4px 4px 0px oklch(0% 0 0 / .02);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-bubble-strong-shadow{--tw-shadow-color: var(--i-bubble-strong-shadow);--tw-shadow: var(--tw-shadow-colored)}#isdk .outline-none{outline:2px solid transparent;outline-offset:2px}#isdk .outline{outline-style:solid}#isdk .outline-1{outline-width:1px}#isdk .outline-2{outline-width:2px}#isdk .outline-accent-4{outline-color:var(--i-color-a-4)}#isdk .outline-bubble-weak{outline-color:var(--i-bubble-weak-outline)}#isdk .outline-divider{outline-color:var(--i-color-divider)}#isdk .outline-neutral-3{outline-color:var(--i-color-n-3)}#isdk .outline-neutral-6{outline-color:var(--i-color-n-6)}#isdk .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-accent-6{--tw-ring-color: var(--i-color-a-6)}#isdk .ring-divider{--tw-ring-color: var(--i-color-divider)}#isdk .ring-lowest{--tw-ring-color: var(--i-color-lowest)}#isdk .ring-transparent{--tw-ring-color: transparent}#isdk .ring-offset-\\[1\\.5px\\]{--tw-ring-offset-width: 1.5px}#isdk .ring-offset-neutral-1{--tw-ring-offset-color: var(--i-color-n-1)}#isdk .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\]{--tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-saturate-150{--tw-backdrop-saturate: saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .duration-100{transition-duration:.1s}#isdk .duration-1000{transition-duration:1s}#isdk .duration-300{transition-duration:.3s}#isdk .duration-700{transition-duration:.7s}#isdk .ease-expo-out{transition-timing-function:cubic-bezier(.16,1,.3,1)}#isdk .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}#isdk .will-change-\\[height\\]{will-change:height}#isdk .text-wrap-balance{text-wrap:balance}#isdk .fr{outline:none}#isdk .fr:focus{outline:none}#isdk .fr:focus-visible{outline:none;--tw-ring-offset-width: 1px;--tw-ring-offset-color: var(--i-color-lowest);--tw-ring-opacity: 1;--tw-ring-color: var(--i-color-a-9);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .gutter-stable{scrollbar-gutter:stable}#isdk .hide-scrollbars::-webkit-scrollbar{display:none}#isdk .hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}#isdk .touch-hitbox:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}#isdk .\\[-webkit-outer-spin-button\\:none\\]{-webkit-outer-spin-button:none}#isdk .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\]{a-z-a--z0-9-_:.$@?}#isdk .\\[grid-template-columns\\:min-content_1fr\\]{grid-template-columns:min-content 1fr}#isdk .\\[text-wrap\\:pretty\\]{text-wrap:pretty}#isdk .selection\\:bg-accent-4 *::-moz-selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-accent-4 *::selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-transparent *::-moz-selection{background-color:transparent}#isdk .selection\\:bg-transparent *::selection{background-color:transparent}#isdk .selection\\:text-accent-12 *::-moz-selection{color:var(--i-color-a-12)}#isdk .selection\\:text-accent-12 *::selection{color:var(--i-color-a-12)}#isdk .selection\\:bg-accent-4::-moz-selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-accent-4::selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-transparent::-moz-selection{background-color:transparent}#isdk .selection\\:bg-transparent::selection{background-color:transparent}#isdk .selection\\:text-accent-12::-moz-selection{color:var(--i-color-a-12)}#isdk .selection\\:text-accent-12::selection{color:var(--i-color-a-12)}#isdk .placeholder\\:text-neutral-10::-moz-placeholder{color:var(--i-color-n-10)}#isdk .placeholder\\:text-neutral-10::placeholder{color:var(--i-color-n-10)}#isdk .placeholder\\:text-neutral-8::-moz-placeholder{color:var(--i-color-n-8)}#isdk .placeholder\\:text-neutral-8::placeholder{color:var(--i-color-n-8)}#isdk .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .focus-within\\:bg-neutral-5:focus-within{background-color:var(--i-color-n-5)}#isdk .focus-within\\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}#isdk .focus-within\\:outline-accent-7:focus-within{outline-color:var(--i-color-a-7)}#isdk .hover\\:border-accent-10:hover{border-color:var(--i-color-a-10)}#isdk .hover\\:border-neutral-5:hover{border-color:var(--i-color-n-5)}#isdk .hover\\:bg-accent-10:hover{background-color:var(--i-color-a-10)}#isdk .hover\\:bg-interactive-bg-hover:hover{background-color:var(--i-interactive-bg-hover)}#isdk .hover\\:bg-neutral-2:hover{background-color:var(--i-color-n-2)}#isdk .hover\\:bg-neutral-3:hover{background-color:var(--i-color-n-3)}#isdk .hover\\:bg-neutral-4:hover{background-color:var(--i-color-n-4)}#isdk .hover\\:bg-neutral-5:hover{background-color:var(--i-color-n-5)}#isdk .hover\\:text-accent-11:hover{color:var(--i-color-a-11)}#isdk .hover\\:text-interactive-copy-hover:hover{color:var(--i-interactive-copy-hover)}#isdk .hover\\:text-neutral-12:hover{color:var(--i-color-n-12)}#isdk .hover\\:underline:hover{text-decoration-line:underline}#isdk .hover\\:ring-accent-8:hover{--tw-ring-color: var(--i-color-a-8)}#isdk .focus\\:bg-neutral-5:focus{background-color:var(--i-color-n-5)}#isdk .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}#isdk .focus-visible\\:bg-neutral-3:focus-visible{background-color:var(--i-color-n-3)}#isdk .focus-visible\\:outline-2:focus-visible{outline-width:2px}#isdk .focus-visible\\:outline-accent-7:focus-visible{outline-color:var(--i-color-a-7)}#isdk .focus-visible\\:outline-accent-8:focus-visible{outline-color:var(--i-color-a-8)}#isdk .focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}#isdk .active\\:border-submit-bg-active:active{border-color:var(--i-submit-button-bg-active)}#isdk .active\\:bg-accent-10:active{background-color:var(--i-color-a-10)}#isdk .active\\:bg-accent-2:active{background-color:var(--i-color-a-2)}#isdk .active\\:bg-interactive-bg-active:active{background-color:var(--i-interactive-bg-active)}#isdk .active\\:bg-submit-bg-active:active{background-color:var(--i-submit-button-bg-active)}#isdk .active\\:text-accent-10:active{color:var(--i-color-a-10)}#isdk .active\\:text-accent-11:active{color:var(--i-color-a-11)}#isdk .active\\:text-interactive-copy-active:active{color:var(--i-interactive-copy-active)}#isdk .active\\:outline-neutral-8:active{outline-color:var(--i-color-n-8)}#isdk .active\\:ring-2:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .active\\:ring-accent-7:active{--tw-ring-color: var(--i-color-a-7)}#isdk .active\\:ring-offset-2:active{--tw-ring-offset-width: 2px}#isdk .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#isdk .disabled\\:opacity-50:disabled{opacity:.5}#isdk .peer:checked~.peer-checked\\:bg-accent-2{background-color:var(--i-color-a-2)}#isdk .peer:checked~.peer-checked\\:text-accent-9{color:var(--i-color-a-9)}#isdk .peer:checked~.peer-checked\\:outline-accent-7{outline-color:var(--i-color-a-7)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-accent-9{--tw-ring-color: var(--i-color-a-9)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-offset-accent-7{--tw-ring-offset-color: var(--i-color-a-7)}@media (pointer: coarse){#isdk .pointer-coarse\\:touch-hitbox\\:\\:before:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}}#isdk .\\[\\&\\:has\\(\\+\\*\\>input\\:focus\\)\\]\\:text-neutral-11:has(+*>input:focus){color:var(--i-color-n-11)}#isdk .\\[\\&\\:has\\(\\.view-switch\\:active\\)\\]\\:scale-\\[0\\.98\\]:has(.view-switch:active){--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}
42
- `,Za="isdk",Ep={not_in_local_storage:"Application not found in local storage",invalid_end_node:"Unexpected node type to finish flow",no_submissions:"Application ended without any fields submitted",invalid_state:"Invalid state"},Tp=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(Za);if(e)return document.body.appendChild(e),e;const t=document.createElement("div");return document.body.appendChild(t),t.id=Za,t}});var Op=["1","2","3","4","5","6","7","8","9","10","11","12"],Ip={light:{1:[98.8,.015],2:[97.8,.018],3:[95.8,.025],4:[92,.04],5:[89,.05],6:[85,.07],7:[80.5,.08],8:[74,.11],9:[60,.22],10:[56,.23],11:[50,.19],12:[25,.18]},dark:{1:[19,.015],2:[21,.018],3:[25.5,.055],4:[29.3,.084],5:[33.5,.098],6:[39.05,.107],7:[45,.11],8:[55,.13],9:[60,.22],10:[67,.18],11:[79.3,.12],12:[95,.04]}},Ap=(e,t=1,r)=>n=>{const[o,i]=Ip[r][n];return"oklch("+o+"% "+i*t+" "+e+")"},Yn=e=>{const t=Ap(e.hue,e.chroma,e.mode);return Object.fromEntries(Op.map(r=>[e.prefix+r,e.transform(t(r))]))},Xn=e=>e,Pp=e=>{const t=Object.keys(e).flatMap(r=>{const n=e[r];return typeof n=="object"&&n!==null?Object.keys(n).map(o=>{const i=n[o];return[`${String(r)}.${o}`,i]}):[[r,n]]});return Object.fromEntries(t)},Rr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Zn=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(Rr(e)&&Rr(r))for(const n in r){const o=r[n];if(Rr(o)){e[n]||Object.assign(e,{[n]:{}});const i=e[n];Rr(i)&&Zn(i,o)}else Object.assign(e,{[n]:r[n]})}return Zn(e,...t)},Np=e=>{function t(r,n){const o=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${o}`:`var(--${o})`}return t},Dp=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:o,getToken:i}=n,a=p=>i("reference",p.toString()),s=e({theme:o}),c=t({theme:o,core:a,raw:{core:s}}),u=r({theme:o,core:a,semantic:a,raw:{core:s,semantic:c}}),f=Pp(Zn(s,c,u)),l=([p,m],g)=>{const v=[g,p].filter(Boolean).join(".");return typeof m=="object"?Object.entries(m).flatMap(_=>l(_,v)):[[n.getToken("declaration",v),m]]};return{values:f,declarations:Object.fromEntries(Object.entries(f).flatMap(p=>l(p))),ref:p=>i("reference",p.toString())}}})})})});const[Jn,Qn,Ja]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],Mp=Dp().core(({theme:e})=>({color:{black:Jn,white:Qn,lowest:e.mode==="light"?Qn:Jn,highest:e.mode==="light"?Jn:Qn,...Yn({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:Xn}),...Yn({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:Xn}),...Yn({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:Xn})},typography:{}})).semantic(({core:e,raw:t,theme:r})=>{const n=(o,i)=>t.core.color[o].replace(")",` / ${i})`);return{"font-family":{body:"inherit",headings:"inherit"},"font-style":{body:"normal",headings:"normal"},"font-weight-body":"normal","font-weight-headings":"normal","radius-app":"1.5rem","radius-interactive":"1.5rem",color:{divider:n("n-8",r.mode==="dark"?.4:.2)},"copy-body":e("color.n-12"),"copy-headings":e("color.n-12"),interactive:{copy:e("color.n-11"),"copy-hover":e("color.n-12"),"copy-active":e("color.n-12"),bg:Ja,"bg-hover":n("n-10",.4),"bg-active":n("n-10",.5)}}}).component(({raw:e,theme:t,semantic:r,core:n})=>{const o=(i,a)=>e.core.color[i].replace(")",` / ${a})`);return{app:{bg:n(t.mode==="dark"?"color.n-1":"color.n-2")},overlay:{bg:o("black",.4)},bubble:{"weak-bg":n(t.mode==="dark"?"color.n-3":"color.lowest"),"weak-outline":r("color.divider"),"strong-shadow":o("a-9",.05)},"status-bar":{bg:o("n-2",.8),"bg-button":Ja,"bg-button-hover":o("n-10",.4),"bg-button-active":o("n-10",.5)},"submit-button":{"bg-active":n(t.mode==="dark"?"color.a-8":"color.a-11")}}}),Fp=Np({prefix:"i-"}),Lp=e=>{const t=Mp.from({theme:e,getToken:Fp}),r=Object.entries(t.declarations).map(([n,o])=>`${n}: ${o};`);return`#isdk {
1
+ var _p=Object.defineProperty;var yp=(We,ve,Te)=>ve in We?_p(We,ve,{enumerable:!0,configurable:!0,writable:!0,value:Te}):We[ve]=Te;var ko=(We,ve,Te)=>(yp(We,typeof ve!="symbol"?ve+"":ve,Te),Te);(function(){"use strict";var We=e=>e,ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var So=Array.isArray,Sr=So,Co=typeof ve=="object"&&ve&&ve.Object===Object&&ve,$o=Co,Eo=$o,Io=typeof self=="object"&&self&&self.Object===Object&&self,To=Eo||Io||Function("return this")(),Cr=To,Ao=Cr,Mo=Ao.Symbol,$r=Mo,Mn=$r,Nn=Object.prototype,No=Nn.hasOwnProperty,Po=Nn.toString,_t=Mn?Mn.toStringTag:void 0;function Oo(e){var t=No.call(e,_t),r=e[_t];try{e[_t]=void 0;var n=!0}catch{}var i=Po.call(e);return n&&(t?e[_t]=r:delete e[_t]),i}var Fo=Oo,Lo=Object.prototype,Do=Lo.toString;function Vo(e){return Do.call(e)}var jo=Vo,Pn=$r,zo=Fo,Ro=jo,Bo="[object Null]",Uo="[object Undefined]",On=Pn?Pn.toStringTag:void 0;function Ho(e){return e==null?e===void 0?Uo:Bo:On&&On in Object(e)?zo(e):Ro(e)}var Fn=Ho;function qo(e){return e!=null&&typeof e=="object"}var Ko=qo,Go=Fn,Wo=Ko,Yo="[object Symbol]";function Jo(e){return typeof e=="symbol"||Wo(e)&&Go(e)==Yo}var Er=Jo,Zo=Sr,Xo=Er,Qo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,es=/^\w*$/;function ts(e,t){if(Zo(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Xo(e)?!0:es.test(e)||!Qo.test(e)||t!=null&&e in Object(t)}var rs=ts;function ns(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ln=ns,is=Fn,as=Ln,os="[object AsyncFunction]",ss="[object Function]",ls="[object GeneratorFunction]",cs="[object Proxy]";function us(e){if(!as(e))return!1;var t=is(e);return t==ss||t==ls||t==os||t==cs}var ds=us,fs=Cr,hs=fs["__core-js_shared__"],ps=hs,Ir=ps,Dn=function(){var e=/[^.]+$/.exec(Ir&&Ir.keys&&Ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vs(e){return!!Dn&&Dn in e}var ms=vs,gs=Function.prototype,bs=gs.toString;function _s(e){if(e!=null){try{return bs.call(e)}catch{}try{return e+""}catch{}}return""}var ys=_s,ws=ds,xs=ms,ks=Ln,Ss=ys,Cs=/[\\^$.*+?()[\]{}|]/g,$s=/^\[object .+?Constructor\]$/,Es=Function.prototype,Is=Object.prototype,Ts=Es.toString,As=Is.hasOwnProperty,Ms=RegExp("^"+Ts.call(As).replace(Cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ns(e){if(!ks(e)||xs(e))return!1;var t=ws(e)?Ms:$s;return t.test(Ss(e))}var Ps=Ns;function Os(e,t){return e==null?void 0:e[t]}var Fs=Os,Ls=Ps,Ds=Fs;function Vs(e,t){var r=Ds(e,t);return Ls(r)?r:void 0}var Vn=Vs,js=Vn,zs=js(Object,"create"),Ut=zs,jn=Ut;function Rs(){this.__data__=jn?jn(null):{},this.size=0}var Bs=Rs;function Us(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Hs=Us,qs=Ut,Ks="__lodash_hash_undefined__",Gs=Object.prototype,Ws=Gs.hasOwnProperty;function Ys(e){var t=this.__data__;if(qs){var r=t[e];return r===Ks?void 0:r}return Ws.call(t,e)?t[e]:void 0}var Js=Ys,Zs=Ut,Xs=Object.prototype,Qs=Xs.hasOwnProperty;function el(e){var t=this.__data__;return Zs?t[e]!==void 0:Qs.call(t,e)}var tl=el,rl=Ut,nl="__lodash_hash_undefined__";function il(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=rl&&t===void 0?nl:t,this}var al=il,ol=Bs,sl=Hs,ll=Js,cl=tl,ul=al;function at(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}at.prototype.clear=ol,at.prototype.delete=sl,at.prototype.get=ll,at.prototype.has=cl,at.prototype.set=ul;var dl=at;function fl(){this.__data__=[],this.size=0}var hl=fl;function pl(e,t){return e===t||e!==e&&t!==t}var vl=pl,ml=vl;function gl(e,t){for(var r=e.length;r--;)if(ml(e[r][0],t))return r;return-1}var Ht=gl,bl=Ht,_l=Array.prototype,yl=_l.splice;function wl(e){var t=this.__data__,r=bl(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():yl.call(t,r,1),--this.size,!0}var xl=wl,kl=Ht;function Sl(e){var t=this.__data__,r=kl(t,e);return r<0?void 0:t[r][1]}var Cl=Sl,$l=Ht;function El(e){return $l(this.__data__,e)>-1}var Il=El,Tl=Ht;function Al(e,t){var r=this.__data__,n=Tl(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ml=Al,Nl=hl,Pl=xl,Ol=Cl,Fl=Il,Ll=Ml;function ot(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ot.prototype.clear=Nl,ot.prototype.delete=Pl,ot.prototype.get=Ol,ot.prototype.has=Fl,ot.prototype.set=Ll;var Dl=ot,Vl=Vn,jl=Cr,zl=Vl(jl,"Map"),Rl=zl,zn=dl,Bl=Dl,Ul=Rl;function Hl(){this.size=0,this.__data__={hash:new zn,map:new(Ul||Bl),string:new zn}}var ql=Hl;function Kl(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Gl=Kl,Wl=Gl;function Yl(e,t){var r=e.__data__;return Wl(t)?r[typeof t=="string"?"string":"hash"]:r.map}var qt=Yl,Jl=qt;function Zl(e){var t=Jl(this,e).delete(e);return this.size-=t?1:0,t}var Xl=Zl,Ql=qt;function ec(e){return Ql(this,e).get(e)}var tc=ec,rc=qt;function nc(e){return rc(this,e).has(e)}var ic=nc,ac=qt;function oc(e,t){var r=ac(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var sc=oc,lc=ql,cc=Xl,uc=tc,dc=ic,fc=sc;function st(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=lc,st.prototype.delete=cc,st.prototype.get=uc,st.prototype.has=dc,st.prototype.set=fc;var hc=st,Rn=hc,pc="Expected a function";function Tr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(pc);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Tr.Cache||Rn),r}Tr.Cache=Rn;var vc=Tr,mc=vc,gc=500;function bc(e){var t=mc(e,function(n){return r.size===gc&&r.clear(),n}),r=t.cache;return t}var _c=bc,yc=_c,wc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xc=/\\(\\)?/g,kc=yc(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wc,function(r,n,i,a){t.push(i?a.replace(xc,"$1"):n||r)}),t}),Sc=kc;function Cc(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var $c=Cc,Bn=$r,Ec=$c,Ic=Sr,Tc=Er,Ac=1/0,Un=Bn?Bn.prototype:void 0,Hn=Un?Un.toString:void 0;function qn(e){if(typeof e=="string")return e;if(Ic(e))return Ec(e,qn)+"";if(Tc(e))return Hn?Hn.call(e):"";var t=e+"";return t=="0"&&1/e==-Ac?"-0":t}var Mc=qn,Nc=Mc;function Pc(e){return e==null?"":Nc(e)}var Oc=Pc,Fc=Sr,Lc=rs,Dc=Sc,Vc=Oc;function jc(e,t){return Fc(e)?e:Lc(e,t)?[e]:Dc(Vc(e))}var zc=jc,Rc=Er,Bc=1/0;function Uc(e){if(typeof e=="string"||Rc(e))return e;var t=e+"";return t=="0"&&1/e==-Bc?"-0":t}var Hc=Uc,qc=zc,Kc=Hc;function Gc(e,t){t=qc(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Kc(t[r++])];return r&&r==n?e:void 0}var Wc=Gc,Yc=Wc;function Jc(e,t,r){var n=e==null?void 0:Yc(e,t);return n===void 0?r:n}var Zc=Jc;const yt=Te(Zc);var wt,C,Kn,Gn,Ye,Wn,Yn,Ar,Jn,lt={},Zn=[],Xc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kt=Array.isArray;function Ae(e,t){for(var r in t)e[r]=t[r];return e}function Xn(e){var t=e.parentNode;t&&t.removeChild(e)}function ce(e,t,r){var n,i,a,o={};for(a in t)a=="key"?n=t[a]:a=="ref"?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?wt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return xt(e,o,n,i,null)}function xt(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Kn};return i==null&&C.vnode!=null&&C.vnode(a),a}function Qc(){return{current:null}}function W(e){return e.children}function _e(e,t){this.props=e,this.context=t}function Gt(e,t){if(t==null)return e.__?Gt(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Gt(e):null}function Qn(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Qn(e)}}function Mr(e){(!e.__d&&(e.__d=!0)&&Ye.push(e)&&!Wt.__r++||Wn!==C.debounceRendering)&&((Wn=C.debounceRendering)||Yn)(Wt)}function Wt(){var e,t,r,n,i,a,o,s,l;for(Ye.sort(Ar);e=Ye.shift();)e.__d&&(t=Ye.length,n=void 0,i=void 0,a=void 0,s=(o=(r=e).__v).__e,(l=r.__P)&&(n=[],i=[],(a=Ae({},o)).__v=o.__v+1,Nr(l,o,a,r.__n,l.ownerSVGElement!==void 0,o.__h!=null?[s]:null,n,s??Gt(o),o.__h,i),oi(n,o,i),o.__e!=s&&Qn(o)),Ye.length>t&&Ye.sort(Ar));Wt.__r=0}function ei(e,t,r,n,i,a,o,s,l,u,h){var d,p,g,v,y,k,x,_,M,F,N=0,H=n&&n.__k||Zn,te=H.length,pe=te,D=t.length;for(r.__k=[],d=0;d<D;d++)(v=r.__k[d]=(v=t[d])==null||typeof v=="boolean"||typeof v=="function"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"?xt(null,v,null,null,v):Kt(v)?xt(W,{children:v},null,null,null):v.__b>0?xt(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)!=null&&(v.__=r,v.__b=r.__b+1,(_=eu(v,H,x=d+N,pe))===-1?g=lt:(g=H[_]||lt,H[_]=void 0,pe--),Nr(e,v,g,i,a,o,s,l,u,h),y=v.__e,(p=v.ref)&&g.ref!=p&&(g.ref&&Pr(g.ref,null,v),h.push(p,v.__c||y,v)),y!=null&&(k==null&&(k=y),F=!(M=g===lt||g.__v===null)&&_===x,M?_==-1&&N--:_!==x&&(_===x+1?(N++,F=!0):_>x?pe>D-x?(N+=_-x,F=!0):N--:N=_<x&&_==x-1?_-x:0),x=d+N,F=F||_==d&&!M,typeof v.type!="function"||_===x&&g.__k!==v.__k?typeof v.type=="function"||F?v.__d!==void 0?(l=v.__d,v.__d=void 0):l=y.nextSibling:l=ri(e,y,l):l=ti(v,l,e),typeof r.type=="function"&&(r.__d=l)));for(r.__e=k,d=te;d--;)H[d]!=null&&(typeof r.type=="function"&&H[d].__e!=null&&H[d].__e==r.__d&&(r.__d=H[d].__e.nextSibling),si(H[d],H[d]))}function ti(e,t,r){for(var n,i=e.__k,a=0;i&&a<i.length;a++)(n=i[a])&&(n.__=e,t=typeof n.type=="function"?ti(n,t,r):ri(r,n.__e,t));return t}function Me(e,t){return t=t||[],e==null||typeof e=="boolean"||(Kt(e)?e.some(function(r){Me(r,t)}):t.push(e)),t}function ri(e,t,r){return r==null||r.parentNode!==e?e.insertBefore(t,null):t==r&&t.parentNode!=null||e.insertBefore(t,r),t.nextSibling}function eu(e,t,r,n){var i=e.key,a=e.type,o=r-1,s=r+1,l=t[r];if(l===null||l&&i==l.key&&a===l.type)return r;if(n>(l!=null?1:0))for(;o>=0||s<t.length;){if(o>=0){if((l=t[o])&&i==l.key&&a===l.type)return o;o--}if(s<t.length){if((l=t[s])&&i==l.key&&a===l.type)return s;s++}}return-1}function tu(e,t,r,n,i){var a;for(a in r)a==="children"||a==="key"||a in t||Yt(e,a,null,r[a],n);for(a in t)i&&typeof t[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||r[a]===t[a]||Yt(e,a,t[a],r[a],n)}function ni(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Xc.test(t)?r:r+"px"}function Yt(e,t,r,n,i){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ni(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ni(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n||e.addEventListener(t,a?ai:ii,a):e.removeEventListener(t,a?ai:ii,a);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function ii(e){return this.l[e.type+!1](C.event?C.event(e):e)}function ai(e){return this.l[e.type+!0](C.event?C.event(e):e)}function Nr(e,t,r,n,i,a,o,s,l,u){var h,d,p,g,v,y,k,x,_,M,F,N,H,te,pe,D=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(l=r.__h,s=t.__e=r.__e,t.__h=null,a=[s]),(h=C.__b)&&h(t);try{e:if(typeof D=="function"){if(x=t.props,_=(h=D.contextType)&&n[h.__c],M=h?_?_.props.value:h.__:n,r.__c?k=(d=t.__c=r.__c).__=d.__E:("prototype"in D&&D.prototype.render?t.__c=d=new D(x,M):(t.__c=d=new _e(x,M),d.constructor=D,d.render=nu),_&&_.sub(d),d.props=x,d.state||(d.state={}),d.context=M,d.__n=n,p=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Ae({},d.__s)),Ae(d.__s,D.getDerivedStateFromProps(x,d.__s))),g=d.props,v=d.state,d.__v=t,p)D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(D.getDerivedStateFromProps==null&&x!==g&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,M),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,M)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(se){se&&(se.__=t)}),F=0;F<d._sb.length;F++)d.__h.push(d._sb[F]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,M),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(g,v,y)})}if(d.context=M,d.props=x,d.__P=e,d.__e=!1,N=C.__r,H=0,"prototype"in D&&D.prototype.render){for(d.state=d.__s,d.__d=!1,N&&N(t),h=d.render(d.props,d.state,d.context),te=0;te<d._sb.length;te++)d.__h.push(d._sb[te]);d._sb=[]}else do d.__d=!1,N&&N(t),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++H<25);d.state=d.__s,d.getChildContext!=null&&(n=Ae(Ae({},n),d.getChildContext())),p||d.getSnapshotBeforeUpdate==null||(y=d.getSnapshotBeforeUpdate(g,v)),ei(e,Kt(pe=h!=null&&h.type===W&&h.key==null?h.props.children:h)?pe:[pe],t,r,n,i,a,o,s,l,u),d.base=t.__e,t.__h=null,d.__h.length&&o.push(d),k&&(d.__E=d.__=null)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=ru(r.__e,t,r,n,i,a,o,l,u);(h=C.diffed)&&h(t)}catch(se){t.__v=null,(l||a!=null)&&(t.__e=s,t.__h=!!l,a[a.indexOf(s)]=null),C.__e(se,t,r)}}function oi(e,t,r){for(var n=0;n<r.length;n++)Pr(r[n],r[++n],r[++n]);C.__c&&C.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){C.__e(a,i.__v)}})}function ru(e,t,r,n,i,a,o,s,l){var u,h,d,p=r.props,g=t.props,v=t.type,y=0;if(v==="svg"&&(i=!0),a!=null){for(;y<a.length;y++)if((u=a[y])&&"setAttribute"in u==!!v&&(v?u.localName===v:u.nodeType===3)){e=u,a[y]=null;break}}if(e==null){if(v===null)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,g.is&&g),a=null,s=!1}if(v===null)p===g||s&&e.data===g||(e.data=g);else{if(a=a&&wt.call(e.childNodes),h=(p=r.props||lt).dangerouslySetInnerHTML,d=g.dangerouslySetInnerHTML,!s){if(a!=null)for(p={},y=0;y<e.attributes.length;y++)p[e.attributes[y].name]=e.attributes[y].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(tu(e,g,p,i,s),d)t.__k=[];else if(ei(e,Kt(y=t.props.children)?y:[y],t,r,n,i&&v!=="foreignObject",a,o,a?a[0]:r.__k&&Gt(r,0),s,l),a!=null)for(y=a.length;y--;)a[y]!=null&&Xn(a[y]);s||("value"in g&&(y=g.value)!==void 0&&(y!==e.value||v==="progress"&&!y||v==="option"&&y!==p.value)&&Yt(e,"value",y,p.value,!1),"checked"in g&&(y=g.checked)!==void 0&&y!==e.checked&&Yt(e,"checked",y,p.checked,!1))}return e}function Pr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){C.__e(n,r)}}function si(e,t,r){var n,i;if(C.unmount&&C.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Pr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){C.__e(a,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&si(n[i],t,r||typeof e.type!="function");r||e.__e==null||Xn(e.__e),e.__=e.__e=e.__d=void 0}function nu(e,t,r){return this.constructor(e,r)}function ct(e,t,r){var n,i,a,o;C.__&&C.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,a=[],o=[],Nr(t,e=(!n&&r||t).__k=ce(W,null,[e]),i||lt,lt,t.ownerSVGElement!==void 0,!n&&r?[r]:i?null:t.firstChild?wt.call(t.childNodes):null,a,!n&&r?r:i?i.__e:t.firstChild,n,o),oi(a,e,o)}function li(e,t){ct(e,t,li)}function iu(e,t,r){var n,i,a,o,s=Ae({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a=="key"?n=t[a]:a=="ref"?i=t[a]:s[a]=t[a]===void 0&&o!==void 0?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?wt.call(arguments,2):r),xt(e.type,s,n||e.key,i||e.ref,null)}function ci(e,t){var r={__c:t="__cC"+Jn++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,Mr(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}wt=Zn.slice,C={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(s){e=s}throw e}},Kn=0,Gn=function(e){return e!=null&&e.constructor===void 0},_e.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ae({},this.state),typeof e=="function"&&(e=e(Ae({},r),this.props)),e&&Ae(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Mr(this))},_e.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Mr(this))},_e.prototype.render=W,Ye=[],Yn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ar=function(e,t){return e.__v.__b-t.__v.__b},Wt.__r=0,Jn=0;var Jt=class extends Error{constructor(t){super(t[0].message);ko(this,"issues");this.name="ValiError",this.issues=t}};function ui(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function kt(e){return{issues:e}}function re(e){return{output:e}}function au(e,t){return{reason:e==null?void 0:e.reason,validation:t.validation,origin:(e==null?void 0:e.origin)||"value",message:t.message,input:t.input,path:t.path,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}}function ou(e,t){return{reason:t,origin:e==null?void 0:e.origin,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}}function De(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return re(e);let i,a,o=e;for(const s of t){const l=s._parse(o);if(l.issues){i=i||ou(r,n);for(const u of l.issues){const h=au(i,u);a?a.push(h):a=[h]}if(i.abortEarly||i.abortPipeEarly)break}else o=l.output}return a?kt(a):re(o)}function Ve(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function di(e){return typeof e=="function"?e():e}function je(e,t,r,n){return kt([{validation:e,message:di(t),input:r,requirement:n}])}function fi(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[a,o]=Ve(t,r);return[e,a,o]}const[n,i]=Ve(e,t);return[void 0,n,i]}function Ne(e,t,r,n,i,a){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:di(n),input:i,issues:a,abortEarly:e==null?void 0:e.abortEarly,abortPipeEarly:e==null?void 0:e.abortPipeEarly,skipPipe:e==null?void 0:e.skipPipe}]}}function hi(e){return typeof e.default=="function"?e.default():e.default}function su(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return De(t,this.pipe,r,"any")}}}function pi(e,t,r){const[n="Invalid type",i]=Ve(t,r);return{type:"array",async:!1,item:e,message:n,pipe:i,_parse(a,o){if(!Array.isArray(a))return Ne(o,"type","array",this.message,a);let s;const l=[];for(let u=0;u<a.length;u++){const h=a[u],d=this.item._parse(h,o);if(d.issues){const p={type:"array",input:a,key:u,value:h};for(const g of d.issues)g.path?g.path.unshift(p):g.path=[p],s==null||s.push(g);if(s||(s=d.issues),o!=null&&o.abortEarly)break}else l.push(d.output)}return s?kt(s):De(l,this.pipe,o,"array")}}}function vi(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(i,a){return typeof i!="boolean"?Ne(a,"type","boolean",this.message,i):De(i,this.pipe,a,"boolean")}}}function mi(e,t="Invalid type"){return{type:"literal",async:!1,literal:e,message:t,_parse(r,n){return r!==this.literal?Ne(n,"type","literal",this.message,r):re(r)}}}function lu(e,t){return{type:"nullable",async:!1,wrapped:e,default:t,_parse(r,n){if(r===null){const i=hi(this);if(i===void 0)return re(r);r=i}return this.wrapped._parse(r,n)}}}function Or(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(i,a){return typeof i!="number"||isNaN(i)?Ne(a,"type","number",this.message,i):De(i,this.pipe,a,"number")}}}function ne(e,t,r,n){const[i,a="Invalid type",o]=fi(t,r,n);let s;return{type:"object",async:!1,entries:e,rest:i,message:a,pipe:o,_parse(l,u){if(!l||typeof l!="object")return Ne(u,"type","object",this.message,l);s=s||Object.entries(this.entries);let h;const d={};for(const[p,g]of s){const v=l[p],y=g._parse(v,u);if(y.issues){const k={type:"object",input:l,key:p,value:v};for(const x of y.issues)x.path?x.path.unshift(k):x.path=[k],h==null||h.push(x);if(h||(h=y.issues),u!=null&&u.abortEarly)break}else(y.output!==void 0||p in l)&&(d[p]=y.output)}if(this.rest&&!(u!=null&&u.abortEarly&&h)){for(const p in l)if(!(p in this.entries)){const g=l[p],v=this.rest._parse(g,u);if(v.issues){const y={type:"object",input:l,key:p,value:g};for(const k of v.issues)k.path?k.path.unshift(y):k.path=[y],h==null||h.push(k);if(h||(h=v.issues),u!=null&&u.abortEarly)break}else d[p]=v.output}}return h?kt(h):De(d,this.pipe,u,"object")}}}function St(e,t){return{type:"optional",async:!1,wrapped:e,default:t,_parse(r,n){if(r===void 0){const i=hi(this);if(i===void 0)return re(r);r=i}return this.wrapped._parse(r,n)}}}function cu(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?re(r):Ne(n,"type","picklist",this.message,r)}}}function X(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(i,a){return typeof i!="string"?Ne(a,"type","string",this.message,i):De(i,this.pipe,a,"string")}}}function uu(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[o,s]=Ve(r,n);return[e,t,o,s]}const[i,a]=Ve(t,r);return[X(),e,i,a]}var du=["__proto__","prototype","constructor"];function gi(e,t,r,n){const[i,a,o="Invalid type",s]=uu(e,t,r,n);return{type:"record",async:!1,key:i,value:a,message:o,pipe:s,_parse(l,u){if(!l||typeof l!="object")return Ne(u,"type","record",this.message,l);let h;const d={};for(const[p,g]of Object.entries(l))if(!du.includes(p)){let v;const y=this.key._parse(p,{origin:"key",abortEarly:u==null?void 0:u.abortEarly,abortPipeEarly:u==null?void 0:u.abortPipeEarly,skipPipe:u==null?void 0:u.skipPipe});if(y.issues){v={type:"record",input:l,key:p,value:g};for(const x of y.issues)x.path=[v],h==null||h.push(x);if(h||(h=y.issues),u!=null&&u.abortEarly)break}const k=this.value._parse(g,u);if(k.issues){v=v||{type:"record",input:l,key:p,value:g};for(const x of k.issues)x.path?x.path.unshift(v):x.path=[v],h==null||h.push(x);if(h||(h=k.issues),u!=null&&u.abortEarly)break}!y.issues&&!k.issues&&(d[y.output]=k.output)}return h?kt(h):De(d,this.pipe,u,"record")}}}function fu(e,t="Invalid type"){return{type:"union",async:!1,options:e,message:t,_parse(r,n){let i,a;for(const o of this.options){const s=o._parse(r,n);if(s.issues)if(i)for(const l of s.issues)i.push(l);else i=s.issues;else{a=[s.output];break}}return a?re(a[0]):Ne(n,"type","union",this.message,r,i)}}}function Zt(e,t,r){const n=e._parse(t,r);if(n.issues)throw new Jt(n.issues);return n.output}async function hu(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new Jt(n.issues);return n.output}function pu(e,t,r,n){const[i,a,o]=fi(t,r,n);return ne(Object.entries(e.entries).reduce((s,[l,u])=>({...s,[l]:St(u)}),{}),i,a,o)}function vu(e,t,r){const n=e._parse(t,r);return n.issues?{success:!1,error:new Jt(n.issues),issues:n.issues}:{success:!0,data:n.output,output:n.output}}function bi(e,t,r){return{...e,_parse(n,i){const a=e._parse(n,i);if(a.issues)return a;const o=t(a.output);return r&&!Array.isArray(r)?r._parse(o,i):De(o,r,i,typeof o)}}}var mu=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function gu(e,t="Invalid input"){return{type:"custom",async:!1,message:t,requirement:e,_parse(r){return this.requirement(r)?re(r):je(this.type,this.message,r,this.requirement)}}}function bu(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:mu,_parse(t){return this.requirement.test(t)?re(t):je(this.type,this.message,t,this.requirement)}}}function Xt(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?je(this.type,this.message,r,this.requirement):re(r)}}}function _u(e,t="Invalid value"){return{type:"max_value",async:!1,message:t,requirement:e,_parse(r){return r>this.requirement?je(this.type,this.message,r,this.requirement):re(r)}}}function Qt(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?je(this.type,this.message,r,this.requirement):re(r)}}}function yu(e,t="Invalid value"){return{type:"min_value",async:!1,message:t,requirement:e,_parse(r){return r<this.requirement?je(this.type,this.message,r,this.requirement):re(r)}}}function _i(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?re(r):je(this.type,this.message,r,this.requirement)}}}function wu(e="Invalid URL"){return{type:"url",async:!1,message:e,requirement(t){try{return new URL(t),!0}catch{return!1}},_parse(t){return this.requirement(t)?re(t):je(this.type,this.message,t,this.requirement)}}}function yi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=yi(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Je(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=yi(e))&&(n&&(n+=" "),n+=t);return n}const wi=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,xi=Je,Ct=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return xi(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const h=r==null?void 0:r[u],d=a==null?void 0:a[u];if(h===null)return null;const p=wi(h)||wi(d);return i[u][p]}),s=r&&Object.entries(r).reduce((u,h)=>{let[d,p]=h;return p===void 0||(u[d]=p),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,h)=>{let{class:d,className:p,...g}=h;return Object.entries(g).every(v=>{let[y,k]=v;return Array.isArray(k)?k.includes({...a,...s}[y]):{...a,...s}[y]===k})?[...u,d,p]:u},[]);return xi(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};var ze,z,Fr,ki,ut=0,Si=[],er=[],Ci=C.__b,$i=C.__r,Ei=C.diffed,Ii=C.__c,Ti=C.unmount;function dt(e,t){C.__h&&C.__h(z,e,ut||t),ut=0;var r=z.__H||(z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:er}),r.__[e]}function me(e){return ut=1,Ai(Pi,e)}function Ai(e,t,r){var n=dt(ze++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Pi(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,s);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=z,!z.u)){var i=function(s,l,u){if(!n.__c.__H)return!0;var h=n.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!a||a.call(this,s,l,u);var d=!1;return h.forEach(function(p){if(p.__N){var g=p.__[0];p.__=p.__N,p.__N=void 0,g!==p.__[0]&&(d=!0)}}),!(!d&&n.__c.props===s)&&(!a||a.call(this,s,l,u))};z.u=!0;var a=z.shouldComponentUpdate,o=z.componentWillUpdate;z.componentWillUpdate=function(s,l,u){if(this.__e){var h=a;a=void 0,i(s,l,u),a=h}o&&o.call(this,s,l,u)},z.shouldComponentUpdate=i}return n.__N||n.__}function ye(e,t){var r=dt(ze++,3);!C.__s&&Dr(r.__H,t)&&(r.__=e,r.i=t,z.__H.__h.push(r))}function ue(e,t){var r=dt(ze++,4);!C.__s&&Dr(r.__H,t)&&(r.__=e,r.i=t,z.__h.push(r))}function de(e){return ut=5,Pe(function(){return{current:e}},[])}function xu(e,t,r){ut=6,ue(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Pe(e,t){var r=dt(ze++,7);return Dr(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ku(e,t){return ut=8,Pe(function(){return e},t)}function Mi(e){var t=z.context[e.__c],r=dt(ze++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(z)),t.props.value):e.__}function Su(e,t){C.useDebugValue&&C.useDebugValue(t?t(e):e)}function Cu(){var e=dt(ze++,11);if(!e.__){for(var t=z.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function $u(){for(var e;e=Si.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(tr),e.__H.__h.forEach(Lr),e.__H.__h=[]}catch(t){e.__H.__h=[],C.__e(t,e.__v)}}C.__b=function(e){z=null,Ci&&Ci(e)},C.__r=function(e){$i&&$i(e),ze=0;var t=(z=e.__c).__H;t&&(Fr===z?(t.__h=[],z.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=er,r.__N=r.i=void 0})):(t.__h.forEach(tr),t.__h.forEach(Lr),t.__h=[],ze=0)),Fr=z},C.diffed=function(e){Ei&&Ei(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Si.push(t)!==1&&ki===C.requestAnimationFrame||((ki=C.requestAnimationFrame)||Eu)($u)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==er&&(r.__=r.__V),r.i=void 0,r.__V=er})),Fr=z=null},C.__c=function(e,t){t.some(function(r){try{r.__h.forEach(tr),r.__h=r.__h.filter(function(n){return!n.__||Lr(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],C.__e(n,r.__v)}}),Ii&&Ii(e,t)},C.unmount=function(e){Ti&&Ti(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{tr(n)}catch(i){t=i}}),r.__H=void 0,t&&C.__e(t,r.__v))};var Ni=typeof requestAnimationFrame=="function";function Eu(e){var t,r=function(){clearTimeout(n),Ni&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ni&&(t=requestAnimationFrame(r))}function tr(e){var t=z,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),z=t}function Lr(e){var t=z;e.__c=e.__(),z=t}function Dr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pi(e,t){return typeof t=="function"?t(e):t}function Oi(e,t){for(var r in t)e[r]=t[r];return e}function Vr(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function zr(e){this.props=e}function Iu(e,t){function r(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,i)||!o:Vr(this.props,i)}function n(i){return this.shouldComponentUpdate=r,ce(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(zr.prototype=new _e).isPureReactComponent=!0,zr.prototype.shouldComponentUpdate=function(e,t){return Vr(this.props,e)||Vr(this.state,t)};var Fi=C.__b;C.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fi&&Fi(e)};var Tu=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Rr(e){function t(r){var n=Oi({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Tu,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Li=function(e,t){return e==null?null:Me(Me(e).map(t))},Au={map:Li,forEach:Li,count:function(e){return e?Me(e).length:0},only:function(e){var t=Me(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Me},Mu=C.__e;C.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Mu(e,t,r,n)};var Di=C.unmount;function Vi(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Oi({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Vi(n,t,r)})),e}function ji(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return ji(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=r)),e}function $t(){this.__u=0,this.t=null,this.__b=null}function zi(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ri(e){var t,r,n;function i(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return ce(r,a)}return i.displayName="Lazy",i.__f=!0,i}function Et(){this.u=null,this.o=null}C.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Di&&Di(e)},($t.prototype=new _e).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=zi(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=ji(u,u.__c.__P,u.__c.__O)}var h;for(n.setState({__a:n.__b=null});h=n.t.pop();)h.forceUpdate()}},l=t.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},$t.prototype.componentWillUnmount=function(){this.t=[]},$t.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Vi(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&ce(W,null,e.fallback);return i&&(i.__h=null),[ce(W,null,t.__a?null:e.children),i]};var Bi=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Nu(e){return this.getChildContext=function(){return e.context},e.children}function Pu(e){var t=this,r=e.i;t.componentWillUnmount=function(){ct(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,i){this.childNodes.push(n),t.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n)}}),ct(ce(Nu,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ou(e,t){var r=ce(Pu,{__v:e,i:t});return r.containerInfo=t,r}(Et.prototype=new _e).__a=function(e){var t=this,r=zi(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),Bi(t,e,n)):i()};r?r(a):a()}},Et.prototype.render=function(e){this.u=null,this.o=new Map;var t=Me(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Et.prototype.componentDidUpdate=Et.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Bi(e,r,t)})};var Ui=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Fu=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Lu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Du=/[A-Z0-9]/g,Vu=typeof document<"u",ju=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function zu(e,t,r){return t.__k==null&&(t.textContent=""),ct(e,t),typeof r=="function"&&r(),e?e.__c:null}function Ru(e,t,r){return li(e,t),typeof r=="function"&&r(),e?e.__c:null}_e.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(_e.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Hi=C.event;function Bu(){}function Uu(){return this.cancelBubble}function Hu(){return this.defaultPrevented}C.event=function(e){return Hi&&(e=Hi(e)),e.persist=Bu,e.isPropagationStopped=Uu,e.isDefaultPrevented=Hu,e.nativeEvent=e};var Br,qu={enumerable:!1,configurable:!0,get:function(){return this.class}},qi=C.vnode;C.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||Vu&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||ju(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Lu.test(a)?a=s:n.indexOf("-")===-1&&Fu.test(a)?a=a.replace(Du,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Me(r.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Me(r.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",qu)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Ui,qi&&qi(e)};var Ki=C.__r;C.__r=function(e){Ki&&Ki(e),Br=e.__c};var Gi=C.diffed;C.diffed=function(e){Gi&&Gi(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Br=null};var Ku={ReactCurrentDispatcher:{current:{readContext:function(e){return Br.__n[e.__c].props.value}}}};function Gu(e){return ce.bind(null,e)}function Wi(e){return!!e&&e.$$typeof===Ui}function Wu(e){return Wi(e)?iu.apply(null,arguments):e}function Yu(e){return!!e.__k&&(ct(null,e),!0)}function Ju(e){return e&&(e.base||e.nodeType===1&&e)||null}var Zu=function(e,t){return e(t)},Xu=function(e,t){return e(t)},Qu=W;function Yi(e){e()}function ed(e){return e}function td(){return[!1,Yi]}var rd=ue;function nd(e,t){var r=t(),n=me({h:{__:r,v:t}}),i=n[0].h,a=n[1];return ue(function(){i.__=r,i.v=t,jr(i.__,t())||a({h:i})},[e,r,t]),ye(function(){return jr(i.__,i.v())||a({h:i}),e(function(){jr(i.__,i.v())||a({h:i})})},[e]),r}var ke={useState:me,useId:Cu,useReducer:Ai,useEffect:ye,useLayoutEffect:ue,useInsertionEffect:rd,useTransition:td,useDeferredValue:ed,useSyncExternalStore:nd,startTransition:Yi,useRef:de,useImperativeHandle:xu,useMemo:Pe,useCallback:ku,useContext:Mi,useDebugValue:Su,version:"17.0.2",Children:Au,render:zu,hydrate:Ru,unmountComponentAtNode:Yu,createPortal:Ou,createElement:ce,createContext:ci,createFactory:Gu,cloneElement:Wu,createRef:Qc,Fragment:W,isValidElement:Wi,findDOMNode:Ju,Component:_e,PureComponent:zr,memo:Iu,forwardRef:Rr,flushSync:Xu,unstable_batchedUpdates:Zu,StrictMode:Qu,Suspense:$t,SuspenseList:Et,lazy:Ri,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ku};const oe=Symbol.for("@ts-pattern/matcher"),Ji=Symbol.for("@ts-pattern/isVariadic"),rr="@ts-pattern/anonymous-select-key",Ur=e=>!!(e&&typeof e=="object"),nr=e=>e&&!!e[oe],Y=(e,t,r)=>{if(nr(e)){const n=e[oe](),{matched:i,selections:a}=n.match(t);return i&&a&&Object.keys(a).forEach(o=>r(o,a[o])),i}if(Ur(e)){if(!Ur(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],a=[];for(const o of e.keys()){const s=e[o];nr(s)&&s[Ji]?a.push(s):a.length?i.push(s):n.push(s)}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;const o=t.slice(0,n.length),s=i.length===0?[]:t.slice(-i.length),l=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,h)=>Y(u,o[h],r))&&i.every((u,h)=>Y(u,s[h],r))&&(a.length===0||Y(a[0],l,r))}return e.length===t.length&&e.every((o,s)=>Y(o,t[s],r))}return Object.keys(e).every(n=>{const i=e[n];return(n in t||nr(a=i)&&a[oe]().matcherType==="optional")&&Y(i,t[n],r);var a})}return Object.is(t,e)},fe=e=>{var t,r,n;return Ur(e)?nr(e)?(t=(r=(n=e[oe]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?It(e,fe):It(Object.values(e),fe):[]},It=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function id(...e){if(e.length===1){const[t]=e;return r=>Y(t,r,()=>{})}if(e.length===2){const[t,r]=e;return Y(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Q(e){return Object.assign(e,{optional:()=>qr(e),and:t=>R(e,t),or:t=>Zi(e,t),select:t=>t===void 0?Tt(e):Tt(t,e)})}function Hr(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Ji]:!0})}}))(e),{optional:()=>Hr(qr(e)),select:t=>Hr(t===void 0?Tt(e):Tt(t,e))})}function qr(e){return Q({[oe]:()=>({match:t=>{let r={};const n=(i,a)=>{r[i]=a};return t===void 0?(fe(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Y(e,t,n),selections:r}},getSelectionKeys:()=>fe(e),matcherType:"optional"})})}const ad=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},od=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function R(...e){return Q({[oe]:()=>({match:t=>{let r={};const n=(i,a)=>{r[i]=a};return{matched:e.every(i=>Y(i,t,n)),selections:r}},getSelectionKeys:()=>It(e,fe),matcherType:"and"})})}function Zi(...e){return Q({[oe]:()=>({match:t=>{let r={};const n=(i,a)=>{r[i]=a};return It(e,fe).forEach(i=>n(i,void 0)),{matched:e.some(i=>Y(i,t,n)),selections:r}},getSelectionKeys:()=>It(e,fe),matcherType:"or"})})}function O(e){return{[oe]:()=>({match:t=>({matched:!!e(t)})})}}function Tt(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Q({[oe]:()=>({match:n=>{let i={[t??rr]:n};return{matched:r===void 0||Y(r,n,(a,o)=>{i[a]=o}),selections:i}},getSelectionKeys:()=>[t??rr].concat(r===void 0?[]:fe(r))})})}function Se(e){return typeof e=="number"}function Ze(e){return typeof e=="string"}function Re(e){return typeof e=="bigint"}const Xi=Q(O(function(e){return!0})),sd=Xi,Xe=e=>Object.assign(Q(e),{startsWith:t=>{return Xe(R(e,(r=t,O(n=>Ze(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Xe(R(e,(r=t,O(n=>Ze(n)&&n.endsWith(r)))));var r},minLength:t=>Xe(R(e,(r=>O(n=>Ze(n)&&n.length>=r))(t))),maxLength:t=>Xe(R(e,(r=>O(n=>Ze(n)&&n.length<=r))(t))),includes:t=>{return Xe(R(e,(r=t,O(n=>Ze(n)&&n.includes(r)))));var r},regex:t=>{return Xe(R(e,(r=t,O(n=>Ze(n)&&!!n.match(r)))));var r}}),ld=Xe(O(Ze)),Ce=e=>Object.assign(Q(e),{between:(t,r)=>Ce(R(e,((n,i)=>O(a=>Se(a)&&n<=a&&i>=a))(t,r))),lt:t=>Ce(R(e,(r=>O(n=>Se(n)&&n<r))(t))),gt:t=>Ce(R(e,(r=>O(n=>Se(n)&&n>r))(t))),lte:t=>Ce(R(e,(r=>O(n=>Se(n)&&n<=r))(t))),gte:t=>Ce(R(e,(r=>O(n=>Se(n)&&n>=r))(t))),int:()=>Ce(R(e,O(t=>Se(t)&&Number.isInteger(t)))),finite:()=>Ce(R(e,O(t=>Se(t)&&Number.isFinite(t)))),positive:()=>Ce(R(e,O(t=>Se(t)&&t>0))),negative:()=>Ce(R(e,O(t=>Se(t)&&t<0)))}),cd=Ce(O(Se)),Be=e=>Object.assign(Q(e),{between:(t,r)=>Be(R(e,((n,i)=>O(a=>Re(a)&&n<=a&&i>=a))(t,r))),lt:t=>Be(R(e,(r=>O(n=>Re(n)&&n<r))(t))),gt:t=>Be(R(e,(r=>O(n=>Re(n)&&n>r))(t))),lte:t=>Be(R(e,(r=>O(n=>Re(n)&&n<=r))(t))),gte:t=>Be(R(e,(r=>O(n=>Re(n)&&n>=r))(t))),positive:()=>Be(R(e,O(t=>Re(t)&&t>0))),negative:()=>Be(R(e,O(t=>Re(t)&&t<0)))}),ud=Be(O(Re)),dd=Q(O(function(e){return typeof e=="boolean"})),fd=Q(O(function(e){return typeof e=="symbol"})),hd=Q(O(function(e){return e==null}));var A={__proto__:null,matcher:oe,optional:qr,array:function(...e){return Hr({[oe]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let n={};if(t.length===0)return fe(r).forEach(a=>{n[a]=[]}),{matched:!0,selections:n};const i=(a,o)=>{n[a]=(n[a]||[]).concat([o])};return{matched:t.every(a=>Y(r,a,i)),selections:n}},getSelectionKeys:()=>e.length===0?[]:fe(e[0])})})},set:function(...e){return Q({[oe]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const n=(a,o)=>{r[a]=(r[a]||[]).concat([o])},i=e[0];return{matched:ad(t,a=>Y(i,a,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:fe(e[0])})})},map:function(...e){return Q({[oe]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(s,l)=>{r[s]=(r[s]||[]).concat([l])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[a,o]=e;return{matched:od(t,(s,l)=>{const u=Y(a,l,n),h=Y(o,s,n);return u&&h}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...fe(e[0]),...fe(e[1])]})})},intersection:R,union:Zi,not:function(e){return Q({[oe]:()=>({match:t=>({matched:!Y(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:O,select:Tt,any:Xi,_:sd,string:ld,number:cd,bigint:ud,boolean:dd,symbol:fd,nullish:hd,instanceOf:function(e){return Q(O(function(t){return r=>r instanceof t}(e)))},shape:function(e){return Q(O(id(e)))}};const Kr={matched:!1,value:void 0};function Qe(e){return new ir(e,Kr)}class ir{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],n=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let a=!1,o={};const s=(u,h)=>{a=!0,o[u]=h},l=!n.some(u=>Y(u,this.input,s))||i&&!i(this.input)?Kr:{matched:!0,value:r(a?rr in o?o[rr]:o:this.input,this.input)};return new ir(this.input,l)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new ir(this.input,n?{matched:!0,value:r(this.input,this.input)}:Kr)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}}const pd=["other","few","many","two","one","zero"],Qi=({terms:e,overrides:t,locale:r})=>{const n=new Intl.PluralRules(r);function i(a,o){const s=(t==null?void 0:t[a])??e[a];switch(typeof s){case"string":return s.replace(/{{(\w+)}}/g,(l,u)=>{var h;return((h=o==null?void 0:o[u])==null?void 0:h.toString())??""});case"object":{if(typeof(o==null?void 0:o.count)!="number")throw new Error(`Missing count for translation key “${a.toString()}”`);let l=n.select(o.count);if(!(l in s)){const u=pd.find(h=>h in s);if(!u)throw new Error(`Missing plural rule for translation key “${a.toString()}”`);l=u}return s[l].replace(/{{(\w+)}}/g,(u,h)=>{var d;return((d=o==null?void 0:o[h])==null?void 0:d.toString())??""})}default:throw new Error(`Invalid translation value in dictionary for key “${a.toString()}”.`)}}return i};var vd=0;function c(e,t,r,n,i,a){var o,s,l={};for(s in t)s=="ref"?o=t[s]:l[s]=t[s];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--vd,__source:i,__self:a};if(typeof e=="function"&&(o=e.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return C.vnode&&C.vnode(u),u}const ea=ci(null),md=e=>({TranslationProvider:({terms:t,children:r,locale:n})=>{const i=Pe(()=>(console.log("instantiating"),Qi({locale:n,terms:e,overrides:t})),[t,n]);return c(ea.Provider,{value:{t:i,locale:n},children:r})},useTranslation:()=>{const t=Mi(ea);if(t===null)throw new Error("Please wrap useTranslation in a TranslationProvider");return{t:t.t,locale:t.locale}},createTFunction:({overrides:t,locale:r})=>Qi({terms:e,overrides:t,locale:r})}),{TranslationProvider:gd,useTranslation:he,createTFunction:bd}=md({error_heading:"Something unexpected happened",undo:"Undo",send:"Send",skip:"Skip",skipped:"Skipped",submission_redirect_message:"Almost there! Please complete your submission here:",complete_submission:"Complete submission",submission_completed:"Submission completed!",submission_failed:"Failed to submit",maximize:"Maximise",minimize:"Minimise",close_application:"Close application",applying_for:"Applying for “{{title}}”",invalid_state:"Invalid application state",redirect_url_error:"Couldn’t get the redirect URL.",upload_file:{one:"Select file to upload",other:"Select files to upload"},file_max_size:"max {{size}}",file_extensions:"Accepted file extensions",address_error:"Something went wrong! Plase continue manually",address_search:"Type and search for places…",address_manual:"Fill in manually",back:"Back",search:"Search",unknown_error:"An error occurred",validation_max_chars:"Please enter no more than {{count}} characters",validation_min_chars:"Please enter {{count}} or more characters",validation_phone:"Please enter a valid phone number",validation_country_code:"Please select a country code",validation_number:"Please enter a valid number",validation_number_min:"Please enter a number greater than or equal to {{min}}",validation_number_max:"Please enter a number less than or equal to {{max}}",validation_number_decimal_cases:"Please enter a number with at most {{count}} decimal cases",validation_file:"Please select a file",validation_file_ext:"Please only upload {{ext}} files",validation_file_max:{one:"Please only upload one file",other:"Please only upload up to {{count}} files"}}),wp="";function we(e,t){if(!e)throw new Error(t)}function ar(){throw new Error("Cycle detected")}var _d=Symbol.for("preact-signals");function Gr(){if(ft>1)ft--;else{for(var e,t=!1;At!==void 0;){var r=At;for(At=void 0,Wr++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&ra(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Wr=0,ft--,t)throw e}}var B=void 0,At=void 0,ft=0,Wr=0,or=0;function ta(e){if(B!==void 0){var t=e.n;if(t===void 0||t.t!==B)return t={i:0,S:e,p:B.s,n:void 0,t:B,e:void 0,x:void 0,r:t},B.s!==void 0&&(B.s.n=t),B.s=t,e.n=t,32&B.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=B.s,t.n=void 0,B.s.n=t,B.s=t),t}}function J(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}J.prototype.brand=_d,J.prototype.h=function(){return!0},J.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},J.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}},J.prototype.subscribe=function(e){var t=this;return Jr(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},J.prototype.valueOf=function(){return this.value},J.prototype.toString=function(){return this.value+""},J.prototype.toJSON=function(){return this.value},J.prototype.peek=function(){return this.v},Object.defineProperty(J.prototype,"value",{get:function(){var e=ta(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(B instanceof He&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Wr>100&&ar(),this.v=e,this.i++,or++,ft++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Gr()}}}});function Ue(e){return new J(e)}function ra(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function na(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ia(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function He(e){J.call(this,void 0),this.x=e,this.s=void 0,this.g=or-1,this.f=4}(He.prototype=new J).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===or))return!0;if(this.g=or,this.f|=1,this.i>0&&!ra(this))return this.f&=-2,!0;var e=B;try{na(this),B=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return B=e,ia(this),this.f&=-2,!0},He.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}J.prototype.S.call(this,e)},He.prototype.U=function(e){if(this.t!==void 0&&(J.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},He.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},He.prototype.peek=function(){if(this.h()||ar(),16&this.f)throw this.v;return this.v},Object.defineProperty(He.prototype,"value",{get:function(){1&this.f&&ar();var e=ta(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function yd(e){return new He(e)}function aa(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ft++;var r=B;B=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Yr(e),n}finally{B=r,Gr()}}}function Yr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,aa(e)}function wd(e){if(B!==this)throw new Error("Out-of-order effect");ia(this),B=e,this.f&=-2,8&this.f&&Yr(this),Gr()}function Mt(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Mt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Mt.prototype.S=function(){1&this.f&&ar(),this.f|=1,this.f&=-9,aa(this),na(this),ft++;var e=B;return B=this,wd.bind(this,e)},Mt.prototype.N=function(){2&this.f||(this.f|=2,this.o=At,At=this)},Mt.prototype.d=function(){this.f|=8,1&this.f||Yr(this)};function Jr(e){var t=new Mt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Zr;function ht(e,t){C[e]=t.bind(null,C[e]||function(){})}function sr(e){Zr&&Zr(),Zr=e&&e.S()}function oa(e){var t=this,r=e.data,n=kd(r);n.value=r;var i=Pe(function(){for(var a=t.__v;a=a.__;)if(a.__c){a.__c.__$f|=4;break}return t.__$u.c=function(){var o;!Gn(i.peek())&&((o=t.base)==null?void 0:o.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},yd(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}oa.displayName="_st",Object.defineProperties(J.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:oa},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ht("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var a=n[i];a instanceof J&&(r||(t.__np=r={}),r[i]=a,n[i]=a.peek())}}e(t)}),ht("__r",function(e,t){sr();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var a;return Jr(function(){a=this}),a.c=function(){n.__$f|=1,n.setState({})},a}())),sr(r),e(t)}),ht("__e",function(e,t,r,n){sr(),e(t,r,n)}),ht("diffed",function(e,t){sr();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var a=r.U;if(a)for(var o in a){var s=a[o];s!==void 0&&!(o in n)&&(s.d(),a[o]=void 0)}else r.U=a={};for(var l in n){var u=a[l],h=n[l];u===void 0?(u=xd(r,l,h,i),a[l]=u):u.o(h,i)}}}e(t)});function xd(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,a=Ue(r);return{o:function(o,s){a.value=o,n=s},d:Jr(function(){var o=a.value.value;n[t]!==o&&(n[t]=o,i?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}ht("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var a=n[i];a&&a.d()}}}}else{var o=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)}),ht("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),_e.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function kd(e){return Pe(function(){return Ue(e)},[])}const Xr=(e,t)=>t.some(r=>e instanceof r);let sa,la;function Sd(){return sa||(sa=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Cd(){return la||(la=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Qr=new WeakMap,en=new WeakMap,lr=new WeakMap;function $d(e){const t=new Promise((r,n)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{r(et(e.result)),i()},o=()=>{n(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return lr.set(t,e),t}function Ed(e){if(Qr.has(e))return;const t=new Promise((r,n)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{r(),i()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});Qr.set(e,t)}let tn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return Qr.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return et(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function ca(e){tn=e(tn)}function Id(e){return Cd().includes(e)?function(...t){return e.apply(rn(this),t),et(this.request)}:function(...t){return et(e.apply(rn(this),t))}}function Td(e){return typeof e=="function"?Id(e):(e instanceof IDBTransaction&&Ed(e),Xr(e,Sd())?new Proxy(e,tn):e)}function et(e){if(e instanceof IDBRequest)return $d(e);if(en.has(e))return en.get(e);const t=Td(e);return t!==e&&(en.set(e,t),lr.set(t,e)),t}const rn=e=>lr.get(e);function Ad(e,t,{blocked:r,upgrade:n,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=et(o);return n&&o.addEventListener("upgradeneeded",l=>{n(et(o.result),l.oldVersion,l.newVersion,et(o.transaction),l)}),r&&o.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),s.then(l=>{a&&l.addEventListener("close",()=>a()),i&&l.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),s}const Md=["get","getKey","getAll","getAllKeys","count"],Nd=["put","add","delete","clear"],nn=new Map;function ua(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(nn.get(t))return nn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=Nd.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||Md.includes(r)))return;const a=async function(o,...s){const l=this.transaction(o,i?"readwrite":"readonly");let u=l.store;return n&&(u=u.index(s.shift())),(await Promise.all([u[r](...s),i&&l.done]))[0]};return nn.set(t,a),a}ca(e=>({...e,get:(t,r,n)=>ua(t,r)||e.get(t,r,n),has:(t,r)=>!!ua(t,r)||e.has(t,r)}));const Pd=["continue","continuePrimaryKey","advance"],da={},an=new WeakMap,fa=new WeakMap,Od={get(e,t){if(!Pd.includes(t))return e[t];let r=da[t];return r||(r=da[t]=function(...n){an.set(this,fa.get(this)[t](...n))}),r}};async function*Fd(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Od);for(fa.set(r,t),lr.set(r,rn(t));t;)yield r,t=await(an.get(r)||t.continue()),an.delete(r)}function ha(e,t){return t===Symbol.asyncIterator&&Xr(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Xr(e,[IDBIndex,IDBObjectStore])}ca(e=>({...e,get(t,r,n){return ha(t,r)?Fd:e.get(t,r,n)},has(t,r){return ha(t,r)||e.has(t,r)}}));const Nt=e=>Qe(e).with(A.number.lte(1e3),()=>`${Math.round(e)}KB`).with(A.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),pa=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Ld=e=>Object.entries(e).reduce((r,[n,i])=>(r[n]=i.value,r),{}),pt=e=>t=>t?t.type===e:!1;class Pt extends Error{constructor(){super("Aborted")}}function Dd(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const va=e=>typeof e=="string",Vd=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),ma=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:Vd()}),jd=e=>Qe(e).with({nativeEvent:{submitter:A.select(A.union(A.instanceOf(HTMLButtonElement),A.instanceOf(HTMLInputElement)))}},t=>t).otherwise(()=>{throw new Error("invalid submitter")}),ga=typeof window>"u"?void 0:Ad("inploi-chatbot",3,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Ot={getStateData:async(e,t)=>{var n;const r=ba({...e,flowKeys:t});return(n=await ga)==null?void 0:n.get("state",r)},setStateData:Dd(async e=>{var r;const t=ba(e);return(r=await ga)==null?void 0:r.put("state",e.data,t)},1e3)},cr=(e,t,r,n=0)=>{if(!t.nextId)return r(t.id,{stepsMade:n,remainingSteps:0}),{stepsMade:n,remainingSteps:0};const i=e.find(u=>u.id===t.nextId);if(i===void 0)return{stepsMade:n,remainingSteps:0};const a=t.type==="if-block"?t.branchId:void 0,o=e.find(u=>u.id===a),s=t.type.includes("question")?1:0;if(o){const u=s+Math.max(cr(e,i,r,n+s).remainingSteps,cr(e,o,r,n+s).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const l=s+cr(e,i,r,n+s).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:l}),{stepsMade:n,remainingSteps:l}},zd=e=>{const t={},r=e.find(n=>n.isHead);return r&&cr(e,r,(n,i)=>{t[n]=i}),t},ba=e=>[...e.flowKeys,e.id,e.version].join("/"),qe=Ue({state:"idle"}),Ft=e=>{const{state:t,flow:r}=qe.value;if(t!=="loaded")return;we(r,"No flow to update");const n=e(r.data);r.data=n,qe.value={state:t,flow:r},Ot.setStateData(r)},T={current$:qe,viewState$:Ue("closed"),inputHeight$:Ue(53),startFlow:async({flow:e,context:t={},flowKeys:r,title:n,analytics:i,job:a})=>{const s={data:await Ot.getStateData(e,r)??ma(),startedAt:new Date,nodeIdToProgress:zd(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n,analytics:i,job:a};qe.value={state:"loaded",flow:s},Ot.setStateData(s)},cancelCurrentFlow:()=>{qe.value={state:"idle"},T.viewState$.value="closed"},markAsFinished:()=>Ft(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Ft(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=qe.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=ma();qe.value={state:e,flow:{...t,data:r,startedAt:new Date}},Ot.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Ft(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=qe.value;we(t==="loaded","Application not loaded");const n=r.data.messages.filter(i=>!i.groupId||!e.includes(i.groupId));r.data.messages=n,Ot.setStateData(r)},setSubmission:(e,t)=>Ft(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Ft(t=>({...t,currentInput:e??null}))},Rd=({message:e})=>{const{t}=he();return c("div",{class:"flex flex-grow flex-col items-center justify-center",children:[c("svg",{class:"text-error-9 h-16 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round",viewBox:"0 0 96 96",children:[c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",fill:"#fff"}),c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"}),c("line",{x1:"36.7",y1:"39.3",x2:"44.8",y2:"47.4"}),c("line",{x1:"52.2",y1:"39.3",x2:"60.3",y2:"47.4"}),c("line",{x1:"44.7",y1:"39.2",x2:"36.6",y2:"47.3"}),c("line",{x1:"60.2",y1:"39.2",x2:"52.1",y2:"47.3"}),c("path",{d:"M38 56h19"})]}),c("div",{class:"flex flex-col gap-2 text-center",children:[c("p",{class:"text-error-11 font-bold",children:t("error_heading")}),e&&c("p",{class:"text-neutral-9 text-sm",children:e})]})]})},_a=e=>c("svg",{role:"img",viewBox:"0 0 24 24",...e,children:[c("title",{children:"Loading"}),c("style",{children:"#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}"}),c("g",{id:"s1",transform:"translate(12,0)",children:c("g",{id:"s2",transform:"scale(0,0)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s3",transform:"translate(12,12)",children:c("g",{id:"s4",transform:"scale(1,1)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s5",transform:"translate(12,0)",children:c("g",{id:"s6",transform:"scale(0,0)",children:c("path",{d:"M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",transform:"translate(-6.5,-6.5)","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})})}),c("g",{id:"s7",transform:"translate(12,0)",children:c("g",{id:"s8",transform:"scale(0,0)",children:c("path",{d:"M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",transform:"translate(-6.5,-9.25)",fill:"currentColor"})})})]}),ya=()=>c("div",{class:"flex flex-grow flex-col items-center justify-center",children:c(_a,{class:"text-neutral-6 h-8 w-8"})}),Bd=e=>{const r=e/100,n=1.3;return e<0?"0%":e>100?"100%":`${Math.round((1-(1-.1)*Math.pow(1-r,n))*100)}%`},ur=({class:e,children:t,...r})=>c("button",{class:Je("touch-hitbox text-interactive-copy hover:text-interactive-copy-hover active:text-interactive-copy-active hover:bg-interactive-bg-hover active:bg-interactive-bg-active fr relative rounded-full p-2 transition-all",e),...r,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",xmlns:"http://www.w3.org/2000/svg",children:t})}),Ud=()=>{if(T.current$.value.state!=="loaded")return null;const e=T.current$.value.flow.nodeIdToProgress,t=T.current$.value.flow.data.nodeHistory.at(-1);if(t===void 0)return null;const r=e[t];if(r===void 0)return null;const n=100*(r.stepsMade/(r.remainingSteps+r.stepsMade));return c("div",{class:"bg-accent-3",children:c("div",{style:{width:Bd(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},Hd=({children:e})=>{const{t}=he(),r=T.viewState$;return c(W,{children:c("header",{class:"ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",children:[c("div",{class:"flex h-[var(--header-height)] gap-2",children:[c("p",{id:"chatbot-status-bar",class:"sr-only",children:e}),c("button",{tabIndex:-1,onClick:()=>{r.value==="minimised"?r.value="maximised":r.value="minimised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1",onTouchStart:on,children:c("p",{"aria-hidden":!0,class:"text-neutral-12 truncate text-sm font-bold tracking-tight",children:e})}),c("div",{class:"flex flex-shrink-0 items-center gap-3 p-1.5",children:r.value==="minimised"?c(W,{children:[c(ur,{class:"view-switch",onTouchStart:on,"aria-label":t("maximize"),onClick:()=>r.value="maximised",children:c("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),c(ur,{"aria-label":t("close_application"),onClick:T.cancelCurrentFlow,children:c("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):c(W,{children:[T.current$.value.state==="loaded"&&c(ur,{"aria-label":"Restart",onClick:()=>{T.restart()},children:[c("path",{d:"M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"}),c("path",{d:"M8 7L10 4.5L8 2.5"})]},"restart"),c(ur,{class:"view-switch",onTouchStart:on,"aria-label":t("minimize"),onClick:()=>r.value="minimised",children:c("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),c(Ud,{})]})})};function on(){}const qd=Ri(()=>Promise.resolve().then(()=>dp).then(e=>e.ChatbotBody)),wa=Ct("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full max-w-[450px] focus:outline-none [&:has(.view-switch:active)]:scale-[0.98] transition-all duration-1000 ease-expo-out",{variants:{view:{closed:"hidden",minimised:"h-[var(--header-height)] animate-slide-in-bottom",maximised:"h-[var(--content-height)] animate-maximise"}}}),xa="outline-neutral-3 bg-neutral-1 relative flex h-full flex-col overflow-hidden rounded-3xl outline outline-1",Kd=({open:e,...t})=>{const r=de(null);return ue(()=>{const n=r.current;n&&(e?n.showModal():n.close())},[e]),c("dialog",{ref:r,...t})},Gd=({logger:e,apiClient:t,analytics:r,terms:n})=>{const{state:i,flow:a,error:o}=T.current$.value,s=T.viewState$.value,l=i!=="idle"&&s==="maximised",u=de(null),h=c(Hd,{children:a==null?void 0:a.title});return c(gd,{terms:n,locale:void 0,children:[c(Kd,{open:l,onClose:()=>T.viewState$.value="minimised",children:c("div",{ref:u,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:wa({view:"maximised"}),children:c("div",{class:xa,children:[h,Qe({state:i,view:s}).with({state:"idle"},()=>null).with({state:"loading"},()=>c(ya,{},"loading")).with({state:"loaded"},()=>c($t,{fallback:c(ya,{},"loading"),children:c(qd,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>c(Rd,{message:o})).exhaustive()]})})}),s==="minimised"?c("div",{class:wa({view:"minimised",class:"z-100 isolate"}),children:c("div",{class:xa,children:h})}):null]})},ka=ne({id:ui(X(),String),version:Or(),build:Or(),nodes:pi(su()),context_schema:St(lu(gi(X(),ne({required:vi(),type:fu([mi("string"),mi("number")])}))))}),Wd=ne({flow:ka}),Yd=ne({company:ne({name:X()}),flow:ka,job:ne({id:ui(X(),String),title:X()})}),Jd=`#isdk{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;z-index:99999;font-size:16px;font-family:sans-serif;--i-lowest: 0 0% 100%;--i-e-1: 340 100% 99%;--i-e-2: 353 100% 98%;--i-e-3: 351 91% 96%;--i-e-4: 351 100% 93%;--i-e-5: 350 100% 90%;--i-e-6: 351 80% 86%;--i-e-7: 349 68% 81%;--i-e-8: 348 61% 74%;--i-e-9: 348 75% 59%;--i-e-10: 347 70% 55%;--i-e-11: 345 70% 47%;--i-e-12: 344 63% 24%;--header-height: 44px;--content-height:calc(100vh - 64px);--content-height:calc(100svh - 64px)}@media screen and (min-width: 768px){#isdk{--content-height: min(640px, calc(100vh - 16px));--content-height: min(640px, calc(100svh - 16px)) }}#isdk{--tw-content: "";font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#isdk em{font-style:italic}#isdk strong{font-weight:700}#isdk *{font-weight:inherit;font-style:inherit;box-sizing:border-box;font-family:inherit;border-style:solid;border-width:0;-webkit-tap-highlight-color:transparent}#isdk :before,#isdk :after{box-sizing:border-box}#isdk :is(ul,ol){list-style:none;padding:0;margin:0}#isdk :is(p){margin:0;padding:0}#isdk :is(li){margin:0;padding:0;list-style:none}#isdk :is(button){margin:0;padding:0;border:unset;background:unset;text-align:unset}#isdk *,#isdk :before,#isdk :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#isdk ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }#isdk .container{width:100%}@media (min-width: 640px){#isdk .container{max-width:640px}}@media (min-width: 768px){#isdk .container{max-width:768px}}@media (min-width: 1024px){#isdk .container{max-width:1024px}}@media (min-width: 1280px){#isdk .container{max-width:1280px}}@media (min-width: 1536px){#isdk .container{max-width:1536px}}#isdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#isdk .visible{visibility:visible}#isdk .collapse{visibility:collapse}#isdk .static{position:static}#isdk .fixed{position:fixed}#isdk .absolute{position:absolute}#isdk .relative{position:relative}#isdk .sticky{position:sticky}#isdk .inset-0{top:0;right:0;bottom:0;left:0}#isdk .bottom-0{bottom:0}#isdk .bottom-2{bottom:.5rem}#isdk .bottom-2\\.5{bottom:.625rem}#isdk .left-0{left:0}#isdk .left-2{left:.5rem}#isdk .right-0{right:0}#isdk .right-2{right:.5rem}#isdk .top-0{top:0}#isdk .isolate{isolation:isolate}#isdk .z-20{z-index:20}#isdk .m-0{margin:0}#isdk .mx-auto{margin-left:auto;margin-right:auto}#isdk .mb-1{margin-bottom:.25rem}#isdk .ml-auto{margin-left:auto}#isdk .mt-auto{margin-top:auto}#isdk .block{display:block}#isdk .inline-block{display:inline-block}#isdk .inline{display:inline}#isdk .flex{display:flex}#isdk .inline-flex{display:inline-flex}#isdk .table{display:table}#isdk .table-row{display:table-row}#isdk .flow-root{display:flow-root}#isdk .grid{display:grid}#isdk .inline-grid{display:inline-grid}#isdk .contents{display:contents}#isdk .list-item{display:list-item}#isdk .\\!hidden{display:none!important}#isdk .hidden{display:none}#isdk .h-1{height:.25rem}#isdk .h-1\\.5{height:.375rem}#isdk .h-16{height:4rem}#isdk .h-4{height:1rem}#isdk .h-48{height:12rem}#isdk .h-8{height:2rem}#isdk .h-\\[3px\\]{height:3px}#isdk .h-\\[var\\(--content-height\\)\\]{height:var(--content-height)}#isdk .h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}#isdk .h-full{height:100%}#isdk .max-h-full{max-height:100%}#isdk .min-h-\\[36px\\]{min-height:36px}#isdk .w-1{width:.25rem}#isdk .w-1\\.5{width:.375rem}#isdk .w-16{width:4rem}#isdk .w-24{width:6rem}#isdk .w-4{width:1rem}#isdk .w-8{width:2rem}#isdk .w-full{width:100%}#isdk .min-w-0{min-width:0px}#isdk .min-w-\\[2rem\\]{min-width:2rem}#isdk .max-w-\\[450px\\]{max-width:450px}#isdk .max-w-\\[min\\(100\\%\\,24rem\\)\\]{max-width:min(100%,24rem)}#isdk .max-w-full{max-width:100%}#isdk .flex-1{flex:1 1 0%}#isdk .flex-none{flex:none}#isdk .flex-shrink{flex-shrink:1}#isdk .flex-shrink-0{flex-shrink:0}#isdk .shrink{flex-shrink:1}#isdk .flex-grow,#isdk .grow{flex-grow:1}#isdk .border-collapse{border-collapse:collapse}#isdk .translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#isdk .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}#isdk .animate-bounce{animation:bounce 1s infinite}@keyframes bubble-in{0%{transform:translateY(100%) scale(.8);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}#isdk .animate-bubble-in{animation:bubble-in .3s cubic-bezier(.34,1.56,.64,1)}@keyframes maximise{0%{transform:translateY(50%) scaleX(.7)}to{transform:translateY(0)}}#isdk .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes slide-in-bottom{0%{transform:translateY(-100%) scaleX(.82)}to{transform:translateY(0)}}#isdk .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.175,.885,.32,1.275)}#isdk .cursor-pointer{cursor:pointer}#isdk .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#isdk .select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}#isdk .resize{resize:both}#isdk .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#isdk .flex-col{flex-direction:column}#isdk .flex-wrap{flex-wrap:wrap}#isdk .items-center{align-items:center}#isdk .items-stretch{align-items:stretch}#isdk .justify-end{justify-content:flex-end}#isdk .justify-center{justify-content:center}#isdk .gap-0{gap:0px}#isdk .gap-1{gap:.25rem}#isdk .gap-1\\.5{gap:.375rem}#isdk .gap-2{gap:.5rem}#isdk .gap-3{gap:.75rem}#isdk .gap-4{gap:1rem}#isdk .gap-px{gap:1px}#isdk .overflow-hidden{overflow:hidden}#isdk .overflow-y-auto{overflow-y:auto}#isdk .overflow-y-scroll{overflow-y:scroll}#isdk .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#isdk .text-ellipsis{text-overflow:ellipsis}#isdk .whitespace-nowrap{white-space:nowrap}#isdk .break-words{overflow-wrap:break-word}#isdk .rounded{border-radius:.25rem}#isdk .rounded-2xl{border-radius:1rem}#isdk .rounded-3xl{border-radius:1.5rem}#isdk .rounded-\\[18px\\]{border-radius:18px}#isdk .rounded-full{border-radius:9999px}#isdk .rounded-lg{border-radius:.5rem}#isdk .rounded-md{border-radius:.375rem}#isdk .rounded-xl{border-radius:.75rem}#isdk .rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}#isdk .rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}#isdk .rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}#isdk .rounded-bl-md{border-bottom-left-radius:.375rem}#isdk .rounded-br-md{border-bottom-right-radius:.375rem}#isdk .border{border-width:1px}#isdk .border-b{border-bottom-width:1px}#isdk .border-t{border-top-width:1px}#isdk .border-solid{border-style:solid}#isdk .border-dashed{border-style:dashed}#isdk .border-accent-9{border-color:var(--i-color-a-9)}#isdk .border-divider{border-color:var(--i-color-divider)}#isdk .border-neutral-5{border-color:var(--i-color-n-5)}#isdk .border-neutral-8{border-color:var(--i-color-n-8)}#isdk .border-transparent{border-color:transparent}#isdk .border-b-neutral-3{border-bottom-color:var(--i-color-n-3)}#isdk .border-b-neutral-5{border-bottom-color:var(--i-color-n-5)}#isdk .border-b-transparent{border-bottom-color:transparent}#isdk .bg-accent-1{background-color:var(--i-color-a-1)}#isdk .bg-accent-3{background-color:var(--i-color-a-3)}#isdk .bg-accent-9{background-color:var(--i-color-a-9)}#isdk .bg-bubble-weak-bg{background-color:var(--i-bubble-weak-bg)}#isdk .bg-lowest{background-color:var(--i-color-lowest)}#isdk .bg-neutral-1{background-color:var(--i-color-n-1)}#isdk .bg-neutral-2{background-color:var(--i-color-n-2)}#isdk .bg-neutral-3{background-color:var(--i-color-n-3)}#isdk .bg-statusbar{background-color:var(--i-status-bar-bg)}#isdk .bg-transparent{background-color:transparent}#isdk .bg-none{background-image:none}#isdk .p-1{padding:.25rem}#isdk .p-1\\.5{padding:.375rem}#isdk .p-2{padding:.5rem}#isdk .p-2\\.5{padding:.625rem}#isdk .p-4{padding:1rem}#isdk .px-1{padding-left:.25rem;padding-right:.25rem}#isdk .px-2{padding-left:.5rem;padding-right:.5rem}#isdk .px-2\\.5{padding-left:.625rem;padding-right:.625rem}#isdk .px-3{padding-left:.75rem;padding-right:.75rem}#isdk .px-4{padding-left:1rem;padding-right:1rem}#isdk .px-5{padding-left:1.25rem;padding-right:1.25rem}#isdk .py-0{padding-top:0;padding-bottom:0}#isdk .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}#isdk .py-1{padding-top:.25rem;padding-bottom:.25rem}#isdk .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}#isdk .py-2{padding-top:.5rem;padding-bottom:.5rem}#isdk .py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}#isdk .py-3{padding-top:.75rem;padding-bottom:.75rem}#isdk .py-\\[6px\\]{padding-top:6px;padding-bottom:6px}#isdk .pb-2{padding-bottom:.5rem}#isdk .pb-6{padding-bottom:1.5rem}#isdk .pl-1{padding-left:.25rem}#isdk .pl-1\\.5{padding-left:.375rem}#isdk .pl-2{padding-left:.5rem}#isdk .pl-3{padding-left:.75rem}#isdk .pl-4{padding-left:1rem}#isdk .pr-1{padding-right:.25rem}#isdk .pr-16{padding-right:4rem}#isdk .pr-2{padding-right:.5rem}#isdk .pr-2\\.5{padding-right:.625rem}#isdk .pr-3{padding-right:.75rem}#isdk .pr-4{padding-right:1rem}#isdk .pt-2{padding-top:.5rem}#isdk .pt-2\\.5{padding-top:.625rem}#isdk .pt-3{padding-top:.75rem}#isdk .pt-5{padding-top:1.25rem}#isdk .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\]{padding-top:calc(var(--header-height) + 1rem)}#isdk .text-center{text-align:center}#isdk .text-right{text-align:right}#isdk .text-justify{text-align:justify}#isdk .text-\\[10px\\]{font-size:10px}#isdk .text-\\[11px\\]{font-size:11px}#isdk .text-base{font-size:1rem;line-height:1.5rem}#isdk .text-sm{font-size:.875rem;line-height:1.25rem}#isdk .text-xs{font-size:.75rem;line-height:1rem}#isdk .font-bold{font-weight:700}#isdk .font-medium{font-weight:500}#isdk .uppercase{text-transform:uppercase}#isdk .lowercase{text-transform:lowercase}#isdk .capitalize{text-transform:capitalize}#isdk .italic{font-style:italic}#isdk .ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}#isdk .leading-3{line-height:.75rem}#isdk .leading-snug{line-height:1.375}#isdk .tracking-\\[-0\\.01em\\]{letter-spacing:-.01em}#isdk .tracking-tight{letter-spacing:-.025em}#isdk .tracking-wide{letter-spacing:.025em}#isdk .tracking-widest{letter-spacing:.1em}#isdk .text-\\[\\#4CAF50\\]{--tw-text-opacity: 1;color:rgb(76 175 80 / var(--tw-text-opacity))}#isdk .text-\\[\\#FFC107\\]{--tw-text-opacity: 1;color:rgb(255 193 7 / var(--tw-text-opacity))}#isdk .text-accent-10{color:var(--i-color-a-10)}#isdk .text-accent-11{color:var(--i-color-a-11)}#isdk .text-accent-12{color:var(--i-color-a-12)}#isdk .text-accent-9{color:var(--i-color-a-9)}#isdk .text-error-11{color:var(--i-color-e-11)}#isdk .text-error-9{color:var(--i-color-e-9)}#isdk .text-interactive-copy{color:var(--i-interactive-copy)}#isdk .text-neutral-10{color:var(--i-color-n-10)}#isdk .text-neutral-11{color:var(--i-color-n-11)}#isdk .text-neutral-12{color:var(--i-color-n-12)}#isdk .text-neutral-6{color:var(--i-color-n-6)}#isdk .text-neutral-8{color:var(--i-color-n-8)}#isdk .text-neutral-9{color:var(--i-color-n-9)}#isdk .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#isdk .underline{text-decoration-line:underline}#isdk .no-underline{text-decoration-line:none}#isdk .underline-offset-2{text-underline-offset:2px}#isdk .caret-accent-9{caret-color:var(--i-color-a-9)}#isdk .opacity-0{opacity:0}#isdk .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-surface-md{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 6px 4px 0px oklch(0% 0 0 / .01);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-surface-sm{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 4px 4px 0px oklch(0% 0 0 / .02);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .shadow-bubble-strong-shadow{--tw-shadow-color: var(--i-bubble-strong-shadow);--tw-shadow: var(--tw-shadow-colored)}#isdk .outline-none{outline:2px solid transparent;outline-offset:2px}#isdk .outline{outline-style:solid}#isdk .outline-1{outline-width:1px}#isdk .outline-2{outline-width:2px}#isdk .outline-accent-4{outline-color:var(--i-color-a-4)}#isdk .outline-bubble-weak{outline-color:var(--i-bubble-weak-outline)}#isdk .outline-divider{outline-color:var(--i-color-divider)}#isdk .outline-neutral-3{outline-color:var(--i-color-n-3)}#isdk .outline-neutral-6{outline-color:var(--i-color-n-6)}#isdk .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .ring-accent-6{--tw-ring-color: var(--i-color-a-6)}#isdk .ring-divider{--tw-ring-color: var(--i-color-divider)}#isdk .ring-lowest{--tw-ring-color: var(--i-color-lowest)}#isdk .ring-transparent{--tw-ring-color: transparent}#isdk .ring-offset-\\[1\\.5px\\]{--tw-ring-offset-width: 1.5px}#isdk .ring-offset-neutral-1{--tw-ring-offset-color: var(--i-color-n-1)}#isdk .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\]{--tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#isdk .backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-saturate-150{--tw-backdrop-saturate: saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#isdk .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#isdk .duration-100{transition-duration:.1s}#isdk .duration-1000{transition-duration:1s}#isdk .duration-300{transition-duration:.3s}#isdk .duration-700{transition-duration:.7s}#isdk .ease-expo-out{transition-timing-function:cubic-bezier(.16,1,.3,1)}#isdk .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}#isdk .will-change-\\[height\\]{will-change:height}#isdk .text-wrap-balance{text-wrap:balance}#isdk .fr{outline:none}#isdk .fr:focus{outline:none}#isdk .fr:focus-visible{outline:none;--tw-ring-offset-width: 1px;--tw-ring-offset-color: var(--i-color-lowest);--tw-ring-opacity: 1;--tw-ring-color: var(--i-color-a-9);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .gutter-stable{scrollbar-gutter:stable}#isdk .hide-scrollbars::-webkit-scrollbar{display:none}#isdk .hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}#isdk .touch-hitbox:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}#isdk .\\[-webkit-outer-spin-button\\:none\\]{-webkit-outer-spin-button:none}#isdk .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\]{a-z-a--z0-9-_:.$@?}#isdk .\\[grid-template-columns\\:min-content_1fr\\]{grid-template-columns:min-content 1fr}#isdk .\\[text-wrap\\:pretty\\]{text-wrap:pretty}#isdk .selection\\:bg-accent-4 *::-moz-selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-accent-4 *::selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-transparent *::-moz-selection{background-color:transparent}#isdk .selection\\:bg-transparent *::selection{background-color:transparent}#isdk .selection\\:text-accent-12 *::-moz-selection{color:var(--i-color-a-12)}#isdk .selection\\:text-accent-12 *::selection{color:var(--i-color-a-12)}#isdk .selection\\:bg-accent-4::-moz-selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-accent-4::selection{background-color:var(--i-color-a-4)}#isdk .selection\\:bg-transparent::-moz-selection{background-color:transparent}#isdk .selection\\:bg-transparent::selection{background-color:transparent}#isdk .selection\\:text-accent-12::-moz-selection{color:var(--i-color-a-12)}#isdk .selection\\:text-accent-12::selection{color:var(--i-color-a-12)}#isdk .placeholder\\:text-neutral-10::-moz-placeholder{color:var(--i-color-n-10)}#isdk .placeholder\\:text-neutral-10::placeholder{color:var(--i-color-n-10)}#isdk .placeholder\\:text-neutral-8::-moz-placeholder{color:var(--i-color-n-8)}#isdk .placeholder\\:text-neutral-8::placeholder{color:var(--i-color-n-8)}#isdk .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#isdk .focus-within\\:bg-neutral-5:focus-within{background-color:var(--i-color-n-5)}#isdk .focus-within\\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}#isdk .focus-within\\:outline-accent-7:focus-within{outline-color:var(--i-color-a-7)}#isdk .hover\\:border-accent-10:hover{border-color:var(--i-color-a-10)}#isdk .hover\\:border-neutral-5:hover{border-color:var(--i-color-n-5)}#isdk .hover\\:bg-accent-10:hover{background-color:var(--i-color-a-10)}#isdk .hover\\:bg-interactive-bg-hover:hover{background-color:var(--i-interactive-bg-hover)}#isdk .hover\\:bg-neutral-2:hover{background-color:var(--i-color-n-2)}#isdk .hover\\:bg-neutral-3:hover{background-color:var(--i-color-n-3)}#isdk .hover\\:bg-neutral-4:hover{background-color:var(--i-color-n-4)}#isdk .hover\\:bg-neutral-5:hover{background-color:var(--i-color-n-5)}#isdk .hover\\:text-accent-11:hover{color:var(--i-color-a-11)}#isdk .hover\\:text-interactive-copy-hover:hover{color:var(--i-interactive-copy-hover)}#isdk .hover\\:text-neutral-12:hover{color:var(--i-color-n-12)}#isdk .hover\\:underline:hover{text-decoration-line:underline}#isdk .hover\\:ring-accent-8:hover{--tw-ring-color: var(--i-color-a-8)}#isdk .focus\\:bg-neutral-5:focus{background-color:var(--i-color-n-5)}#isdk .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}#isdk .focus-visible\\:bg-neutral-3:focus-visible{background-color:var(--i-color-n-3)}#isdk .focus-visible\\:outline-2:focus-visible{outline-width:2px}#isdk .focus-visible\\:outline-accent-7:focus-visible{outline-color:var(--i-color-a-7)}#isdk .focus-visible\\:outline-accent-8:focus-visible{outline-color:var(--i-color-a-8)}#isdk .focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}#isdk .active\\:border-submit-bg-active:active{border-color:var(--i-submit-button-bg-active)}#isdk .active\\:bg-accent-10:active{background-color:var(--i-color-a-10)}#isdk .active\\:bg-accent-2:active{background-color:var(--i-color-a-2)}#isdk .active\\:bg-interactive-bg-active:active{background-color:var(--i-interactive-bg-active)}#isdk .active\\:bg-submit-bg-active:active{background-color:var(--i-submit-button-bg-active)}#isdk .active\\:text-accent-10:active{color:var(--i-color-a-10)}#isdk .active\\:text-accent-11:active{color:var(--i-color-a-11)}#isdk .active\\:text-interactive-copy-active:active{color:var(--i-interactive-copy-active)}#isdk .active\\:outline-neutral-8:active{outline-color:var(--i-color-n-8)}#isdk .active\\:ring-2:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .active\\:ring-accent-7:active{--tw-ring-color: var(--i-color-a-7)}#isdk .active\\:ring-offset-2:active{--tw-ring-offset-width: 2px}#isdk .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#isdk .disabled\\:opacity-50:disabled{opacity:.5}#isdk .peer:checked~.peer-checked\\:bg-accent-2{background-color:var(--i-color-a-2)}#isdk .peer:checked~.peer-checked\\:text-accent-9{color:var(--i-color-a-9)}#isdk .peer:checked~.peer-checked\\:outline-accent-7{outline-color:var(--i-color-a-7)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-accent-9{--tw-ring-color: var(--i-color-a-9)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-offset-accent-7{--tw-ring-offset-color: var(--i-color-a-7)}@media (pointer: coarse){#isdk .pointer-coarse\\:touch-hitbox\\:\\:before:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}}#isdk .\\[\\&\\:has\\(\\+\\*\\>input\\:focus\\)\\]\\:text-neutral-11:has(+*>input:focus){color:var(--i-color-n-11)}#isdk .\\[\\&\\:has\\(\\.view-switch\\:active\\)\\]\\:scale-\\[0\\.98\\]:has(.view-switch:active){--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}#isdk dialog::backdrop{animation:fade-in .5s cubic-bezier(.16,1,.3,1) both}#isdk dialog::backdrop{background-color:var(--i-overlay-bg)}
2
+ `,Sa="isdk",Zd=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(Sa);if(e)return document.body.appendChild(e),e;const t=document.createElement("div");return document.body.appendChild(t),t.id=Sa,t}});var Xd=["1","2","3","4","5","6","7","8","9","10","11","12"],Qd={light:{1:[98.8,.015],2:[97.8,.018],3:[95.8,.025],4:[92,.04],5:[89,.05],6:[85,.07],7:[80.5,.08],8:[74,.11],9:[60,.22],10:[56,.23],11:[50,.19],12:[25,.18]},dark:{1:[19,.015],2:[21,.018],3:[25.5,.055],4:[29.3,.084],5:[33.5,.098],6:[39.05,.107],7:[45,.11],8:[55,.13],9:[60,.22],10:[67,.18],11:[79.3,.12],12:[95,.04]}},ef=(e,t=1,r)=>n=>{const[i,a]=Qd[r][n];return"oklch("+i+"% "+a*t+" "+e+")"},sn=e=>{const t=ef(e.hue,e.chroma,e.mode);return Object.fromEntries(Xd.map(r=>[e.prefix+r,e.transform(t(r))]))},ln=e=>e,tf=e=>{const t=Object.keys(e).flatMap(r=>{const n=e[r];return typeof n=="object"&&n!==null?Object.keys(n).map(i=>{const a=n[i];return[`${String(r)}.${i}`,a]}):[[r,n]]});return Object.fromEntries(t)},dr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),cn=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(dr(e)&&dr(r))for(const n in r){const i=r[n];if(dr(i)){e[n]||Object.assign(e,{[n]:{}});const a=e[n];dr(a)&&cn(a,i)}else Object.assign(e,{[n]:r[n]})}return cn(e,...t)},rf=e=>{function t(r,n){const i=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${i}`:`var(--${i})`}return t},nf=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:i,getToken:a}=n,o=p=>a("reference",p.toString()),s=e({theme:i}),l=t({theme:i,core:o,raw:{core:s}}),u=r({theme:i,core:o,semantic:o,raw:{core:s,semantic:l}}),h=tf(cn(s,l,u)),d=([p,g],v)=>{const y=[v,p].filter(Boolean).join(".");return typeof g=="object"?Object.entries(g).flatMap(k=>d(k,y)):[[n.getToken("declaration",y),g]]};return{values:h,declarations:Object.fromEntries(Object.entries(h).flatMap(p=>d(p))),ref:p=>a("reference",p.toString())}}})})})});const[un,dn,Ca]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],af=nf().core(({theme:e})=>({color:{black:un,white:dn,lowest:e.mode==="light"?dn:un,highest:e.mode==="light"?un:dn,...sn({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:ln}),...sn({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:ln}),...sn({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:ln})},typography:{}})).semantic(({core:e,raw:t,theme:r})=>{const n=(i,a)=>t.core.color[i].replace(")",` / ${a})`);return{"font-family":{body:"inherit",headings:"inherit"},"font-style":{body:"normal",headings:"normal"},"font-weight-body":"normal","font-weight-headings":"normal","radius-app":"1.5rem","radius-interactive":"1.5rem",color:{divider:n("n-8",r.mode==="dark"?.4:.2)},"copy-body":e("color.n-12"),"copy-headings":e("color.n-12"),interactive:{copy:e("color.n-11"),"copy-hover":e("color.n-12"),"copy-active":e("color.n-12"),bg:Ca,"bg-hover":n("n-10",.4),"bg-active":n("n-10",.5)}}}).component(({raw:e,theme:t,semantic:r,core:n})=>{const i=(a,o)=>e.core.color[a].replace(")",` / ${o})`);return{app:{bg:n(t.mode==="dark"?"color.n-1":"color.n-2")},overlay:{bg:i("black",.4)},bubble:{"weak-bg":n(t.mode==="dark"?"color.n-3":"color.lowest"),"weak-outline":r("color.divider"),"strong-shadow":i("a-9",.05)},"status-bar":{bg:i("n-2",.8),"bg-button":Ca,"bg-button-hover":i("n-10",.4),"bg-button-active":i("n-10",.5)},"submit-button":{"bg-active":n(t.mode==="dark"?"color.a-8":"color.a-11")}}}),of=rf({prefix:"i-"}),sf=e=>{const t=af.from({theme:e,getToken:of}),r=Object.entries(t.declarations).map(([n,i])=>`${n}: ${i};`);return`#isdk {
43
3
  ${r.concat(r).join(`
44
4
  `)}
45
- }`},Qa=({context:e,schema:t,logger:r})=>{if(t)for(const n in t){const o=t[n];if(!o)continue;const i=Dt(e,n,null);if(o.required&&i===null){const a=`Configuration error in context: ${n} is required`;throw r.error(a),new Error(a)}switch(o.type){case"number":if(typeof i!="number")throw new Error(`Configuration error in context: ${n} is not a number`);break;case"string":if(typeof i!="string")throw new Error(`Configuration error in context: ${n} is not a string`);break;default:o.type}}},Rp=({_internal_domManager:e=Tp(),theme:t})=>Qe(({apiClient:r,logger:n,analytics:o})=>{let i=!1;const a=()=>{if(typeof window>"u")return;const s=[D("style",{id:"inploi-chatbot-styles"},Cp),D("style",{id:"inploi-chatbot-theme"},Lp(t))],c=e.getOrCreateChatbotElement();gt(D(Y,{},[s,D(kp,{apiClient:r,logger:n,analytics:o})]),c),i=!0};return{prepare:async()=>{if(!(typeof window>"u"))try{if(i)return;a(),n.info("Chatbot plugin prepared")}catch(s){n.error("Error preparing chatbot plugin",s)}},fetchFlowByJobId:async(s,c)=>{const u=new URLSearchParams({id_type:(c==null?void 0:c.idType)==="inploi"?"internal":"external"});return r.fetch([`/flow/job/${s}`,u.toString()].filter(Boolean).join("?")).then(f=>{const l=dr(Sp,f);return{flow:l.flow,title:`Applying for “${l.job.title}”`,flowKeys:[l.job.id,...(c==null?void 0:c.flowKeys)??[]],job:{id:l.job.id,id_type:"external"},...c}})},fetchFlowById:async(s,c)=>r.fetch(`/flow/id/${s}`).then(u=>{var l;const f=dr($p,u);return{flow:f.flow,title:"Chatbot",flowKeys:(c==null?void 0:c.flowKeys)??[],...c,analytics:{customProperties:{flow_id:f.flow.id,flow_version:f.flow.version,...(l=c==null?void 0:c.analytics)==null?void 0:l.customProperties}}}}),open:async s=>{if(!(typeof window>"u"))try{P.cancelCurrentFlow(),P.viewState$.value="maximised",i||a(),s instanceof Promise?(P.current$.value={state:"loading"},s.then(async c=>{Qa({context:c.context||{},schema:c.flow.context_schema,logger:n}),P.startFlow(c)}).catch(c=>{const u=c instanceof Error?c.message:"An error occurred";P.current$.value={state:"error",error:u}})):(Qa({context:s.context||{},schema:s.flow.context_schema,logger:n}),P.startFlow(s))}catch(c){n.error("Error starting flow",c)}},close:async()=>{typeof window>"u"||(P.cancelCurrentFlow(),n.info("Closed flow from an external source"))}}});if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=Rp;const es=({condition:e,context:t,submissions:r,ifBlock:n})=>{const[o,...i]=e.compareKey.split(".");if(!o)return!1;const a=rs({context:t,key:o,path:i,submissions:r});if(!a)return!1;switch(a.type){case"address":{const s=Dt(a.value,i.join("."));switch(e.compare){case"equals":return s===e.compareValue;case"contains":return s?s.includes(e.compareValue):!1;case"notEquals":return s!==e.compareValue;case"notContains":return s?!s.includes(e.compareValue):!0}break}case"integration":{if(typeof a.value!="object"||Array.isArray(a.value))return!1;const s=Dt(a.value,i.join(".")),c={...n,data:{...n.data,compareKey:"_temp"}};switch(typeof s){case"boolean":return Zt(c,{submissions:{_temp:{value:s,type:"boolean"}},context:t});case"string":return Zt(c,{submissions:{_temp:{value:s,type:"string"}},context:t});case"number":return Zt(c,{submissions:{_temp:{value:s,type:"number"}},context:t});case"object":return Array.isArray(s)&&s.every(Ha)?Zt(c,{submissions:{_temp:{value:s,type:"enum"}},context:t}):!1}break}case"boolean":{const s=e.compareValue==="true";switch(e.compare){case"equals":return a.value===s;case"notEquals":return a.value!==s}break}case"string":switch(e.compare){case"equals":return a.value===e.compareValue;case"contains":return a.value?a.value.includes(e.compareValue):!1;case"notEquals":return a.value!==e.compareValue;case"notContains":return a.value?!a.value.includes(e.compareValue):!0}break;case"number":{try{const s=Number(e.compareValue);switch(e.compare){case"equals":return a.value===s;case"notEquals":return a.value!==s;case"greaterThan":return a.value>s;case"greaterThanOrEqualTo":return a.value>=s;case"lessThan":return a.value<s;case"lessThanOrEqualTo":return a.value<=s}}catch{return console.error(`Failed to parse number in if-block ${n.id}`,a.value),!1}break}case"enum":switch(e.compare){case"equals":return a.value.length===1&&a.value[0]===e.compareValue;case"notEquals":return a.value.length===1&&a.value[0]!==e.compareValue;case"contains":return a.value.includes(e.compareValue);case"notContains":return!a.value.includes(e.compareValue)}break}},Zt=(e,{context:t,submissions:r})=>{const n="combinator"in e.data?e.data.conditions:[e.data];if(("combinator"in e.data?e.data.combinator:"and")==="or"){for(const i of n)if(es({condition:i,context:t,submissions:r,ifBlock:e}))return!0;return!1}else{for(const i of n)if(!es({condition:i,context:t,submissions:r,ifBlock:e}))return!1;return!0}},jp=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,Re=(e,{context:t,submissions:r})=>e.replace(jp,(n,o,i="")=>{const[a,...s]=o.trim().split("."),c=rs({key:a,path:s,submissions:r,context:t});if(!c)return i;switch(c.type){case"boolean":return c.value===!0?"true":"false";case"file":return c.value.map(u=>`${u.name} (${Wt(u.sizeKb)})`).join(", ");case"enum":return c.value.join(", ");case"address":return Object.values(c.value).filter(u=>u&&u.trim().length>0).join(", ");case"number":case"string":return c.value?c.value.toString():i;case"integration":{if(typeof c.value!="object"||Array.isArray(c.value))break;const u=Dt(c.value,s.join("."));switch(typeof u){case"boolean":return u===!0?"true":"false";case"string":return u;case"number":return u.toString();case"object":if(Array.isArray(u)&&u.every(Ha))return u.join(", ")}break}}return i}),ts=({node:e,nodes:t,stopWhen:r})=>{if((r==null?void 0:r(e))===!0)return e;const n=e.nextId?t.find(o=>o.id===e.nextId):void 0;if(n)return ts({node:n,nodes:t,stopWhen:r})},Vp=({childNode:e,nodes:t})=>{const n=t.filter(o=>o.type==="if-block").find(o=>{if(!o.branchId)return!1;const i=t.find(s=>s.id===o.branchId);if(!i)return!1;const a=ts({node:i,nodes:t,stopWhen:s=>s.id===e.id});return!(!a||a.id!==e.id)});if(n!=null&&n.nextId)return t.find(o=>o.id===n.nextId)},Bp=({flow:e,analytics:t,logger:r,context:n,apiClient:o,getSubmissions:i,chatService:a,onFlowEnd:s,onInterpret:c})=>{let u=new AbortController;const f={...t.service,log:p=>t.service.log({...p,customProperties:{...p.customProperties,...t.customProperties}})},l=async(p,m)=>{const g=i();c==null||c(p,m);try{await zp({flow:e,analytics:f,logger:r,apiClient:o,context:n,node:p,submissions:g,chat:{sendMessage:async v=>a.send({groupId:p.id,message:v,signal:u.signal}),userInput:async v=>a.input({input:v,signal:u.signal}),addToSubmissions:a.addToSubmissions},next:v=>{const _=v?e.nodes.find(x=>x.id===v):Vp({childNode:p,nodes:e.nodes});return _?l(_,p):s==null?void 0:s(p)},end:()=>s==null?void 0:s(p)})}catch(v){if(v instanceof Gt)return;throw v}};return{interpret:async p=>{const m=e.nodes.find(g=>g.id===p)??Ua(e.nodes);return l(m)},undo:p=>{let m=1;const g=e.nodes.find(_=>_.id===p[p.length-1]);for(let _=p.length-2;_>0;_--){const x=p[_],w=e.nodes.find(T=>T.id===x);if(!w||(m++,w.type.startsWith("question-")))break}u.abort(),u=new AbortController;const v=e.nodes.find(_=>_.id===p[p.length-m]);return Se(v,"Undo failed: new start node not found"),l(v,g),{removed:m}},abort:()=>{u.abort()}}};async function zp(e){const t=e.node;switch(t.type){case"text":return Yp({...e,node:t});case"image":return Xp({...e,node:t});case"question-text":return Zp({...e,node:t});case"question-enum":return Qp({...e,node:t});case"question-number":return Jp({...e,node:t});case"question-boolean":return ev({...e,node:t});case"question-file":return rv({...e,node:t});case"question-address":return tv({...e,node:t});case"end-flow":return nv({...e,node:t});case"if-block":return Gp({...e,node:t});case"jump":return Hp({...e,node:t});case"link":return Kp({...e,node:t});case"integration-application-submit":return Wp({...e,node:t});case"add-submission":return qp({...e,node:t});case"integration-workflow-get":throw Error("Workflow should be unreachable");case"identify":return Up({...e,node:t});default:throw new Error(`Unknown node: ${JSON.stringify(t)}`)}}const Jt=(e,t)=>{var n;const r=(n=e[t])==null?void 0:n.value;if(typeof r!="string"&&typeof r!="number")throw new Error(`Submission at “${t}” is not a string or number`);return r};async function Up({next:e,node:t,analytics:r,submissions:n,logger:o}){if(!n)return e(t.nextId);try{r.log({event:"IDENTIFY",properties:{identifier:Jt(n,t.data.key).toString(),first_name:t.data.firstName?Jt(n,t.data.firstName).toString():void 0,last_name:t.data.lastName?Jt(n,t.data.lastName).toString():void 0,email:t.data.email?Jt(n,t.data.email).toString():void 0,phone_number:t.data.phoneNumber?Jt(n,t.data.phoneNumber).toString():void 0,custom_traits:t.data.customTraits?Object.fromEntries(t.data.customTraits.map(({key:i,value:a})=>{var s;return[i,(s=n[a])==null?void 0:s.value]})):void 0}})}catch(i){o.error(i)}finally{e(t.nextId)}}async function Hp({next:e,node:t}){e(t.data.targetId)}async function qp({next:e,node:t,logger:r,submissions:n,context:o}){if(!n){r.error("Submissions not found");return}n[t.data.key]={type:"string",value:Re(t.data.value,{submissions:n,context:o})},e(t.nextId)}async function Wp({chat:e,next:t,node:r,logger:n,apiClient:o,submissions:i,analytics:a,flow:s}){const c=async u=>{u!==!0&&await e.userInput({type:"submit",key:void 0,config:{label:r.data.submitLabel}}),await e.sendMessage({type:"loading"});const{anonymous_id:f,session_id:l}=a.getSessionInfo(),p=await o.fetch("/flow/submit",{method:"POST",body:JSON.stringify({log_submit:!1,integration_id:r.data.integrationId,anonymous_id:f,session_id:l,job:s.job,submissions:dp(i||{})})}).catch(m=>m);r.data.key&&e.addToSubmissions(r.data.key,{type:"integration",value:p}),st(p).with({integration_response:N.select(N.union({service:N.optional(N.string),status:N.number,data:N.any},{service:N.optional(N.string),status:N.number,error:{message:N.string,data:N.any}}))},m=>{a.log({event:"FLOW_SUBMIT",properties:{flow_id:s.id,flow_version:s.version,flow_session_id:s.data.flowSessionId,flow_build:s.build,service:m.service??"INVALID_SERVICE",response:{status:m.status,payload:"data"in m?m.data:m.error.data??null},job:s.job}})}).otherwise(()=>{}),await st(p).with(N.union({ats_data:N.select("redirect",{redirect_url:N.string,message:N.optional(N.union(N.string,N.nullish)),button_text:N.optional(N.union(N.string,N.nullish))})},{integration_response:{data:N.select("redirect",{redirect_url:N.string,message:N.optional(N.union(N.string,N.nullish)),button_text:N.optional(N.union(N.string,N.nullish))})}}),async m=>{if(m.redirect!==void 0){await e.sendMessage({type:"text",author:"bot",text:m.redirect.message??"Almost there! Please complete your submission here:"});try{const g=new URL(m.redirect.redirect_url);f&&!g.searchParams.has("anonymous_id")&&g.searchParams.set("anonymous_id",f),await e.sendMessage({type:"link",href:g.toString(),text:m.redirect.button_text??"Complete submission",onClick:()=>{if(!l){n.error("session_id not set, cannot log FLOW_REDIRECT event");return}a.log({event:"FLOW_REDIRECT",properties:{flow_build:s.build,flow_id:s.id,flow_session_id:l,flow_version:s.version,href:g.toString(),job:s.job}})}})}catch(g){n.error(`Invalid redirect URL: ${m.redirect.redirect_url}`,g),e.sendMessage({type:"system",variant:"error",text:"Couldn’t get the redirect URL."})}t(r.nextId)}}).with({success:!0},async()=>{r.data.skipConfirmation!==!0&&await e.sendMessage({type:"system",variant:"success",text:"Submission completed!"}),t(r.nextId)}).with(N.union({success:!1,ats_data:N.select("error",{message:N.string})},{integration_response:{error:N.select("error",{message:N.string})}}),async m=>{var g;n.error(m.error),await e.sendMessage({type:"system",variant:"error",text:((g=m.error)==null?void 0:g.message)||"Failed to submit"}),await c(!1)}).otherwise(async m=>{n.error(m),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit"}),await c(!1)})};await c(r.data.skipConfirmation)}async function Kp({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({type:"link",href:Re(r.data.href,{submissions:n,context:o}),text:Re(r.data.cta,{submissions:n,context:o})}),t(r.nextId)}async function Gp({submissions:e,next:t,node:r,context:n}){t(Zt(r,{submissions:e,context:n})?r.branchId:r.nextId)}async function Yp({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Re(r.data.text,{submissions:n,context:o})}),t(r.nextId)}async function Xp({chat:e,next:t,node:r}){await e.sendMessage({author:"bot",type:"image",url:r.data.url,height:r.data.height,width:r.data.width}),t(r.nextId)}async function Zp({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Re(r.data.question,{submissions:n,context:o})});const i=r.data.format==="phone"?await e.userInput({key:r.data.key,type:"phone",config:{optional:r.data.optional,placeholder:r.data.placeholder,maxChars:r.data.maxChars,minChars:r.data.minChars}}):await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:r.data.format,maxChars:r.data.maxChars,minChars:r.data.minChars}});i===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:i.value}),t(r.nextId)}async function Jp({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Re(r.data.question,{submissions:n,context:o})});const i=await e.userInput({key:r.data.key,type:"number",config:{max:r.data.max,min:r.data.min,optional:r.data.optional,placeholder:r.data.placeholder,decimalCases:r.data.decimalCases}});i===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:i.value.toString()}),t(r.nextId)}async function Qp({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Re(r.data.question,{submissions:n,context:o})});const i=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});i.value.length===0?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(a=>i.value.includes(a.value)).map(a=>a.label).join(", ")}),t(r.nextId)}async function ev({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Re(r.data.question,{submissions:n,context:o})});const i=await e.userInput({key:r.data.key,type:"boolean",config:{optional:r.data.optional,labels:{true:r.data.trueLabel,false:r.data.falseLabel}}});i===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:i.value===!0?r.data.trueLabel:r.data.falseLabel}),t(r.nextId)}async function tv({chat:e,next:t,node:r}){await e.sendMessage({author:"bot",type:"text",text:r.data.question});const n=await e.userInput({type:"address",key:r.data.key,config:{optional:r.data.optional,keys:r.data.keys,placeholder:r.data.placeholder}});if(n===null)await e.sendMessage({type:"system",variant:"info",text:"Skipped"});else{const o=Object.values(n.value).filter(i=>i&&i.trim().length>0).join(", ");await e.sendMessage({author:"user",type:"text",text:o})}return t(r.nextId)}async function rv({node:e,chat:t,next:r,submissions:n,context:o}){await t.sendMessage({author:"bot",type:"text",text:Re(e.data.question,{submissions:n,context:o})});const i=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(i===null)await t.sendMessage({type:"system",variant:"info",text:"Skipped"});else for(const a of i.value)await t.sendMessage({author:"user",type:"file",fileName:a.name,fileSizeKb:a.sizeKb});r(e.nextId)}async function nv({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const rs=({key:e,path:t,submissions:r,context:n})=>{if(e==="$context"){if(!t)return;const o=Dt(n,t.join("."));switch(typeof o){case"string":return{type:"string",value:o};case"number":return{type:"number",value:o};case"boolean":return{type:"boolean",value:o};default:console.warn(`Unexpected type for $context.${t.join(".")}`,o);return}}return r==null?void 0:r[e]};function eo(e,t,r){var n,o,i,a,s;t==null&&(t=100);function c(){var f=Date.now()-a;f<t&&f>=0?n=setTimeout(c,t-f):(n=null,r||(s=e.apply(i,o),i=o=null))}var u=function(){i=this,o=arguments,a=Date.now();var f=r&&!n;return n||(n=setTimeout(c,t)),f&&(s=e.apply(i,o),i=o=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(i,o),i=o=null,clearTimeout(n),n=null)},u}eo.debounce=eo;var ov=eo;const ns=Pe(ov);function iv(e){let{debounce:t,scroll:r,polyfill:n,offsetSize:o}=e===void 0?{debounce:0,scroll:!1,offsetSize:!1}:e;const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,s]=K({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=L({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),u=t?typeof t=="number"?t:t.scroll:null,f=t?typeof t=="number"?t:t.resize:null,l=L(!1);V(()=>(l.current=!0,()=>void(l.current=!1)));const[p,m,g]=ve(()=>{const w=()=>{if(!c.current.element)return;const{left:T,top:I,width:O,height:H,bottom:W,right:M,x:F,y:ae}=c.current.element.getBoundingClientRect(),te={left:T,top:I,width:O,height:H,bottom:W,right:M,x:F,y:ae};c.current.element instanceof HTMLElement&&o&&(te.height=c.current.element.offsetHeight,te.width=c.current.element.offsetWidth),Object.freeze(te),l.current&&!lv(c.current.lastBounds,te)&&s(c.current.lastBounds=te)};return[w,f?ns(w,f):w,u?ns(w,u):w]},[s,o,u,f]);function v(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",g,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function _(){c.current.element&&(c.current.resizeObserver=new i(g),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach(w=>w.addEventListener("scroll",g,{capture:!0,passive:!0})))}const x=w=>{!w||w===c.current.element||(v(),c.current.element=w,c.current.scrollContainers=os(w),_())};return sv(g,!!r),av(m),V(()=>{v(),_()},[r,g,m]),V(()=>v,[]),[x,a,p]}function av(e){V(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function sv(e,t){V(()=>{if(t){const r=e;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",r,!0)}},[e,t])}function os(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:o}=window.getComputedStyle(e);return[r,n,o].some(i=>i==="auto"||i==="scroll")&&t.push(e),[...t,...os(e.parentElement)]}const cv=["x","y","top","bottom","left","right","width","height"],lv=(e,t)=>cv.every(r=>e[r]===t[r]),lt=({class:e,...t})=>d("button",{class:ot("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50",e),type:"submit",...t,children:d("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[d("title",{children:"Send"}),d("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),d("path",{d:"M8 4V13"})]})}),uv=25,to=Ge({instant:()=>{},smooth:()=>{}}),le={onSubmitSuccessFn$:Ge(()=>{}),isBotTyping$:Ge(!1),scrollToEnd:{instant:()=>to.value.instant(),smooth:()=>to.value.smooth()}},dv=()=>{const e=L(null);pe(()=>{to.value={instant:()=>{var r;return(r=e.current)==null?void 0:r.scrollTo({top:e.current.scrollHeight,behavior:"instant"})},smooth:()=>{e.current&&e.current.scrollHeight-e.current.scrollTop<=e.current.clientHeight*2&&e.current.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})}}},[e]);const t=ve(()=>({addToSubmissions:(n,o)=>P.setSubmission(n,o),send:async({message:n,signal:o,groupId:i})=>{if(await st(n).with({author:"bot",type:"text"},async a=>{if(o!=null&&o.aborted)throw new Gt;le.isBotTyping$.value=!0;const s=Math.min(Math.max(20,a.text.length),100)*uv;await new Promise(c=>setTimeout(c,s,{signal:o})),le.isBotTyping$.value=!1}).otherwise(async()=>{}),o!=null&&o.aborted)throw new Gt;P.addMessage(n,i)},input:({input:n,signal:o})=>{if(o!=null&&o.aborted)throw new Gt;return P.setInput(n),new Promise(i=>{const a=s=>{if(o!=null&&o.aborted)throw new Gt;P.setInput(void 0),n.key&&P.setSubmission(n.key,s),i(s)};le.onSubmitSuccessFn$.value=a})}}),[]);return{chatRef:e,chatService:t}},Ot=({error:e})=>!e||!e.message?null:d("div",{role:"alert",class:"text-error-11 flex max-w-full items-center gap-1 overflow-hidden rounded-full px-2 py-2",children:[d("svg",{class:"text-error-9 h-4 w-4",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),d("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),d("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),d("p",{class:"truncate pr-1 text-sm",children:e.message})]}),ut=({class:e,...t})=>d("button",{type:"button",class:ot("fr text-neutral-9 flex flex-shrink-0 items-center justify-center gap-1 rounded-full py-[6px] pl-2 pr-3 text-sm underline-offset-2 transition-all",e),...t,children:[d("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",children:[d("title",{children:"Skip"}),d("path",{d:"M3.25 11.25A5 5 0 0 1 12 7"}),d("path",{d:"M13.25 4.5V8.25H9.5"})]}),"Skip"]}),ro={Afghanistan:"93",Albania:"355",Algeria:"213","American Samoa":"1 684",Andorra:"376",Angola:"244",Anguilla:"1 264",Antarctica:"672","Antigua and Barbuda":"1 268",Argentina:"54",Armenia:"374",Aruba:"297",Australia:"61",Austria:"43",Azerbaijan:"994",Bahrain:"973",Bangladesh:"880",Barbados:"1 246",Belarus:"375",Belgium:"32",Belize:"501",Benin:"229",Bermuda:"1 441",Bhutan:"975",Bolivia:"591","Bosnia and Herzegovina":"387",Botswana:"267","Bouvet Island":"47",Brazil:"55","British Indian Ocean Territory":"246","British Virgin Islands":"1 284",Brunei:"673",Bulgaria:"359","Burkina Faso":"226",Burundi:"257","Cabo Verde":"238",Cambodia:"855",Cameroon:"237",Canada:"1","Caribbean Netherlands":"599","Cayman Islands":"1 345","Central African Republic":"236",Chad:"235",Chile:"56",China:"86","Christmas Island":"61","Cocos (Keeling) Islands":"61",Colombia:"57",Comoros:"269","Cook Islands":"682","Costa Rica":"506",Croatia:"385",Cuba:"53",Curaçao:"599",Cyprus:"357",Czechia:"420","Côte d'Ivoire":"225","Democratic Republic of the Congo":"243",Denmark:"45",Djibouti:"253","Dominican Republic":"1 809",Ecuador:"593",Egypt:"20","El Salvador":"503","Equatorial Guinea":"240",Eritrea:"291",Estonia:"372",Eswatini:"268",Ethiopia:"251","Falkland Islands (Islas Malvinas)":"500","Faroe Islands":"298",Fiji:"679",Finland:"358",France:"33","French Guiana":"594","French Polynesia":"689","French Southern and Antarctic Lands":"262",Gabon:"241",Georgia:"995",Germany:"49",Ghana:"233",Gibraltar:"350",Greece:"30",Greenland:"299",Grenada:"1 473",Guadeloupe:"590",Guam:"1 671",Guatemala:"502",Guernsey:"44",Guinea:"224","Guinea-Bissau":"245",Guyana:"592",Haiti:"509",Honduras:"504","Hong Kong":"852",Hungary:"36",Iceland:"354",India:"91",Indonesia:"62",Iran:"98",Iraq:"964",Ireland:"353","Isle of Man":"44",Israel:"972",Italy:"39",Jamaica:"1 876",Japan:"81",Jersey:"44",Jordan:"962",Kazakhstan:"7",Kenya:"254",Kiribati:"686",Kosovo:"383",Kuwait:"965",Kyrgyzstan:"996",Laos:"856",Latvia:"371",Lebanon:"961",Lesotho:"266",Liberia:"231",Libya:"218",Liechtenstein:"423",Lithuania:"370",Luxembourg:"352",Macao:"853",Madagascar:"261",Malawi:"265",Malaysia:"60",Maldives:"960",Mali:"223",Malta:"356","Marshall Islands":"692",Martinique:"596",Mauritania:"222",Mauritius:"230",Mayotte:"262",Mexico:"52",Micronesia:"691",Moldova:"373",Monaco:"377",Mongolia:"976",Montenegro:"382",Montserrat:"1 664",Morocco:"212",Mozambique:"258","Myanmar (Burma)":"95",Namibia:"264",Nauru:"674",Nepal:"977",Netherlands:"31","New Caledonia":"687","New Zealand":"64",Nicaragua:"505",Niger:"227",Nigeria:"234",Niue:"683","Norfolk Island":"672","North Korea":"850","North Macedonia":"389","Northern Mariana Islands":"1 670",Norway:"47",Oman:"968",Pakistan:"92",Palau:"680",Palestine:"970",Panama:"507","Papua New Guinea":"675",Paraguay:"595",Peru:"51",Philippines:"63","Pitcairn Islands":"64",Poland:"48",Portugal:"351","Puerto Rico":"1 787",Qatar:"974",Romania:"40",Russia:"7",Rwanda:"250",Réunion:"262","Saint Barthélemy":"590","Saint Helena, Ascension and Tristan da Cunha":"290","Saint Kitts and Nevis":"1 869","Saint Lucia":"1 758","Saint Martin":"590","Saint Pierre and Miquelon":"508","Saint Vincent and the Grenadines":"1 784",Samoa:"685","San Marino":"378","Saudi Arabia":"966",Senegal:"221",Serbia:"381",Seychelles:"248","Sierra Leone":"232",Singapore:"65","Sint Maarten":"1 721",Slovakia:"421",Slovenia:"386","Solomon Islands":"677",Somalia:"252","South Africa":"27","South Georgia and the South Sandwich Islands":"500","South Korea":"82","South Sudan":"211",Spain:"34","Sri Lanka":"94",Sudan:"249",Suriname:"597","Svalbard and Jan Mayen":"47",Sweden:"46",Switzerland:"41",Syria:"963","São Tomé and Príncipe":"239",Taiwan:"886",Tajikistan:"992",Tanzania:"255",Thailand:"66","The Bahamas":"1 242","The Gambia":"220","Timor-Leste":"670",Togo:"228",Tokelau:"690",Tonga:"676","Trinidad and Tobago":"1 868",Tunisia:"216",Turkmenistan:"993","Turks and Caicos Islands":"1 649",Tuvalu:"688",Türkiye:"90","U.S. Virgin Islands":"1 340",Uganda:"256",Ukraine:"380","United Arab Emirates":"971","United Kingdom":"44","United States":"1","United States Minor Outlying Islands":"1",Uruguay:"598",Uzbekistan:"998",Vanuatu:"678","Vatican City":"379",Venezuela:"58",Vietnam:"84","Wallis and Futuna":"681","Western Sahara":"212",Yemen:"967",Zambia:"260",Zimbabwe:"263","Åland Islands":"358"},fv="https://api.mapbox.com/search/searchbox/v1/suggest",hv="ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==",pv=e=>atob(e).split("").reverse().join(""),je=de({name:se()}),vv=de({suggestions:ii(de({full_address:jt(se()),place_formatted:jt(se()),name:jt(se()),mapbox_id:se(),context:Bd(de({address:je,street:je,neighborhood:je,locality:je,district:je,place:je,region:je,postcode:je,country:je}))}))}),mv=({logger:e})=>ve(()=>{var r;const t=(r=P.current$.peek().flow)==null?void 0:r.data.flowSessionId;return t?{enabled:!0,getPredictions:async n=>{const o=new URL(fv);o.searchParams.set("q",n),o.searchParams.set("session_token",t),o.searchParams.set("access_token",pv(hv));const i=await fetch(o);if(!i.ok)return e.error("Failed to get address details",i),{ok:!1,error:"Something went wrong! Plase continue manually."};const a=zd(vv,await i.json());if(a.success===!1)return e.error("Failed to parse address details",a.issues),{ok:!1,error:"Something went wrong! Plase continue manually."};const{suggestions:s}=a.output;return{ok:!0,data:s.map(c=>{var u,f,l,p,m,g,v,_,x;return{label:c.full_address??c.place_formatted??c.name??c.mapbox_id,id:c.mapbox_id,address:{line1:((u=c.context.address)==null?void 0:u.name)??((f=c.context.street)==null?void 0:f.name),line2:void 0,line3:((l=c.context.neighborhood)==null?void 0:l.name)??((p=c.context.locality)==null?void 0:p.name),city:((m=c.context.place)==null?void 0:m.name)??((g=c.context.district)==null?void 0:g.name),state:(v=c.context.region)==null?void 0:v.name,postcode:(_=c.context.postcode)==null?void 0:_.name,country:(x=c.context.country)==null?void 0:x.name}}})}}}:{enabled:!1}},[e]),is=e=>d("button",{type:"button",class:"text-neutral-10 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",...e,children:[d("svg",{width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d("path",{d:"M10 3L5 8L10 13"})}),d("span",{children:"Back"})]}),no={label:"Fill in manually",value:""},gv=({input:e,onSubmitSuccess:t,logger:r})=>{const[n,o]=K(),[i,a]=K([]),{enabled:s,getPredictions:c}=mv({logger:r}),[u,f]=K(s?"query":"manual"),[l,p]=K(""),[m,g]=K(),v=_=>{Se(s,"Query state should not be enabled"),_=_.trim(),_!==(l==null?void 0:l.trim())&&(p(_),_===""&&a([]),g(void 0),c(_).then(x=>{if(x.ok===!1){a([]),g(x.error);return}a(x.data)}))};switch(u){case"query":return Se(s,"Query state should not be enabled"),d(bv,{input:e,onSkip:()=>t(null),onAddressSelect:_=>{const x=i.find(w=>w.id===_);x&&(o(x.address),f("details"))},onAddressSearch:_=>{v(_)},suggestions:i,query:l,error:m});case"details":return Se(n!==void 0),d(ss,{input:e,logger:r,onSubmitSuccess:t,addressFields:n,actions:d(is,{onClick:()=>{f("query")}})});case"manual":return d(ss,{logger:r,input:e,onSubmitSuccess:t,addressFields:{},actions:s?d(is,{onClick:()=>{f("query")}}):void 0})}},bv=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:o,onAddressSearch:i,error:a})=>{const s=L(null);return pe(()=>{s.current&&(s.current.focus(),s.current.select())},[]),d(Y,{children:[d("form",{noValidate:!0,onSubmit:c=>{c.preventDefault();const f=new FormData(c.currentTarget).get("address");typeof f=="string"&&i(f)},class:"flex gap-1 p-2.5",children:[d("div",{class:"group relative flex-1",children:[d("input",{ref:s,name:"address",id:"chat-address",autocomplete:"address-line1 country-name postal-code",autoFocus:!0,class:"outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest w-full rounded-full px-3 py-1 text-base outline outline-2 transition-all",placeholder:e.config.placeholder||"Type and search for places...",defaultValue:o}),d("button",{type:"submit",class:"touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",children:d("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d("g",{id:"inploi",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",strokeWidth:"1.5",children:[d("circle",{cx:"7",cy:"7",r:"4"}),d("path",{d:"M10 10L13 13"})]}),d("span",{class:"sr-only",children:"Search"})]})})]}),e.config.optional&&d(ut,{class:"",onClick:t})]}),a?d(Ot,{error:{message:a}}):null,d("ul",{children:[r.map(c=>d("li",{children:d("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n(c.id)},children:[d("span",{class:"flex-grow",children:c.label}),d("svg",{class:"flex-none",width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d("path",{d:"M6 3L11 8L6 13"})})]})},c.id)),d("li",{children:d("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n(no.value)},children:d("span",{class:"flex-grow",children:no.label})})},no.label)]})]})},yv={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},as=["line1","line2","line3","city","state","postcode","country"],ss=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const o=L(null);pe(()=>{if(o.current){const a=o.current.querySelector("input");a&&(a.focus(),a.select())}},[]);const i=Object.keys(ro);return d("form",{class:"bg-neutral-1/90 flex flex-col justify-end gap-2 p-2",onSubmit:a=>{const s=new FormData(a.currentTarget),c=Object.fromEntries(s.entries());t({type:"address",value:c})},children:[d("div",{class:"bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",ref:o,children:as.map((a,s)=>{const c=`isdk_${a}`,u=n.config.keys[a];return u?d(Y,{children:[d("label",{for:c,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:yv[a]}),d("div",{class:"flex flex-col items-stretch gap-1.5",children:[a==="country"?d("div",{class:"relative",children:[d("select",{class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",name:u,id:c,defaultValue:e[a],required:!0,children:[e.country&&!i.includes(e.country)?d("option",{value:e[a],children:e[a]}):d("option",{value:"",children:"Select a country"}),i.map(f=>d("option",{value:f,children:f},f))]}),d("svg",{class:"text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",width:"16",height:"16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d("path",{d:"M4 6.5L8 10.5L12 6.5"})})]}):d("input",{autoFocus:s===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",name:u,id:c,defaultValue:e[a],required:!0}),s===as.length-1?d("hr",{class:"m-0 w-full border-b border-b-transparent"}):d("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"})]})]}):null})}),d("div",{class:"flex w-full flex-1 ",children:[d("div",{class:"flex-grow",children:r}),d(lt,{class:"flex items-center justify-center"})]})]})},oo=()=>{const e=L(null);return V(()=>{var t;(t=e.current)==null||t.focus()},[]),e},cs=["true","false"],_v=Fd(cs),wv="answer",ls="flex items-center gap-2 p-2.5",us=re(({label:e,...t},r)=>d("button",{class:"bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all selection:bg-transparent",...t,ref:r,children:d("p",{class:"truncate text-center text-base",children:e})})),xv=({input:e,onSubmitSuccess:t})=>{const r=oo();return d("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const o=pp(n).value,i=dr(_v,o);t({type:"boolean",value:i==="true"})},children:[d("ul",{class:ls,children:cs.map((n,o)=>d("li",{class:"flex-1",children:d(us,{ref:o===0?r:null,type:"submit",name:wv,value:n,label:e.config.labels[n]},n)}))}),e.config.optional&&d("div",{class:"px-2 pb-2",children:d(ut,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},kv=e=>new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>n.result?t(n.result.toString()):r("No result from reader"),n.onerror=r}),$v=e=>e.reduce((t,r)=>t+r.sizeKb,0),Sv=Kt("file"),ds=3,Cv=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${n}$`),"");return d("div",{class:ot("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...r,children:[d("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[d("span",{class:"block truncate",children:o}),d("span",{children:[".",n]})]}),d("p",{"aria-label":"File size",class:"text-accent-11",children:Wt(e.sizeKb)})]})},fs=({class:e,...t})=>d("li",{class:ot("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),hs=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},Ev=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(hs(n.name).toLowerCase()))},Tv=(e,t)=>{const r=hs(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},Ov=({input:e,onSubmitSuccess:t})=>{var f;const r=(f=P.current$.value.flow)==null?void 0:f.data.submissions[e.key],[n,o]=K(Sv(r)?r.value:[]),[i,a]=K(),s=n.length-ds,c=$v(n),u=oo();return d("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:l=>(l.preventDefault(),a(void 0),n.length===0?a({type:"required",message:"Please select a file"}):e.config.extensions.length>0&&!Ev({allowedExtensions:e.config.extensions,files:n})?a({type:"validate",message:`Please upload ${e.config.extensions.join(", ")} files only`}):e.config.fileSizeLimitKib&&c>e.config.fileSizeLimitKib?a({type:"max",message:`File size exceeds limit of ${Wt(e.config.fileSizeLimitKib)}`}):e.config.allowMultiple===!1&&n.length>1?a({type:"invalid",message:"Only one file is allowed"}):t({type:"file",value:n})),children:[d("div",{class:"flex items-center gap-2",children:[d("label",{ref:u,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[n.length>0?d(Y,{children:[d("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,ds).map(l=>{const p=l.name.split(".").pop(),m=l.name.replace(new RegExp(`.${p}$`),"");return d(fs,{class:"flex overflow-hidden",children:[d("span",{class:"block truncate",children:m}),d("span",{children:[".",p]})]})}),s>0?d(fs,{children:["+",s," file",s!==1?"s":""]}):null]}),d("p",{class:"text-neutral-11 text-xs",children:[Wt(c)," ",n.length>1?"total":""]})]}):d("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[d("header",{class:"flex flex-col items-center gap-0",children:[d("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:d("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),d("p",{class:"text-neutral-12 tracking-[-0.01em]",children:[e.config.allowMultiple?"Select files":"Select a file"," to upload"]}),e.config.fileSizeLimitKib?d("p",{class:"text-neutral-10 text-xs",children:["(max ",Wt(e.config.fileSizeLimitKib),")"]}):null]}),d("aside",{class:"flex flex-col items-center gap-2",children:[d("p",{id:"accepted-filetypes",class:"sr-only",children:"Accepted file extensions"}),d("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(l=>d("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:l.replace(".","")}))})]})]}),d("input",{id:"dropzone-file",onInput:async l=>{Se(l.target instanceof HTMLInputElement);const p=l.target.files?Array.from(l.target.files):[],m=await Promise.allSettled(p.map(async v=>{const _=await kv(v);return{name:Tv(v.name,42),data:_,sizeKb:v.size/1e3}}));if(m.some(({status:v})=>v==="rejected"))return a({type:"invalid",message:"Invalid file"});const g=m.map(v=>v.status==="fulfilled"?v.value:null).filter(Boolean);o(g)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),d("div",{class:"flex h-full flex-col items-center gap-2",children:[d(lt,{disabled:n.length===0}),e.config.optional&&d(ut,{onClick:()=>t(null)})]})]}),d(Ot,{error:i})]})};var Qt=e=>e.type==="checkbox",It=e=>e instanceof Date,fe=e=>e==null;const ps=e=>typeof e=="object";var ee=e=>!fe(e)&&!Array.isArray(e)&&ps(e)&&!It(e),Iv=e=>ee(e)&&e.target?Qt(e.target)?e.target.checked:e.target.value:e,Av=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Pv=(e,t)=>e.has(Av(t)),Nv=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},io=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ve(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(io&&(e instanceof Blob||e instanceof FileList))&&(r||ee(e)))if(t=r?[]:{},!r&&!Nv(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Ve(e[n]));else return e;return t}var er=e=>Array.isArray(e)?e.filter(Boolean):[],Z=e=>e===void 0,C=(e,t,r)=>{if(!t||!ee(e))return r;const n=er(t.split(/[,[\].]+?/)).reduce((o,i)=>fe(o)?o:o[i],e);return Z(n)||n===e?Z(e[t])?r:e[t]:n},Ze=e=>typeof e=="boolean";const vs={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ce={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Be={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};$e.createContext(null);var Dv=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Ce.all&&(t._proxyFormState[a]=!n||Ce.all),r&&(r[a]=!0),e[a]}});return o},xe=e=>ee(e)&&!Object.keys(e).length,Mv=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return xe(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||Ce.all))},ao=e=>Array.isArray(e)?e:[e];function Fv(e){const t=$e.useRef(e);t.current=e,$e.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var Ie=e=>typeof e=="string",Lv=(e,t,r,n,o)=>Ie(e)?(n&&t.watch.add(e),C(r,e,o)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),C(r,i))):(n&&(t.watchAll=!0),r),so=e=>/^\w*$/.test(e),ms=e=>er(e.replace(/["|']|\]/g,"").split(/\.|\[/));function U(e,t,r){let n=-1;const o=so(t)?[t]:ms(t),i=o.length,a=i-1;for(;++n<i;){const s=o[n];let c=r;if(n!==a){const u=e[s];c=ee(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}e[s]=c,e=e[s]}return e}var gs=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},bs=e=>({isOnSubmit:!e||e===Ce.onSubmit,isOnBlur:e===Ce.onBlur,isOnChange:e===Ce.onChange,isOnAll:e===Ce.all,isOnTouch:e===Ce.onTouched}),ys=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const jr=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const i=C(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!n)break;if(a.ref&&t(a.ref,a.name)&&!n)break}else ee(s)&&jr(s,t)}}};var Rv=(e,t,r)=>{const n=er(C(e,r));return U(n,"root",t[r]),U(e,r,n),e},co=e=>e.type==="file",Je=e=>typeof e=="function",Vr=e=>{if(!io)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Br=e=>Ie(e),lo=e=>e.type==="radio",zr=e=>e instanceof RegExp;const _s={value:!1,isValid:!1},ws={value:!0,isValid:!0};var xs=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Z(e[0].attributes.value)?Z(e[0].value)||e[0].value===""?ws:{value:e[0].value,isValid:!0}:ws:_s}return _s};const ks={isValid:!1,value:null};var $s=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ks):ks;function Ss(e,t,r="validate"){if(Br(e)||Array.isArray(e)&&e.every(Br)||Ze(e)&&!e)return{type:r,message:Br(e)?e:"",ref:t}}var At=e=>ee(e)&&!zr(e)?e:{value:e,message:""},Cs=async(e,t,r,n,o)=>{const{ref:i,refs:a,required:s,maxLength:c,minLength:u,min:f,max:l,pattern:p,validate:m,name:g,valueAsNumber:v,mount:_,disabled:x}=e._f,w=C(t,g);if(!_||x)return{};const T=a?a[0]:i,I=B=>{n&&T.reportValidity&&(T.setCustomValidity(Ze(B)?"":B||""),T.reportValidity())},O={},H=lo(i),W=Qt(i),M=H||W,F=(v||co(i))&&Z(i.value)&&Z(w)||Vr(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,ae=gs.bind(null,g,r,O),te=(B,R,J,ge=Be.maxLength,ke=Be.minLength)=>{const Ae=B?R:J;O[g]={type:B?ge:ke,message:Ae,ref:i,...ae(B?ge:ke,Ae)}};if(o?!Array.isArray(w)||!w.length:s&&(!M&&(F||fe(w))||Ze(w)&&!w||W&&!xs(a).isValid||H&&!$s(a).isValid)){const{value:B,message:R}=Br(s)?{value:!!s,message:s}:At(s);if(B&&(O[g]={type:Be.required,message:R,ref:T,...ae(Be.required,R)},!r))return I(R),O}if(!F&&(!fe(f)||!fe(l))){let B,R;const J=At(l),ge=At(f);if(!fe(w)&&!isNaN(w)){const ke=i.valueAsNumber||w&&+w;fe(J.value)||(B=ke>J.value),fe(ge.value)||(R=ke<ge.value)}else{const ke=i.valueAsDate||new Date(w),Ae=Yr=>new Date(new Date().toDateString()+" "+Yr),ft=i.type=="time",rr=i.type=="week";Ie(J.value)&&w&&(B=ft?Ae(w)>Ae(J.value):rr?w>J.value:ke>new Date(J.value)),Ie(ge.value)&&w&&(R=ft?Ae(w)<Ae(ge.value):rr?w<ge.value:ke<new Date(ge.value))}if((B||R)&&(te(!!B,J.message,ge.message,Be.max,Be.min),!r))return I(O[g].message),O}if((c||u)&&!F&&(Ie(w)||o&&Array.isArray(w))){const B=At(c),R=At(u),J=!fe(B.value)&&w.length>+B.value,ge=!fe(R.value)&&w.length<+R.value;if((J||ge)&&(te(J,B.message,R.message),!r))return I(O[g].message),O}if(p&&!F&&Ie(w)){const{value:B,message:R}=At(p);if(zr(B)&&!w.match(B)&&(O[g]={type:Be.pattern,message:R,ref:i,...ae(Be.pattern,R)},!r))return I(R),O}if(m){if(Je(m)){const B=await m(w,t),R=Ss(B,T);if(R&&(O[g]={...R,...ae(Be.validate,R.message)},!r))return I(R.message),O}else if(ee(m)){let B={};for(const R in m){if(!xe(B)&&!r)break;const J=Ss(await m[R](w,t),T,R);J&&(B={...J,...ae(R,J.message)},I(J.message),r&&(O[g]=B))}if(!xe(B)&&(O[g]={ref:T,...B},!r))return O}}return I(!0),O};function jv(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Z(e)?n++:e[t[n++]];return e}function Vv(e){for(const t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function ie(e,t){const r=Array.isArray(t)?t:so(t)?[t]:ms(t),n=r.length===1?e:jv(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(ee(n)&&xe(n)||Array.isArray(n)&&Vv(n))&&ie(e,r.slice(0,-1)),e}function uo(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Ur=e=>fe(e)||!ps(e);function dt(e,t){if(Ur(e)||Ur(t))return e===t;if(It(e)&&It(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const i=e[o];if(!n.includes(o))return!1;if(o!=="ref"){const a=t[o];if(It(i)&&It(a)||ee(i)&&ee(a)||Array.isArray(i)&&Array.isArray(a)?!dt(i,a):i!==a)return!1}}return!0}var Es=e=>e.type==="select-multiple",Bv=e=>lo(e)||Qt(e),fo=e=>Vr(e)&&e.isConnected,Ts=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function Hr(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!Ts(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Hr(e[n],t[n])):fe(e[n])||(t[n]=!0);return t}function Os(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const o in e)Array.isArray(e[o])||ee(e[o])&&!Ts(e[o])?Z(t)||Ur(r[o])?r[o]=Array.isArray(e[o])?Hr(e[o],[]):{...Hr(e[o])}:Os(e[o],fe(t)?{}:t[o],r[o]):r[o]=!dt(e[o],t[o]);return r}var ho=(e,t)=>Os(e,t,Hr(t)),Is=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Z(e)?e:t?e===""?NaN:e&&+e:r&&Ie(e)?new Date(e):n?n(e):e;function po(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return co(t)?t.files:lo(t)?$s(e.refs).value:Es(t)?[...t.selectedOptions].map(({value:r})=>r):Qt(t)?xs(e.refs).value:Is(Z(t.value)?e.ref.value:t.value,e)}var zv=(e,t,r,n)=>{const o={};for(const i of e){const a=C(t,i);a&&U(o,i,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},tr=e=>Z(e)?e:zr(e)?e.source:ee(e)?zr(e.value)?e.value.source:e.value:e,Uv=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function As(e,t,r){const n=C(e,r);if(n||so(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const i=o.join("."),a=C(t,i),s=C(e,i);if(a&&!Array.isArray(a)&&r!==i)return{name:r};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:r}}var Hv=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,qv=(e,t)=>!er(C(e,t)).length&&ie(e,t);const Wv={mode:Ce.onSubmit,reValidateMode:Ce.onChange,shouldFocusError:!0};function Kv(e={},t){let r={...Wv,...e},n={submitCount:0,isDirty:!1,isLoading:Je(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=ee(r.defaultValues)||ee(r.values)?Ve(r.defaultValues||r.values)||{}:{},a=r.shouldUnregister?{}:Ve(i),s={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,f=0;const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:uo(),array:uo(),state:uo()},m=e.resetOptions&&e.resetOptions.keepDirtyValues,g=bs(r.mode),v=bs(r.reValidateMode),_=r.criteriaMode===Ce.all,x=h=>b=>{clearTimeout(f),f=setTimeout(h,b)},w=async h=>{if(l.isValid||h){const b=r.resolver?xe((await F()).errors):await te(o,!0);b!==n.isValid&&p.state.next({isValid:b})}},T=h=>l.isValidating&&p.state.next({isValidating:h}),I=(h,b=[],y,E,$=!0,k=!0)=>{if(E&&y){if(s.action=!0,k&&Array.isArray(C(o,h))){const A=y(C(o,h),E.argA,E.argB);$&&U(o,h,A)}if(k&&Array.isArray(C(n.errors,h))){const A=y(C(n.errors,h),E.argA,E.argB);$&&U(n.errors,h,A),qv(n.errors,h)}if(l.touchedFields&&k&&Array.isArray(C(n.touchedFields,h))){const A=y(C(n.touchedFields,h),E.argA,E.argB);$&&U(n.touchedFields,h,A)}l.dirtyFields&&(n.dirtyFields=ho(i,a)),p.state.next({name:h,isDirty:R(h,b),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else U(a,h,b)},O=(h,b)=>{U(n.errors,h,b),p.state.next({errors:n.errors})},H=(h,b,y,E)=>{const $=C(o,h);if($){const k=C(a,h,Z(y)?C(i,h):y);Z(k)||E&&E.defaultChecked||b?U(a,h,b?k:po($._f)):ke(h,k),s.mount&&w()}},W=(h,b,y,E,$)=>{let k=!1,A=!1;const q={name:h};if(!y||E){l.isDirty&&(A=n.isDirty,n.isDirty=q.isDirty=R(),k=A!==q.isDirty);const Q=dt(C(i,h),b);A=C(n.dirtyFields,h),Q?ie(n.dirtyFields,h):U(n.dirtyFields,h,!0),q.dirtyFields=n.dirtyFields,k=k||l.dirtyFields&&A!==!Q}if(y){const Q=C(n.touchedFields,h);Q||(U(n.touchedFields,h,y),q.touchedFields=n.touchedFields,k=k||l.touchedFields&&Q!==y)}return k&&$&&p.state.next(q),k?q:{}},M=(h,b,y,E)=>{const $=C(n.errors,h),k=l.isValid&&Ze(b)&&n.isValid!==b;if(e.delayError&&y?(u=x(()=>O(h,y)),u(e.delayError)):(clearTimeout(f),u=null,y?U(n.errors,h,y):ie(n.errors,h)),(y?!dt($,y):$)||!xe(E)||k){const A={...E,...k&&Ze(b)?{isValid:b}:{},errors:n.errors,name:h};n={...n,...A},p.state.next(A)}T(!1)},F=async h=>r.resolver(a,r.context,zv(h||c.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),ae=async h=>{const{errors:b}=await F(h);if(h)for(const y of h){const E=C(b,y);E?U(n.errors,y,E):ie(n.errors,y)}else n.errors=b;return b},te=async(h,b,y={valid:!0})=>{for(const E in h){const $=h[E];if($){const{_f:k,...A}=$;if(k){const q=c.array.has(k.name),Q=await Cs($,a,_,r.shouldUseNativeValidation&&!b,q);if(Q[k.name]&&(y.valid=!1,b))break;!b&&(C(Q,k.name)?q?Rv(n.errors,Q,k.name):U(n.errors,k.name,Q[k.name]):ie(n.errors,k.name))}A&&await te(A,b,y)}}return y.valid},B=()=>{for(const h of c.unMount){const b=C(o,h);b&&(b._f.refs?b._f.refs.every(y=>!fo(y)):!fo(b._f.ref))&&bo(h)}c.unMount=new Set},R=(h,b)=>(h&&b&&U(a,h,b),!dt(Bs(),i)),J=(h,b,y)=>Lv(h,c,{...s.mount?a:Z(b)?i:Ie(h)?{[h]:b}:b},y,b),ge=h=>er(C(s.mount?a:i,h,e.shouldUnregister?C(i,h,[]):[])),ke=(h,b,y={})=>{const E=C(o,h);let $=b;if(E){const k=E._f;k&&(!k.disabled&&U(a,h,Is(b,k)),$=Vr(k.ref)&&fe(b)?"":b,Es(k.ref)?[...k.ref.options].forEach(A=>A.selected=$.includes(A.value)):k.refs?Qt(k.ref)?k.refs.length>1?k.refs.forEach(A=>(!A.defaultChecked||!A.disabled)&&(A.checked=Array.isArray($)?!!$.find(q=>q===A.value):$===A.value)):k.refs[0]&&(k.refs[0].checked=!!$):k.refs.forEach(A=>A.checked=A.value===$):co(k.ref)?k.ref.value="":(k.ref.value=$,k.ref.type||p.values.next({name:h,values:{...a}})))}(y.shouldDirty||y.shouldTouch)&&W(h,$,y.shouldTouch,y.shouldDirty,!0),y.shouldValidate&&go(h)},Ae=(h,b,y)=>{for(const E in b){const $=b[E],k=`${h}.${E}`,A=C(o,k);(c.array.has(h)||!Ur($)||A&&!A._f)&&!It($)?Ae(k,$,y):ke(k,$,y)}},ft=(h,b,y={})=>{const E=C(o,h),$=c.array.has(h),k=Ve(b);U(a,h,k),$?(p.array.next({name:h,values:{...a}}),(l.isDirty||l.dirtyFields)&&y.shouldDirty&&p.state.next({name:h,dirtyFields:ho(i,a),isDirty:R(h,k)})):E&&!E._f&&!fe(k)?Ae(h,k,y):ke(h,k,y),ys(h,c)&&p.state.next({...n}),p.values.next({name:h,values:{...a}}),!s.mount&&t()},rr=async h=>{const b=h.target;let y=b.name,E=!0;const $=C(o,y),k=()=>b.type?po($._f):Iv(h),A=q=>{E=Number.isNaN(q)||q===C(a,y,q)};if($){let q,Q;const Xr=k(),Pt=h.type===vs.BLUR||h.type===vs.FOCUS_OUT,Hm=!Uv($._f)&&!r.resolver&&!C(n.errors,y)&&!$._f.deps||Hv(Pt,C(n.touchedFields,y),n.isSubmitted,v,g),_o=ys(y,c,Pt);U(a,y,Xr),Pt?($._f.onBlur&&$._f.onBlur(h),u&&u(0)):$._f.onChange&&$._f.onChange(h);const wo=W(y,Xr,Pt,!1),qm=!xe(wo)||_o;if(!Pt&&p.values.next({name:y,type:h.type,values:{...a}}),Hm)return l.isValid&&w(),qm&&p.state.next({name:y,..._o?{}:wo});if(!Pt&&_o&&p.state.next({...n}),T(!0),r.resolver){const{errors:Ys}=await F([y]);if(A(Xr),E){const Wm=As(n.errors,o,y),Xs=As(Ys,o,Wm.name||y);q=Xs.error,y=Xs.name,Q=xe(Ys)}}else q=(await Cs($,a,_,r.shouldUseNativeValidation))[y],A(Xr),E&&(q?Q=!1:l.isValid&&(Q=await te(o,!0)));E&&($._f.deps&&go($._f.deps),M(y,Q,q,wo))}},Yr=(h,b)=>{if(C(n.errors,b)&&h.focus)return h.focus(),1},go=async(h,b={})=>{let y,E;const $=ao(h);if(T(!0),r.resolver){const k=await ae(Z(h)?h:$);y=xe(k),E=h?!$.some(A=>C(k,A)):y}else h?(E=(await Promise.all($.map(async k=>{const A=C(o,k);return await te(A&&A._f?{[k]:A}:A)}))).every(Boolean),!(!E&&!n.isValid)&&w()):E=y=await te(o);return p.state.next({...!Ie(h)||l.isValid&&y!==n.isValid?{}:{name:h},...r.resolver||!h?{isValid:y}:{},errors:n.errors,isValidating:!1}),b.shouldFocus&&!E&&jr(o,Yr,h?$:c.mount),E},Bs=h=>{const b={...i,...s.mount?a:{}};return Z(h)?b:Ie(h)?C(b,h):h.map(y=>C(b,y))},zs=(h,b)=>({invalid:!!C((b||n).errors,h),isDirty:!!C((b||n).dirtyFields,h),isTouched:!!C((b||n).touchedFields,h),error:C((b||n).errors,h)}),Vm=h=>{h&&ao(h).forEach(b=>ie(n.errors,b)),p.state.next({errors:h?n.errors:{}})},Us=(h,b,y)=>{const E=(C(o,h,{_f:{}})._f||{}).ref;U(n.errors,h,{...b,ref:E}),p.state.next({name:h,errors:n.errors,isValid:!1}),y&&y.shouldFocus&&E&&E.focus&&E.focus()},Bm=(h,b)=>Je(h)?p.values.subscribe({next:y=>h(J(void 0,b),y)}):J(h,b,!0),bo=(h,b={})=>{for(const y of h?ao(h):c.mount)c.mount.delete(y),c.array.delete(y),b.keepValue||(ie(o,y),ie(a,y)),!b.keepError&&ie(n.errors,y),!b.keepDirty&&ie(n.dirtyFields,y),!b.keepTouched&&ie(n.touchedFields,y),!r.shouldUnregister&&!b.keepDefaultValue&&ie(i,y);p.values.next({values:{...a}}),p.state.next({...n,...b.keepDirty?{isDirty:R()}:{}}),!b.keepIsValid&&w()},Hs=({disabled:h,name:b,field:y,fields:E,value:$})=>{if(Ze(h)){const k=h?void 0:Z($)?po(y?y._f:C(E,b)._f):$;U(a,b,k),W(b,k,!1,!1,!0)}},yo=(h,b={})=>{let y=C(o,h);const E=Ze(b.disabled);return U(o,h,{...y||{},_f:{...y&&y._f?y._f:{ref:{name:h}},name:h,mount:!0,...b}}),c.mount.add(h),y?Hs({field:y,disabled:b.disabled,name:h}):H(h,!0,b.value),{...E?{disabled:b.disabled}:{},...r.progressive?{required:!!b.required,min:tr(b.min),max:tr(b.max),minLength:tr(b.minLength),maxLength:tr(b.maxLength),pattern:tr(b.pattern)}:{},name:h,onChange:rr,onBlur:rr,ref:$=>{if($){yo(h,b),y=C(o,h);const k=Z($.value)&&$.querySelectorAll&&$.querySelectorAll("input,select,textarea")[0]||$,A=Bv(k),q=y._f.refs||[];if(A?q.find(Q=>Q===k):k===y._f.ref)return;U(o,h,{_f:{...y._f,...A?{refs:[...q.filter(fo),k,...Array.isArray(C(i,h))?[{}]:[]],ref:{type:k.type,name:h}}:{ref:k}}}),H(h,!1,void 0,k)}else y=C(o,h,{}),y._f&&(y._f.mount=!1),(r.shouldUnregister||b.shouldUnregister)&&!(Pv(c.array,h)&&s.action)&&c.unMount.add(h)}}},qs=()=>r.shouldFocusError&&jr(o,Yr,c.mount),zm=h=>{Ze(h)&&(p.state.next({disabled:h}),jr(o,b=>{b.disabled=h},0,!1))},Ws=(h,b)=>async y=>{y&&(y.preventDefault&&y.preventDefault(),y.persist&&y.persist());let E=Ve(a);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:$,values:k}=await F();n.errors=$,E=k}else await te(o);ie(n.errors,"root"),xe(n.errors)?(p.state.next({errors:{}}),await h(E,y)):(b&&await b({...n.errors},y),qs(),setTimeout(qs)),p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:xe(n.errors),submitCount:n.submitCount+1,errors:n.errors})},Um=(h,b={})=>{C(o,h)&&(Z(b.defaultValue)?ft(h,C(i,h)):(ft(h,b.defaultValue),U(i,h,b.defaultValue)),b.keepTouched||ie(n.touchedFields,h),b.keepDirty||(ie(n.dirtyFields,h),n.isDirty=b.defaultValue?R(h,C(i,h)):R()),b.keepError||(ie(n.errors,h),l.isValid&&w()),p.state.next({...n}))},Ks=(h,b={})=>{const y=h?Ve(h):i,E=Ve(y),$=h&&!xe(h)?E:i;if(b.keepDefaultValues||(i=y),!b.keepValues){if(b.keepDirtyValues||m)for(const k of c.mount)C(n.dirtyFields,k)?U($,k,C(a,k)):ft(k,C($,k));else{if(io&&Z(h))for(const k of c.mount){const A=C(o,k);if(A&&A._f){const q=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(Vr(q)){const Q=q.closest("form");if(Q){Q.reset();break}}}}o={}}a=e.shouldUnregister?b.keepDefaultValues?Ve(i):{}:Ve($),p.array.next({values:{...$}}),p.values.next({values:{...$}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!l.isValid||!!b.keepIsValid,s.watch=!!e.shouldUnregister,p.state.next({submitCount:b.keepSubmitCount?n.submitCount:0,isDirty:b.keepDirty?n.isDirty:!!(b.keepDefaultValues&&!dt(h,i)),isSubmitted:b.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:b.keepDirtyValues?n.dirtyFields:b.keepDefaultValues&&h?ho(i,h):{},touchedFields:b.keepTouched?n.touchedFields:{},errors:b.keepErrors?n.errors:{},isSubmitSuccessful:b.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Gs=(h,b)=>Ks(Je(h)?h(a):h,b);return{control:{register:yo,unregister:bo,getFieldState:zs,handleSubmit:Ws,setError:Us,_executeSchema:F,_getWatch:J,_getDirty:R,_updateValid:w,_removeUnmounted:B,_updateFieldArray:I,_updateDisabledField:Hs,_getFieldArray:ge,_reset:Ks,_resetDefaultValues:()=>Je(r.defaultValues)&&r.defaultValues().then(h=>{Gs(h,r.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:h=>{n={...n,...h}},_disableForm:zm,_subjects:p,_proxyFormState:l,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(h){s=h},get _defaultValues(){return i},get _names(){return c},set _names(h){c=h},get _formState(){return n},set _formState(h){n=h},get _options(){return r},set _options(h){r={...r,...h}}},trigger:go,register:yo,handleSubmit:Ws,watch:Bm,setValue:ft,getValues:Bs,reset:Gs,resetField:Um,clearErrors:Vm,unregister:bo,setError:Us,setFocus:(h,b={})=>{const y=C(o,h),E=y&&y._f;if(E){const $=E.refs?E.refs[0]:E.ref;$.focus&&($.focus(),b.shouldSelect&&$.select())}},getFieldState:zs}}function qr(e={}){const t=$e.useRef(),r=$e.useRef(),[n,o]=$e.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Kv(e,()=>o(a=>({...a}))),formState:n});const i=t.current.control;return i._options=e,Fv({subject:i._subjects.state,next:a=>{Mv(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),$e.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),$e.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),$e.useEffect(()=>{e.values&&!dt(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values):i._resetDefaultValues()},[e.values,i]),$e.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Dv(n,i),t.current}var Ps=function(e,t,r){if(e&&"reportValidity"in e){var n=C(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Gv=function(e,t){var r=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?Ps(i.ref,o,e):i.refs&&i.refs.forEach(function(a){return Ps(a,o,e)})};for(var n in t.fields)r(n)},Yv=function(e,t){t.shouldUseNativeValidation&&Gv(e,t);var r={};for(var n in e){var o=C(t.fields,n),i=Object.assign(e[n]||{},{ref:o&&o.ref});if(Zv(t.names||Object.keys(e),n)){var a=Object.assign({},Xv(C(r,n)));U(a,"root",i),U(r,n,a)}else U(r,n,i)}return r},Xv=function(e){return Array.isArray(e)?e.filter(Boolean):[]},Zv=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},Jv=function(e,t){for(var r={};e.issues.length;){var n=e.issues[0];if(n.path){var o=n.path.map(function(s){return s.key}).join(".");if(r[o]||(r[o]={message:n.message,type:n.validation}),t){var i=r[o].types,a=i&&i[n.validation];r[o]=gs(o,t,r,n.validation,a?[].concat(a,n.message):n.message)}e.issues.shift()}}return r},Wr=function(e,t,r){return r===void 0&&(r={}),function(n,o,i){try{return Promise.resolve(function(a,s){try{var c=function(){function u(l){return{values:r.raw?n:l,errors:{}}}var f=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return r.mode==="sync"?u(dr(e,n,f)):Promise.resolve(Vd(e,n,f)).then(u)}()}catch(u){return s(u)}return c&&c.then?c.then(void 0,s):c}(0,function(a){if(a instanceof ur)return{values:{},errors:Yv(Jv(a,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};const Ns=27,Ds=12,Ms=10,Qv=Kt("enum"),em=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Wr(de({checked:li(ci(ai()),r=>Object.entries(r).filter(([n,o])=>o).map(([n,o])=>n),[fr(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),hr(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},tm=re(({option:e,...t},r)=>d(Y,{children:[d("input",{class:"peer sr-only h-full",type:"checkbox",...t,ref:r}),d("label",{class:"bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",htmlFor:t.id,children:e.label})]})),Fs=Tr("gutter-stable flex w-full flex-1 flex-wrap gap-3 overflow-y-auto rounded-xl p-2.5 pr-4",{variants:{variant:{singleOption:"justify-center",booleanLike:ls}}}),rm=({input:e,onSubmitSuccess:t})=>{var u,f;const r=e.key?(u=P.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,n=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,o=n&&e.config.options.length===2,{register:i,handleSubmit:a,formState:{errors:s}}=qr({defaultValues:{checked:n?{}:Qv(r)?Object.fromEntries(r.value.map(l=>[l,!0])):{}},resolver:em(e.config)}),c=oo();return o?d("ul",{style:{maxHeight:6.5*Ns+5*Ds+2*Ms},class:Fs({variant:"booleanLike"}),children:e.config.options.map((l,p)=>d("li",{class:"flex-1",children:d(us,{type:"submit",ref:m=>{m&&p===0&&(c.current=m)},label:l.label,value:"true",onClick:()=>t({type:"enum",value:[l.value]})})},l.value))}):d("form",{noValidate:!0,onSubmit:l=>a(p=>{const m=p.checked;t({type:"enum",value:m})})(l),children:[d("div",{class:"flex items-center gap-1",children:[d("ul",{style:{maxHeight:6.5*Ns+5*Ds+2*Ms},class:Fs({variant:e.config.options.length===1?"singleOption":void 0}),children:e.config.options.map((l,p)=>{const m=`checked.${l.value}`,{ref:g,...v}=i(m);return d("li",{class:"relative",children:d(tm,{option:l,autoFocus:p===0,ref:_=>{_&&p===0&&(c.current=_),g(_)},id:m,...v,onClick:n?()=>t({type:"enum",value:[l.value]}):void 0})},l.value)})}),d("div",{class:"flex flex-col items-center gap-2 pr-2.5 pt-2.5",children:[n?null:d(lt,{}),e.config.minSelected===0&&d(ut,{type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),d("div",{class:"px-1",children:d(Ot,{error:(f=s.checked)==null?void 0:f.root})})]})},nm=Kt("number"),Kr={number:()=>"Please enter a valid number",min:e=>`Please enter a number greater than or equal to ${e}`,max:e=>`Please enter a number less than or equal to ${e}`,decimalCases:e=>`Please enter a number with at most ${e} decimal cases`},om=e=>{const t=e.min??Number.MIN_SAFE_INTEGER,r=e.max??Number.MAX_SAFE_INTEGER,n=e.decimalCases??0;return Wr(de({number:cn(Kr.number(),[Kd(t,Kr.min(t)),Wd(r,Kr.max(r)),Hd(o=>o===Number(o.toFixed(n)),Kr.decimalCases(n))])}))},im=({input:e,onSubmitSuccess:t})=>{var f;const r=e.config.defaultValue,n=e.key?(f=P.current$.value.flow)==null?void 0:f.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:a}}=qr({defaultValues:{number:r?Number(r):nm(n)?n.value:void 0},resolver:om(e.config)}),{ref:s,...c}=o("number",{required:!e.config.optional,valueAsNumber:!0}),u=L();return pe(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:i(l=>{l.number!==void 0&&t({type:"number",value:l.number})}),children:[d("div",{class:"flex items-center gap-2",children:[d("div",{class:"relative min-w-0 flex-grow",children:[d("input",{...c,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:l=>{l&&(u.current=l),s(l)},type:"text",min:e.config.min,max:e.config.max,class:"outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest [type=number:-webkit-inner-spin-button] w-full rounded-full px-3 py-1 text-base outline outline-2 transition-all [-webkit-outer-spin-button:none]",placeholder:e.config.placeholder}),e.config.optional&&d(ut,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(lt,{})]}),d(Ot,{error:a.number})]})},Ls=e=>{if(e==="")return{countryCode:"",phoneNumber:""};const t=Object.entries(ro).find(o=>e.startsWith(o[1])),r=t?t[1]:"",n=e.replace(r,"");return/^\d+$/.test(n)?{countryCode:r,phoneNumber:n}:{countryCode:"",phoneNumber:""}},am="44",vo="That doesn’t look like a valid phone number",Rs=e=>({min:`The phone number needs to be at least ${e.minChars} digits long.`,max:`The phone number can't be longer than ${e.maxChars} digits.`}),sm=Kt("string"),cm=se(vo,[ui(/^\+?[0-9 -]+$/,vo)]),lm=se("Please select a country code",[ui(/^\+?[0-9 -]+$/,vo)]),um=()=>Wr(de({countryCode:lm,phoneNumber:li(cm,e=>e.replace(/[^0-9]/g,""),[])})),dm=({input:e,onSubmitSuccess:t})=>{var m;const r=e.key?(m=P.current$.value.flow)==null?void 0:m.data.submissions[e.key]:void 0,[n,o]=K(),{register:i,handleSubmit:a,formState:{errors:s},watch:c}=qr({defaultValues:e.config.defaultValue?Ls(e.config.defaultValue):sm(r)?Ls(r.value):{countryCode:am,phoneNumber:""},resolver:um()}),{ref:u,...f}=i("phoneNumber",{required:!e.config.optional}),l=L(),p=c("countryCode");return pe(()=>{l.current&&(l.current.focus(),l.current.select())},[]),d("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:a(g=>{const v=g.phoneNumber.replace(/[^0-9]/g,""),_=g.countryCode.replace(/[^0-9]/g,"");if(o(void 0),v.length+_.length>(e.config.maxChars||1/0))return o(Rs(e.config).max);if(v.length+_.length<(e.config.minChars||0))return o(Rs(e.config).min);t({type:"string",value:p+g.phoneNumber})}),children:[d("div",{class:"flex items-center gap-2",children:[d("div",{class:"relative flex min-w-0 flex-1 flex-grow gap-2",children:[d("label",{class:"text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",htmlFor:`isdk_phone_${e.key}`,children:[d("span",{children:["+",p]}),d("select",{...i("countryCode",{}),id:`isdk_phone_${e.key}`,class:"absolute inset-0 opacity-0",children:Object.entries(ro).map(([g,v])=>d("option",{value:v,children:[g," (+",v,")"]},g))})]}),d("input",{...f,id:"chat-input",type:"tel",inputMode:"tel",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:g=>{g&&(l.current=g),u(g)},class:"outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest flex-1 rounded-r-full px-3 py-1 text-base outline outline-2 transition-all",placeholder:e.config.placeholder}),e.config.optional&&d(ut,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(lt,{})]}),d(Ot,{error:s.countryCode||s.phoneNumber||{message:n}})]})},fm=({input:e,onSubmitSuccess:t})=>d("div",{class:"flex flex-col items-center py-3",children:d("button",{class:"bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2",name:e.key,onClick:()=>{t(null)},children:d("span",{class:"flex items-center gap-1.5",children:[d("span",{class:"inline-flex items-center text-sm font-medium",children:e.config.label||"Submit"}),d("svg",{stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d("path",{d:"M4 8L8 4L12 8"}),d("path",{d:"M8 4V13"})]})]})})}),mo={empty:"Please enter some text",email:"That doesn’t look like a valid email address",phone:"That doesn’t look like a valid phone number",url:"That doesn’t look like a valid URL"},hm={email:{type:"email",inputMode:"email",formNoValidate:!0},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},pm=Kt("string"),vm=e=>{const t={maxLength:`Please enter no more than ${e.maxChars??999} characters`,minLength:`Please enter ${e.minChars??1} or more characters`};return Wr(de({text:{email:se(mo.email,[qd(mo.email),hr(e.minChars??1,t.minLength),fr(e.maxChars??1/0,t.maxLength)]),text:se([hr(e.minChars??1,t.minLength),fr(e.maxChars??1/0,t.maxLength)]),url:se([Gd(mo.url),hr(e.minChars??1,t.minLength),fr(e.maxChars??1/0,t.maxLength)])}[e.format]}))},mm={text:({input:e,onSubmitSuccess:t})=>{var f;const r=e.key?(f=P.current$.value.flow)==null?void 0:f.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:o,handleSubmit:i,formState:{errors:a}}=qr({defaultValues:{text:n||(pm(r)?r.value:"")},resolver:vm(e.config)}),{ref:s,...c}=o("text",{required:!e.config.optional}),u=L();return pe(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:i(l=>{t({type:"string",value:l.text})}),children:[d("div",{class:"flex items-center gap-2",children:[d("div",{class:"relative min-w-0 flex-1",children:[d("input",{id:"chat-input",...c,...hm[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:l=>{l&&(u.current=l),s(l)},class:"outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest w-full rounded-full px-3 py-1 text-base outline outline-2 transition-all",placeholder:e.config.placeholder}),e.config.optional&&d(ut,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(lt,{})]}),d(Ot,{error:a.text})]})},phone:dm,"multiple-choice":rm,boolean:xv,file:Ov,submit:fm,address:gv,number:im},gm=({logger:e})=>{var i;const t=(i=P.current$.value.flow)==null?void 0:i.data.currentInput,[r,n]=iv(),o=L(null);return P.inputHeight$.value=n.height,V(()=>{const a=o.current;if(a)return a.addEventListener("transitionstart",le.scrollToEnd.smooth),a.addEventListener("transitioncancel",le.scrollToEnd.smooth),a.addEventListener("transitionend",le.scrollToEnd.smooth),()=>{a.removeEventListener("transitionstart",le.scrollToEnd.smooth),a.removeEventListener("transitioncancel",le.scrollToEnd.smooth),a.removeEventListener("transitionend",le.scrollToEnd.smooth)}},[]),d("div",{ref:o,class:"ease-expo-out absolute bottom-0 w-full overflow-hidden rounded-b-3xl backdrop-blur-xl transition-all duration-700 will-change-[height]",style:{height:n.height},children:d("div",{ref:r,class:"border-divider flex flex-col justify-end border-t",children:t?(()=>{const a=mm[t.type];return d(a,{logger:e,onSubmitSuccess:le.onSubmitSuccessFn$.value,input:t})})():d("div",{class:"flex items-center gap-2 p-2.5",children:[d("input",{"aria-hidden":"true",id:"chat-input",class:"outline-divider flex-grow rounded-full bg-transparent px-3 py-1 text-base outline outline-2",disabled:!0}),d(lt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})})})};var bm=function(e){return e instanceof RegExp},ym=function(t){var r=/[\\^$.*+?()[\]{}|]/g,n=RegExp(r.source);return t&&n.test(t)?t.replace(r,"\\$&"):t},js=function(e){return typeof e=="string"},_m=function(e){var t=[];return e.forEach(function(r){Array.isArray(r)?t=t.concat(r):t.push(r)}),t};function wm(e,t,r){var n=0,o=0;if(e==="")return e;if(!e||!js(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var i=t;bm(i)||(i=new RegExp("("+ym(i)+")","gi"));for(var a=e.split(i),s=1,c=a.length;s<c;s+=2){if(a[s]===void 0||a[s-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}o=a[s].length,n+=a[s-1].length,a[s]=r(a[s],s,n),n+=o}return a}var xm=function(t,r,n){return Array.isArray(t)||(t=[t]),_m(t.map(function(o){return js(o)?wm(o,r,n):o}))};const Gr=Pe(xm),km=/(\[[^\]]+\]\([^)]+\))/g,$m=/\[([^\]]+)\]\(([^)]+)\)/,Sm=/(https?:\/\/[^\s]+)/g,Cm=/_(.*?)_/g,Em=/\*\*(.*?)\*\*/g,Vs="text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline",Tm=e=>{const t=Gr(e,km,(i,a)=>{const[,s,c]=i.match($m)??[];return c?d("a",{class:Vs,href:c,children:s??c},c+a):d("span",{children:"INVALID LINK"})}),r=Gr(t,Sm,(i,a)=>d("a",{class:Vs,href:i,children:i},i+a)),n=Gr(r,Cm,(i,a)=>d("em",{children:i},i+a));return Gr(n,Em,(i,a)=>d("strong",{children:i},i+a))},Om=Tr("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative",{variants:{side:{left:"bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",right:"ml-auto bg-accent-9 text-white rounded-br-md shadow-surface-sm shadow-bubble-strong-shadow"},animate:{true:"animate-bubble-in",false:""}},defaultVariants:{side:"left"}}),Im=({children:e,className:t,animate:r,side:n,...o})=>d("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Om({className:t,side:n,animate:r}),...o,children:e}),Am=({message:e})=>d("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:d("a",{onClick:e.onClick,class:"bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:e.href,children:[e.text,d("svg",{class:"flex-none",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})}),Pm=({className:e,...t})=>(V(()=>{le.scrollToEnd.smooth()}),d("div",{"aria-hidden":!0,children:le.isBotTyping$.value===!0?d("div",{"aria-label":"Typing…",class:ot("flex gap-1 p-4",e),...t,children:Array.from({length:3},(r,n)=>d("div",{class:"bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-n*200}ms`}}))}):void 0})),Nm={bot:"left",user:"right"},Dm=Tr("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),Mm=({lastSentMessageFooter:e})=>{var r;const t=((r=P.current$.value.flow)==null?void 0:r.data.messages)??[];return V(()=>{le.scrollToEnd.smooth()},[t.length]),d("ol",{"aria-label":"Chat messages",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[t.map((n,o)=>d(Y,{children:d("li",{class:"flex",children:st(n).with({type:"system"},i=>d("p",{class:Dm({variant:i.variant}),children:i.text})).with({type:"text",author:N.union("bot","user")},i=>{const a=i.author==="user"&&!t.slice(o+1).some(u=>u.type==="text"&&u.author==="user"),s=o===t.length-1,c=i.author==="bot"?Tm(i.text):i.text;return d(Im,{animate:s,side:Nm[i.author],children:[c,a?e:null]},o)}).with({type:"link"},i=>d(Am,{message:i})).with({type:"image"},i=>d("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:i.url,style:{aspectRatio:i.width/i.height}})).with({type:"file"},i=>d(Cv,{class:i.author==="bot"?void 0:"ml-auto",file:{name:i.fileName,sizeKb:i.fileSizeKb}})).with({type:"loading"},i=>{const a=t[t.length-1];return!(i===a)||le.isBotTyping$.value?null:d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Ga,{class:"text-neutral-6 h-8 w-8"})})}).exhaustive()})},o)),d(Pm,{},"typing")]})},Fm=({logger:e,apiClient:t,analytics:r})=>{const{flow:n}=P.current$.value;Se(n,"Flow is required to exist to show chatbot body");const o=P.viewState$.value,{chatRef:i,chatService:a}=dv(),[s,c]=K();return pe(()=>{o==="maximised"&&le.scrollToEnd.instant()},[o]),pe(()=>{var v,_;const{state:u,flow:f}=P.current$.peek();if(u!=="loaded")throw new Error(Ep.invalid_state);let l=f.data.nodeHistory.at(-1);if(le.scrollToEnd.instant(),P.setInput(void 0),f.data.isFinished)return;l===void 0?(l=Ua(n.nodes).id,P.setCurrentNodeId(l),r.log({event:"FLOW_START",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:f.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(v=n.analytics)==null?void 0:v.customProperties})):P.removeMessagesSentByNodeIds([l]);const{interpret:p,abort:m,undo:g}=Bp({context:n.context,analytics:{service:r,customProperties:(_=n.analytics)==null?void 0:_.customProperties},apiClient:t,logger:e,flow:n,chatService:a,getSubmissions:()=>{var x;return(x=P.current$.peek().flow)==null?void 0:x.data.submissions},onInterpret:(x,w)=>{var I;const T=P.current$.peek().flow;Se(T),w&&(T.data.sequence=T.data.sequence+1,r.log({event:"FLOW_NODE",properties:{flow_id:n.id,flow_version:n.version,from_node_id:w.id,flow_build:n.build,to_node_id:x.id,sequence:T.data.sequence,flow_session_id:T.data.flowSessionId,job:n.job},customProperties:(I=n.analytics)==null?void 0:I.customProperties})),P.setCurrentNodeId(x.id)},onFlowEnd:async()=>{var w;P.markAsFinished();const x=P.current$.peek().flow;Se(x),r.log({event:"FLOW_END",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:x.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(w=n.analytics)==null?void 0:w.customProperties})}});return c(()=>g),p(l),m},[r,t,a,e,n]),d(Y,{children:[d("div",{ref:i,className:"hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",style:{WebkitOverflowScrolling:"touch",paddingBottom:P.inputHeight$.value},children:d(Mm,{lastSentMessageFooter:n.data.isFinished||!s?null:d(Rm,{undoFn:s})})}),d(gm,{logger:e})]})},Lm=e=>"key"in e.data&&e.data.key?[e.data.key]:"keys"in e.data?Object.values(e.data.keys).filter(t=>typeof t=="string"):[],Rm=({undoFn:e})=>d("div",{class:"absolute bottom-0 right-0 flex w-full translate-y-full justify-end",children:d("button",{class:"fr touch-hitbox text-neutral-9 hover:text-neutral-12 rounded-full p-1 text-right text-xs transition-all",onClick:async()=>{const{flow:t}=P.current$.peek();Se(t);const{removed:r}=e(t.data.nodeHistory),n=t.data.nodeHistory.splice(-r);n.length!==0&&(P.removeMessagesSentByNodeIds(n),P.setInput(void 0),n.pop(),n.map(o=>t.nodes.find(i=>i.id===o)).filter(Boolean).flatMap(Lm).forEach(o=>delete t.data.submissions[o]),P.current$.value={...P.current$.value})},children:"Undo"})}),jm=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:Fm},Symbol.toStringTag,{value:"Module"}))})();
5
+ }`},$a=({context:e,schema:t,logger:r})=>{if(t)for(const n in t){const i=t[n];if(!i)continue;const a=yt(e,n,null);if(i.required&&a===null){const o=`Configuration error in context: ${n} is required`;throw r.error(o),new Error(o)}switch(i.type){case"number":if(typeof a!="number")throw new Error(`Configuration error in context: ${n} is not a number`);break;case"string":if(typeof a!="string")throw new Error(`Configuration error in context: ${n} is not a string`);break;default:i.type}}},lf=({_internal_domManager:e=Zd(),theme:t,terms:r})=>We(({apiClient:n,logger:i,analytics:a})=>{let o=!1;const s=bd({locale:void 0,overrides:r??{}}),l=()=>{if(typeof window>"u")return;const u=[ce("style",{id:"inploi-chatbot-styles"},Jd),ce("style",{id:"inploi-chatbot-theme"},sf(t))],h=e.getOrCreateChatbotElement();ct(ce(W,{},[u,ce(Gd,{apiClient:n,logger:i,analytics:a,terms:r})]),h),o=!0};return{prepare:async()=>{if(!(typeof window>"u"))try{if(o)return;l(),i.info("Chatbot plugin prepared")}catch(u){i.error("Error preparing chatbot plugin",u)}},fetchFlowByJobId:async(u,h)=>{const d=new URLSearchParams({id_type:(h==null?void 0:h.idType)==="inploi"?"internal":"external"});return n.fetch([`/flow/job/${u}`,d.toString()].filter(Boolean).join("?")).then(p=>{const g=Zt(Yd,p);return{flow:g.flow,title:s("applying_for",{title:g.job.title}),flowKeys:[g.job.id,...(h==null?void 0:h.flowKeys)??[]],job:{id:g.job.id,id_type:"external"},...h}})},fetchFlowById:async(u,h)=>n.fetch(`/flow/id/${u}`).then(d=>{var g;const p=Zt(Wd,d);return{flow:p.flow,title:"Chatbot",flowKeys:(h==null?void 0:h.flowKeys)??[],...h,analytics:{customProperties:{flow_id:p.flow.id,flow_version:p.flow.version,...(g=h==null?void 0:h.analytics)==null?void 0:g.customProperties}}}}),open:async u=>{if(!(typeof window>"u"))try{T.cancelCurrentFlow(),T.viewState$.value="maximised",o||l(),u instanceof Promise?(T.current$.value={state:"loading"},u.then(async h=>{$a({context:h.context||{},schema:h.flow.context_schema,logger:i}),T.startFlow(h)}).catch(h=>{const d=h instanceof Error?h.message:s("unknown_error");T.current$.value={state:"error",error:d}})):($a({context:u.context||{},schema:u.flow.context_schema,logger:i}),T.startFlow(u))}catch(h){i.error("Error starting flow",h)}},close:async()=>{typeof window>"u"||(T.cancelCurrentFlow(),i.info("Closed flow from an external source"))}}});if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=lf;const Ea=({condition:e,context:t,submissions:r,ifBlock:n})=>{const[i,...a]=e.compareKey.split(".");if(!i)return!1;const o=Ta({context:t,key:i,path:a,submissions:r});if(!o)return!1;switch(o.type){case"address":{const s=yt(o.value,a.join("."));switch(e.compare){case"equals":return s===e.compareValue;case"contains":return s?s.includes(e.compareValue):!1;case"notEquals":return s!==e.compareValue;case"notContains":return s?!s.includes(e.compareValue):!0}break}case"integration":{if(typeof o.value!="object"||Array.isArray(o.value))return!1;const s=yt(o.value,a.join(".")),l={...n,data:{...n.data,compareKey:"_temp"}};switch(typeof s){case"boolean":return Lt(l,{submissions:{_temp:{value:s,type:"boolean"}},context:t});case"string":return Lt(l,{submissions:{_temp:{value:s,type:"string"}},context:t});case"number":return Lt(l,{submissions:{_temp:{value:s,type:"number"}},context:t});case"object":return Array.isArray(s)&&s.every(va)?Lt(l,{submissions:{_temp:{value:s,type:"enum"}},context:t}):!1}break}case"boolean":{const s=e.compareValue==="true";switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s}break}case"phone":case"string":{const s=o.type==="phone"?fr(o.value):o.value;switch(e.compare){case"equals":return s===e.compareValue;case"contains":return s?s.includes(e.compareValue):!1;case"notEquals":return s!==e.compareValue;case"notContains":return s?!s.includes(e.compareValue):!0}break}case"number":{try{const s=Number(e.compareValue);switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s;case"greaterThan":return o.value>s;case"greaterThanOrEqualTo":return o.value>=s;case"lessThan":return o.value<s;case"lessThanOrEqualTo":return o.value<=s}}catch{return console.error(`Failed to parse number in if-block ${n.id}`,o.value),!1}break}case"enum":switch(e.compare){case"equals":return o.value.length===1&&o.value[0]===e.compareValue;case"notEquals":return o.value.length===1&&o.value[0]!==e.compareValue;case"contains":return o.value.includes(e.compareValue);case"notContains":return!o.value.includes(e.compareValue)}break}},Lt=(e,{context:t,submissions:r})=>{const n="combinator"in e.data?e.data.conditions:[e.data];if(("combinator"in e.data?e.data.combinator:"and")==="or"){for(const a of n)if(Ea({condition:a,context:t,submissions:r,ifBlock:e}))return!0;return!1}else{for(const a of n)if(!Ea({condition:a,context:t,submissions:r,ifBlock:e}))return!1;return!0}},cf=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,$e=(e,{context:t,submissions:r})=>e.replace(cf,(n,i,a="")=>{const[o,...s]=i.trim().split("."),l=Ta({key:o,path:s,submissions:r,context:t});if(!l)return a;switch(l.type){case"boolean":return l.value===!0?"true":"false";case"file":return l.value.map(u=>`${u.name} (${Nt(u.sizeKb)})`).join(", ");case"enum":return l.value.join(", ");case"address":return Object.values(l.value).filter(u=>u&&u.trim().length>0).join(", ");case"number":case"string":return l.value?l.value.toString():a;case"phone":return fr(l.value);case"integration":{if(typeof l.value!="object"||Array.isArray(l.value))break;const u=yt(l.value,s.join("."));switch(typeof u){case"boolean":return u===!0?"true":"false";case"string":return u;case"number":return u.toString();case"object":if(Array.isArray(u)&&u.every(va))return u.join(", ")}break}}return a}),Ia=({node:e,nodes:t,stopWhen:r})=>{if((r==null?void 0:r(e))===!0)return e;const n=e.nextId?t.find(i=>i.id===e.nextId):void 0;if(n)return Ia({node:n,nodes:t,stopWhen:r})},uf=({childNode:e,nodes:t})=>{const n=t.filter(i=>i.type==="if-block").find(i=>{if(!i.branchId)return!1;const a=t.find(s=>s.id===i.branchId);if(!a)return!1;const o=Ia({node:a,nodes:t,stopWhen:s=>s.id===e.id});return!(!o||o.id!==e.id)});if(n!=null&&n.nextId)return t.find(i=>i.id===n.nextId)},df=({flow:e,analytics:t,logger:r,context:n,apiClient:i,getSubmissions:a,chatService:o,onFlowEnd:s,onInterpret:l,t:u})=>{let h=new AbortController;const d={...t.service,log:g=>t.service.log({...g,customProperties:{...g.customProperties,...t.customProperties}})},p=async(g,v)=>{const y=a();l==null||l(g,v);try{await ff({flow:e,analytics:d,logger:r,apiClient:i,context:n,node:g,submissions:y,t:u,chat:{sendMessage:async k=>o.send({groupId:g.id,message:k,signal:h.signal}),userInput:async k=>o.input({input:k,signal:h.signal}),addToSubmissions:o.addToSubmissions},next:k=>{const x=k?e.nodes.find(_=>_.id===k):uf({childNode:g,nodes:e.nodes});return x?p(x,g):s==null?void 0:s(g)},end:()=>s==null?void 0:s(g)})}catch(k){if(k instanceof Pt)return;throw k}};return{interpret:async g=>{const v=e.nodes.find(y=>y.id===g)??pa(e.nodes);return p(v)},undo:g=>{let v=1;const y=e.nodes.find(x=>x.id===g[g.length-1]);for(let x=g.length-2;x>0;x--){const _=g[x],M=e.nodes.find(F=>F.id===_);if(!M||(v++,M.type.startsWith("question-")))break}h.abort(),h=new AbortController;const k=e.nodes.find(x=>x.id===g[g.length-v]);return we(k,"Undo failed: new start node not found"),p(k,y),{removed:v}},abort:()=>{h.abort()}}},fr=e=>`+${e.countryCode} ${e.phoneNumber}`;async function ff(e){const t=e.node;switch(t.type){case"text":return yf({...e,node:t});case"image":return wf({...e,node:t});case"question-text":return xf({...e,node:t});case"question-enum":return Cf({...e,node:t});case"question-number":return kf({...e,node:t});case"question-phone":return Sf({...e,node:t});case"question-boolean":return $f({...e,node:t});case"question-file":return If({...e,node:t});case"question-address":return Ef({...e,node:t});case"end-flow":return Tf({...e,node:t});case"if-block":return _f({...e,node:t});case"jump":return vf({...e,node:t});case"link":return bf({...e,node:t});case"integration-application-submit":return gf({...e,node:t});case"add-submission":return mf({...e,node:t});case"integration-workflow-get":throw Error("Workflow should be unreachable");case"identify":return pf({...e,node:t});case"feedback":return hf({...e,node:t});default:throw new Error(`Unknown node: ${JSON.stringify(t)}`)}}const Dt=(e,t)=>{var n;const r=(n=e[t])==null?void 0:n.value;if(typeof r!="string"&&typeof r!="number")throw new Error(`Submission at “${t}” is not a string or number`);return r};async function hf({next:e,node:t}){e(t.nextId)}async function pf({next:e,node:t,analytics:r,submissions:n,logger:i}){if(!n)return e(t.nextId);try{r.log({event:"IDENTIFY",properties:{identifier:Dt(n,t.data.key).toString(),first_name:t.data.firstName?Dt(n,t.data.firstName).toString():void 0,last_name:t.data.lastName?Dt(n,t.data.lastName).toString():void 0,email:t.data.email?Dt(n,t.data.email).toString():void 0,phone_number:t.data.phoneNumber?Dt(n,t.data.phoneNumber).toString():void 0,custom_traits:t.data.customTraits?Object.fromEntries(t.data.customTraits.map(({key:a,value:o})=>{var s;return[a,(s=n[o])==null?void 0:s.value]})):void 0}})}catch(a){i.error(a)}finally{e(t.nextId)}}async function vf({next:e,node:t}){e(t.data.targetId)}async function mf({next:e,node:t,logger:r,submissions:n,context:i}){if(!n){r.error("Submissions not found");return}n[t.data.key]={type:"string",value:$e(t.data.value,{submissions:n,context:i})},e(t.nextId)}async function gf({chat:e,next:t,node:r,logger:n,apiClient:i,submissions:a,analytics:o,flow:s,t:l}){const u=async h=>{h!==!0&&await e.userInput({type:"submit",key:void 0,config:{label:r.data.submitLabel}}),await e.sendMessage({type:"loading"});const{anonymous_id:d,session_id:p}=o.getSessionInfo(),g=await i.fetch("/flow/submit",{method:"POST",body:JSON.stringify({log_submit:!1,integration_id:r.data.integrationId,anonymous_id:d,session_id:p,job:s.job,submissions:Ld(a||{})})}).catch(v=>v);r.data.key&&e.addToSubmissions(r.data.key,{type:"integration",value:g}),Qe(g).with({integration_response:A.select(A.union({service:A.optional(A.string),status:A.number,data:A.any},{service:A.optional(A.string),status:A.number,error:{message:A.string,data:A.any}}))},v=>{o.log({event:"FLOW_SUBMIT",properties:{flow_id:s.id,flow_version:s.version,flow_session_id:s.data.flowSessionId,flow_build:s.build,service:v.service??"INVALID_SERVICE",response:{status:v.status,payload:"data"in v?v.data:v.error.data??null},job:s.job}})}).otherwise(()=>{}),await Qe(g).with(A.union({ats_data:A.select("redirect",{redirect_url:A.string,message:A.optional(A.union(A.string,A.nullish)),button_text:A.optional(A.union(A.string,A.nullish))})},{integration_response:{data:A.select("redirect",{redirect_url:A.string,message:A.optional(A.union(A.string,A.nullish)),button_text:A.optional(A.union(A.string,A.nullish))})}}),async v=>{if(v.redirect!==void 0){await e.sendMessage({type:"text",author:"bot",text:v.redirect.message??l("submission_redirect_message")});try{const y=new URL(v.redirect.redirect_url);d&&!y.searchParams.has("anonymous_id")&&y.searchParams.set("anonymous_id",d),await e.sendMessage({type:"link",href:y.toString(),text:v.redirect.button_text??l("complete_submission"),onClick:()=>{if(!p){n.error("session_id not set, cannot log FLOW_REDIRECT event");return}o.log({event:"FLOW_REDIRECT",properties:{flow_build:s.build,flow_id:s.id,flow_session_id:p,flow_version:s.version,href:y.toString(),job:s.job}})}})}catch(y){n.error(`Invalid redirect URL: ${v.redirect.redirect_url}`,y),e.sendMessage({type:"system",variant:"error",text:l("redirect_url_error")})}t(r.nextId)}}).with({success:!0},async()=>{r.data.skipConfirmation!==!0&&await e.sendMessage({type:"system",variant:"success",text:l("submission_completed")}),t(r.nextId)}).with(A.union({success:!1,ats_data:A.select("error",{message:A.string})},{integration_response:{error:A.select("error",{message:A.string})}}),async v=>{var y;n.error(v.error),await e.sendMessage({type:"system",variant:"error",text:((y=v.error)==null?void 0:y.message)||l("submission_failed")}),await u(!1)}).otherwise(async v=>{n.error(v),await e.sendMessage({type:"system",variant:"error",text:l("submission_failed")}),await u(!1)})};await u(r.data.skipConfirmation)}async function bf({chat:e,next:t,node:r,submissions:n,context:i}){await e.sendMessage({type:"link",href:$e(r.data.href,{submissions:n,context:i}),text:$e(r.data.cta,{submissions:n,context:i})}),t(r.nextId)}async function _f({submissions:e,next:t,node:r,context:n}){t(Lt(r,{submissions:e,context:n})?r.branchId:r.nextId)}async function yf({chat:e,next:t,node:r,submissions:n,context:i}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.text,{submissions:n,context:i})}),t(r.nextId)}async function wf({chat:e,next:t,node:r}){await e.sendMessage({author:"bot",type:"image",url:r.data.url,height:r.data.height,width:r.data.width}),t(r.nextId)}async function xf({chat:e,next:t,node:r,submissions:n,context:i,t:a}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.question,{submissions:n,context:i})});const o=r.data.format==="phone"?await e.userInput({key:r.data.key,type:"phone",config:{optional:r.data.optional,placeholder:r.data.placeholder,maxChars:r.data.maxChars,minChars:r.data.minChars,submissionFormat:"text",defaultValue:{}}}):await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:r.data.format,maxChars:r.data.maxChars,minChars:r.data.minChars}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.type==="phone"?fr(o.value):o.value}),t(r.nextId)}async function kf({chat:e,next:t,node:r,submissions:n,context:i,t:a}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.question,{submissions:n,context:i})});const o=await e.userInput({key:r.data.key,type:"number",config:{max:r.data.max,min:r.data.min,optional:r.data.optional,placeholder:r.data.placeholder,decimalCases:r.data.decimalCases}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value.toString()}),t(r.nextId)}async function Sf({chat:e,next:t,node:r,submissions:n,context:i}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.question,{submissions:n,context:i})});const a=await e.userInput({key:r.data.key,type:"phone",config:{minChars:r.data.minChars,maxChars:r.data.maxChars,defaultValue:{countryCode:r.data.defaultCountryCode},placeholder:r.data.placeholder,submissionFormat:"phone",optional:r.data.optional}});a===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:a.type==="phone"?fr(a.value):a.value}),t(r.nextId)}async function Cf({chat:e,next:t,node:r,submissions:n,context:i,t:a}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.question,{submissions:n,context:i})});const o=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});o.value.length===0?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(s=>o.value.includes(s.value)).map(s=>s.label).join(", ")}),t(r.nextId)}async function $f({chat:e,next:t,node:r,submissions:n,context:i,t:a}){await e.sendMessage({author:"bot",type:"text",text:$e(r.data.question,{submissions:n,context:i})});const o=await e.userInput({key:r.data.key,type:"boolean",config:{optional:r.data.optional,labels:{true:r.data.trueLabel,false:r.data.falseLabel}}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value===!0?r.data.trueLabel:r.data.falseLabel}),t(r.nextId)}async function Ef({chat:e,next:t,node:r,t:n}){await e.sendMessage({author:"bot",type:"text",text:r.data.question});const i=await e.userInput({type:"address",key:r.data.key,config:{optional:r.data.optional,keys:r.data.keys,placeholder:r.data.placeholder}});if(i===null)await e.sendMessage({type:"system",variant:"info",text:n("skipped")});else{const a=Object.values(i.value).filter(o=>o&&o.trim().length>0).join(", ");await e.sendMessage({author:"user",type:"text",text:a})}return t(r.nextId)}async function If({node:e,chat:t,next:r,submissions:n,context:i,t:a}){await t.sendMessage({author:"bot",type:"text",text:$e(e.data.question,{submissions:n,context:i})});const o=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(o===null)await t.sendMessage({type:"system",variant:"info",text:a("skipped")});else for(const s of o.value)await t.sendMessage({author:"user",type:"file",fileName:s.name,fileSizeKb:s.sizeKb});r(e.nextId)}async function Tf({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const Ta=({key:e,path:t,submissions:r,context:n})=>{if(e==="$context"){if(!t)return;const i=yt(n,t.join("."));switch(typeof i){case"string":return{type:"string",value:i};case"number":return{type:"number",value:i};case"boolean":return{type:"boolean",value:i};default:console.warn(`Unexpected type for $context.${t.join(".")}`,i);return}}return r==null?void 0:r[e]};function fn(e,t,r){var n,i,a,o,s;t==null&&(t=100);function l(){var h=Date.now()-o;h<t&&h>=0?n=setTimeout(l,t-h):(n=null,r||(s=e.apply(a,i),a=i=null))}var u=function(){a=this,i=arguments,o=Date.now();var h=r&&!n;return n||(n=setTimeout(l,t)),h&&(s=e.apply(a,i),a=i=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(a,i),a=i=null,clearTimeout(n),n=null)},u}fn.debounce=fn;var Af=fn;const Aa=Te(Af);function Mf(e){let{debounce:t,scroll:r,polyfill:n,offsetSize:i}=e===void 0?{debounce:0,scroll:!1,offsetSize:!1}:e;const a=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,s]=me({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=de({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=t?typeof t=="number"?t:t.scroll:null,h=t?typeof t=="number"?t:t.resize:null,d=de(!1);ye(()=>(d.current=!0,()=>void(d.current=!1)));const[p,g,v]=Pe(()=>{const _=()=>{if(!l.current.element)return;const{left:M,top:F,width:N,height:H,bottom:te,right:pe,x:D,y:se}=l.current.element.getBoundingClientRect(),ae={left:M,top:F,width:N,height:H,bottom:te,right:pe,x:D,y:se};l.current.element instanceof HTMLElement&&i&&(ae.height=l.current.element.offsetHeight,ae.width=l.current.element.offsetWidth),Object.freeze(ae),d.current&&!Ff(l.current.lastBounds,ae)&&s(l.current.lastBounds=ae)};return[_,h?Aa(_,h):_,u?Aa(_,u):_]},[s,i,u,h]);function y(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function k(){l.current.element&&(l.current.resizeObserver=new a(v),l.current.resizeObserver.observe(l.current.element),r&&l.current.scrollContainers&&l.current.scrollContainers.forEach(_=>_.addEventListener("scroll",v,{capture:!0,passive:!0})))}const x=_=>{!_||_===l.current.element||(y(),l.current.element=_,l.current.scrollContainers=Ma(_),k())};return Pf(v,!!r),Nf(g),ye(()=>{y(),k()},[r,v,g]),ye(()=>y,[]),[x,o,p]}function Nf(e){ye(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function Pf(e,t){ye(()=>{if(t){const r=e;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",r,!0)}},[e,t])}function Ma(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:i}=window.getComputedStyle(e);return[r,n,i].some(a=>a==="auto"||a==="scroll")&&t.push(e),[...t,...Ma(e.parentElement)]}const Of=["x","y","top","bottom","left","right","width","height"],Ff=(e,t)=>Of.every(r=>e[r]===t[r]),tt=({class:e,...t})=>{const{t:r}=he();return c("button",{class:Je("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50",e),type:"submit",...t,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[c("title",{children:r("send")}),c("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),c("path",{d:"M8 4V13"})]})})},Lf=25,hn=Ue({instant:()=>{},smooth:()=>{}}),ee={onSubmitSuccessFn$:Ue(()=>{}),isBotTyping$:Ue(!1),scrollToEnd:{instant:()=>hn.value.instant(),smooth:()=>hn.value.smooth()}},Df=()=>{const e=de(null);ue(()=>{hn.value={instant:()=>{var r;return(r=e.current)==null?void 0:r.scrollTo({top:e.current.scrollHeight,behavior:"instant"})},smooth:()=>{e.current&&e.current.scrollHeight-e.current.scrollTop<=e.current.clientHeight*2&&e.current.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})}}},[e]);const t=Pe(()=>({addToSubmissions:(n,i)=>T.setSubmission(n,i),send:async({message:n,signal:i,groupId:a})=>{if(await Qe(n).with({author:"bot",type:"text"},async o=>{if(i!=null&&i.aborted)throw new Pt;ee.isBotTyping$.value=!0;const s=Math.min(Math.max(20,o.text.length),100)*Lf;await new Promise(l=>setTimeout(l,s,{signal:i})),ee.isBotTyping$.value=!1}).otherwise(async()=>{}),i!=null&&i.aborted)throw new Pt;T.addMessage(n,a)},input:({input:n,signal:i})=>{if(i!=null&&i.aborted)throw new Pt;return T.setInput(n),new Promise(a=>{const o=s=>{if(i!=null&&i.aborted)throw new Pt;T.setInput(void 0),n.key&&T.setSubmission(n.key,s),a(s)};ee.onSubmitSuccessFn$.value=o})}}),[]);return{chatRef:e,chatService:t}},vt=({error:e})=>!e||!e.message?null:c("div",{role:"alert",class:"text-error-11 flex max-w-full items-center gap-1 overflow-hidden rounded-full px-2 py-2",children:[c("svg",{class:"text-error-9 h-4 w-4",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),c("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),c("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),c("p",{class:"truncate pr-1 text-sm",children:e.message})]}),rt=({class:e,...t})=>{const{t:r}=he();return c("button",{type:"button",class:Je("fr text-neutral-9 flex flex-shrink-0 items-center justify-center gap-1 rounded-full py-[6px] pl-2 pr-3 text-sm underline-offset-2 transition-all",e),...t,children:[c("svg",{"aria-hidden":!0,class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",children:[c("title",{children:r("skip")}),c("path",{d:"M3.25 11.25A5 5 0 0 1 12 7"}),c("path",{d:"M13.25 4.5V8.25H9.5"})]}),r("skip")]})},pn={Afghanistan:"93",Albania:"355",Algeria:"213","American Samoa":"1 684",Andorra:"376",Angola:"244",Anguilla:"1 264",Antarctica:"672","Antigua and Barbuda":"1 268",Argentina:"54",Armenia:"374",Aruba:"297",Australia:"61",Austria:"43",Azerbaijan:"994",Bahrain:"973",Bangladesh:"880",Barbados:"1 246",Belarus:"375",Belgium:"32",Belize:"501",Benin:"229",Bermuda:"1 441",Bhutan:"975",Bolivia:"591","Bosnia and Herzegovina":"387",Botswana:"267","Bouvet Island":"47",Brazil:"55","British Indian Ocean Territory":"246","British Virgin Islands":"1 284",Brunei:"673",Bulgaria:"359","Burkina Faso":"226",Burundi:"257","Cabo Verde":"238",Cambodia:"855",Cameroon:"237",Canada:"1","Caribbean Netherlands":"599","Cayman Islands":"1 345","Central African Republic":"236",Chad:"235",Chile:"56",China:"86","Christmas Island":"61","Cocos (Keeling) Islands":"61",Colombia:"57",Comoros:"269","Cook Islands":"682","Costa Rica":"506",Croatia:"385",Cuba:"53",Curaçao:"599",Cyprus:"357",Czechia:"420","Côte d'Ivoire":"225","Democratic Republic of the Congo":"243",Denmark:"45",Djibouti:"253","Dominican Republic":"1 809",Ecuador:"593",Egypt:"20","El Salvador":"503","Equatorial Guinea":"240",Eritrea:"291",Estonia:"372",Eswatini:"268",Ethiopia:"251","Falkland Islands (Islas Malvinas)":"500","Faroe Islands":"298",Fiji:"679",Finland:"358",France:"33","French Guiana":"594","French Polynesia":"689","French Southern and Antarctic Lands":"262",Gabon:"241",Georgia:"995",Germany:"49",Ghana:"233",Gibraltar:"350",Greece:"30",Greenland:"299",Grenada:"1 473",Guadeloupe:"590",Guam:"1 671",Guatemala:"502",Guernsey:"44",Guinea:"224","Guinea-Bissau":"245",Guyana:"592",Haiti:"509",Honduras:"504","Hong Kong":"852",Hungary:"36",Iceland:"354",India:"91",Indonesia:"62",Iran:"98",Iraq:"964",Ireland:"353","Isle of Man":"44",Israel:"972",Italy:"39",Jamaica:"1 876",Japan:"81",Jersey:"44",Jordan:"962",Kazakhstan:"7",Kenya:"254",Kiribati:"686",Kosovo:"383",Kuwait:"965",Kyrgyzstan:"996",Laos:"856",Latvia:"371",Lebanon:"961",Lesotho:"266",Liberia:"231",Libya:"218",Liechtenstein:"423",Lithuania:"370",Luxembourg:"352",Macao:"853",Madagascar:"261",Malawi:"265",Malaysia:"60",Maldives:"960",Mali:"223",Malta:"356","Marshall Islands":"692",Martinique:"596",Mauritania:"222",Mauritius:"230",Mayotte:"262",Mexico:"52",Micronesia:"691",Moldova:"373",Monaco:"377",Mongolia:"976",Montenegro:"382",Montserrat:"1 664",Morocco:"212",Mozambique:"258","Myanmar (Burma)":"95",Namibia:"264",Nauru:"674",Nepal:"977",Netherlands:"31","New Caledonia":"687","New Zealand":"64",Nicaragua:"505",Niger:"227",Nigeria:"234",Niue:"683","Norfolk Island":"672","North Korea":"850","North Macedonia":"389","Northern Mariana Islands":"1 670",Norway:"47",Oman:"968",Pakistan:"92",Palau:"680",Palestine:"970",Panama:"507","Papua New Guinea":"675",Paraguay:"595",Peru:"51",Philippines:"63","Pitcairn Islands":"64",Poland:"48",Portugal:"351","Puerto Rico":"1 787",Qatar:"974",Romania:"40",Russia:"7",Rwanda:"250",Réunion:"262","Saint Barthélemy":"590","Saint Helena, Ascension and Tristan da Cunha":"290","Saint Kitts and Nevis":"1 869","Saint Lucia":"1 758","Saint Martin":"590","Saint Pierre and Miquelon":"508","Saint Vincent and the Grenadines":"1 784",Samoa:"685","San Marino":"378","Saudi Arabia":"966",Senegal:"221",Serbia:"381",Seychelles:"248","Sierra Leone":"232",Singapore:"65","Sint Maarten":"1 721",Slovakia:"421",Slovenia:"386","Solomon Islands":"677",Somalia:"252","South Africa":"27","South Georgia and the South Sandwich Islands":"500","South Korea":"82","South Sudan":"211",Spain:"34","Sri Lanka":"94",Sudan:"249",Suriname:"597","Svalbard and Jan Mayen":"47",Sweden:"46",Switzerland:"41",Syria:"963","São Tomé and Príncipe":"239",Taiwan:"886",Tajikistan:"992",Tanzania:"255",Thailand:"66","The Bahamas":"1 242","The Gambia":"220","Timor-Leste":"670",Togo:"228",Tokelau:"690",Tonga:"676","Trinidad and Tobago":"1 868",Tunisia:"216",Turkmenistan:"993","Turks and Caicos Islands":"1 649",Tuvalu:"688",Türkiye:"90","U.S. Virgin Islands":"1 340",Uganda:"256",Ukraine:"380","United Arab Emirates":"971","United Kingdom":"44","United States":"1","United States Minor Outlying Islands":"1",Uruguay:"598",Uzbekistan:"998",Vanuatu:"678","Vatican City":"379",Venezuela:"58",Vietnam:"84","Wallis and Futuna":"681","Western Sahara":"212",Yemen:"967",Zambia:"260",Zimbabwe:"263","Åland Islands":"358"},Vt=Ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all",{variants:{optional:{true:"pr-16 pl-3",false:"pl-3 pr-3"}},defaultVariants:{optional:!1}}),Vf="https://api.mapbox.com/search/searchbox/v1/suggest",jf="ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==",zf=e=>atob(e).split("").reverse().join(""),Oe=ne({name:X()}),Rf=ne({suggestions:pi(ne({full_address:St(X()),place_formatted:St(X()),name:St(X()),mapbox_id:X(),context:pu(ne({address:Oe,street:Oe,neighborhood:Oe,locality:Oe,district:Oe,place:Oe,region:Oe,postcode:Oe,country:Oe}))}))}),Bf=({logger:e,t})=>Pe(()=>{var n;const r=(n=T.current$.peek().flow)==null?void 0:n.data.flowSessionId;return r?{enabled:!0,getPredictions:async i=>{const a=new URL(Vf);a.searchParams.set("q",i),a.searchParams.set("session_token",r),a.searchParams.set("access_token",zf(jf));const o=await fetch(a);if(!o.ok)return e.error("Failed to get address details",o),{ok:!1,error:t("address_error")};const s=vu(Rf,await o.json());if(s.success===!1)return e.error("Failed to parse address details",s.issues),{ok:!1,error:t("address_error")};const{suggestions:l}=s.output;return{ok:!0,data:l.map(u=>{var h,d,p,g,v,y,k,x,_;return{label:u.full_address??u.place_formatted??u.name??u.mapbox_id,id:u.mapbox_id,address:{line1:((h=u.context.address)==null?void 0:h.name)??((d=u.context.street)==null?void 0:d.name),line2:void 0,line3:((p=u.context.neighborhood)==null?void 0:p.name)??((g=u.context.locality)==null?void 0:g.name),city:((v=u.context.place)==null?void 0:v.name)??((y=u.context.district)==null?void 0:y.name),state:(k=u.context.region)==null?void 0:k.name,postcode:(x=u.context.postcode)==null?void 0:x.name,country:(_=u.context.country)==null?void 0:_.name}}})}}}:{enabled:!1}},[e,t]),Na=e=>{const{t}=he();return c("button",{type:"button",class:"text-neutral-10 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",...e,children:[c("svg",{width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M10 3L5 8L10 13"})}),c("span",{children:t("back")})]})},Uf=({input:e,onSubmitSuccess:t,logger:r})=>{const{t:n}=he(),[i,a]=me(),[o,s]=me([]),{enabled:l,getPredictions:u}=Bf({logger:r,t:n}),[h,d]=me(l?"query":"manual"),[p,g]=me(""),[v,y]=me(),k=x=>{we(l,"Query state should not be enabled"),x=x.trim(),x!==(p==null?void 0:p.trim())&&(g(x),x===""&&s([]),y(void 0),u(x).then(_=>{if(_.ok===!1){s([]),y(_.error);return}s(_.data)}))};switch(h){case"query":return we(l,"Query state should not be enabled"),c(Hf,{input:e,onSkip:()=>t(null),onAddressSelect:x=>{if(x===""){a(void 0),d("manual");return}const _=o.find(M=>M.id===x);_&&(a(_.address),d("details"))},onAddressSearch:x=>{k(x)},suggestions:o,query:p,error:v});case"details":return we(i!==void 0),c(Oa,{input:e,logger:r,onSubmitSuccess:t,addressFields:i,actions:c(Na,{onClick:()=>{d("query")}})});case"manual":return c(Oa,{logger:r,input:e,onSubmitSuccess:t,addressFields:{},actions:l?c(Na,{onClick:()=>{d("query")}}):void 0})}},Hf=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:i,onAddressSearch:a,error:o})=>{const{t:s}=he(),l=de(null);return ue(()=>{l.current&&(l.current.focus(),l.current.select())},[]),c(W,{children:[c("form",{noValidate:!0,onSubmit:u=>{u.preventDefault();const d=new FormData(u.currentTarget).get("address");typeof d=="string"&&a(d)},class:"flex gap-1 p-2.5",children:[c("div",{class:"group relative flex-1",children:[c("input",{ref:l,name:"address",id:"chat-address",autocomplete:"address-line1 country-name postal-code",autoFocus:!0,placeholder:e.config.placeholder||s("address_search"),defaultValue:i,class:Vt({optional:!!e.config.optional,className:"w-full rounded-full"})}),c("button",{type:"submit",class:"touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",children:c("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("g",{id:"inploi",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",strokeWidth:"1.5",children:[c("circle",{cx:"7",cy:"7",r:"4"}),c("path",{d:"M10 10L13 13"})]}),c("span",{class:"sr-only",children:s("search")})]})})]}),e.config.optional&&c(rt,{class:"",onClick:t})]}),o?c(vt,{error:{message:o}}):null,c("ul",{children:[r.map(u=>c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n(u.id)},children:[c("span",{class:"flex-grow",children:u.label}),c("svg",{class:"flex-none",width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M6 3L11 8L6 13"})})]})},u.id)),c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n("")},children:c("span",{class:"flex-grow",children:s("address_manual")})})},"")]})]})},qf={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},Pa=["line1","line2","line3","city","state","postcode","country"],Oa=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const i=de(null);ue(()=>{if(i.current){const o=i.current.querySelector("input");o&&(o.focus(),o.select())}},[]);const a=Object.keys(pn);return c("form",{class:"bg-neutral-1/90 flex flex-col justify-end gap-2 p-2",onSubmit:o=>{const s=new FormData(o.currentTarget),l=Object.fromEntries(s.entries());t({type:"address",value:l})},children:[c("div",{class:"bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",ref:i,children:Pa.map((o,s)=>{const l=`isdk_${o}`,u=n.config.keys[o];return u?c(W,{children:[c("label",{for:l,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:qf[o]}),c("div",{class:"flex flex-col items-stretch gap-1.5",children:[o==="country"?c("div",{class:"relative",children:[c("select",{class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",name:u,id:l,defaultValue:e[o],required:!0,children:[e.country&&!a.includes(e.country)?c("option",{value:e[o],children:e[o]}):c("option",{value:"",children:"Select a country"}),a.map(h=>c("option",{value:h,children:h},h))]}),c("svg",{class:"text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",width:"16",height:"16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M4 6.5L8 10.5L12 6.5"})})]}):c("input",{autoFocus:s===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",name:u,id:l,defaultValue:e[o],required:!0}),s===Pa.length-1?c("hr",{class:"m-0 w-full border-b border-b-transparent"}):c("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"})]})]}):null})}),c("div",{class:"flex w-full flex-1 ",children:[c("div",{class:"flex-grow",children:r}),c(tt,{class:"flex items-center justify-center"})]})]})},vn=()=>{const e=de(null);return ye(()=>{var t;(t=e.current)==null||t.focus()},[]),e},Fa=["true","false"],Kf=cu(Fa),Gf="answer",La="flex items-center gap-2 p-2.5",Da=Rr(({label:e,...t},r)=>c("button",{class:"bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all selection:bg-transparent",...t,ref:r,children:c("p",{class:"truncate text-center text-base",children:e})})),Wf=({input:e,onSubmitSuccess:t})=>{const r=vn();return c("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const i=jd(n).value,a=Zt(Kf,i);t({type:"boolean",value:a==="true"})},children:[c("ul",{class:La,children:Fa.map((n,i)=>c("li",{class:"flex-1",children:c(Da,{ref:i===0?r:null,type:"submit",name:Gf,value:n,label:e.config.labels[n]},n)}))}),e.config.optional&&c("div",{class:"px-2 pb-2",children:c(rt,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},Yf=e=>new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>n.result?t(n.result.toString()):r("No result from reader"),n.onerror=r}),Jf=e=>e.reduce((t,r)=>t+r.sizeKb,0),Zf=pt("file"),Va=3,Xf=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),i=e.name.replace(new RegExp(`.${n}$`),"");return c("div",{class:Je("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...r,children:[c("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[c("span",{class:"block truncate",children:i}),c("span",{children:[".",n]})]}),c("p",{"aria-label":"File size",class:"text-accent-11",children:Nt(e.sizeKb)})]})},ja=({class:e,...t})=>c("li",{class:Je("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),za=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},Qf=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(za(n.name).toLowerCase()))},eh=(e,t)=>{const r=za(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},th=({input:e,onSubmitSuccess:t})=>{var d;const r=(d=T.current$.value.flow)==null?void 0:d.data.submissions[e.key],[n,i]=me(Zf(r)?r.value:[]),[a,o]=me(),s=n.length-Va,l=Jf(n),u=vn(),{t:h}=he();return c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:p=>(p.preventDefault(),o(void 0),n.length===0?o({type:"required",message:h("validation_file")}):e.config.extensions.length>0&&!Qf({allowedExtensions:e.config.extensions,files:n})?o({type:"validate",message:`${h("validation_file_ext",{ext:e.config.extensions.join(", ")})}`}):e.config.fileSizeLimitKib&&l>e.config.fileSizeLimitKib?o({type:"max",message:`File size exceeds limit of ${Nt(e.config.fileSizeLimitKib)}`}):e.config.allowMultiple===!1&&n.length>1?o({type:"invalid",message:h("validation_file_max",{count:1})}):t({type:"file",value:n})),children:[c("div",{class:"flex items-center gap-2",children:[c("label",{ref:u,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[n.length>0?c(W,{children:[c("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,Va).map(p=>{const g=p.name.split(".").pop(),v=p.name.replace(new RegExp(`.${g}$`),"");return c(ja,{class:"flex overflow-hidden",children:[c("span",{class:"block truncate",children:v}),c("span",{children:[".",g]})]})}),s>0?c(ja,{children:["+",s," file",s!==1?"s":""]}):null]}),c("p",{class:"text-neutral-11 text-xs",children:[Nt(l)," ",n.length>1?"total":""]})]}):c("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[c("header",{class:"flex flex-col items-center gap-0",children:[c("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:c("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),c("p",{class:"text-neutral-12 tracking-[-0.01em]",children:h("upload_file",{count:e.config.allowMultiple?2:1})}),e.config.fileSizeLimitKib?c("p",{class:"text-neutral-10 text-xs",children:["(",h("file_max_size",{size:Nt(e.config.fileSizeLimitKib)}),")"]}):null]}),c("aside",{class:"flex flex-col items-center gap-2",children:[c("p",{id:"accepted-filetypes",class:"sr-only",children:h("file_extensions")}),c("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(p=>c("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:p.replace(".","")}))})]})]}),c("input",{id:"dropzone-file",onInput:async p=>{we(p.target instanceof HTMLInputElement);const g=p.target.files?Array.from(p.target.files):[],v=await Promise.allSettled(g.map(async k=>{const x=await Yf(k);return{name:eh(k.name,42),data:x,sizeKb:k.size/1e3}}));if(v.some(({status:k})=>k==="rejected"))return o({type:"invalid",message:"Invalid file"});const y=v.map(k=>k.status==="fulfilled"?k.value:null).filter(Boolean);i(y)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),c("div",{class:"flex h-full flex-col items-center gap-2",children:[c(tt,{disabled:n.length===0}),e.config.optional&&c(rt,{onClick:()=>t(null)})]})]}),c(vt,{error:a})]})};var jt=e=>e.type==="checkbox",mt=e=>e instanceof Date,ie=e=>e==null;const Ra=e=>typeof e=="object";var G=e=>!ie(e)&&!Array.isArray(e)&&Ra(e)&&!mt(e),rh=e=>G(e)&&e.target?jt(e.target)?e.target.checked:e.target.value:e,nh=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ih=(e,t)=>e.has(nh(t)),ah=e=>{const t=e.constructor&&e.constructor.prototype;return G(t)&&t.hasOwnProperty("isPrototypeOf")},mn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Fe(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(mn&&(e instanceof Blob||e instanceof FileList))&&(r||G(e)))if(t=r?[]:{},!r&&!ah(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Fe(e[n]));else return e;return t}var zt=e=>Array.isArray(e)?e.filter(Boolean):[],U=e=>e===void 0,$=(e,t,r)=>{if(!t||!G(e))return r;const n=zt(t.split(/[,[\].]+?/)).reduce((i,a)=>ie(i)?i:i[a],e);return U(n)||n===e?U(e[t])?r:e[t]:n},Ke=e=>typeof e=="boolean";const Ba={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Le={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};ke.createContext(null);var oh=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==xe.all&&(t._proxyFormState[o]=!n||xe.all),r&&(r[o]=!0),e[o]}});return i},ge=e=>G(e)&&!Object.keys(e).length,sh=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return ge(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||xe.all))},gn=e=>Array.isArray(e)?e:[e];function lh(e){const t=ke.useRef(e);t.current=e,ke.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var Ee=e=>typeof e=="string",ch=(e,t,r,n,i)=>Ee(e)?(n&&t.watch.add(e),$(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),$(r,a))):(n&&(t.watchAll=!0),r),bn=e=>/^\w*$/.test(e),Ua=e=>zt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function V(e,t,r){let n=-1;const i=bn(t)?[t]:Ua(t),a=i.length,o=a-1;for(;++n<a;){const s=i[n];let l=r;if(n!==o){const u=e[s];l=G(u)||Array.isArray(u)?u:isNaN(+i[n+1])?{}:[]}e[s]=l,e=e[s]}return e}var Ha=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},qa=e=>({isOnSubmit:!e||e===xe.onSubmit,isOnBlur:e===xe.onBlur,isOnChange:e===xe.onChange,isOnAll:e===xe.all,isOnTouch:e===xe.onTouched}),Ka=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const hr=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=$(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)break;if(o.ref&&t(o.ref,o.name)&&!n)break}else G(s)&&hr(s,t)}}};var uh=(e,t,r)=>{const n=zt($(e,r));return V(n,"root",t[r]),V(e,r,n),e},_n=e=>e.type==="file",Ge=e=>typeof e=="function",pr=e=>{if(!mn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vr=e=>Ee(e),yn=e=>e.type==="radio",mr=e=>e instanceof RegExp;const Ga={value:!1,isValid:!1},Wa={value:!0,isValid:!0};var Ya=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!U(e[0].attributes.value)?U(e[0].value)||e[0].value===""?Wa:{value:e[0].value,isValid:!0}:Wa:Ga}return Ga};const Ja={isValid:!1,value:null};var Za=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Ja):Ja;function Xa(e,t,r="validate"){if(vr(e)||Array.isArray(e)&&e.every(vr)||Ke(e)&&!e)return{type:r,message:vr(e)?e:"",ref:t}}var gt=e=>G(e)&&!mr(e)?e:{value:e,message:""},Qa=async(e,t,r,n,i)=>{const{ref:a,refs:o,required:s,maxLength:l,minLength:u,min:h,max:d,pattern:p,validate:g,name:v,valueAsNumber:y,mount:k,disabled:x}=e._f,_=$(t,v);if(!k||x)return{};const M=o?o[0]:a,F=L=>{n&&M.reportValidity&&(M.setCustomValidity(Ke(L)?"":L||""),M.reportValidity())},N={},H=yn(a),te=jt(a),pe=H||te,D=(y||_n(a))&&U(a.value)&&U(_)||pr(a)&&a.value===""||_===""||Array.isArray(_)&&!_.length,se=Ha.bind(null,v,r,N),ae=(L,P,q,le=Le.maxLength,be=Le.minLength)=>{const Ie=L?P:q;N[v]={type:L?le:be,message:Ie,ref:a,...se(L?le:be,Ie)}};if(i?!Array.isArray(_)||!_.length:s&&(!pe&&(D||ie(_))||Ke(_)&&!_||te&&!Ya(o).isValid||H&&!Za(o).isValid)){const{value:L,message:P}=vr(s)?{value:!!s,message:s}:gt(s);if(L&&(N[v]={type:Le.required,message:P,ref:M,...se(Le.required,P)},!r))return F(P),N}if(!D&&(!ie(h)||!ie(d))){let L,P;const q=gt(d),le=gt(h);if(!ie(_)&&!isNaN(_)){const be=a.valueAsNumber||_&&+_;ie(q.value)||(L=be>q.value),ie(le.value)||(P=be<le.value)}else{const be=a.valueAsDate||new Date(_),Ie=xr=>new Date(new Date().toDateString()+" "+xr),it=a.type=="time",Bt=a.type=="week";Ee(q.value)&&_&&(L=it?Ie(_)>Ie(q.value):Bt?_>q.value:be>new Date(q.value)),Ee(le.value)&&_&&(P=it?Ie(_)<Ie(le.value):Bt?_<le.value:be<new Date(le.value))}if((L||P)&&(ae(!!L,q.message,le.message,Le.max,Le.min),!r))return F(N[v].message),N}if((l||u)&&!D&&(Ee(_)||i&&Array.isArray(_))){const L=gt(l),P=gt(u),q=!ie(L.value)&&_.length>+L.value,le=!ie(P.value)&&_.length<+P.value;if((q||le)&&(ae(q,L.message,P.message),!r))return F(N[v].message),N}if(p&&!D&&Ee(_)){const{value:L,message:P}=gt(p);if(mr(L)&&!_.match(L)&&(N[v]={type:Le.pattern,message:P,ref:a,...se(Le.pattern,P)},!r))return F(P),N}if(g){if(Ge(g)){const L=await g(_,t),P=Xa(L,M);if(P&&(N[v]={...P,...se(Le.validate,P.message)},!r))return F(P.message),N}else if(G(g)){let L={};for(const P in g){if(!ge(L)&&!r)break;const q=Xa(await g[P](_,t),M,P);q&&(L={...q,...se(P,q.message)},F(q.message),r&&(N[v]=L))}if(!ge(L)&&(N[v]={ref:M,...L},!r))return N}}return F(!0),N};function dh(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=U(e)?n++:e[t[n++]];return e}function fh(e){for(const t in e)if(e.hasOwnProperty(t)&&!U(e[t]))return!1;return!0}function Z(e,t){const r=Array.isArray(t)?t:bn(t)?[t]:Ua(t),n=r.length===1?e:dh(e,r),i=r.length-1,a=r[i];return n&&delete n[a],i!==0&&(G(n)&&ge(n)||Array.isArray(n)&&fh(n))&&Z(e,r.slice(0,-1)),e}function wn(){let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var gr=e=>ie(e)||!Ra(e);function nt(e,t){if(gr(e)||gr(t))return e===t;if(mt(e)&&mt(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const a=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=t[i];if(mt(a)&&mt(o)||G(a)&&G(o)||Array.isArray(a)&&Array.isArray(o)?!nt(a,o):a!==o)return!1}}return!0}var eo=e=>e.type==="select-multiple",hh=e=>yn(e)||jt(e),xn=e=>pr(e)&&e.isConnected,to=e=>{for(const t in e)if(Ge(e[t]))return!0;return!1};function br(e,t={}){const r=Array.isArray(e);if(G(e)||r)for(const n in e)Array.isArray(e[n])||G(e[n])&&!to(e[n])?(t[n]=Array.isArray(e[n])?[]:{},br(e[n],t[n])):ie(e[n])||(t[n]=!0);return t}function ro(e,t,r){const n=Array.isArray(e);if(G(e)||n)for(const i in e)Array.isArray(e[i])||G(e[i])&&!to(e[i])?U(t)||gr(r[i])?r[i]=Array.isArray(e[i])?br(e[i],[]):{...br(e[i])}:ro(e[i],ie(t)?{}:t[i],r[i]):r[i]=!nt(e[i],t[i]);return r}var kn=(e,t)=>ro(e,t,br(t)),no=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>U(e)?e:t?e===""?NaN:e&&+e:r&&Ee(e)?new Date(e):n?n(e):e;function Sn(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return _n(t)?t.files:yn(t)?Za(e.refs).value:eo(t)?[...t.selectedOptions].map(({value:r})=>r):jt(t)?Ya(e.refs).value:no(U(t.value)?e.ref.value:t.value,e)}var ph=(e,t,r,n)=>{const i={};for(const a of e){const o=$(t,a);o&&V(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Rt=e=>U(e)?e:mr(e)?e.source:G(e)?mr(e.value)?e.value.source:e.value:e,vh=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function io(e,t,r){const n=$(e,r);if(n||bn(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=$(t,a),s=$(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:r}}var mh=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,gh=(e,t)=>!zt($(e,t)).length&&Z(e,t);const bh={mode:xe.onSubmit,reValidateMode:xe.onChange,shouldFocusError:!0};function _h(e={},t){let r={...bh,...e},n={submitCount:0,isDirty:!1,isLoading:Ge(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},i={},a=G(r.defaultValues)||G(r.values)?Fe(r.defaultValues||r.values)||{}:{},o=r.shouldUnregister?{}:Fe(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:wn(),array:wn(),state:wn()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,v=qa(r.mode),y=qa(r.reValidateMode),k=r.criteriaMode===xe.all,x=f=>m=>{clearTimeout(h),h=setTimeout(f,m)},_=async f=>{if(d.isValid||f){const m=r.resolver?ge((await D()).errors):await ae(i,!0);m!==n.isValid&&p.state.next({isValid:m})}},M=f=>d.isValidating&&p.state.next({isValidating:f}),F=(f,m=[],b,E,S=!0,w=!0)=>{if(E&&b){if(s.action=!0,w&&Array.isArray($(i,f))){const I=b($(i,f),E.argA,E.argB);S&&V(i,f,I)}if(w&&Array.isArray($(n.errors,f))){const I=b($(n.errors,f),E.argA,E.argB);S&&V(n.errors,f,I),gh(n.errors,f)}if(d.touchedFields&&w&&Array.isArray($(n.touchedFields,f))){const I=b($(n.touchedFields,f),E.argA,E.argB);S&&V(n.touchedFields,f,I)}d.dirtyFields&&(n.dirtyFields=kn(a,o)),p.state.next({name:f,isDirty:P(f,m),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else V(o,f,m)},N=(f,m)=>{V(n.errors,f,m),p.state.next({errors:n.errors})},H=(f,m,b,E)=>{const S=$(i,f);if(S){const w=$(o,f,U(b)?$(a,f):b);U(w)||E&&E.defaultChecked||m?V(o,f,m?w:Sn(S._f)):be(f,w),s.mount&&_()}},te=(f,m,b,E,S)=>{let w=!1,I=!1;const j={name:f};if(!b||E){d.isDirty&&(I=n.isDirty,n.isDirty=j.isDirty=P(),w=I!==j.isDirty);const K=nt($(a,f),m);I=$(n.dirtyFields,f),K?Z(n.dirtyFields,f):V(n.dirtyFields,f,!0),j.dirtyFields=n.dirtyFields,w=w||d.dirtyFields&&I!==!K}if(b){const K=$(n.touchedFields,f);K||(V(n.touchedFields,f,b),j.touchedFields=n.touchedFields,w=w||d.touchedFields&&K!==b)}return w&&S&&p.state.next(j),w?j:{}},pe=(f,m,b,E)=>{const S=$(n.errors,f),w=d.isValid&&Ke(m)&&n.isValid!==m;if(e.delayError&&b?(u=x(()=>N(f,b)),u(e.delayError)):(clearTimeout(h),u=null,b?V(n.errors,f,b):Z(n.errors,f)),(b?!nt(S,b):S)||!ge(E)||w){const I={...E,...w&&Ke(m)?{isValid:m}:{},errors:n.errors,name:f};n={...n,...I},p.state.next(I)}M(!1)},D=async f=>r.resolver(o,r.context,ph(f||l.mount,i,r.criteriaMode,r.shouldUseNativeValidation)),se=async f=>{const{errors:m}=await D(f);if(f)for(const b of f){const E=$(m,b);E?V(n.errors,b,E):Z(n.errors,b)}else n.errors=m;return m},ae=async(f,m,b={valid:!0})=>{for(const E in f){const S=f[E];if(S){const{_f:w,...I}=S;if(w){const j=l.array.has(w.name),K=await Qa(S,o,k,r.shouldUseNativeValidation&&!m,j);if(K[w.name]&&(b.valid=!1,m))break;!m&&($(K,w.name)?j?uh(n.errors,K,w.name):V(n.errors,w.name,K[w.name]):Z(n.errors,w.name))}I&&await ae(I,m,b)}}return b.valid},L=()=>{for(const f of l.unMount){const m=$(i,f);m&&(m._f.refs?m._f.refs.every(b=>!xn(b)):!xn(m._f.ref))&&En(f)}l.unMount=new Set},P=(f,m)=>(f&&m&&V(o,f,m),!nt(ho(),a)),q=(f,m,b)=>ch(f,l,{...s.mount?o:U(m)?a:Ee(f)?{[f]:m}:m},b,m),le=f=>zt($(s.mount?o:a,f,e.shouldUnregister?$(a,f,[]):[])),be=(f,m,b={})=>{const E=$(i,f);let S=m;if(E){const w=E._f;w&&(!w.disabled&&V(o,f,no(m,w)),S=pr(w.ref)&&ie(m)?"":m,eo(w.ref)?[...w.ref.options].forEach(I=>I.selected=S.includes(I.value)):w.refs?jt(w.ref)?w.refs.length>1?w.refs.forEach(I=>(!I.defaultChecked||!I.disabled)&&(I.checked=Array.isArray(S)?!!S.find(j=>j===I.value):S===I.value)):w.refs[0]&&(w.refs[0].checked=!!S):w.refs.forEach(I=>I.checked=I.value===S):_n(w.ref)?w.ref.value="":(w.ref.value=S,w.ref.type||p.values.next({name:f,values:{...o}})))}(b.shouldDirty||b.shouldTouch)&&te(f,S,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&$n(f)},Ie=(f,m,b)=>{for(const E in m){const S=m[E],w=`${f}.${E}`,I=$(i,w);(l.array.has(f)||!gr(S)||I&&!I._f)&&!mt(S)?Ie(w,S,b):be(w,S,b)}},it=(f,m,b={})=>{const E=$(i,f),S=l.array.has(f),w=Fe(m);V(o,f,w),S?(p.array.next({name:f,values:{...o}}),(d.isDirty||d.dirtyFields)&&b.shouldDirty&&p.state.next({name:f,dirtyFields:kn(a,o),isDirty:P(f,w)})):E&&!E._f&&!ie(w)?Ie(f,w,b):be(f,w,b),Ka(f,l)&&p.state.next({...n}),p.values.next({name:f,values:{...o}}),!s.mount&&t()},Bt=async f=>{const m=f.target;let b=m.name,E=!0;const S=$(i,b),w=()=>m.type?Sn(S._f):rh(f),I=j=>{E=Number.isNaN(j)||j===$(o,b,j)};if(S){let j,K;const kr=w(),bt=f.type===Ba.BLUR||f.type===Ba.FOCUS_OUT,mp=!vh(S._f)&&!r.resolver&&!$(n.errors,b)&&!S._f.deps||mh(bt,$(n.touchedFields,b),n.isSubmitted,y,v),Tn=Ka(b,l,bt);V(o,b,kr),bt?(S._f.onBlur&&S._f.onBlur(f),u&&u(0)):S._f.onChange&&S._f.onChange(f);const An=te(b,kr,bt,!1),gp=!ge(An)||Tn;if(!bt&&p.values.next({name:b,type:f.type,values:{...o}}),mp)return d.isValid&&_(),gp&&p.state.next({name:b,...Tn?{}:An});if(!bt&&Tn&&p.state.next({...n}),M(!0),r.resolver){const{errors:wo}=await D([b]);if(I(kr),E){const bp=io(n.errors,i,b),xo=io(wo,i,bp.name||b);j=xo.error,b=xo.name,K=ge(wo)}}else j=(await Qa(S,o,k,r.shouldUseNativeValidation))[b],I(kr),E&&(j?K=!1:d.isValid&&(K=await ae(i,!0)));E&&(S._f.deps&&$n(S._f.deps),pe(b,K,j,An))}},xr=(f,m)=>{if($(n.errors,m)&&f.focus)return f.focus(),1},$n=async(f,m={})=>{let b,E;const S=gn(f);if(M(!0),r.resolver){const w=await se(U(f)?f:S);b=ge(w),E=f?!S.some(I=>$(w,I)):b}else f?(E=(await Promise.all(S.map(async w=>{const I=$(i,w);return await ae(I&&I._f?{[w]:I}:I)}))).every(Boolean),!(!E&&!n.isValid)&&_()):E=b=await ae(i);return p.state.next({...!Ee(f)||d.isValid&&b!==n.isValid?{}:{name:f},...r.resolver||!f?{isValid:b}:{},errors:n.errors,isValidating:!1}),m.shouldFocus&&!E&&hr(i,xr,f?S:l.mount),E},ho=f=>{const m={...a,...s.mount?o:{}};return U(f)?m:Ee(f)?$(m,f):f.map(b=>$(m,b))},po=(f,m)=>({invalid:!!$((m||n).errors,f),isDirty:!!$((m||n).dirtyFields,f),isTouched:!!$((m||n).touchedFields,f),error:$((m||n).errors,f)}),fp=f=>{f&&gn(f).forEach(m=>Z(n.errors,m)),p.state.next({errors:f?n.errors:{}})},vo=(f,m,b)=>{const E=($(i,f,{_f:{}})._f||{}).ref;V(n.errors,f,{...m,ref:E}),p.state.next({name:f,errors:n.errors,isValid:!1}),b&&b.shouldFocus&&E&&E.focus&&E.focus()},hp=(f,m)=>Ge(f)?p.values.subscribe({next:b=>f(q(void 0,m),b)}):q(f,m,!0),En=(f,m={})=>{for(const b of f?gn(f):l.mount)l.mount.delete(b),l.array.delete(b),m.keepValue||(Z(i,b),Z(o,b)),!m.keepError&&Z(n.errors,b),!m.keepDirty&&Z(n.dirtyFields,b),!m.keepTouched&&Z(n.touchedFields,b),!r.shouldUnregister&&!m.keepDefaultValue&&Z(a,b);p.values.next({values:{...o}}),p.state.next({...n,...m.keepDirty?{isDirty:P()}:{}}),!m.keepIsValid&&_()},mo=({disabled:f,name:m,field:b,fields:E,value:S})=>{if(Ke(f)){const w=f?void 0:U(S)?Sn(b?b._f:$(E,m)._f):S;V(o,m,w),te(m,w,!1,!1,!0)}},In=(f,m={})=>{let b=$(i,f);const E=Ke(m.disabled);return V(i,f,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:f}},name:f,mount:!0,...m}}),l.mount.add(f),b?mo({field:b,disabled:m.disabled,name:f}):H(f,!0,m.value),{...E?{disabled:m.disabled}:{},...r.progressive?{required:!!m.required,min:Rt(m.min),max:Rt(m.max),minLength:Rt(m.minLength),maxLength:Rt(m.maxLength),pattern:Rt(m.pattern)}:{},name:f,onChange:Bt,onBlur:Bt,ref:S=>{if(S){In(f,m),b=$(i,f);const w=U(S.value)&&S.querySelectorAll&&S.querySelectorAll("input,select,textarea")[0]||S,I=hh(w),j=b._f.refs||[];if(I?j.find(K=>K===w):w===b._f.ref)return;V(i,f,{_f:{...b._f,...I?{refs:[...j.filter(xn),w,...Array.isArray($(a,f))?[{}]:[]],ref:{type:w.type,name:f}}:{ref:w}}}),H(f,!1,void 0,w)}else b=$(i,f,{}),b._f&&(b._f.mount=!1),(r.shouldUnregister||m.shouldUnregister)&&!(ih(l.array,f)&&s.action)&&l.unMount.add(f)}}},go=()=>r.shouldFocusError&&hr(i,xr,l.mount),pp=f=>{Ke(f)&&(p.state.next({disabled:f}),hr(i,m=>{m.disabled=f},0,!1))},bo=(f,m)=>async b=>{b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let E=Fe(o);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:S,values:w}=await D();n.errors=S,E=w}else await ae(i);Z(n.errors,"root"),ge(n.errors)?(p.state.next({errors:{}}),await f(E,b)):(m&&await m({...n.errors},b),go(),setTimeout(go)),p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ge(n.errors),submitCount:n.submitCount+1,errors:n.errors})},vp=(f,m={})=>{$(i,f)&&(U(m.defaultValue)?it(f,$(a,f)):(it(f,m.defaultValue),V(a,f,m.defaultValue)),m.keepTouched||Z(n.touchedFields,f),m.keepDirty||(Z(n.dirtyFields,f),n.isDirty=m.defaultValue?P(f,$(a,f)):P()),m.keepError||(Z(n.errors,f),d.isValid&&_()),p.state.next({...n}))},_o=(f,m={})=>{const b=f?Fe(f):a,E=Fe(b),S=f&&!ge(f)?E:a;if(m.keepDefaultValues||(a=b),!m.keepValues){if(m.keepDirtyValues||g)for(const w of l.mount)$(n.dirtyFields,w)?V(S,w,$(o,w)):it(w,$(S,w));else{if(mn&&U(f))for(const w of l.mount){const I=$(i,w);if(I&&I._f){const j=Array.isArray(I._f.refs)?I._f.refs[0]:I._f.ref;if(pr(j)){const K=j.closest("form");if(K){K.reset();break}}}}i={}}o=e.shouldUnregister?m.keepDefaultValues?Fe(a):{}:Fe(S),p.array.next({values:{...S}}),p.values.next({values:{...S}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!d.isValid||!!m.keepIsValid,s.watch=!!e.shouldUnregister,p.state.next({submitCount:m.keepSubmitCount?n.submitCount:0,isDirty:m.keepDirty?n.isDirty:!!(m.keepDefaultValues&&!nt(f,a)),isSubmitted:m.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:m.keepDirtyValues?n.dirtyFields:m.keepDefaultValues&&f?kn(a,f):{},touchedFields:m.keepTouched?n.touchedFields:{},errors:m.keepErrors?n.errors:{},isSubmitSuccessful:m.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},yo=(f,m)=>_o(Ge(f)?f(o):f,m);return{control:{register:In,unregister:En,getFieldState:po,handleSubmit:bo,setError:vo,_executeSchema:D,_getWatch:q,_getDirty:P,_updateValid:_,_removeUnmounted:L,_updateFieldArray:F,_updateDisabledField:mo,_getFieldArray:le,_reset:_o,_resetDefaultValues:()=>Ge(r.defaultValues)&&r.defaultValues().then(f=>{yo(f,r.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:f=>{n={...n,...f}},_disableForm:pp,_subjects:p,_proxyFormState:d,get _fields(){return i},get _formValues(){return o},get _state(){return s},set _state(f){s=f},get _defaultValues(){return a},get _names(){return l},set _names(f){l=f},get _formState(){return n},set _formState(f){n=f},get _options(){return r},set _options(f){r={...r,...f}}},trigger:$n,register:In,handleSubmit:bo,watch:hp,setValue:it,getValues:ho,reset:yo,resetField:vp,clearErrors:fp,unregister:En,setError:vo,setFocus:(f,m={})=>{const b=$(i,f),E=b&&b._f;if(E){const S=E.refs?E.refs[0]:E.ref;S.focus&&(S.focus(),m.shouldSelect&&S.select())}},getFieldState:po}}function _r(e={}){const t=ke.useRef(),r=ke.useRef(),[n,i]=ke.useState({isDirty:!1,isValidating:!1,isLoading:Ge(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Ge(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={..._h(e,()=>i(o=>({...o}))),formState:n});const a=t.current.control;return a._options=e,lh({subject:a._subjects.state,next:o=>{sh(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),ke.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),ke.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),ke.useEffect(()=>{e.values&&!nt(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()},[e.values,a]),ke.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=oh(n,a),t.current}var ao=function(e,t,r){if(e&&"reportValidity"in e){var n=$(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},yh=function(e,t){var r=function(i){var a=t.fields[i];a&&a.ref&&"reportValidity"in a.ref?ao(a.ref,i,e):a.refs&&a.refs.forEach(function(o){return ao(o,i,e)})};for(var n in t.fields)r(n)},wh=function(e,t){t.shouldUseNativeValidation&&yh(e,t);var r={};for(var n in e){var i=$(t.fields,n),a=Object.assign(e[n]||{},{ref:i&&i.ref});if(kh(t.names||Object.keys(e),n)){var o=Object.assign({},xh($(r,n)));V(o,"root",a),V(r,n,o)}else V(r,n,a)}return r},xh=function(e){return Array.isArray(e)?e.filter(Boolean):[]},kh=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},Sh=function(e,t){for(var r={};e.issues.length;){var n=e.issues[0];if(n.path){var i=n.path.map(function(s){return s.key}).join(".");if(r[i]||(r[i]={message:n.message,type:n.validation}),t){var a=r[i].types,o=a&&a[n.validation];r[i]=Ha(i,t,r,n.validation,o?[].concat(o,n.message):n.message)}e.issues.shift()}}return r},yr=function(e,t,r){return r===void 0&&(r={}),function(n,i,a){try{return Promise.resolve(function(o,s){try{var l=function(){function u(d){return{values:r.raw?n:d,errors:{}}}var h=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return r.mode==="sync"?u(Zt(e,n,h)):Promise.resolve(hu(e,n,h)).then(u)}()}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(o){if(o instanceof Jt)return{values:{},errors:wh(Sh(o,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const oo=27,so=12,lo=10,Ch=pt("enum"),$h=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return yr(ne({checked:bi(gi(vi()),r=>Object.entries(r).filter(([n,i])=>i).map(([n,i])=>n),[Xt(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),Qt(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},Eh=Rr(({option:e,...t},r)=>c(W,{children:[c("input",{class:"peer sr-only h-full",type:"checkbox",...t,ref:r}),c("label",{class:"bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",htmlFor:t.id,children:e.label})]})),co=Ct("gutter-stable flex w-full flex-1 flex-wrap gap-3 overflow-y-auto rounded-xl p-2.5 pr-4",{variants:{variant:{singleOption:"justify-center",booleanLike:La}}}),Ih=({input:e,onSubmitSuccess:t})=>{var u,h;const r=e.key?(u=T.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,n=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,i=n&&e.config.options.length===2,{register:a,handleSubmit:o,formState:{errors:s}}=_r({defaultValues:{checked:n?{}:Ch(r)?Object.fromEntries(r.value.map(d=>[d,!0])):{}},resolver:$h(e.config)}),l=vn();return i?c("ul",{style:{maxHeight:6.5*oo+5*so+2*lo},class:co({variant:"booleanLike"}),children:e.config.options.map((d,p)=>c("li",{class:"flex-1",children:c(Da,{type:"submit",ref:g=>{g&&p===0&&(l.current=g)},label:d.label,value:"true",onClick:()=>t({type:"enum",value:[d.value]})})},d.value))}):c("form",{noValidate:!0,onSubmit:d=>o(p=>{const g=p.checked;t({type:"enum",value:g})})(d),children:[c("div",{class:"flex items-center gap-1",children:[c("ul",{style:{maxHeight:6.5*oo+5*so+2*lo},class:co({variant:e.config.options.length===1?"singleOption":void 0}),children:e.config.options.map((d,p)=>{const g=`checked.${d.value}`,{ref:v,...y}=a(g);return c("li",{class:"relative",children:c(Eh,{option:d,autoFocus:p===0,ref:k=>{k&&p===0&&(l.current=k),v(k)},id:g,...y,onClick:n?()=>t({type:"enum",value:[d.value]}):void 0})},d.value)})}),c("div",{class:"flex flex-col items-center gap-2 pr-2.5 pt-2.5",children:[n?null:c(tt,{}),e.config.minSelected===0&&c(rt,{type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),c("div",{class:"px-1",children:c(vt,{error:(h=s.checked)==null?void 0:h.root})})]})},Th=pt("number"),Ah=(e,t)=>{const r=e.min??Number.MIN_SAFE_INTEGER,n=e.max??Number.MAX_SAFE_INTEGER,i=e.decimalCases??0;return yr(ne({number:Or(t("validation_number"),[yu(r,t("validation_number_min",{min:r})),_u(n,t("validation_number_max",{max:n})),gu(a=>a===Number(a.toFixed(i)),t("validation_number_decimal_cases",{count:i}))])}))},Mh=({input:e,onSubmitSuccess:t})=>{var d;const r=e.config.defaultValue,n=e.key?(d=T.current$.value.flow)==null?void 0:d.data.submissions[e.key]:void 0,{t:i}=he(),{register:a,handleSubmit:o,formState:{errors:s}}=_r({defaultValues:{number:r?Number(r):Th(n)?n.value:void 0},resolver:Ah(e.config,i)}),{ref:l,...u}=a("number",{required:!e.config.optional,valueAsNumber:!0}),h=de();return ue(()=>{h.current&&(h.current.focus(),h.current.select())},[]),c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:o(p=>{p.number!==void 0&&t({type:"number",value:p.number})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-grow",children:[c("input",{...u,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:p=>{p&&(h.current=p),l(p)},type:"text",min:e.config.min,max:e.config.max,class:Vt({optional:e.config.optional,className:"[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"}),placeholder:e.config.placeholder}),e.config.optional&&c(rt,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),c(tt,{})]}),c(vt,{error:s.number})]})},Nh=e=>{if(e==="")return{countryCode:"",phoneNumber:""};const t=Object.entries(pn).find(i=>e.startsWith(i[1])),r=t?t[1]:"",n=e.replace(r,"");return/^\d+$/.test(n)?{countryCode:r,phoneNumber:n}:{countryCode:"",phoneNumber:""}},Ph="44",Oh=pt("string"),Fh=pt("phone"),Lh=e=>{const t=X(e("validation_country_code"),[_i(/^\+?[0-9 -]+$/,e("validation_country_code"))]);return yr(ne({countryCode:t,phoneNumber:bi(X(e("validation_phone"),[_i(/^\+?[0-9 -]+$/,e("validation_phone"))]),r=>r.replace(/[^0-9]/g,""),[])}))},Dh=({input:e,onSubmitSuccess:t})=>{var y;const r=e.key?(y=T.current$.value.flow)==null?void 0:y.data.submissions[e.key]:void 0,{t:n}=he(),[i,a]=me(),o=Oh(r)?Nh(r.value):Fh(r)?r.value:void 0,{register:s,handleSubmit:l,formState:{errors:u},watch:h}=_r({defaultValues:{countryCode:(o==null?void 0:o.countryCode)??e.config.defaultValue.countryCode??Ph,phoneNumber:(o==null?void 0:o.phoneNumber)??e.config.defaultValue.phoneNumber??""},resolver:Lh(n)}),{ref:d,...p}=s("phoneNumber",{required:!e.config.optional}),g=de(),v=h("countryCode");return ue(()=>{g.current&&(g.current.focus(),g.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:l(k=>{const x=k.phoneNumber.replace(/[^0-9]/g,""),_=k.countryCode.replace(/[^0-9]/g,"");if(a(void 0),x.length+_.length>(e.config.maxChars||Number.POSITIVE_INFINITY))return a(n("validation_max_chars",{count:e.config.maxChars??999}));if(x.length+_.length<(e.config.minChars||0))return a(n("validation_min_chars",{count:e.config.minChars??1}));e.config.submissionFormat==="phone"?t({type:"phone",value:{countryCode:_,phoneNumber:x}}):t({type:"string",value:v+k.phoneNumber})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative flex min-w-0 flex-1 flex-grow gap-2",children:[c("label",{class:"text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",htmlFor:`isdk_phone_${e.key}`,children:[c("span",{children:["+",v]}),c("select",{...s("countryCode",{}),id:`isdk_phone_${e.key}`,class:"absolute inset-0 opacity-0",children:Object.entries(pn).map(([k,x])=>c("option",{value:x,children:[k," (+",x,")"]},k))})]}),c("input",{...p,id:"chat-input",type:"tel",inputMode:"tel",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:k=>{k&&(g.current=k),d(k)},class:Vt({optional:e.config.optional,className:"flex-1 rounded-r-full"}),placeholder:e.config.placeholder}),e.config.optional&&c(rt,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),c(tt,{})]}),c(vt,{error:u.countryCode||u.phoneNumber||{message:i}})]})},Vh=({input:e,onSubmitSuccess:t})=>c("div",{class:"flex flex-col items-center py-3",children:c("button",{class:"bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2",name:e.key,onClick:()=>{t(null)},children:c("span",{class:"flex items-center gap-1.5",children:[c("span",{class:"inline-flex items-center text-sm font-medium",children:e.config.label||"Submit"}),c("svg",{stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M4 8L8 4L12 8"}),c("path",{d:"M8 4V13"})]})]})})}),Cn={empty:"Please enter some text",email:"That doesn’t look like a valid email address",phone:"That doesn’t look like a valid phone number",url:"That doesn’t look like a valid URL"},jh={email:{type:"email",inputMode:"email",formNoValidate:!0},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},zh=pt("string"),Rh=(e,t)=>{const r={maxLength:t("validation_max_chars",{count:e.maxChars??999}),minLength:t("validation_min_chars",{count:e.minChars??1})};return yr(ne({text:{email:X(Cn.email,[bu(Cn.email),Qt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength)]),text:X([Qt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength)]),url:X([wu(Cn.url),Qt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength)])}[e.format]}))},Bh={text:({input:e,onSubmitSuccess:t})=>{var d;const{t:r}=he(),n=e.key?(d=T.current$.value.flow)==null?void 0:d.data.submissions[e.key]:void 0,i=e.config.defaultValue,{register:a,handleSubmit:o,formState:{errors:s}}=_r({defaultValues:{text:i||(zh(n)?n.value:"")},resolver:Rh(e.config,r)}),{ref:l,...u}=a("text",{required:!e.config.optional}),h=de();return ue(()=>{h.current&&(h.current.focus(),h.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:o(p=>{t({type:"string",value:p.text})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-1",children:[c("input",{id:"chat-input",...u,...jh[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:p=>{p&&(h.current=p),l(p)},placeholder:e.config.placeholder,class:Vt({optional:!!e.config.optional,className:"w-full rounded-full"})}),e.config.optional&&c(rt,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),c(tt,{})]}),c(vt,{error:s.text})]})},phone:Dh,"multiple-choice":Ih,boolean:Wf,file:th,submit:Vh,address:Uf,number:Mh},Uh=({logger:e})=>{var a;const t=(a=T.current$.value.flow)==null?void 0:a.data.currentInput,[r,n]=Mf(),i=de(null);return T.inputHeight$.value=n.height,ye(()=>{const o=i.current;if(o)return o.addEventListener("transitionstart",ee.scrollToEnd.smooth),o.addEventListener("transitioncancel",ee.scrollToEnd.smooth),o.addEventListener("transitionend",ee.scrollToEnd.smooth),()=>{o.removeEventListener("transitionstart",ee.scrollToEnd.smooth),o.removeEventListener("transitioncancel",ee.scrollToEnd.smooth),o.removeEventListener("transitionend",ee.scrollToEnd.smooth)}},[]),c("div",{ref:i,class:"ease-expo-out absolute bottom-0 w-full overflow-hidden rounded-b-3xl backdrop-blur-xl transition-all duration-700 will-change-[height]",style:{height:n.height},children:c("div",{ref:r,class:"border-divider flex flex-col justify-end border-t",children:t?(()=>{const o=Bh[t.type];return c(o,{logger:e,onSubmitSuccess:ee.onSubmitSuccessFn$.value,input:t})})():c("div",{class:"flex items-center gap-2 p-2.5",children:[c("input",{"aria-hidden":"true",id:"chat-input",class:Vt({optional:!1,className:"flex-grow rounded-full"}),disabled:!0}),c(tt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})})})};var Hh=function(e){return e instanceof RegExp},qh=function(t){var r=/[\\^$.*+?()[\]{}|]/g,n=RegExp(r.source);return t&&n.test(t)?t.replace(r,"\\$&"):t},uo=function(e){return typeof e=="string"},Kh=function(e){var t=[];return e.forEach(function(r){Array.isArray(r)?t=t.concat(r):t.push(r)}),t};function Gh(e,t,r){var n=0,i=0;if(e==="")return e;if(!e||!uo(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var a=t;Hh(a)||(a=new RegExp("("+qh(a)+")","gi"));for(var o=e.split(a),s=1,l=o.length;s<l;s+=2){if(o[s]===void 0||o[s-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}i=o[s].length,n+=o[s-1].length,o[s]=r(o[s],s,n),n+=i}return o}var Wh=function(t,r,n){return Array.isArray(t)||(t=[t]),Kh(t.map(function(i){return uo(i)?Gh(i,r,n):i}))};const wr=Te(Wh),Yh=/(\[[^\]]+\]\([^)]+\))/g,Jh=/\[([^\]]+)\]\(([^)]+)\)/,Zh=/(https?:\/\/[^\s]+)/g,Xh=/_(.*?)_/g,Qh=/\*\*(.*?)\*\*/g,fo="text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline",ep=e=>{const t=wr(e,Yh,(a,o)=>{const[,s,l]=a.match(Jh)??[];return l?c("a",{class:fo,href:l,children:s??l},l+o):c("span",{children:"INVALID LINK"})}),r=wr(t,Zh,(a,o)=>c("a",{class:fo,href:a,children:a},a+o)),n=wr(r,Xh,(a,o)=>c("em",{children:a},a+o));return wr(n,Qh,(a,o)=>c("strong",{children:a},a+o))},tp=Ct("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative",{variants:{side:{left:"bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",right:"ml-auto bg-accent-9 text-white rounded-br-md shadow-surface-sm shadow-bubble-strong-shadow"},animate:{true:"animate-bubble-in",false:""}},defaultVariants:{side:"left"}}),rp=({children:e,className:t,animate:r,side:n,...i})=>c("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:tp({className:t,side:n,animate:r}),...i,children:e}),np=({message:e})=>c("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:c("a",{onClick:e.onClick,class:"bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:e.href,children:[e.text,c("svg",{class:"flex-none",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})}),ip=({className:e,...t})=>(ye(()=>{ee.scrollToEnd.smooth()}),c("div",{"aria-hidden":!0,children:ee.isBotTyping$.value===!0?c("div",{"aria-label":"Typing…",class:Je("flex gap-1 p-4",e),...t,children:Array.from({length:3},(r,n)=>c("div",{class:"bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-n*200}ms`}}))}):void 0})),ap={bot:"left",user:"right"},op=Ct("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),sp=({lastSentMessageFooter:e})=>{var r;const t=((r=T.current$.value.flow)==null?void 0:r.data.messages)??[];return ye(()=>{ee.scrollToEnd.smooth()},[t.length]),c("ol",{"aria-label":"Chat messages",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[t.map((n,i)=>c(W,{children:c("li",{class:"flex",children:Qe(n).with({type:"system"},a=>c("p",{class:op({variant:a.variant}),children:a.text})).with({type:"text",author:A.union("bot","user")},a=>{const o=a.author==="user"&&!t.slice(i+1).some(u=>u.type==="text"&&u.author==="user"),s=i===t.length-1,l=a.author==="bot"?ep(a.text):a.text;return c(rp,{animate:s,side:ap[a.author],children:[l,o?e:null]},i)}).with({type:"link"},a=>c(np,{message:a})).with({type:"image"},a=>c("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:a.url,style:{aspectRatio:a.width/a.height}})).with({type:"file"},a=>c(Xf,{class:a.author==="bot"?void 0:"ml-auto",file:{name:a.fileName,sizeKb:a.fileSizeKb}})).with({type:"loading"},a=>{const o=t[t.length-1];return!(a===o)||ee.isBotTyping$.value?null:c("div",{class:"flex flex-grow flex-col items-center justify-center",children:c(_a,{class:"text-neutral-6 h-8 w-8"})})}).exhaustive()})},i)),c(ip,{},"typing")]})},lp=({logger:e,apiClient:t,analytics:r})=>{const{flow:n}=T.current$.value;we(n,"Flow is required to exist to show chatbot body");const i=T.viewState$.value,{chatRef:a,chatService:o}=Df(),{t:s}=he(),[l,u]=me();return ue(()=>{i==="maximised"&&ee.scrollToEnd.instant()},[i]),ue(()=>{var k,x;const{state:h,flow:d}=T.current$.peek();if(h!=="loaded")throw new Error(s("invalid_state"));let p=d.data.nodeHistory.at(-1);if(ee.scrollToEnd.instant(),T.setInput(void 0),d.data.isFinished)return;p===void 0?(p=pa(n.nodes).id,T.setCurrentNodeId(p),r.log({event:"FLOW_START",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:d.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(k=n.analytics)==null?void 0:k.customProperties})):T.removeMessagesSentByNodeIds([p]);const{interpret:g,abort:v,undo:y}=df({context:n.context,analytics:{service:r,customProperties:(x=n.analytics)==null?void 0:x.customProperties},apiClient:t,logger:e,flow:n,chatService:o,t:s,getSubmissions:()=>{var _;return(_=T.current$.peek().flow)==null?void 0:_.data.submissions},onInterpret:(_,M)=>{var N;const F=T.current$.peek().flow;we(F),M&&(F.data.sequence=F.data.sequence+1,r.log({event:"FLOW_NODE",properties:{flow_id:n.id,flow_version:n.version,from_node_id:M.id,flow_build:n.build,to_node_id:_.id,sequence:F.data.sequence,flow_session_id:F.data.flowSessionId,job:n.job},customProperties:(N=n.analytics)==null?void 0:N.customProperties})),T.setCurrentNodeId(_.id)},onFlowEnd:async()=>{var M;T.markAsFinished();const _=T.current$.peek().flow;we(_),r.log({event:"FLOW_END",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:_.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(M=n.analytics)==null?void 0:M.customProperties})}});return u(()=>y),g(p),v},[r,t,o,e,n,s]),c(W,{children:[c("div",{ref:a,className:"hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",style:{WebkitOverflowScrolling:"touch",paddingBottom:T.inputHeight$.value},children:c(sp,{lastSentMessageFooter:n.data.isFinished||!l?null:c(up,{undoFn:l})})}),c(Uh,{logger:e})]})},cp=e=>"key"in e.data&&e.data.key?[e.data.key]:"keys"in e.data?Object.values(e.data.keys).filter(t=>typeof t=="string"):[],up=({undoFn:e})=>{const{t}=he();return c("div",{class:"absolute bottom-0 right-0 flex w-full translate-y-full justify-end",children:c("button",{class:"fr touch-hitbox text-neutral-9 hover:text-neutral-12 rounded-full p-1 text-right text-xs transition-all",onClick:async()=>{const{flow:r}=T.current$.peek();we(r);const{removed:n}=e(r.data.nodeHistory),i=r.data.nodeHistory.splice(-n);i.length!==0&&(T.removeMessagesSentByNodeIds(i),T.setInput(void 0),i.pop(),i.map(a=>r.nodes.find(o=>o.id===a)).filter(Boolean).flatMap(cp).forEach(a=>delete r.data.submissions[a]),T.current$.value={...T.current$.value})},children:t("undo")})})},dp=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:lp},Symbol.toStringTag,{value:"Module"}))})();