youverify-liveness-web 0.1.17 → 0.1.18
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/README.md +2 -1
- package/dist/index.js +11 -4
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,8 @@ The `onSuccess` and `onFailure` callbacks (if supplied) are passed the following
|
|
|
130
130
|
| Option | Type | Description |
|
|
131
131
|
| --- | --- | --- |
|
|
132
132
|
| `data` | Object | Data passed through callback |
|
|
133
|
-
| `data.faceImage` |
|
|
133
|
+
| `data.faceImage` | String | Face Image of user performing liveness check |
|
|
134
|
+
| `data.livenessClip` | String | Video of user performing liveness check |
|
|
134
135
|
| `data.passed` | Boolean | Indicator on whether liveness check passed or failed |
|
|
135
136
|
| `data.metadata` | Any | Metadata passed in during initialization |
|
|
136
137
|
|
package/dist/index.js
CHANGED
|
@@ -2550,7 +2550,13 @@ function er(e, t) {
|
|
|
2550
2550
|
const Ms = (e) => e ? "https://identity.staging.svc.youverify.co" : "https://identity.svc.youverify.co";
|
|
2551
2551
|
function Ps(e) {
|
|
2552
2552
|
return { postData: async (n) => {
|
|
2553
|
-
const {
|
|
2553
|
+
const {
|
|
2554
|
+
faceImage: r,
|
|
2555
|
+
publicKey: o,
|
|
2556
|
+
passed: i,
|
|
2557
|
+
metadata: a,
|
|
2558
|
+
video: s
|
|
2559
|
+
} = n, l = Ms(e), u = await fetch(`${l}/v1/sdk/identity/liveness/`, {
|
|
2554
2560
|
method: "POST",
|
|
2555
2561
|
headers: {
|
|
2556
2562
|
"Content-Type": "application/json"
|
|
@@ -2559,13 +2565,14 @@ function Ps(e) {
|
|
|
2559
2565
|
publicMerchantID: o,
|
|
2560
2566
|
components: ["liveness"],
|
|
2561
2567
|
faceImage: r,
|
|
2568
|
+
livenessClip: s,
|
|
2562
2569
|
passed: i,
|
|
2563
2570
|
metadata: a
|
|
2564
2571
|
})
|
|
2565
2572
|
});
|
|
2566
|
-
if (!
|
|
2567
|
-
throw
|
|
2568
|
-
return (await
|
|
2573
|
+
if (!u.ok)
|
|
2574
|
+
throw u;
|
|
2575
|
+
return (await u.json()).data;
|
|
2569
2576
|
} };
|
|
2570
2577
|
}
|
|
2571
2578
|
const Ns = 360, Ls = "#125766", As = "https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg", Co = {
|
package/dist/index.umd.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
(function(le,k){typeof exports=="object"&&typeof module<"u"?module.exports=k():typeof define=="function"&&define.amd?define(k):(le=typeof globalThis<"u"?globalThis:le||self,le.YouverifyLiveness=k())})(this,function(){"use strict";var le,k,Sn,$e,Fn,Mn,Ft,Mt,Pt,Nt,Pn,Ve={},Nn=[],Fo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rt=Array.isArray;function ce(e,t){for(var n in t)e[n]=t[n];return e}function Ln(e){var t=e.parentNode;t&&t.removeChild(e)}function J(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?le.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 Ue(e,a,r,o,null)}function Ue(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??++Sn,__i:-1,__u:0};return o==null&&k.vnode!=null&&k.vnode(i),i}function Lt(){return{current:null}}function H(e){return e.children}function ee(e,t){this.props=e,this.context=t}function Ee(e,t){if(t==null)return e.__?Ee(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"?Ee(e):null}function An(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 An(e)}}function At(e){(!e.__d&&(e.__d=!0)&&$e.push(e)&&!ot.__r++||Fn!==k.debounceRendering)&&((Fn=k.debounceRendering)||Mn)(ot)}function ot(){var e,t,n,r,o,i,a,s;for($e.sort(Ft);e=$e.shift();)e.__d&&(t=$e.length,r=void 0,i=(o=(n=e).__v).__e,a=[],s=[],n.__P&&((r=ce({},o)).__v=o.__v+1,k.vnode&&k.vnode(r),Dt(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,i??Ee(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,Rn(a,r,s),r.__e!=i&&An(r)),$e.length>t&&$e.sort(Ft));ot.__r=0}function Dn(e,t,n,r,o,i,a,s,l,u,d){var c,p,f,_,y,m=r&&r.__k||Nn,v=t.length;for(n.__d=l,Mo(n,t,m),l=n.__d,c=0;c<v;c++)(f=n.__k[c])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?Ve:m[f.__i]||Ve,f.__i=c,Dt(e,f,p,o,i,a,s,l,u,d),_=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Ht(p.ref,null,f),d.push(f.ref,f.__c||_,f)),y==null&&_!=null&&(y=_),65536&f.__u||p.__k===f.__k?l=Hn(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 Mo(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?Ue(null,o,null,null,null):rt(o)?Ue(H,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ue(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=Po(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=Ee(i)),It(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=Ee(i)),It(i,i))}function Hn(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=Hn(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Ee(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ue(e,t){return t=t||[],e==null||typeof e=="boolean"||(rt(e)?e.some(function(n){ue(n,t)}):t.push(e)),t}function Po(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 In(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Fo.test(t)?n:n+"px"}function it(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||In(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||In(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=Mt,e.addEventListener(t,i?Nt:Pt,i)):e.removeEventListener(t,i?Nt:Pt,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 On(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Mt++;else if(t.t<n.u)return;return n(k.event?k.event(t):t)}}}function Dt(e,t,n,r,o,i,a,s,l,u){var d,c,p,f,_,y,m,v,g,b,C,E,N,R,V,W,$=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=k.__b)&&d(t);e:if(typeof $=="function")try{if(v=t.props,g="prototype"in $&&$.prototype.render,b=(d=$.contextType)&&r[d.__c],C=d?b?b.props.value:d.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:(g?t.__c=c=new $(v,C):(t.__c=c=new ee(v,C),c.constructor=$,c.render=Lo),b&&b.sub(c),c.props=v,c.state||(c.state={}),c.context=C,c.__n=r,p=c.__d=!0,c.__h=[],c._sb=[]),g&&c.__s==null&&(c.__s=c.state),g&&$.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ce({},c.__s)),ce(c.__s,$.getDerivedStateFromProps(v,c.__s))),f=c.props,_=c.state,c.__v=t,p)g&&$.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),g&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(g&&$.getDerivedStateFromProps==null&&v!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(v,C),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(v,c.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=v,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(F){F&&(F.__=t)}),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(v,c.__s,C),g&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,_,y)})}if(c.context=C,c.props=v,c.__P=e,c.__e=!1,N=k.__r,R=0,g){for(c.state=c.__s,c.__d=!1,N&&N(t),d=c.render(c.props,c.state,c.context),V=0;V<c._sb.length;V++)c.__h.push(c._sb[V]);c._sb=[]}else do c.__d=!1,N&&N(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++R<25);c.state=c.__s,c.getChildContext!=null&&(r=ce(ce({},r),c.getChildContext())),g&&!p&&c.getSnapshotBeforeUpdate!=null&&(y=c.getSnapshotBeforeUpdate(f,_)),Dn(e,rt(W=d!=null&&d.type===H&&d.key==null?d.props.children:d)?W:[W],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(F){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;k.__e(F,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=No(n.__e,t,n,r,o,i,a,l,u);(d=k.diffed)&&d(t)}function Rn(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)Ht(n[r],n[++r],n[++r]);k.__c&&k.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){k.__e(i,o.__v)}})}function No(e,t,n,r,o,i,a,s,l){var u,d,c,p,f,_,y,m=n.props,v=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(v);e=document.createElementNS(o,g,v.is&&v),i=null,s=!1}if(g===null)m===v||s&&e.data===v||(e.data=v);else{if(i=i&&le.call(e.childNodes),m=n.props||Ve,!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 v)){if(u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v)continue;it(e,u,null,f,o)}}for(u in v)f=v[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||it(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=""),Dn(e,rt(p)?p:[p],t,n,r,g==="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Ee(n,0),s,l),i!=null)for(u=i.length;u--;)i[u]!=null&&Ln(i[u]);s||(u="value",_!==void 0&&(_!==e[u]||g==="progress"&&!_||g==="option"&&_!==m[u])&&it(e,u,_,m[u],o),u="checked",y!==void 0&&y!==e[u]&&it(e,u,y,m[u],o))}return e}function Ht(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){k.__e(o,n)}}function It(e,t,n){var r,o;if(k.unmount&&k.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Ht(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){k.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&It(r[o],t,n||typeof e.type!="function");n||e.__e==null||Ln(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Lo(e,t,n){return this.constructor(e,n)}function De(e,t,n){var r,o,i,a;k.__&&k.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],Dt(t,e=(!r&&n||t).__k=J(H,null,[e]),o||Ve,Ve,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?le.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),Rn(i,e,a)}function Vn(e,t){De(e,t,Vn)}function Ao(e,t,n){var r,o,i,a,s=ce({},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?le.call(arguments,2):n),Ue(e.type,s,r||e.key,o||e.ref,null)}function Y(e,t){var n={__c:t="__cC"+Pn++,__: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,At(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}le=Nn.slice,k={__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}},Sn=0,ee.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ce({},this.state),typeof e=="function"&&(e=e(ce({},n),this.props)),e&&ce(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),At(this))},ee.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),At(this))},ee.prototype.render=H,$e=[],Mn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ft=function(e,t){return e.__v.__b-t.__v.__b},ot.__r=0,Mt=0,Pt=On(!1),Nt=On(!0),Pn=0;var Do=0;function h(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:--Do,__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 k.vnode&&k.vnode(u),u}var de,A,Ot,Un,He=0,Wn=[],O=k,jn=O.__b,Bn=O.__r,zn=O.diffed,qn=O.__c,Kn=O.unmount,Yn=O.__;function Te(e,t){O.__h&&O.__h(A,e,He||t),He=0;var n=A.__H||(A.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function S(e){return He=1,We(Zn,e)}function We(e,t,n){var r=Te(de++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Zn(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=A,!A.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))};A.u=!0;var i=A.shouldComponentUpdate,a=A.componentWillUpdate;A.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)},A.shouldComponentUpdate=o}return r.__N||r.__}function L(e,t){var n=Te(de++,3);!O.__s&&Wt(n.__H,t)&&(n.__=e,n.i=t,A.__H.__h.push(n))}function Ce(e,t){var n=Te(de++,4);!O.__s&&Wt(n.__H,t)&&(n.__=e,n.i=t,A.__h.push(n))}function w(e){return He=5,P(function(){return{current:e}},[])}function Rt(e,t,n){He=6,Ce(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 P(e,t){var n=Te(de++,7);return Wt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return He=8,P(function(){return e},t)}function B(e){var t=A.context[e.__c],n=Te(de++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(A)),t.props.value):e.__}function Vt(e,t){O.useDebugValue&&O.useDebugValue(t?t(e):e)}function Ho(e){var t=Te(de++,10),n=S();return t.__=e,A.componentDidCatch||(A.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function _e(){var e=Te(de++,11);if(!e.__){for(var t=A.__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 Io(){for(var e;e=Wn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(at),e.__H.__h.forEach(Ut),e.__H.__h=[]}catch(t){e.__H.__h=[],O.__e(t,e.__v)}}O.__b=function(e){A=null,jn&&jn(e)},O.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Yn&&Yn(e,t)},O.__r=function(e){Bn&&Bn(e),de=0;var t=(A=e.__c).__H;t&&(Ot===A?(t.__h=[],A.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(at),t.__h.forEach(Ut),t.__h=[],de=0)),Ot=A},O.diffed=function(e){zn&&zn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wn.push(t)!==1&&Un===O.requestAnimationFrame||((Un=O.requestAnimationFrame)||Oo)(Io)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Ot=A=null},O.__c=function(e,t){t.some(function(n){try{n.__h.forEach(at),n.__h=n.__h.filter(function(r){return!r.__||Ut(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],O.__e(r,n.__v)}}),qn&&qn(e,t)},O.unmount=function(e){Kn&&Kn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{at(r)}catch(o){t=o}}),n.__H=void 0,t&&O.__e(t,n.__v))};var Gn=typeof requestAnimationFrame=="function";function Oo(e){var t,n=function(){clearTimeout(r),Gn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Gn&&(t=requestAnimationFrame(n))}function at(e){var t=A,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),A=t}function Ut(e){var t=A;e.__c=e.__(),A=t}function Wt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Zn(e,t){return typeof t=="function"?t(e):t}function Xn(e,t){for(var n in t)e[n]=t[n];return e}function jt(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 st(e,t){this.props=e,this.context=t}function Qn(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:jt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,J(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(st.prototype=new ee).isPureReactComponent=!0,st.prototype.shouldComponentUpdate=function(e,t){return jt(this.props,e)||jt(this.state,t)};var Jn=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Jn&&Jn(e)};var Ro=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Bt(e){function t(n){var r=Xn({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Ro,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var er=function(e,t){return e==null?null:ue(ue(e).map(t))},tr={map:er,forEach:er,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},Vo=k.__e;k.__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)}Vo(e,t,n,r)};var nr=k.unmount;function rr(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=Xn({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return rr(r,t,n)})),e}function or(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return or(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 je(){this.__u=0,this.t=null,this.__b=null}function ir(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ar(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 J(n,i)}return o.displayName="Lazy",o.__f=!0,o}function Ie(){this.u=null,this.o=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),nr&&nr(e)},(je.prototype=new ee).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=ir(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]=or(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)},je.prototype.componentWillUnmount=function(){this.t=[]},je.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]=rr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&J(H,null,e.fallback);return o&&(o.__u&=-33),[J(H,null,t.__a?null:e.children),o]};var sr=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 Uo(e){return this.getChildContext=function(){return e.context},e.children}function Wo(e){var t=this,n=e.i;t.componentWillUnmount=function(){De(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)}}),De(J(Uo,{context:t.context},e.__v),t.l)}function lt(e,t){var n=J(Wo,{__v:e,i:t});return n.containerInfo=t,n}(Ie.prototype=new ee).__a=function(e){var t=this,n=ir(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),sr(t,e,r)):o()};n?n(i):i()}},Ie.prototype.render=function(e){this.u=null,this.o=new Map;var t=ue(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},Ie.prototype.componentDidUpdate=Ie.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){sr(e,n,t)})};var lr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,jo=/^(?: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]/,Bo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zo=/[A-Z0-9]/g,qo=typeof document<"u",Ko=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function cr(e,t,n){return t.__k==null&&(t.textContent=""),De(e,t),typeof n=="function"&&n(),e?e.__c:null}function ur(e,t,n){return Vn(e,t),typeof n=="function"&&n(),e?e.__c:null}ee.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ee.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var dr=k.event;function Yo(){}function Go(){return this.cancelBubble}function Zo(){return this.defaultPrevented}k.event=function(e){return dr&&(e=dr(e)),e.persist=Yo,e.isPropagationStopped=Go,e.isDefaultPrevented=Zo,e.nativeEvent=e};var zt,Xo={enumerable:!1,configurable:!0,get:function(){return this.class}},fr=k.vnode;k.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||qo&&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"||Ko(n.type)?s==="onfocus"?i="onfocusin":s==="onblur"?i="onfocusout":Bo.test(i)?i=s:r.indexOf("-")===-1&&jo.test(i)?i=i.replace(zo,"-$&").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=ue(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=ue(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",Xo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=lr,fr&&fr(e)};var pr=k.__r;k.__r=function(e){pr&&pr(e),zt=e.__c};var hr=k.diffed;k.diffed=function(e){hr&&hr(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),zt=null};var vr={ReactCurrentDispatcher:{current:{readContext:function(e){return zt.__n[e.__c].props.value},useCallback:D,useContext:B,useDebugValue:Vt,useDeferredValue:Yt,useEffect:L,useId:_e,useImperativeHandle:Rt,useInsertionEffect:Zt,useLayoutEffect:Ce,useMemo:P,useReducer:We,useRef:w,useState:S,useSyncExternalStore:ct,useTransition:Gt}}},Qo="17.0.2";function _r(e){return J.bind(null,e)}function Oe(e){return!!e&&e.$$typeof===lr}function mr(e){return Oe(e)&&e.type===H}function yr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function qt(e){return Oe(e)?Ao.apply(null,arguments):e}function gr(e){return!!e.__k&&(De(null,e),!0)}function wr(e){return e&&(e.base||e.nodeType===1&&e)||null}var br=function(e,t){return e(t)},$r=function(e,t){return e(t)},Er=H;function Kt(e){e()}function Yt(e){return e}function Gt(){return[!1,Kt]}var Zt=Ce,Tr=Oe;function ct(e,t){var n=t(),r=S({h:{__:n,v:t}}),o=r[0].h,i=r[1];return Ce(function(){o.__=n,o.v=t,Xt(o)&&i({h:o})},[e,n,t]),L(function(){return Xt(o)&&i({h:o}),e(function(){Xt(o)&&i({h:o})})},[e]),n}function Xt(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 T={useState:S,useId:_e,useReducer:We,useEffect:L,useLayoutEffect:Ce,useInsertionEffect:Zt,useTransition:Gt,useDeferredValue:Yt,useSyncExternalStore:ct,startTransition:Kt,useRef:w,useImperativeHandle:Rt,useMemo:P,useCallback:D,useContext:B,useDebugValue:Vt,version:"17.0.2",Children:tr,render:cr,hydrate:ur,unmountComponentAtNode:gr,createPortal:lt,createElement:J,createContext:Y,createFactory:_r,cloneElement:qt,createRef:Lt,Fragment:H,isValidElement:Oe,isElement:Tr,isFragment:mr,isMemo:yr,findDOMNode:wr,Component:ee,PureComponent:st,memo:Qn,forwardRef:Bt,flushSync:$r,unstable_batchedUpdates:br,StrictMode:Er,Suspense:je,SuspenseList:Ie,lazy:ar,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:vr};const Cr=Object.freeze(Object.defineProperty({__proto__:null,Children:tr,Component:ee,Fragment:H,PureComponent:st,StrictMode:Er,Suspense:je,SuspenseList:Ie,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:vr,cloneElement:qt,createContext:Y,createElement:J,createFactory:_r,createPortal:lt,createRef:Lt,default:T,findDOMNode:wr,flushSync:$r,forwardRef:Bt,hydrate:ur,isElement:Tr,isFragment:mr,isMemo:yr,isValidElement:Oe,lazy:ar,memo:Qn,render:cr,startTransition:Kt,unmountComponentAtNode:gr,unstable_batchedUpdates:br,useCallback:D,useContext:B,useDebugValue:Vt,useDeferredValue:Yt,useEffect:L,useErrorBoundary:Ho,useId:_e,useImperativeHandle:Rt,useInsertionEffect:Zt,useLayoutEffect:Ce,useMemo:P,useReducer:We,useRef:w,useState:S,useSyncExternalStore:ct,useTransition:Gt,version:Qo},Symbol.toStringTag,{value:"Module"})),xr=typeof document<"u"?T.useLayoutEffect:()=>{};function Jo(e){const t=w(null);return xr(()=>{t.current=e},[e]),D((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Be=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},xe=e=>e&&"window"in e&&e.window===e?e:Be(e).defaultView||window;function ei(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 ti(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 ni(){return ti(/^Mac/i)}function ri(){return ei(/Android/i)}function oi(e){return e.mozInputSource===0&&e.isTrusted?!0:ri()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class ii{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 kr(e){let t=w({isFocused:!1,observer:null});xr(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Jo(r=>{e==null||e(r)});return D(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 ii("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 ai(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=D(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),a=kr(i),s=D(l=>{const u=Be(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 ze=null,Qt=new Set,qe=new Map,ke=!1,Jt=!1;const si={Tab:!0,Escape:!0};function en(e,t){for(let n of Qt)n(e,t)}function li(e){return!(e.metaKey||!ni()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ut(e){ke=!0,li(e)&&(ze="keyboard",en("keyboard",e))}function X(e){ze="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(ke=!0,en("pointer",e))}function Sr(e){oi(e)&&(ke=!0,ze="virtual")}function Fr(e){e.target===window||e.target===document||(!ke&&!Jt&&(ze="virtual",en("virtual",e)),ke=!1,Jt=!1)}function Mr(){ke=!1,Jt=!0}function tn(e){if(typeof window>"u"||qe.get(xe(e)))return;const t=xe(e),n=Be(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ke=!0,r.apply(this,arguments)},n.addEventListener("keydown",ut,!0),n.addEventListener("keyup",ut,!0),n.addEventListener("click",Sr,!0),t.addEventListener("focus",Fr,!0),t.addEventListener("blur",Mr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",X,!0),n.addEventListener("pointermove",X,!0),n.addEventListener("pointerup",X,!0)):(n.addEventListener("mousedown",X,!0),n.addEventListener("mousemove",X,!0),n.addEventListener("mouseup",X,!0)),t.addEventListener("beforeunload",()=>{Pr(e)},{once:!0}),qe.set(t,{focus:r})}const Pr=(e,t)=>{const n=xe(e),r=Be(e);t&&r.removeEventListener("DOMContentLoaded",t),qe.has(n)&&(n.HTMLElement.prototype.focus=qe.get(n).focus,r.removeEventListener("keydown",ut,!0),r.removeEventListener("keyup",ut,!0),r.removeEventListener("click",Sr,!0),n.removeEventListener("focus",Fr,!0),n.removeEventListener("blur",Mr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",X,!0),r.removeEventListener("pointermove",X,!0),r.removeEventListener("pointerup",X,!0)):(r.removeEventListener("mousedown",X,!0),r.removeEventListener("mousemove",X,!0),r.removeEventListener("mouseup",X,!0)),qe.delete(n))};function ci(e){const t=Be(e);let n;return t.readyState!=="loading"?tn(e):(n=()=>{tn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Pr(e,n)}typeof document<"u"&&ci();function Nr(){return ze!=="pointer"}const ui=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function di(e,t,n){var r;const o=typeof window<"u"?xe(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?xe(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?xe(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?xe(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!ui.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&&!si[n.key])}function fi(e,t,n){tn(),L(()=>{let r=(o,i)=>{di(!!(n!=null&&n.isTextInput),o,i)&&e(Nr())};return Qt.add(r),()=>{Qt.delete(r)}},t)}function pi(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=w({isFocusWithin:!1}),a=D(u=>{i.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(u),o&&o(!1))},[n,o,i]),s=kr(a),l=D(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 dt=!1,nn=0;function rn(){dt=!0,setTimeout(()=>{dt=!1},50)}function Lr(e){e.pointerType==="touch"&&rn()}function hi(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Lr):document.addEventListener("touchend",rn),nn++,()=>{nn--,!(nn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Lr):document.removeEventListener("touchend",rn))}}function vi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=S(!1),s=w({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;L(hi,[]);let{hoverProps:l,triggerHoverEnd:u}=P(()=>{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=>{dt&&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&&!dt&&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 _i(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=w({isFocused:!1,isFocusVisible:t||Nr()}),[i,a]=S(!1),[s,l]=S(()=>o.current.isFocused&&o.current.isFocusVisible),u=D(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=D(f=>{o.current.isFocused=f,a(f),u()},[u]);fi(f=>{o.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:c}=ai({isDisabled:r,onFocusChange:d}),{focusWithinProps:p}=pi({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:s,focusProps:r?p:c}}var mi=Object.defineProperty,yi=(e,t,n)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>(yi(e,typeof t!="symbol"?t+"":t,n),n);let gi=class{constructor(){on(this,"current",this.detect()),on(this,"handoffState","pending"),on(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"}},Se=new gi;function ft(e){return Se.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function pt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function me(){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 pt(()=>{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=me();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 ht(){let[e]=S(me);return L(()=>()=>e.dispose(),[e]),e}let q=(e,t)=>{Se.isServer?L(e,t):Ce(e,t)};function Fe(e){let t=w(e);return q(()=>{t.current=e},[e]),t}let I=function(e){let t=Fe(e);return T.useCallback((...n)=>t.current(...n),[t])};function wi(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 bi(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function $i({disabled:e=!1}={}){let t=w(null),[n,r]=S(!1),o=ht(),i=I(()=>{t.current=null,r(!1),o.dispose()}),a=I(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let l=ft(s.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",u=>{if(t.current){let d=wi(u);r(bi(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:a,onPointerUp:i,onClick:i}}}let Ei=Y(void 0);function Ar(){return B(Ei)}function an(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ye(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,ye),r}var vt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(vt||{}),ge=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ge||{});function Z({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??Ti;let l=Dr(t,e);if(i)return _t(l,n,r,a,s);let u=o??0;if(u&2){let{static:d=!1,...c}=l;if(d)return _t(c,n,r,a,s)}if(u&1){let{unmount:d=!0,...c}=l;return ye(d?0:1,{0(){return null},1(){return _t({...c,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return _t(l,n,r,a,s)}function _t(e,t={},n,r,o){let{as:i=n,children:a,refName:s="ref",...l}=sn(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===H&&(Object.keys(Me(l)).length>0||Object.keys(Me(c)).length>0))if(!Oe(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Me(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(Me(l)).concat(Object.keys(Me(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"?(...v)=>an(f(...v),l.className):an(f,l.className),y=_?{className:_}:{},m=Dr(d.props,Me(sn(l,["ref"])));for(let v in c)v in m&&delete c[v];return qt(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return J(i,Object.assign({},sn(l,["ref"]),i!==H&&u,i!==H&&c),d)}function Ti(...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 Dr(...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 Ci(...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 K(e){var t;return Object.assign(Bt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Me(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let xi="button";function ki(e,t){var n;let r=Ar(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=_i({autoFocus:i}),{isHovered:u,hoverProps:d}=vi({isDisabled:o}),{pressed:c,pressProps:p}=$i({disabled:o}),f=Ci({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),_=P(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return Z({ourProps:f,theirProps:a,slot:_,defaultTag:xi,name:"Button"})}let Si=K(ki),Fi="div";var mt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(mt||{});function Mi(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 Z({ourProps:i,theirProps:o,slot:{},defaultTag:Fi,name:"Hidden"})}let ln=K(Mi),Pi=Y(null);function Ni({children:e}){let t=B(Pi);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?lt(T.createElement(T.Fragment,null,e),n):null}let Hr=Symbol();function Li(e,t=!0){return Object.assign(e,{[Hr]:t})}function oe(...e){let t=w(e);L(()=>{t.current=e},[e]);let n=I(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[Hr]))?void 0:n}let cn=Y(null);cn.displayName="DescriptionContext";function Ir(){let e=B(cn);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,Ir),t}return e}function Ai(){let[e,t]=S([]);return[e.length>0?e.join(" "):void 0,P(()=>function(n){let r=I(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=P(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return T.createElement(cn.Provider,{value:o},n.children)},[t])]}let Di="p";function Hi(e,t){let n=_e(),r=Ar(),{id:o=`headlessui-description-${n}`,...i}=e,a=Ir(),s=oe(t);q(()=>a.register(o),[o,a.register]);let l=r||!1,u=P(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return Z({ourProps:d,theirProps:i,slot:u,defaultTag:Di,name:a.name||"Description"})}let Ii=K(Hi),Oi=Object.assign(Ii,{});var Or=(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))(Or||{});let Ri=Y(()=>{});function Vi({value:e,children:t}){return T.createElement(Ri.Provider,{value:e},t)}let Ui=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 Rr(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 Vr(e){return ct(e.subscribe,e.getSnapshot,e.getSnapshot)}let Wi=new Ui(()=>Rr(()=>[],{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 Re(e,t){let n=Wi.get(t),r=_e(),o=Vr(n);if(q(()=>{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 un=new Map,Ke=new Map;function Ur(e){var t;let n=(t=Ke.get(e))!=null?t:0;return Ke.set(e,n+1),n!==0?()=>Wr(e):(un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Wr(e))}function Wr(e){var t;let n=(t=Ke.get(e))!=null?t:1;if(n===1?Ke.delete(e):Ke.set(e,n-1),n!==1)return;let r=un.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,un.delete(e))}function ji(e,{allowed:t,disallowed:n}={}){let r=Re(e,"inert-others");q(()=>{var o,i;if(!r)return;let a=me();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Ur(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=ft(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(Ur(c));d=d.parentElement}}return a.dispose},[r,t,n])}function jr(e,t,n){let r=Fe(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=me();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 dn=["[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(","),Bi=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var fe=(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))(fe||{}),fn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fn||{}),zi=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zi||{});function qi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(dn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ki(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Bi)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Br=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Br||{});function Yi(e,t=0){var n;return e===((n=ft(e))==null?void 0:n.body)?!1:ye(t,{0(){return e.matches(dn)},1(){let r=e;for(;r!==null;){if(r.matches(dn))return!0;r=r.parentElement}return!1}})}var Gi=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Gi||{});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 pe(e){e==null||e.focus({preventScroll:!0})}let Zi=["textarea","input"].join(",");function Xi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Zi))!=null?n:!1}function Qi(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 Ye(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?Qi(e):e:t&64?Ki(e):qi(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&&Xi(p)&&p.select(),2}function zr(){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 ea(){return zr()||Ji()}function Ge(e,t,n,r){let o=Fe(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 qr(e,t,n,r){let o=Fe(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 Kr=30;function ta(e,t,n){let r=Re(e,"outside-click"),o=Fe(n),i=D(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!Yi(d,Br.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=w(null);Ge(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),Ge(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),Ge(r,"click",l=>{ea()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=w({x:0,y:0});Ge(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ge(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=Kr||Math.abs(u.y-s.current.y)>=Kr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),qr(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ze(...e){return P(()=>ft(...e),[...e])}function Yr(e,t,n,r){let o=Fe(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 na(){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 ra(){return zr()?{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=me();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 oa(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ia(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Pe=Rr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:me(),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:ia(n)},o=[ra(),na(),oa()];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)}});Pe.subscribe(()=>{let e=Pe.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)&&Pe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Pe.dispatch("TEARDOWN",n)}});function aa(e,t,n=()=>({containers:[]})){let r=Vr(Pe),o=t?r.get(t):void 0,i=o?o.count>0:!1;return q(()=>{if(!(!t||!e))return Pe.dispatch("PUSH",t,n),()=>Pe.dispatch("POP",t,n)},[e,t]),i}function sa(e,t,n=()=>[document.body]){let r=Re(e,"scroll-lock");aa(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function la(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function ca(e=0){let[t,n]=S(e),r=D(l=>n(l),[t]),o=D(l=>n(u=>u|l),[t]),i=D(l=>(t&l)===l,[t]),a=D(l=>n(u=>u&~l),[n]),s=D(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var ua=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ua||{});function da(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function fa(e,t,n,r){let[o,i]=S(n),{hasFlag:a,addFlag:s,removeFlag:l}=ca(e&&o?3:0),u=w(!1),d=w(!1),c=ht();return q(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),pa(_,{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 pa(e,{prepare:t,run:n,done:r,inFlight:o}){let i=me();return va(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(ha(e,r)),n()}),i.dispose}function ha(e,t){let n=la(t),r=me();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 va(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 pn(e,t){let n=w([]),r=I(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 yt=Y(null);yt.displayName="OpenClosedContext";var te=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(te||{});function gt(){return B(yt)}function _a({value:e,children:t}){return T.createElement(yt.Provider,{value:e},t)}function ma({children:e}){return T.createElement(yt.Provider,{value:null},e)}function ya(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let we=[];ya(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&we[0]!==t.target&&(we.unshift(t.target),we=we.filter(n=>n!=null&&n.isConnected),we.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 Gr(e){let t=I(e),n=w(!1);L(()=>(n.current=!1,()=>{n.current=!0,pt(()=>{n.current&&t()})}),[t])}function ga(){let e=typeof document>"u";return"useSyncExternalStore"in Cr?(t=>t.useSyncExternalStore)(Cr)(()=>()=>{},()=>!1,()=>!e):!1}function Xe(){let e=ga(),[t,n]=S(Se.isHandoffComplete);return t&&Se.isHandoffComplete===!1&&n(!1),L(()=>{t!==!0&&n(!0)},[t]),L(()=>Se.handoff(),[]),e?!1:t}let Zr=Y(!1);function wa(){return B(Zr)}function Xr(e){return T.createElement(Zr.Provider,{value:e.force},e.children)}function ba(e){let t=wa(),n=B(Jr),r=Ze(e),[o,i]=S(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(Se.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 Qr=H,$a=K(function(e,t){let n=e,r=w(null),o=oe(Li(d=>{r.current=d}),t),i=Ze(r),a=ba(r),[s]=S(()=>{var d;return Se.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=B(hn),u=Xe();return q(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),q(()=>{if(s&&l)return l.register(s)},[l,s]),Gr(()=>{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:lt(Z({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Qr,name:"Portal"}),s):null});function Ea(e,t){let n=oe(t),{enabled:r=!0,...o}=e;return r?T.createElement($a,{...o,ref:n}):Z({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Qr,name:"Portal"})}let Ta=H,Jr=Y(null);function Ca(e,t){let{target:n,...r}=e,o={ref:oe(t)};return T.createElement(Jr.Provider,{value:n},Z({ourProps:o,theirProps:r,defaultTag:Ta,name:"Popover.Group"}))}let hn=Y(null);function xa(){let e=B(hn),t=w([]),n=I(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=I(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=P(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,P(()=>function({children:i}){return T.createElement(hn.Provider,{value:o},i)},[o])]}let ka=K(Ea),eo=K(Ca),Sa=Object.assign(ka,{Group:eo});function Fa(e,t=typeof document<"u"?document.defaultView:null,n){let r=Re(e,"escape");Yr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Or.Escape&&n(o))})}function Ma(){var e;let[t]=S(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=S((e=t==null?void 0:t.matches)!=null?e:!1);return q(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function Pa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=Ze(o),a=I(()=>{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:I(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:P(()=>function(){return n!=null?null:T.createElement(ln,{features:mt.Hidden,ref:o})},[o,n])}}function vn(){let e=w(!1);return q(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Qe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qe||{});function Na(){let e=w(0);return qr(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function to(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 La="div";var Ne=(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))(Ne||{});function Aa(e,t){let n=w(null),r=oe(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Xe()||(s=0);let u=Ze(n);Oa(s,{ownerDocument:u});let d=Ra(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Va(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=Na(),p=I(v=>{let g=n.current;g&&(b=>b())(()=>{ye(c.current,{[Qe.Forwards]:()=>{Ye(g,fe.First,{skipElements:[v.relatedTarget,i]})},[Qe.Backwards]:()=>{Ye(g,fe.Last,{skipElements:[v.relatedTarget,i]})}})})}),f=Re(!!(s&2),"focus-trap#tab-lock"),_=ht(),y=w(!1),m={ref:r,onKeyDown(v){v.key=="Tab"&&(y.current=!0,_.requestAnimationFrame(()=>{y.current=!1}))},onBlur(v){if(!(s&4))return;let g=to(a);n.current instanceof HTMLElement&&g.add(n.current);let b=v.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(no(g,b)||(y.current?Ye(n.current,ye(c.current,{[Qe.Forwards]:()=>fe.Next,[Qe.Backwards]:()=>fe.Previous})|fe.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&pe(v.target)))}};return T.createElement(T.Fragment,null,f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}),Z({ourProps:m,theirProps:l,defaultTag:La,name:"FocusTrap"}),f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}))}let Da=K(Aa),Ha=Object.assign(Da,{features:Ne});function Ia(e=!0){let t=w(we.slice());return pn(([n],[r])=>{r===!0&&n===!1&&pt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=we.slice())},[e,we,t]),I(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Oa(e,{ownerDocument:t}){let n=!!(e&8),r=Ia(n);pn(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&pe(r())},[n]),Gr(()=>{n&&pe(r())})}function Ra(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),a=Re(!!(e&1),"focus-trap#initial-focus"),s=vn();return pn(()=>{if(e===0)return;if(!a){o!=null&&o.current&&pe(o.current);return}let l=n.current;l&&pt(()=>{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)pe(r.current);else{if(e&16){if(Ye(l,fe.First|fe.AutoFocus)!==fn.Error)return}else if(Ye(l,fe.First)!==fn.Error)return;if(o!=null&&o.current&&(pe(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 Va(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=vn(),a=!!(e&4);Yr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=to(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?no(l,d)?(o.current=d,pe(d)):(s.preventDefault(),s.stopPropagation(),pe(u)):pe(o.current)},!0)}function no(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function ro(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:io)!==H||T.Children.count(e.children)===1}let wt=Y(null);wt.displayName="TransitionContext";var Ua=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ua||{});function Wa(){let e=B(wt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function ja(){let e=B(bt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let bt=Y(null);bt.displayName="NestingContext";function $t(e){return"children"in e?$t(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function oo(e,t){let n=Fe(e),r=w([]),o=vn(),i=ht(),a=I((f,_=ge.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(ye(_,{[ge.Unmount](){r.current.splice(y,1)},[ge.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!$t(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=I(f=>{let _=r.current.find(({el:y})=>y===f);return _?_.state!=="visible"&&(_.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,ge.Unmount)}),l=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),c=I((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(([v,g])=>g)).then(()=>m())})]),_==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(_)):y(_)}),p=I((f,_,y)=>{Promise.all(d.current[_].splice(0).map(([m,v])=>v)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(_))});return P(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let io=H,ao=vt.RenderStrategy;function Ba(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,v=w(null),g=ro(e),b=oe(...g?[v,t]:t===null?[]:[t]),C=(n=m.unmount)==null||n?ge.Unmount:ge.Hidden,{show:E,appear:N,initial:R}=Wa(),[V,W]=S(E?"visible":"hidden"),$=ja(),{register:F,unregister:x}=$;q(()=>F(v),[F,v]),q(()=>{if(C===ge.Hidden&&v.current){if(E&&V!=="visible"){W("visible");return}return ye(V,{hidden:()=>x(v),visible:()=>F(v)})}},[V,v,F,x,E,C]);let M=Xe();q(()=>{if(g&&M&&V==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,V,M,g]);let z=R&&!N,Q=N&&E&&R,ne=w(!1),re=oo(()=>{ne.current||(W("hidden"),x(v))},$),be=I(kn=>{ne.current=!0;let St=kn?"enter":"leave";re.onStart(v,St,nt=>{nt==="enter"?i==null||i():nt==="leave"&&(s==null||s())})}),ve=I(kn=>{let St=kn?"enter":"leave";ne.current=!1,re.onStop(v,St,nt=>{nt==="enter"?a==null||a():nt==="leave"&&(l==null||l())}),St==="leave"&&!$t(re)&&(W("hidden"),x(v))});L(()=>{g&&o||(be(E),ve(E))},[E,g,o]);let j=!(!o||!g||!M||z),[,U]=fa(j,v,E,{start:be,end:ve}),el=Me({ref:b,className:((r=an(m.className,Q&&u,Q&&d,U.enter&&u,U.enter&&U.closed&&d,U.enter&&!U.closed&&c,U.leave&&f,U.leave&&!U.closed&&_,U.leave&&U.closed&&y,!U.transition&&E&&p))==null?void 0:r.trim())||void 0,...da(U)}),tt=0;return V==="visible"&&(tt|=te.Open),V==="hidden"&&(tt|=te.Closed),U.enter&&(tt|=te.Opening),U.leave&&(tt|=te.Closing),T.createElement(bt.Provider,{value:re},T.createElement(_a,{value:tt},Z({ourProps:el,theirProps:m,defaultTag:io,features:ao,visible:V==="visible",name:"Transition.Child"})))}function za(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=w(null),s=ro(e),l=oe(...s?[a,t]:t===null?[]:[t]);Xe();let u=gt();if(n===void 0&&u!==null&&(n=(u&te.Open)===te.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=S(n?"visible":"hidden"),p=oo(()=>{n||c("hidden")}),[f,_]=S(!0),y=w([n]);q(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),_(!1))},[y,n]);let m=P(()=>({show:n,appear:r,initial:f}),[n,r,f]);jr(n,a,()=>c("hidden")),q(()=>{n?c("visible"):!$t(p)&&a.current!==null&&c("hidden")},[n,p]);let v={unmount:o},g=I(()=>{var C;f&&_(!1),(C=e.beforeEnter)==null||C.call(e)}),b=I(()=>{var C;f&&_(!1),(C=e.beforeLeave)==null||C.call(e)});return T.createElement(bt.Provider,{value:p},T.createElement(wt.Provider,{value:m},Z({ourProps:{...v,as:H,children:T.createElement(so,{ref:l,...v,...i,beforeEnter:g,beforeLeave:b})},theirProps:{},defaultTag:H,features:ao,visible:d==="visible",name:"Transition"})))}function qa(e,t){let n=B(wt)!==null,r=gt()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(_n,{ref:t,...e}):T.createElement(so,{ref:t,...e}))}let _n=K(za),so=K(Ba),mn=K(qa),ie=Object.assign(_n,{Child:mn,Root:_n});var Ka=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ka||{}),Ya=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ya||{});let Ga={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},yn=Y(null);yn.displayName="DialogContext";function Et(e){let t=B(yn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Et),n}return t}function Za(e,t){return ye(t.type,Ga,e,t)}let lo=K(function(e,t){let n=_e(),{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=gt();o===void 0&&p!==null&&(o=(p&te.Open)===te.Open);let f=w(null),_=oe(f,t),y=Ze(f),m=o?0:1,[v,g]=We(Za,{titleId:null,descriptionId:null,panelRef:Lt()}),b=I(()=>i(!1)),C=I(j=>g({type:0,id:j})),E=Xe()?m===0:!1,[N,R]=xa(),V={get current(){var j;return(j=v.panelRef.current)!=null?j:f.current}},{resolveContainers:W,mainTreeNodeRef:$,MainTreeNode:F}=Pa({portals:N,defaultContainers:[V]}),x=p!==null?(p&te.Closing)===te.Closing:!1;ji(u||x?!1:E,{allowed:I(()=>{var j,U;return[(U=(j=f.current)==null?void 0:j.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:I(()=>{var j,U;return[(U=(j=$.current)==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),ta(E,W,j=>{j.preventDefault(),b()}),Fa(E,y==null?void 0:y.defaultView,j=>{j.preventDefault(),j.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),sa(u||x?!1:E,y,W),jr(E,f,b);let[M,z]=Ai(),Q=P(()=>[{dialogState:m,close:b,setTitleId:C},v],[m,v,b,C]),ne=P(()=>({open:m===0}),[m]),re={ref:_,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":v.titleId,"aria-describedby":M},be=!Ma(),ve=Ne.None;return E&&!u&&(ve|=Ne.RestoreFocus,ve|=Ne.TabLock,l&&(ve|=Ne.AutoFocus),be&&(ve|=Ne.InitialFocus)),T.createElement(ma,null,T.createElement(Xr,{force:!0},T.createElement(Sa,null,T.createElement(yn.Provider,{value:Q},T.createElement(eo,{target:f},T.createElement(Xr,{force:!1},T.createElement(z,{slot:ne},T.createElement(R,null,T.createElement(Ha,{initialFocus:a,initialFocusFallback:f,containers:W,features:ve},T.createElement(Vi,{value:b},Z({ourProps:re,theirProps:d,slot:ne,defaultTag:Xa,features:Qa,visible:m===0,name:"Dialog"})))))))))),T.createElement(Ni,null,T.createElement(F,null)))}),Xa="div",Qa=vt.RenderStrategy|vt.Static;function Ja(e,t){let{transition:n=!1,open:r,...o}=e,i=gt(),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?T.createElement(ie,{show:r,transition:n,unmount:o.unmount},T.createElement(lo,{ref:t,...o})):T.createElement(lo,{ref:t,open:r,...o})}let es="div";function ts(e,t){let n=_e(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=Et("Dialog.Panel"),l=oe(t,s.panelRef),u=P(()=>({open:a===0}),[a]),d=I(c=>{c.stopPropagation()});return T.createElement(o?mn:H,null,Z({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:es,name:"Dialog.Panel"}))}let ns="div";function rs(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Et("Dialog.Backdrop"),i=P(()=>({open:o===0}),[o]);return T.createElement(n?mn:H,null,Z({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:ns,name:"Dialog.Backdrop"}))}let os="h2";function is(e,t){let n=_e(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=Et("Dialog.Title"),s=oe(t);L(()=>(a(r),()=>a(null)),[r,a]);let l=P(()=>({open:i===0}),[i]);return Z({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:os,name:"Dialog.Title"})}let as=K(Ja),co=K(ts);K(rs);let ss=K(is),ls=Object.assign(as,{Panel:co,Title:ss,Description:Oi});const Tt={root:"_root_1duny_1",modal:"_modal_1duny_10",container:"_container_1duny_13",page:"_page_1duny_18",close:"_close_1duny_21"},cs={root:"_root_1h6qm_1"},ae=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=P(()=>{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 h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},us=()=>h(ae,{children:h("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"})}),uo=e=>h(ae,{...e,children:h("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"})}),ds=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),fs=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ps=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),hs=e=>h(ae,{...e,children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),vs=e=>h(ae,{...e,children:h("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"})}),_s=e=>h(ae,{...e,viewBox:"0 0 24 24",children:h("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),ms=e=>h(ae,{...e,children:h("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"})}),ys=e=>h(ae,{...e,viewBox:"0 0 99 32",children:[h("g",{clipPath:"url(#clip0_9581_165880)",children:[h("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"}),h("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"}),h("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),h("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),h("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"}),h("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"}),h("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),h("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"}),h("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"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"clip0_9581_165880",children:h("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Le{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Le.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm");return await t.createFromOptions(r,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!1,runningMode:"IMAGE",numFaces:1})}catch(t){return Promise.reject(t)}}static denormalizeKeypoints(t,n,r){return t.map(o=>({x:o.x*n,y:o.y*r,z:o.z}))}static getBoundingBox(t){let n=1/0,r=-1/0,o=1/0,i=-1/0;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),o=Math.min(o,a.y),i=Math.max(i,a.y)}),{xMin:n,xMax:r,yMin:o,yMax:i,width:r-n,height:i-o}}static async detectFaces(t,n){try{const{width:r,height:o}=n,{faceLandmarks:i}=await t.detect(n);if(i.length===0)return[];const a=Le.denormalizeKeypoints(i[0],r,o),s=Le.getBoundingBox(a);return[{keypoints:a,box:s}]}catch(r){return Promise.reject(r)}}}const gs=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},fo=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=gs(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ws=e=>new Promise(t=>{const n=document.createElement("canvas");let{width:r}=e,{height:o}=e;e instanceof HTMLVideoElement&&(r=e.videoWidth,o=e.videoHeight),n.width=r,n.height=o,n.getContext("2d").drawImage(e,0,0),n.toBlob(a=>t(a))});function bs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4",videoBitsPerSecond:25e4}}function po(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),a=D(c=>{r.current.push(c)},[]),s=D(async c=>{if(o.current)return;const p=await ws(c);o.current=p},[]),l=D(c=>{c.data.size>0&&t(c.data)},[]),u=D(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=D(c=>{i.current||(i.current=new MediaRecorder(c,bs()),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 he(e,t){return Math.sqrt(e**2+t**2)}function $s(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 ho(e,t){return new Promise((n,r)=>{const o=Array.isArray(e)?e:[e],i=new File(o,`${Date.now()}`,{type:t}),a=new FileReader;a.readAsDataURL(i),a.onload=()=>n(a.result),a.onerror=s=>r(s)})}const Es=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function Ts(e){return{postData:async n=>{const{faceImage:r,publicKey:o,passed:i,metadata:a}=n,s=Es(e),l=await fetch(`${s}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:o,components:["liveness"],faceImage:r,passed:i,metadata:a})});if(!l.ok)throw l;return(await l.json()).data}}}const Cs=360,xs="#125766",ks="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",vo={"complete-the-circle":{Icon:ds,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:fs,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:ps,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:uo,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"}},_o=Y({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let mo,yo=!1;function Ss(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u,presentation:d,sandboxEnvironment:c=!0}=e,[p,f]=S(0),[_,y]=S(0),[m,v]=S(null),{saveStream:g,savePhoto:b,savedPhoto:C,savedStreams:E}=po(),{postData:N}=Ts(c),R=P(()=>_===n.length,[n,_]),V=()=>{y(x=>x+1),f(x=>x+1)},W=x=>{const M=new Image;M.crossOrigin="Anonymous",M.src=ks,M.onload=()=>{const z=fo(M,M.width,M.height);Le.detectFaces(x,z)}},$=async()=>{const x=[ho(E.current,"video/mp4")];C.current&&x.push(ho(C.current,"image/png"));const[M,z]=await Promise.all(x),Q=await N({faceImage:z,video:M,publicKey:t,passed:!0,metadata:u});l(Q),s()},F=async()=>{const x=await Le.loadDetector();mo=x,W(x),v(x)};return L(()=>{if(yo){v(mo);return}F(),yo=!0},[]),h(_o.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:p,completed:R,completedCount:_,nextTask:V,branding:a,onRequestClose:s,faceDetector:m,saveStream:g,savePhoto:b,onComplete:$,presentation:d},children:r})}function Ae(){return B(_o)}const G={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"},gn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function Fs(){const{branding:e}=Ae();return h("div",{className:gn.root,children:h("div",{className:gn.container,children:h("div",{className:gn.brand,children:(e==null?void 0:e.logo)&&h("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const go="colorScheme";function Ms(){const{namespace:e}=Ae(),t=()=>{const o=localStorage.getItem(go);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(go,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 Ps={root:"_root_bcsvc_1"};function Ns(){if(!(window.screen.width>=900))return 10/9}function wn(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),a=w(null),{start:s,stop:l}=po({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:Ns()}}});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()}},[]),h("div",{className:Ps.root,children:[h("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Je={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},wo=360,Ls=50;function As(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=Ls}=e,i=P(()=>{const a=[Je.container];return r&&a.push(Je.focused),a.join(" ")},[r]);return h("div",{className:i,children:[h(ie,{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:h("div",{className:Je.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*wo/o,l=Math.ceil((s+1)*n/wo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Je.completed);const p=u?"translateX(158px)":"translateX(150px)";return h("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),h(ie,{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:h("div",{className:Je.marker,children:[h("div",{}),h("div",{}),h("div",{}),h("div",{})]})})]})}function Ds(){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")}}}const Hs=1,Is=9,bn={centerMin:20,centerMax:100,verticalMin:230};function Os(){return{isReady:t=>{const{keypoints:n,box:r}=t,o=n[Hs],i=n[Is],a=n[6],s={x:r.width*.5,y:r.height*.5},l={y:o.y-r.yMin,x:o.x-r.xMin},u={y:a.y-r.yMin,x:a.x-r.xMin},d={y:i.y-r.yMin,x:i.x-r.xMin},c=he(u.x-d.x,u.y-d.y);let p=he(s.x-l.x,s.y-l.y),f=he(d.x-l.x,d.y-l.y);return p=p/c*100,f=f/c*100,p<bn.centerMax&&p>bn.centerMin&&f>bn.verticalMin}}}function $n(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i,savePhoto:a}=Ae(),s=w(!1),{isReady:l}=Os(),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:c}=Ds(),p=w(null),f=(y,m)=>{var v;try{if(y.length===0)throw new Error("Detecting face...");if(y.length>1)throw new Error("A maximum of 1 face is allowed");const g=p.current,b=(v=p.current)==null?void 0:v.parentElement;if(!g||!b)return;const C=y[0];for(const E of t)switch(E){case"zoom":d(C,Math.min(b.clientHeight,b.clientWidth));break;case"features":u(C,Math.min(b.clientHeight,b.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const N=n+200;c(C,{x:(b.clientWidth-N)/2,y:(b.clientHeight-N)/2,width:N,height:N,offsetX:(g.videoWidth-b.clientWidth)/2,offsetY:(g.videoHeight-b.clientHeight)/2});break;default:break}s.current||l(C)&&(a(m),s.current=!0),r(C)}catch(g){const{message:b}=g;o(b)}};return{detectFaces:async y=>{if(!i)return;const{ref:m}=y;p.current=m.current;const v=p.current;if(!v)throw new Error("No Video Source detected");const{videoWidth:g,videoHeight:b}=v;if(g===0||b===0)return;const C=fo(v,g,b),E=await Le.detectFaces(i,C);f(E,v)}}}const se={root:"_root_5hgaj_1",container:"_container_5hgaj_4",progress:"_progress_5hgaj_7",intro:"_intro_5hgaj_12",content:"_content_5hgaj_15",branding:"_branding_5hgaj_18",instructionsContainer:"_instructionsContainer_5hgaj_22",instructions:"_instructions_5hgaj_22"},bo={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},$o={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function Eo(e){const{size:t="md",className:n=""}=e;return h("span",{className:`${$o.container} ${$o[t]} ${n}`})}function et(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s,hideButton:l=!1}=e;return h("div",{className:bo.root,children:[h(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),h("h2",{children:r}),h("p",{className:"subtext",children:n}),!l&&h("div",{className:"yvlw-mt-12",children:h(Si,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[h("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&h(Eo,{className:bo.spinner})]})}),s]})}const Ct="yvlw-absolute yvlw-w-full yvlw-h-full",xt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",kt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function En(e){const{children:t,instruction:n,name:r,completed:o,failed:i,onStart:a=()=>{},onReset:s=()=>{}}=e,[l,u]=S(!1),{completedCount:d,tasks:c,nextTask:p}=Ae(),f=P(()=>vo[r],[r]),_=P(()=>d*100/c.length,[d,c.length]);return h("div",{className:se.root,children:h("div",{className:`${se.container} view`,children:[h("div",{style:{width:`${_}%`},className:se.progress}),h(ie,{show:!l&&!o&&!i,as:"div",enter:xt,enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:f.Icon,title:`${f.name.slice(0,-2)}`,description:`${f.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await a(),u(!0)},actionText:"Okay, got it!"})})}),h(ie,{as:"div",show:l&&!o&&!i,enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:[h("div",{className:`${se.content}`,children:t}),h("div",{className:se.instructionsContainer,children:[h("div",{className:se.instructions,children:[h("h2",{children:n.title}),h("p",{className:"subtext",children:n.description})]}),h("div",{className:se.branding,children:[h("span",{children:"Powered by"})," ",h(ys,{size:"custom",className:"yvlw-h-3"})]})]})]}),h(ie,{show:o,as:"div",enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:f.Icon,title:"One task down!",description:`You have completed the ${f.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>p(),actionText:"Next"})})}),h(ie,{show:i,as:"div",enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:_s,title:"Oops, task failed!",description:"Could not confirm liveness on this task. Click on the button below to go again",onActionClick:s,actionText:"Try Again"})})})]})})}function Tn(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=S(!1),i=w(null),a=D(()=>{t&&i.current&&clearTimeout(i.current)},[]),s=D(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),l=D(()=>{o(!1),s()},[]);return L(()=>a,[]),{timedOut:r,reset:l,start:s,stop:a}}const Rs=1,Cn=8,To="Place face in frame";function Vs(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=Ae(),[o,i]=S([]),[a,s]=S(To),[l,u]=S(!1),[d,c]=S(!1),p=w(new Set),f=w(!1),_=w(null),{reset:y,start:m,stop:v,timedOut:g}=Tn({timeout:n}),b=()=>{i([]),s(To),u(!1),c(!1),p.current=new Set,f.current=!1,_.current=null,y()},C=$=>{const F=$*Cn,x=Math.ceil((F+1)/Cs);p.current.has(x)||(p.current.add(x),i(Array.from(p.current))),p.current.size>=Cn&&(v(),setTimeout(()=>{c(!0)},1e3))},E=($,F)=>{let M=Math.atan2(F,$)*(180/Math.PI);return M<0&&(M+=360),M},N=D(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),R=$=>{const{keypoints:F,box:x}=$,M={x:x.width*.5,y:x.height*.5},z=F[Rs],Q={y:z.y-x.yMin,x:z.x-x.xMin},ne=M.x-Q.x,re=Q.y-M.y,be=N();return Math.abs(ne)<be&&Math.abs(re)<be?null:E(ne,re)},{detectFaces:V}=$n({frameSize:280,validations:["zoom","in-frame"],onFace:$=>{u(!0),s("Slowly move head around to complete circle");const F=R($);F&&C(F)},onError:$=>{s($),i([]),p.current.clear(),_.current=null,f.current=!1}});return h(H,{children:h(En,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:g,onReset:b,onStart:m,children:h(wn,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:F}=$.current;V({ref:$,frameSize:F})}catch{}},onRecord:r,children:h(As,{faceDetected:l,sectionsCount:Cn,visitedSections:o})})})})}const xn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Us(e){const{show:t,stickers:n}=e;return h(H,{children:t&&h("div",{className:xn.root,children:n.map(r=>h("div",{className:`${xn.sticker} ${xn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const Ws={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},js="Wrong answer. Try again",Co="Keep face in camera";function Bs(e){const{difficulty:t,questions:n=[Ws],timeout:r}=e,[o,i]=S(Co),[a,s]=S(!1),[l,u]=S(!1),{saveStream:d}=Ae(),c=w("inactive"),p=w(0),f=w(!1),_=w(null),y=w(null),m=()=>{_.current&&clearTimeout(_.current),y.current&&clearTimeout(y.current)},{reset:v,start:g,stop:b,timedOut:C}=Tn({timeout:r,onTimeout:m}),E=()=>{i(Co),s(!1),u(!1),c.current="inactive",p.current=0,f.current=!1,v()},N=x=>{const{keypoints:M}=x,z=M[1],Q=M[9],ne=z.x-Q.x,re=z.y-Q.y;return 90-Math.atan2(re,ne)*(180/Math.PI)},R=x=>{c.current="inactive",i(n[x].question),_.current=setTimeout(()=>{c.current="active"},2e3)},V=P(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),W=x=>{try{if(c.current="inactive",Math.abs(x)<V)throw new Error("Tilt head further to answer");const M=x>0,z=n[p.current].answer;if(M===z)p.current+=1,p.current===n.length?(u(!0),b()):R(p.current);else throw new Error(n[p.current].errorMessage||js)}catch(M){i(M.message),y.current=setTimeout(()=>{R(p.current)},2e3)}},{detectFaces:$}=$n({onFace:x=>{if(f.current||(s(!0),f.current=!0,R(p.current)),c.current==="inactive")return;const M=N(x);W(M)},onError:x=>{i(x)}}),F=x=>{try{if(!x.current||l)return;const{videoWidth:M}=x.current;$({ref:x,frameSize:M})}catch{}};return L(()=>m,[]),h(En,{instruction:{title:o,description:a?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:C,onReset:E,onStart:g,completed:l,children:h(wn,{onStream:F,onRecord:d,children:h(Us,{show:a,stickers:["yes","no"]})})})}function zs(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 qs(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=P(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const m=t-u.current;let v=`Nod head ${m} `;m<t&&(v+="more "),v+=m>1?"times":"time",n(v);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=zs({onChange:m=>{l.current=m}});return{evaluate:m=>{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:v}=m,g=he(v[6].x-v[8].x,v[6].y-v[8].y),C=he(v[2].x-v[1].x,v[2].y-v[1].y)/g*10;if(C>c){if(i.current||!a.current)return;i.current=C,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-C>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()},reset:()=>{i.current=null,a.current=!0,s.current=null,l.current=null,u.current=0,d.current=!1}}}function Ks(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=P(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:l=>{if(o.current)return;const{keypoints:u}=l,d=he(u[6].x-u[8].x,u[6].y-u[8].y);if(he(u[14].x-u[13].x,u[14].y-u[13].y)/d*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")},reset:()=>{o.current=!1}}}function Ys(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),a=w(!1),s=w(null),l=w(0),u=P(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=y=>{i.current&&(y>=u.closed||(i.current=!1,s.current=Date.now()))},c=y=>{if(!i.current&&!(y<u.open)&&(i.current=!0,s.current)){const m=Date.now(),v=s.current;(m-v)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const y=t-l.current;let m=`Blink right eye ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:y=>{if(a.current)return;const{keypoints:m}=y,v=he(m[6].x-m[8].x,m[6].y-m[8].y),b=he(m[145].x-m[159].x,m[145].y-m[159].y)/v*100;d(b),c(b),p()},reset:()=>{i.current=!0,a.current=!1,s.current=null,l.current=0}}}function Gs(){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 xo=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(xo||{});const ko=$s(Object.keys(xo)),So="Keep face in camera";function Zs(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5,timeout:o}=e,i=w(0),[a,s]=S(So),[l,u]=S(!1),[d,c]=S(null),p=w(!1),{requestDeviceOrientationPermission:f}=Gs(),{reset:_,start:y,stop:m,timedOut:v}=Tn({timeout:o}),g=()=>{if(i.current===ko.length-1){u(!0),m();return}i.current+=1},b=qs({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:$=>s($),onComplete:g}),C=Ks({difficulty:t,onMessage:$=>s($),onComplete:g}),E=Ys({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:$=>s($),onComplete:g}),{detectFaces:N}=$n({onFace:$=>{switch(p.current||(p.current=!0),ko[i.current]){case"nod":b.evaluate($);break;case"open_mouth":C.evaluate($);break;case"blink":E.evaluate($);break}},onError:$=>{s($)}}),R=()=>{i.current=0,s(So),u(!1),p.current=!1,E.reset(),b.reset(),C.reset(),_()},V=async $=>{try{if(!$.current||l)return;const{videoWidth:F}=$.current;await N({ref:$,frameSize:F,throttleInterval:500})}catch{}},W=async()=>{try{await f()}catch($){const F=$;s(F.message),c(F)}};return h(En,{instruction:{title:a,description:"Follow the directives as instructed"},name:"motions",failed:v,onReset:R,completed:l,onStart:async()=>{await W(),y()},children:d?h(H,{}):h(wn,{onStream:V})})}function Xs(){var C;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Ms(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s,faceDetector:l,presentation:u}=Ae(),[d,c]=S(!1),[p,f]=S(!1),[_,y]=S(null),[m,v]=S(!1);L(()=>{const E=t();n(E)},[]);const g=async()=>{try{c(!0),y(null),await s(),u==="page"&&v(!0)}catch(E){y(E.message)}finally{c(!1)}},b=D(E=>E===i?G.active:i>E?G.completed:"subtext",[i]);return h("div",{className:G.root,children:h("div",{className:G.container,children:[h("div",{className:`${G.lhs} divider`,children:[h("div",{className:G.info,children:[h(Fs,{}),h("div",{children:h("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."})}),h("ol",{children:[o.map((E,N)=>h("li",{className:b(N),children:vo[E.id].name},`task-${N}`)),h("li",{className:a?G.active:"",children:"Complete! 🎉"})]})]}),h("footer",{className:"divider",children:[h("div",{children:"Powered by Youverify"}),h("div",{onClick:()=>e(),role:"button",children:[h("div",{className:"dark:yvlw-hidden",children:h(uo,{})}),h("div",{className:"yvlw-hidden dark:yvlw-block",children:h(us,{})})]})]})]}),h("div",{className:G.main,children:h("div",{className:G.content,children:[h(ie,{show:!p,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:h("div",{className:G.completed,children:l?h(et,{Icon:hs,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:()=>f(!0)}):h(Eo,{size:"lg"})})}),o.map((E,N)=>{let R;switch(E.id){case"complete-the-circle":R=h(Vs,{...E});break;case"yes-or-no":R=h(Bs,{...E});break;case"motions":R=h(Zs,{...E});break;default:R=h(H,{});break}return h(ie,{show:p&&!a&&i===N,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:R},`task-${N}`)}),h(ie,{show:p&&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:h("div",{className:G.completed,children:h(et,{Icon:vs,title:m?"All Set!":"Completed",description:m?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:d,onActionClick:g,hideButton:m,children:_&&h("div",{className:"yvlw-mt-3",children:_})})})})]})}),h("div",{className:`${G.rhs} divider`,children:r&&h("div",{className:`${G.profile} divider`,children:[h("div",{children:h("div",{className:G.avatar,children:[r.firstName.charAt(0).toUpperCase(),(C=r.lastName)==null?void 0:C.charAt(0).toUpperCase()]})}),h("div",{children:[h("h4",{children:[r.firstName," ",r.lastName]}),r.email&&h("p",{className:"subtext",children:r.email})]})]})})]})})}function Qs(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d,sandboxEnvironment:c}=e,[p,f]=S(e.show),_=()=>{f(!1),i()};return h(Ss,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:_,onSuccess:a,onFailure:s,metadata:d,presentation:l,sandboxEnvironment:c,children:h(ls,{id:n,open:l==="page"?!0:p,onClose:_,transition:!0,className:`${cs.root} ${Tt.root} ${Tt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??xs},children:[l==="modal"&&h("div",{onClick:_,role:"button",className:Tt.close,children:h(ms,{className:"yvlw-text-white"})}),h(co,{className:`${Tt.container}`,children:h(Xs,{})})]})})}class Js{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk";const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),n==="page"&&this.start()}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),De(h(Qs,{namespace:this.namespace,publicKey:this.props.publicKey,sandboxEnvironment:this.props.sandboxEnvironment,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()}}}return Js});
|
|
5
|
+
`))}else{let p=d.props,f=p==null?void 0:p.className,_=typeof f=="function"?(...v)=>an(f(...v),l.className):an(f,l.className),y=_?{className:_}:{},m=Dr(d.props,Me(sn(l,["ref"])));for(let v in c)v in m&&delete c[v];return qt(d,Object.assign({},m,c,u,{ref:o(d.ref,u.ref)},y))}return J(i,Object.assign({},sn(l,["ref"]),i!==H&&u,i!==H&&c),d)}function Ti(...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 Dr(...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 Ci(...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 K(e){var t;return Object.assign(Bt(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Me(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let xi="button";function ki(e,t){var n;let r=Ar(),{disabled:o=r||!1,autoFocus:i=!1,...a}=e,{isFocusVisible:s,focusProps:l}=_i({autoFocus:i}),{isHovered:u,hoverProps:d}=vi({isDisabled:o}),{pressed:c,pressProps:p}=$i({disabled:o}),f=Ci({ref:t,type:(n=a.type)!=null?n:"button",disabled:o||void 0,autoFocus:i},l,d,p),_=P(()=>({disabled:o,hover:u,focus:s,active:c,autofocus:i}),[o,u,s,c,i]);return Z({ourProps:f,theirProps:a,slot:_,defaultTag:xi,name:"Button"})}let Si=K(ki),Fi="div";var mt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(mt||{});function Mi(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 Z({ourProps:i,theirProps:o,slot:{},defaultTag:Fi,name:"Hidden"})}let ln=K(Mi),Pi=Y(null);function Ni({children:e}){let t=B(Pi);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?lt(T.createElement(T.Fragment,null,e),n):null}let Hr=Symbol();function Li(e,t=!0){return Object.assign(e,{[Hr]:t})}function oe(...e){let t=w(e);L(()=>{t.current=e},[e]);let n=I(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[Hr]))?void 0:n}let cn=Y(null);cn.displayName="DescriptionContext";function Ir(){let e=B(cn);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,Ir),t}return e}function Ai(){let[e,t]=S([]);return[e.length>0?e.join(" "):void 0,P(()=>function(n){let r=I(i=>(t(a=>[...a,i]),()=>t(a=>{let s=a.slice(),l=s.indexOf(i);return l!==-1&&s.splice(l,1),s}))),o=P(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return T.createElement(cn.Provider,{value:o},n.children)},[t])]}let Di="p";function Hi(e,t){let n=_e(),r=Ar(),{id:o=`headlessui-description-${n}`,...i}=e,a=Ir(),s=oe(t);q(()=>a.register(o),[o,a.register]);let l=r||!1,u=P(()=>({...a.slot,disabled:l}),[a.slot,l]),d={ref:s,...a.props,id:o};return Z({ourProps:d,theirProps:i,slot:u,defaultTag:Di,name:a.name||"Description"})}let Ii=K(Hi),Oi=Object.assign(Ii,{});var Or=(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))(Or||{});let Ri=Y(()=>{});function Vi({value:e,children:t}){return T.createElement(Ri.Provider,{value:e},t)}let Ui=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 Rr(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 Vr(e){return ct(e.subscribe,e.getSnapshot,e.getSnapshot)}let Wi=new Ui(()=>Rr(()=>[],{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 Re(e,t){let n=Wi.get(t),r=_e(),o=Vr(n);if(q(()=>{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 un=new Map,Ke=new Map;function Ur(e){var t;let n=(t=Ke.get(e))!=null?t:0;return Ke.set(e,n+1),n!==0?()=>Wr(e):(un.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Wr(e))}function Wr(e){var t;let n=(t=Ke.get(e))!=null?t:1;if(n===1?Ke.delete(e):Ke.set(e,n-1),n!==1)return;let r=un.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,un.delete(e))}function ji(e,{allowed:t,disallowed:n}={}){let r=Re(e,"inert-others");q(()=>{var o,i;if(!r)return;let a=me();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&a.add(Ur(l));let s=(i=t==null?void 0:t())!=null?i:[];for(let l of s){if(!l)continue;let u=ft(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(Ur(c));d=d.parentElement}}return a.dispose},[r,t,n])}function jr(e,t,n){let r=Fe(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=me();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 dn=["[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(","),Bi=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var fe=(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))(fe||{}),fn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fn||{}),zi=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zi||{});function qi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(dn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Ki(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Bi)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Br=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Br||{});function Yi(e,t=0){var n;return e===((n=ft(e))==null?void 0:n.body)?!1:ye(t,{0(){return e.matches(dn)},1(){let r=e;for(;r!==null;){if(r.matches(dn))return!0;r=r.parentElement}return!1}})}var Gi=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Gi||{});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 pe(e){e==null||e.focus({preventScroll:!0})}let Zi=["textarea","input"].join(",");function Xi(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Zi))!=null?n:!1}function Qi(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 Ye(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?Qi(e):e:t&64?Ki(e):qi(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&&Xi(p)&&p.select(),2}function zr(){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 ea(){return zr()||Ji()}function Ge(e,t,n,r){let o=Fe(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 qr(e,t,n,r){let o=Fe(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 Kr=30;function ta(e,t,n){let r=Re(e,"outside-click"),o=Fe(n),i=D(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!Yi(d,Br.Loose)&&d.tabIndex!==-1&&l.preventDefault(),o.current(l,d)},[o]),a=w(null);Ge(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),Ge(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),Ge(r,"click",l=>{ea()||a.current&&(i(l,()=>a.current),a.current=null)},!0);let s=w({x:0,y:0});Ge(r,"touchstart",l=>{s.current.x=l.touches[0].clientX,s.current.y=l.touches[0].clientY},!0),Ge(r,"touchend",l=>{let u={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(u.x-s.current.x)>=Kr||Math.abs(u.y-s.current.y)>=Kr))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),qr(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ze(...e){return P(()=>ft(...e),[...e])}function Yr(e,t,n,r){let o=Fe(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 na(){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 ra(){return zr()?{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=me();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 oa(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ia(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Pe=Rr(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:me(),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:ia(n)},o=[ra(),na(),oa()];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)}});Pe.subscribe(()=>{let e=Pe.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)&&Pe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Pe.dispatch("TEARDOWN",n)}});function aa(e,t,n=()=>({containers:[]})){let r=Vr(Pe),o=t?r.get(t):void 0,i=o?o.count>0:!1;return q(()=>{if(!(!t||!e))return Pe.dispatch("PUSH",t,n),()=>Pe.dispatch("POP",t,n)},[e,t]),i}function sa(e,t,n=()=>[document.body]){let r=Re(e,"scroll-lock");aa(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function la(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function ca(e=0){let[t,n]=S(e),r=D(l=>n(l),[t]),o=D(l=>n(u=>u|l),[t]),i=D(l=>(t&l)===l,[t]),a=D(l=>n(u=>u&~l),[n]),s=D(l=>n(u=>u^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}var ua=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(ua||{});function da(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function fa(e,t,n,r){let[o,i]=S(n),{hasFlag:a,addFlag:s,removeFlag:l}=ca(e&&o?3:0),u=w(!1),d=w(!1),c=ht();return q(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),pa(_,{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 pa(e,{prepare:t,run:n,done:r,inFlight:o}){let i=me();return va(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{i.add(ha(e,r)),n()}),i.dispose}function ha(e,t){let n=la(t),r=me();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 va(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 pn(e,t){let n=w([]),r=I(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 yt=Y(null);yt.displayName="OpenClosedContext";var te=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(te||{});function gt(){return B(yt)}function _a({value:e,children:t}){return T.createElement(yt.Provider,{value:e},t)}function ma({children:e}){return T.createElement(yt.Provider,{value:null},e)}function ya(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let we=[];ya(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&we[0]!==t.target&&(we.unshift(t.target),we=we.filter(n=>n!=null&&n.isConnected),we.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 Gr(e){let t=I(e),n=w(!1);L(()=>(n.current=!1,()=>{n.current=!0,pt(()=>{n.current&&t()})}),[t])}function ga(){let e=typeof document>"u";return"useSyncExternalStore"in Cr?(t=>t.useSyncExternalStore)(Cr)(()=>()=>{},()=>!1,()=>!e):!1}function Xe(){let e=ga(),[t,n]=S(Se.isHandoffComplete);return t&&Se.isHandoffComplete===!1&&n(!1),L(()=>{t!==!0&&n(!0)},[t]),L(()=>Se.handoff(),[]),e?!1:t}let Zr=Y(!1);function wa(){return B(Zr)}function Xr(e){return T.createElement(Zr.Provider,{value:e.force},e.children)}function ba(e){let t=wa(),n=B(Jr),r=Ze(e),[o,i]=S(()=>{var a;if(!t&&n!==null)return(a=n.current)!=null?a:null;if(Se.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 Qr=H,$a=K(function(e,t){let n=e,r=w(null),o=oe(Li(d=>{r.current=d}),t),i=Ze(r),a=ba(r),[s]=S(()=>{var d;return Se.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=B(hn),u=Xe();return q(()=>{!a||!s||a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s))},[a,s]),q(()=>{if(s&&l)return l.register(s)},[l,s]),Gr(()=>{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:lt(Z({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Qr,name:"Portal"}),s):null});function Ea(e,t){let n=oe(t),{enabled:r=!0,...o}=e;return r?T.createElement($a,{...o,ref:n}):Z({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Qr,name:"Portal"})}let Ta=H,Jr=Y(null);function Ca(e,t){let{target:n,...r}=e,o={ref:oe(t)};return T.createElement(Jr.Provider,{value:n},Z({ourProps:o,theirProps:r,defaultTag:Ta,name:"Popover.Group"}))}let hn=Y(null);function xa(){let e=B(hn),t=w([]),n=I(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=I(i=>{let a=t.current.indexOf(i);a!==-1&&t.current.splice(a,1),e&&e.unregister(i)}),o=P(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,P(()=>function({children:i}){return T.createElement(hn.Provider,{value:o},i)},[o])]}let ka=K(Ea),eo=K(Ca),Sa=Object.assign(ka,{Group:eo});function Fa(e,t=typeof document<"u"?document.defaultView:null,n){let r=Re(e,"escape");Yr(t,"keydown",o=>{r&&(o.defaultPrevented||o.key===Or.Escape&&n(o))})}function Ma(){var e;let[t]=S(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=S((e=t==null?void 0:t.matches)!=null?e:!1);return q(()=>{if(!t)return;function o(i){r(i.matches)}return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[t]),n}function Pa({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=w((r=n==null?void 0:n.current)!=null?r:null),i=Ze(o),a=I(()=>{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:I(s=>a().some(l=>l.contains(s))),mainTreeNodeRef:o,MainTreeNode:P(()=>function(){return n!=null?null:T.createElement(ln,{features:mt.Hidden,ref:o})},[o,n])}}function vn(){let e=w(!1);return q(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Qe=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qe||{});function Na(){let e=w(0);return qr(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function to(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 La="div";var Ne=(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))(Ne||{});function Aa(e,t){let n=w(null),r=oe(n,t),{initialFocus:o,initialFocusFallback:i,containers:a,features:s=15,...l}=e;Xe()||(s=0);let u=Ze(n);Oa(s,{ownerDocument:u});let d=Ra(s,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:i});Va(s,{ownerDocument:u,container:n,containers:a,previousActiveElement:d});let c=Na(),p=I(v=>{let g=n.current;g&&(b=>b())(()=>{ye(c.current,{[Qe.Forwards]:()=>{Ye(g,fe.First,{skipElements:[v.relatedTarget,i]})},[Qe.Backwards]:()=>{Ye(g,fe.Last,{skipElements:[v.relatedTarget,i]})}})})}),f=Re(!!(s&2),"focus-trap#tab-lock"),_=ht(),y=w(!1),m={ref:r,onKeyDown(v){v.key=="Tab"&&(y.current=!0,_.requestAnimationFrame(()=>{y.current=!1}))},onBlur(v){if(!(s&4))return;let g=to(a);n.current instanceof HTMLElement&&g.add(n.current);let b=v.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(no(g,b)||(y.current?Ye(n.current,ye(c.current,{[Qe.Forwards]:()=>fe.Next,[Qe.Backwards]:()=>fe.Previous})|fe.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&pe(v.target)))}};return T.createElement(T.Fragment,null,f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}),Z({ourProps:m,theirProps:l,defaultTag:La,name:"FocusTrap"}),f&&T.createElement(ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:mt.Focusable}))}let Da=K(Aa),Ha=Object.assign(Da,{features:Ne});function Ia(e=!0){let t=w(we.slice());return pn(([n],[r])=>{r===!0&&n===!1&&pt(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=we.slice())},[e,we,t]),I(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function Oa(e,{ownerDocument:t}){let n=!!(e&8),r=Ia(n);pn(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&pe(r())},[n]),Gr(()=>{n&&pe(r())})}function Ra(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let i=w(null),a=Re(!!(e&1),"focus-trap#initial-focus"),s=vn();return pn(()=>{if(e===0)return;if(!a){o!=null&&o.current&&pe(o.current);return}let l=n.current;l&&pt(()=>{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)pe(r.current);else{if(e&16){if(Ye(l,fe.First|fe.AutoFocus)!==fn.Error)return}else if(Ye(l,fe.First)!==fn.Error)return;if(o!=null&&o.current&&(pe(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 Va(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let i=vn(),a=!!(e&4);Yr(t==null?void 0:t.defaultView,"focus",s=>{if(!a||!i.current)return;let l=to(r);n.current instanceof HTMLElement&&l.add(n.current);let u=o.current;if(!u)return;let d=s.target;d&&d instanceof HTMLElement?no(l,d)?(o.current=d,pe(d)):(s.preventDefault(),s.stopPropagation(),pe(u)):pe(o.current)},!0)}function no(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function ro(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:io)!==H||T.Children.count(e.children)===1}let wt=Y(null);wt.displayName="TransitionContext";var Ua=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ua||{});function Wa(){let e=B(wt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function ja(){let e=B(bt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let bt=Y(null);bt.displayName="NestingContext";function $t(e){return"children"in e?$t(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function oo(e,t){let n=Fe(e),r=w([]),o=vn(),i=ht(),a=I((f,_=ge.Hidden)=>{let y=r.current.findIndex(({el:m})=>m===f);y!==-1&&(ye(_,{[ge.Unmount](){r.current.splice(y,1)},[ge.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var m;!$t(r)&&o.current&&((m=n.current)==null||m.call(n))}))}),s=I(f=>{let _=r.current.find(({el:y})=>y===f);return _?_.state!=="visible"&&(_.state="visible"):r.current.push({el:f,state:"visible"}),()=>a(f,ge.Unmount)}),l=w([]),u=w(Promise.resolve()),d=w({enter:[],leave:[]}),c=I((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(([v,g])=>g)).then(()=>m())})]),_==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(_)):y(_)}),p=I((f,_,y)=>{Promise.all(d.current[_].splice(0).map(([m,v])=>v)).then(()=>{var m;(m=l.current.shift())==null||m()}).then(()=>y(_))});return P(()=>({children:r,register:s,unregister:a,onStart:c,onStop:p,wait:u,chains:d}),[s,a,r,c,p,d,u])}let io=H,ao=vt.RenderStrategy;function Ba(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,v=w(null),g=ro(e),b=oe(...g?[v,t]:t===null?[]:[t]),C=(n=m.unmount)==null||n?ge.Unmount:ge.Hidden,{show:E,appear:N,initial:R}=Wa(),[V,W]=S(E?"visible":"hidden"),$=ja(),{register:F,unregister:x}=$;q(()=>F(v),[F,v]),q(()=>{if(C===ge.Hidden&&v.current){if(E&&V!=="visible"){W("visible");return}return ye(V,{hidden:()=>x(v),visible:()=>F(v)})}},[V,v,F,x,E,C]);let M=Xe();q(()=>{if(g&&M&&V==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,V,M,g]);let z=R&&!N,Q=N&&E&&R,ne=w(!1),re=oo(()=>{ne.current||(W("hidden"),x(v))},$),be=I(kn=>{ne.current=!0;let St=kn?"enter":"leave";re.onStart(v,St,nt=>{nt==="enter"?i==null||i():nt==="leave"&&(s==null||s())})}),ve=I(kn=>{let St=kn?"enter":"leave";ne.current=!1,re.onStop(v,St,nt=>{nt==="enter"?a==null||a():nt==="leave"&&(l==null||l())}),St==="leave"&&!$t(re)&&(W("hidden"),x(v))});L(()=>{g&&o||(be(E),ve(E))},[E,g,o]);let j=!(!o||!g||!M||z),[,U]=fa(j,v,E,{start:be,end:ve}),el=Me({ref:b,className:((r=an(m.className,Q&&u,Q&&d,U.enter&&u,U.enter&&U.closed&&d,U.enter&&!U.closed&&c,U.leave&&f,U.leave&&!U.closed&&_,U.leave&&U.closed&&y,!U.transition&&E&&p))==null?void 0:r.trim())||void 0,...da(U)}),tt=0;return V==="visible"&&(tt|=te.Open),V==="hidden"&&(tt|=te.Closed),U.enter&&(tt|=te.Opening),U.leave&&(tt|=te.Closing),T.createElement(bt.Provider,{value:re},T.createElement(_a,{value:tt},Z({ourProps:el,theirProps:m,defaultTag:io,features:ao,visible:V==="visible",name:"Transition.Child"})))}function za(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=w(null),s=ro(e),l=oe(...s?[a,t]:t===null?[]:[t]);Xe();let u=gt();if(n===void 0&&u!==null&&(n=(u&te.Open)===te.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,c]=S(n?"visible":"hidden"),p=oo(()=>{n||c("hidden")}),[f,_]=S(!0),y=w([n]);q(()=>{f!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),_(!1))},[y,n]);let m=P(()=>({show:n,appear:r,initial:f}),[n,r,f]);jr(n,a,()=>c("hidden")),q(()=>{n?c("visible"):!$t(p)&&a.current!==null&&c("hidden")},[n,p]);let v={unmount:o},g=I(()=>{var C;f&&_(!1),(C=e.beforeEnter)==null||C.call(e)}),b=I(()=>{var C;f&&_(!1),(C=e.beforeLeave)==null||C.call(e)});return T.createElement(bt.Provider,{value:p},T.createElement(wt.Provider,{value:m},Z({ourProps:{...v,as:H,children:T.createElement(so,{ref:l,...v,...i,beforeEnter:g,beforeLeave:b})},theirProps:{},defaultTag:H,features:ao,visible:d==="visible",name:"Transition"})))}function qa(e,t){let n=B(wt)!==null,r=gt()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(_n,{ref:t,...e}):T.createElement(so,{ref:t,...e}))}let _n=K(za),so=K(Ba),mn=K(qa),ie=Object.assign(_n,{Child:mn,Root:_n});var Ka=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ka||{}),Ya=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ya||{});let Ga={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},yn=Y(null);yn.displayName="DialogContext";function Et(e){let t=B(yn);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Et),n}return t}function Za(e,t){return ye(t.type,Ga,e,t)}let lo=K(function(e,t){let n=_e(),{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=gt();o===void 0&&p!==null&&(o=(p&te.Open)===te.Open);let f=w(null),_=oe(f,t),y=Ze(f),m=o?0:1,[v,g]=We(Za,{titleId:null,descriptionId:null,panelRef:Lt()}),b=I(()=>i(!1)),C=I(j=>g({type:0,id:j})),E=Xe()?m===0:!1,[N,R]=xa(),V={get current(){var j;return(j=v.panelRef.current)!=null?j:f.current}},{resolveContainers:W,mainTreeNodeRef:$,MainTreeNode:F}=Pa({portals:N,defaultContainers:[V]}),x=p!==null?(p&te.Closing)===te.Closing:!1;ji(u||x?!1:E,{allowed:I(()=>{var j,U;return[(U=(j=f.current)==null?void 0:j.closest("[data-headlessui-portal]"))!=null?U:null]}),disallowed:I(()=>{var j,U;return[(U=(j=$.current)==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?U:null]})}),ta(E,W,j=>{j.preventDefault(),b()}),Fa(E,y==null?void 0:y.defaultView,j=>{j.preventDefault(),j.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),b()}),sa(u||x?!1:E,y,W),jr(E,f,b);let[M,z]=Ai(),Q=P(()=>[{dialogState:m,close:b,setTitleId:C},v],[m,v,b,C]),ne=P(()=>({open:m===0}),[m]),re={ref:_,id:r,role:s,tabIndex:-1,"aria-modal":u?void 0:m===0?!0:void 0,"aria-labelledby":v.titleId,"aria-describedby":M},be=!Ma(),ve=Ne.None;return E&&!u&&(ve|=Ne.RestoreFocus,ve|=Ne.TabLock,l&&(ve|=Ne.AutoFocus),be&&(ve|=Ne.InitialFocus)),T.createElement(ma,null,T.createElement(Xr,{force:!0},T.createElement(Sa,null,T.createElement(yn.Provider,{value:Q},T.createElement(eo,{target:f},T.createElement(Xr,{force:!1},T.createElement(z,{slot:ne},T.createElement(R,null,T.createElement(Ha,{initialFocus:a,initialFocusFallback:f,containers:W,features:ve},T.createElement(Vi,{value:b},Z({ourProps:re,theirProps:d,slot:ne,defaultTag:Xa,features:Qa,visible:m===0,name:"Dialog"})))))))))),T.createElement(Ni,null,T.createElement(F,null)))}),Xa="div",Qa=vt.RenderStrategy|vt.Static;function Ja(e,t){let{transition:n=!1,open:r,...o}=e,i=gt(),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?T.createElement(ie,{show:r,transition:n,unmount:o.unmount},T.createElement(lo,{ref:t,...o})):T.createElement(lo,{ref:t,open:r,...o})}let es="div";function ts(e,t){let n=_e(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...i}=e,[{dialogState:a},s]=Et("Dialog.Panel"),l=oe(t,s.panelRef),u=P(()=>({open:a===0}),[a]),d=I(c=>{c.stopPropagation()});return T.createElement(o?mn:H,null,Z({ourProps:{ref:l,id:r,onClick:d},theirProps:i,slot:u,defaultTag:es,name:"Dialog.Panel"}))}let ns="div";function rs(e,t){let{transition:n=!1,...r}=e,[{dialogState:o}]=Et("Dialog.Backdrop"),i=P(()=>({open:o===0}),[o]);return T.createElement(n?mn:H,null,Z({ourProps:{ref:t,"aria-hidden":!0},theirProps:r,slot:i,defaultTag:ns,name:"Dialog.Backdrop"}))}let os="h2";function is(e,t){let n=_e(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:a}]=Et("Dialog.Title"),s=oe(t);L(()=>(a(r),()=>a(null)),[r,a]);let l=P(()=>({open:i===0}),[i]);return Z({ourProps:{ref:s,id:r},theirProps:o,slot:l,defaultTag:os,name:"Dialog.Title"})}let as=K(Ja),co=K(ts);K(rs);let ss=K(is),ls=Object.assign(as,{Panel:co,Title:ss,Description:Oi});const Tt={root:"_root_1duny_1",modal:"_modal_1duny_10",container:"_container_1duny_13",page:"_page_1duny_18",close:"_close_1duny_21"},cs={root:"_root_1h6qm_1"},ae=e=>{const{children:t,size:n="md",fill:r="currentColor",stroke:o,strokeWidth:i,className:a="",viewBox:s="0 0 20 20"}=e,l=P(()=>{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 h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:s,fill:r,stroke:o,strokeWidth:i,className:`${l} ${a}`,children:t})},us=()=>h(ae,{children:h("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"})}),uo=e=>h(ae,{...e,children:h("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"})}),ds=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),fs=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),ps=e=>h(ae,{...e,viewBox:"0 0 24 24",children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),hs=e=>h(ae,{...e,children:[h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("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"})]}),vs=e=>h(ae,{...e,children:h("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"})}),_s=e=>h(ae,{...e,viewBox:"0 0 24 24",children:h("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),ms=e=>h(ae,{...e,children:h("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"})}),ys=e=>h(ae,{...e,viewBox:"0 0 99 32",children:[h("g",{clipPath:"url(#clip0_9581_165880)",children:[h("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"}),h("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"}),h("path",{d:"M68.9385 6.74805H67.1367V25.2549H68.9385V6.74805Z",fill:"white"}),h("path",{d:"M55.0725 8.52161V6.73047H47.8535V25.2683H55.0725V23.4748H49.6577V18.9874H52.9664V17.1963H49.6577V8.52161H55.0725Z",fill:"white"}),h("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"}),h("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"}),h("path",{d:"M78.6291 8.53181V6.73828H71.4102V25.2618H73.2143V18.9976H76.5231V17.2065H73.2143V8.53181H78.6291Z",fill:"white"}),h("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"}),h("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"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"clip0_9581_165880",children:h("rect",{width:"98.9474",height:"32",fill:"white"})})})]});class Le{static loadVision(){return import("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3")}static async loadDetector(){try{const{FaceLandmarker:t,FilesetResolver:n}=await Le.loadVision(),r=await n.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm");return await t.createFromOptions(r,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!1,runningMode:"IMAGE",numFaces:1})}catch(t){return Promise.reject(t)}}static denormalizeKeypoints(t,n,r){return t.map(o=>({x:o.x*n,y:o.y*r,z:o.z}))}static getBoundingBox(t){let n=1/0,r=-1/0,o=1/0,i=-1/0;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),o=Math.min(o,a.y),i=Math.max(i,a.y)}),{xMin:n,xMax:r,yMin:o,yMax:i,width:r-n,height:i-o}}static async detectFaces(t,n){try{const{width:r,height:o}=n,{faceLandmarks:i}=await t.detect(n);if(i.length===0)return[];const a=Le.denormalizeKeypoints(i[0],r,o),s=Le.getBoundingBox(a);return[{keypoints:a,box:s}]}catch(r){return Promise.reject(r)}}}const gs=(e,t)=>{let n;return typeof OffscreenCanvas<"u"?n=new OffscreenCanvas(e,t):(n=document.createElement("canvas"),n.width=e,n.height=t),n},fo=(e,t,n,r)=>{let o=0,i=0,a=t,s=n;const u=gs(t,n).getContext("2d");return u.drawImage(e,0,0),u.getImageData(o,i,a,s)},ws=e=>new Promise(t=>{const n=document.createElement("canvas");let{width:r}=e,{height:o}=e;e instanceof HTMLVideoElement&&(r=e.videoWidth,o=e.videoHeight),n.width=r,n.height=o,n.getContext("2d").drawImage(e,0,0),n.toBlob(a=>t(a))});function bs(){if(MediaRecorder.isTypeSupported("video/webm; codecs=vp9"))return{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/webm"))return{mimeType:"video/webm",videoBitsPerSecond:25e4};if(MediaRecorder.isTypeSupported("video/mp4"))return{mimeType:"video/mp4",videoBitsPerSecond:25e4}}function po(e={}){const{onRecord:t=()=>{},onStop:n=()=>{}}=e,r=w([]),o=w(null),i=w(null),a=D(c=>{r.current.push(c)},[]),s=D(async c=>{if(o.current)return;const p=await ws(c);o.current=p},[]),l=D(c=>{c.data.size>0&&t(c.data)},[]),u=D(()=>{!i.current||i.current.state==="inactive"||(i.current.stop(),i.current.stream.getTracks().forEach(c=>c.stop()),n())},[]),d=D(c=>{i.current||(i.current=new MediaRecorder(c,bs()),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 he(e,t){return Math.sqrt(e**2+t**2)}function $s(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 ho(e,t){return new Promise((n,r)=>{const o=Array.isArray(e)?e:[e],i=new File(o,`${Date.now()}`,{type:t}),a=new FileReader;a.readAsDataURL(i),a.onload=()=>n(a.result),a.onerror=s=>r(s)})}const Es=e=>e?"https://identity.staging.svc.youverify.co":"https://identity.svc.youverify.co";function Ts(e){return{postData:async n=>{const{faceImage:r,publicKey:o,passed:i,metadata:a,video:s}=n,l=Es(e),u=await fetch(`${l}/v1/sdk/identity/liveness/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicMerchantID:o,components:["liveness"],faceImage:r,livenessClip:s,passed:i,metadata:a})});if(!u.ok)throw u;return(await u.json()).data}}}const Cs=360,xs="#125766",ks="https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg",vo={"complete-the-circle":{Icon:ds,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:fs,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:ps,name:"Motions 💫",description:"First position your face in the camera frame, then follow the instructions"},"facial-expressions":{Icon:uo,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"}},_o=Y({tasks:[],namespace:"",user:void 0,currentTaskIndex:0,completedCount:0,nextTask:()=>{},completed:!1,onRequestClose:()=>{},faceDetector:null,saveStream:()=>{},savePhoto:()=>{},onComplete:()=>Promise.resolve()});let mo,yo=!1;function Ss(e){const{publicKey:t,tasks:n,children:r,namespace:o,user:i,branding:a,onRequestClose:s,onSuccess:l=()=>{},metadata:u,presentation:d,sandboxEnvironment:c=!0}=e,[p,f]=S(0),[_,y]=S(0),[m,v]=S(null),{saveStream:g,savePhoto:b,savedPhoto:C,savedStreams:E}=po(),{postData:N}=Ts(c),R=P(()=>_===n.length,[n,_]),V=()=>{y(x=>x+1),f(x=>x+1)},W=x=>{const M=new Image;M.crossOrigin="Anonymous",M.src=ks,M.onload=()=>{const z=fo(M,M.width,M.height);Le.detectFaces(x,z)}},$=async()=>{const x=[ho(E.current,"video/mp4")];C.current&&x.push(ho(C.current,"image/png"));const[M,z]=await Promise.all(x),Q=await N({faceImage:z,video:M,publicKey:t,passed:!0,metadata:u});l(Q),s()},F=async()=>{const x=await Le.loadDetector();mo=x,W(x),v(x)};return L(()=>{if(yo){v(mo);return}F(),yo=!0},[]),h(_o.Provider,{value:{tasks:n,namespace:o,user:i,currentTaskIndex:p,completed:R,completedCount:_,nextTask:V,branding:a,onRequestClose:s,faceDetector:m,saveStream:g,savePhoto:b,onComplete:$,presentation:d},children:r})}function Ae(){return B(_o)}const G={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"},gn={root:"_root_135td_1",container:"_container_135td_1",brand:"_brand_135td_1"};function Fs(){const{branding:e}=Ae();return h("div",{className:gn.root,children:h("div",{className:gn.container,children:h("div",{className:gn.brand,children:(e==null?void 0:e.logo)&&h("img",{className:"yvlw-h-10",src:e.logo,alt:"Logo"})})})})}const go="colorScheme";function Ms(){const{namespace:e}=Ae(),t=()=>{const o=localStorage.getItem(go);return!o&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":o},n=(o=null)=>{o&&localStorage.setItem(go,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 Ps={root:"_root_bcsvc_1"};function Ns(){if(!(window.screen.width>=900))return 10/9}function wn(e){const{children:t,onStream:n=()=>{},onRecord:r=()=>{}}=e,o=w(null),i=w(0),a=w(null),{start:s,stop:l}=po({onRecord:r}),u=async()=>{try{const p=await navigator.mediaDevices.getUserMedia({video:{aspectRatio:{exact:Ns()}}});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()}},[]),h("div",{className:Ps.root,children:[h("video",{ref:o,autoPlay:!0,loop:!0,playsInline:!0}),t]})}const Je={container:"_container_mcmsr_1",focused:"_focused_mcmsr_12",progress:"_progress_mcmsr_15",completed:"_completed_mcmsr_36",marker:"_marker_mcmsr_40"},wo=360,Ls=50;function As(e){const{visitedSections:t,sectionsCount:n,faceDetected:r,divisions:o=Ls}=e,i=P(()=>{const a=[Je.container];return r&&a.push(Je.focused),a.join(" ")},[r]);return h("div",{className:i,children:[h(ie,{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:h("div",{className:Je.progress,children:Array.from(Array(o).keys()).map(a=>{const s=a*wo/o,l=Math.ceil((s+1)*n/wo),u=t.includes(l),d=u?a-(l-1)*(o/n):0,c=[];u&&c.push(Je.completed);const p=u?"translateX(158px)":"translateX(150px)";return h("div",{className:c.join(" "),style:{transform:`rotate(${s}deg) ${p}`,transitionDelay:`${d*20}ms`}},`key-${a}`)})})}),h(ie,{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:h("div",{className:Je.marker,children:[h("div",{}),h("div",{}),h("div",{}),h("div",{})]})})]})}function Ds(){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")}}}const Hs=1,Is=9,bn={centerMin:20,centerMax:100,verticalMin:230};function Os(){return{isReady:t=>{const{keypoints:n,box:r}=t,o=n[Hs],i=n[Is],a=n[6],s={x:r.width*.5,y:r.height*.5},l={y:o.y-r.yMin,x:o.x-r.xMin},u={y:a.y-r.yMin,x:a.x-r.xMin},d={y:i.y-r.yMin,x:i.x-r.xMin},c=he(u.x-d.x,u.y-d.y);let p=he(s.x-l.x,s.y-l.y),f=he(d.x-l.x,d.y-l.y);return p=p/c*100,f=f/c*100,p<bn.centerMax&&p>bn.centerMin&&f>bn.verticalMin}}}function $n(e={}){const{validations:t=["zoom"],frameSize:n,onFace:r=()=>{},onError:o=()=>{}}=e,{faceDetector:i,savePhoto:a}=Ae(),s=w(!1),{isReady:l}=Os(),{checkFacialFeatures:u,checkZoomLevel:d,checkInFrame:c}=Ds(),p=w(null),f=(y,m)=>{var v;try{if(y.length===0)throw new Error("Detecting face...");if(y.length>1)throw new Error("A maximum of 1 face is allowed");const g=p.current,b=(v=p.current)==null?void 0:v.parentElement;if(!g||!b)return;const C=y[0];for(const E of t)switch(E){case"zoom":d(C,Math.min(b.clientHeight,b.clientWidth));break;case"features":u(C,Math.min(b.clientHeight,b.clientWidth));break;case"in-frame":if(!n)throw new Error("Frame size is required to check if face is in frame");const N=n+200;c(C,{x:(b.clientWidth-N)/2,y:(b.clientHeight-N)/2,width:N,height:N,offsetX:(g.videoWidth-b.clientWidth)/2,offsetY:(g.videoHeight-b.clientHeight)/2});break;default:break}s.current||l(C)&&(a(m),s.current=!0),r(C)}catch(g){const{message:b}=g;o(b)}};return{detectFaces:async y=>{if(!i)return;const{ref:m}=y;p.current=m.current;const v=p.current;if(!v)throw new Error("No Video Source detected");const{videoWidth:g,videoHeight:b}=v;if(g===0||b===0)return;const C=fo(v,g,b),E=await Le.detectFaces(i,C);f(E,v)}}}const se={root:"_root_5hgaj_1",container:"_container_5hgaj_4",progress:"_progress_5hgaj_7",intro:"_intro_5hgaj_12",content:"_content_5hgaj_15",branding:"_branding_5hgaj_18",instructionsContainer:"_instructionsContainer_5hgaj_22",instructions:"_instructions_5hgaj_22"},bo={root:"_root_h5elg_1",spinner:"_spinner_h5elg_22"},$o={container:"_container_1vep2_1",spin:"_spin_1vep2_1",md:"_md_1vep2_7",lg:"_lg_1vep2_10"};function Eo(e){const{size:t="md",className:n=""}=e;return h("span",{className:`${$o.container} ${$o[t]} ${n}`})}function et(e){const{Icon:t,description:n,title:r,actionText:o="Okay, got it",onActionClick:i=()=>{},loading:a=!1,children:s,hideButton:l=!1}=e;return h("div",{className:bo.root,children:[h(t,{size:"custom",className:"yvlw-h-20 yvlw-mx-auto yvlw-mb-12"}),h("h2",{children:r}),h("p",{className:"subtext",children:n}),!l&&h("div",{className:"yvlw-mt-12",children:h(Si,{onClick:()=>i(),className:"yvlw-flex yvlw-items-center yvlw-space-x-3",disabled:a,children:[h("span",{className:"yvlw-flex-1 yvlw-flex yvlw-items-center yvlw-space-x-1 yvlw-justify-center",children:o}),a&&h(Eo,{className:bo.spinner})]})}),s]})}const Ct="yvlw-absolute yvlw-w-full yvlw-h-full",xt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300",kt="yvlw-transform yvlw-transition yvlw-ease-in yvlw-duration-300";function En(e){const{children:t,instruction:n,name:r,completed:o,failed:i,onStart:a=()=>{},onReset:s=()=>{}}=e,[l,u]=S(!1),{completedCount:d,tasks:c,nextTask:p}=Ae(),f=P(()=>vo[r],[r]),_=P(()=>d*100/c.length,[d,c.length]);return h("div",{className:se.root,children:h("div",{className:`${se.container} view`,children:[h("div",{style:{width:`${_}%`},className:se.progress}),h(ie,{show:!l&&!o&&!i,as:"div",enter:xt,enterFrom:"yvlw--translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw--translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:f.Icon,title:`${f.name.slice(0,-2)}`,description:`${f.description}. Proper lightning helps with getting faster and more accurate results.`,onActionClick:async()=>{await a(),u(!0)},actionText:"Okay, got it!"})})}),h(ie,{as:"div",show:l&&!o&&!i,enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:[h("div",{className:`${se.content}`,children:t}),h("div",{className:se.instructionsContainer,children:[h("div",{className:se.instructions,children:[h("h2",{children:n.title}),h("p",{className:"subtext",children:n.description})]}),h("div",{className:se.branding,children:[h("span",{children:"Powered by"})," ",h(ys,{size:"custom",className:"yvlw-h-3"})]})]})]}),h(ie,{show:o,as:"div",enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:f.Icon,title:"One task down!",description:`You have completed the ${f.name.slice(0,-2)} task. Click on the button below button to proceed.`,onActionClick:()=>p(),actionText:"Next"})})}),h(ie,{show:i,as:"div",enter:xt,enterFrom:"yvlw-translate-x-full",enterTo:"yvlw-translate-x-0",leave:kt,leaveFrom:"yvlw-translate-x-0",leaveTo:"yvlw-translate-x-full",className:Ct,children:h("div",{className:`${se.intro}`,children:h(et,{Icon:_s,title:"Oops, task failed!",description:"Could not confirm liveness on this task. Click on the button below to go again",onActionClick:s,actionText:"Try Again"})})})]})})}function Tn(e={}){const{timeout:t,onTimeout:n=()=>{}}=e,[r,o]=S(!1),i=w(null),a=D(()=>{t&&i.current&&clearTimeout(i.current)},[]),s=D(()=>{t&&(i.current=setTimeout(()=>{o(!0),n()},t))},[]),l=D(()=>{o(!1),s()},[]);return L(()=>a,[]),{timedOut:r,reset:l,start:s,stop:a}}const Rs=1,Cn=8,To="Place face in frame";function Vs(e){const{difficulty:t,timeout:n}=e,{saveStream:r}=Ae(),[o,i]=S([]),[a,s]=S(To),[l,u]=S(!1),[d,c]=S(!1),p=w(new Set),f=w(!1),_=w(null),{reset:y,start:m,stop:v,timedOut:g}=Tn({timeout:n}),b=()=>{i([]),s(To),u(!1),c(!1),p.current=new Set,f.current=!1,_.current=null,y()},C=$=>{const F=$*Cn,x=Math.ceil((F+1)/Cs);p.current.has(x)||(p.current.add(x),i(Array.from(p.current))),p.current.size>=Cn&&(v(),setTimeout(()=>{c(!0)},1e3))},E=($,F)=>{let M=Math.atan2(F,$)*(180/Math.PI);return M<0&&(M+=360),M},N=D(()=>{if(p.current.size===0)return 25;switch(t){case"easy":return 5;case"hard":return 15;default:return 10}},[]),R=$=>{const{keypoints:F,box:x}=$,M={x:x.width*.5,y:x.height*.5},z=F[Rs],Q={y:z.y-x.yMin,x:z.x-x.xMin},ne=M.x-Q.x,re=Q.y-M.y,be=N();return Math.abs(ne)<be&&Math.abs(re)<be?null:E(ne,re)},{detectFaces:V}=$n({frameSize:280,validations:["zoom","in-frame"],onFace:$=>{u(!0),s("Slowly move head around to complete circle");const F=R($);F&&C(F)},onError:$=>{s($),i([]),p.current.clear(),_.current=null,f.current=!1}});return h(H,{children:h(En,{instruction:{title:a,description:l?void 0:"Always ensure face is in frame"},name:"complete-the-circle",completed:d,failed:g,onReset:b,onStart:m,children:h(wn,{onStream:$=>{try{if(!$.current||d)return;const{videoWidth:F}=$.current;V({ref:$,frameSize:F})}catch{}},onRecord:r,children:h(As,{faceDetected:l,sectionsCount:Cn,visitedSections:o})})})})}const xn={root:"_root_thujo_1",sticker:"_sticker_thujo_4",no:"_no_thujo_7",yes:"_yes_thujo_12"};function Us(e){const{show:t,stickers:n}=e;return h(H,{children:t&&h("div",{className:xn.root,children:n.map(r=>h("div",{className:`${xn.sticker} ${xn[r]}`,children:r.toUpperCase()},`sticker-${r}`))})})}const Ws={question:"Are you alive?",errorMessage:"You have to be alive to proceed though",answer:!0},js="Wrong answer. Try again",Co="Keep face in camera";function Bs(e){const{difficulty:t,questions:n=[Ws],timeout:r}=e,[o,i]=S(Co),[a,s]=S(!1),[l,u]=S(!1),{saveStream:d}=Ae(),c=w("inactive"),p=w(0),f=w(!1),_=w(null),y=w(null),m=()=>{_.current&&clearTimeout(_.current),y.current&&clearTimeout(y.current)},{reset:v,start:g,stop:b,timedOut:C}=Tn({timeout:r,onTimeout:m}),E=()=>{i(Co),s(!1),u(!1),c.current="inactive",p.current=0,f.current=!1,v()},N=x=>{const{keypoints:M}=x,z=M[1],Q=M[9],ne=z.x-Q.x,re=z.y-Q.y;return 90-Math.atan2(re,ne)*(180/Math.PI)},R=x=>{c.current="inactive",i(n[x].question),_.current=setTimeout(()=>{c.current="active"},2e3)},V=P(()=>{switch(t){case"easy":return 2;case"hard":return 6;default:return 4}},[]),W=x=>{try{if(c.current="inactive",Math.abs(x)<V)throw new Error("Tilt head further to answer");const M=x>0,z=n[p.current].answer;if(M===z)p.current+=1,p.current===n.length?(u(!0),b()):R(p.current);else throw new Error(n[p.current].errorMessage||js)}catch(M){i(M.message),y.current=setTimeout(()=>{R(p.current)},2e3)}},{detectFaces:$}=$n({onFace:x=>{if(f.current||(s(!0),f.current=!0,R(p.current)),c.current==="inactive")return;const M=N(x);W(M)},onError:x=>{i(x)}}),F=x=>{try{if(!x.current||l)return;const{videoWidth:M}=x.current;$({ref:x,frameSize:M})}catch{}};return L(()=>m,[]),h(En,{instruction:{title:o,description:a?"":"Move head left for No and right for Yes"},name:"yes-or-no",failed:C,onReset:E,onStart:g,completed:l,children:h(wn,{onStream:F,onRecord:d,children:h(Us,{show:a,stickers:["yes","no"]})})})}function zs(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 qs(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=P(()=>{switch(o){case"easy":return 6;case"hard":return 10;default:return 8}},[]),p=()=>{if(u.current<t){const m=t-u.current;let v=`Nod head ${m} `;m<t&&(v+="more "),v+=m>1?"times":"time",n(v);return}d.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)},{canUse:f}=zs({onChange:m=>{l.current=m}});return{evaluate:m=>{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:v}=m,g=he(v[6].x-v[8].x,v[6].y-v[8].y),C=he(v[2].x-v[1].x,v[2].y-v[1].y)/g*10;if(C>c){if(i.current||!a.current)return;i.current=C,a.current=!1,s.current=setTimeout(()=>{i.current=null},3e3)}else i.current&&i.current-C>c/2&&(u.current+=1,i.current=null,s.current&&clearTimeout(s.current)),a.current=!0;p()},reset:()=>{i.current=null,a.current=!0,s.current=null,l.current=null,u.current=0,d.current=!1}}}function Ks(e){const{onMessage:t,onComplete:n,difficulty:r}=e,o=w(!1),i=P(()=>{switch(r){case"easy":return 80;case"hard":return 120;default:return 100}},[]);return{evaluate:l=>{if(o.current)return;const{keypoints:u}=l,d=he(u[6].x-u[8].x,u[6].y-u[8].y);if(he(u[14].x-u[13].x,u[14].y-u[13].y)/d*100>i){o.current=!0,t("Awesome!"),setTimeout(()=>{n()},500);return}t("Open your mouth wide")},reset:()=>{o.current=!1}}}function Ys(e){const{total:t,onMessage:n,onComplete:r,difficulty:o}=e,i=w(!0),a=w(!1),s=w(null),l=w(0),u=P(()=>{switch(o){case"easy":return{closed:20,open:30};case"hard":return{closed:10,open:30};default:return{closed:15,open:30}}},[]),d=y=>{i.current&&(y>=u.closed||(i.current=!1,s.current=Date.now()))},c=y=>{if(!i.current&&!(y<u.open)&&(i.current=!0,s.current)){const m=Date.now(),v=s.current;(m-v)/1e3<=2&&(l.current+=1)}},p=()=>{if(l.current<t){const y=t-l.current;let m=`Blink right eye ${y} `;y<t&&(m+="more "),m+=y>1?"times":"time",n(m);return}a.current=!0,n("Great, hang on..."),setTimeout(()=>{r()},500)};return{evaluate:y=>{if(a.current)return;const{keypoints:m}=y,v=he(m[6].x-m[8].x,m[6].y-m[8].y),b=he(m[145].x-m[159].x,m[145].y-m[159].y)/v*100;d(b),c(b),p()},reset:()=>{i.current=!0,a.current=!1,s.current=null,l.current=0}}}function Gs(){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 xo=(e=>(e.nod="nod",e.open_mouth="open_mouth",e.blink="blink",e))(xo||{});const ko=$s(Object.keys(xo)),So="Keep face in camera";function Zs(e){const{difficulty:t,maxBlinks:n=5,maxNods:r=5,timeout:o}=e,i=w(0),[a,s]=S(So),[l,u]=S(!1),[d,c]=S(null),p=w(!1),{requestDeviceOrientationPermission:f}=Gs(),{reset:_,start:y,stop:m,timedOut:v}=Tn({timeout:o}),g=()=>{if(i.current===ko.length-1){u(!0),m();return}i.current+=1},b=qs({total:Math.floor(Math.random()*r+1),difficulty:t,onMessage:$=>s($),onComplete:g}),C=Ks({difficulty:t,onMessage:$=>s($),onComplete:g}),E=Ys({total:Math.floor(Math.random()*n+1),difficulty:t,onMessage:$=>s($),onComplete:g}),{detectFaces:N}=$n({onFace:$=>{switch(p.current||(p.current=!0),ko[i.current]){case"nod":b.evaluate($);break;case"open_mouth":C.evaluate($);break;case"blink":E.evaluate($);break}},onError:$=>{s($)}}),R=()=>{i.current=0,s(So),u(!1),p.current=!1,E.reset(),b.reset(),C.reset(),_()},V=async $=>{try{if(!$.current||l)return;const{videoWidth:F}=$.current;await N({ref:$,frameSize:F,throttleInterval:500})}catch{}},W=async()=>{try{await f()}catch($){const F=$;s(F.message),c(F)}};return h(En,{instruction:{title:a,description:"Follow the directives as instructed"},name:"motions",failed:v,onReset:R,completed:l,onStart:async()=>{await W(),y()},children:d?h(H,{}):h(wn,{onStream:V})})}function Xs(){var C;const{toggleColorScheme:e,getColorScheme:t,setColorScheme:n}=Ms(),{user:r,tasks:o,currentTaskIndex:i,completed:a,onComplete:s,faceDetector:l,presentation:u}=Ae(),[d,c]=S(!1),[p,f]=S(!1),[_,y]=S(null),[m,v]=S(!1);L(()=>{const E=t();n(E)},[]);const g=async()=>{try{c(!0),y(null),await s(),u==="page"&&v(!0)}catch(E){y(E.message)}finally{c(!1)}},b=D(E=>E===i?G.active:i>E?G.completed:"subtext",[i]);return h("div",{className:G.root,children:h("div",{className:G.container,children:[h("div",{className:`${G.lhs} divider`,children:[h("div",{className:G.info,children:[h(Fs,{}),h("div",{children:h("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."})}),h("ol",{children:[o.map((E,N)=>h("li",{className:b(N),children:vo[E.id].name},`task-${N}`)),h("li",{className:a?G.active:"",children:"Complete! 🎉"})]})]}),h("footer",{className:"divider",children:[h("div",{children:"Powered by Youverify"}),h("div",{onClick:()=>e(),role:"button",children:[h("div",{className:"dark:yvlw-hidden",children:h(uo,{})}),h("div",{className:"yvlw-hidden dark:yvlw-block",children:h(us,{})})]})]})]}),h("div",{className:G.main,children:h("div",{className:G.content,children:[h(ie,{show:!p,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:h("div",{className:G.completed,children:l?h(et,{Icon:hs,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:()=>f(!0)}):h(Eo,{size:"lg"})})}),o.map((E,N)=>{let R;switch(E.id){case"complete-the-circle":R=h(Vs,{...E});break;case"yes-or-no":R=h(Bs,{...E});break;case"motions":R=h(Zs,{...E});break;default:R=h(H,{});break}return h(ie,{show:p&&!a&&i===N,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:R},`task-${N}`)}),h(ie,{show:p&&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:h("div",{className:G.completed,children:h(et,{Icon:vs,title:m?"All Set!":"Completed",description:m?"You can now close or exit the window":"Your Identity verification has been completed successfully. Thanks for your patience",actionText:"Finish",loading:d,onActionClick:g,hideButton:m,children:_&&h("div",{className:"yvlw-mt-3",children:_})})})})]})}),h("div",{className:`${G.rhs} divider`,children:r&&h("div",{className:`${G.profile} divider`,children:[h("div",{children:h("div",{className:G.avatar,children:[r.firstName.charAt(0).toUpperCase(),(C=r.lastName)==null?void 0:C.charAt(0).toUpperCase()]})}),h("div",{children:[h("h4",{children:[r.firstName," ",r.lastName]}),r.email&&h("p",{className:"subtext",children:r.email})]})]})})]})})}function Qs(e){const{tasks:t,namespace:n,user:r,branding:o,onClose:i=()=>{},onSuccess:a,onFailure:s,presentation:l="modal",publicKey:u,metadata:d,sandboxEnvironment:c}=e,[p,f]=S(e.show),_=()=>{f(!1),i()};return h(Ss,{namespace:n,publicKey:u,tasks:t,user:r,branding:o,onRequestClose:_,onSuccess:a,onFailure:s,metadata:d,presentation:l,sandboxEnvironment:c,children:h(ls,{id:n,open:l==="page"?!0:p,onClose:_,transition:!0,className:`${cs.root} ${Tt.root} ${Tt[l]}`,style:{"--branding-color":(o==null?void 0:o.color)??xs},children:[l==="modal"&&h("div",{onClick:_,role:"button",className:Tt.close,children:h(ms,{className:"yvlw-text-white"})}),h(co,{className:`${Tt.container}`,children:h(Xs,{})})]})})}class Js{constructor(t){this.tasks=[],this.container=null,this.namespace="liveness-web-sdk";const{presentation:n="modal"}=t;this.presentation=n,this.props=t,t.tasks&&(this.tasks=t.tasks),n==="page"&&this.start()}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),De(h(Qs,{namespace:this.namespace,publicKey:this.props.publicKey,sandboxEnvironment:this.props.sandboxEnvironment,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()}}}return Js});
|