@inploi/plugin-chatbot 3.20.3 → 3.21.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,4 +1,4 @@
1
- var fm=Object.defineProperty;var pm=(et,ge,Ve)=>ge in et?fm(et,ge,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):et[ge]=Ve;var Ns=(et,ge,Ve)=>(pm(et,typeof ge!="symbol"?ge+"":ge,Ve),Ve);(function(){"use strict";var et=e=>e,ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms=Array.isArray,Hr=Ms,Fs=typeof ge=="object"&&ge&&ge.Object===Object&&ge,Ls=Fs,Rs=Ls,Vs=typeof self=="object"&&self&&self.Object===Object&&self,js=Rs||Vs||Function("return this")(),qr=js,Bs=qr,zs=Bs.Symbol,Kr=zs,gi=Kr,yi=Object.prototype,Us=yi.hasOwnProperty,Hs=yi.toString,Tt=gi?gi.toStringTag:void 0;function qs(e){var t=Us.call(e,Tt),r=e[Tt];try{e[Tt]=void 0;var n=!0}catch{}var o=Hs.call(e);return n&&(t?e[Tt]=r:delete e[Tt]),o}var Ks=qs,Ws=Object.prototype,Gs=Ws.toString;function Ys(e){return Gs.call(e)}var Zs=Ys,_i=Kr,Xs=Ks,Qs=Zs,Js="[object Null]",el="[object Undefined]",wi=_i?_i.toStringTag:void 0;function tl(e){return e==null?e===void 0?el:Js:wi&&wi in Object(e)?Xs(e):Qs(e)}var xi=tl;function rl(e){return e!=null&&typeof e=="object"}var nl=rl,il=xi,ol=nl,al="[object Symbol]";function sl(e){return typeof e=="symbol"||ol(e)&&il(e)==al}var Wr=sl,ll=Hr,cl=Wr,ul=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dl=/^\w*$/;function fl(e,t){if(ll(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||cl(e)?!0:dl.test(e)||!ul.test(e)||t!=null&&e in Object(t)}var pl=fl;function hl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ki=hl,vl=xi,ml=ki,bl="[object AsyncFunction]",gl="[object Function]",yl="[object GeneratorFunction]",_l="[object Proxy]";function wl(e){if(!ml(e))return!1;var t=vl(e);return t==gl||t==yl||t==bl||t==_l}var xl=wl,kl=qr,$l=kl["__core-js_shared__"],Sl=$l,Gr=Sl,$i=function(){var e=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Cl(e){return!!$i&&$i in e}var El=Cl,Pl=Function.prototype,Ol=Pl.toString;function Il(e){if(e!=null){try{return Ol.call(e)}catch{}try{return e+""}catch{}}return""}var Al=Il,Tl=xl,Dl=El,Nl=ki,Ml=Al,Fl=/[\\^$.*+?()[\]{}|]/g,Ll=/^\[object .+?Constructor\]$/,Rl=Function.prototype,Vl=Object.prototype,jl=Rl.toString,Bl=Vl.hasOwnProperty,zl=RegExp("^"+jl.call(Bl).replace(Fl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ul(e){if(!Nl(e)||Dl(e))return!1;var t=Tl(e)?zl:Ll;return t.test(Ml(e))}var Hl=Ul;function ql(e,t){return e==null?void 0:e[t]}var Kl=ql,Wl=Hl,Gl=Kl;function Yl(e,t){var r=Gl(e,t);return Wl(r)?r:void 0}var Si=Yl,Zl=Si,Xl=Zl(Object,"create"),tr=Xl,Ci=tr;function Ql(){this.__data__=Ci?Ci(null):{},this.size=0}var Jl=Ql;function ec(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var tc=ec,rc=tr,nc="__lodash_hash_undefined__",ic=Object.prototype,oc=ic.hasOwnProperty;function ac(e){var t=this.__data__;if(rc){var r=t[e];return r===nc?void 0:r}return oc.call(t,e)?t[e]:void 0}var sc=ac,lc=tr,cc=Object.prototype,uc=cc.hasOwnProperty;function dc(e){var t=this.__data__;return lc?t[e]!==void 0:uc.call(t,e)}var fc=dc,pc=tr,hc="__lodash_hash_undefined__";function vc(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=pc&&t===void 0?hc:t,this}var mc=vc,bc=Jl,gc=tc,yc=sc,_c=fc,wc=mc;function ut(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])}}ut.prototype.clear=bc,ut.prototype.delete=gc,ut.prototype.get=yc,ut.prototype.has=_c,ut.prototype.set=wc;var xc=ut;function kc(){this.__data__=[],this.size=0}var $c=kc;function Sc(e,t){return e===t||e!==e&&t!==t}var Cc=Sc,Ec=Cc;function Pc(e,t){for(var r=e.length;r--;)if(Ec(e[r][0],t))return r;return-1}var rr=Pc,Oc=rr,Ic=Array.prototype,Ac=Ic.splice;function Tc(e){var t=this.__data__,r=Oc(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ac.call(t,r,1),--this.size,!0}var Dc=Tc,Nc=rr;function Mc(e){var t=this.__data__,r=Nc(t,e);return r<0?void 0:t[r][1]}var Fc=Mc,Lc=rr;function Rc(e){return Lc(this.__data__,e)>-1}var Vc=Rc,jc=rr;function Bc(e,t){var r=this.__data__,n=jc(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var zc=Bc,Uc=$c,Hc=Dc,qc=Fc,Kc=Vc,Wc=zc;function dt(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])}}dt.prototype.clear=Uc,dt.prototype.delete=Hc,dt.prototype.get=qc,dt.prototype.has=Kc,dt.prototype.set=Wc;var Gc=dt,Yc=Si,Zc=qr,Xc=Yc(Zc,"Map"),Qc=Xc,Ei=xc,Jc=Gc,eu=Qc;function tu(){this.size=0,this.__data__={hash:new Ei,map:new(eu||Jc),string:new Ei}}var ru=tu;function nu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var iu=nu,ou=iu;function au(e,t){var r=e.__data__;return ou(t)?r[typeof t=="string"?"string":"hash"]:r.map}var nr=au,su=nr;function lu(e){var t=su(this,e).delete(e);return this.size-=t?1:0,t}var cu=lu,uu=nr;function du(e){return uu(this,e).get(e)}var fu=du,pu=nr;function hu(e){return pu(this,e).has(e)}var vu=hu,mu=nr;function bu(e,t){var r=mu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var gu=bu,yu=ru,_u=cu,wu=fu,xu=vu,ku=gu;function ft(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])}}ft.prototype.clear=yu,ft.prototype.delete=_u,ft.prototype.get=wu,ft.prototype.has=xu,ft.prototype.set=ku;var $u=ft,Pi=$u,Su="Expected a function";function Yr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Su);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(Yr.Cache||Pi),r}Yr.Cache=Pi;var Cu=Yr,Eu=Cu,Pu=500;function Ou(e){var t=Eu(e,function(n){return r.size===Pu&&r.clear(),n}),r=t.cache;return t}var Iu=Ou,Au=Iu,Tu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Du=/\\(\\)?/g,Nu=Au(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Tu,function(r,n,o,i){t.push(o?i.replace(Du,"$1"):n||r)}),t}),Mu=Nu;function Fu(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 Lu=Fu,Oi=Kr,Ru=Lu,Vu=Hr,ju=Wr,Bu=1/0,Ii=Oi?Oi.prototype:void 0,Ai=Ii?Ii.toString:void 0;function Ti(e){if(typeof e=="string")return e;if(Vu(e))return Ru(e,Ti)+"";if(ju(e))return Ai?Ai.call(e):"";var t=e+"";return t=="0"&&1/e==-Bu?"-0":t}var zu=Ti,Uu=zu;function Hu(e){return e==null?"":Uu(e)}var qu=Hu,Ku=Hr,Wu=pl,Gu=Mu,Yu=qu;function Zu(e,t){return Ku(e)?e:Wu(e,t)?[e]:Gu(Yu(e))}var Xu=Zu,Qu=Wr,Ju=1/0;function ed(e){if(typeof e=="string"||Qu(e))return e;var t=e+"";return t=="0"&&1/e==-Ju?"-0":t}var td=ed,rd=Xu,nd=td;function id(e,t){t=rd(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[nd(t[r++])];return r&&r==n?e:void 0}var od=id,ad=od;function sd(e,t,r){var n=e==null?void 0:ad(e,t);return n===void 0?r:n}var ld=sd;const Dt=Ve(ld);var Nt,S,Di,Ni,tt,Mi,Fi,Zr,Li,pt={},Ri=[],cd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ir=Array.isArray;function Te(e,t){for(var r in t)e[r]=t[r];return e}function Vi(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?Nt.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 Mt(e,a,n,o,null)}function Mt(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??++Di};return o==null&&S.vnode!=null&&S.vnode(i),i}function ji(){return{current:null}}function G(e){return e.children}function ye(e,t){this.props=e,this.context=t}function or(e,t){if(t==null)return e.__?or(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"?or(e):null}function Bi(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 Bi(e)}}function Xr(e){(!e.__d&&(e.__d=!0)&&tt.push(e)&&!ar.__r++||Mi!==S.debounceRendering)&&((Mi=S.debounceRendering)||Fi)(ar)}function ar(){var e,t,r,n,o,i,a,s,l;for(tt.sort(Zr);e=tt.shift();)e.__d&&(t=tt.length,n=void 0,o=void 0,i=void 0,s=(a=(r=e).__v).__e,(l=r.__P)&&(n=[],o=[],(i=Te({},a)).__v=a.__v+1,Qr(l,a,i,r.__n,l.ownerSVGElement!==void 0,a.__h!=null?[s]:null,n,s??or(a),a.__h,o),Gi(n,a,o),a.__e!=s&&Bi(a)),tt.length>t&&tt.sort(Zr));ar.__r=0}function zi(e,t,r,n,o,i,a,s,l,u,p){var c,v,g,m,h,w,k,_,O,A,P=0,U=n&&n.__k||Ri,q=U.length,N=q,M=t.length;for(r.__k=[],c=0;c<M;c++)(m=r.__k[c]=(m=t[c])==null||typeof m=="boolean"||typeof m=="function"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?Mt(null,m,null,null,m):ir(m)?Mt(G,{children:m},null,null,null):m.__b>0?Mt(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null&&(m.__=r,m.__b=r.__b+1,(_=ud(m,U,k=c+P,N))===-1?g=pt:(g=U[_]||pt,U[_]=void 0,N--),Qr(e,m,g,o,i,a,s,l,u,p),h=m.__e,(v=m.ref)&&g.ref!=v&&(g.ref&&Jr(g.ref,null,m),p.push(v,m.__c||h,m)),h!=null&&(w==null&&(w=h),A=!(O=g===pt||g.__v===null)&&_===k,O?_==-1&&P--:_!==k&&(_===k+1?(P++,A=!0):_>k?N>M-k?(P+=_-k,A=!0):P--:P=_<k&&_==k-1?_-k:0),k=c+P,A=A||_==c&&!O,typeof m.type!="function"||_===k&&g.__k!==m.__k?typeof m.type=="function"||A?m.__d!==void 0?(l=m.__d,m.__d=void 0):l=h.nextSibling:l=Hi(e,h,l):l=Ui(m,l,e),typeof r.type=="function"&&(r.__d=l)));for(r.__e=w,c=q;c--;)U[c]!=null&&(typeof r.type=="function"&&U[c].__e!=null&&U[c].__e==r.__d&&(r.__d=U[c].__e.nextSibling),Yi(U[c],U[c]))}function Ui(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"?Ui(n,t,r):Hi(r,n.__e,t));return t}function De(e,t){return t=t||[],e==null||typeof e=="boolean"||(ir(e)?e.some(function(r){De(r,t)}):t.push(e)),t}function Hi(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 ud(e,t,r,n){var o=e.key,i=e.type,a=r-1,s=r+1,l=t[r];if(l===null||l&&o==l.key&&i===l.type)return r;if(n>(l!=null?1:0))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&o==l.key&&i===l.type)return a;a--}if(s<t.length){if((l=t[s])&&o==l.key&&i===l.type)return s;s++}}return-1}function dd(e,t,r,n,o){var i;for(i in r)i==="children"||i==="key"||i in t||sr(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]||sr(e,i,t[i],r[i],n)}function qi(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||cd.test(t)?r:r+"px"}function sr(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||qi(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||qi(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?Wi:Ki,i):e.removeEventListener(t,i?Wi:Ki,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 Ki(e){return this.l[e.type+!1](S.event?S.event(e):e)}function Wi(e){return this.l[e.type+!0](S.event?S.event(e):e)}function Qr(e,t,r,n,o,i,a,s,l,u){var p,c,v,g,m,h,w,k,_,O,A,P,U,q,N,M=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(l=r.__h,s=t.__e=r.__e,t.__h=null,i=[s]),(p=S.__b)&&p(t);try{e:if(typeof M=="function"){if(k=t.props,_=(p=M.contextType)&&n[p.__c],O=p?_?_.props.value:p.__:n,r.__c?w=(c=t.__c=r.__c).__=c.__E:("prototype"in M&&M.prototype.render?t.__c=c=new M(k,O):(t.__c=c=new ye(k,O),c.constructor=M,c.render=pd),_&&_.sub(c),c.props=k,c.state||(c.state={}),c.context=O,c.__n=n,v=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),M.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=Te({},c.__s)),Te(c.__s,M.getDerivedStateFromProps(k,c.__s))),g=c.props,m=c.state,c.__v=t,v)M.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(M.getDerivedStateFromProps==null&&k!==g&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(k,O),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(k,c.__s,O)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(c.props=k,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(oe){oe&&(oe.__=t)}),A=0;A<c._sb.length;A++)c.__h.push(c._sb[A]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(k,c.__s,O),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(g,m,h)})}if(c.context=O,c.props=k,c.__P=e,c.__e=!1,P=S.__r,U=0,"prototype"in M&&M.prototype.render){for(c.state=c.__s,c.__d=!1,P&&P(t),p=c.render(c.props,c.state,c.context),q=0;q<c._sb.length;q++)c.__h.push(c._sb[q]);c._sb=[]}else do c.__d=!1,P&&P(t),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++U<25);c.state=c.__s,c.getChildContext!=null&&(n=Te(Te({},n),c.getChildContext())),v||c.getSnapshotBeforeUpdate==null||(h=c.getSnapshotBeforeUpdate(g,m)),zi(e,ir(N=p!=null&&p.type===G&&p.key==null?p.props.children:p)?N:[N],t,r,n,o,i,a,s,l,u),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),w&&(c.__E=c.__=null)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=fd(r.__e,t,r,n,o,i,a,l,u);(p=S.diffed)&&p(t)}catch(oe){t.__v=null,(l||i!=null)&&(t.__e=s,t.__h=!!l,i[i.indexOf(s)]=null),S.__e(oe,t,r)}}function Gi(e,t,r){for(var n=0;n<r.length;n++)Jr(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 fd(e,t,r,n,o,i,a,s,l){var u,p,c,v=r.props,g=t.props,m=t.type,h=0;if(m==="svg"&&(o=!0),i!=null){for(;h<i.length;h++)if((u=i[h])&&"setAttribute"in u==!!m&&(m?u.localName===m:u.nodeType===3)){e=u,i[h]=null;break}}if(e==null){if(m===null)return document.createTextNode(g);e=o?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),i=null,s=!1}if(m===null)v===g||s&&e.data===g||(e.data=g);else{if(i=i&&Nt.call(e.childNodes),p=(v=r.props||pt).dangerouslySetInnerHTML,c=g.dangerouslySetInnerHTML,!s){if(i!=null)for(v={},h=0;h<e.attributes.length;h++)v[e.attributes[h].name]=e.attributes[h].value;(c||p)&&(c&&(p&&c.__html==p.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(dd(e,g,v,o,s),c)t.__k=[];else if(zi(e,ir(h=t.props.children)?h:[h],t,r,n,o&&m!=="foreignObject",i,a,i?i[0]:r.__k&&or(r,0),s,l),i!=null)for(h=i.length;h--;)i[h]!=null&&Vi(i[h]);s||("value"in g&&(h=g.value)!==void 0&&(h!==e.value||m==="progress"&&!h||m==="option"&&h!==v.value)&&sr(e,"value",h,v.value,!1),"checked"in g&&(h=g.checked)!==void 0&&h!==e.checked&&sr(e,"checked",h,v.checked,!1))}return e}function Jr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){S.__e(n,r)}}function Yi(e,t,r){var n,o;if(S.unmount&&S.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Jr(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]&&Yi(n[o],t,r||typeof e.type!="function");r||e.__e==null||Vi(e.__e),e.__=e.__e=e.__d=void 0}function pd(e,t,r){return this.constructor(e,r)}function ht(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=[],Qr(t,e=(!n&&r||t).__k=D(G,null,[e]),o||pt,pt,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?Nt.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),Gi(i,e,a)}function Zi(e,t){ht(e,t,Zi)}function hd(e,t,r){var n,o,i,a,s=Te({},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?Nt.call(arguments,2):r),Mt(e.type,s,n||e.key,o||e.ref,null)}function Ft(e,t){var r={__c:t="__cC"+Li++,__: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,Xr(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}Nt=Ri.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}},Di=0,Ni=function(e){return e!=null&&e.constructor===void 0},ye.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Te({},this.state),typeof e=="function"&&(e=e(Te({},r),this.props)),e&&Te(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Xr(this))},ye.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xr(this))},ye.prototype.render=G,tt=[],Fi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zr=function(e,t){return e.__v.__b-t.__v.__b},ar.__r=0,Li=0;var en=class extends Error{constructor(t){super(t[0].message);Ns(this,"issues");this.name="ValiError",this.issues=t}};function Xi(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function Lt(e){return{issues:e}}function se(e){return{output:e}}function vd(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 md(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 je(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return se(e);let o,i,a=e;for(const s of t){const l=s._parse(a);if(l.issues){o=o||md(r,n);for(const u of l.issues){const p=vd(o,u);i?i.push(p):i=[p]}if(o.abortEarly||o.abortPipeEarly)break}else a=l.output}return i?Lt(i):se(a)}function Be(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function Qi(e){return typeof e=="function"?e():e}function ze(e,t,r,n){return Lt([{validation:e,message:Qi(t),input:r,requirement:n}])}function bd(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[i,a]=Be(t,r);return[e,i,a]}const[n,o]=Be(e,t);return[void 0,n,o]}function Ne(e,t,r,n,o,i){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:Qi(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 Ji(e){return typeof e.default=="function"?e.default():e.default}function eo(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return je(t,this.pipe,r,"any")}}}function to(e,t,r){const[n="Invalid type",o]=Be(t,r);return{type:"array",async:!1,item:e,message:n,pipe:o,_parse(i,a){if(!Array.isArray(i))return Ne(a,"type","array",this.message,i);let s;const l=[];for(let u=0;u<i.length;u++){const p=i[u],c=this.item._parse(p,a);if(c.issues){const v={type:"array",input:i,key:u,value:p};for(const g of c.issues)g.path?g.path.unshift(v):g.path=[v],s==null||s.push(g);if(s||(s=c.issues),a!=null&&a.abortEarly)break}else l.push(c.output)}return s?Lt(s):je(l,this.pipe,a,"array")}}}function ro(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="boolean"?Ne(i,"type","boolean",this.message,o):je(o,this.pipe,i,"boolean")}}}function no(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):se(r)}}}function gd(e,t){return{type:"nullable",async:!1,wrapped:e,default:t,_parse(r,n){if(r===null){const o=Ji(this);if(o===void 0)return se(r);r=o}return this.wrapped._parse(r,n)}}}function tn(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="number"||isNaN(o)?Ne(i,"type","number",this.message,o):je(o,this.pipe,i,"number")}}}function Se(e,t,r,n){const[o,i="Invalid type",a]=bd(t,r,n);let s;return{type:"object",async:!1,entries:e,rest:o,message:i,pipe:a,_parse(l,u){if(!l||typeof l!="object")return Ne(u,"type","object",this.message,l);s=s||Object.entries(this.entries);let p;const c={};for(const[v,g]of s){const m=l[v],h=g._parse(m,u);if(h.issues){const w={type:"object",input:l,key:v,value:m};for(const k of h.issues)k.path?k.path.unshift(w):k.path=[w],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}else(h.output!==void 0||v in l)&&(c[v]=h.output)}if(this.rest&&!(u!=null&&u.abortEarly&&p)){for(const v in l)if(!(v in this.entries)){const g=l[v],m=this.rest._parse(g,u);if(m.issues){const h={type:"object",input:l,key:v,value:g};for(const w of m.issues)w.path?w.path.unshift(h):w.path=[h],p==null||p.push(w);if(p||(p=m.issues),u!=null&&u.abortEarly)break}else c[v]=m.output}}return p?Lt(p):je(c,this.pipe,u,"object")}}}function yd(e,t){return{type:"optional",async:!1,wrapped:e,default:t,_parse(r,n){if(r===void 0){const o=Ji(this);if(o===void 0)return se(r);r=o}return this.wrapped._parse(r,n)}}}function _d(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?se(r):Ne(n,"type","picklist",this.message,r)}}}function he(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="string"?Ne(i,"type","string",this.message,o):je(o,this.pipe,i,"string")}}}function wd(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[a,s]=Be(r,n);return[e,t,a,s]}const[o,i]=Be(t,r);return[he(),e,o,i]}var xd=["__proto__","prototype","constructor"];function rn(e,t,r,n){const[o,i,a="Invalid type",s]=wd(e,t,r,n);return{type:"record",async:!1,key:o,value:i,message:a,pipe:s,_parse(l,u){if(!l||typeof l!="object")return Ne(u,"type","record",this.message,l);let p;const c={};for(const[v,g]of Object.entries(l))if(!xd.includes(v)){let m;const h=this.key._parse(v,{origin:"key",abortEarly:u==null?void 0:u.abortEarly,abortPipeEarly:u==null?void 0:u.abortPipeEarly,skipPipe:u==null?void 0:u.skipPipe});if(h.issues){m={type:"record",input:l,key:v,value:g};for(const k of h.issues)k.path=[m],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}const w=this.value._parse(g,u);if(w.issues){m=m||{type:"record",input:l,key:v,value:g};for(const k of w.issues)k.path?k.path.unshift(m):k.path=[m],p==null||p.push(k);if(p||(p=w.issues),u!=null&&u.abortEarly)break}!h.issues&&!w.issues&&(c[h.output]=w.output)}return p?Lt(p):je(c,this.pipe,u,"record")}}}function kd(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 l of s.issues)o.push(l);else o=s.issues;else{i=[s.output];break}}return i?se(i[0]):Ne(n,"type","union",this.message,r,o)}}}function Rt(e,t,r){const n=e._parse(t,r);if(n.issues)throw new en(n.issues);return n.output}async function $d(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new en(n.issues);return n.output}function io(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):je(a,r,o,typeof a)}}}var Sd=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function Cd(e,t="Invalid input"){return{type:"custom",async:!1,message:t,requirement:e,_parse(r){return this.requirement(r)?se(r):ze(this.type,this.message,r,this.requirement)}}}function Ed(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:Sd,_parse(t){return this.requirement.test(t)?se(t):ze(this.type,this.message,t,this.requirement)}}}function Vt(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Pd(e,t="Invalid value"){return{type:"max_value",async:!1,message:t,requirement:e,_parse(r){return r>this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function oo(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Od(e,t="Invalid value"){return{type:"min_value",async:!1,message:t,requirement:e,_parse(r){return r<this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Id(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?se(r):ze(this.type,this.message,r,this.requirement)}}}function Ad(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)?se(t):ze(this.type,this.message,t,this.requirement)}}}function de(){return de=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},de.apply(this,arguments)}var Me,B,nn,ao,vt=0,so=[],lr=[],lo=S.__b,co=S.__r,uo=S.diffed,fo=S.__c,po=S.unmount;function rt(e,t){S.__h&&S.__h(B,e,vt||t),vt=0;var r=B.__H||(B.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:lr}),r.__[e]}function W(e){return vt=1,cr(go,e)}function cr(e,t,r){var n=rt(Me++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):go(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=B,!B.u)){var o=function(s,l,u){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(v){return v.__c});if(p.every(function(v){return!v.__N}))return!i||i.call(this,s,l,u);var c=!1;return p.forEach(function(v){if(v.__N){var g=v.__[0];v.__=v.__N,v.__N=void 0,g!==v.__[0]&&(c=!0)}}),!(!c&&n.__c.props===s)&&(!i||i.call(this,s,l,u))};B.u=!0;var i=B.shouldComponentUpdate,a=B.componentWillUpdate;B.componentWillUpdate=function(s,l,u){if(this.__e){var p=i;i=void 0,o(s,l,u),i=p}a&&a.call(this,s,l,u)},B.shouldComponentUpdate=o}return n.__N||n.__}function V(e,t){var r=rt(Me++,3);!S.__s&&an(r.__H,t)&&(r.__=e,r.i=t,B.__H.__h.push(r))}function ve(e,t){var r=rt(Me++,4);!S.__s&&an(r.__H,t)&&(r.__=e,r.i=t,B.__h.push(r))}function L(e){return vt=5,le(function(){return{current:e}},[])}function ho(e,t,r){vt=6,ve(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 le(e,t){var r=rt(Me++,7);return an(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function me(e,t){return vt=8,le(function(){return e},t)}function ur(e){var t=B.context[e.__c],r=rt(Me++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(B)),t.props.value):e.__}function vo(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function Td(e){var t=rt(Me++,10),r=W();return t.__=e,B.componentDidCatch||(B.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function mo(){var e=rt(Me++,11);if(!e.__){for(var t=B.__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 Dd(){for(var e;e=so.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(dr),e.__H.__h.forEach(on),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){B=null,lo&&lo(e)},S.__r=function(e){co&&co(e),Me=0;var t=(B=e.__c).__H;t&&(nn===B?(t.__h=[],B.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=lr,r.__N=r.i=void 0})):(t.__h.forEach(dr),t.__h.forEach(on),t.__h=[],Me=0)),nn=B},S.diffed=function(e){uo&&uo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(so.push(t)!==1&&ao===S.requestAnimationFrame||((ao=S.requestAnimationFrame)||Nd)(Dd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==lr&&(r.__=r.__V),r.i=void 0,r.__V=lr})),nn=B=null},S.__c=function(e,t){t.some(function(r){try{r.__h.forEach(dr),r.__h=r.__h.filter(function(n){return!n.__||on(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(n,r.__v)}}),fo&&fo(e,t)},S.unmount=function(e){po&&po(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{dr(n)}catch(o){t=o}}),r.__H=void 0,t&&S.__e(t,r.__v))};var bo=typeof requestAnimationFrame=="function";function Nd(e){var t,r=function(){clearTimeout(n),bo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);bo&&(t=requestAnimationFrame(r))}function dr(e){var t=B,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),B=t}function on(e){var t=B;e.__c=e.__(),B=t}function an(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function go(e,t){return typeof t=="function"?t(e):t}function yo(e,t){for(var r in t)e[r]=t[r];return e}function sn(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 ln(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function fr(e){this.props=e}function _o(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:sn(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}(fr.prototype=new ye).isPureReactComponent=!0,fr.prototype.shouldComponentUpdate=function(e,t){return sn(this.props,e)||sn(this.state,t)};var wo=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),wo&&wo(e)};var Md=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ce(e){function t(r){var n=yo({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Md,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var xo=function(e,t){return e==null?null:De(De(e).map(t))},Fe={map:xo,forEach:xo,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},Fd=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)}Fd(e,t,r,n)};var ko=S.unmount;function $o(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=yo({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return $o(n,t,r)})),e}function So(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return So(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 mt(){this.__u=0,this.t=null,this.__b=null}function Co(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function cn(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 bt(){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),ko&&ko(e)},(mt.prototype=new ye).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=Co(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]=So(u,u.__c.__P,u.__c.__O)}var p;for(n.setState({__a:n.__b=null});p=n.t.pop();)p.forceUpdate()}},l=t.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},mt.prototype.componentWillUnmount=function(){this.t=[]},mt.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]=$o(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&D(G,null,e.fallback);return o&&(o.__h=null),[D(G,null,t.__a?null:e.children),o]};var Eo=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 Ld(e){return this.getChildContext=function(){return e.context},e.children}function Rd(e){var t=this,r=e.i;t.componentWillUnmount=function(){ht(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)}}),ht(D(Ld,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Po(e,t){var r=D(Rd,{__v:e,i:t});return r.containerInfo=t,r}(bt.prototype=new ye).__a=function(e){var t=this,r=Co(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Eo(t,e,n)):o()};r?r(i):i()}},bt.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},bt.prototype.componentDidUpdate=bt.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Eo(e,r,t)})};var Oo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vd=/^(?: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]/,jd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Bd=/[A-Z0-9]/g,zd=typeof document<"u",Ud=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Io(e,t,r){return t.__k==null&&(t.textContent=""),ht(e,t),typeof r=="function"&&r(),e?e.__c:null}function Ao(e,t,r){return Zi(e,t),typeof r=="function"&&r(),e?e.__c:null}ye.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ye.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var To=S.event;function Hd(){}function qd(){return this.cancelBubble}function Kd(){return this.defaultPrevented}S.event=function(e){return To&&(e=To(e)),e.persist=Hd,e.isPropagationStopped=qd,e.isDefaultPrevented=Kd,e.nativeEvent=e};var un,Wd={enumerable:!1,configurable:!0,get:function(){return this.class}},Do=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||zd&&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"||Ud(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":jd.test(i)?i=s:n.indexOf("-")===-1&&Vd.test(i)?i=i.replace(Bd,"-$&").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(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=De(r.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",Wd)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Oo,Do&&Do(e)};var No=S.__r;S.__r=function(e){No&&No(e),un=e.__c};var Mo=S.diffed;S.diffed=function(e){Mo&&Mo(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),un=null};var Fo={ReactCurrentDispatcher:{current:{readContext:function(e){return un.__n[e.__c].props.value}}}},Gd="17.0.2";function Lo(e){return D.bind(null,e)}function nt(e){return!!e&&e.$$typeof===Oo}function gt(e){return nt(e)?hd.apply(null,arguments):e}function Ro(e){return!!e.__k&&(ht(null,e),!0)}function Vo(e){return e&&(e.base||e.nodeType===1&&e)||null}var jo=function(e,t){return e(t)},pr=function(e,t){return e(t)},Bo=G;function dn(e){e()}function zo(e){return e}function Uo(){return[!1,dn]}var Ho=ve;function qo(e,t){var r=t(),n=W({h:{__:r,v:t}}),o=n[0].h,i=n[1];return ve(function(){o.__=r,o.v=t,ln(o.__,t())||i({h:o})},[e,r,t]),V(function(){return ln(o.__,o.v())||i({h:o}),e(function(){ln(o.__,o.v())||i({h:o})})},[e]),r}var xe={useState:W,useId:mo,useReducer:cr,useEffect:V,useLayoutEffect:ve,useInsertionEffect:Ho,useTransition:Uo,useDeferredValue:zo,useSyncExternalStore:qo,startTransition:dn,useRef:L,useImperativeHandle:ho,useMemo:le,useCallback:me,useContext:ur,useDebugValue:vo,version:"17.0.2",Children:Fe,render:Io,hydrate:Ao,unmountComponentAtNode:Ro,createPortal:Po,createElement:D,createContext:Ft,createFactory:Lo,cloneElement:gt,createRef:ji,Fragment:G,isValidElement:nt,findDOMNode:Vo,Component:ye,PureComponent:fr,memo:_o,forwardRef:ce,flushSync:pr,unstable_batchedUpdates:jo,StrictMode:Bo,Suspense:mt,SuspenseList:bt,lazy:cn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fo};const Yd=Object.freeze(Object.defineProperty({__proto__:null,Children:Fe,Component:ye,Fragment:G,PureComponent:fr,StrictMode:Bo,Suspense:mt,SuspenseList:bt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fo,cloneElement:gt,createContext:Ft,createElement:D,createFactory:Lo,createPortal:Po,createRef:ji,default:xe,findDOMNode:Vo,flushSync:pr,forwardRef:ce,hydrate:Ao,isValidElement:nt,lazy:cn,memo:_o,render:Io,startTransition:dn,unmountComponentAtNode:Ro,unstable_batchedUpdates:jo,useCallback:me,useContext:ur,useDebugValue:vo,useDeferredValue:zo,useEffect:V,useErrorBoundary:Td,useId:mo,useImperativeHandle:ho,useInsertionEffect:Ho,useLayoutEffect:ve,useMemo:le,useReducer:cr,useRef:L,useState:W,useSyncExternalStore:qo,useTransition:Uo,version:Gd},Symbol.toStringTag,{value:"Module"}));function yt(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 Zd(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ko(...e){return t=>e.forEach(r=>Zd(r,t))}function jt(...e){return me(Ko(...e),e)}function Xd(e,t=[]){let r=[];function n(i,a){const s=Ft(a),l=r.length;r=[...r,a];function u(c){const{scope:v,children:g,...m}=c,h=(v==null?void 0:v[e][l])||s,w=le(()=>m,Object.values(m));return D(h.Provider,{value:w},g)}function p(c,v){const g=(v==null?void 0:v[e][l])||s,m=ur(g);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const o=()=>{const i=r.map(a=>Ft(a));return function(s){const l=(s==null?void 0:s[e])||i;return le(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,Qd(o,...t)]}function Qd(...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:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...s,...c}},{});return le(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}const fn=globalThis!=null&&globalThis.document?ve:()=>{},Jd=Yd["useId".toString()]||(()=>{});let ef=0;function pn(e){const[t,r]=W(Jd());return fn(()=>{e||r(n=>n??String(ef++))},[e]),e||(t?`radix-${t}`:"")}function it(e){const t=L(e);return V(()=>{t.current=e}),le(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function tf({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=rf({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:n,s=it(r),l=me(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s]);return[a,l]}function rf({defaultProp:e,onChange:t}){const r=W(e),[n]=r,o=L(n),i=it(t);return V(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),r}const hn=ce((e,t)=>{const{children:r,...n}=e,o=Fe.toArray(r),i=o.find(of);if(i){const a=i.props.children,s=o.map(l=>l===i?Fe.count(a)>1?Fe.only(null):nt(a)?a.props.children:null:l);return D(vn,de({},n,{ref:t}),nt(a)?gt(a,void 0,s):null)}return D(vn,de({},n,{ref:t}),r)});hn.displayName="Slot";const vn=ce((e,t)=>{const{children:r,...n}=e;return nt(r)?gt(r,{...af(n,r.props),ref:t?Ko(t,r.ref):r.ref}):Fe.count(r)>1?Fe.only(null):null});vn.displayName="SlotClone";const nf=({children:e})=>D(G,null,e);function of(e){return nt(e)&&e.type===nf}function af(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 mn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const r=ce((n,o)=>{const{asChild:i,...a}=n,s=i?hn:t;return V(()=>{window[Symbol.for("radix-ui")]=!0},[]),D(s,de({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sf(e,t){e&&pr(()=>e.dispatchEvent(t))}function lf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e);V(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const bn="dismissableLayer.update",cf="dismissableLayer.pointerDownOutside",uf="dismissableLayer.focusOutside";let Wo;const df=Ft({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ff=ce((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,p=ur(df),[c,v]=W(null),g=(r=c==null?void 0:c.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,m]=W({}),h=jt(t,N=>v(N)),w=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(k),O=c?w.indexOf(c):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,P=O>=_,U=pf(N=>{const M=N.target,oe=[...p.branches].some(te=>te.contains(M));!P||oe||(i==null||i(N),s==null||s(N),N.defaultPrevented||l==null||l())},g),q=hf(N=>{const M=N.target;[...p.branches].some(te=>te.contains(M))||(a==null||a(N),s==null||s(N),N.defaultPrevented||l==null||l())},g);return lf(N=>{O===p.layers.size-1&&(o==null||o(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},g),V(()=>{if(c)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Wo=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(c)),p.layers.add(c),Go(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Wo)}},[c,g,n,p]),V(()=>()=>{c&&(p.layers.delete(c),p.layersWithOutsidePointerEventsDisabled.delete(c),Go())},[c,p]),V(()=>{const N=()=>m({});return document.addEventListener(bn,N),()=>document.removeEventListener(bn,N)},[]),D(mn.div,de({},u,{ref:h,style:{pointerEvents:A?P?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,q.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,q.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,U.onPointerDownCapture)}))});function pf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e),n=L(!1),o=L(()=>{});return V(()=>{const i=s=>{if(s.target&&!n.current){let u=function(){Yo(cf,r,l,{discrete:!0})};const l={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 hf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e),n=L(!1);return V(()=>{const o=i=>{i.target&&!n.current&&Yo(uf,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 Go(){const e=new CustomEvent(bn);document.dispatchEvent(e)}function Yo(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?sf(o,i):o.dispatchEvent(i)}const gn="focusScope.autoFocusOnMount",yn="focusScope.autoFocusOnUnmount",Zo={bubbles:!1,cancelable:!0},vf=ce((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=W(null),u=it(o),p=it(i),c=L(null),v=jt(t,h=>l(h)),g=L({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(n){let h=function(O){if(g.paused||!s)return;const A=O.target;s.contains(A)?c.current=A:Ue(c.current,{select:!0})},w=function(O){if(g.paused||!s)return;const A=O.relatedTarget;A!==null&&(s.contains(A)||Ue(c.current,{select:!0}))},k=function(O){if(document.activeElement===document.body)for(const P of O)P.removedNodes.length>0&&Ue(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",w);const _=new MutationObserver(k);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",w),_.disconnect()}}},[n,s,g.paused]),V(()=>{if(s){Jo.add(g);const h=document.activeElement;if(!s.contains(h)){const k=new CustomEvent(gn,Zo);s.addEventListener(gn,u),s.dispatchEvent(k),k.defaultPrevented||(mf(wf(Xo(s)),{select:!0}),document.activeElement===h&&Ue(s))}return()=>{s.removeEventListener(gn,u),setTimeout(()=>{const k=new CustomEvent(yn,Zo);s.addEventListener(yn,p),s.dispatchEvent(k),k.defaultPrevented||Ue(h??document.body,{select:!0}),s.removeEventListener(yn,p),Jo.remove(g)},0)}}},[s,u,p,g]);const m=me(h=>{if(!r&&!n||g.paused)return;const w=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,k=document.activeElement;if(w&&k){const _=h.currentTarget,[O,A]=bf(_);O&&A?!h.shiftKey&&k===A?(h.preventDefault(),r&&Ue(O,{select:!0})):h.shiftKey&&k===O&&(h.preventDefault(),r&&Ue(A,{select:!0})):k===_&&h.preventDefault()}},[r,n,g.paused]);return D(mn.div,de({tabIndex:-1},a,{ref:v,onKeyDown:m}))});function mf(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ue(n,{select:t}),document.activeElement!==r)return}function bf(e){const t=Xo(e),r=Qo(t,e),n=Qo(t.reverse(),e);return[r,n]}function Xo(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 Qo(e,t){for(const r of e)if(!gf(r,{upTo:t}))return r}function gf(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 yf(e){return e instanceof HTMLInputElement&&"select"in e}function Ue(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yf(e)&&t&&e.select()}}const Jo=_f();function _f(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ea(e,t),e.unshift(t)},remove(t){var r;e=ea(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function ea(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function wf(e){return e.filter(t=>t.tagName!=="A")}function xf(e,t){return cr((r,n)=>{const o=t[r][n];return o??r},e)}const _n=e=>{const{present:t,children:r}=e,n=kf(t),o=typeof r=="function"?r({present:n.isPresent}):Fe.only(r),i=jt(n.ref,o.ref);return typeof r=="function"||n.isPresent?gt(o,{ref:i}):null};_n.displayName="Presence";function kf(e){const[t,r]=W(),n=L({}),o=L(e),i=L("none"),a=e?"mounted":"unmounted",[s,l]=xf(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const u=hr(n.current);i.current=s==="mounted"?u:"none"},[s]),fn(()=>{const u=n.current,p=o.current;if(p!==e){const v=i.current,g=hr(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(p&&v!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),fn(()=>{if(t){const u=c=>{const g=hr(n.current).includes(c.animationName);c.target===t&&g&&pr(()=>l("ANIMATION_END"))},p=c=>{c.target===t&&(i.current=hr(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:me(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}let wn=0;function $f(){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:ta()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:ta()),wn++,()=>{wn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),wn--}},[])}function ta(){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 Ce=function(){return Ce=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},Ce.apply(this,arguments)};function ra(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 Sf(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 vr="right-scroll-bar-position",mr="width-before-scroll-bar",Cf="with-scroll-bars-hidden",Ef="--removed-body-scroll-bar-size";function Pf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Of(e,t){var r=W(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 If(e,t){return Of(t||null,function(r){return e.forEach(function(n){return Pf(n,r)})})}function Af(e){return e}function Tf(e,t){t===void 0&&(t=Af);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 l=function(){var p=a;a=[],p.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(p){a.push(p),u()},filter:function(p){return a=a.filter(p),r}}}};return o}function Df(e){e===void 0&&(e={});var t=Tf(null);return t.options=Ce({async:!0,ssr:!1},e),t}var na=function(e){var t=e.sideCar,r=ra(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,Ce({},r))};na.isSideCarExport=!0;function Nf(e,t){return e.useMedium(t),na}var ia=Df(),xn=function(){},br=ce(function(e,t){var r=L(null),n=W({onScrollCapture:xn,onWheelCapture:xn,onTouchMoveCapture:xn}),o=n[0],i=n[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,p=e.enabled,c=e.shards,v=e.sideCar,g=e.noIsolation,m=e.inert,h=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,_=ra(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),O=v,A=If([r,t]),P=Ce(Ce({},_),o);return D(G,null,p&&D(O,{sideCar:ia,removeScrollBar:u,shards:c,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!h,lockRef:r}),a?gt(Fe.only(s),Ce(Ce({},P),{ref:A})):D(k,Ce({},P,{className:l,ref:A}),s))});br.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},br.classNames={fullWidth:mr,zeroRight:vr};var oa,Mf=function(){if(oa)return oa;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ff(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Mf();return t&&e.setAttribute("nonce",t),e}function Lf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vf=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ff())&&(Lf(t,r),Rf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jf=function(){var e=Vf();return function(t,r){V(function(){return e.add(t),function(){e.remove()}},[t&&r])}},aa=function(){var e=jf(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},Bf={left:0,top:0,right:0,gap:0},kn=function(e){return parseInt(e||"",10)||0},zf=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[kn(r),kn(n),kn(o)]},Uf=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bf;var t=zf(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])}},Hf=aa(),qf=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
1
+ var dm=Object.defineProperty;var fm=(et,be,Ve)=>be in et?dm(et,be,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):et[be]=Ve;var Ts=(et,be,Ve)=>(fm(et,typeof be!="symbol"?be+"":be,Ve),Ve);(function(){"use strict";var et=e=>e,be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds=Array.isArray,Hr=Ds,Ns=typeof be=="object"&&be&&be.Object===Object&&be,Ms=Ns,Fs=Ms,Ls=typeof self=="object"&&self&&self.Object===Object&&self,Rs=Fs||Ls||Function("return this")(),qr=Rs,Vs=qr,js=Vs.Symbol,Wr=js,mi=Wr,bi=Object.prototype,Bs=bi.hasOwnProperty,zs=bi.toString,Tt=mi?mi.toStringTag:void 0;function Us(e){var t=Bs.call(e,Tt),r=e[Tt];try{e[Tt]=void 0;var n=!0}catch{}var o=zs.call(e);return n&&(t?e[Tt]=r:delete e[Tt]),o}var Hs=Us,qs=Object.prototype,Ws=qs.toString;function Ks(e){return Ws.call(e)}var Gs=Ks,gi=Wr,Ys=Hs,Zs=Gs,Xs="[object Null]",Qs="[object Undefined]",yi=gi?gi.toStringTag:void 0;function Js(e){return e==null?e===void 0?Qs:Xs:yi&&yi in Object(e)?Ys(e):Zs(e)}var _i=Js;function ec(e){return e!=null&&typeof e=="object"}var tc=ec,rc=_i,nc=tc,ic="[object Symbol]";function oc(e){return typeof e=="symbol"||nc(e)&&rc(e)==ic}var Kr=oc,ac=Hr,sc=Kr,cc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lc=/^\w*$/;function uc(e,t){if(ac(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||sc(e)?!0:lc.test(e)||!cc.test(e)||t!=null&&e in Object(t)}var dc=uc;function fc(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var wi=fc,pc=_i,hc=wi,vc="[object AsyncFunction]",mc="[object Function]",bc="[object GeneratorFunction]",gc="[object Proxy]";function yc(e){if(!hc(e))return!1;var t=pc(e);return t==mc||t==bc||t==vc||t==gc}var _c=yc,wc=qr,xc=wc["__core-js_shared__"],kc=xc,Gr=kc,xi=function(){var e=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $c(e){return!!xi&&xi in e}var Sc=$c,Cc=Function.prototype,Ec=Cc.toString;function Pc(e){if(e!=null){try{return Ec.call(e)}catch{}try{return e+""}catch{}}return""}var Oc=Pc,Ic=_c,Ac=Sc,Tc=wi,Dc=Oc,Nc=/[\\^$.*+?()[\]{}|]/g,Mc=/^\[object .+?Constructor\]$/,Fc=Function.prototype,Lc=Object.prototype,Rc=Fc.toString,Vc=Lc.hasOwnProperty,jc=RegExp("^"+Rc.call(Vc).replace(Nc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bc(e){if(!Tc(e)||Ac(e))return!1;var t=Ic(e)?jc:Mc;return t.test(Dc(e))}var zc=Bc;function Uc(e,t){return e==null?void 0:e[t]}var Hc=Uc,qc=zc,Wc=Hc;function Kc(e,t){var r=Wc(e,t);return qc(r)?r:void 0}var ki=Kc,Gc=ki,Yc=Gc(Object,"create"),er=Yc,$i=er;function Zc(){this.__data__=$i?$i(null):{},this.size=0}var Xc=Zc;function Qc(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Jc=Qc,el=er,tl="__lodash_hash_undefined__",rl=Object.prototype,nl=rl.hasOwnProperty;function il(e){var t=this.__data__;if(el){var r=t[e];return r===tl?void 0:r}return nl.call(t,e)?t[e]:void 0}var ol=il,al=er,sl=Object.prototype,cl=sl.hasOwnProperty;function ll(e){var t=this.__data__;return al?t[e]!==void 0:cl.call(t,e)}var ul=ll,dl=er,fl="__lodash_hash_undefined__";function pl(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=dl&&t===void 0?fl:t,this}var hl=pl,vl=Xc,ml=Jc,bl=ol,gl=ul,yl=hl;function ut(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])}}ut.prototype.clear=vl,ut.prototype.delete=ml,ut.prototype.get=bl,ut.prototype.has=gl,ut.prototype.set=yl;var _l=ut;function wl(){this.__data__=[],this.size=0}var xl=wl;function kl(e,t){return e===t||e!==e&&t!==t}var $l=kl,Sl=$l;function Cl(e,t){for(var r=e.length;r--;)if(Sl(e[r][0],t))return r;return-1}var tr=Cl,El=tr,Pl=Array.prototype,Ol=Pl.splice;function Il(e){var t=this.__data__,r=El(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ol.call(t,r,1),--this.size,!0}var Al=Il,Tl=tr;function Dl(e){var t=this.__data__,r=Tl(t,e);return r<0?void 0:t[r][1]}var Nl=Dl,Ml=tr;function Fl(e){return Ml(this.__data__,e)>-1}var Ll=Fl,Rl=tr;function Vl(e,t){var r=this.__data__,n=Rl(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var jl=Vl,Bl=xl,zl=Al,Ul=Nl,Hl=Ll,ql=jl;function dt(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])}}dt.prototype.clear=Bl,dt.prototype.delete=zl,dt.prototype.get=Ul,dt.prototype.has=Hl,dt.prototype.set=ql;var Wl=dt,Kl=ki,Gl=qr,Yl=Kl(Gl,"Map"),Zl=Yl,Si=_l,Xl=Wl,Ql=Zl;function Jl(){this.size=0,this.__data__={hash:new Si,map:new(Ql||Xl),string:new Si}}var eu=Jl;function tu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ru=tu,nu=ru;function iu(e,t){var r=e.__data__;return nu(t)?r[typeof t=="string"?"string":"hash"]:r.map}var rr=iu,ou=rr;function au(e){var t=ou(this,e).delete(e);return this.size-=t?1:0,t}var su=au,cu=rr;function lu(e){return cu(this,e).get(e)}var uu=lu,du=rr;function fu(e){return du(this,e).has(e)}var pu=fu,hu=rr;function vu(e,t){var r=hu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var mu=vu,bu=eu,gu=su,yu=uu,_u=pu,wu=mu;function ft(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])}}ft.prototype.clear=bu,ft.prototype.delete=gu,ft.prototype.get=yu,ft.prototype.has=_u,ft.prototype.set=wu;var xu=ft,Ci=xu,ku="Expected a function";function Yr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ku);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(Yr.Cache||Ci),r}Yr.Cache=Ci;var $u=Yr,Su=$u,Cu=500;function Eu(e){var t=Su(e,function(n){return r.size===Cu&&r.clear(),n}),r=t.cache;return t}var Pu=Eu,Ou=Pu,Iu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Au=/\\(\\)?/g,Tu=Ou(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Iu,function(r,n,o,i){t.push(o?i.replace(Au,"$1"):n||r)}),t}),Du=Tu;function Nu(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 Mu=Nu,Ei=Wr,Fu=Mu,Lu=Hr,Ru=Kr,Vu=1/0,Pi=Ei?Ei.prototype:void 0,Oi=Pi?Pi.toString:void 0;function Ii(e){if(typeof e=="string")return e;if(Lu(e))return Fu(e,Ii)+"";if(Ru(e))return Oi?Oi.call(e):"";var t=e+"";return t=="0"&&1/e==-Vu?"-0":t}var ju=Ii,Bu=ju;function zu(e){return e==null?"":Bu(e)}var Uu=zu,Hu=Hr,qu=dc,Wu=Du,Ku=Uu;function Gu(e,t){return Hu(e)?e:qu(e,t)?[e]:Wu(Ku(e))}var Yu=Gu,Zu=Kr,Xu=1/0;function Qu(e){if(typeof e=="string"||Zu(e))return e;var t=e+"";return t=="0"&&1/e==-Xu?"-0":t}var Ju=Qu,ed=Yu,td=Ju;function rd(e,t){t=ed(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[td(t[r++])];return r&&r==n?e:void 0}var nd=rd,id=nd;function od(e,t,r){var n=e==null?void 0:id(e,t);return n===void 0?r:n}var ad=od;const Dt=Ve(ad);var Nt,S,Ai,Ti,tt,Di,Ni,Zr,Mi,pt={},Fi=[],sd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nr=Array.isArray;function Ae(e,t){for(var r in t)e[r]=t[r];return e}function Li(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?Nt.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 Mt(e,a,n,o,null)}function Mt(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??++Ai};return o==null&&S.vnode!=null&&S.vnode(i),i}function Ri(){return{current:null}}function G(e){return e.children}function ge(e,t){this.props=e,this.context=t}function ir(e,t){if(t==null)return e.__?ir(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"?ir(e):null}function Vi(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 Vi(e)}}function Xr(e){(!e.__d&&(e.__d=!0)&&tt.push(e)&&!or.__r++||Di!==S.debounceRendering)&&((Di=S.debounceRendering)||Ni)(or)}function or(){var e,t,r,n,o,i,a,s,c;for(tt.sort(Zr);e=tt.shift();)e.__d&&(t=tt.length,n=void 0,o=void 0,i=void 0,s=(a=(r=e).__v).__e,(c=r.__P)&&(n=[],o=[],(i=Ae({},a)).__v=a.__v+1,Qr(c,a,i,r.__n,c.ownerSVGElement!==void 0,a.__h!=null?[s]:null,n,s??ir(a),a.__h,o),Wi(n,a,o),a.__e!=s&&Vi(a)),tt.length>t&&tt.sort(Zr));or.__r=0}function ji(e,t,r,n,o,i,a,s,c,u,f){var l,h,g,m,v,w,x,_,P,I,O=0,U=n&&n.__k||Fi,q=U.length,N=q,M=t.length;for(r.__k=[],l=0;l<M;l++)(m=r.__k[l]=(m=t[l])==null||typeof m=="boolean"||typeof m=="function"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?Mt(null,m,null,null,m):nr(m)?Mt(G,{children:m},null,null,null):m.__b>0?Mt(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null&&(m.__=r,m.__b=r.__b+1,(_=cd(m,U,x=l+O,N))===-1?g=pt:(g=U[_]||pt,U[_]=void 0,N--),Qr(e,m,g,o,i,a,s,c,u,f),v=m.__e,(h=m.ref)&&g.ref!=h&&(g.ref&&Jr(g.ref,null,m),f.push(h,m.__c||v,m)),v!=null&&(w==null&&(w=v),I=!(P=g===pt||g.__v===null)&&_===x,P?_==-1&&O--:_!==x&&(_===x+1?(O++,I=!0):_>x?N>M-x?(O+=_-x,I=!0):O--:O=_<x&&_==x-1?_-x:0),x=l+O,I=I||_==l&&!P,typeof m.type!="function"||_===x&&g.__k!==m.__k?typeof m.type=="function"||I?m.__d!==void 0?(c=m.__d,m.__d=void 0):c=v.nextSibling:c=zi(e,v,c):c=Bi(m,c,e),typeof r.type=="function"&&(r.__d=c)));for(r.__e=w,l=q;l--;)U[l]!=null&&(typeof r.type=="function"&&U[l].__e!=null&&U[l].__e==r.__d&&(r.__d=U[l].__e.nextSibling),Ki(U[l],U[l]))}function Bi(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"?Bi(n,t,r):zi(r,n.__e,t));return t}function Te(e,t){return t=t||[],e==null||typeof e=="boolean"||(nr(e)?e.some(function(r){Te(r,t)}):t.push(e)),t}function zi(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 cd(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 ld(e,t,r,n,o){var i;for(i in r)i==="children"||i==="key"||i in t||ar(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]||ar(e,i,t[i],r[i],n)}function Ui(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||sd.test(t)?r:r+"px"}function ar(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||Ui(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Ui(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?qi:Hi,i):e.removeEventListener(t,i?qi:Hi,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 Hi(e){return this.l[e.type+!1](S.event?S.event(e):e)}function qi(e){return this.l[e.type+!0](S.event?S.event(e):e)}function Qr(e,t,r,n,o,i,a,s,c,u){var f,l,h,g,m,v,w,x,_,P,I,O,U,q,N,M=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 M=="function"){if(x=t.props,_=(f=M.contextType)&&n[f.__c],P=f?_?_.props.value:f.__:n,r.__c?w=(l=t.__c=r.__c).__=l.__E:("prototype"in M&&M.prototype.render?t.__c=l=new M(x,P):(t.__c=l=new ge(x,P),l.constructor=M,l.render=dd),_&&_.sub(l),l.props=x,l.state||(l.state={}),l.context=P,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),M.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ae({},l.__s)),Ae(l.__s,M.getDerivedStateFromProps(x,l.__s))),g=l.props,m=l.state,l.__v=t,h)M.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(M.getDerivedStateFromProps==null&&x!==g&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(x,P),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(x,l.__s,P)===!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(oe){oe&&(oe.__=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,P),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(g,m,v)})}if(l.context=P,l.props=x,l.__P=e,l.__e=!1,O=S.__r,U=0,"prototype"in M&&M.prototype.render){for(l.state=l.__s,l.__d=!1,O&&O(t),f=l.render(l.props,l.state,l.context),q=0;q<l._sb.length;q++)l.__h.push(l._sb[q]);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&&++U<25);l.state=l.__s,l.getChildContext!=null&&(n=Ae(Ae({},n),l.getChildContext())),h||l.getSnapshotBeforeUpdate==null||(v=l.getSnapshotBeforeUpdate(g,m)),ji(e,nr(N=f!=null&&f.type===G&&f.key==null?f.props.children:f)?N:[N],t,r,n,o,i,a,s,c,u),l.base=t.__e,t.__h=null,l.__h.length&&a.push(l),w&&(l.__E=l.__=null)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=ud(r.__e,t,r,n,o,i,a,c,u);(f=S.diffed)&&f(t)}catch(oe){t.__v=null,(c||i!=null)&&(t.__e=s,t.__h=!!c,i[i.indexOf(s)]=null),S.__e(oe,t,r)}}function Wi(e,t,r){for(var n=0;n<r.length;n++)Jr(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 ud(e,t,r,n,o,i,a,s,c){var u,f,l,h=r.props,g=t.props,m=t.type,v=0;if(m==="svg"&&(o=!0),i!=null){for(;v<i.length;v++)if((u=i[v])&&"setAttribute"in u==!!m&&(m?u.localName===m:u.nodeType===3)){e=u,i[v]=null;break}}if(e==null){if(m===null)return document.createTextNode(g);e=o?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),i=null,s=!1}if(m===null)h===g||s&&e.data===g||(e.data=g);else{if(i=i&&Nt.call(e.childNodes),f=(h=r.props||pt).dangerouslySetInnerHTML,l=g.dangerouslySetInnerHTML,!s){if(i!=null)for(h={},v=0;v<e.attributes.length;v++)h[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(ld(e,g,h,o,s),l)t.__k=[];else if(ji(e,nr(v=t.props.children)?v:[v],t,r,n,o&&m!=="foreignObject",i,a,i?i[0]:r.__k&&ir(r,0),s,c),i!=null)for(v=i.length;v--;)i[v]!=null&&Li(i[v]);s||("value"in g&&(v=g.value)!==void 0&&(v!==e.value||m==="progress"&&!v||m==="option"&&v!==h.value)&&ar(e,"value",v,h.value,!1),"checked"in g&&(v=g.checked)!==void 0&&v!==e.checked&&ar(e,"checked",v,h.checked,!1))}return e}function Jr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){S.__e(n,r)}}function Ki(e,t,r){var n,o;if(S.unmount&&S.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Jr(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]&&Ki(n[o],t,r||typeof e.type!="function");r||e.__e==null||Li(e.__e),e.__=e.__e=e.__d=void 0}function dd(e,t,r){return this.constructor(e,r)}function ht(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=[],Qr(t,e=(!n&&r||t).__k=D(G,null,[e]),o||pt,pt,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?Nt.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),Wi(i,e,a)}function Gi(e,t){ht(e,t,Gi)}function fd(e,t,r){var n,o,i,a,s=Ae({},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?Nt.call(arguments,2):r),Mt(e.type,s,n||e.key,o||e.ref,null)}function Ft(e,t){var r={__c:t="__cC"+Mi++,__: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,Xr(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}Nt=Fi.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}},Ai=0,Ti=function(e){return e!=null&&e.constructor===void 0},ge.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),Xr(this))},ge.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xr(this))},ge.prototype.render=G,tt=[],Ni=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zr=function(e,t){return e.__v.__b-t.__v.__b},or.__r=0,Mi=0;var en=class extends Error{constructor(t){super(t[0].message);Ts(this,"issues");this.name="ValiError",this.issues=t}};function Yi(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function Lt(e){return{issues:e}}function se(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 hd(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 je(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return se(e);let o,i,a=e;for(const s of t){const c=s._parse(a);if(c.issues){o=o||hd(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?Lt(i):se(a)}function Be(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function Zi(e){return typeof e=="function"?e():e}function ze(e,t,r,n){return Lt([{validation:e,message:Zi(t),input:r,requirement:n}])}function vd(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[i,a]=Be(t,r);return[e,i,a]}const[n,o]=Be(e,t);return[void 0,n,o]}function De(e,t,r,n,o,i){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:Zi(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 Xi(e){return typeof e.default=="function"?e.default():e.default}function md(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return je(t,this.pipe,r,"any")}}}function bd(e,t,r){const[n="Invalid type",o]=Be(t,r);return{type:"array",async:!1,item:e,message:n,pipe:o,_parse(i,a){if(!Array.isArray(i))return De(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 h={type:"array",input:i,key:u,value:f};for(const g of l.issues)g.path?g.path.unshift(h):g.path=[h],s==null||s.push(g);if(s||(s=l.issues),a!=null&&a.abortEarly)break}else c.push(l.output)}return s?Lt(s):je(c,this.pipe,a,"array")}}}function Qi(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="boolean"?De(i,"type","boolean",this.message,o):je(o,this.pipe,i,"boolean")}}}function Ji(e,t="Invalid type"){return{type:"literal",async:!1,literal:e,message:t,_parse(r,n){return r!==this.literal?De(n,"type","literal",this.message,r):se(r)}}}function gd(e,t){return{type:"nullable",async:!1,wrapped:e,default:t,_parse(r,n){if(r===null){const o=Xi(this);if(o===void 0)return se(r);r=o}return this.wrapped._parse(r,n)}}}function tn(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="number"||isNaN(o)?De(i,"type","number",this.message,o):je(o,this.pipe,i,"number")}}}function Ne(e,t,r,n){const[o,i="Invalid type",a]=vd(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 De(u,"type","object",this.message,c);s=s||Object.entries(this.entries);let f;const l={};for(const[h,g]of s){const m=c[h],v=g._parse(m,u);if(v.issues){const w={type:"object",input:c,key:h,value:m};for(const x of v.issues)x.path?x.path.unshift(w):x.path=[w],f==null||f.push(x);if(f||(f=v.issues),u!=null&&u.abortEarly)break}else(v.output!==void 0||h in c)&&(l[h]=v.output)}if(this.rest&&!(u!=null&&u.abortEarly&&f)){for(const h in c)if(!(h in this.entries)){const g=c[h],m=this.rest._parse(g,u);if(m.issues){const v={type:"object",input:c,key:h,value:g};for(const w of m.issues)w.path?w.path.unshift(v):w.path=[v],f==null||f.push(w);if(f||(f=m.issues),u!=null&&u.abortEarly)break}else l[h]=m.output}}return f?Lt(f):je(l,this.pipe,u,"object")}}}function yd(e,t){return{type:"optional",async:!1,wrapped:e,default:t,_parse(r,n){if(r===void 0){const o=Xi(this);if(o===void 0)return se(r);r=o}return this.wrapped._parse(r,n)}}}function _d(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?se(r):De(n,"type","picklist",this.message,r)}}}function $e(e,t){const[r="Invalid type",n]=Be(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="string"?De(i,"type","string",this.message,o):je(o,this.pipe,i,"string")}}}function wd(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[a,s]=Be(r,n);return[e,t,a,s]}const[o,i]=Be(t,r);return[$e(),e,o,i]}var xd=["__proto__","prototype","constructor"];function eo(e,t,r,n){const[o,i,a="Invalid type",s]=wd(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 De(u,"type","record",this.message,c);let f;const l={};for(const[h,g]of Object.entries(c))if(!xd.includes(h)){let m;const v=this.key._parse(h,{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){m={type:"record",input:c,key:h,value:g};for(const x of v.issues)x.path=[m],f==null||f.push(x);if(f||(f=v.issues),u!=null&&u.abortEarly)break}const w=this.value._parse(g,u);if(w.issues){m=m||{type:"record",input:c,key:h,value:g};for(const x of w.issues)x.path?x.path.unshift(m):x.path=[m],f==null||f.push(x);if(f||(f=w.issues),u!=null&&u.abortEarly)break}!v.issues&&!w.issues&&(l[v.output]=w.output)}return f?Lt(f):je(l,this.pipe,u,"record")}}}function kd(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?se(i[0]):De(n,"type","union",this.message,r,o)}}}function sr(e,t,r){const n=e._parse(t,r);if(n.issues)throw new en(n.issues);return n.output}async function $d(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new en(n.issues);return n.output}function to(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):je(a,r,o,typeof a)}}}var Sd=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function Cd(e,t="Invalid input"){return{type:"custom",async:!1,message:t,requirement:e,_parse(r){return this.requirement(r)?se(r):ze(this.type,this.message,r,this.requirement)}}}function Ed(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:Sd,_parse(t){return this.requirement.test(t)?se(t):ze(this.type,this.message,t,this.requirement)}}}function Rt(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Pd(e,t="Invalid value"){return{type:"max_value",async:!1,message:t,requirement:e,_parse(r){return r>this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function ro(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Od(e,t="Invalid value"){return{type:"min_value",async:!1,message:t,requirement:e,_parse(r){return r<this.requirement?ze(this.type,this.message,r,this.requirement):se(r)}}}function Id(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?se(r):ze(this.type,this.message,r,this.requirement)}}}function Ad(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)?se(t):ze(this.type,this.message,t,this.requirement)}}}function de(){return de=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},de.apply(this,arguments)}var Me,B,rn,no,vt=0,io=[],cr=[],oo=S.__b,ao=S.__r,so=S.diffed,co=S.__c,lo=S.unmount;function rt(e,t){S.__h&&S.__h(B,e,vt||t),vt=0;var r=B.__H||(B.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:cr}),r.__[e]}function K(e){return vt=1,lr(vo,e)}function lr(e,t,r){var n=rt(Me++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):vo(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=B,!B.u)){var o=function(s,c,u){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(h){return h.__c});if(f.every(function(h){return!h.__N}))return!i||i.call(this,s,c,u);var l=!1;return f.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(l=!0)}}),!(!l&&n.__c.props===s)&&(!i||i.call(this,s,c,u))};B.u=!0;var i=B.shouldComponentUpdate,a=B.componentWillUpdate;B.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)},B.shouldComponentUpdate=o}return n.__N||n.__}function V(e,t){var r=rt(Me++,3);!S.__s&&on(r.__H,t)&&(r.__=e,r.i=t,B.__H.__h.push(r))}function he(e,t){var r=rt(Me++,4);!S.__s&&on(r.__H,t)&&(r.__=e,r.i=t,B.__h.push(r))}function L(e){return vt=5,ce(function(){return{current:e}},[])}function uo(e,t,r){vt=6,he(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 ce(e,t){var r=rt(Me++,7);return on(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ve(e,t){return vt=8,ce(function(){return e},t)}function ur(e){var t=B.context[e.__c],r=rt(Me++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(B)),t.props.value):e.__}function fo(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function Td(e){var t=rt(Me++,10),r=K();return t.__=e,B.componentDidCatch||(B.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function po(){var e=rt(Me++,11);if(!e.__){for(var t=B.__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 Dd(){for(var e;e=io.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(dr),e.__H.__h.forEach(nn),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){B=null,oo&&oo(e)},S.__r=function(e){ao&&ao(e),Me=0;var t=(B=e.__c).__H;t&&(rn===B?(t.__h=[],B.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=cr,r.__N=r.i=void 0})):(t.__h.forEach(dr),t.__h.forEach(nn),t.__h=[],Me=0)),rn=B},S.diffed=function(e){so&&so(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(io.push(t)!==1&&no===S.requestAnimationFrame||((no=S.requestAnimationFrame)||Nd)(Dd)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==cr&&(r.__=r.__V),r.i=void 0,r.__V=cr})),rn=B=null},S.__c=function(e,t){t.some(function(r){try{r.__h.forEach(dr),r.__h=r.__h.filter(function(n){return!n.__||nn(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(n,r.__v)}}),co&&co(e,t)},S.unmount=function(e){lo&&lo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{dr(n)}catch(o){t=o}}),r.__H=void 0,t&&S.__e(t,r.__v))};var ho=typeof requestAnimationFrame=="function";function Nd(e){var t,r=function(){clearTimeout(n),ho&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ho&&(t=requestAnimationFrame(r))}function dr(e){var t=B,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),B=t}function nn(e){var t=B;e.__c=e.__(),B=t}function on(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function vo(e,t){return typeof t=="function"?t(e):t}function mo(e,t){for(var r in t)e[r]=t[r];return e}function an(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 sn(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function fr(e){this.props=e}function bo(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:an(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}(fr.prototype=new ge).isPureReactComponent=!0,fr.prototype.shouldComponentUpdate=function(e,t){return an(this.props,e)||an(this.state,t)};var go=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),go&&go(e)};var Md=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function le(e){function t(r){var n=mo({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Md,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var yo=function(e,t){return e==null?null:Te(Te(e).map(t))},Fe={map:yo,forEach:yo,count:function(e){return e?Te(e).length:0},only:function(e){var t=Te(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Te},Fd=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)}Fd(e,t,r,n)};var _o=S.unmount;function wo(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=mo({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return wo(n,t,r)})),e}function xo(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return xo(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 mt(){this.__u=0,this.t=null,this.__b=null}function ko(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function cn(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 bt(){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),_o&&_o(e)},(mt.prototype=new ge).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=ko(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]=xo(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)},mt.prototype.componentWillUnmount=function(){this.t=[]},mt.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]=wo(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&D(G,null,e.fallback);return o&&(o.__h=null),[D(G,null,t.__a?null:e.children),o]};var $o=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 Ld(e){return this.getChildContext=function(){return e.context},e.children}function Rd(e){var t=this,r=e.i;t.componentWillUnmount=function(){ht(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)}}),ht(D(Ld,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function So(e,t){var r=D(Rd,{__v:e,i:t});return r.containerInfo=t,r}(bt.prototype=new ge).__a=function(e){var t=this,r=ko(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),$o(t,e,n)):o()};r?r(i):i()}},bt.prototype.render=function(e){this.u=null,this.o=new Map;var t=Te(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},bt.prototype.componentDidUpdate=bt.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){$o(e,r,t)})};var Co=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vd=/^(?: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]/,jd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Bd=/[A-Z0-9]/g,zd=typeof document<"u",Ud=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Eo(e,t,r){return t.__k==null&&(t.textContent=""),ht(e,t),typeof r=="function"&&r(),e?e.__c:null}function Po(e,t,r){return Gi(e,t),typeof r=="function"&&r(),e?e.__c:null}ge.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ge.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Oo=S.event;function Hd(){}function qd(){return this.cancelBubble}function Wd(){return this.defaultPrevented}S.event=function(e){return Oo&&(e=Oo(e)),e.persist=Hd,e.isPropagationStopped=qd,e.isDefaultPrevented=Wd,e.nativeEvent=e};var ln,Kd={enumerable:!1,configurable:!0,get:function(){return this.class}},Io=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||zd&&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"||Ud(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":jd.test(i)?i=s:n.indexOf("-")===-1&&Vd.test(i)?i=i.replace(Bd,"-$&").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=Te(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=Te(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",Kd)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Co,Io&&Io(e)};var Ao=S.__r;S.__r=function(e){Ao&&Ao(e),ln=e.__c};var To=S.diffed;S.diffed=function(e){To&&To(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),ln=null};var Do={ReactCurrentDispatcher:{current:{readContext:function(e){return ln.__n[e.__c].props.value}}}},Gd="17.0.2";function No(e){return D.bind(null,e)}function nt(e){return!!e&&e.$$typeof===Co}function gt(e){return nt(e)?fd.apply(null,arguments):e}function Mo(e){return!!e.__k&&(ht(null,e),!0)}function Fo(e){return e&&(e.base||e.nodeType===1&&e)||null}var Lo=function(e,t){return e(t)},pr=function(e,t){return e(t)},Ro=G;function un(e){e()}function Vo(e){return e}function jo(){return[!1,un]}var Bo=he;function zo(e,t){var r=t(),n=K({h:{__:r,v:t}}),o=n[0].h,i=n[1];return he(function(){o.__=r,o.v=t,sn(o.__,t())||i({h:o})},[e,r,t]),V(function(){return sn(o.__,o.v())||i({h:o}),e(function(){sn(o.__,o.v())||i({h:o})})},[e]),r}var we={useState:K,useId:po,useReducer:lr,useEffect:V,useLayoutEffect:he,useInsertionEffect:Bo,useTransition:jo,useDeferredValue:Vo,useSyncExternalStore:zo,startTransition:un,useRef:L,useImperativeHandle:uo,useMemo:ce,useCallback:ve,useContext:ur,useDebugValue:fo,version:"17.0.2",Children:Fe,render:Eo,hydrate:Po,unmountComponentAtNode:Mo,createPortal:So,createElement:D,createContext:Ft,createFactory:No,cloneElement:gt,createRef:Ri,Fragment:G,isValidElement:nt,findDOMNode:Fo,Component:ge,PureComponent:fr,memo:bo,forwardRef:le,flushSync:pr,unstable_batchedUpdates:Lo,StrictMode:Ro,Suspense:mt,SuspenseList:bt,lazy:cn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Do};const Yd=Object.freeze(Object.defineProperty({__proto__:null,Children:Fe,Component:ge,Fragment:G,PureComponent:fr,StrictMode:Ro,Suspense:mt,SuspenseList:bt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Do,cloneElement:gt,createContext:Ft,createElement:D,createFactory:No,createPortal:So,createRef:Ri,default:we,findDOMNode:Fo,flushSync:pr,forwardRef:le,hydrate:Po,isValidElement:nt,lazy:cn,memo:bo,render:Eo,startTransition:un,unmountComponentAtNode:Mo,unstable_batchedUpdates:Lo,useCallback:ve,useContext:ur,useDebugValue:fo,useDeferredValue:Vo,useEffect:V,useErrorBoundary:Td,useId:po,useImperativeHandle:uo,useInsertionEffect:Bo,useLayoutEffect:he,useMemo:ce,useReducer:lr,useRef:L,useState:K,useSyncExternalStore:zo,useTransition:jo,version:Gd},Symbol.toStringTag,{value:"Module"}));function yt(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 Zd(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Uo(...e){return t=>e.forEach(r=>Zd(r,t))}function Vt(...e){return ve(Uo(...e),e)}function Xd(e,t=[]){let r=[];function n(i,a){const s=Ft(a),c=r.length;r=[...r,a];function u(l){const{scope:h,children:g,...m}=l,v=(h==null?void 0:h[e][c])||s,w=ce(()=>m,Object.values(m));return D(v.Provider,{value:w},g)}function f(l,h){const g=(h==null?void 0:h[e][c])||s,m=ur(g);if(m)return m;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=>Ft(a));return function(s){const c=(s==null?void 0:s[e])||i;return ce(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[n,Qd(o,...t)]}function Qd(...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 ce(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}const dn=globalThis!=null&&globalThis.document?he:()=>{},Jd=Yd["useId".toString()]||(()=>{});let ef=0;function fn(e){const[t,r]=K(Jd());return dn(()=>{e||r(n=>n??String(ef++))},[e]),e||(t?`radix-${t}`:"")}function it(e){const t=L(e);return V(()=>{t.current=e}),ce(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function tf({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=rf({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:n,s=it(r),c=ve(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 rf({defaultProp:e,onChange:t}){const r=K(e),[n]=r,o=L(n),i=it(t);return V(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),r}const pn=le((e,t)=>{const{children:r,...n}=e,o=Fe.toArray(r),i=o.find(of);if(i){const a=i.props.children,s=o.map(c=>c===i?Fe.count(a)>1?Fe.only(null):nt(a)?a.props.children:null:c);return D(hn,de({},n,{ref:t}),nt(a)?gt(a,void 0,s):null)}return D(hn,de({},n,{ref:t}),r)});pn.displayName="Slot";const hn=le((e,t)=>{const{children:r,...n}=e;return nt(r)?gt(r,{...af(n,r.props),ref:t?Uo(t,r.ref):r.ref}):Fe.count(r)>1?Fe.only(null):null});hn.displayName="SlotClone";const nf=({children:e})=>D(G,null,e);function of(e){return nt(e)&&e.type===nf}function af(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 vn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const r=le((n,o)=>{const{asChild:i,...a}=n,s=i?pn:t;return V(()=>{window[Symbol.for("radix-ui")]=!0},[]),D(s,de({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sf(e,t){e&&pr(()=>e.dispatchEvent(t))}function cf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e);V(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const mn="dismissableLayer.update",lf="dismissableLayer.pointerDownOutside",uf="dismissableLayer.focusOutside";let Ho;const df=Ft({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ff=le((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...u}=e,f=ur(df),[l,h]=K(null),g=(r=l==null?void 0:l.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,m]=K({}),v=Vt(t,N=>h(N)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(x),P=l?w.indexOf(l):-1,I=f.layersWithOutsidePointerEventsDisabled.size>0,O=P>=_,U=pf(N=>{const M=N.target,oe=[...f.branches].some(te=>te.contains(M));!O||oe||(i==null||i(N),s==null||s(N),N.defaultPrevented||c==null||c())},g),q=hf(N=>{const M=N.target;[...f.branches].some(te=>te.contains(M))||(a==null||a(N),s==null||s(N),N.defaultPrevented||c==null||c())},g);return cf(N=>{P===f.layers.size-1&&(o==null||o(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},g),V(()=>{if(l)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Ho=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),qo(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ho)}},[l,g,n,f]),V(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),qo())},[l,f]),V(()=>{const N=()=>m({});return document.addEventListener(mn,N),()=>document.removeEventListener(mn,N)},[]),D(vn.div,de({},u,{ref:v,style:{pointerEvents:I?O?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,q.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,q.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,U.onPointerDownCapture)}))});function pf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e),n=L(!1),o=L(()=>{});return V(()=>{const i=s=>{if(s.target&&!n.current){let u=function(){Wo(lf,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 hf(e,t=globalThis==null?void 0:globalThis.document){const r=it(e),n=L(!1);return V(()=>{const o=i=>{i.target&&!n.current&&Wo(uf,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 qo(){const e=new CustomEvent(mn);document.dispatchEvent(e)}function Wo(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?sf(o,i):o.dispatchEvent(i)}const bn="focusScope.autoFocusOnMount",gn="focusScope.autoFocusOnUnmount",Ko={bubbles:!1,cancelable:!0},vf=le((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,c]=K(null),u=it(o),f=it(i),l=L(null),h=Vt(t,v=>c(v)),g=L({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(n){let v=function(P){if(g.paused||!s)return;const I=P.target;s.contains(I)?l.current=I:Ue(l.current,{select:!0})},w=function(P){if(g.paused||!s)return;const I=P.relatedTarget;I!==null&&(s.contains(I)||Ue(l.current,{select:!0}))},x=function(P){if(document.activeElement===document.body)for(const O of P)O.removedNodes.length>0&&Ue(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const _=new MutationObserver(x);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),_.disconnect()}}},[n,s,g.paused]),V(()=>{if(s){Zo.add(g);const v=document.activeElement;if(!s.contains(v)){const x=new CustomEvent(bn,Ko);s.addEventListener(bn,u),s.dispatchEvent(x),x.defaultPrevented||(mf(wf(Go(s)),{select:!0}),document.activeElement===v&&Ue(s))}return()=>{s.removeEventListener(bn,u),setTimeout(()=>{const x=new CustomEvent(gn,Ko);s.addEventListener(gn,f),s.dispatchEvent(x),x.defaultPrevented||Ue(v??document.body,{select:!0}),s.removeEventListener(gn,f),Zo.remove(g)},0)}}},[s,u,f,g]);const m=ve(v=>{if(!r&&!n||g.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(w&&x){const _=v.currentTarget,[P,I]=bf(_);P&&I?!v.shiftKey&&x===I?(v.preventDefault(),r&&Ue(P,{select:!0})):v.shiftKey&&x===P&&(v.preventDefault(),r&&Ue(I,{select:!0})):x===_&&v.preventDefault()}},[r,n,g.paused]);return D(vn.div,de({tabIndex:-1},a,{ref:h,onKeyDown:m}))});function mf(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ue(n,{select:t}),document.activeElement!==r)return}function bf(e){const t=Go(e),r=Yo(t,e),n=Yo(t.reverse(),e);return[r,n]}function Go(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 Yo(e,t){for(const r of e)if(!gf(r,{upTo:t}))return r}function gf(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 yf(e){return e instanceof HTMLInputElement&&"select"in e}function Ue(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yf(e)&&t&&e.select()}}const Zo=_f();function _f(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Xo(e,t),e.unshift(t)},remove(t){var r;e=Xo(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function Xo(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function wf(e){return e.filter(t=>t.tagName!=="A")}function xf(e,t){return lr((r,n)=>{const o=t[r][n];return o??r},e)}const yn=e=>{const{present:t,children:r}=e,n=kf(t),o=typeof r=="function"?r({present:n.isPresent}):Fe.only(r),i=Vt(n.ref,o.ref);return typeof r=="function"||n.isPresent?gt(o,{ref:i}):null};yn.displayName="Presence";function kf(e){const[t,r]=K(),n=L({}),o=L(e),i=L("none"),a=e?"mounted":"unmounted",[s,c]=xf(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const u=hr(n.current);i.current=s==="mounted"?u:"none"},[s]),dn(()=>{const u=n.current,f=o.current;if(f!==e){const h=i.current,g=hr(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),dn(()=>{if(t){const u=l=>{const g=hr(n.current).includes(l.animationName);l.target===t&&g&&pr(()=>c("ANIMATION_END"))},f=l=>{l.target===t&&(i.current=hr(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:ve(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}let _n=0;function $f(){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:Qo()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:Qo()),_n++,()=>{_n===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),_n--}},[])}function Qo(){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 Se=function(){return Se=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},Se.apply(this,arguments)};function Jo(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 Sf(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 vr="right-scroll-bar-position",mr="width-before-scroll-bar",Cf="with-scroll-bars-hidden",Ef="--removed-body-scroll-bar-size";function Pf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Of(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 If(e,t){return Of(t||null,function(r){return e.forEach(function(n){return Pf(n,r)})})}function Af(e){return e}function Tf(e,t){t===void 0&&(t=Af);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 Df(e){e===void 0&&(e={});var t=Tf(null);return t.options=Se({async:!0,ssr:!1},e),t}var ea=function(e){var t=e.sideCar,r=Jo(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,Se({},r))};ea.isSideCarExport=!0;function Nf(e,t){return e.useMedium(t),ea}var ta=Df(),wn=function(){},br=le(function(e,t){var r=L(null),n=K({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),o=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,l=e.shards,h=e.sideCar,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,_=Jo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=h,I=If([r,t]),O=Se(Se({},_),o);return D(G,null,f&&D(P,{sideCar:ta,removeScrollBar:u,shards:l,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r}),a?gt(Fe.only(s),Se(Se({},O),{ref:I})):D(x,Se({},O,{className:c,ref:I}),s))});br.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},br.classNames={fullWidth:mr,zeroRight:vr};var ra,Mf=function(){if(ra)return ra;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ff(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Mf();return t&&e.setAttribute("nonce",t),e}function Lf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vf=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ff())&&(Lf(t,r),Rf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jf=function(){var e=Vf();return function(t,r){V(function(){return e.add(t),function(){e.remove()}},[t&&r])}},na=function(){var e=jf(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},Bf={left:0,top:0,right:0,gap:0},xn=function(e){return parseInt(e||"",10)||0},zf=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[xn(r),xn(n),xn(o)]},Uf=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bf;var t=zf(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])}},Hf=na(),qf=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
2
  .`.concat(Cf,` {
3
3
  overflow: hidden `).concat(n,`;
4
4
  padding-right: `).concat(s,"px ").concat(n,`;
@@ -35,11 +35,11 @@ var fm=Object.defineProperty;var pm=(et,ge,Ve)=>ge in et?fm(et,ge,{enumerable:!0
35
35
  body {
36
36
  `).concat(Ef,": ").concat(s,`px;
37
37
  }
38
- `)},Kf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=le(function(){return Uf(o)},[o]);return D(Hf,{styles:qf(i,!t,o,r?"":"!important")})},$n=!1;if(typeof window<"u")try{var gr=Object.defineProperty({},"passive",{get:function(){return $n=!0,!0}});window.addEventListener("test",gr,gr),window.removeEventListener("test",gr,gr)}catch{$n=!1}var _t=$n?{passive:!1}:!1,Wf=function(e){return e.tagName==="TEXTAREA"},sa=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Wf(e)&&r[t]==="visible")},Gf=function(e){return sa(e,"overflowY")},Yf=function(e){return sa(e,"overflowX")},la=function(e,t){var r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=ca(e,r);if(n){var o=ua(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Zf=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Xf=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ca=function(e,t){return e==="v"?Gf(t):Yf(t)},ua=function(e,t){return e==="v"?Zf(t):Xf(t)},Qf=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jf=function(e,t,r,n,o){var i=Qf(e,window.getComputedStyle(t).direction),a=i*n,s=r.target,l=t.contains(s),u=!1,p=a>0,c=0,v=0;do{var g=ua(e,s),m=g[0],h=g[1],w=g[2],k=h-w-i*m;(m||k)&&ca(e,s)&&(c+=k,v+=m),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(p&&(o&&c===0||!o&&a>c)||!p&&(o&&v===0||!o&&-a>v))&&(u=!0),u},yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},da=function(e){return[e.deltaX,e.deltaY]},fa=function(e){return e&&"current"in e?e.current:e},ep=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tp=function(e){return`
38
+ `)},Wf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=ce(function(){return Uf(o)},[o]);return D(Hf,{styles:qf(i,!t,o,r?"":"!important")})},kn=!1;if(typeof window<"u")try{var gr=Object.defineProperty({},"passive",{get:function(){return kn=!0,!0}});window.addEventListener("test",gr,gr),window.removeEventListener("test",gr,gr)}catch{kn=!1}var _t=kn?{passive:!1}:!1,Kf=function(e){return e.tagName==="TEXTAREA"},ia=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Kf(e)&&r[t]==="visible")},Gf=function(e){return ia(e,"overflowY")},Yf=function(e){return ia(e,"overflowX")},oa=function(e,t){var r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=aa(e,r);if(n){var o=sa(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Zf=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Xf=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},aa=function(e,t){return e==="v"?Gf(t):Yf(t)},sa=function(e,t){return e==="v"?Zf(t):Xf(t)},Qf=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jf=function(e,t,r,n,o){var i=Qf(e,window.getComputedStyle(t).direction),a=i*n,s=r.target,c=t.contains(s),u=!1,f=a>0,l=0,h=0;do{var g=sa(e,s),m=g[0],v=g[1],w=g[2],x=v-w-i*m;(m||x)&&aa(e,s)&&(l+=x,h+=m),s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(f&&(o&&l===0||!o&&a>l)||!f&&(o&&h===0||!o&&-a>h))&&(u=!0),u},yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ca=function(e){return[e.deltaX,e.deltaY]},la=function(e){return e&&"current"in e?e.current:e},ep=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tp=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},rp=0,wt=[];function np(e){var t=L([]),r=L([0,0]),n=L(),o=W(rp++)[0],i=W(function(){return aa()})[0],a=L(e);V(function(){a.current=e},[e]),V(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Sf([e.lockRef.current],(e.shards||[]).map(fa),!0).filter(Boolean);return h.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=me(function(h,w){if("touches"in h&&h.touches.length===2)return!a.current.allowPinchZoom;var k=yr(h),_=r.current,O="deltaX"in h?h.deltaX:_[0]-k[0],A="deltaY"in h?h.deltaY:_[1]-k[1],P,U=h.target,q=Math.abs(O)>Math.abs(A)?"h":"v";if("touches"in h&&q==="h"&&U.type==="range")return!1;var N=la(q,U);if(!N)return!0;if(N?P=q:(P=q==="v"?"h":"v",N=la(q,U)),!N)return!1;if(!n.current&&"changedTouches"in h&&(O||A)&&(n.current=P),!P)return!0;var M=n.current||P;return Jf(M,w,h,M==="h"?O:A,!0)},[]),l=me(function(h){var w=h;if(!(!wt.length||wt[wt.length-1]!==i)){var k="deltaY"in w?da(w):yr(w),_=t.current.filter(function(P){return P.name===w.type&&P.target===w.target&&ep(P.delta,k)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var O=(a.current.shards||[]).map(fa).filter(Boolean).filter(function(P){return P.contains(w.target)}),A=O.length>0?s(w,O[0]):!a.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),u=me(function(h,w,k,_){var O={name:h,delta:w,target:k,should:_};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(A){return A!==O})},1)},[]),p=me(function(h){r.current=yr(h),n.current=void 0},[]),c=me(function(h){u(h.type,da(h),h.target,s(h,e.lockRef.current))},[]),v=me(function(h){u(h.type,yr(h),h.target,s(h,e.lockRef.current))},[]);V(function(){return wt.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:v}),document.addEventListener("wheel",l,_t),document.addEventListener("touchmove",l,_t),document.addEventListener("touchstart",p,_t),function(){wt=wt.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,_t),document.removeEventListener("touchmove",l,_t),document.removeEventListener("touchstart",p,_t)}},[]);var g=e.removeScrollBar,m=e.inert;return D(G,null,m?D(i,{styles:tp(o)}):null,g?D(Kf,{gapMode:"margin"}):null)}const ip=Nf(ia,np);var pa=ce(function(e,t){return D(br,Ce({},e,{ref:t,sideCar:ip}))});pa.classNames=br.classNames;const op=pa;var ap=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xt=new WeakMap,_r=new WeakMap,wr={},Sn=0,ha=function(e){return e&&(e.host||ha(e.parentNode))},sp=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=ha(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})},lp=function(e,t,r,n){var o=sp(t,Array.isArray(e)?e:[e]);wr[r]||(wr[r]=new WeakMap);var i=wr[r],a=[],s=new Set,l=new Set(o),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};o.forEach(u);var p=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(v){if(s.has(v))p(v);else{var g=v.getAttribute(n),m=g!==null&&g!=="false",h=(xt.get(v)||0)+1,w=(i.get(v)||0)+1;xt.set(v,h),i.set(v,w),a.push(v),h===1&&m&&_r.set(v,!0),w===1&&v.setAttribute(r,"true"),m||v.setAttribute(n,"true")}})};return p(t),s.clear(),Sn++,function(){a.forEach(function(c){var v=xt.get(c)-1,g=i.get(c)-1;xt.set(c,v),i.set(c,g),v||(_r.has(c)||c.removeAttribute(n),_r.delete(c)),g||c.removeAttribute(r)}),Sn--,Sn||(xt=new WeakMap,xt=new WeakMap,_r=new WeakMap,wr={})}},cp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||ap(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),lp(n,o,r,"aria-hidden")):function(){return null}};const va="Dialog",[ma,vm]=Xd(va),[up,kt]=ma(va),dp=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=L(null),l=L(null),[u=!1,p]=tf({prop:n,defaultProp:o,onChange:i});return D(up,{scope:t,triggerRef:s,contentRef:l,contentId:pn(),titleId:pn(),descriptionId:pn(),open:u,onOpenChange:p,onOpenToggle:me(()=>p(c=>!c),[p]),modal:a},r)},fp="DialogPortal",[mm,ba]=ma(fp,{forceMount:void 0}),Cn="DialogOverlay",pp=ce((e,t)=>{const r=ba(Cn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=kt(Cn,e.__scopeDialog);return i.modal?D(_n,{present:n||i.open},D(hp,de({},o,{ref:t}))):null}),hp=ce((e,t)=>{const{__scopeDialog:r,...n}=e,o=kt(Cn,r);return D(op,{as:hn,allowPinchZoom:!0,shards:[o.contentRef]},D(mn.div,de({"data-state":ya(o.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),Bt="DialogContent",vp=ce((e,t)=>{const r=ba(Bt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=kt(Bt,e.__scopeDialog);return D(_n,{present:n||i.open},i.modal?D(mp,de({},o,{ref:t})):D(bp,de({},o,{ref:t})))}),mp=ce((e,t)=>{const r=kt(Bt,e.__scopeDialog),n=L(null),o=jt(t,r.contentRef,n);return V(()=>{const i=n.current;if(i)return cp(i)},[]),D(ga,de({},e,{ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:yt(e.onFocusOutside,i=>i.preventDefault())}))}),bp=ce((e,t)=>{const r=kt(Bt,e.__scopeDialog),n=L(!1),o=L(!1);return D(ga,de({},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 l=i.target;((s=r.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),ga=ce((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=kt(Bt,r),l=L(null),u=jt(t,l);return $f(),D(G,null,D(vf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i},D(ff,de({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ya(s.open)},a,{ref:u,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function ya(e){return e?"open":"closed"}const gp=dp,yp=pp,_p=vp;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 He(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=_a(e))&&(n&&(n+=" "),n+=t);return n}const wa=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,xa=He,En=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return xa(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 p=r==null?void 0:r[u],c=i==null?void 0:i[u];if(p===null)return null;const v=wa(p)||wa(c);return o[u][v]}),s=r&&Object.entries(r).reduce((u,p)=>{let[c,v]=p;return v===void 0||(u[c]=v),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,p)=>{let{class:c,className:v,...g}=p;return Object.entries(g).every(m=>{let[h,w]=m;return Array.isArray(w)?w.includes({...i,...s}[h]):{...i,...s}[h]===w})?[...u,c,v]:u},[]);return xa(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},fe=Symbol.for("@ts-pattern/matcher"),ka=Symbol.for("@ts-pattern/isVariadic"),xr="@ts-pattern/anonymous-select-key",Pn=e=>!!(e&&typeof e=="object"),kr=e=>e&&!!e[fe],re=(e,t,r)=>{if(kr(e)){const n=e[fe](),{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];kr(s)&&s[ka]?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),l=t.slice(n.length,o.length===0?1/0:-o.length);return n.every((u,p)=>re(u,a[p],r))&&o.every((u,p)=>re(u,s[p],r))&&(i.length===0||re(i[0],l,r))}return e.length===t.length&&e.every((a,s)=>re(a,t[s],r))}return Object.keys(e).every(n=>{const o=e[n];return(n in t||kr(i=o)&&i[fe]().matcherType==="optional")&&re(o,t[n],r);var i})}return Object.is(t,e)},be=e=>{var t,r,n;return Pn(e)?kr(e)?(t=(r=(n=e[fe]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?zt(e,be):zt(Object.values(e),be):[]},zt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function wp(...e){if(e.length===1){const[t]=e;return r=>re(t,r,()=>{})}if(e.length===2){const[t,r]=e;return re(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function ae(e){return Object.assign(e,{optional:()=>In(e),and:t=>K(e,t),or:t=>$a(e,t),select:t=>t===void 0?Ut(e):Ut(t,e)})}function On(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[ka]:!0})}}))(e),{optional:()=>On(In(e)),select:t=>On(t===void 0?Ut(e):Ut(t,e))})}function In(e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return t===void 0?(be(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:re(e,t,n),selections:r}},getSelectionKeys:()=>be(e),matcherType:"optional"})})}const xp=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},kp=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function K(...e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return{matched:e.every(o=>re(o,t,n)),selections:r}},getSelectionKeys:()=>zt(e,be),matcherType:"and"})})}function $a(...e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return zt(e,be).forEach(o=>n(o,void 0)),{matched:e.some(o=>re(o,t,n)),selections:r}},getSelectionKeys:()=>zt(e,be),matcherType:"or"})})}function R(e){return{[fe]:()=>({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 ae({[fe]:()=>({match:n=>{let o={[t??xr]:n};return{matched:r===void 0||re(r,n,(i,a)=>{o[i]=a}),selections:o}},getSelectionKeys:()=>[t??xr].concat(r===void 0?[]:be(r))})})}function Ee(e){return typeof e=="number"}function ot(e){return typeof e=="string"}function qe(e){return typeof e=="bigint"}const Sa=ae(R(function(e){return!0})),$p=Sa,at=e=>Object.assign(ae(e),{startsWith:t=>{return at(K(e,(r=t,R(n=>ot(n)&&n.startsWith(r)))));var r},endsWith:t=>{return at(K(e,(r=t,R(n=>ot(n)&&n.endsWith(r)))));var r},minLength:t=>at(K(e,(r=>R(n=>ot(n)&&n.length>=r))(t))),maxLength:t=>at(K(e,(r=>R(n=>ot(n)&&n.length<=r))(t))),includes:t=>{return at(K(e,(r=t,R(n=>ot(n)&&n.includes(r)))));var r},regex:t=>{return at(K(e,(r=t,R(n=>ot(n)&&!!n.match(r)))));var r}}),Sp=at(R(ot)),Pe=e=>Object.assign(ae(e),{between:(t,r)=>Pe(K(e,((n,o)=>R(i=>Ee(i)&&n<=i&&o>=i))(t,r))),lt:t=>Pe(K(e,(r=>R(n=>Ee(n)&&n<r))(t))),gt:t=>Pe(K(e,(r=>R(n=>Ee(n)&&n>r))(t))),lte:t=>Pe(K(e,(r=>R(n=>Ee(n)&&n<=r))(t))),gte:t=>Pe(K(e,(r=>R(n=>Ee(n)&&n>=r))(t))),int:()=>Pe(K(e,R(t=>Ee(t)&&Number.isInteger(t)))),finite:()=>Pe(K(e,R(t=>Ee(t)&&Number.isFinite(t)))),positive:()=>Pe(K(e,R(t=>Ee(t)&&t>0))),negative:()=>Pe(K(e,R(t=>Ee(t)&&t<0)))}),Cp=Pe(R(Ee)),Ke=e=>Object.assign(ae(e),{between:(t,r)=>Ke(K(e,((n,o)=>R(i=>qe(i)&&n<=i&&o>=i))(t,r))),lt:t=>Ke(K(e,(r=>R(n=>qe(n)&&n<r))(t))),gt:t=>Ke(K(e,(r=>R(n=>qe(n)&&n>r))(t))),lte:t=>Ke(K(e,(r=>R(n=>qe(n)&&n<=r))(t))),gte:t=>Ke(K(e,(r=>R(n=>qe(n)&&n>=r))(t))),positive:()=>Ke(K(e,R(t=>qe(t)&&t>0))),negative:()=>Ke(K(e,R(t=>qe(t)&&t<0)))}),Ep=Ke(R(qe)),Pp=ae(R(function(e){return typeof e=="boolean"})),Op=ae(R(function(e){return typeof e=="symbol"})),Ip=ae(R(function(e){return e==null}));var Oe={__proto__:null,matcher:fe,optional:In,array:function(...e){return On({[fe]:()=>({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 be(r).forEach(i=>{n[i]=[]}),{matched:!0,selections:n};const o=(i,a)=>{n[i]=(n[i]||[]).concat([a])};return{matched:t.every(i=>re(r,i,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:be(e[0])})})},set:function(...e){return ae({[fe]:()=>({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:xp(t,i=>re(o,i,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:be(e[0])})})},map:function(...e){return ae({[fe]:()=>({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 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:kp(t,(s,l)=>{const u=re(i,l,n),p=re(a,s,n);return u&&p}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...be(e[0]),...be(e[1])]})})},intersection:K,union:$a,not:function(e){return ae({[fe]:()=>({match:t=>({matched:!re(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:R,select:Ut,any:Sa,_:$p,string:Sp,number:Cp,bigint:Ep,boolean:Pp,symbol:Op,nullish:Ip,instanceOf:function(e){return ae(R(function(t){return r=>r instanceof t}(e)))},shape:function(e){return ae(R(wp(e)))}};const An={matched:!1,value:void 0};function We(e){return new $r(e,An)}class $r{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,p)=>{i=!0,a[u]=p},l=!n.some(u=>re(u,this.input,s))||o&&!o(this.input)?An:{matched:!0,value:r(i?xr in a?a[xr]:a:this.input,this.input)};return new $r(this.input,l)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new $r(this.input,n?{matched:!0,value:r(this.input,this.input)}:An)}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 bm="";function ke(e,t){if(!e)throw new Error(t)}function Sr(){throw new Error("Cycle detected")}var Ap=Symbol.for("preact-signals");function Tn(){if($t>1)$t--;else{for(var e,t=!1;Ht!==void 0;){var r=Ht;for(Ht=void 0,Dn++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ea(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Dn=0,$t--,t)throw e}}var Y=void 0,Ht=void 0,$t=0,Dn=0,Cr=0;function Ca(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.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=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ne(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ne.prototype.brand=Ap,ne.prototype.h=function(){return!0},ne.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)},ne.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)}},ne.prototype.subscribe=function(e){var t=this;return Mn(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},ne.prototype.valueOf=function(){return this.value},ne.prototype.toString=function(){return this.value+""},ne.prototype.toJSON=function(){return this.value},ne.prototype.peek=function(){return this.v},Object.defineProperty(ne.prototype,"value",{get:function(){var e=Ca(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(Y instanceof Ye&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Dn>100&&Sr(),this.v=e,this.i++,Cr++,$t++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Tn()}}}});function Ge(e){return new ne(e)}function Ea(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 Oa(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){ne.call(this,void 0),this.x=e,this.s=void 0,this.g=Cr-1,this.f=4}(Ye.prototype=new ne).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cr))return!0;if(this.g=Cr,this.f|=1,this.i>0&&!Ea(this))return this.f&=-2,!0;var e=Y;try{Pa(this),Y=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 Y=e,Oa(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)}ne.prototype.S.call(this,e)},Ye.prototype.U=function(e){if(this.t!==void 0&&(ne.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()||Sr(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ye.prototype,"value",{get:function(){1&this.f&&Sr();var e=Ca(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Tp(e){return new Ye(e)}function Ia(e){var t=e.u;if(e.u=void 0,typeof t=="function"){$t++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Nn(e),n}finally{Y=r,Tn()}}}function Nn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ia(e)}function Dp(e){if(Y!==this)throw new Error("Out-of-order effect");Oa(this),Y=e,this.f&=-2,8&this.f&&Nn(this),Tn()}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&&Sr(),this.f|=1,this.f&=-9,Ia(this),Pa(this),$t++;var e=Y;return Y=this,Dp.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||Nn(this)};function Mn(e){var t=new qt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Fn;function St(e,t){S[e]=t.bind(null,S[e]||function(){})}function Er(e){Fn&&Fn(),Fn=e&&e.S()}function Aa(e){var t=this,r=e.data,n=Mp(r);n.value=r;var o=le(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ni(o.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},Tp(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return o.value}Aa.displayName="_st",Object.defineProperties(ne.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Aa},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),St("__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 ne&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)}),St("__r",function(e,t){Er();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return Mn(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),Er(r),e(t)}),St("__e",function(e,t,r,n){Er(),e(t,r,n)}),St("diffed",function(e,t){Er();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 l in n){var u=i[l],p=n[l];u===void 0?(u=Np(r,l,p,o),i[l]=u):u.o(p,o)}}}e(t)});function Np(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:Mn(function(){var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}St("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)}),St("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),ye.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 Mp(e){return le(function(){return Ge(e)},[])}const Ln=(e,t)=>t.some(r=>e instanceof r);let Ta,Da;function Fp(){return Ta||(Ta=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Lp(){return Da||(Da=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Rn=new WeakMap,Vn=new WeakMap,Pr=new WeakMap;function Rp(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{r(st(e.result)),o()},a=()=>{n(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return Pr.set(t,e),t}function Vp(e){if(Rn.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)});Rn.set(e,t)}let jn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return Rn.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return st(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 Na(e){jn=e(jn)}function jp(e){return Lp().includes(e)?function(...t){return e.apply(Bn(this),t),st(this.request)}:function(...t){return st(e.apply(Bn(this),t))}}function Bp(e){return typeof e=="function"?jp(e):(e instanceof IDBTransaction&&Vp(e),Ln(e,Fp())?new Proxy(e,jn):e)}function st(e){if(e instanceof IDBRequest)return Rp(e);if(Vn.has(e))return Vn.get(e);const t=Bp(e);return t!==e&&(Vn.set(e,t),Pr.set(t,e)),t}const Bn=e=>Pr.get(e);function zp(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=st(a);return n&&a.addEventListener("upgradeneeded",l=>{n(st(a.result),l.oldVersion,l.newVersion,st(a.transaction),l)}),r&&a.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),s.then(l=>{i&&l.addEventListener("close",()=>i()),o&&l.addEventListener("versionchange",u=>o(u.oldVersion,u.newVersion,u))}).catch(()=>{}),s}const Up=["get","getKey","getAll","getAllKeys","count"],Hp=["put","add","delete","clear"],zn=new Map;function Ma(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(zn.get(t))return zn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=Hp.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||Up.includes(r)))return;const i=async function(a,...s){const l=this.transaction(a,o?"readwrite":"readonly");let u=l.store;return n&&(u=u.index(s.shift())),(await Promise.all([u[r](...s),o&&l.done]))[0]};return zn.set(t,i),i}Na(e=>({...e,get:(t,r,n)=>Ma(t,r)||e.get(t,r,n),has:(t,r)=>!!Ma(t,r)||e.has(t,r)}));const qp=["continue","continuePrimaryKey","advance"],Fa={},Un=new WeakMap,La=new WeakMap,Kp={get(e,t){if(!qp.includes(t))return e[t];let r=Fa[t];return r||(r=Fa[t]=function(...n){Un.set(this,La.get(this)[t](...n))}),r}};async function*Wp(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Kp);for(La.set(r,t),Pr.set(r,Bn(t));t;)yield r,t=await(Un.get(r)||t.continue()),Un.delete(r)}function Ra(e,t){return t===Symbol.asyncIterator&&Ln(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Ln(e,[IDBIndex,IDBObjectStore])}Na(e=>({...e,get(t,r,n){return Ra(t,r)?Wp:e.get(t,r,n)},has(t,r){return Ra(t,r)||e.has(t,r)}}));const Kt=e=>We(e).with(Oe.number.lte(1e3),()=>`${Math.round(e)}KB`).with(Oe.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),Va=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Gp=e=>Object.entries(e).reduce((r,[n,o])=>(r[n]=o.value,r),{}),Or=e=>t=>t?t.type===e:!1;class Wt extends Error{constructor(){super("Aborted")}}function ja(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const Ba=e=>typeof e=="string",Yp=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),za=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:Yp()}),Ua=typeof window>"u"?void 0:zp("inploi-chatbot",2,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Gt={getStateData:async(e,t)=>{var n;const r=Ha({...e,flowKeys:t});return(n=await Ua)==null?void 0:n.get("state",r)},setStateData:ja(async e=>{var r;const t=Ha(e);return(r=await Ua)==null?void 0:r.put("state",e.data,t)},1e3)},Ir=(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(Ir(e,o,r,n+s).remainingSteps,Ir(e,a,r,n+s).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const l=s+Ir(e,o,r,n+s).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:l}),{stepsMade:n,remainingSteps:l}},Zp=e=>{const t={},r=e.find(n=>n.isHead);return r&&Ir(e,r,(n,o)=>{t[n]=o}),t},Ha=e=>[...e.flowKeys,e.id,e.version].join("/"),Ze=Ge({state:"idle"}),Yt=e=>{const{state:t,flow:r}=Ze.value;if(t!=="loaded")return;ke(r,"No flow to update");const n=e(r.data);r.data=n,Ze.value={state:t,flow:r},Gt.setStateData(r)},T={current$:Ze,viewState$:Ge("closed"),inputHeight$:Ge(53),startFlow:async({flow:e,context:t,flowKeys:r,title:n})=>{const i={data:await Gt.getStateData(e,r)??za(),startedAt:new Date,nodeIdToProgress:Zp(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n};Ze.value={state:"loaded",flow:i},Gt.setStateData(i)},cancelCurrentFlow:()=>{Ze.value={state:"idle"},T.viewState$.value="closed"},markAsFinished:()=>Yt(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Yt(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=Ze.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=za();Ze.value={state:e,flow:{...t,data:r,startedAt:new Date}},Gt.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Yt(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=Ze.value;ke(t==="loaded","Application not loaded");const n=r.data.messages.filter(o=>!o.groupId||!e.includes(o.groupId));r.data.messages=n,Gt.setStateData(r)},setSubmission:(e,t)=>Yt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Yt(t=>({...t,currentInput:e??null}))};var Xp=0;function d(e,t,r,n,o,i){var a,s,l={};for(s in t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Xp,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return S.vnode&&S.vnode(u),u}const Qp=({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})]})]}),Jp=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"})})})]}),qa=()=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Jp,{class:"text-neutral-6 h-8 w-8"})}),eh=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)}%`},Ar=({class:e,children:t,...r})=>d("button",{class:He("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})}),th=()=>{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 d("div",{class:"bg-accent-3",children:d("div",{style:{width:eh(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},rh=({children:e})=>{const t=T.viewState$;return d(G,{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,"aria-hidden":!0,onClick:()=>{t.value==="minimised"?t.value="maximised":t.value="minimised"},class:"h-full flex-grow overflow-hidden px-4 py-1",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(G,{children:[d(Ar,{"aria-label":"Maximise job application",onClick:()=>t.value="maximised",children:d("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),d(Ar,{"aria-label":"Close application",onClick:T.cancelCurrentFlow,children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):d(G,{children:[T.current$.value.state==="loaded"&&d(Ar,{"aria-label":"Restart",onClick:()=>{T.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(Ar,{"aria-label":"Minimise application",onClick:()=>t.value="minimised",children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),d(th,{})]})})},nh=cn(()=>Promise.resolve().then(()=>im).then(e=>e.ChatbotBody)),ih=En("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",{variants:{view:{closed:"hidden",minimised:"h-[var(--header-height)] animate-slide-in-bottom",maximised:"h-[var(--content-height)] animate-maximise"}}}),oh=({logger:e,apiClient:t,analytics:r})=>{const{state:n,flow:o,error:i}=T.current$.value,a=T.viewState$.value,s=n!=="idle"&&a==="maximised",l=L(null);return d(gp,{open:s,modal:s,children:[d(yp,{class:"bg-overlay animate-fade-in pointer-events-none fixed inset-0"}),d(_p,{forceMount:!0,asChild:!0,children:d("div",{ref:l,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:ih({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(rh,{children:o==null?void 0:o.title}),We({state:n,view:a}).with({view:"closed"},()=>null).with({view:"minimised"},()=>null).with({state:"idle"},()=>null).with({state:"loading"},()=>d(qa,{},"loading")).with({state:"loaded"},()=>d(mt,{fallback:d(qa,{},"loading"),children:d(nh,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>d(Qp,{message:i})).exhaustive()]})})})]})},Hn=Se({id:Xi(he(),String),version:tn(),build:tn(),nodes:to(eo()),context_schema:yd(gd(rn(he(),Se({required:ro(),type:kd([no("string"),no("number")])}))))}),ah=Se({flow:Hn}),sh=Se({company:Se({name:he()}),flow:Hn,job:Se({id:Xi(he(),String),title:he()})}),lh=Se({flow:Hn,title:he(),flowKeys:to(he()),context:rn(he(),eo())}),ch=`#isdk{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 *{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 .right-3{right:.75rem}#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%);height:var(--header-height)}to{transform:translateY(0);height:var(--content-height)}}#isdk .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes slide-in-bottom{0%{transform:translateY(-100%)}to{transform:translateY(0)}}#isdk .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.16,1,.3,1)}#isdk .cursor-pointer{cursor:pointer}#isdk .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#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 .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-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-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-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 .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 .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\\: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\\: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)}
42
- `,Ka="isdk",uh={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"},dh=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(Ka);if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.id=Ka,t}});var fh=["1","2","3","4","5","6","7","8","9","10","11","12"],ph={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]}},hh=(e,t=1,r)=>n=>{const[o,i]=ph[r][n];return"oklch("+o+"% "+i*t+" "+e+")"},qn=e=>{const t=hh(e.hue,e.chroma,e.mode);return Object.fromEntries(fh.map(r=>[e.prefix+r,e.transform(t(r))]))},Kn=e=>e,vh=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)},Tr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Wn=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(Tr(e)&&Tr(r))for(const n in r){const o=r[n];if(Tr(o)){e[n]||Object.assign(e,{[n]:{}});const i=e[n];Tr(i)&&Wn(i,o)}else Object.assign(e,{[n]:r[n]})}return Wn(e,...t)},mh=e=>{function t(r,n){const o=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${o}`:`var(--${o})`}return t},bh=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:o,getToken:i}=n,a=v=>i("reference",v.toString()),s=e({theme:o}),l=t({theme:o,core:a,raw:{core:s}}),u=r({theme:o,core:a,semantic:a,raw:{core:s,semantic:l}}),p=vh(Wn(s,l,u)),c=([v,g],m)=>{const h=[m,v].filter(Boolean).join(".");return typeof g=="object"?Object.entries(g).flatMap(w=>c(w,h)):[[n.getToken("declaration",h),g]]};return{values:p,declarations:Object.fromEntries(Object.entries(p).flatMap(v=>c(v))),ref:v=>i("reference",v.toString())}}})})})});const[Gn,Yn,Wa]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],gh=bh().core(({theme:e})=>({color:{black:Gn,white:Yn,lowest:e.mode==="light"?Yn:Gn,highest:e.mode==="light"?Gn:Yn,...qn({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:Kn}),...qn({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:Kn}),...qn({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:Kn})},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:Wa,"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":Wa,"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")}}}),yh=mh({prefix:"i-"}),_h=e=>{const t=gh.from({theme:e,getToken:yh}),r=Object.entries(t.declarations).map(([n,o])=>`${n}: ${o};`);return`#isdk {
41
+ `)},rp=0,wt=[];function np(e){var t=L([]),r=L([0,0]),n=L(),o=K(rp++)[0],i=K(function(){return na()})[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=Sf([e.lockRef.current],(e.shards||[]).map(la),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=ve(function(v,w){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var x=yr(v),_=r.current,P="deltaX"in v?v.deltaX:_[0]-x[0],I="deltaY"in v?v.deltaY:_[1]-x[1],O,U=v.target,q=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in v&&q==="h"&&U.type==="range")return!1;var N=oa(q,U);if(!N)return!0;if(N?O=q:(O=q==="v"?"h":"v",N=oa(q,U)),!N)return!1;if(!n.current&&"changedTouches"in v&&(P||I)&&(n.current=O),!O)return!0;var M=n.current||O;return Jf(M,w,v,M==="h"?P:I,!0)},[]),c=ve(function(v){var w=v;if(!(!wt.length||wt[wt.length-1]!==i)){var x="deltaY"in w?ca(w):yr(w),_=t.current.filter(function(O){return O.name===w.type&&O.target===w.target&&ep(O.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var P=(a.current.shards||[]).map(la).filter(Boolean).filter(function(O){return O.contains(w.target)}),I=P.length>0?s(w,P[0]):!a.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),u=ve(function(v,w,x,_){var P={name:v,delta:w,target:x,should:_};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),f=ve(function(v){r.current=yr(v),n.current=void 0},[]),l=ve(function(v){u(v.type,ca(v),v.target,s(v,e.lockRef.current))},[]),h=ve(function(v){u(v.type,yr(v),v.target,s(v,e.lockRef.current))},[]);V(function(){return wt.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",c,_t),document.addEventListener("touchmove",c,_t),document.addEventListener("touchstart",f,_t),function(){wt=wt.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,_t),document.removeEventListener("touchmove",c,_t),document.removeEventListener("touchstart",f,_t)}},[]);var g=e.removeScrollBar,m=e.inert;return D(G,null,m?D(i,{styles:tp(o)}):null,g?D(Wf,{gapMode:"margin"}):null)}const ip=Nf(ta,np);var ua=le(function(e,t){return D(br,Se({},e,{ref:t,sideCar:ip}))});ua.classNames=br.classNames;const op=ua;var ap=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xt=new WeakMap,_r=new WeakMap,wr={},$n=0,da=function(e){return e&&(e.host||da(e.parentNode))},sp=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=da(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})},cp=function(e,t,r,n){var o=sp(t,Array.isArray(e)?e:[e]);wr[r]||(wr[r]=new WeakMap);var i=wr[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(h){if(s.has(h))f(h);else{var g=h.getAttribute(n),m=g!==null&&g!=="false",v=(xt.get(h)||0)+1,w=(i.get(h)||0)+1;xt.set(h,v),i.set(h,w),a.push(h),v===1&&m&&_r.set(h,!0),w===1&&h.setAttribute(r,"true"),m||h.setAttribute(n,"true")}})};return f(t),s.clear(),$n++,function(){a.forEach(function(l){var h=xt.get(l)-1,g=i.get(l)-1;xt.set(l,h),i.set(l,g),h||(_r.has(l)||l.removeAttribute(n),_r.delete(l)),g||l.removeAttribute(r)}),$n--,$n||(xt=new WeakMap,xt=new WeakMap,_r=new WeakMap,wr={})}},lp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||ap(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),cp(n,o,r,"aria-hidden")):function(){return null}};const fa="Dialog",[pa,hm]=Xd(fa),[up,kt]=pa(fa),dp=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]=tf({prop:n,defaultProp:o,onChange:i});return D(up,{scope:t,triggerRef:s,contentRef:c,contentId:fn(),titleId:fn(),descriptionId:fn(),open:u,onOpenChange:f,onOpenToggle:ve(()=>f(l=>!l),[f]),modal:a},r)},fp="DialogPortal",[vm,ha]=pa(fp,{forceMount:void 0}),Sn="DialogOverlay",pp=le((e,t)=>{const r=ha(Sn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=kt(Sn,e.__scopeDialog);return i.modal?D(yn,{present:n||i.open},D(hp,de({},o,{ref:t}))):null}),hp=le((e,t)=>{const{__scopeDialog:r,...n}=e,o=kt(Sn,r);return D(op,{as:pn,allowPinchZoom:!0,shards:[o.contentRef]},D(vn.div,de({"data-state":ma(o.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),jt="DialogContent",vp=le((e,t)=>{const r=ha(jt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=kt(jt,e.__scopeDialog);return D(yn,{present:n||i.open},i.modal?D(mp,de({},o,{ref:t})):D(bp,de({},o,{ref:t})))}),mp=le((e,t)=>{const r=kt(jt,e.__scopeDialog),n=L(null),o=Vt(t,r.contentRef,n);return V(()=>{const i=n.current;if(i)return lp(i)},[]),D(va,de({},e,{ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:yt(e.onFocusOutside,i=>i.preventDefault())}))}),bp=le((e,t)=>{const r=kt(jt,e.__scopeDialog),n=L(!1),o=L(!1);return D(va,de({},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()}}))}),va=le((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=kt(jt,r),c=L(null),u=Vt(t,c);return $f(),D(G,null,D(vf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i},D(ff,de({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ma(s.open)},a,{ref:u,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function ma(e){return e?"open":"closed"}const gp=dp,yp=pp,_p=vp;function ba(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=ba(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function He(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ba(e))&&(n&&(n+=" "),n+=t);return n}const ga=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ya=He,Cn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ya(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 h=ga(f)||ga(l);return o[u][h]}),s=r&&Object.entries(r).reduce((u,f)=>{let[l,h]=f;return h===void 0||(u[l]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:l,className:h,...g}=f;return Object.entries(g).every(m=>{let[v,w]=m;return Array.isArray(w)?w.includes({...i,...s}[v]):{...i,...s}[v]===w})?[...u,l,h]:u},[]);return ya(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},fe=Symbol.for("@ts-pattern/matcher"),_a=Symbol.for("@ts-pattern/isVariadic"),xr="@ts-pattern/anonymous-select-key",En=e=>!!(e&&typeof e=="object"),kr=e=>e&&!!e[fe],re=(e,t,r)=>{if(kr(e)){const n=e[fe](),{matched:o,selections:i}=n.match(t);return o&&i&&Object.keys(i).forEach(a=>r(a,i[a])),o}if(En(e)){if(!En(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];kr(s)&&s[_a]?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)=>re(u,a[f],r))&&o.every((u,f)=>re(u,s[f],r))&&(i.length===0||re(i[0],c,r))}return e.length===t.length&&e.every((a,s)=>re(a,t[s],r))}return Object.keys(e).every(n=>{const o=e[n];return(n in t||kr(i=o)&&i[fe]().matcherType==="optional")&&re(o,t[n],r);var i})}return Object.is(t,e)},me=e=>{var t,r,n;return En(e)?kr(e)?(t=(r=(n=e[fe]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Bt(e,me):Bt(Object.values(e),me):[]},Bt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function wp(...e){if(e.length===1){const[t]=e;return r=>re(t,r,()=>{})}if(e.length===2){const[t,r]=e;return re(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function ae(e){return Object.assign(e,{optional:()=>On(e),and:t=>W(e,t),or:t=>wa(e,t),select:t=>t===void 0?zt(e):zt(t,e)})}function Pn(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[_a]:!0})}}))(e),{optional:()=>Pn(On(e)),select:t=>Pn(t===void 0?zt(e):zt(t,e))})}function On(e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return t===void 0?(me(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:re(e,t,n),selections:r}},getSelectionKeys:()=>me(e),matcherType:"optional"})})}const xp=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},kp=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function W(...e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return{matched:e.every(o=>re(o,t,n)),selections:r}},getSelectionKeys:()=>Bt(e,me),matcherType:"and"})})}function wa(...e){return ae({[fe]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return Bt(e,me).forEach(o=>n(o,void 0)),{matched:e.some(o=>re(o,t,n)),selections:r}},getSelectionKeys:()=>Bt(e,me),matcherType:"or"})})}function R(e){return{[fe]:()=>({match:t=>({matched:!!e(t)})})}}function zt(...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 ae({[fe]:()=>({match:n=>{let o={[t??xr]:n};return{matched:r===void 0||re(r,n,(i,a)=>{o[i]=a}),selections:o}},getSelectionKeys:()=>[t??xr].concat(r===void 0?[]:me(r))})})}function Ce(e){return typeof e=="number"}function ot(e){return typeof e=="string"}function qe(e){return typeof e=="bigint"}const xa=ae(R(function(e){return!0})),$p=xa,at=e=>Object.assign(ae(e),{startsWith:t=>{return at(W(e,(r=t,R(n=>ot(n)&&n.startsWith(r)))));var r},endsWith:t=>{return at(W(e,(r=t,R(n=>ot(n)&&n.endsWith(r)))));var r},minLength:t=>at(W(e,(r=>R(n=>ot(n)&&n.length>=r))(t))),maxLength:t=>at(W(e,(r=>R(n=>ot(n)&&n.length<=r))(t))),includes:t=>{return at(W(e,(r=t,R(n=>ot(n)&&n.includes(r)))));var r},regex:t=>{return at(W(e,(r=t,R(n=>ot(n)&&!!n.match(r)))));var r}}),Sp=at(R(ot)),Ee=e=>Object.assign(ae(e),{between:(t,r)=>Ee(W(e,((n,o)=>R(i=>Ce(i)&&n<=i&&o>=i))(t,r))),lt:t=>Ee(W(e,(r=>R(n=>Ce(n)&&n<r))(t))),gt:t=>Ee(W(e,(r=>R(n=>Ce(n)&&n>r))(t))),lte:t=>Ee(W(e,(r=>R(n=>Ce(n)&&n<=r))(t))),gte:t=>Ee(W(e,(r=>R(n=>Ce(n)&&n>=r))(t))),int:()=>Ee(W(e,R(t=>Ce(t)&&Number.isInteger(t)))),finite:()=>Ee(W(e,R(t=>Ce(t)&&Number.isFinite(t)))),positive:()=>Ee(W(e,R(t=>Ce(t)&&t>0))),negative:()=>Ee(W(e,R(t=>Ce(t)&&t<0)))}),Cp=Ee(R(Ce)),We=e=>Object.assign(ae(e),{between:(t,r)=>We(W(e,((n,o)=>R(i=>qe(i)&&n<=i&&o>=i))(t,r))),lt:t=>We(W(e,(r=>R(n=>qe(n)&&n<r))(t))),gt:t=>We(W(e,(r=>R(n=>qe(n)&&n>r))(t))),lte:t=>We(W(e,(r=>R(n=>qe(n)&&n<=r))(t))),gte:t=>We(W(e,(r=>R(n=>qe(n)&&n>=r))(t))),positive:()=>We(W(e,R(t=>qe(t)&&t>0))),negative:()=>We(W(e,R(t=>qe(t)&&t<0)))}),Ep=We(R(qe)),Pp=ae(R(function(e){return typeof e=="boolean"})),Op=ae(R(function(e){return typeof e=="symbol"})),Ip=ae(R(function(e){return e==null}));var Pe={__proto__:null,matcher:fe,optional:On,array:function(...e){return Pn({[fe]:()=>({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 me(r).forEach(i=>{n[i]=[]}),{matched:!0,selections:n};const o=(i,a)=>{n[i]=(n[i]||[]).concat([a])};return{matched:t.every(i=>re(r,i,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:me(e[0])})})},set:function(...e){return ae({[fe]:()=>({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:xp(t,i=>re(o,i,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:me(e[0])})})},map:function(...e){return ae({[fe]:()=>({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:kp(t,(s,c)=>{const u=re(i,c,n),f=re(a,s,n);return u&&f}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...me(e[0]),...me(e[1])]})})},intersection:W,union:wa,not:function(e){return ae({[fe]:()=>({match:t=>({matched:!re(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:R,select:zt,any:xa,_:$p,string:Sp,number:Cp,bigint:Ep,boolean:Pp,symbol:Op,nullish:Ip,instanceOf:function(e){return ae(R(function(t){return r=>r instanceof t}(e)))},shape:function(e){return ae(R(wp(e)))}};const In={matched:!1,value:void 0};function Ke(e){return new $r(e,In)}class $r{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=>re(u,this.input,s))||o&&!o(this.input)?In:{matched:!0,value:r(i?xr in a?a[xr]:a:this.input,this.input)};return new $r(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new $r(this.input,n?{matched:!0,value:r(this.input,this.input)}:In)}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 mm="";function xe(e,t){if(!e)throw new Error(t)}function Sr(){throw new Error("Cycle detected")}var Ap=Symbol.for("preact-signals");function An(){if($t>1)$t--;else{for(var e,t=!1;Ut!==void 0;){var r=Ut;for(Ut=void 0,Tn++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&$a(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Tn=0,$t--,t)throw e}}var Y=void 0,Ut=void 0,$t=0,Tn=0,Cr=0;function ka(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.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=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ne(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ne.prototype.brand=Ap,ne.prototype.h=function(){return!0},ne.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)},ne.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)}},ne.prototype.subscribe=function(e){var t=this;return Nn(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},ne.prototype.valueOf=function(){return this.value},ne.prototype.toString=function(){return this.value+""},ne.prototype.toJSON=function(){return this.value},ne.prototype.peek=function(){return this.v},Object.defineProperty(ne.prototype,"value",{get:function(){var e=ka(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(Y instanceof Ye&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Tn>100&&Sr(),this.v=e,this.i++,Cr++,$t++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{An()}}}});function Ge(e){return new ne(e)}function $a(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 Sa(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 Ca(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){ne.call(this,void 0),this.x=e,this.s=void 0,this.g=Cr-1,this.f=4}(Ye.prototype=new ne).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cr))return!0;if(this.g=Cr,this.f|=1,this.i>0&&!$a(this))return this.f&=-2,!0;var e=Y;try{Sa(this),Y=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 Y=e,Ca(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)}ne.prototype.S.call(this,e)},Ye.prototype.U=function(e){if(this.t!==void 0&&(ne.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()||Sr(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ye.prototype,"value",{get:function(){1&this.f&&Sr();var e=ka(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Tp(e){return new Ye(e)}function Ea(e){var t=e.u;if(e.u=void 0,typeof t=="function"){$t++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Dn(e),n}finally{Y=r,An()}}}function Dn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ea(e)}function Dp(e){if(Y!==this)throw new Error("Out-of-order effect");Ca(this),Y=e,this.f&=-2,8&this.f&&Dn(this),An()}function Ht(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ht.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()}},Ht.prototype.S=function(){1&this.f&&Sr(),this.f|=1,this.f&=-9,Ea(this),Sa(this),$t++;var e=Y;return Y=this,Dp.bind(this,e)},Ht.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ut,Ut=this)},Ht.prototype.d=function(){this.f|=8,1&this.f||Dn(this)};function Nn(e){var t=new Ht(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Mn;function St(e,t){S[e]=t.bind(null,S[e]||function(){})}function Er(e){Mn&&Mn(),Mn=e&&e.S()}function Pa(e){var t=this,r=e.data,n=Mp(r);n.value=r;var o=ce(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ti(o.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},Tp(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return o.value}Pa.displayName="_st",Object.defineProperties(ne.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Pa},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),St("__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 ne&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)}),St("__r",function(e,t){Er();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return Nn(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),Er(r),e(t)}),St("__e",function(e,t,r,n){Er(),e(t,r,n)}),St("diffed",function(e,t){Er();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=Np(r,c,f,o),i[c]=u):u.o(f,o)}}}e(t)});function Np(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:Nn(function(){var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}St("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)}),St("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),ge.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 Mp(e){return ce(function(){return Ge(e)},[])}const Fn=(e,t)=>t.some(r=>e instanceof r);let Oa,Ia;function Fp(){return Oa||(Oa=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Lp(){return Ia||(Ia=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ln=new WeakMap,Rn=new WeakMap,Pr=new WeakMap;function Rp(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{r(st(e.result)),o()},a=()=>{n(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return Pr.set(t,e),t}function Vp(e){if(Ln.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)});Ln.set(e,t)}let Vn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return Ln.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return st(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 Aa(e){Vn=e(Vn)}function jp(e){return Lp().includes(e)?function(...t){return e.apply(jn(this),t),st(this.request)}:function(...t){return st(e.apply(jn(this),t))}}function Bp(e){return typeof e=="function"?jp(e):(e instanceof IDBTransaction&&Vp(e),Fn(e,Fp())?new Proxy(e,Vn):e)}function st(e){if(e instanceof IDBRequest)return Rp(e);if(Rn.has(e))return Rn.get(e);const t=Bp(e);return t!==e&&(Rn.set(e,t),Pr.set(t,e)),t}const jn=e=>Pr.get(e);function zp(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=st(a);return n&&a.addEventListener("upgradeneeded",c=>{n(st(a.result),c.oldVersion,c.newVersion,st(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 Up=["get","getKey","getAll","getAllKeys","count"],Hp=["put","add","delete","clear"],Bn=new Map;function Ta(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Bn.get(t))return Bn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=Hp.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||Up.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 Bn.set(t,i),i}Aa(e=>({...e,get:(t,r,n)=>Ta(t,r)||e.get(t,r,n),has:(t,r)=>!!Ta(t,r)||e.has(t,r)}));const qp=["continue","continuePrimaryKey","advance"],Da={},zn=new WeakMap,Na=new WeakMap,Wp={get(e,t){if(!qp.includes(t))return e[t];let r=Da[t];return r||(r=Da[t]=function(...n){zn.set(this,Na.get(this)[t](...n))}),r}};async function*Kp(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Wp);for(Na.set(r,t),Pr.set(r,jn(t));t;)yield r,t=await(zn.get(r)||t.continue()),zn.delete(r)}function Ma(e,t){return t===Symbol.asyncIterator&&Fn(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Fn(e,[IDBIndex,IDBObjectStore])}Aa(e=>({...e,get(t,r,n){return Ma(t,r)?Kp:e.get(t,r,n)},has(t,r){return Ma(t,r)||e.has(t,r)}}));const qt=e=>Ke(e).with(Pe.number.lte(1e3),()=>`${Math.round(e)}KB`).with(Pe.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),Fa=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Gp=e=>Object.entries(e).reduce((r,[n,o])=>(r[n]=o.value,r),{}),Or=e=>t=>t?t.type===e:!1;class Wt extends Error{constructor(){super("Aborted")}}function La(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const Ra=e=>typeof e=="string",Yp=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),Va=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:Yp()}),ja=typeof window>"u"?void 0:zp("inploi-chatbot",3,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Kt={getStateData:async(e,t)=>{var n;const r=Ba({...e,flowKeys:t});return(n=await ja)==null?void 0:n.get("state",r)},setStateData:La(async e=>{var r;const t=Ba(e);return(r=await ja)==null?void 0:r.put("state",e.data,t)},1e3)},Ir=(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(Ir(e,o,r,n+s).remainingSteps,Ir(e,a,r,n+s).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const c=s+Ir(e,o,r,n+s).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:c}),{stepsMade:n,remainingSteps:c}},Zp=e=>{const t={},r=e.find(n=>n.isHead);return r&&Ir(e,r,(n,o)=>{t[n]=o}),t},Ba=e=>[...e.flowKeys,e.id,e.version].join("/"),Ze=Ge({state:"idle"}),Gt=e=>{const{state:t,flow:r}=Ze.value;if(t!=="loaded")return;xe(r,"No flow to update");const n=e(r.data);r.data=n,Ze.value={state:t,flow:r},Kt.setStateData(r)},T={current$:Ze,viewState$:Ge("closed"),inputHeight$:Ge(53),startFlow:async({flow:e,context:t={},flowKeys:r,title:n,analytics:o})=>{const a={data:await Kt.getStateData(e,r)??Va(),startedAt:new Date,nodeIdToProgress:Zp(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n,analytics:o};Ze.value={state:"loaded",flow:a},Kt.setStateData(a)},cancelCurrentFlow:()=>{Ze.value={state:"idle"},T.viewState$.value="closed"},markAsFinished:()=>Gt(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Gt(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=Ze.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=Va();Ze.value={state:e,flow:{...t,data:r,startedAt:new Date}},Kt.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Gt(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=Ze.value;xe(t==="loaded","Application not loaded");const n=r.data.messages.filter(o=>!o.groupId||!e.includes(o.groupId));r.data.messages=n,Kt.setStateData(r)},setSubmission:(e,t)=>Gt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Gt(t=>({...t,currentInput:e??null}))};var Xp=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:--Xp,__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 Qp=({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})]})]}),Jp=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"})})})]}),za=()=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Jp,{class:"text-neutral-6 h-8 w-8"})}),eh=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)}%`},Ar=({class:e,children:t,...r})=>d("button",{class:He("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})}),th=()=>{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 d("div",{class:"bg-accent-3",children:d("div",{style:{width:eh(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},rh=({children:e})=>{const t=T.viewState$;return d(G,{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,"aria-hidden":!0,onClick:()=>{t.value==="minimised"?t.value="maximised":t.value="minimised"},class:"h-full flex-grow overflow-hidden px-4 py-1",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(G,{children:[d(Ar,{"aria-label":"Maximise job application",onClick:()=>t.value="maximised",children:d("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),d(Ar,{"aria-label":"Close application",onClick:T.cancelCurrentFlow,children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):d(G,{children:[T.current$.value.state==="loaded"&&d(Ar,{"aria-label":"Restart",onClick:()=>{T.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(Ar,{"aria-label":"Minimise application",onClick:()=>t.value="minimised",children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),d(th,{})]})})},nh=cn(()=>Promise.resolve().then(()=>nm).then(e=>e.ChatbotBody)),ih=Cn("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",{variants:{view:{closed:"hidden",minimised:"h-[var(--header-height)] animate-slide-in-bottom",maximised:"h-[var(--content-height)] animate-maximise"}}}),oh=({logger:e,apiClient:t,analytics:r})=>{const{state:n,flow:o,error:i}=T.current$.value,a=T.viewState$.value,s=n!=="idle"&&a==="maximised",c=L(null);return d(gp,{open:s,modal:s,children:[d(yp,{class:"bg-overlay animate-fade-in pointer-events-none fixed inset-0 isolate"}),d(_p,{forceMount:!0,asChild:!0,children:d("div",{ref:c,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:ih({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(rh,{children:o==null?void 0:o.title}),Ke({state:n,view:a}).with({view:"closed"},()=>null).with({view:"minimised"},()=>null).with({state:"idle"},()=>null).with({state:"loading"},()=>d(za,{},"loading")).with({state:"loaded"},()=>d(mt,{fallback:d(za,{},"loading"),children:d(nh,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>d(Qp,{message:i})).exhaustive()]})})})]})},Ua=Ne({id:Yi($e(),String),version:tn(),build:tn(),nodes:bd(md()),context_schema:yd(gd(eo($e(),Ne({required:Qi(),type:kd([Ji("string"),Ji("number")])}))))}),ah=Ne({flow:Ua}),sh=Ne({company:Ne({name:$e()}),flow:Ua,job:Ne({id:Yi($e(),String),title:$e()})}),ch=`#isdk{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 *{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 .right-3{right:.75rem}#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%);height:var(--header-height)}to{transform:translateY(0);height:var(--content-height)}}#isdk .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes slide-in-bottom{0%{transform:translateY(-100%)}to{transform:translateY(0)}}#isdk .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.16,1,.3,1)}#isdk .cursor-pointer{cursor:pointer}#isdk .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#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 .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-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-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-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 .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 .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\\: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\\: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)}
42
+ `,Ha="isdk",lh={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"},uh=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(Ha);if(e)return document.body.appendChild(e),e;const t=document.createElement("div");return document.body.appendChild(t),t.id=Ha,t}});var dh=["1","2","3","4","5","6","7","8","9","10","11","12"],fh={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]}},ph=(e,t=1,r)=>n=>{const[o,i]=fh[r][n];return"oklch("+o+"% "+i*t+" "+e+")"},Un=e=>{const t=ph(e.hue,e.chroma,e.mode);return Object.fromEntries(dh.map(r=>[e.prefix+r,e.transform(t(r))]))},Hn=e=>e,hh=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)},Tr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),qn=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(Tr(e)&&Tr(r))for(const n in r){const o=r[n];if(Tr(o)){e[n]||Object.assign(e,{[n]:{}});const i=e[n];Tr(i)&&qn(i,o)}else Object.assign(e,{[n]:r[n]})}return qn(e,...t)},vh=e=>{function t(r,n){const o=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${o}`:`var(--${o})`}return t},mh=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:o,getToken:i}=n,a=h=>i("reference",h.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=hh(qn(s,c,u)),l=([h,g],m)=>{const v=[m,h].filter(Boolean).join(".");return typeof g=="object"?Object.entries(g).flatMap(w=>l(w,v)):[[n.getToken("declaration",v),g]]};return{values:f,declarations:Object.fromEntries(Object.entries(f).flatMap(h=>l(h))),ref:h=>i("reference",h.toString())}}})})})});const[Wn,Kn,qa]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],bh=mh().core(({theme:e})=>({color:{black:Wn,white:Kn,lowest:e.mode==="light"?Kn:Wn,highest:e.mode==="light"?Wn:Kn,...Un({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:Hn}),...Un({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:Hn}),...Un({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:Hn})},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:qa,"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":qa,"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")}}}),gh=vh({prefix:"i-"}),yh=e=>{const t=bh.from({theme:e,getToken:gh}),r=Object.entries(t.declarations).map(([n,o])=>`${n}: ${o};`);return`#isdk {
43
43
  ${r.concat(r).join(`
44
44
  `)}
45
- }`},Ga=({context:e,schema:t})=>{if(t)for(const r in t){const n=t[r];if(!n)continue;const o=Dt(e,r,null);if(n.required&&o===null)throw new Error(`Configuration error in context: ${r} is required`);switch(n.type){case"number":if(typeof o!="number")throw new Error(`Configuration error in context: ${r} is not a number`);break;case"string":if(typeof o!="string")throw new Error(`Configuration error in context: ${r} is not a string`);break;default:n.type}}},wh=({_internal_domManager:e=dh(),theme:t})=>et(({apiClient:r,logger:n,analytics:o})=>{let i=!1;const a=()=>{if(typeof window>"u")return;const s=[D("style",{id:"inploi-chatbot-styles"},ch),D("style",{id:"inploi-chatbot-theme"},_h(t))],l=e.getOrCreateChatbotElement();ht(D(G,{},[s,D(oh,{apiClient:r,logger:n,analytics:o})]),l),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=>r.fetch(`/flow/job/${s}`).then(l=>{const u=Rt(sh,l);return{context:{job_id:u.job.id,flow_id:u.flow.id,flow_version:u.flow.version},flow:u.flow,title:`Applying for “${u.job.title}”`,flowKeys:[u.job.id]}}),fetchFlowById:async s=>r.fetch(`/flow/id/${s}`).then(l=>{const u=Rt(ah,l);return{flow:u.flow,context:{flow_id:u.flow.id,flow_version:u.flow.version},title:"Chatbot",flowKeys:[]}}),open:async s=>{if(!(typeof window>"u"))try{T.cancelCurrentFlow(),T.viewState$.value="maximised",i||a(),s instanceof Promise?(T.current$.value={state:"loading"},s.then(async l=>{const u=Rt(lh,l);Ga({context:u.context,schema:u.flow.context_schema}),T.startFlow(u)}).catch(l=>{const u=l instanceof Error?l.message:"An error occurred";T.current$.value={state:"error",error:u}})):(Ga({context:s.context,schema:s.flow.context_schema}),T.startFlow(s))}catch(l){n.error("Error starting flow",l)}},startApplication:void 0,closeApplication:void 0,close:async()=>{typeof window>"u"||(T.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=wh;const Zt=(e,{context:t,submissions:r})=>{const[n,...o]=e.data.compareKey.split(".");if(!n)return!1;const i=Za({context:t,key:n,path:o,submissions:r});if(!i)return!1;switch(i.type){case"address":{const a=Dt(i.value,o.join("."));switch(e.data.compare){case"equals":return a===e.data.compareValue;case"contains":return a?a.includes(e.data.compareValue):!1;case"notEquals":return a!==e.data.compareValue;case"notContains":return a?!a.includes(e.data.compareValue):!0}break}case"integration":{if(typeof i.value!="object"||Array.isArray(i.value))return!1;const a=Dt(i.value,o.join(".")),s={...e,data:{...e.data,compareKey:"_temp"}};switch(typeof a){case"boolean":return Zt(s,{submissions:{_temp:{value:a,type:"boolean"}},context:t});case"string":return Zt(s,{submissions:{_temp:{value:a,type:"string"}},context:t});case"number":return Zt(s,{submissions:{_temp:{value:a,type:"number"}},context:t});case"object":return Array.isArray(a)&&a.every(Ba)?Zt(s,{submissions:{_temp:{value:a,type:"enum"}},context:t}):!1}break}case"boolean":{const a=e.data.compareValue==="true";switch(e.data.compare){case"equals":return i.value===a;case"notEquals":return i.value!==a}break}case"string":switch(e.data.compare){case"equals":return i.value===e.data.compareValue;case"contains":return i.value?i.value.includes(e.data.compareValue):!1;case"notEquals":return i.value!==e.data.compareValue;case"notContains":return i.value?!i.value.includes(e.data.compareValue):!0}break;case"number":{try{const a=Number(e.data.compareValue);switch(e.data.compare){case"equals":return i.value===a;case"notEquals":return i.value!==a;case"greaterThan":return i.value>a;case"greaterThanOrEqualTo":return i.value>=a;case"lessThan":return i.value<a;case"lessThanOrEqualTo":return i.value<=a}}catch{return console.error(`Failed to parse number in if-block ${e.id}`,i.value),!1}break}case"enum":switch(e.data.compare){case"equals":return i.value.length===1&&i.value[0]===e.data.compareValue;case"notEquals":return i.value.length===1&&i.value[0]!==e.data.compareValue;case"contains":return i.value.includes(e.data.compareValue);case"notContains":return!i.value.includes(e.data.compareValue)}break}return!1},xh=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,Xe=(e,{context:t,submissions:r})=>e.replace(xh,(n,o,i="")=>{const[a,...s]=o.trim().split("."),l=Za({key:a,path:s,submissions:r,context:t});if(!l)return i;switch(l.type){case"boolean":return l.value===!0?"true":"false";case"file":return l.value.map(u=>`${u.name} (${Kt(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():i;case"integration":{if(typeof l.value!="object"||Array.isArray(l.value))break;const u=Dt(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(Ba))return u.join(", ")}break}}return i}),Ya=({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 Ya({node:n,nodes:t,stopWhen:r})},kh=({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=Ya({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)},$h=({flow:e,analytics:t,logger:r,context:n,apiClient:o,getSubmissions:i,chatService:a,onFlowEnd:s,onInterpret:l})=>{let u=new AbortController;const p=async(c,v)=>{const g=i();l==null||l(c,v);try{await Sh({flow:e,analytics:t,logger:r,apiClient:o,context:n,node:c,submissions:g,chat:{sendMessage:async m=>a.send({groupId:c.id,message:m,signal:u.signal}),userInput:async m=>a.input({input:m,signal:u.signal}),addToSubmissions:a.addToSubmissions},next:m=>{const h=m?e.nodes.find(w=>w.id===m):kh({childNode:c,nodes:e.nodes});return h?p(h,c):s==null?void 0:s(c)},end:()=>s==null?void 0:s(c)})}catch(m){if(m instanceof Wt)return;throw m}};return{interpret:async c=>{const v=e.nodes.find(g=>g.id===c)??Va(e.nodes);return p(v)},undo:c=>{let v=1;const g=e.nodes.find(h=>h.id===c[c.length-1]);for(let h=c.length-2;h>0;h--){const w=c[h],k=e.nodes.find(_=>_.id===w);if(!k||(v++,k.type.startsWith("question-")))break}u.abort(),u=new AbortController;const m=e.nodes.find(h=>h.id===c[c.length-v]);return ke(m,"Undo failed: new start node not found"),p(m,g),{removed:v}},abort:()=>{u.abort()}}};async function Sh(e){return await We(e).with({node:{type:"text"}},Oh).with({node:{type:"image"}},Ih).with({node:{type:"question-text"}},Ah).with({node:{type:"question-enum"}},Dh).with({node:{type:"question-number"}},Th).with({node:{type:"question-boolean"}},Nh).with({node:{type:"question-file"}},Fh).with({node:{type:"question-address"}},Mh).with({node:{type:"end-flow"}},Lh).with({node:{type:"if-block"}},Ph).with({node:{type:"jump"}},({node:t,next:r})=>r(t.data.targetId)).with({node:{type:"link"}},Eh).with({node:{type:"integration-application-submit"}},Ch).with({node:{type:"integration-workflow-get"}},()=>Error("Unreachable")).exhaustive()}async function Ch({chat:e,next:t,node:r,logger:n,apiClient:o,submissions:i,context:a,analytics:s,flow:l}){const u=async p=>{p!==!0&&await e.userInput({type:"submit",key:void 0,config:{label:r.data.submitLabel}}),await e.sendMessage({type:"system",variant:"info",text:"Submitting…"});const{anonymous_id:c,session_id:v}=s.getSessionInfo(),g=await o.fetch("/flow/submit",{method:"POST",body:JSON.stringify({...a,integration_id:r.data.integrationId,anonymous_id:c,session_id:v,submissions:Gp(i||{})})}).catch(m=>m);r.data.key&&e.addToSubmissions(r.data.key,{type:"integration",value:g}),await We(g).with({ats_data:{redirect_url:Oe.string}},async m=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please complete your submission here:"});const h=new URL(m.ats_data.redirect_url);c&&!h.searchParams.has("anonymous_id")&&h.searchParams.set("anonymous_id",c),await e.sendMessage({type:"link",href:h.toString(),text:"Complete submission",onClick:()=>{if(alert("kek"),!v)return n.error("session_id not set, cannot log FLOW_REDIRECT event");s.log({event:"FLOW_REDIRECT",properties:{flow_build:l.build,flow_id:l.id,flow_session_id:v,flow_version:l.version,href:h.toString()},customProperties:a})}}),t(r.nextId)}).with({success:!0},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Submission completed!"}),t(r.nextId)}).with({sucess:!1,ats_data:{message:Oe.string}},async m=>{n.error(m.ats_data),await e.sendMessage({type:"system",variant:"error",text:m.ats_data.message}),await u(!1)}).otherwise(async m=>{n.error(m),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit"}),await u(!1)})};await u(r.data.skipConfirmation)}async function Eh({chat:e,next:t,node:r,submissions:n,context:o,analytics:i,flow:a,logger:s}){const{session_id:l}=i.getSessionInfo();await e.sendMessage({type:"link",href:Xe(r.data.href,{submissions:n,context:o}),text:Xe(r.data.cta,{submissions:n,context:o}),onClick:()=>{if(!l)return s.error("session_id not set, cannot log FLOW_REDIRECT event");i.log({event:"FLOW_REDIRECT",properties:{flow_build:a.build,flow_id:a.id,flow_session_id:l,flow_version:a.version,href:r.data.href},customProperties:o})}}),t(r.nextId)}async function Ph({submissions:e,next:t,node:r,context:n}){t(Zt(r,{submissions:e,context:n})?r.branchId:r.nextId)}async function Oh({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(r.data.text,{submissions:n,context:o})}),t(r.nextId)}async function Ih({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 Ah({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(r.data.question,{submissions:n,context:o})});const i=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}});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 Th({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Dh({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Nh({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Mh({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 Fh({node:e,chat:t,next:r,submissions:n,context:o}){await t.sendMessage({author:"bot",type:"text",text:Xe(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 Lh({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const Za=({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 Zn(e,t,r){var n,o,i,a,s;t==null&&(t=100);function l(){var p=Date.now()-a;p<t&&p>=0?n=setTimeout(l,t-p):(n=null,r||(s=e.apply(i,o),i=o=null))}var u=function(){i=this,o=arguments,a=Date.now();var p=r&&!n;return n||(n=setTimeout(l,t)),p&&(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}Zn.debounce=Zn;var Rh=Zn;const Xa=Ve(Rh);function Vh(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]=W({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=L({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),u=t?typeof t=="number"?t:t.scroll:null,p=t?typeof t=="number"?t:t.resize:null,c=L(!1);V(()=>(c.current=!0,()=>void(c.current=!1)));const[v,g,m]=le(()=>{const _=()=>{if(!l.current.element)return;const{left:O,top:A,width:P,height:U,bottom:q,right:N,x:M,y:oe}=l.current.element.getBoundingClientRect(),te={left:O,top:A,width:P,height:U,bottom:q,right:N,x:M,y:oe};l.current.element instanceof HTMLElement&&o&&(te.height=l.current.element.offsetHeight,te.width=l.current.element.offsetWidth),Object.freeze(te),c.current&&!Uh(l.current.lastBounds,te)&&s(l.current.lastBounds=te)};return[_,p?Xa(_,p):_,u?Xa(_,u):_]},[s,o,u,p]);function h(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",m,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function w(){l.current.element&&(l.current.resizeObserver=new i(m),l.current.resizeObserver.observe(l.current.element),r&&l.current.scrollContainers&&l.current.scrollContainers.forEach(_=>_.addEventListener("scroll",m,{capture:!0,passive:!0})))}const k=_=>{!_||_===l.current.element||(h(),l.current.element=_,l.current.scrollContainers=Qa(_),w())};return Bh(m,!!r),jh(g),V(()=>{h(),w()},[r,m,g]),V(()=>h,[]),[k,a,v]}function jh(e){V(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function Bh(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 Qa(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,...Qa(e.parentElement)]}const zh=["x","y","top","bottom","left","right","width","height"],Uh=(e,t)=>zh.every(r=>e[r]===t[r]),Ct=({class:e,...t})=>d("button",{class:He("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"})]})}),Hh=25,Xn=Ge({instant:()=>{},smooth:()=>{}}),Z={onSubmitSuccessFn$:Ge(()=>{}),isBotTyping$:Ge(!1),scrollToEnd:{instant:()=>Xn.value.instant(),smooth:()=>Xn.value.smooth()}},qh=()=>{const e=L(null);ve(()=>{Xn.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=le(()=>({addToSubmissions:(n,o)=>T.setSubmission(n,o),send:async({message:n,signal:o,groupId:i})=>{if(await We(n).with({author:"bot",type:"text"},async a=>{if(o!=null&&o.aborted)throw new Wt;Z.isBotTyping$.value=!0;const s=Math.min(Math.max(20,a.text.length),100)*Hh;await new Promise(l=>setTimeout(l,s,{signal:o})),Z.isBotTyping$.value=!1}).otherwise(async()=>{}),o!=null&&o.aborted)throw new Wt;T.addMessage(n,i)},input:({input:n,signal:o})=>{if(o!=null&&o.aborted)throw new Wt;return T.setInput(n),new Promise(i=>{const a=s=>{if(o!=null&&o.aborted)throw new Wt;T.setInput(void 0),n.key&&T.setSubmission(n.key,s),i(s)};Z.onSubmitSuccessFn$.value=a})}}),[]);return{chatRef:e,chatService:t}},Et=({class:e,...t})=>d("button",{type:"button",class:He("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"]}),Ja=["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Caribbean Netherlands","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Cook Islands","Costa Rica","Croatia","Cuba","Curaçao","Cyprus","Czechia","Côte d'Ivoire","Democratic Republic of the Congo","Denmark","Djibouti","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Falkland Islands (Islas Malvinas)","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern and Antarctic Lands","Gabon","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and McDonald Islands","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macao","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar (Burma)","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Korea","North Macedonia","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Romania","Russia","Rwanda","Réunion","Saint Barthélemy","Saint Helena, Ascension and Tristan da Cunha","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen","Sweden","Switzerland","Syria","São Tomé and Príncipe","Taiwan","Tajikistan","Tanzania","Thailand","The Bahamas","The Gambia","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkmenistan","Turks and Caicos Islands","Tuvalu","Türkiye","U.S. Virgin Islands","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe","Åland Islands"],es={line1:["street_number","floor","room","premise"],line2:["subpremise","street_address","route"],line3:["sublocality","neighborhood"],city:["locality","postal_town"],state:["administrative_area_level_1"],postcode:["postal_code"],country:["country"]},Dr=Object.keys(es),Kh=e=>Dr.reduce((t,r)=>{const n=es[r],o=e.filter(i=>i.types.some(a=>n.includes(a))).map(i=>i.long_name).join(", ");return o&&(t[r]=o),t},{}),Wh=document.createElement("div"),Gh=()=>le(()=>{const{google:e}=window;if(!("google"in window)||!("maps"in e)||!("places"in e.maps))return{enabled:!1};const t=new e.maps.places.AutocompleteService,r=new e.maps.places.PlacesService(Wh);return{enabled:!0,getPredictions:async n=>{const{predictions:o}=await t.getPlacePredictions({input:n,language:"en"});return o.map(i=>({label:i.description,value:i.place_id}))},getPlaceDetails:async n=>await new Promise((i,a)=>r.getDetails({placeId:n,fields:["address_components"],language:"en"},(s,l)=>l!==e.maps.places.PlacesServiceStatus.OK?a(l):s===null?a("ZERO_RESULTS"):i({ok:!0,place:s}))).catch(async i=>(console.error("Failed to get address details",i),{ok:!1}))}},[]),Qn=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"})]}),Jn={label:"Fill in manually",value:""},Yh=({input:e,onSubmitSuccess:t})=>{const[r,n]=W(""),[o,i]=W(),[a,s]=W([]),[l,u]=W(),{enabled:p,getPredictions:c,getPlaceDetails:v}=Gh(),[g,m]=W(p?"query":"manual"),h=le(()=>ja(w=>{ke(p,"Query state should not be enabled if Google Places isn't available"),n(w),w===""&&s([]),!(w.length<3)&&c(w).then(k=>{s(k)})},500),[p,c]);switch(V(()=>{if(p&&!(l===void 0||l===""))return v(l).then(w=>{if(!w.ok||!w.place.address_components){i({});return}const k=Kh(w.place.address_components);i(k),m("details")}),()=>{i(void 0)}},[l,v,p]),g){case"query":return ke(p,"Query state should not be enabled if Google Places isn't available"),d(Zh,{input:e,onSkip:()=>t(null),onAddressSelect:w=>{u(w),m("loading")},onInputChange:h,suggestions:a,query:r});case"loading":return d(ei,{input:e,onSubmitSuccess:t,addressFields:{},actions:d(Qn,{onClick:()=>{u(void 0),m("query")}})});case"details":return ke(o!==void 0),d(ei,{input:e,onSubmitSuccess:t,addressFields:o,actions:d(Qn,{onClick:()=>{u(void 0),m("query")}})});case"manual":return d(ei,{input:e,onSubmitSuccess:t,addressFields:{},actions:p?d(Qn,{onClick:()=>{u(void 0),m("query")}}):void 0})}},Zh=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:o,onInputChange:i})=>{const a=L(null);return ve(()=>{a.current&&(a.current.focus(),a.current.select())},[]),d(G,{children:[d("form",{noValidate:!0,onSubmit:s=>{s.preventDefault()},class:"flex flex-col justify-end gap-1 p-2.5",children:[d("input",{onChange:s=>{i(s.currentTarget.value)},ref:a,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||"Search an address",defaultValue:o}),e.config.optional&&d(Et,{class:"absolute right-3",onClick:t})]}),d("ul",{children:[r.map(s=>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(s.value)},children:[d("span",{class:"flex-grow",children:s.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"})})]})},s.label)),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(Jn.value)},children:d("span",{class:"flex-grow",children:Jn.label})})},Jn.label)]})]})},Xh={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},ei=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const o=L(null);return ve(()=>{if(o.current){const i=o.current.querySelector("input");i&&(i.focus(),i.select())}},[]),d("form",{class:"bg-neutral-1/90 flex flex-col justify-end gap-2 p-2",onSubmit:i=>{const a=new FormData(i.currentTarget),s=Object.fromEntries(a.entries());t({type:"address",value:s})},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:Dr.map((i,a)=>{const s=`isdk_${i}`,l=n.config.keys[i];return l?d(G,{children:[d("label",{for:s,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:Xh[i]}),d("div",{class:"flex flex-col items-stretch gap-1.5",children:[i==="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:l,id:s,defaultValue:e[i],required:!0,children:[e.country&&!Ja.includes(e.country)?d("option",{value:e[i],children:e[i]}):d("option",{value:"",children:"Select a country"}),Ja.map(u=>d("option",{value:u,children:u},u))]}),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:a===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:l,id:s,defaultValue:e[i],required:!0}),a!==Dr.length-1&&d("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"}),a===Dr.length-1&&d("hr",{class:"m-0 w-full border-b border-b-transparent"})]})]}):null})}),d("div",{class:"flex w-full flex-1 ",children:[d("div",{class:"flex-grow",children:r}),d(Ct,{class:"flex items-center justify-center"})]})]})},ti=()=>{const e=L(null);return V(()=>{var t;(t=e.current)==null||t.focus()},[]),e},ts=["true","false"],Qh=_d(ts),Jh="answer",ev=({input:e,onSubmitSuccess:t})=>{const r=ti();return d("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const o=We(n).with({nativeEvent:{submitter:Oe.select(Oe.union(Oe.instanceOf(HTMLButtonElement),Oe.instanceOf(HTMLInputElement)))}},a=>a.value).otherwise(()=>{throw new Error("invalid form")}),i=Rt(Qh,o);t({type:"boolean",value:i==="true"})},children:[d("div",{class:"flex items-center gap-2 p-2.5",children:ts.map((n,o)=>d("button",{ref:o===0?r:null,type:"submit",name:Jh,value:n,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 flex-1 overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all selection:bg-transparent",children:d("p",{class:"truncate text-center text-base",children:e.config.labels[n]})}))}),e.config.optional&&d("div",{class:"px-2 pb-2",children:d(Et,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},Nr=({error:e})=>e?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})]}):null,tv=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}),rv=e=>e.reduce((t,r)=>t+r.sizeKb,0),nv=Or("file"),rs=3,iv=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${n}$`),"");return d("div",{class:He("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:Kt(e.sizeKb)})]})},ns=({class:e,...t})=>d("li",{class:He("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),is=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},ov=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(is(n.name).toLowerCase()))},av=(e,t)=>{const r=is(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},sv=({input:e,onSubmitSuccess:t})=>{var p;const r=(p=T.current$.value.flow)==null?void 0:p.data.submissions[e.key],[n,o]=W(nv(r)?r.value:[]),[i,a]=W(),s=n.length-rs,l=rv(n),u=ti();return d("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:c=>(c.preventDefault(),a(void 0),n.length===0?a({type:"required",message:"Please select a file"}):e.config.extensions.length>0&&!ov({allowedExtensions:e.config.extensions,files:n})?a({type:"validate",message:`Please upload ${e.config.extensions.join(", ")} files only`}):e.config.fileSizeLimitKib&&l>e.config.fileSizeLimitKib?a({type:"max",message:`File size exceeds limit of ${Kt(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(G,{children:[d("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,rs).map(c=>{const v=c.name.split(".").pop(),g=c.name.replace(new RegExp(`.${v}$`),"");return d(ns,{class:"flex overflow-hidden",children:[d("span",{class:"block truncate",children:g}),d("span",{children:[".",v]})]})}),s>0?d(ns,{children:["+",s," file",s!==1?"s":""]}):null]}),d("p",{class:"text-neutral-11 text-xs",children:[Kt(l)," ",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 ",Kt(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(c=>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:c.replace(".","")}))})]})]}),d("input",{id:"dropzone-file",onInput:async c=>{ke(c.target instanceof HTMLInputElement);const v=c.target.files?Array.from(c.target.files):[],g=await Promise.allSettled(v.map(async h=>{const w=await tv(h);return{name:av(h.name,42),data:w,sizeKb:h.size/1e3}}));if(g.some(({status:h})=>h==="rejected"))return a({type:"invalid",message:"Invalid file"});const m=g.map(h=>h.status==="fulfilled"?h.value:null).filter(Boolean);o(m)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),d("div",{class:"flex h-full flex-col items-center gap-2",children:[d(Ct,{disabled:n.length===0}),e.config.optional&&d(Et,{onClick:()=>t(null)})]})]}),d(Nr,{error:i})]})};var Xt=e=>e.type==="checkbox",Pt=e=>e instanceof Date,ue=e=>e==null;const os=e=>typeof e=="object";var ee=e=>!ue(e)&&!Array.isArray(e)&&os(e)&&!Pt(e),lv=e=>ee(e)&&e.target?Xt(e.target)?e.target.checked:e.target.value:e,cv=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,uv=(e,t)=>e.has(cv(t)),dv=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},ri=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(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(!(ri&&(e instanceof Blob||e instanceof FileList))&&(r||ee(e)))if(t=r?[]:{},!r&&!dv(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Le(e[n]));else return e;return t}var Qt=e=>Array.isArray(e)?e.filter(Boolean):[],X=e=>e===void 0,C=(e,t,r)=>{if(!t||!ee(e))return r;const n=Qt(t.split(/[,[\].]+?/)).reduce((o,i)=>ue(o)?o:o[i],e);return X(n)||n===e?X(e[t])?r:e[t]:n},Qe=e=>typeof e=="boolean";const as={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},$e={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Re={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};xe.createContext(null);var fv=(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]!==$e.all&&(t._proxyFormState[a]=!n||$e.all),r&&(r[a]=!0),e[a]}});return o},_e=e=>ee(e)&&!Object.keys(e).length,pv=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return _e(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||$e.all))},ni=e=>Array.isArray(e)?e:[e];function hv(e){const t=xe.useRef(e);t.current=e,xe.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",vv=(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),ii=e=>/^\w*$/.test(e),ss=e=>Qt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function z(e,t,r){let n=-1;const o=ii(t)?[t]:ss(t),i=o.length,a=i-1;for(;++n<i;){const s=o[n];let l=r;if(n!==a){const u=e[s];l=ee(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}e[s]=l,e=e[s]}return e}var ls=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},cs=e=>({isOnSubmit:!e||e===$e.onSubmit,isOnBlur:e===$e.onBlur,isOnChange:e===$e.onChange,isOnAll:e===$e.all,isOnTouch:e===$e.onTouched}),us=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Mr=(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)&&Mr(s,t)}}};var mv=(e,t,r)=>{const n=Qt(C(e,r));return z(n,"root",t[r]),z(e,r,n),e},oi=e=>e.type==="file",Je=e=>typeof e=="function",Fr=e=>{if(!ri)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Lr=e=>Ie(e),ai=e=>e.type==="radio",Rr=e=>e instanceof RegExp;const ds={value:!1,isValid:!1},fs={value:!0,isValid:!0};var ps=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&&!X(e[0].attributes.value)?X(e[0].value)||e[0].value===""?fs:{value:e[0].value,isValid:!0}:fs:ds}return ds};const hs={isValid:!1,value:null};var vs=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hs):hs;function ms(e,t,r="validate"){if(Lr(e)||Array.isArray(e)&&e.every(Lr)||Qe(e)&&!e)return{type:r,message:Lr(e)?e:"",ref:t}}var Ot=e=>ee(e)&&!Rr(e)?e:{value:e,message:""},bs=async(e,t,r,n,o)=>{const{ref:i,refs:a,required:s,maxLength:l,minLength:u,min:p,max:c,pattern:v,validate:g,name:m,valueAsNumber:h,mount:w,disabled:k}=e._f,_=C(t,m);if(!w||k)return{};const O=a?a[0]:i,A=j=>{n&&O.reportValidity&&(O.setCustomValidity(Qe(j)?"":j||""),O.reportValidity())},P={},U=ai(i),q=Xt(i),N=U||q,M=(h||oi(i))&&X(i.value)&&X(_)||Fr(i)&&i.value===""||_===""||Array.isArray(_)&&!_.length,oe=ls.bind(null,m,r,P),te=(j,F,Q,pe=Re.maxLength,we=Re.minLength)=>{const Ae=j?F:Q;P[m]={type:j?pe:we,message:Ae,ref:i,...oe(j?pe:we,Ae)}};if(o?!Array.isArray(_)||!_.length:s&&(!N&&(M||ue(_))||Qe(_)&&!_||q&&!ps(a).isValid||U&&!vs(a).isValid)){const{value:j,message:F}=Lr(s)?{value:!!s,message:s}:Ot(s);if(j&&(P[m]={type:Re.required,message:F,ref:O,...oe(Re.required,F)},!r))return A(F),P}if(!M&&(!ue(p)||!ue(c))){let j,F;const Q=Ot(c),pe=Ot(p);if(!ue(_)&&!isNaN(_)){const we=i.valueAsNumber||_&&+_;ue(Q.value)||(j=we>Q.value),ue(pe.value)||(F=we<pe.value)}else{const we=i.valueAsDate||new Date(_),Ae=zr=>new Date(new Date().toDateString()+" "+zr),ct=i.type=="time",er=i.type=="week";Ie(Q.value)&&_&&(j=ct?Ae(_)>Ae(Q.value):er?_>Q.value:we>new Date(Q.value)),Ie(pe.value)&&_&&(F=ct?Ae(_)<Ae(pe.value):er?_<pe.value:we<new Date(pe.value))}if((j||F)&&(te(!!j,Q.message,pe.message,Re.max,Re.min),!r))return A(P[m].message),P}if((l||u)&&!M&&(Ie(_)||o&&Array.isArray(_))){const j=Ot(l),F=Ot(u),Q=!ue(j.value)&&_.length>+j.value,pe=!ue(F.value)&&_.length<+F.value;if((Q||pe)&&(te(Q,j.message,F.message),!r))return A(P[m].message),P}if(v&&!M&&Ie(_)){const{value:j,message:F}=Ot(v);if(Rr(j)&&!_.match(j)&&(P[m]={type:Re.pattern,message:F,ref:i,...oe(Re.pattern,F)},!r))return A(F),P}if(g){if(Je(g)){const j=await g(_,t),F=ms(j,O);if(F&&(P[m]={...F,...oe(Re.validate,F.message)},!r))return A(F.message),P}else if(ee(g)){let j={};for(const F in g){if(!_e(j)&&!r)break;const Q=ms(await g[F](_,t),O,F);Q&&(j={...Q,...oe(F,Q.message)},A(Q.message),r&&(P[m]=j))}if(!_e(j)&&(P[m]={ref:O,...j},!r))return P}}return A(!0),P};function bv(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=X(e)?n++:e[t[n++]];return e}function gv(e){for(const t in e)if(e.hasOwnProperty(t)&&!X(e[t]))return!1;return!0}function ie(e,t){const r=Array.isArray(t)?t:ii(t)?[t]:ss(t),n=r.length===1?e:bv(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(ee(n)&&_e(n)||Array.isArray(n)&&gv(n))&&ie(e,r.slice(0,-1)),e}function si(){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 Vr=e=>ue(e)||!os(e);function lt(e,t){if(Vr(e)||Vr(t))return e===t;if(Pt(e)&&Pt(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(Pt(i)&&Pt(a)||ee(i)&&ee(a)||Array.isArray(i)&&Array.isArray(a)?!lt(i,a):i!==a)return!1}}return!0}var gs=e=>e.type==="select-multiple",yv=e=>ai(e)||Xt(e),li=e=>Fr(e)&&e.isConnected,ys=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function jr(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!ys(e[n])?(t[n]=Array.isArray(e[n])?[]:{},jr(e[n],t[n])):ue(e[n])||(t[n]=!0);return t}function _s(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const o in e)Array.isArray(e[o])||ee(e[o])&&!ys(e[o])?X(t)||Vr(r[o])?r[o]=Array.isArray(e[o])?jr(e[o],[]):{...jr(e[o])}:_s(e[o],ue(t)?{}:t[o],r[o]):r[o]=!lt(e[o],t[o]);return r}var ci=(e,t)=>_s(e,t,jr(t)),ws=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>X(e)?e:t?e===""?NaN:e&&+e:r&&Ie(e)?new Date(e):n?n(e):e;function ui(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return oi(t)?t.files:ai(t)?vs(e.refs).value:gs(t)?[...t.selectedOptions].map(({value:r})=>r):Xt(t)?ps(e.refs).value:ws(X(t.value)?e.ref.value:t.value,e)}var _v=(e,t,r,n)=>{const o={};for(const i of e){const a=C(t,i);a&&z(o,i,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Jt=e=>X(e)?e:Rr(e)?e.source:ee(e)?Rr(e.value)?e.value.source:e.value:e,wv=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function xs(e,t,r){const n=C(e,r);if(n||ii(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 xv=(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,kv=(e,t)=>!Qt(C(e,t)).length&&ie(e,t);const $v={mode:$e.onSubmit,reValidateMode:$e.onChange,shouldFocusError:!0};function Sv(e={},t){let r={...$v,...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)?Le(r.defaultValues||r.values)||{}:{},a=r.shouldUnregister?{}:Le(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,p=0;const c={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:si(),array:si(),state:si()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,m=cs(r.mode),h=cs(r.reValidateMode),w=r.criteriaMode===$e.all,k=f=>b=>{clearTimeout(p),p=setTimeout(f,b)},_=async f=>{if(c.isValid||f){const b=r.resolver?_e((await M()).errors):await te(o,!0);b!==n.isValid&&v.state.next({isValid:b})}},O=f=>c.isValidating&&v.state.next({isValidating:f}),A=(f,b=[],y,E,$=!0,x=!0)=>{if(E&&y){if(s.action=!0,x&&Array.isArray(C(o,f))){const I=y(C(o,f),E.argA,E.argB);$&&z(o,f,I)}if(x&&Array.isArray(C(n.errors,f))){const I=y(C(n.errors,f),E.argA,E.argB);$&&z(n.errors,f,I),kv(n.errors,f)}if(c.touchedFields&&x&&Array.isArray(C(n.touchedFields,f))){const I=y(C(n.touchedFields,f),E.argA,E.argB);$&&z(n.touchedFields,f,I)}c.dirtyFields&&(n.dirtyFields=ci(i,a)),v.state.next({name:f,isDirty:F(f,b),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else z(a,f,b)},P=(f,b)=>{z(n.errors,f,b),v.state.next({errors:n.errors})},U=(f,b,y,E)=>{const $=C(o,f);if($){const x=C(a,f,X(y)?C(i,f):y);X(x)||E&&E.defaultChecked||b?z(a,f,b?x:ui($._f)):we(f,x),s.mount&&_()}},q=(f,b,y,E,$)=>{let x=!1,I=!1;const H={name:f};if(!y||E){c.isDirty&&(I=n.isDirty,n.isDirty=H.isDirty=F(),x=I!==H.isDirty);const J=lt(C(i,f),b);I=C(n.dirtyFields,f),J?ie(n.dirtyFields,f):z(n.dirtyFields,f,!0),H.dirtyFields=n.dirtyFields,x=x||c.dirtyFields&&I!==!J}if(y){const J=C(n.touchedFields,f);J||(z(n.touchedFields,f,y),H.touchedFields=n.touchedFields,x=x||c.touchedFields&&J!==y)}return x&&$&&v.state.next(H),x?H:{}},N=(f,b,y,E)=>{const $=C(n.errors,f),x=c.isValid&&Qe(b)&&n.isValid!==b;if(e.delayError&&y?(u=k(()=>P(f,y)),u(e.delayError)):(clearTimeout(p),u=null,y?z(n.errors,f,y):ie(n.errors,f)),(y?!lt($,y):$)||!_e(E)||x){const I={...E,...x&&Qe(b)?{isValid:b}:{},errors:n.errors,name:f};n={...n,...I},v.state.next(I)}O(!1)},M=async f=>r.resolver(a,r.context,_v(f||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),oe=async f=>{const{errors:b}=await M(f);if(f)for(const y of f){const E=C(b,y);E?z(n.errors,y,E):ie(n.errors,y)}else n.errors=b;return b},te=async(f,b,y={valid:!0})=>{for(const E in f){const $=f[E];if($){const{_f:x,...I}=$;if(x){const H=l.array.has(x.name),J=await bs($,a,w,r.shouldUseNativeValidation&&!b,H);if(J[x.name]&&(y.valid=!1,b))break;!b&&(C(J,x.name)?H?mv(n.errors,J,x.name):z(n.errors,x.name,J[x.name]):ie(n.errors,x.name))}I&&await te(I,b,y)}}return y.valid},j=()=>{for(const f of l.unMount){const b=C(o,f);b&&(b._f.refs?b._f.refs.every(y=>!li(y)):!li(b._f.ref))&&hi(f)}l.unMount=new Set},F=(f,b)=>(f&&b&&z(a,f,b),!lt($s(),i)),Q=(f,b,y)=>vv(f,l,{...s.mount?a:X(b)?i:Ie(f)?{[f]:b}:b},y,b),pe=f=>Qt(C(s.mount?a:i,f,e.shouldUnregister?C(i,f,[]):[])),we=(f,b,y={})=>{const E=C(o,f);let $=b;if(E){const x=E._f;x&&(!x.disabled&&z(a,f,ws(b,x)),$=Fr(x.ref)&&ue(b)?"":b,gs(x.ref)?[...x.ref.options].forEach(I=>I.selected=$.includes(I.value)):x.refs?Xt(x.ref)?x.refs.length>1?x.refs.forEach(I=>(!I.defaultChecked||!I.disabled)&&(I.checked=Array.isArray($)?!!$.find(H=>H===I.value):$===I.value)):x.refs[0]&&(x.refs[0].checked=!!$):x.refs.forEach(I=>I.checked=I.value===$):oi(x.ref)?x.ref.value="":(x.ref.value=$,x.ref.type||v.values.next({name:f,values:{...a}})))}(y.shouldDirty||y.shouldTouch)&&q(f,$,y.shouldTouch,y.shouldDirty,!0),y.shouldValidate&&pi(f)},Ae=(f,b,y)=>{for(const E in b){const $=b[E],x=`${f}.${E}`,I=C(o,x);(l.array.has(f)||!Vr($)||I&&!I._f)&&!Pt($)?Ae(x,$,y):we(x,$,y)}},ct=(f,b,y={})=>{const E=C(o,f),$=l.array.has(f),x=Le(b);z(a,f,x),$?(v.array.next({name:f,values:{...a}}),(c.isDirty||c.dirtyFields)&&y.shouldDirty&&v.state.next({name:f,dirtyFields:ci(i,a),isDirty:F(f,x)})):E&&!E._f&&!ue(x)?Ae(f,x,y):we(f,x,y),us(f,l)&&v.state.next({...n}),v.values.next({name:f,values:{...a}}),!s.mount&&t()},er=async f=>{const b=f.target;let y=b.name,E=!0;const $=C(o,y),x=()=>b.type?ui($._f):lv(f),I=H=>{E=Number.isNaN(H)||H===C(a,y,H)};if($){let H,J;const Ur=x(),At=f.type===as.BLUR||f.type===as.FOCUS_OUT,cm=!wv($._f)&&!r.resolver&&!C(n.errors,y)&&!$._f.deps||xv(At,C(n.touchedFields,y),n.isSubmitted,h,m),mi=us(y,l,At);z(a,y,Ur),At?($._f.onBlur&&$._f.onBlur(f),u&&u(0)):$._f.onChange&&$._f.onChange(f);const bi=q(y,Ur,At,!1),um=!_e(bi)||mi;if(!At&&v.values.next({name:y,type:f.type,values:{...a}}),cm)return c.isValid&&_(),um&&v.state.next({name:y,...mi?{}:bi});if(!At&&mi&&v.state.next({...n}),O(!0),r.resolver){const{errors:Ts}=await M([y]);if(I(Ur),E){const dm=xs(n.errors,o,y),Ds=xs(Ts,o,dm.name||y);H=Ds.error,y=Ds.name,J=_e(Ts)}}else H=(await bs($,a,w,r.shouldUseNativeValidation))[y],I(Ur),E&&(H?J=!1:c.isValid&&(J=await te(o,!0)));E&&($._f.deps&&pi($._f.deps),N(y,J,H,bi))}},zr=(f,b)=>{if(C(n.errors,b)&&f.focus)return f.focus(),1},pi=async(f,b={})=>{let y,E;const $=ni(f);if(O(!0),r.resolver){const x=await oe(X(f)?f:$);y=_e(x),E=f?!$.some(I=>C(x,I)):y}else f?(E=(await Promise.all($.map(async x=>{const I=C(o,x);return await te(I&&I._f?{[x]:I}:I)}))).every(Boolean),!(!E&&!n.isValid)&&_()):E=y=await te(o);return v.state.next({...!Ie(f)||c.isValid&&y!==n.isValid?{}:{name:f},...r.resolver||!f?{isValid:y}:{},errors:n.errors,isValidating:!1}),b.shouldFocus&&!E&&Mr(o,zr,f?$:l.mount),E},$s=f=>{const b={...i,...s.mount?a:{}};return X(f)?b:Ie(f)?C(b,f):f.map(y=>C(b,y))},Ss=(f,b)=>({invalid:!!C((b||n).errors,f),isDirty:!!C((b||n).dirtyFields,f),isTouched:!!C((b||n).touchedFields,f),error:C((b||n).errors,f)}),om=f=>{f&&ni(f).forEach(b=>ie(n.errors,b)),v.state.next({errors:f?n.errors:{}})},Cs=(f,b,y)=>{const E=(C(o,f,{_f:{}})._f||{}).ref;z(n.errors,f,{...b,ref:E}),v.state.next({name:f,errors:n.errors,isValid:!1}),y&&y.shouldFocus&&E&&E.focus&&E.focus()},am=(f,b)=>Je(f)?v.values.subscribe({next:y=>f(Q(void 0,b),y)}):Q(f,b,!0),hi=(f,b={})=>{for(const y of f?ni(f):l.mount)l.mount.delete(y),l.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);v.values.next({values:{...a}}),v.state.next({...n,...b.keepDirty?{isDirty:F()}:{}}),!b.keepIsValid&&_()},Es=({disabled:f,name:b,field:y,fields:E,value:$})=>{if(Qe(f)){const x=f?void 0:X($)?ui(y?y._f:C(E,b)._f):$;z(a,b,x),q(b,x,!1,!1,!0)}},vi=(f,b={})=>{let y=C(o,f);const E=Qe(b.disabled);return z(o,f,{...y||{},_f:{...y&&y._f?y._f:{ref:{name:f}},name:f,mount:!0,...b}}),l.mount.add(f),y?Es({field:y,disabled:b.disabled,name:f}):U(f,!0,b.value),{...E?{disabled:b.disabled}:{},...r.progressive?{required:!!b.required,min:Jt(b.min),max:Jt(b.max),minLength:Jt(b.minLength),maxLength:Jt(b.maxLength),pattern:Jt(b.pattern)}:{},name:f,onChange:er,onBlur:er,ref:$=>{if($){vi(f,b),y=C(o,f);const x=X($.value)&&$.querySelectorAll&&$.querySelectorAll("input,select,textarea")[0]||$,I=yv(x),H=y._f.refs||[];if(I?H.find(J=>J===x):x===y._f.ref)return;z(o,f,{_f:{...y._f,...I?{refs:[...H.filter(li),x,...Array.isArray(C(i,f))?[{}]:[]],ref:{type:x.type,name:f}}:{ref:x}}}),U(f,!1,void 0,x)}else y=C(o,f,{}),y._f&&(y._f.mount=!1),(r.shouldUnregister||b.shouldUnregister)&&!(uv(l.array,f)&&s.action)&&l.unMount.add(f)}}},Ps=()=>r.shouldFocusError&&Mr(o,zr,l.mount),sm=f=>{Qe(f)&&(v.state.next({disabled:f}),Mr(o,b=>{b.disabled=f},0,!1))},Os=(f,b)=>async y=>{y&&(y.preventDefault&&y.preventDefault(),y.persist&&y.persist());let E=Le(a);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:$,values:x}=await M();n.errors=$,E=x}else await te(o);ie(n.errors,"root"),_e(n.errors)?(v.state.next({errors:{}}),await f(E,y)):(b&&await b({...n.errors},y),Ps(),setTimeout(Ps)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:_e(n.errors),submitCount:n.submitCount+1,errors:n.errors})},lm=(f,b={})=>{C(o,f)&&(X(b.defaultValue)?ct(f,C(i,f)):(ct(f,b.defaultValue),z(i,f,b.defaultValue)),b.keepTouched||ie(n.touchedFields,f),b.keepDirty||(ie(n.dirtyFields,f),n.isDirty=b.defaultValue?F(f,C(i,f)):F()),b.keepError||(ie(n.errors,f),c.isValid&&_()),v.state.next({...n}))},Is=(f,b={})=>{const y=f?Le(f):i,E=Le(y),$=f&&!_e(f)?E:i;if(b.keepDefaultValues||(i=y),!b.keepValues){if(b.keepDirtyValues||g)for(const x of l.mount)C(n.dirtyFields,x)?z($,x,C(a,x)):ct(x,C($,x));else{if(ri&&X(f))for(const x of l.mount){const I=C(o,x);if(I&&I._f){const H=Array.isArray(I._f.refs)?I._f.refs[0]:I._f.ref;if(Fr(H)){const J=H.closest("form");if(J){J.reset();break}}}}o={}}a=e.shouldUnregister?b.keepDefaultValues?Le(i):{}:Le($),v.array.next({values:{...$}}),v.values.next({values:{...$}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!c.isValid||!!b.keepIsValid,s.watch=!!e.shouldUnregister,v.state.next({submitCount:b.keepSubmitCount?n.submitCount:0,isDirty:b.keepDirty?n.isDirty:!!(b.keepDefaultValues&&!lt(f,i)),isSubmitted:b.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:b.keepDirtyValues?n.dirtyFields:b.keepDefaultValues&&f?ci(i,f):{},touchedFields:b.keepTouched?n.touchedFields:{},errors:b.keepErrors?n.errors:{},isSubmitSuccessful:b.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},As=(f,b)=>Is(Je(f)?f(a):f,b);return{control:{register:vi,unregister:hi,getFieldState:Ss,handleSubmit:Os,setError:Cs,_executeSchema:M,_getWatch:Q,_getDirty:F,_updateValid:_,_removeUnmounted:j,_updateFieldArray:A,_updateDisabledField:Es,_getFieldArray:pe,_reset:Is,_resetDefaultValues:()=>Je(r.defaultValues)&&r.defaultValues().then(f=>{As(f,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:f=>{n={...n,...f}},_disableForm:sm,_subjects:v,_proxyFormState:c,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(f){s=f},get _defaultValues(){return i},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:pi,register:vi,handleSubmit:Os,watch:am,setValue:ct,getValues:$s,reset:As,resetField:lm,clearErrors:om,unregister:hi,setError:Cs,setFocus:(f,b={})=>{const y=C(o,f),E=y&&y._f;if(E){const $=E.refs?E.refs[0]:E.ref;$.focus&&($.focus(),b.shouldSelect&&$.select())}},getFieldState:Ss}}function di(e={}){const t=xe.useRef(),r=xe.useRef(),[n,o]=xe.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={...Sv(e,()=>o(a=>({...a}))),formState:n});const i=t.current.control;return i._options=e,hv({subject:i._subjects.state,next:a=>{pv(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),xe.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),xe.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),xe.useEffect(()=>{e.values&&!lt(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values):i._resetDefaultValues()},[e.values,i]),xe.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=fv(n,i),t.current}var ks=function(e,t,r){if(e&&"reportValidity"in e){var n=C(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Cv=function(e,t){var r=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?ks(i.ref,o,e):i.refs&&i.refs.forEach(function(a){return ks(a,o,e)})};for(var n in t.fields)r(n)},Ev=function(e,t){t.shouldUseNativeValidation&&Cv(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(Ov(t.names||Object.keys(e),n)){var a=Object.assign({},Pv(C(r,n)));z(a,"root",i),z(r,n,a)}else z(r,n,i)}return r},Pv=function(e){return Array.isArray(e)?e.filter(Boolean):[]},Ov=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},Iv=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]=ls(o,t,r,n.validation,a?[].concat(a,n.message):n.message)}e.issues.shift()}}return r},fi=function(e,t,r){return r===void 0&&(r={}),function(n,o,i){try{return Promise.resolve(function(a,s){try{var l=function(){function u(c){return{values:r.raw?n:c,errors:{}}}var p=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return r.mode==="sync"?u(Rt(e,n,p)):Promise.resolve($d(e,n,p)).then(u)}()}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(a instanceof en)return{values:{},errors:Ev(Iv(a,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};const Av=27,Tv=12,Dv=10,Nv=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},Mv=Or("enum"),Fv=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return fi(Se({checked:io(rn(ro()),r=>Object.entries(r).filter(([n,o])=>o).map(([n,o])=>n),[Vt(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),oo(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},Lv=({input:e,onSubmitSuccess:t})=>{var l,u;const r=e.key?(l=T.current$.value.flow)==null?void 0:l.data.submissions[e.key]:void 0,n=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,{register:o,handleSubmit:i,formState:{errors:a}}=di({defaultValues:{checked:n?{}:Mv(r)?Object.fromEntries(r.value.map(p=>[p,!0])):{}},resolver:Fv(e.config)}),s=ti();return d("form",{noValidate:!0,class:"pr-2.5",onChange:p=>{n&&Nv(p.currentTarget)},onSubmit:i(p=>{const c=p.checked;t({type:"enum",value:c})}),children:[d("div",{class:"flex items-center gap-1",children:[d("ul",{style:{maxHeight:6.5*Av+5*Tv+2*Dv},class:He("gutter-stable flex w-full flex-1 flex-wrap gap-3 overflow-y-auto rounded-xl p-2.5 pr-4",{"justify-center":e.config.options.length===1}),children:e.config.options.map((p,c)=>{const v=`checked.${p.value}`,{ref:g,...m}=o(v);return d("li",{class:"relative",children:[d("input",{autoFocus:c===0,ref:h=>{h&&c===0&&(s.current=h),g(h)},id:v,...m,class:"peer sr-only h-full",type:"checkbox"}),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:v,children:p.label})]},p.value)})}),d("div",{class:"flex flex-col items-center gap-2",children:[!n&&d(Ct,{}),e.config.minSelected===0&&d(Et,{type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),d("div",{class:"px-1",children:d(Nr,{error:(u=a.checked)==null?void 0:u.root})})]})},Rv=Or("number"),Br={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`},Vv=e=>{const t=e.min??Number.MIN_SAFE_INTEGER,r=e.max??Number.MAX_SAFE_INTEGER,n=e.decimalCases??0;return fi(Se({number:tn(Br.number(),[Od(t,Br.min(t)),Pd(r,Br.max(r)),Cd(o=>o===Number(o.toFixed(n)),Br.decimalCases(n))])}))},jv=({input:e,onSubmitSuccess:t})=>{var p;const r=e.config.defaultValue,n=e.key?(p=T.current$.value.flow)==null?void 0:p.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:a}}=di({defaultValues:{number:r?Number(r):Rv(n)?n.value:void 0},resolver:Vv(e.config)}),{ref:s,...l}=o("number",{required:!e.config.optional,valueAsNumber:!0}),u=L();return ve(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:i(c=>{c.number!==void 0&&t({type:"number",value:c.number})}),children:[d("div",{class:"flex items-center gap-2",children:[d("div",{class:"relative min-w-0 flex-grow",children:[d("input",{...l,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:c=>{c&&(u.current=c),s(c)},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(Et,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(Ct,{})]}),d(Nr,{error:a.number})]})},Bv=({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}),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"})]})]})})}),It={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"},zv=he(It.phone,[Id(/^\+?[0-9 -]+$/,It.phone)]),Uv={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},Hv=Or("string"),qv=e=>{const t=`Please enter no more than ${e.maxChars} characters`;return fi(Se({text:{email:he(It.email,[Ed(It.email),Vt(e.maxChars??1/0,t)]),phone:io(zv,r=>r.replace(/[^0-9]/g,""),[Vt(e.maxChars??1/0,t)]),text:he([oo(1,It.empty),Vt(e.maxChars??1/0,t)]),url:he([Ad(It.url),Vt(e.maxChars??1/0,t)])}[e.format]}))},Kv=({input:e,onSubmitSuccess:t})=>{var p;const r=e.key?(p=T.current$.value.flow)==null?void 0:p.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:o,handleSubmit:i,formState:{errors:a}}=di({defaultValues:{text:n||(Hv(r)?r.value:"")},resolver:qv(e.config)}),{ref:s,...l}=o("text",{required:!e.config.optional}),u=L();return ve(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:i(c=>{t({type:"string",value:c.text})}),children:[d("div",{class:"flex items-center gap-2",children:[d("div",{class:"relative min-w-0 flex-grow",children:[d("input",{id:"chat-input",...l,...Uv[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:c=>{c&&(u.current=c),s(c)},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(Et,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(Ct,{})]}),d(Nr,{error:a.text})]})},Wv=()=>{var o;const e=(o=T.current$.value.flow)==null?void 0:o.data.currentInput,[t,r]=Vh(),n=L(null);return T.inputHeight$.value=r.height,V(()=>{const i=n.current;if(i)return i.addEventListener("transitionstart",Z.scrollToEnd.smooth),i.addEventListener("transitioncancel",Z.scrollToEnd.smooth),i.addEventListener("transitionend",Z.scrollToEnd.smooth),()=>{i.removeEventListener("transitionstart",Z.scrollToEnd.smooth),i.removeEventListener("transitioncancel",Z.scrollToEnd.smooth),i.removeEventListener("transitionend",Z.scrollToEnd.smooth)}},[]),d("div",{ref:n,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:r.height},children:d("div",{ref:t,class:"border-divider flex flex-col justify-end border-t",children:We({input:e}).with({input:Oe.nullish},()=>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(Ct,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},i=>d(Kv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"multiple-choice"}},i=>d(Lv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"boolean"}},i=>d(ev,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"file"}},i=>d(sv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"submit"}},i=>d(Bv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"address"}},i=>d(Yh,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"number"}},i=>d(jv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).exhaustive()})})},Gv=En("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"}}),Yv=({children:e,className:t,animate:r,side:n,...o})=>d("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Gv({className:t,side:n,animate:r}),...o,children:e}),Zv=({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"})})]})}),Xv=({className:e,...t})=>(V(()=>{Z.scrollToEnd.smooth()}),d("div",{"aria-hidden":!0,children:Z.isBotTyping$.value===!0?d("div",{"aria-label":"Typing…",class:He("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})),Qv={bot:"left",user:"right"},Jv=En("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]"}}}),em=({lastSentMessageFooter:e})=>{var r;const t=((r=T.current$.value.flow)==null?void 0:r.data.messages)??[];return V(()=>{Z.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(G,{children:d("li",{class:"flex",children:We(n).with({type:"system"},i=>d("p",{class:Jv({variant:i.variant}),children:i.text})).with({type:"text",author:Oe.union("bot","user")},i=>{const a=i.author==="user"&&!t.slice(o+1).some(l=>l.type==="text"&&l.author==="user"),s=o===t.length-1;return d(Yv,{animate:s,side:Qv[i.author],children:[i.text,a?e:null]},o)}).with({type:"link"},i=>d(Zv,{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(iv,{class:i.author==="bot"?void 0:"ml-auto",file:{name:i.fileName,sizeKb:i.fileSizeKb}})).exhaustive()})},o)),d(Xv,{},"typing")]})},tm=({logger:e,apiClient:t,analytics:r})=>{const{flow:n}=T.current$.value;ke(n,"Flow is required to exist to show chatbot body");const o=T.viewState$.value,{chatRef:i,chatService:a}=qh(),[s,l]=W();return ve(()=>{o==="maximised"&&Z.scrollToEnd.instant()},[o]),ve(()=>{const{state:u,flow:p}=T.current$.peek();if(u!=="loaded")throw new Error(uh.invalid_state);let c=p.data.nodeHistory.at(-1);if(Z.scrollToEnd.instant(),T.setInput(void 0),p.data.isFinished)return;c===void 0?(c=Va(n.nodes).id,T.setCurrentNodeId(c),r.log({event:"FLOW_START",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:p.data.flowSessionId,flow_build:n.build},customProperties:n.context})):T.removeMessagesSentByNodeIds([c]);const{interpret:v,abort:g,undo:m}=$h({context:n.context,analytics:r,apiClient:t,logger:e,flow:n,chatService:a,getSubmissions:()=>{var h;return(h=T.current$.peek().flow)==null?void 0:h.data.submissions},onInterpret:(h,w)=>{const k=T.current$.peek().flow;ke(k),w&&(k.data.sequence=k.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:h.id,sequence:k.data.sequence,flow_session_id:k.data.flowSessionId},customProperties:n.context})),T.setCurrentNodeId(h.id)},onFlowEnd:async()=>{T.markAsFinished();const h=T.current$.peek().flow;ke(h),r.log({event:"FLOW_END",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:h.data.flowSessionId,flow_build:n.build},customProperties:n.context})}});return l(()=>m),v(c),g},[r,t,a,e,n]),d(G,{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:T.inputHeight$.value},children:d(em,{lastSentMessageFooter:n.data.isFinished||!s?null:d(nm,{undoFn:s})})}),d(Wv,{})]})},rm=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"):[],nm=({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}=T.current$.peek();ke(t);const{removed:r}=e(t.data.nodeHistory),n=t.data.nodeHistory.splice(-r);n.length!==0&&(T.removeMessagesSentByNodeIds(n),T.setInput(void 0),n.pop(),n.map(o=>t.nodes.find(i=>i.id===o)).filter(Boolean).flatMap(rm).forEach(o=>delete t.data.submissions[o]),T.current$.value={...T.current$.value})},children:"Undo"})}),im=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:tm},Symbol.toStringTag,{value:"Module"}))})();
45
+ }`},Wa=({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}}},_h=({_internal_domManager:e=uh(),theme:t})=>et(({apiClient:r,logger:n,analytics:o})=>{let i=!1;const a=()=>{if(typeof window>"u")return;const s=[D("style",{id:"inploi-chatbot-styles"},ch),D("style",{id:"inploi-chatbot-theme"},yh(t))],c=e.getOrCreateChatbotElement();ht(D(G,{},[s,D(oh,{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)=>r.fetch(`/flow/job/${s}`).then(u=>{var l;const f=sr(sh,u);return{flow:f.flow,title:`Applying for “${f.job.title}”`,flowKeys:[f.job.id],...c,analytics:{customProperties:{job_id:f.job.id,flow_id:f.flow.id,flow_version:f.flow.version,...(l=c==null?void 0:c.analytics)==null?void 0:l.customProperties}}}}),fetchFlowById:async(s,c)=>r.fetch(`/flow/id/${s}`).then(u=>{var l;const f=sr(ah,u);return{flow:f.flow,title:"Chatbot",flowKeys:[],...c,analytics:{customProperties:{...(l=c==null?void 0:c.analytics)==null?void 0:l.customProperties,flow_id:f.flow.id,flow_version:f.flow.version}}}}),open:async s=>{if(!(typeof window>"u"))try{T.cancelCurrentFlow(),T.viewState$.value="maximised",i||a(),s instanceof Promise?(T.current$.value={state:"loading"},s.then(async c=>{Wa({context:c.context||{},schema:c.flow.context_schema,logger:n}),T.startFlow(c)}).catch(c=>{const u=c instanceof Error?c.message:"An error occurred";T.current$.value={state:"error",error:u}})):(Wa({context:s.context||{},schema:s.flow.context_schema,logger:n}),T.startFlow(s))}catch(c){n.error("Error starting flow",c)}},startApplication:void 0,closeApplication:void 0,close:async()=>{typeof window>"u"||(T.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=_h;const Yt=(e,{context:t,submissions:r})=>{const[n,...o]=e.data.compareKey.split(".");if(!n)return!1;const i=Ga({context:t,key:n,path:o,submissions:r});if(!i)return!1;switch(i.type){case"address":{const a=Dt(i.value,o.join("."));switch(e.data.compare){case"equals":return a===e.data.compareValue;case"contains":return a?a.includes(e.data.compareValue):!1;case"notEquals":return a!==e.data.compareValue;case"notContains":return a?!a.includes(e.data.compareValue):!0}break}case"integration":{if(typeof i.value!="object"||Array.isArray(i.value))return!1;const a=Dt(i.value,o.join(".")),s={...e,data:{...e.data,compareKey:"_temp"}};switch(typeof a){case"boolean":return Yt(s,{submissions:{_temp:{value:a,type:"boolean"}},context:t});case"string":return Yt(s,{submissions:{_temp:{value:a,type:"string"}},context:t});case"number":return Yt(s,{submissions:{_temp:{value:a,type:"number"}},context:t});case"object":return Array.isArray(a)&&a.every(Ra)?Yt(s,{submissions:{_temp:{value:a,type:"enum"}},context:t}):!1}break}case"boolean":{const a=e.data.compareValue==="true";switch(e.data.compare){case"equals":return i.value===a;case"notEquals":return i.value!==a}break}case"string":switch(e.data.compare){case"equals":return i.value===e.data.compareValue;case"contains":return i.value?i.value.includes(e.data.compareValue):!1;case"notEquals":return i.value!==e.data.compareValue;case"notContains":return i.value?!i.value.includes(e.data.compareValue):!0}break;case"number":{try{const a=Number(e.data.compareValue);switch(e.data.compare){case"equals":return i.value===a;case"notEquals":return i.value!==a;case"greaterThan":return i.value>a;case"greaterThanOrEqualTo":return i.value>=a;case"lessThan":return i.value<a;case"lessThanOrEqualTo":return i.value<=a}}catch{return console.error(`Failed to parse number in if-block ${e.id}`,i.value),!1}break}case"enum":switch(e.data.compare){case"equals":return i.value.length===1&&i.value[0]===e.data.compareValue;case"notEquals":return i.value.length===1&&i.value[0]!==e.data.compareValue;case"contains":return i.value.includes(e.data.compareValue);case"notContains":return!i.value.includes(e.data.compareValue)}break}return!1},wh=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,Xe=(e,{context:t,submissions:r})=>e.replace(wh,(n,o,i="")=>{const[a,...s]=o.trim().split("."),c=Ga({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} (${qt(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(Ra))return u.join(", ")}break}}return i}),Ka=({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 Ka({node:n,nodes:t,stopWhen:r})},xh=({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=Ka({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)},kh=({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:h=>t.service.log({...h,customProperties:{...h.customProperties,...t.customProperties}})},l=async(h,g)=>{const m=i();c==null||c(h,g);try{await $h({flow:e,analytics:f,logger:r,apiClient:o,context:n,node:h,submissions:m,chat:{sendMessage:async v=>a.send({groupId:h.id,message:v,signal:u.signal}),userInput:async v=>a.input({input:v,signal:u.signal}),addToSubmissions:a.addToSubmissions},next:v=>{const w=v?e.nodes.find(x=>x.id===v):xh({childNode:h,nodes:e.nodes});return w?l(w,h):s==null?void 0:s(h)},end:()=>s==null?void 0:s(h)})}catch(v){if(v instanceof Wt)return;throw v}};return{interpret:async h=>{const g=e.nodes.find(m=>m.id===h)??Fa(e.nodes);return l(g)},undo:h=>{let g=1;const m=e.nodes.find(w=>w.id===h[h.length-1]);for(let w=h.length-2;w>0;w--){const x=h[w],_=e.nodes.find(P=>P.id===x);if(!_||(g++,_.type.startsWith("question-")))break}u.abort(),u=new AbortController;const v=e.nodes.find(w=>w.id===h[h.length-g]);return xe(v,"Undo failed: new start node not found"),l(v,m),{removed:g}},abort:()=>{u.abort()}}};async function $h(e){return await Ke(e).with({node:{type:"text"}},Ph).with({node:{type:"image"}},Oh).with({node:{type:"question-text"}},Ih).with({node:{type:"question-enum"}},Th).with({node:{type:"question-number"}},Ah).with({node:{type:"question-boolean"}},Dh).with({node:{type:"question-file"}},Mh).with({node:{type:"question-address"}},Nh).with({node:{type:"end-flow"}},Fh).with({node:{type:"if-block"}},Eh).with({node:{type:"jump"}},({node:t,next:r})=>r(t.data.targetId)).with({node:{type:"link"}},Ch).with({node:{type:"integration-application-submit"}},Sh).with({node:{type:"integration-workflow-get"}},()=>Error("Unreachable")).exhaustive()}async function Sh({chat:e,next:t,node:r,logger:n,apiClient:o,submissions:i,context:a,analytics:s,flow:c}){const u=async f=>{f!==!0&&await e.userInput({type:"submit",key:void 0,config:{label:r.data.submitLabel}}),await e.sendMessage({type:"system",variant:"info",text:"Submitting…"});const{anonymous_id:l,session_id:h}=s.getSessionInfo(),g=await o.fetch("/flow/submit",{method:"POST",body:JSON.stringify({...a,integration_id:r.data.integrationId,anonymous_id:l,session_id:h,submissions:Gp(i||{})})}).catch(m=>m);r.data.key&&e.addToSubmissions(r.data.key,{type:"integration",value:g}),await Ke(g).with({ats_data:{redirect_url:Pe.string}},async m=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please complete your submission here:"});const v=new URL(m.ats_data.redirect_url);l&&!v.searchParams.has("anonymous_id")&&v.searchParams.set("anonymous_id",l),await e.sendMessage({type:"link",href:v.toString(),text:"Complete submission",onClick:()=>{if(alert("kek"),!h)return n.error("session_id not set, cannot log FLOW_REDIRECT event");s.log({event:"FLOW_REDIRECT",properties:{flow_build:c.build,flow_id:c.id,flow_session_id:h,flow_version:c.version,href:v.toString()}})}}),t(r.nextId)}).with({success:!0},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Submission completed!"}),t(r.nextId)}).with({sucess:!1,ats_data:{message:Pe.string}},async m=>{n.error(m.ats_data),await e.sendMessage({type:"system",variant:"error",text:m.ats_data.message}),await u(!1)}).otherwise(async m=>{n.error(m),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit"}),await u(!1)})};await u(r.data.skipConfirmation)}async function Ch({chat:e,next:t,node:r,submissions:n,context:o,analytics:i,flow:a,logger:s}){const{session_id:c}=i.getSessionInfo();await e.sendMessage({type:"link",href:Xe(r.data.href,{submissions:n,context:o}),text:Xe(r.data.cta,{submissions:n,context:o}),onClick:()=>{if(!c)return s.error("session_id not set, cannot log FLOW_REDIRECT event");i.log({event:"FLOW_REDIRECT",properties:{flow_build:a.build,flow_id:a.id,flow_session_id:c,flow_version:a.version,href:r.data.href}})}}),t(r.nextId)}async function Eh({submissions:e,next:t,node:r,context:n}){t(Yt(r,{submissions:e,context:n})?r.branchId:r.nextId)}async function Ph({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(r.data.text,{submissions:n,context:o})}),t(r.nextId)}async function Oh({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 Ih({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(r.data.question,{submissions:n,context:o})});const i=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}});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 Ah({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Th({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Dh({chat:e,next:t,node:r,submissions:n,context:o}){await e.sendMessage({author:"bot",type:"text",text:Xe(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 Nh({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 Mh({node:e,chat:t,next:r,submissions:n,context:o}){await t.sendMessage({author:"bot",type:"text",text:Xe(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 Fh({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const Ga=({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 Gn(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}Gn.debounce=Gn;var Lh=Gn;const Ya=Ve(Lh);function Rh(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[h,g,m]=ce(()=>{const _=()=>{if(!c.current.element)return;const{left:P,top:I,width:O,height:U,bottom:q,right:N,x:M,y:oe}=c.current.element.getBoundingClientRect(),te={left:P,top:I,width:O,height:U,bottom:q,right:N,x:M,y:oe};c.current.element instanceof HTMLElement&&o&&(te.height=c.current.element.offsetHeight,te.width=c.current.element.offsetWidth),Object.freeze(te),l.current&&!zh(c.current.lastBounds,te)&&s(c.current.lastBounds=te)};return[_,f?Ya(_,f):_,u?Ya(_,u):_]},[s,o,u,f]);function v(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",m,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function w(){c.current.element&&(c.current.resizeObserver=new i(m),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach(_=>_.addEventListener("scroll",m,{capture:!0,passive:!0})))}const x=_=>{!_||_===c.current.element||(v(),c.current.element=_,c.current.scrollContainers=Za(_),w())};return jh(m,!!r),Vh(g),V(()=>{v(),w()},[r,m,g]),V(()=>v,[]),[x,a,h]}function Vh(e){V(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function jh(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 Za(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,...Za(e.parentElement)]}const Bh=["x","y","top","bottom","left","right","width","height"],zh=(e,t)=>Bh.every(r=>e[r]===t[r]),Ct=({class:e,...t})=>d("button",{class:He("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"})]})}),Uh=25,Yn=Ge({instant:()=>{},smooth:()=>{}}),Z={onSubmitSuccessFn$:Ge(()=>{}),isBotTyping$:Ge(!1),scrollToEnd:{instant:()=>Yn.value.instant(),smooth:()=>Yn.value.smooth()}},Hh=()=>{const e=L(null);he(()=>{Yn.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=ce(()=>({addToSubmissions:(n,o)=>T.setSubmission(n,o),send:async({message:n,signal:o,groupId:i})=>{if(await Ke(n).with({author:"bot",type:"text"},async a=>{if(o!=null&&o.aborted)throw new Wt;Z.isBotTyping$.value=!0;const s=Math.min(Math.max(20,a.text.length),100)*Uh;await new Promise(c=>setTimeout(c,s,{signal:o})),Z.isBotTyping$.value=!1}).otherwise(async()=>{}),o!=null&&o.aborted)throw new Wt;T.addMessage(n,i)},input:({input:n,signal:o})=>{if(o!=null&&o.aborted)throw new Wt;return T.setInput(n),new Promise(i=>{const a=s=>{if(o!=null&&o.aborted)throw new Wt;T.setInput(void 0),n.key&&T.setSubmission(n.key,s),i(s)};Z.onSubmitSuccessFn$.value=a})}}),[]);return{chatRef:e,chatService:t}},Et=({class:e,...t})=>d("button",{type:"button",class:He("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"]}),Xa=["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Caribbean Netherlands","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Cook Islands","Costa Rica","Croatia","Cuba","Curaçao","Cyprus","Czechia","Côte d'Ivoire","Democratic Republic of the Congo","Denmark","Djibouti","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Falkland Islands (Islas Malvinas)","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern and Antarctic Lands","Gabon","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and McDonald Islands","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macao","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar (Burma)","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Korea","North Macedonia","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Romania","Russia","Rwanda","Réunion","Saint Barthélemy","Saint Helena, Ascension and Tristan da Cunha","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen","Sweden","Switzerland","Syria","São Tomé and Príncipe","Taiwan","Tajikistan","Tanzania","Thailand","The Bahamas","The Gambia","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkmenistan","Turks and Caicos Islands","Tuvalu","Türkiye","U.S. Virgin Islands","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe","Åland Islands"],Qa={line1:["street_number","floor","room","premise"],line2:["subpremise","street_address","route"],line3:["sublocality","neighborhood"],city:["locality","postal_town"],state:["administrative_area_level_1"],postcode:["postal_code"],country:["country"]},Dr=Object.keys(Qa),qh=e=>Dr.reduce((t,r)=>{const n=Qa[r],o=e.filter(i=>i.types.some(a=>n.includes(a))).map(i=>i.long_name).join(", ");return o&&(t[r]=o),t},{}),Wh=document.createElement("div"),Kh=()=>ce(()=>{const{google:e}=window;if(!("google"in window)||!("maps"in e)||!("places"in e.maps))return{enabled:!1};const t=new e.maps.places.AutocompleteService,r=new e.maps.places.PlacesService(Wh);return{enabled:!0,getPredictions:async n=>{const{predictions:o}=await t.getPlacePredictions({input:n,language:"en"});return o.map(i=>({label:i.description,value:i.place_id}))},getPlaceDetails:async n=>await new Promise((i,a)=>r.getDetails({placeId:n,fields:["address_components"],language:"en"},(s,c)=>c!==e.maps.places.PlacesServiceStatus.OK?a(c):s===null?a("ZERO_RESULTS"):i({ok:!0,place:s}))).catch(async i=>(console.error("Failed to get address details",i),{ok:!1}))}},[]),Zn=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"})]}),Xn={label:"Fill in manually",value:""},Gh=({input:e,onSubmitSuccess:t})=>{const[r,n]=K(""),[o,i]=K(),[a,s]=K([]),[c,u]=K(),{enabled:f,getPredictions:l,getPlaceDetails:h}=Kh(),[g,m]=K(f?"query":"manual"),v=ce(()=>La(w=>{xe(f,"Query state should not be enabled if Google Places isn't available"),n(w),w===""&&s([]),!(w.length<3)&&l(w).then(x=>{s(x)})},500),[f,l]);switch(V(()=>{if(f&&!(c===void 0||c===""))return h(c).then(w=>{if(!w.ok||!w.place.address_components){i({});return}const x=qh(w.place.address_components);i(x),m("details")}),()=>{i(void 0)}},[c,h,f]),g){case"query":return xe(f,"Query state should not be enabled if Google Places isn't available"),d(Yh,{input:e,onSkip:()=>t(null),onAddressSelect:w=>{u(w),m("loading")},onInputChange:v,suggestions:a,query:r});case"loading":return d(Qn,{input:e,onSubmitSuccess:t,addressFields:{},actions:d(Zn,{onClick:()=>{u(void 0),m("query")}})});case"details":return xe(o!==void 0),d(Qn,{input:e,onSubmitSuccess:t,addressFields:o,actions:d(Zn,{onClick:()=>{u(void 0),m("query")}})});case"manual":return d(Qn,{input:e,onSubmitSuccess:t,addressFields:{},actions:f?d(Zn,{onClick:()=>{u(void 0),m("query")}}):void 0})}},Yh=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:o,onInputChange:i})=>{const a=L(null);return he(()=>{a.current&&(a.current.focus(),a.current.select())},[]),d(G,{children:[d("form",{noValidate:!0,onSubmit:s=>{s.preventDefault()},class:"flex flex-col justify-end gap-1 p-2.5",children:[d("input",{onChange:s=>{i(s.currentTarget.value)},ref:a,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||"Search an address",defaultValue:o}),e.config.optional&&d(Et,{class:"absolute right-3",onClick:t})]}),d("ul",{children:[r.map(s=>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(s.value)},children:[d("span",{class:"flex-grow",children:s.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"})})]})},s.label)),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(Xn.value)},children:d("span",{class:"flex-grow",children:Xn.label})})},Xn.label)]})]})},Zh={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},Qn=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const o=L(null);return he(()=>{if(o.current){const i=o.current.querySelector("input");i&&(i.focus(),i.select())}},[]),d("form",{class:"bg-neutral-1/90 flex flex-col justify-end gap-2 p-2",onSubmit:i=>{const a=new FormData(i.currentTarget),s=Object.fromEntries(a.entries());t({type:"address",value:s})},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:Dr.map((i,a)=>{const s=`isdk_${i}`,c=n.config.keys[i];return c?d(G,{children:[d("label",{for:s,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:Zh[i]}),d("div",{class:"flex flex-col items-stretch gap-1.5",children:[i==="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:c,id:s,defaultValue:e[i],required:!0,children:[e.country&&!Xa.includes(e.country)?d("option",{value:e[i],children:e[i]}):d("option",{value:"",children:"Select a country"}),Xa.map(u=>d("option",{value:u,children:u},u))]}),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:a===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:c,id:s,defaultValue:e[i],required:!0}),a!==Dr.length-1&&d("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"}),a===Dr.length-1&&d("hr",{class:"m-0 w-full border-b border-b-transparent"})]})]}):null})}),d("div",{class:"flex w-full flex-1 ",children:[d("div",{class:"flex-grow",children:r}),d(Ct,{class:"flex items-center justify-center"})]})]})},Jn=()=>{const e=L(null);return V(()=>{var t;(t=e.current)==null||t.focus()},[]),e},Ja=["true","false"],Xh=_d(Ja),Qh="answer",Jh=({input:e,onSubmitSuccess:t})=>{const r=Jn();return d("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const o=Ke(n).with({nativeEvent:{submitter:Pe.select(Pe.union(Pe.instanceOf(HTMLButtonElement),Pe.instanceOf(HTMLInputElement)))}},a=>a.value).otherwise(()=>{throw new Error("invalid form")}),i=sr(Xh,o);t({type:"boolean",value:i==="true"})},children:[d("div",{class:"flex items-center gap-2 p-2.5",children:Ja.map((n,o)=>d("button",{ref:o===0?r:null,type:"submit",name:Qh,value:n,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 flex-1 overflow-hidden rounded-2xl px-2.5 py-2.5 ring-2 transition-all selection:bg-transparent",children:d("p",{class:"truncate text-center text-base",children:e.config.labels[n]})}))}),e.config.optional&&d("div",{class:"px-2 pb-2",children:d(Et,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},Nr=({error:e})=>e?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})]}):null,ev=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}),tv=e=>e.reduce((t,r)=>t+r.sizeKb,0),rv=Or("file"),es=3,nv=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${n}$`),"");return d("div",{class:He("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:qt(e.sizeKb)})]})},ts=({class:e,...t})=>d("li",{class:He("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),rs=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},iv=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(rs(n.name).toLowerCase()))},ov=(e,t)=>{const r=rs(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},av=({input:e,onSubmitSuccess:t})=>{var f;const r=(f=T.current$.value.flow)==null?void 0:f.data.submissions[e.key],[n,o]=K(rv(r)?r.value:[]),[i,a]=K(),s=n.length-es,c=tv(n),u=Jn();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&&!iv({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 ${qt(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(G,{children:[d("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,es).map(l=>{const h=l.name.split(".").pop(),g=l.name.replace(new RegExp(`.${h}$`),"");return d(ts,{class:"flex overflow-hidden",children:[d("span",{class:"block truncate",children:g}),d("span",{children:[".",h]})]})}),s>0?d(ts,{children:["+",s," file",s!==1?"s":""]}):null]}),d("p",{class:"text-neutral-11 text-xs",children:[qt(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 ",qt(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=>{xe(l.target instanceof HTMLInputElement);const h=l.target.files?Array.from(l.target.files):[],g=await Promise.allSettled(h.map(async v=>{const w=await ev(v);return{name:ov(v.name,42),data:w,sizeKb:v.size/1e3}}));if(g.some(({status:v})=>v==="rejected"))return a({type:"invalid",message:"Invalid file"});const m=g.map(v=>v.status==="fulfilled"?v.value:null).filter(Boolean);o(m)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),d("div",{class:"flex h-full flex-col items-center gap-2",children:[d(Ct,{disabled:n.length===0}),e.config.optional&&d(Et,{onClick:()=>t(null)})]})]}),d(Nr,{error:i})]})};var Zt=e=>e.type==="checkbox",Pt=e=>e instanceof Date,ue=e=>e==null;const ns=e=>typeof e=="object";var ee=e=>!ue(e)&&!Array.isArray(e)&&ns(e)&&!Pt(e),sv=e=>ee(e)&&e.target?Zt(e.target)?e.target.checked:e.target.value:e,cv=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,lv=(e,t)=>e.has(cv(t)),uv=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},ei=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(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(!(ei&&(e instanceof Blob||e instanceof FileList))&&(r||ee(e)))if(t=r?[]:{},!r&&!uv(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Le(e[n]));else return e;return t}var Xt=e=>Array.isArray(e)?e.filter(Boolean):[],X=e=>e===void 0,C=(e,t,r)=>{if(!t||!ee(e))return r;const n=Xt(t.split(/[,[\].]+?/)).reduce((o,i)=>ue(o)?o:o[i],e);return X(n)||n===e?X(e[t])?r:e[t]:n},Qe=e=>typeof e=="boolean";const is={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ke={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Re={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};we.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]!==ke.all&&(t._proxyFormState[a]=!n||ke.all),r&&(r[a]=!0),e[a]}});return o},ye=e=>ee(e)&&!Object.keys(e).length,fv=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return ye(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||ke.all))},ti=e=>Array.isArray(e)?e:[e];function pv(e){const t=we.useRef(e);t.current=e,we.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var Oe=e=>typeof e=="string",hv=(e,t,r,n,o)=>Oe(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),ri=e=>/^\w*$/.test(e),os=e=>Xt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function z(e,t,r){let n=-1;const o=ri(t)?[t]:os(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 as=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},ss=e=>({isOnSubmit:!e||e===ke.onSubmit,isOnBlur:e===ke.onBlur,isOnChange:e===ke.onChange,isOnAll:e===ke.all,isOnTouch:e===ke.onTouched}),cs=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Mr=(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)&&Mr(s,t)}}};var vv=(e,t,r)=>{const n=Xt(C(e,r));return z(n,"root",t[r]),z(e,r,n),e},ni=e=>e.type==="file",Je=e=>typeof e=="function",Fr=e=>{if(!ei)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Lr=e=>Oe(e),ii=e=>e.type==="radio",Rr=e=>e instanceof RegExp;const ls={value:!1,isValid:!1},us={value:!0,isValid:!0};var ds=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&&!X(e[0].attributes.value)?X(e[0].value)||e[0].value===""?us:{value:e[0].value,isValid:!0}:us:ls}return ls};const fs={isValid:!1,value:null};var ps=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,fs):fs;function hs(e,t,r="validate"){if(Lr(e)||Array.isArray(e)&&e.every(Lr)||Qe(e)&&!e)return{type:r,message:Lr(e)?e:"",ref:t}}var Ot=e=>ee(e)&&!Rr(e)?e:{value:e,message:""},vs=async(e,t,r,n,o)=>{const{ref:i,refs:a,required:s,maxLength:c,minLength:u,min:f,max:l,pattern:h,validate:g,name:m,valueAsNumber:v,mount:w,disabled:x}=e._f,_=C(t,m);if(!w||x)return{};const P=a?a[0]:i,I=j=>{n&&P.reportValidity&&(P.setCustomValidity(Qe(j)?"":j||""),P.reportValidity())},O={},U=ii(i),q=Zt(i),N=U||q,M=(v||ni(i))&&X(i.value)&&X(_)||Fr(i)&&i.value===""||_===""||Array.isArray(_)&&!_.length,oe=as.bind(null,m,r,O),te=(j,F,Q,pe=Re.maxLength,_e=Re.minLength)=>{const Ie=j?F:Q;O[m]={type:j?pe:_e,message:Ie,ref:i,...oe(j?pe:_e,Ie)}};if(o?!Array.isArray(_)||!_.length:s&&(!N&&(M||ue(_))||Qe(_)&&!_||q&&!ds(a).isValid||U&&!ps(a).isValid)){const{value:j,message:F}=Lr(s)?{value:!!s,message:s}:Ot(s);if(j&&(O[m]={type:Re.required,message:F,ref:P,...oe(Re.required,F)},!r))return I(F),O}if(!M&&(!ue(f)||!ue(l))){let j,F;const Q=Ot(l),pe=Ot(f);if(!ue(_)&&!isNaN(_)){const _e=i.valueAsNumber||_&&+_;ue(Q.value)||(j=_e>Q.value),ue(pe.value)||(F=_e<pe.value)}else{const _e=i.valueAsDate||new Date(_),Ie=zr=>new Date(new Date().toDateString()+" "+zr),lt=i.type=="time",Jt=i.type=="week";Oe(Q.value)&&_&&(j=lt?Ie(_)>Ie(Q.value):Jt?_>Q.value:_e>new Date(Q.value)),Oe(pe.value)&&_&&(F=lt?Ie(_)<Ie(pe.value):Jt?_<pe.value:_e<new Date(pe.value))}if((j||F)&&(te(!!j,Q.message,pe.message,Re.max,Re.min),!r))return I(O[m].message),O}if((c||u)&&!M&&(Oe(_)||o&&Array.isArray(_))){const j=Ot(c),F=Ot(u),Q=!ue(j.value)&&_.length>+j.value,pe=!ue(F.value)&&_.length<+F.value;if((Q||pe)&&(te(Q,j.message,F.message),!r))return I(O[m].message),O}if(h&&!M&&Oe(_)){const{value:j,message:F}=Ot(h);if(Rr(j)&&!_.match(j)&&(O[m]={type:Re.pattern,message:F,ref:i,...oe(Re.pattern,F)},!r))return I(F),O}if(g){if(Je(g)){const j=await g(_,t),F=hs(j,P);if(F&&(O[m]={...F,...oe(Re.validate,F.message)},!r))return I(F.message),O}else if(ee(g)){let j={};for(const F in g){if(!ye(j)&&!r)break;const Q=hs(await g[F](_,t),P,F);Q&&(j={...Q,...oe(F,Q.message)},I(Q.message),r&&(O[m]=j))}if(!ye(j)&&(O[m]={ref:P,...j},!r))return O}}return I(!0),O};function mv(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=X(e)?n++:e[t[n++]];return e}function bv(e){for(const t in e)if(e.hasOwnProperty(t)&&!X(e[t]))return!1;return!0}function ie(e,t){const r=Array.isArray(t)?t:ri(t)?[t]:os(t),n=r.length===1?e:mv(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(ee(n)&&ye(n)||Array.isArray(n)&&bv(n))&&ie(e,r.slice(0,-1)),e}function oi(){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 Vr=e=>ue(e)||!ns(e);function ct(e,t){if(Vr(e)||Vr(t))return e===t;if(Pt(e)&&Pt(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(Pt(i)&&Pt(a)||ee(i)&&ee(a)||Array.isArray(i)&&Array.isArray(a)?!ct(i,a):i!==a)return!1}}return!0}var ms=e=>e.type==="select-multiple",gv=e=>ii(e)||Zt(e),ai=e=>Fr(e)&&e.isConnected,bs=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function jr(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!bs(e[n])?(t[n]=Array.isArray(e[n])?[]:{},jr(e[n],t[n])):ue(e[n])||(t[n]=!0);return t}function gs(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const o in e)Array.isArray(e[o])||ee(e[o])&&!bs(e[o])?X(t)||Vr(r[o])?r[o]=Array.isArray(e[o])?jr(e[o],[]):{...jr(e[o])}:gs(e[o],ue(t)?{}:t[o],r[o]):r[o]=!ct(e[o],t[o]);return r}var si=(e,t)=>gs(e,t,jr(t)),ys=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>X(e)?e:t?e===""?NaN:e&&+e:r&&Oe(e)?new Date(e):n?n(e):e;function ci(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return ni(t)?t.files:ii(t)?ps(e.refs).value:ms(t)?[...t.selectedOptions].map(({value:r})=>r):Zt(t)?ds(e.refs).value:ys(X(t.value)?e.ref.value:t.value,e)}var yv=(e,t,r,n)=>{const o={};for(const i of e){const a=C(t,i);a&&z(o,i,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Qt=e=>X(e)?e:Rr(e)?e.source:ee(e)?Rr(e.value)?e.value.source:e.value:e,_v=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _s(e,t,r){const n=C(e,r);if(n||ri(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 wv=(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,xv=(e,t)=>!Xt(C(e,t)).length&&ie(e,t);const kv={mode:ke.onSubmit,reValidateMode:ke.onChange,shouldFocusError:!0};function $v(e={},t){let r={...kv,...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)?Le(r.defaultValues||r.values)||{}:{},a=r.shouldUnregister?{}:Le(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},h={values:oi(),array:oi(),state:oi()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,m=ss(r.mode),v=ss(r.reValidateMode),w=r.criteriaMode===ke.all,x=p=>b=>{clearTimeout(f),f=setTimeout(p,b)},_=async p=>{if(l.isValid||p){const b=r.resolver?ye((await M()).errors):await te(o,!0);b!==n.isValid&&h.state.next({isValid:b})}},P=p=>l.isValidating&&h.state.next({isValidating:p}),I=(p,b=[],y,E,$=!0,k=!0)=>{if(E&&y){if(s.action=!0,k&&Array.isArray(C(o,p))){const A=y(C(o,p),E.argA,E.argB);$&&z(o,p,A)}if(k&&Array.isArray(C(n.errors,p))){const A=y(C(n.errors,p),E.argA,E.argB);$&&z(n.errors,p,A),xv(n.errors,p)}if(l.touchedFields&&k&&Array.isArray(C(n.touchedFields,p))){const A=y(C(n.touchedFields,p),E.argA,E.argB);$&&z(n.touchedFields,p,A)}l.dirtyFields&&(n.dirtyFields=si(i,a)),h.state.next({name:p,isDirty:F(p,b),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else z(a,p,b)},O=(p,b)=>{z(n.errors,p,b),h.state.next({errors:n.errors})},U=(p,b,y,E)=>{const $=C(o,p);if($){const k=C(a,p,X(y)?C(i,p):y);X(k)||E&&E.defaultChecked||b?z(a,p,b?k:ci($._f)):_e(p,k),s.mount&&_()}},q=(p,b,y,E,$)=>{let k=!1,A=!1;const H={name:p};if(!y||E){l.isDirty&&(A=n.isDirty,n.isDirty=H.isDirty=F(),k=A!==H.isDirty);const J=ct(C(i,p),b);A=C(n.dirtyFields,p),J?ie(n.dirtyFields,p):z(n.dirtyFields,p,!0),H.dirtyFields=n.dirtyFields,k=k||l.dirtyFields&&A!==!J}if(y){const J=C(n.touchedFields,p);J||(z(n.touchedFields,p,y),H.touchedFields=n.touchedFields,k=k||l.touchedFields&&J!==y)}return k&&$&&h.state.next(H),k?H:{}},N=(p,b,y,E)=>{const $=C(n.errors,p),k=l.isValid&&Qe(b)&&n.isValid!==b;if(e.delayError&&y?(u=x(()=>O(p,y)),u(e.delayError)):(clearTimeout(f),u=null,y?z(n.errors,p,y):ie(n.errors,p)),(y?!ct($,y):$)||!ye(E)||k){const A={...E,...k&&Qe(b)?{isValid:b}:{},errors:n.errors,name:p};n={...n,...A},h.state.next(A)}P(!1)},M=async p=>r.resolver(a,r.context,yv(p||c.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),oe=async p=>{const{errors:b}=await M(p);if(p)for(const y of p){const E=C(b,y);E?z(n.errors,y,E):ie(n.errors,y)}else n.errors=b;return b},te=async(p,b,y={valid:!0})=>{for(const E in p){const $=p[E];if($){const{_f:k,...A}=$;if(k){const H=c.array.has(k.name),J=await vs($,a,w,r.shouldUseNativeValidation&&!b,H);if(J[k.name]&&(y.valid=!1,b))break;!b&&(C(J,k.name)?H?vv(n.errors,J,k.name):z(n.errors,k.name,J[k.name]):ie(n.errors,k.name))}A&&await te(A,b,y)}}return y.valid},j=()=>{for(const p of c.unMount){const b=C(o,p);b&&(b._f.refs?b._f.refs.every(y=>!ai(y)):!ai(b._f.ref))&&fi(p)}c.unMount=new Set},F=(p,b)=>(p&&b&&z(a,p,b),!ct(xs(),i)),Q=(p,b,y)=>hv(p,c,{...s.mount?a:X(b)?i:Oe(p)?{[p]:b}:b},y,b),pe=p=>Xt(C(s.mount?a:i,p,e.shouldUnregister?C(i,p,[]):[])),_e=(p,b,y={})=>{const E=C(o,p);let $=b;if(E){const k=E._f;k&&(!k.disabled&&z(a,p,ys(b,k)),$=Fr(k.ref)&&ue(b)?"":b,ms(k.ref)?[...k.ref.options].forEach(A=>A.selected=$.includes(A.value)):k.refs?Zt(k.ref)?k.refs.length>1?k.refs.forEach(A=>(!A.defaultChecked||!A.disabled)&&(A.checked=Array.isArray($)?!!$.find(H=>H===A.value):$===A.value)):k.refs[0]&&(k.refs[0].checked=!!$):k.refs.forEach(A=>A.checked=A.value===$):ni(k.ref)?k.ref.value="":(k.ref.value=$,k.ref.type||h.values.next({name:p,values:{...a}})))}(y.shouldDirty||y.shouldTouch)&&q(p,$,y.shouldTouch,y.shouldDirty,!0),y.shouldValidate&&di(p)},Ie=(p,b,y)=>{for(const E in b){const $=b[E],k=`${p}.${E}`,A=C(o,k);(c.array.has(p)||!Vr($)||A&&!A._f)&&!Pt($)?Ie(k,$,y):_e(k,$,y)}},lt=(p,b,y={})=>{const E=C(o,p),$=c.array.has(p),k=Le(b);z(a,p,k),$?(h.array.next({name:p,values:{...a}}),(l.isDirty||l.dirtyFields)&&y.shouldDirty&&h.state.next({name:p,dirtyFields:si(i,a),isDirty:F(p,k)})):E&&!E._f&&!ue(k)?Ie(p,k,y):_e(p,k,y),cs(p,c)&&h.state.next({...n}),h.values.next({name:p,values:{...a}}),!s.mount&&t()},Jt=async p=>{const b=p.target;let y=b.name,E=!0;const $=C(o,y),k=()=>b.type?ci($._f):sv(p),A=H=>{E=Number.isNaN(H)||H===C(a,y,H)};if($){let H,J;const Ur=k(),At=p.type===is.BLUR||p.type===is.FOCUS_OUT,cm=!_v($._f)&&!r.resolver&&!C(n.errors,y)&&!$._f.deps||wv(At,C(n.touchedFields,y),n.isSubmitted,v,m),hi=cs(y,c,At);z(a,y,Ur),At?($._f.onBlur&&$._f.onBlur(p),u&&u(0)):$._f.onChange&&$._f.onChange(p);const vi=q(y,Ur,At,!1),lm=!ye(vi)||hi;if(!At&&h.values.next({name:y,type:p.type,values:{...a}}),cm)return l.isValid&&_(),lm&&h.state.next({name:y,...hi?{}:vi});if(!At&&hi&&h.state.next({...n}),P(!0),r.resolver){const{errors:Is}=await M([y]);if(A(Ur),E){const um=_s(n.errors,o,y),As=_s(Is,o,um.name||y);H=As.error,y=As.name,J=ye(Is)}}else H=(await vs($,a,w,r.shouldUseNativeValidation))[y],A(Ur),E&&(H?J=!1:l.isValid&&(J=await te(o,!0)));E&&($._f.deps&&di($._f.deps),N(y,J,H,vi))}},zr=(p,b)=>{if(C(n.errors,b)&&p.focus)return p.focus(),1},di=async(p,b={})=>{let y,E;const $=ti(p);if(P(!0),r.resolver){const k=await oe(X(p)?p:$);y=ye(k),E=p?!$.some(A=>C(k,A)):y}else p?(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)&&_()):E=y=await te(o);return h.state.next({...!Oe(p)||l.isValid&&y!==n.isValid?{}:{name:p},...r.resolver||!p?{isValid:y}:{},errors:n.errors,isValidating:!1}),b.shouldFocus&&!E&&Mr(o,zr,p?$:c.mount),E},xs=p=>{const b={...i,...s.mount?a:{}};return X(p)?b:Oe(p)?C(b,p):p.map(y=>C(b,y))},ks=(p,b)=>({invalid:!!C((b||n).errors,p),isDirty:!!C((b||n).dirtyFields,p),isTouched:!!C((b||n).touchedFields,p),error:C((b||n).errors,p)}),im=p=>{p&&ti(p).forEach(b=>ie(n.errors,b)),h.state.next({errors:p?n.errors:{}})},$s=(p,b,y)=>{const E=(C(o,p,{_f:{}})._f||{}).ref;z(n.errors,p,{...b,ref:E}),h.state.next({name:p,errors:n.errors,isValid:!1}),y&&y.shouldFocus&&E&&E.focus&&E.focus()},om=(p,b)=>Je(p)?h.values.subscribe({next:y=>p(Q(void 0,b),y)}):Q(p,b,!0),fi=(p,b={})=>{for(const y of p?ti(p):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);h.values.next({values:{...a}}),h.state.next({...n,...b.keepDirty?{isDirty:F()}:{}}),!b.keepIsValid&&_()},Ss=({disabled:p,name:b,field:y,fields:E,value:$})=>{if(Qe(p)){const k=p?void 0:X($)?ci(y?y._f:C(E,b)._f):$;z(a,b,k),q(b,k,!1,!1,!0)}},pi=(p,b={})=>{let y=C(o,p);const E=Qe(b.disabled);return z(o,p,{...y||{},_f:{...y&&y._f?y._f:{ref:{name:p}},name:p,mount:!0,...b}}),c.mount.add(p),y?Ss({field:y,disabled:b.disabled,name:p}):U(p,!0,b.value),{...E?{disabled:b.disabled}:{},...r.progressive?{required:!!b.required,min:Qt(b.min),max:Qt(b.max),minLength:Qt(b.minLength),maxLength:Qt(b.maxLength),pattern:Qt(b.pattern)}:{},name:p,onChange:Jt,onBlur:Jt,ref:$=>{if($){pi(p,b),y=C(o,p);const k=X($.value)&&$.querySelectorAll&&$.querySelectorAll("input,select,textarea")[0]||$,A=gv(k),H=y._f.refs||[];if(A?H.find(J=>J===k):k===y._f.ref)return;z(o,p,{_f:{...y._f,...A?{refs:[...H.filter(ai),k,...Array.isArray(C(i,p))?[{}]:[]],ref:{type:k.type,name:p}}:{ref:k}}}),U(p,!1,void 0,k)}else y=C(o,p,{}),y._f&&(y._f.mount=!1),(r.shouldUnregister||b.shouldUnregister)&&!(lv(c.array,p)&&s.action)&&c.unMount.add(p)}}},Cs=()=>r.shouldFocusError&&Mr(o,zr,c.mount),am=p=>{Qe(p)&&(h.state.next({disabled:p}),Mr(o,b=>{b.disabled=p},0,!1))},Es=(p,b)=>async y=>{y&&(y.preventDefault&&y.preventDefault(),y.persist&&y.persist());let E=Le(a);if(h.state.next({isSubmitting:!0}),r.resolver){const{errors:$,values:k}=await M();n.errors=$,E=k}else await te(o);ie(n.errors,"root"),ye(n.errors)?(h.state.next({errors:{}}),await p(E,y)):(b&&await b({...n.errors},y),Cs(),setTimeout(Cs)),h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ye(n.errors),submitCount:n.submitCount+1,errors:n.errors})},sm=(p,b={})=>{C(o,p)&&(X(b.defaultValue)?lt(p,C(i,p)):(lt(p,b.defaultValue),z(i,p,b.defaultValue)),b.keepTouched||ie(n.touchedFields,p),b.keepDirty||(ie(n.dirtyFields,p),n.isDirty=b.defaultValue?F(p,C(i,p)):F()),b.keepError||(ie(n.errors,p),l.isValid&&_()),h.state.next({...n}))},Ps=(p,b={})=>{const y=p?Le(p):i,E=Le(y),$=p&&!ye(p)?E:i;if(b.keepDefaultValues||(i=y),!b.keepValues){if(b.keepDirtyValues||g)for(const k of c.mount)C(n.dirtyFields,k)?z($,k,C(a,k)):lt(k,C($,k));else{if(ei&&X(p))for(const k of c.mount){const A=C(o,k);if(A&&A._f){const H=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(Fr(H)){const J=H.closest("form");if(J){J.reset();break}}}}o={}}a=e.shouldUnregister?b.keepDefaultValues?Le(i):{}:Le($),h.array.next({values:{...$}}),h.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,h.state.next({submitCount:b.keepSubmitCount?n.submitCount:0,isDirty:b.keepDirty?n.isDirty:!!(b.keepDefaultValues&&!ct(p,i)),isSubmitted:b.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:b.keepDirtyValues?n.dirtyFields:b.keepDefaultValues&&p?si(i,p):{},touchedFields:b.keepTouched?n.touchedFields:{},errors:b.keepErrors?n.errors:{},isSubmitSuccessful:b.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Os=(p,b)=>Ps(Je(p)?p(a):p,b);return{control:{register:pi,unregister:fi,getFieldState:ks,handleSubmit:Es,setError:$s,_executeSchema:M,_getWatch:Q,_getDirty:F,_updateValid:_,_removeUnmounted:j,_updateFieldArray:I,_updateDisabledField:Ss,_getFieldArray:pe,_reset:Ps,_resetDefaultValues:()=>Je(r.defaultValues)&&r.defaultValues().then(p=>{Os(p,r.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:p=>{n={...n,...p}},_disableForm:am,_subjects:h,_proxyFormState:l,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(p){s=p},get _defaultValues(){return i},get _names(){return c},set _names(p){c=p},get _formState(){return n},set _formState(p){n=p},get _options(){return r},set _options(p){r={...r,...p}}},trigger:di,register:pi,handleSubmit:Es,watch:om,setValue:lt,getValues:xs,reset:Os,resetField:sm,clearErrors:im,unregister:fi,setError:$s,setFocus:(p,b={})=>{const y=C(o,p),E=y&&y._f;if(E){const $=E.refs?E.refs[0]:E.ref;$.focus&&($.focus(),b.shouldSelect&&$.select())}},getFieldState:ks}}function li(e={}){const t=we.useRef(),r=we.useRef(),[n,o]=we.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={...$v(e,()=>o(a=>({...a}))),formState:n});const i=t.current.control;return i._options=e,pv({subject:i._subjects.state,next:a=>{fv(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),we.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),we.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),we.useEffect(()=>{e.values&&!ct(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values):i._resetDefaultValues()},[e.values,i]),we.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 ws=function(e,t,r){if(e&&"reportValidity"in e){var n=C(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Sv=function(e,t){var r=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?ws(i.ref,o,e):i.refs&&i.refs.forEach(function(a){return ws(a,o,e)})};for(var n in t.fields)r(n)},Cv=function(e,t){t.shouldUseNativeValidation&&Sv(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(Pv(t.names||Object.keys(e),n)){var a=Object.assign({},Ev(C(r,n)));z(a,"root",i),z(r,n,a)}else z(r,n,i)}return r},Ev=function(e){return Array.isArray(e)?e.filter(Boolean):[]},Pv=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},Ov=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]=as(o,t,r,n.validation,a?[].concat(a,n.message):n.message)}e.issues.shift()}}return r},ui=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(sr(e,n,f)):Promise.resolve($d(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 en)return{values:{},errors:Cv(Ov(a,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};const Iv=27,Av=12,Tv=10,Dv=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},Nv=Or("enum"),Mv=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return ui(Ne({checked:to(eo(Qi()),r=>Object.entries(r).filter(([n,o])=>o).map(([n,o])=>n),[Rt(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),ro(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},Fv=({input:e,onSubmitSuccess:t})=>{var c,u;const r=e.key?(c=T.current$.value.flow)==null?void 0:c.data.submissions[e.key]:void 0,n=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,{register:o,handleSubmit:i,formState:{errors:a}}=li({defaultValues:{checked:n?{}:Nv(r)?Object.fromEntries(r.value.map(f=>[f,!0])):{}},resolver:Mv(e.config)}),s=Jn();return d("form",{noValidate:!0,class:"pr-2.5",onChange:f=>{n&&Dv(f.currentTarget)},onSubmit:i(f=>{const l=f.checked;t({type:"enum",value:l})}),children:[d("div",{class:"flex items-center gap-1",children:[d("ul",{style:{maxHeight:6.5*Iv+5*Av+2*Tv},class:He("gutter-stable flex w-full flex-1 flex-wrap gap-3 overflow-y-auto rounded-xl p-2.5 pr-4",{"justify-center":e.config.options.length===1}),children:e.config.options.map((f,l)=>{const h=`checked.${f.value}`,{ref:g,...m}=o(h);return d("li",{class:"relative",children:[d("input",{autoFocus:l===0,ref:v=>{v&&l===0&&(s.current=v),g(v)},id:h,...m,class:"peer sr-only h-full",type:"checkbox"}),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:h,children:f.label})]},f.value)})}),d("div",{class:"flex flex-col items-center gap-2",children:[!n&&d(Ct,{}),e.config.minSelected===0&&d(Et,{type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),d("div",{class:"px-1",children:d(Nr,{error:(u=a.checked)==null?void 0:u.root})})]})},Lv=Or("number"),Br={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`},Rv=e=>{const t=e.min??Number.MIN_SAFE_INTEGER,r=e.max??Number.MAX_SAFE_INTEGER,n=e.decimalCases??0;return ui(Ne({number:tn(Br.number(),[Od(t,Br.min(t)),Pd(r,Br.max(r)),Cd(o=>o===Number(o.toFixed(n)),Br.decimalCases(n))])}))},Vv=({input:e,onSubmitSuccess:t})=>{var f;const r=e.config.defaultValue,n=e.key?(f=T.current$.value.flow)==null?void 0:f.data.submissions[e.key]:void 0,{register:o,handleSubmit:i,formState:{errors:a}}=li({defaultValues:{number:r?Number(r):Lv(n)?n.value:void 0},resolver:Rv(e.config)}),{ref:s,...c}=o("number",{required:!e.config.optional,valueAsNumber:!0}),u=L();return he(()=>{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(Et,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(Ct,{})]}),d(Nr,{error:a.number})]})},jv=({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}),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"})]})]})})}),It={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"},Bv=$e(It.phone,[Id(/^\+?[0-9 -]+$/,It.phone)]),zv={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},Uv=Or("string"),Hv=e=>{const t=`Please enter no more than ${e.maxChars} characters`;return ui(Ne({text:{email:$e(It.email,[Ed(It.email),Rt(e.maxChars??1/0,t)]),phone:to(Bv,r=>r.replace(/[^0-9]/g,""),[Rt(e.maxChars??1/0,t)]),text:$e([ro(1,It.empty),Rt(e.maxChars??1/0,t)]),url:$e([Ad(It.url),Rt(e.maxChars??1/0,t)])}[e.format]}))},qv=({input:e,onSubmitSuccess:t})=>{var f;const r=e.key?(f=T.current$.value.flow)==null?void 0:f.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:o,handleSubmit:i,formState:{errors:a}}=li({defaultValues:{text:n||(Uv(r)?r.value:"")},resolver:Hv(e.config)}),{ref:s,...c}=o("text",{required:!e.config.optional}),u=L();return he(()=>{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-grow",children:[d("input",{id:"chat-input",...c,...zv[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(Et,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(Ct,{})]}),d(Nr,{error:a.text})]})},Wv=()=>{var o;const e=(o=T.current$.value.flow)==null?void 0:o.data.currentInput,[t,r]=Rh(),n=L(null);return T.inputHeight$.value=r.height,V(()=>{const i=n.current;if(i)return i.addEventListener("transitionstart",Z.scrollToEnd.smooth),i.addEventListener("transitioncancel",Z.scrollToEnd.smooth),i.addEventListener("transitionend",Z.scrollToEnd.smooth),()=>{i.removeEventListener("transitionstart",Z.scrollToEnd.smooth),i.removeEventListener("transitioncancel",Z.scrollToEnd.smooth),i.removeEventListener("transitionend",Z.scrollToEnd.smooth)}},[]),d("div",{ref:n,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:r.height},children:d("div",{ref:t,class:"border-divider flex flex-col justify-end border-t",children:Ke({input:e}).with({input:Pe.nullish},()=>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(Ct,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},i=>d(qv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"multiple-choice"}},i=>d(Fv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"boolean"}},i=>d(Jh,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"file"}},i=>d(av,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"submit"}},i=>d(jv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"address"}},i=>d(Gh,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).with({input:{type:"number"}},i=>d(Vv,{onSubmitSuccess:Z.onSubmitSuccessFn$.value,...i})).exhaustive()})})},Kv=Cn("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"}}),Gv=({children:e,className:t,animate:r,side:n,...o})=>d("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Kv({className:t,side:n,animate:r}),...o,children:e}),Yv=({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"})})]})}),Zv=({className:e,...t})=>(V(()=>{Z.scrollToEnd.smooth()}),d("div",{"aria-hidden":!0,children:Z.isBotTyping$.value===!0?d("div",{"aria-label":"Typing…",class:He("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})),Xv={bot:"left",user:"right"},Qv=Cn("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]"}}}),Jv=({lastSentMessageFooter:e})=>{var r;const t=((r=T.current$.value.flow)==null?void 0:r.data.messages)??[];return V(()=>{Z.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(G,{children:d("li",{class:"flex",children:Ke(n).with({type:"system"},i=>d("p",{class:Qv({variant:i.variant}),children:i.text})).with({type:"text",author:Pe.union("bot","user")},i=>{const a=i.author==="user"&&!t.slice(o+1).some(c=>c.type==="text"&&c.author==="user"),s=o===t.length-1;return d(Gv,{animate:s,side:Xv[i.author],children:[i.text,a?e:null]},o)}).with({type:"link"},i=>d(Yv,{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(nv,{class:i.author==="bot"?void 0:"ml-auto",file:{name:i.fileName,sizeKb:i.fileSizeKb}})).exhaustive()})},o)),d(Zv,{},"typing")]})},em=({logger:e,apiClient:t,analytics:r})=>{const{flow:n}=T.current$.value;xe(n,"Flow is required to exist to show chatbot body");const o=T.viewState$.value,{chatRef:i,chatService:a}=Hh(),[s,c]=K();return he(()=>{o==="maximised"&&Z.scrollToEnd.instant()},[o]),he(()=>{var v,w;const{state:u,flow:f}=T.current$.peek();if(u!=="loaded")throw new Error(lh.invalid_state);let l=f.data.nodeHistory.at(-1);if(Z.scrollToEnd.instant(),T.setInput(void 0),f.data.isFinished)return;l===void 0?(l=Fa(n.nodes).id,T.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},customProperties:(v=n.analytics)==null?void 0:v.customProperties})):T.removeMessagesSentByNodeIds([l]);const{interpret:h,abort:g,undo:m}=kh({context:n.context,analytics:{service:r,customProperties:(w=n.analytics)==null?void 0:w.customProperties},apiClient:t,logger:e,flow:n,chatService:a,getSubmissions:()=>{var x;return(x=T.current$.peek().flow)==null?void 0:x.data.submissions},onInterpret:(x,_)=>{var I;const P=T.current$.peek().flow;xe(P),_&&(P.data.sequence=P.data.sequence+1,r.log({event:"FLOW_NODE",properties:{flow_id:n.id,flow_version:n.version,from_node_id:_.id,flow_build:n.build,to_node_id:x.id,sequence:P.data.sequence,flow_session_id:P.data.flowSessionId},customProperties:(I=n.analytics)==null?void 0:I.customProperties})),T.setCurrentNodeId(x.id)},onFlowEnd:async()=>{var _;T.markAsFinished();const x=T.current$.peek().flow;xe(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},customProperties:(_=n.analytics)==null?void 0:_.customProperties})}});return c(()=>m),h(l),g},[r,t,a,e,n]),d(G,{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:T.inputHeight$.value},children:d(Jv,{lastSentMessageFooter:n.data.isFinished||!s?null:d(rm,{undoFn:s})})}),d(Wv,{})]})},tm=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}=T.current$.peek();xe(t);const{removed:r}=e(t.data.nodeHistory),n=t.data.nodeHistory.splice(-r);n.length!==0&&(T.removeMessagesSentByNodeIds(n),T.setInput(void 0),n.pop(),n.map(o=>t.nodes.find(i=>i.id===o)).filter(Boolean).flatMap(tm).forEach(o=>delete t.data.submissions[o]),T.current$.value={...T.current$.value})},children:"Undo"})}),nm=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:em},Symbol.toStringTag,{value:"Module"}))})();