youverify-liveness-web 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2519,7 +2519,7 @@ function ws() {
2519
2519
  });
2520
2520
  if (!a.ok)
2521
2521
  throw a;
2522
- return await a.json();
2522
+ return (await a.json()).data;
2523
2523
  } };
2524
2524
  }
2525
2525
  const bs = 360, $s = "#125766", Es = "https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg", ho = {
@@ -2,4 +2,4 @@
2
2
  (function(ee,C){typeof exports=="object"&&typeof module<"u"?module.exports=C():typeof define=="function"&&define.amd?define(C):(ee=typeof globalThis<"u"?globalThis:ee||self,ee.YouverifyLiveness=C())})(this,function(){"use strict";var ee,C,En,he,Cn,Tn,Ct,Tt,kt,Ft,kn,Ae={},Fn=[],yo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qe=Array.isArray;function te(e,t){for(var n in t)e[n]=t[n];return e}function xn(e){var t=e.parentNode;t&&t.removeChild(e)}function G(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ee.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Oe(e,a,r,o,null)}function Oe(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++En,__i:-1,__u:0};return o==null&&C.vnode!=null&&C.vnode(i),i}function xt(){return{current:null}}function D(e){return e.children}function Z(e,t){this.props=e,this.context=t}function _e(e,t){if(t==null)return e.__?_e(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?_e(e):null}function Sn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Sn(e)}}function St(e){(!e.__d&&(e.__d=!0)&&he.push(e)&&!Je.__r++||Cn!==C.debounceRendering)&&((Cn=C.debounceRendering)||Tn)(Je)}function Je(){var e,t,n,r,o,i,a,s;for(he.sort(Ct);e=he.shift();)e.__d&&(t=he.length,r=void 0,i=(o=(n=e).__v).__e,a=[],s=[],n.__P&&((r=te({},o)).__v=o.__v+1,C.vnode&&C.vnode(r),Pt(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,i??_e(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,Dn(a,r,s),r.__e!=i&&Sn(r)),he.length>t&&he.sort(Ct));Je.__r=0}function Pn(e,t,n,r,o,i,a,s,l,u,d){var c,p,f,_,y,m=r&&r.__k||Fn,h=t.length;for(n.__d=l,go(n,t,m),l=n.__d,c=0;c<h;c++)(f=n.__k[c])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?Ae:m[f.__i]||Ae,f.__i=c,Pt(e,f,p,o,i,a,s,l,u,d),_=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Lt(p.ref,null,f),d.push(f.ref,f.__c||_,f)),y==null&&_!=null&&(y=_),65536&f.__u||p.__k===f.__k?l=Ln(f,l,e):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:_&&(l=_.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=y}function go(e,t,n){var r,o,i,a,s,l=t.length,u=n.length,d=u,c=0;for(e.__k=[],r=0;r<l;r++)a=r+c,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Oe(null,o,null,null,null):Qe(o)?Oe(D,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Oe(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=wo(o,n,a,d),o.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&c--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s==a-1?c=s-a:s==a+1?c++:s>a?d>l-a?c+=s-a:c--:s<a&&c++,s!==r+c&&(o.__u|=65536))):(i=n[a])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=_e(i)),Mt(i,i,!1),n[a]=null,d--);if(d)for(r=0;r<u;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=_e(i)),Mt(i,i))}function Ln(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Ln(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=_e(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ne(e,t){return t=t||[],e==null||typeof e=="boolean"||(Qe(e)?e.some(function(n){ne(n,t)}):t.push(e)),t}function wo(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,l=t[n];if(l===null||l&&o==l.key&&i===l.type&&!(131072&l.__u))return n;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&i===l.type)return a;a--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&i===l.type)return s;s++}}return-1}function Mn(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||yo.test(t)?n:n+"px"}function et(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Mn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Mn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Tt,e.addEventListener(t,i?Ft:kt,i)):e.removeEventListener(t,i?Ft:kt,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Nn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Tt++;else if(t.t<n.u)return;return n(C.event?C.event(t):t)}}}function Pt(e,t,n,r,o,i,a,s,l,u){var d,c,p,f,_,y,m,h,g,T,b,$,x,A,M,S,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=C.__b)&&d(t);e:if(typeof N=="function")try{if(h=t.props,g="prototype"in N&&N.prototype.render,T=(d=N.contextType)&&r[d.__c],b=d?T?T.props.value:d.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:(g?t.__c=c=new N(h,b):(t.__c=c=new Z(h,b),c.constructor=N,c.render=$o),T&&T.sub(c),c.props=h,c.state||(c.state={}),c.context=b,c.__n=r,p=c.__d=!0,c.__h=[],c._sb=[]),g&&c.__s==null&&(c.__s=c.state),g&&N.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=te({},c.__s)),te(c.__s,N.getDerivedStateFromProps(h,c.__s))),f=c.props,_=c.state,c.__v=t,p)g&&N.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),g&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(g&&N.getDerivedStateFromProps==null&&h!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(h,b),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(h,c.__s,b)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=h,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(j){j&&(j.__=t)}),$=0;$<c._sb.length;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(h,c.__s,b),g&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,_,y)})}if(c.context=b,c.props=h,c.__P=e,c.__e=!1,x=C.__r,A=0,g){for(c.state=c.__s,c.__d=!1,x&&x(t),d=c.render(c.props,c.state,c.context),M=0;M<c._sb.length;M++)c.__h.push(c._sb[M]);c._sb=[]}else do c.__d=!1,x&&x(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++A<25);c.state=c.__s,c.getChildContext!=null&&(r=te(te({},r),c.getChildContext())),g&&!p&&c.getSnapshotBeforeUpdate!=null&&(y=c.getSnapshotBeforeUpdate(f,_)),Pn(e,Qe(S=d!=null&&d.type===D&&d.key==null?d.props.children:d)?S:[S],t,n,r,o,i,a,s,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&a.push(c),m&&(c.__E=c.__=null)}catch(j){if(t.__v=null,l||i!=null){for(t.__u|=l?160:32;s&&s.nodeType===8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else t.__e=n.__e,t.__k=n.__k;C.__e(j,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=bo(n.__e,t,n,r,o,i,a,l,u);(d=C.diffed)&&d(t)}function Dn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Lt(n[r],n[++r],n[++r]);C.__c&&C.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){C.__e(i,o.__v)}})}function bo(e,t,n,r,o,i,a,s,l){var u,d,c,p,f,_,y,m=n.props,h=t.props,g=t.type;if(g==="svg"?o="http://www.w3.org/2000/svg":g==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!g&&(g?f.localName===g:f.nodeType===3)){e=f,i[u]=null;break}}if(e==null){if(g===null)return document.createTextNode(h);e=document.createElementNS(o,g,h.is&&h),i=null,s=!1}if(g===null)m===h||s&&e.data===h||(e.data=h);else{if(i=i&&ee.call(e.childNodes),m=n.props||Ae,!s&&i!=null)for(m={},u=0;u<e.attributes.length;u++)m[(f=e.attributes[u]).name]=f.value;for(u in m)if(f=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")c=f;else if(u!=="key"&&!(u in h)){if(u=="value"&&"defaultValue"in h||u=="checked"&&"defaultChecked"in h)continue;et(e,u,null,f,o)}}for(u in h)f=h[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?_=f:u=="checked"?y=f:u==="key"||s&&typeof f!="function"||m[u]===f||et(e,u,f,m[u],o);if(d)s||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),Pn(e,Qe(p)?p:[p],t,n,r,g==="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&_e(n,0),s,l),i!=null)for(u=i.length;u--;)i[u]!=null&&xn(i[u]);s||(u="value",_!==void 0&&(_!==e[u]||g==="progress"&&!_||g==="option"&&_!==m[u])&&et(e,u,_,m[u],o),u="checked",y!==void 0&&y!==e[u]&&et(e,u,y,m[u],o))}return e}function Lt(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){C.__e(o,n)}}function Mt(e,t,n){var r,o;if(C.unmount&&C.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Lt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){C.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Mt(r[o],t,n||typeof e.type!="function");n||e.__e==null||xn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function $o(e,t,n){return this.constructor(e,n)}function Fe(e,t,n){var r,o,i,a;C.__&&C.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],Pt(t,e=(!r&&n||t).__k=G(D,null,[e]),o||Ae,Ae,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ee.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),Dn(i,e,a)}function Hn(e,t){Fe(e,t,Hn)}function Eo(e,t,n){var r,o,i,a,s=te({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?r=t[i]:i=="ref"?o=t[i]:s[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?ee.call(arguments,2):n),Oe(e.type,s,r||e.key,o||e.ref,null)}function B(e,t){var n={__c:t="__cC"+kn++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(s){s.__e=!0,St(s)})},this.sub=function(a){o.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o&&o.splice(o.indexOf(a),1),s&&s.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}ee=Fn.slice,C={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},En=0,Z.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=te({},this.state),typeof e=="function"&&(e=e(te({},n),this.props)),e&&te(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),St(this))},Z.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),St(this))},Z.prototype.render=D,he=[],Tn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ct=function(e,t){return e.__v.__b-t.__v.__b},Je.__r=0,Tt=0,kt=Nn(!1),Ft=Nn(!0),kn=0;var Co=0;function v(e,t,n,r,o,i){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Co,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return C.vnode&&C.vnode(u),u}var re,P,Nt,An,xe=0,On=[],O=C,In=O.__b,Rn=O.__r,Vn=O.diffed,Un=O.__c,jn=O.unmount,Wn=O.__;function me(e,t){O.__h&&O.__h(P,e,xe||t),xe=0;var n=P.__H||(P.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function k(e){return xe=1,Ie(Bn,e)}function Ie(e,t,n){var r=me(re++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Bn(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,s);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=P,!P.u)){var o=function(s,l,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,s,l,u);var c=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(c=!0)}}),!(!c&&r.__c.props===s)&&(!i||i.call(this,s,l,u))};P.u=!0;var i=P.shouldComponentUpdate,a=P.componentWillUpdate;P.componentWillUpdate=function(s,l,u){if(this.__e){var d=i;i=void 0,o(s,l,u),i=d}a&&a.call(this,s,l,u)},P.shouldComponentUpdate=o}return r.__N||r.__}function L(e,t){var n=me(re++,3);!O.__s&&Ot(n.__H,t)&&(n.__=e,n.i=t,P.__H.__h.push(n))}function ye(e,t){var n=me(re++,4);!O.__s&&Ot(n.__H,t)&&(n.__=e,n.i=t,P.__h.push(n))}function w(e){return xe=5,F(function(){return{current:e}},[])}function Dt(e,t,n){xe=6,ye(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function F(e,t){var n=me(re++,7);return Ot(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function I(e,t){return xe=8,F(function(){return e},t)}function U(e){var t=P.context[e.__c],n=me(re++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(P)),t.props.value):e.__}function Ht(e,t){O.useDebugValue&&O.useDebugValue(t?t(e):e)}function To(e){var t=me(re++,10),n=k();return t.__=e,P.componentDidCatch||(P.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function ce(){var e=me(re++,11);if(!e.__){for(var t=P.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ko(){for(var e;e=On.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(tt),e.__H.__h.forEach(At),e.__H.__h=[]}catch(t){e.__H.__h=[],O.__e(t,e.__v)}}O.__b=function(e){P=null,In&&In(e)},O.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Wn&&Wn(e,t)},O.__r=function(e){Rn&&Rn(e),re=0;var t=(P=e.__c).__H;t&&(Nt===P?(t.__h=[],P.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(tt),t.__h.forEach(At),t.__h=[],re=0)),Nt=P},O.diffed=function(e){Vn&&Vn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(On.push(t)!==1&&An===O.requestAnimationFrame||((An=O.requestAnimationFrame)||Fo)(ko)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Nt=P=null},O.__c=function(e,t){t.some(function(n){try{n.__h.forEach(tt),n.__h=n.__h.filter(function(r){return!r.__||At(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],O.__e(r,n.__v)}}),Un&&Un(e,t)},O.unmount=function(e){jn&&jn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{tt(r)}catch(o){t=o}}),n.__H=void 0,t&&O.__e(t,n.__v))};var zn=typeof requestAnimationFrame=="function";function Fo(e){var t,n=function(){clearTimeout(r),zn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);zn&&(t=requestAnimationFrame(n))}function tt(e){var t=P,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),P=t}function At(e){var t=P;e.__c=e.__(),P=t}function Ot(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Bn(e,t){return typeof t=="function"?t(e):t}function qn(e,t){for(var n in t)e[n]=t[n];return e}function It(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function nt(e,t){this.props=e,this.context=t}function Yn(e,t){function n(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!a:It(this.props,o)}function r(o){return this.shouldComponentUpdate=n,G(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(nt.prototype=new Z).isPureReactComponent=!0,nt.prototype.shouldComponentUpdate=function(e,t){return It(this.props,e)||It(this.state,t)};var Kn=C.__b;C.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Kn&&Kn(e)};var xo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Rt(e){function t(n){var r=qn({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=xo,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Gn=function(e,t){return e==null?null:ne(ne(e).map(t))},Zn={map:Gn,forEach:Gn,count:function(e){return e?ne(e).length:0},only:function(e){var t=ne(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ne},So=C.__e;C.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}So(e,t,n,r)};var Xn=C.unmount;function Qn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=qn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Qn(r,t,n)})),e}function Jn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Jn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Re(){this.__u=0,this.t=null,this.__b=null}function er(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function tr(e){var t,n,r;function o(i){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return G(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Se(){this.u=null,this.o=null}C.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Xn&&Xn(e)},(Re.prototype=new Z).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=er(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Jn(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Re.prototype.componentWillUnmount=function(){this.t=[]},Re.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Qn(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&G(D,null,e.fallback);return o&&(o.__u&=-33),[G(D,null,t.__a?null:e.children),o]};var nr=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Po(e){return this.getChildContext=function(){return e.context},e.children}function Lo(e){var t=this,n=e.i;t.componentWillUnmount=function(){Fe(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Fe(G(Po,{context:t.context},e.__v),t.l)}function rt(e,t){var n=G(Lo,{__v:e,i:t});return n.containerInfo=t,n}(Se.prototype=new Z).__a=function(e){var t=this,n=er(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),nr(t,e,r)):o()};n?n(i):i()}},Se.prototype.render=function(e){this.u=null,this.o=new Map;var t=ne(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Se.prototype.componentDidUpdate=Se.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){nr(e,n,t)})};var rr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Mo=/^(?: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]/,No=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Do=/[A-Z0-9]/g,Ho=typeof document<"u",Ao=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function or(e,t,n){return t.__k==null&&(t.textContent=""),Fe(e,t),typeof n=="function"&&n(),e?e.__c:null}function ir(e,t,n){return Hn(e,t),typeof n=="function"&&n(),e?e.__c:null}Z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ar=C.event;function Oo(){}function Io(){return this.cancelBubble}function Ro(){return this.defaultPrevented}C.event=function(e){return ar&&(e=ar(e)),e.persist=Oo,e.isPropagationStopped=Io,e.isDefaultPrevented=Ro,e.nativeEvent=e};var Vt,Vo={enumerable:!1,configurable:!0,get:function(){return this.class}},sr=C.vnode;C.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||Ho&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var s=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===!0?a="":s==="translate"&&a==="no"?a=!1:s==="ondoubleclick"?i="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||Ao(n.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":No.test(i)?i=s:r.indexOf("-")===-1&&Mo.test(i)?i=i.replace(Do,"-$&").toLowerCase():a===null&&(a=void 0):s=i="oninput",s==="oninput"&&o[i=s]&&(i="oninputCapture"),o[i]=a}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=ne(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=ne(n.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Vo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=rr,sr&&sr(e)};var lr=C.__r;C.__r=function(e){lr&&lr(e),Vt=e.__c};var cr=C.diffed;C.diffed=function(e){cr&&cr(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Vt=null};var ur={ReactCurrentDispatcher:{current:{readContext:function(e){return Vt.__n[e.__c].props.value},useCallback:I,useContext:U,useDebugValue:Ht,useDeferredValue:Wt,useEffect:L,useId:ce,useImperativeHandle:Dt,useInsertionEffect:Bt,useLayoutEffect:ye,useMemo:F,useReducer:Ie,useRef:w,useState:k,useSyncExternalStore:ot,useTransition:zt}}},Uo="17.0.2";function dr(e){return G.bind(null,e)}function Pe(e){return!!e&&e.$$typeof===rr}function fr(e){return Pe(e)&&e.type===D}function pr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Ut(e){return Pe(e)?Eo.apply(null,arguments):e}function vr(e){return!!e.__k&&(Fe(null,e),!0)}function hr(e){return e&&(e.base||e.nodeType===1&&e)||null}var _r=function(e,t){return e(t)},mr=function(e,t){return e(t)},yr=D;function jt(e){e()}function Wt(e){return e}function zt(){return[!1,jt]}var Bt=ye,gr=Pe;function ot(e,t){var n=t(),r=k({h:{__:n,v:t}}),o=r[0].h,i=r[1];return ye(function(){o.__=n,o.v=t,qt(o)&&i({h:o})},[e,n,t]),L(function(){return qt(o)&&i({h:o}),e(function(){qt(o)&&i({h:o})})},[e]),n}function qt(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var E={useState:k,useId:ce,useReducer:Ie,useEffect:L,useLayoutEffect:ye,useInsertionEffect:Bt,useTransition:zt,useDeferredValue:Wt,useSyncExternalStore:ot,startTransition:jt,useRef:w,useImperativeHandle:Dt,useMemo:F,useCallback:I,useContext:U,useDebugValue:Ht,version:"17.0.2",Children:Zn,render:or,hydrate:ir,unmountComponentAtNode:vr,createPortal:rt,createElement:G,createContext:B,createFactory:dr,cloneElement:Ut,createRef:xt,Fragment:D,isValidElement:Pe,isElement:gr,isFragment:fr,isMemo:pr,findDOMNode:hr,Component:Z,PureComponent:nt,memo:Yn,forwardRef:Rt,flushSync:mr,unstable_batchedUpdates:_r,StrictMode:yr,Suspense:Re,SuspenseList:Se,lazy:tr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ur};const wr=Object.freeze(Object.defineProperty({__proto__:null,Children:Zn,Component:Z,Fragment:D,PureComponent:nt,StrictMode:yr,Suspense:Re,SuspenseList:Se,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ur,cloneElement:Ut,createContext:B,createElement:G,createFactory:dr,createPortal:rt,createRef:xt,default:E,findDOMNode:hr,flushSync:mr,forwardRef:Rt,hydrate:ir,isElement:gr,isFragment:fr,isMemo:pr,isValidElement:Pe,lazy:tr,memo:Yn,render:or,startTransition:jt,unmountComponentAtNode:vr,unstable_batchedUpdates:_r,useCallback:I,useContext:U,useDebugValue:Ht,useDeferredValue:Wt,useEffect:L,useErrorBoundary:To,useId:ce,useImperativeHandle:Dt,useInsertionEffect:Bt,useLayoutEffect:ye,useMemo:F,useReducer:Ie,useRef:w,useState:k,useSyncExternalStore:ot,useTransition:zt,version:Uo},Symbol.toStringTag,{value:"Module"})),br=typeof document<"u"?E.useLayoutEffect:()=>{};function jo(e){const t=w(null);return br(()=>{t.current=e},[e]),I((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ve=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},ge=e=>e&&"window"in e&&e.window===e?e:Ve(e).defaultView||window;function Wo(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function zo(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Bo(){return zo(/^Mac/i)}function qo(){return Wo(/Android/i)}function Yo(e){return e.mozInputSource===0&&e.isTrusted?!0:qo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Ko{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function $r(e){let t=w({isFocused:!1,observer:null});br(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=jo(r=>{e==null||e(r)});return I(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=a=>{t.current.isFocused=!1,o.disabled&&n(new Ko("blur",a)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var a;(a=t.current.observer)===null||a===void 0||a.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function Go(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=I(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),a=$r(i),s=I(l=>{const u=Ve(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),o&&o(!0),a(l))},[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Ue=null,Yt=new Set,je=new Map,we=!1,Kt=!1;const Zo={Tab:!0,Escape:!0};function Gt(e,t){for(let n of Yt)n(e,t)}function Xo(e){return!(e.metaKey||!Bo()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function it(e){we=!0,Xo(e)&&(Ue="keyboard",Gt("keyboard",e))}function K(e){Ue="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(we=!0,Gt("pointer",e))}function Er(e){Yo(e)&&(we=!0,Ue="virtual")}function Cr(e){e.target===window||e.target===document||(!we&&!Kt&&(Ue="virtual",Gt("virtual",e)),we=!1,Kt=!1)}function Tr(){we=!1,Kt=!0}function Zt(e){if(typeof window>"u"||je.get(ge(e)))return;const t=ge(e),n=Ve(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){we=!0,r.apply(this,arguments)},n.addEventListener("keydown",it,!0),n.addEventListener("keyup",it,!0),n.addEventListener("click",Er,!0),t.addEventListener("focus",Cr,!0),t.addEventListener("blur",Tr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",K,!0),n.addEventListener("pointermove",K,!0),n.addEventListener("pointerup",K,!0)):(n.addEventListener("mousedown",K,!0),n.addEventListener("mousemove",K,!0),n.addEventListener("mouseup",K,!0)),t.addEventListener("beforeunload",()=>{kr(e)},{once:!0}),je.set(t,{focus:r})}const kr=(e,t)=>{const n=ge(e),r=Ve(e);t&&r.removeEventListener("DOMContentLoaded",t),je.has(n)&&(n.HTMLElement.prototype.focus=je.get(n).focus,r.removeEventListener("keydown",it,!0),r.removeEventListener("keyup",it,!0),r.removeEventListener("click",Er,!0),n.removeEventListener("focus",Cr,!0),n.removeEventListener("blur",Tr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",K,!0),r.removeEventListener("pointermove",K,!0),r.removeEventListener("pointerup",K,!0)):(r.removeEventListener("mousedown",K,!0),r.removeEventListener("mousemove",K,!0),r.removeEventListener("mouseup",K,!0)),je.delete(n))};function Qo(e){const t=Ve(e);let n;return t.readyState!=="loading"?Zt(e):(n=()=>{Zt(e)},t.addEventListener("DOMContentLoaded",n)),()=>kr(e,n)}typeof document<"u"&&Qo();function Fr(){return Ue!=="pointer"}const Jo=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ei(e,t,n){var r;const o=typeof window<"u"?ge(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?ge(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?ge(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?ge(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!Jo.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof a&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof s&&!Zo[n.key])}function ti(e,t,n){Zt(),L(()=>{let r=(o,i)=>{ei(!!(n!=null&&n.isTextInput),o,i)&&e(Fr())};return Yt.add(r),()=>{Yt.delete(r)}},t)}function ni(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=w({isFocusWithin:!1}),a=I(u=>{i.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(u),o&&o(!1))},[n,o,i]),s=$r(a),l=I(u=>{!i.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),o&&o(!0),i.current.isFocusWithin=!0,s(u))},[r,o,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:a}}}let at=!1,Xt=0;function Qt(){at=!0,setTimeout(()=>{at=!1},50)}function xr(e){e.pointerType==="touch"&&Qt()}function ri(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",xr):document.addEventListener("touchend",Qt),Xt++,()=>{Xt--,!(Xt>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",xr):document.removeEventListener("touchend",Qt))}}function oi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=k(!1),s=w({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;L(ri,[]);let{hoverProps:l,triggerHoverEnd:u}=F(()=>{let d=(f,_)=>{if(s.pointerType=_,o||_==="touch"||s.isHovered||!f.currentTarget.contains(f.target))return;s.isHovered=!0;let y=f.currentTarget;s.target=y,t&&t({type:"hoverstart",target:y,pointerType:_}),n&&n(!0),a(!0)},c=(f,_)=>{if(s.pointerType="",s.target=null,_==="touch"||!s.isHovered)return;s.isHovered=!1;let y=f.currentTarget;r&&r({type:"hoverend",target:y,pointerType:_}),n&&n(!1),a(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=f=>{at&&f.pointerType==="mouse"||d(f,f.pointerType)},p.onPointerLeave=f=>{!o&&f.currentTarget.contains(f.target)&&c(f,f.pointerType)}):(p.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=f=>{!s.ignoreEmulatedMouseEvents&&!at&&d(f,"mouse"),s.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=f=>{!o&&f.currentTarget.contains(f.target)&&c(f,"mouse")}),{hoverProps:p,triggerHoverEnd:c}},[t,n,r,o,s]);return L(()=>{o&&u({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:l,isHovered:i}}function ii(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=w({isFocused:!1,isFocusVisible:t||Fr()}),[i,a]=k(!1),[s,l]=k(()=>o.current.isFocused&&o.current.isFocusVisible),u=I(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=I(f=>{o.current.isFocused=f,a(f),u()},[u]);ti(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:c}=Go({isDisabled:r,onFocusChange:d}),{focusWithinProps:p}=ni({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:s,focusProps:r?p:c}}var ai=Object.defineProperty,si=(e,t,n)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t,n)=>(si(e,typeof t!="symbol"?t+"":t,n),n);let li=class{constructor(){Jt(this,"current",this.detect()),Jt(this,"handoffState","pending"),Jt(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},be=new li;function st(e){return be.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function lt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ue(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return lt(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=ue();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function ct(){let[e]=k(ue);return L(()=>()=>e.dispose(),[e]),e}let W=(e,t)=>{be.isServer?L(e,t):ye(e,t)};function $e(e){let t=w(e);return W(()=>{t.current=e},[e]),t}let H=function(e){let t=$e(e);return E.useCallback((...n)=>t.current(...n),[t])};function ci(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function ui(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function di({disabled:e=!1}={}){let t=w(null),[n,r]=k(!1),o=ct(),i=H(()=>{t.current=null,r(!1),o.dispose()}),a=H(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let l=st(s.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=ci(u);r(ui(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:a,onPointerUp:i,onClick:i}}}let fi=B(void 0);function Sr(){return U(fi)}function en(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function de(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,de),r}var ut=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ut||{}),fe=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(fe||{});function Y({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??pi;let l=Pr(t,e);if(i)return dt(l,n,r,a,s);let u=o??0;if(u&2){let{static:d=!1,...c}=l;if(d)return dt(c,n,r,a,s)}if(u&1){let{unmount:d=!0,...c}=l;return de(d?0:1,{0(){return null},1(){return dt({...c,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return dt(l,n,r,a,s)}function dt(e,t={},n,r,o){let{as:i=n,children:a,refName:s="ref",...l}=tn(e,["unmount","static"]),u=e.ref!==void 0?{[s]:e.ref}:{},d=typeof a=="function"?a(t):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let c={};if(t){let p=!1,f=[];for(let[_,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&f.push(_.replace(/([A-Z])/g,m=>`-${m.toLowerCase()}`));if(p){c["data-headlessui-state"]=f.join(" ");for(let _ of f)c[`data-${_}`]=""}}if(i===D&&(Object.keys(Ee(l)).length>0||Object.keys(Ee(c)).length>0))if(!Pe(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Ee(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ee(l)).concat(Object.keys(Ee(c))).map(p=>` - ${p}`).join(`
3
3
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
4
4
  `)].join(`
5
- `))}else{let p=d.props,f=p==null?void 0:p.className,_=typeof f=="function"?(...h)=>en(f(...h),l.className):en(f,l.className),y=_?{className:_}:{},m=Pr(d.props,Ee(tn(l,["ref"])));for(let h in c)h in m&&delete c[h];return Ut(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return G(i,Object.assign({},tn(l,["ref"]),i!==D&&u,i!==D&&c),d)}function pi(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Pr(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function vi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let a of i)a==null||a(...o)}});return t}function z(e){var t;return Object.assign(Rt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ee(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function tn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let hi="button";function _i(e,t){var n;let r=Sr(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=ii({autoFocus:i}),{isHovered:u,hoverProps:d}=oi({isDisabled:o}),{pressed:c,pressProps:p}=di({disabled:o}),f=vi({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),_=F(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return Y({ourProps:f,theirProps:a,slot:_,defaultTag:hi,name:"Button"})}let mi=z(_i),yi="div";var ft=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ft||{});function gi(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Y({ourProps:i,theirProps:o,slot:{},defaultTag:yi,name:"Hidden"})}let nn=z(gi),wi=B(null);function bi({children:e}){let t=U(wi);if(!t)return E.createElement(E.Fragment,null,e);let{target:n}=t;return n?rt(E.createElement(E.Fragment,null,e),n):null}let Lr=Symbol();function $i(e,t=!0){return Object.assign(e,{[Lr]:t})}function Q(...e){let t=w(e);L(()=>{t.current=e},[e]);let n=H(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Lr]))?void 0:n}let rn=B(null);rn.displayName="DescriptionContext";function Mr(){let e=U(rn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Mr),t}return e}function Ei(){let[e,t]=k([]);return[e.length>0?e.join(" "):void 0,F(()=>function(n){let r=H(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=F(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return E.createElement(rn.Provider,{value:o},n.children)},[t])]}let Ci="p";function Ti(e,t){let n=ce(),r=Sr(),{id:o=`headlessui-description-${n}`,...i}=e,a=Mr(),s=Q(t);W(()=>a.register(o),[o,a.register]);let l=r||!1,u=F(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return Y({ourProps:d,theirProps:i,slot:u,defaultTag:Ci,name:a.name||"Description"})}let ki=z(Ti),Fi=Object.assign(ki,{});var Nr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Nr||{});let xi=B(()=>{});function Si({value:e,children:t}){return E.createElement(xi.Provider,{value:e},t)}let Pi=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Dr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let a=t[o].call(n,...i);a&&(n=a,r.forEach(s=>s()))}}}function Hr(e){return ot(e.subscribe,e.getSnapshot,e.getSnapshot)}let Li=new Pi(()=>Dr(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function Le(e,t){let n=Li.get(t),r=ce(),o=Hr(n);if(W(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let on=new Map,We=new Map;function Ar(e){var t;let n=(t=We.get(e))!=null?t:0;return We.set(e,n+1),n!==0?()=>Or(e):(on.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Or(e))}function Or(e){var t;let n=(t=We.get(e))!=null?t:1;if(n===1?We.delete(e):We.set(e,n-1),n!==1)return;let r=on.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,on.delete(e))}function Mi(e,{allowed:t,disallowed:n}={}){let r=Le(e,"inert-others");W(()=>{var o,i;if(!r)return;let a=ue();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Ar(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=st(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let c of d.children)s.some(p=>c.contains(p))||a.add(Ar(c));d=d.parentElement}}return a.dispose},[r,t,n])}function Ir(e,t,n){let r=$e(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});L(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=ue();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,r,e])}let an=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Ni=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var oe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(oe||{}),sn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(sn||{}),Di=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Di||{});function Hi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(an)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ai(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ni)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Rr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Rr||{});function Oi(e,t=0){var n;return e===((n=st(e))==null?void 0:n.body)?!1:de(t,{0(){return e.matches(an)},1(){let r=e;for(;r!==null;){if(r.matches(an))return!0;r=r.parentElement}return!1}})}var Ii=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ii||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ie(e){e==null||e.focus({preventScroll:!0})}let Ri=["textarea","input"].join(",");function Vi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ri))!=null?n:!1}function Ui(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ze(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?Ui(e):e:t&64?Ai(e):Hi(e);o.length>0&&a.length>1&&(a=a.filter(f=>!o.some(_=>_!=null&&"current"in _?(_==null?void 0:_.current)===f:_===f))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,c=a.length,p;do{if(d>=c||d+c<=0)return 0;let f=l+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}p=a[f],p==null||p.focus(u),d+=s}while(p!==i.activeElement);return t&6&&Vi(p)&&p.select(),2}function Vr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ji(){return/Android/gi.test(window.navigator.userAgent)}function Wi(){return Vr()||ji()}function Be(e,t,n,r){let o=$e(n);L(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Ur(e,t,n,r){let o=$e(n);L(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const jr=30;function zi(e,t,n){let r=Le(e,"outside-click"),o=$e(n),i=I(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(d)||l.composed&&l.composedPath().includes(f))return}return!Oi(d,Rr.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=w(null);Be(r,"pointerdown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Be(r,"mousedown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Be(r,"click",l=>{Wi()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=w({x:0,y:0});Be(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Be(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=jr||Math.abs(u.y-s.current.y)>=jr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Ur(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function qe(...e){return F(()=>st(...e),[...e])}function Wr(e,t,n,r){let o=$e(n);L(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function Bi(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function qi(){return Vr()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=ue();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(a=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let l=s.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Yi(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ki(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ce=Dr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ue(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Ki(n)},o=[qi(),Bi(),Yi()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ce.subscribe(()=>{let e=Ce.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Ce.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ce.dispatch("TEARDOWN",n)}});function Gi(e,t,n=()=>({containers:[]})){let r=Hr(Ce),o=t?r.get(t):void 0,i=o?o.count>0:!1;return W(()=>{if(!(!t||!e))return Ce.dispatch("PUSH",t,n),()=>Ce.dispatch("POP",t,n)},[e,t]),i}function Zi(e,t,n=()=>[document.body]){let r=Le(e,"scroll-lock");Gi(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Xi(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Qi(e=0){let[t,n]=k(e),r=I(l=>n(l),[t]),o=I(l=>n(u=>u|l),[t]),i=I(l=>(t&l)===l,[t]),a=I(l=>n(u=>u&~l),[n]),s=I(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var Ji=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Ji||{});function ea(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function ta(e,t,n,r){let[o,i]=k(n),{hasFlag:a,addFlag:s,removeFlag:l}=Qi(e&&o?3:0),u=w(!1),d=w(!1),c=ct();return W(function p(){var f;if(!e)return;n&&i(!0);let _=t.current;return _?((f=r==null?void 0:r.start)==null||f.call(r,n),na(_,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(s(3),l(4)):(s(4),l(2)))},run(){d.current?n?(l(3),s(4)):(l(4),s(3)):n?l(1):s(1)},done(){var y;d.current&&typeof _.getAnimations=="function"&&_.getAnimations().length>0||(u.current=!1,l(7),n||i(!1),(y=r==null?void 0:r.end)==null||y.call(r,n))}})):n?(s(3),c.nextFrame(()=>p())):void 0},[e,n,t,c]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function na(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ue();return oa(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(ra(e,r)),n()}),i.dispose}function ra(e,t){let n=Xi(t),r=ue();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[a,s]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,p)=>p-c);return d}),l=a+s;if(l!==0){let u=r.group(d=>{let c=d.setTimeout(()=>{n(),d.dispose()},l);d.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&(c(),d.addEventListener(e,"transitioncancel",f=>{f.target===f.currentTarget&&(n(),u())}))})});r.addEventListener(e,"transitionend",d=>{d.target===d.currentTarget&&(n(),r.dispose())})}else n();return r.dispose}function oa(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function ln(e,t){let n=w([]),r=H(e);L(()=>{let o=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}let pt=B(null);pt.displayName="OpenClosedContext";var X=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(X||{});function vt(){return U(pt)}function ia({value:e,children:t}){return E.createElement(pt.Provider,{value:e},t)}function aa({children:e}){return E.createElement(pt.Provider,{value:null},e)}function sa(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let pe=[];sa(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&pe[0]!==t.target&&(pe.unshift(t.target),pe=pe.filter(n=>n!=null&&n.isConnected),pe.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function zr(e){let t=H(e),n=w(!1);L(()=>(n.current=!1,()=>{n.current=!0,lt(()=>{n.current&&t()})}),[t])}function la(){let e=typeof document>"u";return"useSyncExternalStore"in wr?(t=>t.useSyncExternalStore)(wr)(()=>()=>{},()=>!1,()=>!e):!1}function Ye(){let e=la(),[t,n]=k(be.isHandoffComplete);return t&&be.isHandoffComplete===!1&&n(!1),L(()=>{t!==!0&&n(!0)},[t]),L(()=>be.handoff(),[]),e?!1:t}let Br=B(!1);function ca(){return U(Br)}function qr(e){return E.createElement(Br.Provider,{value:e.force},e.children)}function ua(e){let t=ca(),n=U(Kr),r=qe(e),[o,i]=k(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(be.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return L(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),L(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Yr=D,da=z(function(e,t){let n=e,r=w(null),o=Q($i(d=>{r.current=d}),t),i=qe(r),a=ua(r),[s]=k(()=>{var d;return be.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=U(cn),u=Ye();return W(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),W(()=>{if(s&&l)return l.register(s)},[l,s]),zr(()=>{var d;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))}),u?!a||!s?null:rt(Y({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Yr,name:"Portal"}),s):null});function fa(e,t){let n=Q(t),{enabled:r=!0,...o}=e;return r?E.createElement(da,{...o,ref:n}):Y({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Yr,name:"Portal"})}let pa=D,Kr=B(null);function va(e,t){let{target:n,...r}=e,o={ref:Q(t)};return E.createElement(Kr.Provider,{value:n},Y({ourProps:o,theirProps:r,defaultTag:pa,name:"Popover.Group"}))}let cn=B(null);function ha(){let e=U(cn),t=w([]),n=H(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=H(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=F(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,F(()=>function({children:i}){return E.createElement(cn.Provider,{value:o},i)},[o])]}let _a=z(fa),Gr=z(va),ma=Object.assign(_a,{Group:Gr});function ya(e,t=typeof document<"u"?document.defaultView:null,n){let r=Le(e,"escape");Wr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Nr.Escape&&n(o))})}function ga(){var e;let[t]=k(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=k((e=t==null?void 0:t.matches)!=null?e:!1);return W(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function wa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=qe(o),a=H(()=>{var s,l,u;let d=[];for(let c of e)c!==null&&(c instanceof HTMLElement?d.push(c):"current"in c&&c.current instanceof HTMLElement&&d.push(c.current));if(t!=null&&t.current)for(let c of t.current)d.push(c);for(let c of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(c.contains(o.current)||c.contains((u=(l=o.current)==null?void 0:l.getRootNode())==null?void 0:u.host)||d.some(p=>c.contains(p))||d.push(c));return d});return{resolveContainers:a,contains:H(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:F(()=>function(){return n!=null?null:E.createElement(nn,{features:ft.Hidden,ref:o})},[o,n])}}function un(){let e=w(!1);return W(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Ke=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ke||{});function ba(){let e=w(0);return Ur(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Zr(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let $a="div";var Te=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Te||{});function Ea(e,t){let n=w(null),r=Q(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Ye()||(s=0);let u=qe(n);Fa(s,{ownerDocument:u});let d=xa(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Sa(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=ba(),p=H(h=>{let g=n.current;g&&(T=>T())(()=>{de(c.current,{[Ke.Forwards]:()=>{ze(g,oe.First,{skipElements:[h.relatedTarget,i]})},[Ke.Backwards]:()=>{ze(g,oe.Last,{skipElements:[h.relatedTarget,i]})}})})}),f=Le(!!(s&2),"focus-trap#tab-lock"),_=ct(),y=w(!1),m={ref:r,onKeyDown(h){h.key=="Tab"&&(y.current=!0,_.requestAnimationFrame(()=>{y.current=!1}))},onBlur(h){if(!(s&4))return;let g=Zr(a);n.current instanceof HTMLElement&&g.add(n.current);let T=h.relatedTarget;T instanceof HTMLElement&&T.dataset.headlessuiFocusGuard!=="true"&&(Xr(g,T)||(y.current?ze(n.current,de(c.current,{[Ke.Forwards]:()=>oe.Next,[Ke.Backwards]:()=>oe.Previous})|oe.WrapAround,{relativeTo:h.target}):h.target instanceof HTMLElement&&ie(h.target)))}};return E.createElement(E.Fragment,null,f&&E.createElement(nn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:ft.Focusable}),Y({ourProps:m,theirProps:l,defaultTag:$a,name:"FocusTrap"}),f&&E.createElement(nn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:ft.Focusable}))}let Ca=z(Ea),Ta=Object.assign(Ca,{features:Te});function ka(e=!0){let t=w(pe.slice());return ln(([n],[r])=>{r===!0&&n===!1&&lt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=pe.slice())},[e,pe,t]),H(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Fa(e,{ownerDocument:t}){let n=!!(e&8),r=ka(n);ln(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&ie(r())},[n]),zr(()=>{n&&ie(r())})}function xa(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),a=Le(!!(e&1),"focus-trap#initial-focus"),s=un();return ln(()=>{if(e===0)return;if(!a){o!=null&&o.current&&ie(o.current);return}let l=n.current;l&&lt(()=>{if(!s.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(l.contains(u)){i.current=u;return}if(r!=null&&r.current)ie(r.current);else{if(e&16){if(ze(l,oe.First|oe.AutoFocus)!==sn.Error)return}else if(ze(l,oe.First)!==sn.Error)return;if(o!=null&&o.current&&(ie(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,a,e]),i}function Sa(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=un(),a=!!(e&4);Wr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=Zr(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?Xr(l,d)?(o.current=d,ie(d)):(s.preventDefault(),s.stopPropagation(),ie(u)):ie(o.current)},!0)}function Xr(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function Qr(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:eo)!==D||E.Children.count(e.children)===1}let ht=B(null);ht.displayName="TransitionContext";var Pa=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Pa||{});function La(){let e=U(ht);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ma(){let e=U(_t);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _t=B(null);_t.displayName="NestingContext";function mt(e){return"children"in e?mt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Jr(e,t){let n=$e(e),r=w([]),o=un(),i=ct(),a=H((f,_=fe.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(de(_,{[fe.Unmount](){r.current.splice(y,1)},[fe.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!mt(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=H(f=>{let _=r.current.find(({el:y})=>y===f);return _?_.state!=="visible"&&(_.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,fe.Unmount)}),l=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),c=H((f,_,y)=>{l.current.splice(0),t&&(t.chains.current[_]=t.chains.current[_].filter(([m])=>m!==f)),t==null||t.chains.current[_].push([f,new Promise(m=>{l.current.push(m)})]),t==null||t.chains.current[_].push([f,new Promise(m=>{Promise.all(d.current[_].map(([h,g])=>g)).then(()=>m())})]),_==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(_)):y(_)}),p=H((f,_,y)=>{Promise.all(d.current[_].splice(0).map(([m,h])=>h)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(_))});return F(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let eo=D,to=ut.RenderStrategy;function Na(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:u,enterFrom:d,enterTo:c,entered:p,leave:f,leaveFrom:_,leaveTo:y,...m}=e,h=w(null),g=Qr(e),T=Q(...g?[h,t]:t===null?[]:[t]),b=(n=m.unmount)==null||n?fe.Unmount:fe.Hidden,{show:$,appear:x,initial:A}=La(),[M,S]=k($?"visible":"hidden"),N=Ma(),{register:j,unregister:J}=N;W(()=>j(h),[j,h]),W(()=>{if(b===fe.Hidden&&h.current){if($&&M!=="visible"){S("visible");return}return de(M,{hidden:()=>J(h),visible:()=>j(h)})}},[M,h,j,J,$,b]);let Ne=Ye();W(()=>{if(g&&Ne&&M==="visible"&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,M,Ne,g]);let bn=A&&!x,bt=x&&$&&A,De=w(!1),He=Jr(()=>{De.current||(S("hidden"),J(h))},N),$t=H($n=>{De.current=!0;let Et=$n?"enter":"leave";He.onStart(h,Et,Xe=>{Xe==="enter"?i==null||i():Xe==="leave"&&(s==null||s())})}),ve=H($n=>{let Et=$n?"enter":"leave";De.current=!1,He.onStop(h,Et,Xe=>{Xe==="enter"?a==null||a():Xe==="leave"&&(l==null||l())}),Et==="leave"&&!mt(He)&&(S("hidden"),J(h))});L(()=>{g&&o||($t($),ve($))},[$,g,o]);let V=!(!o||!g||!Ne||bn),[,R]=ta(V,h,$,{start:$t,end:ve}),Vs=Ee({ref:T,className:((r=en(m.className,bt&&u,bt&&d,R.enter&&u,R.enter&&R.closed&&d,R.enter&&!R.closed&&c,R.leave&&f,R.leave&&!R.closed&&_,R.leave&&R.closed&&y,!R.transition&&$&&p))==null?void 0:r.trim())||void 0,...ea(R)}),Ze=0;return M==="visible"&&(Ze|=X.Open),M==="hidden"&&(Ze|=X.Closed),R.enter&&(Ze|=X.Opening),R.leave&&(Ze|=X.Closing),E.createElement(_t.Provider,{value:He},E.createElement(ia,{value:Ze},Y({ourProps:Vs,theirProps:m,defaultTag:eo,features:to,visible:M==="visible",name:"Transition.Child"})))}function Da(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=w(null),s=Qr(e),l=Q(...s?[a,t]:t===null?[]:[t]);Ye();let u=vt();if(n===void 0&&u!==null&&(n=(u&X.Open)===X.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=k(n?"visible":"hidden"),p=Jr(()=>{n||c("hidden")}),[f,_]=k(!0),y=w([n]);W(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),_(!1))},[y,n]);let m=F(()=>({show:n,appear:r,initial:f}),[n,r,f]);Ir(n,a,()=>c("hidden")),W(()=>{n?c("visible"):!mt(p)&&a.current!==null&&c("hidden")},[n,p]);let h={unmount:o},g=H(()=>{var b;f&&_(!1),(b=e.beforeEnter)==null||b.call(e)}),T=H(()=>{var b;f&&_(!1),(b=e.beforeLeave)==null||b.call(e)});return E.createElement(_t.Provider,{value:p},E.createElement(ht.Provider,{value:m},Y({ourProps:{...h,as:D,children:E.createElement(no,{ref:l,...h,...i,beforeEnter:g,beforeLeave:T})},theirProps:{},defaultTag:D,features:to,visible:d==="visible",name:"Transition"})))}function Ha(e,t){let n=U(ht)!==null,r=vt()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(dn,{ref:t,...e}):E.createElement(no,{ref:t,...e}))}let dn=z(Da),no=z(Na),fn=z(Ha),ae=Object.assign(dn,{Child:fn,Root:dn});var Aa=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Aa||{}),Oa=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Oa||{});let Ia={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},pn=B(null);pn.displayName="DialogContext";function yt(e){let t=U(pn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,yt),n}return t}function Ra(e,t){return de(t.type,Ia,e,t)}let ro=z(function(e,t){let n=ce(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,...d}=e,c=w(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(c.current||(c.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=vt();o===void 0&&p!==null&&(o=(p&X.Open)===X.Open);let f=w(null),_=Q(f,t),y=qe(f),m=o?0:1,[h,g]=Ie(Ra,{titleId:null,descriptionId:null,panelRef:xt()}),T=H(()=>i(!1)),b=H(V=>g({type:0,id:V})),$=Ye()?m===0:!1,[x,A]=ha(),M={get current(){var V;return(V=h.panelRef.current)!=null?V:f.current}},{resolveContainers:S,mainTreeNodeRef:N,MainTreeNode:j}=wa({portals:x,defaultContainers:[M]}),J=p!==null?(p&X.Closing)===X.Closing:!1;Mi(u||J?!1:$,{allowed:H(()=>{var V,R;return[(R=(V=f.current)==null?void 0:V.closest("[data-headlessui-portal]"))!=null?R:null]}),disallowed:H(()=>{var V,R;return[(R=(V=N.current)==null?void 0:V.closest("body > *:not(#headlessui-portal-root)"))!=null?R:null]})}),zi($,S,V=>{V.preventDefault(),T()}),ya($,y==null?void 0:y.defaultView,V=>{V.preventDefault(),V.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),T()}),Zi(u||J?!1:$,y,S),Ir($,f,T);let[Ne,bn]=Ei(),bt=F(()=>[{dialogState:m,close:T,setTitleId:b},h],[m,h,T,b]),De=F(()=>({open:m===0}),[m]),He={ref:_,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":h.titleId,"aria-describedby":Ne},$t=!ga(),ve=Te.None;return $&&!u&&(ve|=Te.RestoreFocus,ve|=Te.TabLock,l&&(ve|=Te.AutoFocus),$t&&(ve|=Te.InitialFocus)),E.createElement(aa,null,E.createElement(qr,{force:!0},E.createElement(ma,null,E.createElement(pn.Provider,{value:bt},E.createElement(Gr,{target:f},E.createElement(qr,{force:!1},E.createElement(bn,{slot:De},E.createElement(A,null,E.createElement(Ta,{initialFocus:a,initialFocusFallback:f,containers:S,features:ve},E.createElement(Si,{value:T},Y({ourProps:He,theirProps:d,slot:De,defaultTag:Va,features:Ua,visible:m===0,name:"Dialog"})))))))))),E.createElement(bi,null,E.createElement(j,null)))}),Va="div",Ua=ut.RenderStrategy|ut.Static;function ja(e,t){let{transition:n=!1,open:r,...o}=e,i=vt(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?E.createElement(ae,{show:r,transition:n,unmount:o.unmount},E.createElement(ro,{ref:t,...o})):E.createElement(ro,{ref:t,open:r,...o})}let Wa="div";function za(e,t){let n=ce(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=yt("Dialog.Panel"),l=Q(t,s.panelRef),u=F(()=>({open:a===0}),[a]),d=H(c=>{c.stopPropagation()});return E.createElement(o?fn:D,null,Y({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:Wa,name:"Dialog.Panel"}))}let Ba="div";function qa(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=yt("Dialog.Backdrop"),i=F(()=>({open:o===0}),[o]);return E.createElement(n?fn:D,null,Y({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:Ba,name:"Dialog.Backdrop"}))}let Ya="h2";function Ka(e,t){let n=ce(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=yt("Dialog.Title"),s=Q(t);L(()=>(a(r),()=>a(null)),[r,a]);let l=F(()=>({open:i===0}),[i]);return Y({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:Ya,name:"Dialog.Title"})}let Ga=z(ja),oo=z(za);z(qa);let Za=z(Ka),Xa=Object.assign(Ga,{Panel:oo,Title:Za,Description:Fi});const gt={root:"_root_1hpzn_1",modal:"_modal_1hpzn_10",container:"_container_1hpzn_13",page:"_page_1hpzn_16",close:"_close_1hpzn_19"},Qa={root:"_root_1h6qm_1"},se=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=F(()=>{switch(n){case"sm":return"yvlw-w-4 yvlw-h-4";case"lg":return"yvlw-w-7 yvlw-h-7";case"xl":return"yvlw-w-10 yvlw-h-10";case"custom":return"";default:return"yvlw-w-5 yvlw-h-5"}},[n]);return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},Ja=()=>v(se,{children:v("path",{d:"M10 2a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 2zM10 15a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 15zM10 7a3 3 0 100 6 3 3 0 000-6zM15.657 5.404a.75.75 0 10-1.06-1.06l-1.061 1.06a.75.75 0 001.06 1.06l1.06-1.06zM6.464 14.596a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 001.06 1.06l1.06-1.06zM18 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0118 10zM5 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 015 10zM14.596 15.657a.75.75 0 001.06-1.06l-1.06-1.061a.75.75 0 10-1.06 1.06l1.06 1.06zM5.404 6.464a.75.75 0 001.06-1.06l-1.06-1.06a.75.75 0 10-1.061 1.06l1.06 1.06z"})}),io=e=>v(se,{...e,children:v("path",{fillRule:"evenodd",d:"M7.455 2.004a.75.75 0 01.26.77 7 7 0 009.958 7.967.75.75 0 011.067.853A8.5 8.5 0 116.647 1.921a.75.75 0 01.808.083z",clipRule:"evenodd"})}),es=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"})]}),ts=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),ns=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),rs=e=>v(se,{...e,children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4zm6 5H6v-.99c.2-.72 3.3-2.01 6-2.01s5.8 1.29 6 2v1z"})]}),os=e=>v(se,{...e,children:v("path",{d:"M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z"})}),is=e=>v(se,{...e,children:v("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}),as=e=>v(se,{...e,viewBox:"0 0 99 32",children:[v("g",{clipPath:"url(#clip0_9581_165880)",children:[v("path",{d:"M98.9474 20.7006V2.701C98.9474 1.20997 97.7302 0 96.2304 0H87.4325H2.71699C1.21714 0 0 1.20997 0 2.701V29.299C0 30.79 1.21714 32 2.71699 32H86.6203C87.2911 32 87.938 31.7523 88.4388 31.3069L98.0489 22.7084C98.6191 22.1964 98.9474 21.4651 98.9474 20.7006Z",fill:"#46B2C8"}),v("path",{d:"M24.3666 25.2683H20.593C19.3951 25.2683 18.4199 24.2989 18.4199 23.108V8.8908C18.4199 7.69988 19.3951 6.73047 20.593 6.73047H24.3642C25.5622 6.73047 26.5374 7.69988 26.5374 8.8908V23.1056C26.5398 24.2989 25.5646 25.2683 24.3666 25.2683ZM20.593 8.52161C20.3894 8.52161 20.2217 8.68596 20.2217 8.8908V23.1056C20.2217 23.3081 20.387 23.4748 20.593 23.4748H24.3642C24.5679 23.4748 24.7356 23.3104 24.7356 23.1056V8.8908C24.7356 8.68834 24.5703 8.52161 24.3642 8.52161H20.593Z",fill:"#C7E8EF"}),v("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),v("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),v("path",{d:"M46.528 6.73828L44.4795 23.4993C44.283 24.5354 43.4061 25.2595 42.3447 25.2595C41.2833 25.2595 40.404 24.5354 40.2099 23.4993L40.2003 23.4421L38.1758 6.73828H39.9919L41.9853 23.1896C42.0404 23.4183 42.2081 23.4683 42.3447 23.4683C42.4789 23.4683 42.649 23.4183 42.7041 23.1896L44.7119 6.73828H46.528Z",fill:"white"}),v("path",{d:"M36.9104 6.73047V23.1056C36.9104 24.2965 35.9353 25.2659 34.7373 25.2659H30.9685C29.7681 25.2659 28.793 24.2965 28.793 23.1056V6.73047H30.5947V23.1056C30.5947 23.3104 30.7624 23.4748 30.9685 23.4748H34.7373C34.9433 23.4748 35.1087 23.3081 35.1087 23.1056V6.73047H36.9104Z",fill:"#C7E8EF"}),v("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),v("path",{d:"M15.8797 6.73047L13.3089 14.9764L10.9034 6.73047H9.02734L12.3793 18.2157V25.2516H14.181V18.2324L17.7653 6.73047H15.8797Z",fill:"#C7E8EF"}),v("path",{d:"M85.7767 6.73047L83.2058 14.9764L80.7979 6.73047H78.9219L82.2738 18.2157V25.2516H84.0755V18.2324L87.6623 6.73047H85.7767Z",fill:"white"}),v("path",{d:"M61.2349 18.4801C63.4535 17.5226 65.0085 15.3241 65.0085 12.7732V8.8908C65.0085 7.69988 64.0357 6.73047 62.8354 6.73047H59.0618C57.8638 6.73047 56.8887 7.69988 56.8887 8.8908V18.0918V18.9874V25.2493H58.6904V18.9898H58.7527C58.9659 18.9898 59.1768 18.9779 59.3828 18.9588L63.6093 25.254H65.78L61.2349 18.4801ZM58.6928 17.1986V8.89318C58.6928 8.68834 58.8581 8.52399 59.0618 8.52399H62.8354C63.039 8.52399 63.2044 8.69072 63.2044 8.89318V12.7756C63.2044 15.2146 61.2085 17.1986 58.7551 17.1986H58.6928Z",fill:"white"})]}),v("defs",{children:v("clipPath",{id:"clip0_9581_165880",children:v("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class vn{static async loadDetector(){try{return await faceLandmarksDetection.createDetector("MediaPipeFaceMesh",{runtime:"mediapipe",refineLandmarks:!0,solutionPath:"https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh"})}catch(t){return Promise.reject(t)}}static async detectFaces(t,n){try{return await t.estimateFaces(n)}catch(r){return Promise.reject(r)}}}const ss=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},ao=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=ss(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ls=e=>new Promise(t=>{const n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),n.toBlob(o=>t(o))});function cs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9"};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm"};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4"}}function so(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),a=I(c=>{r.current.push(c)},[]),s=I(async c=>{if(o.current)return;const p=await ls(c);o.current=p},[]),l=I(c=>{c.data.size>0&&t(c.data)},[]),u=I(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=I(c=>{i.current||(i.current=new MediaRecorder(c,cs()),i.current.ondataavailable=l,i.current.onstop=u,i.current.start(1e3))},[]);return{saveStream:a,savePhoto:s,start:d,stop:u,savedStreams:r,savedPhoto:o}}function Me(e,t){return Math.sqrt(e**2+t**2)}function us(e){const t=e.slice();for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function ds(e,t){return new Promise((n,r)=>{const o=new File([e],`${Date.now()}`,{type:t}),i=new FileReader;i.readAsDataURL(o),i.onload=()=>n(i.result),i.onerror=a=>r(a)})}const fs="https://identity.dev.svc.youverify.co";function ps(){return{postData:async t=>{const{faceImage:n,publicKey:r,passed:o,metadata:i}=t,a=await fetch(`${fs}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:r,components:["liveness"],faceImage:n,passed:o,metadata:i})});if(!a.ok)throw a;return await a.json()}}}const vs=360,hs="#125766",_s="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",lo={"complete-the-circle":{Icon:es,name:"Complete The Circle ⭕️",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"},"yes-or-no":{Icon:ts,name:"Yes or No ❓",description:"First position your face in the camera. Then tilt your head to the left to answer No and to the right to answer Yes"},motions:{Icon:ns,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:io,name:"Facial Expressions 🤪",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"}},co=B({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let uo,fo=!1;function ms(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u}=e,[d,c]=k(0),[p,f]=k(0),[_,y]=k(null),{saveStream:m,savePhoto:h,savedPhoto:g}=so(),{postData:T}=ps(),b=F(()=>p===n.length,[n,p]),$=()=>{f(S=>S+1),c(S=>S+1)},x=S=>{const N=new Image;N.crossOrigin="Anonymous",N.src=_s,N.onload=()=>{const j=ao(N,N.width,N.height);vn.detectFaces(S,j)}},A=async()=>{const S=await T({faceImage:g.current?await ds(g.current,"image/png"):null,publicKey:t,passed:!0,metadata:u});l(S),s()},M=async()=>{const S=await vn.loadDetector();uo=S,x(S),y(S)};return L(()=>{if(fo){y(uo);return}M(),fo=!0},[]),v(co.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:d,completed:b,completedCount:p,nextTask:$,branding:a,onRequestClose:s,faceDetector:_,saveStream:m,savePhoto:h,onComplete:A},children:r})}function ke(){return U(co)}const q={root:"_root_vqy7d_1",container:"_container_vqy7d_4",lhs:"_lhs_vqy7d_7",info:"_info_vqy7d_11",active:"_active_vqy7d_32",completed:"_completed_vqy7d_39",rhs:"_rhs_vqy7d_62",profile:"_profile_vqy7d_65",avatar:"_avatar_vqy7d_68",main:"_main_vqy7d_81",content:"_content_vqy7d_84"},hn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function ys(){const{branding:e}=ke();return v("div",{className:hn.root,children:v("div",{className:hn.container,children:v("div",{className:hn.brand,children:(e==null?void 0:e.logo)&&v("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const po="colorScheme";function gs(){const{namespace:e}=ke(),t=()=>{const o=localStorage.getItem(po);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(po,o);const i=`${e}-color-scheme`,a=document.documentElement;o&&o==="dark"?a==null||a.setAttribute(i,"dark"):a==null||a.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const ws={root:"_root_bcsvc_1"};function bs(){if(!(window.screen.width>=900))return 10/9}function _n(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),a=w(null),{start:s,stop:l}=so({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:bs()}}});a.current=p,s(p),o.current&&(o.current.srcObject=p)}catch{}},d=()=>{a.current&&(a.current.getTracks().forEach(p=>p.stop()),a.current=null,l(),o.current&&(o.current.srcObject=null))},c=()=>{n(o),i.current=requestAnimationFrame(c)};return L(()=>{const p=o.current;if(!p)return;const f=()=>{i.current=requestAnimationFrame(c)};return u(),p.addEventListener("canplay",f),()=>{p.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),v("div",{className:ws.root,children:[v("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Ge={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},vo=360,$s=50;function Es(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=$s}=e,i=F(()=>{const a=[Ge.container];return r&&a.push(Ge.focused),a.join(" ")},[r]);return v("div",{className:i,children:[v(ae,{as:"div",show:r,leave:"yvlw-transition yvlw-linear yvlw-duration-300",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-125 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-300",enterFrom:"yvlw-scale-125 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:v("div",{className:Ge.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*vo/o,l=Math.ceil((s+1)*n/vo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Ge.completed);const p=u?"translateX(158px)":"translateX(150px)";return v("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),v(ae,{as:"div",show:!r,leave:"yvlw-transition yvlw-linear yvlw-duration-200",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-75 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-200",enterFrom:"yvlw-scale-75 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:v("div",{className:Ge.marker,children:[v("div",{}),v("div",{}),v("div",{}),v("div",{})]})})]})}function Cs(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:a,height:s}=i,l=a*s,u=o**2,d=l/u;if(d>.9)throw new Error("Move face farther from camera");if(d<.05)throw new Error("Move face closer to camera")},checkFacialFeatures:(r,o)=>{},checkInFrame:(r,o)=>{const{offsetX:i,offsetY:a}=o,{box:s}=r;if(!(s.xMin-i>=o.x&&s.yMin-a>=o.y&&s.xMax-i<=o.x+o.width&&s.yMax-a<=o.y+o.height))throw new Error("Position head in frame")}}}function mn(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i}=ke(),{checkFacialFeatures:a,checkZoomLevel:s,checkInFrame:l}=Cs(),u=w(null),d=(p,f)=>{var _;try{if(p.length===0)throw new Error("Detecting face...");if(p.length>1)throw new Error("A maximum of 1 face is allowed");const y=u.current,m=(_=u.current)==null?void 0:_.parentElement;if(!y||!m)return;const h=p[0];for(const g of t)switch(g){case"zoom":s(h,Math.min(m.clientHeight,m.clientWidth));break;case"features":a(h,Math.min(m.clientHeight,m.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const T=n+200;l(h,{x:(m.clientWidth-T)/2,y:(m.clientHeight-T)/2,width:T,height:T,offsetX:(y.videoWidth-m.clientWidth)/2,offsetY:(y.videoHeight-m.clientHeight)/2});break;default:break}r(h,f)}catch(y){const{message:m}=y;o(m)}};return{detectFaces:async p=>{if(!i)return;const{ref:f}=p;u.current=f.current;const _=u.current;if(!_)throw new Error("No Video Source detected");const{videoWidth:y,videoHeight:m}=_;if(y===0||m===0)return;const h=ao(_,y,m),g=await vn.detectFaces(i,h);d(g,h)}}}const le={root:"_root_1psx5_1",container:"_container_1psx5_4",progress:"_progress_1psx5_7",intro:"_intro_1psx5_12",content:"_content_1psx5_15",branding:"_branding_1psx5_18",instructionsContainer:"_instructionsContainer_1psx5_22",instructions:"_instructions_1psx5_22"},ho={root:"_root_1j21c_1",spinner:"_spinner_1j21c_18",spin:"_spin_1j21c_18"};function wt(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s}=e;return v("div",{className:ho.root,children:[v(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),v("h2",{children:r}),v("p",{className:"subtext",children:n}),v("div",{className:"yvlw-mt-12",children:v(mi,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[v("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&v("span",{className:ho.spinner})]})}),s]})}function yn(e){const{children:t,instruction:n,name:r,completed:o,onStart:i=()=>{}}=e,[a,s]=k(!1),{completedCount:l,tasks:u,nextTask:d}=ke(),c=F(()=>lo[r],[r]),p=F(()=>l*100/u.length,[l,u.length]);return v("div",{className:le.root,children:v("div",{className:`${le.container} view`,children:[v("div",{style:{width:`${p}%`},className:le.progress}),v(ae,{show:!a&&!o,as:"div",enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:"yvlw-absolute yvlw-h-full yvlw-w-full",children:v("div",{className:`${le.intro}`,children:v(wt,{Icon:c.Icon,title:`${c.name.slice(0,-2)}`,description:`${c.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await i(),s(!0)},actionText:"Okay, got it!"})})}),v(ae,{as:"div",show:a&&!o,enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:"yvlw-absolute yvlw-w-full yvlw-h-full",children:[v("div",{className:`${le.content}`,children:t}),v("div",{className:le.instructionsContainer,children:[v("div",{className:le.instructions,children:[v("h2",{children:n.title}),v("p",{className:"subtext",children:n.description})]}),v("div",{className:le.branding,children:[v("span",{children:"Powered by"})," ",v(as,{size:"custom",className:"yvlw-h-3"})]})]})]}),v(ae,{show:o,as:"div",enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:"yvlw-absolute yvlw-w-full yvlw-h-full",children:v("div",{className:`${le.intro}`,children:v(wt,{Icon:c.Icon,title:"One task down!",description:`You have completed the ${c.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>d(),actionText:"Next"})})})]})})}const Ts=1,gn=8;function ks(e){const{difficulty:t}=e,{saveStream:n,savePhoto:r}=ke(),[o,i]=k([]),[a,s]=k("Place face in frame"),[l,u]=k(!1),[d,c]=k(!1),p=w(new Set),f=w(!1),_=w(null),y=$=>{const x=$*gn,A=Math.ceil((x+1)/vs);p.current.has(A)||(p.current.add(A),i(Array.from(p.current))),p.current.size>=gn&&setTimeout(()=>{c(!0)},1e3)},m=($,x)=>{let M=Math.atan2(x,$)*(180/Math.PI);return M<0&&(M+=360),M},h=F(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),g=$=>{const{keypoints:x,box:A}=$,M={x:A.width*.5,y:A.height*.5},S=x[Ts],N={y:S.y-A.yMin,x:S.x-A.xMin},j=M.x-N.x,J=N.y-M.y;return Math.abs(j)<h&&Math.abs(J)<h?null:m(j,J)},{detectFaces:T}=mn({frameSize:280,validations:["zoom","in-frame"],onFace:($,x)=>{r(x),u(!0),s("Slowly move head around to complete circle");const A=g($);A&&y(A)},onError:$=>{s($),i([]),p.current.clear(),_.current=null,f.current=!1}});return v(D,{children:v(yn,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,children:v(_n,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:x}=$.current;T({ref:$,frameSize:x})}catch{}},onRecord:n,children:v(Es,{faceDetected:l,sectionsCount:gn,visitedSections:o})})})})}const wn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Fs(e){const{show:t,stickers:n}=e;return v(D,{children:t&&v("div",{className:wn.root,children:n.map(r=>v("div",{className:`${wn.sticker} ${wn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const xs={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},Ss="Wrong answer. Try again";function Ps(e){const{difficulty:t,questions:n=[xs]}=e,[r,o]=k("Keep face in camera"),[i,a]=k(!1),[s,l]=k(!1),{saveStream:u,savePhoto:d}=ke(),c=w("inactive"),p=w(0),f=w(!1),_=b=>{const{keypoints:$}=b,x=$[1],A=$[9],M=x.x-A.x,S=x.y-A.y;return 90-Math.atan2(S,M)*(180/Math.PI)},y=b=>{c.current="inactive",o(n[b].question),setTimeout(()=>{c.current="active"},2e3)},m=F(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),h=b=>{try{if(c.current="inactive",Math.abs(b)<m)throw new Error("Tilt head further to answer");const $=b>0,x=n[p.current].answer;if($===x)p.current+=1,p.current===n.length?l(!0):y(p.current);else throw new Error(n[p.current].errorMessage||Ss)}catch($){o($.message),setTimeout(()=>{y(p.current)},2e3)}},{detectFaces:g}=mn({onFace:(b,$)=>{if(f.current||(a(!0),d($),f.current=!0,y(p.current)),c.current==="inactive")return;const x=_(b);h(x)},onError:b=>{o(b)}});return v(yn,{instruction:{title:r,description:i?"":"Move head left for No and right for Yes"},name:"yes-or-no",completed:s,children:v(_n,{onStream:b=>{try{if(!b.current||s)return;const{videoWidth:$}=b.current;g({ref:b,frameSize:$})}catch{}},onRecord:u,children:v(Fs,{show:i,stickers:["yes","no"]})})})}function Ls(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return L(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function Ms(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(null),a=w(!0),s=w(null),l=w(null),u=w(0),d=w(!1),c=F(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const y=t-u.current;let m=`Nod head ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=Ls({onChange:y=>{l.current=y}});return{evaluate:y=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!l.current||!l.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(l.current.beta<60||l.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:m}=y,h=Me(m[6].x-m[8].x,m[6].y-m[8].y),T=Me(m[2].x-m[1].x,m[2].y-m[1].y)/h*10;if(T>c){if(i.current||!a.current)return;i.current=T,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-T>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()}}}function Ns(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=F(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:s=>{if(o.current)return;const{keypoints:l}=s,u=Me(l[6].x-l[8].x,l[6].y-l[8].y);if(Me(l[14].x-l[13].x,l[14].y-l[13].y)/u*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")}}}function Ds(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),a=w(!1),s=w(null),l=w(0),u=F(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=_=>{i.current&&(_>=u.closed||(i.current=!1,s.current=Date.now()))},c=_=>{if(!i.current&&!(_<u.open)&&(i.current=!0,s.current)){const y=Date.now(),m=s.current;(y-m)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const _=t-l.current;let y=`Blink right eye ${_} `;_<t&&(y+="more "),y+=_>1?"times":"time",n(y);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:_=>{if(a.current)return;const{keypoints:y}=_,m=Me(y[6].x-y[8].x,y[6].y-y[8].y),g=Me(y[145].x-y[159].x,y[145].y-y[159].y)/m*100;d(g),c(g),p()}}}function Hs(){return{requestDeviceOrientationPermission:async()=>{if(!window.DeviceOrientationEvent)throw new Error("Cannot continue. Transfer to mobile device to complete");const t=window.DeviceOrientationEvent;if(typeof t.requestPermission=="function"&&await t.requestPermission()!=="granted")throw new Error("Permission for device orientation not granted")}}}var _o=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(_o||{});const mo=us(Object.keys(_o));function As(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5}=e,o=w(0),[i,a]=k("Keep face in camera"),[s,l]=k(!1),[u,d]=k(null),c=w(!1),{requestDeviceOrientationPermission:p}=Hs(),f=()=>{if(o.current===mo.length-1){l(!0);return}o.current+=1},_=Ms({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:b=>a(b),onComplete:f}),y=Ns({difficulty:t,onMessage:b=>a(b),onComplete:f}),m=Ds({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:b=>a(b),onComplete:f}),{detectFaces:h}=mn({onFace:b=>{switch(c.current||(c.current=!0),mo[o.current]){case"nod":_.evaluate(b);break;case"open_mouth":y.evaluate(b);break;case"blink":m.evaluate(b);break}},onError:b=>{a(b)}});return v(yn,{instruction:{title:i,description:"Follow the directives as instructed"},name:"motions",completed:s,onStart:async()=>{try{await p()}catch(b){const $=b;a($.message),d($)}},children:u?v(D,{}):v(_n,{onStream:async b=>{try{if(!b.current||s)return;const{videoWidth:$}=b.current;await h({ref:b,frameSize:$,throttleInterval:500})}catch{}}})})}function Os(){var m;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=gs(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s}=ke(),[l,u]=k(!1),[d,c]=k(!1),[p,f]=k(null);L(()=>{const h=t();n(h)},[]);const _=async()=>{try{u(!0),f(null),await s()}catch(h){f(h.message)}finally{u(!1)}},y=I(h=>h===i?q.active:i>h?q.completed:"subtext",[i]);return v("div",{className:q.root,children:v("div",{className:q.container,children:[v("div",{className:`${q.lhs} divider`,children:[v("div",{className:q.info,children:[v(ys,{}),v("div",{children:v("p",{className:"yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext",children:"You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way."})}),v("ol",{children:[o.map((h,g)=>v("li",{className:y(g),children:lo[h.id].name},`task-${g}`)),v("li",{className:a?q.active:"",children:"Complete! 🎉"})]})]}),v("footer",{className:"divider",children:[v("div",{children:"Powered by Youverify"}),v("div",{onClick:()=>e(),role:"button",children:[v("div",{className:"dark:yvlw-hidden",children:v(io,{})}),v("div",{className:"yvlw-hidden dark:yvlw-block",children:v(Ja,{})})]})]})]}),v("div",{className:q.main,children:v("div",{className:q.content,children:[v(ae,{show:!d,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:v("div",{className:q.completed,children:v(wt,{Icon:rs,title:"Liveness Check",description:"To ensure the security of your identity, we conduct a liveness check to verify that you are a real person actively engaging with the process.",actionText:"Start Liveness Test",onActionClick:()=>c(!0)})})}),o.map((h,g)=>{let T;switch(h.id){case"complete-the-circle":T=v(ks,{...h});break;case"yes-or-no":T=v(Ps,{...h});break;case"motions":T=v(As,{...h});break;default:T=v(D,{});break}return v(ae,{show:d&&!a&&i===g,appear:!0,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full",children:T},`task-${g}`)}),v(ae,{show:d&&a,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:v("div",{className:q.completed,children:v(wt,{Icon:os,title:"Successful",description:"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:l,onActionClick:_,children:p&&v("div",{className:"yvlw-mt-3",children:p})})})})]})}),v("div",{className:`${q.rhs} divider`,children:[r&&v("div",{className:`${q.profile} divider`,children:[v("div",{children:v("div",{className:q.avatar,children:[r.firstName.charAt(0).toUpperCase(),(m=r.lastName)==null?void 0:m.charAt(0).toUpperCase()]})}),v("div",{children:[v("h4",{children:[r.firstName," ",r.lastName]}),r.email&&v("p",{className:"subtext",children:r.email})]})]}),v("footer",{children:[v("div",{children:"About · Terms · Help · Privacy · Contact"}),v("div",{children:"© 2024 from Youverify Inc."})]})]})]})})}function Is(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d}=e,[c,p]=k(e.show),f=()=>{p(!1),i()};return v(ms,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:f,onSuccess:a,onFailure:s,metadata:d,children:v(Xa,{id:n,open:l==="page"?!0:c,onClose:f,transition:!0,className:`${Qa.root} ${gt.root} ${gt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??hs},children:[l==="modal"&&v("div",{onClick:f,role:"button",className:gt.close,children:v(is,{className:"yvlw-text-white"})}),v(oo,{className:`${gt.container}`,children:v(Os,{})})]})})}class Rs{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk",this.scriptsURLs=["https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh@0.4.1633559619/face_mesh.min.js","https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core@4.20.0/dist/tf-core.min.js","https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl@4.20.0/dist/tf-backend-webgl.min.js","https://cdn.jsdelivr.net/npm/@tensorflow-models/face-landmarks-detection@1.0.5/dist/face-landmarks-detection.min.js"],this.addedResources=[];const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),this.addResources(),n==="page"&&this.start()}addResources(){for(const t of this.scriptsURLs){const n=document.createElement("script");n.src=t,n.async=!1,this.addedResources.push(n),document.head.appendChild(n)}}removeResources(){for(const t of this.addedResources)document.head.removeChild(t)}validateOptions(){if(!this.tasks)throw new Error("Tasks cannot be empty!");if(!this.props.publicKey)throw new Error("A Public Key is required");if(this.props.user&&!this.props.user.firstName)throw new Error("First Name is required when User object is supplied")}async start(t){t&&(this.tasks=t),this.validateOptions(),this.container=document.createElement("div"),document.body.appendChild(this.container),Fe(v(Is,{namespace:this.namespace,publicKey:this.props.publicKey,presentation:this.props.presentation,show:!0,tasks:this.tasks,user:this.props.user,branding:this.props.branding,onClose:()=>this.close(),onSuccess:this.props.onSuccess,onFailure:this.props.onFailure,metadata:this.props.metadata}),this.container)}close(){if(this.container&&this.presentation!=="page"){if(!document.body.contains(this.container))return;document.body.removeChild(this.container),this.props.onClose&&this.props.onClose()}}terminate(){this.removeResources()}}return Rs});
5
+ `))}else{let p=d.props,f=p==null?void 0:p.className,_=typeof f=="function"?(...h)=>en(f(...h),l.className):en(f,l.className),y=_?{className:_}:{},m=Pr(d.props,Ee(tn(l,["ref"])));for(let h in c)h in m&&delete c[h];return Ut(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return G(i,Object.assign({},tn(l,["ref"]),i!==D&&u,i!==D&&c),d)}function pi(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Pr(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function vi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let a of i)a==null||a(...o)}});return t}function z(e){var t;return Object.assign(Rt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ee(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function tn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let hi="button";function _i(e,t){var n;let r=Sr(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=ii({autoFocus:i}),{isHovered:u,hoverProps:d}=oi({isDisabled:o}),{pressed:c,pressProps:p}=di({disabled:o}),f=vi({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),_=F(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return Y({ourProps:f,theirProps:a,slot:_,defaultTag:hi,name:"Button"})}let mi=z(_i),yi="div";var ft=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ft||{});function gi(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Y({ourProps:i,theirProps:o,slot:{},defaultTag:yi,name:"Hidden"})}let nn=z(gi),wi=B(null);function bi({children:e}){let t=U(wi);if(!t)return E.createElement(E.Fragment,null,e);let{target:n}=t;return n?rt(E.createElement(E.Fragment,null,e),n):null}let Lr=Symbol();function $i(e,t=!0){return Object.assign(e,{[Lr]:t})}function Q(...e){let t=w(e);L(()=>{t.current=e},[e]);let n=H(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Lr]))?void 0:n}let rn=B(null);rn.displayName="DescriptionContext";function Mr(){let e=U(rn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Mr),t}return e}function Ei(){let[e,t]=k([]);return[e.length>0?e.join(" "):void 0,F(()=>function(n){let r=H(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=F(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return E.createElement(rn.Provider,{value:o},n.children)},[t])]}let Ci="p";function Ti(e,t){let n=ce(),r=Sr(),{id:o=`headlessui-description-${n}`,...i}=e,a=Mr(),s=Q(t);W(()=>a.register(o),[o,a.register]);let l=r||!1,u=F(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return Y({ourProps:d,theirProps:i,slot:u,defaultTag:Ci,name:a.name||"Description"})}let ki=z(Ti),Fi=Object.assign(ki,{});var Nr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Nr||{});let xi=B(()=>{});function Si({value:e,children:t}){return E.createElement(xi.Provider,{value:e},t)}let Pi=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function Dr(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let a=t[o].call(n,...i);a&&(n=a,r.forEach(s=>s()))}}}function Hr(e){return ot(e.subscribe,e.getSnapshot,e.getSnapshot)}let Li=new Pi(()=>Dr(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function Le(e,t){let n=Li.get(t),r=ce(),o=Hr(n);if(W(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),a=o.length;return i===-1&&(i=a,a+=1),i===a-1}let on=new Map,We=new Map;function Ar(e){var t;let n=(t=We.get(e))!=null?t:0;return We.set(e,n+1),n!==0?()=>Or(e):(on.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Or(e))}function Or(e){var t;let n=(t=We.get(e))!=null?t:1;if(n===1?We.delete(e):We.set(e,n-1),n!==1)return;let r=on.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,on.delete(e))}function Mi(e,{allowed:t,disallowed:n}={}){let r=Le(e,"inert-others");W(()=>{var o,i;if(!r)return;let a=ue();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Ar(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=st(l);if(!u)continue;let d=l.parentElement;for(;d&&d!==u.body;){for(let c of d.children)s.some(p=>c.contains(p))||a.add(Ar(c));d=d.parentElement}}return a.dispose},[r,t,n])}function Ir(e,t,n){let r=$e(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});L(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=ue();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(o));a.observe(o),i.add(()=>a.disconnect())}return()=>i.dispose()},[t,r,e])}let an=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Ni=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var oe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(oe||{}),sn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(sn||{}),Di=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Di||{});function Hi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(an)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ai(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ni)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Rr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Rr||{});function Oi(e,t=0){var n;return e===((n=st(e))==null?void 0:n.body)?!1:de(t,{0(){return e.matches(an)},1(){let r=e;for(;r!==null;){if(r.matches(an))return!0;r=r.parentElement}return!1}})}var Ii=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ii||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ie(e){e==null||e.focus({preventScroll:!0})}let Ri=["textarea","input"].join(",");function Vi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ri))!=null?n:!1}function Ui(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ze(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?Ui(e):e:t&64?Ai(e):Hi(e);o.length>0&&a.length>1&&(a=a.filter(f=>!o.some(_=>_!=null&&"current"in _?(_==null?void 0:_.current)===f:_===f))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,c=a.length,p;do{if(d>=c||d+c<=0)return 0;let f=l+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}p=a[f],p==null||p.focus(u),d+=s}while(p!==i.activeElement);return t&6&&Vi(p)&&p.select(),2}function Vr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ji(){return/Android/gi.test(window.navigator.userAgent)}function Wi(){return Vr()||ji()}function Be(e,t,n,r){let o=$e(n);L(()=>{if(!e)return;function i(a){o.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Ur(e,t,n,r){let o=$e(n);L(()=>{if(!e)return;function i(a){o.current(a)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const jr=30;function zi(e,t,n){let r=Le(e,"outside-click"),o=$e(n),i=I(function(l,u){if(l.defaultPrevented)return;let d=u(l);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(d)||l.composed&&l.composedPath().includes(f))return}return!Oi(d,Rr.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=w(null);Be(r,"pointerdown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Be(r,"mousedown",l=>{var u,d;a.current=((d=(u=l.composedPath)==null?void 0:u.call(l))==null?void 0:d[0])||l.target},!0),Be(r,"click",l=>{Wi()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=w({x:0,y:0});Be(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Be(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=jr||Math.abs(u.y-s.current.y)>=jr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Ur(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function qe(...e){return F(()=>st(...e),[...e])}function Wr(e,t,n,r){let o=$e(n);L(()=>{e=e??window;function i(a){o.current(a)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function Bi(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function qi(){return Vr()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=ue();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,a=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let l=s.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),d=e.querySelector(u);d&&!r(d)&&(a=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let l=s.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let l=s.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let l=(s=window.scrollY)!=null?s:window.pageYOffset;i!==l&&window.scrollTo(0,i),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Yi(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ki(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ce=Dr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ue(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Ki(n)},o=[qi(),Bi(),Yi()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ce.subscribe(()=>{let e=Ce.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Ce.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ce.dispatch("TEARDOWN",n)}});function Gi(e,t,n=()=>({containers:[]})){let r=Hr(Ce),o=t?r.get(t):void 0,i=o?o.count>0:!1;return W(()=>{if(!(!t||!e))return Ce.dispatch("PUSH",t,n),()=>Ce.dispatch("POP",t,n)},[e,t]),i}function Zi(e,t,n=()=>[document.body]){let r=Le(e,"scroll-lock");Gi(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Xi(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Qi(e=0){let[t,n]=k(e),r=I(l=>n(l),[t]),o=I(l=>n(u=>u|l),[t]),i=I(l=>(t&l)===l,[t]),a=I(l=>n(u=>u&~l),[n]),s=I(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var Ji=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Ji||{});function ea(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function ta(e,t,n,r){let[o,i]=k(n),{hasFlag:a,addFlag:s,removeFlag:l}=Qi(e&&o?3:0),u=w(!1),d=w(!1),c=ct();return W(function p(){var f;if(!e)return;n&&i(!0);let _=t.current;return _?((f=r==null?void 0:r.start)==null||f.call(r,n),na(_,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(s(3),l(4)):(s(4),l(2)))},run(){d.current?n?(l(3),s(4)):(l(4),s(3)):n?l(1):s(1)},done(){var y;d.current&&typeof _.getAnimations=="function"&&_.getAnimations().length>0||(u.current=!1,l(7),n||i(!1),(y=r==null?void 0:r.end)==null||y.call(r,n))}})):n?(s(3),c.nextFrame(()=>p())):void 0},[e,n,t,c]),e?[o,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function na(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ue();return oa(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(ra(e,r)),n()}),i.dispose}function ra(e,t){let n=Xi(t),r=ue();if(!e)return r.dispose;let{transitionDuration:o,transitionDelay:i}=getComputedStyle(e),[a,s]=[o,i].map(u=>{let[d=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,p)=>p-c);return d}),l=a+s;if(l!==0){let u=r.group(d=>{let c=d.setTimeout(()=>{n(),d.dispose()},l);d.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&(c(),d.addEventListener(e,"transitioncancel",f=>{f.target===f.currentTarget&&(n(),u())}))})});r.addEventListener(e,"transitionend",d=>{d.target===d.currentTarget&&(n(),r.dispose())})}else n();return r.dispose}function oa(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function ln(e,t){let n=w([]),r=H(e);L(()=>{let o=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}let pt=B(null);pt.displayName="OpenClosedContext";var X=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(X||{});function vt(){return U(pt)}function ia({value:e,children:t}){return E.createElement(pt.Provider,{value:e},t)}function aa({children:e}){return E.createElement(pt.Provider,{value:null},e)}function sa(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let pe=[];sa(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&pe[0]!==t.target&&(pe.unshift(t.target),pe=pe.filter(n=>n!=null&&n.isConnected),pe.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function zr(e){let t=H(e),n=w(!1);L(()=>(n.current=!1,()=>{n.current=!0,lt(()=>{n.current&&t()})}),[t])}function la(){let e=typeof document>"u";return"useSyncExternalStore"in wr?(t=>t.useSyncExternalStore)(wr)(()=>()=>{},()=>!1,()=>!e):!1}function Ye(){let e=la(),[t,n]=k(be.isHandoffComplete);return t&&be.isHandoffComplete===!1&&n(!1),L(()=>{t!==!0&&n(!0)},[t]),L(()=>be.handoff(),[]),e?!1:t}let Br=B(!1);function ca(){return U(Br)}function qr(e){return E.createElement(Br.Provider,{value:e.force},e.children)}function ua(e){let t=ca(),n=U(Kr),r=qe(e),[o,i]=k(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(be.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return L(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),L(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Yr=D,da=z(function(e,t){let n=e,r=w(null),o=Q($i(d=>{r.current=d}),t),i=qe(r),a=ua(r),[s]=k(()=>{var d;return be.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=U(cn),u=Ye();return W(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),W(()=>{if(s&&l)return l.register(s)},[l,s]),zr(()=>{var d;!a||!s||(s instanceof Node&&a.contains(s)&&a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))}),u?!a||!s?null:rt(Y({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Yr,name:"Portal"}),s):null});function fa(e,t){let n=Q(t),{enabled:r=!0,...o}=e;return r?E.createElement(da,{...o,ref:n}):Y({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Yr,name:"Portal"})}let pa=D,Kr=B(null);function va(e,t){let{target:n,...r}=e,o={ref:Q(t)};return E.createElement(Kr.Provider,{value:n},Y({ourProps:o,theirProps:r,defaultTag:pa,name:"Popover.Group"}))}let cn=B(null);function ha(){let e=U(cn),t=w([]),n=H(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=H(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=F(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,F(()=>function({children:i}){return E.createElement(cn.Provider,{value:o},i)},[o])]}let _a=z(fa),Gr=z(va),ma=Object.assign(_a,{Group:Gr});function ya(e,t=typeof document<"u"?document.defaultView:null,n){let r=Le(e,"escape");Wr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Nr.Escape&&n(o))})}function ga(){var e;let[t]=k(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=k((e=t==null?void 0:t.matches)!=null?e:!1);return W(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function wa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=qe(o),a=H(()=>{var s,l,u;let d=[];for(let c of e)c!==null&&(c instanceof HTMLElement?d.push(c):"current"in c&&c.current instanceof HTMLElement&&d.push(c.current));if(t!=null&&t.current)for(let c of t.current)d.push(c);for(let c of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(c.contains(o.current)||c.contains((u=(l=o.current)==null?void 0:l.getRootNode())==null?void 0:u.host)||d.some(p=>c.contains(p))||d.push(c));return d});return{resolveContainers:a,contains:H(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:F(()=>function(){return n!=null?null:E.createElement(nn,{features:ft.Hidden,ref:o})},[o,n])}}function un(){let e=w(!1);return W(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Ke=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ke||{});function ba(){let e=w(0);return Ur(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Zr(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let $a="div";var Te=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Te||{});function Ea(e,t){let n=w(null),r=Q(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Ye()||(s=0);let u=qe(n);Fa(s,{ownerDocument:u});let d=xa(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Sa(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=ba(),p=H(h=>{let g=n.current;g&&(T=>T())(()=>{de(c.current,{[Ke.Forwards]:()=>{ze(g,oe.First,{skipElements:[h.relatedTarget,i]})},[Ke.Backwards]:()=>{ze(g,oe.Last,{skipElements:[h.relatedTarget,i]})}})})}),f=Le(!!(s&2),"focus-trap#tab-lock"),_=ct(),y=w(!1),m={ref:r,onKeyDown(h){h.key=="Tab"&&(y.current=!0,_.requestAnimationFrame(()=>{y.current=!1}))},onBlur(h){if(!(s&4))return;let g=Zr(a);n.current instanceof HTMLElement&&g.add(n.current);let T=h.relatedTarget;T instanceof HTMLElement&&T.dataset.headlessuiFocusGuard!=="true"&&(Xr(g,T)||(y.current?ze(n.current,de(c.current,{[Ke.Forwards]:()=>oe.Next,[Ke.Backwards]:()=>oe.Previous})|oe.WrapAround,{relativeTo:h.target}):h.target instanceof HTMLElement&&ie(h.target)))}};return E.createElement(E.Fragment,null,f&&E.createElement(nn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:ft.Focusable}),Y({ourProps:m,theirProps:l,defaultTag:$a,name:"FocusTrap"}),f&&E.createElement(nn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:ft.Focusable}))}let Ca=z(Ea),Ta=Object.assign(Ca,{features:Te});function ka(e=!0){let t=w(pe.slice());return ln(([n],[r])=>{r===!0&&n===!1&&lt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=pe.slice())},[e,pe,t]),H(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Fa(e,{ownerDocument:t}){let n=!!(e&8),r=ka(n);ln(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&ie(r())},[n]),zr(()=>{n&&ie(r())})}function xa(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),a=Le(!!(e&1),"focus-trap#initial-focus"),s=un();return ln(()=>{if(e===0)return;if(!a){o!=null&&o.current&&ie(o.current);return}let l=n.current;l&&lt(()=>{if(!s.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(l.contains(u)){i.current=u;return}if(r!=null&&r.current)ie(r.current);else{if(e&16){if(ze(l,oe.First|oe.AutoFocus)!==sn.Error)return}else if(ze(l,oe.First)!==sn.Error)return;if(o!=null&&o.current&&(ie(o.current),(t==null?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}i.current=t==null?void 0:t.activeElement})},[o,a,e]),i}function Sa(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=un(),a=!!(e&4);Wr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=Zr(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?Xr(l,d)?(o.current=d,ie(d)):(s.preventDefault(),s.stopPropagation(),ie(u)):ie(o.current)},!0)}function Xr(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function Qr(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:eo)!==D||E.Children.count(e.children)===1}let ht=B(null);ht.displayName="TransitionContext";var Pa=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Pa||{});function La(){let e=U(ht);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ma(){let e=U(_t);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _t=B(null);_t.displayName="NestingContext";function mt(e){return"children"in e?mt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Jr(e,t){let n=$e(e),r=w([]),o=un(),i=ct(),a=H((f,_=fe.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(de(_,{[fe.Unmount](){r.current.splice(y,1)},[fe.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!mt(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=H(f=>{let _=r.current.find(({el:y})=>y===f);return _?_.state!=="visible"&&(_.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,fe.Unmount)}),l=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),c=H((f,_,y)=>{l.current.splice(0),t&&(t.chains.current[_]=t.chains.current[_].filter(([m])=>m!==f)),t==null||t.chains.current[_].push([f,new Promise(m=>{l.current.push(m)})]),t==null||t.chains.current[_].push([f,new Promise(m=>{Promise.all(d.current[_].map(([h,g])=>g)).then(()=>m())})]),_==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(_)):y(_)}),p=H((f,_,y)=>{Promise.all(d.current[_].splice(0).map(([m,h])=>h)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(_))});return F(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let eo=D,to=ut.RenderStrategy;function Na(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:a,beforeLeave:s,afterLeave:l,enter:u,enterFrom:d,enterTo:c,entered:p,leave:f,leaveFrom:_,leaveTo:y,...m}=e,h=w(null),g=Qr(e),T=Q(...g?[h,t]:t===null?[]:[t]),b=(n=m.unmount)==null||n?fe.Unmount:fe.Hidden,{show:$,appear:x,initial:A}=La(),[M,S]=k($?"visible":"hidden"),N=Ma(),{register:j,unregister:J}=N;W(()=>j(h),[j,h]),W(()=>{if(b===fe.Hidden&&h.current){if($&&M!=="visible"){S("visible");return}return de(M,{hidden:()=>J(h),visible:()=>j(h)})}},[M,h,j,J,$,b]);let Ne=Ye();W(()=>{if(g&&Ne&&M==="visible"&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,M,Ne,g]);let bn=A&&!x,bt=x&&$&&A,De=w(!1),He=Jr(()=>{De.current||(S("hidden"),J(h))},N),$t=H($n=>{De.current=!0;let Et=$n?"enter":"leave";He.onStart(h,Et,Xe=>{Xe==="enter"?i==null||i():Xe==="leave"&&(s==null||s())})}),ve=H($n=>{let Et=$n?"enter":"leave";De.current=!1,He.onStop(h,Et,Xe=>{Xe==="enter"?a==null||a():Xe==="leave"&&(l==null||l())}),Et==="leave"&&!mt(He)&&(S("hidden"),J(h))});L(()=>{g&&o||($t($),ve($))},[$,g,o]);let V=!(!o||!g||!Ne||bn),[,R]=ta(V,h,$,{start:$t,end:ve}),Vs=Ee({ref:T,className:((r=en(m.className,bt&&u,bt&&d,R.enter&&u,R.enter&&R.closed&&d,R.enter&&!R.closed&&c,R.leave&&f,R.leave&&!R.closed&&_,R.leave&&R.closed&&y,!R.transition&&$&&p))==null?void 0:r.trim())||void 0,...ea(R)}),Ze=0;return M==="visible"&&(Ze|=X.Open),M==="hidden"&&(Ze|=X.Closed),R.enter&&(Ze|=X.Opening),R.leave&&(Ze|=X.Closing),E.createElement(_t.Provider,{value:He},E.createElement(ia,{value:Ze},Y({ourProps:Vs,theirProps:m,defaultTag:eo,features:to,visible:M==="visible",name:"Transition.Child"})))}function Da(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=w(null),s=Qr(e),l=Q(...s?[a,t]:t===null?[]:[t]);Ye();let u=vt();if(n===void 0&&u!==null&&(n=(u&X.Open)===X.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=k(n?"visible":"hidden"),p=Jr(()=>{n||c("hidden")}),[f,_]=k(!0),y=w([n]);W(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),_(!1))},[y,n]);let m=F(()=>({show:n,appear:r,initial:f}),[n,r,f]);Ir(n,a,()=>c("hidden")),W(()=>{n?c("visible"):!mt(p)&&a.current!==null&&c("hidden")},[n,p]);let h={unmount:o},g=H(()=>{var b;f&&_(!1),(b=e.beforeEnter)==null||b.call(e)}),T=H(()=>{var b;f&&_(!1),(b=e.beforeLeave)==null||b.call(e)});return E.createElement(_t.Provider,{value:p},E.createElement(ht.Provider,{value:m},Y({ourProps:{...h,as:D,children:E.createElement(no,{ref:l,...h,...i,beforeEnter:g,beforeLeave:T})},theirProps:{},defaultTag:D,features:to,visible:d==="visible",name:"Transition"})))}function Ha(e,t){let n=U(ht)!==null,r=vt()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(dn,{ref:t,...e}):E.createElement(no,{ref:t,...e}))}let dn=z(Da),no=z(Na),fn=z(Ha),ae=Object.assign(dn,{Child:fn,Root:dn});var Aa=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Aa||{}),Oa=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Oa||{});let Ia={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},pn=B(null);pn.displayName="DialogContext";function yt(e){let t=U(pn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,yt),n}return t}function Ra(e,t){return de(t.type,Ia,e,t)}let ro=z(function(e,t){let n=ce(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:i,initialFocus:a,role:s="dialog",autoFocus:l=!0,__demoMode:u=!1,...d}=e,c=w(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(c.current||(c.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let p=vt();o===void 0&&p!==null&&(o=(p&X.Open)===X.Open);let f=w(null),_=Q(f,t),y=qe(f),m=o?0:1,[h,g]=Ie(Ra,{titleId:null,descriptionId:null,panelRef:xt()}),T=H(()=>i(!1)),b=H(V=>g({type:0,id:V})),$=Ye()?m===0:!1,[x,A]=ha(),M={get current(){var V;return(V=h.panelRef.current)!=null?V:f.current}},{resolveContainers:S,mainTreeNodeRef:N,MainTreeNode:j}=wa({portals:x,defaultContainers:[M]}),J=p!==null?(p&X.Closing)===X.Closing:!1;Mi(u||J?!1:$,{allowed:H(()=>{var V,R;return[(R=(V=f.current)==null?void 0:V.closest("[data-headlessui-portal]"))!=null?R:null]}),disallowed:H(()=>{var V,R;return[(R=(V=N.current)==null?void 0:V.closest("body > *:not(#headlessui-portal-root)"))!=null?R:null]})}),zi($,S,V=>{V.preventDefault(),T()}),ya($,y==null?void 0:y.defaultView,V=>{V.preventDefault(),V.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),T()}),Zi(u||J?!1:$,y,S),Ir($,f,T);let[Ne,bn]=Ei(),bt=F(()=>[{dialogState:m,close:T,setTitleId:b},h],[m,h,T,b]),De=F(()=>({open:m===0}),[m]),He={ref:_,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":h.titleId,"aria-describedby":Ne},$t=!ga(),ve=Te.None;return $&&!u&&(ve|=Te.RestoreFocus,ve|=Te.TabLock,l&&(ve|=Te.AutoFocus),$t&&(ve|=Te.InitialFocus)),E.createElement(aa,null,E.createElement(qr,{force:!0},E.createElement(ma,null,E.createElement(pn.Provider,{value:bt},E.createElement(Gr,{target:f},E.createElement(qr,{force:!1},E.createElement(bn,{slot:De},E.createElement(A,null,E.createElement(Ta,{initialFocus:a,initialFocusFallback:f,containers:S,features:ve},E.createElement(Si,{value:T},Y({ourProps:He,theirProps:d,slot:De,defaultTag:Va,features:Ua,visible:m===0,name:"Dialog"})))))))))),E.createElement(bi,null,E.createElement(j,null)))}),Va="div",Ua=ut.RenderStrategy|ut.Static;function ja(e,t){let{transition:n=!1,open:r,...o}=e,i=vt(),a=e.hasOwnProperty("open")||i!==null,s=e.hasOwnProperty("onClose");if(!a&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!i&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!o.static?E.createElement(ae,{show:r,transition:n,unmount:o.unmount},E.createElement(ro,{ref:t,...o})):E.createElement(ro,{ref:t,open:r,...o})}let Wa="div";function za(e,t){let n=ce(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=yt("Dialog.Panel"),l=Q(t,s.panelRef),u=F(()=>({open:a===0}),[a]),d=H(c=>{c.stopPropagation()});return E.createElement(o?fn:D,null,Y({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:Wa,name:"Dialog.Panel"}))}let Ba="div";function qa(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=yt("Dialog.Backdrop"),i=F(()=>({open:o===0}),[o]);return E.createElement(n?fn:D,null,Y({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:Ba,name:"Dialog.Backdrop"}))}let Ya="h2";function Ka(e,t){let n=ce(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=yt("Dialog.Title"),s=Q(t);L(()=>(a(r),()=>a(null)),[r,a]);let l=F(()=>({open:i===0}),[i]);return Y({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:Ya,name:"Dialog.Title"})}let Ga=z(ja),oo=z(za);z(qa);let Za=z(Ka),Xa=Object.assign(Ga,{Panel:oo,Title:Za,Description:Fi});const gt={root:"_root_1hpzn_1",modal:"_modal_1hpzn_10",container:"_container_1hpzn_13",page:"_page_1hpzn_16",close:"_close_1hpzn_19"},Qa={root:"_root_1h6qm_1"},se=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=F(()=>{switch(n){case"sm":return"yvlw-w-4 yvlw-h-4";case"lg":return"yvlw-w-7 yvlw-h-7";case"xl":return"yvlw-w-10 yvlw-h-10";case"custom":return"";default:return"yvlw-w-5 yvlw-h-5"}},[n]);return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},Ja=()=>v(se,{children:v("path",{d:"M10 2a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 2zM10 15a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 15zM10 7a3 3 0 100 6 3 3 0 000-6zM15.657 5.404a.75.75 0 10-1.06-1.06l-1.061 1.06a.75.75 0 001.06 1.06l1.06-1.06zM6.464 14.596a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 001.06 1.06l1.06-1.06zM18 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0118 10zM5 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 015 10zM14.596 15.657a.75.75 0 001.06-1.06l-1.06-1.061a.75.75 0 10-1.06 1.06l1.06 1.06zM5.404 6.464a.75.75 0 001.06-1.06l-1.06-1.06a.75.75 0 10-1.061 1.06l1.06 1.06z"})}),io=e=>v(se,{...e,children:v("path",{fillRule:"evenodd",d:"M7.455 2.004a.75.75 0 01.26.77 7 7 0 009.958 7.967.75.75 0 011.067.853A8.5 8.5 0 116.647 1.921a.75.75 0 01.808.083z",clipRule:"evenodd"})}),es=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"})]}),ts=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),ns=e=>v(se,{...e,viewBox:"0 0 24 24",children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M3.72 6.04c.47.46 1.21.48 1.71.06.37-.32.69-.51.87-.43.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1h1.21c.69 0 1.25-.56 1.25-1.25s-.56-1.25-1.25-1.25h-1.22c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3c-1.09 0-2.04.63-2.7 1.22-.53.48-.53 1.32-.02 1.82zm10.16 12.51c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"})]}),rs=e=>v(se,{...e,children:[v("path",{d:"M0 0h24v24H0V0z",fill:"none"}),v("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4zm6 5H6v-.99c.2-.72 3.3-2.01 6-2.01s5.8 1.29 6 2v1z"})]}),os=e=>v(se,{...e,children:v("path",{d:"M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z"})}),is=e=>v(se,{...e,children:v("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}),as=e=>v(se,{...e,viewBox:"0 0 99 32",children:[v("g",{clipPath:"url(#clip0_9581_165880)",children:[v("path",{d:"M98.9474 20.7006V2.701C98.9474 1.20997 97.7302 0 96.2304 0H87.4325H2.71699C1.21714 0 0 1.20997 0 2.701V29.299C0 30.79 1.21714 32 2.71699 32H86.6203C87.2911 32 87.938 31.7523 88.4388 31.3069L98.0489 22.7084C98.6191 22.1964 98.9474 21.4651 98.9474 20.7006Z",fill:"#46B2C8"}),v("path",{d:"M24.3666 25.2683H20.593C19.3951 25.2683 18.4199 24.2989 18.4199 23.108V8.8908C18.4199 7.69988 19.3951 6.73047 20.593 6.73047H24.3642C25.5622 6.73047 26.5374 7.69988 26.5374 8.8908V23.1056C26.5398 24.2989 25.5646 25.2683 24.3666 25.2683ZM20.593 8.52161C20.3894 8.52161 20.2217 8.68596 20.2217 8.8908V23.1056C20.2217 23.3081 20.387 23.4748 20.593 23.4748H24.3642C24.5679 23.4748 24.7356 23.3104 24.7356 23.1056V8.8908C24.7356 8.68834 24.5703 8.52161 24.3642 8.52161H20.593Z",fill:"#C7E8EF"}),v("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),v("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),v("path",{d:"M46.528 6.73828L44.4795 23.4993C44.283 24.5354 43.4061 25.2595 42.3447 25.2595C41.2833 25.2595 40.404 24.5354 40.2099 23.4993L40.2003 23.4421L38.1758 6.73828H39.9919L41.9853 23.1896C42.0404 23.4183 42.2081 23.4683 42.3447 23.4683C42.4789 23.4683 42.649 23.4183 42.7041 23.1896L44.7119 6.73828H46.528Z",fill:"white"}),v("path",{d:"M36.9104 6.73047V23.1056C36.9104 24.2965 35.9353 25.2659 34.7373 25.2659H30.9685C29.7681 25.2659 28.793 24.2965 28.793 23.1056V6.73047H30.5947V23.1056C30.5947 23.3104 30.7624 23.4748 30.9685 23.4748H34.7373C34.9433 23.4748 35.1087 23.3081 35.1087 23.1056V6.73047H36.9104Z",fill:"#C7E8EF"}),v("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),v("path",{d:"M15.8797 6.73047L13.3089 14.9764L10.9034 6.73047H9.02734L12.3793 18.2157V25.2516H14.181V18.2324L17.7653 6.73047H15.8797Z",fill:"#C7E8EF"}),v("path",{d:"M85.7767 6.73047L83.2058 14.9764L80.7979 6.73047H78.9219L82.2738 18.2157V25.2516H84.0755V18.2324L87.6623 6.73047H85.7767Z",fill:"white"}),v("path",{d:"M61.2349 18.4801C63.4535 17.5226 65.0085 15.3241 65.0085 12.7732V8.8908C65.0085 7.69988 64.0357 6.73047 62.8354 6.73047H59.0618C57.8638 6.73047 56.8887 7.69988 56.8887 8.8908V18.0918V18.9874V25.2493H58.6904V18.9898H58.7527C58.9659 18.9898 59.1768 18.9779 59.3828 18.9588L63.6093 25.254H65.78L61.2349 18.4801ZM58.6928 17.1986V8.89318C58.6928 8.68834 58.8581 8.52399 59.0618 8.52399H62.8354C63.039 8.52399 63.2044 8.69072 63.2044 8.89318V12.7756C63.2044 15.2146 61.2085 17.1986 58.7551 17.1986H58.6928Z",fill:"white"})]}),v("defs",{children:v("clipPath",{id:"clip0_9581_165880",children:v("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class vn{static async loadDetector(){try{return await faceLandmarksDetection.createDetector("MediaPipeFaceMesh",{runtime:"mediapipe",refineLandmarks:!0,solutionPath:"https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh"})}catch(t){return Promise.reject(t)}}static async detectFaces(t,n){try{return await t.estimateFaces(n)}catch(r){return Promise.reject(r)}}}const ss=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},ao=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=ss(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ls=e=>new Promise(t=>{const n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").putImageData(e,0,0),n.toBlob(o=>t(o))});function cs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9"};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm"};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4"}}function so(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),a=I(c=>{r.current.push(c)},[]),s=I(async c=>{if(o.current)return;const p=await ls(c);o.current=p},[]),l=I(c=>{c.data.size>0&&t(c.data)},[]),u=I(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=I(c=>{i.current||(i.current=new MediaRecorder(c,cs()),i.current.ondataavailable=l,i.current.onstop=u,i.current.start(1e3))},[]);return{saveStream:a,savePhoto:s,start:d,stop:u,savedStreams:r,savedPhoto:o}}function Me(e,t){return Math.sqrt(e**2+t**2)}function us(e){const t=e.slice();for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function ds(e,t){return new Promise((n,r)=>{const o=new File([e],`${Date.now()}`,{type:t}),i=new FileReader;i.readAsDataURL(o),i.onload=()=>n(i.result),i.onerror=a=>r(a)})}const fs="https://identity.dev.svc.youverify.co";function ps(){return{postData:async t=>{const{faceImage:n,publicKey:r,passed:o,metadata:i}=t,a=await fetch(`${fs}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:r,components:["liveness"],faceImage:n,passed:o,metadata:i})});if(!a.ok)throw a;return(await a.json()).data}}}const vs=360,hs="#125766",_s="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",lo={"complete-the-circle":{Icon:es,name:"Complete The Circle ⭕️",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"},"yes-or-no":{Icon:ts,name:"Yes or No ❓",description:"First position your face in the camera. Then tilt your head to the left to answer No and to the right to answer Yes"},motions:{Icon:ns,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:io,name:"Facial Expressions 🤪",description:"First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"}},co=B({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let uo,fo=!1;function ms(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u}=e,[d,c]=k(0),[p,f]=k(0),[_,y]=k(null),{saveStream:m,savePhoto:h,savedPhoto:g}=so(),{postData:T}=ps(),b=F(()=>p===n.length,[n,p]),$=()=>{f(S=>S+1),c(S=>S+1)},x=S=>{const N=new Image;N.crossOrigin="Anonymous",N.src=_s,N.onload=()=>{const j=ao(N,N.width,N.height);vn.detectFaces(S,j)}},A=async()=>{const S=await T({faceImage:g.current?await ds(g.current,"image/png"):null,publicKey:t,passed:!0,metadata:u});l(S),s()},M=async()=>{const S=await vn.loadDetector();uo=S,x(S),y(S)};return L(()=>{if(fo){y(uo);return}M(),fo=!0},[]),v(co.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:d,completed:b,completedCount:p,nextTask:$,branding:a,onRequestClose:s,faceDetector:_,saveStream:m,savePhoto:h,onComplete:A},children:r})}function ke(){return U(co)}const q={root:"_root_vqy7d_1",container:"_container_vqy7d_4",lhs:"_lhs_vqy7d_7",info:"_info_vqy7d_11",active:"_active_vqy7d_32",completed:"_completed_vqy7d_39",rhs:"_rhs_vqy7d_62",profile:"_profile_vqy7d_65",avatar:"_avatar_vqy7d_68",main:"_main_vqy7d_81",content:"_content_vqy7d_84"},hn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function ys(){const{branding:e}=ke();return v("div",{className:hn.root,children:v("div",{className:hn.container,children:v("div",{className:hn.brand,children:(e==null?void 0:e.logo)&&v("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const po="colorScheme";function gs(){const{namespace:e}=ke(),t=()=>{const o=localStorage.getItem(po);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(po,o);const i=`${e}-color-scheme`,a=document.documentElement;o&&o==="dark"?a==null||a.setAttribute(i,"dark"):a==null||a.removeAttribute(i)};return{setColorScheme:n,toggleColorScheme:()=>{const o=t();return n(o==="dark"?"light":"dark")},getColorScheme:t}}const ws={root:"_root_bcsvc_1"};function bs(){if(!(window.screen.width>=900))return 10/9}function _n(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),a=w(null),{start:s,stop:l}=so({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:bs()}}});a.current=p,s(p),o.current&&(o.current.srcObject=p)}catch{}},d=()=>{a.current&&(a.current.getTracks().forEach(p=>p.stop()),a.current=null,l(),o.current&&(o.current.srcObject=null))},c=()=>{n(o),i.current=requestAnimationFrame(c)};return L(()=>{const p=o.current;if(!p)return;const f=()=>{i.current=requestAnimationFrame(c)};return u(),p.addEventListener("canplay",f),()=>{p.removeEventListener("canplay",f),cancelAnimationFrame(i.current),d()}},[]),v("div",{className:ws.root,children:[v("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Ge={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},vo=360,$s=50;function Es(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=$s}=e,i=F(()=>{const a=[Ge.container];return r&&a.push(Ge.focused),a.join(" ")},[r]);return v("div",{className:i,children:[v(ae,{as:"div",show:r,leave:"yvlw-transition yvlw-linear yvlw-duration-300",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-125 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-300",enterFrom:"yvlw-scale-125 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:v("div",{className:Ge.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*vo/o,l=Math.ceil((s+1)*n/vo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Ge.completed);const p=u?"translateX(158px)":"translateX(150px)";return v("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),v(ae,{as:"div",show:!r,leave:"yvlw-transition yvlw-linear yvlw-duration-200",leaveFrom:"yvlw-scale-100 yvlw-opacity-100",leaveTo:"yvlw-scale-75 yvlw-opacity-0",enter:"yvlw-transition yvlw-linear yvlw-duration-200",enterFrom:"yvlw-scale-75 yvlw-opacity-0",enterTo:"yvlw-scale-100 yvlw-opacity-100",className:"yvlw-absolute",children:v("div",{className:Ge.marker,children:[v("div",{}),v("div",{}),v("div",{}),v("div",{})]})})]})}function Cs(){return{checkZoomLevel:(r,o)=>{const{box:i}=r,{width:a,height:s}=i,l=a*s,u=o**2,d=l/u;if(d>.9)throw new Error("Move face farther from camera");if(d<.05)throw new Error("Move face closer to camera")},checkFacialFeatures:(r,o)=>{},checkInFrame:(r,o)=>{const{offsetX:i,offsetY:a}=o,{box:s}=r;if(!(s.xMin-i>=o.x&&s.yMin-a>=o.y&&s.xMax-i<=o.x+o.width&&s.yMax-a<=o.y+o.height))throw new Error("Position head in frame")}}}function mn(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i}=ke(),{checkFacialFeatures:a,checkZoomLevel:s,checkInFrame:l}=Cs(),u=w(null),d=(p,f)=>{var _;try{if(p.length===0)throw new Error("Detecting face...");if(p.length>1)throw new Error("A maximum of 1 face is allowed");const y=u.current,m=(_=u.current)==null?void 0:_.parentElement;if(!y||!m)return;const h=p[0];for(const g of t)switch(g){case"zoom":s(h,Math.min(m.clientHeight,m.clientWidth));break;case"features":a(h,Math.min(m.clientHeight,m.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const T=n+200;l(h,{x:(m.clientWidth-T)/2,y:(m.clientHeight-T)/2,width:T,height:T,offsetX:(y.videoWidth-m.clientWidth)/2,offsetY:(y.videoHeight-m.clientHeight)/2});break;default:break}r(h,f)}catch(y){const{message:m}=y;o(m)}};return{detectFaces:async p=>{if(!i)return;const{ref:f}=p;u.current=f.current;const _=u.current;if(!_)throw new Error("No Video Source detected");const{videoWidth:y,videoHeight:m}=_;if(y===0||m===0)return;const h=ao(_,y,m),g=await vn.detectFaces(i,h);d(g,h)}}}const le={root:"_root_1psx5_1",container:"_container_1psx5_4",progress:"_progress_1psx5_7",intro:"_intro_1psx5_12",content:"_content_1psx5_15",branding:"_branding_1psx5_18",instructionsContainer:"_instructionsContainer_1psx5_22",instructions:"_instructions_1psx5_22"},ho={root:"_root_1j21c_1",spinner:"_spinner_1j21c_18",spin:"_spin_1j21c_18"};function wt(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s}=e;return v("div",{className:ho.root,children:[v(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),v("h2",{children:r}),v("p",{className:"subtext",children:n}),v("div",{className:"yvlw-mt-12",children:v(mi,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[v("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&v("span",{className:ho.spinner})]})}),s]})}function yn(e){const{children:t,instruction:n,name:r,completed:o,onStart:i=()=>{}}=e,[a,s]=k(!1),{completedCount:l,tasks:u,nextTask:d}=ke(),c=F(()=>lo[r],[r]),p=F(()=>l*100/u.length,[l,u.length]);return v("div",{className:le.root,children:v("div",{className:`${le.container} view`,children:[v("div",{style:{width:`${p}%`},className:le.progress}),v(ae,{show:!a&&!o,as:"div",enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:"yvlw-absolute yvlw-h-full yvlw-w-full",children:v("div",{className:`${le.intro}`,children:v(wt,{Icon:c.Icon,title:`${c.name.slice(0,-2)}`,description:`${c.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await i(),s(!0)},actionText:"Okay, got it!"})})}),v(ae,{as:"div",show:a&&!o,enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:"yvlw-absolute yvlw-w-full yvlw-h-full",children:[v("div",{className:`${le.content}`,children:t}),v("div",{className:le.instructionsContainer,children:[v("div",{className:le.instructions,children:[v("h2",{children:n.title}),v("p",{className:"subtext",children:n.description})]}),v("div",{className:le.branding,children:[v("span",{children:"Powered by"})," ",v(as,{size:"custom",className:"yvlw-h-3"})]})]})]}),v(ae,{show:o,as:"div",enter:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:"yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:"yvlw-absolute yvlw-w-full yvlw-h-full",children:v("div",{className:`${le.intro}`,children:v(wt,{Icon:c.Icon,title:"One task down!",description:`You have completed the ${c.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>d(),actionText:"Next"})})})]})})}const Ts=1,gn=8;function ks(e){const{difficulty:t}=e,{saveStream:n,savePhoto:r}=ke(),[o,i]=k([]),[a,s]=k("Place face in frame"),[l,u]=k(!1),[d,c]=k(!1),p=w(new Set),f=w(!1),_=w(null),y=$=>{const x=$*gn,A=Math.ceil((x+1)/vs);p.current.has(A)||(p.current.add(A),i(Array.from(p.current))),p.current.size>=gn&&setTimeout(()=>{c(!0)},1e3)},m=($,x)=>{let M=Math.atan2(x,$)*(180/Math.PI);return M<0&&(M+=360),M},h=F(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),g=$=>{const{keypoints:x,box:A}=$,M={x:A.width*.5,y:A.height*.5},S=x[Ts],N={y:S.y-A.yMin,x:S.x-A.xMin},j=M.x-N.x,J=N.y-M.y;return Math.abs(j)<h&&Math.abs(J)<h?null:m(j,J)},{detectFaces:T}=mn({frameSize:280,validations:["zoom","in-frame"],onFace:($,x)=>{r(x),u(!0),s("Slowly move head around to complete circle");const A=g($);A&&y(A)},onError:$=>{s($),i([]),p.current.clear(),_.current=null,f.current=!1}});return v(D,{children:v(yn,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,children:v(_n,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:x}=$.current;T({ref:$,frameSize:x})}catch{}},onRecord:n,children:v(Es,{faceDetected:l,sectionsCount:gn,visitedSections:o})})})})}const wn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Fs(e){const{show:t,stickers:n}=e;return v(D,{children:t&&v("div",{className:wn.root,children:n.map(r=>v("div",{className:`${wn.sticker} ${wn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const xs={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},Ss="Wrong answer. Try again";function Ps(e){const{difficulty:t,questions:n=[xs]}=e,[r,o]=k("Keep face in camera"),[i,a]=k(!1),[s,l]=k(!1),{saveStream:u,savePhoto:d}=ke(),c=w("inactive"),p=w(0),f=w(!1),_=b=>{const{keypoints:$}=b,x=$[1],A=$[9],M=x.x-A.x,S=x.y-A.y;return 90-Math.atan2(S,M)*(180/Math.PI)},y=b=>{c.current="inactive",o(n[b].question),setTimeout(()=>{c.current="active"},2e3)},m=F(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),h=b=>{try{if(c.current="inactive",Math.abs(b)<m)throw new Error("Tilt head further to answer");const $=b>0,x=n[p.current].answer;if($===x)p.current+=1,p.current===n.length?l(!0):y(p.current);else throw new Error(n[p.current].errorMessage||Ss)}catch($){o($.message),setTimeout(()=>{y(p.current)},2e3)}},{detectFaces:g}=mn({onFace:(b,$)=>{if(f.current||(a(!0),d($),f.current=!0,y(p.current)),c.current==="inactive")return;const x=_(b);h(x)},onError:b=>{o(b)}});return v(yn,{instruction:{title:r,description:i?"":"Move head left for No and right for Yes"},name:"yes-or-no",completed:s,children:v(_n,{onStream:b=>{try{if(!b.current||s)return;const{videoWidth:$}=b.current;g({ref:b,frameSize:$})}catch{}},onRecord:u,children:v(Fs,{show:i,stickers:["yes","no"]})})})}function Ls(e={}){const{onChange:t=()=>{}}=e,n=!!window.DeviceOrientationEvent,r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma})};return L(()=>(window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r)}),[]),{canUse:n}}function Ms(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(null),a=w(!0),s=w(null),l=w(null),u=w(0),d=w(!1),c=F(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const y=t-u.current;let m=`Nod head ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=Ls({onChange:y=>{l.current=y}});return{evaluate:y=>{if(!f){n("Cannot perform task. Transfer to mobile device to complete");return}if(!l.current||!l.current.beta){n("Cannot perform task. Transfer to mobile device to complete");return}if(l.current.beta<60||l.current.beta>100){n("Keep phone in upright position to continue");return}if(d.current)return;const{keypoints:m}=y,h=Me(m[6].x-m[8].x,m[6].y-m[8].y),T=Me(m[2].x-m[1].x,m[2].y-m[1].y)/h*10;if(T>c){if(i.current||!a.current)return;i.current=T,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-T>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()}}}function Ns(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=F(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:s=>{if(o.current)return;const{keypoints:l}=s,u=Me(l[6].x-l[8].x,l[6].y-l[8].y);if(Me(l[14].x-l[13].x,l[14].y-l[13].y)/u*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")}}}function Ds(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),a=w(!1),s=w(null),l=w(0),u=F(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=_=>{i.current&&(_>=u.closed||(i.current=!1,s.current=Date.now()))},c=_=>{if(!i.current&&!(_<u.open)&&(i.current=!0,s.current)){const y=Date.now(),m=s.current;(y-m)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const _=t-l.current;let y=`Blink right eye ${_} `;_<t&&(y+="more "),y+=_>1?"times":"time",n(y);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:_=>{if(a.current)return;const{keypoints:y}=_,m=Me(y[6].x-y[8].x,y[6].y-y[8].y),g=Me(y[145].x-y[159].x,y[145].y-y[159].y)/m*100;d(g),c(g),p()}}}function Hs(){return{requestDeviceOrientationPermission:async()=>{if(!window.DeviceOrientationEvent)throw new Error("Cannot continue. Transfer to mobile device to complete");const t=window.DeviceOrientationEvent;if(typeof t.requestPermission=="function"&&await t.requestPermission()!=="granted")throw new Error("Permission for device orientation not granted")}}}var _o=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(_o||{});const mo=us(Object.keys(_o));function As(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5}=e,o=w(0),[i,a]=k("Keep face in camera"),[s,l]=k(!1),[u,d]=k(null),c=w(!1),{requestDeviceOrientationPermission:p}=Hs(),f=()=>{if(o.current===mo.length-1){l(!0);return}o.current+=1},_=Ms({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:b=>a(b),onComplete:f}),y=Ns({difficulty:t,onMessage:b=>a(b),onComplete:f}),m=Ds({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:b=>a(b),onComplete:f}),{detectFaces:h}=mn({onFace:b=>{switch(c.current||(c.current=!0),mo[o.current]){case"nod":_.evaluate(b);break;case"open_mouth":y.evaluate(b);break;case"blink":m.evaluate(b);break}},onError:b=>{a(b)}});return v(yn,{instruction:{title:i,description:"Follow the directives as instructed"},name:"motions",completed:s,onStart:async()=>{try{await p()}catch(b){const $=b;a($.message),d($)}},children:u?v(D,{}):v(_n,{onStream:async b=>{try{if(!b.current||s)return;const{videoWidth:$}=b.current;await h({ref:b,frameSize:$,throttleInterval:500})}catch{}}})})}function Os(){var m;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=gs(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s}=ke(),[l,u]=k(!1),[d,c]=k(!1),[p,f]=k(null);L(()=>{const h=t();n(h)},[]);const _=async()=>{try{u(!0),f(null),await s()}catch(h){f(h.message)}finally{u(!1)}},y=I(h=>h===i?q.active:i>h?q.completed:"subtext",[i]);return v("div",{className:q.root,children:v("div",{className:q.container,children:[v("div",{className:`${q.lhs} divider`,children:[v("div",{className:q.info,children:[v(ys,{}),v("div",{children:v("p",{className:"yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext",children:"You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way."})}),v("ol",{children:[o.map((h,g)=>v("li",{className:y(g),children:lo[h.id].name},`task-${g}`)),v("li",{className:a?q.active:"",children:"Complete! 🎉"})]})]}),v("footer",{className:"divider",children:[v("div",{children:"Powered by Youverify"}),v("div",{onClick:()=>e(),role:"button",children:[v("div",{className:"dark:yvlw-hidden",children:v(io,{})}),v("div",{className:"yvlw-hidden dark:yvlw-block",children:v(Ja,{})})]})]})]}),v("div",{className:q.main,children:v("div",{className:q.content,children:[v(ae,{show:!d,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:v("div",{className:q.completed,children:v(wt,{Icon:rs,title:"Liveness Check",description:"To ensure the security of your identity, we conduct a liveness check to verify that you are a real person actively engaging with the process.",actionText:"Start Liveness Test",onActionClick:()=>c(!0)})})}),o.map((h,g)=>{let T;switch(h.id){case"complete-the-circle":T=v(ks,{...h});break;case"yes-or-no":T=v(Ps,{...h});break;case"motions":T=v(As,{...h});break;default:T=v(D,{});break}return v(ae,{show:d&&!a&&i===g,appear:!0,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full",children:T},`task-${g}`)}),v(ae,{show:d&&a,as:"div",leave:"yvlw-transform yvlw-transition yvlw-duration-300",leaveFrom:"yvlw-translate-y-0 yvlw-opacity-100",leaveTo:"yvlw--translate-y-full yvlw-opacity-0",enterFrom:"yvlw-translate-y-full yvlw-opacity-0",enterTo:"yvlw-translate-y-0 yvlw-opacity-100",className:"yvlw-h-full yvlw-w-full",children:v("div",{className:q.completed,children:v(wt,{Icon:os,title:"Successful",description:"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:l,onActionClick:_,children:p&&v("div",{className:"yvlw-mt-3",children:p})})})})]})}),v("div",{className:`${q.rhs} divider`,children:[r&&v("div",{className:`${q.profile} divider`,children:[v("div",{children:v("div",{className:q.avatar,children:[r.firstName.charAt(0).toUpperCase(),(m=r.lastName)==null?void 0:m.charAt(0).toUpperCase()]})}),v("div",{children:[v("h4",{children:[r.firstName," ",r.lastName]}),r.email&&v("p",{className:"subtext",children:r.email})]})]}),v("footer",{children:[v("div",{children:"About · Terms · Help · Privacy · Contact"}),v("div",{children:"© 2024 from Youverify Inc."})]})]})]})})}function Is(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d}=e,[c,p]=k(e.show),f=()=>{p(!1),i()};return v(ms,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:f,onSuccess:a,onFailure:s,metadata:d,children:v(Xa,{id:n,open:l==="page"?!0:c,onClose:f,transition:!0,className:`${Qa.root} ${gt.root} ${gt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??hs},children:[l==="modal"&&v("div",{onClick:f,role:"button",className:gt.close,children:v(is,{className:"yvlw-text-white"})}),v(oo,{className:`${gt.container}`,children:v(Os,{})})]})})}class Rs{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk",this.scriptsURLs=["https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh@0.4.1633559619/face_mesh.min.js","https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core@4.20.0/dist/tf-core.min.js","https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl@4.20.0/dist/tf-backend-webgl.min.js","https://cdn.jsdelivr.net/npm/@tensorflow-models/face-landmarks-detection@1.0.5/dist/face-landmarks-detection.min.js"],this.addedResources=[];const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),this.addResources(),n==="page"&&this.start()}addResources(){for(const t of this.scriptsURLs){const n=document.createElement("script");n.src=t,n.async=!1,this.addedResources.push(n),document.head.appendChild(n)}}removeResources(){for(const t of this.addedResources)document.head.removeChild(t)}validateOptions(){if(!this.tasks)throw new Error("Tasks cannot be empty!");if(!this.props.publicKey)throw new Error("A Public Key is required");if(this.props.user&&!this.props.user.firstName)throw new Error("First Name is required when User object is supplied")}async start(t){t&&(this.tasks=t),this.validateOptions(),this.container=document.createElement("div"),document.body.appendChild(this.container),Fe(v(Is,{namespace:this.namespace,publicKey:this.props.publicKey,presentation:this.props.presentation,show:!0,tasks:this.tasks,user:this.props.user,branding:this.props.branding,onClose:()=>this.close(),onSuccess:this.props.onSuccess,onFailure:this.props.onFailure,metadata:this.props.metadata}),this.container)}close(){if(this.container&&this.presentation!=="page"){if(!document.body.contains(this.container))return;document.body.removeChild(this.container),this.props.onClose&&this.props.onClose()}}terminate(){this.removeResources()}}return Rs});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youverify-liveness-web",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"