@inploi/plugin-chatbot 3.14.0 → 3.15.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,7 +1,7 @@
1
- var Wd=Object.defineProperty;var Kd=(Ze,he,S)=>he in Ze?Wd(Ze,he,{enumerable:!0,configurable:!0,writable:!0,value:S}):Ze[he]=S;var Gs=(Ze,he,S)=>(Kd(Ze,typeof he!="symbol"?he+"":he,S),S);(function(){"use strict";var Ze=e=>e,he,S,Zn,Qn,Qe,Xn,Jn,Ar,ei,lt={},ti=[],Zs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;function Ae(e,t){for(var r in t)e[r]=t[r];return e}function ri(e){var t=e.parentNode;t&&t.removeChild(e)}function T(e,t,r){var n,o,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?he.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return St(e,s,n,o,null)}function St(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??++Zn};return o==null&&S.vnode!=null&&S.vnode(i),i}function ni(){return{current:null}}function q(e){return e.children}function me(e,t){this.props=e,this.context=t}function Yt(e,t){if(t==null)return e.__?Yt(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"?Yt(e):null}function ii(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 ii(e)}}function Ir(e){(!e.__d&&(e.__d=!0)&&Qe.push(e)&&!Gt.__r++||Xn!==S.debounceRendering)&&((Xn=S.debounceRendering)||Jn)(Gt)}function Gt(){var e,t,r,n,o,i,s,a,c;for(Qe.sort(Ar);e=Qe.shift();)e.__d&&(t=Qe.length,n=void 0,o=void 0,i=void 0,a=(s=(r=e).__v).__e,(c=r.__P)&&(n=[],o=[],(i=Ae({},s)).__v=s.__v+1,Dr(c,s,i,r.__n,c.ownerSVGElement!==void 0,s.__h!=null?[a]:null,n,a??Yt(s),s.__h,o),di(n,s,o),s.__e!=a&&ii(s)),Qe.length>t&&Qe.sort(Ar));Gt.__r=0}function oi(e,t,r,n,o,i,s,a,c,u,p){var l,v,b,g,h,_,k,w,P,I,O=0,z=n&&n.__k||ti,W=z.length,N=W,F=t.length;for(r.__k=[],l=0;l<F;l++)(g=r.__k[l]=(g=t[l])==null||typeof g=="boolean"||typeof g=="function"?null:typeof g=="string"||typeof g=="number"||typeof g=="bigint"?St(null,g,null,null,g):qt(g)?St(q,{children:g},null,null,null):g.__b>0?St(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)!=null&&(g.__=r,g.__b=r.__b+1,(w=Qs(g,z,k=l+O,N))===-1?b=lt:(b=z[w]||lt,z[w]=void 0,N--),Dr(e,g,b,o,i,s,a,c,u,p),h=g.__e,(v=g.ref)&&b.ref!=v&&(b.ref&&Tr(b.ref,null,g),p.push(v,g.__c||h,g)),h!=null&&(_==null&&(_=h),I=!(P=b===lt||b.__v===null)&&w===k,P?w==-1&&O--:w!==k&&(w===k+1?(O++,I=!0):w>k?N>F-k?(O+=w-k,I=!0):O--:O=w<k&&w==k-1?w-k:0),k=l+O,I=I||w==l&&!P,typeof g.type!="function"||w===k&&b.__k!==g.__k?typeof g.type=="function"||I?g.__d!==void 0?(c=g.__d,g.__d=void 0):c=h.nextSibling:c=ai(e,h,c):c=si(g,c,e),typeof r.type=="function"&&(r.__d=c)));for(r.__e=_,l=W;l--;)z[l]!=null&&(typeof r.type=="function"&&z[l].__e!=null&&z[l].__e==r.__d&&(r.__d=z[l].__e.nextSibling),fi(z[l],z[l]))}function si(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"?si(n,t,r):ai(r,n.__e,t));return t}function Ie(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Ie(r,t)}):t.push(e)),t}function ai(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 Qs(e,t,r,n){var o=e.key,i=e.type,s=r-1,a=r+1,c=t[r];if(c===null||c&&o==c.key&&i===c.type)return r;if(n>(c!=null?1:0))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&o==c.key&&i===c.type)return a;a++}}return-1}function Xs(e,t,r,n,o){var i;for(i in r)i==="children"||i==="key"||i in t||Zt(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]||Zt(e,i,t[i],r[i],n)}function li(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Zs.test(t)?r:r+"px"}function Zt(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||li(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||li(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?ui:ci,i):e.removeEventListener(t,i?ui:ci,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 ci(e){return this.l[e.type+!1](S.event?S.event(e):e)}function ui(e){return this.l[e.type+!0](S.event?S.event(e):e)}function Dr(e,t,r,n,o,i,s,a,c,u){var p,l,v,b,g,h,_,k,w,P,I,O,z,W,N,F=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(c=r.__h,a=t.__e=r.__e,t.__h=null,i=[a]),(p=S.__b)&&p(t);try{e:if(typeof F=="function"){if(k=t.props,w=(p=F.contextType)&&n[p.__c],P=p?w?w.props.value:p.__:n,r.__c?_=(l=t.__c=r.__c).__=l.__E:("prototype"in F&&F.prototype.render?t.__c=l=new F(k,P):(t.__c=l=new me(k,P),l.constructor=F,l.render=ea),w&&w.sub(l),l.props=k,l.state||(l.state={}),l.context=P,l.__n=n,v=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ae({},l.__s)),Ae(l.__s,F.getDerivedStateFromProps(k,l.__s))),b=l.props,g=l.state,l.__v=t,v)F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F.getDerivedStateFromProps==null&&k!==b&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(k,P),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(k,l.__s,P)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=k,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(ie){ie&&(ie.__=t)}),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(k,l.__s,P),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(b,g,h)})}if(l.context=P,l.props=k,l.__P=e,l.__e=!1,O=S.__r,z=0,"prototype"in F&&F.prototype.render){for(l.state=l.__s,l.__d=!1,O&&O(t),p=l.render(l.props,l.state,l.context),W=0;W<l._sb.length;W++)l.__h.push(l._sb[W]);l._sb=[]}else do l.__d=!1,O&&O(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++z<25);l.state=l.__s,l.getChildContext!=null&&(n=Ae(Ae({},n),l.getChildContext())),v||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(b,g)),oi(e,qt(N=p!=null&&p.type===q&&p.key==null?p.props.children:p)?N:[N],t,r,n,o,i,s,a,c,u),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),_&&(l.__E=l.__=null)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Js(r.__e,t,r,n,o,i,s,c,u);(p=S.diffed)&&p(t)}catch(ie){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),S.__e(ie,t,r)}}function di(e,t,r){for(var n=0;n<r.length;n++)Tr(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 Js(e,t,r,n,o,i,s,a,c){var u,p,l,v=r.props,b=t.props,g=t.type,h=0;if(g==="svg"&&(o=!0),i!=null){for(;h<i.length;h++)if((u=i[h])&&"setAttribute"in u==!!g&&(g?u.localName===g:u.nodeType===3)){e=u,i[h]=null;break}}if(e==null){if(g===null)return document.createTextNode(b);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,b.is&&b),i=null,a=!1}if(g===null)v===b||a&&e.data===b||(e.data=b);else{if(i=i&&he.call(e.childNodes),p=(v=r.props||lt).dangerouslySetInnerHTML,l=b.dangerouslySetInnerHTML,!a){if(i!=null)for(v={},h=0;h<e.attributes.length;h++)v[e.attributes[h].name]=e.attributes[h].value;(l||p)&&(l&&(p&&l.__html==p.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(Xs(e,b,v,o,a),l)t.__k=[];else if(oi(e,qt(h=t.props.children)?h:[h],t,r,n,o&&g!=="foreignObject",i,s,i?i[0]:r.__k&&Yt(r,0),a,c),i!=null)for(h=i.length;h--;)i[h]!=null&&ri(i[h]);a||("value"in b&&(h=b.value)!==void 0&&(h!==e.value||g==="progress"&&!h||g==="option"&&h!==v.value)&&Zt(e,"value",h,v.value,!1),"checked"in b&&(h=b.checked)!==void 0&&h!==e.checked&&Zt(e,"checked",h,v.checked,!1))}return e}function Tr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){S.__e(n,r)}}function fi(e,t,r){var n,o;if(S.unmount&&S.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Tr(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]&&fi(n[o],t,r||typeof e.type!="function");r||e.__e==null||ri(e.__e),e.__=e.__e=e.__d=void 0}function ea(e,t,r){return this.constructor(e,r)}function ct(e,t,r){var n,o,i,s;S.__&&S.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],s=[],Dr(t,e=(!n&&r||t).__k=T(q,null,[e]),o||lt,lt,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?he.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,s),di(i,e,s)}function pi(e,t){ct(e,t,pi)}function ta(e,t,r){var n,o,i,s,a=Ae({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&s!==void 0?s[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?he.call(arguments,2):r),St(e.type,a,n||e.key,o||e.ref,null)}function Et(e,t){var r={__c:t="__cC"+ei++,__: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(s){this.props.value!==s.value&&o.some(function(a){a.__e=!0,Ir(a)})},this.sub=function(s){o.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),a&&a.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}he=ti.slice,S={__e:function(e,t,r,n){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},Zn=0,Qn=function(e){return e!=null&&e.constructor===void 0},me.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),Ir(this))},me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ir(this))},me.prototype.render=q,Qe=[],Jn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ar=function(e,t){return e.__v.__b-t.__v.__b},Gt.__r=0,ei=0;var Nr=class extends Error{constructor(t){super(t[0].message);Gs(this,"issues");this.name="ValiError",this.issues=t}};function hi(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function Ct(e){return{issues:e}}function Le(e){return{output:e}}function ra(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 na(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 Re(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return Le(e);let o,i,s=e;for(const a of t){const c=a._parse(s);if(c.issues){o=o||na(r,n);for(const u of c.issues){const p=ra(o,u);i?i.push(p):i=[p]}if(o.abortEarly||o.abortPipeEarly)break}else s=c.output}return i?Ct(i):Le(s)}function Ve(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function vi(e){return typeof e=="function"?e():e}function Ot(e,t,r,n){return Ct([{validation:e,message:vi(t),input:r,requirement:n}])}function ia(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[i,s]=Ve(t,r);return[e,i,s]}const[n,o]=Ve(e,t);return[void 0,n,o]}function Xe(e,t,r,n,o,i){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:vi(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 gi(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return Re(t,this.pipe,r,"any")}}}function mi(e,t,r){const[n="Invalid type",o]=Ve(t,r);return{type:"array",async:!1,item:e,message:n,pipe:o,_parse(i,s){if(!Array.isArray(i))return Xe(s,"type","array",this.message,i);let a;const c=[];for(let u=0;u<i.length;u++){const p=i[u],l=this.item._parse(p,s);if(l.issues){const v={type:"array",input:i,key:u,value:p};for(const b of l.issues)b.path?b.path.unshift(v):b.path=[v],a==null||a.push(b);if(a||(a=l.issues),s!=null&&s.abortEarly)break}else c.push(l.output)}return a?Ct(a):Re(c,this.pipe,s,"array")}}}function oa(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="boolean"?Xe(i,"type","boolean",this.message,o):Re(o,this.pipe,i,"boolean")}}}function bi(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="number"||isNaN(o)?Xe(i,"type","number",this.message,o):Re(o,this.pipe,i,"number")}}}function Be(e,t,r,n){const[o,i="Invalid type",s]=ia(t,r,n);let a;return{type:"object",async:!1,entries:e,rest:o,message:i,pipe:s,_parse(c,u){if(!c||typeof c!="object")return Xe(u,"type","object",this.message,c);a=a||Object.entries(this.entries);let p;const l={};for(const[v,b]of a){const g=c[v],h=b._parse(g,u);if(h.issues){const _={type:"object",input:c,key:v,value:g};for(const k of h.issues)k.path?k.path.unshift(_):k.path=[_],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}else(h.output!==void 0||v in c)&&(l[v]=h.output)}if(this.rest&&!(u!=null&&u.abortEarly&&p)){for(const v in c)if(!(v in this.entries)){const b=c[v],g=this.rest._parse(b,u);if(g.issues){const h={type:"object",input:c,key:v,value:b};for(const _ of g.issues)_.path?_.path.unshift(h):_.path=[h],p==null||p.push(_);if(p||(p=g.issues),u!=null&&u.abortEarly)break}else l[v]=g.output}}return p?Ct(p):Re(l,this.pipe,u,"object")}}}function sa(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?Le(r):Xe(n,"type","picklist",this.message,r)}}}function be(e,t){const[r="Invalid type",n]=Ve(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="string"?Xe(i,"type","string",this.message,o):Re(o,this.pipe,i,"string")}}}function aa(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[s,a]=Ve(r,n);return[e,t,s,a]}const[o,i]=Ve(t,r);return[be(),e,o,i]}var la=["__proto__","prototype","constructor"];function yi(e,t,r,n){const[o,i,s="Invalid type",a]=aa(e,t,r,n);return{type:"record",async:!1,key:o,value:i,message:s,pipe:a,_parse(c,u){if(!c||typeof c!="object")return Xe(u,"type","record",this.message,c);let p;const l={};for(const[v,b]of Object.entries(c))if(!la.includes(v)){let g;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){g={type:"record",input:c,key:v,value:b};for(const k of h.issues)k.path=[g],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}const _=this.value._parse(b,u);if(_.issues){g=g||{type:"record",input:c,key:v,value:b};for(const k of _.issues)k.path?k.path.unshift(g):k.path=[g],p==null||p.push(k);if(p||(p=_.issues),u!=null&&u.abortEarly)break}!h.issues&&!_.issues&&(l[h.output]=_.output)}return p?Ct(p):Re(l,this.pipe,u,"record")}}}function Pt(e,t,r){const n=e._parse(t,r);if(n.issues)throw new Nr(n.issues);return n.output}async function ca(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new Nr(n.issues);return n.output}function wi(e,t,r){return{...e,_parse(n,o){const i=e._parse(n,o);if(i.issues)return i;const s=t(i.output);return r&&!Array.isArray(r)?r._parse(s,o):Re(s,r,o,typeof s)}}}var ua=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function da(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:ua,_parse(t){return this.requirement.test(t)?Le(t):Ot(this.type,this.message,t,this.requirement)}}}function At(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?Ot(this.type,this.message,r,this.requirement):Le(r)}}}function _i(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?Ot(this.type,this.message,r,this.requirement):Le(r)}}}function fa(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?Le(r):Ot(this.type,this.message,r,this.requirement)}}}function pa(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)?Le(t):Ot(this.type,this.message,t,this.requirement)}}}function ue(){return ue=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},ue.apply(this,arguments)}var De,j,Fr,xi,ut=0,ki=[],Qt=[],$i=S.__b,Si=S.__r,Ei=S.diffed,Ci=S.__c,Oi=S.unmount;function Je(e,t){S.__h&&S.__h(j,e,ut||t),ut=0;var r=j.__H||(j.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Qt}),r.__[e]}function Y(e){return ut=1,Xt(Ti,e)}function Xt(e,t,r){var n=Je(De++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Ti(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=j,!j.u)){var o=function(a,c,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,a,c,u);var l=!1;return p.forEach(function(v){if(v.__N){var b=v.__[0];v.__=v.__N,v.__N=void 0,b!==v.__[0]&&(l=!0)}}),!(!l&&n.__c.props===a)&&(!i||i.call(this,a,c,u))};j.u=!0;var i=j.shouldComponentUpdate,s=j.componentWillUpdate;j.componentWillUpdate=function(a,c,u){if(this.__e){var p=i;i=void 0,o(a,c,u),i=p}s&&s.call(this,a,c,u)},j.shouldComponentUpdate=o}return n.__N||n.__}function V(e,t){var r=Je(De++,3);!S.__s&&Lr(r.__H,t)&&(r.__=e,r.i=t,j.__H.__h.push(r))}function ye(e,t){var r=Je(De++,4);!S.__s&&Lr(r.__H,t)&&(r.__=e,r.i=t,j.__h.push(r))}function L(e){return ut=5,se(function(){return{current:e}},[])}function Pi(e,t,r){ut=6,ye(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 se(e,t){var r=Je(De++,7);return Lr(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ve(e,t){return ut=8,se(function(){return e},t)}function Jt(e){var t=j.context[e.__c],r=Je(De++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(j)),t.props.value):e.__}function Ai(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function ha(e){var t=Je(De++,10),r=Y();return t.__=e,j.componentDidCatch||(j.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Ii(){var e=Je(De++,11);if(!e.__){for(var t=j.__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 va(){for(var e;e=ki.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(er),e.__H.__h.forEach(Mr),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){j=null,$i&&$i(e)},S.__r=function(e){Si&&Si(e),De=0;var t=(j=e.__c).__H;t&&(Fr===j?(t.__h=[],j.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Qt,r.__N=r.i=void 0})):(t.__h.forEach(er),t.__h.forEach(Mr),t.__h=[],De=0)),Fr=j},S.diffed=function(e){Ei&&Ei(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ki.push(t)!==1&&xi===S.requestAnimationFrame||((xi=S.requestAnimationFrame)||ga)(va)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Qt&&(r.__=r.__V),r.i=void 0,r.__V=Qt})),Fr=j=null},S.__c=function(e,t){t.some(function(r){try{r.__h.forEach(er),r.__h=r.__h.filter(function(n){return!n.__||Mr(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(n,r.__v)}}),Ci&&Ci(e,t)},S.unmount=function(e){Oi&&Oi(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{er(n)}catch(o){t=o}}),r.__H=void 0,t&&S.__e(t,r.__v))};var Di=typeof requestAnimationFrame=="function";function ga(e){var t,r=function(){clearTimeout(n),Di&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Di&&(t=requestAnimationFrame(r))}function er(e){var t=j,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),j=t}function Mr(e){var t=j;e.__c=e.__(),j=t}function Lr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ti(e,t){return typeof t=="function"?t(e):t}function Ni(e,t){for(var r in t)e[r]=t[r];return e}function Rr(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 Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function tr(e){this.props=e}function Fi(e,t){function r(o){var i=this.props.ref,s=i==o.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!s:Rr(this.props,o)}function n(o){return this.shouldComponentUpdate=r,T(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(tr.prototype=new me).isPureReactComponent=!0,tr.prototype.shouldComponentUpdate=function(e,t){return Rr(this.props,e)||Rr(this.state,t)};var Mi=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Mi&&Mi(e)};var ma=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ae(e){function t(r){var n=Ni({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=ma,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Li=function(e,t){return e==null?null:Ie(Ie(e).map(t))},Te={map:Li,forEach:Li,count:function(e){return e?Ie(e).length:0},only:function(e){var t=Ie(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Ie},ba=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)}ba(e,t,r,n)};var Ri=S.unmount;function Vi(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Ni({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Vi(n,t,r)})),e}function Bi(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Bi(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 dt(){this.__u=0,this.t=null,this.__b=null}function ji(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Br(e){var t,r,n;function o(i){if(t||(t=e()).then(function(s){r=s.default||s},function(s){n=s}),n)throw n;if(!r)throw t;return T(r,i)}return o.displayName="Lazy",o.__f=!0,o}function ft(){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),Ri&&Ri(e)},(dt.prototype=new me).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=ji(n.__v),i=!1,s=function(){i||(i=!0,r.__R=null,o?o(a):a())};r.__R=s;var a=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Bi(u,u.__c.__P,u.__c.__O)}var p;for(n.setState({__a:n.__b=null});p=n.t.pop();)p.forceUpdate()}},c=t.__h===!0;n.__u++||c||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},dt.prototype.componentWillUnmount=function(){this.t=[]},dt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Vi(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&T(q,null,e.fallback);return o&&(o.__h=null),[T(q,null,t.__a?null:e.children),o]};var Ui=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 ya(e){return this.getChildContext=function(){return e.context},e.children}function wa(e){var t=this,r=e.i;t.componentWillUnmount=function(){ct(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,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)}}),ct(T(ya,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function zi(e,t){var r=T(wa,{__v:e,i:t});return r.containerInfo=t,r}(ft.prototype=new me).__a=function(e){var t=this,r=ji(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Ui(t,e,n)):o()};r?r(i):i()}},ft.prototype.render=function(e){this.u=null,this.o=new Map;var t=Ie(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},ft.prototype.componentDidUpdate=ft.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Ui(e,r,t)})};var Hi=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_a=/^(?: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]/,xa=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ka=/[A-Z0-9]/g,$a=typeof document<"u",Sa=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Wi(e,t,r){return t.__k==null&&(t.textContent=""),ct(e,t),typeof r=="function"&&r(),e?e.__c:null}function Ki(e,t,r){return pi(e,t),typeof r=="function"&&r(),e?e.__c:null}me.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(me.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qi=S.event;function Ea(){}function Ca(){return this.cancelBubble}function Oa(){return this.defaultPrevented}S.event=function(e){return qi&&(e=qi(e)),e.persist=Ea,e.isPropagationStopped=Ca,e.isDefaultPrevented=Oa,e.nativeEvent=e};var jr,Pa={enumerable:!1,configurable:!0,get:function(){return this.class}},Yi=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 s=r[i];if(!(i==="value"&&"defaultValue"in r&&s==null||$a&&i==="children"&&n==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in r&&r.value==null?i="value":i==="download"&&s===!0?s="":a==="ondoubleclick"?i="ondblclick":a!=="onchange"||n!=="input"&&n!=="textarea"||Sa(r.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":xa.test(i)?i=a:n.indexOf("-")===-1&&_a.test(i)?i=i.replace(ka,"-$&").toLowerCase():s===null&&(s=void 0):a=i="oninput",a==="oninput"&&o[i=a]&&(i="oninputCapture"),o[i]=s}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Ie(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=Ie(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",Pa)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Hi,Yi&&Yi(e)};var Gi=S.__r;S.__r=function(e){Gi&&Gi(e),jr=e.__c};var Zi=S.diffed;S.diffed=function(e){Zi&&Zi(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),jr=null};var Qi={ReactCurrentDispatcher:{current:{readContext:function(e){return jr.__n[e.__c].props.value}}}},Aa="17.0.2";function Xi(e){return T.bind(null,e)}function et(e){return!!e&&e.$$typeof===Hi}function pt(e){return et(e)?ta.apply(null,arguments):e}function Ji(e){return!!e.__k&&(ct(null,e),!0)}function eo(e){return e&&(e.base||e.nodeType===1&&e)||null}var to=function(e,t){return e(t)},rr=function(e,t){return e(t)},ro=q;function Ur(e){e()}function no(e){return e}function io(){return[!1,Ur]}var oo=ye;function so(e,t){var r=t(),n=Y({h:{__:r,v:t}}),o=n[0].h,i=n[1];return ye(function(){o.__=r,o.v=t,Vr(o.__,t())||i({h:o})},[e,r,t]),V(function(){return Vr(o.__,o.v())||i({h:o}),e(function(){Vr(o.__,o.v())||i({h:o})})},[e]),r}var xe={useState:Y,useId:Ii,useReducer:Xt,useEffect:V,useLayoutEffect:ye,useInsertionEffect:oo,useTransition:io,useDeferredValue:no,useSyncExternalStore:so,startTransition:Ur,useRef:L,useImperativeHandle:Pi,useMemo:se,useCallback:ve,useContext:Jt,useDebugValue:Ai,version:"17.0.2",Children:Te,render:Wi,hydrate:Ki,unmountComponentAtNode:Ji,createPortal:zi,createElement:T,createContext:Et,createFactory:Xi,cloneElement:pt,createRef:ni,Fragment:q,isValidElement:et,findDOMNode:eo,Component:me,PureComponent:tr,memo:Fi,forwardRef:ae,flushSync:rr,unstable_batchedUpdates:to,StrictMode:ro,Suspense:dt,SuspenseList:ft,lazy:Br,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qi};const Ia=Object.freeze(Object.defineProperty({__proto__:null,Children:Te,Component:me,Fragment:q,PureComponent:tr,StrictMode:ro,Suspense:dt,SuspenseList:ft,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qi,cloneElement:pt,createContext:Et,createElement:T,createFactory:Xi,createPortal:zi,createRef:ni,default:xe,findDOMNode:eo,flushSync:rr,forwardRef:ae,hydrate:Ki,isValidElement:et,lazy:Br,memo:Fi,render:Wi,startTransition:Ur,unmountComponentAtNode:Ji,unstable_batchedUpdates:to,useCallback:ve,useContext:Jt,useDebugValue:Ai,useDeferredValue:no,useEffect:V,useErrorBoundary:ha,useId:Ii,useImperativeHandle:Pi,useInsertionEffect:oo,useLayoutEffect:ye,useMemo:se,useReducer:Xt,useRef:L,useState:Y,useSyncExternalStore:so,useTransition:io,version:Aa},Symbol.toStringTag,{value:"Module"}));function ht(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 Da(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ao(...e){return t=>e.forEach(r=>Da(r,t))}function It(...e){return ve(ao(...e),e)}function Ta(e,t=[]){let r=[];function n(i,s){const a=Et(s),c=r.length;r=[...r,s];function u(l){const{scope:v,children:b,...g}=l,h=(v==null?void 0:v[e][c])||a,_=se(()=>g,Object.values(g));return T(h.Provider,{value:_},b)}function p(l,v){const b=(v==null?void 0:v[e][c])||a,g=Jt(b);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const o=()=>{const i=r.map(s=>Et(s));return function(a){const c=(a==null?void 0:a[e])||i;return se(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Na(o,...t)]}function Na(...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 s=n.reduce((a,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...a,...l}},{});return se(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}const zr=globalThis!=null&&globalThis.document?ye:()=>{},Fa=Ia["useId".toString()]||(()=>{});let Ma=0;function Hr(e){const[t,r]=Y(Fa());return zr(()=>{e||r(n=>n??String(Ma++))},[e]),e||(t?`radix-${t}`:"")}function tt(e){const t=L(e);return V(()=>{t.current=e}),se(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function La({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=Ra({defaultProp:t,onChange:r}),i=e!==void 0,s=i?e:n,a=tt(r),c=ve(u=>{if(i){const l=typeof u=="function"?u(e):u;l!==e&&a(l)}else o(u)},[i,e,o,a]);return[s,c]}function Ra({defaultProp:e,onChange:t}){const r=Y(e),[n]=r,o=L(n),i=tt(t);return V(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),r}const Wr=ae((e,t)=>{const{children:r,...n}=e,o=Te.toArray(r),i=o.find(Ba);if(i){const s=i.props.children,a=o.map(c=>c===i?Te.count(s)>1?Te.only(null):et(s)?s.props.children:null:c);return T(Kr,ue({},n,{ref:t}),et(s)?pt(s,void 0,a):null)}return T(Kr,ue({},n,{ref:t}),r)});Wr.displayName="Slot";const Kr=ae((e,t)=>{const{children:r,...n}=e;return et(r)?pt(r,{...ja(n,r.props),ref:t?ao(t,r.ref):r.ref}):Te.count(r)>1?Te.only(null):null});Kr.displayName="SlotClone";const Va=({children:e})=>T(q,null,e);function Ba(e){return et(e)&&e.type===Va}function ja(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]=(...a)=>{i(...a),o(...a)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const r=ae((n,o)=>{const{asChild:i,...s}=n,a=i?Wr:t;return V(()=>{window[Symbol.for("radix-ui")]=!0},[]),T(a,ue({},s,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ua(e,t){e&&rr(()=>e.dispatchEvent(t))}function za(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e);V(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const Yr="dismissableLayer.update",Ha="dismissableLayer.pointerDownOutside",Wa="dismissableLayer.focusOutside";let lo;const Ka=Et({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qa=ae((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,p=Jt(Ka),[l,v]=Y(null),b=(r=l==null?void 0:l.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=Y({}),h=It(t,N=>v(N)),_=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),w=_.indexOf(k),P=l?_.indexOf(l):-1,I=p.layersWithOutsidePointerEventsDisabled.size>0,O=P>=w,z=Ya(N=>{const F=N.target,ie=[...p.branches].some(ee=>ee.contains(F));!O||ie||(i==null||i(N),a==null||a(N),N.defaultPrevented||c==null||c())},b),W=Ga(N=>{const F=N.target;[...p.branches].some(ee=>ee.contains(F))||(s==null||s(N),a==null||a(N),N.defaultPrevented||c==null||c())},b);return za(N=>{P===p.layers.size-1&&(o==null||o(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},b),V(()=>{if(l)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(lo=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(l)),p.layers.add(l),co(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=lo)}},[l,b,n,p]),V(()=>()=>{l&&(p.layers.delete(l),p.layersWithOutsidePointerEventsDisabled.delete(l),co())},[l,p]),V(()=>{const N=()=>g({});return document.addEventListener(Yr,N),()=>document.removeEventListener(Yr,N)},[]),T(qr.div,ue({},u,{ref:h,style:{pointerEvents:I?O?"auto":"none":void 0,...e.style},onFocusCapture:ht(e.onFocusCapture,W.onFocusCapture),onBlurCapture:ht(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:ht(e.onPointerDownCapture,z.onPointerDownCapture)}))});function Ya(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e),n=L(!1),o=L(()=>{});return V(()=>{const i=a=>{if(a.target&&!n.current){let u=function(){uo(Ha,r,c,{discrete:!0})};const c={originalEvent:a};a.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},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Ga(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e),n=L(!1);return V(()=>{const o=i=>{i.target&&!n.current&&uo(Wa,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 co(){const e=new CustomEvent(Yr);document.dispatchEvent(e)}function uo(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?Ua(o,i):o.dispatchEvent(i)}const Gr="focusScope.autoFocusOnMount",Zr="focusScope.autoFocusOnUnmount",fo={bubbles:!1,cancelable:!0},Za=ae((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,c]=Y(null),u=tt(o),p=tt(i),l=L(null),v=It(t,h=>c(h)),b=L({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(n){let h=function(P){if(b.paused||!a)return;const I=P.target;a.contains(I)?l.current=I:je(l.current,{select:!0})},_=function(P){if(b.paused||!a)return;const I=P.relatedTarget;I!==null&&(a.contains(I)||je(l.current,{select:!0}))},k=function(P){if(document.activeElement===document.body)for(const O of P)O.removedNodes.length>0&&je(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",_);const w=new MutationObserver(k);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",_),w.disconnect()}}},[n,a,b.paused]),V(()=>{if(a){vo.add(b);const h=document.activeElement;if(!a.contains(h)){const k=new CustomEvent(Gr,fo);a.addEventListener(Gr,u),a.dispatchEvent(k),k.defaultPrevented||(Qa(rl(po(a)),{select:!0}),document.activeElement===h&&je(a))}return()=>{a.removeEventListener(Gr,u),setTimeout(()=>{const k=new CustomEvent(Zr,fo);a.addEventListener(Zr,p),a.dispatchEvent(k),k.defaultPrevented||je(h??document.body,{select:!0}),a.removeEventListener(Zr,p),vo.remove(b)},0)}}},[a,u,p,b]);const g=ve(h=>{if(!r&&!n||b.paused)return;const _=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,k=document.activeElement;if(_&&k){const w=h.currentTarget,[P,I]=Xa(w);P&&I?!h.shiftKey&&k===I?(h.preventDefault(),r&&je(P,{select:!0})):h.shiftKey&&k===P&&(h.preventDefault(),r&&je(I,{select:!0})):k===w&&h.preventDefault()}},[r,n,b.paused]);return T(qr.div,ue({tabIndex:-1},s,{ref:v,onKeyDown:g}))});function Qa(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(je(n,{select:t}),document.activeElement!==r)return}function Xa(e){const t=po(e),r=ho(t,e),n=ho(t.reverse(),e);return[r,n]}function po(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 ho(e,t){for(const r of e)if(!Ja(r,{upTo:t}))return r}function Ja(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 el(e){return e instanceof HTMLInputElement&&"select"in e}function je(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&el(e)&&t&&e.select()}}const vo=tl();function tl(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=go(e,t),e.unshift(t)},remove(t){var r;e=go(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function go(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function rl(e){return e.filter(t=>t.tagName!=="A")}function nl(e,t){return Xt((r,n)=>{const o=t[r][n];return o??r},e)}const Qr=e=>{const{present:t,children:r}=e,n=il(t),o=typeof r=="function"?r({present:n.isPresent}):Te.only(r),i=It(n.ref,o.ref);return typeof r=="function"||n.isPresent?pt(o,{ref:i}):null};Qr.displayName="Presence";function il(e){const[t,r]=Y(),n=L({}),o=L(e),i=L("none"),s=e?"mounted":"unmounted",[a,c]=nl(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const u=nr(n.current);i.current=a==="mounted"?u:"none"},[a]),zr(()=>{const u=n.current,p=o.current;if(p!==e){const v=i.current,b=nr(u);e?c("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),zr(()=>{if(t){const u=l=>{const b=nr(n.current).includes(l.animationName);l.target===t&&b&&rr(()=>c("ANIMATION_END"))},p=l=>{l.target===t&&(i.current=nr(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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:ve(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function nr(e){return(e==null?void 0:e.animationName)||"none"}let Xr=0;function ol(){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:mo()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:mo()),Xr++,()=>{Xr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Xr--}},[])}function mo(){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 bo(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 sl(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 ir="right-scroll-bar-position",or="width-before-scroll-bar",al="with-scroll-bars-hidden",ll="--removed-body-scroll-bar-size";function cl(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ul(e,t){var r=Y(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 dl(e,t){return ul(t||null,function(r){return e.forEach(function(n){return cl(n,r)})})}function fl(e){return e}function pl(e,t){t===void 0&&(t=fl);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 s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var c=function(){var p=s;s=[],p.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(p){s.push(p),u()},filter:function(p){return s=s.filter(p),r}}}};return o}function hl(e){e===void 0&&(e={});var t=pl(null);return t.options=Se({async:!0,ssr:!1},e),t}var yo=function(e){var t=e.sideCar,r=bo(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 T(n,Se({},r))};yo.isSideCarExport=!0;function vl(e,t){return e.useMedium(t),yo}var wo=hl(),Jr=function(){},sr=ae(function(e,t){var r=L(null),n=Y({onScrollCapture:Jr,onWheelCapture:Jr,onTouchMoveCapture:Jr}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,p=e.enabled,l=e.shards,v=e.sideCar,b=e.noIsolation,g=e.inert,h=e.allowPinchZoom,_=e.as,k=_===void 0?"div":_,w=bo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=v,I=dl([r,t]),O=Se(Se({},w),o);return T(q,null,p&&T(P,{sideCar:wo,removeScrollBar:u,shards:l,noIsolation:b,inert:g,setCallbacks:i,allowPinchZoom:!!h,lockRef:r}),s?pt(Te.only(a),Se(Se({},O),{ref:I})):T(k,Se({},O,{className:c,ref:I}),a))});sr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sr.classNames={fullWidth:or,zeroRight:ir};var _o,gl=function(){if(_o)return _o;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ml(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gl();return t&&e.setAttribute("nonce",t),e}function bl(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wl=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ml())&&(bl(t,r),yl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_l=function(){var e=wl();return function(t,r){V(function(){return e.add(t),function(){e.remove()}},[t&&r])}},xo=function(){var e=_l(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},xl={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},kl=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[en(r),en(n),en(o)]},$l=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xl;var t=kl(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])}},Sl=xo(),El=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
2
- .`.concat(al,` {
1
+ var Kd=Object.defineProperty;var qd=(Ze,he,$)=>he in Ze?Kd(Ze,he,{enumerable:!0,configurable:!0,writable:!0,value:$}):Ze[he]=$;var Za=(Ze,he,$)=>(qd(Ze,typeof he!="symbol"?he+"":he,$),$);(function(){"use strict";var Ze=e=>e,he,$,Zn,Qn,Qe,Xn,Jn,Ir,ei,lt={},ti=[],Qa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;function Ie(e,t){for(var r in t)e[r]=t[r];return e}function ri(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?he.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 $t(e,a,n,o,null)}function $t(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??++Zn};return o==null&&$.vnode!=null&&$.vnode(i),i}function ni(){return{current:null}}function q(e){return e.children}function me(e,t){this.props=e,this.context=t}function Gt(e,t){if(t==null)return e.__?Gt(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Gt(e):null}function ii(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 ii(e)}}function Or(e){(!e.__d&&(e.__d=!0)&&Qe.push(e)&&!Yt.__r++||Xn!==$.debounceRendering)&&((Xn=$.debounceRendering)||Jn)(Yt)}function Yt(){var e,t,r,n,o,i,a,s,c;for(Qe.sort(Ir);e=Qe.shift();)e.__d&&(t=Qe.length,n=void 0,o=void 0,i=void 0,s=(a=(r=e).__v).__e,(c=r.__P)&&(n=[],o=[],(i=Ie({},a)).__v=a.__v+1,Tr(c,a,i,r.__n,c.ownerSVGElement!==void 0,a.__h!=null?[s]:null,n,s??Gt(a),a.__h,o),di(n,a,o),a.__e!=s&&ii(a)),Qe.length>t&&Qe.sort(Ir));Yt.__r=0}function oi(e,t,r,n,o,i,a,s,c,u,p){var l,v,b,g,h,_,k,w,P,O,A=0,U=n&&n.__k||ti,W=U.length,N=W,M=t.length;for(r.__k=[],l=0;l<M;l++)(g=r.__k[l]=(g=t[l])==null||typeof g=="boolean"||typeof g=="function"?null:typeof g=="string"||typeof g=="number"||typeof g=="bigint"?$t(null,g,null,null,g):qt(g)?$t(q,{children:g},null,null,null):g.__b>0?$t(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)!=null&&(g.__=r,g.__b=r.__b+1,(w=Xa(g,U,k=l+A,N))===-1?b=lt:(b=U[w]||lt,U[w]=void 0,N--),Tr(e,g,b,o,i,a,s,c,u,p),h=g.__e,(v=g.ref)&&b.ref!=v&&(b.ref&&Dr(b.ref,null,g),p.push(v,g.__c||h,g)),h!=null&&(_==null&&(_=h),O=!(P=b===lt||b.__v===null)&&w===k,P?w==-1&&A--:w!==k&&(w===k+1?(A++,O=!0):w>k?N>M-k?(A+=w-k,O=!0):A--:A=w<k&&w==k-1?w-k:0),k=l+A,O=O||w==l&&!P,typeof g.type!="function"||w===k&&b.__k!==g.__k?typeof g.type=="function"||O?g.__d!==void 0?(c=g.__d,g.__d=void 0):c=h.nextSibling:c=si(e,h,c):c=ai(g,c,e),typeof r.type=="function"&&(r.__d=c)));for(r.__e=_,l=W;l--;)U[l]!=null&&(typeof r.type=="function"&&U[l].__e!=null&&U[l].__e==r.__d&&(r.__d=U[l].__e.nextSibling),fi(U[l],U[l]))}function ai(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"?ai(n,t,r):si(r,n.__e,t));return t}function Oe(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Oe(r,t)}):t.push(e)),t}function si(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 Xa(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 Ja(e,t,r,n,o){var i;for(i in r)i==="children"||i==="key"||i in t||Zt(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]||Zt(e,i,t[i],r[i],n)}function li(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Qa.test(t)?r:r+"px"}function Zt(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||li(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||li(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?ui:ci,i):e.removeEventListener(t,i?ui:ci,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 ci(e){return this.l[e.type+!1]($.event?$.event(e):e)}function ui(e){return this.l[e.type+!0]($.event?$.event(e):e)}function Tr(e,t,r,n,o,i,a,s,c,u){var p,l,v,b,g,h,_,k,w,P,O,A,U,W,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]),(p=$.__b)&&p(t);try{e:if(typeof M=="function"){if(k=t.props,w=(p=M.contextType)&&n[p.__c],P=p?w?w.props.value:p.__:n,r.__c?_=(l=t.__c=r.__c).__=l.__E:("prototype"in M&&M.prototype.render?t.__c=l=new M(k,P):(t.__c=l=new me(k,P),l.constructor=M,l.render=ts),w&&w.sub(l),l.props=k,l.state||(l.state={}),l.context=P,l.__n=n,v=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),M.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ie({},l.__s)),Ie(l.__s,M.getDerivedStateFromProps(k,l.__s))),b=l.props,g=l.state,l.__v=t,v)M.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(M.getDerivedStateFromProps==null&&k!==b&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(k,P),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(k,l.__s,P)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=k,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(ie){ie&&(ie.__=t)}),O=0;O<l._sb.length;O++)l.__h.push(l._sb[O]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(k,l.__s,P),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(b,g,h)})}if(l.context=P,l.props=k,l.__P=e,l.__e=!1,A=$.__r,U=0,"prototype"in M&&M.prototype.render){for(l.state=l.__s,l.__d=!1,A&&A(t),p=l.render(l.props,l.state,l.context),W=0;W<l._sb.length;W++)l.__h.push(l._sb[W]);l._sb=[]}else do l.__d=!1,A&&A(t),p=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=Ie(Ie({},n),l.getChildContext())),v||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(b,g)),oi(e,qt(N=p!=null&&p.type===q&&p.key==null?p.props.children:p)?N:[N],t,r,n,o,i,a,s,c,u),l.base=t.__e,t.__h=null,l.__h.length&&a.push(l),_&&(l.__E=l.__=null)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=es(r.__e,t,r,n,o,i,a,c,u);(p=$.diffed)&&p(t)}catch(ie){t.__v=null,(c||i!=null)&&(t.__e=s,t.__h=!!c,i[i.indexOf(s)]=null),$.__e(ie,t,r)}}function di(e,t,r){for(var n=0;n<r.length;n++)Dr(r[n],r[++n],r[++n]);$.__c&&$.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){$.__e(i,o.__v)}})}function es(e,t,r,n,o,i,a,s,c){var u,p,l,v=r.props,b=t.props,g=t.type,h=0;if(g==="svg"&&(o=!0),i!=null){for(;h<i.length;h++)if((u=i[h])&&"setAttribute"in u==!!g&&(g?u.localName===g:u.nodeType===3)){e=u,i[h]=null;break}}if(e==null){if(g===null)return document.createTextNode(b);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,b.is&&b),i=null,s=!1}if(g===null)v===b||s&&e.data===b||(e.data=b);else{if(i=i&&he.call(e.childNodes),p=(v=r.props||lt).dangerouslySetInnerHTML,l=b.dangerouslySetInnerHTML,!s){if(i!=null)for(v={},h=0;h<e.attributes.length;h++)v[e.attributes[h].name]=e.attributes[h].value;(l||p)&&(l&&(p&&l.__html==p.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(Ja(e,b,v,o,s),l)t.__k=[];else if(oi(e,qt(h=t.props.children)?h:[h],t,r,n,o&&g!=="foreignObject",i,a,i?i[0]:r.__k&&Gt(r,0),s,c),i!=null)for(h=i.length;h--;)i[h]!=null&&ri(i[h]);s||("value"in b&&(h=b.value)!==void 0&&(h!==e.value||g==="progress"&&!h||g==="option"&&h!==v.value)&&Zt(e,"value",h,v.value,!1),"checked"in b&&(h=b.checked)!==void 0&&h!==e.checked&&Zt(e,"checked",h,v.checked,!1))}return e}function Dr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){$.__e(n,r)}}function fi(e,t,r){var n,o;if($.unmount&&$.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Dr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){$.__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]&&fi(n[o],t,r||typeof e.type!="function");r||e.__e==null||ri(e.__e),e.__=e.__e=e.__d=void 0}function ts(e,t,r){return this.constructor(e,r)}function ct(e,t,r){var n,o,i,a;$.__&&$.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],Tr(t,e=(!n&&r||t).__k=D(q,null,[e]),o||lt,lt,t.ownerSVGElement!==void 0,!n&&r?[r]:o?null:t.firstChild?he.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),di(i,e,a)}function pi(e,t){ct(e,t,pi)}function rs(e,t,r){var n,o,i,a,s=Ie({},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?he.call(arguments,2):r),$t(e.type,s,n||e.key,o||e.ref,null)}function Et(e,t){var r={__c:t="__cC"+ei++,__: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,Or(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}he=ti.slice,$={__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}},Zn=0,Qn=function(e){return e!=null&&e.constructor===void 0},me.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ie({},this.state),typeof e=="function"&&(e=e(Ie({},r),this.props)),e&&Ie(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Or(this))},me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Or(this))},me.prototype.render=q,Qe=[],Jn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ir=function(e,t){return e.__v.__b-t.__v.__b},Yt.__r=0,ei=0;var Nr=class extends Error{constructor(t){super(t[0].message);Za(this,"issues");this.name="ValiError",this.issues=t}};function hi(e,t){return{...e,_parse(r,n){return e._parse(t(r),n)}}}function Ct(e){return{issues:e}}function Le(e){return{output:e}}function ns(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 is(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 Be(e,t,r,n){if(!t||!t.length||r!=null&&r.skipPipe)return Le(e);let o,i,a=e;for(const s of t){const c=s._parse(a);if(c.issues){o=o||is(r,n);for(const u of c.issues){const p=ns(o,u);i?i.push(p):i=[p]}if(o.abortEarly||o.abortPipeEarly)break}else a=c.output}return i?Ct(i):Le(a)}function Re(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function vi(e){return typeof e=="function"?e():e}function At(e,t,r,n){return Ct([{validation:e,message:vi(t),input:r,requirement:n}])}function os(e,t,r){if(!e||typeof e=="object"&&!Array.isArray(e)){const[i,a]=Re(t,r);return[e,i,a]}const[n,o]=Re(e,t);return[void 0,n,o]}function Xe(e,t,r,n,o,i){return{issues:[{reason:t,validation:r,origin:(e==null?void 0:e.origin)||"value",message:vi(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 gi(e){return{type:"any",async:!1,pipe:e,_parse(t,r){return Be(t,this.pipe,r,"any")}}}function mi(e,t,r){const[n="Invalid type",o]=Re(t,r);return{type:"array",async:!1,item:e,message:n,pipe:o,_parse(i,a){if(!Array.isArray(i))return Xe(a,"type","array",this.message,i);let s;const c=[];for(let u=0;u<i.length;u++){const p=i[u],l=this.item._parse(p,a);if(l.issues){const v={type:"array",input:i,key:u,value:p};for(const b of l.issues)b.path?b.path.unshift(v):b.path=[v],s==null||s.push(b);if(s||(s=l.issues),a!=null&&a.abortEarly)break}else c.push(l.output)}return s?Ct(s):Be(c,this.pipe,a,"array")}}}function as(e,t){const[r="Invalid type",n]=Re(e,t);return{type:"boolean",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="boolean"?Xe(i,"type","boolean",this.message,o):Be(o,this.pipe,i,"boolean")}}}function bi(e,t){const[r="Invalid type",n]=Re(e,t);return{type:"number",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="number"||isNaN(o)?Xe(i,"type","number",this.message,o):Be(o,this.pipe,i,"number")}}}function Ve(e,t,r,n){const[o,i="Invalid type",a]=os(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 Xe(u,"type","object",this.message,c);s=s||Object.entries(this.entries);let p;const l={};for(const[v,b]of s){const g=c[v],h=b._parse(g,u);if(h.issues){const _={type:"object",input:c,key:v,value:g};for(const k of h.issues)k.path?k.path.unshift(_):k.path=[_],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}else(h.output!==void 0||v in c)&&(l[v]=h.output)}if(this.rest&&!(u!=null&&u.abortEarly&&p)){for(const v in c)if(!(v in this.entries)){const b=c[v],g=this.rest._parse(b,u);if(g.issues){const h={type:"object",input:c,key:v,value:b};for(const _ of g.issues)_.path?_.path.unshift(h):_.path=[h],p==null||p.push(_);if(p||(p=g.issues),u!=null&&u.abortEarly)break}else l[v]=g.output}}return p?Ct(p):Be(l,this.pipe,u,"object")}}}function ss(e,t="Invalid type"){return{type:"picklist",async:!1,options:e,message:t,_parse(r,n){return this.options.includes(r)?Le(r):Xe(n,"type","picklist",this.message,r)}}}function be(e,t){const[r="Invalid type",n]=Re(e,t);return{type:"string",async:!1,message:r,pipe:n,_parse(o,i){return typeof o!="string"?Xe(i,"type","string",this.message,o):Be(o,this.pipe,i,"string")}}}function ls(e,t,r,n){if(typeof t=="object"&&!Array.isArray(t)){const[a,s]=Re(r,n);return[e,t,a,s]}const[o,i]=Re(t,r);return[be(),e,o,i]}var cs=["__proto__","prototype","constructor"];function yi(e,t,r,n){const[o,i,a="Invalid type",s]=ls(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 Xe(u,"type","record",this.message,c);let p;const l={};for(const[v,b]of Object.entries(c))if(!cs.includes(v)){let g;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){g={type:"record",input:c,key:v,value:b};for(const k of h.issues)k.path=[g],p==null||p.push(k);if(p||(p=h.issues),u!=null&&u.abortEarly)break}const _=this.value._parse(b,u);if(_.issues){g=g||{type:"record",input:c,key:v,value:b};for(const k of _.issues)k.path?k.path.unshift(g):k.path=[g],p==null||p.push(k);if(p||(p=_.issues),u!=null&&u.abortEarly)break}!h.issues&&!_.issues&&(l[h.output]=_.output)}return p?Ct(p):Be(l,this.pipe,u,"record")}}}function Pt(e,t,r){const n=e._parse(t,r);if(n.issues)throw new Nr(n.issues);return n.output}async function us(e,t,r){const n=await e._parse(t,r);if(n.issues)throw new Nr(n.issues);return n.output}function wi(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):Be(a,r,o,typeof a)}}}var ds=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function fs(e="Invalid email"){return{type:"email",async:!1,message:e,requirement:ds,_parse(t){return this.requirement.test(t)?Le(t):At(this.type,this.message,t,this.requirement)}}}function It(e,t="Invalid length"){return{type:"max_length",async:!1,message:t,requirement:e,_parse(r){return r.length>this.requirement?At(this.type,this.message,r,this.requirement):Le(r)}}}function _i(e,t="Invalid length"){return{type:"min_length",async:!1,message:t,requirement:e,_parse(r){return r.length<this.requirement?At(this.type,this.message,r,this.requirement):Le(r)}}}function ps(e,t="Invalid regex"){return{type:"regex",async:!1,message:t,requirement:e,_parse(r){return this.requirement.test(r)?Le(r):At(this.type,this.message,r,this.requirement)}}}function hs(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)?Le(t):At(this.type,this.message,t,this.requirement)}}}function ue(){return ue=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},ue.apply(this,arguments)}var Te,j,Mr,xi,ut=0,ki=[],Qt=[],Si=$.__b,$i=$.__r,Ei=$.diffed,Ci=$.__c,Ai=$.unmount;function Je(e,t){$.__h&&$.__h(j,e,ut||t),ut=0;var r=j.__H||(j.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Qt}),r.__[e]}function G(e){return ut=1,Xt(Di,e)}function Xt(e,t,r){var n=Je(Te++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Di(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=j,!j.u)){var o=function(s,c,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,c,u);var l=!1;return p.forEach(function(v){if(v.__N){var b=v.__[0];v.__=v.__N,v.__N=void 0,b!==v.__[0]&&(l=!0)}}),!(!l&&n.__c.props===s)&&(!i||i.call(this,s,c,u))};j.u=!0;var i=j.shouldComponentUpdate,a=j.componentWillUpdate;j.componentWillUpdate=function(s,c,u){if(this.__e){var p=i;i=void 0,o(s,c,u),i=p}a&&a.call(this,s,c,u)},j.shouldComponentUpdate=o}return n.__N||n.__}function R(e,t){var r=Je(Te++,3);!$.__s&&Lr(r.__H,t)&&(r.__=e,r.i=t,j.__H.__h.push(r))}function ye(e,t){var r=Je(Te++,4);!$.__s&&Lr(r.__H,t)&&(r.__=e,r.i=t,j.__h.push(r))}function L(e){return ut=5,ae(function(){return{current:e}},[])}function Pi(e,t,r){ut=6,ye(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 ae(e,t){var r=Je(Te++,7);return Lr(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ve(e,t){return ut=8,ae(function(){return e},t)}function Jt(e){var t=j.context[e.__c],r=Je(Te++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(j)),t.props.value):e.__}function Ii(e,t){$.useDebugValue&&$.useDebugValue(t?t(e):e)}function vs(e){var t=Je(Te++,10),r=G();return t.__=e,j.componentDidCatch||(j.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Oi(){var e=Je(Te++,11);if(!e.__){for(var t=j.__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 gs(){for(var e;e=ki.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(er),e.__H.__h.forEach(Fr),e.__H.__h=[]}catch(t){e.__H.__h=[],$.__e(t,e.__v)}}$.__b=function(e){j=null,Si&&Si(e)},$.__r=function(e){$i&&$i(e),Te=0;var t=(j=e.__c).__H;t&&(Mr===j?(t.__h=[],j.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Qt,r.__N=r.i=void 0})):(t.__h.forEach(er),t.__h.forEach(Fr),t.__h=[],Te=0)),Mr=j},$.diffed=function(e){Ei&&Ei(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ki.push(t)!==1&&xi===$.requestAnimationFrame||((xi=$.requestAnimationFrame)||ms)(gs)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Qt&&(r.__=r.__V),r.i=void 0,r.__V=Qt})),Mr=j=null},$.__c=function(e,t){t.some(function(r){try{r.__h.forEach(er),r.__h=r.__h.filter(function(n){return!n.__||Fr(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],$.__e(n,r.__v)}}),Ci&&Ci(e,t)},$.unmount=function(e){Ai&&Ai(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{er(n)}catch(o){t=o}}),r.__H=void 0,t&&$.__e(t,r.__v))};var Ti=typeof requestAnimationFrame=="function";function ms(e){var t,r=function(){clearTimeout(n),Ti&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ti&&(t=requestAnimationFrame(r))}function er(e){var t=j,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),j=t}function Fr(e){var t=j;e.__c=e.__(),j=t}function Lr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Di(e,t){return typeof t=="function"?t(e):t}function Ni(e,t){for(var r in t)e[r]=t[r];return e}function Br(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 Rr(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function tr(e){this.props=e}function Mi(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:Br(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}(tr.prototype=new me).isPureReactComponent=!0,tr.prototype.shouldComponentUpdate=function(e,t){return Br(this.props,e)||Br(this.state,t)};var Fi=$.__b;$.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fi&&Fi(e)};var bs=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function se(e){function t(r){var n=Ni({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=bs,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Li=function(e,t){return e==null?null:Oe(Oe(e).map(t))},De={map:Li,forEach:Li,count:function(e){return e?Oe(e).length:0},only:function(e){var t=Oe(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Oe},ys=$.__e;$.__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)}ys(e,t,r,n)};var Bi=$.unmount;function Ri(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=Ni({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Ri(n,t,r)})),e}function Vi(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Vi(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 dt(){this.__u=0,this.t=null,this.__b=null}function ji(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Vr(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 ft(){this.u=null,this.o=null}$.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Bi&&Bi(e)},(dt.prototype=new me).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=ji(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]=Vi(u,u.__c.__P,u.__c.__O)}var p;for(n.setState({__a:n.__b=null});p=n.t.pop();)p.forceUpdate()}},c=t.__h===!0;n.__u++||c||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},dt.prototype.componentWillUnmount=function(){this.t=[]},dt.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]=Ri(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&D(q,null,e.fallback);return o&&(o.__h=null),[D(q,null,t.__a?null:e.children),o]};var zi=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 ws(e){return this.getChildContext=function(){return e.context},e.children}function _s(e){var t=this,r=e.i;t.componentWillUnmount=function(){ct(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,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)}}),ct(D(ws,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ui(e,t){var r=D(_s,{__v:e,i:t});return r.containerInfo=t,r}(ft.prototype=new me).__a=function(e){var t=this,r=ji(t.__v),n=t.o.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),zi(t,e,n)):o()};r?r(i):i()}},ft.prototype.render=function(e){this.u=null,this.o=new Map;var t=Oe(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},ft.prototype.componentDidUpdate=ft.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){zi(e,r,t)})};var Hi=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,xs=/^(?: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]/,ks=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ss=/[A-Z0-9]/g,$s=typeof document<"u",Es=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Wi(e,t,r){return t.__k==null&&(t.textContent=""),ct(e,t),typeof r=="function"&&r(),e?e.__c:null}function Ki(e,t,r){return pi(e,t),typeof r=="function"&&r(),e?e.__c:null}me.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(me.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qi=$.event;function Cs(){}function As(){return this.cancelBubble}function Ps(){return this.defaultPrevented}$.event=function(e){return qi&&(e=qi(e)),e.persist=Cs,e.isPropagationStopped=As,e.isDefaultPrevented=Ps,e.nativeEvent=e};var jr,Is={enumerable:!1,configurable:!0,get:function(){return this.class}},Gi=$.vnode;$.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||$s&&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"||Es(r.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":ks.test(i)?i=s:n.indexOf("-")===-1&&xs.test(i)?i=i.replace(Ss,"-$&").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=Oe(r.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=Oe(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",Is)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Hi,Gi&&Gi(e)};var Yi=$.__r;$.__r=function(e){Yi&&Yi(e),jr=e.__c};var Zi=$.diffed;$.diffed=function(e){Zi&&Zi(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),jr=null};var Qi={ReactCurrentDispatcher:{current:{readContext:function(e){return jr.__n[e.__c].props.value}}}},Os="17.0.2";function Xi(e){return D.bind(null,e)}function et(e){return!!e&&e.$$typeof===Hi}function pt(e){return et(e)?rs.apply(null,arguments):e}function Ji(e){return!!e.__k&&(ct(null,e),!0)}function eo(e){return e&&(e.base||e.nodeType===1&&e)||null}var to=function(e,t){return e(t)},rr=function(e,t){return e(t)},ro=q;function zr(e){e()}function no(e){return e}function io(){return[!1,zr]}var oo=ye;function ao(e,t){var r=t(),n=G({h:{__:r,v:t}}),o=n[0].h,i=n[1];return ye(function(){o.__=r,o.v=t,Rr(o.__,t())||i({h:o})},[e,r,t]),R(function(){return Rr(o.__,o.v())||i({h:o}),e(function(){Rr(o.__,o.v())||i({h:o})})},[e]),r}var xe={useState:G,useId:Oi,useReducer:Xt,useEffect:R,useLayoutEffect:ye,useInsertionEffect:oo,useTransition:io,useDeferredValue:no,useSyncExternalStore:ao,startTransition:zr,useRef:L,useImperativeHandle:Pi,useMemo:ae,useCallback:ve,useContext:Jt,useDebugValue:Ii,version:"17.0.2",Children:De,render:Wi,hydrate:Ki,unmountComponentAtNode:Ji,createPortal:Ui,createElement:D,createContext:Et,createFactory:Xi,cloneElement:pt,createRef:ni,Fragment:q,isValidElement:et,findDOMNode:eo,Component:me,PureComponent:tr,memo:Mi,forwardRef:se,flushSync:rr,unstable_batchedUpdates:to,StrictMode:ro,Suspense:dt,SuspenseList:ft,lazy:Vr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qi};const Ts=Object.freeze(Object.defineProperty({__proto__:null,Children:De,Component:me,Fragment:q,PureComponent:tr,StrictMode:ro,Suspense:dt,SuspenseList:ft,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qi,cloneElement:pt,createContext:Et,createElement:D,createFactory:Xi,createPortal:Ui,createRef:ni,default:xe,findDOMNode:eo,flushSync:rr,forwardRef:se,hydrate:Ki,isValidElement:et,lazy:Vr,memo:Mi,render:Wi,startTransition:zr,unmountComponentAtNode:Ji,unstable_batchedUpdates:to,useCallback:ve,useContext:Jt,useDebugValue:Ii,useDeferredValue:no,useEffect:R,useErrorBoundary:vs,useId:Oi,useImperativeHandle:Pi,useInsertionEffect:oo,useLayoutEffect:ye,useMemo:ae,useReducer:Xt,useRef:L,useState:G,useSyncExternalStore:ao,useTransition:io,version:Os},Symbol.toStringTag,{value:"Module"}));function ht(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 Ds(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function so(...e){return t=>e.forEach(r=>Ds(r,t))}function Ot(...e){return ve(so(...e),e)}function Ns(e,t=[]){let r=[];function n(i,a){const s=Et(a),c=r.length;r=[...r,a];function u(l){const{scope:v,children:b,...g}=l,h=(v==null?void 0:v[e][c])||s,_=ae(()=>g,Object.values(g));return D(h.Provider,{value:_},b)}function p(l,v){const b=(v==null?void 0:v[e][c])||s,g=Jt(b);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,p]}const o=()=>{const i=r.map(a=>Et(a));return function(s){const c=(s==null?void 0:s[e])||i;return ae(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[n,Ms(o,...t)]}function Ms(...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 ae(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}const Ur=globalThis!=null&&globalThis.document?ye:()=>{},Fs=Ts["useId".toString()]||(()=>{});let Ls=0;function Hr(e){const[t,r]=G(Fs());return Ur(()=>{e||r(n=>n??String(Ls++))},[e]),e||(t?`radix-${t}`:"")}function tt(e){const t=L(e);return R(()=>{t.current=e}),ae(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function Bs({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=Rs({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:n,s=tt(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 Rs({defaultProp:e,onChange:t}){const r=G(e),[n]=r,o=L(n),i=tt(t);return R(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),r}const Wr=se((e,t)=>{const{children:r,...n}=e,o=De.toArray(r),i=o.find(js);if(i){const a=i.props.children,s=o.map(c=>c===i?De.count(a)>1?De.only(null):et(a)?a.props.children:null:c);return D(Kr,ue({},n,{ref:t}),et(a)?pt(a,void 0,s):null)}return D(Kr,ue({},n,{ref:t}),r)});Wr.displayName="Slot";const Kr=se((e,t)=>{const{children:r,...n}=e;return et(r)?pt(r,{...zs(n,r.props),ref:t?so(t,r.ref):r.ref}):De.count(r)>1?De.only(null):null});Kr.displayName="SlotClone";const Vs=({children:e})=>D(q,null,e);function js(e){return et(e)&&e.type===Vs}function zs(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 qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const r=se((n,o)=>{const{asChild:i,...a}=n,s=i?Wr:t;return R(()=>{window[Symbol.for("radix-ui")]=!0},[]),D(s,ue({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Us(e,t){e&&rr(()=>e.dispatchEvent(t))}function Hs(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e);R(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const Gr="dismissableLayer.update",Ws="dismissableLayer.pointerDownOutside",Ks="dismissableLayer.focusOutside";let lo;const qs=Et({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gs=se((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...u}=e,p=Jt(qs),[l,v]=G(null),b=(r=l==null?void 0:l.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=G({}),h=Ot(t,N=>v(N)),_=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),w=_.indexOf(k),P=l?_.indexOf(l):-1,O=p.layersWithOutsidePointerEventsDisabled.size>0,A=P>=w,U=Ys(N=>{const M=N.target,ie=[...p.branches].some(ee=>ee.contains(M));!A||ie||(i==null||i(N),s==null||s(N),N.defaultPrevented||c==null||c())},b),W=Zs(N=>{const M=N.target;[...p.branches].some(ee=>ee.contains(M))||(a==null||a(N),s==null||s(N),N.defaultPrevented||c==null||c())},b);return Hs(N=>{P===p.layers.size-1&&(o==null||o(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},b),R(()=>{if(l)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(lo=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(l)),p.layers.add(l),co(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=lo)}},[l,b,n,p]),R(()=>()=>{l&&(p.layers.delete(l),p.layersWithOutsidePointerEventsDisabled.delete(l),co())},[l,p]),R(()=>{const N=()=>g({});return document.addEventListener(Gr,N),()=>document.removeEventListener(Gr,N)},[]),D(qr.div,ue({},u,{ref:h,style:{pointerEvents:O?A?"auto":"none":void 0,...e.style},onFocusCapture:ht(e.onFocusCapture,W.onFocusCapture),onBlurCapture:ht(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:ht(e.onPointerDownCapture,U.onPointerDownCapture)}))});function Ys(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e),n=L(!1),o=L(()=>{});return R(()=>{const i=s=>{if(s.target&&!n.current){let u=function(){uo(Ws,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 Zs(e,t=globalThis==null?void 0:globalThis.document){const r=tt(e),n=L(!1);return R(()=>{const o=i=>{i.target&&!n.current&&uo(Ks,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 co(){const e=new CustomEvent(Gr);document.dispatchEvent(e)}function uo(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?Us(o,i):o.dispatchEvent(i)}const Yr="focusScope.autoFocusOnMount",Zr="focusScope.autoFocusOnUnmount",fo={bubbles:!1,cancelable:!0},Qs=se((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,c]=G(null),u=tt(o),p=tt(i),l=L(null),v=Ot(t,h=>c(h)),b=L({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R(()=>{if(n){let h=function(P){if(b.paused||!s)return;const O=P.target;s.contains(O)?l.current=O:je(l.current,{select:!0})},_=function(P){if(b.paused||!s)return;const O=P.relatedTarget;O!==null&&(s.contains(O)||je(l.current,{select:!0}))},k=function(P){if(document.activeElement===document.body)for(const A of P)A.removedNodes.length>0&&je(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",_);const w=new MutationObserver(k);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",_),w.disconnect()}}},[n,s,b.paused]),R(()=>{if(s){vo.add(b);const h=document.activeElement;if(!s.contains(h)){const k=new CustomEvent(Yr,fo);s.addEventListener(Yr,u),s.dispatchEvent(k),k.defaultPrevented||(Xs(nl(po(s)),{select:!0}),document.activeElement===h&&je(s))}return()=>{s.removeEventListener(Yr,u),setTimeout(()=>{const k=new CustomEvent(Zr,fo);s.addEventListener(Zr,p),s.dispatchEvent(k),k.defaultPrevented||je(h??document.body,{select:!0}),s.removeEventListener(Zr,p),vo.remove(b)},0)}}},[s,u,p,b]);const g=ve(h=>{if(!r&&!n||b.paused)return;const _=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,k=document.activeElement;if(_&&k){const w=h.currentTarget,[P,O]=Js(w);P&&O?!h.shiftKey&&k===O?(h.preventDefault(),r&&je(P,{select:!0})):h.shiftKey&&k===P&&(h.preventDefault(),r&&je(O,{select:!0})):k===w&&h.preventDefault()}},[r,n,b.paused]);return D(qr.div,ue({tabIndex:-1},a,{ref:v,onKeyDown:g}))});function Xs(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(je(n,{select:t}),document.activeElement!==r)return}function Js(e){const t=po(e),r=ho(t,e),n=ho(t.reverse(),e);return[r,n]}function po(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 ho(e,t){for(const r of e)if(!el(r,{upTo:t}))return r}function el(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 tl(e){return e instanceof HTMLInputElement&&"select"in e}function je(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&tl(e)&&t&&e.select()}}const vo=rl();function rl(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=go(e,t),e.unshift(t)},remove(t){var r;e=go(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function go(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function nl(e){return e.filter(t=>t.tagName!=="A")}function il(e,t){return Xt((r,n)=>{const o=t[r][n];return o??r},e)}const Qr=e=>{const{present:t,children:r}=e,n=ol(t),o=typeof r=="function"?r({present:n.isPresent}):De.only(r),i=Ot(n.ref,o.ref);return typeof r=="function"||n.isPresent?pt(o,{ref:i}):null};Qr.displayName="Presence";function ol(e){const[t,r]=G(),n=L({}),o=L(e),i=L("none"),a=e?"mounted":"unmounted",[s,c]=il(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R(()=>{const u=nr(n.current);i.current=s==="mounted"?u:"none"},[s]),Ur(()=>{const u=n.current,p=o.current;if(p!==e){const v=i.current,b=nr(u);e?c("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ur(()=>{if(t){const u=l=>{const b=nr(n.current).includes(l.animationName);l.target===t&&b&&rr(()=>c("ANIMATION_END"))},p=l=>{l.target===t&&(i.current=nr(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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:ve(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function nr(e){return(e==null?void 0:e.animationName)||"none"}let Xr=0;function al(){R(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:mo()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:mo()),Xr++,()=>{Xr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Xr--}},[])}function mo(){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 $e=function(){return $e=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},$e.apply(this,arguments)};function bo(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 sl(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 ir="right-scroll-bar-position",or="width-before-scroll-bar",ll="with-scroll-bars-hidden",cl="--removed-body-scroll-bar-size";function ul(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dl(e,t){var r=G(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 fl(e,t){return dl(t||null,function(r){return e.forEach(function(n){return ul(n,r)})})}function pl(e){return e}function hl(e,t){t===void 0&&(t=pl);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 p=a;a=[],p.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(p){a.push(p),u()},filter:function(p){return a=a.filter(p),r}}}};return o}function vl(e){e===void 0&&(e={});var t=hl(null);return t.options=$e({async:!0,ssr:!1},e),t}var yo=function(e){var t=e.sideCar,r=bo(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,$e({},r))};yo.isSideCarExport=!0;function gl(e,t){return e.useMedium(t),yo}var wo=vl(),Jr=function(){},ar=se(function(e,t){var r=L(null),n=G({onScrollCapture:Jr,onWheelCapture:Jr,onTouchMoveCapture:Jr}),o=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,p=e.enabled,l=e.shards,v=e.sideCar,b=e.noIsolation,g=e.inert,h=e.allowPinchZoom,_=e.as,k=_===void 0?"div":_,w=bo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=v,O=fl([r,t]),A=$e($e({},w),o);return D(q,null,p&&D(P,{sideCar:wo,removeScrollBar:u,shards:l,noIsolation:b,inert:g,setCallbacks:i,allowPinchZoom:!!h,lockRef:r}),a?pt(De.only(s),$e($e({},A),{ref:O})):D(k,$e({},A,{className:c,ref:O}),s))});ar.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ar.classNames={fullWidth:or,zeroRight:ir};var _o,ml=function(){if(_o)return _o;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bl(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ml();return t&&e.setAttribute("nonce",t),e}function yl(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _l=function(){var e=0,t=null;return{add:function(r){e==0&&(t=bl())&&(yl(t,r),wl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xl=function(){var e=_l();return function(t,r){R(function(){return e.add(t),function(){e.remove()}},[t&&r])}},xo=function(){var e=xl(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},kl={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},Sl=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[en(r),en(n),en(o)]},$l=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kl;var t=Sl(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])}},El=xo(),Cl=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
2
+ .`.concat(ll,` {
3
3
  overflow: hidden `).concat(n,`;
4
- padding-right: `).concat(a,"px ").concat(n,`;
4
+ padding-right: `).concat(s,"px ").concat(n,`;
5
5
  }
6
6
  body {
7
7
  overflow: hidden `).concat(n,`;
@@ -9,19 +9,19 @@ var Wd=Object.defineProperty;var Kd=(Ze,he,S)=>he in Ze?Wd(Ze,he,{enumerable:!0,
9
9
  `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
10
10
  padding-left: `.concat(o,`px;
11
11
  padding-top: `).concat(i,`px;
12
- padding-right: `).concat(s,`px;
12
+ padding-right: `).concat(a,`px;
13
13
  margin-left:0;
14
14
  margin-top:0;
15
- margin-right: `).concat(a,"px ").concat(n,`;
16
- `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
15
+ margin-right: `).concat(s,"px ").concat(n,`;
16
+ `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
17
17
  }
18
18
 
19
19
  .`).concat(ir,` {
20
- right: `).concat(a,"px ").concat(n,`;
20
+ right: `).concat(s,"px ").concat(n,`;
21
21
  }
22
22
 
23
23
  .`).concat(or,` {
24
- margin-right: `).concat(a,"px ").concat(n,`;
24
+ margin-right: `).concat(s,"px ").concat(n,`;
25
25
  }
26
26
 
27
27
  .`).concat(ir," .").concat(ir,` {
@@ -33,13 +33,13 @@ var Wd=Object.defineProperty;var Kd=(Ze,he,S)=>he in Ze?Wd(Ze,he,{enumerable:!0,
33
33
  }
34
34
 
35
35
  body {
36
- `).concat(ll,": ").concat(a,`px;
36
+ `).concat(cl,": ").concat(s,`px;
37
37
  }
38
- `)},Cl=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=se(function(){return $l(o)},[o]);return T(Sl,{styles:El(i,!t,o,r?"":"!important")})},tn=!1;if(typeof window<"u")try{var ar=Object.defineProperty({},"passive",{get:function(){return tn=!0,!0}});window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{tn=!1}var vt=tn?{passive:!1}:!1,Ol=function(e){return e.tagName==="TEXTAREA"},ko=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Ol(e)&&r[t]==="visible")},Pl=function(e){return ko(e,"overflowY")},Al=function(e){return ko(e,"overflowX")},$o=function(e,t){var r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=So(e,r);if(n){var o=Eo(e,r),i=o[1],s=o[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Il=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Dl=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},So=function(e,t){return e==="v"?Pl(t):Al(t)},Eo=function(e,t){return e==="v"?Il(t):Dl(t)},Tl=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nl=function(e,t,r,n,o){var i=Tl(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,c=t.contains(a),u=!1,p=s>0,l=0,v=0;do{var b=Eo(e,a),g=b[0],h=b[1],_=b[2],k=h-_-i*g;(g||k)&&So(e,a)&&(l+=k,v+=g),a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(p&&(o&&l===0||!o&&s>l)||!p&&(o&&v===0||!o&&-s>v))&&(u=!0),u},lr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Co=function(e){return[e.deltaX,e.deltaY]},Oo=function(e){return e&&"current"in e?e.current:e},Fl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ml=function(e){return`
38
+ `)},Al=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=ae(function(){return $l(o)},[o]);return D(El,{styles:Cl(i,!t,o,r?"":"!important")})},tn=!1;if(typeof window<"u")try{var sr=Object.defineProperty({},"passive",{get:function(){return tn=!0,!0}});window.addEventListener("test",sr,sr),window.removeEventListener("test",sr,sr)}catch{tn=!1}var vt=tn?{passive:!1}:!1,Pl=function(e){return e.tagName==="TEXTAREA"},ko=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Pl(e)&&r[t]==="visible")},Il=function(e){return ko(e,"overflowY")},Ol=function(e){return ko(e,"overflowX")},So=function(e,t){var r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=$o(e,r);if(n){var o=Eo(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Tl=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Dl=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$o=function(e,t){return e==="v"?Il(t):Ol(t)},Eo=function(e,t){return e==="v"?Tl(t):Dl(t)},Nl=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ml=function(e,t,r,n,o){var i=Nl(e,window.getComputedStyle(t).direction),a=i*n,s=r.target,c=t.contains(s),u=!1,p=a>0,l=0,v=0;do{var b=Eo(e,s),g=b[0],h=b[1],_=b[2],k=h-_-i*g;(g||k)&&$o(e,s)&&(l+=k,v+=g),s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(p&&(o&&l===0||!o&&a>l)||!p&&(o&&v===0||!o&&-a>v))&&(u=!0),u},lr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Co=function(e){return[e.deltaX,e.deltaY]},Ao=function(e){return e&&"current"in e?e.current:e},Fl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ll=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},Ll=0,gt=[];function Rl(e){var t=L([]),r=L([0,0]),n=L(),o=Y(Ll++)[0],i=Y(function(){return xo()})[0],s=L(e);V(function(){s.current=e},[e]),V(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=sl([e.lockRef.current],(e.shards||[]).map(Oo),!0).filter(Boolean);return h.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=ve(function(h,_){if("touches"in h&&h.touches.length===2)return!s.current.allowPinchZoom;var k=lr(h),w=r.current,P="deltaX"in h?h.deltaX:w[0]-k[0],I="deltaY"in h?h.deltaY:w[1]-k[1],O,z=h.target,W=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in h&&W==="h"&&z.type==="range")return!1;var N=$o(W,z);if(!N)return!0;if(N?O=W:(O=W==="v"?"h":"v",N=$o(W,z)),!N)return!1;if(!n.current&&"changedTouches"in h&&(P||I)&&(n.current=O),!O)return!0;var F=n.current||O;return Nl(F,_,h,F==="h"?P:I,!0)},[]),c=ve(function(h){var _=h;if(!(!gt.length||gt[gt.length-1]!==i)){var k="deltaY"in _?Co(_):lr(_),w=t.current.filter(function(O){return O.name===_.type&&O.target===_.target&&Fl(O.delta,k)})[0];if(w&&w.should){_.cancelable&&_.preventDefault();return}if(!w){var P=(s.current.shards||[]).map(Oo).filter(Boolean).filter(function(O){return O.contains(_.target)}),I=P.length>0?a(_,P[0]):!s.current.noIsolation;I&&_.cancelable&&_.preventDefault()}}},[]),u=ve(function(h,_,k,w){var P={name:h,delta:_,target:k,should:w};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),p=ve(function(h){r.current=lr(h),n.current=void 0},[]),l=ve(function(h){u(h.type,Co(h),h.target,a(h,e.lockRef.current))},[]),v=ve(function(h){u(h.type,lr(h),h.target,a(h,e.lockRef.current))},[]);V(function(){return gt.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:v}),document.addEventListener("wheel",c,vt),document.addEventListener("touchmove",c,vt),document.addEventListener("touchstart",p,vt),function(){gt=gt.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,vt),document.removeEventListener("touchmove",c,vt),document.removeEventListener("touchstart",p,vt)}},[]);var b=e.removeScrollBar,g=e.inert;return T(q,null,g?T(i,{styles:Ml(o)}):null,b?T(Cl,{gapMode:"margin"}):null)}const Vl=vl(wo,Rl);var Po=ae(function(e,t){return T(sr,Se({},e,{ref:t,sideCar:Vl}))});Po.classNames=sr.classNames;const Bl=Po;var jl=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mt=new WeakMap,cr=new WeakMap,ur={},rn=0,Ao=function(e){return e&&(e.host||Ao(e.parentNode))},Ul=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ao(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})},zl=function(e,t,r,n){var o=Ul(t,Array.isArray(e)?e:[e]);ur[r]||(ur[r]=new WeakMap);var i=ur[r],s=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var p=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(v){if(a.has(v))p(v);else{var b=v.getAttribute(n),g=b!==null&&b!=="false",h=(mt.get(v)||0)+1,_=(i.get(v)||0)+1;mt.set(v,h),i.set(v,_),s.push(v),h===1&&g&&cr.set(v,!0),_===1&&v.setAttribute(r,"true"),g||v.setAttribute(n,"true")}})};return p(t),a.clear(),rn++,function(){s.forEach(function(l){var v=mt.get(l)-1,b=i.get(l)-1;mt.set(l,v),i.set(l,b),v||(cr.has(l)||l.removeAttribute(n),cr.delete(l)),b||l.removeAttribute(r)}),rn--,rn||(mt=new WeakMap,mt=new WeakMap,cr=new WeakMap,ur={})}},Hl=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||jl(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),zl(n,o,r,"aria-hidden")):function(){return null}};const Io="Dialog",[Do,Yd]=Ta(Io),[Wl,bt]=Do(Io),Kl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=L(null),c=L(null),[u=!1,p]=La({prop:n,defaultProp:o,onChange:i});return T(Wl,{scope:t,triggerRef:a,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:p,onOpenToggle:ve(()=>p(l=>!l),[p]),modal:s},r)},ql="DialogPortal",[Gd,To]=Do(ql,{forceMount:void 0}),nn="DialogOverlay",Yl=ae((e,t)=>{const r=To(nn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=bt(nn,e.__scopeDialog);return i.modal?T(Qr,{present:n||i.open},T(Gl,ue({},o,{ref:t}))):null}),Gl=ae((e,t)=>{const{__scopeDialog:r,...n}=e,o=bt(nn,r);return T(Bl,{as:Wr,allowPinchZoom:!0,shards:[o.contentRef]},T(qr.div,ue({"data-state":Fo(o.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),Dt="DialogContent",Zl=ae((e,t)=>{const r=To(Dt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=bt(Dt,e.__scopeDialog);return T(Qr,{present:n||i.open},i.modal?T(Ql,ue({},o,{ref:t})):T(Xl,ue({},o,{ref:t})))}),Ql=ae((e,t)=>{const r=bt(Dt,e.__scopeDialog),n=L(null),o=It(t,r.contentRef,n);return V(()=>{const i=n.current;if(i)return Hl(i)},[]),T(No,ue({},e,{ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=r.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:ht(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ht(e.onFocusOutside,i=>i.preventDefault())}))}),Xl=ae((e,t)=>{const r=bt(Dt,e.__scopeDialog),n=L(!1),o=L(!1);return T(No,ue({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}n.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=i.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),No=ae((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=bt(Dt,r),c=L(null),u=It(t,c);return ol(),T(q,null,T(Za,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i},T(qa,ue({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Fo(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function Fo(e){return e?"open":"closed"}const Jl=Kl,ec=Yl,tc=Zl;function Mo(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=Mo(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ue(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Mo(e))&&(n&&(n+=" "),n+=t);return n}const Lo=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Ro=Ue,on=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ro(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const p=r==null?void 0:r[u],l=i==null?void 0:i[u];if(p===null)return null;const v=Lo(p)||Lo(l);return o[u][v]}),a=r&&Object.entries(r).reduce((u,p)=>{let[l,v]=p;return v===void 0||(u[l]=v),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,p)=>{let{class:l,className:v,...b}=p;return Object.entries(b).every(g=>{let[h,_]=g;return Array.isArray(_)?_.includes({...i,...a}[h]):{...i,...a}[h]===_})?[...u,l,v]:u},[]);return Ro(e,s,c,r==null?void 0:r.class,r==null?void 0:r.className)},de=Symbol.for("@ts-pattern/matcher"),Vo=Symbol.for("@ts-pattern/isVariadic"),dr="@ts-pattern/anonymous-select-key",sn=e=>!!(e&&typeof e=="object"),fr=e=>e&&!!e[de],te=(e,t,r)=>{if(fr(e)){const n=e[de](),{matched:o,selections:i}=n.match(t);return o&&i&&Object.keys(i).forEach(s=>r(s,i[s])),o}if(sn(e)){if(!sn(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],o=[],i=[];for(const s of e.keys()){const a=e[s];fr(a)&&a[Vo]?i.push(a):i.length?o.push(a):n.push(a)}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 s=t.slice(0,n.length),a=o.length===0?[]:t.slice(-o.length),c=t.slice(n.length,o.length===0?1/0:-o.length);return n.every((u,p)=>te(u,s[p],r))&&o.every((u,p)=>te(u,a[p],r))&&(i.length===0||te(i[0],c,r))}return e.length===t.length&&e.every((s,a)=>te(s,t[a],r))}return Object.keys(e).every(n=>{const o=e[n];return(n in t||fr(i=o)&&i[de]().matcherType==="optional")&&te(o,t[n],r);var i})}return Object.is(t,e)},ge=e=>{var t,r,n;return sn(e)?fr(e)?(t=(r=(n=e[de]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Tt(e,ge):Tt(Object.values(e),ge):[]},Tt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function rc(...e){if(e.length===1){const[t]=e;return r=>te(t,r,()=>{})}if(e.length===2){const[t,r]=e;return te(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function oe(e){return Object.assign(e,{optional:()=>ln(e),and:t=>K(e,t),or:t=>Bo(e,t),select:t=>t===void 0?Nt(e):Nt(t,e)})}function an(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Vo]:!0})}}))(e),{optional:()=>an(ln(e)),select:t=>an(t===void 0?Nt(e):Nt(t,e))})}function ln(e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return t===void 0?(ge(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:te(e,t,n),selections:r}},getSelectionKeys:()=>ge(e),matcherType:"optional"})})}const nc=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},ic=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function K(...e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return{matched:e.every(o=>te(o,t,n)),selections:r}},getSelectionKeys:()=>Tt(e,ge),matcherType:"and"})})}function Bo(...e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return Tt(e,ge).forEach(o=>n(o,void 0)),{matched:e.some(o=>te(o,t,n)),selections:r}},getSelectionKeys:()=>Tt(e,ge),matcherType:"or"})})}function R(e){return{[de]:()=>({match:t=>({matched:!!e(t)})})}}function Nt(...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 oe({[de]:()=>({match:n=>{let o={[t??dr]:n};return{matched:r===void 0||te(r,n,(i,s)=>{o[i]=s}),selections:o}},getSelectionKeys:()=>[t??dr].concat(r===void 0?[]:ge(r))})})}function Ee(e){return typeof e=="number"}function rt(e){return typeof e=="string"}function ze(e){return typeof e=="bigint"}const jo=oe(R(function(e){return!0})),oc=jo,nt=e=>Object.assign(oe(e),{startsWith:t=>{return nt(K(e,(r=t,R(n=>rt(n)&&n.startsWith(r)))));var r},endsWith:t=>{return nt(K(e,(r=t,R(n=>rt(n)&&n.endsWith(r)))));var r},minLength:t=>nt(K(e,(r=>R(n=>rt(n)&&n.length>=r))(t))),maxLength:t=>nt(K(e,(r=>R(n=>rt(n)&&n.length<=r))(t))),includes:t=>{return nt(K(e,(r=t,R(n=>rt(n)&&n.includes(r)))));var r},regex:t=>{return nt(K(e,(r=t,R(n=>rt(n)&&!!n.match(r)))));var r}}),sc=nt(R(rt)),Ce=e=>Object.assign(oe(e),{between:(t,r)=>Ce(K(e,((n,o)=>R(i=>Ee(i)&&n<=i&&o>=i))(t,r))),lt:t=>Ce(K(e,(r=>R(n=>Ee(n)&&n<r))(t))),gt:t=>Ce(K(e,(r=>R(n=>Ee(n)&&n>r))(t))),lte:t=>Ce(K(e,(r=>R(n=>Ee(n)&&n<=r))(t))),gte:t=>Ce(K(e,(r=>R(n=>Ee(n)&&n>=r))(t))),int:()=>Ce(K(e,R(t=>Ee(t)&&Number.isInteger(t)))),finite:()=>Ce(K(e,R(t=>Ee(t)&&Number.isFinite(t)))),positive:()=>Ce(K(e,R(t=>Ee(t)&&t>0))),negative:()=>Ce(K(e,R(t=>Ee(t)&&t<0)))}),ac=Ce(R(Ee)),He=e=>Object.assign(oe(e),{between:(t,r)=>He(K(e,((n,o)=>R(i=>ze(i)&&n<=i&&o>=i))(t,r))),lt:t=>He(K(e,(r=>R(n=>ze(n)&&n<r))(t))),gt:t=>He(K(e,(r=>R(n=>ze(n)&&n>r))(t))),lte:t=>He(K(e,(r=>R(n=>ze(n)&&n<=r))(t))),gte:t=>He(K(e,(r=>R(n=>ze(n)&&n>=r))(t))),positive:()=>He(K(e,R(t=>ze(t)&&t>0))),negative:()=>He(K(e,R(t=>ze(t)&&t<0)))}),lc=He(R(ze)),cc=oe(R(function(e){return typeof e=="boolean"})),uc=oe(R(function(e){return typeof e=="symbol"})),dc=oe(R(function(e){return e==null}));var fe={__proto__:null,matcher:de,optional:ln,array:function(...e){return an({[de]:()=>({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 ge(r).forEach(i=>{n[i]=[]}),{matched:!0,selections:n};const o=(i,s)=>{n[i]=(n[i]||[]).concat([s])};return{matched:t.every(i=>te(r,i,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},set:function(...e){return oe({[de]:()=>({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,s)=>{r[i]=(r[i]||[]).concat([s])},o=e[0];return{matched:nc(t,i=>te(o,i,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},map:function(...e){return oe({[de]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const n=(a,c)=>{r[a]=(r[a]||[]).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,s]=e;return{matched:ic(t,(a,c)=>{const u=te(i,c,n),p=te(s,a,n);return u&&p}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...ge(e[0]),...ge(e[1])]})})},intersection:K,union:Bo,not:function(e){return oe({[de]:()=>({match:t=>({matched:!te(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:R,select:Nt,any:jo,_:oc,string:sc,number:ac,bigint:lc,boolean:cc,symbol:uc,nullish:dc,instanceOf:function(e){return oe(R(function(t){return r=>r instanceof t}(e)))},shape:function(e){return oe(R(rc(e)))}};const cn={matched:!1,value:void 0};function Ne(e){return new pr(e,cn)}class pr{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,s={};const a=(u,p)=>{i=!0,s[u]=p},c=!n.some(u=>te(u,this.input,a))||o&&!o(this.input)?cn:{matched:!0,value:r(i?dr in s?s[dr]:s:this.input,this.input)};return new pr(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new pr(this.input,n?{matched:!0,value:r(this.input,this.input)}:cn)}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 Uo="isdk",fc=44,pc={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"},Zd="";function ke(e,t){if(!e)throw new Error(t)}function hr(){throw new Error("Cycle detected")}var hc=Symbol.for("preact-signals");function un(){if(yt>1)yt--;else{for(var e,t=!1;Ft!==void 0;){var r=Ft;for(Ft=void 0,dn++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ho(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(dn=0,yt--,t)throw e}}var G=void 0,Ft=void 0,yt=0,dn=0,vr=0;function zo(e){if(G!==void 0){var t=e.n;if(t===void 0||t.t!==G)return t={i:0,S:e,p:G.s,n:void 0,t:G,e:void 0,x:void 0,r:t},G.s!==void 0&&(G.s.n=t),G.s=t,e.n=t,32&G.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=G.s,t.n=void 0,G.s.n=t,G.s=t),t}}function re(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}re.prototype.brand=hc,re.prototype.h=function(){return!0},re.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)},re.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)}},re.prototype.subscribe=function(e){var t=this;return pn(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},re.prototype.valueOf=function(){return this.value},re.prototype.toString=function(){return this.value+""},re.prototype.toJSON=function(){return this.value},re.prototype.peek=function(){return this.v},Object.defineProperty(re.prototype,"value",{get:function(){var e=zo(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(G instanceof Ke&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){dn>100&&hr(),this.v=e,this.i++,vr++,yt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{un()}}}});function We(e){return new re(e)}function Ho(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 Wo(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 Ko(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 Ke(e){re.call(this,void 0),this.x=e,this.s=void 0,this.g=vr-1,this.f=4}(Ke.prototype=new re).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vr))return!0;if(this.g=vr,this.f|=1,this.i>0&&!Ho(this))return this.f&=-2,!0;var e=G;try{Wo(this),G=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 G=e,Ko(this),this.f&=-2,!0},Ke.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)}re.prototype.S.call(this,e)},Ke.prototype.U=function(e){if(this.t!==void 0&&(re.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)}},Ke.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Ke.prototype.peek=function(){if(this.h()||hr(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ke.prototype,"value",{get:function(){1&this.f&&hr();var e=zo(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function vc(e){return new Ke(e)}function qo(e){var t=e.u;if(e.u=void 0,typeof t=="function"){yt++;var r=G;G=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,fn(e),n}finally{G=r,un()}}}function fn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,qo(e)}function gc(e){if(G!==this)throw new Error("Out-of-order effect");Ko(this),G=e,this.f&=-2,8&this.f&&fn(this),un()}function Mt(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Mt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Mt.prototype.S=function(){1&this.f&&hr(),this.f|=1,this.f&=-9,qo(this),Wo(this),yt++;var e=G;return G=this,gc.bind(this,e)},Mt.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ft,Ft=this)},Mt.prototype.d=function(){this.f|=8,1&this.f||fn(this)};function pn(e){var t=new Mt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var hn;function wt(e,t){S[e]=t.bind(null,S[e]||function(){})}function gr(e){hn&&hn(),hn=e&&e.S()}function Yo(e){var t=this,r=e.data,n=bc(r);n.value=r;var o=se(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var s;!Qn(o.peek())&&((s=t.base)==null?void 0:s.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},vc(function(){var s=n.value.value;return s===0?0:s===!0?"":s||""})},[]);return o.value}Yo.displayName="_st",Object.defineProperties(re.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Yo},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),wt("__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 re&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)}),wt("__r",function(e,t){gr();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return pn(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),gr(r),e(t)}),wt("__e",function(e,t,r,n){gr(),e(t,r,n)}),wt("diffed",function(e,t){gr();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 s in i){var a=i[s];a!==void 0&&!(s in n)&&(a.d(),i[s]=void 0)}else r.U=i={};for(var c in n){var u=i[c],p=n[c];u===void 0?(u=mc(r,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function mc(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=We(r);return{o:function(s,a){i.value=s,n=a},d:pn(function(){var s=i.value.value;n[t]!==s&&(n[t]=s,o?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}wt("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 s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),wt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),me.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 bc(e){return se(function(){return We(e)},[])}const vn=(e,t)=>t.some(r=>e instanceof r);let Go,Zo;function yc(){return Go||(Go=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function wc(){return Zo||(Zo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const gn=new WeakMap,mn=new WeakMap,mr=new WeakMap;function _c(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{r(it(e.result)),o()},s=()=>{n(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",s)});return mr.set(t,e),t}function xc(e){if(gn.has(e))return;const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{r(),o()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});gn.set(e,t)}let bn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return gn.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return it(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 Qo(e){bn=e(bn)}function kc(e){return wc().includes(e)?function(...t){return e.apply(yn(this),t),it(this.request)}:function(...t){return it(e.apply(yn(this),t))}}function $c(e){return typeof e=="function"?kc(e):(e instanceof IDBTransaction&&xc(e),vn(e,yc())?new Proxy(e,bn):e)}function it(e){if(e instanceof IDBRequest)return _c(e);if(mn.has(e))return mn.get(e);const t=$c(e);return t!==e&&(mn.set(e,t),mr.set(t,e)),t}const yn=e=>mr.get(e);function Sc(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=it(s);return n&&s.addEventListener("upgradeneeded",c=>{n(it(s.result),c.oldVersion,c.newVersion,it(s.transaction),c)}),r&&s.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{i&&c.addEventListener("close",()=>i()),o&&c.addEventListener("versionchange",u=>o(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const Ec=["get","getKey","getAll","getAllKeys","count"],Cc=["put","add","delete","clear"],wn=new Map;function Xo(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(wn.get(t))return wn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=Cc.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||Ec.includes(r)))return;const i=async function(s,...a){const c=this.transaction(s,o?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(a.shift())),(await Promise.all([u[r](...a),o&&c.done]))[0]};return wn.set(t,i),i}Qo(e=>({...e,get:(t,r,n)=>Xo(t,r)||e.get(t,r,n),has:(t,r)=>!!Xo(t,r)||e.has(t,r)}));const Oc=["continue","continuePrimaryKey","advance"],Jo={},_n=new WeakMap,es=new WeakMap,Pc={get(e,t){if(!Oc.includes(t))return e[t];let r=Jo[t];return r||(r=Jo[t]=function(...n){_n.set(this,es.get(this)[t](...n))}),r}};async function*Ac(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Pc);for(es.set(r,t),mr.set(r,yn(t));t;)yield r,t=await(_n.get(r)||t.continue()),_n.delete(r)}function ts(e,t){return t===Symbol.asyncIterator&&vn(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&vn(e,[IDBIndex,IDBObjectStore])}Qo(e=>({...e,get(t,r,n){return ts(t,r)?Ac:e.get(t,r,n)},has(t,r){return ts(t,r)||e.has(t,r)}}));const Lt=e=>Ne(e).with(fe.number.lte(1e3),()=>`${Math.round(e)}KB`).with(fe.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),rs=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Ic=e=>Object.entries(e).reduce((r,[n,o])=>(r[n]=o.value,r),{}),xn=e=>t=>t?t.type===e:!1;class Rt extends Error{constructor(){super("Aborted")}}function ns(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const is=typeof window>"u"?void 0:Sc("inploi-chatbot",2,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Vt={getStateData:async(e,t)=>{var n;const r=os({...e,flowKeys:t});return(n=await is)==null?void 0:n.get("state",r)},setStateData:ns(async e=>{var r;const t=os(e);return(r=await is)==null?void 0:r.put("state",e.data,t)},1e3)},br=(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,s=e.find(u=>u.id===i),a=t.type.includes("question")?1:0;if(s){const u=a+Math.max(br(e,o,r,n+a).remainingSteps,br(e,s,r,n+a).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const c=a+br(e,o,r,n+a).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:c}),{stepsMade:n,remainingSteps:c}},Dc=e=>{const t={},r=e.find(n=>n.isHead);return r&&br(e,r,(n,o)=>{t[n]=o}),t},os=e=>[...e.flowKeys,e.id,e.version].join("/"),qe=We({state:"idle"}),Bt=e=>{const{state:t,flow:r}=qe.value;if(t!=="loaded")return;ke(r,"No flow to update");const n=e(r.data);r.data=n,qe.value={state:t,flow:r},Vt.setStateData(r)},D={current$:qe,viewState$:We("closed"),inputHeight$:We(53),startFlow:async({flow:e,context:t,flowKeys:r,title:n})=>{const i={data:await Vt.getStateData(e,r)??ss(),startedAt:new Date,nodeIdToProgress:Dc(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n};qe.value={state:"loaded",flow:i},Vt.setStateData(i)},cancelCurrentFlow:()=>{qe.value={state:"idle"},D.viewState$.value="closed"},markAsFinished:()=>Bt(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Bt(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=qe.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=ss();qe.value={state:e,flow:{...t,data:r,startedAt:new Date}},Vt.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Bt(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=qe.value;ke(t==="loaded","Application not loaded");const n=r.data.messages.filter(o=>!o.groupId||!e.includes(o.groupId));r.data.messages=n,Vt.setStateData(r)},setSubmission:(e,t)=>Bt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Bt(t=>({...t,currentInput:e??null}))},Tc=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),ss=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:Tc()});var Nc=0;function d(e,t,r,n,o,i){var s,a,c={};for(a in t)a=="ref"?s=t[a]:c[a]=t[a];var u={type:e,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Nc,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return S.vnode&&S.vnode(u),u}const Fc=({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})]})]}),Mc=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"})})})]}),as=()=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Mc,{class:"text-neutral-6 h-8 w-8"})}),Lc=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)}%`},yr=({class:e,children:t,...r})=>d("button",{class:Ue("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})}),Rc=()=>{if(D.current$.value.state!=="loaded")return null;const e=D.current$.value.flow.nodeIdToProgress,t=D.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:Lc(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},Vc=({children:e})=>{const t=D.viewState$;return d(q,{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(q,{children:[d(yr,{"aria-label":"Maximise job application",onClick:()=>t.value="maximised",children:d("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),d(yr,{"aria-label":"Close application",onClick:D.cancelCurrentFlow,children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):d(q,{children:[D.current$.value.state==="loaded"&&d(yr,{"aria-label":"Restart",onClick:()=>{D.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(yr,{"aria-label":"Minimise application",onClick:()=>t.value="minimised",children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),d(Rc,{})]})})},Bc=Br(()=>Promise.resolve().then(()=>Ld).then(e=>e.ChatbotBody)),jc=on("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"}}}),Uc=({logger:e,apiClient:t,analytics:r})=>{const{state:n,flow:o,error:i}=D.current$.value,s=D.viewState$.value,a=n!=="idle"&&s==="maximised",c=L(null);return d(Jl,{open:a,modal:a,children:[d(ec,{class:"bg-overlay animate-fade-in pointer-events-none fixed inset-0"}),d(tc,{forceMount:!0,asChild:!0,children:d("div",{ref:c,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",style:{"--header-height":`${fc}px`,"--content-height":"75vh"},class:jc({view:s}),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(Vc,{children:o==null?void 0:o.title}),Ne({state:n,view:s}).with({view:"closed"},()=>null).with({view:"minimised"},()=>null).with({state:"idle"},()=>null).with({state:"loading"},()=>d(as,{},"loading")).with({state:"loaded"},()=>d(dt,{fallback:d(as,{},"loading"),children:d(Bc,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>d(Fc,{message:i})).exhaustive()]})})})]})},kn=Be({id:hi(be(),String),version:bi(),build:bi(),nodes:mi(gi())}),zc=Be({flow:kn}),Hc=Be({company:Be({name:be()}),flow:kn,job:Be({id:hi(be(),String),title:be()})}),Wc=Be({flow:kn,title:be(),flowKeys:mi(be()),context:yi(be(),gi())}),Kc=`#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%;--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 .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 .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 .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 .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 .\\[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 .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-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-10:active{outline-color:var(--i-color-n-10)}#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-7{--tw-ring-color: var(--i-color-a-7)}#isdk .peer:focus-visible~.peer-focus-visible\\:ring-offset-2{--tw-ring-offset-width: 2px}@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
- `,qc=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(Uo);if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.id=Uo,t}});var Yc=["1","2","3","4","5","6","7","8","9","10","11","12"],Gc={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]}},Zc=(e,t=1,r)=>n=>{const[o,i]=Gc[r][n];return"oklch("+o+"% "+i*t+" "+e+")"},$n=e=>{const t=Zc(e.hue,e.chroma,e.mode);return Object.fromEntries(Yc.map(r=>[e.prefix+r,e.transform(t(r))]))},Sn=e=>e,Qc=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)},wr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),En=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(wr(e)&&wr(r))for(const n in r){const o=r[n];if(wr(o)){e[n]||Object.assign(e,{[n]:{}});const i=e[n];wr(i)&&En(i,o)}else Object.assign(e,{[n]:r[n]})}return En(e,...t)},Xc=e=>{function t(r,n){const o=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${o}`:`var(--${o})`}return t},Jc=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:o,getToken:i}=n,s=v=>i("reference",v.toString()),a=e({theme:o}),c=t({theme:o,core:s,raw:{core:a}}),u=r({theme:o,core:s,semantic:s,raw:{core:a,semantic:c}}),p=Qc(En(a,c,u)),l=([v,b],g)=>{const h=[g,v].filter(Boolean).join(".");return typeof b=="object"?Object.entries(b).flatMap(_=>l(_,h)):[[n.getToken("declaration",h),b]]};return{values:p,declarations:Object.fromEntries(Object.entries(p).flatMap(v=>l(v))),ref:v=>i("reference",v.toString())}}})})})});const[Cn,On,ls]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],eu=Jc().core(({theme:e})=>({color:{black:Cn,white:On,lowest:e.mode==="light"?On:Cn,highest:e.mode==="light"?Cn:On,...$n({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:Sn}),...$n({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:Sn}),...$n({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:Sn})},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:ls,"bg-hover":n("n-10",.4),"bg-active":n("n-10",.5)}}}).component(({raw:e,theme:t,semantic:r,core:n})=>{const o=(i,s)=>e.core.color[i].replace(")",` / ${s})`);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":ls,"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")}}}),tu=Xc({prefix:"i-"}),ru=e=>{const t=eu.from({theme:e,getToken:tu}),r=Object.entries(t.declarations).map(([n,o])=>`${n}: ${o};`);return`#isdk {
41
+ `)},Bl=0,gt=[];function Rl(e){var t=L([]),r=L([0,0]),n=L(),o=G(Bl++)[0],i=G(function(){return xo()})[0],a=L(e);R(function(){a.current=e},[e]),R(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=sl([e.lockRef.current],(e.shards||[]).map(Ao),!0).filter(Boolean);return h.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=ve(function(h,_){if("touches"in h&&h.touches.length===2)return!a.current.allowPinchZoom;var k=lr(h),w=r.current,P="deltaX"in h?h.deltaX:w[0]-k[0],O="deltaY"in h?h.deltaY:w[1]-k[1],A,U=h.target,W=Math.abs(P)>Math.abs(O)?"h":"v";if("touches"in h&&W==="h"&&U.type==="range")return!1;var N=So(W,U);if(!N)return!0;if(N?A=W:(A=W==="v"?"h":"v",N=So(W,U)),!N)return!1;if(!n.current&&"changedTouches"in h&&(P||O)&&(n.current=A),!A)return!0;var M=n.current||A;return Ml(M,_,h,M==="h"?P:O,!0)},[]),c=ve(function(h){var _=h;if(!(!gt.length||gt[gt.length-1]!==i)){var k="deltaY"in _?Co(_):lr(_),w=t.current.filter(function(A){return A.name===_.type&&A.target===_.target&&Fl(A.delta,k)})[0];if(w&&w.should){_.cancelable&&_.preventDefault();return}if(!w){var P=(a.current.shards||[]).map(Ao).filter(Boolean).filter(function(A){return A.contains(_.target)}),O=P.length>0?s(_,P[0]):!a.current.noIsolation;O&&_.cancelable&&_.preventDefault()}}},[]),u=ve(function(h,_,k,w){var P={name:h,delta:_,target:k,should:w};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(O){return O!==P})},1)},[]),p=ve(function(h){r.current=lr(h),n.current=void 0},[]),l=ve(function(h){u(h.type,Co(h),h.target,s(h,e.lockRef.current))},[]),v=ve(function(h){u(h.type,lr(h),h.target,s(h,e.lockRef.current))},[]);R(function(){return gt.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:v}),document.addEventListener("wheel",c,vt),document.addEventListener("touchmove",c,vt),document.addEventListener("touchstart",p,vt),function(){gt=gt.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,vt),document.removeEventListener("touchmove",c,vt),document.removeEventListener("touchstart",p,vt)}},[]);var b=e.removeScrollBar,g=e.inert;return D(q,null,g?D(i,{styles:Ll(o)}):null,b?D(Al,{gapMode:"margin"}):null)}const Vl=gl(wo,Rl);var Po=se(function(e,t){return D(ar,$e({},e,{ref:t,sideCar:Vl}))});Po.classNames=ar.classNames;const jl=Po;var zl=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mt=new WeakMap,cr=new WeakMap,ur={},rn=0,Io=function(e){return e&&(e.host||Io(e.parentNode))},Ul=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Io(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})},Hl=function(e,t,r,n){var o=Ul(t,Array.isArray(e)?e:[e]);ur[r]||(ur[r]=new WeakMap);var i=ur[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 p=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(v){if(s.has(v))p(v);else{var b=v.getAttribute(n),g=b!==null&&b!=="false",h=(mt.get(v)||0)+1,_=(i.get(v)||0)+1;mt.set(v,h),i.set(v,_),a.push(v),h===1&&g&&cr.set(v,!0),_===1&&v.setAttribute(r,"true"),g||v.setAttribute(n,"true")}})};return p(t),s.clear(),rn++,function(){a.forEach(function(l){var v=mt.get(l)-1,b=i.get(l)-1;mt.set(l,v),i.set(l,b),v||(cr.has(l)||l.removeAttribute(n),cr.delete(l)),b||l.removeAttribute(r)}),rn--,rn||(mt=new WeakMap,mt=new WeakMap,cr=new WeakMap,ur={})}},Wl=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||zl(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),Hl(n,o,r,"aria-hidden")):function(){return null}};const Oo="Dialog",[To,Yd]=Ns(Oo),[Kl,bt]=To(Oo),ql=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=L(null),c=L(null),[u=!1,p]=Bs({prop:n,defaultProp:o,onChange:i});return D(Kl,{scope:t,triggerRef:s,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:p,onOpenToggle:ve(()=>p(l=>!l),[p]),modal:a},r)},Gl="DialogPortal",[Zd,Do]=To(Gl,{forceMount:void 0}),nn="DialogOverlay",Yl=se((e,t)=>{const r=Do(nn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=bt(nn,e.__scopeDialog);return i.modal?D(Qr,{present:n||i.open},D(Zl,ue({},o,{ref:t}))):null}),Zl=se((e,t)=>{const{__scopeDialog:r,...n}=e,o=bt(nn,r);return D(jl,{as:Wr,allowPinchZoom:!0,shards:[o.contentRef]},D(qr.div,ue({"data-state":Mo(o.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),Tt="DialogContent",Ql=se((e,t)=>{const r=Do(Tt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=bt(Tt,e.__scopeDialog);return D(Qr,{present:n||i.open},i.modal?D(Xl,ue({},o,{ref:t})):D(Jl,ue({},o,{ref:t})))}),Xl=se((e,t)=>{const r=bt(Tt,e.__scopeDialog),n=L(null),o=Ot(t,r.contentRef,n);return R(()=>{const i=n.current;if(i)return Wl(i)},[]),D(No,ue({},e,{ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:ht(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:ht(e.onFocusOutside,i=>i.preventDefault())}))}),Jl=se((e,t)=>{const r=bt(Tt,e.__scopeDialog),n=L(!1),o=L(!1);return D(No,ue({},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()}}))}),No=se((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=bt(Tt,r),c=L(null),u=Ot(t,c);return al(),D(q,null,D(Qs,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i},D(Gs,ue({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Mo(s.open)},a,{ref:u,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function Mo(e){return e?"open":"closed"}const ec=ql,tc=Yl,rc=Ql;function Fo(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=Fo(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ze(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Fo(e))&&(n&&(n+=" "),n+=t);return n}const Lo=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Bo=ze,on=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Bo(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],l=i==null?void 0:i[u];if(p===null)return null;const v=Lo(p)||Lo(l);return o[u][v]}),s=r&&Object.entries(r).reduce((u,p)=>{let[l,v]=p;return v===void 0||(u[l]=v),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,p)=>{let{class:l,className:v,...b}=p;return Object.entries(b).every(g=>{let[h,_]=g;return Array.isArray(_)?_.includes({...i,...s}[h]):{...i,...s}[h]===_})?[...u,l,v]:u},[]);return Bo(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},de=Symbol.for("@ts-pattern/matcher"),Ro=Symbol.for("@ts-pattern/isVariadic"),dr="@ts-pattern/anonymous-select-key",an=e=>!!(e&&typeof e=="object"),fr=e=>e&&!!e[de],te=(e,t,r)=>{if(fr(e)){const n=e[de](),{matched:o,selections:i}=n.match(t);return o&&i&&Object.keys(i).forEach(a=>r(a,i[a])),o}if(an(e)){if(!an(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];fr(s)&&s[Ro]?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,p)=>te(u,a[p],r))&&o.every((u,p)=>te(u,s[p],r))&&(i.length===0||te(i[0],c,r))}return e.length===t.length&&e.every((a,s)=>te(a,t[s],r))}return Object.keys(e).every(n=>{const o=e[n];return(n in t||fr(i=o)&&i[de]().matcherType==="optional")&&te(o,t[n],r);var i})}return Object.is(t,e)},ge=e=>{var t,r,n;return an(e)?fr(e)?(t=(r=(n=e[de]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Dt(e,ge):Dt(Object.values(e),ge):[]},Dt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function nc(...e){if(e.length===1){const[t]=e;return r=>te(t,r,()=>{})}if(e.length===2){const[t,r]=e;return te(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function oe(e){return Object.assign(e,{optional:()=>ln(e),and:t=>K(e,t),or:t=>Vo(e,t),select:t=>t===void 0?Nt(e):Nt(t,e)})}function sn(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[Ro]:!0})}}))(e),{optional:()=>sn(ln(e)),select:t=>sn(t===void 0?Nt(e):Nt(t,e))})}function ln(e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return t===void 0?(ge(e).forEach(o=>n(o,void 0)),{matched:!0,selections:r}):{matched:te(e,t,n),selections:r}},getSelectionKeys:()=>ge(e),matcherType:"optional"})})}const ic=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},oc=(e,t)=>{for(const[r,n]of e.entries())if(!t(n,r))return!1;return!0};function K(...e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return{matched:e.every(o=>te(o,t,n)),selections:r}},getSelectionKeys:()=>Dt(e,ge),matcherType:"and"})})}function Vo(...e){return oe({[de]:()=>({match:t=>{let r={};const n=(o,i)=>{r[o]=i};return Dt(e,ge).forEach(o=>n(o,void 0)),{matched:e.some(o=>te(o,t,n)),selections:r}},getSelectionKeys:()=>Dt(e,ge),matcherType:"or"})})}function B(e){return{[de]:()=>({match:t=>({matched:!!e(t)})})}}function Nt(...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 oe({[de]:()=>({match:n=>{let o={[t??dr]:n};return{matched:r===void 0||te(r,n,(i,a)=>{o[i]=a}),selections:o}},getSelectionKeys:()=>[t??dr].concat(r===void 0?[]:ge(r))})})}function Ee(e){return typeof e=="number"}function rt(e){return typeof e=="string"}function Ue(e){return typeof e=="bigint"}const jo=oe(B(function(e){return!0})),ac=jo,nt=e=>Object.assign(oe(e),{startsWith:t=>{return nt(K(e,(r=t,B(n=>rt(n)&&n.startsWith(r)))));var r},endsWith:t=>{return nt(K(e,(r=t,B(n=>rt(n)&&n.endsWith(r)))));var r},minLength:t=>nt(K(e,(r=>B(n=>rt(n)&&n.length>=r))(t))),maxLength:t=>nt(K(e,(r=>B(n=>rt(n)&&n.length<=r))(t))),includes:t=>{return nt(K(e,(r=t,B(n=>rt(n)&&n.includes(r)))));var r},regex:t=>{return nt(K(e,(r=t,B(n=>rt(n)&&!!n.match(r)))));var r}}),sc=nt(B(rt)),Ce=e=>Object.assign(oe(e),{between:(t,r)=>Ce(K(e,((n,o)=>B(i=>Ee(i)&&n<=i&&o>=i))(t,r))),lt:t=>Ce(K(e,(r=>B(n=>Ee(n)&&n<r))(t))),gt:t=>Ce(K(e,(r=>B(n=>Ee(n)&&n>r))(t))),lte:t=>Ce(K(e,(r=>B(n=>Ee(n)&&n<=r))(t))),gte:t=>Ce(K(e,(r=>B(n=>Ee(n)&&n>=r))(t))),int:()=>Ce(K(e,B(t=>Ee(t)&&Number.isInteger(t)))),finite:()=>Ce(K(e,B(t=>Ee(t)&&Number.isFinite(t)))),positive:()=>Ce(K(e,B(t=>Ee(t)&&t>0))),negative:()=>Ce(K(e,B(t=>Ee(t)&&t<0)))}),lc=Ce(B(Ee)),He=e=>Object.assign(oe(e),{between:(t,r)=>He(K(e,((n,o)=>B(i=>Ue(i)&&n<=i&&o>=i))(t,r))),lt:t=>He(K(e,(r=>B(n=>Ue(n)&&n<r))(t))),gt:t=>He(K(e,(r=>B(n=>Ue(n)&&n>r))(t))),lte:t=>He(K(e,(r=>B(n=>Ue(n)&&n<=r))(t))),gte:t=>He(K(e,(r=>B(n=>Ue(n)&&n>=r))(t))),positive:()=>He(K(e,B(t=>Ue(t)&&t>0))),negative:()=>He(K(e,B(t=>Ue(t)&&t<0)))}),cc=He(B(Ue)),uc=oe(B(function(e){return typeof e=="boolean"})),dc=oe(B(function(e){return typeof e=="symbol"})),fc=oe(B(function(e){return e==null}));var fe={__proto__:null,matcher:de,optional:ln,array:function(...e){return sn({[de]:()=>({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 ge(r).forEach(i=>{n[i]=[]}),{matched:!0,selections:n};const o=(i,a)=>{n[i]=(n[i]||[]).concat([a])};return{matched:t.every(i=>te(r,i,o)),selections:n}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},set:function(...e){return oe({[de]:()=>({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:ic(t,i=>te(o,i,n)),selections:r}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},map:function(...e){return oe({[de]:()=>({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:oc(t,(s,c)=>{const u=te(i,c,n),p=te(a,s,n);return u&&p}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...ge(e[0]),...ge(e[1])]})})},intersection:K,union:Vo,not:function(e){return oe({[de]:()=>({match:t=>({matched:!te(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:B,select:Nt,any:jo,_:ac,string:sc,number:lc,bigint:cc,boolean:uc,symbol:dc,nullish:fc,instanceOf:function(e){return oe(B(function(t){return r=>r instanceof t}(e)))},shape:function(e){return oe(B(nc(e)))}};const cn={matched:!1,value:void 0};function Ne(e){return new pr(e,cn)}class pr{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},c=!n.some(u=>te(u,this.input,s))||o&&!o(this.input)?cn:{matched:!0,value:r(i?dr in a?a[dr]:a:this.input,this.input)};return new pr(this.input,c)}when(t,r){if(this.state.matched)return this;const n=!!t(this.input);return new pr(this.input,n?{matched:!0,value:r(this.input,this.input)}:cn)}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 zo="isdk",pc=44,hc={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"},Qd="";function ke(e,t){if(!e)throw new Error(t)}function hr(){throw new Error("Cycle detected")}var vc=Symbol.for("preact-signals");function un(){if(yt>1)yt--;else{for(var e,t=!1;Mt!==void 0;){var r=Mt;for(Mt=void 0,dn++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ho(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(dn=0,yt--,t)throw e}}var Y=void 0,Mt=void 0,yt=0,dn=0,vr=0;function Uo(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 re(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}re.prototype.brand=vc,re.prototype.h=function(){return!0},re.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)},re.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)}},re.prototype.subscribe=function(e){var t=this;return pn(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})},re.prototype.valueOf=function(){return this.value},re.prototype.toString=function(){return this.value+""},re.prototype.toJSON=function(){return this.value},re.prototype.peek=function(){return this.v},Object.defineProperty(re.prototype,"value",{get:function(){var e=Uo(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(Y instanceof Ke&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){dn>100&&hr(),this.v=e,this.i++,vr++,yt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{un()}}}});function We(e){return new re(e)}function Ho(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 Wo(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 Ko(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 Ke(e){re.call(this,void 0),this.x=e,this.s=void 0,this.g=vr-1,this.f=4}(Ke.prototype=new re).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vr))return!0;if(this.g=vr,this.f|=1,this.i>0&&!Ho(this))return this.f&=-2,!0;var e=Y;try{Wo(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,Ko(this),this.f&=-2,!0},Ke.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)}re.prototype.S.call(this,e)},Ke.prototype.U=function(e){if(this.t!==void 0&&(re.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)}},Ke.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Ke.prototype.peek=function(){if(this.h()||hr(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ke.prototype,"value",{get:function(){1&this.f&&hr();var e=Uo(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function gc(e){return new Ke(e)}function qo(e){var t=e.u;if(e.u=void 0,typeof t=="function"){yt++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,fn(e),n}finally{Y=r,un()}}}function fn(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,qo(e)}function mc(e){if(Y!==this)throw new Error("Out-of-order effect");Ko(this),Y=e,this.f&=-2,8&this.f&&fn(this),un()}function Ft(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ft.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()}},Ft.prototype.S=function(){1&this.f&&hr(),this.f|=1,this.f&=-9,qo(this),Wo(this),yt++;var e=Y;return Y=this,mc.bind(this,e)},Ft.prototype.N=function(){2&this.f||(this.f|=2,this.o=Mt,Mt=this)},Ft.prototype.d=function(){this.f|=8,1&this.f||fn(this)};function pn(e){var t=new Ft(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var hn;function wt(e,t){$[e]=t.bind(null,$[e]||function(){})}function gr(e){hn&&hn(),hn=e&&e.S()}function Go(e){var t=this,r=e.data,n=yc(r);n.value=r;var o=ae(function(){for(var i=t.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Qn(o.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=o.peek():(t.__$f|=1,t.setState({}))},gc(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return o.value}Go.displayName="_st",Object.defineProperties(re.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Go},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),wt("__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 re&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)}),wt("__r",function(e,t){gr();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return pn(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),gr(r),e(t)}),wt("__e",function(e,t,r,n){gr(),e(t,r,n)}),wt("diffed",function(e,t){gr();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],p=n[c];u===void 0?(u=bc(r,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function bc(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=We(r);return{o:function(a,s){i.value=a,n=s},d:pn(function(){var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}wt("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)}),wt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)}),me.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 yc(e){return ae(function(){return We(e)},[])}const vn=(e,t)=>t.some(r=>e instanceof r);let Yo,Zo;function wc(){return Yo||(Yo=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _c(){return Zo||(Zo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const gn=new WeakMap,mn=new WeakMap,mr=new WeakMap;function xc(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{r(it(e.result)),o()},a=()=>{n(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return mr.set(t,e),t}function kc(e){if(gn.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)});gn.set(e,t)}let bn={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return gn.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return it(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 Qo(e){bn=e(bn)}function Sc(e){return _c().includes(e)?function(...t){return e.apply(yn(this),t),it(this.request)}:function(...t){return it(e.apply(yn(this),t))}}function $c(e){return typeof e=="function"?Sc(e):(e instanceof IDBTransaction&&kc(e),vn(e,wc())?new Proxy(e,bn):e)}function it(e){if(e instanceof IDBRequest)return xc(e);if(mn.has(e))return mn.get(e);const t=$c(e);return t!==e&&(mn.set(e,t),mr.set(t,e)),t}const yn=e=>mr.get(e);function Ec(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=it(a);return n&&a.addEventListener("upgradeneeded",c=>{n(it(a.result),c.oldVersion,c.newVersion,it(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 Cc=["get","getKey","getAll","getAllKeys","count"],Ac=["put","add","delete","clear"],wn=new Map;function Xo(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(wn.get(t))return wn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=Ac.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||Cc.includes(r)))return;const i=async function(a,...s){const c=this.transaction(a,o?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(s.shift())),(await Promise.all([u[r](...s),o&&c.done]))[0]};return wn.set(t,i),i}Qo(e=>({...e,get:(t,r,n)=>Xo(t,r)||e.get(t,r,n),has:(t,r)=>!!Xo(t,r)||e.has(t,r)}));const Pc=["continue","continuePrimaryKey","advance"],Jo={},_n=new WeakMap,ea=new WeakMap,Ic={get(e,t){if(!Pc.includes(t))return e[t];let r=Jo[t];return r||(r=Jo[t]=function(...n){_n.set(this,ea.get(this)[t](...n))}),r}};async function*Oc(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Ic);for(ea.set(r,t),mr.set(r,yn(t));t;)yield r,t=await(_n.get(r)||t.continue()),_n.delete(r)}function ta(e,t){return t===Symbol.asyncIterator&&vn(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&vn(e,[IDBIndex,IDBObjectStore])}Qo(e=>({...e,get(t,r,n){return ta(t,r)?Oc:e.get(t,r,n)},has(t,r){return ta(t,r)||e.has(t,r)}}));const Lt=e=>Ne(e).with(fe.number.lte(1e3),()=>`${Math.round(e)}KB`).with(fe.number.lt(1e3*10),()=>`${(e/1e3).toFixed(1)}MB`).otherwise(()=>`${Math.round(e/1e3)}MB`),ra=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Tc=e=>Object.entries(e).reduce((r,[n,o])=>(r[n]=o.value,r),{}),xn=e=>t=>t?t.type===e:!1;class Bt extends Error{constructor(){super("Aborted")}}function na(e,t=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}const ia=typeof window>"u"?void 0:Ec("inploi-chatbot",2,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}}),Rt={getStateData:async(e,t)=>{var n;const r=oa({...e,flowKeys:t});return(n=await ia)==null?void 0:n.get("state",r)},setStateData:na(async e=>{var r;const t=oa(e);return(r=await ia)==null?void 0:r.put("state",e.data,t)},1e3)},br=(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(br(e,o,r,n+s).remainingSteps,br(e,a,r,n+s).remainingSteps);return r(t.id,{stepsMade:n,remainingSteps:u}),{stepsMade:n,remainingSteps:u}}const c=s+br(e,o,r,n+s).remainingSteps;return r(t.id,{stepsMade:n,remainingSteps:c}),{stepsMade:n,remainingSteps:c}},Dc=e=>{const t={},r=e.find(n=>n.isHead);return r&&br(e,r,(n,o)=>{t[n]=o}),t},oa=e=>[...e.flowKeys,e.id,e.version].join("/"),qe=We({state:"idle"}),Vt=e=>{const{state:t,flow:r}=qe.value;if(t!=="loaded")return;ke(r,"No flow to update");const n=e(r.data);r.data=n,qe.value={state:t,flow:r},Rt.setStateData(r)},T={current$:qe,viewState$:We("closed"),inputHeight$:We(53),startFlow:async({flow:e,context:t,flowKeys:r,title:n})=>{const i={data:await Rt.getStateData(e,r)??aa(),startedAt:new Date,nodeIdToProgress:Dc(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:n};qe.value={state:"loaded",flow:i},Rt.setStateData(i)},cancelCurrentFlow:()=>{qe.value={state:"idle"},T.viewState$.value="closed"},markAsFinished:()=>Vt(e=>({...e,isFinished:!0})),setCurrentNodeId:e=>Vt(t=>(t.nodeHistory.push(e),t)),restart:()=>{const{state:e,flow:t}=qe.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r=aa();qe.value={state:e,flow:{...t,data:r,startedAt:new Date}},Rt.setStateData(t)},addMessage:(e,t)=>{const r={...e,groupId:t};return Vt(n=>(n.messages.push(r),n))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=qe.value;ke(t==="loaded","Application not loaded");const n=r.data.messages.filter(o=>!o.groupId||!e.includes(o.groupId));r.data.messages=n,Rt.setStateData(r)},setSubmission:(e,t)=>Vt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>Vt(t=>({...t,currentInput:e??null}))},Nc=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),aa=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],isFinished:!1,sequence:0,flowSessionId:Nc()});var Mc=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:--Mc,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)c[s]===void 0&&(c[s]=a[s]);return $.vnode&&$.vnode(u),u}const Fc=({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})]})]}),Lc=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"})})})]}),sa=()=>d("div",{class:"flex flex-grow flex-col items-center justify-center",children:d(Lc,{class:"text-neutral-6 h-8 w-8"})}),Bc=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)}%`},yr=({class:e,children:t,...r})=>d("button",{class:ze("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})}),Rc=()=>{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:Bc(n)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},Vc=({children:e})=>{const t=T.viewState$;return d(q,{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(q,{children:[d(yr,{"aria-label":"Maximise job application",onClick:()=>t.value="maximised",children:d("path",{d:"M12.5 9.5L8 5L3.5 9.5"})},"minmax"),d(yr,{"aria-label":"Close application",onClick:T.cancelCurrentFlow,children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"close")]}):d(q,{children:[T.current$.value.state==="loaded"&&d(yr,{"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(yr,{"aria-label":"Minimise application",onClick:()=>t.value="minimised",children:d("path",{d:"M12.5 6.5L8 11L3.5 6.5"})},"minmax")]})})]}),d(Rc,{})]})})},jc=Vr(()=>Promise.resolve().then(()=>Bd).then(e=>e.ChatbotBody)),zc=on("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"}}}),Uc=({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(ec,{open:s,modal:s,children:[d(tc,{class:"bg-overlay animate-fade-in pointer-events-none fixed inset-0"}),d(rc,{forceMount:!0,asChild:!0,children:d("div",{ref:c,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",style:{"--header-height":`${pc}px`,"--content-height":"75vh"},class:zc({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(Vc,{children:o==null?void 0:o.title}),Ne({state:n,view:a}).with({view:"closed"},()=>null).with({view:"minimised"},()=>null).with({state:"idle"},()=>null).with({state:"loading"},()=>d(sa,{},"loading")).with({state:"loaded"},()=>d(dt,{fallback:d(sa,{},"loading"),children:d(jc,{analytics:r,apiClient:t,logger:e})})).with({state:"error"},()=>d(Fc,{message:i})).exhaustive()]})})})]})},kn=Ve({id:hi(be(),String),version:bi(),build:bi(),nodes:mi(gi())}),Hc=Ve({flow:kn}),Wc=Ve({company:Ve({name:be()}),flow:kn,job:Ve({id:hi(be(),String),title:be()})}),Kc=Ve({flow:kn,title:be(),flowKeys:mi(be()),context:yi(be(),gi())}),qc=`#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%;--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 .\\[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
+ `,Gc=()=>({getOrCreateChatbotElement:()=>{const e=document.getElementById(zo);if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.id=zo,t}});var Yc=["1","2","3","4","5","6","7","8","9","10","11","12"],Zc={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]}},Qc=(e,t=1,r)=>n=>{const[o,i]=Zc[r][n];return"oklch("+o+"% "+i*t+" "+e+")"},Sn=e=>{const t=Qc(e.hue,e.chroma,e.mode);return Object.fromEntries(Yc.map(r=>[e.prefix+r,e.transform(t(r))]))},$n=e=>e,Xc=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)},wr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),En=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(wr(e)&&wr(r))for(const n in r){const o=r[n];if(wr(o)){e[n]||Object.assign(e,{[n]:{}});const i=e[n];wr(i)&&En(i,o)}else Object.assign(e,{[n]:r[n]})}return En(e,...t)},Jc=e=>{function t(r,n){const o=[e.prefix,n.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${o}`:`var(--${o})`}return t},eu=()=>({core:e=>({semantic:t=>({component:r=>({from:n=>{const{theme:o,getToken:i}=n,a=v=>i("reference",v.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}}),p=Xc(En(s,c,u)),l=([v,b],g)=>{const h=[g,v].filter(Boolean).join(".");return typeof b=="object"?Object.entries(b).flatMap(_=>l(_,h)):[[n.getToken("declaration",h),b]]};return{values:p,declarations:Object.fromEntries(Object.entries(p).flatMap(v=>l(v))),ref:v=>i("reference",v.toString())}}})})})});const[Cn,An,la]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],tu=eu().core(({theme:e})=>({color:{black:Cn,white:An,lowest:e.mode==="light"?An:Cn,highest:e.mode==="light"?Cn:An,...Sn({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:$n}),...Sn({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:$n}),...Sn({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:$n})},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:la,"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":la,"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")}}}),ru=Jc({prefix:"i-"}),nu=e=>{const t=tu.from({theme:e,getToken:ru}),r=Object.entries(t.declarations).map(([n,o])=>`${n}: ${o};`);return`#isdk {
43
43
  ${r.concat(r).join(`
44
44
  `)}
45
- }`},nu=({_internal_domManager:e=qc(),theme:t})=>Ze(({apiClient:r,logger:n,analytics:o})=>{let i=!1;const s=()=>{if(typeof window>"u")return;const a=[T("style",{id:"inploi-chatbot-styles"},Kc),T("style",{id:"inploi-chatbot-theme"},ru(t))],c=e.getOrCreateChatbotElement();ct(T(q,{},[a,T(Uc,{apiClient:r,logger:n,analytics:o})]),c),i=!0};return{prepare:async()=>{if(!(typeof window>"u"))try{if(i)return;s(),n.info("Chatbot plugin prepared")}catch(a){n.error("Error preparing chatbot plugin",a)}},fetchFlowByJobId:async a=>r.fetch(`/flow/job/${a}`).then(c=>{const u=Pt(Hc,c);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 a=>r.fetch(`/flow/id/${a}`).then(c=>{const u=Pt(zc,c);return{flow:u.flow,context:{flow_id:u.flow.id,flow_version:u.flow.version},title:"Chatbot",flowKeys:[]}}),open:async a=>{if(!(typeof window>"u"))try{D.cancelCurrentFlow(),D.viewState$.value="maximised",i||s(),a instanceof Promise?(D.current$.value={state:"loading"},a.then(async c=>{const u=Pt(Wc,c);D.startFlow(u)}).catch(c=>{const u=c instanceof Error?c.message:"An error occurred";D.current$.value={state:"error",error:u}})):D.startFlow(a)}catch(c){n.error("Error starting flow",c)}},startApplication:void 0,closeApplication:void 0,close:async()=>{typeof window>"u"||(D.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=nu;const cs=({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 cs({node:n,nodes:t,stopWhen:r})},iu=({childNode:e,nodes:t})=>{const n=t.filter(o=>o.type==="if-block").find(o=>{if(!o.branchId)return!1;const i=t.find(a=>a.id===o.branchId);if(!i)return!1;const s=cs({node:i,nodes:t,stopWhen:a=>a.id===e.id});return!(!s||s.id!==e.id)});if(n!=null&&n.nextId)return t.find(o=>o.id===n.nextId)},ou=({flow:e,analytics:t,logger:r,context:n,apiClient:o,getSubmissions:i,chatService:s,onFlowEnd:a,onInterpret:c})=>{let u=new AbortController;const p=async(l,v)=>{const b=i();c==null||c(l,v);try{await su({analytics:t,logger:r,apiClient:o,context:n,node:l,submissions:b,chat:{sendMessage:async g=>s.send({groupId:l.id,message:g,signal:u.signal}),userInput:async g=>s.input({input:g,signal:u.signal})},next:g=>{const h=g?e.find(_=>_.id===g):iu({childNode:l,nodes:e});return h?p(h,l):a==null?void 0:a(l)},end:()=>a==null?void 0:a(l)})}catch(g){if(g instanceof Rt)return;throw g}};return{interpret:async l=>{const v=e.find(b=>b.id===l)??rs(e);return p(v)},undo:l=>{let v=1;const b=e.find(h=>h.id===l[l.length-1]);for(let h=l.length-2;h>0;h--){const _=l[h],k=e.find(w=>w.id===_);if(!k||(v++,k.type.startsWith("question-")))break}u.abort(),u=new AbortController;const g=e.find(h=>h.id===l[l.length-v]);return ke(g,"Undo failed: new start node not found"),p(g,b),{removed:v}},abort:()=>{u.abort()}}};async function su(e){return await Ne(e).with({node:{type:"text"}},uu).with({node:{type:"image"}},du).with({node:{type:"question-text"}},fu).with({node:{type:"question-enum"}},hu).with({node:{type:"question-number"}},pu).with({node:{type:"question-boolean"}},vu).with({node:{type:"question-file"}},mu).with({node:{type:"question-address"}},gu).with({node:{type:"end-flow"}},bu).with({node:{type:"if-block"}},cu).with({node:{type:"jump"}},({node:t,next:r})=>r(t.data.targetId)).with({node:{type:"link"}},lu).with({node:{type:"integration-application-submit"}},au).with({node:{type:"integration-workflow-get"}},()=>Error("Unreachable")).exhaustive()}async function au({chat:e,next:t,node:r,logger:n,apiClient:o,submissions:i,context:s,analytics:a}){r.data.skipConfirmation!==!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:u}=a.getSessionInfo(),p=await o.fetch("/flow/apply",{method:"POST",body:JSON.stringify({...s,integration_id:r.data.integrationId,anonymous_id:c,session_id:u,submissions:Ic(i||{})})}).catch(l=>l);await Ne(p).with({ats_data:{redirect_url:fe.string}},async l=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please complete your submission here:"});const v=new URL(l.ats_data.redirect_url);c&&!v.searchParams.has("anonymous_id")&&v.searchParams.set("anonymous_id",c),await e.sendMessage({type:"link",href:v.toString(),text:"Complete submission"}),t(r.nextId)}).with({success:!0},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Submission completed!"}),t(r.nextId)}).otherwise(async l=>{n.error(l),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit"}),t(r.id)})}async function lu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({type:"link",href:r.data.href,text:ot(r.data.cta,n)}),t(r.nextId)}async function cu({submissions:e,next:t,node:r}){const n=yu(r,e)?r.branchId:r.nextId;t(n)}async function uu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.text,n)}),t(r.nextId)}async function du({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 fu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=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}});o.value===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:o.value}),t(r.nextId)}async function pu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:"text"}});o.value===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:o.value}),t(r.nextId)}async function hu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});o.value.length===0?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(i=>o.value.includes(i.value)).map(i=>i.label).join(", ")}),t(r.nextId)}async function vu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});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}}})).value;i===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:{true:r.data.trueLabel,false:r.data.falseLabel}[i]}),t(r.nextId)}async function gu({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.value===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 mu({node:e,chat:t,next:r,submissions:n}){await t.sendMessage({author:"bot",type:"text",text:ot(e.data.question,n)});const o=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(o.value===null)await t.sendMessage({type:"system",variant:"info",text:"Skipped"});else for(const i of o.value)await t.sendMessage({author:"user",type:"file",fileName:i.name,fileSizeKb:i.sizeKb});r(e.nextId)}async function bu({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const us=fe.union(fe.string,fe.array(fe.string),null),yu=(e,t)=>{const r=t==null?void 0:t[e.data.compareKey];return r?Ne({...e.data,answer:r}).with({compare:"equals"},({compareValue:n})=>typeof r.value=="string"||typeof r.value=="boolean"?n===r.value.toString():!1).with({compare:"notEquals"},({compareValue:n})=>typeof r.value=="string"||typeof r.value=="boolean"?n!==r.value.toString():!1).with({compare:"contains",answer:{value:us}},({compareValue:n,answer:o})=>o.value!==null&&o.value.includes(n)).with({compare:"notContains",answer:{value:us}},({compareValue:n,answer:o})=>o.value===null||!o.value.includes(n)).with({answer:{type:"file"}},()=>!1).with({answer:{type:"address",value:fe.any}},()=>!1).exhaustive():!1},ot=(e,t)=>{const r=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;return e.replace(r,(n,o,i="")=>{o=o.trim();const s=t==null?void 0:t[o];if(!s)return i;switch(s.type){case"boolean":return s.value==="true"?"true":"false";case"file":return s.value?s.value.map(a=>`${a.name} (${Lt(a.sizeKb)})`).join(", "):"no files";case"multiple-choice":return s.value.join(", ");default:return s.value||i}})};function wu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e,t,r){var n,o,i,s,a;t==null&&(t=100);function c(){var p=Date.now()-s;p<t&&p>=0?n=setTimeout(c,t-p):(n=null,r||(a=e.apply(i,o),i=o=null))}var u=function(){i=this,o=arguments,s=Date.now();var p=r&&!n;return n||(n=setTimeout(c,t)),p&&(a=e.apply(i,o),i=o=null),a};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(a=e.apply(i,o),i=o=null,clearTimeout(n),n=null)},u}Pn.debounce=Pn;var _u=Pn;const ds=wu(_u);function xu(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[s,a]=Y({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:s}),u=t?typeof t=="number"?t:t.scroll:null,p=t?typeof t=="number"?t:t.resize:null,l=L(!1);V(()=>(l.current=!0,()=>void(l.current=!1)));const[v,b,g]=se(()=>{const w=()=>{if(!c.current.element)return;const{left:P,top:I,width:O,height:z,bottom:W,right:N,x:F,y:ie}=c.current.element.getBoundingClientRect(),ee={left:P,top:I,width:O,height:z,bottom:W,right:N,x:F,y:ie};c.current.element instanceof HTMLElement&&o&&(ee.height=c.current.element.offsetHeight,ee.width=c.current.element.offsetWidth),Object.freeze(ee),l.current&&!Eu(c.current.lastBounds,ee)&&a(c.current.lastBounds=ee)};return[w,p?ds(w,p):w,u?ds(w,u):w]},[a,o,u,p]);function h(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",g,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function _(){c.current.element&&(c.current.resizeObserver=new i(g),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach(w=>w.addEventListener("scroll",g,{capture:!0,passive:!0})))}const k=w=>{!w||w===c.current.element||(h(),c.current.element=w,c.current.scrollContainers=fs(w),_())};return $u(g,!!r),ku(b),V(()=>{h(),_()},[r,g,b]),V(()=>h,[]),[k,s,v]}function ku(e){V(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function $u(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 fs(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,...fs(e.parentElement)]}const Su=["x","y","top","bottom","left","right","width","height"],Eu=(e,t)=>Su.every(r=>e[r]===t[r]),jt=({class:e,...t})=>d("button",{class:Ue("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"})]})}),Cu=25,An=We({instant:()=>{},smooth:()=>{}}),le={onSubmitSuccessFn$:We(()=>{}),isBotTyping$:We(!1),scrollToEnd:{instant:()=>An.value.instant(),smooth:()=>An.value.smooth()}},Ou=()=>{const e=L(null);ye(()=>{An.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*1.5&&e.current.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})}}},[e]);const t=se(()=>({send:async({message:r,signal:n,groupId:o})=>{if(await Ne(r).with({author:"bot",type:"text"},async i=>{if(n!=null&&n.aborted)throw new Rt;le.isBotTyping$.value=!0;const s=Math.min(Math.max(20,i.text.length),100)*Cu;await new Promise(a=>setTimeout(a,s,{signal:n})),le.isBotTyping$.value=!1}).otherwise(async()=>{}),n!=null&&n.aborted)throw new Rt;D.addMessage(r,o)},input:async({input:r,signal:n})=>{if(n!=null&&n.aborted)throw new Rt;return D.setInput(r),await new Promise(o=>{const i=s=>{if(n!=null&&n.aborted)throw new Rt;D.setInput(void 0),r.key&&D.setSubmission(r.key,s),o(s)};le.onSubmitSuccessFn$.value=i})}}),[]);return{chatRef:e,chatService:t}},Ut=({class:e,...t})=>d("button",{type:"button",class:Ue("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"]}),ps={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"]},_r=Object.keys(ps),Pu=e=>_r.reduce((t,r)=>{const n=ps[r],o=e.filter(i=>i.types.some(s=>n.includes(s))).map(i=>i.long_name).join(", ");return o&&(t[r]=o),t},{}),Au=document.createElement("div"),Iu=()=>se(()=>{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(Au);return{enabled:!0,getPredictions:async n=>{const{predictions:o}=await t.getPlacePredictions({input:n});return o.map(i=>({label:i.description,value:i.place_id}))},getPlaceDetails:async n=>await new Promise((i,s)=>r.getDetails({placeId:n,fields:["address_components"]},(a,c)=>c!==e.maps.places.PlacesServiceStatus.OK?s(c):a===null?s("ZERO_RESULTS"):i({ok:!0,place:a}))).catch(async i=>(console.error("Failed to get address details",i),{ok:!1}))}},[]),In=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"})]}),Dn={label:"Fill in manually",value:""},Du=({input:e,onSubmitSuccess:t})=>{const[r,n]=Y(""),[o,i]=Y(),[s,a]=Y([]),[c,u]=Y(),{enabled:p,getPredictions:l,getPlaceDetails:v}=Iu(),[b,g]=Y(p?"query":"manual"),h=se(()=>ns(_=>{if(ke(p,"Query state should not be enabled if Google Places isn't available"),n(_),_===""){a([]);return}l(_).then(k=>{a(k)})},500),[p,l]);switch(V(()=>{if(p&&!(c===void 0||c===""))return v(c).then(_=>{if(!_.ok||!_.place.address_components){i({});return}const k=Pu(_.place.address_components);i(k),g("details")}),()=>{i(void 0)}},[c,v,p]),b){case"query":return ke(p,"Query state should not be enabled if Google Places isn't available"),d(Tu,{input:e,onSkip:()=>t(null),onAddressSelect:_=>{u(_),g("loading")},onInputChange:h,suggestions:s,query:r});case"loading":return d(Tn,{input:e,onSubmitSuccess:t,addressFields:{},actions:d(In,{onClick:()=>{u(void 0),g("query")}})});case"details":return ke(o!==void 0),d(Tn,{input:e,onSubmitSuccess:t,addressFields:o,actions:d(In,{onClick:()=>{u(void 0),g("query")}})});case"manual":return d(Tn,{input:e,onSubmitSuccess:t,addressFields:{},actions:p?d(In,{onClick:()=>{u(void 0),g("query")}}):void 0})}},Tu=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:o,onInputChange:i})=>{const s=L(null);return ye(()=>{s.current&&(s.current.focus(),s.current.select())},[]),d(q,{children:[d("form",{noValidate:!0,onSubmit:a=>{a.preventDefault()},class:"flex flex-col justify-end gap-1 p-2.5",children:[d("input",{onChange:a=>{i(a.currentTarget.value)},ref:s,name:"address",id:"chat-address",autocomplete:"on",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(Ut,{class:"absolute right-3",onClick:t})]}),d("ul",{children:[r.map(a=>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(a.value)},children:[d("span",{class:"flex-grow",children:a.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"})})]})},a.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(Dn.value)},children:d("span",{class:"flex-grow",children:Dn.label})})},Dn.label)]})]})},Nu={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},Tn=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const o=L(null);return ye(()=>{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 s=new FormData(i.currentTarget),a=Object.fromEntries(s.entries());t(a)},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:_r.map((i,s)=>{const a=`isdk_${i}`,c=n.config.keys[i];return c?d(q,{children:[d("label",{for:a,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:Nu[i]}),d("div",{class:"flex flex-col items-stretch gap-1.5",children:[d("input",{autoFocus:s===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors focus:outline-none",name:c,id:a,defaultValue:e[i],required:!0}),s!==_r.length-1&&d("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"}),s===_r.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(jt,{class:"flex items-center justify-center"})]})]})},Nn=()=>{const e=L(null);return V(()=>{var t;(t=e.current)==null||t.focus()},[]),e},hs=["true","false"],Fu=sa(hs),Mu="answer",Lu=({input:e,onSubmitSuccess:t})=>{const r=Nn();return d("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const o=Ne(n).with({nativeEvent:{submitter:fe.select(fe.union(fe.instanceOf(HTMLButtonElement),fe.instanceOf(HTMLInputElement)))}},s=>s.value).otherwise(()=>{throw new Error("invalid form")}),i=Pt(Fu,o);t(i)},children:[d("div",{class:"flex items-center gap-2 p-2.5",children:hs.map((n,o)=>d("button",{ref:o===0?r:null,type:"submit",name:Mu,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(Ut,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},Fn=({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,Ru=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}),Vu=e=>e.reduce((t,r)=>t+r.sizeKb,0),Bu=xn("file"),vs=3,ju=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${n}$`),"");return d("div",{class:Ue("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:Lt(e.sizeKb)})]})},gs=({class:e,...t})=>d("li",{class:Ue("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),ms=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},Uu=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(ms(n.name).toLowerCase()))},zu=(e,t)=>{const r=ms(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},Hu=({input:e,onSubmitSuccess:t})=>{var p;const r=(p=D.current$.value.flow)==null?void 0:p.data.submissions[e.key],[n,o]=Y(Bu(r)&&r.value!==null?r.value:[]),[i,s]=Y(),a=n.length-vs,c=Vu(n),u=Nn();return d("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:l=>(l.preventDefault(),s(void 0),n.length===0?s({type:"required",message:"Please select a file"}):e.config.extensions.length>0&&!Uu({allowedExtensions:e.config.extensions,files:n})?s({type:"validate",message:`Please upload ${e.config.extensions.join(", ")} files only`}):e.config.fileSizeLimitKib&&c>e.config.fileSizeLimitKib?s({type:"max",message:`File size exceeds limit of ${Lt(e.config.fileSizeLimitKib)}`}):e.config.allowMultiple===!1&&n.length>1?s({type:"invalid",message:"Only one file is allowed"}):t(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(q,{children:[d("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,vs).map(l=>{const v=l.name.split(".").pop(),b=l.name.replace(new RegExp(`.${v}$`),"");return d(gs,{class:"flex overflow-hidden",children:[d("span",{class:"block truncate",children:b}),d("span",{children:[".",v]})]})}),a>0?d(gs,{children:["+",a," file",a!==1?"s":""]}):null]}),d("p",{class:"text-neutral-11 text-xs",children:[Lt(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 ",Lt(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=>{ke(l.target instanceof HTMLInputElement);const v=l.target.files?Array.from(l.target.files):[],b=await Promise.allSettled(v.map(async h=>{const _=await Ru(h);return{name:zu(h.name,42),data:_,sizeKb:h.size/1e3}}));if(b.some(({status:h})=>h==="rejected"))return s({type:"invalid",message:"Invalid file"});const g=b.map(h=>h.status==="fulfilled"?h.value:null).filter(Boolean);o(g)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),d("div",{class:"flex h-full flex-col items-center gap-2",children:[d(jt,{disabled:n.length===0}),e.config.optional&&d(Ut,{onClick:()=>t(null)})]})]}),i&&d(Fn,{error:i})]})};var zt=e=>e.type==="checkbox",_t=e=>e instanceof Date,ce=e=>e==null;const bs=e=>typeof e=="object";var J=e=>!ce(e)&&!Array.isArray(e)&&bs(e)&&!_t(e),Wu=e=>J(e)&&e.target?zt(e.target)?e.target.checked:e.target.value:e,Ku=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qu=(e,t)=>e.has(Ku(t)),Yu=e=>{const t=e.constructor&&e.constructor.prototype;return J(t)&&t.hasOwnProperty("isPrototypeOf")},Mn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Fe(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Mn&&(e instanceof Blob||e instanceof FileList))&&(r||J(e)))if(t=r?[]:{},!r&&!Yu(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Fe(e[n]));else return e;return t}var Ht=e=>Array.isArray(e)?e.filter(Boolean):[],Z=e=>e===void 0,E=(e,t,r)=>{if(!t||!J(e))return r;const n=Ht(t.split(/[,[\].]+?/)).reduce((o,i)=>ce(o)?o:o[i],e);return Z(n)||n===e?Z(e[t])?r:e[t]:n},Ye=e=>typeof e=="boolean";const ys={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},$e={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Me={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};xe.createContext(null);var Gu=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==$e.all&&(t._proxyFormState[s]=!n||$e.all),r&&(r[s]=!0),e[s]}});return o},we=e=>J(e)&&!Object.keys(e).length,Zu=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return we(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!n||$e.all))},Ln=e=>Array.isArray(e)?e:[e];function Qu(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 Oe=e=>typeof e=="string",Xu=(e,t,r,n,o)=>Oe(e)?(n&&t.watch.add(e),E(r,e,o)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),E(r,i))):(n&&(t.watchAll=!0),r),Rn=e=>/^\w*$/.test(e),ws=e=>Ht(e.replace(/["|']|\]/g,"").split(/\.|\[/));function U(e,t,r){let n=-1;const o=Rn(t)?[t]:ws(t),i=o.length,s=i-1;for(;++n<i;){const a=o[n];let c=r;if(n!==s){const u=e[a];c=J(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}e[a]=c,e=e[a]}return e}var _s=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},xs=e=>({isOnSubmit:!e||e===$e.onSubmit,isOnBlur:e===$e.onBlur,isOnChange:e===$e.onChange,isOnAll:e===$e.all,isOnTouch:e===$e.onTouched}),ks=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const xr=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const i=E(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!n)break;if(s.ref&&t(s.ref,s.name)&&!n)break}else J(a)&&xr(a,t)}}};var Ju=(e,t,r)=>{const n=Ht(E(e,r));return U(n,"root",t[r]),U(e,r,n),e},Vn=e=>e.type==="file",Ge=e=>typeof e=="function",kr=e=>{if(!Mn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$r=e=>Oe(e),Bn=e=>e.type==="radio",Sr=e=>e instanceof RegExp;const $s={value:!1,isValid:!1},Ss={value:!0,isValid:!0};var Es=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Z(e[0].attributes.value)?Z(e[0].value)||e[0].value===""?Ss:{value:e[0].value,isValid:!0}:Ss:$s}return $s};const Cs={isValid:!1,value:null};var Os=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Cs):Cs;function Ps(e,t,r="validate"){if($r(e)||Array.isArray(e)&&e.every($r)||Ye(e)&&!e)return{type:r,message:$r(e)?e:"",ref:t}}var xt=e=>J(e)&&!Sr(e)?e:{value:e,message:""},As=async(e,t,r,n,o)=>{const{ref:i,refs:s,required:a,maxLength:c,minLength:u,min:p,max:l,pattern:v,validate:b,name:g,valueAsNumber:h,mount:_,disabled:k}=e._f,w=E(t,g);if(!_||k)return{};const P=s?s[0]:i,I=B=>{n&&P.reportValidity&&(P.setCustomValidity(Ye(B)?"":B||""),P.reportValidity())},O={},z=Bn(i),W=zt(i),N=z||W,F=(h||Vn(i))&&Z(i.value)&&Z(w)||kr(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,ie=_s.bind(null,g,r,O),ee=(B,M,Q,pe=Me.maxLength,_e=Me.minLength)=>{const Pe=B?M:Q;O[g]={type:B?pe:_e,message:Pe,ref:i,...ie(B?pe:_e,Pe)}};if(o?!Array.isArray(w)||!w.length:a&&(!N&&(F||ce(w))||Ye(w)&&!w||W&&!Es(s).isValid||z&&!Os(s).isValid)){const{value:B,message:M}=$r(a)?{value:!!a,message:a}:xt(a);if(B&&(O[g]={type:Me.required,message:M,ref:P,...ie(Me.required,M)},!r))return I(M),O}if(!F&&(!ce(p)||!ce(l))){let B,M;const Q=xt(l),pe=xt(p);if(!ce(w)&&!isNaN(w)){const _e=i.valueAsNumber||w&&+w;ce(Q.value)||(B=_e>Q.value),ce(pe.value)||(M=_e<pe.value)}else{const _e=i.valueAsDate||new Date(w),Pe=Or=>new Date(new Date().toDateString()+" "+Or),at=i.type=="time",Kt=i.type=="week";Oe(Q.value)&&w&&(B=at?Pe(w)>Pe(Q.value):Kt?w>Q.value:_e>new Date(Q.value)),Oe(pe.value)&&w&&(M=at?Pe(w)<Pe(pe.value):Kt?w<pe.value:_e<new Date(pe.value))}if((B||M)&&(ee(!!B,Q.message,pe.message,Me.max,Me.min),!r))return I(O[g].message),O}if((c||u)&&!F&&(Oe(w)||o&&Array.isArray(w))){const B=xt(c),M=xt(u),Q=!ce(B.value)&&w.length>+B.value,pe=!ce(M.value)&&w.length<+M.value;if((Q||pe)&&(ee(Q,B.message,M.message),!r))return I(O[g].message),O}if(v&&!F&&Oe(w)){const{value:B,message:M}=xt(v);if(Sr(B)&&!w.match(B)&&(O[g]={type:Me.pattern,message:M,ref:i,...ie(Me.pattern,M)},!r))return I(M),O}if(b){if(Ge(b)){const B=await b(w,t),M=Ps(B,P);if(M&&(O[g]={...M,...ie(Me.validate,M.message)},!r))return I(M.message),O}else if(J(b)){let B={};for(const M in b){if(!we(B)&&!r)break;const Q=Ps(await b[M](w,t),P,M);Q&&(B={...Q,...ie(M,Q.message)},I(Q.message),r&&(O[g]=B))}if(!we(B)&&(O[g]={ref:P,...B},!r))return O}}return I(!0),O};function ed(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Z(e)?n++:e[t[n++]];return e}function td(e){for(const t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function ne(e,t){const r=Array.isArray(t)?t:Rn(t)?[t]:ws(t),n=r.length===1?e:ed(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(J(n)&&we(n)||Array.isArray(n)&&td(n))&&ne(e,r.slice(0,-1)),e}function jn(){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 Er=e=>ce(e)||!bs(e);function st(e,t){if(Er(e)||Er(t))return e===t;if(_t(e)&&_t(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 s=t[o];if(_t(i)&&_t(s)||J(i)&&J(s)||Array.isArray(i)&&Array.isArray(s)?!st(i,s):i!==s)return!1}}return!0}var Is=e=>e.type==="select-multiple",rd=e=>Bn(e)||zt(e),Un=e=>kr(e)&&e.isConnected,Ds=e=>{for(const t in e)if(Ge(e[t]))return!0;return!1};function Cr(e,t={}){const r=Array.isArray(e);if(J(e)||r)for(const n in e)Array.isArray(e[n])||J(e[n])&&!Ds(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Cr(e[n],t[n])):ce(e[n])||(t[n]=!0);return t}function Ts(e,t,r){const n=Array.isArray(e);if(J(e)||n)for(const o in e)Array.isArray(e[o])||J(e[o])&&!Ds(e[o])?Z(t)||Er(r[o])?r[o]=Array.isArray(e[o])?Cr(e[o],[]):{...Cr(e[o])}:Ts(e[o],ce(t)?{}:t[o],r[o]):r[o]=!st(e[o],t[o]);return r}var zn=(e,t)=>Ts(e,t,Cr(t)),Ns=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Z(e)?e:t?e===""?NaN:e&&+e:r&&Oe(e)?new Date(e):n?n(e):e;function Hn(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Vn(t)?t.files:Bn(t)?Os(e.refs).value:Is(t)?[...t.selectedOptions].map(({value:r})=>r):zt(t)?Es(e.refs).value:Ns(Z(t.value)?e.ref.value:t.value,e)}var nd=(e,t,r,n)=>{const o={};for(const i of e){const s=E(t,i);s&&U(o,i,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Wt=e=>Z(e)?e:Sr(e)?e.source:J(e)?Sr(e.value)?e.value.source:e.value:e,id=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Fs(e,t,r){const n=E(e,r);if(n||Rn(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const i=o.join("."),s=E(t,i),a=E(e,i);if(s&&!Array.isArray(s)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:r}}var od=(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,sd=(e,t)=>!Ht(E(e,t)).length&&ne(e,t);const ad={mode:$e.onSubmit,reValidateMode:$e.onChange,shouldFocusError:!0};function ld(e={},t){let r={...ad,...e},n={submitCount:0,isDirty:!1,isLoading:Ge(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=J(r.defaultValues)||J(r.values)?Fe(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:Fe(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,p=0;const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:jn(),array:jn(),state:jn()},b=e.resetOptions&&e.resetOptions.keepDirtyValues,g=xs(r.mode),h=xs(r.reValidateMode),_=r.criteriaMode===$e.all,k=f=>m=>{clearTimeout(p),p=setTimeout(f,m)},w=async f=>{if(l.isValid||f){const m=r.resolver?we((await F()).errors):await ee(o,!0);m!==n.isValid&&v.state.next({isValid:m})}},P=f=>l.isValidating&&v.state.next({isValidating:f}),I=(f,m=[],y,C,$=!0,x=!0)=>{if(C&&y){if(a.action=!0,x&&Array.isArray(E(o,f))){const A=y(E(o,f),C.argA,C.argB);$&&U(o,f,A)}if(x&&Array.isArray(E(n.errors,f))){const A=y(E(n.errors,f),C.argA,C.argB);$&&U(n.errors,f,A),sd(n.errors,f)}if(l.touchedFields&&x&&Array.isArray(E(n.touchedFields,f))){const A=y(E(n.touchedFields,f),C.argA,C.argB);$&&U(n.touchedFields,f,A)}l.dirtyFields&&(n.dirtyFields=zn(i,s)),v.state.next({name:f,isDirty:M(f,m),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else U(s,f,m)},O=(f,m)=>{U(n.errors,f,m),v.state.next({errors:n.errors})},z=(f,m,y,C)=>{const $=E(o,f);if($){const x=E(s,f,Z(y)?E(i,f):y);Z(x)||C&&C.defaultChecked||m?U(s,f,m?x:Hn($._f)):_e(f,x),a.mount&&w()}},W=(f,m,y,C,$)=>{let x=!1,A=!1;const H={name:f};if(!y||C){l.isDirty&&(A=n.isDirty,n.isDirty=H.isDirty=M(),x=A!==H.isDirty);const X=st(E(i,f),m);A=E(n.dirtyFields,f),X?ne(n.dirtyFields,f):U(n.dirtyFields,f,!0),H.dirtyFields=n.dirtyFields,x=x||l.dirtyFields&&A!==!X}if(y){const X=E(n.touchedFields,f);X||(U(n.touchedFields,f,y),H.touchedFields=n.touchedFields,x=x||l.touchedFields&&X!==y)}return x&&$&&v.state.next(H),x?H:{}},N=(f,m,y,C)=>{const $=E(n.errors,f),x=l.isValid&&Ye(m)&&n.isValid!==m;if(e.delayError&&y?(u=k(()=>O(f,y)),u(e.delayError)):(clearTimeout(p),u=null,y?U(n.errors,f,y):ne(n.errors,f)),(y?!st($,y):$)||!we(C)||x){const A={...C,...x&&Ye(m)?{isValid:m}:{},errors:n.errors,name:f};n={...n,...A},v.state.next(A)}P(!1)},F=async f=>r.resolver(s,r.context,nd(f||c.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),ie=async f=>{const{errors:m}=await F(f);if(f)for(const y of f){const C=E(m,y);C?U(n.errors,y,C):ne(n.errors,y)}else n.errors=m;return m},ee=async(f,m,y={valid:!0})=>{for(const C in f){const $=f[C];if($){const{_f:x,...A}=$;if(x){const H=c.array.has(x.name),X=await As($,s,_,r.shouldUseNativeValidation&&!m,H);if(X[x.name]&&(y.valid=!1,m))break;!m&&(E(X,x.name)?H?Ju(n.errors,X,x.name):U(n.errors,x.name,X[x.name]):ne(n.errors,x.name))}A&&await ee(A,m,y)}}return y.valid},B=()=>{for(const f of c.unMount){const m=E(o,f);m&&(m._f.refs?m._f.refs.every(y=>!Un(y)):!Un(m._f.ref))&&Kn(f)}c.unMount=new Set},M=(f,m)=>(f&&m&&U(s,f,m),!st(Vs(),i)),Q=(f,m,y)=>Xu(f,c,{...a.mount?s:Z(m)?i:Oe(f)?{[f]:m}:m},y,m),pe=f=>Ht(E(a.mount?s:i,f,e.shouldUnregister?E(i,f,[]):[])),_e=(f,m,y={})=>{const C=E(o,f);let $=m;if(C){const x=C._f;x&&(!x.disabled&&U(s,f,Ns(m,x)),$=kr(x.ref)&&ce(m)?"":m,Is(x.ref)?[...x.ref.options].forEach(A=>A.selected=$.includes(A.value)):x.refs?zt(x.ref)?x.refs.length>1?x.refs.forEach(A=>(!A.defaultChecked||!A.disabled)&&(A.checked=Array.isArray($)?!!$.find(H=>H===A.value):$===A.value)):x.refs[0]&&(x.refs[0].checked=!!$):x.refs.forEach(A=>A.checked=A.value===$):Vn(x.ref)?x.ref.value="":(x.ref.value=$,x.ref.type||v.values.next({name:f,values:{...s}})))}(y.shouldDirty||y.shouldTouch)&&W(f,$,y.shouldTouch,y.shouldDirty,!0),y.shouldValidate&&Wn(f)},Pe=(f,m,y)=>{for(const C in m){const $=m[C],x=`${f}.${C}`,A=E(o,x);(c.array.has(f)||!Er($)||A&&!A._f)&&!_t($)?Pe(x,$,y):_e(x,$,y)}},at=(f,m,y={})=>{const C=E(o,f),$=c.array.has(f),x=Fe(m);U(s,f,x),$?(v.array.next({name:f,values:{...s}}),(l.isDirty||l.dirtyFields)&&y.shouldDirty&&v.state.next({name:f,dirtyFields:zn(i,s),isDirty:M(f,x)})):C&&!C._f&&!ce(x)?Pe(f,x,y):_e(f,x,y),ks(f,c)&&v.state.next({...n}),v.values.next({name:f,values:{...s}}),!a.mount&&t()},Kt=async f=>{const m=f.target;let y=m.name,C=!0;const $=E(o,y),x=()=>m.type?Hn($._f):Wu(f),A=H=>{C=Number.isNaN(H)||H===E(s,y,H)};if($){let H,X;const Pr=x(),$t=f.type===ys.BLUR||f.type===ys.FOCUS_OUT,Ud=!id($._f)&&!r.resolver&&!E(n.errors,y)&&!$._f.deps||od($t,E(n.touchedFields,y),n.isSubmitted,h,g),Yn=ks(y,c,$t);U(s,y,Pr),$t?($._f.onBlur&&$._f.onBlur(f),u&&u(0)):$._f.onChange&&$._f.onChange(f);const Gn=W(y,Pr,$t,!1),zd=!we(Gn)||Yn;if(!$t&&v.values.next({name:y,type:f.type,values:{...s}}),Ud)return l.isValid&&w(),zd&&v.state.next({name:y,...Yn?{}:Gn});if(!$t&&Yn&&v.state.next({...n}),P(!0),r.resolver){const{errors:qs}=await F([y]);if(A(Pr),C){const Hd=Fs(n.errors,o,y),Ys=Fs(qs,o,Hd.name||y);H=Ys.error,y=Ys.name,X=we(qs)}}else H=(await As($,s,_,r.shouldUseNativeValidation))[y],A(Pr),C&&(H?X=!1:l.isValid&&(X=await ee(o,!0)));C&&($._f.deps&&Wn($._f.deps),N(y,X,H,Gn))}},Or=(f,m)=>{if(E(n.errors,m)&&f.focus)return f.focus(),1},Wn=async(f,m={})=>{let y,C;const $=Ln(f);if(P(!0),r.resolver){const x=await ie(Z(f)?f:$);y=we(x),C=f?!$.some(A=>E(x,A)):y}else f?(C=(await Promise.all($.map(async x=>{const A=E(o,x);return await ee(A&&A._f?{[x]:A}:A)}))).every(Boolean),!(!C&&!n.isValid)&&w()):C=y=await ee(o);return v.state.next({...!Oe(f)||l.isValid&&y!==n.isValid?{}:{name:f},...r.resolver||!f?{isValid:y}:{},errors:n.errors,isValidating:!1}),m.shouldFocus&&!C&&xr(o,Or,f?$:c.mount),C},Vs=f=>{const m={...i,...a.mount?s:{}};return Z(f)?m:Oe(f)?E(m,f):f.map(y=>E(m,y))},Bs=(f,m)=>({invalid:!!E((m||n).errors,f),isDirty:!!E((m||n).dirtyFields,f),isTouched:!!E((m||n).touchedFields,f),error:E((m||n).errors,f)}),Rd=f=>{f&&Ln(f).forEach(m=>ne(n.errors,m)),v.state.next({errors:f?n.errors:{}})},js=(f,m,y)=>{const C=(E(o,f,{_f:{}})._f||{}).ref;U(n.errors,f,{...m,ref:C}),v.state.next({name:f,errors:n.errors,isValid:!1}),y&&y.shouldFocus&&C&&C.focus&&C.focus()},Vd=(f,m)=>Ge(f)?v.values.subscribe({next:y=>f(Q(void 0,m),y)}):Q(f,m,!0),Kn=(f,m={})=>{for(const y of f?Ln(f):c.mount)c.mount.delete(y),c.array.delete(y),m.keepValue||(ne(o,y),ne(s,y)),!m.keepError&&ne(n.errors,y),!m.keepDirty&&ne(n.dirtyFields,y),!m.keepTouched&&ne(n.touchedFields,y),!r.shouldUnregister&&!m.keepDefaultValue&&ne(i,y);v.values.next({values:{...s}}),v.state.next({...n,...m.keepDirty?{isDirty:M()}:{}}),!m.keepIsValid&&w()},Us=({disabled:f,name:m,field:y,fields:C,value:$})=>{if(Ye(f)){const x=f?void 0:Z($)?Hn(y?y._f:E(C,m)._f):$;U(s,m,x),W(m,x,!1,!1,!0)}},qn=(f,m={})=>{let y=E(o,f);const C=Ye(m.disabled);return U(o,f,{...y||{},_f:{...y&&y._f?y._f:{ref:{name:f}},name:f,mount:!0,...m}}),c.mount.add(f),y?Us({field:y,disabled:m.disabled,name:f}):z(f,!0,m.value),{...C?{disabled:m.disabled}:{},...r.progressive?{required:!!m.required,min:Wt(m.min),max:Wt(m.max),minLength:Wt(m.minLength),maxLength:Wt(m.maxLength),pattern:Wt(m.pattern)}:{},name:f,onChange:Kt,onBlur:Kt,ref:$=>{if($){qn(f,m),y=E(o,f);const x=Z($.value)&&$.querySelectorAll&&$.querySelectorAll("input,select,textarea")[0]||$,A=rd(x),H=y._f.refs||[];if(A?H.find(X=>X===x):x===y._f.ref)return;U(o,f,{_f:{...y._f,...A?{refs:[...H.filter(Un),x,...Array.isArray(E(i,f))?[{}]:[]],ref:{type:x.type,name:f}}:{ref:x}}}),z(f,!1,void 0,x)}else y=E(o,f,{}),y._f&&(y._f.mount=!1),(r.shouldUnregister||m.shouldUnregister)&&!(qu(c.array,f)&&a.action)&&c.unMount.add(f)}}},zs=()=>r.shouldFocusError&&xr(o,Or,c.mount),Bd=f=>{Ye(f)&&(v.state.next({disabled:f}),xr(o,m=>{m.disabled=f},0,!1))},Hs=(f,m)=>async y=>{y&&(y.preventDefault&&y.preventDefault(),y.persist&&y.persist());let C=Fe(s);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:$,values:x}=await F();n.errors=$,C=x}else await ee(o);ne(n.errors,"root"),we(n.errors)?(v.state.next({errors:{}}),await f(C,y)):(m&&await m({...n.errors},y),zs(),setTimeout(zs)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:we(n.errors),submitCount:n.submitCount+1,errors:n.errors})},jd=(f,m={})=>{E(o,f)&&(Z(m.defaultValue)?at(f,E(i,f)):(at(f,m.defaultValue),U(i,f,m.defaultValue)),m.keepTouched||ne(n.touchedFields,f),m.keepDirty||(ne(n.dirtyFields,f),n.isDirty=m.defaultValue?M(f,E(i,f)):M()),m.keepError||(ne(n.errors,f),l.isValid&&w()),v.state.next({...n}))},Ws=(f,m={})=>{const y=f?Fe(f):i,C=Fe(y),$=f&&!we(f)?C:i;if(m.keepDefaultValues||(i=y),!m.keepValues){if(m.keepDirtyValues||b)for(const x of c.mount)E(n.dirtyFields,x)?U($,x,E(s,x)):at(x,E($,x));else{if(Mn&&Z(f))for(const x of c.mount){const A=E(o,x);if(A&&A._f){const H=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(kr(H)){const X=H.closest("form");if(X){X.reset();break}}}}o={}}s=e.shouldUnregister?m.keepDefaultValues?Fe(i):{}:Fe($),v.array.next({values:{...$}}),v.values.next({values:{...$}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!l.isValid||!!m.keepIsValid,a.watch=!!e.shouldUnregister,v.state.next({submitCount:m.keepSubmitCount?n.submitCount:0,isDirty:m.keepDirty?n.isDirty:!!(m.keepDefaultValues&&!st(f,i)),isSubmitted:m.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:m.keepDirtyValues?n.dirtyFields:m.keepDefaultValues&&f?zn(i,f):{},touchedFields:m.keepTouched?n.touchedFields:{},errors:m.keepErrors?n.errors:{},isSubmitSuccessful:m.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ks=(f,m)=>Ws(Ge(f)?f(s):f,m);return{control:{register:qn,unregister:Kn,getFieldState:Bs,handleSubmit:Hs,setError:js,_executeSchema:F,_getWatch:Q,_getDirty:M,_updateValid:w,_removeUnmounted:B,_updateFieldArray:I,_updateDisabledField:Us,_getFieldArray:pe,_reset:Ws,_resetDefaultValues:()=>Ge(r.defaultValues)&&r.defaultValues().then(f=>{Ks(f,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:f=>{n={...n,...f}},_disableForm:Bd,_subjects:v,_proxyFormState:l,get _fields(){return o},get _formValues(){return s},get _state(){return a},set _state(f){a=f},get _defaultValues(){return i},get _names(){return c},set _names(f){c=f},get _formState(){return n},set _formState(f){n=f},get _options(){return r},set _options(f){r={...r,...f}}},trigger:Wn,register:qn,handleSubmit:Hs,watch:Vd,setValue:at,getValues:Vs,reset:Ks,resetField:jd,clearErrors:Rd,unregister:Kn,setError:js,setFocus:(f,m={})=>{const y=E(o,f),C=y&&y._f;if(C){const $=C.refs?C.refs[0]:C.ref;$.focus&&($.focus(),m.shouldSelect&&$.select())}},getFieldState:Bs}}function Ms(e={}){const t=xe.useRef(),r=xe.useRef(),[n,o]=xe.useState({isDirty:!1,isValidating:!1,isLoading:Ge(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Ge(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...ld(e,()=>o(s=>({...s}))),formState:n});const i=t.current.control;return i._options=e,Qu({subject:i._subjects.state,next:s=>{Zu(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),xe.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),xe.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==n.isDirty&&i._subjects.state.next({isDirty:s})}},[i,n.isDirty]),xe.useEffect(()=>{e.values&&!st(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=Gu(n,i),t.current}var Ls=function(e,t,r){if(e&&"reportValidity"in e){var n=E(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},cd=function(e,t){var r=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?Ls(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return Ls(s,o,e)})};for(var n in t.fields)r(n)},ud=function(e,t){t.shouldUseNativeValidation&&cd(e,t);var r={};for(var n in e){var o=E(t.fields,n),i=Object.assign(e[n]||{},{ref:o&&o.ref});if(fd(t.names||Object.keys(e),n)){var s=Object.assign({},dd(E(r,n)));U(s,"root",i),U(r,n,s)}else U(r,n,i)}return r},dd=function(e){return Array.isArray(e)?e.filter(Boolean):[]},fd=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},pd=function(e,t){for(var r={};e.issues.length;){var n=e.issues[0];if(n.path){var o=n.path.map(function(a){return a.key}).join(".");if(r[o]||(r[o]={message:n.message,type:n.validation}),t){var i=r[o].types,s=i&&i[n.validation];r[o]=_s(o,t,r,n.validation,s?[].concat(s,n.message):n.message)}e.issues.shift()}}return r},Rs=function(e,t,r){return r===void 0&&(r={}),function(n,o,i){try{return Promise.resolve(function(s,a){try{var c=function(){function u(l){return{values:r.raw?n:l,errors:{}}}var p=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return r.mode==="sync"?u(Pt(e,n,p)):Promise.resolve(ca(e,n,p)).then(u)}()}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(s){if(s instanceof Nr)return{values:{},errors:ud(pd(s,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}};const hd=27,vd=12,gd=10,md=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},bd=xn("multiple-choice"),yd=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Rs(Be({checked:wi(yi(oa()),r=>Object.entries(r).filter(([n,o])=>o).map(([n,o])=>n),[At(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),_i(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},wd=({input:e,onSubmitSuccess:t})=>{var c,u;const r=e.key?(c=D.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:s}}=Ms({defaultValues:{checked:n?{}:bd(r)?Object.fromEntries(r.value.map(p=>[p,!0])):{}},resolver:yd(e.config)}),a=Nn();return d("form",{noValidate:!0,class:"flex flex-col gap-1 pr-2.5",onChange:p=>{n&&md(p.currentTarget)},onSubmit:i(p=>{const l=p.checked;t(l)}),children:[d("div",{class:"flex items-center gap-1",children:[d("ul",{style:{maxHeight:6.5*hd+5*vd+2*gd},class:Ue("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,l)=>{const v=`checked.${p.value}`,{ref:b,...g}=o(v);return d("li",{class:"relative",children:[d("input",{autoFocus:l===0,ref:h=>{h&&l===0&&(a.current=h),b(h)},id:v,...g,class:"peer sr-only h-full",type:"checkbox"}),d("label",{class:"bg-lowest peer-focus-visible:ring-accent-7 active:outline-neutral-10 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 block rounded-2xl px-2.5 py-1 outline outline-2 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4 peer-focus-visible:ring-offset-2",htmlFor:v,children:p.label})]},p.value)})}),d("div",{class:"flex flex-col items-center gap-2",children:[!n&&d(jt,{}),e.config.minSelected===0&&d(Ut,{type:"button",onClick:()=>t([])})]})]}),d("div",{class:"px-1",children:d(Fn,{error:(u=s.checked)==null?void 0:u.root})})]})},_d=({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"})]})]})})}),kt={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"},xd=be(kt.phone,[fa(/^\+?[0-9 -]+$/,kt.phone)]),kd={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},$d=xn("text"),Sd=e=>{const t=`Please enter no more than ${e.maxChars} characters`;return Rs(Be({text:{email:be(kt.email,[da(kt.email),At(e.maxChars??1/0,t)]),phone:wi(xd,r=>r.replace(/[^0-9]/g,""),[At(e.maxChars??1/0,t)]),text:be([_i(1,kt.empty),At(e.maxChars??1/0,t)]),url:be([pa(kt.url),At(e.maxChars??1/0,t)])}[e.format]}))},Ed=({input:e,onSubmitSuccess:t})=>{var p;const r=e.key?(p=D.current$.value.flow)==null?void 0:p.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:o,handleSubmit:i,formState:{errors:s}}=Ms({defaultValues:{text:n||($d(r)?r.value:"")},resolver:Sd(e.config)}),{ref:a,...c}=o("text",{required:!e.config.optional}),u=L();return ye(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d(q,{children:d("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:i(l=>{t(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,...kd[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:l=>{l&&(u.current=l),a(l)},class:"outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest w-full rounded-full px-3 py-1 text-base outline outline-2 transition-all",placeholder:e.config.placeholder}),e.config.optional&&d(Ut,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(jt,{})]}),d(Fn,{error:s.text})]})})},Cd=()=>{var i;const e=(i=D.current$.value.flow)==null?void 0:i.data.currentInput,[t,r]=xu(),n=L(null);D.inputHeight$.value=r.height,V(()=>{const s=n.current;if(s)return s.addEventListener("transitionstart",le.scrollToEnd.smooth),s.addEventListener("transitioncancel",le.scrollToEnd.smooth),s.addEventListener("transitionend",le.scrollToEnd.smooth),()=>{s.removeEventListener("transitionstart",le.scrollToEnd.smooth),s.removeEventListener("transitioncancel",le.scrollToEnd.smooth),s.removeEventListener("transitionend",le.scrollToEnd.smooth)}},[]);const o=s=>a=>le.onSubmitSuccessFn$.value({type:s,value:a});return 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:Ne({input:e}).with({input:fe.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(jt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},s=>d(Ed,{onSubmitSuccess:o(s.input.type),...s})).with({input:{type:"multiple-choice"}},s=>d(wd,{onSubmitSuccess:o(s.input.type),...s})).with({input:{type:"boolean"}},s=>d(Lu,{onSubmitSuccess:o(s.input.type),...s})).with({input:{type:"file"}},s=>d(Hu,{onSubmitSuccess:o(s.input.type),...s})).with({input:{type:"submit"}},s=>d(_d,{onSubmitSuccess:o(s.input.type),...s})).with({input:{type:"address"}},s=>d(Du,{onSubmitSuccess:o(s.input.type),...s})).exhaustive()})})},Od=on("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"}}),Pd=({children:e,className:t,animate:r,side:n,...o})=>d("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Od({className:t,side:n,animate:r}),...o,children:e}),Ad=({className:e,...t})=>(V(()=>{le.scrollToEnd.smooth()}),d("div",{"aria-hidden":!0,children:le.isBotTyping$.value===!0?d("div",{"aria-label":"Typing…",class:Ue("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})),Id={bot:"left",user:"right"},Dd=on("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]"}}}),Td=({lastSentMessageFooter:e})=>{var r;const t=((r=D.current$.value.flow)==null?void 0:r.data.messages)??[];return V(()=>{le.scrollToEnd.smooth()},[t.length]),d("ol",{"aria-label":"Chat messages",class:"flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[t.map((n,o)=>d(q,{children:d("li",{class:"flex",children:Ne(n).with({type:"system"},i=>d("p",{class:Dd({variant:i.variant}),children:i.text})).with({type:"text",author:fe.union("bot","user")},i=>{const s=i.author==="user"&&!t.slice(o+1).some(c=>c.type==="text"&&c.author==="user"),a=o===t.length-1;return d(Pd,{animate:a,side:Id[i.author],children:[i.text,s?e:null]},o)}).with({type:"link"},i=>d("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:d("a",{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:i.href,children:[i.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"})})]})})).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(ju,{class:i.author==="bot"?"":"ml-auto",file:{name:i.fileName,sizeKb:i.fileSizeKb}})).exhaustive()})},o)),d(Ad,{},"typing")]})},Nd=({logger:e,apiClient:t,analytics:r})=>{const{flow:n}=D.current$.value;ke(n,"Flow is required to exist to show chatbot body");const o=D.viewState$.value,{chatRef:i,chatService:s}=Ou(),[a,c]=Y();return ye(()=>{o==="maximised"&&le.scrollToEnd.instant()},[o]),ye(()=>{const{state:u,flow:p}=D.current$.peek();if(u!=="loaded")throw new Error(pc.invalid_state);let l=p.data.nodeHistory.at(-1);if(le.scrollToEnd.instant(),D.setInput(void 0),p.data.isFinished)return;l===void 0?(l=rs(n.nodes).id,D.setCurrentNodeId(l),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})):D.removeMessagesSentByNodeIds([l]);const{interpret:v,abort:b,undo:g}=ou({context:n.context,analytics:r,apiClient:t,logger:e,flow:n.nodes,chatService:s,getSubmissions:()=>{var h;return(h=D.current$.peek().flow)==null?void 0:h.data.submissions},onInterpret:(h,_)=>{const k=D.current$.peek().flow;ke(k),_&&(k.data.sequence=k.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:h.id,sequence:k.data.sequence,flow_session_id:k.data.flowSessionId},customProperties:n.context})),D.setCurrentNodeId(h.id)},onFlowEnd:async()=>{D.markAsFinished();const h=D.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 c(()=>g),v(l),b},[r,t,s,e,n]),d(q,{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:D.inputHeight$.value},children:d(Td,{lastSentMessageFooter:n.data.isFinished||!a?null:d(Md,{undoFn:a})})}),d(Cd,{})]})},Fd=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"):[],Md=({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}=D.current$.peek();ke(t);const{removed:r}=e(t.data.nodeHistory),n=t.data.nodeHistory.splice(-r);n.length!==0&&(D.removeMessagesSentByNodeIds(n),D.setInput(void 0),n.pop(),n.map(o=>t.nodes.find(i=>i.id===o)).filter(Boolean).flatMap(Fd).forEach(o=>delete t.data.submissions[o]),D.current$.value={...D.current$.value})},children:"Undo"})}),Ld=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:Nd},Symbol.toStringTag,{value:"Module"}))})();
45
+ }`},iu=({_internal_domManager:e=Gc(),theme:t})=>Ze(({apiClient:r,logger:n,analytics:o})=>{let i=!1;const a=()=>{if(typeof window>"u")return;const s=[D("style",{id:"inploi-chatbot-styles"},qc),D("style",{id:"inploi-chatbot-theme"},nu(t))],c=e.getOrCreateChatbotElement();ct(D(q,{},[s,D(Uc,{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=>r.fetch(`/flow/job/${s}`).then(c=>{const u=Pt(Wc,c);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(c=>{const u=Pt(Hc,c);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 c=>{const u=Pt(Kc,c);T.startFlow(u)}).catch(c=>{const u=c instanceof Error?c.message:"An error occurred";T.current$.value={state:"error",error:u}})):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=iu;const ca=({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 ca({node:n,nodes:t,stopWhen:r})},ou=({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=ca({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)},au=({flow:e,analytics:t,logger:r,context:n,apiClient:o,getSubmissions:i,chatService:a,onFlowEnd:s,onInterpret:c})=>{let u=new AbortController;const p=async(l,v)=>{const b=i();c==null||c(l,v);try{await su({analytics:t,logger:r,apiClient:o,context:n,node:l,submissions:b,chat:{sendMessage:async g=>a.send({groupId:l.id,message:g,signal:u.signal}),userInput:async g=>a.input({input:g,signal:u.signal})},next:g=>{const h=g?e.find(_=>_.id===g):ou({childNode:l,nodes:e});return h?p(h,l):s==null?void 0:s(l)},end:()=>s==null?void 0:s(l)})}catch(g){if(g instanceof Bt)return;throw g}};return{interpret:async l=>{const v=e.find(b=>b.id===l)??ra(e);return p(v)},undo:l=>{let v=1;const b=e.find(h=>h.id===l[l.length-1]);for(let h=l.length-2;h>0;h--){const _=l[h],k=e.find(w=>w.id===_);if(!k||(v++,k.type.startsWith("question-")))break}u.abort(),u=new AbortController;const g=e.find(h=>h.id===l[l.length-v]);return ke(g,"Undo failed: new start node not found"),p(g,b),{removed:v}},abort:()=>{u.abort()}}};async function su(e){return await Ne(e).with({node:{type:"text"}},du).with({node:{type:"image"}},fu).with({node:{type:"question-text"}},pu).with({node:{type:"question-enum"}},vu).with({node:{type:"question-number"}},hu).with({node:{type:"question-boolean"}},gu).with({node:{type:"question-file"}},bu).with({node:{type:"question-address"}},mu).with({node:{type:"end-flow"}},yu).with({node:{type:"if-block"}},uu).with({node:{type:"jump"}},({node:t,next:r})=>r(t.data.targetId)).with({node:{type:"link"}},cu).with({node:{type:"integration-application-submit"}},lu).with({node:{type:"integration-workflow-get"}},()=>Error("Unreachable")).exhaustive()}async function lu({chat:e,next:t,node:r,logger:n,apiClient:o,submissions:i,context:a,analytics:s}){r.data.skipConfirmation!==!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:u}=s.getSessionInfo(),p=await o.fetch("/flow/apply",{method:"POST",body:JSON.stringify({...a,integration_id:r.data.integrationId,anonymous_id:c,session_id:u,submissions:Tc(i||{})})}).catch(l=>l);await Ne(p).with({ats_data:{redirect_url:fe.string}},async l=>{await e.sendMessage({type:"text",author:"bot",text:"Almost there! Please complete your submission here:"});const v=new URL(l.ats_data.redirect_url);c&&!v.searchParams.has("anonymous_id")&&v.searchParams.set("anonymous_id",c),await e.sendMessage({type:"link",href:v.toString(),text:"Complete submission"}),t(r.nextId)}).with({success:!0},async()=>{await e.sendMessage({type:"system",variant:"success",text:"Submission completed!"}),t(r.nextId)}).otherwise(async l=>{n.error(l),await e.sendMessage({type:"system",variant:"error",text:"Failed to submit"}),t(r.id)})}async function cu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({type:"link",href:r.data.href,text:ot(r.data.cta,n)}),t(r.nextId)}async function uu({submissions:e,next:t,node:r}){const n=wu(r,e)?r.branchId:r.nextId;t(n)}async function du({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.text,n)}),t(r.nextId)}async function fu({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 pu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=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}});o.value===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:o.value}),t(r.nextId)}async function hu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:"text"}});o.value===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:o.value}),t(r.nextId)}async function vu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});const o=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});o.value.length===0?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(i=>o.value.includes(i.value)).map(i=>i.label).join(", ")}),t(r.nextId)}async function gu({chat:e,next:t,node:r,submissions:n}){await e.sendMessage({author:"bot",type:"text",text:ot(r.data.question,n)});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}}})).value;i===null?await e.sendMessage({type:"system",variant:"info",text:"Skipped"}):await e.sendMessage({author:"user",type:"text",text:{true:r.data.trueLabel,false:r.data.falseLabel}[i]}),t(r.nextId)}async function mu({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.value===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 bu({node:e,chat:t,next:r,submissions:n}){await t.sendMessage({author:"bot",type:"text",text:ot(e.data.question,n)});const o=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(o.value===null)await t.sendMessage({type:"system",variant:"info",text:"Skipped"});else for(const i of o.value)await t.sendMessage({author:"user",type:"file",fileName:i.name,fileSizeKb:i.sizeKb});r(e.nextId)}async function yu({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}const ua=fe.union(fe.string,fe.array(fe.string),null),wu=(e,t)=>{const r=t==null?void 0:t[e.data.compareKey];return r?Ne({...e.data,answer:r}).with({compare:"equals"},({compareValue:n})=>typeof r.value=="string"||typeof r.value=="boolean"?n===r.value.toString():!1).with({compare:"notEquals"},({compareValue:n})=>typeof r.value=="string"||typeof r.value=="boolean"?n!==r.value.toString():!1).with({compare:"contains",answer:{value:ua}},({compareValue:n,answer:o})=>o.value!==null&&o.value.includes(n)).with({compare:"notContains",answer:{value:ua}},({compareValue:n,answer:o})=>o.value===null||!o.value.includes(n)).with({answer:{type:"file"}},()=>!1).with({answer:{type:"address",value:fe.any}},()=>!1).with({compare:"greaterThan"},()=>!1).with({compare:"lessThan"},()=>!1).with({compare:"greaterThanOrEqualTo"},()=>!1).with({compare:"lessThanOrEqualTo"},()=>!1).exhaustive():!1},ot=(e,t)=>{const r=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g;return e.replace(r,(n,o,i="")=>{o=o.trim();const a=t==null?void 0:t[o];if(!a)return i;switch(a.type){case"boolean":return a.value==="true"?"true":"false";case"file":return a.value?a.value.map(s=>`${s.name} (${Lt(s.sizeKb)})`).join(", "):"no files";case"multiple-choice":return a.value.join(", ");default:return a.value||i}})};function _u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e,t,r){var n,o,i,a,s;t==null&&(t=100);function c(){var p=Date.now()-a;p<t&&p>=0?n=setTimeout(c,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(c,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}Pn.debounce=Pn;var xu=Pn;const da=_u(xu);function ku(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]=G({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,p=t?typeof t=="number"?t:t.resize:null,l=L(!1);R(()=>(l.current=!0,()=>void(l.current=!1)));const[v,b,g]=ae(()=>{const w=()=>{if(!c.current.element)return;const{left:P,top:O,width:A,height:U,bottom:W,right:N,x:M,y:ie}=c.current.element.getBoundingClientRect(),ee={left:P,top:O,width:A,height:U,bottom:W,right:N,x:M,y:ie};c.current.element instanceof HTMLElement&&o&&(ee.height=c.current.element.offsetHeight,ee.width=c.current.element.offsetWidth),Object.freeze(ee),l.current&&!Cu(c.current.lastBounds,ee)&&s(c.current.lastBounds=ee)};return[w,p?da(w,p):w,u?da(w,u):w]},[s,o,u,p]);function h(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",g,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function _(){c.current.element&&(c.current.resizeObserver=new i(g),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach(w=>w.addEventListener("scroll",g,{capture:!0,passive:!0})))}const k=w=>{!w||w===c.current.element||(h(),c.current.element=w,c.current.scrollContainers=fa(w),_())};return $u(g,!!r),Su(b),R(()=>{h(),_()},[r,g,b]),R(()=>h,[]),[k,a,v]}function Su(e){R(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function $u(e,t){R(()=>{if(t){const r=e;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",r,!0)}},[e,t])}function fa(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,...fa(e.parentElement)]}const Eu=["x","y","top","bottom","left","right","width","height"],Cu=(e,t)=>Eu.every(r=>e[r]===t[r]),jt=({class:e,...t})=>d("button",{class:ze("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"})]})}),Au=25,In=We({instant:()=>{},smooth:()=>{}}),le={onSubmitSuccessFn$:We(()=>{}),isBotTyping$:We(!1),scrollToEnd:{instant:()=>In.value.instant(),smooth:()=>In.value.smooth()}},Pu=()=>{const e=L(null);ye(()=>{In.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*1.5&&e.current.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})}}},[e]);const t=ae(()=>({send:async({message:r,signal:n,groupId:o})=>{if(await Ne(r).with({author:"bot",type:"text"},async i=>{if(n!=null&&n.aborted)throw new Bt;le.isBotTyping$.value=!0;const a=Math.min(Math.max(20,i.text.length),100)*Au;await new Promise(s=>setTimeout(s,a,{signal:n})),le.isBotTyping$.value=!1}).otherwise(async()=>{}),n!=null&&n.aborted)throw new Bt;T.addMessage(r,o)},input:async({input:r,signal:n})=>{if(n!=null&&n.aborted)throw new Bt;return T.setInput(r),await new Promise(o=>{const i=a=>{if(n!=null&&n.aborted)throw new Bt;T.setInput(void 0),r.key&&T.setSubmission(r.key,a),o(a)};le.onSubmitSuccessFn$.value=i})}}),[]);return{chatRef:e,chatService:t}},zt=({class:e,...t})=>d("button",{type:"button",class:ze("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"]}),pa=["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"],ha={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"]},_r=Object.keys(ha),Iu=e=>_r.reduce((t,r)=>{const n=ha[r],o=e.filter(i=>i.types.some(a=>n.includes(a))).map(i=>i.long_name).join(", ");return o&&(t[r]=o),t},{}),Ou=document.createElement("div"),Tu=()=>ae(()=>{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(Ou);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}))}},[]),On=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"})]}),Tn={label:"Fill in manually",value:""},Du=({input:e,onSubmitSuccess:t})=>{const[r,n]=G(""),[o,i]=G(),[a,s]=G([]),[c,u]=G(),{enabled:p,getPredictions:l,getPlaceDetails:v}=Tu(),[b,g]=G(p?"query":"manual"),h=ae(()=>na(_=>{if(ke(p,"Query state should not be enabled if Google Places isn't available"),n(_),_===""){s([]);return}l(_).then(k=>{s(k)})},500),[p,l]);switch(R(()=>{if(p&&!(c===void 0||c===""))return v(c).then(_=>{if(!_.ok||!_.place.address_components){i({});return}const k=Iu(_.place.address_components);i(k),g("details")}),()=>{i(void 0)}},[c,v,p]),b){case"query":return ke(p,"Query state should not be enabled if Google Places isn't available"),d(Nu,{input:e,onSkip:()=>t(null),onAddressSelect:_=>{u(_),g("loading")},onInputChange:h,suggestions:a,query:r});case"loading":return d(Dn,{input:e,onSubmitSuccess:t,addressFields:{},actions:d(On,{onClick:()=>{u(void 0),g("query")}})});case"details":return ke(o!==void 0),d(Dn,{input:e,onSubmitSuccess:t,addressFields:o,actions:d(On,{onClick:()=>{u(void 0),g("query")}})});case"manual":return d(Dn,{input:e,onSubmitSuccess:t,addressFields:{},actions:p?d(On,{onClick:()=>{u(void 0),g("query")}}):void 0})}},Nu=({input:e,onSkip:t,suggestions:r,onAddressSelect:n,query:o,onInputChange:i})=>{const a=L(null);return ye(()=>{a.current&&(a.current.focus(),a.current.select())},[]),d(q,{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(zt,{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(Tn.value)},children:d("span",{class:"flex-grow",children:Tn.label})})},Tn.label)]})]})},Mu={line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country"},Dn=({addressFields:e,onSubmitSuccess:t,actions:r,input:n})=>{const o=L(null);return ye(()=>{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(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:_r.map((i,a)=>{const s=`isdk_${i}`,c=n.config.keys[i];return c?d(q,{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:Mu[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&&!pa.includes(e.country)?d("option",{value:e[i],children:e[i]}):d("option",{value:"",children:"Select a country"}),pa.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!==_r.length-1&&d("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"}),a===_r.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(jt,{class:"flex items-center justify-center"})]})]})},Nn=()=>{const e=L(null);return R(()=>{var t;(t=e.current)==null||t.focus()},[]),e},va=["true","false"],Fu=ss(va),Lu="answer",Bu=({input:e,onSubmitSuccess:t})=>{const r=Nn();return d("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const o=Ne(n).with({nativeEvent:{submitter:fe.select(fe.union(fe.instanceOf(HTMLButtonElement),fe.instanceOf(HTMLInputElement)))}},a=>a.value).otherwise(()=>{throw new Error("invalid form")}),i=Pt(Fu,o);t(i)},children:[d("div",{class:"flex items-center gap-2 p-2.5",children:va.map((n,o)=>d("button",{ref:o===0?r:null,type:"submit",name:Lu,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(zt,{class:"w-full",type:"button",onClick:()=>t(null)})})]})},Mn=({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,Ru=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}),Vu=e=>e.reduce((t,r)=>t+r.sizeKb,0),ju=xn("file"),ga=3,zu=({file:e,class:t,...r})=>{const n=e.name.split(".").pop(),o=e.name.replace(new RegExp(`.${n}$`),"");return d("div",{class:ze("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:Lt(e.sizeKb)})]})},ma=({class:e,...t})=>d("li",{class:ze("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),ba=e=>{const t=e.split(".").pop();if(!t)throw new Error("No file extension found");return t?"."+t:""},Uu=({allowedExtensions:e,files:t})=>{const r=e.map(n=>n.toLowerCase());return t.every(n=>r.includes(ba(n.name).toLowerCase()))},Hu=(e,t)=>{const r=ba(e);return`${e.replace(new RegExp(`${r}$`),"").slice(0,t)}${r}`},Wu=({input:e,onSubmitSuccess:t})=>{var p;const r=(p=T.current$.value.flow)==null?void 0:p.data.submissions[e.key],[n,o]=G(ju(r)&&r.value!==null?r.value:[]),[i,a]=G(),s=n.length-ga,c=Vu(n),u=Nn();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&&!Uu({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 ${Lt(e.config.fileSizeLimitKib)}`}):e.config.allowMultiple===!1&&n.length>1?a({type:"invalid",message:"Only one file is allowed"}):t(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(q,{children:[d("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[n.slice(0,ga).map(l=>{const v=l.name.split(".").pop(),b=l.name.replace(new RegExp(`.${v}$`),"");return d(ma,{class:"flex overflow-hidden",children:[d("span",{class:"block truncate",children:b}),d("span",{children:[".",v]})]})}),s>0?d(ma,{children:["+",s," file",s!==1?"s":""]}):null]}),d("p",{class:"text-neutral-11 text-xs",children:[Lt(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 ",Lt(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=>{ke(l.target instanceof HTMLInputElement);const v=l.target.files?Array.from(l.target.files):[],b=await Promise.allSettled(v.map(async h=>{const _=await Ru(h);return{name:Hu(h.name,42),data:_,sizeKb:h.size/1e3}}));if(b.some(({status:h})=>h==="rejected"))return a({type:"invalid",message:"Invalid file"});const g=b.map(h=>h.status==="fulfilled"?h.value:null).filter(Boolean);o(g)},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),d("div",{class:"flex h-full flex-col items-center gap-2",children:[d(jt,{disabled:n.length===0}),e.config.optional&&d(zt,{onClick:()=>t(null)})]})]}),d(Mn,{error:i})]})};var Ut=e=>e.type==="checkbox",_t=e=>e instanceof Date,ce=e=>e==null;const ya=e=>typeof e=="object";var J=e=>!ce(e)&&!Array.isArray(e)&&ya(e)&&!_t(e),Ku=e=>J(e)&&e.target?Ut(e.target)?e.target.checked:e.target.value:e,qu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Gu=(e,t)=>e.has(qu(t)),Yu=e=>{const t=e.constructor&&e.constructor.prototype;return J(t)&&t.hasOwnProperty("isPrototypeOf")},Fn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Me(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(!(Fn&&(e instanceof Blob||e instanceof FileList))&&(r||J(e)))if(t=r?[]:{},!r&&!Yu(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Me(e[n]));else return e;return t}var Ht=e=>Array.isArray(e)?e.filter(Boolean):[],Z=e=>e===void 0,E=(e,t,r)=>{if(!t||!J(e))return r;const n=Ht(t.split(/[,[\].]+?/)).reduce((o,i)=>ce(o)?o:o[i],e);return Z(n)||n===e?Z(e[t])?r:e[t]:n},Ge=e=>typeof e=="boolean";const wa={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Se={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};xe.createContext(null);var Zu=(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]!==Se.all&&(t._proxyFormState[a]=!n||Se.all),r&&(r[a]=!0),e[a]}});return o},we=e=>J(e)&&!Object.keys(e).length,Qu=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return we(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!n||Se.all))},Ln=e=>Array.isArray(e)?e:[e];function Xu(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 Ae=e=>typeof e=="string",Ju=(e,t,r,n,o)=>Ae(e)?(n&&t.watch.add(e),E(r,e,o)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),E(r,i))):(n&&(t.watchAll=!0),r),Bn=e=>/^\w*$/.test(e),_a=e=>Ht(e.replace(/["|']|\]/g,"").split(/\.|\[/));function z(e,t,r){let n=-1;const o=Bn(t)?[t]:_a(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=J(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}e[s]=c,e=e[s]}return e}var xa=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},ka=e=>({isOnSubmit:!e||e===Se.onSubmit,isOnBlur:e===Se.onBlur,isOnChange:e===Se.onChange,isOnAll:e===Se.all,isOnTouch:e===Se.onTouched}),Sa=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const xr=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const i=E(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 J(s)&&xr(s,t)}}};var ed=(e,t,r)=>{const n=Ht(E(e,r));return z(n,"root",t[r]),z(e,r,n),e},Rn=e=>e.type==="file",Ye=e=>typeof e=="function",kr=e=>{if(!Fn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Sr=e=>Ae(e),Vn=e=>e.type==="radio",$r=e=>e instanceof RegExp;const $a={value:!1,isValid:!1},Ea={value:!0,isValid:!0};var Ca=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Z(e[0].attributes.value)?Z(e[0].value)||e[0].value===""?Ea:{value:e[0].value,isValid:!0}:Ea:$a}return $a};const Aa={isValid:!1,value:null};var Pa=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Aa):Aa;function Ia(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Ge(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var xt=e=>J(e)&&!$r(e)?e:{value:e,message:""},Oa=async(e,t,r,n,o)=>{const{ref:i,refs:a,required:s,maxLength:c,minLength:u,min:p,max:l,pattern:v,validate:b,name:g,valueAsNumber:h,mount:_,disabled:k}=e._f,w=E(t,g);if(!_||k)return{};const P=a?a[0]:i,O=V=>{n&&P.reportValidity&&(P.setCustomValidity(Ge(V)?"":V||""),P.reportValidity())},A={},U=Vn(i),W=Ut(i),N=U||W,M=(h||Rn(i))&&Z(i.value)&&Z(w)||kr(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,ie=xa.bind(null,g,r,A),ee=(V,F,Q,pe=Fe.maxLength,_e=Fe.minLength)=>{const Pe=V?F:Q;A[g]={type:V?pe:_e,message:Pe,ref:i,...ie(V?pe:_e,Pe)}};if(o?!Array.isArray(w)||!w.length:s&&(!N&&(M||ce(w))||Ge(w)&&!w||W&&!Ca(a).isValid||U&&!Pa(a).isValid)){const{value:V,message:F}=Sr(s)?{value:!!s,message:s}:xt(s);if(V&&(A[g]={type:Fe.required,message:F,ref:P,...ie(Fe.required,F)},!r))return O(F),A}if(!M&&(!ce(p)||!ce(l))){let V,F;const Q=xt(l),pe=xt(p);if(!ce(w)&&!isNaN(w)){const _e=i.valueAsNumber||w&&+w;ce(Q.value)||(V=_e>Q.value),ce(pe.value)||(F=_e<pe.value)}else{const _e=i.valueAsDate||new Date(w),Pe=Ar=>new Date(new Date().toDateString()+" "+Ar),st=i.type=="time",Kt=i.type=="week";Ae(Q.value)&&w&&(V=st?Pe(w)>Pe(Q.value):Kt?w>Q.value:_e>new Date(Q.value)),Ae(pe.value)&&w&&(F=st?Pe(w)<Pe(pe.value):Kt?w<pe.value:_e<new Date(pe.value))}if((V||F)&&(ee(!!V,Q.message,pe.message,Fe.max,Fe.min),!r))return O(A[g].message),A}if((c||u)&&!M&&(Ae(w)||o&&Array.isArray(w))){const V=xt(c),F=xt(u),Q=!ce(V.value)&&w.length>+V.value,pe=!ce(F.value)&&w.length<+F.value;if((Q||pe)&&(ee(Q,V.message,F.message),!r))return O(A[g].message),A}if(v&&!M&&Ae(w)){const{value:V,message:F}=xt(v);if($r(V)&&!w.match(V)&&(A[g]={type:Fe.pattern,message:F,ref:i,...ie(Fe.pattern,F)},!r))return O(F),A}if(b){if(Ye(b)){const V=await b(w,t),F=Ia(V,P);if(F&&(A[g]={...F,...ie(Fe.validate,F.message)},!r))return O(F.message),A}else if(J(b)){let V={};for(const F in b){if(!we(V)&&!r)break;const Q=Ia(await b[F](w,t),P,F);Q&&(V={...Q,...ie(F,Q.message)},O(Q.message),r&&(A[g]=V))}if(!we(V)&&(A[g]={ref:P,...V},!r))return A}}return O(!0),A};function td(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Z(e)?n++:e[t[n++]];return e}function rd(e){for(const t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function ne(e,t){const r=Array.isArray(t)?t:Bn(t)?[t]:_a(t),n=r.length===1?e:td(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(J(n)&&we(n)||Array.isArray(n)&&rd(n))&&ne(e,r.slice(0,-1)),e}function jn(){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 Er=e=>ce(e)||!ya(e);function at(e,t){if(Er(e)||Er(t))return e===t;if(_t(e)&&_t(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(_t(i)&&_t(a)||J(i)&&J(a)||Array.isArray(i)&&Array.isArray(a)?!at(i,a):i!==a)return!1}}return!0}var Ta=e=>e.type==="select-multiple",nd=e=>Vn(e)||Ut(e),zn=e=>kr(e)&&e.isConnected,Da=e=>{for(const t in e)if(Ye(e[t]))return!0;return!1};function Cr(e,t={}){const r=Array.isArray(e);if(J(e)||r)for(const n in e)Array.isArray(e[n])||J(e[n])&&!Da(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Cr(e[n],t[n])):ce(e[n])||(t[n]=!0);return t}function Na(e,t,r){const n=Array.isArray(e);if(J(e)||n)for(const o in e)Array.isArray(e[o])||J(e[o])&&!Da(e[o])?Z(t)||Er(r[o])?r[o]=Array.isArray(e[o])?Cr(e[o],[]):{...Cr(e[o])}:Na(e[o],ce(t)?{}:t[o],r[o]):r[o]=!at(e[o],t[o]);return r}var Un=(e,t)=>Na(e,t,Cr(t)),Ma=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Z(e)?e:t?e===""?NaN:e&&+e:r&&Ae(e)?new Date(e):n?n(e):e;function Hn(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Rn(t)?t.files:Vn(t)?Pa(e.refs).value:Ta(t)?[...t.selectedOptions].map(({value:r})=>r):Ut(t)?Ca(e.refs).value:Ma(Z(t.value)?e.ref.value:t.value,e)}var id=(e,t,r,n)=>{const o={};for(const i of e){const a=E(t,i);a&&z(o,i,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Wt=e=>Z(e)?e:$r(e)?e.source:J(e)?$r(e.value)?e.value.source:e.value:e,od=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Fa(e,t,r){const n=E(e,r);if(n||Bn(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const i=o.join("."),a=E(t,i),s=E(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 ad=(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,sd=(e,t)=>!Ht(E(e,t)).length&&ne(e,t);const ld={mode:Se.onSubmit,reValidateMode:Se.onChange,shouldFocusError:!0};function cd(e={},t){let r={...ld,...e},n={submitCount:0,isDirty:!1,isLoading:Ye(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=J(r.defaultValues)||J(r.values)?Me(r.defaultValues||r.values)||{}:{},a=r.shouldUnregister?{}:Me(i),s={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,p=0;const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:jn(),array:jn(),state:jn()},b=e.resetOptions&&e.resetOptions.keepDirtyValues,g=ka(r.mode),h=ka(r.reValidateMode),_=r.criteriaMode===Se.all,k=f=>m=>{clearTimeout(p),p=setTimeout(f,m)},w=async f=>{if(l.isValid||f){const m=r.resolver?we((await M()).errors):await ee(o,!0);m!==n.isValid&&v.state.next({isValid:m})}},P=f=>l.isValidating&&v.state.next({isValidating:f}),O=(f,m=[],y,C,S=!0,x=!0)=>{if(C&&y){if(s.action=!0,x&&Array.isArray(E(o,f))){const I=y(E(o,f),C.argA,C.argB);S&&z(o,f,I)}if(x&&Array.isArray(E(n.errors,f))){const I=y(E(n.errors,f),C.argA,C.argB);S&&z(n.errors,f,I),sd(n.errors,f)}if(l.touchedFields&&x&&Array.isArray(E(n.touchedFields,f))){const I=y(E(n.touchedFields,f),C.argA,C.argB);S&&z(n.touchedFields,f,I)}l.dirtyFields&&(n.dirtyFields=Un(i,a)),v.state.next({name:f,isDirty:F(f,m),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else z(a,f,m)},A=(f,m)=>{z(n.errors,f,m),v.state.next({errors:n.errors})},U=(f,m,y,C)=>{const S=E(o,f);if(S){const x=E(a,f,Z(y)?E(i,f):y);Z(x)||C&&C.defaultChecked||m?z(a,f,m?x:Hn(S._f)):_e(f,x),s.mount&&w()}},W=(f,m,y,C,S)=>{let x=!1,I=!1;const H={name:f};if(!y||C){l.isDirty&&(I=n.isDirty,n.isDirty=H.isDirty=F(),x=I!==H.isDirty);const X=at(E(i,f),m);I=E(n.dirtyFields,f),X?ne(n.dirtyFields,f):z(n.dirtyFields,f,!0),H.dirtyFields=n.dirtyFields,x=x||l.dirtyFields&&I!==!X}if(y){const X=E(n.touchedFields,f);X||(z(n.touchedFields,f,y),H.touchedFields=n.touchedFields,x=x||l.touchedFields&&X!==y)}return x&&S&&v.state.next(H),x?H:{}},N=(f,m,y,C)=>{const S=E(n.errors,f),x=l.isValid&&Ge(m)&&n.isValid!==m;if(e.delayError&&y?(u=k(()=>A(f,y)),u(e.delayError)):(clearTimeout(p),u=null,y?z(n.errors,f,y):ne(n.errors,f)),(y?!at(S,y):S)||!we(C)||x){const I={...C,...x&&Ge(m)?{isValid:m}:{},errors:n.errors,name:f};n={...n,...I},v.state.next(I)}P(!1)},M=async f=>r.resolver(a,r.context,id(f||c.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),ie=async f=>{const{errors:m}=await M(f);if(f)for(const y of f){const C=E(m,y);C?z(n.errors,y,C):ne(n.errors,y)}else n.errors=m;return m},ee=async(f,m,y={valid:!0})=>{for(const C in f){const S=f[C];if(S){const{_f:x,...I}=S;if(x){const H=c.array.has(x.name),X=await Oa(S,a,_,r.shouldUseNativeValidation&&!m,H);if(X[x.name]&&(y.valid=!1,m))break;!m&&(E(X,x.name)?H?ed(n.errors,X,x.name):z(n.errors,x.name,X[x.name]):ne(n.errors,x.name))}I&&await ee(I,m,y)}}return y.valid},V=()=>{for(const f of c.unMount){const m=E(o,f);m&&(m._f.refs?m._f.refs.every(y=>!zn(y)):!zn(m._f.ref))&&Kn(f)}c.unMount=new Set},F=(f,m)=>(f&&m&&z(a,f,m),!at(Va(),i)),Q=(f,m,y)=>Ju(f,c,{...s.mount?a:Z(m)?i:Ae(f)?{[f]:m}:m},y,m),pe=f=>Ht(E(s.mount?a:i,f,e.shouldUnregister?E(i,f,[]):[])),_e=(f,m,y={})=>{const C=E(o,f);let S=m;if(C){const x=C._f;x&&(!x.disabled&&z(a,f,Ma(m,x)),S=kr(x.ref)&&ce(m)?"":m,Ta(x.ref)?[...x.ref.options].forEach(I=>I.selected=S.includes(I.value)):x.refs?Ut(x.ref)?x.refs.length>1?x.refs.forEach(I=>(!I.defaultChecked||!I.disabled)&&(I.checked=Array.isArray(S)?!!S.find(H=>H===I.value):S===I.value)):x.refs[0]&&(x.refs[0].checked=!!S):x.refs.forEach(I=>I.checked=I.value===S):Rn(x.ref)?x.ref.value="":(x.ref.value=S,x.ref.type||v.values.next({name:f,values:{...a}})))}(y.shouldDirty||y.shouldTouch)&&W(f,S,y.shouldTouch,y.shouldDirty,!0),y.shouldValidate&&Wn(f)},Pe=(f,m,y)=>{for(const C in m){const S=m[C],x=`${f}.${C}`,I=E(o,x);(c.array.has(f)||!Er(S)||I&&!I._f)&&!_t(S)?Pe(x,S,y):_e(x,S,y)}},st=(f,m,y={})=>{const C=E(o,f),S=c.array.has(f),x=Me(m);z(a,f,x),S?(v.array.next({name:f,values:{...a}}),(l.isDirty||l.dirtyFields)&&y.shouldDirty&&v.state.next({name:f,dirtyFields:Un(i,a),isDirty:F(f,x)})):C&&!C._f&&!ce(x)?Pe(f,x,y):_e(f,x,y),Sa(f,c)&&v.state.next({...n}),v.values.next({name:f,values:{...a}}),!s.mount&&t()},Kt=async f=>{const m=f.target;let y=m.name,C=!0;const S=E(o,y),x=()=>m.type?Hn(S._f):Ku(f),I=H=>{C=Number.isNaN(H)||H===E(a,y,H)};if(S){let H,X;const Pr=x(),St=f.type===wa.BLUR||f.type===wa.FOCUS_OUT,Ud=!od(S._f)&&!r.resolver&&!E(n.errors,y)&&!S._f.deps||ad(St,E(n.touchedFields,y),n.isSubmitted,h,g),Gn=Sa(y,c,St);z(a,y,Pr),St?(S._f.onBlur&&S._f.onBlur(f),u&&u(0)):S._f.onChange&&S._f.onChange(f);const Yn=W(y,Pr,St,!1),Hd=!we(Yn)||Gn;if(!St&&v.values.next({name:y,type:f.type,values:{...a}}),Ud)return l.isValid&&w(),Hd&&v.state.next({name:y,...Gn?{}:Yn});if(!St&&Gn&&v.state.next({...n}),P(!0),r.resolver){const{errors:Ga}=await M([y]);if(I(Pr),C){const Wd=Fa(n.errors,o,y),Ya=Fa(Ga,o,Wd.name||y);H=Ya.error,y=Ya.name,X=we(Ga)}}else H=(await Oa(S,a,_,r.shouldUseNativeValidation))[y],I(Pr),C&&(H?X=!1:l.isValid&&(X=await ee(o,!0)));C&&(S._f.deps&&Wn(S._f.deps),N(y,X,H,Yn))}},Ar=(f,m)=>{if(E(n.errors,m)&&f.focus)return f.focus(),1},Wn=async(f,m={})=>{let y,C;const S=Ln(f);if(P(!0),r.resolver){const x=await ie(Z(f)?f:S);y=we(x),C=f?!S.some(I=>E(x,I)):y}else f?(C=(await Promise.all(S.map(async x=>{const I=E(o,x);return await ee(I&&I._f?{[x]:I}:I)}))).every(Boolean),!(!C&&!n.isValid)&&w()):C=y=await ee(o);return v.state.next({...!Ae(f)||l.isValid&&y!==n.isValid?{}:{name:f},...r.resolver||!f?{isValid:y}:{},errors:n.errors,isValidating:!1}),m.shouldFocus&&!C&&xr(o,Ar,f?S:c.mount),C},Va=f=>{const m={...i,...s.mount?a:{}};return Z(f)?m:Ae(f)?E(m,f):f.map(y=>E(m,y))},ja=(f,m)=>({invalid:!!E((m||n).errors,f),isDirty:!!E((m||n).dirtyFields,f),isTouched:!!E((m||n).touchedFields,f),error:E((m||n).errors,f)}),Rd=f=>{f&&Ln(f).forEach(m=>ne(n.errors,m)),v.state.next({errors:f?n.errors:{}})},za=(f,m,y)=>{const C=(E(o,f,{_f:{}})._f||{}).ref;z(n.errors,f,{...m,ref:C}),v.state.next({name:f,errors:n.errors,isValid:!1}),y&&y.shouldFocus&&C&&C.focus&&C.focus()},Vd=(f,m)=>Ye(f)?v.values.subscribe({next:y=>f(Q(void 0,m),y)}):Q(f,m,!0),Kn=(f,m={})=>{for(const y of f?Ln(f):c.mount)c.mount.delete(y),c.array.delete(y),m.keepValue||(ne(o,y),ne(a,y)),!m.keepError&&ne(n.errors,y),!m.keepDirty&&ne(n.dirtyFields,y),!m.keepTouched&&ne(n.touchedFields,y),!r.shouldUnregister&&!m.keepDefaultValue&&ne(i,y);v.values.next({values:{...a}}),v.state.next({...n,...m.keepDirty?{isDirty:F()}:{}}),!m.keepIsValid&&w()},Ua=({disabled:f,name:m,field:y,fields:C,value:S})=>{if(Ge(f)){const x=f?void 0:Z(S)?Hn(y?y._f:E(C,m)._f):S;z(a,m,x),W(m,x,!1,!1,!0)}},qn=(f,m={})=>{let y=E(o,f);const C=Ge(m.disabled);return z(o,f,{...y||{},_f:{...y&&y._f?y._f:{ref:{name:f}},name:f,mount:!0,...m}}),c.mount.add(f),y?Ua({field:y,disabled:m.disabled,name:f}):U(f,!0,m.value),{...C?{disabled:m.disabled}:{},...r.progressive?{required:!!m.required,min:Wt(m.min),max:Wt(m.max),minLength:Wt(m.minLength),maxLength:Wt(m.maxLength),pattern:Wt(m.pattern)}:{},name:f,onChange:Kt,onBlur:Kt,ref:S=>{if(S){qn(f,m),y=E(o,f);const x=Z(S.value)&&S.querySelectorAll&&S.querySelectorAll("input,select,textarea")[0]||S,I=nd(x),H=y._f.refs||[];if(I?H.find(X=>X===x):x===y._f.ref)return;z(o,f,{_f:{...y._f,...I?{refs:[...H.filter(zn),x,...Array.isArray(E(i,f))?[{}]:[]],ref:{type:x.type,name:f}}:{ref:x}}}),U(f,!1,void 0,x)}else y=E(o,f,{}),y._f&&(y._f.mount=!1),(r.shouldUnregister||m.shouldUnregister)&&!(Gu(c.array,f)&&s.action)&&c.unMount.add(f)}}},Ha=()=>r.shouldFocusError&&xr(o,Ar,c.mount),jd=f=>{Ge(f)&&(v.state.next({disabled:f}),xr(o,m=>{m.disabled=f},0,!1))},Wa=(f,m)=>async y=>{y&&(y.preventDefault&&y.preventDefault(),y.persist&&y.persist());let C=Me(a);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:S,values:x}=await M();n.errors=S,C=x}else await ee(o);ne(n.errors,"root"),we(n.errors)?(v.state.next({errors:{}}),await f(C,y)):(m&&await m({...n.errors},y),Ha(),setTimeout(Ha)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:we(n.errors),submitCount:n.submitCount+1,errors:n.errors})},zd=(f,m={})=>{E(o,f)&&(Z(m.defaultValue)?st(f,E(i,f)):(st(f,m.defaultValue),z(i,f,m.defaultValue)),m.keepTouched||ne(n.touchedFields,f),m.keepDirty||(ne(n.dirtyFields,f),n.isDirty=m.defaultValue?F(f,E(i,f)):F()),m.keepError||(ne(n.errors,f),l.isValid&&w()),v.state.next({...n}))},Ka=(f,m={})=>{const y=f?Me(f):i,C=Me(y),S=f&&!we(f)?C:i;if(m.keepDefaultValues||(i=y),!m.keepValues){if(m.keepDirtyValues||b)for(const x of c.mount)E(n.dirtyFields,x)?z(S,x,E(a,x)):st(x,E(S,x));else{if(Fn&&Z(f))for(const x of c.mount){const I=E(o,x);if(I&&I._f){const H=Array.isArray(I._f.refs)?I._f.refs[0]:I._f.ref;if(kr(H)){const X=H.closest("form");if(X){X.reset();break}}}}o={}}a=e.shouldUnregister?m.keepDefaultValues?Me(i):{}:Me(S),v.array.next({values:{...S}}),v.values.next({values:{...S}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!l.isValid||!!m.keepIsValid,s.watch=!!e.shouldUnregister,v.state.next({submitCount:m.keepSubmitCount?n.submitCount:0,isDirty:m.keepDirty?n.isDirty:!!(m.keepDefaultValues&&!at(f,i)),isSubmitted:m.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:m.keepDirtyValues?n.dirtyFields:m.keepDefaultValues&&f?Un(i,f):{},touchedFields:m.keepTouched?n.touchedFields:{},errors:m.keepErrors?n.errors:{},isSubmitSuccessful:m.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},qa=(f,m)=>Ka(Ye(f)?f(a):f,m);return{control:{register:qn,unregister:Kn,getFieldState:ja,handleSubmit:Wa,setError:za,_executeSchema:M,_getWatch:Q,_getDirty:F,_updateValid:w,_removeUnmounted:V,_updateFieldArray:O,_updateDisabledField:Ua,_getFieldArray:pe,_reset:Ka,_resetDefaultValues:()=>Ye(r.defaultValues)&&r.defaultValues().then(f=>{qa(f,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:f=>{n={...n,...f}},_disableForm:jd,_subjects:v,_proxyFormState:l,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(f){s=f},get _defaultValues(){return i},get _names(){return c},set _names(f){c=f},get _formState(){return n},set _formState(f){n=f},get _options(){return r},set _options(f){r={...r,...f}}},trigger:Wn,register:qn,handleSubmit:Wa,watch:Vd,setValue:st,getValues:Va,reset:qa,resetField:zd,clearErrors:Rd,unregister:Kn,setError:za,setFocus:(f,m={})=>{const y=E(o,f),C=y&&y._f;if(C){const S=C.refs?C.refs[0]:C.ref;S.focus&&(S.focus(),m.shouldSelect&&S.select())}},getFieldState:ja}}function La(e={}){const t=xe.useRef(),r=xe.useRef(),[n,o]=xe.useState({isDirty:!1,isValidating:!1,isLoading:Ye(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:Ye(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...cd(e,()=>o(a=>({...a}))),formState:n});const i=t.current.control;return i._options=e,Xu({subject:i._subjects.state,next:a=>{Qu(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&&!at(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=Zu(n,i),t.current}var Ba=function(e,t,r){if(e&&"reportValidity"in e){var n=E(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ud=function(e,t){var r=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?Ba(i.ref,o,e):i.refs&&i.refs.forEach(function(a){return Ba(a,o,e)})};for(var n in t.fields)r(n)},dd=function(e,t){t.shouldUseNativeValidation&&ud(e,t);var r={};for(var n in e){var o=E(t.fields,n),i=Object.assign(e[n]||{},{ref:o&&o.ref});if(pd(t.names||Object.keys(e),n)){var a=Object.assign({},fd(E(r,n)));z(a,"root",i),z(r,n,a)}else z(r,n,i)}return r},fd=function(e){return Array.isArray(e)?e.filter(Boolean):[]},pd=function(e,t){return e.some(function(r){return r.startsWith(t+".")})},hd=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]=xa(o,t,r,n.validation,a?[].concat(a,n.message):n.message)}e.issues.shift()}}return r},Ra=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 p=Object.assign({},{abortEarly:!1,abortPipeEarly:!1},t);return r.mode==="sync"?u(Pt(e,n,p)):Promise.resolve(us(e,n,p)).then(u)}()}catch(u){return s(u)}return c&&c.then?c.then(void 0,s):c}(0,function(a){if(a instanceof Nr)return{values:{},errors:dd(hd(a,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};const vd=27,gd=12,md=10,bd=e=>{const t=Object.fromEntries(new FormData(e).entries());Object.keys(t).length&&e.dispatchEvent(new Event("submit",{bubbles:!0}))},yd=xn("multiple-choice"),wd=e=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Ra(Ve({checked:wi(yi(as()),r=>Object.entries(r).filter(([n,o])=>o).map(([n,o])=>n),[It(t.max,`Please select at most ${t.max} option${t.max!==1?"s":""}`),_i(t.min,`Please select at least ${t.min} option${t.min!==1?"s":""}`)])}))},_d=({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}}=La({defaultValues:{checked:n?{}:yd(r)?Object.fromEntries(r.value.map(p=>[p,!0])):{}},resolver:wd(e.config)}),s=Nn();return d("form",{noValidate:!0,class:"pr-2.5",onChange:p=>{n&&bd(p.currentTarget)},onSubmit:i(p=>{const l=p.checked;t(l)}),children:[d("div",{class:"flex items-center gap-1",children:[d("ul",{style:{maxHeight:6.5*vd+5*gd+2*md},class:ze("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,l)=>{const v=`checked.${p.value}`,{ref:b,...g}=o(v);return d("li",{class:"relative",children:[d("input",{autoFocus:l===0,ref:h=>{h&&l===0&&(s.current=h),b(h)},id:v,...g,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(jt,{}),e.config.minSelected===0&&d(zt,{type:"button",onClick:()=>t([])})]})]}),d("div",{class:"px-1",children:d(Mn,{error:(u=a.checked)==null?void 0:u.root})})]})},xd=({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"})]})]})})}),kt={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"},kd=be(kt.phone,[ps(/^\+?[0-9 -]+$/,kt.phone)]),Sd={email:{type:"email",inputMode:"email",formNoValidate:!0},phone:{type:"tel",inputMode:"tel"},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},$d=xn("text"),Ed=e=>{const t=`Please enter no more than ${e.maxChars} characters`;return Ra(Ve({text:{email:be(kt.email,[fs(kt.email),It(e.maxChars??1/0,t)]),phone:wi(kd,r=>r.replace(/[^0-9]/g,""),[It(e.maxChars??1/0,t)]),text:be([_i(1,kt.empty),It(e.maxChars??1/0,t)]),url:be([hs(kt.url),It(e.maxChars??1/0,t)])}[e.format]}))},Cd=({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}}=La({defaultValues:{text:n||($d(r)?r.value:"")},resolver:Ed(e.config)}),{ref:s,...c}=o("text",{required:!e.config.optional}),u=L();return ye(()=>{u.current&&(u.current.focus(),u.current.select())},[]),d(q,{children:d("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:i(l=>{t(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,...Sd[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(zt,{class:"absolute right-0 top-0",onClick:()=>t(null)})]}),d(jt,{})]}),d(Mn,{error:a.text})]})})},Ad=()=>{var i;const e=(i=T.current$.value.flow)==null?void 0:i.data.currentInput,[t,r]=ku(),n=L(null);T.inputHeight$.value=r.height,R(()=>{const a=n.current;if(a)return a.addEventListener("transitionstart",le.scrollToEnd.smooth),a.addEventListener("transitioncancel",le.scrollToEnd.smooth),a.addEventListener("transitionend",le.scrollToEnd.smooth),()=>{a.removeEventListener("transitionstart",le.scrollToEnd.smooth),a.removeEventListener("transitioncancel",le.scrollToEnd.smooth),a.removeEventListener("transitionend",le.scrollToEnd.smooth)}},[]);const o=a=>s=>le.onSubmitSuccessFn$.value({type:a,value:s});return 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:Ne({input:e}).with({input:fe.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(jt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})).with({input:{type:"text"}},a=>d(Cd,{onSubmitSuccess:o(a.input.type),...a})).with({input:{type:"multiple-choice"}},a=>d(_d,{onSubmitSuccess:o(a.input.type),...a})).with({input:{type:"boolean"}},a=>d(Bu,{onSubmitSuccess:o(a.input.type),...a})).with({input:{type:"file"}},a=>d(Wu,{onSubmitSuccess:o(a.input.type),...a})).with({input:{type:"submit"}},a=>d(xd,{onSubmitSuccess:o(a.input.type),...a})).with({input:{type:"address"}},a=>d(Du,{onSubmitSuccess:o(a.input.type),...a})).exhaustive()})})},Pd=on("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"}}),Id=({children:e,className:t,animate:r,side:n,...o})=>d("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Pd({className:t,side:n,animate:r}),...o,children:e}),Od=({className:e,...t})=>(R(()=>{le.scrollToEnd.smooth()}),d("div",{"aria-hidden":!0,children:le.isBotTyping$.value===!0?d("div",{"aria-label":"Typing…",class:ze("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})),Td={bot:"left",user:"right"},Dd=on("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]"}}}),Nd=({lastSentMessageFooter:e})=>{var r;const t=((r=T.current$.value.flow)==null?void 0:r.data.messages)??[];return R(()=>{le.scrollToEnd.smooth()},[t.length]),d("ol",{"aria-label":"Chat messages",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[t.map((n,o)=>d(q,{children:d("li",{class:"flex",children:Ne(n).with({type:"system"},i=>d("p",{class:Dd({variant:i.variant}),children:i.text})).with({type:"text",author:fe.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(Id,{animate:s,side:Td[i.author],children:[i.text,a?e:null]},o)}).with({type:"link"},i=>d("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:d("a",{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:i.href,children:[i.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"})})]})})).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(zu,{class:i.author==="bot"?"":"ml-auto",file:{name:i.fileName,sizeKb:i.fileSizeKb}})).exhaustive()})},o)),d(Od,{},"typing")]})},Md=({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}=Pu(),[s,c]=G();return ye(()=>{o==="maximised"&&le.scrollToEnd.instant()},[o]),ye(()=>{const{state:u,flow:p}=T.current$.peek();if(u!=="loaded")throw new Error(hc.invalid_state);let l=p.data.nodeHistory.at(-1);if(le.scrollToEnd.instant(),T.setInput(void 0),p.data.isFinished)return;l===void 0?(l=ra(n.nodes).id,T.setCurrentNodeId(l),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([l]);const{interpret:v,abort:b,undo:g}=au({context:n.context,analytics:r,apiClient:t,logger:e,flow:n.nodes,chatService:a,getSubmissions:()=>{var h;return(h=T.current$.peek().flow)==null?void 0:h.data.submissions},onInterpret:(h,_)=>{const k=T.current$.peek().flow;ke(k),_&&(k.data.sequence=k.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: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 c(()=>g),v(l),b},[r,t,a,e,n]),d(q,{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(Nd,{lastSentMessageFooter:n.data.isFinished||!s?null:d(Ld,{undoFn:s})})}),d(Ad,{})]})},Fd=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"):[],Ld=({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(Fd).forEach(o=>delete t.data.submissions[o]),T.current$.value={...T.current$.value})},children:"Undo"})}),Bd=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:Md},Symbol.toStringTag,{value:"Module"}))})();