deskcord 0.12.0 → 1.0.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.
@@ -1,146 +1,2 @@
1
- (function(){"use strict";var bn,U,oa,Ce,sa,aa,gi,ca,yi,wi,vi,la,xn={},ua=[],hf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,hr=Array.isArray;function re(t,e){for(var n in e)t[n]=e[n];return t}function _i(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function B(t,e,n){var r,i,o,s={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?bn.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Cn(t,s,r,i,null)}function Cn(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++oa,__i:-1,__u:0};return i==null&&U.vnode!=null&&U.vnode(o),o}function da(){return{current:null}}function tt(t){return t.children}function Rt(t,e){this.props=t,this.context=e}function je(t,e){if(e==null)return t.__?je(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?je(t):null}function ha(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return ha(t)}}function bi(t){(!t.__d&&(t.__d=!0)&&Ce.push(t)&&!fr.__r++||sa!==U.debounceRendering)&&((sa=U.debounceRendering)||aa)(fr)}function fr(){var t,e,n,r,i,o,s,a;for(Ce.sort(gi);t=Ce.shift();)t.__d&&(e=Ce.length,r=void 0,o=(i=(n=t).__v).__e,s=[],a=[],n.__P&&((r=re({},i)).__v=i.__v+1,U.vnode&&U.vnode(r),xi(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[o]:null,s,o??je(i),!!(32&i.__u),a),r.__v=i.__v,r.__.__k[r.__i]=r,ya(s,r,a),r.__e!=o&&ha(r)),Ce.length>e&&Ce.sort(gi));fr.__r=0}function fa(t,e,n,r,i,o,s,a,l,d,c){var f,m,g,_,v,C,b=r&&r.__k||ua,S=e.length;for(l=ff(n,e,b,l,S),f=0;f<S;f++)(g=n.__k[f])!=null&&(m=g.__i===-1?xn:b[g.__i]||xn,g.__i=f,C=xi(t,g,m,i,o,s,a,l,d,c),_=g.__e,g.ref&&m.ref!=g.ref&&(m.ref&&Ci(m.ref,null,g),c.push(g.ref,g.__c||_,g)),v==null&&_!=null&&(v=_),4&g.__u||m.__k===g.__k?l=pa(g,l,t):typeof g.type=="function"&&C!==void 0?l=C:_&&(l=_.nextSibling),g.__u&=-7);return n.__e=v,l}function ff(t,e,n,r,i){var o,s,a,l,d,c=n.length,f=c,m=0;for(t.__k=new Array(i),o=0;o<i;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=o+m,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Cn(null,s,null,null,null):hr(s)?Cn(tt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?Cn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(d=s.__i=pf(s,n,l,f))!==-1&&(f--,(a=n[d])&&(a.__u|=2)),a==null||a.__v===null?(d==-1&&m--,typeof s.type!="function"&&(s.__u|=4)):d!=l&&(d==l-1?m--:d==l+1?m++:(d>l?m--:m++,s.__u|=4))):t.__k[o]=null;if(f)for(o=0;o<c;o++)(a=n[o])!=null&&!(2&a.__u)&&(a.__e==r&&(r=je(a)),wa(a,a));return r}function pa(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=pa(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=je(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ie(t,e){return e=e||[],t==null||typeof t=="boolean"||(hr(t)?t.some(function(n){ie(n,e)}):e.push(t)),e}function pf(t,e,n,r){var i,o,s=t.key,a=t.type,l=e[n];if(l===null||l&&s==l.key&&a===l.type&&!(2&l.__u))return n;if(r>(l!=null&&!(2&l.__u)?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&a===l.type)return i;i--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&s==l.key&&a===l.type)return o;o++}}return-1}function ma(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||hf.test(e)?n:n+"px"}function pr(t,e,n,r,i){var o;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ma(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ma(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(ca,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=yi,t.addEventListener(e,o?vi:wi,o)):t.removeEventListener(e,o?vi:wi,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ga(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=yi++;else if(e.t<n.u)return;return n(U.event?U.event(e):e)}}}function xi(t,e,n,r,i,o,s,a,l,d){var c,f,m,g,_,v,C,b,S,T,M,A,R,N,k,P,D,O=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(c=U.__b)&&c(e);t:if(typeof O=="function")try{if(b=e.props,S="prototype"in O&&O.prototype.render,T=(c=O.contextType)&&r[c.__c],M=c?T?T.props.value:c.__:r,n.__c?C=(f=e.__c=n.__c).__=f.__E:(S?e.__c=f=new O(b,M):(e.__c=f=new Rt(b,M),f.constructor=O,f.render=gf),T&&T.sub(f),f.props=b,f.state||(f.state={}),f.context=M,f.__n=r,m=f.__d=!0,f.__h=[],f._sb=[]),S&&f.__s==null&&(f.__s=f.state),S&&O.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=re({},f.__s)),re(f.__s,O.getDerivedStateFromProps(b,f.__s))),g=f.props,_=f.state,f.__v=e,m)S&&O.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),S&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(S&&O.getDerivedStateFromProps==null&&b!==g&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(b,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(b,f.__s,M)===!1||e.__v==n.__v)){for(e.__v!=n.__v&&(f.props=b,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(J){J&&(J.__=e)}),A=0;A<f._sb.length;A++)f.__h.push(f._sb[A]);f._sb=[],f.__h.length&&s.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(b,f.__s,M),S&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(g,_,v)})}if(f.context=M,f.props=b,f.__P=t,f.__e=!1,R=U.__r,N=0,S){for(f.state=f.__s,f.__d=!1,R&&R(e),c=f.render(f.props,f.state,f.context),k=0;k<f._sb.length;k++)f.__h.push(f._sb[k]);f._sb=[]}else do f.__d=!1,R&&R(e),c=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++N<25);f.state=f.__s,f.getChildContext!=null&&(r=re(re({},r),f.getChildContext())),S&&!m&&f.getSnapshotBeforeUpdate!=null&&(v=f.getSnapshotBeforeUpdate(g,_)),a=fa(t,hr(P=c!=null&&c.type===tt&&c.key==null?c.props.children:c)?P:[P],e,n,r,i,o,s,a,l,d),f.base=e.__e,e.__u&=-161,f.__h.length&&s.push(f),C&&(f.__E=f.__=null)}catch(J){if(e.__v=null,l||o!=null)if(J.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(D=o.length;D--;)_i(o[D]);else e.__e=n.__e,e.__k=n.__k;U.__e(J,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=mf(n.__e,e,n,r,i,o,s,l,d);return(c=U.diffed)&&c(e),128&e.__u?void 0:a}function ya(t,e,n){for(var r=0;r<n.length;r++)Ci(n[r],n[++r],n[++r]);U.__c&&U.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){U.__e(o,i.__v)}})}function mf(t,e,n,r,i,o,s,a,l){var d,c,f,m,g,_,v,C=n.props,b=e.props,S=e.type;if(S=="svg"?i="http://www.w3.org/2000/svg":S=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((g=o[d])&&"setAttribute"in g==!!S&&(S?g.localName==S:g.nodeType==3)){t=g,o[d]=null;break}}if(t==null){if(S==null)return document.createTextNode(b);t=document.createElementNS(i,S,b.is&&b),a&&(U.__m&&U.__m(e,o),a=!1),o=null}if(S===null)C===b||a&&t.data===b||(t.data=b);else{if(o=o&&bn.call(t.childNodes),C=n.props||xn,!a&&o!=null)for(C={},d=0;d<t.attributes.length;d++)C[(g=t.attributes[d]).name]=g.value;for(d in C)if(g=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")f=g;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;pr(t,d,null,g,i)}}for(d in b)g=b[d],d=="children"?m=g:d=="dangerouslySetInnerHTML"?c=g:d=="value"?_=g:d=="checked"?v=g:a&&typeof g!="function"||C[d]===g||pr(t,d,g,C[d],i);if(c)a||f&&(c.__html===f.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(f&&(t.innerHTML=""),fa(t,hr(m)?m:[m],e,n,r,S=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:n.__k&&je(n,0),a,l),o!=null)for(d=o.length;d--;)_i(o[d]);a||(d="value",S=="progress"&&_==null?t.removeAttribute("value"):_!==void 0&&(_!==t[d]||S=="progress"&&!_||S=="option"&&_!==C[d])&&pr(t,d,_,C[d],i),d="checked",v!==void 0&&v!==t[d]&&pr(t,d,v,C[d],i))}return t}function Ci(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){U.__e(i,n)}}function wa(t,e,n){var r,i;if(U.unmount&&U.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Ci(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){U.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&wa(r[i],e,n||typeof t.type!="function");n||_i(t.__e),t.__c=t.__=t.__e=void 0}function gf(t,e,n){return this.constructor(t,n)}function Sn(t,e,n){var r,i,o,s;e==document&&(e=document.documentElement),U.__&&U.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],s=[],xi(e,t=(!r&&n||e).__k=B(tt,null,[t]),i||xn,xn,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?bn.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r,s),ya(o,t,s)}function va(t,e){Sn(t,e,va)}function yf(t,e,n){var r,i,o,s,a=re({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?bn.call(arguments,2):n),Cn(t.type,a,r||t.key,i||t.ref,null)}function Et(t,e){var n={__c:e="__cC"+la++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=new Set,(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.forEach(function(a){a.__e=!0,bi(a)})},this.sub=function(s){i.add(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){i&&i.delete(s),a&&a.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}bn=ua.slice,U={__e:function(t,e,n,r){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},oa=0,Rt.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=re({},this.state),typeof t=="function"&&(t=t(re({},n),this.props)),t&&re(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),bi(this))},Rt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),bi(this))},Rt.prototype.render=tt,Ce=[],aa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gi=function(t,e){return t.__v.__b-e.__v.__b},fr.__r=0,ca=/(PointerCapture)$|Capture$/i,yi=0,wi=ga(!1),vi=ga(!0),la=0;var wf=0;function w(t,e,n,r,i,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var d={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--wf,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return U.vnode&&U.vnode(d),d}var oe,X,Si,_a,He=0,ba=[],it=U,xa=it.__b,Ca=it.__r,Sa=it.diffed,ka=it.__c,Ea=it.unmount,Ta=it.__;function Se(t,e){it.__h&&it.__h(X,t,He||e),He=0;var n=X.__H||(X.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function H(t){return He=1,kn(Pa,t)}function kn(t,e,n){var r=Se(oe++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Pa(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],d=r.t(l,a);l!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=X,!X.u)){var i=function(a,l,d){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(m){return!!m.__c});if(c.every(function(m){return!m.__N}))return!o||o.call(this,a,l,d);var f=r.__c.props!==a;return c.forEach(function(m){if(m.__N){var g=m.__[0];m.__=m.__N,m.__N=void 0,g!==m.__[0]&&(f=!0)}}),o&&o.call(this,a,l,d)||f};X.u=!0;var o=X.shouldComponentUpdate,s=X.componentWillUpdate;X.componentWillUpdate=function(a,l,d){if(this.__e){var c=o;o=void 0,i(a,l,d),o=c}s&&s.call(this,a,l,d)},X.shouldComponentUpdate=i}return r.__N||r.__}function $(t,e){var n=Se(oe++,3);!it.__s&&Ti(n.__H,e)&&(n.__=t,n.i=e,X.__H.__h.push(n))}function se(t,e){var n=Se(oe++,4);!it.__s&&Ti(n.__H,e)&&(n.__=t,n.i=e,X.__h.push(n))}function F(t){return He=5,vt(function(){return{current:t}},[])}function En(t,e,n){He=6,se(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function vt(t,e){var n=Se(oe++,7);return Ti(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function et(t,e){return He=8,vt(function(){return t},e)}function ut(t){var e=X.context[t.__c],n=Se(oe++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(X)),e.props.value):t.__}function ki(t,e){it.useDebugValue&&it.useDebugValue(e?e(t):t)}function vf(t){var e=Se(oe++,10),n=H();return e.__=t,X.componentDidCatch||(X.componentDidCatch=function(r,i){e.__&&e.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function We(){var t=Se(oe++,11);if(!t.__){for(var e=X.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function _f(){for(var t;t=ba.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(mr),t.__H.__h.forEach(Ei),t.__H.__h=[]}catch(e){t.__H.__h=[],it.__e(e,t.__v)}}it.__b=function(t){X=null,xa&&xa(t)},it.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ta&&Ta(t,e)},it.__r=function(t){Ca&&Ca(t),oe=0;var e=(X=t.__c).__H;e&&(Si===X?(e.__h=[],X.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(mr),e.__h.forEach(Ei),e.__h=[],oe=0)),Si=X},it.diffed=function(t){Sa&&Sa(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ba.push(e)!==1&&_a===it.requestAnimationFrame||((_a=it.requestAnimationFrame)||bf)(_f)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Si=X=null},it.__c=function(t,e){e.some(function(n){try{n.__h.forEach(mr),n.__h=n.__h.filter(function(r){return!r.__||Ei(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],it.__e(r,n.__v)}}),ka&&ka(t,e)},it.unmount=function(t){Ea&&Ea(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{mr(r)}catch(i){e=i}}),n.__H=void 0,e&&it.__e(e,n.__v))};var Aa=typeof requestAnimationFrame=="function";function bf(t){var e,n=function(){clearTimeout(r),Aa&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Aa&&(e=requestAnimationFrame(n))}function mr(t){var e=X,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),X=e}function Ei(t){var e=X;t.__c=t.__(),X=e}function Ti(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Pa(t,e){return typeof e=="function"?e(t):e}function Ia(t,e){for(var n in e)t[n]=e[n];return t}function Ai(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function Pi(t,e){var n=e(),r=H({t:{__:n,u:e}}),i=r[0].t,o=r[1];return se(function(){i.__=n,i.u=e,Ii(i)&&o({t:i})},[t,n,e]),$(function(){return Ii(i)&&o({t:i}),t(function(){Ii(i)&&o({t:i})})},[t]),n}function Ii(t){var e,n,r=t.u,i=t.__;try{var o=r();return!((e=i)===(n=o)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return!0}}function Mi(t){t()}function Ri(t){return t}function Ni(){return[!1,Mi]}var Tn=se;function gr(t,e){this.props=t,this.context=e}function Ma(t,e){function n(i){var o=this.props.ref,s=o==i.ref;return!s&&o&&(o.call?o(null):o.current=null),e?!e(this.props,i)||!s:Ai(this.props,i)}function r(i){return this.shouldComponentUpdate=n,B(t,i)}return r.displayName="Memo("+(t.displayName||t.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(gr.prototype=new Rt).isPureReactComponent=!0,gr.prototype.shouldComponentUpdate=function(t,e){return Ai(this.props,t)||Ai(this.state,e)};var Ra=U.__b;U.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ra&&Ra(t)};var xf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function he(t){function e(n){var r=Ia({},n);return delete r.ref,t(r,n.ref||null)}return e.$$typeof=xf,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Na=function(t,e){return t==null?null:ie(ie(t).map(e))},Di={map:Na,forEach:Na,count:function(t){return t?ie(t).length:0},only:function(t){var e=ie(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:ie},Cf=U.__e;U.__e=function(t,e,n,r){if(t.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}Cf(t,e,n,r)};var Da=U.unmount;function La(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=Ia({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return La(r,e,n)})),t}function Oa(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return Oa(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function An(){this.__u=0,this.o=null,this.__b=null}function Ba(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Fa(t){var e,n,r;function i(o){if(e||(e=t()).then(function(s){n=s.default||s},function(s){r=s}),r)throw r;if(!n)throw e;return B(n,o)}return i.displayName="Lazy",i.__f=!0,i}function Ke(){this.i=null,this.l=null}U.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Da&&Da(t)},(An.prototype=new Rt).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=Ba(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Oa(l,l.__c.__P,l.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.o.pop();)d.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(s,s)},An.prototype.componentWillUnmount=function(){this.o=[]},An.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=La(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&B(tt,null,t.fallback);return i&&(i.__u&=-33),[B(tt,null,e.__a?null:t.children),i]};var Va=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function Sf(t){return this.getChildContext=function(){return t.context},t.children}function kf(t){var e=this,n=t.h;e.componentWillUnmount=function(){Sn(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),e.v||(e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),e.h.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.h.insertBefore(r,i)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}),Sn(B(Sf,{context:e.context},t.__v),e.v)}function Li(t,e){var n=B(kf,{__v:t,h:e});return n.containerInfo=e,n}(Ke.prototype=new Rt).__a=function(t){var e=this,n=Ba(e.__v),r=e.l.get(t);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Va(e,t,r)):i()};n?n(o):o()}},Ke.prototype.render=function(t){this.i=null,this.l=new Map;var e=ie(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Ke.prototype.componentDidUpdate=Ke.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){Va(t,n,e)})};var Ua=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Ef=/^(?: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]/,Tf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Af=/[A-Z0-9]/g,Pf=typeof document<"u",If=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function $a(t,e,n){return e.__k==null&&(e.textContent=""),Sn(t,e),typeof n=="function"&&n(),t?t.__c:null}function za(t,e,n){return va(t,e),typeof n=="function"&&n(),t?t.__c:null}Rt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Rt.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var ja=U.event;function Mf(){}function Rf(){return this.cancelBubble}function Nf(){return this.defaultPrevented}U.event=function(t){return ja&&(t=ja(t)),t.persist=Mf,t.isPropagationStopped=Rf,t.isDefaultPrevented=Nf,t.nativeEvent=t};var Oi,Df={enumerable:!1,configurable:!0,get:function(){return this.class}},Ha=U.vnode;U.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var s in n){var a=n[s];if(!(s==="value"&&"defaultValue"in n&&a==null||Pf&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||If(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":Tf.test(s)&&(s=l):l=s="oninput":o&&Ef.test(s)?s=s.replace(Af,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&i[s=l]&&(s="oninputCapture"),i[s]=a}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ie(n.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=ie(n.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Df)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),e.props=i}(t),t.$$typeof=Ua,Ha&&Ha(t)};var Wa=U.__r;U.__r=function(t){Wa&&Wa(t),Oi=t.__c};var Ka=U.diffed;U.diffed=function(t){Ka&&Ka(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Oi=null};var qa={ReactCurrentDispatcher:{current:{readContext:function(t){return Oi.__n[t.__c].props.value},useCallback:et,useContext:ut,useDebugValue:ki,useDeferredValue:Ri,useEffect:$,useId:We,useImperativeHandle:En,useInsertionEffect:Tn,useLayoutEffect:se,useMemo:vt,useReducer:kn,useRef:F,useState:H,useSyncExternalStore:Pi,useTransition:Ni}}},Ya="18.3.1";function Ga(t){return B.bind(null,t)}function qe(t){return!!t&&t.$$typeof===Ua}function Xa(t){return qe(t)&&t.type===tt}function Za(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Bi(t){return qe(t)?yf.apply(null,arguments):t}function Ja(t){return!!t.__k&&(Sn(null,t),!0)}function Qa(t){return t&&(t.base||t.nodeType===1&&t)||null}var tc=function(t,e){return t(e)},ec=function(t,e){return t(e)},nc=tt,rc=qe,ke={useState:H,useId:We,useReducer:kn,useEffect:$,useLayoutEffect:se,useInsertionEffect:Tn,useTransition:Ni,useDeferredValue:Ri,useSyncExternalStore:Pi,startTransition:Mi,useRef:F,useImperativeHandle:En,useMemo:vt,useCallback:et,useContext:ut,useDebugValue:ki,version:"18.3.1",Children:Di,render:$a,hydrate:za,unmountComponentAtNode:Ja,createPortal:Li,createElement:B,createContext:Et,createFactory:Ga,cloneElement:Bi,createRef:da,Fragment:tt,isValidElement:qe,isElement:rc,isFragment:Xa,isMemo:Za,findDOMNode:Qa,Component:Rt,PureComponent:gr,memo:Ma,forwardRef:he,flushSync:ec,unstable_batchedUpdates:tc,StrictMode:nc,Suspense:An,SuspenseList:Ke,lazy:Fa,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qa};const Lf=Object.freeze(Object.defineProperty({__proto__:null,Children:Di,Component:Rt,Fragment:tt,PureComponent:gr,StrictMode:nc,Suspense:An,SuspenseList:Ke,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qa,cloneElement:Bi,createContext:Et,createElement:B,createFactory:Ga,createPortal:Li,createRef:da,default:ke,findDOMNode:Qa,flushSync:ec,forwardRef:he,hydrate:za,isElement:rc,isFragment:Xa,isMemo:Za,isValidElement:qe,lazy:Fa,memo:Ma,render:$a,startTransition:Mi,unmountComponentAtNode:Ja,unstable_batchedUpdates:tc,useCallback:et,useContext:ut,useDebugValue:ki,useDeferredValue:Ri,useEffect:$,useErrorBoundary:vf,useId:We,useImperativeHandle:En,useInsertionEffect:Tn,useLayoutEffect:se,useMemo:vt,useReducer:kn,useRef:F,useState:H,useSyncExternalStore:Pi,useTransition:Ni,version:Ya},Symbol.toStringTag,{value:"Module"})),Of='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,*:before,*:after{border-color:hsl(var(--border))}#deskcord-shadow-container{color:hsl(var(--foreground));font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.dc-scroll{scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:transparent transparent;transition:scrollbar-color .3s ease}.dc-scroll.dc-scroll--active{scrollbar-color:rgba(0,0,0,.25) transparent}.dc-scroll::-webkit-scrollbar{width:6px}.dc-scroll::-webkit-scrollbar-track{background:transparent}.dc-scroll::-webkit-scrollbar-thumb{background-color:transparent;border-radius:9999px;-webkit-transition:background-color .3s ease;transition:background-color .3s ease}.dc-scroll.dc-scroll--active::-webkit-scrollbar-thumb{background-color:#00000040}.dark .dc-scroll.dc-scroll--active{scrollbar-color:rgba(255,255,255,.3) transparent}.dark .dc-scroll.dc-scroll--active::-webkit-scrollbar-thumb{background-color:#ffffff4d}*,:before,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.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}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-0\\.5{bottom:-.125rem}.-end-0\\.5{inset-inline-end:-.125rem}.bottom-0{bottom:0}.bottom-\\[22\\%\\]{bottom:22%}.bottom-full{bottom:100%}.end-0{inset-inline-end:0px}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.right-1{right:.25rem}.start-0{inset-inline-start:0px}.top-0{top:0}.top-1{top:.25rem}.top-full{top:100%}.z-20{z-index:20}.m-2{margin:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-\\[3px\\]{margin-top:3px;margin-bottom:3px}.\\!me-1{margin-inline-end:.25rem!important}.\\!me-1\\.5{margin-inline-end:.375rem!important}.\\!ms-auto{margin-inline-start:auto!important}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.me-11{margin-inline-end:2.75rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.ms-0\\.5{margin-inline-start:.125rem}.ms-2{margin-inline-start:.5rem}.ms-auto{margin-inline-start:auto}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.\\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.size-2\\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\\[32px\\]{width:32px;height:32px}.\\!h-2\\.5{height:.625rem!important}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-32{height:8rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[10px\\]{height:10px}.h-\\[33px\\]{height:33px}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-\\[100px\\]{max-height:100px}.max-h-\\[200px\\]{max-height:200px}.min-h-0{min-height:0px}.min-h-\\[55px\\]{min-height:55px}.\\!w-2\\.5{width:.625rem!important}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-32{width:8rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[33px\\]{width:33px}.w-\\[40px\\]{width:40px}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-10{min-width:2.5rem}.max-w-\\[100px\\]{max-width:100px}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[240px\\]{max-width:240px}.max-w-\\[300px\\]{max-width:300px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: -50%;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))}.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 slide-in{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}.animate-slide-in{animation:slide-in .2s ease-out}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.\\!justify-between{justify-content:space-between!important}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-.5rem * var(--tw-space-x-reverse));margin-left:calc(-.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-\\[3px\\]>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(3px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(3px * var(--tw-space-y-reverse))}.space-y-reverse>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 1}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.\\!rounded-sm{border-radius:calc(var(--radius) - 4px)!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-\\[3px\\]{border-width:3px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-solid{border-style:solid}.\\!border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity))!important}.border-current{border-color:currentColor}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-gray-200{--tw-border-opacity: 1;border-top-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.\\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.bg-\\[var\\(--dc-primary\\)\\]{background-color:var(--dc-primary)}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-teal-400{--tw-bg-opacity: 1;background-color:rgb(45 212 191 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-80{--tw-bg-opacity: .8}.fill-black{fill:#000}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.\\!py-0\\.5{padding-top:.125rem!important;padding-bottom:.125rem!important}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\\[3px\\]{padding-left:3px;padding-right:3px}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pl-3{padding-left:.75rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.ps-11{padding-inline-start:2.75rem}.ps-3\\.5{padding-inline-start:.875rem}.text-left{text-align:left}.text-center{text-align:center}.text-end{text-align:end}.align-bottom{vertical-align:bottom}.\\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-\\[12px\\]{font-size:12px}.text-\\[7px\\]{font-size:7px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg\\/5{font-size:1.125rem;line-height:1.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-sm\\/3{font-size:.875rem;line-height:.75rem}.text-xs,.text-xs\\/4{font-size:.75rem;line-height:1rem}.\\!font-medium{font-weight:500!important}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.leading-\\[11px\\]{line-height:11px}.tracking-tight{letter-spacing:-.025em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-slate-50{--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13 148 136 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity))}.no-underline{text-decoration-line:none}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.\\!shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.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)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--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(3px + 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)}.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)}.ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.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)}.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)}.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)}.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}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-500{animation-duration:.5s}.running{animation-play-state:running}:host,#deskcord-shadow-container{overflow-x:hidden;--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--dc-primary: #7289DA;--dc-primary-mid: #5B6EAB;--dc-primary-dark: #22252A}.dark,:host(.dark) #deskcord-shadow-container{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}@keyframes dc-typing-bounce{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-3px)}}.dc-typing-dot{animation:dc-typing-bounce .9s ease-in-out infinite}@media (prefers-reduced-motion: reduce){.dc-typing-dot{animation:none}}.hover\\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.hover\\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.hover\\:bg-\\[var\\(--dc-primary-mid\\)\\]:hover{background-color:var(--dc-primary-mid)}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:z-10:focus{z-index:10}.focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--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)}.focus\\:ring-\\[var\\(--dc-primary\\)\\]:focus{--tw-ring-color: var(--dc-primary)}.focus\\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.focus\\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity))}.focus\\:ring-opacity-50:focus{--tw-ring-opacity: .5}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:transform-none:disabled{transform:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}.selected .hs-combo-box-selected\\:block,.selected.hs-combo-box-selected\\:block{display:block}.complete .hs-file-upload-complete\\:bg-green-600,.complete.hs-file-upload-complete\\:bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.dark\\:\\!border-neutral-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(64 64 64 / var(--tw-border-opacity))!important}.dark\\:border-neutral-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity))}.dark\\:border-neutral-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity))}.dark\\:border-neutral-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity))}.dark\\:\\!bg-neutral-800:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(38 38 38 / var(--tw-bg-opacity))!important}.dark\\:bg-blue-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.dark\\:bg-neutral-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(115 115 115 / var(--tw-bg-opacity))}.dark\\:bg-neutral-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.dark\\:bg-neutral-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.dark\\:bg-neutral-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.dark\\:bg-opacity-80:is(.dark *){--tw-bg-opacity: .8}.dark\\:fill-neutral-200:is(.dark *){fill:#e5e5e5}.dark\\:text-blue-500:is(.dark *){--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.dark\\:text-neutral-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity))}.dark\\:text-neutral-400:is(.dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity))}.dark\\:text-neutral-500:is(.dark *){--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity))}.dark\\:text-neutral-600:is(.dark *){--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity))}.dark\\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\\:placeholder-neutral-500:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(115 115 115 / var(--tw-placeholder-opacity))}.dark\\:placeholder-neutral-500:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(115 115 115 / var(--tw-placeholder-opacity))}.dark\\:ring-neutral-900:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity))}.dark\\:hover\\:bg-neutral-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.dark\\:hover\\:bg-neutral-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.dark\\:hover\\:text-neutral-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity))}.dark\\:hover\\:text-neutral-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity))}.dark\\:focus\\:bg-neutral-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}@media (min-width: 640px){.sm\\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem}}@media (min-width: 768px){.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}',Bf=".yarl__fullsize{height:100%;width:100%}.yarl__relative{position:relative}.yarl__portal{bottom:0;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transition:opacity var(--yarl__fade_animation_duration,.25s) var(--yarl__fade_animation_timing_function,ease);z-index:var(--yarl__portal_zindex,9999)}.yarl__portal_open{opacity:1}.yarl__container{background-color:var(--yarl__container_background_color,var(--yarl__color_backdrop,#000));bottom:0;left:0;outline:none;overflow:hidden;overscroll-behavior:var(--yarl__controller_overscroll_behavior,contain);position:absolute;right:0;top:0;touch-action:var(--yarl__controller_touch_action,none);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yarl__carousel{align-content:center;align-items:stretch;display:flex;flex:0 0 auto;height:100%;justify-content:center;opacity:var(--yarl__pull_opacity,1);transform:translate(var(--yarl__swipe_offset,0),var(--yarl__pull_offset,0));width:calc(100% + (var(--yarl__carousel_slides_count) - 1)*(100% + var(--yarl__carousel_spacing_px, 0)*1px + var(--yarl__carousel_spacing_percent, 0)*1%))}.yarl__carousel_with_slides{-moz-column-gap:calc(var(--yarl__carousel_spacing_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_spacing_percent, 0)*1%);column-gap:calc(var(--yarl__carousel_spacing_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_spacing_percent, 0)*1%)}.yarl__flex_center{align-content:center;align-items:center;display:flex;justify-content:center}.yarl__slide{flex:1;overflow:hidden;padding:calc(var(--yarl__carousel_padding_px, 0)*1px + 100/(var(--yarl__carousel_slides_count)*100 + (var(--yarl__carousel_slides_count) - 1)*var(--yarl__carousel_spacing_percent, 0))*var(--yarl__carousel_padding_percent, 0)*1%);position:relative}[dir=rtl] .yarl__slide{--yarl__direction:-1}.yarl__slide_image{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;touch-action:var(--yarl__controller_touch_action,none);-moz-user-select:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.yarl__slide_image_cover{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.yarl__slide_image_loading{opacity:0}@media screen and (min-width:800px){.yarl__slide_wrapper:not(.yarl__slide_wrapper_interactive) .yarl__slide_image{-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0);-webkit-transform-style:preserve-3d}}.yarl__slide_placeholder{left:50%;line-height:0;position:absolute;top:50%;transform:translate(-50%) translateY(-50%)}.yarl__slide_loading{animation:yarl__delayed_fadein 1s linear;color:var(--yarl__slide_icon_loading_color,var(--yarl__color_button,hsla(0,0%,100%,.8)))}.yarl__slide_loading line{animation:yarl__stroke_opacity 1s linear infinite}.yarl__slide_loading line:first-of-type{animation-delay:-1.875s}.yarl__slide_loading line:nth-of-type(2){animation-delay:-1.75s}.yarl__slide_loading line:nth-of-type(3){animation-delay:-1.625s}.yarl__slide_loading line:nth-of-type(4){animation-delay:-1.5s}.yarl__slide_loading line:nth-of-type(5){animation-delay:-1.375s}.yarl__slide_loading line:nth-of-type(6){animation-delay:-1.25s}.yarl__slide_loading line:nth-of-type(7){animation-delay:-1.125s}.yarl__slide_loading line:nth-of-type(8){animation-delay:-1s}.yarl__slide_error{color:var(--yarl__slide_icon_error_color,red);height:var(--yarl__slide_icon_error_size,48px);width:var(--yarl__slide_icon_error_size,48px)}@media (prefers-reduced-motion){.yarl__portal,.yarl__slide{transition:unset}.yarl__slide_loading,.yarl__slide_loading line{animation:unset}}.yarl__toolbar{bottom:auto;display:flex;justify-content:flex-end;left:auto;padding:var(--yarl__toolbar_padding,8px);position:absolute;right:0;top:0}[dir=rtl] .yarl__toolbar{bottom:auto;left:0;right:auto;top:0}.yarl__icon{height:var(--yarl__icon_size,32px);width:var(--yarl__icon_size,32px)}.yarl__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--yarl__button_background_color,transparent);border:var(--yarl__button_border,0);color:var(--yarl__color_button,hsla(0,0%,100%,.8));cursor:pointer;filter:var(--yarl__button_filter,drop-shadow(2px 2px 2px rgba(0,0,0,.8)));line-height:0;margin:var(--yarl__button_margin,0);outline:none;padding:var(--yarl__button_padding,8px);-webkit-tap-highlight-color:transparent}.yarl__button:focus{color:var(--yarl__color_button_active,#fff)}.yarl__button:focus:not(:focus-visible){color:var(--yarl__color_button,hsla(0,0%,100%,.8))}.yarl__button:focus-visible{color:var(--yarl__color_button_active,#fff)}@media (hover:hover){.yarl__button:focus-visible:hover,.yarl__button:focus:hover,.yarl__button:hover{color:var(--yarl__color_button_active,#fff)}}.yarl__button:disabled{color:var(--yarl__color_button_disabled,hsla(0,0%,100%,.4));cursor:default}.yarl__navigation_next,.yarl__navigation_prev{padding:var(--yarl__navigation_button_padding,24px 16px);position:absolute;top:50%;transform:translateY(-50%)}.yarl__navigation_prev{left:0}[dir=rtl] .yarl__navigation_prev{left:unset;right:0;transform:translateY(-50%) rotate(180deg)}.yarl__navigation_next{right:0}[dir=rtl] .yarl__navigation_next{left:0;right:unset;transform:translateY(-50%) rotate(180deg)}.yarl__no_scroll{height:100%;overflow:hidden;overscroll-behavior:none}@keyframes yarl__delayed_fadein{0%{opacity:0}80%{opacity:0}to{opacity:1}}@keyframes yarl__stroke_opacity{0%{stroke-opacity:1}to{stroke-opacity:.125}}";function Ff(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}const{useRef:Vf}=ke;function Fi(t){const e=Vf();return n=>{const r=t(n);return Ff(e.current,r)?e.current:e.current=r}}const Vi=Et({});function Ui(t){const e=F(null);return e.current===null&&(e.current=t()),e.current}const $i=typeof window<"u",ic=$i?se:$,yr=Et(null);function zi(t,e){t.indexOf(e)===-1&&t.push(e)}function ji(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ae=(t,e,n)=>n>e?e:n<t?t:n;let wr=()=>{};const ce={},oc=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function sc(t){return typeof t=="object"&&t!==null}const ac=t=>/^0[^.\s]+$/u.test(t);function Hi(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ft=t=>t,Uf=(t,e)=>n=>e(t(n)),Pn=(...t)=>t.reduce(Uf),In=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Wi{constructor(){this.subscriptions=[]}add(e){return zi(this.subscriptions,e),()=>ji(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Gt=t=>t*1e3,Xt=t=>t/1e3;function cc(t,e){return e?t*(1e3/e):0}const lc=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,$f=1e-7,zf=12;function jf(t,e,n,r,i){let o,s,a=0;do s=e+(n-e)/2,o=lc(s,r,i)-t,o>0?n=s:e=s;while(Math.abs(o)>$f&&++a<zf);return s}function Mn(t,e,n,r){if(t===e&&n===r)return Ft;const i=o=>jf(o,0,1,t,n);return o=>o===0||o===1?o:lc(i(o),e,r)}const uc=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dc=t=>e=>1-t(1-e),hc=Mn(.33,1.53,.69,.99),Ki=dc(hc),fc=uc(Ki),pc=t=>(t*=2)<1?.5*Ki(t):.5*(2-Math.pow(2,-10*(t-1))),qi=t=>1-Math.sin(Math.acos(t)),mc=dc(qi),gc=uc(qi),Hf=Mn(.42,0,1,1),Wf=Mn(0,0,.58,1),yc=Mn(.42,0,.58,1),Kf=t=>Array.isArray(t)&&typeof t[0]!="number",wc=t=>Array.isArray(t)&&typeof t[0]=="number",vc={linear:Ft,easeIn:Hf,easeInOut:yc,easeOut:Wf,circIn:qi,circInOut:gc,circOut:mc,backIn:Ki,backInOut:fc,backOut:hc,anticipate:pc},qf=t=>typeof t=="string",_c=t=>{if(wc(t)){wr(t.length===4);const[e,n,r,i]=t;return Mn(e,n,r,i)}else if(qf(t))return wr(vc[t]!==void 0),vc[t];return t},vr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],bc={value:null,addProjectionMetrics:null};function Yf(t,e){let n=new Set,r=new Set,i=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function d(f){s.has(f)&&(c.schedule(f),t()),l++,f(a)}const c={schedule:(f,m=!1,g=!1)=>{const v=g&&i?n:r;return m&&s.add(f),v.has(f)||v.add(f),f},cancel:f=>{r.delete(f),s.delete(f)},process:f=>{if(a=f,i){o=!0;return}i=!0,[n,r]=[r,n],n.forEach(d),e&&bc.value&&bc.value.frameloop[e].push(l),l=0,n.clear(),i=!1,o&&(o=!1,c.process(f))}};return c}const Gf=40;function xc(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=vr.reduce((T,M)=>(T[M]=Yf(o,e?M:void 0),T),{}),{setup:a,read:l,resolveKeyframes:d,preUpdate:c,update:f,preRender:m,render:g,postRender:_}=s,v=()=>{const T=ce.useManualTiming?i.timestamp:performance.now();n=!1,ce.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(T-i.timestamp,Gf),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),l.process(i),d.process(i),c.process(i),f.process(i),m.process(i),g.process(i),_.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(v))},C=()=>{n=!0,r=!0,i.isProcessing||t(v)};return{schedule:vr.reduce((T,M)=>{const A=s[M];return T[M]=(R,N=!1,k=!1)=>(n||C(),A.schedule(R,N,k)),T},{}),cancel:T=>{for(let M=0;M<vr.length;M++)s[vr[M]].cancel(T)},state:i,steps:s}}const{schedule:nt,cancel:fe,state:Ct,steps:Yi}=xc(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ft,!0);let _r;function Xf(){_r=void 0}const Pt={now:()=>(_r===void 0&&Pt.set(Ct.isProcessing||ce.useManualTiming?Ct.timestamp:performance.now()),_r),set:t=>{_r=t,queueMicrotask(Xf)}},Cc=t=>e=>typeof e=="string"&&e.startsWith(t),Gi=Cc("--"),Zf=Cc("var(--"),Xi=t=>Zf(t)?Jf.test(t.split("/*")[0].trim()):!1,Jf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ye={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Rn={...Ye,transform:t=>ae(0,1,t)},br={...Ye,default:1},Nn=t=>Math.round(t*1e5)/1e5,Zi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qf(t){return t==null}const tp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ji=(t,e)=>n=>!!(typeof n=="string"&&tp.test(n)&&n.startsWith(t)||e&&!Qf(n)&&Object.prototype.hasOwnProperty.call(n,e)),Sc=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(Zi);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},ep=t=>ae(0,255,t),Qi={...Ye,transform:t=>Math.round(ep(t))},Ee={test:Ji("rgb","red"),parse:Sc("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Qi.transform(t)+", "+Qi.transform(e)+", "+Qi.transform(n)+", "+Nn(Rn.transform(r))+")"};function np(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const to={test:Ji("#"),parse:np,transform:Ee.transform},Dn=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),pe=Dn("deg"),Zt=Dn("%"),V=Dn("px"),rp=Dn("vh"),ip=Dn("vw"),kc={...Zt,parse:t=>Zt.parse(t)/100,transform:t=>Zt.transform(t*100)},Ge={test:Ji("hsl","hue"),parse:Sc("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Zt.transform(Nn(e))+", "+Zt.transform(Nn(n))+", "+Nn(Rn.transform(r))+")"},mt={test:t=>Ee.test(t)||to.test(t)||Ge.test(t),parse:t=>Ee.test(t)?Ee.parse(t):Ge.test(t)?Ge.parse(t):to.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ee.transform(t):Ge.transform(t),getAnimatableNone:t=>{const e=mt.parse(t);return e.alpha=0,mt.transform(e)}},op=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sp(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Zi))==null?void 0:e.length)||0)+(((n=t.match(op))==null?void 0:n.length)||0)>0}const Ec="number",Tc="color",ap="var",cp="var(",Ac="${}",lp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ln(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(lp,l=>(mt.test(l)?(r.color.push(o),i.push(Tc),n.push(mt.parse(l))):l.startsWith(cp)?(r.var.push(o),i.push(ap),n.push(l)):(r.number.push(o),i.push(Ec),n.push(parseFloat(l))),++o,Ac)).split(Ac);return{values:n,split:a,indexes:r,types:i}}function Pc(t){return Ln(t).values}function Ic(t){const{split:e,types:n}=Ln(t),r=e.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=e[s],i[s]!==void 0){const a=n[s];a===Ec?o+=Nn(i[s]):a===Tc?o+=mt.transform(i[s]):o+=i[s]}return o}}const up=t=>typeof t=="number"?0:mt.test(t)?mt.getAnimatableNone(t):t;function dp(t){const e=Pc(t);return Ic(t)(e.map(up))}const me={test:sp,parse:Pc,createTransformer:Ic,getAnimatableNone:dp};function eo(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function hp({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,o=0,s=0;if(!e)i=o=s=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=eo(l,a,t+1/3),o=eo(l,a,t),s=eo(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function xr(t,e){return n=>n>0?e:t}const ot=(t,e,n)=>t+(e-t)*n,no=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},fp=[to,Ee,Ge],pp=t=>fp.find(e=>e.test(t));function Mc(t){const e=pp(t);if(!e)return!1;let n=e.parse(t);return e===Ge&&(n=hp(n)),n}const Rc=(t,e)=>{const n=Mc(t),r=Mc(e);if(!n||!r)return xr(t,e);const i={...n};return o=>(i.red=no(n.red,r.red,o),i.green=no(n.green,r.green,o),i.blue=no(n.blue,r.blue,o),i.alpha=ot(n.alpha,r.alpha,o),Ee.transform(i))},ro=new Set(["none","hidden"]);function mp(t,e){return ro.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gp(t,e){return n=>ot(t,e,n)}function io(t){return typeof t=="number"?gp:typeof t=="string"?Xi(t)?xr:mt.test(t)?Rc:vp:Array.isArray(t)?Nc:typeof t=="object"?mt.test(t)?Rc:yp:xr}function Nc(t,e){const n=[...t],r=n.length,i=t.map((o,s)=>io(o)(o,e[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function yp(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=io(t[i])(t[i],e[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function wp(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],s=t.indexes[o][r[o]],a=t.values[s]??0;n[i]=a,r[o]++}return n}const vp=(t,e)=>{const n=me.createTransformer(e),r=Ln(t),i=Ln(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ro.has(t)&&!i.values.length||ro.has(e)&&!r.values.length?mp(t,e):Pn(Nc(wp(r,i),i.values),n):xr(t,e)};function Dc(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ot(t,e,n):io(t)(t,e)}const _p=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>nt.update(e,n),stop:()=>fe(e),now:()=>Ct.isProcessing?Ct.timestamp:Pt.now()}},Lc=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)r+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Cr=2e4;function oo(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Cr;)e+=n,r=t.next(e);return e>=Cr?1/0:e}function bp(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(oo(r),Cr);return{type:"keyframes",ease:o=>r.next(i*o).value/e,duration:Xt(i)}}const xp=5;function Oc(t,e,n){const r=Math.max(e-xp,0);return cc(n-t(r),e-r)}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},so=.001;function Cp({duration:t=at.duration,bounce:e=at.bounce,velocity:n=at.velocity,mass:r=at.mass}){let i,o,s=1-e;s=ae(at.minDamping,at.maxDamping,s),t=ae(at.minDuration,at.maxDuration,Xt(t)),s<1?(i=d=>{const c=d*s,f=c*t,m=c-n,g=ao(d,s),_=Math.exp(-f);return so-m/g*_},o=d=>{const f=d*s*t,m=f*n+n,g=Math.pow(s,2)*Math.pow(d,2)*t,_=Math.exp(-f),v=ao(Math.pow(d,2),s);return(-i(d)+so>0?-1:1)*((m-g)*_)/v}):(i=d=>{const c=Math.exp(-d*t),f=(d-n)*t+1;return-so+c*f},o=d=>{const c=Math.exp(-d*t),f=(n-d)*(t*t);return c*f});const a=5/t,l=kp(i,o,a);if(t=Gt(t),isNaN(l))return{stiffness:at.stiffness,damping:at.damping,duration:t};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:s*2*Math.sqrt(r*d),duration:t}}}const Sp=12;function kp(t,e,n){let r=n;for(let i=1;i<Sp;i++)r=r-t(r)/e(r);return r}function ao(t,e){return t*Math.sqrt(1-e*e)}const Ep=["duration","bounce"],Tp=["stiffness","damping","mass"];function Bc(t,e){return e.some(n=>t[n]!==void 0)}function Ap(t){let e={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...t};if(!Bc(t,Tp)&&Bc(t,Ep))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*ae(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:at.mass,stiffness:i,damping:o}}else{const n=Cp(t);e={...e,...n,mass:at.mass},e.isResolvedFromDuration=!0}return e}function Sr(t=at.visualDuration,e=at.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:d,mass:c,duration:f,velocity:m,isResolvedFromDuration:g}=Ap({...n,velocity:-Xt(n.velocity||0)}),_=m||0,v=d/(2*Math.sqrt(l*c)),C=s-o,b=Xt(Math.sqrt(l/c)),S=Math.abs(C)<5;r||(r=S?at.restSpeed.granular:at.restSpeed.default),i||(i=S?at.restDelta.granular:at.restDelta.default);let T;if(v<1){const A=ao(b,v);T=R=>{const N=Math.exp(-v*b*R);return s-N*((_+v*b*C)/A*Math.sin(A*R)+C*Math.cos(A*R))}}else if(v===1)T=A=>s-Math.exp(-b*A)*(C+(_+b*C)*A);else{const A=b*Math.sqrt(v*v-1);T=R=>{const N=Math.exp(-v*b*R),k=Math.min(A*R,300);return s-N*((_+v*b*C)*Math.sinh(k)+A*C*Math.cosh(k))/A}}const M={calculatedDuration:g&&f||null,next:A=>{const R=T(A);if(g)a.done=A>=f;else{let N=A===0?_:0;v<1&&(N=A===0?Gt(_):Oc(T,A,R));const k=Math.abs(N)<=r,P=Math.abs(s-R)<=i;a.done=k&&P}return a.value=a.done?s:R,a},toString:()=>{const A=Math.min(oo(M),Cr),R=Lc(N=>M.next(A*N).value,A,30);return A+"ms "+R},toTransition:()=>{}};return M}Sr.applyToOptions=t=>{const e=bp(t,100,Sr);return t.ease=e.ease,t.duration=Gt(e.duration),t.type="keyframes",t};function co({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:d=.5,restSpeed:c}){const f=t[0],m={done:!1,value:f},g=k=>a!==void 0&&k<a||l!==void 0&&k>l,_=k=>a===void 0?l:l===void 0||Math.abs(a-k)<Math.abs(l-k)?a:l;let v=n*e;const C=f+v,b=s===void 0?C:s(C);b!==C&&(v=b-f);const S=k=>-v*Math.exp(-k/r),T=k=>b+S(k),M=k=>{const P=S(k),D=T(k);m.done=Math.abs(P)<=d,m.value=m.done?b:D};let A,R;const N=k=>{g(m.value)&&(A=k,R=Sr({keyframes:[m.value,_(m.value)],velocity:Oc(T,k,m.value),damping:i,stiffness:o,restDelta:d,restSpeed:c}))};return N(0),{calculatedDuration:null,next:k=>{let P=!1;return!R&&A===void 0&&(P=!0,M(k),N(k)),A!==void 0&&k>=A?R.next(k-A):(!P&&M(k),m)}}}function Pp(t,e,n){const r=[],i=n||ce.mix||Dc,o=t.length-1;for(let s=0;s<o;s++){let a=i(t[s],t[s+1]);if(e){const l=Array.isArray(e)?e[s]||Ft:e;a=Pn(l,a)}r.push(a)}return r}function Ip(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const o=t.length;if(wr(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Pp(e,r,i),l=a.length,d=c=>{if(s&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const m=In(t[f],t[f+1],c);return a[f](m)};return n?c=>d(ae(t[0],t[o-1],c)):d}function Mp(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=In(0,e,r);t.push(ot(n,1,i))}}function Rp(t){const e=[0];return Mp(e,t.length-1),e}function Np(t,e){return t.map(n=>n*e)}function Dp(t,e){return t.map(()=>e||yc).splice(0,t.length-1)}function On({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Kf(r)?r.map(_c):_c(r),o={done:!1,value:e[0]},s=Np(n&&n.length===e.length?n:Rp(e),t),a=Ip(s,e,{ease:Array.isArray(i)?i:Dp(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Lp=t=>t!==null;function lo(t,{repeat:e,repeatType:n="loop"},r,i=1){const o=t.filter(Lp),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||r===void 0?o[a]:r}const Op={decay:co,inertia:co,tween:On,keyframes:On,spring:Sr};function Fc(t){typeof t.type=="string"&&(t.type=Op[t.type])}class uo{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Bp=t=>t/100;class ho extends uo{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Pt.now()&&this.tick(Pt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Fc(e);const{type:n=On,repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const l=n||On;l!==On&&typeof a[0]!="number"&&(this.mixKeyframes=Pn(Bp,Dc(a[0],a[1])),a=[0,100]);const d=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=oo(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:c,repeat:f,repeatType:m,repeatDelay:g,type:_,onUpdate:v,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let T=this.currentTime,M=r;if(f){const k=Math.min(this.currentTime,i)/a;let P=Math.floor(k),D=k%1;!D&&k>=1&&(D=1),D===1&&P--,P=Math.min(P,f+1),!!(P%2)&&(m==="reverse"?(D=1-D,g&&(D-=g/a)):m==="mirror"&&(M=s)),T=ae(0,1,D)*a}const A=S?{done:!1,value:c[0]}:M.next(T);o&&(A.value=o(A.value));let{done:R}=A;!S&&l!==null&&(R=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return N&&_!==co&&(A.value=lo(c,this.options,C,this.speed)),v&&v(A.value),N&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return Xt(this.calculatedDuration)}get time(){return Xt(this.currentTime)}set time(e){var n;e=Gt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Pt.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Xt(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:e=_p,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),(o=(i=this.options).onPlay)==null||o.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Pt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Fp(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Te=t=>t*180/Math.PI,fo=t=>{const e=Te(Math.atan2(t[1],t[0]));return po(e)},Vp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:fo,rotateZ:fo,skewX:t=>Te(Math.atan(t[1])),skewY:t=>Te(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},po=t=>(t=t%360,t<0&&(t+=360),t),Vc=fo,Uc=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$c=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Up={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Uc,scaleY:$c,scale:t=>(Uc(t)+$c(t))/2,rotateX:t=>po(Te(Math.atan2(t[6],t[5]))),rotateY:t=>po(Te(Math.atan2(-t[2],t[0]))),rotateZ:Vc,rotate:Vc,skewX:t=>Te(Math.atan(t[4])),skewY:t=>Te(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function mo(t){return t.includes("scale")?1:0}function go(t,e){if(!t||t==="none")return mo(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Up,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Vp,i=a}if(!i)return mo(e);const o=r[e],s=i[1].split(",").map(zp);return typeof o=="function"?o(s):s[o]}const $p=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return go(n,e)};function zp(t){return parseFloat(t.trim())}const Xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ze=new Set(Xe),zc=t=>t===Ye||t===V,jp=new Set(["x","y","z"]),Hp=Xe.filter(t=>!jp.has(t));function Wp(t){const e=[];return Hp.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ae={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>go(e,"x"),y:(t,{transform:e})=>go(e,"y")};Ae.translateX=Ae.x,Ae.translateY=Ae.y;const Pe=new Set;let yo=!1,wo=!1,vo=!1;function jc(){if(wo){const t=Array.from(Pe).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Wp(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))==null||a.set(s)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}wo=!1,yo=!1,Pe.forEach(t=>t.complete(vo)),Pe.clear()}function Hc(){Pe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(wo=!0)})}function Kp(){vo=!0,Hc(),jc(),vo=!1}class _o{constructor(e,n,r,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Pe.add(this),yo||(yo=!0,nt.read(Hc),nt.resolveKeyframes(jc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const o=i==null?void 0:i.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const a=r.readValue(n,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),i&&o===void 0&&i.set(e[0])}Fp(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Pe.delete(this)}cancel(){this.state==="scheduled"&&(Pe.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qp=t=>t.startsWith("--");function Yp(t,e,n){qp(e)?t.style.setProperty(e,n):t.style[e]=n}const Gp=Hi(()=>window.ScrollTimeline!==void 0),Xp={};function Zp(t,e){const n=Hi(t);return()=>Xp[e]??n()}const Wc=Zp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bn=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Kc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bn([0,.65,.55,1]),circOut:Bn([.55,0,1,.45]),backIn:Bn([.31,.01,.66,-.59]),backOut:Bn([.33,1.53,.69,.99])};function qc(t,e){if(t)return typeof t=="function"?Wc()?Lc(t,e):"ease-out":wc(t)?Bn(t):Array.isArray(t)?t.map(n=>qc(n,e)||Kc.easeOut):Kc[t]}function Jp(t,e,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},d=void 0){const c={[e]:n};l&&(c.offset=l);const f=qc(a,i);Array.isArray(f)&&(c.easing=f);const m={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(c,m)}function Yc(t){return typeof t=="function"&&"applyToOptions"in t}function Qp({type:t,...e}){return Yc(t)&&Wc()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class tm extends uo{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,wr(typeof e.type!="string");const d=Qp(e);this.animation=Jp(n,r,i,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=lo(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):Yp(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Xt(Number(e))}get time(){return Xt(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Gt(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Gp()?(this.animation.timeline=e,Ft):n(this)}}const Gc={anticipate:pc,backInOut:fc,circInOut:gc};function em(t){return t in Gc}function nm(t){typeof t.ease=="string"&&em(t.ease)&&(t.ease=Gc[t.ease])}const Xc=10;class rm extends tm{constructor(e){nm(e),Fc(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:o,...s}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new ho({...s,autoplay:!1}),l=Gt(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Xc).value,a.sample(l).value,Xc),a.stop()}}const Zc=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(me.test(t)||t==="0")&&!t.startsWith("url("));function im(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function om(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],s=Zc(i,e),a=Zc(o,e);return!s||!a?!1:im(t)||(n==="spring"||Yc(n))&&r}function bo(t){t.duration=0,t.type}const sm=new Set(["opacity","clipPath","filter","transform"]),am=Hi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cm(t){var c;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:o,type:s}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:d}=e.owner.getProps();return am()&&n&&sm.has(n)&&(n!=="transform"||!d)&&!l&&!r&&i!=="mirror"&&o!==0&&s!=="inertia"}const lm=40;class um extends uo{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:d,element:c,...f}){var _;super(),this.stop=()=>{var v,C;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Pt.now();const m={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,name:l,motionValue:d,element:c,...f},g=(c==null?void 0:c.KeyframeResolver)||_o;this.keyframeResolver=new g(a,(v,C,b)=>this.onKeyframesResolved(v,C,m,!b),l,d,c),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:d,onUpdate:c}=r;this.resolvedAt=Pt.now(),om(e,o,s,a)||((ce.instantAnimations||!l)&&(c==null||c(lo(e,r,n))),e[0]=e[e.length-1],bo(r),r.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>lm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},g=!d&&cm(m)?new rm({...m,element:m.motionValue.owner.current}):new ho(m);g.finished.then(()=>this.notifyFinished()).catch(Ft),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Kp()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const dm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hm(t){const e=dm.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function Jc(t,e,n=1){const[r,i]=hm(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const s=o.trim();return oc(s)?parseFloat(s):s}return Xi(i)?Jc(i,e,n+1):i}function xo(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const Qc=new Set(["width","height","top","left","right","bottom",...Xe]),fm={test:t=>t==="auto",parse:t=>t},tl=t=>e=>e.test(t),el=[Ye,V,Zt,pe,ip,rp,fm],nl=t=>el.find(tl(t));function pm(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ac(t):!0}const mm=new Set(["brightness","contrast","saturate","opacity"]);function gm(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Zi)||[];if(!r)return t;const i=n.replace(r,"");let o=mm.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+i+")"}const ym=/\b([a-z-]*)\(.*?\)/gu,Co={...me,getAnimatableNone:t=>{const e=t.match(ym);return e?e.map(gm).join(" "):t}},rl={...Ye,transform:Math.round},So={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V,...{rotate:pe,rotateX:pe,rotateY:pe,rotateZ:pe,scale:br,scaleX:br,scaleY:br,scaleZ:br,skew:pe,skewX:pe,skewY:pe,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Rn,originX:kc,originY:kc,originZ:V},zIndex:rl,fillOpacity:Rn,strokeOpacity:Rn,numOctaves:rl},wm={...So,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Co,WebkitFilter:Co},il=t=>wm[t];function ol(t,e){let n=il(t);return n!==Co&&(n=me),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const vm=new Set(["auto","none","0"]);function _m(t,e,n){let r=0,i;for(;r<t.length&&!i;){const o=t[r];typeof o=="string"&&!vm.has(o)&&Ln(o).values.length&&(i=t[r]),r++}if(i&&n)for(const o of e)t[o]=ol(n,i)}class bm extends _o{constructor(e,n,r,i,o){super(e,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let d=e[l];if(typeof d=="string"&&(d=d.trim(),Xi(d))){const c=Jc(d,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Qc.has(r)||e.length!==2)return;const[i,o]=e,s=nl(i),a=nl(o);if(s!==a)if(zc(s)&&zc(a))for(let l=0;l<e.length;l++){const d=e[l];typeof d=="string"&&(e[l]=parseFloat(d))}else Ae[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||pm(e[i]))&&r.push(i);r.length&&_m(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ae[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=r.length-1,s=r[o];r[o]=Ae[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,d])=>{e.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function xm(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const sl=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function al(t){return sc(t)&&"offsetHeight"in t}const cl=30,Cm=t=>!isNaN(parseFloat(t));class Sm{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const i=Pt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Pt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Cm(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Wi);const r=this.events[e].add(n);return e==="change"?()=>{r(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Pt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>cl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cl);return cc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Je(t,e){return new Sm(t,e)}const{schedule:ko,cancel:wb}=xc(queueMicrotask,!1),Ht={x:!1,y:!1};function ll(){return Ht.x||Ht.y}function km(t){return t==="x"||t==="y"?Ht[t]?null:(Ht[t]=!0,()=>{Ht[t]=!1}):Ht.x||Ht.y?null:(Ht.x=Ht.y=!0,()=>{Ht.x=Ht.y=!1})}function ul(t,e){const n=xm(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function dl(t){return!(t.pointerType==="touch"||ll())}function Em(t,e,n={}){const[r,i,o]=ul(t,n),s=a=>{if(!dl(a))return;const{target:l}=a,d=e(l,a);if(typeof d!="function"||!l)return;const c=f=>{dl(f)&&(d(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const hl=(t,e)=>e?t===e?!0:hl(t,e.parentElement):!1,Eo=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Tm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Am(t){return Tm.has(t.tagName)||t.tabIndex!==-1}const kr=new WeakSet;function fl(t){return e=>{e.key==="Enter"&&t(e)}}function To(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Pm=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=fl(()=>{if(kr.has(n))return;To(n,"down");const i=fl(()=>{To(n,"up")}),o=()=>To(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function pl(t){return Eo(t)&&!ll()}function Im(t,e,n={}){const[r,i,o]=ul(t,n),s=a=>{const l=a.currentTarget;if(!pl(a))return;kr.add(l);const d=e(l,a),c=(g,_)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),kr.has(l)&&kr.delete(l),pl(g)&&typeof d=="function"&&d(g,{success:_})},f=g=>{c(g,l===window||l===document||n.useGlobalTarget||hl(l,g.target))},m=g=>{c(g,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),al(a)&&(a.addEventListener("focus",d=>Pm(d,i)),!Am(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function ml(t){return sc(t)&&"ownerSVGElement"in t}function Mm(t){return ml(t)&&t.tagName==="svg"}const St=t=>!!(t&&t.getVelocity),Rm=[...el,mt,me],Nm=t=>Rm.find(tl(t)),Ao=Et({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Dm extends Rt{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=al(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Lm({children:t,isPresent:e,anchorX:n,root:r}){const i=We(),o=F(null),s=F({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=ut(Ao);return Tn(()=>{const{width:l,height:d,top:c,left:f,right:m}=s.current;if(e||!o.current||!l||!d)return;const g=n==="left"?`left: ${f}`:`right: ${m}`;o.current.dataset.motionPopId=i;const _=document.createElement("style");a&&(_.nonce=a);const v=r??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
2
- [data-motion-pop-id="${i}"] {
3
- position: absolute !important;
4
- width: ${l}px !important;
5
- height: ${d}px !important;
6
- ${g}px !important;
7
- top: ${c}px !important;
8
- }
9
- `),()=>{v.contains(_)&&v.removeChild(_)}},[e]),w(Dm,{isPresent:e,childRef:o,sizeRef:s,children:Bi(t,{ref:o})})}const Om=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const d=Ui(Bm),c=We();let f=!0,m=vt(()=>(f=!1,{id:c,initial:e,isPresent:n,custom:i,onExitComplete:g=>{d.set(g,!0);for(const _ of d.values())if(!_)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return o&&f&&(m={...m}),vt(()=>{d.forEach((g,_)=>d.set(_,!1))},[n]),$(()=>{!n&&!d.size&&r&&r()},[n]),s==="popLayout"&&(t=w(Lm,{isPresent:n,anchorX:a,root:l,children:t})),w(yr.Provider,{value:m,children:t})};function Bm(){return new Map}function gl(t=!0){const e=ut(yr);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,o=We();$(()=>{if(t)return i(o)},[t]);const s=et(()=>t&&r&&r(o),[o,r,t]);return!n&&r?[!1,s]:[!0]}const Er=t=>t.key||"";function yl(t){const e=[];return Di.forEach(t,n=>{qe(n)&&e.push(n)}),e}const Tr=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[d,c]=gl(s),f=vt(()=>yl(t),[t]),m=s&&!d?[]:f.map(Er),g=F(!0),_=F(f),v=Ui(()=>new Map),[C,b]=H(f),[S,T]=H(f);ic(()=>{g.current=!1,_.current=f;for(let R=0;R<S.length;R++){const N=Er(S[R]);m.includes(N)?v.delete(N):v.get(N)!==!0&&v.set(N,!1)}},[S,m.length,m.join("-")]);const M=[];if(f!==C){let R=[...f];for(let N=0;N<S.length;N++){const k=S[N],P=Er(k);m.includes(P)||(R.splice(N,0,k),M.push(k))}return o==="wait"&&M.length&&(R=M),T(yl(R)),b(f),null}const{forceRender:A}=ut(Vi);return w(tt,{children:S.map(R=>{const N=Er(R),k=s&&!d?!1:f===S||m.includes(N),P=()=>{if(v.has(N))v.set(N,!0);else return;let D=!0;v.forEach(O=>{O||(D=!1)}),D&&(A==null||A(),T(_.current),s&&(c==null||c()),r&&r())};return w(Om,{isPresent:k,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:k?void 0:P,anchorX:a,children:R},N)})})},wl=Et({strict:!1}),vl={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Qe={};for(const t in vl)Qe[t]={isEnabled:e=>vl[t].some(n=>!!e[n])};function Fm(t){for(const e in t)Qe[e]={...Qe[e],...t[e]}}const Vm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ar(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Vm.has(t)}let _l=t=>!Ar(t);function Um(t){typeof t=="function"&&(_l=e=>e.startsWith("on")?!Ar(e):t(e))}try{Um(require("@emotion/is-prop-valid").default)}catch{}function $m(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(_l(i)||n===!0&&Ar(i)||!e&&!Ar(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const Pr=Et({});function Ir(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Fn(t){return typeof t=="string"||Array.isArray(t)}const Po=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Io=["initial",...Po];function Mr(t){return Ir(t.animate)||Io.some(e=>Fn(t[e]))}function bl(t){return!!(Mr(t)||t.variants)}function zm(t,e){if(Mr(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Fn(n)?n:void 0,animate:Fn(r)?r:void 0}}return t.inherit!==!1?e:{}}function jm(t){const{initial:e,animate:n}=zm(t,ut(Pr));return vt(()=>({initial:e,animate:n}),[xl(e),xl(n)])}function xl(t){return Array.isArray(t)?t.join(" "):t}const Vn={};function Hm(t){for(const e in t)Vn[e]=t[e],Gi(e)&&(Vn[e].isCSSVariable=!0)}function Cl(t,{layout:e,layoutId:n}){return Ze.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Vn[t]||t==="opacity")}const Wm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Km=Xe.length;function qm(t,e,n){let r="",i=!0;for(let o=0;o<Km;o++){const s=Xe[o],a=t[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const d=sl(a,So[s]);if(!l){i=!1;const c=Wm[s]||s;r+=`${c}(${d}) `}n&&(e[s]=d)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Mo(t,e,n){const{style:r,vars:i,transformOrigin:o}=t;let s=!1,a=!1;for(const l in e){const d=e[l];if(Ze.has(l)){s=!0;continue}else if(Gi(l)){i[l]=d;continue}else{const c=sl(d,So[l]);l.startsWith("origin")?(a=!0,o[l]=c):r[l]=c}}if(e.transform||(s||n?r.transform=qm(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:d="50%",originZ:c=0}=o;r.transformOrigin=`${l} ${d} ${c}`}}const Ro=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sl(t,e,n){for(const r in e)!St(e[r])&&!Cl(r,n)&&(t[r]=e[r])}function Ym({transformTemplate:t},e){return vt(()=>{const n=Ro();return Mo(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Gm(t,e){const n=t.style||{},r={};return Sl(r,n,t),Object.assign(r,Ym(t,e)),r}function Xm(t,e){const n={},r=Gm(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Zm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jm={offset:"strokeDashoffset",array:"strokeDasharray"};function Qm(t,e,n=1,r=0,i=!0){t.pathLength=1;const o=i?Zm:Jm;t[o.offset]=V.transform(-r);const s=V.transform(e),a=V.transform(n);t[o.array]=`${s} ${a}`}function kl(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,d,c){if(Mo(t,a,d),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:m}=t;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&Qm(f,i,o,s,!1)}const El=()=>({...Ro(),attrs:{}}),Tl=t=>typeof t=="string"&&t.toLowerCase()==="svg";function t0(t,e,n,r){const i=vt(()=>{const o=El();return kl(o,e,Tl(r),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Sl(o,t.style,t),i.style={...o,...i.style}}return i}const e0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function No(t){return typeof t!="string"||t.includes("-")?!1:!!(e0.indexOf(t)>-1||/[A-Z]/u.test(t))}function n0(t,e,n,{latestValues:r},i,o=!1){const a=(No(t)?t0:Xm)(e,r,i,t),l=$m(e,typeof t=="string",o),d=t!==tt?{...l,...a,ref:n}:{},{children:c}=e,f=vt(()=>St(c)?c.get():c,[c]);return B(t,{...d,children:f})}function Al(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Do(t,e,n,r){if(typeof e=="function"){const[i,o]=Al(r);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Al(r);e=e(n!==void 0?n:t.custom,i,o)}return e}function Rr(t){return St(t)?t.get():t}function r0({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:i0(n,r,i,t),renderState:e()}}function i0(t,e,n,r){const i={},o=r(t,{});for(const m in o)i[m]=Rr(o[m]);let{initial:s,animate:a}=t;const l=Mr(t),d=bl(t);e&&d&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const f=c?a:s;if(f&&typeof f!="boolean"&&!Ir(f)){const m=Array.isArray(f)?f:[f];for(let g=0;g<m.length;g++){const _=Do(t,m[g]);if(_){const{transitionEnd:v,transition:C,...b}=_;for(const S in b){let T=b[S];if(Array.isArray(T)){const M=c?T.length-1:0;T=T[M]}T!==null&&(i[S]=T)}for(const S in v)i[S]=v[S]}}}return i}const Pl=t=>(e,n)=>{const r=ut(Pr),i=ut(yr),o=()=>r0(t,e,r,i);return n?o():Ui(o)};function Lo(t,e,n){var o;const{style:r}=t,i={};for(const s in r)(St(r[s])||e.style&&St(e.style[s])||Cl(s,t)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const o0=Pl({scrapeMotionValuesFromProps:Lo,createRenderState:Ro});function Il(t,e,n){const r=Lo(t,e,n);for(const i in t)if(St(t[i])||St(e[i])){const o=Xe.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=t[i]}return r}const s0=Pl({scrapeMotionValuesFromProps:Il,createRenderState:El}),a0=Symbol.for("motionComponentSymbol");function tn(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function c0(t,e,n){return et(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):tn(n)&&(n.current=r))},[e])}const Oo=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ml="data-"+Oo("framerAppearId"),Rl=Et({});function l0(t,e,n,r,i){var v,C;const{visualElement:o}=ut(Pr),s=ut(wl),a=ut(yr),l=ut(Ao).reducedMotion,d=F(null);r=r||s.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=d.current,f=ut(Rl);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&u0(d.current,n,i,f);const m=F(!1);Tn(()=>{c&&m.current&&c.update(n,a)});const g=n[Ml],_=F(!!g&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return ic(()=>{c&&(m.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),_.current&&c.animationState&&c.animationState.animateChanges())}),$(()=>{c&&(!_.current&&c.animationState&&c.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,g)}),_.current=!1),c.enteringChildren=void 0)}),c}function u0(t,e,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:d,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Nl(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&tn(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:d})}function Nl(t){if(t)return t.options.allowProjection!==!1?t.projection:Nl(t.parent)}function Bo(t,{forwardMotionProps:e=!1}={},n,r){n&&Fm(n);const i=No(t)?s0:o0;function o(a,l){let d;const c={...ut(Ao),...a,layoutId:d0(a)},{isStatic:f}=c,m=jm(a),g=i(a,f);if(!f&&$i){h0();const _=f0(c);d=_.MeasureLayout,m.visualElement=l0(t,g,c,r,_.ProjectionNode)}return w(Pr.Provider,{value:m,children:[d&&m.visualElement?w(d,{visualElement:m.visualElement,...c}):null,n0(t,a,c0(g,m.visualElement,l),g,f,e)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=he(o);return s[a0]=t,s}function d0({layoutId:t}){const e=ut(Vi).id;return e&&t!==void 0?e+"-"+t:t}function h0(t,e){ut(wl).strict}function f0(t){const{drag:e,layout:n}=Qe;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function p0(t,e){if(typeof Proxy>"u")return Bo;const n=new Map,r=(o,s)=>Bo(o,s,t,e),i=(o,s)=>r(o,s);return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,Bo(s,void 0,t,e)),n.get(s))})}function Dl({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function m0({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function g0(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fo(t){return t===void 0||t===1}function Vo({scale:t,scaleX:e,scaleY:n}){return!Fo(t)||!Fo(e)||!Fo(n)}function Ie(t){return Vo(t)||Ll(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ll(t){return Ol(t.x)||Ol(t.y)}function Ol(t){return t&&t!=="0%"}function Nr(t,e,n){const r=t-n,i=e*r;return n+i}function Bl(t,e,n,r,i){return i!==void 0&&(t=Nr(t,i,r)),Nr(t,n,r)+e}function Uo(t,e=0,n=1,r,i){t.min=Bl(t.min,e,n,r,i),t.max=Bl(t.max,e,n,r,i)}function Fl(t,{x:e,y:n}){Uo(t.x,e.translate,e.scale,e.originPoint),Uo(t.y,n.translate,n.scale,n.originPoint)}const Vl=.999999999999,Ul=1.0000000000001;function y0(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&nn(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,Fl(t,s)),r&&Ie(o.latestValues)&&nn(t,o.latestValues))}e.x<Ul&&e.x>Vl&&(e.x=1),e.y<Ul&&e.y>Vl&&(e.y=1)}function en(t,e){t.min=t.min+e,t.max=t.max+e}function $l(t,e,n,r,i=.5){const o=ot(t.min,t.max,i);Uo(t,e,n,o,r)}function nn(t,e){$l(t.x,e.x,e.scaleX,e.scale,e.originX),$l(t.y,e.y,e.scaleY,e.scale,e.originY)}function zl(t,e){return Dl(g0(t.getBoundingClientRect(),e))}function w0(t,e,n){const r=zl(t,n),{scroll:i}=e;return i&&(en(r.x,i.offset.x),en(r.y,i.offset.y)),r}const jl=()=>({translate:0,scale:1,origin:0,originPoint:0}),rn=()=>({x:jl(),y:jl()}),Hl=()=>({min:0,max:0}),dt=()=>({x:Hl(),y:Hl()}),$o={current:null},Wl={current:!1};function v0(){if(Wl.current=!0,!!$i)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>$o.current=t.matches;t.addEventListener("change",e),e()}else $o.current=!1}const _0=new WeakMap;function b0(t,e,n){for(const r in e){const i=e[r],o=n[r];if(St(i))t.addValue(r,i);else if(St(o))t.addValue(r,Je(i,{owner:t}));else if(o!==i)if(t.hasValue(r)){const s=t.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(r);t.addValue(r,Je(s!==void 0?s:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Kl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class x0{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_o,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Pt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,nt.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Mr(n),this.isVariantNode=bl(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const g=f[m];l[m]!==void 0&&St(g)&&g.set(l[m])}}mount(e){var n;this.current=e,_0.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),Wl.current||v0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$o.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),fe(this.notifyUpdate),fe(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Ze.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&nt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Qe){const n=Qe[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Kl.length;r++){const i=Kl[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=e[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=b0(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Je(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(oc(r)||ac(r))?r=parseFloat(r):!Nm(r)&&me.test(n)&&(r=ol(e,n)),this.setBaseTarget(e,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=Do(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!St(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Wi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ko.render(this.render)}}class ql extends x0{constructor(){super(...arguments),this.KeyframeResolver=bm}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;St(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Yl(t,{style:e,vars:n},r,i){const o=t.style;let s;for(s in e)o[s]=e[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function C0(t){return window.getComputedStyle(t)}class S0 extends ql{constructor(){super(...arguments),this.type="html",this.renderInstance=Yl}readValueFromInstance(e,n){var r;if(Ze.has(n))return(r=this.projection)!=null&&r.isProjecting?mo(n):$p(e,n);{const i=C0(e),o=(Gi(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return zl(e,n)}build(e,n,r){Mo(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Lo(e,n,r)}}const Gl=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function k0(t,e,n,r){Yl(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(Gl.has(i)?i:Oo(i),e.attrs[i])}class E0 extends ql{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ze.has(n)){const r=il(n);return r&&r.default||0}return n=Gl.has(n)?n:Oo(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Il(e,n,r)}build(e,n,r){kl(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){k0(e,n,r,i)}mount(e){this.isSVGTag=Tl(e.tagName),super.mount(e)}}const T0=(t,e)=>No(t)?new E0(e):new S0(e,{allowProjection:t!==tt});function on(t,e,n){const r=t.getProps();return Do(r,e,n!==void 0?n:r.custom,t)}const zo=t=>Array.isArray(t);function A0(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Je(n))}function P0(t){return zo(t)?t[t.length-1]||0:t}function I0(t,e){const n=on(t,e);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=P0(o[s]);A0(t,s,a)}}function M0(t){return!!(St(t)&&t.add)}function jo(t,e){const n=t.getValue("willChange");if(M0(n))return n.add(e);if(!n&&ce.WillChange){const r=new ce.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Xl(t){return t.props[Ml]}const R0=t=>t!==null;function N0(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(R0),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const D0={type:"spring",stiffness:500,damping:25,restSpeed:10},L0=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),O0={type:"keyframes",duration:.8},B0={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},F0=(t,{keyframes:e})=>e.length>2?O0:Ze.has(t)?t.startsWith("scale")?L0(e[1]):D0:B0;function V0({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:d,...c}){return!!Object.keys(c).length}const Ho=(t,e,n,r={},i,o)=>s=>{const a=xo(r,t)||{},l=a.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Gt(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-d,onUpdate:m=>{e.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};V0(a)||Object.assign(c,F0(t,c)),c.duration&&(c.duration=Gt(c.duration)),c.repeatDelay&&(c.repeatDelay=Gt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(bo(c),c.delay===0&&(f=!0)),(ce.instantAnimations||ce.skipAnimations)&&(f=!0,bo(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const m=N0(c.keyframes,a);if(m!==void 0){nt.update(()=>{c.onUpdate(m),c.onComplete()});return}}return a.isSync?new ho(c):new um(c)};function U0({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Zl(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:s,...a}=e;r&&(o=r);const l=[],d=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const f=t.getValue(c,t.latestValues[c]??null),m=a[c];if(m===void 0||d&&U0(d,c))continue;const g={delay:n,...xo(o||{},c)},_=f.get();if(_!==void 0&&!f.isAnimating&&!Array.isArray(m)&&m===_&&!g.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const b=Xl(t);if(b){const S=window.MotionHandoffAnimation(b,c,nt);S!==null&&(g.startTime=S,v=!0)}}jo(t,c),f.start(Ho(c,f,m,t.shouldReduceMotion&&Qc.has(c)?{type:!1}:g,t,v));const C=f.animation;C&&l.push(C)}return s&&Promise.all(l).then(()=>{nt.update(()=>{s&&I0(t,s)})}),l}function Jl(t,e,n,r=0,i=1){const o=Array.from(t).sort((d,c)=>d.sortNodePosition(c)).indexOf(e),s=t.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function Wo(t,e,n={}){var l;const r=on(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Zl(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:m}=i;return $0(t,e,d,c,f,m,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[d,c]=a==="beforeChildren"?[o,s]:[s,o];return d().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function $0(t,e,n=0,r=0,i=0,o=1,s){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Wo(l,e,{...s,delay:n+(typeof r=="function"?0:r)+Jl(t.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function z0(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(o=>Wo(t,o,n));r=Promise.all(i)}else if(typeof e=="string")r=Wo(t,e,n);else{const i=typeof e=="function"?on(t,e,n.custom):e;r=Promise.all(Zl(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function Ql(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const j0=Io.length;function tu(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?tu(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<j0;n++){const r=Io[n],i=t.props[r];(Fn(i)||i===!1)&&(e[r]=i)}return e}const H0=[...Po].reverse(),W0=Po.length;function K0(t){return e=>Promise.all(e.map(({animation:n,options:r})=>z0(t,n,r)))}function q0(t){let e=K0(t),n=eu(),r=!0;const i=l=>(d,c)=>{var m;const f=on(t,c,l==="exit"?(m=t.presenceContext)==null?void 0:m.custom:void 0);if(f){const{transition:g,transitionEnd:_,...v}=f;d={...d,...v,..._}}return d};function o(l){e=l(t)}function s(l){const{props:d}=t,c=tu(t.parent)||{},f=[],m=new Set;let g={},_=1/0;for(let C=0;C<W0;C++){const b=H0[C],S=n[b],T=d[b]!==void 0?d[b]:c[b],M=Fn(T),A=b===l?S.isActive:null;A===!1&&(_=C);let R=T===c[b]&&T!==d[b]&&M;if(R&&r&&t.manuallyAnimateOnMount&&(R=!1),S.protectedKeys={...g},!S.isActive&&A===null||!T&&!S.prevProp||Ir(T)||typeof T=="boolean")continue;const N=Y0(S.prevProp,T);let k=N||b===l&&S.isActive&&!R&&M||C>_&&M,P=!1;const D=Array.isArray(T)?T:[T];let O=D.reduce(i(b),{});A===!1&&(O={});const{prevResolvedValues:J={}}=S,ft={...J,...O},Lt=q=>{k=!0,m.has(q)&&(P=!0,m.delete(q)),S.needsAnimating[q]=!0;const wt=t.getValue(q);wt&&(wt.liveStyle=!1)};for(const q in ft){const wt=O[q],Ot=J[q];if(g.hasOwnProperty(q))continue;let jt=!1;zo(wt)&&zo(Ot)?jt=!Ql(wt,Ot):jt=wt!==Ot,jt?wt!=null?Lt(q):m.add(q):wt!==void 0&&m.has(q)?Lt(q):S.protectedKeys[q]=!0}S.prevProp=T,S.prevResolvedValues=O,S.isActive&&(g={...g,...O}),r&&t.blockInitialAnimation&&(k=!1);const G=R&&N;k&&(!G||P)&&f.push(...D.map(q=>{const wt={type:b};if(typeof q=="string"&&r&&!G&&t.manuallyAnimateOnMount&&t.parent){const{parent:Ot}=t,jt=on(Ot,q);if(Ot.enteringChildren&&jt){const{delayChildren:K}=jt.transition||{};wt.delay=Jl(Ot.enteringChildren,t,K)}}return{animation:q,options:wt}}))}if(m.size){const C={};if(typeof d.initial!="boolean"){const b=on(t,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(C.transition=b.transition)}m.forEach(b=>{const S=t.getBaseTarget(b),T=t.getValue(b);T&&(T.liveStyle=!0),C[b]=S??null}),f.push({animation:C})}let v=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,v?e(f):Promise.resolve()}function a(l,d){var f;if(n[l].isActive===d)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(l,d)}),n[l].isActive=d;const c=s(l);for(const m in n)n[m].protectedKeys={};return c}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=eu(),r=!0}}}function Y0(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ql(e,t):!1}function Me(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eu(){return{animate:Me(!0),whileInView:Me(),whileHover:Me(),whileTap:Me(),whileDrag:Me(),whileFocus:Me(),exit:Me()}}class ge{constructor(e){this.isMounted=!1,this.node=e}update(){}}class G0 extends ge{constructor(e){super(e),e.animationState||(e.animationState=q0(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ir(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let X0=0;class Z0 extends ge{constructor(){super(...arguments),this.id=X0++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const J0={animation:{Feature:G0},exit:{Feature:Z0}};function Un(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function $n(t){return{point:{x:t.pageX,y:t.pageY}}}const Q0=t=>e=>Eo(e)&&t(e,$n(e));function zn(t,e,n,r){return Un(t,e,Q0(n),r)}const nu=1e-4,tg=1-nu,eg=1+nu,ru=.01,ng=0-ru,rg=0+ru;function Tt(t){return t.max-t.min}function ig(t,e,n){return Math.abs(t-e)<=n}function iu(t,e,n,r=.5){t.origin=r,t.originPoint=ot(e.min,e.max,t.origin),t.scale=Tt(n)/Tt(e),t.translate=ot(n.min,n.max,t.origin)-t.originPoint,(t.scale>=tg&&t.scale<=eg||isNaN(t.scale))&&(t.scale=1),(t.translate>=ng&&t.translate<=rg||isNaN(t.translate))&&(t.translate=0)}function jn(t,e,n,r){iu(t.x,e.x,n.x,r?r.originX:void 0),iu(t.y,e.y,n.y,r?r.originY:void 0)}function ou(t,e,n){t.min=n.min+e.min,t.max=t.min+Tt(e)}function og(t,e,n){ou(t.x,e.x,n.x),ou(t.y,e.y,n.y)}function su(t,e,n){t.min=e.min-n.min,t.max=t.min+Tt(e)}function Hn(t,e,n){su(t.x,e.x,n.x),su(t.y,e.y,n.y)}function Vt(t){return[t("x"),t("y")]}const au=({current:t})=>t?t.ownerDocument.defaultView:null,cu=(t,e)=>Math.abs(t-e);function sg(t,e){const n=cu(t.x,e.x),r=cu(t.y,e.y);return Math.sqrt(n**2+r**2)}class lu{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=qo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,_=sg(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!_)return;const{point:v}=m,{timestamp:C}=Ct;this.history.push({...v,timestamp:C});const{onStart:b,onMove:S}=this.handlers;g||(b&&b(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=Ko(g,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:_,onSessionEnd:v,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=qo(m.type==="pointercancel"?this.lastMoveEventInfo:Ko(g,this.transformPagePoint),this.history);this.startEvent&&_&&_(m,b),v&&v(m,b)},!Eo(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=$n(e),l=Ko(a,this.transformPagePoint),{point:d}=l,{timestamp:c}=Ct;this.history=[{...d,timestamp:c}];const{onSessionStart:f}=n;f&&f(e,qo(l,this.history)),this.removeListeners=Pn(zn(this.contextWindow,"pointermove",this.handlePointerMove),zn(this.contextWindow,"pointerup",this.handlePointerUp),zn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),fe(this.updatePoint)}}function Ko(t,e){return e?{point:e(t.point)}:t}function uu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qo({point:t},e){return{point:t,delta:uu(t,du(e)),offset:uu(t,ag(e)),velocity:cg(e,.1)}}function ag(t){return t[0]}function du(t){return t[t.length-1]}function cg(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=du(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Gt(e)));)n--;if(!r)return{x:0,y:0};const o=Xt(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function lg(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?ot(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?ot(n,t,r.max):Math.min(t,n)),t}function hu(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ug(t,{top:e,left:n,bottom:r,right:i}){return{x:hu(t.x,n,i),y:hu(t.y,e,r)}}function fu(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function dg(t,e){return{x:fu(t.x,e.x),y:fu(t.y,e.y)}}function hg(t,e){let n=.5;const r=Tt(t),i=Tt(e);return i>r?n=In(e.min,e.max-r,t.min):r>i&&(n=In(t.min,t.max-i,e.min)),ae(0,1,n)}function fg(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Yo=.35;function pg(t=Yo){return t===!1?t=0:t===!0&&(t=Yo),{x:pu(t,"left","right"),y:pu(t,"top","bottom")}}function pu(t,e,n){return{min:mu(t,e),max:mu(t,n)}}function mu(t,e){return typeof t=="number"?t:t[e]||0}const mg=new WeakMap;class gg{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=f=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor($n(f).point)},s=(f,m)=>{const{drag:g,dragPropagation:_,onDragStart:v}=this.getProps();if(g&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=km(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vt(b=>{let S=this.getAxisMotionValue(b).get()||0;if(Zt.test(S)){const{projection:T}=this.visualElement;if(T&&T.layout){const M=T.layout.layoutBox[b];M&&(S=Tt(M)*(parseFloat(S)/100))}}this.originPoint[b]=S}),v&&nt.postRender(()=>v(f,m)),jo(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;const{dragPropagation:g,dragDirectionLock:_,onDirectionLock:v,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:b}=m;if(_&&this.currentDirection===null){this.currentDirection=yg(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),C&&C(f,m)},l=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>Vt(f=>{var m;return this.getAnimationState(f)==="paused"&&((m=this.getAxisMotionValue(f).animation)==null?void 0:m.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new lu(e,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:au(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&nt.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!Dr(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=lg(s,this.constraints[e],this.elastic[e])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&&tn(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=ug(r.layoutBox,e):this.constraints=!1,this.elastic=pg(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Vt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=fg(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!tn(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=w0(r,i.root,this.visualElement.getTransformPagePoint());let s=dg(i.layout.layoutBox,o);if(n){const a=n(m0(s));this.hasMutatedConstraints=!!a,a&&(s=Dl(a))}return s}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},d=Vt(c=>{if(!Dr(c,n,this.currentDirection))return;let f=l&&l[c]||{};s&&(f={min:0,max:0});const m=i?200:1e6,g=i?40:1e7,_={type:"inertia",velocity:r?e[c]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(c,_)});return Promise.all(d).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return jo(this.visualElement,e),r.start(Ho(e,r,0,n,this.visualElement,!1))}stopAnimation(){Vt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Vt(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Vt(n=>{const{drag:r}=this.getProps();if(!Dr(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(e[n]-ot(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!tn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=hg({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vt(s=>{if(!Dr(s,e,null))return;const a=this.getAxisMotionValue(s),{min:l,max:d}=this.constraints[s];a.set(ot(l,d,i[s]))})}addListeners(){if(!this.visualElement.current)return;mg.set(this.visualElement,this);const e=this.visualElement.current,n=zn(e,"pointerdown",l=>{const{drag:d,dragListener:c=!0}=this.getProps();d&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();tn(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),nt.read(r);const s=Un(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Vt(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Yo,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Dr(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yg(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class wg extends ge{constructor(e){super(e),this.removeGroupControls=Ft,this.removeListeners=Ft,this.controls=new gg(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ft}unmount(){this.removeGroupControls(),this.removeListeners()}}const gu=t=>(e,n)=>{t&&nt.postRender(()=>t(e,n))};class vg extends ge{constructor(){super(...arguments),this.removePointerDownListener=Ft}onPointerDown(e){this.session=new lu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:au(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:gu(e),onStart:gu(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&nt.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=zn(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yu(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Wn={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(V.test(t))t=parseFloat(t);else return t;const n=yu(t,e.target.x),r=yu(t,e.target.y);return`${n}% ${r}%`}},_g={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=me.parse(t);if(i.length>5)return r;const o=me.createTransformer(t),s=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+s]/=a,i[1+s]/=l;const d=ot(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=d),typeof i[3+s]=="number"&&(i[3+s]/=d),o(i)}};let Go=!1;class bg extends Rt{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=e;Hm(xg),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),Go&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Lr.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,Go=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||nt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ko.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;Go=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wu(t){const[e,n]=gl(),r=ut(Vi);return w(bg,{...t,layoutGroup:r,switchLayoutGroup:ut(Rl),isPresent:e,safeToRemove:n})}const xg={borderRadius:{...Wn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wn,borderTopRightRadius:Wn,borderBottomLeftRadius:Wn,borderBottomRightRadius:Wn,boxShadow:_g};function Cg(t,e,n){const r=St(t)?t:Je(t);return r.start(Ho("",r,e,n)),r.animation}const Sg=(t,e)=>t.depth-e.depth;class kg{constructor(){this.children=[],this.isDirty=!1}add(e){zi(this.children,e),this.isDirty=!0}remove(e){ji(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Sg),this.isDirty=!1,this.children.forEach(e)}}function Eg(t,e){const n=Pt.now(),r=({timestamp:i})=>{const o=i-n;o>=e&&(fe(r),t(o-e))};return nt.setup(r,!0),()=>fe(r)}const vu=["TopLeft","TopRight","BottomLeft","BottomRight"],Tg=vu.length,_u=t=>typeof t=="string"?parseFloat(t):t,bu=t=>typeof t=="number"||V.test(t);function Ag(t,e,n,r,i,o){i?(t.opacity=ot(0,n.opacity??1,Pg(r)),t.opacityExit=ot(e.opacity??1,0,Ig(r))):o&&(t.opacity=ot(e.opacity??1,n.opacity??1,r));for(let s=0;s<Tg;s++){const a=`border${vu[s]}Radius`;let l=xu(e,a),d=xu(n,a);if(l===void 0&&d===void 0)continue;l||(l=0),d||(d=0),l===0||d===0||bu(l)===bu(d)?(t[a]=Math.max(ot(_u(l),_u(d),r),0),(Zt.test(d)||Zt.test(l))&&(t[a]+="%")):t[a]=d}(e.rotate||n.rotate)&&(t.rotate=ot(e.rotate||0,n.rotate||0,r))}function xu(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Pg=Cu(0,.5,mc),Ig=Cu(.5,.95,Ft);function Cu(t,e,n){return r=>r<t?0:r>e?1:n(In(t,e,r))}function Su(t,e){t.min=e.min,t.max=e.max}function Ut(t,e){Su(t.x,e.x),Su(t.y,e.y)}function ku(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Eu(t,e,n,r,i){return t-=e,t=Nr(t,1/n,r),i!==void 0&&(t=Nr(t,1/i,r)),t}function Mg(t,e=0,n=1,r=.5,i,o=t,s=t){if(Zt.test(e)&&(e=parseFloat(e),e=ot(s.min,s.max,e/100)-s.min),typeof e!="number")return;let a=ot(o.min,o.max,r);t===o&&(a-=e),t.min=Eu(t.min,e,n,a,i),t.max=Eu(t.max,e,n,a,i)}function Tu(t,e,[n,r,i],o,s){Mg(t,e[n],e[r],e[i],e.scale,o,s)}const Rg=["x","scaleX","originX"],Ng=["y","scaleY","originY"];function Au(t,e,n,r){Tu(t.x,e,Rg,n?n.x:void 0,r?r.x:void 0),Tu(t.y,e,Ng,n?n.y:void 0,r?r.y:void 0)}function Pu(t){return t.translate===0&&t.scale===1}function Iu(t){return Pu(t.x)&&Pu(t.y)}function Mu(t,e){return t.min===e.min&&t.max===e.max}function Dg(t,e){return Mu(t.x,e.x)&&Mu(t.y,e.y)}function Ru(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Nu(t,e){return Ru(t.x,e.x)&&Ru(t.y,e.y)}function Du(t){return Tt(t.x)/Tt(t.y)}function Lu(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Lg{constructor(){this.members=[]}add(e){zi(this.members,e),e.scheduleRender()}remove(e){if(ji(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Og(t,e,n){let r="";const i=t.x.translate/e.x,o=t.y.translate/e.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:c,rotateX:f,rotateY:m,skewX:g,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),g&&(r+=`skewX(${g}deg) `),_&&(r+=`skewY(${_}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Xo=["","X","Y","Z"],Bg=1e3;let Fg=0;function Zo(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Ou(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Xl(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",nt,!(i||o))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Ou(r)}function Bu({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=e==null?void 0:e()){this.id=Fg++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach($g),this.nodes.forEach(Wg),this.nodes.forEach(Kg),this.nodes.forEach(zg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new kg)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Wi),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=ml(s)&&!Mm(s),this.instance=s;const{layoutId:a,layout:l,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,f=0;const m=()=>this.root.updateBlockedByResize=!1;nt.read(()=>{f=window.innerWidth}),t(s,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,c&&c(),c=Eg(m,250),Lr.hasAnimatedSinceResize&&(Lr.hasAnimatedSinceResize=!1,this.nodes.forEach(Uu)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&d&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||Zg,{onLayoutAnimationStart:v,onLayoutAnimationComplete:C}=d.getProps(),b=!this.targetLayout||!Nu(this.targetLayout,g),S=!f&&m;if(this.options.layoutRoot||this.resumeFrom||S||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...xo(_,"layout"),onPlay:v,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(c,S)}else f||Uu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qg),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ou(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Fu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Vu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hg),this.nodes.forEach(Vg),this.nodes.forEach(Ug)):this.nodes.forEach(Vu),this.clearAllSnapshots();const a=Pt.now();Ct.delta=ae(0,1e3/60,a-Ct.timestamp),Ct.timestamp=a,Ct.isProcessing=!0,Yi.update.process(Ct),Yi.preRender.process(Ct),Yi.render.process(Ct),Ct.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ko.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jg),this.sharedNodes.forEach(Yg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Tt(this.snapshot.measuredBox.x)&&!Tt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=dt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Iu(this.projectionDelta),l=this.getTransformTemplate(),d=l?l(this.latestValues,""):void 0,c=d!==this.prevTransformTemplateValue;s&&this.instance&&(a||Ie(this.latestValues)||c)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),Jg(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:s}=this.options;if(!s)return dt();const a=s.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(Qg))){const{scroll:c}=this.root;c&&(en(a.x,c.offset.x),en(a.y,c.offset.y))}return a}removeElementScroll(s){var l;const a=dt();if(Ut(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let d=0;d<this.path.length;d++){const c=this.path[d],{scroll:f,options:m}=c;c!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&Ut(a,s),en(a.x,f.offset.x),en(a.y,f.offset.y))}return a}applyTransform(s,a=!1){const l=dt();Ut(l,s);for(let d=0;d<this.path.length;d++){const c=this.path[d];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&nn(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Ie(c.latestValues)&&nn(l,c.latestValues)}return Ie(this.latestValues)&&nn(l,this.latestValues),l}removeTransform(s){const a=dt();Ut(a,s);for(let l=0;l<this.path.length;l++){const d=this.path[l];if(!d.instance||!Ie(d.latestValues))continue;Vo(d.latestValues)&&d.updateSnapshot();const c=dt(),f=d.measurePageBox();Ut(c,f),Au(a,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,c)}return Ie(this.latestValues)&&Au(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ct.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=Ct.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),Hn(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dt(),this.targetWithTransforms=dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),og(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ut(this.target,this.layout.layoutBox),Fl(this.target,this.targetDelta)):Ut(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),Hn(this.relativeTargetOrigin,this.target,g.target),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Vo(this.parent.latestValues)||Ll(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var _;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ct.timestamp&&(l=!1),l)return;const{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;Ut(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;y0(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=dt());const{target:g}=s;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ku(this.prevProjectionDelta.x,this.projectionDelta.x),ku(this.prevProjectionDelta.y,this.projectionDelta.y)),jn(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Lu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Lu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rn(),this.projectionDelta=rn(),this.projectionDeltaWithTransform=rn()}setAnimationOrigin(s,a=!1){const l=this.snapshot,d=l?l.latestValues:{},c={...this.latestValues},f=rn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=dt(),g=l?l.source:void 0,_=this.layout?this.layout.source:void 0,v=g!==_,C=this.getStack(),b=!C||C.members.length<=1,S=!!(v&&!b&&this.options.crossfade===!0&&!this.path.some(Xg));this.animationProgress=0;let T;this.mixTargetDelta=M=>{const A=M/1e3;$u(f.x,s.x,A),$u(f.y,s.y,A),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hn(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Gg(this.relativeTarget,this.relativeTargetOrigin,m,A),T&&Dg(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=dt()),Ut(T,this.relativeTarget)),v&&(this.animationValues=c,Ag(c,d,this.latestValues,A,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,d;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(d=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||d.stop(),this.pendingAnimation&&(fe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{Lr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Je(0)),this.currentAnimation=Cg(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),s.onUpdate&&s.onUpdate(c)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:d,latestValues:c}=s;if(!(!a||!l||!d)){if(this!==s&&this.layout&&d&&Ku(this.options.animationType,this.layout.layoutBox,d.layoutBox)){l=this.target||dt();const f=Tt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const m=Tt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+m}Ut(a,l),nn(a,c),jn(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Lg),this.sharedNodes.get(s).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const d=this.getStack();d&&d.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const d={};l.z&&Zo("z",s,d,this.animationValues);for(let c=0;c<Xo.length;c++)Zo(`rotate${Xo[c]}`,s,d,this.animationValues),Zo(`skew${Xo[c]}`,s,d,this.animationValues);s.render();for(const c in d)s.setStaticValue(c,d[c]),this.animationValues&&(this.animationValues[c]=d[c]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Rr(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Rr(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Ie(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const c=d.animationValues||d.latestValues;this.applyTransformsToTarget();let f=Og(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),s.transform=f;const{x:m,y:g}=this.projectionDelta;s.transformOrigin=`${m.origin*100}% ${g.origin*100}% 0`,d.animationValues?s.opacity=d===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:s.opacity=d===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const _ in Vn){if(c[_]===void 0)continue;const{correct:v,applyTo:C,isCSSVariable:b}=Vn[_],S=f==="none"?c[_]:v(c[_],d);if(C){const T=C.length;for(let M=0;M<T;M++)s[C[M]]=S}else b?this.options.visualElement.renderState.vars[_]=S:s[_]=S}this.options.layoutId&&(s.pointerEvents=d===this?Rr(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Fu),this.root.sharedNodes.clear()}}}function Vg(t){t.updateLayout()}function Ug(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:o}=t.options,s=e.source!==t.layout.source;o==="size"?Vt(f=>{const m=s?e.measuredBox[f]:e.layoutBox[f],g=Tt(m);m.min=r[f].min,m.max=m.min+g}):Ku(o,e.layoutBox,r)&&Vt(f=>{const m=s?e.measuredBox[f]:e.layoutBox[f],g=Tt(r[f]);m.max=m.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+g)});const a=rn();jn(a,r,e.layoutBox);const l=rn();s?jn(l,t.applyTransform(i,!0),e.measuredBox):jn(l,r,e.layoutBox);const d=!Iu(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:g}=f;if(m&&g){const _=dt();Hn(_,e.layoutBox,m.layoutBox);const v=dt();Hn(v,r,g.layoutBox),Nu(_,v)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=_,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function $g(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zg(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function jg(t){t.clearSnapshot()}function Fu(t){t.clearMeasurements()}function Vu(t){t.isLayoutDirty=!1}function Hg(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Uu(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Wg(t){t.resolveTargetDelta()}function Kg(t){t.calcProjection()}function qg(t){t.resetSkewAndRotation()}function Yg(t){t.removeLeadSnapshot()}function $u(t,e,n){t.translate=ot(e.translate,0,n),t.scale=ot(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function zu(t,e,n,r){t.min=ot(e.min,n.min,r),t.max=ot(e.max,n.max,r)}function Gg(t,e,n,r){zu(t.x,e.x,n.x,r),zu(t.y,e.y,n.y,r)}function Xg(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Zg={duration:.45,ease:[.4,0,.1,1]},ju=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hu=ju("applewebkit/")&&!ju("chrome/")?Math.round:Ft;function Wu(t){t.min=Hu(t.min),t.max=Hu(t.max)}function Jg(t){Wu(t.x),Wu(t.y)}function Ku(t,e,n){return t==="position"||t==="preserve-aspect"&&!ig(Du(e),Du(n),.2)}function Qg(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const ty=Bu({attachResizeListener:(t,e)=>Un(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jo={current:void 0},qu=Bu({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Jo.current){const t=new ty({});t.mount(window),t.setOptions({layoutScroll:!0}),Jo.current=t}return Jo.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ey={pan:{Feature:vg},drag:{Feature:wg,ProjectionNode:qu,MeasureLayout:wu}};function Yu(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&nt.postRender(()=>o(e,$n(e)))}class ny extends ge{mount(){const{current:e}=this.node;e&&(this.unmount=Em(e,(n,r)=>(Yu(this.node,r,"Start"),i=>Yu(this.node,i,"End"))))}unmount(){}}class ry extends ge{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Pn(Un(this.node.current,"focus",()=>this.onFocus()),Un(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Gu(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&nt.postRender(()=>o(e,$n(e)))}class iy extends ge{mount(){const{current:e}=this.node;e&&(this.unmount=Im(e,(n,r)=>(Gu(this.node,r,"Start"),(i,{success:o})=>Gu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Qo=new WeakMap,ts=new WeakMap,oy=t=>{const e=Qo.get(t.target);e&&e(t)},sy=t=>{t.forEach(oy)};function ay({root:t,...e}){const n=t||document;ts.has(n)||ts.set(n,{});const r=ts.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(sy,{root:t,...e})),r[i]}function cy(t,e,n){const r=ay(e);return Qo.set(t,n),r.observe(t),()=>{Qo.delete(t),r.unobserve(t)}}const ly={some:0,all:1};class uy extends ge{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=e,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:ly[i]},a=l=>{const{isIntersecting:d}=l;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),m=d?c:f;m&&m(l)};return cy(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(dy(e,n))&&this.startObserver()}unmount(){}}function dy({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const hy={...J0,...{inView:{Feature:uy},tap:{Feature:iy},focus:{Feature:ry},hover:{Feature:ny}},...ey,...{layout:{ProjectionNode:qu,MeasureLayout:wu}}},ye=p0(hy,T0);/**
10
- * @license lucide-react v0.435.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */const fy=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xu=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/**
15
- * @license lucide-react v0.435.0 - ISC
16
- *
17
- * This source code is licensed under the ISC license.
18
- * See the LICENSE file in the root directory of this source tree.
19
- */var py={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
20
- * @license lucide-react v0.435.0 - ISC
21
- *
22
- * This source code is licensed under the ISC license.
23
- * See the LICENSE file in the root directory of this source tree.
24
- */const my=he(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>B("svg",{ref:l,...py,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Xu("lucide",i),...a},[...s.map(([d,c])=>B(d,c)),...Array.isArray(o)?o:[o]]));/**
25
- * @license lucide-react v0.435.0 - ISC
26
- *
27
- * This source code is licensed under the ISC license.
28
- * See the LICENSE file in the root directory of this source tree.
29
- */const Jt=(t,e)=>{const n=he(({className:r,...i},o)=>B(my,{ref:o,iconNode:e,className:Xu(`lucide-${fy(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
30
- * @license lucide-react v0.435.0 - ISC
31
- *
32
- * This source code is licensed under the ISC license.
33
- * See the LICENSE file in the root directory of this source tree.
34
- */const gy=Jt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
35
- * @license lucide-react v0.435.0 - ISC
36
- *
37
- * This source code is licensed under the ISC license.
38
- * See the LICENSE file in the root directory of this source tree.
39
- */const yy=Jt("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
40
- * @license lucide-react v0.435.0 - ISC
41
- *
42
- * This source code is licensed under the ISC license.
43
- * See the LICENSE file in the root directory of this source tree.
44
- */const wy=Jt("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
45
- * @license lucide-react v0.435.0 - ISC
46
- *
47
- * This source code is licensed under the ISC license.
48
- * See the LICENSE file in the root directory of this source tree.
49
- */const vy=Jt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
50
- * @license lucide-react v0.435.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const _y=Jt("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
55
- * @license lucide-react v0.435.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */const by=Jt("SendHorizontal",[["path",{d:"m3 3 3 9-3 9 19-9Z",key:"1aobqy"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
60
- * @license lucide-react v0.435.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const xy=Jt("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
65
- * @license lucide-react v0.435.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const Zu=Jt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
70
- * @license lucide-react v0.435.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */const Cy=Jt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
75
- * @license lucide-react v0.435.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const Sy=Jt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ky={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Ju=t=>{let e;const n=new Set,r=(c,f)=>{const m=typeof c=="function"?c(e):c;if(!Object.is(m,e)){const g=e;e=f??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(_=>_(e,g))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>d,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(ky?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,i,l);return l},Ey=t=>t?Ju(t):Ju;function Ty(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ay(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Qu={exports:{}},td={};const ed=Ay(Lf);var nd={exports:{}},rd={};/**
80
- * @license React
81
- * use-sync-external-store-shim.production.min.js
82
- *
83
- * Copyright (c) Facebook, Inc. and its affiliates.
84
- *
85
- * This source code is licensed under the MIT license found in the
86
- * LICENSE file in the root directory of this source tree.
87
- */var sn=ed;function Py(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Iy=typeof Object.is=="function"?Object.is:Py,My=sn.useState,Ry=sn.useEffect,Ny=sn.useLayoutEffect,Dy=sn.useDebugValue;function Ly(t,e){var n=e(),r=My({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Ny(function(){i.value=n,i.getSnapshot=e,es(i)&&o({inst:i})},[t,n,e]),Ry(function(){return es(i)&&o({inst:i}),t(function(){es(i)&&o({inst:i})})},[t]),Dy(n),n}function es(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Iy(t,n)}catch{return!0}}function Oy(t,e){return e()}var By=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oy:Ly;rd.useSyncExternalStore=sn.useSyncExternalStore!==void 0?sn.useSyncExternalStore:By,nd.exports=rd;var Fy=nd.exports;/**
88
- * @license React
89
- * use-sync-external-store-shim/with-selector.production.min.js
90
- *
91
- * Copyright (c) Facebook, Inc. and its affiliates.
92
- *
93
- * This source code is licensed under the MIT license found in the
94
- * LICENSE file in the root directory of this source tree.
95
- */var Or=ed,Vy=Fy;function Uy(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var $y=typeof Object.is=="function"?Object.is:Uy,zy=Vy.useSyncExternalStore,jy=Or.useRef,Hy=Or.useEffect,Wy=Or.useMemo,Ky=Or.useDebugValue;td.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=jy(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Wy(function(){function l(g){if(!d){if(d=!0,c=g,g=r(g),i!==void 0&&s.hasValue){var _=s.value;if(i(_,g))return f=_}return f=g}if(_=f,$y(c,g))return _;var v=r(g);return i!==void 0&&i(_,v)?_:(c=g,f=v)}var d=!1,c,f,m=n===void 0?null:n;return[function(){return l(e())},m===null?void 0:function(){return l(m())}]},[e,n,r,i]);var a=zy(t,o[0],o[1]);return Hy(function(){s.hasValue=!0,s.value=a},[a]),Ky(a),a},Qu.exports=td;var qy=Qu.exports;const Yy=Ty(qy),id={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:Gy}=ke,{useSyncExternalStoreWithSelector:Xy}=Yy;let od=!1;const Zy=t=>t;function Jy(t,e=Zy,n){(id?"production":void 0)!=="production"&&n&&!od&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),od=!0);const r=Xy(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Gy(r),r}const sd=t=>{(id?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Ey(t):t,n=(r,i)=>Jy(e,r,i);return Object.assign(n,e),n},Qy=t=>t?sd(t):sd;var ad=Symbol.for("immer-nothing"),cd=Symbol.for("immer-draftable"),Nt=Symbol.for("immer-state");function Wt(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var an=Object.getPrototypeOf;function cn(t){return!!t&&!!t[Nt]}function Re(t){var e;return t?ld(t)||Array.isArray(t)||!!t[cd]||!!((e=t.constructor)!=null&&e[cd])||Vr(t)||Ur(t):!1}var tw=Object.prototype.constructor.toString();function ld(t){if(!t||typeof t!="object")return!1;const e=an(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===tw}function Br(t,e){Fr(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,r)=>e(r,n,t))}function Fr(t){const e=t[Nt];return e?e.type_:Array.isArray(t)?1:Vr(t)?2:Ur(t)?3:0}function ns(t,e){return Fr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function ud(t,e,n){const r=Fr(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}function ew(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function Vr(t){return t instanceof Map}function Ur(t){return t instanceof Set}function Ne(t){return t.copy_||t.base_}function rs(t,e){if(Vr(t))return new Map(t);if(Ur(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=ld(t);if(e===!0||e==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(t);delete r[Nt];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[s]})}return Object.create(an(t),r)}else{const r=an(t);if(r!==null&&n)return{...t};const i=Object.create(r);return Object.assign(i,t)}}function is(t,e=!1){return $r(t)||cn(t)||!Re(t)||(Fr(t)>1&&(t.set=t.add=t.clear=t.delete=nw),Object.freeze(t),e&&Object.entries(t).forEach(([n,r])=>is(r,!0))),t}function nw(){Wt(2)}function $r(t){return Object.isFrozen(t)}var rw={};function De(t){const e=rw[t];return e||Wt(0,t),e}var Kn;function dd(){return Kn}function iw(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function hd(t,e){e&&(De("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function os(t){ss(t),t.drafts_.forEach(ow),t.drafts_=null}function ss(t){t===Kn&&(Kn=t.parent_)}function fd(t){return Kn=iw(Kn,t)}function ow(t){const e=t[Nt];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function pd(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[Nt].modified_&&(os(e),Wt(4)),Re(t)&&(t=zr(e,t),e.parent_||jr(e,t)),e.patches_&&De("Patches").generateReplacementPatches_(n[Nt].base_,t,e.patches_,e.inversePatches_)):t=zr(e,n,[]),os(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==ad?t:void 0}function zr(t,e,n){if($r(e))return e;const r=e[Nt];if(!r)return Br(e,(i,o)=>md(t,r,e,i,o,n)),e;if(r.scope_!==t)return e;if(!r.modified_)return jr(t,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Br(o,(a,l)=>md(t,r,i,a,l,n,s)),jr(t,i,!1),n&&t.patches_&&De("Patches").generatePatches_(r,n,t.patches_,t.inversePatches_)}return r.copy_}function md(t,e,n,r,i,o,s){if(cn(i)){const a=o&&e&&e.type_!==3&&!ns(e.assigned_,r)?o.concat(r):void 0,l=zr(t,i,a);if(ud(n,r,l),cn(l))t.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Re(i)&&!$r(i)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;zr(t,i),(!e||!e.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&jr(t,i)}}function jr(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&is(e,n)}function sw(t,e){const n=Array.isArray(t),r={type_:n?1:0,scope_:e?e.scope_:dd(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=as;n&&(i=[r],o=qn);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var as={get(t,e){if(e===Nt)return t;const n=Ne(t);if(!ns(n,e))return aw(t,n,e);const r=n[e];return t.finalized_||!Re(r)?r:r===cs(t.base_,e)?(us(t),t.copy_[e]=ds(r,t)):r},has(t,e){return e in Ne(t)},ownKeys(t){return Reflect.ownKeys(Ne(t))},set(t,e,n){const r=gd(Ne(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=cs(Ne(t),e),o=i==null?void 0:i[Nt];if(o&&o.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(ew(n,i)&&(n!==void 0||ns(t.base_,e)))return!0;us(t),ls(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return cs(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,us(t),ls(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Ne(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty(){Wt(11)},getPrototypeOf(t){return an(t.base_)},setPrototypeOf(){Wt(12)}},qn={};Br(as,(t,e)=>{qn[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),qn.deleteProperty=function(t,e){return qn.set.call(this,t,e,void 0)},qn.set=function(t,e,n){return as.set.call(this,t[0],e,n,t[0])};function cs(t,e){const n=t[Nt];return(n?Ne(n):t)[e]}function aw(t,e,n){var i;const r=gd(e,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(t.draft_):void 0}function gd(t,e){if(!(e in t))return;let n=an(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=an(n)}}function ls(t){t.modified_||(t.modified_=!0,t.parent_&&ls(t.parent_))}function us(t){t.copy_||(t.copy_=rs(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var cw=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,r)=>{if(typeof e=="function"&&typeof n!="function"){const o=n;n=e;const s=this;return function(l=o,...d){return s.produce(l,c=>n.call(this,c,...d))}}typeof n!="function"&&Wt(6),r!==void 0&&typeof r!="function"&&Wt(7);let i;if(Re(e)){const o=fd(this),s=ds(e,void 0);let a=!0;try{i=n(s),a=!1}finally{a?os(o):ss(o)}return hd(o,r),pd(i,o)}else if(!e||typeof e!="object"){if(i=n(e),i===void 0&&(i=e),i===ad&&(i=void 0),this.autoFreeze_&&is(i,!0),r){const o=[],s=[];De("Patches").generateReplacementPatches_(e,i,o,s),r(o,s)}return i}else Wt(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(s,...a)=>this.produceWithPatches(s,l=>e(l,...a));let r,i;return[this.produce(e,n,(s,a)=>{r=s,i=a}),r,i]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Re(t)||Wt(8),cn(t)&&(t=lw(t));const e=fd(this),n=ds(t,void 0);return n[Nt].isManual_=!0,ss(e),n}finishDraft(t,e){const n=t&&t[Nt];(!n||!n.isManual_)&&Wt(9);const{scope_:r}=n;return hd(r,e),pd(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const i=e[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(e=e.slice(n+1));const r=De("Patches").applyPatches_;return cn(t)?r(t,e):this.produce(t,i=>r(i,e))}};function ds(t,e){const n=Vr(t)?De("MapSet").proxyMap_(t,e):Ur(t)?De("MapSet").proxySet_(t,e):sw(t,e);return(e?e.scope_:dd()).drafts_.push(n),n}function lw(t){return cn(t)||Wt(10,t),yd(t)}function yd(t){if(!Re(t)||$r(t))return t;const e=t[Nt];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=rs(t,e.scope_.immer_.useStrictShallowCopy_)}else n=rs(t,!0);return Br(n,(r,i)=>{ud(n,r,yd(i))}),e&&(e.finalized_=!1),n}var Dt=new cw,Qt=Dt.produce;Dt.produceWithPatches.bind(Dt),Dt.setAutoFreeze.bind(Dt),Dt.setUseStrictShallowCopy.bind(Dt),Dt.applyPatches.bind(Dt),Dt.createDraft.bind(Dt),Dt.finishDraft.bind(Dt);const Hr={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},hs=new Map,Wr=t=>{const e=hs.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,r])=>[n,r.getState()])):{}},uw=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const r=hs.get(n.name);if(r)return{type:"tracked",store:t,...r};const i={connection:e.connect(n),stores:{}};return hs.set(n.name,i),{type:"tracked",store:t,...i}},dw=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=e;let d;try{d=(o??(Hr?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!d)return(Hr?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const{connection:c,...f}=uw(a,d,l);let m=!0;i.setState=(v,C,b)=>{const S=n(v,C);if(!m)return S;const T=b===void 0?{type:s||"anonymous"}:typeof b=="string"?{type:b}:b;return a===void 0?(c==null||c.send(T,r()),S):(c==null||c.send({...T,type:`${a}/${T.type}`},{...Wr(l.name),[a]:i.getState()}),S)};const g=(...v)=>{const C=m;m=!1,n(...v),m=C},_=t(i.setState,r,i);if(f.type==="untracked"?c==null||c.init(_):(f.stores[f.store]=i,c==null||c.init(Object.fromEntries(Object.entries(f.stores).map(([v,C])=>[v,v===f.store?_:C.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let v=!1;const C=i.dispatch;i.dispatch=(...b)=>{(Hr?"production":void 0)!=="production"&&b[0].type==="__setState"&&!v&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),v=!0),C(...b)}}return c.subscribe(v=>{var C;switch(v.type){case"ACTION":if(typeof v.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return fs(v.payload,b=>{if(b.type==="__setState"){if(a===void 0){g(b.state);return}Object.keys(b.state).length!==1&&console.error(`
96
- [zustand devtools middleware] Unsupported __setState action format.
97
- When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
98
- and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
99
- `);const S=b.state[a];if(S==null)return;JSON.stringify(i.getState())!==JSON.stringify(S)&&g(S);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(b)});case"DISPATCH":switch(v.payload.type){case"RESET":return g(_),a===void 0?c==null?void 0:c.init(i.getState()):c==null?void 0:c.init(Wr(l.name));case"COMMIT":if(a===void 0){c==null||c.init(i.getState());return}return c==null?void 0:c.init(Wr(l.name));case"ROLLBACK":return fs(v.state,b=>{if(a===void 0){g(b),c==null||c.init(i.getState());return}g(b[a]),c==null||c.init(Wr(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return fs(v.state,b=>{if(a===void 0){g(b);return}JSON.stringify(i.getState())!==JSON.stringify(b[a])&&g(b[a])});case"IMPORT_STATE":{const{nextLiftedState:b}=v.payload,S=(C=b.computedStates.slice(-1)[0])==null?void 0:C.state;if(!S)return;g(a===void 0?S:S[a]),c==null||c.send(null,b);return}case"PAUSE_RECORDING":return m=!m}return}}),_},fs=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)};function hw(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Yn=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Yn(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yn(r)(n)}}}},fw=(t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:C=>C,version:0,merge:(C,b)=>({...b,...C}),...e},s=!1;const a=new Set,l=new Set;let d;try{d=o.getStorage()}catch{}if(!d)return t((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...C)},r,i);const c=Yn(o.serialize),f=()=>{const C=o.partialize({...r()});let b;const S=c({state:C,version:o.version}).then(T=>d.setItem(o.name,T)).catch(T=>{b=T});if(b)throw b;return S},m=i.setState;i.setState=(C,b)=>{m(C,b),f()};const g=t((...C)=>{n(...C),f()},r,i);let _;const v=()=>{var C;if(!d)return;s=!1,a.forEach(S=>S(r()));const b=((C=o.onRehydrateStorage)==null?void 0:C.call(o,r()))||void 0;return Yn(d.getItem.bind(d))(o.name).then(S=>{if(S)return o.deserialize(S)}).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==o.version){if(o.migrate)return o.migrate(S.state,S.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return S.state}).then(S=>{var T;return _=o.merge(S,(T=r())!=null?T:g),n(_,!0),f()}).then(()=>{b==null||b(_,void 0),s=!0,l.forEach(S=>S(_))}).catch(S=>{b==null||b(void 0,S)})};return i.persist={setOptions:C=>{o={...o,...C},C.getStorage&&(d=C.getStorage())},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:C=>(a.add(C),()=>{a.delete(C)}),onFinishHydration:C=>(l.add(C),()=>{l.delete(C)})},v(),_||g},pw=(t,e)=>(n,r,i)=>{let o={storage:hw(()=>localStorage),partialize:v=>v,version:0,merge:(v,C)=>({...C,...v}),...e},s=!1;const a=new Set,l=new Set;let d=o.storage;if(!d)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...v)},r,i);const c=()=>{const v=o.partialize({...r()});return d.setItem(o.name,{state:v,version:o.version})},f=i.setState;i.setState=(v,C)=>{f(v,C),c()};const m=t((...v)=>{n(...v),c()},r,i);i.getInitialState=()=>m;let g;const _=()=>{var v,C;if(!d)return;s=!1,a.forEach(S=>{var T;return S((T=r())!=null?T:m)});const b=((C=o.onRehydrateStorage)==null?void 0:C.call(o,(v=r())!=null?v:m))||void 0;return Yn(d.getItem.bind(d))(o.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==o.version){if(o.migrate)return[!0,o.migrate(S.state,S.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var T;const[M,A]=S;if(g=o.merge(A,(T=r())!=null?T:m),n(g,!0),M)return c()}).then(()=>{b==null||b(g,void 0),g=r(),s=!0,l.forEach(S=>S(g))}).catch(S=>{b==null||b(void 0,S)})};return i.persist={setOptions:v=>{o={...o,...v},v.storage&&(d=v.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>_(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},o.skipHydration||_(),g||m},mw=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((Hr?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),fw(t,e)):pw(t,e);/*! js-cookie v3.0.5 | MIT */function Kr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var gw={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ps(t,e){function n(i,o,s){if(!(typeof document>"u")){s=Kr({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+a}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var l=o[a].split("="),d=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(s[c]=t.read(d,c),i===c)break}catch{}}return i?s[i]:s}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",Kr({},o,{expires:-1}))},withAttributes:function(i){return ps(this.converter,Kr({},this.attributes,i))},withConverter:function(i){return ps(Kr({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var we=ps(gw,{path:"/"}),Le=(t=>(t[t.IntroduceYourself=0]="IntroduceYourself",t[t.UploadFile=1]="UploadFile",t))(Le||{});function qr(t){const e=t.content.slice(0,50);return t.support?`${t.date}-${t.authorName}-${e}`:`${t.date}-customer-${e}`}function ms(t,e){const n=new Map;return t.forEach(r=>{const i=qr(r);n.set(i,r)}),e.forEach(r=>{var s;const i=qr(r),o=(s=n.get(i))==null?void 0:s.localId;n.set(i,o?{...r,localId:o}:r)}),Array.from(n.values()).sort((r,i)=>r.date-i.date)}function wd(t,e){const n=qr(e);return t.some(r=>qr(r)===n)}const vd=460,yw=750,ww="https://api.deskcord.chat";function vw(){var n,r,i,o,s,a;const t=(r=(n=window.deskcord)==null?void 0:n.settings)==null?void 0:r.app_id,e=((o=(i=window.deskcord)==null?void 0:i.settings)==null?void 0:o.domain)??ww;if(!t)throw new Error("Cannot initialize discord chat. Please check your installation and embed.");return{app_id:t,domain:e,user:(a=(s=window.deskcord)==null?void 0:s.settings)==null?void 0:a.user}}const It=vw();function ht(...t){}const _w="DESKCORD_UNAVAILABLE";class Gn extends Error{constructor(){super("Deskcord is temporarily unavailable")}}async function Xn(t){if(t.status!==503)return;const e=await t.clone().json().catch(()=>null);if((e==null?void 0:e.code)===_w)throw z.getState().setWidgetUnavailable(!0),new Gn}async function bw(t){const e=new Headers;e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${t}`);try{const n=await fetch(`${It.domain}/conversations/unread-count`,{method:"GET",headers:e});return await Xn(n),n.ok?(await n.json()).unreadCount:(ht(`Failed to fetch unread count: ${n.status}`),null)}catch{return null}}async function xw(t,e){const n=new Headers;n.append("Content-Type","application/json"),n.append("Authorization",`Bearer ${t}`);try{const r=await fetch(`${It.domain}/conversations/mark-read`,{method:"POST",headers:n,body:JSON.stringify({timestamp:e})});return r.ok?(await r.json()).success:(ht(`Failed to mark as read: ${r.status}`),!1)}catch{return!1}}const gs="deskcord_last_read",ys="deskcord_unread_count",Cw=()=>{try{const t=localStorage.getItem(gs);if(!t)return null;const e=parseInt(t,10);return isNaN(e)?null:e}catch{return console.warn("[Deskcord] localStorage unavailable for reading last read timestamp"),null}},_d=t=>{try{localStorage.setItem(gs,t.toString())}catch{console.warn("[Deskcord] localStorage unavailable for writing last read timestamp")}},Yr=()=>{try{const t=localStorage.getItem(ys);if(!t)return 0;const e=parseInt(t,10);return isNaN(e)?0:e}catch{return console.warn("[Deskcord] localStorage unavailable for reading unread count"),0}},Zn=t=>{try{localStorage.setItem(ys,t.toString())}catch{console.warn("[Deskcord] localStorage unavailable for writing unread count")}},Sw=()=>{try{localStorage.removeItem(gs),localStorage.removeItem(ys)}catch{console.warn("[Deskcord] localStorage unavailable for clearing unread data")}},z=Qy(dw(mw((t,e)=>({_REHYDRATED_:!1,token:"",isNetworkInitialized:!1,isChatOpen:!1,isConversationOpen:!0,conversations:[],email:"",username:"",avatarUrl:"",verifiedUserId:null,openConversationId:null,guildSettings:{iconURL:"",header_title:"",header_subtitle:"",lastUpdate:null},fullScreen:!1,isLoading:!1,networkError:null,widgetUnavailable:!1,setWidgetUnavailable:n=>t(()=>({widgetUnavailable:n})),currentConversationLastFetchedAt:null,pastConversationsLastFetchedAt:null,unreadCount:0,lastReadMessageDate:null,typingByThread:{},setThreadTyping:(n,r)=>t(i=>({typingByThread:{...i.typingByThread,[n]:r}})),setRehydrated:n=>t(()=>({_REHYDRATED_:n})),setFullScreen:n=>t(()=>({fullScreen:n})),setToken:n=>t(()=>({token:n})),toggleChatOpen:()=>t(n=>({isChatOpen:!n.isChatOpen})),setNetworkInitialized:n=>t(()=>({isNetworkInitialized:n})),setChatOpen:n=>t(()=>({isChatOpen:n})),setOpenConversationId:n=>t(()=>({openConversationId:n})),setConversations:n=>t(()=>({conversations:n})),setGuildSettings:n=>t(r=>({guildSettings:{...r.guildSettings,...n}})),setConversationOpen:(n,r)=>t(i=>({conversations:i.conversations.map(o=>o.threadId===n?{...o,status:r?"open":"closed"}:o)})),setConversationCSMember:(n,r)=>t(Qt(i=>{const o=i.conversations.find(s=>s.threadId===n);o&&(o.csMember=r)})),addMessage:(n,r)=>t(Qt(i=>{const o=i.conversations.find(s=>s.threadId===n);o?o.messages.push(r):(i.conversations.push({threadId:n,lastMessageDate:Date.now(),firstMessageDate:Date.now(),status:"open",messages:[r]}),i.openConversationId=n)})),updateMessage:(n,r,i)=>t(Qt(o=>{const s=o.conversations.findIndex(a=>a.threadId===n);if(s!==-1){const a=o.conversations[s].messages.findIndex(l=>l.date===r);a!==-1&&(o.conversations[s].messages[a]=i)}})),removeMessage:(n,r)=>t(Qt(i=>{const o=i.conversations.findIndex(s=>s.threadId===n);o!==-1&&(i.conversations[o].messages=i.conversations[o].messages.filter(s=>s.date!==r))})),tempConversationToThread:n=>t(Qt(r=>{r.openConversationId=n,bd(r,n)})),confirmPendingMessage:(n,r)=>t(Qt(i=>{const o=i.conversations.find(l=>l.messages.some(d=>d.localId===n));if(!o)return;const s=o.messages.find(l=>l.localId===n);if(s.pending=!1,s.date=r.date,o.threadId===r.threadId){o.lastMessageDate=r.date;return}if(o.threadId==="TEMP"){bd(i,r.threadId),i.openConversationId=r.threadId;return}o.messages=o.messages.filter(l=>l.localId!==n),o.status="closed";const a=i.conversations.find(l=>l.threadId===r.threadId);a?(a.messages.push(s),a.status="open",a.lastMessageDate=r.date):i.conversations.push({threadId:r.threadId,firstMessageDate:r.date,lastMessageDate:r.date,status:"open",messages:[s]}),i.openConversationId===o.threadId&&(i.openConversationId=r.threadId)})),discardPendingMessage:n=>t(Qt(r=>{r.conversations.forEach(i=>{i.messages=i.messages.filter(o=>o.localId!==n)})})),setEmail:n=>t(()=>({email:n})),setUsername:n=>t(()=>({username:n})),setIdentity:n=>t(()=>n),removeIntroConversation:()=>t(Qt(n=>{const r=n.conversations.find(i=>i.threadId==="TEMP"&&i.messages.every(o=>o.customRenderer===Le.IntroduceYourself));r&&(n.conversations=n.conversations.filter(i=>i!==r),n.openConversationId==="TEMP"&&(n.openConversationId=null))})),resetSession:()=>{Sw(),t(()=>({token:"",username:"",email:"",avatarUrl:"",verifiedUserId:null,conversations:[],openConversationId:null,isNetworkInitialized:!1,networkError:null,currentConversationLastFetchedAt:null,pastConversationsLastFetchedAt:null,unreadCount:0,lastReadMessageDate:null,typingByThread:{}}))},getConversation:()=>{const{conversations:n,openConversationId:r}=e();return r?n.find(i=>i.threadId===r)??null:null},setLoading:n=>t(()=>({isLoading:n})),setNetworkError:n=>t(()=>({networkError:n})),setCurrentConversationLastFetchedAt:n=>t(()=>({currentConversationLastFetchedAt:n})),setPastConversationsLastFetchedAt:n=>t(()=>({pastConversationsLastFetchedAt:n})),smartMergeCurrentConversation:n=>t(Qt(r=>{const i=r.conversations.findIndex(o=>o.threadId===n.threadId);if(i!==-1){const o=r.conversations[i],s=ms(o.messages,n.messages);r.conversations[i]={...n,messages:s}}else r.conversations.push(n);r.currentConversationLastFetchedAt=Date.now()})),smartMergePastConversations:n=>t(Qt(r=>{n.forEach(i=>{const o=r.conversations.findIndex(s=>s.threadId===i.threadId);if(o!==-1){const s=r.conversations[o],a=ms(s.messages,i.messages);r.conversations[o]={...i,messages:a}}else r.conversations.push(i)}),r.pastConversationsLastFetchedAt=Date.now()})),incrementUnreadCount:()=>t(n=>{const r=n.unreadCount+1;return Zn(r),{unreadCount:r}}),markMessagesAsRead:()=>t(()=>{const n=Date.now();return Zn(0),_d(n),{unreadCount:0,lastReadMessageDate:n}}),setUnreadCount:n=>t(()=>(Zn(n),{unreadCount:n})),syncUnreadCountFromServer:async()=>{const n=we.get("discord-widget");if(!n){const r=Yr();t(()=>({unreadCount:r}));return}try{const r=await bw(n);if(r!==null)ht(`Synced unread count from server: ${r}`),Zn(r),t(()=>({unreadCount:r}));else{ht("Server unavailable, using cached unread count");const i=Yr();t(()=>({unreadCount:i}))}}catch{const i=Yr();t(()=>({unreadCount:i}))}},markMessagesAsReadWithSync:async()=>{const n=Date.now();Zn(0),_d(n),t(()=>({unreadCount:0,lastReadMessageDate:n}));const r=we.get("discord-widget");if(r)try{const i=await xw(r,n);ht(i?"Successfully synced mark-read with server":"Failed to sync mark-read with server (will retry on next load)")}catch{}},initializeUnreadState:()=>{const n=Yr(),r=Cw();t(()=>({unreadCount:n,lastReadMessageDate:r}))}}),{name:"discord-widget-storage",partialize:t=>({token:t.token,username:t.username,avatarUrl:t.avatarUrl,verifiedUserId:t.verifiedUserId,email:t.email,openConversationId:t.openConversationId,conversations:Ew(t.conversations),guildSettings:t.guildSettings}),merge:(t,e)=>{const n=t??{},r=kw(n.conversations??[]),i=n.openConversationId==="TEMP"||r.some(o=>o.threadId===n.openConversationId)?n.openConversationId??null:null;return{...e,...n,conversations:r,openConversationId:i}},onRehydrateStorage:t=>()=>t.setRehydrated(!0)}),{enabled:!1}));function bd(t,e){const n=t.conversations.find(i=>i.threadId==="TEMP");if(!n)return;const r=t.conversations.find(i=>i.threadId===e);if(!r){n.threadId=e;return}r.messages=ms(r.messages,n.messages),t.conversations=t.conversations.filter(i=>i!==n)}function kw(t){return t.filter(e=>typeof(e==null?void 0:e.threadId)=="string"&&e.threadId.length>0).map(e=>{const n=(e.messages??[]).filter(o=>Number.isFinite(o==null?void 0:o.date)),r=n.map(o=>o.date),i=r.length?Math.max(...r):Date.now();return{...e,messages:n,firstMessageDate:Number.isFinite(e.firstMessageDate)?e.firstMessageDate:r[0]??i,lastMessageDate:Number.isFinite(e.lastMessageDate)?e.lastMessageDate:i}})}function Ew(t){return t.map(e=>({...e,messages:e.messages.filter(n=>!n.ephemeral&&!n.pending)}))}const Tw="bottom-right";function Aw(t){return t==="bottom-left"||t==="bottom-right"}function ws(t){return Aw(t)?t:Tw}function vs(t,e){return t==="bottom-left"?{left:e}:{right:e}}const Pw=({onClick:t,isOpen:e,unreadCount:n=0})=>{const[r,i]=H(!1),o=z(l=>{var d;return(d=l.guildSettings)==null?void 0:d.widget_position}),s=ws(o);$(()=>{if(n>0&&!e){i(!0);const l=setTimeout(()=>i(!1),600),d=setInterval(()=>{i(!0),setTimeout(()=>i(!1),600)},1e4);return()=>{clearTimeout(l),clearInterval(d)}}else i(!1)},[n,e]);const a=n>0&&!e;return w("div",{className:"fixed",style:{zIndex:9998,bottom:30,...vs(s,30)},children:[r&&a&&w(ye.div,{className:"absolute inset-0 rounded-full",style:{background:"var(--dc-primary)"},initial:{scale:1,opacity:.6},animate:{scale:1.5,opacity:0},transition:{duration:.6,ease:"easeOut"}}),w(ye.button,{onClick:t,className:"relative w-14 h-14 rounded-full shadow-lg flex items-center justify-center outline-none",style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.25)",background:"var(--dc-primary)"},"aria-label":e?"Close chat":"Open chat",animate:{scale:[1,.9,1.05,1]},transition:{duration:.25,ease:"easeOut"},children:[w(Tr,{mode:"wait",initial:!1,children:w(ye.div,{initial:{rotate:-90,opacity:0,scale:.9},animate:{rotate:0,opacity:1,scale:1},exit:{rotate:90,opacity:0,scale:.9},transition:{duration:.18,ease:"easeInOut"},className:"flex items-center justify-center",whileHover:{scale:1.1},whileTap:{scale:.95},children:e?w(Sy,{size:24,color:"#FFFFFF"}):w(vy,{size:22,fill:"#FFFFFF",color:"#FFFFFF"})},e?"close":"open")}),w(Tr,{children:a&&w(ye.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"absolute flex items-center justify-center",style:{top:-4,right:-4,minWidth:22,height:22,borderRadius:11,backgroundColor:"var(--dc-primary)",border:"2px solid #FFFFFF",padding:"0 6px"},children:w("span",{style:{color:"#FFFFFF",fontSize:12,fontWeight:600,lineHeight:1},children:n>99?"99+":n})})})]})]})};async function Iw({content:t}){const e=z.getState().username,n=we.get("discord-widget"),r=JSON.stringify({name:e,content:t}),i=new Headers;i.append("Content-Type","application/json"),i.append("Authorization",`Bearer ${n}`);const o={method:"POST",headers:i,body:r},s=await fetch(`${It.domain}/conversations/sendMessage`,o);if(await Xn(s),!s.ok)throw new Error(`Could not send message (${s.status})`);const a=await s.json();if(!(a!=null&&a.threadId)||!Number.isFinite(a.date))throw new Error("Unexpected sendMessage response");return a}const Jn="System",Mw={content:"This conversation has been closed by the support.",support:!0,authorName:Jn,date:Date.now()},Rw={content:"",support:!0,authorName:Jn,date:Date.now(),customRenderer:Le.IntroduceYourself};function xd(t){return{content:`You are now chatting with ${t}.`,support:!0,authorName:Jn,date:Date.now(),ephemeral:!0}}function Nw(t){return{content:"",support:!0,authorName:Jn,date:Date.now(),customRenderer:Le.UploadFile,customRendererProps:{file:t},ephemeral:!0}}function Dw(t,e){return{content:"",support:!1,authorName:"",date:typeof e=="number"&&Number.isFinite(e)?e:Date.now(),ephemeral:!0,attachments:t}}const Cd=["image/png","image/jpeg","image/gif","image/webp","application/pdf"],Lw=he(({accept:t,maxSize:e,uploadConfig:n,onFileSelect:r,onUploadComplete:i,onUploadStart:o,onError:s},a)=>{const l=F(null),d=F(null),{addMessage:c,getConversation:f,removeMessage:m,updateMessage:g}=z(),_=f();En(a,()=>({upload:async()=>{if(d.current)try{const M=new FormData;M.append("file",d.current),o==null||o(d.current),C(d.current);const A=await fetch(n.url,{method:n.method,headers:n.headers,body:M});if(await Xn(A),!A.ok)throw new Error(`Upload failed (${A.status})`);const R=await A.json();i==null||i(A),b(d.current),v(R)}catch(M){s==null||s(M),S(d.current)}},clear:()=>{d.current=null,l.current&&(l.current.value=""),r==null||r(null)}}));function v(M){_&&c(_.threadId,Dw(M.attachments,M.date))}function C(M){_&&c(_.threadId,Nw({fileName:M.name,status:"uploading",size:M.size}))}function b(M){var R;if(!_)return;const A=(R=f())==null?void 0:R.messages.find(N=>{var k,P;return((P=(k=N.customRendererProps)==null?void 0:k.file)==null?void 0:P.fileName)===M.name});A&&m(_.threadId,A.date)}function S(M){var R,N;if(!_)return;const A=(R=f())==null?void 0:R.messages.find(k=>{var P,D;return((D=(P=k.customRendererProps)==null?void 0:P.file)==null?void 0:D.fileName)===M.name});(N=A==null?void 0:A.customRendererProps)!=null&&N.file&&g(_.threadId,A.date,{...A,customRendererProps:{...A.customRendererProps,file:{...A.customRendererProps.file,status:"error"}}})}return w(tt,{children:[w("button",{className:"text-gray-500 hover:text-blue-500","aria-label":"Upload file",onClick:()=>{var M;return(M=l.current)==null?void 0:M.click()},children:w(_y,{size:16})}),w("input",{type:"file",accept:t,ref:l,style:{display:"none"},onChange:M=>{var R;const A=(R=M.target.files)==null?void 0:R[0];A&&A.size<=e&&Cd.includes(A.type)?(d.current=A,r==null||r(A)):(d.current=null,r==null||r(null))}})]})}),Ow=({size:t})=>w("svg",{className:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:t||16,height:t||16,fill:"currentColor",viewBox:"0 0 16 16",children:w("path",{d:"M15.964.686a.5.5 0 0 0-.65-.65L.767 5.855H.766l-.452.18a.5.5 0 0 0-.082.887l.41.26.001.002 4.995 3.178 3.178 4.995.002.002.26.41a.5.5 0 0 0 .886-.083l6-15Zm-1.833 1.89L6.637 10.07l-.215-.338a.5.5 0 0 0-.154-.154l-.338-.215 7.494-7.494 1.178-.471-.47 1.178Z"})}),Bw=({onPickEmoji:t})=>w("div",{className:"mb-2 p-2 bg-white max-h-40 overflow-y-auto",children:w("div",{className:"grid grid-cols-8 gap-2",children:Fw.map((e,n)=>w("button",{className:"text-2xl hover:bg-gray-100 rounded",onClick:()=>t(e),children:e},n))})}),Fw=["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","☹️","😣","😖","😫","😩","🥺","😢","😭","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🤫","🤥","😶","😐","😑","😬","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕"],Vw=({imageUrl:t,fileName:e,onDelete:n,width:r,height:i})=>w("div",{className:"relative w-32 h-32 rounded-lg overflow-hidden bg-gray-100 border border-gray-200",children:[w("div",{className:"flex justify-center absolute inset-0",children:w("img",{src:t,alt:"Preview",className:`w-[${r}px] h-[${i}px] max-w-[100px] max-h-[100px] aspect-auto`})}),w("button",{onClick:n,className:"absolute top-1 right-1 bg-gray-600 p-1 rounded-lg text-red-400 hover:text-white transition",children:w(Zu,{size:20})}),w("div",{className:"absolute bottom-0 left-0 right-0 bg-gray-800 bg-opacity-80 text-white text-sm px-2 py-1 truncate",children:e})]}),_s=({extension:t,className:e="",iconColorClassName:n="text-gray-300 dark:text-neutral-600"})=>{const r=t==null?void 0:t.slice(0,4).toUpperCase();return w("span",{className:`relative inline-flex shrink-0 items-center justify-center ${e}`,children:[w(yy,{className:`w-full h-full ${n}`,strokeWidth:1.5}),r&&w("span",{className:"absolute left-1/2 bottom-[22%] -translate-x-1/2 rounded-[3px] bg-blue-600 px-[3px] leading-[11px] text-[7px] font-bold tracking-tight text-white",children:r})]})};function Gr(t){const e=t.lastIndexOf(".");return e<=0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function bs(t,e=!1,n=1){const r=e?1e3:1024;if(Math.abs(t)<r)return t+" B";const i=e?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let o=-1;const s=10**n;do t/=r,++o;while(Math.round(Math.abs(t)*s)/s>=r&&o<i.length-1);return t.toFixed(n)+" "+i[o]}const Uw=({fileName:t,size:e,onDelete:n})=>w("div",{className:"relative flex items-center gap-3 w-56 rounded-lg border border-gray-200 bg-gray-50 pl-3 pr-8 py-2",children:[w(_s,{extension:Gr(t),className:"w-8 h-9"}),w("div",{className:"min-w-0",children:[w("p",{className:"text-sm font-medium text-gray-800 truncate",children:t}),w("p",{className:"text-xs text-gray-500",children:bs(e)})]}),w("button",{onClick:n,"aria-label":"Remove attachment",className:"absolute top-1 right-1 p-1 rounded-lg text-gray-400 hover:text-red-500 transition",children:w(Zu,{size:16})})]}),$w=({className:t})=>w("svg",{className:t,viewBox:"0 0 642 74",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w("path",{d:"M23.9 73.2C19.4333 73.2 15.3667 72.0667 11.7 69.8C8.1 67.5333 5.23333 64.4333 3.1 60.5C1.03333 56.5 7.45058e-08 51.9667 7.45058e-08 46.9C7.45058e-08 41.7667 1.06667 37.2333 3.2 33.3C5.33333 29.3 8.23333 26.1667 11.9 23.9C15.6333 21.5667 19.7667 20.4 24.3 20.4C27.7667 20.4 30.8 21.0333 33.4 22.3C36 23.5 38.1333 25.2667 39.8 27.6V-2.86102e-06H54.8V72H41.5L39.8 65.5C38.8 66.9 37.5667 68.2 36.1 69.4C34.7 70.5333 33 71.4333 31 72.1C29 72.8333 26.6333 73.2 23.9 73.2ZM27.8 60.1C30.2667 60.1 32.4333 59.5333 34.3 58.4C36.2333 57.2667 37.7 55.7 38.7 53.7C39.7667 51.7 40.3 49.4 40.3 46.8C40.3 44.2 39.7667 41.9 38.7 39.9C37.7 37.9 36.2333 36.3333 34.3 35.2C32.4333 34.0667 30.2667 33.5 27.8 33.5C25.4 33.5 23.2333 34.0667 21.3 35.2C19.4333 36.3333 17.9667 37.9 16.9 39.9C15.8333 41.9 15.3 44.1667 15.3 46.7C15.3 49.3 15.8333 51.6333 16.9 53.7C17.9667 55.7 19.4333 57.2667 21.3 58.4C23.2333 59.5333 25.4 60.1 27.8 60.1ZM86.6086 73.2C81.4086 73.2 76.8419 72.1333 72.9086 70C68.9753 67.8 65.8753 64.7667 63.6086 60.9C61.4086 56.9667 60.3086 52.4667 60.3086 47.4C60.3086 42.2 61.4086 37.5667 63.6086 33.5C65.8086 29.4333 68.8753 26.2333 72.8086 23.9C76.7419 21.5667 81.3086 20.4 86.5086 20.4C91.5753 20.4 96.0086 21.5 99.8086 23.7C103.609 25.9 106.575 28.9 108.709 32.7C110.909 36.4333 112.009 40.7667 112.009 45.7C112.009 46.3667 111.975 47.1333 111.909 48C111.909 48.8 111.842 49.6333 111.709 50.5H71.0086V41.8H96.7086C96.5753 39 95.5419 36.7667 93.6086 35.1C91.7419 33.3667 89.4086 32.5 86.6086 32.5C84.4753 32.5 82.5419 33 80.8086 34C79.0753 35 77.6753 36.5 76.6086 38.5C75.6086 40.5 75.1086 43.0333 75.1086 46.1V49.1C75.1086 51.4333 75.5419 53.5 76.4086 55.3C77.3419 57.1 78.6419 58.5 80.3086 59.5C82.0419 60.5 84.0753 61 86.4086 61C88.6086 61 90.4086 60.5667 91.8086 59.7C93.2753 58.7667 94.4086 57.6 95.2086 56.2H110.509C109.575 59.4 107.975 62.3 105.709 64.9C103.442 67.4333 100.675 69.4667 97.4086 71C94.1419 72.4667 90.5419 73.2 86.6086 73.2ZM138.039 73.2C133.306 73.2 129.206 72.4667 125.739 71C122.339 69.4667 119.639 67.4 117.639 64.8C115.706 62.2 114.606 59.2667 114.339 56H129.239C129.506 57.1333 129.972 58.1667 130.639 59.1C131.372 59.9667 132.339 60.6667 133.539 61.2C134.806 61.6667 136.206 61.9 137.739 61.9C139.406 61.9 140.739 61.7 141.739 61.3C142.806 60.8333 143.606 60.2333 144.139 59.5C144.672 58.7667 144.939 58 144.939 57.2C144.939 55.9333 144.539 54.9667 143.739 54.3C143.006 53.6333 141.906 53.1 140.439 52.7C138.972 52.2333 137.206 51.8 135.139 51.4C132.739 50.8667 130.339 50.2667 127.939 49.6C125.606 48.8667 123.506 47.9667 121.639 46.9C119.839 45.8333 118.372 44.4667 117.239 42.8C116.172 41.0667 115.639 38.9667 115.639 36.5C115.639 33.5 116.472 30.8 118.139 28.4C119.806 25.9333 122.206 24 125.339 22.6C128.472 21.1333 132.272 20.4 136.739 20.4C143.072 20.4 148.039 21.8 151.639 24.6C155.239 27.4 157.372 31.1667 158.039 35.9H144.039C143.639 34.5667 142.806 33.5667 141.539 32.9C140.272 32.1667 138.672 31.8 136.739 31.8C134.539 31.8 132.872 32.1667 131.739 32.9C130.606 33.6333 130.039 34.6 130.039 35.8C130.039 36.6 130.406 37.3333 131.139 38C131.939 38.6 133.072 39.1333 134.539 39.6C136.006 40.0667 137.806 40.5333 139.939 41C144.006 41.8667 147.506 42.8 150.439 43.8C153.439 44.8 155.772 46.2667 157.439 48.2C159.106 50.0667 159.906 52.8 159.839 56.4C159.906 59.6667 159.039 62.5667 157.239 65.1C155.506 67.6333 153.006 69.6333 149.739 71.1C146.472 72.5 142.572 73.2 138.039 73.2ZM198.643 72L177.843 44.4L196.343 21.6H214.043L189.143 50.8V38.8L217.243 72H198.643ZM165.043 72V-2.86102e-06H180.043V72H165.043ZM239.509 73.2C234.309 73.2 229.709 72.0667 225.709 69.8C221.776 67.5333 218.676 64.4333 216.409 60.5C214.209 56.5667 213.109 52.0667 213.109 47C213.109 41.8 214.209 37.2333 216.409 33.3C218.676 29.3 221.776 26.1667 225.709 23.9C229.709 21.5667 234.309 20.4 239.509 20.4C246.109 20.4 251.643 22.1333 256.109 25.6C260.643 29.0667 263.509 33.9 264.709 40.1H248.809C248.209 37.9667 247.076 36.3 245.409 35.1C243.743 33.9 241.743 33.3 239.409 33.3C237.209 33.3 235.276 33.8667 233.609 35C232.009 36.0667 230.743 37.6333 229.809 39.7C228.876 41.7 228.409 44.0667 228.409 46.8C228.409 48.8667 228.676 50.7333 229.209 52.4C229.743 54.0667 230.476 55.5 231.409 56.7C232.409 57.9 233.576 58.8333 234.909 59.5C236.243 60.1 237.743 60.4 239.409 60.4C241.009 60.4 242.409 60.1333 243.609 59.6C244.876 59.0667 245.943 58.3 246.809 57.3C247.743 56.3 248.409 55.0667 248.809 53.6H264.709C263.509 59.6 260.643 64.3667 256.109 67.9C251.576 71.4333 246.043 73.2 239.509 73.2ZM294.528 73.2C289.661 73.2 285.295 72.0667 281.428 69.8C277.561 67.5333 274.495 64.4333 272.228 60.5C269.961 56.5 268.828 51.9667 268.828 46.9C268.828 41.7 269.961 37.1333 272.228 33.2C274.495 29.2 277.561 26.0667 281.428 23.8C285.361 21.5333 289.728 20.4 294.528 20.4C299.461 20.4 303.861 21.5333 307.728 23.8C311.595 26.0667 314.661 29.2 316.928 33.2C319.195 37.1333 320.328 41.6667 320.328 46.8C320.328 51.9333 319.195 56.5 316.928 60.5C314.661 64.4333 311.595 67.5333 307.728 69.8C303.861 72.0667 299.461 73.2 294.528 73.2ZM294.528 60.2C296.528 60.2 298.295 59.7 299.828 58.7C301.428 57.7 302.695 56.2 303.628 54.2C304.561 52.2 305.028 49.7333 305.028 46.8C305.028 43.8667 304.561 41.4 303.628 39.4C302.695 37.4 301.461 35.9 299.928 34.9C298.395 33.9 296.628 33.4 294.628 33.4C292.628 33.4 290.828 33.9 289.228 34.9C287.695 35.9 286.461 37.4 285.528 39.4C284.595 41.4 284.128 43.8667 284.128 46.8C284.128 49.7333 284.595 52.2 285.528 54.2C286.461 56.2 287.695 57.7 289.228 58.7C290.828 59.7 292.595 60.2 294.528 60.2ZM325.852 72V21.6H339.152L340.552 30.8C341.885 28.6667 343.452 26.8333 345.252 25.3C347.052 23.7667 349.118 22.5667 351.452 21.7C353.852 20.8333 356.418 20.4 359.152 20.4V36.3H354.152C352.152 36.3 350.318 36.5333 348.652 37C347.052 37.4 345.652 38.1 344.452 39.1C343.318 40.1 342.418 41.4667 341.752 43.2C341.152 44.8667 340.852 46.9667 340.852 49.5V72H325.852ZM383.853 73.2C379.386 73.2 375.32 72.0667 371.653 69.8C368.053 67.5333 365.186 64.4333 363.053 60.5C360.986 56.5 359.953 51.9667 359.953 46.9C359.953 41.7667 361.02 37.2333 363.153 33.3C365.286 29.3 368.186 26.1667 371.853 23.9C375.586 21.5667 379.72 20.4 384.253 20.4C387.72 20.4 390.753 21.0333 393.353 22.3C395.953 23.5 398.086 25.2667 399.753 27.6V-2.86102e-06H414.753V72H401.453L399.753 65.5C398.753 66.9 397.52 68.2 396.053 69.4C394.653 70.5333 392.953 71.4333 390.953 72.1C388.953 72.8333 386.586 73.2 383.853 73.2ZM387.753 60.1C390.22 60.1 392.386 59.5333 394.253 58.4C396.186 57.2667 397.653 55.7 398.653 53.7C399.72 51.7 400.253 49.4 400.253 46.8C400.253 44.2 399.72 41.9 398.653 39.9C397.653 37.9 396.186 36.3333 394.253 35.2C392.386 34.0667 390.22 33.5 387.753 33.5C385.353 33.5 383.186 34.0667 381.253 35.2C379.386 36.3333 377.92 37.9 376.853 39.9C375.786 41.9 375.253 44.1667 375.253 46.7C375.253 49.3 375.786 51.6333 376.853 53.7C377.92 55.7 379.386 57.2667 381.253 58.4C383.186 59.5333 385.353 60.1 387.753 60.1ZM428.762 72.5C426.028 72.5 423.795 71.7 422.062 70.1C420.395 68.4333 419.562 66.4333 419.562 64.1C419.562 61.7 420.395 59.7 422.062 58.1C423.795 56.4333 426.028 55.6 428.762 55.6C431.428 55.6 433.595 56.4333 435.262 58.1C436.928 59.7 437.762 61.7 437.762 64.1C437.762 66.4333 436.928 68.4333 435.262 70.1C433.595 71.7 431.428 72.5 428.762 72.5ZM467.42 73.2C462.22 73.2 457.62 72.0667 453.62 69.8C449.686 67.5333 446.586 64.4333 444.32 60.5C442.12 56.5667 441.02 52.0667 441.02 47C441.02 41.8 442.12 37.2333 444.32 33.3C446.586 29.3 449.686 26.1667 453.62 23.9C457.62 21.5667 462.22 20.4 467.42 20.4C474.02 20.4 479.553 22.1333 484.02 25.6C488.553 29.0667 491.42 33.9 492.62 40.1H476.72C476.12 37.9667 474.986 36.3 473.32 35.1C471.653 33.9 469.653 33.3 467.32 33.3C465.12 33.3 463.186 33.8667 461.52 35C459.92 36.0667 458.653 37.6333 457.72 39.7C456.786 41.7 456.32 44.0667 456.32 46.8C456.32 48.8667 456.586 50.7333 457.12 52.4C457.653 54.0667 458.386 55.5 459.32 56.7C460.32 57.9 461.486 58.8333 462.82 59.5C464.153 60.1 465.653 60.4 467.32 60.4C468.92 60.4 470.32 60.1333 471.52 59.6C472.786 59.0667 473.853 58.3 474.72 57.3C475.653 56.3 476.32 55.0667 476.72 53.6H492.62C491.42 59.6 488.553 64.3667 484.02 67.9C479.486 71.4333 473.953 73.2 467.42 73.2ZM498.238 72V-2.86102e-06H513.238V28.8C514.838 26.2667 517.005 24.2333 519.738 22.7C522.472 21.1667 525.672 20.4 529.338 20.4C533.605 20.4 537.172 21.3 540.038 23.1C542.905 24.9 545.072 27.5333 546.538 31C548.005 34.4 548.738 38.5333 548.738 43.4V72H533.838V44.8C533.838 41.0667 533.038 38.1667 531.438 36.1C529.905 34.0333 527.438 33 524.038 33C522.038 33 520.205 33.5 518.538 34.5C516.872 35.5 515.572 36.9333 514.638 38.8C513.705 40.6 513.238 42.7667 513.238 45.3V72H498.238ZM572.427 73.2C568.227 73.2 564.727 72.5333 561.927 71.2C559.193 69.8667 557.16 68.0667 555.827 65.8C554.56 63.4667 553.927 60.9 553.927 58.1C553.927 55.1 554.66 52.4667 556.127 50.2C557.66 47.8667 560.027 46.0333 563.227 44.7C566.427 43.3 570.46 42.6 575.327 42.6H587.527C587.527 40.3333 587.227 38.4667 586.627 37C586.093 35.5333 585.193 34.4333 583.927 33.7C582.66 32.9667 580.927 32.6 578.727 32.6C576.393 32.6 574.427 33.0667 572.827 34C571.227 34.9333 570.227 36.4 569.827 38.4H555.427C555.76 34.8 556.927 31.6667 558.927 29C560.993 26.3333 563.727 24.2333 567.127 22.7C570.527 21.1667 574.427 20.4 578.827 20.4C583.627 20.4 587.793 21.2 591.327 22.8C594.86 24.3333 597.593 26.6 599.527 29.6C601.527 32.6 602.527 36.3333 602.527 40.8V72H590.027L588.227 64.7C587.493 65.9667 586.627 67.1333 585.627 68.2C584.627 69.2 583.46 70.1 582.127 70.9C580.793 71.6333 579.327 72.2 577.727 72.6C576.127 73 574.36 73.2 572.427 73.2ZM576.127 61.8C577.727 61.8 579.127 61.5333 580.327 61C581.527 60.4667 582.56 59.7333 583.427 58.8C584.293 57.8667 584.993 56.8 585.527 55.6C586.127 54.3333 586.56 52.9667 586.827 51.5V51.4H577.127C575.46 51.4 574.06 51.6333 572.927 52.1C571.86 52.5 571.06 53.1 570.527 53.9C569.993 54.7 569.727 55.6333 569.727 56.7C569.727 57.8333 569.993 58.8 570.527 59.6C571.127 60.3333 571.893 60.9 572.827 61.3C573.827 61.6333 574.927 61.8 576.127 61.8ZM632.299 72C628.633 72 625.399 71.4333 622.599 70.3C619.799 69.1 617.633 67.1667 616.099 64.5C614.566 61.8333 613.799 58.2 613.799 53.6V34.1H605.199V21.6H613.799L615.399 7.4H628.799V21.6H641.699V34.1H628.799V53.8C628.799 55.8 629.233 57.2333 630.099 58.1C631.033 58.9 632.599 59.3 634.799 59.3H641.699V72H632.299Z",fill:"currentColor"})}),zw=t=>{const{inputMessage:e,setInputMessage:n,sendMessage:r,setFiles:i,files:o,showEmojiPicker:s,addEmoji:a,setShowEmojiPicker:l,attachmentPreviews:d,disabled:c=!1}=t,{getConversation:f}=z(),m=f(),g=we.get("discord-widget"),_=F(null),v=(m==null?void 0:m.status)==="closed",C=v||c,b=()=>{},S=k=>{i(o.filter(P=>(k==null?void 0:k.name)!==P.name))},T=k=>{k&&i([...o,k])},M=()=>{var k;(k=_.current)==null||k.upload()},A=()=>{o.length&&M(),r()},R=k=>{k.key==="Enter"&&(k.shiftKey?(k.preventDefault(),n(`${e}
100
- `)):(k.preventDefault(),A()))};return w("div",{className:"relative",children:[!v&&s&&w(Bw,{onPickEmoji:a}),!v&&(()=>{if(!(o!=null&&o.length))return null;const k=o.map((P,D)=>{if(!d[P.name])return null;const O=()=>{var G;i(o.filter(ve=>ve.name!==P.name)),(G=_.current)==null||G.clear()};if(!P.type.startsWith("image/"))return w(Uw,{onDelete:O,fileName:P.name,size:P.size},`attachment-preview-${D}`);const{url:J,width:ft,height:Lt}=d[P.name];return w(Vw,{onDelete:O,fileName:P.name,width:ft,height:Lt,imageUrl:J},`attachment-preview-${D}`)});return w("div",{className:"m-2",children:k})})(),!v&&w("div",{className:"flex items-start gap-2 p-2 bg-white dark:bg-neutral-900",children:[w("textarea",{id:"hs-textarea-ex-1",disabled:C,value:e,onChange:k=>n(k.target.value),onKeyDown:R,className:"flex-1 p-3 block text-base md:text-sm outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:text-neutral-400 dark:placeholder-neutral-500 resize-none min-h-[55px] max-h-[200px] overflow-y-auto",placeholder:c?"Please introduce yourself first...":"Ask us anything!","data-hs-textarea-auto-height":""}),w("button",{type:"button",disabled:C,onClick:()=>A(),style:{background:C?"#9CA3AF":"var(--dc-primary)"},"aria-label":"Send message",className:"inline-flex shrink-0 justify-center items-center w-[33px] h-[33px] rounded-lg text-white transform transition-transform duration-150 hover:scale-105 active:scale-95 disabled:opacity-50 disabled:pointer-events-none disabled:transform-none",children:w(Ow,{size:16})})]}),w("div",{className:"flex items-center justify-between px-2 py-1.5 bg-white dark:bg-neutral-900",children:[w("div",{className:"flex items-center gap-1",children:!v&&w(tt,{children:[w("div",{className:"inline-flex shrink-0 justify-center items-center size-8 rounded-lg text-gray-500 hover:bg-gray-100 focus:z-10 focus:outline-none focus:bg-gray-100 dark:text-neutral-500 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 transition-colors duration-150",children:w(Lw,{ref:_,accept:Cd.join(","),maxSize:10*1024*1024,uploadConfig:{url:`${It.domain}/conversations/uploadAttachment`,method:"POST",headers:{Authorization:`Bearer ${g}`}},onUploadComplete:b,onUploadStart:S,onFileSelect:T})}),w("button",{type:"button",disabled:C,onClick:C?void 0:()=>l(!s),"aria-label":"Open emoji picker",className:"inline-flex shrink-0 justify-center items-center size-8 rounded-lg text-gray-500 hover:bg-gray-100 focus:z-10 focus:outline-none focus:bg-gray-100 dark:text-neutral-500 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 disabled:opacity-50 disabled:pointer-events-none transition-colors duration-150",children:w(xy,{size:16})})]})}),w("a",{href:"https://deskcord.chat",target:"_blank",rel:"noopener noreferrer","aria-label":"Powered by Deskcord",className:"flex items-center gap-1 text-[10px] text-gray-400 hover:text-gray-600 dark:text-neutral-600 dark:hover:text-neutral-400 transition-colors duration-200 no-underline",children:[w("span",{children:"Powered by"}),w($w,{className:"h-[10px] w-auto"})]})]})]})},Sd=t=>{if(!Number.isFinite(t))return"";const e=Date.now(),n=Math.floor((e-t)/1e3);return n<60?"Just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`},kd="carousel",Ed="controller",jw="navigation",Hw="no-scroll",xs="portal",Ww="root",Td="toolbar",Cs="loading",Ss="error",ks="complete",Kw="placeholder",qw=t=>`active-slide-${t}`,Ad="flex_center",Yw="no_scroll",Pd="no_scroll_padding",Gw="slide_wrapper",Oe="prev",Be="next",Id="swipe",ln="close",Md="onPointerDown",Rd="onPointerMove",Nd="onPointerUp",Dd="onPointerLeave",Ld="onPointerCancel",Od="onKeyDown",Xw="onKeyUp",Bd="onWheel",Zw="Escape",Jw="ArrowLeft",Qw="ArrowRight",t1="button",Es="icon",Fd="contain",Vd="cover",e1="Unknown action type",Ud="yarl__";function le(...t){return[...t].filter(Boolean).join(" ")}function Y(t){return`${Ud}${t}`}function Mt(t){return`--${Ud}${t}`}function Qn(t,e){return`${t}${e?`_${e}`:""}`}function Ts(t){return e=>Qn(t,e)}function n1(t,e){var n;return(n=t==null?void 0:t[e])!==null&&n!==void 0?n:e}function $d(...t){return()=>{t.forEach(e=>{e()})}}function Fe(t,e,n){return()=>{const r=ut(n);if(!r)throw new Error(`${t} must be used within a ${e}.Provider`);return r}}function zd(){return typeof window<"u"}function r1(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function jd(t){return t.type===void 0||t.type==="image"}function i1(t,e){return t.imageFit===Vd||t.imageFit!==Fd&&e===Vd}function Xr(t){return typeof t=="string"?Number.parseInt(t,10):t}function Zr(t){if(typeof t=="number")return{pixel:t};if(typeof t=="string"){const e=Xr(t);return t.endsWith("%")?{percent:e}:{pixel:e}}return{pixel:0}}function o1(t,e){const n=Zr(e),r=n.percent!==void 0?t.width/100*n.percent:n.pixel;return{width:Math.max(t.width-2*r,0),height:Math.max(t.height-2*r,0)}}function Hd(t,e){return e>0?(t%e+e)%e:0}function Wd(t){return t.length>0}function Kd(t,e){return t[Hd(e,t.length)]}function As(t,e){return Wd(t)?Kd(t,e):void 0}function s1(t){return jd(t)?t.src:void 0}function a1(t,e,n=0){return Math.min(t.preload,Math.max(t.finite?e.length-1:Math.floor(e.length/2),n))}const c1=Number(Ya.split(".")[0])>=19;function l1(t){return{inert:c1?t:t?"":void 0}}const Ps={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[ln]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Fd,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Ve(t,e){return{name:t,component:e}}function bt(t,e){return{module:t,children:e}}function qd(t,e,n){return t.module.name===e?n(t):t.children?[bt(t.module,t.children.flatMap(r=>{var i;return(i=qd(r,e,n))!==null&&i!==void 0?i:[]}))]:[t]}function un(t,e,n){return t.flatMap(r=>{var i;return(i=qd(r,e,n))!==null&&i!==void 0?i:[]})}function u1(t,e=[],n=[]){let r=t;const i=g=>{const _=[...r];for(;_.length>0;){const v=_.pop();if((v==null?void 0:v.module.name)===g)return!0;v!=null&&v.children&&_.push(...v.children)}return!1},o=(g,_)=>{if(g===""){r=[bt(_,r)];return}r=un(r,g,v=>[bt(_,[v])])},s=(g,_)=>{r=un(r,g,v=>[bt(v.module,[bt(_,v.children)])])},a=(g,_,v)=>{r=un(r,g,C=>{var b;return[bt(C.module,[...v?[bt(_)]:[],...(b=C.children)!==null&&b!==void 0?b:[],...v?[]:[bt(_)]])]})},l=(g,_,v)=>{r=un(r,g,C=>[...v?[bt(_)]:[],C,...v?[]:[bt(_)]])},d=g=>{s(Ed,g)},c=(g,_)=>{r=un(r,g,v=>[bt(_,v.children)])},f=g=>{r=un(r,g,_=>_.children)},m=g=>{n.push(g)};return e.forEach(g=>{g({contains:i,addParent:o,append:s,addChild:a,addSibling:l,addModule:d,replace:c,remove:f,augment:m})}),{config:r,augmentation:g=>n.reduce((_,v)=>v(_),g)}}const Yd=Et(null),Is=Fe("useDocument","DocumentContext",Yd);function d1({nodeRef:t,children:e}){const n=vt(()=>{const r=o=>{var s;return((s=o||t.current)===null||s===void 0?void 0:s.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:o=>{var s;return((s=r(o))===null||s===void 0?void 0:s.defaultView)||window}}},[t]);return B(Yd.Provider,{value:n},e)}const Gd=Et(null),Jr=Fe("useEvents","EventsContext",Gd);function h1({children:t}){const[e]=H({});$(()=>()=>{Object.keys(e).forEach(r=>delete e[r])},[e]);const n=vt(()=>{const r=(s,a)=>{var l;(l=e[s])===null||l===void 0||l.splice(0,e[s].length,...e[s].filter(d=>d!==a))};return{publish:(...[s,a])=>{var l;(l=e[s])===null||l===void 0||l.forEach(d=>d(a))},subscribe:(s,a)=>(e[s]||(e[s]=[]),e[s].push(a),()=>r(s,a)),unsubscribe:r}},[e]);return B(Gd.Provider,{value:n},t)}const Xd=Et(null),tr=Fe("useLightboxProps","LightboxPropsContext",Xd);function f1({children:t,...e}){return B(Xd.Provider,{value:e},t)}const Zd=Et(null),Qr=Fe("useLightboxState","LightboxStateContext",Zd),Jd=Et(null),p1=Fe("useLightboxDispatch","LightboxDispatchContext",Jd);function m1(t,e){switch(e.type){case"swipe":{const{slides:n}=t,r=(e==null?void 0:e.increment)||0,i=t.globalIndex+r,o=Hd(i,n.length),s=As(n,o),a=r||e.duration?{increment:r,duration:e.duration,easing:e.easing}:void 0;return{slides:n,currentIndex:o,globalIndex:i,currentSlide:s,animation:a}}case"update":return e.slides!==t.slides||e.index!==t.currentIndex?{slides:e.slides,currentIndex:e.index,globalIndex:e.index,currentSlide:As(e.slides,e.index)}:t;default:throw new Error(e1)}}function g1({slides:t,index:e,children:n}){const[r,i]=kn(m1,{slides:t,currentIndex:e,globalIndex:e,currentSlide:As(t,e)});$(()=>{i({type:"update",slides:t,index:e})},[t,e]);const o=vt(()=>({...r,state:r,dispatch:i}),[r,i]);return B(Jd.Provider,{value:i},B(Zd.Provider,{value:o},n))}const Qd=Et(null),ti=Fe("useTimeouts","TimeoutsContext",Qd);function y1({children:t}){const[e]=H([]);$(()=>()=>{e.forEach(r=>window.clearTimeout(r)),e.splice(0,e.length)},[e]);const n=vt(()=>{const r=s=>{e.splice(0,e.length,...e.filter(a=>a!==s))};return{setTimeout:(s,a)=>{const l=window.setTimeout(()=>{r(l),s()},a);return e.push(l),l},clearTimeout:s=>{s!==void 0&&(r(s),window.clearTimeout(s))}}},[e]);return B(Qd.Provider,{value:n},t)}const th=he(function({label:e,className:n,icon:r,renderIcon:i,onClick:o,style:s,...a},l){const{styles:d,labels:c}=tr(),f=n1(c,e);return B("button",{ref:l,type:"button",title:f,"aria-label":f,className:le(Y(t1),n),onClick:o,style:{...s,...d.button},...a},i?i():B(r,{className:Y(Es),style:d.icon}))});function w1(t,e){const n=r=>B("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},e);return n.displayName=t,n}function er(t,e){return w1(t,B("g",{fill:"currentColor"},B("path",{d:"M0 0h24v24H0z",fill:"none"}),e))}const v1=er("Close",B("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),_1=er("Previous",B("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),b1=er("Next",B("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),x1=er("Loading",B(tt,null,Array.from({length:8}).map((t,e,n)=>B("line",{key:e,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(e+1),transform:`rotate(${360/n.length*e}, 12, 12)`})))),C1=er("Error",B("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),nr=zd()?se:$;function eh(){const[t,e]=H(!1);return $(()=>{var n,r;const i=(n=window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-reduced-motion: reduce)");e(i==null?void 0:i.matches);const o=s=>e(s.matches);return(r=i==null?void 0:i.addEventListener)===null||r===void 0||r.call(i,"change",o),()=>{var s;return(s=i==null?void 0:i.removeEventListener)===null||s===void 0?void 0:s.call(i,"change",o)}},[]),t}function S1(t){let e=0,n=0,r=0;const o=window.getComputedStyle(t).transform.match(/matrix.*\((.+)\)/);if(o){const s=o[1].split(",").map(Xr);s.length===6?(e=s[4],n=s[5]):s.length===16&&(e=s[12],n=s[13],r=s[14])}return{x:e,y:n,z:r}}function nh(t,e){const n=F(),r=F(),i=eh();return nr(()=>{var o,s,a;if(t.current&&n.current!==void 0&&!i){const{keyframes:l,duration:d,easing:c,onfinish:f}=e(n.current,t.current.getBoundingClientRect(),S1(t.current))||{};if(l&&d){(o=r.current)===null||o===void 0||o.cancel(),r.current=void 0;try{r.current=(a=(s=t.current).animate)===null||a===void 0?void 0:a.call(s,l,{duration:d,easing:c})}catch(m){console.error(m)}r.current&&(r.current.onfinish=()=>{r.current=void 0,f==null||f()})}}n.current=void 0}),{prepareAnimation:o=>{n.current=o},isAnimationPlaying:()=>{var o;return((o=r.current)===null||o===void 0?void 0:o.playState)==="running"}}}function rh(){const t=F(null),e=F(),[n,r]=H();return{setContainerRef:et(o=>{t.current=o,e.current&&(e.current.disconnect(),e.current=void 0);const s=()=>{if(o){const a=window.getComputedStyle(o),l=d=>parseFloat(d)||0;r({width:Math.round(o.clientWidth-l(a.paddingLeft)-l(a.paddingRight)),height:Math.round(o.clientHeight-l(a.paddingTop)-l(a.paddingBottom))})}else r(void 0)};s(),o&&typeof ResizeObserver<"u"&&(e.current=new ResizeObserver(s),e.current.observe(o))},[]),containerRef:t,containerRect:n}}function ei(){const t=F(),{setTimeout:e,clearTimeout:n}=ti();return et((r,i)=>{n(t.current),t.current=e(r,i>0?i:0)},[e,n])}function gt(t){const e=F(t);return nr(()=>{e.current=t}),et((...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function ih(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function Ms(t,e){return vt(()=>t==null&&e==null?null:n=>{ih(t,n),ih(e,n)},[t,e])}function k1(t,e=!1){const n=F();nr(()=>{e&&n.current&&(n.current=!1,t())},[e,t]);const r=et(()=>{n.current=!0},[]),i=et(()=>{n.current=!1},[]);return{onFocus:r,onBlur:i}}function Rs(){const[t,e]=H(!1);return nr(()=>{e(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),t}function E1(){const[t]=H({}),e=et((i,o)=>{var s;(s=t[i])===null||s===void 0||s.forEach(a=>{o.isPropagationStopped()||a(o)})},[t]),n=vt(()=>({onPointerDown:i=>e(Md,i),onPointerMove:i=>e(Rd,i),onPointerUp:i=>e(Nd,i),onPointerLeave:i=>e(Dd,i),onPointerCancel:i=>e(Ld,i),onKeyDown:i=>e(Od,i),onKeyUp:i=>e(Xw,i),onWheel:i=>e(Bd,i)}),[e]),r=et((i,o)=>(t[i]||(t[i]=[]),t[i].unshift(o),()=>{const s=t[i];s&&s.splice(0,s.length,...s.filter(a=>a!==o))}),[t]);return{registerSensors:n,subscribeSensors:r}}function oh(t,e){const n=F(0),r=ei(),i=gt((...o)=>{n.current=Date.now(),t(o)});return et((...o)=>{r(()=>{i(o)},e-(Date.now()-n.current))},[e,i,r])}const Ns=Ts("slide"),Ds=Ts("slide_image");function T1({slide:t,offset:e,render:n,rect:r,imageFit:i,imageProps:o,onClick:s,onLoad:a,onError:l,style:d}){var c,f,m,g,_,v,C;const[b,S]=H(Cs),{publish:T}=Jr(),{setTimeout:M}=ti(),A=F(null);$(()=>{e===0&&T(qw(b))},[e,b,T]);const R=gt(K=>{("decode"in K?K.decode():Promise.resolve()).catch(()=>{}).then(()=>{K.parentNode&&(S(ks),M(()=>{a==null||a(K)},0))})}),N=et(K=>{A.current=K,K!=null&&K.complete&&R(K)},[R]),k=et(K=>{R(K.currentTarget)},[R]),P=gt(()=>{S(Ss),l==null||l()}),D=i1(t,i),O=(K,Yt)=>Number.isFinite(K)?K:Yt,J=O(Math.max(...((f=(c=t.srcSet)===null||c===void 0?void 0:c.map(K=>K.width))!==null&&f!==void 0?f:[]).concat(t.width?[t.width]:[]).filter(Boolean)),((m=A.current)===null||m===void 0?void 0:m.naturalWidth)||0),ft=O(Math.max(...((_=(g=t.srcSet)===null||g===void 0?void 0:g.map(K=>K.height))!==null&&_!==void 0?_:[]).concat(t.height?[t.height]:[]).filter(Boolean)),((v=A.current)===null||v===void 0?void 0:v.naturalHeight)||0),Lt=J&&ft?{maxWidth:`min(${J}px, 100%)`,maxHeight:`min(${ft}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},G=(C=t.srcSet)===null||C===void 0?void 0:C.sort((K,Yt)=>K.width-Yt.width).map(K=>`${K.src} ${K.width}w`).join(", "),ve=()=>r&&!D&&t.width&&t.height?r.height/t.height*t.width:Number.MAX_VALUE,q=G&&r&&zd()?`${Math.round(Math.min(ve(),r.width))}px`:void 0,{style:wt,className:Ot,...jt}=o||{};return B(tt,null,B("img",{ref:N,onLoad:k,onError:P,onClick:s,draggable:!1,className:le(Y(Ds()),D&&Y(Ds("cover")),b!==ks&&Y(Ds("loading")),Ot),style:{...Lt,...d,...wt},...jt,alt:t.alt,sizes:q,srcSet:G,src:t.src}),b!==ks&&B("div",{className:Y(Ns(Kw))},b===Cs&&(n!=null&&n.iconLoading?n.iconLoading():B(x1,{className:le(Y(Es),Y(Ns(Cs)))})),b===Ss&&(n!=null&&n.iconError?n.iconError():B(C1,{className:le(Y(Es),Y(Ns(Ss)))}))))}const A1=he(function({className:e,children:n,...r},i){const o=F(null);return B(d1,{nodeRef:o},B("div",{ref:Ms(i,o),className:le(Y("root"),e),...r},n))});var kt;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL",t[t.ANIMATION=3]="ANIMATION"})(kt||(kt={}));function P1(t,e,n,r,i){$(()=>$d(t(Md,e),t(Rd,n),t(Nd,r),t(Dd,r),t(Ld,r)),[t,e,n,r,i])}var Kt;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL"})(Kt||(Kt={}));const Ls=30;function I1(t,e,n,r,i,o,s,a,l,d,c,f,m,g){const _=F(0),v=F([]),C=F(),b=F(0),S=F(Kt.NONE),T=et(P=>{C.current===P.pointerId&&(C.current=void 0,S.current=Kt.NONE);const D=v.current;D.splice(0,D.length,...D.filter(O=>O.pointerId!==P.pointerId))},[]),M=et(P=>{T(P),P.persist(),v.current.push(P)},[T]),A=gt(P=>{M(P)}),R=(P,D)=>d&&P>D||l&&P<-D,N=gt(P=>{if(v.current.find(D=>D.pointerId===P.pointerId)&&C.current===P.pointerId){const D=Date.now()-b.current,O=_.current;S.current===Kt.SWIPE?Math.abs(O)>.3*n||Math.abs(O)>5&&D<r?s(O,D):a(O):S.current===Kt.PULL&&(R(O,2*Ls)?m(O,D):g(O)),_.current=0,S.current=Kt.NONE}T(P)}),k=gt(P=>{const D=v.current.find(O=>O.pointerId===P.pointerId);if(D){const O=C.current===P.pointerId;if(P.buttons===0){O&&_.current!==0?N(P):T(D);return}const J=P.clientX-D.clientX,ft=P.clientY-D.clientY;if(C.current===void 0){const Lt=G=>{M(P),C.current=P.pointerId,b.current=Date.now(),S.current=G};Math.abs(J)>Math.abs(ft)&&Math.abs(J)>Ls&&e(J)?(Lt(Kt.SWIPE),i()):Math.abs(ft)>Math.abs(J)&&R(ft,Ls)&&(Lt(Kt.PULL),c())}else O&&(S.current===Kt.SWIPE?(_.current=J,o(J)):S.current===Kt.PULL&&(_.current=ft,f(ft)))}});P1(t,A,k,N)}function M1({preventDefaultWheelX:t,preventDefaultWheelY:e}){const n=F(null),r=gt(i=>{const o=Math.abs(i.deltaX)>Math.abs(i.deltaY);(o&&t||!o&&e||i.ctrlKey)&&i.preventDefault()});return et(i=>{var o;i?i.addEventListener("wheel",r,{passive:!1}):(o=n.current)===null||o===void 0||o.removeEventListener("wheel",r),n.current=i},[r])}function R1(t,e,n,r,i,o,s,a,l){const d=F(0),c=F(0),f=F(),m=F(),g=F(0),_=F(),v=F(0),{setTimeout:C,clearTimeout:b}=ti(),S=et(()=>{f.current&&(b(f.current),f.current=void 0)},[b]),T=et(()=>{m.current&&(b(m.current),m.current=void 0)},[b]),M=gt(()=>{t!==kt.SWIPE&&(d.current=0,v.current=0,S(),T())});$(M,[t,M]);const A=gt(N=>{m.current=void 0,d.current===N&&l(d.current)}),R=gt(N=>{if(N.ctrlKey||Math.abs(N.deltaY)>Math.abs(N.deltaX))return;const k=P=>{g.current=P,b(_.current),_.current=P>0?C(()=>{g.current=0,_.current=void 0},300):void 0};if(t===kt.NONE){if(Math.abs(N.deltaX)<=1.2*Math.abs(g.current)){k(N.deltaX);return}if(!n(-N.deltaX))return;if(c.current+=N.deltaX,S(),Math.abs(c.current)>30)c.current=0,k(0),v.current=Date.now(),o();else{const P=c.current;f.current=C(()=>{f.current=void 0,P===c.current&&(c.current=0)},i)}}else if(t===kt.SWIPE){let P=d.current-N.deltaX;if(P=Math.min(Math.abs(P),r)*Math.sign(P),d.current=P,s(P),T(),Math.abs(P)>.2*r){k(N.deltaX),a(P,Date.now()-v.current);return}m.current=C(()=>A(P),2*i)}else k(N.deltaX)});$(()=>e(Bd,R),[e,R])}const sh=Ts("container"),ah=Et(null),rr=Fe("useController","ControllerContext",ah);function N1({children:t,...e}){var n;const{carousel:r,animation:i,controller:o,on:s,styles:a,render:l}=e,{closeOnPullUp:d,closeOnPullDown:c,preventDefaultWheelX:f,preventDefaultWheelY:m}=o,[g,_]=H(),v=Qr(),C=p1(),[b,S]=H(kt.NONE),T=F(0),M=F(0),A=F(1),{registerSensors:R,subscribeSensors:N}=E1(),{subscribe:k,publish:P}=Jr(),D=ei(),O=ei(),J=ei(),{containerRef:ft,setContainerRef:Lt,containerRect:G}=rh(),ve=Ms(M1({preventDefaultWheelX:f,preventDefaultWheelY:m}),Lt),q=F(null),wt=Ms(q,void 0),{getOwnerDocument:Ot}=Is(),jt=Rs(),K=L=>(jt?-1:1)*(typeof L=="number"?L:1),Yt=gt(()=>{var L;return(L=ft.current)===null||L===void 0?void 0:L.focus()}),hi=gt(()=>e),pt=gt(()=>v),_t=et(L=>P(Oe,L),[P]),$e=et(L=>P(Be,L),[P]),_e=et(()=>P(ln),[P]),gn=L=>!(r.finite&&(K(L)>0&&v.currentIndex===0||K(L)<0&&v.currentIndex===v.slides.length-1)),lr=L=>{var Q;T.current=L,(Q=ft.current)===null||Q===void 0||Q.style.setProperty(Mt("swipe_offset"),`${Math.round(L)}px`)},yn=L=>{var Q,xt;M.current=L,A.current=(()=>{const de=c&&L>0?L:d&&L<0?-L:0;return Math.min(Math.max(r1(1-de/60*(1-.5),2),.5),1)})(),(Q=ft.current)===null||Q===void 0||Q.style.setProperty(Mt("pull_offset"),`${Math.round(L)}px`),(xt=ft.current)===null||xt===void 0||xt.style.setProperty(Mt("pull_opacity"),`${A.current}`)},{prepareAnimation:be}=nh(q,(L,Q,xt)=>{if(q.current&&G)return{keyframes:[{transform:`translate(0, ${L.rect.y-Q.y+xt.y}px)`,opacity:L.opacity},{transform:"translate(0, 0)",opacity:1}],duration:L.duration,easing:i.easing.fade}}),wn=(L,Q)=>{if(d||c){yn(L);let xt=0;q.current&&(xt=i.fade*(Q?2:1),be({rect:q.current.getBoundingClientRect(),opacity:A.current,duration:xt})),J(()=>{yn(0),S(kt.NONE)},xt),S(kt.ANIMATION),Q||_e()}},{prepareAnimation:fi,isAnimationPlaying:ia}=nh(q,(L,Q,xt)=>{var At;if(q.current&&G&&(!((At=v.animation)===null||At===void 0)&&At.duration)){const st=Zr(r.spacing),de=(st.percent?st.percent*G.width/100:st.pixel)||0;return{keyframes:[{transform:`translate(${K(v.globalIndex-L.index)*(G.width+de)+L.rect.x-Q.x+xt.x}px, 0)`},{transform:"translate(0, 0)"}],duration:v.animation.duration,easing:v.animation.easing}}}),xe=gt(L=>{var Q,xt;const At=L.offset||0,st=At?i.swipe:(Q=i.navigation)!==null&&Q!==void 0?Q:i.swipe,de=!At&&!ia()?i.easing.navigation:i.easing.swipe;let{direction:vn}=L;const Bt=(xt=L.count)!==null&&xt!==void 0?xt:1;let dr=kt.ANIMATION,p=st*Bt;if(!vn){const h=G==null?void 0:G.width,y=L.duration||0,x=h?st/h*Math.abs(At):st;Bt!==0?(y<x?p=p/x*Math.max(y,x/5):h&&(p=st/h*(h-Math.abs(At))),vn=K(At)>0?Oe:Be):p=st/2}let u=0;vn===Oe?gn(K(1))?u=-Bt:(dr=kt.NONE,p=st):vn===Be&&(gn(K(-1))?u=Bt:(dr=kt.NONE,p=st)),p=Math.round(p),O(()=>{lr(0),S(kt.NONE)},p),q.current&&fi({rect:q.current.getBoundingClientRect(),index:v.globalIndex}),S(dr),P(Id,{type:"swipe",increment:u,duration:p,easing:de})});$(()=>{var L,Q;!((L=v.animation)===null||L===void 0)&&L.increment&&(!((Q=v.animation)===null||Q===void 0)&&Q.duration)&&D(()=>C({type:"swipe",increment:0}),v.animation.duration)},[v.animation,C,D]);const ue=[N,gn,(G==null?void 0:G.width)||0,i.swipe,()=>S(kt.SWIPE),L=>lr(L),(L,Q)=>xe({offset:L,duration:Q,count:1}),L=>xe({offset:L,count:0})],ze=[()=>{c&&S(kt.PULL)},L=>yn(L),L=>wn(L),L=>wn(L,!0)];I1(...ue,d,c,...ze),R1(b,...ue);const pi=gt(()=>{o.focus&&Ot().querySelector(`.${Y(xs)} .${Y(sh())}`)&&Yt()});$(pi,[pi]);const mi=gt(()=>{var L;(L=s.view)===null||L===void 0||L.call(s,{index:v.currentIndex})});$(mi,[v.globalIndex,mi]),$(()=>$d(k(Oe,L=>xe({direction:Oe,...L})),k(Be,L=>xe({direction:Be,...L})),k(Id,L=>C(L))),[k,xe,C]);const ur=vt(()=>({prev:_t,next:$e,close:_e,focus:Yt,slideRect:G?o1(G,r.padding):{width:0,height:0},containerRect:G||{width:0,height:0},subscribeSensors:N,containerRef:ft,setCarouselRef:wt,toolbarWidth:g,setToolbarWidth:_}),[_t,$e,_e,Yt,N,G,ft,wt,g,_,r.padding]);return En(o.ref,()=>({prev:_t,next:$e,close:_e,focus:Yt,getLightboxProps:hi,getLightboxState:pt}),[_t,$e,_e,Yt,hi,pt]),B("div",{ref:ve,className:le(Y(sh()),Y(Ad)),style:{...b===kt.SWIPE?{[Mt("swipe_offset")]:`${Math.round(T.current)}px`}:null,...b===kt.PULL?{[Mt("pull_offset")]:`${Math.round(M.current)}px`,[Mt("pull_opacity")]:`${A.current}`}:null,...o.touchAction!=="none"?{[Mt("controller_touch_action")]:o.touchAction}:null,...a.container},...o.aria?{role:"presentation","aria-live":"polite"}:null,tabIndex:-1,...R},G&&B(ah.Provider,{value:ur},t,(n=l.controls)===null||n===void 0?void 0:n.call(l)))}const D1=Ve(Ed,N1);function Ue(t){return Qn(kd,t)}function ch(t){return Qn("slide",t)}function L1({slide:t,offset:e}){const n=F(null),{currentIndex:r}=Qr(),{slideRect:i,close:o,focus:s}=rr(),{render:a,carousel:{imageFit:l,imageProps:d},on:{click:c},controller:{closeOnBackdropClick:f},styles:{slide:m}}=tr(),{getOwnerDocument:g}=Is(),_=e!==0;$(()=>{var b;_&&(!((b=n.current)===null||b===void 0)&&b.contains(g().activeElement))&&s()},[_,s,g]);const v=()=>{var b,S,T,M;let A=(b=a.slide)===null||b===void 0?void 0:b.call(a,{slide:t,offset:e,rect:i});return!A&&jd(t)&&(A=B(T1,{slide:t,offset:e,render:a,rect:i,imageFit:l,imageProps:d,onClick:_?void 0:()=>c==null?void 0:c({index:r})})),A?B(tt,null,(S=a.slideHeader)===null||S===void 0?void 0:S.call(a,{slide:t}),((T=a.slideContainer)!==null&&T!==void 0?T:({children:R})=>R)({slide:t,children:A}),(M=a.slideFooter)===null||M===void 0?void 0:M.call(a,{slide:t})):null},C=b=>{const S=n.current,T=b.target instanceof HTMLElement?b.target:void 0;f&&T&&S&&(T===S||Array.from(S.children).find(M=>M===T)&&T.classList.contains(Y(Gw)))&&o()};return B("div",{ref:n,className:le(Y(ch()),!_&&Y(ch("current")),Y(Ad)),...l1(_),onClick:C,style:m},v())}function O1(){const t=tr().styles.slide;return B("div",{className:Y("slide"),style:t})}function B1({carousel:t}){const{slides:e,currentIndex:n,globalIndex:r}=Qr(),{setCarouselRef:i}=rr(),o=Zr(t.spacing),s=Zr(t.padding),a=a1(t,e,1),l=[];if(Wd(e))for(let d=n-a;d<=n+a;d+=1){const c=Kd(e,d),f=r-n+d,m=t.finite&&(d<0||d>e.length-1);l.push(m?{key:f}:{key:[`${f}`,s1(c)].filter(Boolean).join("|"),offset:d-n,slide:c})}return B("div",{ref:i,className:le(Y(Ue()),l.length>0&&Y(Ue("with_slides"))),style:{[`${Mt(Ue("slides_count"))}`]:l.length,[`${Mt(Ue("spacing_px"))}`]:o.pixel||0,[`${Mt(Ue("spacing_percent"))}`]:o.percent||0,[`${Mt(Ue("padding_px"))}`]:s.pixel||0,[`${Mt(Ue("padding_percent"))}`]:s.percent||0}},l.map(({key:d,slide:c,offset:f})=>c?B(L1,{key:d,slide:c,offset:f}):B(O1,{key:d})))}const F1=Ve(kd,B1);function lh(){const{carousel:t}=tr(),{slides:e,currentIndex:n}=Qr(),r=e.length===0||t.finite&&n===0,i=e.length===0||t.finite&&n===e.length-1;return{prevDisabled:r,nextDisabled:i}}function V1(t){var e;const n=Rs(),{publish:r}=Jr(),{animation:i}=tr(),{prevDisabled:o,nextDisabled:s}=lh(),a=((e=i.navigation)!==null&&e!==void 0?e:i.swipe)/2,l=oh(()=>r(Oe),a),d=oh(()=>r(Be),a),c=gt(f=>{switch(f.key){case Zw:r(ln);break;case Jw:(n?s:o)||(n?d:l)();break;case Qw:(n?o:s)||(n?l:d)();break}});$(()=>t(Od,c),[t,c])}function uh({label:t,icon:e,renderIcon:n,action:r,onClick:i,disabled:o,style:s}){return B(th,{label:t,icon:e,renderIcon:n,className:Y(`navigation_${r}`),disabled:o,onClick:i,style:s,...k1(rr().focus,o)})}function U1({render:{buttonPrev:t,buttonNext:e,iconPrev:n,iconNext:r},styles:i}){const{prev:o,next:s,subscribeSensors:a}=rr(),{prevDisabled:l,nextDisabled:d}=lh();return V1(a),B(tt,null,t?t():B(uh,{label:"Previous",action:Oe,icon:_1,renderIcon:n,style:i.navigationPrev,disabled:l,onClick:o}),e?e():B(uh,{label:"Next",action:Be,icon:b1,renderIcon:r,style:i.navigationNext,disabled:d,onClick:s}))}const $1=Ve(jw,U1),dh=Y(Yw),z1=Y(Pd);function j1(t){return"style"in t}function hh(t,e,n){const r=window.getComputedStyle(t),i=n?"padding-left":"padding-right",o=n?r.paddingLeft:r.paddingRight,s=t.style.getPropertyValue(i);return t.style.setProperty(i,`${(Xr(o)||0)+e}px`),()=>{s?t.style.setProperty(i,s):t.style.removeProperty(i)}}function H1({noScroll:{disabled:t},children:e}){const n=Rs(),{getOwnerDocument:r,getOwnerWindow:i}=Is();return $(()=>{if(t)return()=>{};const o=[],s=i(),{body:a,documentElement:l}=r(),d=Math.round(s.innerWidth-l.clientWidth);if(d>0){o.push(hh(a,d,n));const c=a.getElementsByTagName("*");for(let f=0;f<c.length;f+=1){const m=c[f];j1(m)&&s.getComputedStyle(m).getPropertyValue("position")==="fixed"&&!m.classList.contains(z1)&&o.push(hh(m,d,n))}}return a.classList.add(dh),()=>{a.classList.remove(dh),o.forEach(c=>c())}},[n,t,r,i]),B(tt,null,e)}const W1=Ve(Hw,H1);function fh(t){return Qn(xs,t)}function ph(t,e,n){const r=t.getAttribute(e);return t.setAttribute(e,n),()=>{r?t.setAttribute(e,r):t.removeAttribute(e)}}function K1({children:t,animation:e,styles:n,className:r,on:i,portal:o,close:s}){const[a,l]=H(!1),[d,c]=H(!1),f=F([]),m=F(null),{setTimeout:g}=ti(),{subscribe:_}=Jr(),C=eh()?0:e.fade;$(()=>(l(!0),()=>{l(!1),c(!1)}),[]);const b=gt(()=>{f.current.forEach(A=>A()),f.current=[]}),S=gt(()=>{var A;c(!1),b(),(A=i.exiting)===null||A===void 0||A.call(i),g(()=>{var R;(R=i.exited)===null||R===void 0||R.call(i),s()},C)});$(()=>_(ln,S),[_,S]);const T=gt(A=>{var R,N,k;A.scrollTop,c(!0),(R=i.entering)===null||R===void 0||R.call(i);const P=(k=(N=A.parentNode)===null||N===void 0?void 0:N.children)!==null&&k!==void 0?k:[];for(let D=0;D<P.length;D+=1){const O=P[D];["TEMPLATE","SCRIPT","STYLE"].indexOf(O.tagName)===-1&&O!==A&&(f.current.push(ph(O,"inert","")),f.current.push(ph(O,"aria-hidden","true")))}f.current.push(()=>{var D,O;(O=(D=m.current)===null||D===void 0?void 0:D.focus)===null||O===void 0||O.call(D)}),g(()=>{var D;(D=i.entered)===null||D===void 0||D.call(i)},C)}),M=et(A=>{A?T(A):b()},[T,b]);return a?Li(B(A1,{ref:M,className:le(r,Y(fh()),Y(Pd),d&&Y(fh("open"))),role:"presentation","aria-live":"polite",style:{...e.fade!==Ps.animation.fade?{[Mt("fade_animation_duration")]:`${C}ms`}:null,...e.easing.fade!==Ps.animation.easing.fade?{[Mt("fade_animation_timing_function")]:e.easing.fade}:null,...n.root},onFocus:A=>{m.current||(m.current=A.relatedTarget)}},t),o.root||document.body):null}const q1=Ve(xs,K1);function Y1({children:t}){return B(tt,null,t)}const G1=Ve(Ww,Y1);function X1(t){return Qn(Td,t)}function Z1({toolbar:{buttons:t},render:{buttonClose:e,iconClose:n},styles:r}){const{close:i,setToolbarWidth:o}=rr(),{setContainerRef:s,containerRect:a}=rh();nr(()=>{o(a==null?void 0:a.width)},[o,a==null?void 0:a.width]);const l=()=>e?e():B(th,{key:ln,label:"Close",icon:v1,renderIcon:n,onClick:i});return B("div",{ref:s,style:r.toolbar,className:Y(X1())},t==null?void 0:t.map(d=>d===ln?l():d))}const J1=Ve(Td,Z1);function mh(t,e){var n;return B(t.module.component,{key:t.module.name,...e},(n=t.children)===null||n===void 0?void 0:n.map(r=>mh(r,e)))}function Q1(t,e={}){const{easing:n,...r}=t,{easing:i,...o}=e;return{easing:{...n,...i},...r,...o}}function tv({carousel:t,animation:e,render:n,toolbar:r,controller:i,noScroll:o,on:s,plugins:a,slides:l,index:d,...c}){const{animation:f,carousel:m,render:g,toolbar:_,controller:v,noScroll:C,on:b,slides:S,index:T,plugins:M,...A}=Ps,{config:R,augmentation:N}=u1([bt(q1,[bt(W1,[bt(D1,[bt(F1),bt(J1),bt($1)])])])],a||M),k=N({animation:Q1(f,e),carousel:{...m,...t},render:{...g,...n},toolbar:{..._,...r},controller:{...v,...i},noScroll:{...C,...o},on:{...b,...s},...A,...c});return k.open?B(f1,{...k},B(g1,{slides:l||S,index:Xr(d||T)},B(y1,null,B(h1,null,mh(bt(G1,R),k))))):null}const ev=({attachment:t})=>{const e=async n=>{n.preventDefault();try{const r=await fetch(t.url);if(!r.ok)throw new Error("Download failed");const i=await r.blob(),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=t.name,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch{window.open(t.url,"_blank","noopener,noreferrer")}};return w("a",{href:t.url,onClick:e,className:"flex items-center gap-3 max-w-[240px] rounded-lg border border-gray-200 bg-white px-3 py-2 no-underline hover:bg-gray-50 transition-colors cursor-pointer dark:bg-neutral-800 dark:border-neutral-700 dark:hover:bg-neutral-700",children:[w(_s,{extension:Gr(t.name),className:"w-8 h-9"}),w("div",{className:"min-w-0",children:[w("p",{className:"text-sm font-medium text-gray-800 dark:text-white truncate",children:t.name}),w("p",{className:"text-xs text-gray-500 dark:text-neutral-400",children:bs(t.size)})]})]})},nv=["png","jpg","jpeg","gif","webp"];function gh(t){return t.contentType?t.contentType.startsWith("image/"):nv.includes(Gr(t.name))}function yh(t){var e;return t.contentType?t.contentType==="image/gif":((e=t.name)==null?void 0:e.toLowerCase().endsWith(".gif"))??!1}const wh=({messageIndexKey:t,attachments:e})=>{const{setFullScreen:n}=z(),[r,i]=H(!1),o=ut(df);function s(){if(o){const c=o.getElementById("deskcord-lightbox-portal");if(c)return c}const d=document.getElementById("deskcord-lightbox-portal");return d||document.body}const a=(e==null?void 0:e.filter(d=>gh(d)&&!yh(d)))??[];function l(){return a.length?w(tv,{open:r,portal:{root:s()},close:()=>{i(!1),n(!1)},slides:a.map(d=>({src:d.proxyURL}))}):null}return e!=null&&e.length?w("div",{children:[e.map((d,c)=>{const{proxyURL:f,width:m,height:g}=d;return gh(d)?yh(d)?w("div",{children:w("img",{src:f,alt:"GIF",className:`rounded-lg w-[${m}px] h-[${g}px] max-w-[200px] max-h-[200px] aspect-auto`})},`conv-cus-attachment-${t}-${c}`):w("div",{onClick:()=>{n(!0),i(!0)},className:"cursor-pointer",children:w("img",{src:f,alt:"Preview",className:`rounded-lg w-[${m}px] h-[${g}px] max-w-[200px] max-h-[200px] aspect-auto`})},`conv-cus-attachment-${t}-${c}`):w("div",{className:"mt-1",children:w(ev,{attachment:d})},`conv-cus-attachment-${t}-${c}`)}),l()]},`conv-cus-attachment-${t}`):null},vh=({imageUrls:t,messageIndexKey:e})=>t.length?w("div",{className:"flex flex-col gap-1 mt-1",children:t.map((n,r)=>w("div",{className:"inline-block",children:w("img",{src:n,alt:"Inline image",className:"rounded-lg max-w-[200px] max-h-[200px] object-contain",loading:"lazy"})},`inline-img-${e}-${r}`))}):null,rv=["giphy.com","imgur.com","gfycat.com","media.discordapp.net","cdn.discordapp.com","i.redd.it","i.imgur.com"],iv=[".gif",".jpg",".jpeg",".png",".webp",".apng"];function ov(t){try{const e=new URL(t),n=e.pathname.toLowerCase(),r=e.hostname.toLowerCase();for(const i of iv)if(n.endsWith(i))return!0;for(const i of rv)if(r===i||r.endsWith(`.${i}`))return!0;return!1}catch{return!1}}const sv=/https?:\/\/[^\s<>]+/gi;function _h(t){if(!t)return{text:"",imageUrls:[]};const e=[];let n=t;const r=t.match(sv);if(r)for(const i of r)ov(i)&&(e.push(i),n=n.replace(i,""));return n=n.replace(/\s+/g," ").trim(),{text:n,imageUrls:e}}const av=({renderTimestamp:t,message:e,indexKey:n})=>{function r(s,a){const l=/<\w?:\w+:\d+>/g,d=s.split(l),c=s.match(l)??[],f=[];for(let m=0;m<d.length;m++)if(f.push(d[m]),c[m]){const g=a[c[m]];g&&f.push(w("img",{src:g.imageURL,alt:"",style:{display:"inline-block",width:"20px",height:"20px"}},m))}return f}const{text:i,imageUrls:o}=_h(e.content??"");return w("li",{className:"flex flex-col items-start max-w-lg gap-x-2 sm:gap-x-4 me-11",children:[i&&w("div",{style:{background:"linear-gradient(167deg, #27292A 0%, #404547 100%)"},className:"text-white text-sm min-w-10 inline-block rounded-lg px-3 py-2 shadow-sm",children:r(i,e.emojis??{})}),w(vh,{imageUrls:o,messageIndexKey:n}),w("div",{className:"flex flex-1",children:w(wh,{attachments:e.attachments,messageIndexKey:n})}),t&&w("div",{children:w("span",{className:"mt-1.5 flex items-center gap-x-1 text-xs text-gray-500",children:[e.authorName," · ",Sd(e.date)," ",e.edited?"(edited)":""]})})]},`conv-cs-${n}`)},cv=({message:t,indexKey:e})=>{const{text:n,imageUrls:r}=_h(t.content??"");return w("li",{className:`flex flex-col items-end ms-auto my-[3px] ${t.pending?"opacity-80":""}`,children:[n&&w("div",{className:"grow",children:w("div",{style:{background:"linear-gradient(167deg, var(--dc-primary) 0%, var(--dc-primary-mid) 100%)"},className:"min-w-10 inline-block rounded-lg px-3 py-2 shadow-sm",children:w("p",{className:"text-left text-sm text-white",children:n})})}),w(vh,{imageUrls:r,messageIndexKey:e}),t.attachments&&w("div",{className:"flex flex-1 justify-end",children:w(wh,{attachments:t.attachments,messageIndexKey:e})},`conv-cus-${e}-attachments`)]},`conv-cus-${e}`)},lv=({message:t,indexKey:e})=>w("li",{className:"max-w-lg flex gap-x-2 sm:gap-x-4 me-11",children:w("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 space-y-3 dark:bg-neutral-900 dark:border-neutral-700",children:w("p",{className:"mb-1.5 text-sm text-gray-800 dark:text-white",children:t.content})})},`conv-system-${e}`),uv=()=>{const{setEmail:t,setUsername:e,username:n,email:r,token:i}=z(),[o,s]=H(r),[a,l]=H(n),[d,c]=H(""),[f,m]=H(!1),g=b=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(b),_=!!n&&!!r,v=b=>{if(b.preventDefault(),!!a.trim()){if(!g(o)){c("Please enter a valid email address");return}f||(m(!0),c(""),t(o),e(a))}};function C(){return w("form",{onSubmit:v,className:"w-full space-y-4",children:[w("div",{className:"mb-4",children:[w("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:"Let's get started"}),w("p",{className:"text-sm text-gray-600",children:"Tell us a bit about yourself so we can assist you better."})]}),w("div",{children:[w("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your name"}),w("div",{className:"relative",children:[w("div",{className:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5",children:w(Cy,{size:18,className:"text-gray-400"})}),w("input",{type:"text",id:"name",value:a,onChange:b=>l(b.target.value),name:"name",className:"py-2.5 px-4 ps-11 block w-full bg-white border border-gray-300 rounded-lg text-base md:text-sm text-gray-900 placeholder-gray-500 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-[var(--dc-primary)] focus:ring-opacity-50 focus:border-transparent disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed",placeholder:"John Smith",disabled:_,required:!0})]})]}),w("div",{children:[w("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email address"}),w("div",{className:"relative",children:[w("div",{className:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5",children:w(wy,{size:18,className:"text-gray-400"})}),w("input",{type:"email",id:"email",value:o,onChange:b=>{s(b.target.value),d&&c("")},name:"email",className:`py-2.5 px-4 ps-11 block w-full bg-white rounded-lg text-base md:text-sm text-gray-900 placeholder-gray-500 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-opacity-50 focus:border-transparent disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed border ${d?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-[var(--dc-primary)]"}`,placeholder:"you@example.com",disabled:_,required:!0})]}),d&&w("p",{className:"text-red-600 text-sm mt-2 flex items-center gap-1",children:[w("span",{className:"inline-block w-1 h-1 bg-red-600 rounded-full"}),d]})]}),w("p",{className:"text-xs text-gray-500 text-center",children:"We'll never share your information"}),!n||!r?w("button",{type:"submit",className:"w-full py-2.5 px-4 bg-[var(--dc-primary)] hover:bg-[var(--dc-primary-mid)] text-white font-medium text-sm rounded-lg transition-all duration-200 transform hover:shadow-md active:scale-95 focus:outline-none focus:ring-2 focus:ring-[var(--dc-primary)] focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed",disabled:f,children:"Start Chatting"}):null]})}return w(tt,{children:[w("li",{className:`max-w-lg flex gap-x-2 sm:gap-x-4 me-11 ${i?"opacity-75":""}`,children:w("div",{className:"w-full rounded-xl p-5 bg-white shadow-lg border border-gray-100 overflow-hidden",children:C()})}),n&&r&&w("li",{className:"flex ms-auto my-4 animate-slide-in",style:{marginTop:"1rem"},children:w("div",{className:"grow",children:w("div",{style:{background:"linear-gradient(167deg, var(--dc-primary) 0%, var(--dc-primary-mid) 100%)"},className:"min-w-10 inline-block rounded-lg px-4 py-2 shadow-sm flex items-center gap-2",children:[w(gy,{size:16,className:"text-white flex-shrink-0"}),w("p",{className:"text-sm text-white font-medium",children:["Nice to meet you, ",w("span",{className:"font-semibold",children:n}),"! Feel free to ask us anything."]})]})})})]})};function dv(t,e){const n=F();$(()=>{n.current=t},[t]),$(()=>{function r(){var i;(i=n==null?void 0:n.current)==null||i.call(n)}if(e!==null){const i=setInterval(r,e);return()=>clearInterval(i)}},[e])}const hv=({indexKey:t,message:e})=>{const n=e.customRendererProps.file,r=n.status==="error",[i,o]=H(!0),[s,a]=H(0);return dv(()=>{s<88?a(s+2.5):o(!1)},i&&!r?250:null),w("li",{className:"max-w-lg flex gap-x-2 sm:gap-x-4",style:{marginTop:"20px",marginBottom:"20px"},children:w("div",{className:"w-full bg-white border border-gray-200 rounded-2xl p-4 space-y-4",children:w("div",{children:[w("div",{className:"mb-2 flex justify-between items-center",children:[w("div",{className:"flex items-center gap-x-3",children:[w(_s,{extension:Gr(n.fileName),className:"size-9",iconColorClassName:r?"text-red-300":void 0}),w("div",{children:[w("p",{className:`text-sm ${r?"font-semibold text-red-500":"font-medium text-gray-800"}`,children:n.fileName}),w("p",{className:"text-xs text-gray-500 dark:text-neutral-500",children:bs(n.size)})]})]}),r&&w("div",{className:"inline-flex items-center gap-x-2",children:w("span",{className:"relative",children:[w("svg",{className:"shrink-0 size-4 text-red-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:w("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})}),w("span",{className:"sr-only",children:"Danger"})]})})]}),w("div",{className:"flex items-center gap-x-3 whitespace-nowrap",children:[w("div",{className:"flex w-full h-2 bg-gray-200 rounded-full overflow-hidden dark:bg-neutral-700",role:"progressbar",children:w("div",{className:`flex flex-col justify-center rounded-full overflow-hidden ${r?"bg-red-500":"bg-blue-600"} text-xs text-white text-center whitespace-nowrap transition duration-500 dark:bg-blue-500`,style:{width:`${s}%`}})}),w("div",{className:"w-6 text-end",children:w("span",{className:"text-sm text-gray-800 dark:text-white",children:[Math.round(s),"%"]})})]})]})})},`conv-fileupload-${t}`)};function bh(t){return t.localId?t.localId:`${t.date}-${t.support?"s":"c"}-${t.customRenderer??""}-${t.content.slice(0,32)}`}const fv=({conversation:t,open:e})=>{const n=F(null);n.current===null&&(n.current=new Set(((t==null?void 0:t.messages)??[]).map(bh)));function r(a,l){const d=bh(a),c=`${a.date}-${l}`;let f;if(typeof a.customRenderer<"u")switch(a.customRenderer){case Le.IntroduceYourself:f=w(uv,{});break;case Le.UploadFile:f=w(hv,{message:a,indexKey:c});break;default:f=s(a,c)}else a.authorName===Jn?f=s(a,c):a.support?f=i(a,c):f=o(a,c);const m=!n.current.has(d);return w(ye.li,{initial:m?{opacity:0,y:12}:!1,animate:{opacity:1,y:0},transition:{duration:.2,ease:[.22,1,.36,1]},children:f},d)}function i(a,l){var m;const d=(m=t==null?void 0:t.messages)==null?void 0:m.filter(g=>g.support),c=d==null?void 0:d[d.length-1],f=a.date===(c==null?void 0:c.date);return w(av,{renderTimestamp:f,message:a,indexKey:l})}function o(a,l){return w(cv,{message:a,indexKey:l})}function s(a,l){return w(lv,{message:a,indexKey:l})}return w("ul",{className:"space-y-[3px]",children:[[...(t==null?void 0:t.messages)??[]].sort((a,l)=>a.date-l.date).map(r),t&&!e&&r({...Mw,date:t.lastMessageDate},-1)]})},pv=({authorName:t,visible:e})=>w("div",{className:`flex items-center gap-2 px-4 py-1.5 bg-white dark:bg-neutral-900 transition-opacity duration-150 ${e?"opacity-100":"opacity-0 pointer-events-none"}`,role:"status","aria-hidden":!e,"aria-label":e?`${t} is typing`:void 0,children:[w("span",{className:"inline-flex items-center gap-1",children:[0,1,2].map(n=>w("span",{className:`block w-1.5 h-1.5 rounded-full bg-gray-400 dark:bg-neutral-500 ${e?"dc-typing-dot":""}`,style:{animationDelay:`${n*.15}s`}},n))}),w("span",{className:"text-xs text-gray-500 dark:text-neutral-400",children:[w("span",{className:"font-semibold text-gray-700 dark:text-neutral-200",children:t})," ","is typing..."]})]});function xh(t=800){const[e,n]=H(!1),r=F(null),i=()=>{n(!0),r.current!==null&&clearTimeout(r.current),r.current=window.setTimeout(()=>{n(!1),r.current=null},t)};return $(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),{isScrolling:e,handleScroll:i}}const mv=()=>{var N;const{conversation:t,addMessage:e,username:n,email:r,confirmPendingMessage:i,discardPendingMessage:o,isSupportTyping:s}=z(Fi(k=>{const P=k.conversations.find(D=>D.threadId===k.openConversationId)??null;return{conversation:P,addMessage:k.addMessage,username:k.username,email:k.email,confirmPendingMessage:k.confirmPendingMessage,discardPendingMessage:k.discardPendingMessage,isSupportTyping:!!(P&&k.typingByThread[P.threadId])}})),a=!!(n&&r),[l,d]=H(!1),[c,f]=H([]),[m,g]=H({}),_=(t==null?void 0:t.status)==="open",[v,C]=H(""),{isScrolling:b,handleScroll:S}=xh(),T=[...(t==null?void 0:t.messages)??[]].filter(k=>k.support&&k.authorName).sort((k,P)=>P.date-k.date)[0],M=((N=t==null?void 0:t.csMember)==null?void 0:N.displayName)??(T==null?void 0:T.authorName)??"Support";$(()=>{const k={};c.forEach(P=>{if(!P.type.startsWith("image/")){k[P.name]={url:"",width:0,height:0,size:P.size},g({...k});return}const D=new FileReader;D.addEventListener("load",function(){const O=new Image;O.onload=()=>{k[P.name]={url:D.result,width:O.width,height:O.height,size:P.size},g({...k})},O.src=D.result},!1),D.readAsDataURL(P)})},[c]);const A=k=>{C(P=>P+k)},R=async()=>{const k=v;if(k.trim()==="")return;const P=`${Date.now()}-${Math.random().toString(36).slice(2)}`,D={support:!1,content:k,date:Date.now(),authorName:n,pending:!0,localId:P};C(""),e(t?t.threadId:"TEMP",D);try{const O=await Iw({content:k});i(P,O)}catch(O){o(P),O instanceof Gn||C(J=>J||k)}};return w(tt,{children:[w("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 flex flex-col-reverse space-y-4 space-y-reverse dc-scroll ${b?"dc-scroll--active":""}`,onScroll:S,children:w("div",{children:w(fv,{conversation:t,open:_},(t==null?void 0:t.threadId)??"none")})}),w(pv,{authorName:M,visible:s}),w("div",{className:(t==null?void 0:t.status)==="closed"?"":"border-t border-t-gray-200 dark:border-neutral-800",children:w(zw,{attachmentPreviews:m,files:c,setFiles:f,inputMessage:v,setInputMessage:C,showEmojiPicker:l,setShowEmojiPicker:d,addEmoji:A,sendMessage:R,disabled:!a})})]})};function Os(t,e){switch(t){case"online":return e==="text"?"text-teal-600":"bg-teal-400";case"idle":return e==="text"?"text-yellow-600":"bg-yellow-400";case"dnd":return e==="text"?"text-red-600":"bg-red-400";case"offline":case"invisible":return e==="text"?"text-black":"bg-gray-400";default:return e==="text"?"text-black":"bg-gray-400"}}function gv(t){switch(t){case"online":return"Online";case"idle":case"offline":case"invisible":return"Away";case"dnd":return"Unavailable";default:return"Away"}}const te=Object.create(null);te.open="0",te.close="1",te.ping="2",te.pong="3",te.message="4",te.upgrade="5",te.noop="6";const ni=Object.create(null);Object.keys(te).forEach(t=>{ni[te[t]]=t});const Bs={type:"error",data:"parser error"},Ch=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Sh=typeof ArrayBuffer=="function",kh=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Fs=({type:t,data:e},n,r)=>Ch&&e instanceof Blob?n?r(e):Eh(e,r):Sh&&(e instanceof ArrayBuffer||kh(e))?n?r(e):Eh(new Blob([e]),r):r(te[t]+(e||"")),Eh=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Th(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Vs;function yv(t,e){if(Ch&&t.data instanceof Blob)return t.data.arrayBuffer().then(Th).then(e);if(Sh&&(t.data instanceof ArrayBuffer||kh(t.data)))return e(Th(t.data));Fs(t,!1,n=>{Vs||(Vs=new TextEncoder),e(Vs.encode(n))})}const Ah="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ir=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Ah.length;t++)ir[Ah.charCodeAt(t)]=t;const wv=t=>{let e=t.length*.75,n=t.length,r,i=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const d=new ArrayBuffer(e),c=new Uint8Array(d);for(r=0;r<n;r+=4)o=ir[t.charCodeAt(r)],s=ir[t.charCodeAt(r+1)],a=ir[t.charCodeAt(r+2)],l=ir[t.charCodeAt(r+3)],c[i++]=o<<2|s>>4,c[i++]=(s&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return d},vv=typeof ArrayBuffer=="function",Us=(t,e)=>{if(typeof t!="string")return{type:"message",data:Ph(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:_v(t.substring(1),e)}:ni[n]?t.length>1?{type:ni[n],data:t.substring(1)}:{type:ni[n]}:Bs},_v=(t,e)=>{if(vv){const n=wv(t);return Ph(n,e)}else return{base64:!0,data:t}},Ph=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},Ih="",bv=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,s)=>{Fs(o,!1,a=>{r[s]=a,++i===n&&e(r.join(Ih))})})},xv=(t,e)=>{const n=t.split(Ih),r=[];for(let i=0;i<n.length;i++){const o=Us(n[i],e);if(r.push(o),o.type==="error")break}return r};function Cv(){return new TransformStream({transform(t,e){yv(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let $s;function ri(t){return t.reduce((e,n)=>e+n.length,0)}function ii(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Sv(t,e){$s||($s=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(ri(n)<1)break;const l=ii(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(ri(n)<2)break;const l=ii(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(ri(n)<8)break;const l=ii(n,8),d=new DataView(l.buffer,l.byteOffset,l.length),c=d.getUint32(0);if(c>Math.pow(2,21)-1){a.enqueue(Bs);break}i=c*Math.pow(2,32)+d.getUint32(4),r=3}else{if(ri(n)<i)break;const l=ii(n,i);a.enqueue(Us(o?l:$s.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(Bs);break}}}})}const Mh=4;function yt(t){if(t)return kv(t)}function kv(t){for(var e in yt.prototype)t[e]=yt.prototype[e];return t}yt.prototype.on=yt.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},yt.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},yt.prototype.off=yt.prototype.removeListener=yt.prototype.removeAllListeners=yt.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},yt.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},yt.prototype.emitReserved=yt.prototype.emit,yt.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},yt.prototype.hasListeners=function(t){return!!this.listeners(t).length};const $t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Rh(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const Ev=$t.setTimeout,Tv=$t.clearTimeout;function oi(t,e){e.useNativeTimers?(t.setTimeoutFn=Ev.bind($t),t.clearTimeoutFn=Tv.bind($t)):(t.setTimeoutFn=$t.setTimeout.bind($t),t.clearTimeoutFn=$t.clearTimeout.bind($t))}const Av=1.33;function Pv(t){return typeof t=="string"?Iv(t):Math.ceil((t.byteLength||t.size)*Av)}function Iv(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function Mv(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Rv(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class Nv extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class zs extends yt{constructor(e){super(),this.writable=!1,oi(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new Nv(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=Us(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Mv(e);return n.length?"?"+n:""}}const Nh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),js=64,Dv={};let Dh=0,si=0,Lh;function Oh(t){let e="";do e=Nh[t%js]+e,t=Math.floor(t/js);while(t>0);return e}function Bh(){const t=Oh(+new Date);return t!==Lh?(Dh=0,Lh=t):t+"."+Oh(Dh++)}for(;si<js;si++)Dv[Nh[si]]=si;let Fh=!1;try{Fh=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Lv=Fh;function Vh(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Lv))return new XMLHttpRequest}catch{}if(!e)try{return new $t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Sb(){}function Ov(){}const Bv=function(){return new Vh({xdomain:!1}).responseType!=null}();class Fv extends zs{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}const n=e&&e.forceBase64;this.supportsBinary=Bv&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};xv(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,bv(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Bh()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ee(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class ee extends yt{constructor(e,n){super(),oi(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.data=n.data!==void 0?n.data:null,this.create()}create(){var e;const n=Rh(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Vh(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=ee.requestsCount++,ee.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Ov,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ee.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ee.requestsCount=0,ee.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Uh);else if(typeof addEventListener=="function"){const t="onpagehide"in $t?"pagehide":"unload";addEventListener(t,Uh,!1)}}function Uh(){for(let t in ee.requests)ee.requests.hasOwnProperty(t)&&ee.requests[t].abort()}var Vv={},ai={};ai.byteLength=zv,ai.toByteArray=Hv,ai.fromByteArray=qv;for(var ne=[],zt=[],Uv=typeof Uint8Array<"u"?Uint8Array:Array,Hs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dn=0,$v=Hs.length;dn<$v;++dn)ne[dn]=Hs[dn],zt[Hs.charCodeAt(dn)]=dn;zt[45]=62,zt[95]=63;function $h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function zv(t){var e=$h(t),n=e[0],r=e[1];return(n+r)*3/4-r}function jv(t,e,n){return(e+n)*3/4-n}function Hv(t){var e,n=$h(t),r=n[0],i=n[1],o=new Uv(jv(t,r,i)),s=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)e=zt[t.charCodeAt(l)]<<18|zt[t.charCodeAt(l+1)]<<12|zt[t.charCodeAt(l+2)]<<6|zt[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=zt[t.charCodeAt(l)]<<2|zt[t.charCodeAt(l+1)]>>4,o[s++]=e&255),i===1&&(e=zt[t.charCodeAt(l)]<<10|zt[t.charCodeAt(l+1)]<<4|zt[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function Wv(t){return ne[t>>18&63]+ne[t>>12&63]+ne[t>>6&63]+ne[t&63]}function Kv(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Wv(r));return i.join("")}function qv(t){for(var e,n=t.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(Kv(t,s,s+o>a?a:s+o));return r===1?(e=t[n-1],i.push(ne[e>>2]+ne[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(ne[e>>10]+ne[e>>4&63]+ne[e<<2&63]+"=")),i.join("")}var Ws={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ws.read=function(t,e,n,r,i){var o,s,a=i*8-r-1,l=(1<<a)-1,d=l>>1,c=-7,f=n?i-1:0,m=n?-1:1,g=t[e+f];for(f+=m,o=g&(1<<-c)-1,g>>=-c,c+=a;c>0;o=o*256+t[e+f],f+=m,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+t[e+f],f+=m,c-=8);if(o===0)o=1-d;else{if(o===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(g?-1:1)*s*Math.pow(2,o-r)},Ws.write=function(t,e,n,r,i,o){var s,a,l,d=o*8-i-1,c=(1<<d)-1,f=c>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:o-1,_=r?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=m/l:e+=m*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*l-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+g]=a&255,g+=_,a/=256,i-=8);for(s=s<<i|a,d+=i;d>0;t[n+g]=s&255,g+=_,s/=256,d-=8);t[n+g-_]|=v*128};/*!
101
- * The buffer module from node.js, for the browser.
102
- *
103
- * @author Feross Aboukhadijeh <https://feross.org>
104
- * @license MIT
105
- */(function(t){const e=ai,n=Ws,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=A,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const p=new o(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,o.prototype),Object.setPrototypeOf(p,u),p.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(p){if(p>i)throw new RangeError('The value "'+p+'" is invalid for option "size"');const u=new o(p);return Object.setPrototypeOf(u,c.prototype),u}function c(p,u,h){if(typeof p=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(p)}return f(p,u,h)}c.poolSize=8192;function f(p,u,h){if(typeof p=="string")return v(p,u);if(s.isView(p))return b(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(st(p,s)||p&&st(p.buffer,s)||typeof a<"u"&&(st(p,a)||p&&st(p.buffer,a)))return S(p,u,h);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const y=p.valueOf&&p.valueOf();if(y!=null&&y!==p)return c.from(y,u,h);const x=T(p);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return c.from(p[Symbol.toPrimitive]("string"),u,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}c.from=function(p,u,h){return f(p,u,h)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function m(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function g(p,u,h){return m(p),p<=0?d(p):u!==void 0?typeof h=="string"?d(p).fill(u,h):d(p).fill(u):d(p)}c.alloc=function(p,u,h){return g(p,u,h)};function _(p){return m(p),d(p<0?0:M(p)|0)}c.allocUnsafe=function(p){return _(p)},c.allocUnsafeSlow=function(p){return _(p)};function v(p,u){if((typeof u!="string"||u==="")&&(u="utf8"),!c.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const h=R(p,u)|0;let y=d(h);const x=y.write(p,u);return x!==h&&(y=y.slice(0,x)),y}function C(p){const u=p.length<0?0:M(p.length)|0,h=d(u);for(let y=0;y<u;y+=1)h[y]=p[y]&255;return h}function b(p){if(st(p,o)){const u=new o(p);return S(u.buffer,u.byteOffset,u.byteLength)}return C(p)}function S(p,u,h){if(u<0||p.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<u+(h||0))throw new RangeError('"length" is outside of buffer bounds');let y;return u===void 0&&h===void 0?y=new o(p):h===void 0?y=new o(p,u):y=new o(p,u,h),Object.setPrototypeOf(y,c.prototype),y}function T(p){if(c.isBuffer(p)){const u=M(p.length)|0,h=d(u);return h.length===0||p.copy(h,0,0,u),h}if(p.length!==void 0)return typeof p.length!="number"||de(p.length)?d(0):C(p);if(p.type==="Buffer"&&Array.isArray(p.data))return C(p.data)}function M(p){if(p>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return p|0}function A(p){return+p!=p&&(p=0),c.alloc(+p)}c.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==c.prototype},c.compare=function(u,h){if(st(u,o)&&(u=c.from(u,u.offset,u.byteLength)),st(h,o)&&(h=c.from(h,h.offset,h.byteLength)),!c.isBuffer(u)||!c.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===h)return 0;let y=u.length,x=h.length;for(let E=0,I=Math.min(y,x);E<I;++E)if(u[E]!==h[E]){y=u[E],x=h[E];break}return y<x?-1:x<y?1:0},c.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(u,h){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return c.alloc(0);let y;if(h===void 0)for(h=0,y=0;y<u.length;++y)h+=u[y].length;const x=c.allocUnsafe(h);let E=0;for(y=0;y<u.length;++y){let I=u[y];if(st(I,o))E+I.length>x.length?(c.isBuffer(I)||(I=c.from(I)),I.copy(x,E)):o.prototype.set.call(x,I,E);else if(c.isBuffer(I))I.copy(x,E);else throw new TypeError('"list" argument must be an Array of Buffers');E+=I.length}return x};function R(p,u){if(c.isBuffer(p))return p.length;if(s.isView(p)||st(p,s))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);const h=p.length,y=arguments.length>2&&arguments[2]===!0;if(!y&&h===0)return 0;let x=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ur(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return xt(p).length;default:if(x)return y?-1:ur(p).length;u=(""+u).toLowerCase(),x=!0}}c.byteLength=R;function N(p,u,h){let y=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,u>>>=0,h<=u))return"";for(p||(p="utf8");;)switch(p){case"hex":return Yt(this,u,h);case"utf8":case"utf-8":return q(this,u,h);case"ascii":return jt(this,u,h);case"latin1":case"binary":return K(this,u,h);case"base64":return ve(this,u,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hi(this,u,h);default:if(y)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),y=!0}}c.prototype._isBuffer=!0;function k(p,u,h){const y=p[u];p[u]=p[h],p[h]=y}c.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<u;h+=2)k(this,h,h+1);return this},c.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<u;h+=4)k(this,h,h+3),k(this,h+1,h+2);return this},c.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<u;h+=8)k(this,h,h+7),k(this,h+1,h+6),k(this,h+2,h+5),k(this,h+3,h+4);return this},c.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?q(this,0,u):N.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(u){if(!c.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:c.compare(this,u)===0},c.prototype.inspect=function(){let u="";const h=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(u+=" ... "),"<Buffer "+u+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(u,h,y,x,E){if(st(u,o)&&(u=c.from(u,u.offset,u.byteLength)),!c.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(h===void 0&&(h=0),y===void 0&&(y=u?u.length:0),x===void 0&&(x=0),E===void 0&&(E=this.length),h<0||y>u.length||x<0||E>this.length)throw new RangeError("out of range index");if(x>=E&&h>=y)return 0;if(x>=E)return-1;if(h>=y)return 1;if(h>>>=0,y>>>=0,x>>>=0,E>>>=0,this===u)return 0;let I=E-x,j=y-h;const ct=Math.min(I,j),rt=this.slice(x,E),lt=u.slice(h,y);for(let Z=0;Z<ct;++Z)if(rt[Z]!==lt[Z]){I=rt[Z],j=lt[Z];break}return I<j?-1:j<I?1:0};function P(p,u,h,y,x){if(p.length===0)return-1;if(typeof h=="string"?(y=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,de(h)&&(h=x?0:p.length-1),h<0&&(h=p.length+h),h>=p.length){if(x)return-1;h=p.length-1}else if(h<0)if(x)h=0;else return-1;if(typeof u=="string"&&(u=c.from(u,y)),c.isBuffer(u))return u.length===0?-1:D(p,u,h,y,x);if(typeof u=="number")return u=u&255,typeof o.prototype.indexOf=="function"?x?o.prototype.indexOf.call(p,u,h):o.prototype.lastIndexOf.call(p,u,h):D(p,[u],h,y,x);throw new TypeError("val must be string, number or Buffer")}function D(p,u,h,y,x){let E=1,I=p.length,j=u.length;if(y!==void 0&&(y=String(y).toLowerCase(),y==="ucs2"||y==="ucs-2"||y==="utf16le"||y==="utf-16le")){if(p.length<2||u.length<2)return-1;E=2,I/=2,j/=2,h/=2}function ct(lt,Z){return E===1?lt[Z]:lt.readUInt16BE(Z*E)}let rt;if(x){let lt=-1;for(rt=h;rt<I;rt++)if(ct(p,rt)===ct(u,lt===-1?0:rt-lt)){if(lt===-1&&(lt=rt),rt-lt+1===j)return lt*E}else lt!==-1&&(rt-=rt-lt),lt=-1}else for(h+j>I&&(h=I-j),rt=h;rt>=0;rt--){let lt=!0;for(let Z=0;Z<j;Z++)if(ct(p,rt+Z)!==ct(u,Z)){lt=!1;break}if(lt)return rt}return-1}c.prototype.includes=function(u,h,y){return this.indexOf(u,h,y)!==-1},c.prototype.indexOf=function(u,h,y){return P(this,u,h,y,!0)},c.prototype.lastIndexOf=function(u,h,y){return P(this,u,h,y,!1)};function O(p,u,h,y){h=Number(h)||0;const x=p.length-h;y?(y=Number(y),y>x&&(y=x)):y=x;const E=u.length;y>E/2&&(y=E/2);let I;for(I=0;I<y;++I){const j=parseInt(u.substr(I*2,2),16);if(de(j))return I;p[h+I]=j}return I}function J(p,u,h,y){return At(ur(u,p.length-h),p,h,y)}function ft(p,u,h,y){return At(L(u),p,h,y)}function Lt(p,u,h,y){return At(xt(u),p,h,y)}function G(p,u,h,y){return At(Q(u,p.length-h),p,h,y)}c.prototype.write=function(u,h,y,x){if(h===void 0)x="utf8",y=this.length,h=0;else if(y===void 0&&typeof h=="string")x=h,y=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(y)?(y=y>>>0,x===void 0&&(x="utf8")):(x=y,y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const E=this.length-h;if((y===void 0||y>E)&&(y=E),u.length>0&&(y<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");let I=!1;for(;;)switch(x){case"hex":return O(this,u,h,y);case"utf8":case"utf-8":return J(this,u,h,y);case"ascii":case"latin1":case"binary":return ft(this,u,h,y);case"base64":return Lt(this,u,h,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,u,h,y);default:if(I)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),I=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ve(p,u,h){return u===0&&h===p.length?e.fromByteArray(p):e.fromByteArray(p.slice(u,h))}function q(p,u,h){h=Math.min(p.length,h);const y=[];let x=u;for(;x<h;){const E=p[x];let I=null,j=E>239?4:E>223?3:E>191?2:1;if(x+j<=h){let ct,rt,lt,Z;switch(j){case 1:E<128&&(I=E);break;case 2:ct=p[x+1],(ct&192)===128&&(Z=(E&31)<<6|ct&63,Z>127&&(I=Z));break;case 3:ct=p[x+1],rt=p[x+2],(ct&192)===128&&(rt&192)===128&&(Z=(E&15)<<12|(ct&63)<<6|rt&63,Z>2047&&(Z<55296||Z>57343)&&(I=Z));break;case 4:ct=p[x+1],rt=p[x+2],lt=p[x+3],(ct&192)===128&&(rt&192)===128&&(lt&192)===128&&(Z=(E&15)<<18|(ct&63)<<12|(rt&63)<<6|lt&63,Z>65535&&Z<1114112&&(I=Z))}}I===null?(I=65533,j=1):I>65535&&(I-=65536,y.push(I>>>10&1023|55296),I=56320|I&1023),y.push(I),x+=j}return Ot(y)}const wt=4096;function Ot(p){const u=p.length;if(u<=wt)return String.fromCharCode.apply(String,p);let h="",y=0;for(;y<u;)h+=String.fromCharCode.apply(String,p.slice(y,y+=wt));return h}function jt(p,u,h){let y="";h=Math.min(p.length,h);for(let x=u;x<h;++x)y+=String.fromCharCode(p[x]&127);return y}function K(p,u,h){let y="";h=Math.min(p.length,h);for(let x=u;x<h;++x)y+=String.fromCharCode(p[x]);return y}function Yt(p,u,h){const y=p.length;(!u||u<0)&&(u=0),(!h||h<0||h>y)&&(h=y);let x="";for(let E=u;E<h;++E)x+=vn[p[E]];return x}function hi(p,u,h){const y=p.slice(u,h);let x="";for(let E=0;E<y.length-1;E+=2)x+=String.fromCharCode(y[E]+y[E+1]*256);return x}c.prototype.slice=function(u,h){const y=this.length;u=~~u,h=h===void 0?y:~~h,u<0?(u+=y,u<0&&(u=0)):u>y&&(u=y),h<0?(h+=y,h<0&&(h=0)):h>y&&(h=y),h<u&&(h=u);const x=this.subarray(u,h);return Object.setPrototypeOf(x,c.prototype),x};function pt(p,u,h){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+u>h)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(u,h,y){u=u>>>0,h=h>>>0,y||pt(u,h,this.length);let x=this[u],E=1,I=0;for(;++I<h&&(E*=256);)x+=this[u+I]*E;return x},c.prototype.readUintBE=c.prototype.readUIntBE=function(u,h,y){u=u>>>0,h=h>>>0,y||pt(u,h,this.length);let x=this[u+--h],E=1;for(;h>0&&(E*=256);)x+=this[u+--h]*E;return x},c.prototype.readUint8=c.prototype.readUInt8=function(u,h){return u=u>>>0,h||pt(u,1,this.length),this[u]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(u,h){return u=u>>>0,h||pt(u,2,this.length),this[u]|this[u+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(u,h){return u=u>>>0,h||pt(u,2,this.length),this[u]<<8|this[u+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},c.prototype.readBigUInt64LE=Bt(function(u){u=u>>>0,ue(u,"offset");const h=this[u],y=this[u+7];(h===void 0||y===void 0)&&ze(u,this.length-8);const x=h+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,E=this[++u]+this[++u]*2**8+this[++u]*2**16+y*2**24;return BigInt(x)+(BigInt(E)<<BigInt(32))}),c.prototype.readBigUInt64BE=Bt(function(u){u=u>>>0,ue(u,"offset");const h=this[u],y=this[u+7];(h===void 0||y===void 0)&&ze(u,this.length-8);const x=h*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],E=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+y;return(BigInt(x)<<BigInt(32))+BigInt(E)}),c.prototype.readIntLE=function(u,h,y){u=u>>>0,h=h>>>0,y||pt(u,h,this.length);let x=this[u],E=1,I=0;for(;++I<h&&(E*=256);)x+=this[u+I]*E;return E*=128,x>=E&&(x-=Math.pow(2,8*h)),x},c.prototype.readIntBE=function(u,h,y){u=u>>>0,h=h>>>0,y||pt(u,h,this.length);let x=h,E=1,I=this[u+--x];for(;x>0&&(E*=256);)I+=this[u+--x]*E;return E*=128,I>=E&&(I-=Math.pow(2,8*h)),I},c.prototype.readInt8=function(u,h){return u=u>>>0,h||pt(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},c.prototype.readInt16LE=function(u,h){u=u>>>0,h||pt(u,2,this.length);const y=this[u]|this[u+1]<<8;return y&32768?y|4294901760:y},c.prototype.readInt16BE=function(u,h){u=u>>>0,h||pt(u,2,this.length);const y=this[u+1]|this[u]<<8;return y&32768?y|4294901760:y},c.prototype.readInt32LE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},c.prototype.readInt32BE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},c.prototype.readBigInt64LE=Bt(function(u){u=u>>>0,ue(u,"offset");const h=this[u],y=this[u+7];(h===void 0||y===void 0)&&ze(u,this.length-8);const x=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(y<<24);return(BigInt(x)<<BigInt(32))+BigInt(h+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),c.prototype.readBigInt64BE=Bt(function(u){u=u>>>0,ue(u,"offset");const h=this[u],y=this[u+7];(h===void 0||y===void 0)&&ze(u,this.length-8);const x=(h<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(x)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+y)}),c.prototype.readFloatLE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),n.read(this,u,!0,23,4)},c.prototype.readFloatBE=function(u,h){return u=u>>>0,h||pt(u,4,this.length),n.read(this,u,!1,23,4)},c.prototype.readDoubleLE=function(u,h){return u=u>>>0,h||pt(u,8,this.length),n.read(this,u,!0,52,8)},c.prototype.readDoubleBE=function(u,h){return u=u>>>0,h||pt(u,8,this.length),n.read(this,u,!1,52,8)};function _t(p,u,h,y,x,E){if(!c.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>x||u<E)throw new RangeError('"value" argument is out of bounds');if(h+y>p.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(u,h,y,x){if(u=+u,h=h>>>0,y=y>>>0,!x){const j=Math.pow(2,8*y)-1;_t(this,u,h,y,j,0)}let E=1,I=0;for(this[h]=u&255;++I<y&&(E*=256);)this[h+I]=u/E&255;return h+y},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(u,h,y,x){if(u=+u,h=h>>>0,y=y>>>0,!x){const j=Math.pow(2,8*y)-1;_t(this,u,h,y,j,0)}let E=y-1,I=1;for(this[h+E]=u&255;--E>=0&&(I*=256);)this[h+E]=u/I&255;return h+y},c.prototype.writeUint8=c.prototype.writeUInt8=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,1,255,0),this[h]=u&255,h+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,2,65535,0),this[h]=u&255,this[h+1]=u>>>8,h+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,2,65535,0),this[h]=u>>>8,this[h+1]=u&255,h+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,4,4294967295,0),this[h+3]=u>>>24,this[h+2]=u>>>16,this[h+1]=u>>>8,this[h]=u&255,h+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,4,4294967295,0),this[h]=u>>>24,this[h+1]=u>>>16,this[h+2]=u>>>8,this[h+3]=u&255,h+4};function $e(p,u,h,y,x){xe(u,y,x,p,h,7);let E=Number(u&BigInt(4294967295));p[h++]=E,E=E>>8,p[h++]=E,E=E>>8,p[h++]=E,E=E>>8,p[h++]=E;let I=Number(u>>BigInt(32)&BigInt(4294967295));return p[h++]=I,I=I>>8,p[h++]=I,I=I>>8,p[h++]=I,I=I>>8,p[h++]=I,h}function _e(p,u,h,y,x){xe(u,y,x,p,h,7);let E=Number(u&BigInt(4294967295));p[h+7]=E,E=E>>8,p[h+6]=E,E=E>>8,p[h+5]=E,E=E>>8,p[h+4]=E;let I=Number(u>>BigInt(32)&BigInt(4294967295));return p[h+3]=I,I=I>>8,p[h+2]=I,I=I>>8,p[h+1]=I,I=I>>8,p[h]=I,h+8}c.prototype.writeBigUInt64LE=Bt(function(u,h=0){return $e(this,u,h,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Bt(function(u,h=0){return _e(this,u,h,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(u,h,y,x){if(u=+u,h=h>>>0,!x){const ct=Math.pow(2,8*y-1);_t(this,u,h,y,ct-1,-ct)}let E=0,I=1,j=0;for(this[h]=u&255;++E<y&&(I*=256);)u<0&&j===0&&this[h+E-1]!==0&&(j=1),this[h+E]=(u/I>>0)-j&255;return h+y},c.prototype.writeIntBE=function(u,h,y,x){if(u=+u,h=h>>>0,!x){const ct=Math.pow(2,8*y-1);_t(this,u,h,y,ct-1,-ct)}let E=y-1,I=1,j=0;for(this[h+E]=u&255;--E>=0&&(I*=256);)u<0&&j===0&&this[h+E+1]!==0&&(j=1),this[h+E]=(u/I>>0)-j&255;return h+y},c.prototype.writeInt8=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,1,127,-128),u<0&&(u=255+u+1),this[h]=u&255,h+1},c.prototype.writeInt16LE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,2,32767,-32768),this[h]=u&255,this[h+1]=u>>>8,h+2},c.prototype.writeInt16BE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,2,32767,-32768),this[h]=u>>>8,this[h+1]=u&255,h+2},c.prototype.writeInt32LE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,4,2147483647,-2147483648),this[h]=u&255,this[h+1]=u>>>8,this[h+2]=u>>>16,this[h+3]=u>>>24,h+4},c.prototype.writeInt32BE=function(u,h,y){return u=+u,h=h>>>0,y||_t(this,u,h,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[h]=u>>>24,this[h+1]=u>>>16,this[h+2]=u>>>8,this[h+3]=u&255,h+4},c.prototype.writeBigInt64LE=Bt(function(u,h=0){return $e(this,u,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Bt(function(u,h=0){return _e(this,u,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function gn(p,u,h,y,x,E){if(h+y>p.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function lr(p,u,h,y,x){return u=+u,h=h>>>0,x||gn(p,u,h,4),n.write(p,u,h,y,23,4),h+4}c.prototype.writeFloatLE=function(u,h,y){return lr(this,u,h,!0,y)},c.prototype.writeFloatBE=function(u,h,y){return lr(this,u,h,!1,y)};function yn(p,u,h,y,x){return u=+u,h=h>>>0,x||gn(p,u,h,8),n.write(p,u,h,y,52,8),h+8}c.prototype.writeDoubleLE=function(u,h,y){return yn(this,u,h,!0,y)},c.prototype.writeDoubleBE=function(u,h,y){return yn(this,u,h,!1,y)},c.prototype.copy=function(u,h,y,x){if(!c.isBuffer(u))throw new TypeError("argument should be a Buffer");if(y||(y=0),!x&&x!==0&&(x=this.length),h>=u.length&&(h=u.length),h||(h=0),x>0&&x<y&&(x=y),x===y||u.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(y<0||y>=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),u.length-h<x-y&&(x=u.length-h+y);const E=x-y;return this===u&&typeof o.prototype.copyWithin=="function"?this.copyWithin(h,y,x):o.prototype.set.call(u,this.subarray(y,x),h),E},c.prototype.fill=function(u,h,y,x){if(typeof u=="string"){if(typeof h=="string"?(x=h,h=0,y=this.length):typeof y=="string"&&(x=y,y=this.length),x!==void 0&&typeof x!="string")throw new TypeError("encoding must be a string");if(typeof x=="string"&&!c.isEncoding(x))throw new TypeError("Unknown encoding: "+x);if(u.length===1){const I=u.charCodeAt(0);(x==="utf8"&&I<128||x==="latin1")&&(u=I)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(h<0||this.length<h||this.length<y)throw new RangeError("Out of range index");if(y<=h)return this;h=h>>>0,y=y===void 0?this.length:y>>>0,u||(u=0);let E;if(typeof u=="number")for(E=h;E<y;++E)this[E]=u;else{const I=c.isBuffer(u)?u:c.from(u,x),j=I.length;if(j===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(E=0;E<y-h;++E)this[E+h]=I[E%j]}return this};const be={};function wn(p,u,h){be[p]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(x){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:x,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}wn("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),wn("ERR_INVALID_ARG_TYPE",function(p,u){return`The "${p}" argument must be of type number. Received type ${typeof u}`},TypeError),wn("ERR_OUT_OF_RANGE",function(p,u,h){let y=`The value of "${p}" is out of range.`,x=h;return Number.isInteger(h)&&Math.abs(h)>2**32?x=fi(String(h)):typeof h=="bigint"&&(x=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(x=fi(x)),x+="n"),y+=` It must be ${u}. Received ${x}`,y},RangeError);function fi(p){let u="",h=p.length;const y=p[0]==="-"?1:0;for(;h>=y+4;h-=3)u=`_${p.slice(h-3,h)}${u}`;return`${p.slice(0,h)}${u}`}function ia(p,u,h){ue(u,"offset"),(p[u]===void 0||p[u+h]===void 0)&&ze(u,p.length-(h+1))}function xe(p,u,h,y,x,E){if(p>h||p<u){const I=typeof u=="bigint"?"n":"";let j;throw u===0||u===BigInt(0)?j=`>= 0${I} and < 2${I} ** ${(E+1)*8}${I}`:j=`>= -(2${I} ** ${(E+1)*8-1}${I}) and < 2 ** ${(E+1)*8-1}${I}`,new be.ERR_OUT_OF_RANGE("value",j,p)}ia(y,x,E)}function ue(p,u){if(typeof p!="number")throw new be.ERR_INVALID_ARG_TYPE(u,"number",p)}function ze(p,u,h){throw Math.floor(p)!==p?(ue(p,h),new be.ERR_OUT_OF_RANGE("offset","an integer",p)):u<0?new be.ERR_BUFFER_OUT_OF_BOUNDS:new be.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,p)}const pi=/[^+/0-9A-Za-z-_]/g;function mi(p){if(p=p.split("=")[0],p=p.trim().replace(pi,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function ur(p,u){u=u||1/0;let h;const y=p.length;let x=null;const E=[];for(let I=0;I<y;++I){if(h=p.charCodeAt(I),h>55295&&h<57344){if(!x){if(h>56319){(u-=3)>-1&&E.push(239,191,189);continue}else if(I+1===y){(u-=3)>-1&&E.push(239,191,189);continue}x=h;continue}if(h<56320){(u-=3)>-1&&E.push(239,191,189),x=h;continue}h=(x-55296<<10|h-56320)+65536}else x&&(u-=3)>-1&&E.push(239,191,189);if(x=null,h<128){if((u-=1)<0)break;E.push(h)}else if(h<2048){if((u-=2)<0)break;E.push(h>>6|192,h&63|128)}else if(h<65536){if((u-=3)<0)break;E.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((u-=4)<0)break;E.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return E}function L(p){const u=[];for(let h=0;h<p.length;++h)u.push(p.charCodeAt(h)&255);return u}function Q(p,u){let h,y,x;const E=[];for(let I=0;I<p.length&&!((u-=2)<0);++I)h=p.charCodeAt(I),y=h>>8,x=h%256,E.push(x),E.push(y);return E}function xt(p){return e.toByteArray(mi(p))}function At(p,u,h,y){let x;for(x=0;x<y&&!(x+h>=u.length||x>=p.length);++x)u[x+h]=p[x];return x}function st(p,u){return p instanceof u||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===u.name}function de(p){return p!==p}const vn=function(){const p="0123456789abcdef",u=new Array(256);for(let h=0;h<16;++h){const y=h*16;for(let x=0;x<16;++x)u[y+x]=p[h]+p[x]}return u}();function Bt(p){return typeof BigInt>"u"?dr:p}function dr(){throw new Error("BigInt not supported")}})(Vv);const Ks=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),ci=$t.WebSocket||$t.MozWebSocket,zh=!0,Yv="arraybuffer",jh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Gv extends zs{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=jh?{}:Rh(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=zh&&!jh?n?new ci(e,n):new ci(e):new ci(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;Fs(r,this.supportsBinary,o=>{const s={};try{zh&&this.ws.send(o)}catch{}i&&Ks(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Bh()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}check(){return!!ci}}class Xv extends zs{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const n=Sv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Cv();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this.writer.write(r).then(()=>{i&&Ks(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Zv={websocket:Gv,webtransport:Xv,polling:Fv},Jv=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Qv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qs(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=Jv.exec(t||""),o={},s=14;for(;s--;)o[Qv[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=t_(o,o.path),o.queryKey=e_(o,o.query),o}function t_(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function e_(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Hh=class _n extends yt{constructor(e,n={}){super(),this.binaryType=Yv,this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=qs(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=qs(n.host).host),oi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Rv(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=Mh,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Zv[e](r)}open(){let e;if(this.opts.rememberUpgrade&&_n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;_n.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;_n.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const s=f=>{const m=new Error("probe error: "+f);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function a(){s("transport closed")}function l(){s("socket closed")}function d(f){n&&f.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",d)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",d),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",_n.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Pv(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){_n.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}};Hh.protocol=Mh;function n_(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=qs(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const r_=typeof ArrayBuffer=="function",i_=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Wh=Object.prototype.toString,o_=typeof Blob=="function"||typeof Blob<"u"&&Wh.call(Blob)==="[object BlobConstructor]",s_=typeof File=="function"||typeof File<"u"&&Wh.call(File)==="[object FileConstructor]";function Ys(t){return r_&&(t instanceof ArrayBuffer||i_(t))||o_&&t instanceof Blob||s_&&t instanceof File}function li(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(li(t[n]))return!0;return!1}if(Ys(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return li(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&li(t[n]))return!0;return!1}function a_(t){const e=[],n=t.data,r=t;return r.data=Gs(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Gs(t,e){if(!t)return t;if(Ys(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Gs(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Gs(t[r],e));return n}return t}function c_(t,e){return t.data=Xs(t.data,e),delete t.attachments,t}function Xs(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Xs(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Xs(t[n],e));return t}const l_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],u_=5;var W;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(W||(W={}));class d_{constructor(e){this.replacer=e}encode(e){return(e.type===W.EVENT||e.type===W.ACK)&&li(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===W.BINARY_EVENT||e.type===W.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=a_(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Kh(t){return Object.prototype.toString.call(t)==="[object Object]"}class Zs extends yt{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===W.BINARY_EVENT;r||n.type===W.BINARY_ACK?(n.type=r?W.EVENT:W.ACK,this.reconstructor=new h_(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ys(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(W[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===W.BINARY_EVENT||r.type===W.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(o,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(Zs.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case W.CONNECT:return Kh(n);case W.DISCONNECT:return n===void 0;case W.CONNECT_ERROR:return typeof n=="string"||Kh(n);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&l_.indexOf(n[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class h_{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=c_(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const f_=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Zs,Encoder:d_,get PacketType(){return W},protocol:u_},Symbol.toStringTag,{value:"Module"}));function qt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const p_=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class qh extends yt{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[qt(e,"open",this.onopen.bind(this)),qt(e,"packet",this.onpacket.bind(this)),qt(e,"error",this.onerror.bind(this)),qt(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(p_.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:W.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),s=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...n){return new Promise((r,i)=>{const o=(s,a)=>s?i(s):r(a);o.withError=!0,n.push(o),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:W.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case W.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case W.EVENT:case W.BINARY_EVENT:this.onevent(e);break;case W.ACK:case W.BINARY_ACK:this.onack(e);break;case W.DISCONNECT:this.ondisconnect();break;case W.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:W.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:W.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function hn(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}hn.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},hn.prototype.reset=function(){this.attempts=0},hn.prototype.setMin=function(t){this.ms=t},hn.prototype.setMax=function(t){this.max=t},hn.prototype.setJitter=function(t){this.jitter=t};class Js extends yt{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,oi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new hn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||f_;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Hh(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=qt(n,"open",function(){r.onopen(),e&&e()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},s=qt(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(qt(e,"ping",this.onping.bind(this)),qt(e,"data",this.ondata.bind(this)),qt(e,"error",this.onerror.bind(this)),qt(e,"close",this.onclose.bind(this)),qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Ks(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new qh(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const or={};function ui(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=n_(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=or[i]&&o in or[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new Js(r,e):(or[i]||(or[i]=new Js(r,e)),l=or[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(ui,{Manager:Js,Socket:qh,io:ui,connect:ui});function Qs(){return document.visibilityState==="visible"&&document.hasFocus()}const m_=8e3,sr=new Map;function Yh(t){const e=sr.get(t);e&&(clearTimeout(e),sr.delete(t)),z.getState().setThreadTyping(t,!1)}function g_(t){z.getState().setThreadTyping(t.threadId,!0);const e=sr.get(t.threadId);e&&clearTimeout(e),sr.set(t.threadId,setTimeout(()=>{sr.delete(t.threadId),z.getState().setThreadTyping(t.threadId,!1)},m_))}function y_(t){const{conversations:e,addMessage:n,isChatOpen:r,incrementUnreadCount:i}=z.getState(),o={support:!0,content:t.message.content,authorName:t.message.authorName,date:t.message.date,attachments:t.message.attachments,emojis:t.message.emojis},s=e.find(a=>a.threadId===t.threadId);if(s&&wd(s.messages,o)){ht("Duplicate message detected, skipping:",t.threadId);return}n(t.threadId,o),Yh(t.threadId),(!r||!Qs())&&i()}function w_(t){const e=z.getState().setConversationOpen;e(t.threadId,!1),Yh(t.threadId)}function v_(t){z.getState().setConversationOpen(t.threadId,!0)}function __(t){const{setConversationCSMember:e,addMessage:n,tempConversationToThread:r}=z.getState();r(t.threadId),e(t.threadId,t.csMember),n(t.threadId,xd(t.csMember.displayName))}function b_(t){const{setConversationCSMember:e,addMessage:n}=z.getState();e(t.threadId,t.csMember),n(t.threadId,xd(t.csMember.displayName))}function x_(t){const{conversations:e,updateMessage:n}=z.getState(),r=e.find(o=>o.threadId===t.threadId);if(!r){ht("⚠️ Conversation not found for update:",t.threadId);return}if(!r.messages.some(o=>o.date===t.message.date)){ht("⚠️ Message not found for update:",t.message.date);return}n(t.threadId,t.message.date,{support:!0,content:t.message.content,authorName:t.message.authorName,date:t.message.date,attachments:t.message.attachments,edited:!0,emojis:t.message.emojis})}function C_(t){const{conversations:e,removeMessage:n}=z.getState(),r=e.find(o=>o.threadId===t.threadId);if(!r){ht("⚠️ Conversation not found for deletion:",t.threadId);return}if(!r.messages.some(o=>o.date===t.messageDate)){ht("⚠️ Message not found for deletion:",t.messageDate);return}n(t.threadId,t.messageDate)}function S_(t){z.getState().setGuildSettings({onlineCsMembers:t.onlineCsMembers})}function k_(t){var l;const{conversations:e,addMessage:n}=z.getState(),r=e.flatMap(d=>d.messages),i=!!t.message.content&&r.some(d=>d.pending&&d.content===t.message.content),o=!t.message.content&&r.some(d=>{var c,f;return d.customRenderer===Le.UploadFile&&((f=(c=d.customRendererProps)==null?void 0:c.file)==null?void 0:f.status)==="uploading"});if(i||o)return;const s={support:!1,content:t.message.content,authorName:t.message.authorName,date:t.message.date,attachments:t.message.attachments,emojis:t.message.emojis},a=e.find(d=>d.threadId===t.threadId);a&&wd(a.messages,s)||(l=s.attachments)!=null&&l.length&&r.some(d=>{var c;return!d.support&&d.date===s.date&&((c=d.attachments)==null?void 0:c.length)})||n(t.threadId,s)}let fn=null,pn=null;function Gh(){fn==null||fn.disconnect(),pn==null||pn(),fn=null,pn=null}function E_(t){return Gh(),new Promise(e=>{const n=ui(It.domain,{path:"/socket"});fn=n,pn=()=>e(n),n.on("new-support-message",y_),n.on("updated-support-message",x_),n.on("deleted-support-message",C_),n.on("thread-closed",w_),n.on("thread-reopened",v_),n.on("thread-assigned",__),n.on("thread-reassigned",b_),n.on("support-typing",g_),n.on("presence-updated",S_),n.on("new-customer-message",k_),n.on("connect",()=>{n.emit("identify",{jwt:t}),fn===n&&(pn=null),e(n)})})}const ta="discord-widget";function mn(){return we.get(ta)}function T_(){we.remove(ta),z.getState().setToken("")}function Xh(t){we.set(ta,t,{sameSite:"strict",secure:window.location.protocol==="https:"}),z.getState().setToken(t)}function Zh(t){try{const e=JSON.parse(atob(t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")));return Number.isFinite(e.exp)?e.exp*1e3:null}catch{return null}}async function Jh(t,e,n){const r=new Headers;return r.append("Content-Type","application/json"),n&&r.append("Authorization",`Bearer ${n}`),fetch(`${It.domain}${t}`,{method:"POST",headers:r,body:JSON.stringify({guildId:It.app_id,...e})})}async function Qh({name:t,email:e,avatarUrl:n},r){const o=await(await Jh("/auth/token",{name:t,email:e,...n&&{avatarUrl:n}},r)).json();return o.token&&o.token!=="undefined"&&Xh(o.token),o}async function A_({userId:t,userHash:e,name:n,email:r,avatarUrl:i},o){const s=await Jh("/auth/identify",{userId:t,userHash:e,name:n,email:r,...i&&{avatarUrl:i}},o);if(!s.ok)return null;const a=await s.json();return a.token?(Xh(a.token),a.token):null}const P_=12*60*60*1e3,I_=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,M_=256,R_=2048;function N_(t){return typeof t!="string"||!t?"":!/^https:\/\/[^\s]+$/i.test(t)||t.length>R_?(console.warn("[Deskcord] avatarUrl ignored: it must be an https:// URL of at most 2048 characters."),""):t}let ar=Promise.resolve();function tf(t){return ar=ar.then(t).catch(e=>{console.error("[Deskcord]",e)}),ar}async function D_(){let t;do t=ar,await t;while(t!==ar)}function ef(t){return tf(()=>F_(t))}function L_(){return tf(di)}function O_(t){const{verifiedUserId:e}=z.getState();if(e){const n=mn(),r=n?Zh(n):null,i=!!n&&(r===null||r>Date.now()),o=(t==null?void 0:t.userId)===e&&!!(t!=null&&t.userHash);(t===null||!i&&!o)&&di()}t&&ef(t)}function di(){z_(),T_(),z.getState().resetSession()}function B_(t){return typeof(t==null?void 0:t.name)=="string"&&t.name.trim().length>0&&typeof t.email=="string"&&I_.test(t.email)}async function F_(t){if(!B_(t)){console.error("[Deskcord] identify() needs at least a name and a valid email.");return}const e=!!(t.userId&&t.userHash),n=z.getState();n.verifiedUserId&&(!e||t.userId!==n.verifiedUserId)&&di();const r={username:t.name.trim().slice(0,M_),email:t.email,avatarUrl:N_(t.avatarUrl)},i=z.getState(),o=i.username!==r.username||i.email!==r.email||i.avatarUrl!==r.avatarUrl;i.setIdentity({...r,verifiedUserId:i.verifiedUserId}),i.removeIntroConversation();const s=mn();if(e){const l=s?Zh(s):null;if(i.verifiedUserId===t.userId&&!o&&l!==null&&l-Date.now()>P_)return;const c=await A_({userId:t.userId,userHash:t.userHash,name:r.username,email:r.email,avatarUrl:r.avatarUrl||void 0},s);if(c){const f=i.verifiedUserId!==t.userId;z.getState().setIdentity({...r,verifiedUserId:t.userId}),ht("✅ Identified as verified user",t.userId),f&&$_()&&await sf(c);return}console.warn("[Deskcord] Identity verification failed: check that it's enabled (/identity-verification enable) and that userHash is HMAC-SHA256(secret, userId) computed on your server. Continuing without it."),i.verifiedUserId&&(di(),z.getState().setIdentity({...r,verifiedUserId:null}))}const a=mn();a&&o&&await Qh({name:r.username,email:r.email,avatarUrl:r.avatarUrl||void 0},a)}async function V_(t){const e=new Headers;e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${t}`);try{const n=await fetch(`${It.domain}/conversations/current`,{method:"GET",headers:e});return await Xn(n),n.status!==200?null:(await n.json()).currentConversation??null}catch(n){if(n instanceof Gn)throw n;return console.error("Error fetching current conversation",n),null}}async function U_(t){const e=new Headers;e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${t}`);try{const n=await fetch(`${It.domain}/conversations/past`,{method:"GET",headers:e});return await Xn(n),n.status!==200?null:(await n.json()).pastConversations??null}catch(n){return console.error("Error fetching past conversations",n),null}}function nf(t){return mn()===t}async function rf(t){return await E_(t)}async function of(t){const{smartMergeCurrentConversation:e,setConversationOpen:n,conversations:r}=z.getState();try{const i=await V_(t);if(!nf(t))return;if(i)ht("✅ Found current conversation:",i.threadId),e(i);else{ht("ℹ️ No current conversation found");const o=r.find(s=>s.status==="open"&&s.threadId!=="TEMP");o&&(ht("ℹ️ Closing stale conversation:",o.threadId),n(o.threadId,!1))}}catch(i){if(i instanceof Gn)return;z.getState().setNetworkError("Failed to load conversation")}}async function ea(t){const{pastConversationsLastFetchedAt:e,smartMergePastConversations:n,setLoading:r,setNetworkError:i}=z.getState(),o=5*60*1e3;if(!e||Date.now()-e>o)try{r(!0);const a=await U_(t);if(!nf(t))return;a&&a.length>0?(ht(`✅ Loaded ${a.length} past conversations`),n(a)):ht("ℹ️ No past conversations found")}catch(a){if(a instanceof Gn)return;i("Failed to load conversation history")}finally{r(!1)}}let na=!1;function $_(){return na}function z_(){na=!1,Gh()}async function sf(t){z.getState().setPastConversationsLastFetchedAt(null),await rf(t),await of(t),await ea(t),await z.getState().syncUnreadCountFromServer()}async function j_(){const{setNetworkError:t,setLoading:e}=z.getState();try{e(!0),t(null),await D_();const{username:n,email:r,avatarUrl:i,verifiedUserId:o}=z.getState();let s=mn();s?ht("ℹ️ Returning user - JWT found in cookies"):(ht("ℹ️ New user - obtaining JWT token..."),s=(await Qh({name:n,email:r,avatarUrl:i||void 0})).token,ht("✅ JWT token obtained")),await rf(s),await of(s),o&&ea(s);const a=mn();if(!a)return;na=!0,ht("✅ Network initialization complete"),a!==s&&await sf(a)}catch(n){t(n instanceof Error?n.message:"Network initialization failed")}finally{e(!1)}}const H_="Customer support",W_="A team member will pick up this conversation shortly",K_="https://i.imgur.com/ecjl5HR.png",q_=()=>{const{conversations:t,setOpenConversationId:e,pastConversationsLastFetchedAt:n,guildSettings:r}=z(),i=t.filter(c=>c.status==="open").length,{isScrolling:o,handleScroll:s}=xh();$(()=>{const c=we.get("discord-widget");if(!c)return;const f=5*60*1e3;(!n||Date.now()-n>f)&&ea(c)},[n]);function a(){return i!==0?null:w(ye.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},onClick:()=>e("TEMP"),style:{background:"var(--dc-primary)"},type:"button",className:"flex justify-center items-center w-full h-16 border-t border-gray-200",children:w("div",{className:`flex flex-row items-center transform transition-transform duration-150
106
- hover:scale-105 active:scale-95`,children:[w("span",{className:"text-sm text-slate-50 pr-3",children:"Send us a new message"}),w(by,{color:"#FFFFFF",size:18,strokeWidth:1})]})})}function l(c,f,m){var C,b;const g=c.messages[c.messages.length-1],_=c.status==="open",v=!(c!=null&&c.csMember)||c.csMember.displayName===H_;return w("div",{className:`flex flex-row items-center px-3 py-4 hover:bg-gray-200 cursor-pointer ${m?"":"border-b border-gray-200 "}`,onClick:()=>e(c.threadId),children:[w("div",{className:"relative inline-block mr-3",children:[w("img",{className:"inline-block size-[32px] rounded-full",src:v?(r==null?void 0:r.iconURL)||K_:c.csMember.displayAvatarURL}),!v&&((C=c==null?void 0:c.csMember)==null?void 0:C.status)&&w("span",{className:`absolute top-0 end-0 block size-3 rounded-full ring-1 ring-white dark:ring-neutral-900 ${Os(c.csMember.status,"bg")}`})]}),w("div",{className:"flex flex-1 flex-col",children:[w("p",{className:`text-sm/3 ${_?"font-semibold":""}`,children:v?W_:(b=c==null?void 0:c.csMember)==null?void 0:b.displayName}),w("p",{className:"text-xs text-gray-500 line-clamp-1",children:g.content})]}),w("div",{className:"ml-2",children:w("p",{className:"text-xs text-gray-500",children:Sd(g.date)})})]},`conversation-${f}`)}function d(){const c=[...t].filter(g=>g.status==="open"),f=[...t].filter(g=>g.status==="closed"),m=g=>g.sort((_,v)=>v.lastMessageDate-_.lastMessageDate).map((_,v)=>_.messages.length?l(_,v,v+1===g.length):null);return w("div",{onScroll:s,className:`flex flex-col flex-1 min-h-0 p-2 overflow-y-auto dc-scroll ${o?"dc-scroll--active":""}`,children:[c.length>0&&w("div",{className:"mb-2",children:[w("span",{className:"text-sm",children:"Current conversation"}),m(c)]}),f.length>0&&w(tt,{children:[w("span",{className:"text-sm",children:"Closed messages"}),m(f)]})]})}return w("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[d(),a()]})},af=({IconComponent:t,onClick:e})=>w("button",{onClick:e,className:`flex mr-2 items-center justify-center w-8 h-8
107
- transform transition-transform duration-150
108
- hover:scale-110 active:scale-95`,children:w(t,{})}),Y_=({size:t})=>w("svg",{xmlns:"http://www.w3.org/2000/svg",width:t||26,height:t||26,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[w("path",{d:"M18 6 6 18"}),w("path",{d:"m6 6 12 12"})]}),G_=({size:t})=>w("svg",{xmlns:"http://www.w3.org/2000/svg",width:t||24,height:t||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-left",children:w("path",{d:"m15 18-6-6 6-6"})}),ra=3,X_=({members:t})=>{if(t.length<=1)return null;const e=t.length>ra,n=t.slice(0,e?ra-1:ra),r=t.length-n.length;return w("div",{className:"flex items-center -space-x-2 ml-3",children:[n.map((i,o)=>w("div",{className:"relative",style:{zIndex:n.length-o},children:[w("img",{src:i.displayAvatarURL,alt:i.displayName,title:i.displayName,className:"block w-7 h-7 rounded-full object-cover ring-1 ring-white dark:ring-neutral-900"}),w("span",{className:`absolute -bottom-0.5 -end-0.5 block size-2.5 rounded-full ring-1 ring-white dark:ring-neutral-900 ${Os(i.status,"bg")}`})]},`${i.displayName}-${o}`)),r>0&&w("div",{className:"relative flex items-center justify-center w-7 h-7 rounded-full bg-gray-500 text-white text-[10px] font-semibold ring-1 ring-white dark:ring-neutral-900",style:{zIndex:0},children:["+",r]})]})},cf={title:"Hi there 👋",subtitle:"We typically reply within a few minutes"},Z_="No one's online right now — leave a message and we'll get back to you.",J_=()=>{var _,v,C,b,S,T;const{setChatOpen:t,setOpenConversationId:e,guildSettings:n,conversations:r,openConversationId:i}=z(),o=r.find(M=>M.status==="open"),s=!!i,a=r.length===1&&r[0].status==="closed",l=r.length>1,d=s&&(a||l),c=!!(i&&(o!=null&&o.csMember)&&((_=o==null?void 0:o.csMember)==null?void 0:_.displayName)!=="Customer support"),f=n==null?void 0:n.onlineCsMembers,m=Array.isArray(f)&&f.length===0,g=c?{title:(v=o==null?void 0:o.csMember)==null?void 0:v.displayName,subtitle:(C=o==null?void 0:o.csMember)!=null&&C.status?gv((b=o==null?void 0:o.csMember)==null?void 0:b.status):null,avatar:(S=o==null?void 0:o.csMember)==null?void 0:S.displayAvatarURL,status:(T=o==null?void 0:o.csMember)==null?void 0:T.status}:{title:(n==null?void 0:n.header_title)??cf.title,subtitle:m?(n==null?void 0:n.offline_message)??Z_:(n==null?void 0:n.header_subtitle)??cf.subtitle,avatar:(n==null?void 0:n.iconURL)||"https://i.imgur.com/ecjl5HR.png",status:Array.isArray(f)?f.length>0?"online":"offline":void 0};return w("div",{style:{background:"linear-gradient(135deg, var(--dc-primary), var(--dc-primary-mid))",boxShadow:"0 4px 4px rgba(0, 0, 0, 0.1)"},className:"flex flex-row items-center py-5 px-4 text-white",children:[d&&w(af,{onClick:()=>e(null),IconComponent:G_}),w("div",{className:"relative inline-block mr-3",children:[w("img",{className:"inline-block w-[40px] rounded-full",src:g.avatar}),g.status&&w("span",{className:`absolute top-0 end-0 block size-3.5 rounded-full ring-1 ring-white dark:ring-neutral-900 ${Os(g.status,"bg")}`})]}),w("div",{className:"flex-1 flex-col",children:[w("p",{className:"text-lg/5 font-regular",children:g.title}),g.subtitle&&w("p",{className:"flex-1 text-xs/4 line-clamp-2",children:g.subtitle})]}),!c&&f&&w(X_,{members:f}),w(af,{onClick:()=>t(!1),IconComponent:Y_})]})};function Q_(){const[t,e]=H({width:null,height:null});return se(()=>{const n=()=>{e({width:window.innerWidth,height:window.innerHeight})};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),t}const tb=()=>{const t=Q_();return!t.width||!t.height?!1:t.width>t.height?t.width<=vd||t.height<=yw:t.width<=vd},eb=()=>{const{isChatOpen:t,renderConversationList:e,widgetPosition:n}=z(Fi(l=>{var d;return{isChatOpen:l.isChatOpen,renderConversationList:!l.openConversationId&&l.conversations.length>0,widgetPosition:(d=l.guildSettings)==null?void 0:d.widget_position}})),r=tb(),i=ws(n),o=i==="bottom-left"?"bottom left":"bottom right",s={position:"fixed",inset:"0px",width:"100%",height:"100%",zIndex:9999,transformOrigin:o,willChange:"transform, opacity"},a={position:"fixed",bottom:"110px",...vs(i,30),width:"400px",height:"700px",maxWidth:"calc(100% - 60px)",maxHeight:"calc(100% - 124px)",zIndex:9999,transformOrigin:o,willChange:"transform, opacity"};return w(Tr,{children:t&&w(ye.div,{initial:{opacity:0,scale:.92,y:r?0:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:r?0:8,transition:{duration:.14,ease:"easeIn"}},transition:r?{duration:.2,ease:[.22,1,.36,1]}:{type:"spring",stiffness:520,damping:34,mass:.7},style:r?s:a,children:w("div",{className:`flex flex-col h-full bg-white shadow-xl overflow-hidden ${r?"":"rounded-xl"}`,children:[w(J_,{}),w(Tr,{mode:"wait",initial:!1,children:w(ye.div,{className:"flex flex-col flex-1 min-h-0",initial:{opacity:0,x:e?-12:12},animate:{opacity:1,x:0},exit:{opacity:0,transition:{duration:.08}},transition:{duration:.16,ease:[.22,1,.36,1]},children:e?w(q_,{}):w(mv,{})},e?"list":"conversation")})]})},"chatbox")})};async function nb(){const{setGuildSettings:t,guildSettings:e}=z.getState();if(e.lastUpdate)return;const n=new Headers;n.append("Content-Type","application/json");try{const i=await(await fetch(`${It.domain}/guildSettings/${It.app_id}`,{method:"GET",headers:n})).json();t(i)}catch{}}async function rb(){const t=new Headers;t.append("Content-Type","application/json");try{return(await(await fetch(`${It.domain}/guildSettings/status/${It.app_id}`,{method:"GET",headers:t})).json()).active}catch{return!1}}function ib(t,e){const n=F(document.title),r=F(null),i=F(!1);$(()=>{n.current||(n.current=document.title)},[]),$(()=>{if(r.current!==null&&(clearInterval(r.current),r.current=null),e&&t>0){const o=()=>{const s=t>1?"s":"";return`(${t}) New message${s} - ${n.current}`};document.title=o(),i.current=!0,r.current=window.setInterval(()=>{i.current?(document.title=n.current,i.current=!1):(document.title=o(),i.current=!0)},5e3)}else document.title=n.current,i.current=!1;return()=>{r.current!==null&&(clearInterval(r.current),r.current=null),document.title=n.current}},[t,e]),$(()=>{if(e&&t>0&&i.current){const o=t>1?"s":"";document.title=`(${t}) New message${o} - ${n.current}`}},[t,e])}function ob(){const[t,e]=H(Qs);return $(()=>{const n=()=>e(Qs());return document.addEventListener("visibilitychange",n),window.addEventListener("focus",n),window.addEventListener("blur",n),()=>{document.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n),window.removeEventListener("blur",n)}},[]),t}const sb="#7289DA",ab=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function cb(t){return!!t&&ab.test(t.trim())}function lf(t){const e=t.trim();return e.length===4?"#"+e.slice(1).split("").map(n=>n+n).join(""):e.toLowerCase()}function lb(t){const e=lf(t),n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return[n,r,i]}function ub(t,e,n){const r=t/255,i=e/255,o=n/255,s=Math.max(r,i,o),a=Math.min(r,i,o);let l=0,d=0;const c=(s+a)/2;if(s!==a){const f=s-a;switch(d=c>.5?f/(2-s-a):f/(s+a),s){case r:l=(i-o)/f+(i<o?6:0);break;case i:l=(o-r)/f+2;break;default:l=(r-i)/f+4;break}l/=6}return[l*360,d*100,c*100]}function uf(t,e,n){const r=Math.min(100,Math.max(0,e))/100,i=Math.min(100,Math.max(0,n))/100,o=d=>(d+t/30)%12,s=r*Math.min(i,1-i),a=d=>i-s*Math.max(-1,Math.min(o(d)-3,Math.min(9-o(d),1))),l=d=>Math.round(a(d)*255).toString(16).padStart(2,"0");return`#${l(0)}${l(8)}${l(4)}`}function db(t){const e=lf(t),[n,r,i]=lb(e),[o,s,a]=ub(n,r,i);return{primary:e,primaryMid:uf(o,s*.552,a*.789),primaryDark:uf(o,s*.18,a*.229)}}function hb(t){const e=cb(t)?t:sb;return db(e)}function fb(t){const{primary:e,primaryMid:n,primaryDark:r}=hb(t);return{"--dc-primary":e,"--dc-primary-mid":n,"--dc-primary-dark":r}}function pb(){const{isChatOpen:t,toggleChatOpen:e,isNetworkInitialized:n,setNetworkInitialized:r,username:i,email:o,addMessage:s,hasConversations:a,_REHYDRATED_:l,networkError:d,widgetUnavailable:c,unreadCount:f,markMessagesAsReadWithSync:m,syncUnreadCountFromServer:g,initializeUnreadState:_,primaryColor:v,widgetPositionSetting:C}=z(Fi(k=>{var P,D;return{isChatOpen:k.isChatOpen,toggleChatOpen:k.toggleChatOpen,isNetworkInitialized:k.isNetworkInitialized,setNetworkInitialized:k.setNetworkInitialized,username:k.username,email:k.email,addMessage:k.addMessage,hasConversations:k.conversations.length>0,_REHYDRATED_:k._REHYDRATED_,networkError:k.networkError,widgetUnavailable:k.widgetUnavailable,unreadCount:k.unreadCount,markMessagesAsReadWithSync:k.markMessagesAsReadWithSync,syncUnreadCountFromServer:k.syncUnreadCountFromServer,initializeUnreadState:k.initializeUnreadState,primaryColor:(P=k.guildSettings)==null?void 0:P.primary_color,widgetPositionSetting:(D=k.guildSettings)==null?void 0:D.widget_position}})),b=fb(v),S=ws(C),[T,M]=H(!1),A=ob();ib(f,f>0&&(!t||!A)),$(()=>{t&&A&&f>0&&m()},[t,A,f,m]),$(()=>{(async()=>{const k=await rb();M(k)})()},[]),$(()=>{_()},[_]);const R=et(()=>(!i||!o)&&!a?(s("TEMP",Rw),!0):!1,[i,o,s,a]);return $(()=>{l&&(async()=>(await nb(),!R()&&(i||o)&&!n&&(j_(),r(!0),g())))()},[n,r,R,g,i,o,l]),!T||c?null:w("div",{style:b,children:[w(Pw,{onClick:()=>e(),isOpen:t,unreadCount:f}),w(eb,{}),w(()=>d?w("div",{style:{position:"fixed",bottom:"90px",...vs(S,20),backgroundColor:"#EF4444",color:"white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:9999,maxWidth:"300px",fontSize:"14px"},children:[w("strong",{children:"Connection Error"}),w("p",{style:{margin:"4px 0 0 0",fontSize:"12px"},children:d})]}):null,{}),w("div",{id:"deskcord-lightbox-portal",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:2147482e3,pointerEvents:"none"}})]})}const mb=()=>{const t=F(null),[e,n]=H(null),[r,i]=H(null);return $(()=>{if(!t.current)return;let o=t.current.shadowRoot;o||(o=t.current.attachShadow({mode:"open"}));let s=o.querySelector("#deskcord-shadow-container");s||(s=document.createElement("div"),s.id="deskcord-shadow-container",s.style.cssText=`
109
- all: initial;
110
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
111
- font-size: 16px;
112
- line-height: 1.5;
113
- color: #000;
114
- box-sizing: border-box;
115
- `,o.appendChild(s));let a=o.querySelector("#deskcord-tailwind-styles");a||(a=document.createElement("style"),a.id="deskcord-tailwind-styles",a.textContent=Of,o.insertBefore(a,o.firstChild));let l=o.querySelector("#deskcord-lightbox-styles");l||(l=document.createElement("style"),l.id="deskcord-lightbox-styles",l.textContent=Bf,o.insertBefore(l,a.nextSibling));let d=o.querySelector("#deskcord-reset-styles");return d||(d=document.createElement("style"),d.id="deskcord-reset-styles",d.textContent=`
116
- /* Reset styles to ensure isolation from parent page */
117
- :host {
118
- all: initial;
119
- display: block;
120
- position: fixed;
121
- top: 0;
122
- left: 0;
123
- width: 0;
124
- height: 0;
125
- z-index: 2147483647;
126
- pointer-events: none;
127
- overflow-x: hidden;
128
- }
129
-
130
- /* Allow pointer events on actual widget elements */
131
- #deskcord-shadow-container,
132
- #deskcord-shadow-container * {
133
- pointer-events: auto;
134
- }
135
-
136
- /* Ensure box-sizing is consistent */
137
- *, *::before, *::after {
138
- box-sizing: border-box;
139
- }
140
-
141
- /* Prevent text selection issues */
142
- * {
143
- -webkit-font-smoothing: antialiased;
144
- -moz-osx-font-smoothing: grayscale;
145
- }
146
- `,o.insertBefore(d,o.firstChild)),n(o),i(s),()=>{}},[]),w(tt,{children:[w("div",{ref:t,id:"deskcord-shadow-host",style:{position:"fixed",top:0,left:0,width:0,height:0,overflow:"visible",zIndex:2147483647,pointerEvents:"none"}}),e&&r&&ke.createPortal(w(gb,{value:e,children:w(pb,{})}),r)]})},df=ke.createContext(null),gb=({value:t,children:e})=>w(df.Provider,{value:t,children:e});window.deskcord?(window.deskcord.openChatbox=()=>{z.getState().setChatOpen(!0)},window.deskcord.identify=ef,window.deskcord.logout=()=>{L_()},O_(It.user)):window.deskcord={settings:{app_id:""},openChatbox:()=>{}};let cr=document.getElementById("deskcord-root");cr||(cr=document.createElement("div"),cr.id="deskcord-root",document.body.appendChild(cr)),ke.render(w(ke.StrictMode,{children:w(mb,{})}),cr)})();
1
+ (function(){"use strict";var Ue,I,Zt,ce,Gt,Qt,at,en,ct,lt,dt,tn,Ee={},nn=[],Zr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ut=Array.isArray;function ie(t,e){for(var n in e)t[n]=e[n];return t}function pt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Gr(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Ue.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return ze(t,a,r,i,null)}function ze(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Zt,__i:-1,__u:0};return i==null&&I.vnode!=null&&I.vnode(o),o}function B(t){return t.children}function Be(t,e){this.props=t,this.context=e}function ge(t,e){if(e==null)return t.__?ge(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?ge(t):null}function rn(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return rn(t)}}function ft(t){(!t.__d&&(t.__d=!0)&&ce.push(t)&&!Pe.__r++||Gt!==I.debounceRendering)&&((Gt=I.debounceRendering)||Qt)(Pe)}function Pe(){var t,e,n,r,i,o,a,c;for(ce.sort(at);t=ce.shift();)t.__d&&(e=ce.length,r=void 0,o=(i=(n=t).__v).__e,a=[],c=[],n.__P&&((r=ie({},i)).__v=i.__v+1,I.vnode&&I.vnode(r),ht(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[o]:null,a,o??ge(i),!!(32&i.__u),c),r.__v=i.__v,r.__.__k[r.__i]=r,ln(a,r,c),r.__e!=o&&rn(r)),ce.length>e&&ce.sort(at));Pe.__r=0}function on(t,e,n,r,i,o,a,c,u,p,v){var d,g,x,w,_,C,b=r&&r.__k||nn,k=e.length;for(u=Qr(n,e,b,u,k),d=0;d<k;d++)(x=n.__k[d])!=null&&(g=x.__i===-1?Ee:b[x.__i]||Ee,x.__i=d,C=ht(t,x,g,i,o,a,c,u,p,v),w=x.__e,x.ref&&g.ref!=x.ref&&(g.ref&&gt(g.ref,null,x),v.push(x.ref,x.__c||w,x)),_==null&&w!=null&&(_=w),4&x.__u||g.__k===x.__k?u=sn(x,u,t):typeof x.type=="function"&&C!==void 0?u=C:w&&(u=w.nextSibling),x.__u&=-7);return n.__e=_,u}function Qr(t,e,n,r,i){var o,a,c,u,p,v=n.length,d=v,g=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+g,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?ze(null,a,null,null,null):ut(a)?ze(B,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?ze(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,c=null,(p=a.__i=ei(a,n,u,d))!==-1&&(d--,(c=n[p])&&(c.__u|=2)),c==null||c.__v===null?(p==-1&&g--,typeof a.type!="function"&&(a.__u|=4)):p!=u&&(p==u-1?g--:p==u+1?g++:(p>u?g--:g++,a.__u|=4))):t.__k[o]=null;if(d)for(o=0;o<v;o++)(c=n[o])!=null&&!(2&c.__u)&&(c.__e==r&&(r=ge(c)),dn(c,c));return r}function sn(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=sn(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=ge(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ei(t,e,n,r){var i,o,a=t.key,c=t.type,u=e[n];if(u===null||u&&a==u.key&&c===u.type&&!(2&u.__u))return n;if(r>(u!=null&&!(2&u.__u)?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((u=e[i])&&!(2&u.__u)&&a==u.key&&c===u.type)return i;i--}if(o<e.length){if((u=e[o])&&!(2&u.__u)&&a==u.key&&c===u.type)return o;o++}}return-1}function an(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Zr.test(e)?n:n+"px"}function Fe(t,e,n,r,i){var o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||an(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||an(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(en,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=ct,t.addEventListener(e,o?dt:lt,o)):t.removeEventListener(e,o?dt:lt,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function cn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=ct++;else if(e.t<n.u)return;return n(I.event?I.event(e):e)}}}function ht(t,e,n,r,i,o,a,c,u,p){var v,d,g,x,w,_,C,b,k,U,F,Y,te,fe,V,K,se,z=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),o=[c=e.__e=n.__e]),(v=I.__b)&&v(e);e:if(typeof z=="function")try{if(b=e.props,k="prototype"in z&&z.prototype.render,U=(v=z.contextType)&&r[v.__c],F=v?U?U.props.value:v.__:r,n.__c?C=(d=e.__c=n.__c).__=d.__E:(k?e.__c=d=new z(b,F):(e.__c=d=new Be(b,F),d.constructor=z,d.render=ni),U&&U.sub(d),d.props=b,d.state||(d.state={}),d.context=F,d.__n=r,g=d.__d=!0,d.__h=[],d._sb=[]),k&&d.__s==null&&(d.__s=d.state),k&&z.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ie({},d.__s)),ie(d.__s,z.getDerivedStateFromProps(b,d.__s))),x=d.props,w=d.state,d.__v=e,g)k&&z.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),k&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(k&&z.getDerivedStateFromProps==null&&b!==x&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,F),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,F)===!1||e.__v==n.__v)){for(e.__v!=n.__v&&(d.props=b,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(E){E&&(E.__=e)}),Y=0;Y<d._sb.length;Y++)d.__h.push(d._sb[Y]);d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,F),k&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(x,w,_)})}if(d.context=F,d.props=b,d.__P=t,d.__e=!1,te=I.__r,fe=0,k){for(d.state=d.__s,d.__d=!1,te&&te(e),v=d.render(d.props,d.state,d.context),V=0;V<d._sb.length;V++)d.__h.push(d._sb[V]);d._sb=[]}else do d.__d=!1,te&&te(e),v=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++fe<25);d.state=d.__s,d.getChildContext!=null&&(r=ie(ie({},r),d.getChildContext())),k&&!g&&d.getSnapshotBeforeUpdate!=null&&(_=d.getSnapshotBeforeUpdate(x,w)),c=on(t,ut(K=v!=null&&v.type===B&&v.key==null?v.props.children:v)?K:[K],e,n,r,i,o,a,c,u,p),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),C&&(d.__E=d.__=null)}catch(E){if(e.__v=null,u||o!=null)if(E.then){for(e.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,e.__e=c}else for(se=o.length;se--;)pt(o[se]);else e.__e=n.__e,e.__k=n.__k;I.__e(E,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=ti(n.__e,e,n,r,i,o,a,u,p);return(v=I.diffed)&&v(e),128&e.__u?void 0:c}function ln(t,e,n){for(var r=0;r<n.length;r++)gt(n[r],n[++r],n[++r]);I.__c&&I.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){I.__e(o,i.__v)}})}function ti(t,e,n,r,i,o,a,c,u){var p,v,d,g,x,w,_,C=n.props,b=e.props,k=e.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p<o.length;p++)if((x=o[p])&&"setAttribute"in x==!!k&&(k?x.localName==k:x.nodeType==3)){t=x,o[p]=null;break}}if(t==null){if(k==null)return document.createTextNode(b);t=document.createElementNS(i,k,b.is&&b),c&&(I.__m&&I.__m(e,o),c=!1),o=null}if(k===null)C===b||c&&t.data===b||(t.data=b);else{if(o=o&&Ue.call(t.childNodes),C=n.props||Ee,!c&&o!=null)for(C={},p=0;p<t.attributes.length;p++)C[(x=t.attributes[p]).name]=x.value;for(p in C)if(x=C[p],p!="children"){if(p=="dangerouslySetInnerHTML")d=x;else if(!(p in b)){if(p=="value"&&"defaultValue"in b||p=="checked"&&"defaultChecked"in b)continue;Fe(t,p,null,x,i)}}for(p in b)x=b[p],p=="children"?g=x:p=="dangerouslySetInnerHTML"?v=x:p=="value"?w=x:p=="checked"?_=x:c&&typeof x!="function"||C[p]===x||Fe(t,p,x,C[p],i);if(v)c||d&&(v.__html===d.__html||v.__html===t.innerHTML)||(t.innerHTML=v.__html),e.__k=[];else if(d&&(t.innerHTML=""),on(t,ut(g)?g:[g],e,n,r,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&ge(n,0),c,u),o!=null)for(p=o.length;p--;)pt(o[p]);c||(p="value",k=="progress"&&w==null?t.removeAttribute("value"):w!==void 0&&(w!==t[p]||k=="progress"&&!w||k=="option"&&w!==C[p])&&Fe(t,p,w,C[p],i),p="checked",_!==void 0&&_!==t[p]&&Fe(t,p,_,C[p],i))}return t}function gt(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){I.__e(i,n)}}function dn(t,e,n){var r,i;if(I.unmount&&I.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||gt(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){I.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&dn(r[i],e,n||typeof t.type!="function");n||pt(t.__e),t.__c=t.__=t.__e=void 0}function ni(t,e,n){return this.constructor(t,n)}function ri(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),I.__&&I.__(t,e),i=(r=typeof n=="function")?null:e.__k,o=[],a=[],ht(e,t=(!r&&n||e).__k=Gr(B,null,[t]),i||Ee,Ee,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?Ue.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r,a),ln(o,t,a)}function un(t,e){var n={__c:e="__cC"+tn++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=new Set,(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.forEach(function(c){c.__e=!0,ft(c)})},this.sub=function(a){i.add(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i&&i.delete(a),c&&c.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Ue=nn.slice,I={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(c){t=c}throw t}},Zt=0,Be.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ie({},this.state),typeof t=="function"&&(t=t(ie({},n),this.props)),t&&ie(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ft(this))},Be.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ft(this))},Be.prototype.render=B,ce=[],Qt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,at=function(t,e){return t.__v.__b-e.__v.__b},Pe.__r=0,en=/(PointerCapture)$|Capture$/i,ct=0,lt=cn(!1),dt=cn(!0),tn=0;var ii=0;function s(t,e,n,r,i,o){e||(e={});var a,c,u=e;if("ref"in u)for(c in u={},e)c=="ref"?a=e[c]:u[c]=e[c];var p={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ii,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(c in a)u[c]===void 0&&(u[c]=a[c]);return I.vnode&&I.vnode(p),p}const oi=':host{all:initial}.dc{--dc-accent: #5865f2;--dc-accent-2: #4a55cc;--dc-on-accent: #fff;--dc-on-grad: #fff;--dc-accent-soft: rgba(88,101,242,.14);--dc-accent-text: #4a55cc;--w-bg: #ffffff;--w-raised: #ffffff;--w-sunken: #f2f3f7;--w-bubble: #f0f1f5;--w-line: rgba(18,22,33,.08);--w-line-strong: rgba(18,22,33,.15);--w-fg: #14171f;--w-fg-2: #3b404c;--w-muted: #6a7080;--w-faint: #9499a5;--w-online: #23a55a;--w-idle: #f0b232;--w-dnd: #f23f43;--w-offline: #80848e;--w-danger: #e5484d;--w-success: #1f9d55;--w-warn: #c98a0c;--w-badge: #f23f43;--w-shadow: 0 1px 2px rgba(16,20,30,.06), 0 10px 28px -8px rgba(16,20,30,.18), 0 30px 70px -18px rgba(16,20,30,.28);--w-card-shadow: 0 1px 2px rgba(16,20,30,.05), 0 6px 18px -10px rgba(16,20,30,.2);--ease-out: cubic-bezier(.22,1,.36,1);--ease-spring: cubic-bezier(.34,1.45,.64,1);--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--edge: 20px;position:fixed;inset:0;z-index:2147483000;pointer-events:none;font-family:var(--font);color:var(--w-fg);font-size:14px;line-height:1.4;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color-scheme:light}.dc[data-theme=dark]{--w-bg: #232428;--w-raised: #2b2d31;--w-sunken: #1c1d21;--w-bubble: #34363c;--w-line: rgba(255,255,255,.07);--w-line-strong: rgba(255,255,255,.13);--w-fg: #f2f3f5;--w-fg-2: #d5d7dc;--w-muted: #a4a8b2;--w-faint: #7d828d;--w-shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 34px -8px rgba(0,0,0,.55), 0 30px 80px -18px rgba(0,0,0,.6);--w-card-shadow: 0 1px 2px rgba(0,0,0,.25);color-scheme:dark}.dc *,.dc *:before,.dc *:after{box-sizing:border-box}:where(.dc) button{font:inherit;color:inherit;margin:0}:where(.dc) :is(p,h1,h2,h3,h4,ul,ol,form){margin:0;padding:0}.dc :focus-visible{outline:2px solid var(--dc-accent);outline-offset:2px}.dc [hidden]{display:none!important}.dc svg{display:block;flex:none}.dc img{max-width:100%}.dc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.dc-launcher{pointer-events:auto;position:absolute;bottom:calc(var(--edge) + env(safe-area-inset-bottom,0px));right:var(--edge);width:56px;height:56px;border-radius:50%;border:0;padding:0;cursor:pointer;background:linear-gradient(145deg,var(--dc-accent) 0%,var(--dc-accent-2) 100%);color:var(--dc-on-grad);box-shadow:0 2px 4px #10141e1f,0 10px 26px -6px color-mix(in srgb,var(--dc-accent) 60%,transparent);transition:transform .35s var(--ease-spring),opacity .2s}.dc[data-pos=left] .dc-launcher{right:auto;left:var(--edge)}.dc-launcher:hover{transform:translateY(-2px) scale(1.04)}.dc-launcher:active{transform:scale(.93);transition-duration:.1s}.dc-launcher .ic{position:absolute;inset:0;display:grid;place-items:center;transition:transform .4s var(--ease-spring),opacity .2s}.dc-launcher .ic-close{opacity:0;transform:rotate(-90deg) scale(.6)}.dc-launcher.is-open .ic-chat{opacity:0;transform:rotate(90deg) scale(.6)}.dc-launcher.is-open .ic-close{opacity:1;transform:none}.dc-launcher.has-unread:after{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid var(--dc-accent);animation:dc-halo 2.4s var(--ease-out) infinite;pointer-events:none}@keyframes dc-halo{0%{transform:scale(1);opacity:.7}70%,to{transform:scale(1.55);opacity:0}}.dc-badge{position:absolute;top:-3px;right:-3px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--w-badge);color:#fff;font:700 12px/22px var(--font);text-align:center;font-variant-numeric:tabular-nums;box-shadow:0 0 0 2.5px #fff}.dc-preview{pointer-events:auto;position:absolute;right:var(--edge);bottom:calc(var(--edge) + 70px + env(safe-area-inset-bottom,0px));width:300px;max-width:calc(100% - 2 * var(--edge));background:var(--w-raised);color:var(--w-fg);border:1px solid var(--w-line);border-radius:18px 18px 6px;padding:12px 14px;box-shadow:var(--w-shadow);cursor:pointer;display:grid;grid-template-columns:34px 1fr;gap:10px;transform-origin:bottom right}.dc[data-pos=left] .dc-preview{right:auto;left:var(--edge);border-radius:18px 18px 18px 6px;transform-origin:bottom left}.dc-preview .who{font-size:12.5px;color:var(--w-muted);margin-bottom:2px}.dc-preview .who b{color:var(--w-fg);font-weight:600}.dc-preview .txt{font-size:14px;color:var(--w-fg-2);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.dc-preview .x{position:absolute;top:-8px;right:-8px;width:24px;height:24px;border-radius:50%;border:0;background:var(--w-fg);color:var(--w-bg);display:grid;place-items:center;cursor:pointer;opacity:0;transition:opacity .15s;padding:0}.dc-preview:hover .x,.dc-preview:focus-within .x{opacity:1}@media (hover: none){.dc-preview .x{opacity:1}}.dc-panel{pointer-events:auto;position:absolute;right:var(--edge);bottom:calc(var(--edge) + 70px + env(safe-area-inset-bottom,0px));width:384px;height:min(680px,calc(100% - 110px));max-width:calc(100% - 2 * var(--edge));background:var(--w-bg);border-radius:22px;box-shadow:var(--w-shadow);border:1px solid var(--w-line);overflow:hidden;display:flex;flex-direction:column;transform-origin:bottom right}.dc[data-pos=left] .dc-panel{right:auto;left:var(--edge);transform-origin:bottom left}.dc[data-theme=dark] .dc-panel{border:0}.dc-views{position:relative;flex:1;min-height:0}.dc-view{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--w-bg)}.dc-head{background:linear-gradient(160deg,var(--dc-accent) 0%,var(--dc-accent-2) 100%);color:var(--dc-on-grad);position:relative;flex:none;isolation:isolate}.dc-head:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(120% 90% at 100% 0%,rgba(255,255,255,.22),transparent 55%),radial-gradient(80% 60% at 0% 100%,rgba(0,0,0,.12),transparent 60%)}.dc[data-flat] .dc-head:before{display:none}.dc-hbtn{width:34px;height:34px;border-radius:10px;border:0;background:transparent;display:grid;place-items:center;cursor:pointer;color:inherit;flex:none;padding:0;transition:background .15s,transform .2s var(--ease-spring)}.dc-hbtn:hover{background:color-mix(in srgb,currentColor 16%,transparent)}.dc-hbtn:active{transform:scale(.9)}.dc-hbtn .ic-down{display:none}.dc-head--compact{display:flex;align-items:center;gap:6px;padding:12px 10px;min-height:66px}.dc-head-id{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding-left:4px}.dc-head-id .tx{min-width:0}.dc-head-id .t{font-weight:650;font-size:15.5px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dc-head-id .s{font-size:12.5px;opacity:.85;display:flex;align-items:center;gap:6px;white-space:nowrap;overflow:hidden;margin-top:1px}.dc-head-id .s span:last-child{overflow:hidden;text-overflow:ellipsis}.dc-head-id .mini{display:flex;flex:none}.dc-head-id .mini .dc-av{margin-left:-5px;box-shadow:0 0 0 1.5px var(--dc-accent)}.dc-head-id .mini .dc-av:first-child{margin-left:0}.dc-av{--s: 28px;width:var(--s);height:var(--s);border-radius:50%;flex:none;position:relative;display:grid;place-items:center;font:650 calc(var(--s) * .4) / 1 var(--font);color:#fff;letter-spacing:-.02em;background:linear-gradient(140deg,hsl(var(--h, 230) 72% 64%),hsl(calc(var(--h, 230) + 28) 62% 46%))}.dc-av img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}.dc-av .dot{position:absolute;right:-2px;bottom:-2px;width:calc(var(--s) * .34);height:calc(var(--s) * .34);min-width:9px;min-height:9px;border-radius:50%;box-shadow:0 0 0 2.5px var(--ring, var(--w-bg))}.dot.online{background:var(--w-online)}.dot.idle{background:var(--w-idle)}.dot.dnd{background:var(--w-dnd)}.dot.offline,.dot.invisible{background:var(--w-offline)}.dc-head .dc-av .dot{--ring: var(--dc-accent-2)}.dc-guild{--s: 36px;width:var(--s);height:var(--s);border-radius:calc(var(--s) * .3);background:var(--dc-accent-2);color:var(--dc-on-grad);display:grid;place-items:center;flex:none;position:relative;font:700 calc(var(--s) * .42) / 1 var(--font);box-shadow:0 0 0 1px #ffffff24 inset}.dc-guild img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}.dc-guild .dot{position:absolute;right:-3px;bottom:-3px;width:11px;height:11px;border-radius:50%;box-shadow:0 0 0 2.5px var(--ring, var(--dc-accent-2))}.dc-hero{padding:16px 16px 58px}.dc-hero .top{display:flex;align-items:center;justify-content:space-between}.dc-hero h2{font:700 26px/1.12 var(--font);letter-spacing:-.02em;margin:22px 4px 6px;text-wrap:balance;color:inherit}.dc-hero p{margin:0 4px;font-size:14.5px;opacity:.88;line-height:1.45}.dc-team{display:flex;align-items:center;gap:10px;margin:16px 4px 0;font-size:13px}.dc-team .stack{display:flex}.dc-team .stack .dc-av{--s: 30px;margin-left:-8px;box-shadow:0 0 0 2px var(--dc-accent-2)}.dc-team .stack .dc-av:first-child{margin-left:0}.dc-team .stack .dc-av .dot{--ring: var(--dc-accent-2)}.dc-home-body{flex:1;min-height:0;overflow-y:auto;margin-top:-40px;padding:0 12px 12px;display:flex;flex-direction:column;gap:10px;position:relative;scrollbar-width:thin}.dc-card{background:var(--w-raised);border:1px solid var(--w-line);border-radius:16px;box-shadow:var(--w-card-shadow)}.dc-cta{display:flex;align-items:center;gap:12px;width:100%;padding:14px 14px 14px 16px;text-align:left;cursor:pointer;color:var(--w-fg);transition:transform .25s var(--ease-spring),box-shadow .2s}.dc-cta:hover{transform:translateY(-1px);box-shadow:var(--w-shadow)}.dc-cta .tx{flex:1;min-width:0}.dc-cta b{display:block;font-size:15px;font-weight:650}.dc-cta small{display:block;font-size:13px;color:var(--w-muted);margin-top:2px}.dc-cta .go{width:36px;height:36px;border-radius:50%;background:var(--dc-accent);color:var(--dc-on-accent);display:grid;place-items:center;flex:none;transition:transform .3s var(--ease-spring)}.dc-cta:hover .go{transform:translate(3px)}.dc-eyebrow{font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--w-faint);padding:12px 16px 2px}.dc-list{padding:4px}.dc-conv{display:flex;gap:12px;align-items:center;width:100%;padding:12px 14px 12px 12px;border:0;background:transparent;text-align:left;cursor:pointer;border-radius:12px;color:var(--w-fg);position:relative;transition:background .15s}.dc-conv:hover{background:var(--w-sunken)}.dc-conv .tx{flex:1;min-width:0}.dc-conv .l1{display:flex;gap:8px;align-items:baseline}.dc-conv .l1 b{font-size:14px;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dc-conv .l1 time{font-size:12px;color:var(--w-faint);flex:none}.dc-conv .l2{display:block;font-size:13px;color:var(--w-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.dc-conv.is-unread .l2{color:var(--w-fg);font-weight:550}.dc-conv .count{background:var(--w-badge);color:#fff;font:700 11px/20px var(--font);min-width:20px;height:20px;border-radius:10px;text-align:center;padding:0 6px;flex:none}.dc-conv .chev{color:var(--w-faint);flex:none}.dc-list .dc-conv+.dc-conv:before{content:"";position:absolute;left:64px;right:14px;top:0;height:1px;background:var(--w-line)}.dc-pill{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;background:var(--w-sunken);color:var(--w-muted);margin-right:4px;vertical-align:1px}.dc-pill.ok{color:var(--w-success);background:color-mix(in srgb,var(--w-success) 12%,transparent)}.dc-empty{padding:14px 16px 16px;font-size:13px;color:var(--w-muted)}.dc-empty button{border:0;background:none;padding:0;color:var(--dc-accent-text);font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.dc-skel-row{display:flex;gap:12px;align-items:center;padding:12px}.dc-skel-row i,.dc-skel i{display:block;border-radius:999px;background:linear-gradient(90deg,var(--w-sunken) 0%,var(--w-bubble) 40%,var(--w-sunken) 80%);background-size:300% 100%;animation:dc-shimmer 1.2s linear infinite}.dc-skel-row i:first-child{width:40px;height:40px;flex:none}.dc-skel-row span{flex:1;display:flex;flex-direction:column;gap:7px}.dc-skel-row span i{height:10px;width:60%}.dc-skel-row span i+i{width:85%}@keyframes dc-shimmer{0%{background-position:100% 0}to{background-position:-50% 0}}.dc-conn{overflow:hidden;flex:none;font-size:12.5px;font-weight:550;display:flex;align-items:center;justify-content:center;gap:8px;padding:7px 12px}.dc-conn.is-down{background:color-mix(in srgb,var(--w-warn) 14%,var(--w-bg));color:var(--w-warn)}.dc-conn.is-up{background:color-mix(in srgb,var(--w-success) 13%,var(--w-bg));color:var(--w-success)}.dc-spin{width:13px;height:13px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:dc-rot .8s linear infinite}@keyframes dc-rot{to{transform:rotate(360deg)}}.dc-scroll-wrap{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.dc-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;position:relative;scrollbar-width:thin;scrollbar-color:var(--w-line-strong) transparent;overscroll-behavior:contain}.dc-welcome{padding:34px 28px 10px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px}.dc-welcome .stack{display:flex;margin-bottom:8px}.dc-welcome .stack .dc-av{--s: 44px;margin-left:-12px;box-shadow:0 0 0 3px var(--w-bg)}.dc-welcome .stack .dc-av:first-child{margin-left:0}.dc-welcome .stack .dc-av .dot{--ring: var(--w-bg)}.dc-welcome h3{margin:0;font-size:19px;font-weight:700;letter-spacing:-.015em;text-wrap:balance;color:var(--w-fg)}.dc-welcome p{margin:0;font-size:13.5px;color:var(--w-muted);max-width:30ch;line-height:1.5;text-wrap:balance}.dc-msgs{display:flex;flex-direction:column;padding:6px 14px}.dc-day{display:flex;align-items:center;gap:10px;font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--w-faint);margin:16px 6px 2px}.dc-day:before,.dc-day:after{content:"";flex:1;height:1px;background:var(--w-line)}.dc-row{display:flex;gap:8px;align-items:flex-end;margin-top:2px}.dc-row.is-first{margin-top:12px}.dc-row--me{justify-content:flex-end}.dc-row.is-deleted{animation:dc-collapse .38s var(--ease-out) forwards;overflow:hidden}@keyframes dc-collapse{0%{max-height:600px;opacity:1}to{max-height:0;opacity:0;margin-top:0;transform:scale(.96)}}.dc-row-av{width:28px;flex:none;visibility:hidden}.dc-row.is-last .dc-row-av{visibility:visible}.dc-stack{display:flex;flex-direction:column;gap:3px;max-width:80%;min-width:0;align-items:flex-start}.dc-row--me .dc-stack{align-items:flex-end}.dc-name{display:none;font-size:12px;color:var(--w-muted);margin:0 0 1px 4px}.dc-name b{color:var(--w-fg-2);font-weight:600;margin-right:4px}.dc-row.is-first .dc-name{display:block}.dc-bubble{padding:8px 13px 9px;font-size:14.5px;line-height:1.42;overflow-wrap:anywhere;background:var(--w-bubble);color:var(--w-fg);border-radius:6px 18px 18px 6px;max-width:100%;white-space:normal;transition:background .6s}.dc-row--agent.is-first .dc-bubble{border-top-left-radius:18px}.dc-row--agent.is-last .dc-bubble{border-bottom-left-radius:18px}.dc-row--me .dc-bubble{background:var(--dc-accent);color:var(--dc-on-accent);border-radius:18px 6px 6px 18px}.dc-row--me.is-first .dc-bubble{border-top-right-radius:18px}.dc-row--me.is-last .dc-bubble{border-bottom-right-radius:18px}.dc-row.is-pending .dc-bubble,.dc-row.is-pending .dc-img,.dc-row.is-pending .dc-file{opacity:.62}.dc-bubble a{color:var(--dc-accent-text);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.dc-row--me .dc-bubble a{color:inherit}.dc-bubble code{font:12.5px/1.4 var(--mono);background:color-mix(in srgb,currentColor 11%,transparent);padding:1px 5px;border-radius:5px}.dc-bubble pre{margin:6px 0 2px;padding:9px 11px;border-radius:9px;background:color-mix(in srgb,currentColor 8%,transparent);overflow-x:auto;white-space:pre}.dc-bubble pre code{background:none;padding:0;font-size:12px}.dc-bubble strong{font-weight:650}.dc-bubble .dc-quote{display:inline-block;border-left:3px solid color-mix(in srgb,currentColor 30%,transparent);padding-left:8px}.dc-cemoji{width:20px;height:20px;vertical-align:-5px;display:inline-block;object-fit:contain}.dc-bubble.is-jumbo{background:none!important;padding:0 2px;font-size:40px;line-height:1.15}.dc-bubble.is-jumbo .dc-cemoji{width:46px;height:46px}.dc-spoiler{background:var(--w-fg);color:transparent;border-radius:4px;cursor:pointer;transition:background .25s,color .25s;padding:0 2px}.dc-row--me .dc-spoiler{background:var(--dc-on-accent)}.dc-spoiler.is-shown{background:color-mix(in srgb,currentColor 12%,transparent)!important;color:inherit;cursor:auto}.dc-edited{font-size:11px;color:var(--w-faint);margin-left:4px}.dc-row--me .dc-edited{color:inherit;opacity:.7}.dc-bubble.is-flash{background:color-mix(in srgb,var(--dc-accent) 22%,var(--w-bubble));transition:none}.dc-status{display:none;align-items:center;gap:4px;font-size:11.5px;color:var(--w-faint);margin:1px 4px 0}.dc-row.show-status .dc-status,.dc-status.is-failed,.dc-status.is-pending{display:flex}.dc-status.is-failed{color:var(--w-danger)}.dc-status button{border:0;background:none;padding:0;color:inherit;font-weight:650;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.dc-event{align-self:center;display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--w-muted);margin:14px 0 4px;padding:5px 12px 5px 6px;border-radius:999px;background:var(--w-sunken);max-width:92%}.dc-event .dc-av{--s: 20px}.dc-event .ic{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--w-bg);color:var(--w-muted);flex:none}.dc-event.ok .ic{background:var(--w-success);color:#fff}.dc-event b{color:var(--w-fg-2);font-weight:600}.dc-event time{color:var(--w-faint)}.dc-event.note{border-radius:14px;padding:9px 12px;text-align:center;line-height:1.45}.dc-gallery{display:grid;grid-template-columns:1fr 1fr;gap:4px;width:236px;max-width:100%}.dc-img{position:relative;display:block;width:min(var(--w, 232px),232px);max-width:100%;border:0;padding:0;border-radius:14px;overflow:hidden;background:var(--w-sunken);cursor:zoom-in}.dc-gallery .dc-img{width:100%;aspect-ratio:1!important}.dc-img img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .4s var(--ease-out)}.dc-img:hover img{transform:scale(1.035)}.dc-img.is-uploading,.dc-img.is-failed{cursor:default}.dc-img.is-uploading:after{content:"";position:absolute;inset:0;background:#080a106b}.dc-ring{position:absolute;left:50%;top:50%;width:44px;height:44px;margin:-22px 0 0 -22px;z-index:1;transform:rotate(-90deg)}.dc-ring circle{fill:none;stroke-width:3.2}.dc-ring .bg{stroke:#ffffff4d}.dc-ring .fg{stroke:#fff;stroke-linecap:round;stroke-dasharray:100;transition:stroke-dashoffset .25s var(--ease-out)}.dc-img .pct{position:absolute;left:0;right:0;top:50%;z-index:1;margin-top:26px;text-align:center;color:#fff;font:600 11px/1 var(--font);font-variant-numeric:tabular-nums}.dc-img .fail{position:absolute;inset:0;z-index:1;display:grid;place-items:center;align-content:center;gap:6px;background:color-mix(in srgb,var(--w-danger) 62%,rgba(0,0,0,.4));color:#fff;font-size:12.5px;font-weight:650}.dc-file{position:relative;display:flex;align-items:center;gap:11px;width:248px;max-width:100%;padding:10px;border-radius:14px;background:var(--w-raised);border:1px solid var(--w-line-strong);color:var(--w-fg);text-decoration:none;cursor:pointer;overflow:hidden;text-align:left;transition:transform .25s var(--ease-spring),box-shadow .2s}.dc-file:hover{transform:translateY(-1px);box-shadow:var(--w-card-shadow)}.dc-ftype{width:34px;height:40px;flex:none;position:relative;border-radius:6px;background:#e5484d;color:#fff;font:800 8.5px/1 var(--font);letter-spacing:.04em;display:grid;place-items:end center;padding-bottom:7px;clip-path:polygon(0 0,66% 0,100% 28%,100% 100%,0 100%)}.dc-ftype:after{content:"";position:absolute;top:0;right:0;width:34%;height:28%;background:#fff6;border-bottom-left-radius:4px}.dc-ftype.is-image{background:#3f8cff}.dc-file .tx{flex:1;min-width:0}.dc-file b{display:block;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dc-file small{display:block;font-size:12px;color:var(--w-muted);margin-top:2px;font-variant-numeric:tabular-nums}.dc-file .dl{width:32px;height:32px;border-radius:50%;background:var(--w-sunken);color:var(--w-muted);display:grid;place-items:center;flex:none;transition:background .15s,color .15s}.dc-file:hover .dl{background:var(--dc-accent);color:var(--dc-on-accent)}.dc-file .bar{position:absolute;left:0;bottom:0;height:3px;width:100%;background:var(--w-sunken)}.dc-file .bar i{display:block;height:100%;background:var(--dc-accent);transition:width .25s var(--ease-out);border-radius:0 2px 2px 0}.dc-file.is-failed{border-color:color-mix(in srgb,var(--w-danger) 50%,transparent)}.dc-file.is-failed small{color:var(--w-danger)}.dc-inline-img{display:block;max-width:232px;max-height:232px;border-radius:14px}.dc-skel{display:flex;flex-direction:column;gap:10px;padding:18px 14px}.dc-skel i{height:34px;border-radius:16px}.dc-skel i:nth-child(odd){width:62%}.dc-skel i:nth-child(2n){width:48%;align-self:flex-end}.dc-skel i:nth-child(3){width:70%;height:52px}.dc-intro{align-self:stretch;display:flex;gap:8px;align-items:flex-end;margin-top:12px}.dc-intro .card{flex:1;min-width:0;background:var(--w-raised);border:1px solid var(--w-line-strong);border-radius:18px 18px 18px 6px;padding:14px;box-shadow:var(--w-card-shadow)}.dc-intro h4{margin:0 0 3px;font-size:14.5px;font-weight:650;color:var(--w-fg)}.dc-intro p{margin:0 0 12px;font-size:13px;color:var(--w-muted);line-height:1.45}.dc-intro form{display:flex;flex-direction:column;gap:8px}.dc-in{display:flex;flex-direction:column;gap:4px}.dc-in span{font-size:12px;font-weight:600;color:var(--w-fg-2)}.dc-in input{font:16px/1.3 var(--font);color:var(--w-fg);background:var(--w-bg);border:1px solid var(--w-line-strong);border-radius:11px;padding:9px 11px;outline:0;width:100%;transition:border-color .15s,box-shadow .15s}@media (pointer: fine){.dc-in input{font-size:14.5px}}.dc-in input:focus{border-color:var(--dc-accent);box-shadow:0 0 0 4px var(--dc-accent-soft)}.dc-in input:focus-visible{outline:none}.dc-in.is-err input{border-color:var(--w-danger)}.dc-in em{font-style:normal;font-size:12px;color:var(--w-danger)}.dc-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:12px;padding:10px 14px;font-weight:650;font-size:14px;background:var(--dc-accent);color:var(--dc-on-accent);cursor:pointer;transition:transform .25s var(--ease-spring),filter .15s}.dc-btn:hover{filter:brightness(1.06)}.dc-btn:active{transform:scale(.96)}.dc-intro .done{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--w-muted)}.dc-intro .done .ok{width:20px;height:20px;border-radius:50%;background:var(--w-success);color:#fff;display:grid;place-items:center;flex:none}.dc-intro .done b{color:var(--w-fg);font-weight:600}.dc-shake{animation:dc-shake .4s}@keyframes dc-shake{20%{transform:translate(-5px)}40%{transform:translate(5px)}60%{transform:translate(-3px)}80%{transform:translate(2px)}}.dc-typing{display:flex;gap:8px;align-items:flex-end;padding:2px 14px 8px}.dc-typing .dots{display:flex;gap:4px;padding:13px 14px;background:var(--w-bubble);border-radius:18px 18px 18px 6px}.dc-typing .dots i{width:7px;height:7px;border-radius:50%;background:var(--w-muted);animation:dc-bounce 1.1s infinite var(--ease-out)}.dc-typing .dots i:nth-child(2){animation-delay:.14s}.dc-typing .dots i:nth-child(3){animation-delay:.28s}@keyframes dc-bounce{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}.dc-jump{position:absolute;left:50%;bottom:10px;transform:translate(-50%);z-index:2;display:flex;align-items:center;gap:6px;border:0;border-radius:999px;padding:7px 12px 7px 10px;font-size:12.5px;font-weight:600;background:var(--w-fg);color:var(--w-bg);box-shadow:var(--w-card-shadow);cursor:pointer}.dc-composer{flex:none;padding:6px 12px calc(8px + env(safe-area-inset-bottom,0px));position:relative;background:var(--w-bg)}.dc-field{border:1px solid var(--w-line-strong);background:var(--w-raised);border-radius:22px;transition:border-color .2s,box-shadow .2s}.dc-field:focus-within{border-color:color-mix(in srgb,var(--dc-accent) 70%,transparent);box-shadow:0 0 0 4px var(--dc-accent-soft)}.dc-tray{display:flex;gap:10px;padding:12px 12px 2px;overflow-x:auto;scrollbar-width:none}.dc-chip{position:relative;flex:none;height:58px;border-radius:13px;background:var(--w-sunken);border:1px solid var(--w-line)}.dc-chip.img{width:58px}.dc-chip.img img{width:100%;height:100%;object-fit:cover;border-radius:12px;display:block}.dc-chip.file{display:flex;align-items:center;gap:9px;padding:0 30px 0 10px;max-width:200px}.dc-chip.file .dc-ftype{width:28px;height:33px;padding-bottom:5px;font-size:7.5px}.dc-chip.file .tx{min-width:0}.dc-chip.file b{display:block;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--w-fg)}.dc-chip.file small{font-size:11.5px;color:var(--w-muted)}.dc-chip .rm{position:absolute;top:-7px;right:-7px;width:22px;height:22px;border-radius:50%;border:2px solid var(--w-raised);background:var(--w-fg);color:var(--w-bg);display:grid;place-items:center;cursor:pointer;padding:0;transition:transform .2s var(--ease-spring)}.dc-chip .rm:hover{transform:scale(1.12)}.dc-input-row{display:flex;align-items:flex-end;gap:2px;padding:5px 5px 5px 15px}.dc-input-row textarea{flex:1;min-width:0;border:0;outline:0;resize:none;background:transparent;color:var(--w-fg);font:16px/1.4 var(--font);padding:7px 0;height:37px;max-height:128px;margin:0}@media (pointer: fine){.dc-input-row textarea{font-size:15px;height:35px}}.dc-input-row textarea::placeholder{color:var(--w-faint)}.dc-input-row textarea:focus-visible{outline:none}.dc-tool{width:34px;height:34px;border-radius:50%;border:0;background:transparent;color:var(--w-muted);display:grid;place-items:center;cursor:pointer;flex:none;padding:0;transition:background .15s,color .15s,transform .2s var(--ease-spring)}.dc-tool:hover{background:var(--w-sunken);color:var(--w-fg)}.dc-tool:active{transform:scale(.9)}.dc-tool[aria-expanded=true]{color:var(--dc-accent-text);background:var(--dc-accent-soft)}.dc-send{width:34px;height:34px;border-radius:50%;border:0;display:grid;place-items:center;flex:none;cursor:pointer;margin-left:2px;padding:0;background:var(--dc-accent);color:var(--dc-on-accent);transition:transform .35s var(--ease-spring),background .2s,color .2s,box-shadow .2s;box-shadow:0 4px 12px -4px color-mix(in srgb,var(--dc-accent) 70%,transparent)}.dc-send:disabled{background:var(--w-sunken);color:var(--w-faint);transform:scale(.86);cursor:default;box-shadow:none}.dc-send:not(:disabled):hover{transform:scale(1.07)}.dc-send:not(:disabled):active{transform:scale(.92)}.dc-powered{display:flex;justify-content:center;align-items:center;gap:5px;margin-top:7px;font-size:11px;color:var(--w-faint);text-decoration:none;transition:color .15s}.dc-powered svg{height:9px;width:auto}.dc-powered:hover{color:var(--w-fg-2)}.dc-toast{position:absolute;left:12px;right:12px;bottom:calc(100% + 4px);display:flex;justify-content:center;pointer-events:none;z-index:3}.dc-toast span{display:flex;align-items:center;gap:7px;background:var(--w-fg);color:var(--w-bg);font-size:12.5px;font-weight:550;padding:8px 12px;border-radius:12px;box-shadow:var(--w-shadow);max-width:100%}.dc-toast span svg{color:#ff8b8e}.dc-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px 8px 2px;text-align:center}.dc-resolved p{margin:0;font-size:13px;color:var(--w-muted)}.dc-emoji{position:absolute;right:12px;bottom:calc(100% - 2px);width:300px;max-width:calc(100% - 24px);height:268px;background:var(--w-raised);border:1px solid var(--w-line-strong);border-radius:18px;box-shadow:var(--w-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:4;transform-origin:bottom right}.dc-emoji .grid{flex:1;overflow-y:auto;display:grid;grid-template-columns:repeat(8,1fr);padding:8px;gap:2px;align-content:start;scrollbar-width:thin}.dc-emoji .grid button{border:0;background:transparent;font-size:22px;line-height:1;height:34px;border-radius:9px;cursor:pointer;padding:0;transition:background .12s,transform .2s var(--ease-spring)}.dc-emoji .grid button:hover{background:var(--w-sunken);transform:scale(1.18)}.dc-emoji .tabs{display:flex;border-top:1px solid var(--w-line);padding:4px;gap:2px}.dc-emoji .tabs button{flex:1;border:0;background:transparent;font-size:17px;height:32px;border-radius:9px;cursor:pointer;padding:0;filter:grayscale(1);opacity:.6;transition:filter .15s,opacity .15s,background .15s}.dc-emoji .tabs button[aria-pressed=true]{filter:none;opacity:1;background:var(--w-sunken)}.dc-emoji .cat{grid-column:1 / -1;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--w-faint);padding:6px 4px 4px}.dc-drop{position:absolute;inset:8px;z-index:6;border-radius:18px;display:grid;place-items:center;align-content:center;gap:6px;text-align:center;color:var(--dc-accent-text);background-color:color-mix(in srgb,var(--w-bg) 86%,transparent);backdrop-filter:blur(6px);background-image:linear-gradient(90deg,var(--dc-accent) 50%,transparent 0),linear-gradient(90deg,var(--dc-accent) 50%,transparent 0),linear-gradient(0deg,var(--dc-accent) 50%,transparent 0),linear-gradient(0deg,var(--dc-accent) 50%,transparent 0);background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;background-size:14px 2px,14px 2px,2px 14px,2px 14px;background-position:0 0,0 100%,0 0,100% 0;animation:dc-march .6s linear infinite;pointer-events:none}@keyframes dc-march{to{background-position:14px 0,-14px 100%,0 -14px,100% 14px}}.dc-drop .ic{width:56px;height:56px;border-radius:18px;background:var(--dc-accent);color:var(--dc-on-accent);display:grid;place-items:center;margin:0 auto 6px;animation:dc-float 1.4s ease-in-out infinite}@keyframes dc-float{50%{transform:translateY(-5px)}}.dc-drop b{font-size:16px;color:var(--w-fg)}.dc-drop small{font-size:12.5px;color:var(--w-muted)}.dc-lightbox{pointer-events:auto;position:fixed;inset:0;z-index:20;display:flex;flex-direction:column}.dc-lightbox .bd{position:absolute;inset:0;background:#08090cdb;backdrop-filter:blur(4px)}.dc-lightbox .bar{position:relative;display:flex;align-items:center;gap:10px;padding:calc(12px + env(safe-area-inset-top,0px)) 14px 12px;color:#fff;font-size:13px}.dc-lightbox .bar span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.85}.dc-lightbox .bar a,.dc-lightbox .bar button{color:#fff;border:0;background:#ffffff1f;border-radius:10px;height:34px;padding:0 12px;display:inline-flex;align-items:center;gap:6px;cursor:pointer;text-decoration:none;font-size:13px}.dc-lightbox .bar button.x{width:34px;padding:0;justify-content:center}.dc-lightbox .pic{position:relative;flex:1;min-height:0;display:grid;place-items:center;padding:8px 20px 28px}.dc-lightbox img{max-width:100%;max-height:100%;border-radius:10px;box-shadow:0 30px 80px #00000080;transform-origin:top left}@media (max-width: 520px),(max-height: 540px){.dc-panel{inset:0;width:auto;height:auto;max-width:none;border-radius:0;border:0;padding-top:env(safe-area-inset-top,0px)}.dc-launcher.is-open{opacity:0;pointer-events:none;transform:scale(.6)}.dc-hbtn .ic-x{display:none}.dc-hbtn .ic-down{display:block}}@media (prefers-reduced-motion: reduce){.dc *,.dc *:before,.dc *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}',si="https://api.deskcord.chat";function ai(){const t=window.deskcord?.settings;if(!t?.app_id)return console.error("[Deskcord] window.deskcord.settings.app_id is missing: check the embed snippet."),null;const e=t.theme==="dark"||t.theme==="auto"?t.theme:"light";return{appId:String(t.app_id),domain:(t.domain??si).replace(/\/+$/,""),user:t.user,theme:e}}const ci="DESKCORD_UNAVAILABLE";class me extends Error{constructor(e,n){super(`Request failed (${e})`),this.status=e,this.body=n}}class pn extends Error{constructor(){super("Deskcord is temporarily unavailable")}}class mt extends Error{}function fn(t){if(!t)return null;try{return JSON.parse(t)}catch{return t}}function li(t,e){function n(o,a){if(o===503&&a?.code===ci)throw e(),new pn;if(o<200||o>=300)throw new me(o,a)}async function r(o,a,c,u){const p={};c!==void 0&&(p["Content-Type"]="application/json"),u&&(p.Authorization=`Bearer ${u}`);let v;try{v=await fetch(t+a,{method:o,headers:p,body:c===void 0?void 0:JSON.stringify(c)})}catch(g){throw new mt(String(g))}const d=fn(await v.text());return n(v.status,d),d}function i(o,a,c,u){return new Promise((p,v)=>{const d=new XMLHttpRequest;d.open("POST",t+o),d.setRequestHeader("Authorization",`Bearer ${c}`),d.upload.onprogress=x=>{x.lengthComputable&&u(x.loaded/x.total)},d.onload=()=>{const x=fn(d.responseText);try{n(d.status,x),p(x)}catch(w){v(w)}},d.onerror=()=>v(new mt("Upload failed"));const g=new FormData;g.append("file",a),d.send(g)})}return{get:(o,a)=>r("GET",o,void 0,a),post:(o,a,c)=>r("POST",o,a,c),upload:i}}const hn=t=>t instanceof me&&t.status===404;function di(t,e){const n=li(t.domain,e),r=t.appId,i=({name:o,email:a,avatarUrl:c})=>({name:o,email:a,...c?{avatarUrl:c}:{}});return{async status(){return!!(await n.get(`/guildSettings/status/${encodeURIComponent(r)}`))?.active},settings(){return n.get(`/guildSettings/${encodeURIComponent(r)}`)},async token(o,a){const c=await n.post("/auth/token",{guildId:r,...i(o)},a);if(!c?.token||c.token==="undefined")throw new Error("No token in /auth/token response");return c.token},async identify(o,a){try{return(await n.post("/auth/identify",{guildId:r,userId:o.userId,userHash:o.userHash,...i(o)},a))?.token??null}catch(c){if(c instanceof me&&c.status<500)return null;throw c}},async current(o){try{return(await n.get("/conversations/current",o))?.currentConversation??null}catch(a){if(hn(a))return null;throw a}},async past(o){try{return(await n.get("/conversations/past",o))?.pastConversations??[]}catch(a){if(hn(a))return[];throw a}},async unreadCount(o){const a=await n.get("/conversations/unread-count",o);return Number(a?.unreadCount)||0},async markRead(o,a){await n.post("/conversations/mark-read",{timestamp:a},o)},send(o,a,c){return n.post("/conversations/sendMessage",{name:a,content:c},o)},upload(o,a,c){return n.upload("/conversations/uploadAttachment",a,o,c)}}}const Q=Object.create(null);Q.open="0",Q.close="1",Q.ping="2",Q.pong="3",Q.message="4",Q.upgrade="5",Q.noop="6";const je=Object.create(null);Object.keys(Q).forEach(t=>{je[Q[t]]=t});const vt={type:"error",data:"parser error"},gn=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",mn=typeof ArrayBuffer=="function",vn=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,yt=({type:t,data:e},n,r)=>gn&&e instanceof Blob?n?r(e):yn(e,r):mn&&(e instanceof ArrayBuffer||vn(e))?n?r(e):yn(new Blob([e]),r):r(Q[t]+(e||"")),yn=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function bn(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let bt;function ui(t,e){if(gn&&t.data instanceof Blob)return t.data.arrayBuffer().then(bn).then(e);if(mn&&(t.data instanceof ArrayBuffer||vn(t.data)))return e(bn(t.data));yt(t,!1,n=>{bt||(bt=new TextEncoder),e(bt.encode(n))})}const xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ae=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<xn.length;t++)Ae[xn.charCodeAt(t)]=t;const pi=t=>{let e=t.length*.75,n=t.length,r,i=0,o,a,c,u;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const p=new ArrayBuffer(e),v=new Uint8Array(p);for(r=0;r<n;r+=4)o=Ae[t.charCodeAt(r)],a=Ae[t.charCodeAt(r+1)],c=Ae[t.charCodeAt(r+2)],u=Ae[t.charCodeAt(r+3)],v[i++]=o<<2|a>>4,v[i++]=(a&15)<<4|c>>2,v[i++]=(c&3)<<6|u&63;return p},fi=typeof ArrayBuffer=="function",xt=(t,e)=>{if(typeof t!="string")return{type:"message",data:wn(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:hi(t.substring(1),e)}:je[n]?t.length>1?{type:je[n],data:t.substring(1)}:{type:je[n]}:vt},hi=(t,e)=>{if(fi){const n=pi(t);return wn(n,e)}else return{base64:!0,data:t}},wn=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},_n="",gi=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,a)=>{yt(o,!1,c=>{r[a]=c,++i===n&&e(r.join(_n))})})},mi=(t,e)=>{const n=t.split(_n),r=[];for(let i=0;i<n.length;i++){const o=xt(n[i],e);if(r.push(o),o.type==="error")break}return r};function vi(){return new TransformStream({transform(t,e){ui(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let wt;function He(t){return t.reduce((e,n)=>e+n.length,0)}function qe(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function yi(t,e){wt||(wt=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(He(n)<1)break;const u=qe(n,1);o=(u[0]&128)===128,i=u[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(He(n)<2)break;const u=qe(n,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(He(n)<8)break;const u=qe(n,8),p=new DataView(u.buffer,u.byteOffset,u.length),v=p.getUint32(0);if(v>Math.pow(2,21)-1){c.enqueue(vt);break}i=v*Math.pow(2,32)+p.getUint32(4),r=3}else{if(He(n)<i)break;const u=qe(n,i);c.enqueue(xt(o?u:wt.decode(u),e)),r=0}if(i===0||i>t){c.enqueue(vt);break}}}})}const kn=4;function D(t){if(t)return bi(t)}function bi(t){for(var e in D.prototype)t[e]=D.prototype[e];return t}D.prototype.on=D.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},D.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},D.prototype.off=D.prototype.removeListener=D.prototype.removeAllListeners=D.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},D.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},D.prototype.emitReserved=D.prototype.emit,D.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},D.prototype.hasListeners=function(t){return!!this.listeners(t).length};const J=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function En(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const xi=J.setTimeout,wi=J.clearTimeout;function Ve(t,e){e.useNativeTimers?(t.setTimeoutFn=xi.bind(J),t.clearTimeoutFn=wi.bind(J)):(t.setTimeoutFn=J.setTimeout.bind(J),t.clearTimeoutFn=J.clearTimeout.bind(J))}const _i=1.33;function ki(t){return typeof t=="string"?Ei(t):Math.ceil((t.byteLength||t.size)*_i)}function Ei(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function Ai(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Ti(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class Si extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class _t extends D{constructor(e){super(),this.writable=!1,Ve(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new Si(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=xt(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Ai(e);return n.length?"?"+n:""}}const An="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kt=64,Ci={};let Tn=0,We=0,Sn;function Cn(t){let e="";do e=An[t%kt]+e,t=Math.floor(t/kt);while(t>0);return e}function In(){const t=Cn(+new Date);return t!==Sn?(Tn=0,Sn=t):t+"."+Cn(Tn++)}for(;We<kt;We++)Ci[An[We]]=We;let Rn=!1;try{Rn=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ii=Rn;function Nn(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Ii))return new XMLHttpRequest}catch{}if(!e)try{return new J[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Gs(){}function Ri(){}const Ni=function(){return new Nn({xdomain:!1}).responseType!=null}();class Oi extends _t{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}const n=e&&e.forceBase64;this.supportsBinary=Ni&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};mi(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,gi(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=In()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ee(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class ee extends D{constructor(e,n){super(),Ve(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.data=n.data!==void 0?n.data:null,this.create()}create(){var e;const n=En(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Nn(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=ee.requestsCount++,ee.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Ri,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ee.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ee.requestsCount=0,ee.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",On);else if(typeof addEventListener=="function"){const t="onpagehide"in J?"pagehide":"unload";addEventListener(t,On,!1)}}function On(){for(let t in ee.requests)ee.requests.hasOwnProperty(t)&&ee.requests[t].abort()}const Et=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Ye=J.WebSocket||J.MozWebSocket,Ln=!0,Li="arraybuffer",$n=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class $i extends _t{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=$n?{}:En(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Ln&&!$n?n?new Ye(e,n):new Ye(e):new Ye(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;yt(r,this.supportsBinary,o=>{const a={};try{Ln&&this.ws.send(o)}catch{}i&&Et(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=In()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}check(){return!!Ye}}class Mi extends _t{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const n=yi(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=vi();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),o())}).catch(c=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this.writer.write(r).then(()=>{i&&Et(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Di={websocket:$i,webtransport:Mi,polling:Oi},Ui=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function At(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=Ui.exec(t||""),o={},a=14;for(;a--;)o[zi[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Bi(o,o.path),o.queryKey=Pi(o,o.query),o}function Bi(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Pi(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let Mn=class ke extends D{constructor(e,n={}){super(),this.binaryType=Li,this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=At(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=At(n.host).host),Ve(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ti(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=kn,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Di[e](r)}open(){let e;if(this.opts.rememberUpgrade&&ke.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;ke.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ke.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(v(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,v(),n.close(),n=null)}const a=d=>{const g=new Error("probe error: "+d);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function c(){a("transport closed")}function u(){a("socket closed")}function p(d){n&&d.name!==n.name&&o()}const v=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",p)};n.once("open",i),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",p),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",ke.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=ki(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){ke.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}};Mn.protocol=kn;function Fi(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=At(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const ji=typeof ArrayBuffer=="function",Hi=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Dn=Object.prototype.toString,qi=typeof Blob=="function"||typeof Blob<"u"&&Dn.call(Blob)==="[object BlobConstructor]",Vi=typeof File=="function"||typeof File<"u"&&Dn.call(File)==="[object FileConstructor]";function Tt(t){return ji&&(t instanceof ArrayBuffer||Hi(t))||qi&&t instanceof Blob||Vi&&t instanceof File}function Ke(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Ke(t[n]))return!0;return!1}if(Tt(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ke(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Ke(t[n]))return!0;return!1}function Wi(t){const e=[],n=t.data,r=t;return r.data=St(n,e),r.attachments=e.length,{packet:r,buffers:e}}function St(t,e){if(!t)return t;if(Tt(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=St(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=St(t[r],e));return n}return t}function Yi(t,e){return t.data=Ct(t.data,e),delete t.attachments,t}function Ct(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Ct(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Ct(t[n],e));return t}const Ki=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Xi=5;var S;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(S||(S={}));class Ji{constructor(e){this.replacer=e}encode(e){return(e.type===S.EVENT||e.type===S.ACK)&&Ke(e)?this.encodeAsBinary({type:e.type===S.EVENT?S.BINARY_EVENT:S.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===S.BINARY_EVENT||e.type===S.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=Wi(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Un(t){return Object.prototype.toString.call(t)==="[object Object]"}class It extends D{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===S.BINARY_EVENT;r||n.type===S.BINARY_ACK?(n.type=r?S.EVENT:S.ACK,this.reconstructor=new Zi(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Tt(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(S[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===S.BINARY_EVENT||r.type===S.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const a=e.substring(o,n);if(a!=Number(a)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=e.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(It.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case S.CONNECT:return Un(n);case S.DISCONNECT:return n===void 0;case S.CONNECT_ERROR:return typeof n=="string"||Un(n);case S.EVENT:case S.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Ki.indexOf(n[0])===-1);case S.ACK:case S.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Zi{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=Yi(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gi=Object.freeze(Object.defineProperty({__proto__:null,Decoder:It,Encoder:Ji,get PacketType(){return S},protocol:Xi},Symbol.toStringTag,{value:"Module"}));function G(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Qi=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class zn extends D{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[G(e,"open",this.onopen.bind(this)),G(e,"packet",this.onpacket.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(Qi.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:S.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,c=n.pop();this._registerAckCallback(a,c),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},i),a=(...c)=>{this.io.clearTimeoutFn(o),n.apply(this,c)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...n){return new Promise((r,i)=>{const o=(a,c)=>a?i(a):r(c);o.withError=!0,n.push(o),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:S.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case S.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case S.EVENT:case S.BINARY_EVENT:this.onevent(e);break;case S.ACK:case S.BINARY_ACK:this.onack(e);break;case S.DISCONNECT:this.ondisconnect();break;case S.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:S.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:S.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function ve(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ve.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},ve.prototype.reset=function(){this.attempts=0},ve.prototype.setMin=function(t){this.ms=t},ve.prototype.setMax=function(t){this.max=t},ve.prototype.setJitter=function(t){this.jitter=t};class Rt extends D{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ve(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new ve({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||Gi;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Mn(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=G(n,"open",function(){r.onopen(),e&&e()}),o=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},a=G(n,"error",o);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(G(e,"ping",this.onping.bind(this)),G(e,"data",this.ondata.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this)),G(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Et(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new zn(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Te={};function Xe(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=Fi(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Te[i]&&o in Te[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let u;return c?u=new Rt(r,e):(Te[i]||(Te[i]=new Rt(r,e)),u=Te[i]),n.query&&!e.query&&(e.query=n.queryKey),u.socket(n.path,e)}Object.assign(Xe,{Manager:Rt,Socket:zn,io:Xe,connect:Xe});const eo=["new-support-message","updated-support-message","deleted-support-message","new-customer-message","thread-closed","thread-reopened","thread-assigned","thread-reassigned","support-typing","presence-updated"];function to(t,e,n){const r=Xe(t,{path:"/socket"});let i=!1,o=0,a;for(const c of eo)r.on(c,u=>n.event(c,u));return r.on("connect",()=>{o=0,r.emit("identify",{jwt:e}),n.status(!0)}),r.on("disconnect",c=>{n.status(!1),c==="io server disconnect"&&!i&&(a=setTimeout(()=>r.connect(),Math.min(3e4,1e3*2**o++)))}),r.on("connect_error",()=>n.status(!1)),r.on("error",c=>{c?.message==="Invalid token"&&n.invalidToken()}),{close(){i=!0,clearTimeout(a),r.removeAllListeners(),r.disconnect()}}}const no="Customer support";function Bn(t){const e=t;return!e?.displayName||e.displayName===no?null:{displayName:e.displayName,displayAvatarURL:e.displayAvatarURL??"",status:e.status??"offline"}}function ro(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)}function Pn(t){return t.id?`id:${t.id}`:`d:${t.date}:${t.support?"s":"c"}:${ro(t.content??"")}:${t.attachments?.length??0}`}function Je(t,e){const n=Pn(t);return{key:e.get(n)??n,sid:n,from:t.support?"agent":"me",authorName:t.authorName??"",text:t.content??"",date:Number(t.date),attachments:Array.isArray(t.attachments)?t.attachments:[],emojis:t.emojis??{}}}const Fn=(t,e)=>t.date-e.date;function jn(t,e){return{threadId:t,status:"open",csMember:null,messages:[],lastMessageDate:e}}function Hn(t,e){const n=new Set,r=[];for(const i of t.messages??[]){if(!Number.isFinite(Number(i?.date)))continue;const o=Je(i,e);n.has(o.sid)||(n.add(o.sid),r.push(o))}return r.sort(Fn),{threadId:t.threadId,status:t.status==="closed"?"closed":"open",csMember:Bn(t.csMember),messages:r,lastMessageDate:r[r.length-1]?.date??(Number(t.lastMessageDate)||Date.now())}}function qn(t,e){const n=t.messages.findIndex(i=>i.sid===e.sid),r=n===-1?[...t.messages,e].sort(Fn):t.messages.map((i,o)=>o===n?{...e,key:i.key}:i);return{...t,messages:r,lastMessageDate:Math.max(t.lastMessageDate,e.date)}}function Vn(t,e,n){if(e){const r=t.messages.find(i=>i.sid===`id:${e}`);if(r)return r}return t.messages.find(r=>r.from==="agent"&&r.date===n)}function Wn(t,e,n){return{...t,messages:t.messages.map(r=>r.sid===e?{...r,...n}:r)}}function io(t,e){return{...t,messages:t.messages.filter(n=>n.sid!==e)}}function Ze(t,e){let n=!1;const r={...t};for(const i of Object.values(t))i.status==="open"&&i.threadId!==e&&(r[i.threadId]={...i,status:"closed"},n=!0);return n?r:t}function Yn(t){return Object.values(t).sort((e,n)=>n.lastMessageDate-e.lastMessageDate)}function Nt(t){return Yn(t).find(e=>e.status==="open")??null}function oo(t){if(!t)return 0;for(let e=t.messages.length-1;e>=0;e--)if(t.messages[e].from==="agent")return t.messages[e].date;return 0}function Kn(t,e){const n=Nt(t);return n?n.messages.filter(r=>r.from==="agent"&&!r.deleted&&r.date>e).length:0}function so(t,e){const n=t.messages.filter(r=>r.from==="agent").map(r=>r.date).sort((r,i)=>i-r);return e<=0?n[0]??0:e>=n.length?0:n[e]}function ao(t){for(let e=t.messages.length-1;e>=0;e--)if(t.messages[e].from==="agent"&&t.messages[e].authorName)return t.messages[e].authorName;return null}function Xn(t){try{const e=localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}function co(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function Ot(t){try{localStorage.removeItem(t)}catch{}}function lo(t){try{const e=document.cookie.split("; ").find(n=>n.startsWith(`${t}=`));return e?decodeURIComponent(e.slice(t.length+1)):null}catch{return null}}function uo(t){try{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`}catch{}}const Jn={name:"",email:"",avatarUrl:"",verifiedUserId:null};function po(){return{boot:"loading",activeAt:null,guild:{},dark:!1,open:!1,view:"chat",nav:0,navPrev:null,activeThreadId:null,identity:Jn,token:null,conversations:{},synced:!1,past:"idle",outbox:[],tray:[],typing:{},connection:"off",lastReadAt:0,events:{},preview:null,lightbox:null,notice:null}}const fo=30,Zn=200,Lt=t=>`deskcord:${t}`,W=t=>typeof t=="string",Se=t=>typeof t=="number"&&Number.isFinite(t);function ho(t){return!t||!W(t.sid)||!W(t.key)||!Se(t.date)?null:{key:t.key,sid:t.sid,from:t.from==="me"?"me":"agent",authorName:W(t.authorName)?t.authorName:"",text:W(t.text)?t.text:"",date:t.date,attachments:Array.isArray(t.attachments)?t.attachments:[],emojis:t.emojis&&typeof t.emojis=="object"?t.emojis:{},...t.edited?{edited:!0}:{}}}function go(t){if(!t||!W(t.threadId)||!t.threadId)return null;const e=(Array.isArray(t.messages)?t.messages:[]).map(ho).filter(n=>!!n).slice(-Zn);return{threadId:t.threadId,status:t.status==="open"?"open":"closed",csMember:t.csMember??null,messages:e,lastMessageDate:Se(t.lastMessageDate)?t.lastMessageDate:e[e.length-1]?.date??0}}function Gn(t){return{name:W(t?.name)?t.name:"",email:W(t?.email)?t.email:"",avatarUrl:W(t?.avatarUrl)?t.avatarUrl:"",verifiedUserId:W(t?.verifiedUserId)?t.verifiedUserId:null}}function mo(){const t=Xn("discord-widget-storage"),e=lo("discord-widget");if(!t&&!e)return null;const n=t?.state??{},r=e||(W(n.token)&&n.token?n.token:null);return Ot("discord-widget-storage"),Ot("deskcord_last_read"),Ot("deskcord_unread_count"),uo("discord-widget"),{token:r,identity:Gn({name:n.username,email:n.email,avatarUrl:n.avatarUrl,verifiedUserId:n.verifiedUserId}),conversations:{},lastReadAt:0,guild:{},activeAt:null,outbox:[]}}function Qn(t){const e=Xn(Lt(t));if(!e||e.v!==1)return mo();const n={};for(const i of Array.isArray(e.conversations)?e.conversations:[]){const o=go(i);o&&(n[o.threadId]=o)}const r=(Array.isArray(e.outbox)?e.outbox:[]).filter(i=>W(i?.localId)&&W(i?.text)&&i.text).map(i=>({localId:i.localId,text:i.text,state:i.state==="held"||i.state==="queued"?i.state:"failed",progress:0,attempts:0,createdAt:Se(i.createdAt)?i.createdAt:Date.now()}));return{token:W(e.token)&&e.token?e.token:null,identity:Gn(e.identity),conversations:n,lastReadAt:Se(e.lastReadAt)?e.lastReadAt:0,guild:e.guild&&typeof e.guild=="object"?e.guild:{},activeAt:Se(e.activeAt)?e.activeAt:null,outbox:r}}function vo(t,e){const n=Object.values(e.conversations).sort((i,o)=>o.lastMessageDate-i.lastMessageDate).slice(0,fo).map(i=>({...i,messages:i.messages.filter(o=>!o.deleted).slice(-Zn)})),r={v:1,token:e.token,identity:e.identity,conversations:n,lastReadAt:e.lastReadAt,guild:e.guild,activeAt:e.activeAt,outbox:e.outbox.filter(i=>!i.file&&i.text).map(({localId:i,text:o,state:a,createdAt:c})=>({localId:i,text:o,state:a,createdAt:c}))};co(Lt(t),r)}var le,L,$t,er,Ge=0,tr=[],M=I,nr=M.__b,rr=M.__r,ir=M.diffed,or=M.__c,sr=M.unmount,ar=M.__;function Ce(t,e){M.__h&&M.__h(L,t,Ge||e),Ge=0;var n=L.__H||(L.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function P(t){return Ge=1,cr(ur,t)}function cr(t,e,n){var r=Ce(le++,2);if(r.t=t,!r.__c&&(r.__=[ur(void 0,e),function(c){var u=r.__N?r.__N[0]:r.__[0],p=r.t(u,c);u!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=L,!L.u)){var i=function(c,u,p){if(!r.__c.__H)return!0;var v=r.__c.__H.__.filter(function(g){return!!g.__c});if(v.every(function(g){return!g.__N}))return!o||o.call(this,c,u,p);var d=r.__c.props!==c;return v.forEach(function(g){if(g.__N){var x=g.__[0];g.__=g.__N,g.__N=void 0,x!==g.__[0]&&(d=!0)}}),o&&o.call(this,c,u,p)||d};L.u=!0;var o=L.shouldComponentUpdate,a=L.componentWillUpdate;L.componentWillUpdate=function(c,u,p){if(this.__e){var v=o;o=void 0,i(c,u,p),o=v}a&&a.call(this,c,u,p)},L.shouldComponentUpdate=i}return r.__N||r.__}function de(t,e){var n=Ce(le++,3);!M.__s&&Dt(n.__H,e)&&(n.__=t,n.i=e,L.__H.__h.push(n))}function R(t,e){var n=Ce(le++,4);!M.__s&&Dt(n.__H,e)&&(n.__=t,n.i=e,L.__h.push(n))}function A(t){return Ge=5,Qe(function(){return{current:t}},[])}function Qe(t,e){var n=Ce(le++,7);return Dt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function lr(t){var e=L.context[t.__c],n=Ce(le++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(L)),e.props.value):t.__}function yo(){for(var t;t=tr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(et),t.__H.__h.forEach(Mt),t.__H.__h=[]}catch(e){t.__H.__h=[],M.__e(e,t.__v)}}M.__b=function(t){L=null,nr&&nr(t)},M.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ar&&ar(t,e)},M.__r=function(t){rr&&rr(t),le=0;var e=(L=t.__c).__H;e&&($t===L?(e.__h=[],L.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(et),e.__h.forEach(Mt),e.__h=[],le=0)),$t=L},M.diffed=function(t){ir&&ir(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(tr.push(e)!==1&&er===M.requestAnimationFrame||((er=M.requestAnimationFrame)||bo)(yo)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),$t=L=null},M.__c=function(t,e){e.some(function(n){try{n.__h.forEach(et),n.__h=n.__h.filter(function(r){return!r.__||Mt(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],M.__e(r,n.__v)}}),or&&or(t,e)},M.unmount=function(t){sr&&sr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{et(r)}catch(i){e=i}}),n.__H=void 0,e&&M.__e(e,n.__v))};var dr=typeof requestAnimationFrame=="function";function bo(t){var e,n=function(){clearTimeout(r),dr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);dr&&(e=requestAnimationFrame(n))}function et(t){var e=L,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),L=e}function Mt(t){var e=L;t.__c=t.__(),L=e}function Dt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function ur(t,e){return typeof e=="function"?e(t):e}function xo(t){let e=t;const n=new Set;return{get:()=>e,set(r){const i=typeof r=="function"?r(e):r;e={...e,...i},n.forEach(o=>o())},subscribe(r){return n.add(r),()=>n.delete(r)}}}function wo(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null||Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t);return n.length!==Object.keys(e).length?!1:n.every(r=>Object.is(t[r],e[r]))}function _o(t,e,n=wo){const[,r]=cr(c=>c+1,0),i=A(e);i.current=e;const o=e(t.get()),a=A(o);return a.current=o,R(()=>{const c=()=>{n(i.current(t.get()),a.current)||r(0)},u=t.subscribe(c);return c(),u},[t,n]),o}const pr=["image/png","image/jpeg","image/gif","image/webp","application/pdf"],ko=10*1024*1024,fr=10,ye=2e3,Eo=8e3,Ao=12*60*60*1e3,To=5*60*1e3,So=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,hr=256,Co=2048,gr=t=>So.test(t.trim()),Ut=t=>`${t}${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`,Io=()=>document.visibilityState==="visible"&&document.hasFocus();function mr(t){try{const e=JSON.parse(atob(t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")));return Number.isFinite(e.exp)?e.exp*1e3:null}catch{return null}}function Ro(t){return typeof t!="string"||!t?"":!/^https:\/\/\S+$/i.test(t)||t.length>Co?(console.warn("[Deskcord] avatarUrl ignored: it must be an https:// URL of at most 2048 characters."),""):t}function No(t){const e=[];let n=t;for(;n.length>ye;){let r=n.lastIndexOf(`
2
+ `,ye);r<ye/2&&(r=n.lastIndexOf(" ",ye)),r<ye/2&&(r=ye),e.push(n.slice(0,r).trim()),n=n.slice(r).trim()}return n&&e.push(n),e}function Oo(t){const e=xo(po()),{get:n,set:r}=e,i=di(t,()=>fe()),o=new Map,a=new Map,c=new Map;let u=null,p=0,v=!1,d,g=null,x=0;const w=[];let _,C,b=0,k=0,U=!1,F=!1;function Y(l){x>0?w.push(l):l()}function te(){for(;x===0&&w.length;)w.shift()()}function fe(){r({boot:"hidden",open:!1,activeAt:null}),E()}function V(l,f,m=!1){let h=!0;return r(y=>{const T=y.conversations[l];if(!T&&!m)return h=!1,{};h=!!T;const O=T??jn(l,Date.now());let j={...y.conversations,[l]:f(O)};return T||(j=Ze(j,l)),{conversations:j}}),h}function K(l){const f=Nt(l.conversations);return f?{view:"chat",activeThreadId:f.threadId}:Object.keys(l.conversations).length||l.token?{view:"home",activeThreadId:null}:{view:"chat",activeThreadId:null}}function se(){U||n().open||r(l=>K(l))}function z(){const l=n().token;if(!l)return;u?.close();const f=p;r({connection:"connecting"}),setTimeout(()=>{f===p&&!n().synced&&we()},3e3),u=to(t.domain,l,{event:(m,h)=>{f===p&&Ms(m,h)},status:m=>{f===p&&re(m)},invalidToken:()=>{f===p&&Kt()}})}function E(){u?.close(),u=null,n().connection!=="off"&&r({connection:"off"})}function re(l){const f=n().connection;l?(r({connection:"up"}),we(),he()):f==="up"&&r({connection:"down"})}async function we(){const{token:l,synced:f}=n();if(!l)return;const m=p;b=Date.now();try{const[h,y]=await Promise.all([i.current(l),f?Promise.resolve(null):i.unreadCount(l).catch(()=>null)]);if(m!==p)return;Y(()=>$s(h,y))}catch(h){if(m!==p)return;h instanceof me&&(h.status===401||h.status===403)&&Kt()}}function Oe(){clearTimeout(_),_=setTimeout(()=>void we(),400)}function $s(l,f){let m=!1;r(h=>{let y=Ze(h.conversations,l?.threadId??null),T=h.lastReadAt;if(l){const O=Hn(l,o);if(y={...y,[O.threadId]:O},f!==null){const j=so(O,f);m=h.lastReadAt>j,T=Math.max(h.lastReadAt,j)}}return{conversations:y,lastReadAt:T,synced:!0}}),m&&Xr(),se()}async function Kt(){const l=n();if(l.identity.verifiedUserId){Me();return}if(E(),r({token:null}),l.identity.name&&l.identity.email)try{await Pr()}catch{}}function Pr(){const l=n().token;if(l)return Promise.resolve(l);if(!g){const f=p;g=(async()=>{const{name:m,email:h,avatarUrl:y}=n().identity;if(!m||!h)throw new Error("Missing name or email");const T=await i.token({name:m,email:h,avatarUrl:y});if(f!==p)throw new Error("Visitor changed");return r({token:T}),z(),T})().finally(()=>{g=null})}return g}function Ms(l,f){const m=f??{},h=m.threadId;switch(l){case"presence-updated":r(y=>({guild:{...y.guild,onlineCsMembers:Array.isArray(m.onlineCsMembers)?m.onlineCsMembers:[]}}));return;case"new-support-message":h&&m.message&&Ds(h,m.message);return;case"new-customer-message":if(h&&m.message){const y=m.message;Y(()=>jr(h,y))}return;case"updated-support-message":h&&m.message&&Us(h,m.message);return;case"deleted-support-message":h&&zs(h,m.messageId,m.messageDate);return;case"thread-closed":h&&(V(h,y=>({...y,status:"closed"})),Xt(h));return;case"thread-reopened":h&&(r(y=>({conversations:Ze(y.conversations,h),events:Fr(y,h,"reopened")})),V(h,y=>({...y,status:"open"}))||Oe());return;case"thread-assigned":case"thread-reassigned":{if(!h)return;const y=Bn(m.csMember);V(h,O=>({...O,csMember:y}),!0)||Oe(),l==="thread-reassigned"&&y&&r(O=>({events:Fr(O,h,"handoff",y.displayName)}));return}case"support-typing":h&&Bs(h);return}}function Fr(l,f,m,h){return{...l.events,[f]:[...l.events[f]??[],{key:Ut("e"),kind:m,date:Date.now(),name:h}]}}function jr(l,f){const m=Je(f,o);return Number.isFinite(m.date)?(V(l,y=>qn({...y,status:"open"},m),!0)||Oe(),m):null}function Ds(l,f){const m=jr(l,f);if(Xt(l),!m)return;n().open||r({preview:{threadId:l,key:m.key}})}function Us(l,f){const m=n().conversations[l],h=m&&Vn(m,f.id,f.date);if(!h)return;const y=Je(f,o);V(l,T=>Wn(T,h.sid,{text:y.text,attachments:y.attachments,emojis:y.emojis,edited:!0}))}function zs(l,f,m){const h=n().conversations[l],y=h&&Vn(h,f,m);y&&(V(l,T=>Wn(T,y.sid,{deleted:!0})),setTimeout(()=>V(l,T=>io(T,y.sid)),400))}function Bs(l){clearTimeout(c.get(l)),c.set(l,setTimeout(()=>Xt(l),Eo)),n().typing[l]||r(f=>({typing:{...f.typing,[l]:!0}}))}function Xt(l){clearTimeout(c.get(l)),c.delete(l),n().typing[l]&&r(f=>({typing:{...f.typing,[l]:!1}}))}function Hr(l){const f={localId:Ut("l"),progress:0,attempts:0,createdAt:Date.now(),...l};return r(m=>({outbox:[...m.outbox,f]})),f}function Le(l,f){r(m=>({outbox:m.outbox.map(h=>h.localId===l?{...h,...f}:h)}))}function qr(l){r(f=>({outbox:f.outbox.filter(m=>m.localId!==l)}))}async function he(){if(!v){v=!0;try{for(;;){const l=n();if(l.boot==="hidden")break;const f=l.outbox.find(m=>m.state==="queued");if(!f||!await Ps(f))break}}finally{v=!1}}}async function Ps(l){const f=p,m=l.attempts+1;Le(l.localId,{state:"sending",progress:0,attempts:m}),x++;try{const h=await Pr();if(l.file){const y=await i.upload(h,l.file,T=>Le(l.localId,{progress:T}));f===p&&Vr(l,{threadId:y.threadId,id:y.id,date:Number.isFinite(y.date)?y.date:Date.now(),content:"",attachments:y.attachments??[]})}else{const y=await i.send(h,n().identity.name,l.text??"");f===p&&Vr(l,{threadId:y.threadId,id:y.id,date:y.date,content:l.text??"",attachments:[]})}return!0}catch(h){return f!==p?!0:h instanceof pn?(qr(l.localId),!1):(h instanceof mt||h instanceof me&&(h.status===401||h.status>=500))&&m<3?(Le(l.localId,{state:"queued"}),h instanceof me&&h.status===401&&await Kt(),clearTimeout(d),d=setTimeout(()=>void he(),2e3*m),!1):(Le(l.localId,{state:"failed"}),!0)}finally{x--,te()}}function Vr(l,f){const m={id:f.id,content:f.content,authorName:n().identity.name,support:!1,date:f.date,attachments:f.attachments};o.set(Pn(m),l.localId),l.fileInfo?.previewUrl&&a.set(l.localId,l.fileInfo.previewUrl);const h=Je(m,o);r(y=>{const T=Ze(y.conversations,f.threadId),O=T[f.threadId]??jn(f.threadId,f.date),j=y.activeThreadId,X=j===null||j===f.threadId||y.conversations[j]?.status==="open";return{conversations:{...T,[f.threadId]:qn({...O,status:"open"},h)},outbox:y.outbox.filter(ae=>ae.localId!==l.localId),activeThreadId:X?f.threadId:j}})}function Wr(){n().outbox.some(l=>l.state==="held")&&(r(l=>({outbox:l.outbox.map(f=>f.state==="held"?{...f,state:"queued"}:f)})),he())}let $e=Promise.resolve();function Yr(l){return $e=$e.then(l).catch(f=>console.error("[Deskcord]",f)),$e}async function Fs(){let l;do l=$e,await l;while(l!==$e)}function Me(){p++,E(),o.clear(),a.forEach(l=>URL.revokeObjectURL(l)),a.clear(),c.forEach(clearTimeout),c.clear(),w.length=0,U=!1,r(l=>({token:null,identity:Jn,conversations:{},outbox:[],tray:[],typing:{},lastReadAt:0,events:{},preview:null,synced:!1,past:"idle",view:"chat",activeThreadId:null,nav:l.nav+1})),st()}function js(l){const{identity:f,token:m}=n();if(f.verifiedUserId){const h=m?mr(m):null,y=!!m&&(h===null||h>Date.now()),T=l?.userId===f.verifiedUserId&&!!l?.userHash;(l===null||!y&&!T)&&Me()}l&&Kr(l)}function Kr(l){return Yr(()=>qs(l))}function Hs(){return Yr(Me)}async function qs(l){if(typeof l?.name!="string"||!l.name.trim()||typeof l.email!="string"||!gr(l.email)){console.error("[Deskcord] identify() needs at least a name and a valid email.");return}const f=!!(l.userId&&l.userHash),m=n().identity;m.verifiedUserId&&(!f||String(l.userId)!==m.verifiedUserId)&&Me();const h={name:l.name.trim().slice(0,hr),email:l.email.trim(),avatarUrl:Ro(l.avatarUrl)},y=n().identity,T=y.name!==h.name||y.email!==h.email||y.avatarUrl!==h.avatarUrl;r(X=>({identity:{...h,verifiedUserId:X.identity.verifiedUserId}})),Wr();const O=n().token;if(f){const X=String(l.userId),ae=O?mr(O):null;if(y.verifiedUserId===X&&!T&&ae!==null&&ae-Date.now()>Ao)return;const Xs=p,Jr=await i.identify({...h,userId:X,userHash:String(l.userHash)},O);if(Xs!==p)return;if(Jr){const Js=y.verifiedUserId!==X;r(Zs=>({token:Jr,identity:{...Zs.identity,verifiedUserId:X}})),Js&&(r({past:"idle",synced:!1}),k=0,n().boot==="ready"&&z());return}console.warn("[Deskcord] Identity verification failed: check that it's enabled (/identity-verification enable) and that userHash is HMAC-SHA256(secret, userId) computed on your server. Continuing without it."),y.verifiedUserId&&(Me(),r({identity:{...h,verifiedUserId:null}}))}const j=n().token;if(j&&T)try{const X=await i.token(h,j);r({token:X})}catch{}}function De(){const l=n();if(!l.open||l.view!=="chat"||!l.activeThreadId||!Io())return;const f=oo(l.conversations[l.activeThreadId]);f>l.lastReadAt&&(r({lastReadAt:f}),Xr())}function Xr(){clearTimeout(C),C=setTimeout(()=>{const{token:l,lastReadAt:f}=n();l&&f&&i.markRead(l,f).catch(()=>{})},600)}let Jt,ot=null;function Vs(l){return{token:l.token,identity:l.identity,conversations:l.conversations,lastReadAt:l.lastReadAt,guild:l.guild,activeAt:l.activeAt,outbox:l.outbox}}function st(){clearTimeout(Jt);const l=Vs(n());ot=l,vo(t.appId,l)}function Ws(){const l=n(),f=ot;f&&f.token===l.token&&f.identity===l.identity&&f.conversations===l.conversations&&f.lastReadAt===l.lastReadAt&&f.guild===l.guild&&f.activeAt===l.activeAt&&f.outbox===l.outbox||(clearTimeout(Jt),Jt=setTimeout(st,300))}function Ys(l){if(l.key!==Lt(t.appId))return;const f=Qn(t.appId),m=n();!f||f.token===m.token||(p++,E(),o.clear(),ot=f,r({token:f.token,identity:f.identity,conversations:f.conversations,lastReadAt:f.lastReadAt,outbox:[],synced:!1,past:"idle",activeThreadId:null,view:"chat",nav:m.nav+1}),r(h=>K(h)),f.token&&m.boot==="ready"&&z())}async function Ks(){const l=Qn(t.appId);l&&(r({...l}),ot=null),r(y=>K(y)),js(t.user),e.subscribe(Ws),e.subscribe(De),st();const f=n().activeAt;f&&Date.now()-f<7*24*60*60*1e3&&r({boot:"ready"});let m=!1,h=null;try{[m,h]=await Promise.all([i.status(),i.settings().catch(()=>null)])}catch{m=!1}if(!m){fe();return}r(y=>({boot:"ready",activeAt:Date.now(),guild:h?{...y.guild,...h}:y.guild})),F&&_e.open(),await Fs(),n().token&&z(),he()}if(typeof window<"u"){window.addEventListener("storage",Ys),window.addEventListener("pagehide",st),window.addEventListener("online",()=>void he());const l=()=>{De(),document.visibilityState==="visible"&&n().connection==="up"&&Date.now()-b>3e4&&we()};document.addEventListener("visibilitychange",l),window.addEventListener("focus",l)}const _e={open(){if(n().boot!=="ready"){F=n().boot==="loading";return}F=!1,r({open:!0,preview:null}),De(),n().view==="home"&&_e.loadPast()},close(){r({open:!1,lightbox:null})},toggle(){n().open?_e.close():_e.open()},goHome(){U=!0,r(l=>({view:"home",nav:l.nav+1,navPrev:l.activeThreadId})),_e.loadPast()},openConversation(l){U=!0;const f=n();if(f.view==="chat"&&f.activeThreadId===l){r({preview:null}),De();return}r(m=>({view:"chat",activeThreadId:l,nav:m.nav+1,navPrev:m.activeThreadId,preview:null})),De()},newConversation(){U=!0;const l=Nt(n().conversations);r(f=>({view:"chat",activeThreadId:l?.threadId??null,nav:f.nav+1,navPrev:f.activeThreadId}))},dismissPreview(){r({preview:null})},async loadPast(l=!1){const f=n();if(!f.token||f.past==="loading"||!l&&f.past==="done"&&Date.now()-k<To)return;const m=p;r({past:"loading"});try{const h=await i.past(f.token);if(m!==p)return;k=Date.now(),r(y=>{const T={...y.conversations};for(const O of h)!O?.threadId||T[O.threadId]?.status==="open"||(T[O.threadId]={...Hn(O,o),status:"closed"});return{conversations:T,past:"done"}})}catch{m===p&&r({past:"error"})}},send(l){const f=n(),m=!f.identity.name||!f.identity.email,h=m?"held":"queued";f.activeThreadId&&f.conversations[f.activeThreadId]?.status==="closed"&&r({activeThreadId:null});for(const y of No(l.trim()))Hr({text:y,state:h});for(const y of f.tray)Hr({state:h,file:y.file,fileInfo:{name:y.file.name||"image.png",size:y.file.size,type:y.file.type,previewUrl:y.previewUrl,width:y.width,height:y.height}});r({tray:[]}),m||he()},completeIntro(l,f){r(m=>({identity:{...m.identity,name:l.trim().slice(0,hr),email:f.trim()}})),Wr()},retry(l){Le(l,{state:"queued",attempts:0}),he()},discard(l){const f=n().outbox.find(m=>m.localId===l);f?.fileInfo?.previewUrl&&URL.revokeObjectURL(f.fileInfo.previewUrl),qr(l)},addFiles(l){let f=null;const m=[];for(const h of l){if(!pr.includes(h.type)){f=`“${h.name}” can't be sent. Send an image or a PDF.`;continue}if(h.size>ko){f=`“${h.name}” is over 10 MB.`;continue}if(n().tray.length+m.length>=fr){f=`You can attach up to ${fr} files at once.`;break}const y=h.type.startsWith("image/"),T={id:Ut("f"),file:h,previewUrl:y?URL.createObjectURL(h):null,width:4,height:3};if(m.push(T),T.previewUrl){const O=new Image;O.onload=()=>{const j=O.naturalWidth||4,X=O.naturalHeight||3;r(ae=>({tray:ae.tray.map(ne=>ne.id===T.id?{...ne,width:j,height:X}:ne)})),r(ae=>({outbox:ae.outbox.map(ne=>ne.fileInfo&&ne.fileInfo.previewUrl===T.previewUrl?{...ne,fileInfo:{...ne.fileInfo,width:j,height:X}}:ne)}))},O.src=T.previewUrl}}return m.length&&r(h=>({tray:[...h.tray,...m]})),f&&r({notice:{text:f,at:Date.now()}}),f},removeFromTray(l){const f=n().tray.find(m=>m.id===l);f?.previewUrl&&URL.revokeObjectURL(f.previewUrl),r(m=>({tray:m.tray.filter(h=>h.id!==l)}))},openLightbox(l,f,m){r({lightbox:{url:l,name:f,from:m}})},closeLightbox(){r({lightbox:null})},clearNotice(){r({notice:null})},setDark(l){n().dark!==l&&r({dark:l})}};return{store:e,actions:_e,boot:Ks,identify:Kr,logout:Hs,localPreview:l=>a.get(l)??null}}const Lo="#5865F2",$o=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function tt(t){const e=t?.trim().match($o);if(!e)return null;let n=e[1];n.length===3&&(n=[...n].map(i=>i+i).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]}function vr([t,e,n]){const r=i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4);return .2126*r(t)+.7152*r(e)+.0722*r(n)}function be(t,e){const[n,r]=[vr(t),vr(e)].sort((i,o)=>o-i);return(n+.05)/(r+.05)}const yr=(t,e,n)=>t.map((r,i)=>Math.round(r+(e[i]-r)*n)),Ie=t=>`rgb(${t.join(",")})`,ue=[255,255,255],nt=[17,19,24],br=[0,0,0];function Mo(t){const e=tt(t.primary)??tt(Lo),n=tt(t.gradient)??yr(e,br,.17),r=be(e,ue)>=2.6?ue:nt,i=Math.min(be(e,ue),be(n,ue)),o=Math.min(be(e,nt),be(n,nt)),a=tt(t.headerText)??(i>=2.6||i>=o?ue:nt),c=t.dark?[43,45,49]:ue;let u=e;for(let p=0;p<24&&be(u,c)<4.5;p++)u=yr(u,t.dark?ue:br,.08);return{vars:{"--dc-accent":Ie(e),"--dc-accent-2":Ie(n),"--dc-on-accent":Ie(r),"--dc-on-grad":Ie(a),"--dc-accent-text":Ie(u),"--dc-accent-soft":`rgba(${e.join(",")},${t.dark?.24:.14})`},flat:e.join()===n.join()}}const Z={out:"cubic-bezier(.22,1,.36,1)",spring:"cubic-bezier(.34,1.45,.64,1)",in:"cubic-bezier(.4,0,1,1)"},Do=typeof matchMedia=="function"?matchMedia("(prefers-reduced-motion: reduce)"):null;function zt(){return!Do?.matches}function $(t,e,n={}){return!t||typeof t.animate!="function"?null:t.animate(e,{duration:300,easing:Z.out,fill:"backwards",...n,...zt()?{}:{duration:1,delay:0}})}function Uo(t){return t?t.finished.then(()=>{},()=>{}):Promise.resolve()}function xr(t){return t.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}const zo=/\.(gif|jpe?g|png|webp|apng)$/i,wr=/https?:\/\/[^\s<]+[^\s<.,:;!?"')\]]/g;function Bo(t){try{const{protocol:e,pathname:n}=new URL(t);return(e==="https:"||e==="http:")&&zo.test(n)}catch{return!1}}function Po(t){const e=[],n=t.replace(wr,r=>Bo(r)?(e.push(r),""):r);return{text:e.length?n.replace(/[ \t]{2,}/g," ").trim():t,images:e}}function Fo(t,e,n,r){return r[t]?.imageURL??`https://cdn.discordapp.com/emojis/${n}.${e?"gif":"webp"}?size=48`}function _r(t,e={}){let n=xr(t);const r=[],i=o=>`${r.push(o)-1}`;return n=n.replace(/```(?:[a-z0-9+-]*\n)?([\s\S]*?)```/gi,(o,a)=>i(`<pre><code>${a.replace(/^\n+|\n+$/g,"")}</code></pre>`)),n=n.replace(/`([^`\n]+)`/g,(o,a)=>i(`<code>${a}</code>`)),n=n.replace(/&lt;(a?):(\w+):(\d+)&gt;/g,(o,a,c,u)=>i(`<img class="dc-cemoji" alt=":${c}:" title=":${c}:" src="${xr(Fo(`<${a}:${c}:${u}>`,a==="a",u,e))}">`)),n=n.replace(/\[([^\]\n]+)\]\((https?:\/\/[^\s)]+)\)/g,(o,a,c)=>i(`<a href="${c}" target="_blank" rel="noopener noreferrer nofollow">${a}</a>`)),n=n.replace(wr,o=>i(`<a href="${o}" target="_blank" rel="noopener noreferrer nofollow">${o.replace(/^https?:\/\//,"")}</a>`)),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<u>$1</u>").replace(/\*(?!\s)(.+?)\*/g,"<em>$1</em>").replace(/(^|[\s(])_(?!\s)(.+?)_(?=$|[\s).,!?])/gm,"$1<em>$2</em>").replace(/~~(.+?)~~/g,"<s>$1</s>").replace(/\|\|(.+?)\|\|/g,'<span class="dc-spoiler" tabindex="0" role="button" aria-label="Spoiler, click to reveal">$1</span>').replace(/^&gt; (.*)$/gm,'<span class="dc-quote">$1</span>').replace(/^[-*] (?=\S)/gm,"• ").replace(/\n/g,"<br>"),n.replace(/\u0001(\d+)\u0001/g,(o,a)=>r[Number(a)])}const kr=Intl.Segmenter,Er=kr?new kr:null;function jo(t){const e=t.replace(/<a?:\w+:\d+>/g,"⭐").replace(/\s+/g,"");return!e||!/^(?:\p{Extended_Pictographic}|\p{Emoji_Modifier}|[\u{1F1E6}-\u{1F1FF}]|‍|️|⃣)+$/u.test(e)?!1:(Er?[...Er.segment(e)].length:[...e].length)<=3}function Ar(t){return t.replace(/<a?:(\w+):\d+>/g,":$1:").replace(/```[\s\S]*?```/g,"[code]").replace(/[*_`|~]/g,"").replace(/\s+/g," ").trim()}const Ho={x:"M6 6l12 12M18 6 6 18",down:"m6 9 6 6 6-6",left:"m15 18-6-6 6-6",right:"m9 18 6-6-6-6",send:"M12 19V5M5.5 11.5 12 5l6.5 6.5",arrow:"M5 12h14M13 6l6 6-6 6",clip:"m20.5 11.5-8.3 8.3a5.2 5.2 0 0 1-7.4-7.4l8.6-8.6a3.5 3.5 0 0 1 4.9 4.9l-8.5 8.6a1.75 1.75 0 0 1-2.5-2.5l7.9-7.9",check:"m5 12.5 4.5 4.5L19 7.5",dl:"M12 4v11m-5-5 5 5 5-5M5 20h14",retry:"M4 12a8 8 0 0 1 14-5.3M20 4v4h-4M20 12a8 8 0 0 1-14 5.3M4 20v-4h4",plus:"M12 5v14M5 12h14",upload:"M12 16V4m-5 5 5-5 5 5M5 20h14",ext:"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"};function N({name:t,size:e=18,class:n}){const r={width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",class:n};return t==="smile"?s("svg",{...r,children:[s("circle",{cx:"12",cy:"12",r:"9"}),s("path",{d:"M8.5 14.5a4.5 4.5 0 0 0 7 0"}),s("circle",{cx:"9",cy:"9.8",r:"1.1",fill:"currentColor",stroke:"none"}),s("circle",{cx:"15",cy:"9.8",r:"1.1",fill:"currentColor",stroke:"none"})]}):t==="clock"?s("svg",{...r,children:[s("circle",{cx:"12",cy:"12",r:"8.5"}),s("path",{d:"M12 7.5V12l3 2"})]}):t==="alert"?s("svg",{...r,children:[s("circle",{cx:"12",cy:"12",r:"9"}),s("path",{d:"M12 7.5v5.5"}),s("circle",{cx:"12",cy:"16.3",r:"1.2",fill:"currentColor",stroke:"none"})]}):s("svg",{...r,children:s("path",{d:Ho[t]})})}function qo(){return s("svg",{width:"26",height:"26",viewBox:"0 0 24 24","aria-hidden":"true",children:[s("path",{fill:"currentColor",d:"M12 3.5c4.97 0 9 3.36 9 7.5s-4.03 7.5-9 7.5c-.98 0-1.92-.13-2.8-.37L5.1 20.1c-.5.25-1.06-.22-.9-.75l1.02-3.34C3.84 14.7 3 12.93 3 11c0-4.14 4.03-7.5 9-7.5Z"}),s("circle",{cx:"8.6",cy:"11",r:"1.25",fill:"var(--dc-accent)"}),s("circle",{cx:"12",cy:"11",r:"1.25",fill:"var(--dc-accent)"}),s("circle",{cx:"15.4",cy:"11",r:"1.25",fill:"var(--dc-accent)"})]})}function Tr(){return s("svg",{viewBox:"0 0 642 74","aria-label":"Deskcord",children:s("path",{fill:"currentColor",d:"M23.9 73.2C19.43 73.2 15.37 72.07 11.7 69.8 8.1 67.53 5.23 64.43 3.1 60.5 1.03 56.5 0 51.97 0 46.9c0-5.13 1.07-9.67 3.2-13.6 2.13-4 5.03-7.13 8.7-9.4 3.73-2.33 7.87-3.5 12.4-3.5 3.47 0 6.5.63 9.1 1.9 2.6 1.2 4.73 2.97 6.4 5.3V0h15v72H41.5l-1.7-6.5c-1 1.4-2.23 2.7-3.7 3.9-1.4 1.13-3.1 2.03-5.1 2.7-2 .73-4.37 1.1-7.1 1.1Zm3.9-13.1c2.47 0 4.63-.57 6.5-1.7 1.93-1.13 3.4-2.7 4.4-4.7 1.07-2 1.6-4.3 1.6-6.9s-.53-4.9-1.6-6.9c-1-2-2.47-3.57-4.4-4.7-1.87-1.13-4.03-1.7-6.5-1.7-2.4 0-4.57.57-6.5 1.7-1.87 1.13-3.33 2.7-4.4 4.7-1.07 2-1.6 4.27-1.6 6.8 0 2.6.53 4.93 1.6 7 1.07 2 2.53 3.57 4.4 4.7 1.93 1.13 4.1 1.7 6.5 1.7Zm58.81 13.1c-5.2 0-9.77-1.07-13.7-3.2-3.93-2.2-7.03-5.23-9.3-9.1-2.2-3.93-3.3-8.43-3.3-13.5 0-5.2 1.1-9.83 3.3-13.9 2.2-4.07 5.27-7.27 9.2-9.6 3.93-2.33 8.5-3.5 13.7-3.5 5.07 0 9.5 1.1 13.3 3.3 3.8 2.2 6.77 5.2 8.9 9 2.2 3.73 3.3 8.07 3.3 13 0 .67-.03 1.43-.1 2.3 0 .8-.07 1.63-.2 2.5H71.01v-8.7h25.7c-.13-2.8-1.17-5.03-3.1-6.7-1.87-1.73-4.2-2.6-7-2.6-2.13 0-4.07.5-5.8 1.5-1.73 1-3.13 2.5-4.2 4.5-1 2-1.5 4.53-1.5 7.6v3c0 2.33.43 4.4 1.3 6.2.93 1.8 2.23 3.2 3.9 4.2 1.73 1 3.77 1.5 6.1 1.5 2.2 0 4-.43 5.4-1.3 1.47-.93 2.6-2.1 3.4-3.5h15.3c-.93 3.2-2.53 6.1-4.8 8.7-2.27 2.53-5.030 4.57-8.3 6.1-3.27 1.47-6.87 2.2-10.8 2.2Zm51.43 0c-4.73 0-8.83-.73-12.3-2.2-3.4-1.53-6.1-3.6-8.1-6.2-1.93-2.6-3.03-5.53-3.3-8.8h14.9c.27 1.13.73 2.17 1.4 3.1.73.87 1.7 1.57 2.9 2.1 1.27.47 2.67.7 4.2.7 1.67 0 3-.2 4-.6 1.07-.47 1.87-1.07 2.4-1.8.53-.73.8-1.5.8-2.3 0-1.27-.4-2.23-1.2-2.9-.73-.67-1.83-1.2-3.3-1.6-1.47-.47-3.23-.9-5.3-1.3-2.4-.53-4.8-1.13-7.2-1.8-2.33-.73-4.43-1.630-6.3-2.7-1.8-1.07-3.27-2.43-4.4-4.1-1.07-1.73-1.6-3.83-1.6-6.3 0-3 .83-5.7 2.5-8.1 1.67-2.47 4.07-4.4 7.2-5.8 3.13-1.47 6.93-2.2 11.4-2.2 6.33 0 11.3 1.4 14.9 4.2 3.6 2.8 5.73 6.57 6.4 11.3h-14c-.4-1.33-1.23-2.33-2.5-3-1.27-.73-2.87-1.1-4.8-1.1-2.2 0-3.87.37-5 1.1-1.13.73-1.7 1.7-1.7 2.9 0 .8.37 1.53 1.1 2.2.8.6 1.93 1.13 3.4 1.6 1.47.47 3.27.93 5.4 1.4 4.07.87 7.57 1.8 10.5 2.8 3 1 5.33 2.47 7 4.4 1.67 1.87 2.47 4.6 2.4 8.2.07 3.27-.8 6.17-2.6 8.7-1.73 2.53-4.23 4.53-7.5 6-3.27 1.4-7.17 2.1-11.7 2.1Zm60.6-1.2-20.8-27.6 18.5-22.8h17.7l-24.9 29.2v-12L217.24 72h-18.6Zm-33.6 0V0h15v72h-15Zm74.47 1.2c-5.2 0-9.8-1.13-13.8-3.4-3.93-2.27-7.03-5.37-9.3-9.3-2.2-3.93-3.3-8.43-3.3-13.5 0-5.2 1.1-9.77 3.3-13.7 2.27-4 5.37-7.13 9.3-9.4 4-2.33 8.6-3.5 13.8-3.5 6.6 0 12.13 1.73 16.6 5.2 4.53 3.47 7.4 8.3 8.6 14.5h-15.9c-.6-2.13-1.73-3.8-3.4-5-1.67-1.2-3.67-1.8-6-1.8-2.2 0-4.13.57-5.8 1.7-1.6 1.07-2.87 2.63-3.8 4.7-.93 2-1.4 4.37-1.4 7.1 0 2.07.27 3.93.8 5.6.53 1.67 1.27 3.1 2.2 4.3 1 1.2 2.17 2.13 3.5 2.8 1.33.6 2.83.9 4.5.9 1.6 0 3-.27 4.2-.8 1.27-.53 2.33-1.3 3.2-2.3.93-1 1.6-2.23 2-3.7h15.9c-1.2 6-4.07 10.77-8.6 14.3-4.53 3.53-10.07 5.3-16.6 5.3Zm55.02 0c-4.87 0-9.23-1.13-13.1-3.4-3.87-2.27-6.93-5.37-9.2-9.3-2.27-4-3.4-8.53-3.4-13.6 0-5.2 1.13-9.77 3.4-13.7 2.27-4 5.33-7.13 9.2-9.4 3.93-2.27 8.3-3.4 13.1-3.4 4.93 0 9.33 1.13 13.2 3.4 3.87 2.27 6.93 5.4 9.2 9.4 2.27 3.93 3.4 8.47 3.4 13.6 0 5.13-1.13 9.7-3.4 13.7-2.27 3.93-5.33 7.03-9.2 9.3-3.87 2.27-8.27 3.4-13.2 3.4Zm0-13c2 0 3.77-.5 5.3-1.5 1.6-1 2.87-2.5 3.8-4.5.93-2 1.4-4.47 1.4-7.4s-.47-5.4-1.4-7.4c-.93-2-2.17-3.5-3.7-4.5-1.53-1-3.3-1.5-5.3-1.5s-3.8.5-5.4 1.5c-1.53 1-2.77 2.5-3.7 4.5-.93 2-1.4 4.47-1.4 7.4s.47 5.4 1.4 7.4c.93 2 2.17 3.5 3.7 4.5 1.6 1 3.37 1.5 5.3 1.5Zm31.32 11.8V21.6h13.3l1.4 9.2c1.33-2.13 2.9-3.97 4.7-5.5 1.8-1.53 3.87-2.73 6.2-3.6 2.4-.87 4.97-1.3 7.7-1.3v15.9h-5c-2 0-3.83.23-5.5.7-1.6.4-3 1.1-4.2 2.1-1.13 1-2.03 2.37-2.7 4.1-.6 1.67-.9 3.77-.9 6.3V72h-15Zm58 1.2c-4.47 0-8.53-1.13-12.2-3.4-3.6-2.27-6.47-5.37-8.6-9.3-2.07-4-3.1-8.53-3.1-13.6 0-5.13 1.07-9.67 3.2-13.6 2.13-4 5.03-7.13 8.7-9.4 3.73-2.33 7.87-3.5 12.4-3.5 3.47 0 6.5.63 9.1 1.9 2.6 1.2 4.73 2.97 6.4 5.3V0h15v72h-13.3l-1.7-6.5c-1 1.4-2.23 2.7-3.7 3.9-1.4 1.13-3.1 2.03-5.1 2.7-2 .73-4.37 1.1-7.1 1.1Zm3.9-13.1c2.47 0 4.63-.57 6.5-1.7 1.93-1.13 3.4-2.7 4.4-4.7 1.07-2 1.6-4.3 1.6-6.9s-.53-4.9-1.6-6.9c-1-2-2.47-3.57-4.4-4.7-1.87-1.13-4.03-1.7-6.5-1.7-2.4 0-4.57.57-6.5 1.7-1.87 1.13-3.33 2.7-4.4 4.7-1.07 2-1.6 4.27-1.6 6.8 0 2.6.53 4.93 1.6 7 1.07 2 2.53 3.57 4.4 4.7 1.93 1.13 4.1 1.7 6.5 1.7Zm41.01 12.4c-2.73 0-4.97-.8-6.7-2.4-1.67-1.67-2.5-3.67-2.5-6 0-2.4.83-4.4 2.5-6 1.73-1.67 3.97-2.5 6.7-2.5 2.67 0 4.83.83 6.5 2.5 1.67 1.6 2.5 3.6 2.5 6 0 2.33-.83 4.33-2.5 6-1.67 1.6-3.83 2.4-6.5 2.4Zm38.66.7c-5.2 0-9.8-1.13-13.8-3.4-3.93-2.27-7.03-5.37-9.3-9.3-2.2-3.93-3.3-8.43-3.3-13.5 0-5.2 1.1-9.77 3.3-13.7 2.27-4 5.37-7.13 9.3-9.4 4-2.33 8.6-3.5 13.8-3.5 6.6 0 12.13 1.73 16.6 5.2 4.53 3.47 7.4 8.3 8.6 14.5h-15.9c-.6-2.13-1.73-3.8-3.4-5-1.67-1.2-3.67-1.8-6-1.8-2.2 0-4.13.57-5.8 1.7-1.6 1.07-2.87 2.63-3.8 4.7-.93 2-1.4 4.37-1.4 7.1 0 2.070.27 3.93.8 5.6.53 1.67 1.27 3.1 2.2 4.3 1 1.2 2.17 2.13 3.5 2.8 1.33.6 2.83.9 4.5.9 1.6 0 3-.27 4.2-.8 1.27-.53 2.33-1.3 3.2-2.3.93-1 1.6-2.23 2-3.7h15.9c-1.2 6-4.07 10.77-8.6 14.3-4.53 3.53-10.07 5.3-16.6 5.3ZM498.24 72V0h15v28.8c1.6-2.53 3.77-4.57 6.5-6.1 2.73-1.53 5.93-2.3 9.6-2.3 4.27 0 7.83.9 10.7 2.7 2.87 1.8 5.03 4.43 6.5 7.9 1.47 3.4 2.2 7.53 2.2 12.4V72h-14.9V44.8c0-3.73-.8-6.63-2.4-8.7-1.53-2.07-4-3.1-7.4-3.1-2 0-3.83.5-5.5 1.5-1.67 1-2.97 2.43-3.9 4.3-.93 1.8-1.4 3.97-1.4 6.5V72h-15Zm74.19 1.2c-4.2 0-7.7-.67-10.5-2-2.73-1.33-4.77-3.13-6.1-5.4-1.27-2.33-1.9-4.9-1.9-7.7 0-3 .73-5.63 2.2-7.9 1.53-2.33 3.9-4.17 7.1-5.5 3.2-1.4 7.23-2.1 12.1-2.1h12.2c0-2.27-.3-4.13-.9-5.6-.53-1.47-1.43-2.57-2.7-3.3-1.27-.73-3-1.1-5.2-1.1-2.33 0-4.3.47-5.9 1.4-1.6.93-2.6 2.4-3 4.4h-14.4c.33-3.6 1.5-6.73 3.5-9.4 2.07-2.67 4.8-4.77 8.2-6.3 3.4-1.53 7.3-2.3 11.7-2.3 4.8 0 8.97.8 12.5 2.4 3.53 1.53 6.27 3.8 8.2 6.8 2 3 3 6.73 3 11.2V72h-12.5l-1.8-7.3c-.73 1.27-1.6 2.43-2.6 3.5-1 1-2.17 1.9-3.5 2.7-1.33.73-2.8 1.3-4.4 1.7-1.6.4-3.37.6-5.3.6Zm3.7-11.4c1.6 0 3-.27 4.2-.8 1.2-.53 2.23-1.27 3.1-2.2.87-.93 1.57-2 2.1-3.2.6-1.27 1.03-2.63 1.3-4.1v-.1h-9.7c-1.67 0-3.07.23-4.2.7-1.07.4-1.87 1-2.4 1.8-.53.8-.8 1.73-.8 2.8 0 1.13.27 2.1.8 2.9.6.73 1.37 1.3 2.3 1.7 1 .33 2.1.5 3.3.5ZM632.3 72c-3.67 0-6.9-.57-9.7-1.7-2.8-1.2-4.97-3.13-6.5-5.8-1.53-2.67-2.3-6.3-2.3-10.9V34.1h-8.6V21.6h8.6l1.6-14.2h13.4v14.2h12.9v12.5h-12.9v19.7c0 2 .43 3.43 1.3 4.3.93.8 2.5 1.2 4.7 1.2h6.9V72h-9.4Z"})})}const Sr=un(null),q=()=>lr(Sr);function H(t){return _o(q().store,t)}function Vo(t){const[,e]=P(0);de(()=>{const n=setInterval(()=>e(r=>r+1),t);return()=>clearInterval(n)},[t])}function Wo(t,e,n,r,i={}){const[o,a]=P(t),c=A(t);c.current=t;const u=A(null);return R(()=>{if(t){u.current?.cancel(),u.current=null,o||a(!0);return}if(!o)return;const p=$(e.current,r,{duration:160,fill:"forwards",...i.exit});u.current=p,Uo(p).then(()=>{!c.current&&u.current===p&&a(!1)})},[t]),R(()=>{t&&o&&$(e.current,n,{duration:380,...i.enter})},[t,o]),o}function Yo(){const t=()=>document.visibilityState==="visible"&&document.hasFocus(),[e,n]=P(t);return de(()=>{const r=()=>n(t());return document.addEventListener("visibilitychange",r),window.addEventListener("focus",r),window.addEventListener("blur",r),()=>{document.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r),window.removeEventListener("blur",r)}},[]),e}const Cr=()=>typeof matchMedia=="function"&&matchMedia("(pointer: fine)").matches;function Ko(t){let e=0;for(let n=0;n<t.length;n++)e=(e*31+t.charCodeAt(n))%360;return e}const Ir=t=>(t.trim()[0]??"?").toUpperCase();function pe({name:t,url:e,size:n=28,status:r}){const[i,o]=P(!1);return s("span",{class:"dc-av",style:`--s:${n}px;--h:${Ko(t)}`,title:t,children:[e&&!i?s("img",{src:e,alt:"",loading:"lazy",onError:()=>o(!0)}):Ir(t),r&&s("i",{class:`dot ${r}`})]})}function oe({member:t,size:e,withStatus:n}){return s(pe,{name:t.displayName,url:t.displayAvatarURL,size:e,status:n?t.status:null})}function Re({size:t=36,dot:e}){const{iconURL:n,name:r}=H(a=>({iconURL:a.guild.iconURL,name:a.guild.name})),[i,o]=P(!1);return s("span",{class:"dc-guild",style:`--s:${t}px`,children:[n&&!i?s("img",{src:n,alt:"",onError:()=>o(!0)}):Ir(r||"S"),e&&s("i",{class:`dot ${e}`})]})}const rt={online:3,idle:2,dnd:1};function Bt(t,e=3){return[...t].sort((n,r)=>(rt[r.status]??0)-(rt[n.status]??0)).slice(0,e).reverse()}function Pt(t){const e=[...t].sort((r,i)=>(rt[i.status]??0)-(rt[r.status]??0)).map(r=>r.displayName);if(e.length===1)return`${e[0]} is online`;if(e.length===2)return`${e[0]} and ${e[1]} are online`;const n=e.length-2;return`${e[0]}, ${e[1]} and ${n===1?e[2]:`${n} others`} are online`}const Xo={online:"Online",idle:"Away",dnd:"Busy",invisible:"Offline",offline:"Offline"},Jo="Hi there 👋",Zo="We typically reply within a few minutes.",Ft="No one is online right now. Leave a message and we'll get back to you here.",it=6e4,jt=60*it,Ne=24*jt;function xe(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Go(t,e=Date.now()){if(!Number.isFinite(t))return"";const n=e-t;return n<it?"now":n<jt?`${Math.floor(n/it)} min`:n<Ne&&new Date(t).getDate()===new Date(e).getDate()?xe(t):n<7*Ne?`${Math.max(1,Math.floor(n/Ne))}d`:new Date(t).toLocaleDateString([],{day:"numeric",month:"short"})}function Qo(t,e=Date.now()){const n=new Date(e);return n.setHours(0,0,0,0),t>=n.getTime()?"Today":t>=n.getTime()-Ne?"Yesterday":new Date(t).toLocaleDateString([],{weekday:"short",day:"numeric",month:"short"})}function es(t){const e=new Date(t);return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function Ht(t){return Number.isFinite(t)?t<1024*1024?`${Math.max(1,Math.round(t/1024))} KB`:`${(t/1024/1024).toFixed(1)} MB`:""}function qt(t){const e=t.lastIndexOf(".");return e>0&&e<t.length-1?t.slice(e+1).toUpperCase().slice(0,4):"FILE"}const ts={MIN:it,HOUR:jt,DAY:Ne};function Rr(){const{actions:t}=q();return s("button",{class:"dc-hbtn","aria-label":"Close chat",onClick:t.close,children:[s(N,{name:"x",size:20,class:"ic-x"}),s(N,{name:"down",size:22,class:"ic-down"})]})}function ns(){const{actions:t}=q(),{guild:e,identity:n,conversations:r,past:i,lastReadAt:o}=H(_=>({guild:_.guild,identity:_.identity,conversations:_.conversations,past:_.past,lastReadAt:_.lastReadAt}));Vo(3e4);const a=Qe(()=>Yn(r),[r]),c=a.find(_=>_.status==="open"),u=a.filter(_=>_.status==="closed"&&_.messages.length),p=e.onlineCsMembers,v=Array.isArray(p)&&p.length===0,d=n.name.trim().split(/\s+/)[0],g=e.header_title||(d?`Hi ${d} 👋`:Jo),x=v?e.offline_message||Ft:e.header_subtitle||Zo,w=c?c.messages.filter(_=>_.from==="agent"&&_.date>o).length:0;return s(B,{children:[s("header",{class:"dc-head dc-hero",children:[s("div",{class:"top",children:[s(Re,{size:36}),s(Rr,{})]}),s("h2",{children:g}),s("p",{children:x}),p&&p.length>0&&s("div",{class:"dc-team",children:[s("span",{class:"stack",children:Bt(p).map(_=>s(oe,{member:_,size:30,withStatus:!0},_.displayName))}),s("span",{children:Pt(p)})]}),v&&s("div",{class:"dc-team",children:"The team is away right now"})]}),s("div",{class:"dc-home-body",children:[c?s("div",{class:"dc-card",children:[s("div",{class:"dc-eyebrow",children:"Ongoing conversation"}),s("div",{class:"dc-list",children:s(Or,{conv:c,unread:w,onOpen:()=>t.openConversation(c.threadId)})})]}):s("button",{class:"dc-card dc-cta",onClick:t.newConversation,children:[s("span",{class:"tx",children:[s("b",{children:"Send us a message"}),s("small",{children:v?"We'll reply as soon as we're back":"We typically reply within a few minutes"})]}),s("span",{class:"go",children:s(N,{name:"arrow",size:18})})]}),(u.length>0||i==="loading"||i==="error")&&s("div",{class:"dc-card",children:[s("div",{class:"dc-eyebrow",children:"Previous conversations"}),s("div",{class:"dc-list",children:[u.map(_=>s(Or,{conv:_,unread:0,onOpen:()=>t.openConversation(_.threadId)},_.threadId)),i==="loading"&&u.length===0&&s(B,{children:[s(Nr,{}),s(Nr,{})]})]}),i==="error"&&s("p",{class:"dc-empty",children:["Couldn't load your previous conversations."," ",s("button",{onClick:()=>void t.loadPast(!0),children:"Try again"})]})]}),s("a",{class:"dc-powered",href:"https://deskcord.chat",target:"_blank",rel:"noopener",children:["Powered by ",s(Tr,{})]})]})]})}function Nr(){return s("div",{class:"dc-skel-row","aria-hidden":"true",children:[s("i",{}),s("span",{children:[s("i",{}),s("i",{})]})]})}function rs(t){for(let e=t.messages.length-1;e>=0;e--){const n=t.messages[e];if(n.deleted)continue;const r=n.from==="me"?"You: ":"";if(n.text)return r+Ar(n.text);if(n.attachments.length)return r+(n.attachments[0].contentType?.startsWith("image/")?"📷 Image":`📄 ${n.attachments[0].name}`)}return""}function Or({conv:t,unread:e,onOpen:n}){const r=H(a=>a.guild.name),i=t.status==="closed",o=t.csMember?.displayName??ao(t);return s("button",{class:`dc-conv${e?" is-unread":""}`,onClick:n,children:[t.csMember?s(oe,{member:t.csMember,size:40,withStatus:!i}):o?s(pe,{name:o,size:40}):s(Re,{size:40}),s("span",{class:"tx",children:[s("span",{class:"l1",children:[s("b",{children:o??r??"Support"}),s("time",{children:Go(t.lastMessageDate)})]}),s("span",{class:"l2",children:[i&&s("span",{class:"dc-pill ok",children:"Resolved"}),rs(t)]})]}),e>0?s("span",{class:"count",children:e}):s("span",{class:"chev",children:s(N,{name:"right",size:16})})]})}const is=5*ts.MIN;function os(t,e,n,r){const i=[];let o="",a=null,c=!1,u=!1,p=!1;const v=w=>{const _=es(w);_!==o&&(i.push({type:"day",key:`day-${_}`,date:w}),o=_,a=null)},d=(w,_)=>{const C=a,b=!!C&&C.side===w&&_-C.date<is;if(b){const k=i[i.length-1];(k.type==="msg"||k.type==="out")&&(k.last=!1)}return a={side:w,date:_},!b},g=[...(t?.messages??[]).map(w=>({date:w.date,m:w})),...n.map(w=>({date:w.date,e:w}))].sort((w,_)=>w.date-_.date);for(const w of g){if(v(w.date),w.e){i.push({type:"event",key:w.e.key,e:w.e}),a=null;continue}const _=w.m;_.from==="agent"?(u=!0,c||(c=!0,i.push({type:"joined",key:`joined-${_.key}`,name:_.authorName,date:_.date}),a=null)):p=!0;const C=d(_.from==="me"?"me":`a:${_.authorName}`,_.date);i.push({type:"msg",key:_.key,m:_,first:C,last:!0,status:!1})}let x=!1;for(const w of e){v(w.createdAt),p=!0;const _=d("me",w.createdAt);i.push({type:"out",key:w.localId,o:w,first:_,last:!0}),w.state==="held"&&(x=!0)}if(!e.length)for(let w=i.length-1;w>=0;w--){const _=i[w];if(_.type==="msg"&&_.m.from==="me"){_.status=!0;break}}return x&&i.push({type:"intro",key:"intro"}),r&&p&&!u&&t?.status!=="closed"&&i.push({type:"note",key:"offline-note",text:r}),t?.status==="closed"&&i.push({type:"resolved",key:"resolved",date:t.lastMessageDate}),i}const Lr=un({mounted:{current:!1}});function ss({items:t,member:e}){const n=A(!1);return R(()=>{n.current=!0},[]),s(Lr.Provider,{value:{mounted:n},children:s("div",{class:"dc-msgs",onClick:r=>{const i=r.target.closest?.(".dc-spoiler");i&&i.classList.add("is-shown")},onKeyDown:r=>{const i=r.target;(r.key==="Enter"||r.key===" ")&&i.classList?.contains("dc-spoiler")&&(r.preventDefault(),i.classList.add("is-shown"))},children:t.map(r=>s(as,{item:r,member:e},r.key))})})}function as({item:t,member:e}){const{mounted:n}=lr(Lr),r=A(null);switch(R(()=>{if(!n.current)return;const i=t.type==="out"||t.type==="msg"&&t.m.from==="me",o=t.type==="msg"||t.type==="out";r.current&&(r.current.style.transformOrigin=i?"bottom right":o?"bottom left":"center"),$(r.current,[{opacity:0,transform:`translateY(10px) scale(${o?.94:.98})`},{opacity:1,transform:"none"}],{duration:420,easing:Z.spring})},[]),t.type){case"day":return s("div",{ref:r,class:"dc-day",children:Qo(t.date)});case"joined":return s("div",{ref:r,class:"dc-event",children:[e&&e.displayName===t.name?s(oe,{member:e,size:20}):s(pe,{name:t.name,size:20}),s("span",{children:[s("b",{children:t.name})," joined the conversation"]}),s("time",{children:xe(t.date)})]});case"event":return s("div",{ref:r,class:"dc-event",children:[t.e.kind==="handoff"?s(B,{children:[s(pe,{name:t.e.name??"?",size:20}),s("span",{children:[s("b",{children:t.e.name})," took over the conversation"]})]}):s(B,{children:[s("span",{class:"ic",children:s(N,{name:"retry",size:12})}),s("span",{children:"Conversation reopened"})]}),s("time",{children:xe(t.e.date)})]});case"resolved":return s("div",{ref:r,class:"dc-event ok",children:[s("span",{class:"ic",children:s(N,{name:"check",size:12})}),s("span",{children:"Conversation resolved"})]});case"note":return s("div",{ref:r,class:"dc-event note",children:s("span",{children:t.text})});case"intro":return s("div",{ref:r,children:s(hs,{})});case"msg":return t.m.from==="me"?s(ls,{ref_:r,m:t.m,first:t.first,last:t.last,status:t.status}):s(cs,{ref_:r,m:t.m,first:t.first,last:t.last,member:e});case"out":return s(ds,{ref_:r,o:t.o,first:t.first,last:t.last})}}function Vt({text:t,emojis:e,edited:n}){const r=A(null),i=A(!0),{text:o,images:a}=Po(t);return R(()=>{if(i.current){i.current=!1;return}$(r.current,[{filter:"brightness(1.25) saturate(1.3)"},{filter:"none"}],{duration:900})},[t]),s(B,{children:[o&&s("div",{ref:r,class:`dc-bubble${jo(o)?" is-jumbo":""}`,dangerouslySetInnerHTML:{__html:_r(o,e)+(n?'<span class="dc-edited">(edited)</span>':"")}}),a.map(c=>s("img",{class:"dc-inline-img",src:c,alt:"",loading:"lazy"},c))]})}function Wt(t,e,n,r=""){return`dc-row dc-row--${t}${e?" is-first":""}${n?" is-last":""}${r}`}function cs({ref_:t,m:e,first:n,last:r,member:i}){const o=i&&i.displayName===e.authorName?i:null;return s("div",{ref:t,class:Wt("agent",n,r,e.deleted?" is-deleted":""),title:xe(e.date),children:[s("div",{class:"dc-row-av",children:o?s(oe,{member:o,size:28}):s(pe,{name:e.authorName||"?",size:28})}),s("div",{class:"dc-stack",children:[s("div",{class:"dc-name",children:[s("b",{children:e.authorName}),xe(e.date)]}),s(Vt,{text:e.text,emojis:e.emojis,edited:e.edited}),s(Mr,{list:e.attachments,localUrl:null})]})]})}function ls({ref_:t,m:e,first:n,last:r,status:i}){const{localPreview:o}=q();return s("div",{ref:t,class:Wt("me",n,r,i?" show-status":""),title:xe(e.date),children:s("div",{class:"dc-stack",children:[s(Vt,{text:e.text,emojis:e.emojis,edited:e.edited}),s(Mr,{list:e.attachments,localUrl:o(e.key)}),s("div",{class:"dc-status",children:[s(N,{name:"check",size:12})," Sent"]})]})})}function ds({ref_:t,o:e,first:n,last:r}){const{actions:i}=q(),o=e.state==="failed",a=e.fileInfo,c=Math.round(e.progress*100);return s("div",{ref:t,class:Wt("me",n,r,o?"":" is-pending"),children:s("div",{class:"dc-stack",children:[e.text&&s(Vt,{text:e.text,emojis:{}}),a&&(a.previewUrl?s("div",{class:`dc-img is-${o?"failed":"uploading"}`,style:`--w:${$r(a.width,a.height)}px;aspect-ratio:${a.width}/${a.height}`,children:[s("img",{src:a.previewUrl,alt:a.name}),!o&&s(us,{value:e.state==="sending"?c:0}),o&&s("span",{class:"fail",children:[s(N,{name:"retry",size:20}),"Not sent"]})]}):s("div",{class:`dc-file is-${o?"failed":"uploading"}`,children:[s("span",{class:"dc-ftype",children:qt(a.name)}),s("span",{class:"tx",children:[s("b",{children:a.name}),s("small",{children:o?"Not sent":e.state==="sending"?`Uploading · ${c}%`:Ht(a.size)})]}),!o&&s("span",{class:"bar",children:s("i",{style:`width:${e.state==="sending"?c:0}%`})})]})),o?s("div",{class:"dc-status is-failed",children:[s(N,{name:"alert",size:13})," Not sent ·"," ",s("button",{onClick:()=>i.retry(e.localId),children:"Retry"})," ·"," ",s("button",{onClick:()=>i.discard(e.localId),children:"Remove"})]}):s("div",{class:"dc-status is-pending",children:[s(N,{name:"clock",size:12})," ",e.state==="held"?"Waiting for your details":"Sending…"]})]})})}function us({value:t}){return s(B,{children:[s("svg",{class:"dc-ring",viewBox:"0 0 36 36","aria-hidden":"true",children:[s("circle",{class:"bg",cx:"18",cy:"18",r:"15"}),s("circle",{class:"fg",cx:"18",cy:"18",r:"15",pathLength:100,style:`stroke-dashoffset:${100-t}`})]}),s("span",{class:"pct",children:[t,"%"]})]})}const Yt=t=>t.contentType?t.contentType.startsWith("image/"):/\.(png|jpe?g|gif|webp)$/i.test(t.name);function $r(t,e){return!t||!e?232:e>t?Math.max(120,Math.round(232*t/e)):232}function Mr({list:t,localUrl:e}){if(!t.length)return null;const n=t.filter(Yt),r=t.filter(i=>!Yt(i));return s(B,{children:[n.length>1?s("div",{class:"dc-gallery",children:n.map(i=>s(Dr,{a:i,src:i.proxyURL||i.url},i.url))}):n[0]&&s(Dr,{a:n[0],src:e??(n[0].proxyURL||n[0].url)}),r.map(i=>s(fs,{a:i},i.url))]})}function Dr({a:t,src:e}){const{actions:n}=q(),r=t.width&&t.height?`${t.width}/${t.height}`:"4/3";return s("button",{class:"dc-img",style:`--w:${$r(t.width,t.height)}px;aspect-ratio:${r}`,"aria-label":`Open image ${t.name}`,onClick:i=>n.openLightbox(t.url||e,t.name,i.currentTarget.getBoundingClientRect()),children:s("img",{src:e,alt:t.name,loading:"lazy"})})}async function ps(t){try{const e=await fetch(t.url);if(!e.ok)throw new Error(String(e.status));const n=URL.createObjectURL(await e.blob()),r=document.createElement("a");r.href=n,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch{window.open(t.url,"_blank","noopener,noreferrer")}}function fs({a:t}){return s("button",{class:"dc-file",onClick:()=>void ps(t),"aria-label":`Download ${t.name}`,children:[s("span",{class:`dc-ftype${Yt(t)?" is-image":""}`,children:qt(t.name)}),s("span",{class:"tx",children:[s("b",{children:t.name}),s("small",{children:[Ht(t.size)," · ",qt(t.name)]})]}),s("span",{class:"dl",children:s(N,{name:"dl",size:16})})]})}function hs(){const{actions:t}=q(),e=H(d=>d.identity),[n,r]=P(e.name),[i,o]=P(e.email),[a,c]=P({}),u=A(null),p=A(null);return R(()=>{Cr()&&setTimeout(()=>p.current?.focus({preventScroll:!0}),350)},[]),s("div",{class:"dc-intro",children:[s(Re,{size:28}),s("div",{class:"card",ref:u,children:[s("h4",{children:"Who should we reply to?"}),s("p",{children:"Your message is ready. Add your name and email so the team knows who they're talking to."}),s("form",{onSubmit:d=>{d.preventDefault();const g={name:n.trim()?void 0:"Tell us what to call you.",email:gr(i)?void 0:"That email doesn't look right."};if(c(g),g.name||g.email){$(u.current,[{transform:"translateX(-5px)"},{transform:"translateX(5px)"},{transform:"translateX(-3px)"},{transform:"none"}],{duration:360});return}t.completeIntro(n,i)},noValidate:!0,children:[s("label",{class:`dc-in${a.name?" is-err":""}`,children:[s("span",{children:"Name"}),s("input",{ref:p,id:"dc-name",name:"name",autocomplete:"name",placeholder:"Ada Lovelace",maxLength:256,value:n,onInput:d=>r(d.currentTarget.value)}),a.name&&s("em",{children:a.name})]}),s("label",{class:`dc-in${a.email?" is-err":""}`,children:[s("span",{children:"Email"}),s("input",{id:"dc-email",name:"email",type:"email",autocomplete:"email",placeholder:"ada@example.com",value:i,onInput:d=>o(d.currentTarget.value)}),a.email&&s("em",{children:a.email})]}),s("button",{class:"dc-btn",type:"submit",children:[s(N,{name:"send",size:15})," Send message"]})]})]})]})}const Ur=[["😀","Smileys","😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 😉 😍 🥰 😘 😋 😜 🤪 🤓 😎 🥳 😏 😒 😔 😕 🙁 😣 😩 🥺 😢 😭 😤 😠 🤯 😳 😱 🤗 🤔 🤫 😐 🙄 😬 😴 😷"],["👋","People","👋 🤚 ✋ 👌 🤌 ✌️ 🤞 🤟 🤘 👈 👉 👆 👇 👍 👎 ✊ 👊 👏 🙌 🫶 🙏 💪 ✍️ 👀"],["🎮","Objects","💻 🖥️ ⌨️ 🖱️ 📱 🎮 🕹️ 🎧 📦 📎 📌 📝 📅 🔒 🔑 🛠️ ⚙️ 🧪 💡 🔋 📈 📉 🧾 💳 🗂️"],["❤️","Symbols","❤️ 🧡 💛 💚 💙 💜 🖤 🤍 💯 ✅ ❌ ⚠️ ❓ ❗ 🔥 ✨ ⭐ 🎉 🎊 🚀 💬 🆗 🆒 ⏳ 🌊"]];function gs({closed:t,placeholder:e}){const{actions:n}=q(),{tray:r,notice:i}=H(b=>({tray:b.tray,notice:b.notice})),[o,a]=P(""),[c,u]=P(!1),p=A(null),v=A(null),d=A(null),g=A(null),x=A(t);R(()=>{const b=p.current;b&&(b.style.height="",b.style.height=`${Math.min(b.scrollHeight,128)}px`)},[o,t]),R(()=>{x.current!==t&&($(g.current,[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"none"}],{duration:380}),x.current=t)},[t]),de(()=>{if(!i)return;$(d.current,[{transform:"translateX(-5px)"},{transform:"translateX(5px)"},{transform:"translateX(-3px)"},{transform:"none"}],{duration:360});const b=setTimeout(n.clearNotice,3200);return()=>clearTimeout(b)},[i,n]);const w=!!o.trim()||r.length>0,_=()=>{w&&(n.send(o),a(""),u(!1),p.current?.focus({preventScroll:!0}))},C=b=>{const k=p.current,U=k?.selectionStart??o.length,F=k?.selectionEnd??o.length,Y=o.slice(0,U)+b+o.slice(F);a(Y),requestAnimationFrame(()=>{k&&(k.focus({preventScroll:!0}),k.selectionStart=k.selectionEnd=U+b.length)})};return t?s("footer",{class:"dc-composer",ref:g,children:[s("div",{class:"dc-resolved",children:[s("p",{children:"This conversation was resolved. Need anything else?"}),s("button",{class:"dc-btn",onClick:n.newConversation,children:[s(N,{name:"plus",size:16})," Start a new conversation"]})]}),s(zr,{})]}):s("footer",{class:"dc-composer",ref:g,children:[i&&s(ms,{text:i.text},i.at),c&&s(ys,{onPick:C,onClose:()=>u(!1)}),s("div",{class:"dc-field",ref:d,children:[r.length>0&&s("div",{class:"dc-tray",children:r.map(b=>s(vs,{id:b.id,file:b.file,previewUrl:b.previewUrl,onRemove:()=>n.removeFromTray(b.id)},b.id))}),s("div",{class:"dc-input-row",children:[s("textarea",{ref:p,id:"dc-input",rows:1,"aria-label":"Message",placeholder:e,value:o,onInput:b=>a(b.currentTarget.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&Cr()&&(b.preventDefault(),_()),b.key==="Escape"&&c&&(b.preventDefault(),u(!1))},onPaste:b=>{const k=[...b.clipboardData?.files??[]];k.length&&(b.preventDefault(),n.addFiles(k))}}),s("button",{class:"dc-tool","aria-label":"Attach a file",onClick:()=>v.current?.click(),children:s(N,{name:"clip",size:20})}),s("button",{class:"dc-tool","data-emoji-toggle":!0,"aria-label":"Emoji","aria-expanded":c,onClick:()=>u(b=>!b),children:s(N,{name:"smile",size:20})}),s("button",{class:"dc-send","aria-label":"Send",disabled:!w,onClick:_,children:s(N,{name:"send",size:18})})]})]}),s("input",{ref:v,type:"file",multiple:!0,hidden:!0,accept:pr.join(","),onChange:b=>{const k=b.currentTarget;n.addFiles([...k.files??[]]),k.value="",p.current?.focus({preventScroll:!0})}}),s(zr,{})]})}function zr(){return s("a",{class:"dc-powered",href:"https://deskcord.chat",target:"_blank",rel:"noopener",children:["Powered by ",s(Tr,{})]})}function ms({text:t}){const e=A(null);return R(()=>{$(e.current,[{opacity:0,transform:"translateY(6px) scale(.96)"},{opacity:1,transform:"none"}],{duration:320,easing:Z.spring})},[]),s("div",{class:"dc-toast",role:"alert",children:s("span",{ref:e,children:[s(N,{name:"alert",size:15}),t]})})}function vs({file:t,previewUrl:e,onRemove:n}){const r=A(null);R(()=>{$(r.current,[{opacity:0,transform:"scale(.6)"},{opacity:1,transform:"none"}],{duration:420,easing:Z.spring})},[]);const i=()=>{const c=$(r.current,[{opacity:1,transform:"none"},{opacity:0,transform:"scale(.6)"}],{duration:180,easing:Z.in,fill:"forwards"});c?c.onfinish=n:n()},o=t.name||"image.png",a=s("button",{class:"rm","aria-label":`Remove ${o}`,onClick:i,children:s(N,{name:"x",size:11})});return e?s("div",{class:"dc-chip img",ref:r,children:[s("img",{src:e,alt:o}),a]}):s("div",{class:"dc-chip file",ref:r,children:[s("span",{class:"dc-ftype",children:"PDF"}),s("span",{class:"tx",children:[s("b",{children:o}),s("small",{children:Ht(t.size)})]}),a]})}function ys({onPick:t,onClose:e}){const[n,r]=P(0),i=A(null);R(()=>{$(i.current,[{opacity:0,transform:"translateY(8px) scale(.94)"},{opacity:1,transform:"none"}],{duration:340,easing:Z.spring})},[]),de(()=>{const c=u=>{const p=u.composedPath();p.includes(i.current)||p.some(v=>v instanceof Element&&v.hasAttribute("data-emoji-toggle"))||e()};return document.addEventListener("pointerdown",c,!0),()=>document.removeEventListener("pointerdown",c,!0)},[e]);const[,o,a]=Ur[n];return s("div",{class:"dc-emoji",ref:i,role:"dialog","aria-label":"Emoji",onKeyDown:c=>{c.key==="Escape"&&(c.preventDefault(),e())},children:[s("div",{class:"grid",children:[s("div",{class:"cat",children:o}),a.split(" ").map(c=>s("button",{"aria-label":c,onClick:()=>t(c),children:c},c))]}),s("div",{class:"tabs",children:Ur.map(([c,u],p)=>s("button",{"aria-label":u,"aria-pressed":p===n,onClick:()=>r(p),children:c},u))})]})}const bs=[],xs=[];function ws({frozenThreadId:t}){const{actions:e}=q(),n=H(E=>E.activeThreadId),r=t!==void 0?t:n,i=H(E=>{const re=r?E.conversations[r]??null:null,we=!re||re.status==="open";return{conv:re,outbox:we?E.outbox:bs,events:r&&E.events[r]||xs,typing:!!(r&&E.typing[r]),guild:E.guild,identity:E.identity,open:E.open,canGoBack:!!E.token||Object.keys(E.conversations).some(Oe=>Oe!==r)}}),{conv:o,outbox:a,events:c,typing:u,guild:p,identity:v}=i,d=p.onlineCsMembers,g=Array.isArray(d)&&d.length===0,x=g?p.offline_message||Ft:null,w=Qe(()=>os(o,a,c,x),[o,a,c,x]),_=w.length===0,C=o?.status==="closed",b=o?.csMember??null,k=A(null),U=A(!0),[F,Y]=P(!1),te=w[w.length-1],fe=te?.key,V=(()=>{const E=te;return!!E&&(E.type==="out"||E.type==="intro"||E.type==="msg"&&E.m.from==="me")})(),K=E=>{const re=k.current;re&&re.scrollTo({top:re.scrollHeight,behavior:E&&zt()?"smooth":"auto"})},se=A(!1);R(()=>{if(!se.current){se.current=!0,K(!1);return}U.current||V?K(!0):Y(!0)},[fe,w.length]),R(()=>{u&&U.current&&K(!0)},[u]),R(()=>{i.open&&K(!1)},[i.open]);const z=v.name.trim().split(/\s+/)[0];return s(B,{children:[s("header",{class:"dc-head dc-head--compact",children:[i.canGoBack&&s("button",{class:"dc-hbtn","aria-label":"All conversations",onClick:e.goHome,children:s(N,{name:"left",size:22})}),s(_s,{memberKey:b?`${b.displayName}:${b.status}`:`g:${d?.length??"?"}`,children:b?s(B,{children:[s(oe,{member:b,size:38,withStatus:!0}),s("div",{class:"tx",children:[s("div",{class:"t",children:b.displayName}),s("div",{class:"s",children:s("span",{children:[p.name?`${p.name} · `:"",Xo[b.status]]})})]})]}):s(B,{children:[s(Re,{size:38,dot:d?d.length?"online":"offline":null}),s("div",{class:"tx",children:[s("div",{class:"t",children:p.name||"Support"}),s("div",{class:"s",children:d&&d.length>0?s(B,{children:[s("span",{class:"mini",children:Bt(d).map(E=>s(oe,{member:E,size:16},E.displayName))}),s("span",{children:Pt(d)})]}):s("span",{children:g?"Away · we'll reply as soon as we can":"We typically reply within a few minutes"})})]})]})}),s(Rr,{})]}),s(Es,{}),s("div",{class:"dc-scroll-wrap",children:[s("div",{class:"dc-scroll",ref:k,role:"log","aria-live":"polite",onScroll:()=>{const E=k.current;E&&(U.current=E.scrollHeight-E.scrollTop-E.clientHeight<90,U.current&&F&&Y(!1))},children:[_&&s("div",{class:"dc-welcome",children:[s("div",{class:"stack",children:d&&d.length>0?Bt(d).map(E=>s(oe,{member:E,size:44,withStatus:!0},E.displayName)):s(Re,{size:48})}),s("h3",{children:z&&v.verifiedUserId?`Hi ${z}, how can we help?`:"How can we help?"}),s("p",{children:g?p.offline_message||Ft:d&&d.length?`${Pt(d)}. We typically reply within a few minutes.`:"We typically reply within a few minutes."})]}),s(ss,{items:w,member:b}),u&&!C&&s(ks,{name:b?.displayName??"Support",avatar:b?.displayAvatarURL})]}),F&&s("button",{class:"dc-jump",onClick:()=>{K(!0),Y(!1)},children:[s(N,{name:"down",size:16})," New message"]})]}),s(gs,{closed:C,placeholder:g?"Leave a message…":`Message ${p.name||"us"}…`})]})}function _s({memberKey:t,children:e}){const n=A(null),r=A(!0);return R(()=>{if(r.current){r.current=!1;return}$(n.current,[{opacity:0,transform:"translateY(6px)"},{opacity:1,transform:"none"}],{duration:340})},[t]),s("div",{class:"dc-head-id",ref:n,children:e})}function ks({name:t,avatar:e}){const n=A(null);return R(()=>{n.current&&(n.current.style.transformOrigin="bottom left"),$(n.current,[{opacity:0,transform:"translateY(8px) scale(.9)"},{opacity:1,transform:"none"}],{duration:380,easing:Z.spring})},[]),s("div",{class:"dc-typing",ref:n,role:"status","aria-label":`${t} is typing`,children:[s(pe,{name:t,url:e,size:28}),s("div",{class:"dots",children:[s("i",{}),s("i",{}),s("i",{})]})]})}function Es(){const t=H(a=>a.connection),[e,n]=P("none"),r=A(t),i=A(null);de(()=>{let a;return t==="down"?n("down"):t==="up"&&r.current==="down"?(n("back"),a=setTimeout(()=>n("none"),2200)):t==="off"&&n("none"),r.current=t,()=>clearTimeout(a)},[t]);const o=e!=="none";return R(()=>{o&&$(i.current,[{opacity:0,transform:"translateY(-100%)"},{opacity:1,transform:"none"}],{duration:300})},[o]),e==="none"?null:s("div",{ref:i,class:`dc-conn ${e==="down"?"is-down":"is-up"}`,role:"status",children:e==="down"?s(B,{children:[s("span",{class:"dc-spin"})," Connection lost. Reconnecting…"]}):s(B,{children:[s(N,{name:"check",size:14})," Back online"]})})}function As(){const{actions:t}=q(),e=H(c=>c.lightbox),n=A(null),r=A(null),i=A(!1),o=c=>{const u=e?.from,p=r.current;if(!u||!p||!zt())return null;const v=p.getBoundingClientRect();if(!v.width)return null;const g=[{transform:`translate(${u.left-v.left}px, ${u.top-v.top}px) scale(${u.width/v.width}, ${u.height/v.height})`,borderRadius:"28px"},{transform:"none",borderRadius:"10px"}];return p.animate(c?g.reverse():g,{duration:c?320:460,easing:Z.out,fill:c?"forwards":"backwards"})},a=()=>{if(i.current)return;i.current=!0;const c=o(!0);n.current?.querySelectorAll(".bd, .bar").forEach(u=>u.animate([{opacity:1},{opacity:0}],{duration:240,fill:"forwards"})),c?c.onfinish=()=>t.closeLightbox():t.closeLightbox()};return R(()=>{if(!e)return;i.current=!1,$(n.current?.querySelector(".bd"),[{opacity:0},{opacity:1}],{duration:300}),$(n.current?.querySelector(".bar"),[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"none"}],{duration:300,delay:120});const c=r.current;c?.complete?o(!1):c&&(c.onload=()=>o(!1))},[e]),de(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),a())};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e]),e?s("div",{class:"dc-lightbox",ref:n,role:"dialog","aria-label":e.name,children:[s("div",{class:"bd",onClick:a}),s("div",{class:"bar",children:[s("span",{children:e.name}),s("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:[s(N,{name:"ext",size:15})," Open original"]}),s("button",{class:"x","aria-label":"Close",onClick:a,children:s(N,{name:"x",size:18})})]}),s("div",{class:"pic",onClick:a,children:s("img",{ref:r,src:e.url,alt:e.name})})]}):null}function Ts(){const{boot:t,dark:e,guild:n}=H(o=>({boot:o.boot,dark:o.dark,guild:o.guild})),r=Qe(()=>Mo({primary:n.primary_color,gradient:n.gradient_color,headerText:n.header_text_color,dark:e}),[n.primary_color,n.gradient_color,n.header_text_color,e]),i=Object.entries(r.vars).map(([o,a])=>`${o}:${a}`).join(";");return Ss(),t!=="ready"?null:s("div",{class:"dc","data-theme":e?"dark":"light","data-pos":n.widget_position==="bottom-left"?"left":"right","data-flat":r.flat?"":void 0,style:i,children:[s(Is,{}),s(Rs,{}),s(Cs,{}),s(As,{})]})}function Ss(){const{open:t,unread:e}=H(i=>({open:i.open,unread:Kn(i.conversations,i.lastReadAt)})),n=Yo(),r=e>0&&(!t||!n);de(()=>{if(!r)return;const i=`(${e}) New message${e>1?"s":""}`;let o=document.title,a=!1;const c=()=>{!a&&document.title!==i&&(o=document.title),a=!a,document.title=a?i:o};c();const u=setInterval(c,2500);return()=>{clearInterval(u),document.title===i&&(document.title=o)}},[r,e])}function Cs(){const{actions:t}=q(),{open:e,unread:n}=H(c=>({open:c.open,unread:Kn(c.conversations,c.lastReadAt)})),r=A(null),i=A(null),o=A(n);R(()=>{$(r.current,[{opacity:0,transform:"scale(.4)"},{opacity:1,transform:"none"}],{duration:520,delay:120,easing:Z.spring})},[]),R(()=>{n>o.current&&$(i.current,[{transform:"scale(0)"},{transform:"scale(1.25)",offset:.6},{transform:"scale(1)"}],{duration:420}),o.current=n},[n]);const a=n>0&&!e;return s("button",{ref:r,class:`dc-launcher${e?" is-open":""}${a?" has-unread":""}`,"aria-label":e?"Close chat":a?`Open chat, ${n} unread`:"Open chat","aria-expanded":e,onClick:t.toggle,children:[s("span",{class:"ic ic-chat",children:s(qo,{})}),s("span",{class:"ic ic-close",children:s(N,{name:"down",size:24})}),a&&s("span",{class:"dc-badge",ref:i,"aria-hidden":"true",children:n>99?"99+":n})]})}function Is(){const{actions:t}=q(),e=H(d=>{if(!d.preview||d.open)return null;const g=d.conversations[d.preview.threadId],x=g?.messages.find(w=>w.key===d.preview.key&&!w.deleted);return x?{threadId:g.threadId,message:x,member:g.csMember}:null}),n=A(null),r=A(e);e&&(r.current=e);const i=Wo(!!e,n,[{opacity:0,transform:"translateY(12px) scale(.94)"},{opacity:1,transform:"none"}],[{opacity:1},{opacity:0,transform:"translateY(6px) scale(.97)"}],{enter:{duration:460,easing:Z.spring}}),o=e??r.current;if(!i||!o)return null;const{message:a,member:c,threadId:u}=o,p=c?.displayName??a.authorName,v=a.text?_r(Ar(a.text),a.emojis):a.attachments.some(d=>!d.contentType?.startsWith("image/"))?"📄 Sent a file":"📷 Sent an image";return s("div",{ref:n,class:"dc-preview",role:"button",tabIndex:0,"aria-label":`New message from ${p}`,onClick:()=>{t.openConversation(u),t.open()},onKeyDown:d=>{d.key==="Enter"&&d.currentTarget.click()},children:[c?s(oe,{member:c,size:34,withStatus:!0}):s(pe,{name:p,size:34}),s("div",{style:"min-width:0",children:[s("div",{class:"who",children:s("b",{children:p})}),s("div",{class:"txt",dangerouslySetInnerHTML:{__html:v}})]}),s("button",{class:"x","aria-label":"Dismiss",onClick:d=>{d.stopPropagation(),t.dismissPreview()},children:s(N,{name:"x",size:12})})]})}function Rs(){const{actions:t}=q(),{open:e,view:n}=H(g=>({open:g.open,view:g.view})),r=A(null),[i,o]=P(e),[a,c]=P(e),[u,p]=P(!1),v=A(0);if(R(()=>{if(e){o(!0),c(!0);return}if(!a)return;const g=r.current?.animate([{opacity:1,transform:"none"},{opacity:0,transform:"translateY(10px) scale(.96)"}],{duration:170,easing:Z.in});if(!g){c(!1);return}return g.onfinish=()=>c(!1),()=>g.cancel()},[e]),R(()=>{if(!e||!a)return;const g=r.current;$(g,[{opacity:0},{opacity:1}],{duration:180}),$(g,[{transform:"translateY(18px) scale(.92)"},{transform:"none"}],{duration:520,easing:Z.spring,composite:"add"}),g?.querySelectorAll(".dc-hero > *, .dc-home-body > *, .dc-welcome > *, .dc-head-id, .dc-composer").forEach((x,w)=>$(x,[{opacity:0,transform:"translateY(8px)"},{opacity:1,transform:"none"}],{duration:420,delay:60+w*35}))},[e,a]),!i)return null;const d=g=>n==="chat"&&!!g.dataTransfer?.types.includes("Files");return s("section",{ref:r,class:"dc-panel",role:"dialog","aria-label":"Chat",hidden:!a,onKeyDown:g=>{g.key==="Escape"&&!g.defaultPrevented&&t.close()},onDragEnter:g=>{d(g)&&(g.preventDefault(),v.current++===0&&p(!0))},onDragOver:g=>{u&&g.preventDefault()},onDragLeave:()=>{v.current>0&&--v.current===0&&p(!1)},onDrop:g=>{u&&(g.preventDefault(),v.current=0,p(!1),t.addFiles([...g.dataTransfer?.files??[]]))},children:[s(Os,{}),u&&s(Ns,{})]})}function Ns(){const t=A(null);return R(()=>{$(t.current,[{opacity:0,transform:"scale(.98)"},{opacity:1,transform:"none"}],{duration:200})},[]),s("div",{class:"dc-drop",ref:t,children:[s("div",{class:"ic",children:s(N,{name:"upload",size:26})}),s("b",{children:"Drop to attach"}),s("small",{children:"Images or PDFs, up to 10 MB each"})]})}function Os(){const{store:t}=q(),{view:e,nav:n}=H(a=>({view:a.view,nav:a.nav})),r=`${e}:${n}`,[i,o]=P(()=>[{key:r,view:e,threadId:t.get().activeThreadId}]);return R(()=>{o(a=>a[a.length-1].key===r?a:[{...a[a.length-1],threadId:t.get().navPrev},{key:r,view:e,threadId:null}])},[r]),s("div",{class:"dc-views",children:i.map((a,c)=>s(Ls,{leaving:c<i.length-1,animateIn:i.length>1,back:e==="home",onGone:()=>o(u=>u.filter(p=>p.key!==a.key)),children:a.view==="home"?s(ns,{}):s(ws,{frozenThreadId:c<i.length-1?a.threadId:void 0})},a.key))})}function Ls({leaving:t,animateIn:e,back:n,onGone:r,children:i}){const o=A(null),a=n?-28:28;return R(()=>{e&&$(o.current,[{transform:`translateX(${a}%)`,opacity:0},{transform:"none",opacity:1}],{duration:340})},[]),R(()=>{if(!t)return;const c=$(o.current,[{transform:"none",opacity:1},{transform:`translateX(${-a}%)`,opacity:0}],{duration:300,fill:"forwards"}),u=setTimeout(r,340);return c&&(c.onfinish=r),()=>clearTimeout(u)},[t]),s("div",{ref:o,class:"dc-view",inert:t,style:t?"pointer-events:none":void 0,children:i})}function Br(){if(document.getElementById("deskcord-root"))return;const t=ai();if(!t)return;const e=Oo(t),n=window.deskcord;n.openChatbox=()=>e.actions.open(),n.closeChatbox=()=>e.actions.close(),n.identify=e.identify,n.logout=()=>{e.logout()};const r=matchMedia("(prefers-color-scheme: dark)"),i=()=>e.actions.setDark(t.theme==="dark"||t.theme==="auto"&&r.matches);i(),r.addEventListener("change",i);const o=document.createElement("div");o.id="deskcord-root",o.style.cssText="position:fixed;top:0;left:0;width:0;height:0;z-index:2147483000;",document.body.appendChild(o);const a=o.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=oi,a.appendChild(c);const u=document.createElement("div");a.appendChild(u),ri(s(Sr.Provider,{value:e,children:s(Ts,{})}),u),e.boot()}document.body?Br():document.addEventListener("DOMContentLoaded",Br,{once:!0})})();