@smileid/web-components 11.0.3 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/components/smart-camera-web/src/README.md +0 -1
- package/dist/esm/{DocumentCaptureScreens-C5BhNB-0.js → DocumentCaptureScreens-BbtA-WkX.js} +199 -193
- package/dist/esm/DocumentCaptureScreens-BbtA-WkX.js.map +1 -0
- package/dist/esm/{EndUserConsent-D4fd1ovG.js → EndUserConsent-HVufMamg.js} +65 -63
- package/dist/esm/EndUserConsent-HVufMamg.js.map +1 -0
- package/dist/esm/{Navigation-CTjK6tLU.js → Navigation-B-dqPkZj.js} +17 -9
- package/dist/esm/Navigation-B-dqPkZj.js.map +1 -0
- package/dist/esm/{SelfieCaptureScreens-KoQpCxtc.js → SelfieCaptureScreens-ChAMfKi3.js} +3274 -3329
- package/dist/esm/SelfieCaptureScreens-ChAMfKi3.js.map +1 -0
- package/dist/esm/{TotpConsent-CQU5jQi4.js → TotpConsent-XxR8TNxy.js} +13 -9
- package/dist/esm/TotpConsent-XxR8TNxy.js.map +1 -0
- package/dist/esm/combobox.js +20 -19
- package/dist/esm/combobox.js.map +1 -1
- package/dist/esm/document.js +1 -1
- package/dist/esm/end-user-consent.js +1 -1
- package/dist/esm/index-B_ozpejI.js +1360 -0
- package/dist/esm/index-B_ozpejI.js.map +1 -0
- package/dist/esm/localisation.js +21 -0
- package/dist/esm/localisation.js.map +1 -0
- package/dist/esm/main.js +34 -17
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/navigation.js +1 -1
- package/dist/esm/{package-B-UwEdv7.js → package-u3FEJ3Fm.js} +25 -40
- package/dist/esm/package-u3FEJ3Fm.js.map +1 -0
- package/dist/esm/selfie.js +1 -1
- package/dist/esm/smart-camera-web.js +32 -23
- package/dist/esm/smart-camera-web.js.map +1 -1
- package/dist/esm/totp-consent.js +1 -1
- package/dist/package.json +1 -1
- package/dist/smart-camera-web.js +144 -160
- package/dist/smart-camera-web.js.map +1 -1
- package/dist/src/components/combobox/src/index.js +424 -1
- package/dist/src/components/document/src/index.js +1422 -1
- package/dist/src/components/end-user-consent/src/index.js +1573 -1
- package/dist/src/components/selfie/src/index.js +1220 -1
- package/dist/src/components/signature-pad/src/index.js +787 -1
- package/dist/src/components/smart-camera-web/src/SmartCameraWeb.js +2753 -1
- package/dist/src/components/totp-consent/src/index.js +1292 -1
- package/dist/types/combobox.d.ts +2 -2
- package/dist/types/document.d.ts +2 -2
- package/dist/types/end-user-consent.d.ts +2 -2
- package/dist/types/locale.d.ts +19 -0
- package/dist/types/localisation.d.ts +21 -0
- package/dist/types/main.d.ts +35 -26
- package/dist/types/navigation.d.ts +2 -2
- package/dist/types/selfie.d.ts +2 -2
- package/dist/types/signature-pad.d.ts +2 -2
- package/dist/types/smart-camera-web.d.ts +2 -2
- package/dist/types/totp-consent.d.ts +2 -2
- package/lib/components/camera-permission/CameraPermission.js +9 -4
- package/lib/components/combobox/src/Combobox.js +4 -2
- package/lib/components/document/src/DocumentCaptureScreens.js +4 -3
- package/lib/components/document/src/DocumentCaptureScreens.stories.js +37 -13
- package/lib/components/document/src/document-capture/DocumentCapture.js +23 -17
- package/lib/components/document/src/document-capture/DocumentCapture.stories.js +11 -2
- package/lib/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +19 -14
- package/lib/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +14 -5
- package/lib/components/document/src/document-capture-review/DocumentCaptureReview.js +14 -10
- package/lib/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +14 -5
- package/lib/components/end-user-consent/src/EndUserConsent.js +30 -29
- package/lib/components/end-user-consent/src/EndUserConsent.stories.js +12 -2
- package/lib/components/navigation/src/Navigation.js +15 -2
- package/lib/components/navigation/src/Navigation.stories.js +20 -4
- package/lib/components/selfie/src/SelfieCaptureScreens.js +12 -8
- package/lib/components/selfie/src/SelfieCaptureScreens.stories.js +16 -4
- package/lib/components/selfie/src/selfie-capture/SelfieCapture.js +25 -18
- package/lib/components/selfie/src/selfie-capture/SelfieCapture.stories.js +19 -7
- package/lib/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +19 -14
- package/lib/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +14 -5
- package/lib/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +13 -8
- package/lib/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +14 -5
- package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +98 -47
- package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +2 -2
- package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +5 -2
- package/lib/components/selfie/src/smartselfie-capture/hooks/useCamera.ts +4 -4
- package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +6 -5
- package/lib/components/selfie/src/smartselfie-capture/utils/alertMessages.ts +11 -9
- package/lib/components/selfie/src/smartselfie-capture/utils/imageCapture.ts +3 -1
- package/lib/components/signature-pad/package.json +1 -1
- package/lib/components/smart-camera-web/src/SmartCameraWeb.js +9 -1
- package/lib/components/totp-consent/src/TotpConsent.js +8 -3
- package/lib/domain/camera/src/SmartCamera.js +7 -22
- package/lib/domain/constants/src/Constants.js +28 -0
- package/lib/domain/file-upload/src/SmartFileUpload.js +9 -10
- package/lib/domain/localisation/index.js +456 -0
- package/package.json +13 -7
- package/dist/esm/DocumentCaptureScreens-C5BhNB-0.js.map +0 -1
- package/dist/esm/EndUserConsent-D4fd1ovG.js.map +0 -1
- package/dist/esm/Navigation-CTjK6tLU.js.map +0 -1
- package/dist/esm/SelfieCaptureScreens-KoQpCxtc.js.map +0 -1
- package/dist/esm/TotpConsent-CQU5jQi4.js.map +0 -1
- package/dist/esm/package-B-UwEdv7.js.map +0 -1
package/dist/smart-camera-web.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var SmartCameraWeb=function(P){"use strict";var vu=Object.defineProperty,bu=Object.defineProperties;var wu=Object.getOwnPropertyDescriptors;var Pr=Object.getOwnPropertySymbols;var K2=Object.prototype.hasOwnProperty,J2=Object.prototype.propertyIsEnumerable;var da=Math.pow,ha=(P,J,ie)=>J in P?vu(P,J,{enumerable:!0,configurable:!0,writable:!0,value:ie}):P[J]=ie,Fe=(P,J)=>{for(var ie in J||(J={}))K2.call(J,ie)&&ha(P,ie,J[ie]);if(Pr)for(var ie of Pr(J))J2.call(J,ie)&&ha(P,ie,J[ie]);return P},qi=(P,J)=>bu(P,wu(J));var ua=(P,J)=>{var ie={};for(var Pe in P)K2.call(P,Pe)&&J.indexOf(Pe)<0&&(ie[Pe]=P[Pe]);if(P!=null&&Pr)for(var Pe of Pr(P))J.indexOf(Pe)<0&&J2.call(P,Pe)&&(ie[Pe]=P[Pe]);return ie};var li=(P,J,ie)=>ha(P,typeof J!="symbol"?J+"":J,ie);var L=(P,J,ie)=>new Promise((Pe,Sn)=>{var $r=_t=>{try{Wi(ie.next(_t))}catch(hi){Sn(hi)}},Nr=_t=>{try{Wi(ie.throw(_t))}catch(hi){Sn(hi)}},Wi=_t=>_t.done?Pe(_t.value):Promise.resolve(_t.value).then($r,Nr);Wi((ie=ie.apply(P,J)).next())});var rt;function J(e){const t=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${e}-${t}`}function ie(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function Pe(e){return e&&e.clientHeight<e.scrollHeight}function Sn(e,t){const{offsetHeight:i,offsetTop:n}=e,{offsetHeight:r,scrollTop:s}=t,o=n<s,a=n+i>s+r;o?t.scrollTo(0,n):a&&t.scrollTo(0,n-r+i)}class $r extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(t){const i=t.relatedTarget||t.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class Nr extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
|
|
1
|
+
var SmartCameraWeb=function(B){"use strict";var G5=Object.defineProperty,Z5=Object.defineProperties;var W5=Object.getOwnPropertyDescriptors;var oo=Object.getOwnPropertySymbols;var K0=Object.prototype.hasOwnProperty,Y0=Object.prototype.propertyIsEnumerable;var dl=Math.pow,ul=(B,J,te)=>J in B?G5(B,J,{enumerable:!0,configurable:!0,writable:!0,value:te}):B[J]=te,Re=(B,J)=>{for(var te in J||(J={}))K0.call(J,te)&&ul(B,te,J[te]);if(oo)for(var te of oo(J))Y0.call(J,te)&&ul(B,te,J[te]);return B},nr=(B,J)=>Z5(B,W5(J));var hl=(B,J)=>{var te={};for(var Te in B)K0.call(B,Te)&&J.indexOf(Te)<0&&(te[Te]=B[Te]);if(B!=null&&oo)for(var Te of oo(B))J.indexOf(Te)<0&&Y0.call(B,Te)&&(te[Te]=B[Te]);return te};var _i=(B,J,te)=>ul(B,typeof J!="symbol"?J+"":J,te);var S=(B,J,te)=>new Promise((Te,or)=>{var so=Ye=>{try{wi(te.next(Ye))}catch(ni){or(ni)}},sr=Ye=>{try{wi(te.throw(Ye))}catch(ni){or(ni)}},wi=Ye=>Ye.done?Te(Ye.value):Promise.resolve(Ye.value).then(so,sr);wi((te=te.apply(B,J)).next())});var ct;var J=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te,or;function so(){if(or)return Te;or=1;function e(){this.__data__=[],this.size=0}return Te=e,Te}var sr,wi;function Ye(){if(wi)return sr;wi=1;function e(t,i){return t===i||t!==t&&i!==i}return sr=e,sr}var ni,pl;function jr(){if(pl)return ni;pl=1;var e=Ye();function t(i,r){for(var n=i.length;n--;)if(e(i[n][0],r))return n;return-1}return ni=t,ni}var ao,ml;function J0(){if(ml)return ao;ml=1;var e=jr(),t=Array.prototype,i=t.splice;function r(n){var o=this.__data__,s=e(o,n);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():i.call(o,s,1),--this.size,!0}return ao=r,ao}var co,gl;function Q0(){if(gl)return co;gl=1;var e=jr();function t(i){var r=this.__data__,n=e(r,i);return n<0?void 0:r[n][1]}return co=t,co}var lo,vl;function e3(){if(vl)return lo;vl=1;var e=jr();function t(i){return e(this.__data__,i)>-1}return lo=t,lo}var uo,bl;function t3(){if(bl)return uo;bl=1;var e=jr();function t(i,r){var n=this.__data__,o=e(n,i);return o<0?(++this.size,n.push([i,r])):n[o][1]=r,this}return uo=t,uo}var ho,yl;function zr(){if(yl)return ho;yl=1;var e=so(),t=J0(),i=Q0(),r=e3(),n=t3();function o(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var l=s[a];this.set(l[0],l[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,ho=o,ho}var fo,_l;function i3(){if(_l)return fo;_l=1;var e=zr();function t(){this.__data__=new e,this.size=0}return fo=t,fo}var po,wl;function r3(){if(wl)return po;wl=1;function e(t){var i=this.__data__,r=i.delete(t);return this.size=i.size,r}return po=e,po}var mo,Cl;function n3(){if(Cl)return mo;Cl=1;function e(t){return this.__data__.get(t)}return mo=e,mo}var go,El;function o3(){if(El)return go;El=1;function e(t){return this.__data__.has(t)}return go=e,go}var vo,xl;function kl(){if(xl)return vo;xl=1;var e=typeof J=="object"&&J&&J.Object===Object&&J;return vo=e,vo}var bo,Al;function oi(){if(Al)return bo;Al=1;var e=kl(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return bo=i,bo}var yo,Sl;function Ll(){if(Sl)return yo;Sl=1;var e=oi(),t=e.Symbol;return yo=t,yo}var _o,Tl;function s3(){if(Tl)return _o;Tl=1;var e=Ll(),t=Object.prototype,i=t.hasOwnProperty,r=t.toString,n=e?e.toStringTag:void 0;function o(s){var a=i.call(s,n),c=s[n];try{s[n]=void 0;var l=!0}catch(u){}var d=r.call(s);return l&&(a?s[n]=c:delete s[n]),d}return _o=o,_o}var wo,Ml;function a3(){if(Ml)return wo;Ml=1;var e=Object.prototype,t=e.toString;function i(r){return t.call(r)}return wo=i,wo}var Co,Il;function ar(){if(Il)return Co;Il=1;var e=Ll(),t=s3(),i=a3(),r="[object Null]",n="[object Undefined]",o=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?n:r:o&&o in Object(a)?t(a):i(a)}return Co=s,Co}var Eo,Fl;function gt(){if(Fl)return Eo;Fl=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return Eo=e,Eo}var xo,Bl;function ko(){if(Bl)return xo;Bl=1;var e=ar(),t=gt(),i="[object AsyncFunction]",r="[object Function]",n="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!t(a))return!1;var c=e(a);return c==r||c==n||c==i||c==o}return xo=s,xo}var Ao,Dl;function c3(){if(Dl)return Ao;Dl=1;var e=oi(),t=e["__core-js_shared__"];return Ao=t,Ao}var So,Rl;function l3(){if(Rl)return So;Rl=1;var e=c3(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function i(r){return!!t&&t in r}return So=i,So}var Lo,Ol;function u3(){if(Ol)return Lo;Ol=1;var e=Function.prototype,t=e.toString;function i(r){if(r!=null){try{return t.call(r)}catch(n){}try{return r+""}catch(n){}}return""}return Lo=i,Lo}var To,Pl;function d3(){if(Pl)return To;Pl=1;var e=ko(),t=l3(),i=gt(),r=u3(),n=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,c=s.toString,l=a.hasOwnProperty,d=RegExp("^"+c.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(h){if(!i(h)||t(h))return!1;var f=e(h)?d:o;return f.test(r(h))}return To=u,To}var Mo,$l;function h3(){if($l)return Mo;$l=1;function e(t,i){return t==null?void 0:t[i]}return Mo=e,Mo}var Io,Nl;function Fo(){if(Nl)return Io;Nl=1;var e=d3(),t=h3();function i(r,n){var o=t(r,n);return e(o)?o:void 0}return Io=i,Io}var Bo,Hl;function Ul(){if(Hl)return Bo;Hl=1;var e=Fo(),t=oi(),i=e(t,"Map");return Bo=i,Bo}var Do,ql;function Gr(){if(ql)return Do;ql=1;var e=Fo(),t=e(Object,"create");return Do=t,Do}var Ro,Vl;function f3(){if(Vl)return Ro;Vl=1;var e=Gr();function t(){this.__data__=e?e(null):{},this.size=0}return Ro=t,Ro}var Oo,jl;function p3(){if(jl)return Oo;jl=1;function e(t){var i=this.has(t)&&delete this.__data__[t];return this.size-=i?1:0,i}return Oo=e,Oo}var Po,zl;function m3(){if(zl)return Po;zl=1;var e=Gr(),t="__lodash_hash_undefined__",i=Object.prototype,r=i.hasOwnProperty;function n(o){var s=this.__data__;if(e){var a=s[o];return a===t?void 0:a}return r.call(s,o)?s[o]:void 0}return Po=n,Po}var $o,Gl;function g3(){if(Gl)return $o;Gl=1;var e=Gr(),t=Object.prototype,i=t.hasOwnProperty;function r(n){var o=this.__data__;return e?o[n]!==void 0:i.call(o,n)}return $o=r,$o}var No,Zl;function v3(){if(Zl)return No;Zl=1;var e=Gr(),t="__lodash_hash_undefined__";function i(r,n){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&n===void 0?t:n,this}return No=i,No}var Ho,Wl;function b3(){if(Wl)return Ho;Wl=1;var e=f3(),t=p3(),i=m3(),r=g3(),n=v3();function o(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var l=s[a];this.set(l[0],l[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,Ho=o,Ho}var Uo,Xl;function y3(){if(Xl)return Uo;Xl=1;var e=b3(),t=zr(),i=Ul();function r(){this.size=0,this.__data__={hash:new e,map:new(i||t),string:new e}}return Uo=r,Uo}var qo,Kl;function _3(){if(Kl)return qo;Kl=1;function e(t){var i=typeof t;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?t!=="__proto__":t===null}return qo=e,qo}var Vo,Yl;function Zr(){if(Yl)return Vo;Yl=1;var e=_3();function t(i,r){var n=i.__data__;return e(r)?n[typeof r=="string"?"string":"hash"]:n.map}return Vo=t,Vo}var jo,Jl;function w3(){if(Jl)return jo;Jl=1;var e=Zr();function t(i){var r=e(this,i).delete(i);return this.size-=r?1:0,r}return jo=t,jo}var zo,Ql;function C3(){if(Ql)return zo;Ql=1;var e=Zr();function t(i){return e(this,i).get(i)}return zo=t,zo}var Go,e1;function E3(){if(e1)return Go;e1=1;var e=Zr();function t(i){return e(this,i).has(i)}return Go=t,Go}var Zo,t1;function x3(){if(t1)return Zo;t1=1;var e=Zr();function t(i,r){var n=e(this,i),o=n.size;return n.set(i,r),this.size+=n.size==o?0:1,this}return Zo=t,Zo}var Wo,i1;function k3(){if(i1)return Wo;i1=1;var e=y3(),t=w3(),i=C3(),r=E3(),n=x3();function o(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var l=s[a];this.set(l[0],l[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,Wo=o,Wo}var Xo,r1;function A3(){if(r1)return Xo;r1=1;var e=zr(),t=Ul(),i=k3(),r=200;function n(o,s){var a=this.__data__;if(a instanceof e){var c=a.__data__;if(!t||c.length<r-1)return c.push([o,s]),this.size=++a.size,this;a=this.__data__=new i(c)}return a.set(o,s),this.size=a.size,this}return Xo=n,Xo}var Ko,n1;function S3(){if(n1)return Ko;n1=1;var e=zr(),t=i3(),i=r3(),r=n3(),n=o3(),o=A3();function s(a){var c=this.__data__=new e(a);this.size=c.size}return s.prototype.clear=t,s.prototype.delete=i,s.prototype.get=r,s.prototype.has=n,s.prototype.set=o,Ko=s,Ko}var Yo,o1;function s1(){if(o1)return Yo;o1=1;var e=Fo(),t=function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch(r){}}();return Yo=t,Yo}var Jo,a1;function Qo(){if(a1)return Jo;a1=1;var e=s1();function t(i,r,n){r=="__proto__"&&e?e(i,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):i[r]=n}return Jo=t,Jo}var es,c1;function l1(){if(c1)return es;c1=1;var e=Qo(),t=Ye();function i(r,n,o){(o!==void 0&&!t(r[n],o)||o===void 0&&!(n in r))&&e(r,n,o)}return es=i,es}var ts,u1;function L3(){if(u1)return ts;u1=1;function e(t){return function(i,r,n){for(var o=-1,s=Object(i),a=n(i),c=a.length;c--;){var l=a[t?c:++o];if(r(s[l],l,s)===!1)break}return i}}return ts=e,ts}var is,d1;function T3(){if(d1)return is;d1=1;var e=L3(),t=e();return is=t,is}var cr={exports:{}};cr.exports;var h1;function M3(){return h1||(h1=1,function(e,t){var i=oi(),r=t&&!t.nodeType&&t,n=r&&!0&&e&&!e.nodeType&&e,o=n&&n.exports===r,s=o?i.Buffer:void 0,a=s?s.allocUnsafe:void 0;function c(l,d){if(d)return l.slice();var u=l.length,h=a?a(u):new l.constructor(u);return l.copy(h),h}e.exports=c}(cr,cr.exports)),cr.exports}var rs,f1;function I3(){if(f1)return rs;f1=1;var e=oi(),t=e.Uint8Array;return rs=t,rs}var ns,p1;function F3(){if(p1)return ns;p1=1;var e=I3();function t(i){var r=new i.constructor(i.byteLength);return new e(r).set(new e(i)),r}return ns=t,ns}var os,m1;function B3(){if(m1)return os;m1=1;var e=F3();function t(i,r){var n=r?e(i.buffer):i.buffer;return new i.constructor(n,i.byteOffset,i.length)}return os=t,os}var ss,g1;function D3(){if(g1)return ss;g1=1;function e(t,i){var r=-1,n=t.length;for(i||(i=Array(n));++r<n;)i[r]=t[r];return i}return ss=e,ss}var as,v1;function R3(){if(v1)return as;v1=1;var e=gt(),t=Object.create,i=function(){function r(){}return function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var o=new r;return r.prototype=void 0,o}}();return as=i,as}var cs,b1;function O3(){if(b1)return cs;b1=1;function e(t,i){return function(r){return t(i(r))}}return cs=e,cs}var ls,y1;function _1(){if(y1)return ls;y1=1;var e=O3(),t=e(Object.getPrototypeOf,Object);return ls=t,ls}var us,w1;function C1(){if(w1)return us;w1=1;var e=Object.prototype;function t(i){var r=i&&i.constructor,n=typeof r=="function"&&r.prototype||e;return i===n}return us=t,us}var ds,E1;function P3(){if(E1)return ds;E1=1;var e=R3(),t=_1(),i=C1();function r(n){return typeof n.constructor=="function"&&!i(n)?e(t(n)):{}}return ds=r,ds}var hs,x1;function Ci(){if(x1)return hs;x1=1;function e(t){return t!=null&&typeof t=="object"}return hs=e,hs}var fs,k1;function $3(){if(k1)return fs;k1=1;var e=ar(),t=Ci(),i="[object Arguments]";function r(n){return t(n)&&e(n)==i}return fs=r,fs}var ps,A1;function S1(){if(A1)return ps;A1=1;var e=$3(),t=Ci(),i=Object.prototype,r=i.hasOwnProperty,n=i.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(s){return t(s)&&r.call(s,"callee")&&!n.call(s,"callee")};return ps=o,ps}var ms,L1;function T1(){if(L1)return ms;L1=1;var e=Array.isArray;return ms=e,ms}var gs,M1;function I1(){if(M1)return gs;M1=1;var e=9007199254740991;function t(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return gs=t,gs}var vs,F1;function bs(){if(F1)return vs;F1=1;var e=ko(),t=I1();function i(r){return r!=null&&t(r.length)&&!e(r)}return vs=i,vs}var ys,B1;function N3(){if(B1)return ys;B1=1;var e=bs(),t=Ci();function i(r){return t(r)&&e(r)}return ys=i,ys}var lr={exports:{}},_s,D1;function H3(){if(D1)return _s;D1=1;function e(){return!1}return _s=e,_s}lr.exports;var R1;function O1(){return R1||(R1=1,function(e,t){var i=oi(),r=H3(),n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===n,a=s?i.Buffer:void 0,c=a?a.isBuffer:void 0,l=c||r;e.exports=l}(lr,lr.exports)),lr.exports}var ws,P1;function U3(){if(P1)return ws;P1=1;var e=ar(),t=_1(),i=Ci(),r="[object Object]",n=Function.prototype,o=Object.prototype,s=n.toString,a=o.hasOwnProperty,c=s.call(Object);function l(d){if(!i(d)||e(d)!=r)return!1;var u=t(d);if(u===null)return!0;var h=a.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==c}return ws=l,ws}var Cs,$1;function q3(){if($1)return Cs;$1=1;var e=ar(),t=I1(),i=Ci(),r="[object Arguments]",n="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",c="[object Function]",l="[object Map]",d="[object Number]",u="[object Object]",h="[object RegExp]",f="[object Set]",p="[object String]",m="[object WeakMap]",v="[object ArrayBuffer]",g="[object DataView]",b="[object Float32Array]",_="[object Float64Array]",M="[object Int8Array]",P="[object Int16Array]",x="[object Int32Array]",D="[object Uint8Array]",C="[object Uint8ClampedArray]",R="[object Uint16Array]",F="[object Uint32Array]",E={};E[b]=E[_]=E[M]=E[P]=E[x]=E[D]=E[C]=E[R]=E[F]=!0,E[r]=E[n]=E[v]=E[o]=E[g]=E[s]=E[a]=E[c]=E[l]=E[d]=E[u]=E[h]=E[f]=E[p]=E[m]=!1;function j(O){return i(O)&&t(O.length)&&!!E[e(O)]}return Cs=j,Cs}var Es,N1;function V3(){if(N1)return Es;N1=1;function e(t){return function(i){return t(i)}}return Es=e,Es}var ur={exports:{}};ur.exports;var H1;function j3(){return H1||(H1=1,function(e,t){var i=kl(),r=t&&!t.nodeType&&t,n=r&&!0&&e&&!e.nodeType&&e,o=n&&n.exports===r,s=o&&i.process,a=function(){try{var c=n&&n.require&&n.require("util").types;return c||s&&s.binding&&s.binding("util")}catch(l){}}();e.exports=a}(ur,ur.exports)),ur.exports}var xs,U1;function q1(){if(U1)return xs;U1=1;var e=q3(),t=V3(),i=j3(),r=i&&i.isTypedArray,n=r?t(r):e;return xs=n,xs}var ks,V1;function j1(){if(V1)return ks;V1=1;function e(t,i){if(!(i==="constructor"&&typeof t[i]=="function")&&i!="__proto__")return t[i]}return ks=e,ks}var As,z1;function z3(){if(z1)return As;z1=1;var e=Qo(),t=Ye(),i=Object.prototype,r=i.hasOwnProperty;function n(o,s,a){var c=o[s];(!(r.call(o,s)&&t(c,a))||a===void 0&&!(s in o))&&e(o,s,a)}return As=n,As}var Ss,G1;function G3(){if(G1)return Ss;G1=1;var e=z3(),t=Qo();function i(r,n,o,s){var a=!o;o||(o={});for(var c=-1,l=n.length;++c<l;){var d=n[c],u=s?s(o[d],r[d],d,o,r):void 0;u===void 0&&(u=r[d]),a?t(o,d,u):e(o,d,u)}return o}return Ss=i,Ss}var Ls,Z1;function Z3(){if(Z1)return Ls;Z1=1;function e(t,i){for(var r=-1,n=Array(t);++r<t;)n[r]=i(r);return n}return Ls=e,Ls}var Ts,W1;function X1(){if(W1)return Ts;W1=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function i(r,n){var o=typeof r;return n=n==null?e:n,!!n&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<n}return Ts=i,Ts}var Ms,K1;function W3(){if(K1)return Ms;K1=1;var e=Z3(),t=S1(),i=T1(),r=O1(),n=X1(),o=q1(),s=Object.prototype,a=s.hasOwnProperty;function c(l,d){var u=i(l),h=!u&&t(l),f=!u&&!h&&r(l),p=!u&&!h&&!f&&o(l),m=u||h||f||p,v=m?e(l.length,String):[],g=v.length;for(var b in l)(d||a.call(l,b))&&!(m&&(b=="length"||f&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||n(b,g)))&&v.push(b);return v}return Ms=c,Ms}var Is,Y1;function X3(){if(Y1)return Is;Y1=1;function e(t){var i=[];if(t!=null)for(var r in Object(t))i.push(r);return i}return Is=e,Is}var Fs,J1;function K3(){if(J1)return Fs;J1=1;var e=gt(),t=C1(),i=X3(),r=Object.prototype,n=r.hasOwnProperty;function o(s){if(!e(s))return i(s);var a=t(s),c=[];for(var l in s)l=="constructor"&&(a||!n.call(s,l))||c.push(l);return c}return Fs=o,Fs}var Bs,Q1;function eu(){if(Q1)return Bs;Q1=1;var e=W3(),t=K3(),i=bs();function r(n){return i(n)?e(n,!0):t(n)}return Bs=r,Bs}var Ds,tu;function Y3(){if(tu)return Ds;tu=1;var e=G3(),t=eu();function i(r){return e(r,t(r))}return Ds=i,Ds}var Rs,iu;function J3(){if(iu)return Rs;iu=1;var e=l1(),t=M3(),i=B3(),r=D3(),n=P3(),o=S1(),s=T1(),a=N3(),c=O1(),l=ko(),d=gt(),u=U3(),h=q1(),f=j1(),p=Y3();function m(v,g,b,_,M,P,x){var D=f(v,b),C=f(g,b),R=x.get(C);if(R){e(v,b,R);return}var F=P?P(D,C,b+"",v,g,x):void 0,E=F===void 0;if(E){var j=s(C),O=!j&&c(C),ae=!j&&!O&&h(C);F=C,j||O||ae?s(D)?F=D:a(D)?F=r(D):O?(E=!1,F=t(C,!0)):ae?(E=!1,F=i(C,!0)):F=[]:u(C)||o(C)?(F=D,o(D)?F=p(D):(!d(D)||l(D))&&(F=n(C))):E=!1}E&&(x.set(C,F),M(F,C,_,P,x),x.delete(C)),e(v,b,F)}return Rs=m,Rs}var Os,ru;function Q3(){if(ru)return Os;ru=1;var e=S3(),t=l1(),i=T3(),r=J3(),n=gt(),o=eu(),s=j1();function a(c,l,d,u,h){c!==l&&i(l,function(f,p){if(h||(h=new e),n(f))r(c,l,p,d,a,u,h);else{var m=u?u(s(c,p),f,p+"",c,l,h):void 0;m===void 0&&(m=f),t(c,p,m)}},o)}return Os=a,Os}var Ps,nu;function ou(){if(nu)return Ps;nu=1;function e(t){return t}return Ps=e,Ps}var $s,su;function e4(){if(su)return $s;su=1;function e(t,i,r){switch(r.length){case 0:return t.call(i);case 1:return t.call(i,r[0]);case 2:return t.call(i,r[0],r[1]);case 3:return t.call(i,r[0],r[1],r[2])}return t.apply(i,r)}return $s=e,$s}var Ns,au;function t4(){if(au)return Ns;au=1;var e=e4(),t=Math.max;function i(r,n,o){return n=t(n===void 0?r.length-1:n,0),function(){for(var s=arguments,a=-1,c=t(s.length-n,0),l=Array(c);++a<c;)l[a]=s[n+a];a=-1;for(var d=Array(n+1);++a<n;)d[a]=s[a];return d[n]=o(l),e(r,this,d)}}return Ns=i,Ns}var Hs,cu;function i4(){if(cu)return Hs;cu=1;function e(t){return function(){return t}}return Hs=e,Hs}var Us,lu;function r4(){if(lu)return Us;lu=1;var e=i4(),t=s1(),i=ou(),r=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:i;return Us=r,Us}var qs,uu;function n4(){if(uu)return qs;uu=1;var e=800,t=16,i=Date.now;function r(n){var o=0,s=0;return function(){var a=i(),c=t-(a-s);if(s=a,c>0){if(++o>=e)return arguments[0]}else o=0;return n.apply(void 0,arguments)}}return qs=r,qs}var Vs,du;function o4(){if(du)return Vs;du=1;var e=r4(),t=n4(),i=t(e);return Vs=i,Vs}var js,hu;function s4(){if(hu)return js;hu=1;var e=ou(),t=t4(),i=o4();function r(n,o){return i(t(n,o,e),n+"")}return js=r,js}var zs,fu;function a4(){if(fu)return zs;fu=1;var e=Ye(),t=bs(),i=X1(),r=gt();function n(o,s,a){if(!r(a))return!1;var c=typeof s;return(c=="number"?t(a)&&i(s,a.length):c=="string"&&s in a)?e(a[s],o):!1}return zs=n,zs}var Gs,pu;function c4(){if(pu)return Gs;pu=1;var e=s4(),t=a4();function i(r){return e(function(n,o){var s=-1,a=o.length,c=a>1?o[a-1]:void 0,l=a>2?o[2]:void 0;for(c=r.length>3&&typeof c=="function"?(a--,c):void 0,l&&t(o[0],o[1],l)&&(c=a<3?void 0:c,a=1),n=Object(n);++s<a;){var d=o[s];d&&r(n,d,s,c)}return n})}return Gs=i,Gs}var Zs,mu;function l4(){if(mu)return Zs;mu=1;var e=Q3(),t=c4(),i=t(function(r,n,o){e(r,n,o)});return Zs=i,Zs}var u4=l4();const d4=te(u4),h4={direction:"rtl",common:{back:"رجوع",close:"إغلاق",closeVerificationFrame:"إغلاق التحقق من الهوية (Smile ID)",allow:"اسمح",cancel:"إلغاء",continue:"استمر",or:"أو",toggle:"تبديل"},combobox:{noItems:"لا توجد عناصر"},navigation:{back:"رجوع",closeVerificationFrame:"إغلاق التحقق من الهوية (Smile ID)"},camera:{permission:{description:"اسمح بالوصول إلى الكاميرا للتحقق من بياناتك",requestButton:"طلب الوصول إلى الكاميرا"},error:{notAllowed:"لم يتم منح الوصول إلى الكاميرا أو تم حظره بواسطة متصفح/إضافات. قم بتمكين الوصول في متصفحك/إضافتك للمتابعة. قد تحتاج إلى إعادة تحميل الصفحة.",abort:"حدث خطأ ما، وفقدنا الوصول إلى كاميرتك. يرجى إعادة تحميل الصفحة.",notReadable:"يبدو أن هناك مشكلة في الكاميرا. قم بإصلاحها وحاول مرة أخرى، أو حاول استخدام الجهاز.",notFound:"لا نستطيع العثور على الكاميرا الخاصة بك. يرجى التحديث.",insecure:"يلزم اتصال آمن. الوصول إلى الكاميرا معطل على المواقع غير الآمنة. يرجى الانتقال إلى الصفحة الآمنة أو الاتصال بمالك التطبيق."}},selfie:{instructions:{title:"بعد ذلك، سنأخذ صورة سيلفي سريعة",allowButton:"اسمح",tips:{goodLight:{header:"إضاءة جيدة",body:"تأكد من أنك في بيئة جيدة الإضاءة."},clearImage:{header:"صورة واضحة",body:"امسك هاتفك بثبات لتكون صورة السيلفي واضحة وحادة."},removeObstructions:{header:"إزالة العوائق",body:"أزل أي شيء يغطي وجهك، مثل النظارات والأقنعة والقبعات."},wideSmile:{header:"ابتسامة كبيرة",body:"عندما يُطلب منك الابتسام، ابتسم ابتسامة عريضة تظهر أسنانك."}}},capture:{tip:{fitHead:"ضع رأسك داخل الإطار البيضاوي"},cta:{smile:"ابتسم",widerSmile:"ابتسامة أوسع"},button:{takeSelfie:"التقط سيلفي",startCapture:"بدء التسجيل"},agentMode:{on:"وضع الوكيل قيد التشغيل",off:"وضع الوكيل معطل"},error:{minFrames:"كاميرا ويب الذكية: الحد الأدنى المطلوب لعدد الإطارات هو {{count}}",webcamCapture:"تعذر التقاط صور كاميرا الويب - يرجى تجربة جهاز آخر"},loading:{progress:"جارٍ التحميل... {{progress}}%",slowConnection:"الإنترنت بطيء جدًا، انتظر قليلاً...",connectionError:"خطأ في الاتصال بالإنترنت، تحقق من اتصالك وأعد المحاولة"}},smart:{alert:{multipleFaces:"تأكد من وضوح وجه واحد فقط",noFace:"ضع وجهك في الشكل البيضاوي",outOfBounds:"ضع وجهك في الشكل البيضاوي",tooClose:"ابتعد أكثر",tooFar:"اقترب",neutralExpression:"تعبير محايد",smileRequired:"يبتسم!",openMouthSmile:"ابتسامة أوسع - أسنان ظاهرة",initializing:"جارٍ التهيئة..."},status:{capturing:"جارٍ التقاط...",keepSmiling:"حافظ على ابتسامتك!",readyToCapture:"جاهز للتصوير"}},review:{title:"مراجعة صورة سيلفي",question:"هل وجهك كله صافي؟",acceptButton:"نعم، استخدم هذا",retakeButton:"لا، أعد التقاط صورة السيلفي"}},document:{name:{default:"وثيقة"},title:{front:"تقديم صورة أمامية لبطاقة الهوية",back:"تقديم ظهر الهوية"},capture:{checkingPermissions:"جارٍ التحقق من الأذونات...",instructionText:"تأكد من أن جميع الزوايا مرئية ولا يوجد وهج.",captureButton:"التقاط وثيقة"},instructions:{description:"سنستخدمه للتحقق من هويتك.",followInstructions:"يرجى اتباع التعليمات أدناه.",goodLight:{header:"إضاءة جيدة",body:"تأكد من التقاط الصورة في بيئة مضاءة جيداً حيث يسهل قراءة وثيقة الهوية."},clearImage:{header:"صورة واضحة",body:"اجعل الكاميرا ثابتة حتى لا تكون الكلمات الموجودة على الهوية ضبابية."},takePhotoButton:"التقط صورة",uploadPhotoButton:"تحميل صورة"},review:{question:"هل الوثيقة واضحة ومقروءة؟",description:"تأكد من أن جميع زوايا المستند مرئية ولا يوجد توهج",acceptButton:"نعم، بطاقة هويتي واضحة و مقروءة",retakeButton:"لا، أعد التقاط الصورة"}},fileUpload:{error:{readingFile:"حدث خطأ أثناء قراءة الملف. يرجى التحقق من الملف والمحاولة مرة أخرى.",multipleFiles:"يُسمح بتحميل ملف واحد فقط في كل مرة",unsupportedFormat:"تنسيق ملف غير مدعوم. يرجى التأكد من توفير صورة بتنسيق JPG أو PNG",fileTooLarge:"{{filename}} كبير جدًا. يُرجى التأكد من أن الملف أقل من {{size}}."}},consent:{demoTip:"شاشة الموافقة هذه لأغراض توضيحية فقط. لا يقوم التطبيق التجريبي بجمع بيانات الهوية السيلفي.",accessRequest:"{{partnerName}} يرغب في الوصول إلى معلوماتك {{idTypeLabel}}",allowPartner:"هذا سيسمح لـ {{partnerName}} بـ:",processing:{personalDetails:{title:"معالجة بياناتك السيلفي",description:"بإمكان الشريك معالجة اسمك وتاريخ ميلادك وجنسك"},contactInfo:{title:"معالجة معلومات الاتصال الخاصة بك",description:"يمكن للشريك معالجة أرقام هواتفك وعنوانك"},documentInfo:{title:"معالجة معلومات مستندك",description:"يمكن للشريك معالجة صورتك وتاريخ انتهاء صلاحية هويتك وبلد الإصدار ورقم الوثيقة"}},privacyPolicy:"يمكنك الاطلاع على سياسة الخصوصية الخاصة بـ {{partnerName}}",privacyPolicyLink:"هنا.",grantConsent:'باختيارك "السماح"، فإنك تمنح {{partnerName}} الموافقة على معالجة بياناتك السيلفي لتقديم هذه الخدمة لك.',denied:{title:"تم رفض الموافقة",message:"لا يمكننا التحقق من هويتك بدون موافقتك",prompt:"هل ترغب في تصحيح ذلك؟",goBack:"عُد",confirmCancel:"لا، إلغاء التحقق"}},pages:{loading:{title:"إنشاء",subtitle:"بضع ثوانٍ أخرى فقط",description:"نحن نجهز عملية التحقق الخاصة بك"},idSelection:{title:"حدد نوع المستند",selectCountry:"اختر البلد",selectIdType:"حدد نوع المستند",selectDocument:"حدد المستند",searchCountry:"البحث عن بلد",placeholder:"الرجاء الاختيار",selectCountryFirst:"--اختر البلد أولاً--",noCountryFound:"لا يوجد بلد",noIdTypeFound:"لم يتم العثور على نوع هوية"},upload:{title:"جاري تحميل",subtitle:"بضع ثوانٍ أخرى فقط",description:"نحن بصدد معالجة طلبك"},complete:{title:"تم الإرسال بنجاح",subtitle:"هذا كل ما تحتاجه للتحقق من هويتك",processingInfo:"سنقوم بمعالجة معلوماتك {{country}} - {{idType}} للتحقق من هويتك"},smartSelfie:{authentication:{title:"مصادقة SmartSelfie™",upload:"مصادقة المستخدم"},registration:{title:"تسجيل SmartSelfie™",upload:"تسجيل المستخدم"}},eSignature:{fullName:"الاسم الكامل",loading:{description:"نحن بصدد التأسيس"},upload:{description:"نحن بصدد معالجة طلبك"},entry:{title:"تقديم التوقيع",subtitle:"اقرأ واقبل الاتفاقيات التي ستراها في الصفحة التالية"},tips:{read:{title:"اقرأ المستند",description:"اقرأ المستند (المستندات) المقدمة بعناية"},name:{title:"أضف اسمك الكامل",description:"اكتب اسمك الكامل بعد موافقتك على المستند (المستندات) التي تمت مشاركتها معك."},signature:{title:"أضف توقيعك",description:"وقّع أو حمّل توقيعك لتوثيق المستندات"}},getStarted:"ابدأ الآن",review:{title:"مراجعة الوثائق",subtitle:"قبل القبول، يُرجى قراءة المستند(ات) بعناية",consent:"بتحديد هذا المربع، فإنك توافق على الشروط الواردة في المستند (المستندات)."},personalInfo:{title:"أضف اسمك الكامل",subtitle:"يرجى إضافة اسمك بالكامل للتحقق من قراءتك للوثيقة (الوثائق) المقدمة مسبقاً.",placeholder:"جيمس دو"},signature:{title:"أضف توقيعك",subtitle:"وقّع أو حمّل توقيعك أدناه"},confirmDetails:{title:"تأكيد التفاصيل",subtitle:"تأكد من أن اسمك مكتوب بشكل صحيح، وأن التوقيع يشبه التوقيع الموجود في هويتك",yes:"نعم، هذا صحيح",no:"لا، غيّرهم"},error:{uploadFailed:"لم نتمكن من تحميل توقيعك"}},idInfo:{title:"أدخل معلومات الهوية",idNumber:"رقم الهوية",firstName:"الاسم الأول",lastName:"اسم العائلة",dateOfBirth:"تاريخ الميلاد",day:"يوم",month:"شهر",year:"سنة",bank:"بنك",selectBank:"--حدد البنك--",searchBank:"البحث عن بنك",noBankFound:"لم يتم العثور على بنك",citizenship:"الجنسية",selectCitizenship:"اختر نوع الجنسية",dob:"تاريخ الميلاد"},error:{title:"حدث خطأ",generic:"حدث خطأ ما",uploadFailed:"لم نتمكن من تحميل معلوماتك",checkInternet:"يرجى التأكد من وجود اتصال إنترنت مستقر. ثم حاول مرة أخرى!",tryAgain:"أعد المحاولة",countryNotSupported:"{{country}} غير مدعوم"},validation:{isRequired:"{{field}} مطلوب",invalidFormat:"{{field}} غير صالح"}}},f4={direction:"ltr",common:{back:"Back",close:"Close",closeVerificationFrame:"Close Smile ID Verification",allow:"Allow",cancel:"Cancel",continue:"Continue",or:"or",toggle:"Toggle"},combobox:{noItems:"No items"},navigation:{back:"Back",closeVerificationFrame:"Close Smile ID Verification"},camera:{permission:{description:"Allow camera access to verify your details",requestButton:"Request Camera Access"},error:{notAllowed:"Camera access not granted or blocked by a browser/extensions. Enable access in your browser/extension to continue. You may need to refresh.",abort:"Something happened, and we lost access to your camera. Please refresh.",notReadable:"There seems to be a problem with your camera connection. Please check and try again or try using device.",notFound:"We are unable to find your camera. Please refresh.",insecure:"Secure connection required. Camera access is disabled on insecure sites. Please switch to the secure page or contact the app owner."}},selfie:{instructions:{title:"Next, we'll take a quick selfie",allowButton:"Allow",tips:{goodLight:{header:"Good Light",body:"Make sure you are in a well-lit environment."},clearImage:{header:"Clear Image",body:"Hold your device steady so the selfie is clear and sharp."},removeObstructions:{header:"Remove Obstructions",body:"Remove anything that covers your face, such as glasses, masks, and hats."},wideSmile:{header:"Wide Smile",body:"When asked to smile, give a wide smile, showing your teeth."}}},capture:{tip:{fitHead:"Fit your head inside the oval frame"},cta:{smile:"SMILE",widerSmile:"WIDER SMILE"},button:{takeSelfie:"Capture Selfie",startCapture:"Start Capture"},agentMode:{on:"Agent Mode On",off:"Agent Mode Off"},error:{minFrames:"SmartCameraWeb: The minimum no of frames required is {{count}}",webcamCapture:"Unable to capture webcam images - Please try another device"},loading:{progress:"Loading... {{progress}}%",slowConnection:"Internet is too slow, wait a little more...",connectionError:"Internet connection error, check your connection and retry"}},smart:{alert:{multipleFaces:"Ensure only one face is visible",noFace:"Position your face in the oval",outOfBounds:"Position your face in the oval",tooClose:"Move farther away",tooFar:"Move closer",neutralExpression:"Neutral expression",smileRequired:"Smile!",openMouthSmile:"Wider smile - teeth visible",initializing:"Initialising..."},status:{capturing:"Capturing...",keepSmiling:"Keep smiling!",readyToCapture:"Ready to capture"}},review:{title:"Review Selfie",question:"Is your whole face clear?",acceptButton:"Yes, use this",retakeButton:"No, Retake Selfie"}},document:{name:{default:"Document"},title:{front:"Submit Front of ID",back:"Submit Back of ID"},capture:{checkingPermissions:"Checking permissions...",instructionText:"Make sure all corners are visible and there is no glare.",captureButton:"Capture Document"},instructions:{description:"We'll use it to verify your identity.",followInstructions:"Please follow the instructions below.",goodLight:{header:"Good Light",body:"Make sure the image is taken in a well-lit environment where the ID document is easy to read."},clearImage:{header:"Clear Image",body:"Hold your device steady so the information on the ID are not blurry."},takePhotoButton:"Take Photo",uploadPhotoButton:"Upload Photo"},review:{question:"Is the document clear and readable?",description:"Make sure all corners of the document are visible and there is no glare",acceptButton:"Yes, my ID is readable",retakeButton:"No, retake photo"}},fileUpload:{error:{readingFile:"An error occurred reading the file. Please check the file, and try again",multipleFiles:"Only one file upload is permitted at a time",unsupportedFormat:"Unsupported file format. Please ensure that you are providing a JPG or PNG image",fileTooLarge:"{{filename}} is too large. Please ensure that the file is less than {{size}}."}},consent:{demoTip:"This consent screen is for illustrative purposes only. Demo App does not collect personal ID data.",accessRequest:"{{partnerName}} wants to access your {{idTypeLabel}} information",allowPartner:"This will allow {{partnerName}} to:",processing:{personalDetails:{title:"Process your personal information",description:"Partner can process your names, DoB and gender"},contactInfo:{title:"Process your contact information",description:"Partner can process your phone numbers and address"},documentInfo:{title:"Process your document information",description:"Partner can process your photo, ID expiration date, country of issuance and document number"}},privacyPolicy:"You can view {{partnerName}}'s privacy policy",privacyPolicyLink:"here.",grantConsent:'By choosing "Allow", you grant {{partnerName}} consent to process your personal data to offer you this service',denied:{title:"Consent Denied",message:"We cannot verify you without your consent",prompt:"Wish to correct that?",goBack:"Go Back",confirmCancel:"No, Cancel Verification"}},pages:{loading:{title:"Setting up",subtitle:"Just a few more seconds",description:"We are setting up your verification flow"},idSelection:{title:"Select ID Type",selectCountry:"Select Country",selectIdType:"Select ID Type",selectDocument:"Select Document",searchCountry:"Search Country",placeholder:"--Please Select--",selectCountryFirst:"--Select Country First--",noCountryFound:"No country found",noIdTypeFound:"No ID type found"},upload:{title:"Uploading",subtitle:"Just a few more seconds",description:"We are processing your request"},complete:{title:"Submission Complete",subtitle:"That's all you need to verify your identity",processingInfo:"We will process your {{country}} - {{idType}} information to verify your identity"},smartSelfie:{authentication:{title:"SmartSelfie™ Authentication",upload:"Authenticating User"},registration:{title:"SmartSelfie™ Registration",upload:"Registering User"}},eSignature:{fullName:"Full Name",loading:{description:"We are setting up"},upload:{description:"We are processing your request"},entry:{title:"Provide Signature",subtitle:"Read and accept the agreements you would see in the next page"},tips:{read:{title:"Read document",description:"Read the document(s) provided carefully"},name:{title:"Add your full names",description:"Type your full names once you agree with the document(s) shared with you"},signature:{title:"Append your signature",description:"Sign or upload your signature to certify the documents"}},getStarted:"Get started",review:{title:"Review documents",subtitle:"Before accepting, carefully read through the document(s)",consent:"By ticking this checkbox, you agree to the conditions in the document(s)"},personalInfo:{title:"Add your full names",subtitle:"Kindly add your full names to verify that you read the document(s) provided earlier.",placeholder:"James Doe"},signature:{title:"Add your signature",subtitle:"Sign or upload your signature below"},confirmDetails:{title:"Confirm details",subtitle:"Make sure your name is correctly spelled, and the signature matches the one on your ID",yes:"Yes, it's correct",no:"No, change them"},error:{uploadFailed:"We could not upload your signature"}},idInfo:{title:"Enter ID Information",idNumber:"ID Number",firstName:"First Name",lastName:"Last Name",dateOfBirth:"Date of Birth",day:"Day",month:"Month",year:"Year",bank:"Bank",selectBank:"--Select Bank--",searchBank:"Search Bank",noBankFound:"No bank found",citizenship:"Citizenship",selectCitizenship:"Select Citizenship Type",dob:"Date of Birth"},error:{title:"An error occurred",generic:"Something went wrong",uploadFailed:"We could not upload your information",checkInternet:"Please check that you have a stable internet connection. Then try again!",tryAgain:"Try again",countryNotSupported:"{{country}} is not supported"},validation:{isRequired:"{{field}} is required",invalidFormat:"{{field}} is invalid"}}},p4={direction:"ltr",common:{back:"Retour",close:"Fermer",closeVerificationFrame:"Fermer la vérification Smile ID",allow:"Autoriser",cancel:"Annuler",continue:"Continuer",or:"ou",toggle:"Basculer"},combobox:{noItems:"Aucun article"},navigation:{back:"Retour",closeVerificationFrame:"Fermer la vérification d'identité Smile ID"},camera:{permission:{description:"Autorisez l'accès à la caméra pour vérifier vos informations.",requestButton:"Demander l'accès à la caméra"},error:{notAllowed:"L'accès à la caméra est refusé ou bloqué par votre navigateur/vos extensions. Pour continuer, autorisez l'accès dans votre navigateur/vos extensions. Il se peut que vous deviez actualiser la page.",abort:"Un problème est survenu et nous avons perdu l'accès à votre caméra. Veuillez actualiser.",notReadable:"Il semble y avoir un problème avec la connexion de votre caméra. Veuillez vérifier et réessayer, ou essayez d'utiliser un autre appareil.",notFound:"Nous ne parvenons pas à trouver votre caméra. Veuillez actualiser.",insecure:"Connexion sécurisée requise. L'accès à la caméra est désactivé sur les sites non sécurisés. Veuillez vous rendre sur la page sécurisée ou contacter le propriétaire de l'application."}},selfie:{instructions:{title:"Ensuite, nous allons prendre un selfie rapide",allowButton:"Autoriser",tips:{goodLight:{header:"Bonne lumière",body:"Assurez-vous d'être dans un environnement bien éclairé."},clearImage:{header:"Image Claire",body:"Tenez votre téléphone stable pour que le selfie soit net et clair."},removeObstructions:{header:"Retirer les Obstructions",body:"Retirez tout ce qui vous couvre le visage, comme les lunettes, masques et chapeaux."},wideSmile:{header:"large sourire",body:"Lorsque l'on vous demande de sourire, faites un large sourire, en montrant vos dents."}}},capture:{tip:{fitHead:"Placez votre visage dans le cadre ovale"},cta:{smile:"SOURIRE",widerSmile:"UN SOURIRE PLUS LARGE"},button:{takeSelfie:"Prendre un selfie",startCapture:"Démarrer la capture"},agentMode:{on:"Mode Agent Activé",off:"Mode Agent Désactivé"},error:{minFrames:"SmartCameraWeb : Le nombre minimum d'images requis est de {{count}}",webcamCapture:"Impossible de capturer les images de la webcam - Veuillez essayer un autre appareil"},loading:{progress:"Chargement... {{progress}}%",slowConnection:"La connexion Internet est trop lente, veuillez patienter...",connectionError:"Erreur de connexion Internet, vérifiez votre connexion et réessayez"}},smart:{alert:{multipleFaces:"Assurez-vous qu'un seul visage soit visible",noFace:"Positionnez votre visage dans l'ovale",outOfBounds:"Positionnez votre visage dans l'ovale",tooClose:"Éloignez-vous",tooFar:"Rapprochez-vous",neutralExpression:"Expression neutre",smileRequired:"Souriez !",openMouthSmile:"Sourire plus large - dents visibles",initializing:"Initialisation en cours..."},status:{capturing:"Capture en cours...",keepSmiling:"Continuez de sourire!",readyToCapture:"Prêt à enregistrer"}},review:{title:"Vérification du selfie",question:"Votre visage est-il entièrement net ?",acceptButton:"Oui, utiliser ceci",retakeButton:"Non, refaire le selfie"}},document:{name:{default:"Document"},title:{front:"Soumettre le recto de la pièce d'identité",back:"Soumettre le verso de la pièce d'identité"},capture:{checkingPermissions:"Vérification des autorisations...",instructionText:"Assurez-vous que tous les coins sont visibles et qu'il n'y a pas de reflet.",captureButton:"Capturez le document"},instructions:{description:"Nous l'utiliserons pour vérifier votre identité.",followInstructions:"Veuillez suivre les instructions ci-dessous.",goodLight:{header:"Bonne lumière",body:"Assurez-vous que l'image est prise dans un environnement bien éclairé où le document d'identité est facile à lire."},clearImage:{header:"Image Claire",body:"Tenez votre appareil photo fermement pour que les mots sur la pièce d'identité ne soient pas flous."},takePhotoButton:"Prendre une photo",uploadPhotoButton:"Télécharger une photo"},review:{question:"Le document est-il clair et lisible ?",description:"Assurez-vous que tous les coins du document sont visibles et qu'il n'y a pas de reflet.",acceptButton:"Oui, ma pièce d'identité est lisible",retakeButton:"Non, reprendre la photo"}},fileUpload:{error:{readingFile:"Une erreur s'est produite lors de la lecture du fichier. Veuillez vérifier le fichier et réessayer.",multipleFiles:"Seulement un téléchargement de fichier est autorisé à la fois",unsupportedFormat:"Format de fichier non pris en charge. Veuillez vous assurer que vous fournissez une image JPG ou PNG",fileTooLarge:"{{filename}} est trop volumineux. Veuillez vous assurer que la taille du fichier est inférieure à {{size}}."}},consent:{demoTip:"Cet écran de consentement est présenté à titre indicatif uniquement. L'application de démonstration ne collecte pas de données d'identification personnelle.",accessRequest:"{{partnerName}} veut accéder à vos informations {{idTypeLabel}}",allowPartner:"Ceci permettra à {{partnerName}} de :",processing:{personalDetails:{title:"Traiter vos informations personnelles",description:"Le partenaire peut traiter votre nom, date de naissance et sexe"},contactInfo:{title:"Traiter vos coordonnées",description:"Le partenaire peut traiter vos numéros de téléphone et votre adresse"},documentInfo:{title:"Traitez les informations de votre document",description:"Le partenaire peut traiter votre photo, la date d'expiration de votre pièce d'identité, le pays d'émission et le numéro de document"}},privacyPolicy:"Vous pouvez consulter la politique de confidentialité de {{partnerName}}",privacyPolicyLink:"ici.",grantConsent:'En choisissant "Autoriser", vous accordez à {{partnerName}} le consentement de traiter vos données personnelles pour permettre ce service',denied:{title:"Consentement refusé",message:"Nous ne pouvons pas vous vérifier sans votre consentement",prompt:"Souhaitez-vous corriger cela?",goBack:"Retour",confirmCancel:"Non, Annuler la vérification"}},pages:{loading:{title:"Configuration",subtitle:"Juste quelques secondes de plus",description:"Nous mettons en place votre processus de vérification"},idSelection:{title:"Sélectionner le type de pièce d'identité",selectCountry:"Sélectionnez le pays",selectIdType:"Sélectionnez le type de pièce d'identité",selectDocument:"Sélectionner le document",searchCountry:"Rechercher un pays",placeholder:"--Veuillez sélectionner--",selectCountryFirst:"--Sélectionnez le pays d'abord--",noCountryFound:"Aucun pays trouvé",noIdTypeFound:"Aucun type de pièce d'identité trouvé"},upload:{title:"Téléchargement en cours",subtitle:"Plus que quelques secondes",description:"Nous traitons votre demande"},complete:{title:"Envoie terminée",subtitle:"C'est tout ce dont vous avez besoin pour vérifier votre identité.",processingInfo:"Nous traiterons vos informations {{country}} - {{idType}} pour vérifier votre identité"},smartSelfie:{authentication:{title:"Authentification SmartSelfie™",upload:"Authentification de l'utilisateur"},registration:{title:"Inscription SmartSelfie™",upload:"Inscription de l'utilisateur"}},eSignature:{fullName:"Nom complet",loading:{description:"Nous mettons en place"},upload:{description:"Nous traitons votre demande"},entry:{title:"Fournir une signature",subtitle:"Lisez et acceptez les accords que vous verrez à la page suivante"},tips:{read:{title:"Lire le document",description:"Lisez attentivement le(s) document(s) fourni(s)"},name:{title:"Ajouter votre nom complet",description:"Tapez votre nom complet une fois que vous êtes d'accord avec le(s) document(s) partagé(s) avec vous"},signature:{title:"Ajouter votre signature",description:"Signez ou téléchargez votre signature pour certifier les documents"}},getStarted:"Commencer",review:{title:"Examiner les documents",subtitle:"Veuillez lire attentivement le(s) document(s) avant d'accepter.",consent:"En cochant cette case, vous acceptez les conditions contenues dans le(s) document(s)"},personalInfo:{title:"Ajoutez votre nom complet",subtitle:"Veuillez ajouter votre nom complet pour confirmer que vous avez lu le(s) document(s) fourni(s) précédemment.",placeholder:"James Doe"},signature:{title:"Ajoutez votre signature",subtitle:"Signez ou téléchargez votre signature ci-dessous"},confirmDetails:{title:"Confirmer les détails",subtitle:"Assurez-vous que votre nom est correctement orthographié et que la signature ressemble à celle de votre pièce d'identité",yes:"Oui, c'est exact",no:"Non, les changer"},error:{uploadFailed:"Nous n'avons pas pu télécharger votre signature"}},idInfo:{title:"Saisir les informations d'identité",idNumber:"Numéro d'identification",firstName:"Prénom",lastName:"Nom de famille",dateOfBirth:"Date de Naissance",day:"Jour",month:"Mois",year:"Année",bank:"Banque",selectBank:"--Sélectionner la banque--",searchBank:"Rechercher une banque",noBankFound:"Aucune banque trouvée",citizenship:"Citoyenneté",selectCitizenship:"Sélectionner le type de citoyenneté",dob:"Date de naissance"},error:{title:"Une erreur est survenue",generic:"Quelque chose s'est mal passé",uploadFailed:"Nous n'avons pas pu télécharger vos informations",checkInternet:"Veuillez vérifier que vous disposez d'une connexion Internet stable. Ensuite, veuillez réessayer !",tryAgain:"Essayez à nouveau",countryNotSupported:"{{country}} n'est pas pris en charge"},validation:{isRequired:"{{field}} est obligatoire",invalidFormat:"{{field}} n'est pas valide"}}},gu={ar:"ar-EG",en:"en-GB",fr:"fr-FR"};function dr(e){return gu[e]||e}const St="en-GB",m4=5e3;let lt=St;const Ee={"ar-EG":h4,"en-GB":f4,"fr-FR":p4};function Wr(e,t){Ee[e]=t}function vu(e,t){return!t||typeof t!="object"?e:!e||typeof e!="object"?t:d4({},e,t)}const bu=["direction","common.back","common.close","common.continue","common.cancel","camera.permission.description","camera.permission.requestButton","camera.error.notAllowed","selfie.instructions.title","selfie.capture.button.takeSelfie","selfie.review.title","selfie.review.acceptButton","selfie.review.retakeButton","document.capture.captureButton","document.review.acceptButton","document.review.retakeButton"];function g4(i){return S(this,arguments,function*(e,t=m4){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return yield fetch(e,{signal:r.signal})}finally{clearTimeout(n)}})}function yu(e,t){return S(this,null,function*(){try{const i=yield g4(t);if(!i.ok)throw new Error(`Failed to load locale from ${t}: ${i.status}`);const r=yield i.json();return Wr(e,r),r}catch(i){const r=i.name==="AbortError"?`Timeout loading locale '${e}' from ${t}`:`Error loading locale '${e}' from ${t}: ${i.message}`;if(console.error(r),e!==St&&Ee[St])return console.warn(`Falling back to default locale '${St}'`),Ee[St];throw i}})}function _u(e,t){return S(this,null,function*(){const i=dr(e);return Ee[i]?Ee[i]:t?yu(e,t):(console.warn(`Locale '${e}' not found and no URL provided, using default '${St}'`),Ee[St]||{})})}function Ws(e,t){if(!e)return;const i=t.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},e);return typeof i=="string"?i:void 0}function wu(e){if(!e||typeof e!="object")return{missingKeys:bu,valid:!1};const t=bu.filter(i=>i==="direction"?!e.direction:!Ws(e,i));return{missingKeys:t,valid:t.length===0}}function y(e){const t=dr(lt),i=Ee[t],r=Ws(i,e);if(r)return r;const n=dr(St);if(t!==n){const o=Ws(Ee[n],e);if(o)return o}return console.warn(`Translation key '${e}' not found in any locale`),e}const Xs=y,v4={'"':""","&":"&","'":"'","<":"<",">":">"};function hr(e){return e.replace(/[&<>"']/g,t=>v4[t])}function Nt(e,t={}){let i=y(e);return Object.keys(t).forEach(r=>{const n=t[r],o=`{{${r}}}`;if(n&&typeof n=="object"&&"value"in n){const s=hr(String(n.value||"")),a=hr(String(n.className||""));i=i.split(o).join(a?`<span class="${a}">${s}</span>`:s)}else i=i.split(o).join(hr(String(n)))}),i}const Cu=Nt;function b4(o){return S(this,arguments,function*(e,{url:t,translation:i,locales:r,validate:n=!1}={}){if(lt=dr(e),r&&typeof r=="object"&&Object.entries(r).forEach(([a,c])=>{if(!c||typeof c!="object")return;const l=dr(a);Ee[l]?Ee[l]=vu(Ee[l],c):(Wr(l,c),a!==l&&(gu[a]=l))}),!Ee[lt])if(i)Wr(lt,i);else if(t)try{yield _u(lt,t)}catch(a){return console.error(`Failed to load locale '${e}', keeping current locale '${lt}'`),!1}else return console.warn(`Locale '${e}' not registered and no URL provided`),!1;if(n&&Ee[lt]){const a=wu(Ee[lt]);a.valid||console.warn(`Locale '${e}' is missing required keys:`,a.missingKeys)}const s=Ee[lt];return s&&s.direction&&(document!=null&&document.documentElement)&&(document.documentElement.dir=s.direction),!0})}function y4(){return lt}function _4(){return St}function w4(e){return e in Ee}function C4(e){const t=Ee[e];t&&t.direction&&(document.documentElement.dir=t.direction)}function ut(){const e=Ee[lt];return(e==null?void 0:e.direction)||"ltr"}function Eu(e){const t=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${e}-${t}`}function E4(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function x4(e){return e&&e.clientHeight<e.scrollHeight}function k4(e,t){const{offsetHeight:i,offsetTop:r}=e,{offsetHeight:n,scrollTop:o}=t,s=r<o,a=r+i>o+n;s?t.scrollTo(0,r):a&&t.scrollTo(0,r-n+i)}class A4 extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(t){const i=t.relatedTarget||t.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class S4 extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
|
|
2
2
|
<div>
|
|
3
3
|
<input ${this.value?`value="${this.value}" `:""}${this.disabled?" disabled ":""}type="text" placeholder="${this.label}" />
|
|
4
4
|
<button ${this.disabled?"disabled ":""}tabindex='-1' type='button'>
|
|
5
|
-
<span class="visually-hidden"
|
|
5
|
+
<span class="visually-hidden">${y("common.toggle")}</span>
|
|
6
6
|
</button>
|
|
7
7
|
</div>
|
|
8
|
-
`:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",t=>t.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(t=>{t.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",t=>t.stopPropagation())),this.options&&this.options.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(t){if(t.ctrlKey||t.shiftKey)return;const{key:i}=t;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{t.preventDefault();const
|
|
8
|
+
`:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",t=>t.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(t=>{t.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",t=>t.stopPropagation())),this.options&&this.options.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(t){if(t.ctrlKey||t.shiftKey)return;const{key:i}=t;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{t.preventDefault();const r=this.buttonTrigger.getAttribute("aria-activedescendant");r&&document.getElementById(r).click()}else t.preventDefault(),this.toggleExpansionState();break;case"Esc":case"Escape":t.preventDefault(),this.getAttribute("expanded")==="true"&&this.toggleExpansionState();break;case"Down":case"ArrowDown":t.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("First")):this.focusListbox("Down");break;case"Up":case"ArrowUp":t.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("Last")):this.focusListbox("Up");break;case"Left":case"ArrowLeft":case"Right":case"ArrowRight":case"Home":case"End":this.resetListbox();break}}handleKeyUp(t){const{key:i}=t,r=n=>n.length===1&&n.match(/\S| /);(t.key==="Escape"||t.key==="Esc")&&(t.preventDefault(),this.getAttribute("expanded")==="true"?this.toggleExpansionState():this.inputTrigger&&(this.inputTrigger.value="",this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:""})))),(r(i)||i==="Backspace")&&(this.resetListbox(),this.filterListbox(t.target.value))}toggleExpansionState(){const t=this.getAttribute("expanded")==="true";this.setAttribute("expanded",!t),this.buttonTrigger.setAttribute("aria-expanded",!t),this.inputTrigger&&this.inputTrigger.setAttribute("aria-expanded",!t)}handleSelection(t){this.inputTrigger?this.inputTrigger.value=t.detail.label:this.buttonTrigger.textContent=t.detail.label,this.toggleExpansionState(),this.parentElement.dispatchEvent(new CustomEvent("combobox.change",{detail:{value:t.detail.value}}))}filterListbox(t){this.getAttribute("expanded")!=="true"&&this.toggleExpansionState(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:t}))}focusListbox(t){this.resetListbox(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.focus",{detail:{direction:t}}))}resetListbox(){this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.reset"))}}class L4 extends HTMLElement{constructor(){super(),this.handleFilter=this.handleFilter.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleReset=this.handleReset.bind(this),this.handleOptionSelection=this.handleOptionSelection.bind(this)}get emptyLabel(){return this.getAttribute("empty-label")}get emptyState(){return`
|
|
9
9
|
<p id='empty-state' style="text-align: center;">
|
|
10
|
-
${this.emptyLabel||"
|
|
10
|
+
${this.emptyLabel||y("combobox.noItems")}
|
|
11
11
|
</p>
|
|
12
|
-
`}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",
|
|
12
|
+
`}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",Eu("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(t=>t.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(t=>!t.hasAttribute("hidden")&&t.hasAttribute("aria-selected"))||this.optionNodes.filter(t=>!t.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(t=>{t.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(t,i,r){switch(t){case"search-term":i&&!r?this.optionNodes.forEach(n=>{n.removeAttribute("hidden")}):r&&this.filterNodes(r);break}}filterNodes(t){this.optionNodes.forEach(n=>{const o=n.getAttribute("value").toLowerCase(),s=n.getAttribute("label").toLowerCase();o.includes(t.toLowerCase())||s.includes(t.toLowerCase())?n.removeAttribute("hidden"):n.setAttribute("hidden",!0)});const i=this.optionNodes.find(n=>!n.hasAttribute("hidden")),r=this.querySelector("#empty-state");!i&&!r?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&r&&this.removeChild(r)}handleFilter(t){const i=t.detail;this.setAttribute("search-term",i)}handleFocus(t){this.setSelected(t.detail.direction)}handleReset(){this.optionNodes.forEach(t=>t.setAttribute("tabindex","-1"))}handleOptionSelection(t){this.triggers.filter(r=>r.tagName==="INPUT")[0]&&this.setAttribute("search-term",t.detail.label)}setSelected(t){const i=this.optionNodes.filter(s=>!s.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const r=i.findIndex(s=>s===this.selectedNode),n=i.length-1;let o;switch(t){case"First":o=0;break;case"Last":o=n;break;case"Up":r===0?o=n:o=r-1;break;default:r===n?o=0:o=r+1;break}r!==o&&this.swapSelected(this.selectedNode,i[o])}swapSelected(t,i){t.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,x4(this)&&k4(this.selectedNode,this),E4(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(r=>r.setAttribute("aria-activedescendant",i.id))}}class T4 extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",Eu("option")),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.addEventListener("click",this.select)}disconnectedCallback(){this.removeEventListener("click",this.select)}get value(){return this.getAttribute("value")}get label(){return this.getAttribute("label")}select(){const t=this.options.find(i=>i.getAttribute("aria-selected"));t&&t.removeAttribute("aria-selected"),this.setAttribute("aria-selected",!0),this.dispatchEvent(new CustomEvent("combobox.option.select",{detail:{id:this.getAttribute("id"),label:this.label,value:this.value}}))}}const xu=A4,ku=S4,Au=L4,Su=T4;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",xu),window.customElements.define("smileid-combobox-trigger",ku),window.customElements.define("smileid-combobox-listbox",Au),window.customElements.define("smileid-combobox-option",Su));const Ei={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},Ht=.92,M4=`
|
|
13
13
|
.text-xs {
|
|
14
14
|
font-size: 0.75rem;
|
|
15
15
|
line-height: 1rem;
|
|
@@ -58,14 +58,14 @@ var SmartCameraWeb=function(P){"use strict";var vu=Object.defineProperty,bu=Obje
|
|
|
58
58
|
.font-normal {
|
|
59
59
|
font-weight: 400;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,dt=e=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
62
62
|
<link
|
|
63
63
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"
|
|
64
64
|
rel="stylesheet"
|
|
65
65
|
as="style"
|
|
66
66
|
/>
|
|
67
67
|
<style>
|
|
68
|
-
${
|
|
68
|
+
${M4}
|
|
69
69
|
:host {
|
|
70
70
|
--theme-color: ${e||"#001096"};
|
|
71
71
|
--color-active: #001096;
|
|
@@ -423,28 +423,17 @@ ${Q2}
|
|
|
423
423
|
left: 1.25rem;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
</style>`,
|
|
427
|
-
Looks like camera access was not granted, or was blocked by a browser
|
|
428
|
-
level setting / extension. Please follow the prompt from the URL bar,
|
|
429
|
-
or extensions, and enable access.
|
|
430
|
-
You may need to refresh to start all over again
|
|
431
|
-
`;case"AbortError":return`
|
|
432
|
-
Oops! Something happened, and we lost access to your stream.
|
|
433
|
-
Please refresh to start all over again
|
|
434
|
-
`;case"NotReadableError":return`
|
|
435
|
-
There seems to be a problem with your device's camera, or its connection.
|
|
436
|
-
Please check this, and when resolved, try again. Or try another device.
|
|
437
|
-
`;case"NotFoundError":return`
|
|
438
|
-
We are unable to find a video stream.
|
|
439
|
-
You may need to refresh to start all over again
|
|
440
|
-
`;case"TypeError":return`
|
|
441
|
-
This site is insecure, and as such cannot have access to your camera.
|
|
442
|
-
Try to navigate to a secure version of this page, or contact the owner.
|
|
443
|
-
`;default:return t.message}}};li(wt,"stream",null),li(wt,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:wt.isSamsungMultiCameraDevice()?2:1});let F=wt;class va extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
426
|
+
</style>`,kt=class kt{static getMedia(t){return S(this,null,function*(){return kt.stream=yield navigator.mediaDevices.getUserMedia(t),kt.stream})}static stopMedia(){kt.stream&&(kt.stream.getTracks().forEach(t=>t.stop()),kt.stream=null)}static supportsAgentMode(){return S(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(n=>n.kind==="videoinput");let r=!1;return i.forEach(n=>n.label.toLowerCase().includes("back")||n.label.toLowerCase().includes("rear")?(r=!0,!0):!1),r}catch(t){return console.warn("Error accessing media devices: ",t),!1}})}static isSamsungMultiCameraDevice(){const t=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!t)return!1;const i=parseInt(t[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(t){switch(t.name){case"NotAllowedError":case"SecurityError":return y("camera.error.notAllowed");case"AbortError":return y("camera.error.abort");case"NotReadableError":return y("camera.error.notReadable");case"NotFoundError":return y("camera.error.notFound");case"TypeError":return y("camera.error.insecure");default:return t.message}}};_i(kt,"stream",null),_i(kt,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:kt.isSamsungMultiCameraDevice()?2:1});let $=kt;class Lu extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=ut(),r=document.createElement("style");r.textContent=`
|
|
444
427
|
:host {
|
|
445
428
|
display: flex;
|
|
446
429
|
max-inline-size: 100%;
|
|
447
430
|
justify-content: ${this.showBackButton?"space-between":"flex-end"};
|
|
431
|
+
direction: ${i};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
:host([dir="rtl"]) .back-button svg,
|
|
435
|
+
:host .back-button svg[data-rtl="true"] {
|
|
436
|
+
transform: scaleX(-1);
|
|
448
437
|
}
|
|
449
438
|
|
|
450
439
|
button {
|
|
@@ -510,6 +499,7 @@ button[data-type="icon"] {
|
|
|
510
499
|
height="24"
|
|
511
500
|
viewBox="0 0 24 24"
|
|
512
501
|
fill="none"
|
|
502
|
+
data-rtl="${i==="rtl"}"
|
|
513
503
|
>
|
|
514
504
|
<path
|
|
515
505
|
fill="#DBDBC4"
|
|
@@ -521,8 +511,8 @@ button[data-type="icon"] {
|
|
|
521
511
|
d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"
|
|
522
512
|
/>
|
|
523
513
|
</svg>
|
|
524
|
-
<span part="back-button-text"
|
|
525
|
-
`;const
|
|
514
|
+
<span part="back-button-text">${y("navigation.back")}</span>
|
|
515
|
+
`;const o=document.createElement("button");o.setAttribute("class","close-button"),o.setAttribute("data-type","icon"),o.setAttribute("part","close-button"),o.setAttribute("type","button"),o.innerHTML=`
|
|
526
516
|
<svg
|
|
527
517
|
xmlns="http://www.w3.org/2000/svg"
|
|
528
518
|
viewBox="0 0 24 24"
|
|
@@ -541,9 +531,9 @@ button[data-type="icon"] {
|
|
|
541
531
|
/>
|
|
542
532
|
</svg>
|
|
543
533
|
<span class="visually-hidden"
|
|
544
|
-
|
|
534
|
+
>${y("navigation.closeVerificationFrame")}</span
|
|
545
535
|
>
|
|
546
|
-
`,t.appendChild(
|
|
536
|
+
`,t.appendChild(r),this.showBackButton&&t.appendChild(n),t.appendChild(o),this.setAttribute("dir",i),this.backButton=n,this.backButton.addEventListener("click",()=>this.handleBack()),this.closeButton=o,this.closeButton.addEventListener("click",()=>this.handleClose())}disconnectedCallback(){this.backButton.removeEventListener("click",()=>this.handleBack()),this.closeButton.removeEventListener("click",()=>this.handleClose())}handleBack(){this.dispatchEvent(new CustomEvent("navigation.back"))}handleClose(){this.dispatchEvent(new CustomEvent("navigation.close"))}get showBackButton(){return!this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hasThemeColor(){var t;return(t=this.getAttribute("theme-color"))==null?void 0:t.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",Lu);function I4(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function F4(){return`
|
|
547
537
|
<style>
|
|
548
538
|
.visually-hidden {
|
|
549
539
|
border: 0;
|
|
@@ -575,7 +565,7 @@ button[data-type="icon"] {
|
|
|
575
565
|
overflow: visible;
|
|
576
566
|
margin: 0 auto;
|
|
577
567
|
}
|
|
578
|
-
|
|
568
|
+
|
|
579
569
|
@media (max-width: 600px) {
|
|
580
570
|
.section {
|
|
581
571
|
width: 99%;
|
|
@@ -608,7 +598,7 @@ button[data-type="icon"] {
|
|
|
608
598
|
-webkit-tap-highlight-color: transparent;
|
|
609
599
|
content: normal;
|
|
610
600
|
}
|
|
611
|
-
|
|
601
|
+
|
|
612
602
|
.id-video {
|
|
613
603
|
width: 99%;
|
|
614
604
|
text-align: center;
|
|
@@ -639,7 +629,7 @@ button[data-type="icon"] {
|
|
|
639
629
|
box-sizing: border-box;
|
|
640
630
|
inset: 0px;
|
|
641
631
|
}
|
|
642
|
-
|
|
632
|
+
|
|
643
633
|
.video-overlay .inner-border {
|
|
644
634
|
position: absolute;
|
|
645
635
|
border-width: 0.25rem;
|
|
@@ -655,7 +645,7 @@ button[data-type="icon"] {
|
|
|
655
645
|
border-style: solid;
|
|
656
646
|
border-radius: 0.25rem;
|
|
657
647
|
}
|
|
658
|
-
|
|
648
|
+
|
|
659
649
|
.description {
|
|
660
650
|
align-self: center;
|
|
661
651
|
padding-bottom: 1.75rem;
|
|
@@ -669,7 +659,7 @@ button[data-type="icon"] {
|
|
|
669
659
|
.id-side {
|
|
670
660
|
padding-bottom: 0.5rem;
|
|
671
661
|
}
|
|
672
|
-
|
|
662
|
+
|
|
673
663
|
.circle-progress {
|
|
674
664
|
display: flex;
|
|
675
665
|
flex-direction: column;
|
|
@@ -688,13 +678,13 @@ button[data-type="icon"] {
|
|
|
688
678
|
padding-top: 10px;
|
|
689
679
|
}
|
|
690
680
|
</style>
|
|
691
|
-
${
|
|
692
|
-
<div id='document-capture-screen' class='flow center flex-column'>
|
|
693
|
-
|
|
681
|
+
${dt(this.themeColor)}
|
|
682
|
+
<div id='document-capture-screen' class='flow center flex-column' dir='${this.direction}'>
|
|
683
|
+
${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' show-navigation ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
|
|
694
684
|
<h2 class='text-base font-bold title-color'>${this.documentName}</h2>
|
|
695
685
|
<div class="circle-progress" id="loader">
|
|
696
686
|
${this.cameraError?"":'<p class="spinner"></p>'}
|
|
697
|
-
${this.cameraError?`<p style="--flow-space: 4rem" class='color-red | center'>${this.cameraError}</p
|
|
687
|
+
${this.cameraError?`<p style="--flow-space: 4rem" class='color-red | center'>${this.cameraError}</p>`:`<p style="--flow-space: 4rem">${y("document.capture.checkingPermissions")}</p>`}
|
|
698
688
|
</div>
|
|
699
689
|
<div class='section | flow ${this.isPortraitCaptureView?"portrait":"landscape"}' ${this.cameraError?"hidden":""}>
|
|
700
690
|
<div class='id-video-container'>
|
|
@@ -702,13 +692,13 @@ button[data-type="icon"] {
|
|
|
702
692
|
</div>
|
|
703
693
|
<div class='video-footer sticky'>
|
|
704
694
|
<h2 class='text-base font-bold title-color reset-margin-block id-side'>${this.title}</h2>
|
|
705
|
-
<h4 class='text-base font-normal title-color description reset-margin-block'
|
|
695
|
+
<h4 class='text-base font-normal title-color description reset-margin-block'>${y("document.capture.instructionText")}</h4>
|
|
706
696
|
<div class='actions' hidden>
|
|
707
697
|
<button id='capture-id-image' class='button icon-btn | center' type='button'>
|
|
708
698
|
<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70" fill="none" aria-hidden="true" focusable="false">
|
|
709
699
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M35 70C54.33 70 70 54.33 70 35C70 15.67 54.33 0 35 0C15.67 0 0 15.67 0 35C0 54.33 15.67 70 35 70ZM61 35C61 49.3594 49.3594 61 35 61C20.6406 61 9 49.3594 9 35C9 20.6406 20.6406 9 35 9C49.3594 9 61 20.6406 61 35ZM65 35C65 51.5685 51.5685 65 35 65C18.4315 65 5 51.5685 5 35C5 18.4315 18.4315 5 35 5C51.5685 5 65 18.4315 65 35Z" fill="${this.themeColor}"/>
|
|
710
700
|
</svg>
|
|
711
|
-
<span class='visually-hidden'
|
|
701
|
+
<span class='visually-hidden'>${y("document.capture.captureButton")}</span>
|
|
712
702
|
</button>
|
|
713
703
|
</div>
|
|
714
704
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
@@ -716,7 +706,7 @@ button[data-type="icon"] {
|
|
|
716
706
|
</div>
|
|
717
707
|
</div>
|
|
718
708
|
</div>
|
|
719
|
-
`}const
|
|
709
|
+
`}const xi=.6;class B4 extends HTMLElement{constructor(){super(),this.templateString=F4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return S(this,null,function*(){if(!$.stream&&this.hasAttribute("data-camera-error")){try{yield $.getMedia({audio:!1,video:nr(Re({},$.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(t){console.error(t.constraint),console.error(t.message)}this.handleIDStream($.stream)}})}_captureIDImage(){const t=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Re({},t)}))}_drawIDImage(t=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=t.videoWidth,i.height=i.width*16/9;const c=document.createElement("canvas");c.width=i.width,c.height=i.height,this.updatePortraitId(i,t,1,1),this.updatePortraitId(c,t);const l=i.toDataURL("image/jpeg",Ht),d=c.toDataURL("image/jpeg",Ht);return Re({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:d},this.idCardRegion)}i.width=2240,i.height=1260;const r=i.width/(t.videoWidth/t.videoHeight);i.height=r;const n=document.createElement("canvas");if(n.height=i.height,n.width=i.width,t.videoWidth<t.videoHeight){const c=document.createElement("canvas");n.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(c,t),this._drawLandscapeImageFromCanvas(i,c,1,1),this._drawLandscapeImageFromCanvas(n,c)}else this._drawLandscapeImage(i,t,1,1),this._drawLandscapeImage(n,t);const s=i.toDataURL("image/jpeg",Ht),a=n.toDataURL("image/jpeg",Ht);return Re({image:s,originalHeight:i.height,originalWidth:i.width,previewImage:a},this.idCardRegion)}_drawImage(t,i=!0,r=$.stream){this.resetErrorMessage();const n=t.getContext("2d");if(n.drawImage(r,0,0,r.videoWidth,r.videoHeight,0,0,t.width,t.height),i){const o=n.getImageData(0,0,t.width,t.height);if(I4(o.data))return n;throw new Error("Unable to capture webcam images - Please try another device")}else return n}handleIDStream(t){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let r=null,n=null;r=document.createElement("video"),n=document.createElement("canvas");const o=this.shadowRoot.querySelector(".id-video-container");r.muted=!0,r.setAttribute("muted","true"),r.autoplay=!0,r.playsInline=!0,"srcObject"in r?r.srcObject=t:r.src=window.URL.createObjectURL(t),n.width=o.clientWidth,n.height=o.clientWidth*9/16,this.isPortraitCaptureView&&(n.height=o.clientWidth*16/9),r.onloadedmetadata=()=>{r.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||o.prepend(n)};const s=()=>{if(r.paused||r.ended)return;r.removeEventListener("playing",s);const c=r.videoWidth/r.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(n,r),requestAnimationFrame(s);return}if(c){o.classList.add("mobile-camera-screen");const l=document.createElement("canvas");this._capturePortraitToLandscapeImage(l,r),this._drawLandscapeImageFromCanvas(n,l)}else this._drawLandscapeImage(n,r);requestAnimationFrame(s)};r.addEventListener("playing",s),this._IDStream=t,this._IDVideo=r}catch(i){this.setAttribute("data-camera-error",$.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),$.stopMedia()}}_drawLandscapeImage(t,i=this._IDVideo,r=xi,n=xi){const o=this.height?this.height/i.videoHeight:r,s=this.width?this.width/i.videoWidth:n,a=(1-r)/2,c=(1-n)/2,l=i.videoWidth*s,d=i.videoHeight*o,u=i.videoWidth*c,h=i.videoHeight*a;t.getContext("2d").drawImage(i,u,h,l,d,0,0,t.width,t.height)}_capturePortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:r,videoWidth:n}=i,o=n,s=n*9/16,a=0,c=(r-s)/2;t.width=o,t.height=s,t.getContext("2d").drawImage(i,a,c,o,s,0,0,t.width,t.height)}_drawLandscapeImageFromCanvas(t,i,r=xi,n=xi){const o=this.height?this.height/i.height:r,s=this.width?this.width/i.width:n,a=(1-r)/2,c=(1-n)/2,l=i.width*s,d=i.height*o,u=i.width*c,h=i.height*a;t.getContext("2d").drawImage(i,u,h,l,d,0,0,t.width,t.height)}_drawPortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:r,videoWidth:n}=i,o=600,s=400;t.width=o,t.height=s;const a=(n-o)/2,c=(r-s)/2;t.getContext("2d").drawImage(i,a,c,o,s,0,0,t.width,t.height)}updatePortraitId(t,i=this._IDVideo,r=xi,n=xi){const{videoWidth:o,videoHeight:s}=i;if(o&&s){const a=document.createElement("canvas"),c=9/16;let l,d,u,h;o/s>c?(d=s,l=d*c,u=(o-l)/2,h=0):(l=o,d=l,u=0,h=0),a.height=d,a.width=l,a.getContext("2d").drawImage(i,u,h,l,d,0,0,a.width,a.height);const f=this.height?this.height/l:r,p=this.width?this.width/d:n,m=(1-r)/2,v=(1-n)/2,g=l*p,b=d*f,_=l*v,M=d*m;t.getContext("2d").drawImage(a,_,M,g,b,0,0,t.width,t.height)}}_stopIDVideoStream(t=this._IDStream){t.getTracks().forEach(i=>i.stop())}setUpEventListeners(){var t,i;this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),$.stream&&this.handleIDStream($.stream),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.captureIDImage.addEventListener("click",()=>{this._captureIDImage()}),this.getUserMedia()}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||`${this.IdSides[this.sideOfId]} of ${this.documentName}`}get height(){return this.getAttribute("height")}get width(){return this.getAttribute("width")}get hidden(){return this.getAttribute("hidden")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get documentType(){return this.getAttribute("document-type")||""}get documentName(){return this.getAttribute("document-name")||y("document.name.default")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get cameraError(){return this.getAttribute("data-camera-error")}static get observedAttributes(){return["data-camera-error","data-camera-ready","document-name","document-type","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"data-camera-ready":case"document-name":case"document-type":case"hidden":case"title":this.connectedCallback();break}}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture.cancelled")),$.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),$.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",B4);function D4(){return`
|
|
720
710
|
<style>
|
|
721
711
|
.retake-photo.button[data-variant~="ghost"] {
|
|
722
712
|
color: #FF5805;
|
|
@@ -931,14 +921,13 @@ button[data-type="icon"] {
|
|
|
931
921
|
line-height: 1.5rem;
|
|
932
922
|
}
|
|
933
923
|
</style>
|
|
934
|
-
${
|
|
935
|
-
<div id='document-capture-review-screen' class='flow center'>
|
|
936
|
-
|
|
924
|
+
${dt(this.themeColor)}
|
|
925
|
+
<div id='document-capture-review-screen' class='flow center' dir='${this.direction}'>
|
|
926
|
+
${this.showNavigation?"<smileid-navigation show-navigation hide-back></smileid-navigation>":""}
|
|
937
927
|
<h1 class="header-title title-color">
|
|
938
|
-
|
|
928
|
+
${y("document.review.question")}
|
|
939
929
|
</h1>
|
|
940
|
-
<p class="description">
|
|
941
|
-
are visible and there is no glare</p>
|
|
930
|
+
<p class="description">${y("document.review.description")}</p>
|
|
942
931
|
<div class='section | flow'>
|
|
943
932
|
<div class='id-image-container'>
|
|
944
933
|
<div class='id-image'>
|
|
@@ -947,10 +936,10 @@ button[data-type="icon"] {
|
|
|
947
936
|
</div>
|
|
948
937
|
<div class='flow action-buttons'>
|
|
949
938
|
<button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
|
|
950
|
-
|
|
939
|
+
${y("document.review.acceptButton")}
|
|
951
940
|
</button>
|
|
952
941
|
<button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-id-image'>
|
|
953
|
-
|
|
942
|
+
${y("document.review.retakeButton")}
|
|
954
943
|
</button>
|
|
955
944
|
</div>
|
|
956
945
|
</div>
|
|
@@ -960,7 +949,7 @@ button[data-type="icon"] {
|
|
|
960
949
|
`}
|
|
961
950
|
</div>
|
|
962
951
|
</div>
|
|
963
|
-
`}class
|
|
952
|
+
`}class R4 extends HTMLElement{constructor(){super(),this.templateString=D4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get title(){return this.getAttribute("title")||y("document.title.front")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){var t,i;this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",R4);let O4=(ct=class{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),n=t/dl(1024,r);return r===0?`${t} bytes`:`${n.toFixed(0)} ${i[r]}`}static getData(t){return new Promise((i,r)=>{const n=new FileReader;n.onload=o=>{i(o.target.result)},n.onerror=()=>{r(new Error(y("fileUpload.error.readingFile")))},n.readAsDataURL(t)})}static retrieve(t){return S(this,null,function*(){if(t.length>1)throw new Error(y("fileUpload.error.multipleFiles"));const i=t[0];if(!ct.supportedTypes.includes(i.type))throw new Error(y("fileUpload.error.unsupportedFormat"));if(i.size>ct.memoryLimit)throw new Error(Nt("fileUpload.error.fileTooLarge",{filename:i.name,size:ct.getHumanSize(ct.memoryLimit)}));return yield ct.getData(i)})}},_i(ct,"memoryLimit",1024e4),_i(ct,"supportedTypes",["image/jpeg","image/png"]),ct);function P4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
|
|
964
953
|
<path d="M15.3799 21.2759C15.3799 16.8576 18.9616 13.2759 23.3799 13.2759H64.2764C68.6947 13.2759 72.2764 16.8576 72.2764 21.2759V73.5517C72.2764 77.97 68.6947 81.5517 64.2764 81.5517H23.3799C18.9616 81.5517 15.3799 77.97 15.3799 73.5517V21.2759Z" fill="#F6C969"/>
|
|
965
954
|
<g filter="url(#filter0_d_1281_4127)">
|
|
966
955
|
<path d="M60.2117 80.8741C60.2117 80.8741 49.3661 81.5134 44.1952 81.5134C39.0242 81.5134 28.1787 80.8741 28.1787 80.8741C28.1787 80.8741 34.6256 78.4515 35.3307 76.8701C35.7001 76.0962 35.8344 73.2362 35.9015 70.578C35.9687 67.9199 35.9015 65.5646 35.9015 65.5646L44.1952 65.6992L52.4888 65.5646C52.4888 65.5646 52.3881 72.0921 52.7575 75.3223C52.7813 75.8503 52.8832 76.372 53.0597 76.8701C53.7984 78.4515 60.2117 80.8741 60.2117 80.8741Z" fill="url(#paint0_linear_1281_4127)"/>
|
|
@@ -1068,7 +1057,7 @@ button[data-type="icon"] {
|
|
|
1068
1057
|
<stop offset="0.71" stop-color="#FF766A"/>
|
|
1069
1058
|
</linearGradient>
|
|
1070
1059
|
</defs>
|
|
1071
|
-
</svg>`}function
|
|
1060
|
+
</svg>`}function $4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
|
|
1072
1061
|
<path d="M143 68C143 65.7909 144.791 64 147 64H164C166.209 64 168 65.7909 168 68V89C168 91.2091 166.209 93 164 93H147C144.791 93 143 91.2091 143 89V68Z" fill="#F6C969"/>
|
|
1073
1062
|
<g filter="url(#filter0_d_1281_4284)">
|
|
1074
1063
|
<mask id="path-2-inside-1_1281_4284" fill="white">
|
|
@@ -1103,7 +1092,7 @@ button[data-type="icon"] {
|
|
|
1103
1092
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4284" result="shape"/>
|
|
1104
1093
|
</filter>
|
|
1105
1094
|
</defs>
|
|
1106
|
-
</svg>`}function
|
|
1095
|
+
</svg>`}function N4(){return`
|
|
1107
1096
|
<style>
|
|
1108
1097
|
h1 {
|
|
1109
1098
|
font-size: 1.25rem;
|
|
@@ -1140,20 +1129,20 @@ button[data-type="icon"] {
|
|
|
1140
1129
|
margin-top: 1rem;
|
|
1141
1130
|
}
|
|
1142
1131
|
</style>
|
|
1143
|
-
<div id="document-capture-instructions-screen" class="flow center">
|
|
1132
|
+
<div id="document-capture-instructions-screen" class="flow center" dir="${this.direction}">
|
|
1144
1133
|
<div class="content-root">
|
|
1145
1134
|
<div class="content-header">
|
|
1146
|
-
|
|
1135
|
+
${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' show-navigation ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
|
|
1147
1136
|
</div>
|
|
1148
1137
|
<div class="content-body">
|
|
1149
1138
|
<header>
|
|
1150
|
-
${this.isFrontOfId?
|
|
1151
|
-
<h1 class='title-color font-bold'>${this.title}</h1>
|
|
1139
|
+
${this.isFrontOfId?P4():$4()}
|
|
1140
|
+
<h1 class='title-color font-bold'>${hr(this.title)}</h1>
|
|
1152
1141
|
<p class="description text-sm font-normal">
|
|
1153
|
-
|
|
1142
|
+
${y("document.instructions.description")}
|
|
1154
1143
|
</p>
|
|
1155
1144
|
<p class="description padding-bottom-2">
|
|
1156
|
-
|
|
1145
|
+
${y("document.instructions.followInstructions")}
|
|
1157
1146
|
</p>
|
|
1158
1147
|
</header>
|
|
1159
1148
|
<div class="instructions-wrapper">
|
|
@@ -1233,9 +1222,9 @@ button[data-type="icon"] {
|
|
|
1233
1222
|
</defs>
|
|
1234
1223
|
</svg>
|
|
1235
1224
|
<div class="instruction">
|
|
1236
|
-
<p class="instruction-header font-bold text-base"
|
|
1225
|
+
<p class="instruction-header font-bold text-base">${y("document.instructions.goodLight.header")}</p>
|
|
1237
1226
|
<p class="instruction-body text-xs font-medium">
|
|
1238
|
-
|
|
1227
|
+
${y("document.instructions.goodLight.body")}
|
|
1239
1228
|
</p>
|
|
1240
1229
|
</div>
|
|
1241
1230
|
</div>
|
|
@@ -1321,9 +1310,9 @@ button[data-type="icon"] {
|
|
|
1321
1310
|
</defs>
|
|
1322
1311
|
</svg>
|
|
1323
1312
|
<div>
|
|
1324
|
-
<p class="instruction-header font-bold text-base"
|
|
1313
|
+
<p class="instruction-header font-bold text-base">${y("document.instructions.clearImage.header")}</p>
|
|
1325
1314
|
<p class="instruction-body text-xs font-medium">
|
|
1326
|
-
|
|
1315
|
+
${y("document.instructions.clearImage.body")}
|
|
1327
1316
|
</p>
|
|
1328
1317
|
</div>
|
|
1329
1318
|
</div>
|
|
@@ -1333,13 +1322,13 @@ button[data-type="icon"] {
|
|
|
1333
1322
|
<div class='controls'>
|
|
1334
1323
|
${this.supportBothCaptureModes||this.documentCaptureModes==="camera"?`
|
|
1335
1324
|
<button data-variant='solid full-width' class='button' type='button' id='take-photo'>
|
|
1336
|
-
|
|
1325
|
+
${y("document.instructions.takePhotoButton")}
|
|
1337
1326
|
</button>
|
|
1338
1327
|
`:""}
|
|
1339
1328
|
${this.supportBothCaptureModes||this.documentCaptureModes==="upload"?`
|
|
1340
1329
|
<label id='upload-photo-label' data-variant='${this.supportBothCaptureModes?"outline":"solid"}' class='button'>
|
|
1341
1330
|
<input type='file' hidden onclick='this.value=null;' id='upload-photo' name='document' accept='image/png, image/jpeg' />
|
|
1342
|
-
<span
|
|
1331
|
+
<span>${y("document.instructions.uploadPhotoButton")}</span>
|
|
1343
1332
|
</label>
|
|
1344
1333
|
`:""}
|
|
1345
1334
|
</div>
|
|
@@ -1351,29 +1340,29 @@ ${this.hideAttribution?"":`
|
|
|
1351
1340
|
</div>
|
|
1352
1341
|
</div>
|
|
1353
1342
|
</div>
|
|
1354
|
-
${
|
|
1355
|
-
`}class
|
|
1356
|
-
${
|
|
1343
|
+
${dt(this.themeColor)}
|
|
1344
|
+
`}class H4 extends HTMLElement{constructor(){super(),this.templateString=N4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){var i,r;const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",n=>S(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:o}=n.target,s=yield O4.retrieve(o);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:s,previewImage:s}}))}catch(o){this.shadowRoot.querySelector("#error").innerHTML=o.message}}))}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||y("document.title.front")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",H4);const fr={version:"11.2.0"},U4=fr.version,H=document.querySelector("smart-camera-web");function Ut(e){return S(this,null,function*(){try{const t=yield $.getMedia({audio:!1,video:$.environmentOptions}),r=(yield navigator.mediaDevices.enumerateDevices()).find(n=>n.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===n.deviceId);H==null||H.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:r==null?void 0:r.label}})),e.removeAttribute("data-camera-error"),e.setAttribute("data-camera-ready",!0)}catch(t){e.removeAttribute("data-camera-ready"),e.setAttribute("data-camera-error",$.handleCameraError(t))}})}class Tu extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),H==null||H.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
1345
|
+
${dt(this.themeColor)}
|
|
1357
1346
|
<div style="height: 100%;">
|
|
1358
1347
|
<document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
|
|
1359
1348
|
${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions?"hidden":""}
|
|
1360
1349
|
${this.hideAttribution}
|
|
1361
1350
|
></document-capture-instructions>
|
|
1362
1351
|
<document-capture id='document-capture-front' side-of-id='Front'
|
|
1363
|
-
${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}
|
|
1352
|
+
${this.title||`title='${y("document.title.front")}'`} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}
|
|
1364
1353
|
${this.documentCaptureModes} ${this.documentType} theme-color='${this.themeColor}'
|
|
1365
1354
|
></document-capture>
|
|
1366
|
-
<document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='
|
|
1355
|
+
<document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='${y("document.title.back")}'
|
|
1367
1356
|
${this.documentCaptureModes} ${this.showNavigation} theme-color='${this.themeColor}' ${this.hideAttribution} hidden
|
|
1368
1357
|
></document-capture-instructions>
|
|
1369
|
-
<document-capture id='document-capture-back' side-of-id='Back' ${this.title}
|
|
1358
|
+
<document-capture id='document-capture-back' side-of-id='Back' ${this.title||`title='${y("document.title.back")}'`} ${this.showNavigation}
|
|
1370
1359
|
${this.documentCaptureModes} theme-color='${this.themeColor}' ${this.hideAttribution}
|
|
1371
1360
|
hidden
|
|
1372
1361
|
></document-capture>
|
|
1373
1362
|
<document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1374
1363
|
<document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1375
1364
|
</div>
|
|
1376
|
-
`,this._data={images:[],meta:{libraryVersion:hh}},this.documentInstruction=this.querySelector("document-capture-instructions"),this.documentInstructionBack=this.querySelector("#document-capture-instructions-back"),this.idCapture=this.querySelector("#document-capture-front"),this.idReview=this.querySelector("#front-of-document-capture-review"),this.idCaptureBack=this.querySelector("#document-capture-back"),this.backOfIdReview=this.querySelector("#back-of-document-capture-review"),this.thankYouScreen=this.querySelector("thank-you"),this.hideInstructions?(Bt(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){F.stopMedia(),B==null||B.dispatchEvent(new CustomEvent("metadata.cleanup")),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.documentInstruction.addEventListener("document-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.documentInstruction.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"gallery"}})),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-end")),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),F.stopMedia(),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.cancelled",()=>{this.hideInstructions?this.handleBackEvents():this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>L(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>L(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"gallery"}})),this.backOfIdReview.setAttribute("data-image",i.detail.image),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-end")),this.backOfIdReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),F.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>L(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.accepted",()=>{this._publishSelectedImages()}),[this.documentInstruction,this.idCapture,this.documentInstructionBack,this.idCaptureBack,this.idReview,this.backOfIdReview].forEach(i=>{i.addEventListener(`${i.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvents())})}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("document-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get documentType(){return this.hasAttribute("document-type")?`document-type='${this.getAttribute("document-type")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.close"))}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(t){switch(t){case"document-capture-modes":case"document-type":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("document-capture-screens")&&customElements.define("document-capture-screens",ba);var Ln=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yi={exports:{}};var dh=Yi.exports,ya;function uh(){return ya||(ya=1,function(e,t){(function(i,n,r){var s=function(a,c,l){l=o.extend({},o.options,l);var d=o.runValidations(a,c,l);if(d.some(function(h){return o.isPromise(h.error)}))throw new Error("Use validate.async if you want support for promises");return s.processValidationResults(d,l)},o=s;o.extend=function(a){return[].slice.call(arguments,1).forEach(function(c){for(var l in c)a[l]=c[l]}),a},o.extend(s,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var a=o.format("%{major}.%{minor}.%{patch}",o.version);return o.isEmpty(o.version.metadata)||(a+="+"+o.version.metadata),a}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],h,u,p,f,m,v,g;(o.isDomElement(a)||o.isJqueryElement(a))&&(a=o.collectFormValues(a));for(h in c){p=o.getDeepObjectValue(a,h),f=o.result(c[h],p,a,h,l,c);for(u in f){if(m=o.validators[u],!m)throw g=o.format("Unknown validator %{name}",{name:u}),new Error(g);v=f[u],v=o.result(v,p,a,h,l,c),v&&d.push({attribute:h,value:p,validator:u,globalOptions:l,attributes:a,options:v,error:m.call(m,p,v,h,a,l)})}}return d},processValidationResults:function(a,c){a=o.pruneEmptyErrors(a,c),a=o.expandMultipleErrors(a,c),a=o.convertErrorMessages(a,c);var l=c.format||"grouped";if(typeof o.formatters[l]=="function")a=o.formatters[l](a);else throw new Error(o.format("Unknown format %{format}",c));return o.isEmpty(a)?void 0:a},async:function(a,c,l){l=o.extend({},o.async.options,l);var d=l.wrapErrors||function(u){return u};l.cleanAttributes!==!1&&(a=o.cleanAttributes(a,c));var h=o.runValidations(a,c,l);return new o.Promise(function(u,p){o.waitForResults(h).then(function(){var f=o.processValidationResults(h,l);f?p(new d(f,l,a,c)):u(a)},function(f){p(f)})})},single:function(a,c,l){return l=o.extend({},o.single.options,l,{format:"flat",fullMessages:!1}),o({single:a},{single:c},l)},waitForResults:function(a){return a.reduce(function(c,l){return o.isPromise(l.error)?c.then(function(){return l.error.then(function(d){l.error=d||null})}):c},new o.Promise(function(c){c()}))},result:function(a){var c=[].slice.call(arguments,1);return typeof a=="function"&&(a=a.apply(null,c)),a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)},isFunction:function(a){return typeof a=="function"},isInteger:function(a){return o.isNumber(a)&&a%1===0},isBoolean:function(a){return typeof a=="boolean"},isObject:function(a){return a===Object(a)},isDate:function(a){return a instanceof Date},isDefined:function(a){return a!=null},isPromise:function(a){return!!a&&o.isFunction(a.then)},isJqueryElement:function(a){return a&&o.isString(a.jquery)},isDomElement:function(a){return!a||!a.querySelectorAll||!a.querySelector?!1:o.isObject(document)&&a===document?!0:typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"},isEmpty:function(a){var c;if(!o.isDefined(a))return!0;if(o.isFunction(a))return!1;if(o.isString(a))return o.EMPTY_STRING_REGEXP.test(a);if(o.isArray(a))return a.length===0;if(o.isDate(a))return!1;if(o.isObject(a)){for(c in a)return!1;return!0}return!1},format:o.extend(function(a,c){return o.isString(a)?a.replace(o.format.FORMAT_REGEXP,function(l,d,h){return d==="%"?"%{"+h+"}":String(c[h])}):a},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(a){return o.isNumber(a)?a*100%1===0?""+a:parseFloat(Math.round(a*100)/100).toFixed(2):o.isArray(a)?a.map(function(c){return o.prettify(c)}).join(", "):o.isObject(a)?o.isDefined(a.toString)?a.toString():JSON.stringify(a):(a=""+a,a.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(c,l,d){return""+l+" "+d.toLowerCase()}).toLowerCase())},stringifyValue:function(a,c){var l=c&&c.prettify||o.prettify;return l(a)},isString:function(a){return typeof a=="string"},isArray:function(a){return{}.toString.call(a)==="[object Array]"},isHash:function(a){return o.isObject(a)&&!o.isArray(a)&&!o.isFunction(a)},contains:function(a,c){return o.isDefined(a)?o.isArray(a)?a.indexOf(c)!==-1:c in a:!1},unique:function(a){return o.isArray(a)?a.filter(function(c,l,d){return d.indexOf(c)==l}):a},forEachKeyInKeypath:function(a,c,l){if(o.isString(c)){var d="",h,u=!1;for(h=0;h<c.length;++h)switch(c[h]){case".":u?(u=!1,d+="."):(a=l(a,d,!1),d="");break;case"\\":u?(u=!1,d+="\\"):u=!0;break;default:u=!1,d+=c[h];break}return l(a,d,!0)}},getDeepObjectValue:function(a,c){if(o.isObject(a))return o.forEachKeyInKeypath(a,c,function(l,d){if(o.isObject(l))return l[d]})},collectFormValues:function(a,c){var l={},d,h,u,p,f,m;if(o.isJqueryElement(a)&&(a=a[0]),!a)return l;for(c=c||{},p=a.querySelectorAll("input[name], textarea[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){var v=u.name.replace(/\./g,"\\\\.");m=o.sanitizeFormValue(u.value,c),u.type==="number"?m=m?+m:null:u.type==="checkbox"?u.attributes.value?u.checked||(m=l[v]||null):m=u.checked:u.type==="radio"&&(u.checked||(m=l[v]||null)),l[v]=m}for(p=a.querySelectorAll("select[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){if(u.multiple){m=[];for(h in u.options)f=u.options[h],f&&f.selected&&m.push(o.sanitizeFormValue(f.value,c))}else{var g=typeof u.options[u.selectedIndex]!="undefined"?u.options[u.selectedIndex].value:"";m=o.sanitizeFormValue(g,c)}l[u.name]=m}return l},sanitizeFormValue:function(a,c){return c.trim&&o.isString(a)&&(a=a.trim()),c.nullify!==!1&&a===""?null:a},capitalize:function(a){return o.isString(a)?a[0].toUpperCase()+a.slice(1):a},pruneEmptyErrors:function(a){return a.filter(function(c){return!o.isEmpty(c.error)})},expandMultipleErrors:function(a){var c=[];return a.forEach(function(l){o.isArray(l.error)?l.error.forEach(function(d){c.push(o.extend({},l,{error:d}))}):c.push(l)}),c},convertErrorMessages:function(a,c){c=c||{};var l=[],d=c.prettify||o.prettify;return a.forEach(function(h){var u=o.result(h.error,h.value,h.attribute,h.options,h.attributes,h.globalOptions);if(!o.isString(u)){l.push(h);return}u[0]==="^"?u=u.slice(1):c.fullMessages!==!1&&(u=o.capitalize(d(h.attribute))+" "+u),u=u.replace(/\\\^/g,"^"),u=o.format(u,{value:o.stringifyValue(h.value,c)}),l.push(o.extend({},h,{error:u}))}),l},groupErrorsByAttribute:function(a){var c={};return a.forEach(function(l){var d=c[l.attribute];d?d.push(l):c[l.attribute]=[l]}),c},flattenErrorsToArray:function(a){return a.map(function(c){return c.error}).filter(function(c,l,d){return d.indexOf(c)===l})},cleanAttributes:function(a,c){function l(u,p,f){return o.isObject(u[p])?u[p]:u[p]=f?!0:{}}function d(u){var p={},f;for(f in u)u[f]&&o.forEachKeyInKeypath(p,f,l);return p}function h(u,p){if(!o.isObject(u))return u;var f=o.extend({},u),m,v;for(v in u)m=p[v],o.isObject(m)?f[v]=h(f[v],m):m||delete f[v];return f}return!o.isObject(c)||!o.isObject(a)?{}:(c=d(c),h(a,c))},exposeModule:function(a,c,l,d,h){l?(d&&d.exports&&(l=d.exports=a),l.validate=a):(c.validate=a,a.isFunction(h)&&h.amd&&h([],function(){return a}))},warn:function(a){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+a)}}),s.validators={presence:function(a,c){if(c=o.extend({},this.options,c),c.allowEmpty!==!1?!o.isDefined(a):o.isEmpty(a))return c.message||this.message||"can't be blank"},length:function(a,c,l){if(o.isDefined(a)){c=o.extend({},this.options,c);var d=c.is,h=c.maximum,u=c.minimum,p=c.tokenizer||function(g){return g},f,m=[];a=p(a);var v=a.length;if(!o.isNumber(v))return c.message||this.notValid||"has an incorrect length";if(o.isNumber(d)&&v!==d&&(f=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(o.format(f,{count:d}))),o.isNumber(u)&&v<u&&(f=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(o.format(f,{count:u}))),o.isNumber(h)&&v>h&&(f=c.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",m.push(o.format(f,{count:h}))),m.length>0)return c.message||m}},numericality:function(a,c,l,d,h){if(o.isDefined(a)){c=o.extend({},this.options,c);var u=[],p,f,m={greaterThan:function(E,M){return E>M},greaterThanOrEqualTo:function(E,M){return E>=M},equalTo:function(E,M){return E===M},lessThan:function(E,M){return E<M},lessThanOrEqualTo:function(E,M){return E<=M},divisibleBy:function(E,M){return E%M===0}},v=c.prettify||h&&h.prettify||o.prettify;if(o.isString(a)&&c.strict){var g="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(g+="(\\.\\d+)?"),g+="$",!new RegExp(g).test(a))return c.message||c.notValid||this.notValid||this.message||"must be a valid number"}if(c.noStrings!==!0&&o.isString(a)&&!o.isEmpty(a)&&(a=+a),!o.isNumber(a))return c.message||c.notValid||this.notValid||this.message||"is not a number";if(c.onlyInteger&&!o.isInteger(a))return c.message||c.notInteger||this.notInteger||this.message||"must be an integer";for(p in m)if(f=c[p],o.isNumber(f)&&!m[p](a,f)){var b="not"+o.capitalize(p),_=c[b]||this[b]||this.message||"must be %{type} %{count}";u.push(o.format(_,{count:f,type:v(p)}))}if(c.odd&&a%2!==1&&u.push(c.notOdd||this.notOdd||this.message||"must be odd"),c.even&&a%2!==0&&u.push(c.notEven||this.notEven||this.message||"must be even"),u.length)return c.message||u}},datetime:o.extend(function(a,c){if(!o.isFunction(this.parse)||!o.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(o.isDefined(a)){c=o.extend({},this.options,c);var l,d=[],h=c.earliest?this.parse(c.earliest,c):NaN,u=c.latest?this.parse(c.latest,c):NaN;if(a=this.parse(a,c),isNaN(a)||c.dateOnly&&a%864e5!==0)return l=c.notValid||c.message||this.notValid||"must be a valid date",o.format(l,{value:arguments[0]});if(!isNaN(h)&&a<h&&(l=c.tooEarly||c.message||this.tooEarly||"must be no earlier than %{date}",l=o.format(l,{value:this.format(a,c),date:this.format(h,c)}),d.push(l)),!isNaN(u)&&a>u&&(l=c.tooLate||c.message||this.tooLate||"must be no later than %{date}",l=o.format(l,{date:this.format(u,c),value:this.format(a,c)}),d.push(l)),d.length)return o.unique(d)}},{parse:null,format:null}),date:function(a,c){return c=o.extend({},c,{dateOnly:!0}),o.validators.datetime.call(o.validators.datetime,a,c)},format:function(a,c){(o.isString(c)||c instanceof RegExp)&&(c={pattern:c}),c=o.extend({},this.options,c);var l=c.message||this.message||"is invalid",d=c.pattern,h;if(o.isDefined(a)&&(!o.isString(a)||(o.isString(d)&&(d=new RegExp(c.pattern,c.flags)),h=d.exec(a),!h||h[0].length!=a.length)))return l},inclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is not included in the list";return o.format(l,{value:a})}},exclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is restricted";return o.isString(c.within[a])&&(a=c.within[a]),o.format(l,{value:a})}},email:o.extend(function(a,c){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid email";if(o.isDefined(a)&&(!o.isString(a)||!this.PATTERN.exec(a)))return l},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(a,c,l,d,h){if(o.isDefined(a)){o.isString(c)&&(c={attribute:c}),c=o.extend({},this.options,c);var u=c.message||this.message||"is not equal to %{attribute}";if(o.isEmpty(c.attribute)||!o.isString(c.attribute))throw new Error("The attribute must be a non empty string");var p=o.getDeepObjectValue(d,c.attribute),f=c.comparator||function(v,g){return v===g},m=c.prettify||h&&h.prettify||o.prettify;if(!f(a,p,c,l,d))return o.format(u,{attribute:m(c.attribute)})}},url:function(a,c){if(o.isDefined(a)){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid url",d=c.schemes||this.schemes||["http","https"],h=c.allowLocal||this.allowLocal||!1,u=c.allowDataUrl||this.allowDataUrl||!1;if(!o.isString(a))return l;var p="^(?:(?:"+d.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(h?f+="?":p+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",p+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+f+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",u){var m="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",v="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",g="data:(?:"+m+")?(?:;base64)?,"+v;p="(?:"+p+")|(?:^"+g+"$)"}var b=new RegExp(p,"i");if(!b.exec(a))return l}},type:o.extend(function(a,c,l,d,h){if(o.isString(c)&&(c={type:c}),!!o.isDefined(a)){var u=o.extend({},this.options,c),p=u.type;if(!o.isDefined(p))throw new Error("No type was specified");var f;if(o.isFunction(p)?f=p:f=this.types[p],!o.isFunction(f))throw new Error("validate.validators.type.types."+p+" must be a function.");if(!f(a,u,l,d,h)){var m=c.message||this.messages[p]||this.message||u.message||(o.isFunction(p)?"must be of the correct type":"must be of type %{type}");return o.isFunction(m)&&(m=m(a,c,l,d,h)),o.format(m,{attribute:o.prettify(l),type:p})}}},{types:{object:function(a){return o.isObject(a)&&!o.isArray(a)},array:o.isArray,integer:o.isInteger,number:o.isNumber,string:o.isString,date:o.isDate,boolean:o.isBoolean},messages:{}})},s.formatters={detailed:function(a){return a},flat:o.flattenErrorsToArray,grouped:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=o.flattenErrorsToArray(a[c]);return a},constraint:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=a[c].map(function(l){return l.validator}).sort();return a}},s.exposeModule(s,this,i,n,r)}).call(dh,t,e,null)}(Yi,Yi.exports)),Yi.exports}var ph=uh();const fh=wa(ph);function Hr(e,t){return fetch(e,{body:JSON.stringify(t),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function mh(){return`
|
|
1365
|
+
`,this._data={images:[],meta:{libraryVersion:U4}},this.documentInstruction=this.querySelector("document-capture-instructions"),this.documentInstructionBack=this.querySelector("#document-capture-instructions-back"),this.idCapture=this.querySelector("#document-capture-front"),this.idReview=this.querySelector("#front-of-document-capture-review"),this.idCaptureBack=this.querySelector("#document-capture-back"),this.backOfIdReview=this.querySelector("#back-of-document-capture-review"),this.thankYouScreen=this.querySelector("thank-you"),this.hideInstructions?(Ut(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){$.stopMedia(),H==null||H.dispatchEvent(new CustomEvent("metadata.cleanup")),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.documentInstruction.addEventListener("document-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.documentInstruction.addEventListener("document-capture-instructions.capture",()=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),H==null||H.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Ut(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"gallery"}})),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ei.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{H==null||H.dispatchEvent(new CustomEvent("metadata.document-front-capture-end")),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ei.ID_CARD_IMAGE_BASE64}),$.stopMedia(),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.cancelled",()=>{this.hideInstructions?this.handleBackEvents():this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.rejected",()=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Ut(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>S(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Ut(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),H==null||H.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Ut(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>S(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Ut(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"gallery"}})),this.backOfIdReview.setAttribute("data-image",i.detail.image),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ei.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{H==null||H.dispatchEvent(new CustomEvent("metadata.document-back-capture-end")),this.backOfIdReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ei.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),$.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>S(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Ut(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>S(this,null,function*(){H==null||H.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Ut(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.accepted",()=>{this._publishSelectedImages()}),[this.documentInstruction,this.idCapture,this.documentInstructionBack,this.idCaptureBack,this.idReview,this.backOfIdReview].forEach(i=>{i.addEventListener(`${i.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvents())})}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("document-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get documentType(){return this.hasAttribute("document-type")?`document-type='${this.getAttribute("document-type")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.close"))}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(t){switch(t){case"document-capture-modes":case"document-type":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("document-capture-screens")&&customElements.define("document-capture-screens",Tu);var pr={exports:{}};var q4=pr.exports,Mu;function V4(){return Mu||(Mu=1,function(e,t){(function(i,r,n){var o=function(a,c,l){l=s.extend({},s.options,l);var d=s.runValidations(a,c,l);if(d.some(function(u){return s.isPromise(u.error)}))throw new Error("Use validate.async if you want support for promises");return o.processValidationResults(d,l)},s=o;s.extend=function(a){return[].slice.call(arguments,1).forEach(function(c){for(var l in c)a[l]=c[l]}),a},s.extend(o,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var a=s.format("%{major}.%{minor}.%{patch}",s.version);return s.isEmpty(s.version.metadata)||(a+="+"+s.version.metadata),a}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],u,h,f,p,m,v,g;(s.isDomElement(a)||s.isJqueryElement(a))&&(a=s.collectFormValues(a));for(u in c){f=s.getDeepObjectValue(a,u),p=s.result(c[u],f,a,u,l,c);for(h in p){if(m=s.validators[h],!m)throw g=s.format("Unknown validator %{name}",{name:h}),new Error(g);v=p[h],v=s.result(v,f,a,u,l,c),v&&d.push({attribute:u,value:f,validator:h,globalOptions:l,attributes:a,options:v,error:m.call(m,f,v,u,a,l)})}}return d},processValidationResults:function(a,c){a=s.pruneEmptyErrors(a,c),a=s.expandMultipleErrors(a,c),a=s.convertErrorMessages(a,c);var l=c.format||"grouped";if(typeof s.formatters[l]=="function")a=s.formatters[l](a);else throw new Error(s.format("Unknown format %{format}",c));return s.isEmpty(a)?void 0:a},async:function(a,c,l){l=s.extend({},s.async.options,l);var d=l.wrapErrors||function(h){return h};l.cleanAttributes!==!1&&(a=s.cleanAttributes(a,c));var u=s.runValidations(a,c,l);return new s.Promise(function(h,f){s.waitForResults(u).then(function(){var p=s.processValidationResults(u,l);p?f(new d(p,l,a,c)):h(a)},function(p){f(p)})})},single:function(a,c,l){return l=s.extend({},s.single.options,l,{format:"flat",fullMessages:!1}),s({single:a},{single:c},l)},waitForResults:function(a){return a.reduce(function(c,l){return s.isPromise(l.error)?c.then(function(){return l.error.then(function(d){l.error=d||null})}):c},new s.Promise(function(c){c()}))},result:function(a){var c=[].slice.call(arguments,1);return typeof a=="function"&&(a=a.apply(null,c)),a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)},isFunction:function(a){return typeof a=="function"},isInteger:function(a){return s.isNumber(a)&&a%1===0},isBoolean:function(a){return typeof a=="boolean"},isObject:function(a){return a===Object(a)},isDate:function(a){return a instanceof Date},isDefined:function(a){return a!=null},isPromise:function(a){return!!a&&s.isFunction(a.then)},isJqueryElement:function(a){return a&&s.isString(a.jquery)},isDomElement:function(a){return!a||!a.querySelectorAll||!a.querySelector?!1:s.isObject(document)&&a===document?!0:typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"},isEmpty:function(a){var c;if(!s.isDefined(a))return!0;if(s.isFunction(a))return!1;if(s.isString(a))return s.EMPTY_STRING_REGEXP.test(a);if(s.isArray(a))return a.length===0;if(s.isDate(a))return!1;if(s.isObject(a)){for(c in a)return!1;return!0}return!1},format:s.extend(function(a,c){return s.isString(a)?a.replace(s.format.FORMAT_REGEXP,function(l,d,u){return d==="%"?"%{"+u+"}":String(c[u])}):a},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(a){return s.isNumber(a)?a*100%1===0?""+a:parseFloat(Math.round(a*100)/100).toFixed(2):s.isArray(a)?a.map(function(c){return s.prettify(c)}).join(", "):s.isObject(a)?s.isDefined(a.toString)?a.toString():JSON.stringify(a):(a=""+a,a.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(c,l,d){return""+l+" "+d.toLowerCase()}).toLowerCase())},stringifyValue:function(a,c){var l=c&&c.prettify||s.prettify;return l(a)},isString:function(a){return typeof a=="string"},isArray:function(a){return{}.toString.call(a)==="[object Array]"},isHash:function(a){return s.isObject(a)&&!s.isArray(a)&&!s.isFunction(a)},contains:function(a,c){return s.isDefined(a)?s.isArray(a)?a.indexOf(c)!==-1:c in a:!1},unique:function(a){return s.isArray(a)?a.filter(function(c,l,d){return d.indexOf(c)==l}):a},forEachKeyInKeypath:function(a,c,l){if(s.isString(c)){var d="",u,h=!1;for(u=0;u<c.length;++u)switch(c[u]){case".":h?(h=!1,d+="."):(a=l(a,d,!1),d="");break;case"\\":h?(h=!1,d+="\\"):h=!0;break;default:h=!1,d+=c[u];break}return l(a,d,!0)}},getDeepObjectValue:function(a,c){if(s.isObject(a))return s.forEachKeyInKeypath(a,c,function(l,d){if(s.isObject(l))return l[d]})},collectFormValues:function(a,c){var l={},d,u,h,f,p,m;if(s.isJqueryElement(a)&&(a=a[0]),!a)return l;for(c=c||{},f=a.querySelectorAll("input[name], textarea[name]"),d=0;d<f.length;++d)if(h=f.item(d),!s.isDefined(h.getAttribute("data-ignored"))){var v=h.name.replace(/\./g,"\\\\.");m=s.sanitizeFormValue(h.value,c),h.type==="number"?m=m?+m:null:h.type==="checkbox"?h.attributes.value?h.checked||(m=l[v]||null):m=h.checked:h.type==="radio"&&(h.checked||(m=l[v]||null)),l[v]=m}for(f=a.querySelectorAll("select[name]"),d=0;d<f.length;++d)if(h=f.item(d),!s.isDefined(h.getAttribute("data-ignored"))){if(h.multiple){m=[];for(u in h.options)p=h.options[u],p&&p.selected&&m.push(s.sanitizeFormValue(p.value,c))}else{var g=typeof h.options[h.selectedIndex]!="undefined"?h.options[h.selectedIndex].value:"";m=s.sanitizeFormValue(g,c)}l[h.name]=m}return l},sanitizeFormValue:function(a,c){return c.trim&&s.isString(a)&&(a=a.trim()),c.nullify!==!1&&a===""?null:a},capitalize:function(a){return s.isString(a)?a[0].toUpperCase()+a.slice(1):a},pruneEmptyErrors:function(a){return a.filter(function(c){return!s.isEmpty(c.error)})},expandMultipleErrors:function(a){var c=[];return a.forEach(function(l){s.isArray(l.error)?l.error.forEach(function(d){c.push(s.extend({},l,{error:d}))}):c.push(l)}),c},convertErrorMessages:function(a,c){c=c||{};var l=[],d=c.prettify||s.prettify;return a.forEach(function(u){var h=s.result(u.error,u.value,u.attribute,u.options,u.attributes,u.globalOptions);if(!s.isString(h)){l.push(u);return}h[0]==="^"?h=h.slice(1):c.fullMessages!==!1&&(h=s.capitalize(d(u.attribute))+" "+h),h=h.replace(/\\\^/g,"^"),h=s.format(h,{value:s.stringifyValue(u.value,c)}),l.push(s.extend({},u,{error:h}))}),l},groupErrorsByAttribute:function(a){var c={};return a.forEach(function(l){var d=c[l.attribute];d?d.push(l):c[l.attribute]=[l]}),c},flattenErrorsToArray:function(a){return a.map(function(c){return c.error}).filter(function(c,l,d){return d.indexOf(c)===l})},cleanAttributes:function(a,c){function l(h,f,p){return s.isObject(h[f])?h[f]:h[f]=p?!0:{}}function d(h){var f={},p;for(p in h)h[p]&&s.forEachKeyInKeypath(f,p,l);return f}function u(h,f){if(!s.isObject(h))return h;var p=s.extend({},h),m,v;for(v in h)m=f[v],s.isObject(m)?p[v]=u(p[v],m):m||delete p[v];return p}return!s.isObject(c)||!s.isObject(a)?{}:(c=d(c),u(a,c))},exposeModule:function(a,c,l,d,u){l?(d&&d.exports&&(l=d.exports=a),l.validate=a):(c.validate=a,a.isFunction(u)&&u.amd&&u([],function(){return a}))},warn:function(a){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+a)}}),o.validators={presence:function(a,c){if(c=s.extend({},this.options,c),c.allowEmpty!==!1?!s.isDefined(a):s.isEmpty(a))return c.message||this.message||"can't be blank"},length:function(a,c,l){if(s.isDefined(a)){c=s.extend({},this.options,c);var d=c.is,u=c.maximum,h=c.minimum,f=c.tokenizer||function(g){return g},p,m=[];a=f(a);var v=a.length;if(!s.isNumber(v))return c.message||this.notValid||"has an incorrect length";if(s.isNumber(d)&&v!==d&&(p=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(s.format(p,{count:d}))),s.isNumber(h)&&v<h&&(p=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(s.format(p,{count:h}))),s.isNumber(u)&&v>u&&(p=c.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",m.push(s.format(p,{count:u}))),m.length>0)return c.message||m}},numericality:function(a,c,l,d,u){if(s.isDefined(a)){c=s.extend({},this.options,c);var h=[],f,p,m={greaterThan:function(M,P){return M>P},greaterThanOrEqualTo:function(M,P){return M>=P},equalTo:function(M,P){return M===P},lessThan:function(M,P){return M<P},lessThanOrEqualTo:function(M,P){return M<=P},divisibleBy:function(M,P){return M%P===0}},v=c.prettify||u&&u.prettify||s.prettify;if(s.isString(a)&&c.strict){var g="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(g+="(\\.\\d+)?"),g+="$",!new RegExp(g).test(a))return c.message||c.notValid||this.notValid||this.message||"must be a valid number"}if(c.noStrings!==!0&&s.isString(a)&&!s.isEmpty(a)&&(a=+a),!s.isNumber(a))return c.message||c.notValid||this.notValid||this.message||"is not a number";if(c.onlyInteger&&!s.isInteger(a))return c.message||c.notInteger||this.notInteger||this.message||"must be an integer";for(f in m)if(p=c[f],s.isNumber(p)&&!m[f](a,p)){var b="not"+s.capitalize(f),_=c[b]||this[b]||this.message||"must be %{type} %{count}";h.push(s.format(_,{count:p,type:v(f)}))}if(c.odd&&a%2!==1&&h.push(c.notOdd||this.notOdd||this.message||"must be odd"),c.even&&a%2!==0&&h.push(c.notEven||this.notEven||this.message||"must be even"),h.length)return c.message||h}},datetime:s.extend(function(a,c){if(!s.isFunction(this.parse)||!s.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(s.isDefined(a)){c=s.extend({},this.options,c);var l,d=[],u=c.earliest?this.parse(c.earliest,c):NaN,h=c.latest?this.parse(c.latest,c):NaN;if(a=this.parse(a,c),isNaN(a)||c.dateOnly&&a%864e5!==0)return l=c.notValid||c.message||this.notValid||"must be a valid date",s.format(l,{value:arguments[0]});if(!isNaN(u)&&a<u&&(l=c.tooEarly||c.message||this.tooEarly||"must be no earlier than %{date}",l=s.format(l,{value:this.format(a,c),date:this.format(u,c)}),d.push(l)),!isNaN(h)&&a>h&&(l=c.tooLate||c.message||this.tooLate||"must be no later than %{date}",l=s.format(l,{date:this.format(h,c),value:this.format(a,c)}),d.push(l)),d.length)return s.unique(d)}},{parse:null,format:null}),date:function(a,c){return c=s.extend({},c,{dateOnly:!0}),s.validators.datetime.call(s.validators.datetime,a,c)},format:function(a,c){(s.isString(c)||c instanceof RegExp)&&(c={pattern:c}),c=s.extend({},this.options,c);var l=c.message||this.message||"is invalid",d=c.pattern,u;if(s.isDefined(a)&&(!s.isString(a)||(s.isString(d)&&(d=new RegExp(c.pattern,c.flags)),u=d.exec(a),!u||u[0].length!=a.length)))return l},inclusion:function(a,c){if(s.isDefined(a)&&(s.isArray(c)&&(c={within:c}),c=s.extend({},this.options,c),!s.contains(c.within,a))){var l=c.message||this.message||"^%{value} is not included in the list";return s.format(l,{value:a})}},exclusion:function(a,c){if(s.isDefined(a)&&(s.isArray(c)&&(c={within:c}),c=s.extend({},this.options,c),!!s.contains(c.within,a))){var l=c.message||this.message||"^%{value} is restricted";return s.isString(c.within[a])&&(a=c.within[a]),s.format(l,{value:a})}},email:s.extend(function(a,c){c=s.extend({},this.options,c);var l=c.message||this.message||"is not a valid email";if(s.isDefined(a)&&(!s.isString(a)||!this.PATTERN.exec(a)))return l},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(a,c,l,d,u){if(s.isDefined(a)){s.isString(c)&&(c={attribute:c}),c=s.extend({},this.options,c);var h=c.message||this.message||"is not equal to %{attribute}";if(s.isEmpty(c.attribute)||!s.isString(c.attribute))throw new Error("The attribute must be a non empty string");var f=s.getDeepObjectValue(d,c.attribute),p=c.comparator||function(v,g){return v===g},m=c.prettify||u&&u.prettify||s.prettify;if(!p(a,f,c,l,d))return s.format(h,{attribute:m(c.attribute)})}},url:function(a,c){if(s.isDefined(a)){c=s.extend({},this.options,c);var l=c.message||this.message||"is not a valid url",d=c.schemes||this.schemes||["http","https"],u=c.allowLocal||this.allowLocal||!1,h=c.allowDataUrl||this.allowDataUrl||!1;if(!s.isString(a))return l;var f="^(?:(?:"+d.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(u?p+="?":f+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",f+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+p+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",h){var m="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",v="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",g="data:(?:"+m+")?(?:;base64)?,"+v;f="(?:"+f+")|(?:^"+g+"$)"}var b=new RegExp(f,"i");if(!b.exec(a))return l}},type:s.extend(function(a,c,l,d,u){if(s.isString(c)&&(c={type:c}),!!s.isDefined(a)){var h=s.extend({},this.options,c),f=h.type;if(!s.isDefined(f))throw new Error("No type was specified");var p;if(s.isFunction(f)?p=f:p=this.types[f],!s.isFunction(p))throw new Error("validate.validators.type.types."+f+" must be a function.");if(!p(a,h,l,d,u)){var m=c.message||this.messages[f]||this.message||h.message||(s.isFunction(f)?"must be of the correct type":"must be of type %{type}");return s.isFunction(m)&&(m=m(a,c,l,d,u)),s.format(m,{attribute:s.prettify(l),type:f})}}},{types:{object:function(a){return s.isObject(a)&&!s.isArray(a)},array:s.isArray,integer:s.isInteger,number:s.isNumber,string:s.isString,date:s.isDate,boolean:s.isBoolean},messages:{}})},o.formatters={detailed:function(a){return a},flat:s.flattenErrorsToArray,grouped:function(a){var c;a=s.groupErrorsByAttribute(a);for(c in a)a[c]=s.flattenErrorsToArray(a[c]);return a},constraint:function(a){var c;a=s.groupErrorsByAttribute(a);for(c in a)a[c]=a[c].map(function(l){return l.validator}).sort();return a}},o.exposeModule(o,this,i,r,n)}).call(q4,t,e,null)}(pr,pr.exports)),pr.exports}var j4=V4();const z4=te(j4);function Ks(e,t){return fetch(e,{body:JSON.stringify(t),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function G4(){return`
|
|
1377
1366
|
<style>
|
|
1378
1367
|
*,
|
|
1379
1368
|
*::before,
|
|
@@ -1643,7 +1632,7 @@ ${this.hideAttribution?"":`
|
|
|
1643
1632
|
}
|
|
1644
1633
|
</style>
|
|
1645
1634
|
|
|
1646
|
-
<div class='flow center' id='id-entry'>
|
|
1635
|
+
<div class='flow center' id='id-entry' dir='${this.direction}'>
|
|
1647
1636
|
<div class="nav">
|
|
1648
1637
|
<div class="back-wrapper">
|
|
1649
1638
|
<button type='button' data-type='icon' id="back-button" class="back-button">
|
|
@@ -1690,7 +1679,7 @@ ${this.hideAttribution?"":`
|
|
|
1690
1679
|
</form>
|
|
1691
1680
|
</div>
|
|
1692
1681
|
|
|
1693
|
-
<div hidden class='flow center' id='select-mode'>
|
|
1682
|
+
<div hidden class='flow center' id='select-mode' dir='${this.direction}'>
|
|
1694
1683
|
<div class="nav">
|
|
1695
1684
|
<div class="back-wrapper">
|
|
1696
1685
|
<button type='button' data-type='icon' id="back-to-entry-button" class="back-button">
|
|
@@ -1801,7 +1790,7 @@ ${this.hideAttribution?"":`
|
|
|
1801
1790
|
</form>
|
|
1802
1791
|
</div>
|
|
1803
1792
|
|
|
1804
|
-
<div hidden class='flow center' id='otp-verification'>
|
|
1793
|
+
<div hidden class='flow center' id='otp-verification' dir='${this.direction}'>
|
|
1805
1794
|
<div class="nav justify-right">
|
|
1806
1795
|
<button data-type='icon' type='button' class='close-iframe'>
|
|
1807
1796
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
|
|
@@ -1840,7 +1829,7 @@ ${this.hideAttribution?"":`
|
|
|
1840
1829
|
</form>
|
|
1841
1830
|
</div>
|
|
1842
1831
|
</div>
|
|
1843
|
-
`}class
|
|
1832
|
+
`}class Iu extends HTMLElement{constructor(){super(),this.templateString=G4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(t){switch(t){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const r=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);r.hidden=!1,this.shadowRoot.replaceChild(r,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(r);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const t=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),t.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const t=window.parent;[t.parent,t].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(r=>r.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(r=>r.remove())}handleIdNumberValidationErrors(t){Object.keys(t).forEach(r=>{const n=this.activeScreen.querySelector(`#${r}`);n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",`${r}-hint`);const o=document.createElement("div");o.setAttribute("id",`${r}-hint`),o.setAttribute("class","validation-message"),o.textContent=t[r][0],n.insertAdjacentElement("afterend",o)})}handleActiveScreenErrors(t){const i=this.activeScreen.querySelector('[type="submit"]'),r=document.createElement("div");r.setAttribute("class","validation-message"),r.textContent=t,i.insertAdjacentElement("beforebegin",r)}validateIdNumber(t){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},r=z4({id_number:t},i);return r&&this.handleIdNumberValidationErrors(r),r}queryOtpModes(t){return S(this,null,function*(){t&&(t.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const r={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},n=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const o=yield Ks(n,r),s=yield o.json();this.toggleLoading(),o.ok?(this.sessionId=s.session_id,this.modes=s.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",s.modes)):this.handleActiveScreenErrors(s.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}}})}selectOtpMode(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,n=>n.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const n=yield Ks(r,i),o=yield n.json();this.toggleLoading(),n.ok?(this.selectedOtpDeliveryMode=this.modes.filter(s=>s[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(o.error)}catch(n){this.toggleLoading(),this.handleActiveScreenErrors(n.message)}})}submitOtp(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const n=yield Ks(r,i),o=yield n.json();this.toggleLoading(),n.ok?this.handleTotpConsentGrant(t):this.handleActiveScreenErrors(o.error)}catch(n){this.toggleLoading(),this.handleActiveScreenErrors(n.message)}})}toggleLoading(){const t=this.activeScreen.querySelector('button[type="submit"]'),i=t.querySelector(".text"),r=t.querySelector("svg"),n=t.querySelector(".spinner");t.toggleAttribute("disabled"),i.toggleAttribute("hidden"),r.toggleAttribute("hidden"),n.toggleAttribute("hidden")}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get idNumber(){return localStorage.getItem("idNumber")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get token(){return this.getAttribute("token")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}handleTotpConsentGrant(){const t=new CustomEvent("end-user-consent.totp.granted",{detail:{consented:{contact_information:!0,document_information:!0,personal_details:!0},id_number:this.idNumber,session_id:this.sessionId}});this.dispatchEvent(t)}handleTotpConsentContactMethodsOutdated(){const t="end-user-consent.totp.denied.contact-methods-outdated",i=new CustomEvent(t,{detail:{data:{id_number:this.idNumber,session_id:this.sessionId},message:t}});this.dispatchEvent(i)}}"customElements"in window&&!window.customElements.get("totp-consent")&&window.customElements.define("totp-consent",Iu);class Z4 extends HTMLElement{constructor(){super();const t=document.createElement("template");t.innerHTML=`
|
|
1844
1833
|
<p style='margin-inline: auto; max-inline-size: 10rem'>
|
|
1845
1834
|
<svg viewBox="0 0 90 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1846
1835
|
<path d="M0.544 7V1.4H2.616C3.064 1.4 3.43467 1.47467 3.728 1.624C4.02133 1.77333 4.24 1.97867 4.384 2.24C4.528 2.50133 4.6 2.79467 4.6 3.12C4.6 3.42933 4.53067 3.71467 4.392 3.976C4.25333 4.232 4.03733 4.44 3.744 4.6C3.45067 4.75467 3.07467 4.832 2.616 4.832H1.568V7H0.544ZM1.568 4H2.552C2.90933 4 3.16533 3.92267 3.32 3.768C3.48 3.608 3.56 3.392 3.56 3.12C3.56 2.84267 3.48 2.62667 3.32 2.472C3.16533 2.312 2.90933 2.232 2.552 2.232H1.568V4ZM7.08025 7.096C6.69625 7.096 6.34958 7.008 6.04025 6.832C5.73625 6.656 5.49358 6.41333 5.31225 6.104C5.13625 5.78933 5.04825 5.42667 5.04825 5.016C5.04825 4.60533 5.13892 4.24533 5.32025 3.936C5.50158 3.62133 5.74425 3.376 6.04825 3.2C6.35758 3.024 6.70425 2.936 7.08825 2.936C7.46692 2.936 7.80825 3.024 8.11225 3.2C8.42158 3.376 8.66425 3.62133 8.84025 3.936C9.02158 4.24533 9.11225 4.60533 9.11225 5.016C9.11225 5.42667 9.02158 5.78933 8.84025 6.104C8.66425 6.41333 8.42158 6.656 8.11225 6.832C7.80292 7.008 7.45892 7.096 7.08025 7.096ZM7.08025 6.208C7.34692 6.208 7.57892 6.10933 7.77625 5.912C7.97358 5.70933 8.07225 5.41067 8.07225 5.016C8.07225 4.62133 7.97358 4.32533 7.77625 4.128C7.57892 3.92533 7.34958 3.824 7.08825 3.824C6.81625 3.824 6.58158 3.92533 6.38425 4.128C6.19225 4.32533 6.09625 4.62133 6.09625 5.016C6.09625 5.41067 6.19225 5.70933 6.38425 5.912C6.58158 6.10933 6.81358 6.208 7.08025 6.208ZM10.6632 7L9.50319 3.032H10.5192L11.2072 5.888L12.0072 3.032H13.1432L13.9432 5.888L14.6392 3.032H15.6552L14.4872 7H13.4232L12.5752 4.032L11.7272 7H10.6632ZM18.0886 7.096C17.6886 7.096 17.334 7.01067 17.0246 6.84C16.7153 6.66933 16.4726 6.42933 16.2966 6.12C16.1206 5.81067 16.0326 5.45333 16.0326 5.048C16.0326 4.63733 16.118 4.272 16.2886 3.952C16.4646 3.632 16.7046 3.384 17.0086 3.208C17.318 3.02667 17.6806 2.936 18.0966 2.936C18.486 2.936 18.83 3.02133 19.1286 3.192C19.4273 3.36267 19.6593 3.59733 19.8246 3.896C19.9953 4.18933 20.0806 4.51733 20.0806 4.88C20.0806 4.93867 20.078 5 20.0726 5.064C20.0726 5.128 20.07 5.19467 20.0646 5.264H17.0486C17.07 5.57333 17.1766 5.816 17.3686 5.992C17.566 6.168 17.8033 6.256 18.0806 6.256C18.2886 6.256 18.462 6.21067 18.6006 6.12C18.7446 6.024 18.8513 5.90133 18.9206 5.752H19.9606C19.886 6.00267 19.7606 6.232 19.5846 6.44C19.414 6.64267 19.2006 6.80267 18.9446 6.92C18.694 7.03733 18.4086 7.096 18.0886 7.096ZM18.0966 3.768C17.846 3.768 17.6246 3.84 17.4326 3.984C17.2406 4.12267 17.118 4.336 17.0646 4.624H19.0406C19.0246 4.36267 18.9286 4.15467 18.7526 4C18.5766 3.84533 18.358 3.768 18.0966 3.768ZM20.9419 7V3.032H21.8539L21.9499 3.776C22.0939 3.52 22.2885 3.31733 22.5339 3.168C22.7845 3.01333 23.0779 2.936 23.4139 2.936V4.016H23.1259C22.9019 4.016 22.7019 4.05067 22.5259 4.12C22.3499 4.18933 22.2112 4.30933 22.1099 4.48C22.0139 4.65067 21.9659 4.888 21.9659 5.192V7H20.9419ZM25.9714 7.096C25.5714 7.096 25.2168 7.01067 24.9074 6.84C24.5981 6.66933 24.3554 6.42933 24.1794 6.12C24.0034 5.81067 23.9154 5.45333 23.9154 5.048C23.9154 4.63733 24.0008 4.272 24.1714 3.952C24.3474 3.632 24.5874 3.384 24.8914 3.208C25.2008 3.02667 25.5634 2.936 25.9794 2.936C26.3688 2.936 26.7128 3.02133 27.0114 3.192C27.3101 3.36267 27.5421 3.59733 27.7074 3.896C27.8781 4.18933 27.9634 4.51733 27.9634 4.88C27.9634 4.93867 27.9608 5 27.9554 5.064C27.9554 5.128 27.9528 5.19467 27.9474 5.264H24.9314C24.9528 5.57333 25.0594 5.816 25.2514 5.992C25.4488 6.168 25.6861 6.256 25.9634 6.256C26.1714 6.256 26.3448 6.21067 26.4834 6.12C26.6274 6.024 26.7341 5.90133 26.8034 5.752H27.8434C27.7688 6.00267 27.6434 6.232 27.4674 6.44C27.2968 6.64267 27.0834 6.80267 26.8274 6.92C26.5768 7.03733 26.2914 7.096 25.9714 7.096ZM25.9794 3.768C25.7288 3.768 25.5074 3.84 25.3154 3.984C25.1234 4.12267 25.0008 4.336 24.9474 4.624H26.9234C26.9074 4.36267 26.8114 4.15467 26.6354 4C26.4594 3.84533 26.2408 3.768 25.9794 3.768ZM30.6487 7.096C30.2754 7.096 29.942 7.00533 29.6487 6.824C29.3554 6.64267 29.1234 6.39467 28.9527 6.08C28.782 5.76533 28.6967 5.408 28.6967 5.008C28.6967 4.608 28.782 4.25333 28.9527 3.944C29.1234 3.62933 29.3554 3.384 29.6487 3.208C29.942 3.02667 30.2754 2.936 30.6487 2.936C30.9474 2.936 31.2087 2.992 31.4327 3.104C31.6567 3.216 31.838 3.37333 31.9767 3.576V1.24H33.0007V7H32.0887L31.9767 6.432C31.8487 6.608 31.678 6.76267 31.4647 6.896C31.2567 7.02933 30.9847 7.096 30.6487 7.096ZM30.8647 6.2C31.1954 6.2 31.4647 6.09067 31.6727 5.872C31.886 5.648 31.9927 5.36267 31.9927 5.016C31.9927 4.66933 31.886 4.38667 31.6727 4.168C31.4647 3.944 31.1954 3.832 30.8647 3.832C30.5394 3.832 30.27 3.94133 30.0567 4.16C29.8434 4.37867 29.7367 4.66133 29.7367 5.008C29.7367 5.35467 29.8434 5.64 30.0567 5.864C30.27 6.088 30.5394 6.2 30.8647 6.2ZM38.3017 7.096C38.003 7.096 37.7417 7.04 37.5177 6.928C37.2937 6.816 37.1124 6.65867 36.9737 6.456L36.8617 7H35.9497V1.24H36.9737V3.6C37.1017 3.424 37.2697 3.26933 37.4777 3.136C37.691 3.00267 37.9657 2.936 38.3017 2.936C38.675 2.936 39.0084 3.02667 39.3017 3.208C39.595 3.38933 39.827 3.63733 39.9977 3.952C40.1684 4.26667 40.2537 4.624 40.2537 5.024C40.2537 5.424 40.1684 5.78133 39.9977 6.096C39.827 6.40533 39.595 6.65067 39.3017 6.832C39.0084 7.008 38.675 7.096 38.3017 7.096ZM38.0857 6.2C38.411 6.2 38.6804 6.09067 38.8937 5.872C39.107 5.65333 39.2137 5.37067 39.2137 5.024C39.2137 4.67733 39.107 4.392 38.8937 4.168C38.6804 3.944 38.411 3.832 38.0857 3.832C37.755 3.832 37.483 3.944 37.2697 4.168C37.0617 4.38667 36.9577 4.66933 36.9577 5.016C36.9577 5.36267 37.0617 5.648 37.2697 5.872C37.483 6.09067 37.755 6.2 38.0857 6.2ZM41.3051 8.76L42.2251 6.736H41.9851L40.4411 3.032H41.5531L42.6651 5.824L43.8251 3.032H44.9131L42.3931 8.76H41.3051Z" fill="#001096"/>
|
|
@@ -1862,7 +1851,7 @@ ${this.hideAttribution?"":`
|
|
|
1862
1851
|
</defs>
|
|
1863
1852
|
</svg>
|
|
1864
1853
|
</p>
|
|
1865
|
-
`,this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",
|
|
1854
|
+
`,this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",Z4);function W4(){return`
|
|
1866
1855
|
<style>
|
|
1867
1856
|
*,
|
|
1868
1857
|
*::before,
|
|
@@ -2174,8 +2163,8 @@ ${this.hideAttribution?"":`
|
|
|
2174
2163
|
color: var(--color-danger);
|
|
2175
2164
|
}
|
|
2176
2165
|
</style>
|
|
2177
|
-
${
|
|
2178
|
-
<div id='consent-screen'>
|
|
2166
|
+
${dt(this.themeColor)}
|
|
2167
|
+
<div id='consent-screen' dir='${this.direction}'>
|
|
2179
2168
|
<section class='flow center'>
|
|
2180
2169
|
<div class="nav ${this.hideBack?"justify-right":""}">
|
|
2181
2170
|
<div class="back-wrapper" ${this.hideBack?"hidden":""}>
|
|
@@ -2185,14 +2174,14 @@ ${this.hideAttribution?"":`
|
|
|
2185
2174
|
<path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
|
|
2186
2175
|
</svg>
|
|
2187
2176
|
</button>
|
|
2188
|
-
<div class="back-button-text"
|
|
2177
|
+
<div class="back-button-text">${y("common.back")}</div>
|
|
2189
2178
|
</div>
|
|
2190
2179
|
<button data-type='icon' type='button' class='close-iframe'>
|
|
2191
2180
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
|
|
2192
2181
|
<path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
|
|
2193
2182
|
<path fill="#91190F" d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"/>
|
|
2194
2183
|
</svg>
|
|
2195
|
-
<span class='visually-hidden'
|
|
2184
|
+
<span class='visually-hidden'>${y("common.close")} SmileIdentity Verification frame</span>
|
|
2196
2185
|
</button>
|
|
2197
2186
|
</div>
|
|
2198
2187
|
<img alt='' width='50' height='50' src='${this.partnerLogoURL}' />
|
|
@@ -2204,17 +2193,14 @@ ${this.hideAttribution?"":`
|
|
|
2204
2193
|
</svg>
|
|
2205
2194
|
|
|
2206
2195
|
<span>
|
|
2207
|
-
|
|
2196
|
+
${y("consent.demoTip")}
|
|
2208
2197
|
</span>
|
|
2209
2198
|
</p>
|
|
2210
2199
|
<h1 class='text-base font-bold'>
|
|
2211
|
-
|
|
2212
|
-
wants to access your
|
|
2213
|
-
<span class='theme'>${this.idTypeLabel}</span>
|
|
2214
|
-
information
|
|
2200
|
+
${Nt("consent.accessRequest",{idTypeLabel:{className:"theme",value:this.idTypeLabel},partnerName:{className:"theme",value:this.partnerName}})}
|
|
2215
2201
|
</h1>
|
|
2216
2202
|
<p class='text-base font-normal'>
|
|
2217
|
-
|
|
2203
|
+
${Nt("consent.allowPartner",{partnerName:this.partnerName})}
|
|
2218
2204
|
</p>
|
|
2219
2205
|
</section>
|
|
2220
2206
|
|
|
@@ -2226,8 +2212,8 @@ ${this.hideAttribution?"":`
|
|
|
2226
2212
|
<path d="M14.9238 19.0148L13.8262 17.931C13.8262 17.931 13.6341 17.7956 13.5244 17.7956C13.4146 17.7956 13.3049 17.8498 13.2226 17.931C13.1402 18.0123 13.0854 18.1207 13.0854 18.2291C13.0854 18.3374 13.1402 18.4458 13.2226 18.5271L14.622 19.9089C14.622 19.9089 14.814 20.0443 14.9238 20.0443C15.0335 20.0443 15.1433 19.9901 15.2256 19.9089L17.8323 17.335C17.8323 17.335 17.9421 17.1724 17.9421 17.0369C17.9421 16.9015 17.9146 16.8202 17.8323 16.7389C17.75 16.6576 17.6677 16.6305 17.5579 16.6305C17.4482 16.6305 17.3384 16.6576 17.2835 16.7389L15.0061 18.9877L14.9238 19.0148ZM15.5 24C15.5 24 15.4177 24 15.3902 24C15.3628 24 15.3354 24 15.3079 24C14.0457 23.6207 13.0305 22.8621 12.2073 21.7241C11.4116 20.5862 11 19.3128 11 17.931V15.2217C11 15.0591 11.0549 14.8965 11.1646 14.734C11.2744 14.5714 11.4116 14.4901 11.5488 14.4089L15.1982 13.0542C15.1982 13.0542 15.3902 13 15.5 13C15.6098 13 15.6921 13 15.8018 13.0542L19.4512 14.4089C19.6159 14.4631 19.753 14.5714 19.8354 14.734C19.9177 14.8965 20 15.032 20 15.2217V17.931C20 19.3128 19.5884 20.5862 18.7927 21.7241C17.9969 22.8621 16.9543 23.6478 15.6921 24H15.5Z" fill="#2CC05C"/>
|
|
2227
2213
|
</svg>
|
|
2228
2214
|
<div class='processing-list__items-item'>
|
|
2229
|
-
<p class='font-medium text-base processing-list__item__title'
|
|
2230
|
-
<p class='text-xs font-medium processing-list__items-item__description'
|
|
2215
|
+
<p class='font-medium text-base processing-list__item__title'>${y("consent.processing.personalDetails.title")}</p>
|
|
2216
|
+
<p class='text-xs font-medium processing-list__items-item__description'>${y("consent.processing.personalDetails.description")}</p>
|
|
2231
2217
|
</div
|
|
2232
2218
|
</li>
|
|
2233
2219
|
<li class='processing-list__items'>
|
|
@@ -2237,8 +2223,8 @@ ${this.hideAttribution?"":`
|
|
|
2237
2223
|
<path d="M20 16.83C19.9987 17.2074 19.9131 17.5798 19.7496 17.92C19.5794 18.28 19.359 18.62 19.0686 18.94C18.5779 19.48 18.037 19.87 17.4261 20.12C17.4161 20.12 17.4061 20.13 17.3961 20.13C16.8052 20.37 16.1642 20.5 15.4732 20.5C14.4517 20.5 13.36 20.26 12.2083 19.77C11.0566 19.28 9.90483 18.62 8.76312 17.79C8.37253 17.5 7.98195 17.21 7.61139 16.9L10.8863 13.63C11.1667 13.84 11.4171 14 11.6274 14.11C11.6775 14.13 11.7376 14.16 11.8077 14.19C11.8878 14.22 11.9679 14.23 12.0581 14.23C12.2283 14.23 12.3585 14.17 12.4687 14.06L13.2298 13.31C13.4802 13.06 13.7206 12.87 13.9509 12.75C14.1813 12.61 14.4116 12.54 14.662 12.54C14.8523 12.54 15.0526 12.58 15.2729 12.67C15.4932 12.76 15.7236 12.89 15.9739 13.06L19.2889 15.41C19.5493 15.59 19.7296 15.8 19.8397 16.05C19.9399 16.3 20 16.55 20 16.83Z" fill="#151F72"/>
|
|
2238
2224
|
</svg>
|
|
2239
2225
|
<div class='processing-list__items-item'>
|
|
2240
|
-
<p class='font-medium text-base processing-list__item__title'
|
|
2241
|
-
<p class='text-xs font-medium processing-list__items-item__description'
|
|
2226
|
+
<p class='font-medium text-base processing-list__item__title'>${y("consent.processing.contactInfo.title")}</p>
|
|
2227
|
+
<p class='text-xs font-medium processing-list__items-item__description'>${y("consent.processing.contactInfo.description")}</p>
|
|
2242
2228
|
</div
|
|
2243
2229
|
</li>
|
|
2244
2230
|
<li class='processing-list__items'>
|
|
@@ -2261,32 +2247,30 @@ ${this.hideAttribution?"":`
|
|
|
2261
2247
|
</defs>
|
|
2262
2248
|
</svg>
|
|
2263
2249
|
<div class='processing-list__items-item'>
|
|
2264
|
-
<p class='font-medium text-base processing-list__item__title'
|
|
2265
|
-
<p class='text-xs font-medium processing-list__items-item__description'
|
|
2250
|
+
<p class='font-medium text-base processing-list__item__title'>${y("consent.processing.documentInfo.title")}</p>
|
|
2251
|
+
<p class='text-xs font-medium processing-list__items-item__description'>${y("consent.processing.documentInfo.description")}</p>
|
|
2266
2252
|
</div
|
|
2267
2253
|
</li>
|
|
2268
2254
|
</ul>
|
|
2269
2255
|
|
|
2270
2256
|
<section class='callout | flow center' style='--flow-space: 2rem; margin: var(--flow-space) auto;'>
|
|
2271
2257
|
<p>
|
|
2272
|
-
|
|
2273
|
-
<a class='theme' href='${this.partnerPolicyURL}' rel='noreferer noopener' target='_blank'
|
|
2258
|
+
${Nt("consent.privacyPolicy",{partnerName:this.partnerName})}
|
|
2259
|
+
<a class='theme' href='${this.partnerPolicyURL}' rel='noreferer noopener' target='_blank'>${y("consent.privacyPolicyLink")}</a>
|
|
2274
2260
|
</p>
|
|
2275
2261
|
|
|
2276
2262
|
<p style='--flow-space: .75rem'>
|
|
2277
|
-
|
|
2278
|
-
<span class='theme'>${this.partnerName}</span>
|
|
2279
|
-
consent to process your personal data to offer you this service
|
|
2263
|
+
${Nt("consent.grantConsent",{partnerName:this.partnerName})}
|
|
2280
2264
|
</p>
|
|
2281
2265
|
</section>
|
|
2282
2266
|
|
|
2283
2267
|
<section class='flow' style='--flow-space: 2.5rem'>
|
|
2284
2268
|
<button id='allow' data-variant='solid'>
|
|
2285
|
-
|
|
2269
|
+
${y("common.allow")}
|
|
2286
2270
|
</button>
|
|
2287
2271
|
|
|
2288
2272
|
<button id='cancel' data-variant='ghost' class='color-danger' style='--flow-space: 1.5rem'>
|
|
2289
|
-
|
|
2273
|
+
${y("common.cancel")}
|
|
2290
2274
|
</button>
|
|
2291
2275
|
</section>
|
|
2292
2276
|
</div>
|
|
@@ -2414,15 +2398,15 @@ ${this.hideAttribution?"":`
|
|
|
2414
2398
|
</svg>
|
|
2415
2399
|
|
|
2416
2400
|
<h1 style='font-size: 36px; line-height: 1; font-weight: 500; --flow-space: 1.5rem'>
|
|
2417
|
-
|
|
2401
|
+
${y("consent.denied.title")}
|
|
2418
2402
|
</h1>
|
|
2419
2403
|
|
|
2420
2404
|
<p class='color-grey' style='--flow-space: 1rem'>
|
|
2421
|
-
|
|
2405
|
+
${y("consent.denied.message")}
|
|
2422
2406
|
</p>
|
|
2423
2407
|
|
|
2424
2408
|
<p>
|
|
2425
|
-
|
|
2409
|
+
${y("consent.denied.prompt")}
|
|
2426
2410
|
</p>
|
|
2427
2411
|
</section>
|
|
2428
2412
|
|
|
@@ -2430,16 +2414,16 @@ ${this.hideAttribution?"":`
|
|
|
2430
2414
|
<svg style='transform: rotate(.5turn);' width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2431
2415
|
<path d="M7 12h11m0 0-4.588-4M18 12l-4.588 4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2432
2416
|
</svg>
|
|
2433
|
-
|
|
2417
|
+
${y("consent.denied.goBack")}
|
|
2434
2418
|
</button>
|
|
2435
2419
|
|
|
2436
2420
|
<button data-variant='outline' id='confirm-consent-rejection' style='--flow-space: 1rem; border-radius: 2rem'>
|
|
2437
|
-
|
|
2421
|
+
${y("consent.denied.confirmCancel")}
|
|
2438
2422
|
</button>
|
|
2439
2423
|
|
|
2440
2424
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
2441
2425
|
</div>
|
|
2442
|
-
`}class
|
|
2426
|
+
`}class Fu extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=W4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.rejectButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",r=>this.handleConsentRejection(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",r=>this.handleBackEvents(r)),this.backButton.addEventListener("click",r=>{this.handleBackEvents(r)}),i.forEach(r=>{r.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get token(){return this.getAttribute("token")}handleConsentGrant(t){const i=t.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(t){const i=new CustomEvent(t.type,{detail:Re({},t.detail)});this.dispatchEvent(i)}handleBackEvents(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",Fu);function X4(){return`
|
|
2443
2427
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
2444
2428
|
<link
|
|
2445
2429
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap"
|
|
@@ -2775,11 +2759,11 @@ ${this.hideAttribution?"":`
|
|
|
2775
2759
|
text-align: justify;
|
|
2776
2760
|
}
|
|
2777
2761
|
</style>
|
|
2778
|
-
${
|
|
2779
|
-
<div id="selfie-capture-instruction-screen" class="center">
|
|
2762
|
+
${dt(this.themeColor)}
|
|
2763
|
+
<div id="selfie-capture-instruction-screen" class="center" dir="${this.direction}">
|
|
2780
2764
|
<div class="content-root">
|
|
2781
2765
|
<div class="content-header">
|
|
2782
|
-
|
|
2766
|
+
${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
|
|
2783
2767
|
</div>
|
|
2784
2768
|
<div class="content-body">
|
|
2785
2769
|
<header>
|
|
@@ -2807,7 +2791,7 @@ ${this.hideAttribution?"":`
|
|
|
2807
2791
|
</clipPath>
|
|
2808
2792
|
</defs>
|
|
2809
2793
|
</svg>
|
|
2810
|
-
<h1 class='title-color font-bold'
|
|
2794
|
+
<h1 class='title-color font-bold'>${y("selfie.instructions.title")}</h1>
|
|
2811
2795
|
</header>
|
|
2812
2796
|
<div class="instructions-wrapper">
|
|
2813
2797
|
<div class="instructions">
|
|
@@ -2886,9 +2870,9 @@ ${this.hideAttribution?"":`
|
|
|
2886
2870
|
</defs>
|
|
2887
2871
|
</svg>
|
|
2888
2872
|
<div class="instruction">
|
|
2889
|
-
<p class="text-base title-color font-bold tip-header"
|
|
2873
|
+
<p class="text-base title-color font-bold tip-header">${y("selfie.instructions.tips.goodLight.header")}</p>
|
|
2890
2874
|
<p class="tip-body">
|
|
2891
|
-
|
|
2875
|
+
${y("selfie.instructions.tips.goodLight.body")}
|
|
2892
2876
|
</p>
|
|
2893
2877
|
</div>
|
|
2894
2878
|
</div>
|
|
@@ -2974,9 +2958,9 @@ ${this.hideAttribution?"":`
|
|
|
2974
2958
|
</defs>
|
|
2975
2959
|
</svg>
|
|
2976
2960
|
<div class="instruction">
|
|
2977
|
-
<p class="text-base title-color font-bold tip-header"
|
|
2961
|
+
<p class="text-base title-color font-bold tip-header">${y("selfie.instructions.tips.clearImage.header")}</p>
|
|
2978
2962
|
<p class="tip-body">
|
|
2979
|
-
|
|
2963
|
+
${y("selfie.instructions.tips.clearImage.body")}
|
|
2980
2964
|
</p>
|
|
2981
2965
|
</div>
|
|
2982
2966
|
</div>
|
|
@@ -3006,25 +2990,25 @@ ${this.hideAttribution?"":`
|
|
|
3006
2990
|
/>
|
|
3007
2991
|
</svg>
|
|
3008
2992
|
<div class="instruction">
|
|
3009
|
-
<p class="text-base title-color font-bold tip-header"
|
|
2993
|
+
<p class="text-base title-color font-bold tip-header">${y("selfie.instructions.tips.removeObstructions.header")}</p>
|
|
3010
2994
|
<p class="tip-body">
|
|
3011
|
-
|
|
2995
|
+
${y("selfie.instructions.tips.removeObstructions.body")}
|
|
3012
2996
|
</p>
|
|
3013
2997
|
</div>
|
|
3014
2998
|
</div>
|
|
3015
2999
|
<div class="instructions">
|
|
3016
3000
|
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 24 24" fill="none" stroke="${this.themeColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-mood-happy"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 9l.01 0" /><path d="M15 9l.01 0" /><path d="M8 13a4 4 0 1 0 8 0h-8" /></svg>
|
|
3017
3001
|
<div class="instruction">
|
|
3018
|
-
<p class="text-base title-color font-bold tip-header"
|
|
3002
|
+
<p class="text-base title-color font-bold tip-header">${y("selfie.instructions.tips.wideSmile.header")}</p>
|
|
3019
3003
|
<p class="tip-body">
|
|
3020
|
-
|
|
3004
|
+
${y("selfie.instructions.tips.wideSmile.body")}
|
|
3021
3005
|
</p>
|
|
3022
3006
|
</div>
|
|
3023
3007
|
</div>
|
|
3024
3008
|
</div>
|
|
3025
3009
|
<section class="controls">
|
|
3026
3010
|
<button id='allow' data-variant='solid full-width' class='button theme-background'>
|
|
3027
|
-
|
|
3011
|
+
${y("selfie.instructions.allowButton")}
|
|
3028
3012
|
</button>
|
|
3029
3013
|
</section>
|
|
3030
3014
|
${this.hideAttribution?"":`
|
|
@@ -3035,7 +3019,7 @@ ${this.hideAttribution?"":`
|
|
|
3035
3019
|
</div>
|
|
3036
3020
|
</div>
|
|
3037
3021
|
</div>
|
|
3038
|
-
`}class
|
|
3022
|
+
`}class K4 extends HTMLElement{constructor(){super(),this.templateString=X4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){var i,r;this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.handleCloseEvents()},!1)}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.cancelled"))}get showNavigation(){return this.hasAttribute("show-navigation")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",K4);function Y4(){return`
|
|
3039
3023
|
<style>
|
|
3040
3024
|
.retake-photo.button[data-variant~="ghost"] {
|
|
3041
3025
|
color: #FF5805;
|
|
@@ -3087,11 +3071,11 @@ ${this.hideAttribution?"":`
|
|
|
3087
3071
|
margin-top: 0;
|
|
3088
3072
|
}
|
|
3089
3073
|
</style>
|
|
3090
|
-
${
|
|
3091
|
-
<div id='selfie-capture-review-screen' class='center'>
|
|
3092
|
-
|
|
3074
|
+
${dt(this.themeColor)}
|
|
3075
|
+
<div id='selfie-capture-review-screen' class='center' dir='${this.direction}'>
|
|
3076
|
+
${this.showNavigation?"<smileid-navigation hide-back></smileid-navigation>":""}
|
|
3093
3077
|
<h1 class="header-title title-color font-bold">
|
|
3094
|
-
|
|
3078
|
+
${y("selfie.review.question")}
|
|
3095
3079
|
</h1>
|
|
3096
3080
|
<div class='section | flow'>
|
|
3097
3081
|
<div class='selfie-review-container ${this.isPortraitCaptureView?"portrait":"landscape"}'>
|
|
@@ -3105,10 +3089,10 @@ ${this.hideAttribution?"":`
|
|
|
3105
3089
|
</div>
|
|
3106
3090
|
<div class='flow action-buttons'>
|
|
3107
3091
|
<button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
|
|
3108
|
-
|
|
3092
|
+
${y("selfie.review.acceptButton")}
|
|
3109
3093
|
</button>
|
|
3110
3094
|
<button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-image'>
|
|
3111
|
-
|
|
3095
|
+
${y("selfie.review.retakeButton")}
|
|
3112
3096
|
</button>
|
|
3113
3097
|
</div>
|
|
3114
3098
|
${this.hideAttribution?"":`
|
|
@@ -3116,21 +3100,21 @@ ${this.hideAttribution?"":`
|
|
|
3116
3100
|
`}
|
|
3117
3101
|
</div>
|
|
3118
3102
|
</div>
|
|
3119
|
-
`}class _h extends HTMLElement{constructor(){super(),this.templateString=yh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",_h);var Ki,U,Ea,xa,Yt,ka,Aa,Sa,La,Ur,Vr,jr,Ji={},Ma=[],Ch=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qi=Array.isArray;function dt(e,t){for(var i in t)e[i]=t[i];return e}function Gr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ct(e,t,i){var n,r,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ki.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return en(e,o,n,r,null)}function en(e,t,i,n,r){var s={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r==null?++Ea:r,__i:-1,__u:0};return r==null&&U.vnode!=null&&U.vnode(s),s}function Dt(e){return e.children}function tn(e,t){this.props=e,this.context=t}function pi(e,t){if(t==null)return e.__?pi(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?pi(e):null}function Ta(e){var t,i;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null){e.__e=e.__c.base=i.__e;break}return Ta(e)}}function Ia(e){(!e.__d&&(e.__d=!0)&&Yt.push(e)&&!Mn.__r++||ka!=U.debounceRendering)&&((ka=U.debounceRendering)||Aa)(Mn)}function Mn(){for(var e,t,i,n,r,s,o,a=1;Yt.length;)Yt.length>a&&Yt.sort(Sa),e=Yt.shift(),a=Yt.length,e.__d&&(i=void 0,r=(n=(t=e).__v).__e,s=[],o=[],t.__P&&((i=dt({},n)).__v=n.__v+1,U.vnode&&U.vnode(i),zr(t.__P,i,n,t.__n,t.__P.namespaceURI,32&n.__u?[r]:null,s,r==null?pi(n):r,!!(32&n.__u),o),i.__v=n.__v,i.__.__k[i.__i]=i,Pa(s,i,o),i.__e!=r&&Ta(i)));Mn.__r=0}function Fa(e,t,i,n,r,s,o,a,c,l,d){var h,u,p,f,m,v,g=n&&n.__k||Ma,b=t.length;for(c=Eh(i,t,g,c,b),h=0;h<b;h++)(p=i.__k[h])!=null&&(u=p.__i==-1?Ji:g[p.__i]||Ji,p.__i=h,v=zr(e,p,u,r,s,o,a,c,l,d),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&qr(u.ref,null,p),d.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||u.__k===p.__k?c=Ba(p,c,e):typeof p.type=="function"&&v!==void 0?c=v:f&&(c=f.nextSibling),p.__u&=-7);return i.__e=m,c}function Eh(e,t,i,n,r){var s,o,a,c,l,d=i.length,h=d,u=0;for(e.__k=new Array(r),s=0;s<r;s++)(o=t[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+u,(o=e.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?en(null,o,null,null,null):Qi(o)?en(Dt,{children:o},null,null,null):o.constructor==null&&o.__b>0?en(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,a=null,(l=o.__i=xh(o,i,c,h))!=-1&&(h--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?u--:r<d&&u++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?u--:l==c+1?u++:(l>c?u--:u++,o.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<d;s++)(a=i[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=pi(a)),Na(a,a));return n}function Ba(e,t,i){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Ba(n[r],t,i));return t}e.__e!=t&&(t&&e.type&&!i.contains(t)&&(t=pi(e)),i.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Da(e,t){return t=t||[],e==null||typeof e=="boolean"||(Qi(e)?e.some(function(i){Da(i,t)}):t.push(e)),t}function xh(e,t,i,n){var r,s,o,a=e.key,c=e.type,l=t[i],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return i;if(n>(d?1:0)){for(r=i-1,s=i+1;r>=0||s<t.length;)if((l=t[o=r>=0?r--:s++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return o}return-1}function Ra(e,t,i){t[0]=="-"?e.setProperty(t,i==null?"":i):e[t]=i==null?"":typeof i!="number"||Ch.test(t)?i:i+"px"}function Tn(e,t,i,n,r){var s,o;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||Ra(e.style,t,"");if(i)for(t in i)n&&i[t]==n[t]||Ra(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(La,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?n?i.u=n.u:(i.u=Ur,e.addEventListener(t,s?jr:Vr,s)):e.removeEventListener(t,s?jr:Vr,s);else{if(r=="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]=i==null?"":i;break e}catch(a){}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function Oa(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ur++;else if(t.t<i.u)return;return i(U.event?U.event(t):t)}}}function zr(e,t,i,n,r,s,o,a,c,l){var d,h,u,p,f,m,v,g,b,_,E,M,w,T,I,O,be,ce=t.type;if(t.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),s=[a=t.__e=i.__e]),(d=U.__b)&&d(t);e:if(typeof ce=="function")try{if(g=t.props,b="prototype"in ce&&ce.prototype.render,_=(d=ce.contextType)&&n[d.__c],E=d?_?_.props.value:d.__:n,i.__c?v=(h=t.__c=i.__c).__=h.__E:(b?t.__c=h=new ce(g,E):(t.__c=h=new tn(g,E),h.constructor=ce,h.render=Ah),_&&_.sub(h),h.props=g,h.state||(h.state={}),h.context=E,h.__n=n,u=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&ce.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=dt({},h.__s)),dt(h.__s,ce.getDerivedStateFromProps(g,h.__s))),p=h.props,f=h.state,h.__v=t,u)b&&ce.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&ce.getDerivedStateFromProps==null&&g!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(g,E),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(g,h.__s,E)===!1||t.__v==i.__v){for(t.__v!=i.__v&&(h.props=g,h.state=h.__s,h.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(re){re&&(re.__=t)}),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(g,h.__s,E),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,f,m)})}if(h.context=E,h.props=g,h.__P=e,h.__e=!1,w=U.__r,T=0,b){for(h.state=h.__s,h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[]}else do h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++T<25);h.state=h.__s,h.getChildContext!=null&&(n=dt(dt({},n),h.getChildContext())),b&&!u&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,f)),O=d,d!=null&&d.type===Dt&&d.key==null&&(O=$a(d.props.children)),a=Fa(e,Qi(O)?O:[O],t,i,n,r,s,o,a,c,l),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),v&&(h.__E=h.__=null)}catch(re){if(t.__v=null,c||s!=null)if(re.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(be=s.length;be--;)Gr(s[be]);Zr(t)}else t.__e=i.__e,t.__k=i.__k,re.then||Zr(t);U.__e(re,t,i)}else s==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=kh(i.__e,t,i,n,r,s,o,c,l);return(d=U.diffed)&&d(t),128&t.__u?void 0:a}function Zr(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Zr)}function Pa(e,t,i){for(var n=0;n<i.length;n++)qr(i[n],i[++n],i[++n]);U.__c&&U.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){U.__e(s,r.__v)}})}function $a(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Qi(e)?e.map($a):dt({},e)}function kh(e,t,i,n,r,s,o,a,c){var l,d,h,u,p,f,m,v=i.props,g=t.props,b=t.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,s[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(r,b,g.is&&g),a&&(U.__m&&U.__m(t,s),a=!1),s=null}if(b==null)v===g||a&&e.data==g||(e.data=g);else{if(s=s&&Ki.call(e.childNodes),v=i.props||Ji,!a&&s!=null)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=p;else if(!(l in g)){if(l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g)continue;Tn(e,l,null,p,r)}}for(l in g)p=g[l],l=="children"?u=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?f=p:l=="checked"?m=p:a&&typeof p!="function"||v[l]===p||Tn(e,l,p,v[l],r);if(d)a||h&&(d.__html==h.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(h&&(e.innerHTML=""),Fa(t.type=="template"?e.content:e,Qi(u)?u:[u],t,i,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:i.__k&&pi(i,0),a,c),s!=null)for(l=s.length;l--;)Gr(s[l]);a||(l="value",b=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[l]||b=="progress"&&!f||b=="option"&&f!=v[l])&&Tn(e,l,f,v[l],r),l="checked",m!=null&&m!=e[l]&&Tn(e,l,m,v[l],r))}return e}function qr(e,t,i){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(r){U.__e(r,i)}}function Na(e,t,i){var n,r;if(U.unmount&&U.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){U.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&Na(n[r],t,i||typeof e.type!="function");i||Gr(e.__e),e.__c=e.__=e.__e=void 0}function Ah(e,t,i){return this.constructor(e,i)}function In(e,t,i){var n,r,s,o;t==document&&(t=document.documentElement),U.__&&U.__(e,t),r=(n=typeof i=="function")?null:i&&i.__k||t.__k,s=[],o=[],zr(t,e=(!n&&i||t).__k=Ct(Dt,null,[e]),r||Ji,Ji,t.namespaceURI,!n&&i?[i]:r?null:t.firstChild?Ki.call(t.childNodes):null,s,!n&&i?i:r?r.__e:t.firstChild,n,o),Pa(s,e,o)}function Ha(e,t){In(e,t,Ha)}function Ua(e,t,i){var n,r,s,o,a=dt({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?r=t[s]:a[s]=t[s]===void 0&&o!=null?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ki.call(arguments,2):i),en(e.type,a,n||e.key,r||e.ref,null)}Ki=Ma.slice,U={__e:function(e,t,i,n){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,n||{}),o=r.__d),o)return r.__E=r}catch(a){e=a}throw e}},Ea=0,xa=function(e){return e!=null&&e.constructor==null},tn.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},i),this.props)),e&&dt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ia(this))},tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ia(this))},tn.prototype.render=Dt,Yt=[],Aa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sa=function(e,t){return e.__v.__b-t.__v.__b},Mn.__r=0,La=/(PointerCapture)$|Capture$/i,Ur=0,Vr=Oa(!1),jr=Oa(!0);var Sh=0;function D(e,t,i,n,r,s){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Sh,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return U.vnode&&U.vnode(l),l}var nn,le,Wr,Va,Fn=0,ja=[],fe=U,Ga=fe.__b,za=fe.__r,Za=fe.diffed,qa=fe.__c,Wa=fe.unmount,Xa=fe.__;function Xr(e,t){fe.__h&&fe.__h(le,e,Fn||t),Fn=0;var i=le.__H||(le.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Kt(e){return Fn=1,Lh(Ja,e)}function Lh(e,t,i){var n=Xr(nn++,2);if(n.t=e,!n.__c&&(n.__=[Ja(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=le,!le.__f)){var r=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(u){return!!u.__c});if(d.every(function(u){return!u.__N}))return!s||s.call(this,a,c,l);var h=n.__c.props!==a;return d.forEach(function(u){if(u.__N){var p=u.__[0];u.__=u.__N,u.__N=void 0,p!==u.__[0]&&(h=!0)}}),s&&s.call(this,a,c,l)||h};le.__f=!0;var s=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}o&&o.call(this,a,c,l)},le.shouldComponentUpdate=r}return n.__N||n.__}function ot(e,t){var i=Xr(nn++,3);!fe.__s&&Ka(i.__H,t)&&(i.__=e,i.u=t,le.__H.__h.push(i))}function xe(e){return Fn=5,Bn(function(){return{current:e}},[])}function Bn(e,t){var i=Xr(nn++,7);return Ka(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Mh(){for(var e;e=ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dn),e.__H.__h.forEach(Yr),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){le=null,Ga&&Ga(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xa&&Xa(e,t)},fe.__r=function(e){za&&za(e),nn=0;var t=(le=e.__c).__H;t&&(Wr===le?(t.__h=[],le.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(Dn),t.__h.forEach(Yr),t.__h=[],nn=0)),Wr=le},fe.diffed=function(e){Za&&Za(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ja.push(t)!==1&&Va===fe.requestAnimationFrame||((Va=fe.requestAnimationFrame)||Th)(Mh)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),Wr=le=null},fe.__c=function(e,t){t.some(function(i){try{i.__h.forEach(Dn),i.__h=i.__h.filter(function(n){return!n.__||Yr(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],fe.__e(n,i.__v)}}),qa&&qa(e,t)},fe.unmount=function(e){Wa&&Wa(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{Dn(n)}catch(r){t=r}}),i.__H=void 0,t&&fe.__e(t,i.__v))};var Ya=typeof requestAnimationFrame=="function";function Th(e){var t,i=function(){clearTimeout(n),Ya&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,35);Ya&&(t=requestAnimationFrame(i))}function Dn(e){var t=le,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),le=t}function Yr(e){var t=le;e.__c=e.__(),le=t}function Ka(e,t){return!e||e.length!==t.length||t.some(function(i,n){return i!==e[n]})}function Ja(e,t){return typeof t=="function"?t(e):t}var Ih={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Fh=(e,t,i,n)=>{const r=f=>{var m=f,{color:s="currentColor",size:o=24,stroke:a=2,title:c,children:l,className:d="",class:h="",style:u}=m,p=ua(m,["color","size","stroke","title","children","className","class","style"]);return Ct("svg",Fe(qi(Fe({},Ih[e]),{width:String(o),height:String(o),class:["tabler-icon",`tabler-icon-${t}`,h,d].join(" "),"stroke-width":a,stroke:s,style:u}),p),[c&&Ct("title",{},c),...n.map(([v,g])=>Ct(v,g)),...Da(l)])};return r.displayName=`${i}`,r};var Bh=Fh("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Kr(){return(Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var Dh=["context","children"];function Rh(e){this.getChildContext=function(){return e.context};var t=e.children,i=function(n,r){if(n==null)return{};var s,o,a={},c=Object.keys(n);for(o=0;o<c.length;o++)r.indexOf(s=c[o])>=0||(a[s]=n[s]);return a}(e,Dh);return Ua(t,i)}function Oh(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Ct(Rh,Kr({},this._props,{context:e.detail.context}),function t(i,n){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var r=[],s={},o=0,a=i.attributes,c=i.childNodes;for(o=a.length;o--;)a[o].name!=="slot"&&(s[a[o].name]=a[o].value,s[Qa(a[o].name)]=a[o].value);for(o=c.length;o--;){var l=t(c[o],null),d=c[o].slot;d?s[d]=Ct(e1,{name:d},l):r[o]=l}var h=n?Ct(e1,null,r):r;return Ct(n||i.nodeName.toLowerCase(),s,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ha:In)(this._vdom,this._root)}function Qa(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function Ph(e,t,i){if(this._vdom){var n={};n[e]=i=i==null?void 0:i,n[Qa(e)]=i,this._vdom=Ua(this._vdom,n),In(this._vdom,this._root)}}function $h(){In(this._vdom=null,this._root)}function e1(e,t){var i=this;return Ct("slot",Kr({},e,{ref:function(n){n?(i.ref=n,i._listener||(i._listener=function(r){r.stopPropagation(),r.detail.context=t},n.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function t1(e,t,i,n){function r(){var s=Reflect.construct(HTMLElement,[],r);return s._vdomComponent=e,s._root=n&&n.shadow?s.attachShadow({mode:n.mode||"open"}):s,s}return(r.prototype=Object.create(HTMLElement.prototype)).constructor=r,r.prototype.connectedCallback=Oh,r.prototype.attributeChangedCallback=Ph,r.prototype.disconnectedCallback=$h,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),r.observedAttributes=i,i.forEach(function(s){Object.defineProperty(r.prototype,s,{get:function(){return this._vdom.props[s]},set:function(o){this._vdom?this.attributeChangedCallback(s,null,o):(this._props||(this._props={}),this._props[s]=o,this.connectedCallback());var a=typeof o;o!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,o)}})}),customElements.define(t||e.tagName||e.displayName||e.name,r)}const fi=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t;var Nh=Symbol.for("preact-signals");function Rn(){if(Rt>1)Rt--;else{for(var e,t=!1;rn!==void 0;){var i=rn;for(rn=void 0,Jr++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&s1(i))try{i.c()}catch(r){t||(e=r,t=!0)}i=n}}if(Jr=0,Rt--,t)throw e}}function Hh(e){if(Rt>0)return e();Rt++;try{return e()}finally{Rn()}}var V=void 0;function i1(e){var t=V;V=void 0;try{return e()}finally{V=t}}var rn=void 0,Rt=0,Jr=0,On=0;function n1(e){if(V!==void 0){var t=e.n;if(t===void 0||t.t!==V)return t={i:0,S:e,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:t},V.s!==void 0&&(V.s.n=t),V.s=t,e.n=t,32&V.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=V.s,t.n=void 0,V.s.n=t,V.s=t),t}}function Ee(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Ee.prototype.brand=Nh,Ee.prototype.h=function(){return!0},Ee.prototype.S=function(e){var t=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:i1(function(){var n;(n=t.W)==null||n.call(t)}))},Ee.prototype.U=function(e){var t=this;if(this.t!==void 0){var i=e.e,n=e.x;i!==void 0&&(i.x=n,e.e=void 0),n!==void 0&&(n.e=i,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&i1(function(){var r;(r=t.Z)==null||r.call(t)}))}},Ee.prototype.subscribe=function(e){var t=this;return sn(function(){var i=t.value,n=V;V=void 0;try{e(i)}finally{V=n}})},Ee.prototype.valueOf=function(){return this.value},Ee.prototype.toString=function(){return this.value+""},Ee.prototype.toJSON=function(){return this.value},Ee.prototype.peek=function(){var e=V;V=void 0;try{return this.value}finally{V=e}},Object.defineProperty(Ee.prototype,"value",{get:function(){var e=n1(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Jr>100)throw new Error("Cycle detected");this.v=e,this.i++,On++,Rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Rn()}}}});function r1(e,t){return new Ee(e,t)}function s1(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function o1(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function a1(e){for(var t=e.s,i=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=i}function Jt(e,t){Ee.call(this,void 0),this.x=e,this.s=void 0,this.g=On-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Jt.prototype=new Ee,Jt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===On))return!0;if(this.g=On,this.f|=1,this.i>0&&!s1(this))return this.f&=-2,!0;var e=V;try{o1(this),V=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return V=e,a1(this),this.f&=-2,!0},Jt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ee.prototype.S.call(this,e)},Jt.prototype.U=function(e){if(this.t!==void 0&&(Ee.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=n1(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Qr(e,t){return new Jt(e,t)}function c1(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Rt++;var i=V;V=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,es(e),n}finally{V=i,Rn()}}}function es(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,c1(e)}function Uh(e){if(V!==this)throw new Error("Out-of-order effect");a1(this),V=e,this.f&=-2,8&this.f&&es(this),Rn()}function mi(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}mi.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},mi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,c1(this),o1(this),Rt++;var e=V;return V=this,Uh.bind(this,e)},mi.prototype.N=function(){2&this.f||(this.f|=2,this.o=rn,rn=this)},mi.prototype.d=function(){this.f|=8,1&this.f||es(this)},mi.prototype.dispose=function(){this.d()};function sn(e){var t=new mi(e);try{t.c()}catch(n){throw t.d(),n}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var l1,Pn,ts,h1=[];sn(function(){l1=this.N})();function gi(e,t){U[e]=t.bind(null,U[e]||function(){})}function $n(e){ts&&ts(),ts=e&&e.S()}function d1(e){var t=this,i=e.data,n=se(i);n.value=i;var r=Bn(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=Qr(function(){var p=n.value.value;return p===0?0:p===!0?"":p||""}),d=Qr(function(){return!Array.isArray(l.value)&&!xa(l.value)}),h=sn(function(){if(this.N=u1,d.value){var p=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),u=t.__$u.d;return t.__$u.d=function(){h(),u.call(this)},[d,l]},[]),s=r[0],o=r[1];return s.value?o.peek():o.value}d1.displayName="_st",Object.defineProperties(Ee.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:d1},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),gi("__b",function(e,t){if(typeof t.type=="string"){var i,n=t.props;for(var r in n)if(r!=="children"){var s=n[r];s instanceof Ee&&(i||(t.__np=i={}),i[r]=s,n[r]=s.peek())}}e(t)}),gi("__r",function(e,t){if(t.type!==Dt){$n();var i,n=t.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=function(r){var s;return sn(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Pn=n,$n(i)}e(t)}),gi("__e",function(e,t,i,n){$n(),Pn=void 0,e(t,i,n)}),gi("diffed",function(e,t){$n(),Pn=void 0;var i;if(typeof t.type=="string"&&(i=t.__e)){var n=t.__np,r=t.props;if(n){var s=i.U;if(s)for(var o in s){var a=s[o];a!==void 0&&!(o in n)&&(a.d(),s[o]=void 0)}else s={},i.U=s;for(var c in n){var l=s[c],d=n[c];l===void 0?(l=Vh(i,c,d,r),s[c]=l):l.o(d,r)}}}e(t)});function Vh(e,t,i,n){var r=t in e&&e.ownerSVGElement===void 0,s=r1(i);return{o:function(o,a){s.value=o,n=a},d:sn(function(){this.N=u1;var o=s.value.value;n[t]!==o&&(n[t]=o,r?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}gi("unmount",function(e,t){if(typeof t.type=="string"){var i=t.__e;if(i){var n=i.U;if(n){i.U=void 0;for(var r in n){var s=n[r];s&&s.d()}}}}else{var o=t.__c;if(o){var a=o.__$u;a&&(o.__$u=void 0,a.d())}}e(t)}),gi("__h",function(e,t,i,n){(n<3||n===9)&&(t.__$f|=2),e(t,i,n)}),tn.prototype.shouldComponentUpdate=function(e,t){var i=this.__$u,n=i&&i.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function se(e,t){return Bn(function(){return r1(e,t)},[])}function is(e,t){var i=xe(e);return i.current=e,Pn.__$f|=4,Bn(function(){return Qr(function(){return i.current()},t)},[])}var jh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Gh(){Hh(function(){for(var e;e=h1.shift();)l1.call(e)})}function u1(){h1.push(this)===1&&(U.requestAnimationFrame||jh)(Gh)}var ns,p1;function rs(){if(p1)return ns;p1=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return ns=e,ns}var ss,f1;function zh(){if(f1)return ss;f1=1;var e=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln;return ss=e,ss}var os,m1;function g1(){if(m1)return os;m1=1;var e=zh(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return os=i,os}var as,v1;function Zh(){if(v1)return as;v1=1;var e=g1(),t=function(){return e.Date.now()};return as=t,as}var cs,b1;function qh(){if(b1)return cs;b1=1;var e=/\s/;function t(i){for(var n=i.length;n--&&e.test(i.charAt(n)););return n}return cs=t,cs}var ls,w1;function Wh(){if(w1)return ls;w1=1;var e=qh(),t=/^\s+/;function i(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ls=i,ls}var hs,y1;function _1(){if(y1)return hs;y1=1;var e=g1(),t=e.Symbol;return hs=t,hs}var ds,C1;function Xh(){if(C1)return ds;C1=1;var e=_1(),t=Object.prototype,i=t.hasOwnProperty,n=t.toString,r=e?e.toStringTag:void 0;function s(o){var a=i.call(o,r),c=o[r];try{o[r]=void 0;var l=!0}catch(h){}var d=n.call(o);return l&&(a?o[r]=c:delete o[r]),d}return ds=s,ds}var us,E1;function Yh(){if(E1)return us;E1=1;var e=Object.prototype,t=e.toString;function i(n){return t.call(n)}return us=i,us}var ps,x1;function Kh(){if(x1)return ps;x1=1;var e=_1(),t=Xh(),i=Yh(),n="[object Null]",r="[object Undefined]",s=e?e.toStringTag:void 0;function o(a){return a==null?a===void 0?r:n:s&&s in Object(a)?t(a):i(a)}return ps=o,ps}var fs,k1;function Jh(){if(k1)return fs;k1=1;function e(t){return t!=null&&typeof t=="object"}return fs=e,fs}var ms,A1;function Qh(){if(A1)return ms;A1=1;var e=Kh(),t=Jh(),i="[object Symbol]";function n(r){return typeof r=="symbol"||t(r)&&e(r)==i}return ms=n,ms}var gs,S1;function ed(){if(S1)return gs;S1=1;var e=Wh(),t=rs(),i=Qh(),n=NaN,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(i(l))return n;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var h=s.test(l);return h||o.test(l)?a(l.slice(2),h?2:8):r.test(l)?n:+l}return gs=c,gs}var vs,L1;function td(){if(L1)return vs;L1=1;var e=rs(),t=Zh(),i=ed(),n="Expected a function",r=Math.max,s=Math.min;function o(a,c,l){var d,h,u,p,f,m,v=0,g=!1,b=!1,_=!0;if(typeof a!="function")throw new TypeError(n);c=i(c)||0,e(l)&&(g=!!l.leading,b="maxWait"in l,u=b?r(i(l.maxWait)||0,c):u,_="trailing"in l?!!l.trailing:_);function E(Z){var ue=d,pe=h;return d=h=void 0,v=Z,p=a.apply(pe,ue),p}function M(Z){return v=Z,f=setTimeout(I,c),g?E(Z):p}function w(Z){var ue=Z-m,pe=Z-v,Ae=c-ue;return b?s(Ae,u-pe):Ae}function T(Z){var ue=Z-m,pe=Z-v;return m===void 0||ue>=c||ue<0||b&&pe>=u}function I(){var Z=t();if(T(Z))return O(Z);f=setTimeout(I,w(Z))}function O(Z){return f=void 0,_&&d?E(Z):(d=h=void 0,p)}function be(){f!==void 0&&clearTimeout(f),v=0,d=m=h=f=void 0}function ce(){return f===void 0?p:O(t())}function re(){var Z=t(),ue=T(Z);if(d=arguments,h=this,m=Z,ue){if(f===void 0)return M(m);if(b)return clearTimeout(f),f=setTimeout(I,c),E(m)}return f===void 0&&(f=setTimeout(I,c)),p}return re.cancel=be,re.flush=ce,re}return vs=o,vs}var bs,M1;function id(){if(M1)return bs;M1=1;var e=td(),t=rs(),i="Expected a function";function n(r,s,o){var a=!0,c=!0;if(typeof r!="function")throw new TypeError(i);return t(o)&&(a="leading"in o?!!o.leading:a,c="trailing"in o?!!o.trailing:c),e(r,s,{leading:a,maxWait:s,trailing:c})}return bs=n,bs}var nd=id();const T1=wa(nd),rd=(e="user")=>{var v;const t=xe(null),i=xe(null),[n,r]=Kt(e),[s,o]=Kt(!1),a=xe(null),c=xe(!1),l=xe(new Set),d=g=>{a.current=g};ot(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const _=setTimeout(()=>{var E;(E=a.current)==null||E.call(a),c.current=!1,l.current.delete(_)},100);l.current.add(_)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(_=>clearTimeout(_)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),ot(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const h=(g,b)=>L(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(be=>be.stop()),i.current=null),t.current&&(t.current.srcObject=null);const _=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||n}});i.current=_;const w=_.getVideoTracks()[0].getSettings().facingMode;(w&&w!==(g||n)||w&&w!==n)&&r(w);const O=(yield navigator.mediaDevices.enumerateDevices()).find(be=>be.kind==="videoinput"&&_.getVideoTracks()[0].getSettings().deviceId===be.deviceId);b==null||b(O==null?void 0:O.label),t.current&&(t.current.srcObject=_,yield t.current.play())}catch(_){console.error("Failed to start camera:",_)}}),u=()=>L(this,null,function*(){const g=n==="user"?"environment":"user";c.current=!0;const b=n;try{r(g),i.current&&(i.current.getTracks().forEach(_=>_.stop()),i.current=null),yield h(g)}catch(_){r(b),c.current=!1;try{yield h(b)}catch(E){console.error("Failed to restore previous camera:",E)}}}),p=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),_="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",E=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||_||E,isChromium:g.includes("chrome")||g.includes("chromium")||g.includes("edge"),isWebKit:g.includes("webkit")&&!g.includes("chrome")}};return{videoRef:t,streamRef:i,facingMode:n,agentSupported:s,startCamera:h,switchCamera:u,checkAgentSupport:()=>L(this,null,function*(){var g,b;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){o(!0);return}const{isGecko:E}=p();let M=null,w=null;try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});M=(g=I.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,I.getTracks().forEach(O=>O.stop())}catch(I){}try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});w=(b=I.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,I.getTracks().forEach(O=>O.stop())}catch(I){}if(!(M&&w&&M!==w)){o(!1);return}o(!E)}catch(_){o(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(g=>g.stop()),i.current=null),t.current&&(t.current.srcObject=null,t.current.load())},registerCameraSwitchCallback:d}};var vi=typeof self!="undefined"?self:{};function Qt(){throw Error("Invalid UTF8")}function I1(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Nn,ws;const sd=typeof TextDecoder!="undefined";let od;const ad=typeof TextEncoder!="undefined";function F1(e){if(ad)e=(od||(od=new TextEncoder)).encode(e);else{let i=0;const n=new Uint8Array(3*e.length);for(let r=0;r<e.length;r++){var t=e.charCodeAt(r);if(t<128)n[i++]=t;else{if(t<2048)n[i++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&r<e.length){const s=e.charCodeAt(++r);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,n[i++]=t>>18|240,n[i++]=t>>12&63|128,n[i++]=t>>6&63|128,n[i++]=63&t|128;continue}r--}t=65533}n[i++]=t>>12|224,n[i++]=t>>6&63|128}n[i++]=63&t|128}}e=i===n.length?n:n.subarray(0,i)}return e}var ys,Hn;e:{for(var B1=["CLOSURE_FLAGS"],_s=vi,Cs=0;Cs<B1.length;Cs++)if((_s=_s[B1[Cs]])==null){Hn=null;break e}Hn=_s}var on,D1=Hn&&Hn[610401301];ys=D1!=null&&D1;const R1=vi.navigator;function Es(e){return!!ys&&!!on&&on.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Xe(e){var t;return(t=vi.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Ot(){return!!ys&&!!on&&on.brands.length>0}function xs(){return Ot()?Es("Chromium"):(Xe("Chrome")||Xe("CriOS"))&&!(!Ot()&&Xe("Edge"))||Xe("Silk")}function Un(e){return Un[" "](e),e}on=R1&&R1.userAgentData||null,Un[" "]=function(){};var cd=!Ot()&&(Xe("Trident")||Xe("MSIE"));!Xe("Android")||xs(),xs(),Xe("Safari")&&(xs()||!Ot()&&Xe("Coast")||!Ot()&&Xe("Opera")||!Ot()&&Xe("Edge")||(Ot()?Es("Microsoft Edge"):Xe("Edg/"))||Ot()&&Es("Opera"));var O1={},an=null;function ld(e){const t=e.length;let i=3*t/4;i%3?i=Math.floor(i):"=.".indexOf(e[t-1])!=-1&&(i="=.".indexOf(e[t-2])!=-1?i-2:i-1);const n=new Uint8Array(i);let r=0;return function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=an[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}P1();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),u=a(64);if(u===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),u!=64&&o(h<<6&192|u))}}(e,function(s){n[r++]=s}),r!==i?n.subarray(0,r):n}function P1(){if(!an){an={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const n=e.concat(t[i].split(""));O1[i]=n;for(let r=0;r<n.length;r++){const s=n[r];an[s]===void 0&&(an[s]=r)}}}}var $1=typeof Uint8Array!="undefined",N1=!cd&&typeof btoa=="function";function H1(e){if(!N1){var t;t===void 0&&(t=0),P1(),t=O1[t];var i=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var r=e[c],s=e[c+1],o=e[c+2],a=t[r>>2];r=t[(3&r)<<4|s>>4],s=t[(15&s)<<2|o>>6],o=t[63&o],i[l++]=a+r+s+o}switch(a=0,o=n,e.length-c){case 2:o=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],i[l]=t[e>>2]+t[(3&e)<<4|a>>4]+o+n}return i.join("")}for(t="",i=0,n=e.length-10240;i<n;)t+=String.fromCharCode.apply(null,e.subarray(i,i+=10240));return t+=String.fromCharCode.apply(null,i?e.subarray(i):e),btoa(t)}const U1=/[-_.]/g,hd={"-":"+",_:"/",".":"="};function dd(e){return hd[e]||""}function V1(e){if(!N1)return ld(e);U1.test(e)&&(e=e.replace(U1,dd)),e=atob(e);const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function ei(e){return $1&&e!=null&&e instanceof Uint8Array}var bi={};function ti(){return ud||(ud=new Et(null,bi))}function ks(e){j1(bi);var t=e.g;return(t=t==null||ei(t)?t:typeof t=="string"?V1(t):null)==null?t:e.g=t}var Et=class{h(){return new Uint8Array(ks(this)||0)}constructor(e,t){if(j1(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let ud,As;function j1(e){if(e!==bi)throw Error("illegal external caller")}function G1(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Ss(e){return G1(e=Error(e),"warning"),e}function Ls(e){if(e!=null){var t=As!=null?As:As={},i=t[e]||0;i>=5||(t[e]=i+1,G1(e=Error(),"incident"),function(n){vi.setTimeout(()=>{throw n},0)}(e))}}var Vn=typeof Symbol=="function"&&typeof Symbol()=="symbol";function wi(e,t,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var pd=wi("jas",void 0,!0),z1=wi(void 0,"0di"),cn=wi(void 0,"1oa"),yi=wi(void 0,Symbol()),fd=wi(void 0,"0actk"),Z1=wi(void 0,"8utk");const k=Vn?pd:"Ea",q1={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},W1=Object.defineProperties;function jn(e,t){Vn||k in e||W1(e,q1),e[k]|=t}function me(e,t){Vn||k in e||W1(e,q1),e[k]=t}function _i(e){return jn(e,34),e}function md(e,t){me(t,-15615&(0|e))}function Ms(e,t){me(t,-15581&(34|e))}function Gn(){return typeof BigInt=="function"}function Be(e){return Array.prototype.slice.call(e)}var Ts,ln={};function zn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Is(e,t){if(e!=null){if(typeof e=="string")e=e?new Et(e,bi):ti();else if(e.constructor!==Et)if(ei(e))e=e.length?new Et(new Uint8Array(e),bi):ti();else{if(!t)throw Error();e=void 0}}return e}const X1=[];function Pt(e){if(2&e)throw Error()}me(X1,55),Ts=Object.freeze(X1);class Y1{constructor(t,i,n){this.g=t,this.h=i,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function Fs(e){return yi?e[yi]:void 0}var gd=Object.freeze({});function Zn(e){return e.Na=!0,e}var vd=Zn(e=>typeof e=="number"),K1=Zn(e=>typeof e=="string"),bd=Zn(e=>typeof e=="boolean"),qn=typeof vi.BigInt=="function"&&typeof vi.BigInt(0)=="bigint";function $t(e){var t=e;if(K1(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(vd(t)&&!Number.isSafeInteger(t))throw Error(String(t));return qn?BigInt(e):e=bd(e)?e?"1":"0":K1(e)?e.trim()||"0":String(e)}var Bs=Zn(e=>qn?e>=yd&&e<=Cd:e[0]==="-"?J1(e,wd):J1(e,_d));const wd=Number.MIN_SAFE_INTEGER.toString(),yd=qn?BigInt(Number.MIN_SAFE_INTEGER):void 0,_d=Number.MAX_SAFE_INTEGER.toString(),Cd=qn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function J1(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let i=0;i<e.length;i++){const n=e[i],r=t[i];if(n>r)return!1;if(n<r)return!0}}const Ed=typeof Uint8Array.prototype.slice=="function";let Q1,q=0,oe=0;function ec(e){const t=e>>>0;q=t,oe=(e-t)/4294967296>>>0}function ii(e){if(e<0){ec(-e);const[t,i]=Ps(q,oe);q=t>>>0,oe=i>>>0}else ec(e)}function Ds(e){const t=Q1||(Q1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),oe=0,q=t.getUint32(0,!0)}function Rs(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:hn(e,t)}function Os(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Rs(e,t))=="number"?i?-e:e:i?"-"+e:e}function hn(e,t){if(e>>>=0,(t>>>=0)<=2097151)var i=""+(4294967296*t+e);else Gn()?i=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(i=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,e>=1e7&&(i+=e/1e7>>>0,e%=1e7),i>=1e7&&(t+=i/1e7>>>0,i%=1e7),i=t+tc(i)+tc(e));return i}function tc(e){return e=String(e),"0000000".slice(e.length)+e}function ic(){var e=q,t=oe;if(2147483648&t)if(Gn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,n]=Ps(e,t);e="-"+hn(i,n)}else e=hn(e,t);return e}function Wn(e){if(e.length<16)ii(Number(e));else if(Gn())e=BigInt(e),q=Number(e&BigInt(4294967295))>>>0,oe=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");oe=q=0;const i=e.length;for(let n=t,r=(i-t)%6+t;r<=i;n=r,r+=6){const s=Number(e.slice(n,r));oe*=1e6,q=1e6*q+s,q>=4294967296&&(oe+=Math.trunc(q/4294967296),oe>>>=0,q>>>=0)}if(t){const[n,r]=Ps(q,oe);q=n,oe=r}}}function Ps(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const dn=typeof BigInt=="function"?BigInt.asIntN:void 0,xd=typeof BigInt=="function"?BigInt.asUintN:void 0,Nt=Number.isSafeInteger,Xn=Number.isFinite,Ci=Math.trunc,kd=$t(0);function Ht(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function nc(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Ad=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function un(e){switch(typeof e){case"bigint":return!0;case"number":return Xn(e);case"string":return Ad.test(e);default:return!1}}function Ei(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?0|e:void 0}function rc(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?e>>>0:void 0}function sc(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function oc(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function ac(e){return oc(e)?e:(Wn(e),ic())}function $s(e){return e=Ci(e),Nt(e)||(ii(e),e=Os(q,oe)),e}function cc(e){var t=Ci(Number(e));return Nt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),ac(e))}function lc(e){var t=Ci(Number(e));return Nt(t)?$t(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gn()?$t(dn(64,BigInt(e))):$t(ac(e)))}function hc(e){if(Nt(e))e=$t($s(e));else{if(e=Ci(e),Nt(e))e=String(e);else{const t=String(e);oc(t)?e=t:(ii(e),e=ic())}e=$t(e)}return e}function Ns(e){return e==null?e:typeof e=="bigint"?(Bs(e)?e=Number(e):(e=dn(64,e),e=Bs(e)?Number(e):String(e)),e):un(e)?typeof e=="number"?$s(e):cc(e):void 0}function Sd(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(xd(64,e));if(un(e)){if(t==="string")return t=Ci(Number(e)),Nt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),sc(e)||(Wn(e),e=hn(q,oe))),e;if(t==="number")return(e=Ci(e))>=0&&Nt(e)?e:function(i){if(i<0){ii(i);var n=hn(q,oe);return i=Number(n),Nt(i)?i:n}return sc(n=String(i))?n:(ii(i),Rs(q,oe))}(e)}}function dc(e){if(typeof e!="string")throw Error();return e}function xi(e){if(e!=null&&typeof e!="string")throw Error();return e}function ki(e){return e==null||typeof e=="string"?e:void 0}function Hs(e,t,i,n){if(e!=null&&typeof e=="object"&&e.W===ln)return e;if(!Array.isArray(e))return i?2&n?((e=t[z1])||(_i((e=new t).u),e=t[z1]=e),t=e):t=new t:t=void 0,t;let r=i=0|e[k];return r===0&&(r|=32&n),r|=2&n,r!==i&&me(e,r),new t(e)}function Ld(e,t,i){if(t)e:{if(!un(t=e))throw Ss("int64");switch(typeof t){case"string":t=lc(t);break e;case"bigint":t=$t(dn(64,t));break e;default:t=hc(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?$t(dn(64,t)):un(t)?e==="string"?lc(t):hc(t):void 0;return(e=t)==null?i?kd:void 0:e}function Md(e){return e}const Td={};let Id=function(){try{return Un(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class Us{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,i){return this.g.set(t,i),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}[Symbol.iterator](){return this.entries()}}const Fd=Id?(Object.setPrototypeOf(Us.prototype,Map.prototype),Object.defineProperties(Us.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Us):class extends Map{constructor(){super()}};function uc(e){return e}function Vs(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var ut=class extends Fd{constructor(e,t,i=uc,n=uc){super();let r=0|e[k];r|=64,me(e,r),this.M=r,this.I=t,this.S=i,this.X=this.I?Bd:n;for(let s=0;s<e.length;s++){const o=e[s],a=i(o[0],!1,!0);let c=o[1];t?c===void 0&&(c=null):c=n(o[1],!1,!0,void 0,void 0,r),super.set(a,c)}}La(){var e=$d;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=Dd){const t=[],i=super.entries();for(var n;!(n=i.next()).done;)(n=n.value)[0]=e(n[0]),n[1]=e(n[1]),t.push(n);return t}clear(){Vs(this),super.clear()}delete(e){return Vs(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Y1(e,Rd,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Y1(e,ut.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((i,n,r)=>{e.call(t,r.get(n),n,r)}):super.forEach(e,t)}set(e,t){return Vs(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var i=this.I;return i?((i=this.X(t,!1,!0,i,this.pa,this.M))!==t&&super.set(e,i),i):t}}[Symbol.iterator](){return this.entries()}};function Bd(e,t,i,n,r,s){return e=Hs(e,n,i,s),r&&(e=Qn(e)),e}function Dd(e){return e}function Rd(e){return[e,this.get(e)]}let Od,Yn,pc,Pd;function fc(){return Od||(Od=new ut(_i([]),void 0,void 0,void 0,Td))}function js(e,t,i,n,r){if(e!=null){if(Array.isArray(e)){const s=0|e[k];return e.length===0&&1&s?void 0:r&&2&s?e:Kn(e,t,i,n!==void 0,r)}return t(e,n)}}function Kn(e,t,i,n,r){const s=n||i?0|e[k]:0,o=n?!!(32&s):void 0;let a=0;const c=(n=Be(e)).length;for(let f=0;f<c;f++){var l=n[f];if(f===c-1&&zn(l)){var d=t,h=i,u=o,p=r;let m;for(let v in l){const g=js(l[v],d,h,u,p);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=js(n[f],t,i,o,r);n[f]=l,l!=null&&(a=f+1)}return a<c&&(n.length=a),i&&((e=Fs(e))&&(n[yi]=Be(e)),i(s,n)),n}function $d(e){return js(e,Gs,void 0,void 0,!1)}function Gs(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Bs(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(ei(e))return ei(e)&&Ls(Z1),H1(e);if(e.W===ln)return mc(e);if(e instanceof Et){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=H1(t)}return e instanceof ut?e.La():void 0}return e}function mc(e){var t=e.u;e=Kn(t,Gs,void 0,void 0,!1);var i=0|t[k];if((t=e.length)&&!(512&i)){var n=e[t-1],r=!1;zn(n)?(t--,r=!0):n=void 0;var s=t-(i=512&i?0:-1),o=(Yn!=null?Yn:Md)(s,i,e,n);if(n&&(e[t]=void 0),s<o&&n){for(var a in s=!0,n){const c=+a;c<=o?(e[r=c+i]=n[a],t=Math.max(r+1,t),r=!1,delete n[a]):s=!1}s&&(n=void 0)}for(s=t-1;t>0;s=t-1)if((a=e[s])==null)t--,r=!0;else{if(!((s-=i)>=o))break;(n!=null?n:n={})[s]=a,t--,r=!0}r&&(e.length=t),n&&e.push(n)}return e}function Ut(e,t,i){return e=gc(e,t[0],t[1],i?1:2),t!==pc&&i&&jn(e,8192),e}function gc(e,t,i,n){if(e==null){var r=96;i?(e=[i],r|=512):e=[],t&&(r=-16760833&r|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(r=0|e[k])||!(64&r)||2&r||Ls(fd),1024&r)throw Error("farr");if(64&r)return e;if(n===1||n===2||(r|=64),i&&(r|=512,i!==e[0]))throw Error("mid");e:{var s=(i=e).length;if(s){var o=s-1;if(zn(n=i[o])){if((o-=t=512&(r|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(s=+a)<o&&(i[s+t]=n[a],delete n[a]);r=-16760833&r|(1023&o)<<14;break e}}if(t){if((a=Math.max(t,s-(512&r?0:-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&a)<<14}}}return me(e,r),e}function zs(e,t,i=Ms){if(e!=null){if($1&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[k];return 2&n?e:(t&&(t=n===0||!!(32&n)&&!(64&n||!(16&n))),t?(me(e,34|n),4&n&&Object.freeze(e),e):Kn(e,zs,4&n?Ms:i,!0,!0))}return e.W===ln?e=2&(n=0|(i=e.u)[k])?e:new e.constructor(Jn(i,n,!0)):e instanceof ut&&!(2&e.M)&&(i=_i(e.da(zs)),e=new ut(i,e.I,e.S,e.X)),e}}function Jn(e,t,i){const n=i||2&t?Ms:md,r=!!(32&t);return e=function(s,o,a){const c=Be(s);var l=c.length;const d=256&o?c[l-1]:void 0;for(l+=d?-1:0,o=512&o?1:0;o<l;o++)c[o]=a(c[o]);if(d){o=c[o]={};for(const h in d)o[h]=a(d[h])}return(s=Fs(s))&&(c[yi]=Be(s)),c}(e,t,s=>zs(s,r,n)),jn(e,32|(i?2:0)),e}function Qn(e){const t=e.u,i=0|t[k];return 2&i?new e.constructor(Jn(t,i,!1)):e}function Ai(e,t){return xt(e=e.u,0|e[k],t)}function xt(e,t,i){if(i===-1)return null;const n=i+(512&t?0:-1),r=e.length-1;return n>=r&&256&t?e[r][i]:n<=r?e[n]:void 0}function W(e,t,i){const n=e.u;let r=0|n[k];return Pt(r),ne(n,r,t,i),e}function ne(e,t,i,n){const r=512&t?0:-1,s=i+r;var o=e.length-1;return s>=o&&256&t?(e[o][i]=n,t):s<=o?(e[s]=n,t):(n!==void 0&&(i>=(o=t>>14&1023||536870912)?n!=null&&(e[o+r]={[i]:n},me(e,t|=256)):e[s]=n),t)}function er(e,t){let i=0|(e=e.u)[k];const n=xt(e,i,t),r=Ht(n);return r!=null&&r!==n&&ne(e,i,t,r),r}function vc(e){let t=0|(e=e.u)[k];const i=xt(e,t,1),n=Is(i,!0);return n!=null&&n!==i&&ne(e,t,1,n),n}function ni(){return gd===void 0?2:4}function ri(e,t,i,n,r){const s=e.u,o=2&(e=0|s[k])?1:n;r=!!r;let a=0|(n=Zs(s,e,t))[k];if(!(4&a)){4&a&&(n=Be(n),a=St(a,e),e=ne(s,e,t,n));let c=0,l=0;for(;c<n.length;c++){const d=i(n[c]);d!=null&&(n[l++]=d)}l<c&&(n.length=l),a=qs(a,e),i=-2049&(20|a),a=i&=-4097,me(n,a),2&a&&Object.freeze(n)}return o===1||o===4&&32&a?kt(a)||(r=a,a|=2,a!==r&&me(n,a),Object.freeze(n)):(o===2&&kt(a)&&(n=Be(n),a=St(a,e),a=Vt(a,e,r),me(n,a),e=ne(s,e,t,n)),kt(a)||(t=a,a=Vt(a,e,r),a!==t&&me(n,a))),n}function Zs(e,t,i){return e=xt(e,t,i),Array.isArray(e)?e:Ts}function qs(e,t){return e===0&&(e=St(e,t)),1|e}function kt(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function bc(e){e=Be(e);for(let t=0;t<e.length;t++){const i=e[t]=Be(e[t]);Array.isArray(i[1])&&(i[1]=_i(i[1]))}return e}function Ws(e,t,i,n){let r=0|(e=e.u)[k];Pt(r),ne(e,r,t,(n==="0"?Number(i)===0:i===n)?void 0:i)}function Si(e,t,i,n){Pt(t);let r=Zs(e,t,i);const s=r!==Ts;if(64&t||!(8192&t)||!s){const o=s?0|r[k]:0;let a=o;(!s||2&a||kt(a)||4&a&&!(32&a))&&(r=Be(r),a=St(a,t),t=ne(e,t,i,r)),a=-13&qs(a,t),a=Vt(n?-17&a:16|a,t,!0),a!==o&&me(r,a)}return r}function Xs(e,t){var i=bl;return Ks(Ys(e=e.u),e,0|e[k],i)===t?t:-1}function Ys(e){var i;if(Vn)return(i=e[cn])!=null?i:e[cn]=new Map;if(cn in e)return e[cn];const t=new Map;return Object.defineProperty(e,cn,{value:t}),t}function wc(e,t,i,n){const r=Ys(e),s=Ks(r,e,t,i);return s!==n&&(s&&(t=ne(e,t,s)),r.set(i,n)),t}function Ks(e,t,i,n){let r=e.get(n);if(r!=null)return r;r=0;for(let s=0;s<n.length;s++){const o=n[s];xt(t,i,o)!=null&&(r!==0&&(i=ne(t,i,r)),r=o)}return e.set(n,r),r}function Js(e,t,i){let n=0|e[k];const r=xt(e,n,i);let s;if(r!=null&&r.W===ln)return(t=Qn(r))!==r&&ne(e,n,i,t),t.u;if(Array.isArray(r)){const o=0|r[k];s=2&o?Ut(Jn(r,o,!1),t,!0):64&o?r:Ut(s,t,!0)}else s=Ut(void 0,t,!0);return s!==r&&ne(e,n,i,s),s}function yc(e,t,i){let n=0|(e=e.u)[k];const r=xt(e,n,i);return(t=Hs(r,t,!1,n))!==r&&t!=null&&ne(e,n,i,t),t}function N(e,t,i){if((t=yc(e,t,i))==null)return t;let n=0|(e=e.u)[k];if(!(2&n)){const r=Qn(t);r!==t&&ne(e,n,i,t=r)}return t}function _c(e,t,i,n,r,s,o){e=e.u;var a=!!(2&t);const c=a?1:r;s=!!s,o&&(o=!a);var l=0|(r=Zs(e,t,n))[k];if(!(a=!!(4&l))){var d=r,h=t;const u=!!(2&(l=qs(l,t)));u&&(h|=2);let p=!u,f=!0,m=0,v=0;for(;m<d.length;m++){const g=Hs(d[m],i,!1,h);if(g instanceof i){if(!u){const b=!!(2&(0|g.u[k]));p&&(p=!b),f&&(f=b)}d[v++]=g}}v<m&&(d.length=v),l|=4,l=f?16|l:-17&l,me(d,l=p?8|l:-9&l),u&&Object.freeze(d)}if(o&&!(8&l||!r.length&&(c===1||c===4&&32&l))){for(kt(l)&&(r=Be(r),l=St(l,t),t=ne(e,t,n,r)),i=r,o=l,d=0;d<i.length;d++)(l=i[d])!==(h=Qn(l))&&(i[d]=h);o|=8,me(i,o=i.length?-17&o:16|o),l=o}return c===1||c===4&&32&l?kt(l)||(t=l,(l|=!r.length||16&l&&(!a||32&l)?2:1024)!==t&&me(r,l),Object.freeze(r)):(c===2&&kt(l)&&(me(r=Be(r),l=Vt(l=St(l,t),t,s)),t=ne(e,t,n,r)),kt(l)||(n=l,(l=Vt(l,t,s))!==n&&me(r,l))),r}function At(e,t,i){const n=0|e.u[k];return _c(e,n,t,i,ni(),!1,!(2&n))}function S(e,t,i,n){return n==null&&(n=void 0),W(e,i,n)}function pn(e,t,i,n){n==null&&(n=void 0);e:{let r=0|(e=e.u)[k];if(Pt(r),n==null){const s=Ys(e);if(Ks(s,e,r,i)!==t)break e;s.set(i,0)}else r=wc(e,r,i,t);ne(e,r,t,n)}}function St(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Vt(e,t,i){return 32&t&&i||(e&=-33),e}function tr(e,t,i){Pt(0|e.u[k]),ri(e,t,ki,2,!0).push(dc(i))}function ir(e,t,i,n){const r=0|e.u[k];Pt(r),e=_c(e,r,i,t,2,!0),n=n!=null?n:new i,e.push(n),e[k]=2&(0|n.u[k])?-9&e[k]:-17&e[k]}function Ye(e,t){return Ei(Ai(e,t))}function Ke(e,t){return ki(Ai(e,t))}function he(e,t){var i;return(i=er(e,t))!=null?i:0}function fn(e,t,i){if(i!=null&&typeof i!="boolean")throw e=typeof i,Error(`Expected boolean but got ${e!="object"?e:i?Array.isArray(i)?"array":e:"null"}: ${i}`);W(e,t,i)}function pt(e,t,i){if(i!=null){if(typeof i!="number"||!Xn(i))throw Ss("int32");i|=0}W(e,t,i)}function x(e,t,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);W(e,t,i)}function nr(e,t,i){{const o=e.u;let a=0|o[k];if(Pt(a),i==null)ne(o,a,t);else{var n=e=0|i[k],r=kt(e),s=r||Object.isFrozen(i);for(r||(e=0),s||(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),e|=21,r=0;r<i.length;r++){const c=i[r],l=dc(c);Object.is(c,l)||(s&&(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),i[r]=l)}e!==n&&(s&&(i=Be(i),e=Vt(e=St(e,a),a,!0)),me(i,e)),ne(o,a,t,i)}}}function Cc(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Qs(){return Error("Failed to read varint, encoding is invalid.")}function Ec(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function eo(e){if(typeof e=="string")return{buffer:V1(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Et)return{buffer:ks(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function to(e,t){let i,n=0,r=0,s=0;const o=e.h;let a=e.g;do i=o[a++],n|=(127&i)<<s,s+=7;while(s<32&&128&i);for(s>32&&(r|=(127&i)>>4),s=3;s<32&&128&i;s+=7)i=o[a++],r|=(127&i)<<s;if(si(e,a),i<128)return t(n>>>0,r>>>0);throw Qs()}function io(e){let t=0,i=e.g;const n=i+10,r=e.h;for(;i<n;){const s=r[i++];if(t|=s,(128&s)==0)return si(e,i),!!(127&t)}throw Qs()}function jt(e){const t=e.h;let i=e.g,n=t[i++],r=127&n;if(128&n&&(n=t[i++],r|=(127&n)<<7,128&n&&(n=t[i++],r|=(127&n)<<14,128&n&&(n=t[i++],r|=(127&n)<<21,128&n&&(n=t[i++],r|=n<<28,128&n&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++])))))throw Qs();return si(e,i),r}function Lt(e){return jt(e)>>>0}function no(e){var t=e.h;const i=e.g,n=t[i],r=t[i+1],s=t[i+2];return t=t[i+3],si(e,e.g+4),(n<<0|r<<8|s<<16|t<<24)>>>0}function ro(e){var t=no(e);e=2*(t>>31)+1;const i=t>>>23&255;return t&=8388607,i==255?t?NaN:e*(1/0):i==0?1401298464324817e-60*e*t:e*Math.pow(2,i-150)*(t+8388608)}function Nd(e){return jt(e)}function so(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=eo(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function si(e,t){if(e.g=t,t>e.l)throw Ec(e.l,t)}function xc(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const i=e.g,n=i+t;if(n>e.l)throw Ec(t,e.l-i);return e.g=n,i}function kc(e,t){if(t==0)return ti();var i=xc(e,t);return e.aa&&e.m?i=e.h.subarray(i,i+t):(e=e.h,i=i===(t=i+t)?new Uint8Array(0):Ed?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?ti():new Et(i,bi)}ut.prototype.toJSON=void 0;var Ac=[];function Sc(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Lt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw Cc(i,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=i,!0}function rr(e){switch(e.h){case 0:e.h!=0?rr(e):io(e.g);break;case 1:si(e=e.g,e.g+8);break;case 2:if(e.h!=2)rr(e);else{var t=Lt(e.g);si(e=e.g,e.g+t)}break;case 5:si(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Sc(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}rr(e)}break;default:throw Cc(e.h,e.l)}}function mn(e,t,i){const n=e.g.l,r=Lt(e.g),s=e.g.g+r;let o=s-n;if(o<=0&&(e.g.l=s,i(t,e,void 0,void 0,void 0),o=s-e.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${r} bytes, instead read ${r-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=s,e.g.l=n,t}function oo(e){var t=Lt(e.g),i=xc(e=e.g,t);if(e=e.h,sd){var n,r=e;(n=ws)||(n=ws=new TextDecoder("utf-8",{fatal:!0})),t=i+t,r=i===0&&t===r.length?r:r.subarray(i,t);try{var s=n.decode(r)}catch(a){if(Nn===void 0){try{n.decode(new Uint8Array([128]))}catch(c){}try{n.decode(new Uint8Array([97])),Nn=!0}catch(c){Nn=!1}}throw!Nn&&(ws=void 0),a}}else{t=(s=i)+t,i=[];let a,c=null;for(;s<t;){var o=e[s++];o<128?i.push(o):o<224?s>=t?Qt():(a=e[s++],o<194||(192&a)!=128?(s--,Qt()):i.push((31&o)<<6|63&a)):o<240?s>=t-1?Qt():(a=e[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(n=e[s++]))!=128?(s--,Qt()):i.push((15&o)<<12|(63&a)<<6|63&n)):o<=244?s>=t-2?Qt():(a=e[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(n=e[s++]))!=128||(192&(r=e[s++]))!=128?(s--,Qt()):(o=(7&o)<<18|(63&a)<<12|(63&n)<<6|63&r,o-=65536,i.push(55296+(o>>10&1023),56320+(1023&o)))):Qt(),i.length>=8192&&(c=I1(c,i),i.length=0)}s=I1(c,i)}return s}function Lc(e){const t=Lt(e.g);return kc(e.g,t)}function sr(e,t,i){var n=Lt(e.g);for(n=e.g.g+n;e.g.g<n;)i.push(t(e.g))}var or=[];function at(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var C=class{constructor(e,t){this.u=gc(e,t)}toJSON(){try{var e=mc(this)}finally{Yn=void 0}return e}l(){var e=_0;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(Jn(e,0|e[k],!1))}O(){return!!(2&(0|this.u[k]))}};function Mc(e){return e?/^\d+$/.test(e)?(Wn(e),new ao(q,oe)):null:Hd||(Hd=new ao(0,0))}C.prototype.W=ln,C.prototype.toString=function(){return this.u.toString()};var ao=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Hd;function Tc(e){return e?/^-?\d+$/.test(e)?(Wn(e),new co(q,oe)):null:Ud||(Ud=new co(0,0))}var co=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Ud;function Li(e,t,i){for(;i>0||t>127;)e.g.push(127&t|128),t=(t>>>7|i<<25)>>>0,i>>>=7;e.g.push(t)}function Mi(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ar(e,t){if(t>=0)Mi(e,t);else{for(let i=0;i<9;i++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function gn(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Ti(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function $e(e,t,i){Mi(e.g,8*t+i)}function lo(e,t){return $e(e,t,2),t=e.g.end(),Ti(e,t),t.push(e.h),t}function ho(e,t){var i=t.pop();for(i=e.h+e.g.length()-i;i>127;)t.push(127&i|128),i>>>=7,e.h++;t.push(i),e.h++}function cr(e,t,i){$e(e,t,2),Mi(e.g,i.length),Ti(e,e.g.end()),Ti(e,i)}function lr(e,t,i,n){i!=null&&(t=lo(e,t),n(i,e),ho(e,t))}function ct(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var uo=ct(),Ic=ct(),po=ct(),fo=ct(),Fc=ct(),Bc=ct(),mo=ct(),Dc=ct(),Rc=ct(),Ii=class{constructor(e,t,i){this.g=e,this.h=t,e=uo,this.l=!!e&&i===e||!1}};function hr(e,t){return new Ii(e,t,uo)}function Oc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}const Vd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc),jd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc);var dr=Symbol(),go=Symbol(),Pc=Symbol(),$c=Symbol();let ur,pr;function oi(e,t,i,n){var r=n[e];if(r)return r;(r={}).Ma=n,r.T=function(h){switch(typeof h){case"boolean":return pc||(pc=[0,void 0,!0]);case"number":return h>0?void 0:h===0?Pd||(Pd=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(n[0]);var s=n[1];let o=1;s&&s.constructor===Object&&(r.ga=s,typeof(s=n[++o])=="function"&&(r.la=!0,ur!=null||(ur=s),pr!=null||(pr=n[o+1]),s=n[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=n[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=n[++o]);var l=void 0;if(s instanceof Ii?h=s:(h=Vd,o--),h==null?void 0:h.l){s=n[++o],l=n;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=n[++o])=="number"&&s<0&&(d-=s,s=n[++o]);c<d;c++){const u=a[c];l?i(r,c,h,l,u):t(r,c,h,u)}}return n[e]=r}function Nc(e){return Array.isArray(e)?e[0]instanceof Ii?e:[jd,e]:[e,void 0]}function Hc(e,t){return e instanceof C?e.u:Array.isArray(e)?Ut(e,t,!1):void 0}function vo(e,t,i,n){const r=i.g;e[t]=n?(s,o,a)=>r(s,o,a,n):r}function bo(e,t,i,n,r){const s=i.g;let o,a;e[t]=(c,l,d)=>s(c,l,d,a||(a=oi(go,vo,bo,n).T),o||(o=wo(n)),r)}function wo(e){let t=e[Pc];if(t!=null)return t;const i=oi(go,vo,bo,e);return t=i.la?(n,r)=>ur(n,r,i):(n,r)=>{const s=0|n[k];for(;Sc(r)&&r.h!=4;){var o=r.m,a=i[o];if(a==null){var c=i.ga;c&&(c=c[o])&&(c=Gd(c))!=null&&(a=i[o]=c)}a!=null&&a(r,n,o)||(o=(a=r).l,rr(a),a.fa?a=void 0:(c=a.g.g-o,a.g.g=o,a=kc(a.g,c)),o=n,a&&((c=o[yi])?c.push(a):o[yi]=[a]))}return 8192&s&&_i(n),!0},e[Pc]=t}function Gd(e){const t=(e=Nc(e))[0].g;if(e=e[1]){const i=wo(e),n=oi(go,vo,bo,e).T;return(r,s,o)=>t(r,s,o,n,i)}return t}function fr(e,t,i){e[t]=i.h}function mr(e,t,i,n){let r,s;const o=i.h;e[t]=(a,c,l)=>o(a,c,l,s||(s=oi(dr,fr,mr,n).T),r||(r=Uc(n)))}function Uc(e){let t=e[$c];if(!t){const i=oi(dr,fr,mr,e);t=(n,r)=>Vc(n,r,i),e[$c]=t}return t}function Vc(e,t,i){(function(n,r,s){const o=512&r?0:-1,a=n.length,c=a+((r=64&r?256&r:!!a&&zn(n[a-1]))?-1:0);for(let l=0;l<c;l++)s(l-o,n[l]);if(r){n=n[a-1];for(const l in n)!isNaN(l)&&s(+l,n[l])}})(e,0|e[k]|(i.T[1]?512:0),(n,r)=>{if(r!=null){var s=function(o,a){var c=o[a];if(c)return c;if((c=o.ga)&&(c=c[a])){var l=(c=Nc(c))[0].h;if(c=c[1]){const d=Uc(c),h=oi(dr,fr,mr,c).T;c=o.la?pr(h,d):(u,p,f)=>l(u,p,f,h,d)}else c=l;return o[a]=c}}(i,n);s&&s(t,r,n)}}),(e=Fs(e))&&function(n,r){Ti(n,n.g.end());for(let s=0;s<r.length;s++)Ti(n,ks(r[s])||new Uint8Array(0))}(t,e)}function Fi(e,t){if(Array.isArray(t)){var i=0|t[k];if(4&i)return t;for(var n=0,r=0;n<t.length;n++){const s=e(t[n]);s!=null&&(t[r++]=s)}return r<n&&(t.length=r),me(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Se(e,t,i){return new Ii(e,t,i)}function Bi(e,t,i){return new Ii(e,t,i)}function Le(e,t,i){ne(e,0|e[k],t,i)}var zd=hr(function(e,t,i,n,r){return e.h===2&&(e=mn(e,Ut([void 0,void 0],n,!0),r),Pt(n=0|t[k]),(r=xt(t,n,i))instanceof ut?(2&r.M)!=0?((r=r.da()).push(e),ne(t,n,i,r)):r.Ja(e):Array.isArray(r)?(2&(0|r[k])&&ne(t,n,i,r=bc(r)),r.push(e)):ne(t,n,i,[e]),!0)},function(e,t,i,n,r){if(t instanceof ut)t.forEach((s,o)=>{lr(e,i,Ut([o,s],n,!1),r)});else if(Array.isArray(t))for(let s=0;s<t.length;s++){const o=t[s];Array.isArray(o)&&lr(e,i,Ut(o,n,!1),r)}});function jc(e,t,i){if(t=function(n){if(n==null)return n;const r=typeof n;if(r==="bigint")return String(dn(64,n));if(un(n)){if(r==="string")return cc(n);if(r==="number")return $s(n)}}(t),t!=null&&(typeof t=="string"&&Tc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new co(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Tc(t),Li(e.g,i.h,i.g)}}function Gc(e,t,i){(t=Ei(t))!=null&&t!=null&&($e(e,i,0),ar(e.g,t))}function zc(e,t,i){(t=nc(t))!=null&&($e(e,i,0),e.g.g.push(t?1:0))}function Zc(e,t,i){(t=ki(t))!=null&&cr(e,i,F1(t))}function qc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}function Wc(e,t,i){t==null||typeof t=="string"||t instanceof Et||(ei(t)?ei(t)&&Ls(Z1):t=void 0),t!=null&&cr(e,i,eo(t).buffer)}function Xc(e,t,i){return(e.h===5||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,ro,t):t.push(ro(e.g)),!0)}var Mt=Se(function(e,t,i){if(e.h!==1)return!1;var n=e.g;e=no(n);const r=no(n);n=2*(r>>31)+1;const s=r>>>20&2047;return e=4294967296*(1048575&r)+e,Le(t,i,s==2047?e?NaN:n*(1/0):s==0?5e-324*n*e:n*Math.pow(2,s-1075)*(e+4503599627370496)),!0},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,1),e=e.g,(i=Q1||(Q1=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),q=i.getUint32(0,!0),oe=i.getUint32(4,!0),gn(e,q),gn(e,oe))},ct()),ge=Se(function(e,t,i){return e.h===5&&(Le(t,i,ro(e.g)),!0)},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,5),e=e.g,Ds(t),gn(e,q))},mo),Zd=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,5),n=n.g,Ds(s),gn(n,q))}},mo),yo=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null&&t.length){$e(e,i,2),Mi(e.g,4*t.length);for(let n=0;n<t.length;n++)i=e.g,Ds(t[n]),gn(i,q)}},mo),Gt=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Os)),!0)},jc,Bc),_o=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=to(e.g,Os))===0?void 0:e),!0)},jc,Bc),qd=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Rs)),!0)},function(e,t,i){if((t=Sd(t))!=null&&(typeof t=="string"&&Mc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new ao(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Mc(t),Li(e.g,i.h,i.g)}},ct()),ae=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},Gc,fo),gr=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,jt,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},fo),Di=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=jt(e.g))===0?void 0:e),!0)},Gc,fo),Q=Se(function(e,t,i){return e.h===0&&(Le(t,i,io(e.g)),!0)},zc,Ic),Ri=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=io(e.g))===!1?void 0:e),!0)},zc,Ic),ke=Bi(function(e,t,i){return e.h===2&&(e=oo(e),Si(t,0|t[k],i,!1).push(e),!0)},function(e,t,i){if((t=Fi(ki,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&cr(n,r,F1(s))}},po),zt=Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=oo(e))===""?void 0:e),!0)},Zc,po),j=Se(function(e,t,i){return e.h===2&&(Le(t,i,oo(e)),!0)},Zc,po),we=function(e,t,i=uo){return new Ii(e,t,i)}(function(e,t,i,n,r){return e.h===2&&(n=Ut(void 0,n,!0),Si(t,0|t[k],i,!0).push(n),mn(e,n,r),!0)},function(e,t,i,n,r){if(Array.isArray(t))for(let s=0;s<t.length;s++)qc(e,t[s],i,n,r)}),G=hr(function(e,t,i,n,r,s){return e.h===2&&(wc(t,0|t[k],s,i),mn(e,t=Js(t,n,i),r),!0)},qc),Yc=Se(function(e,t,i){return e.h===2&&(Le(t,i,Lc(e)),!0)},Wc,Dc),Wd=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Lt,t):t.push(Lt(e.g)),!0)},function(e,t,i){if((t=Fi(rc,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,0),Mi(n.g,s))}},Fc),Xd=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=Lt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=rc(t))!=null&&t!=null&&($e(e,i,0),Mi(e.g,t))},Fc),Ne=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},function(e,t,i){(t=Ei(t))!=null&&(t=parseInt(t,10),$e(e,i,0),ar(e.g,t))},Rc);class Yd{constructor(t,i){this.h=t,this.g=i,this.l=N,this.m=S,this.defaultValue=void 0}register(){Un(this)}}function lt(e,t){return new Yd(e,t)}function Zt(e,t){return(i,n)=>{if(or.length){const s=or.pop();s.o(n),so(s.g,i,n),i=s}else i=new class{constructor(s,o){if(Ac.length){const a=Ac.pop();so(a,s,o),s=a}else s=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,so(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,o);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({fa:s=!1}={}){this.fa=s}}(i,n);try{const s=new e,o=s.u;wo(t)(o,i);var r=s}finally{i.g.clear(),i.m=-1,i.h=-1,or.length<100&&or.push(i)}return r}}function vr(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Vc(this.u,t,oi(dr,fr,mr,e)),Ti(t,t.g.end());const i=new Uint8Array(t.h),n=t.l,r=n.length;let s=0;for(let o=0;o<r;o++){const a=n[o];i.set(a,s),s+=a.length}return t.l=[i],i}}var Kc=class extends C{constructor(e){super(e)}},Jc=[0,zt,Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=Lc(e))===ti()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof C){const n=t.Oa;return void(n&&(t=n(t),t!=null&&cr(e,i,eo(t).buffer)))}if(Array.isArray(t))return}Wc(e,t,i)},Dc)];let Co,Qc=globalThis.trustedTypes;function el(e){Co===void 0&&(Co=function(){let i=null;if(!Qc)return i;try{const n=r=>r;i=Qc.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch(n){}return i}());var t=Co;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function Kd(e,...t){if(t.length===0)return el(e[0]);let i=e[0];for(let n=0;n<t.length;n++)i+=encodeURIComponent(t[n])+e[n+1];return el(i)}var tl=[0,ae,Ne,Q,-1,gr,Ne,-1],Jd=class extends C{constructor(e){super(e)}},il=[0,Q,j,Q,Ne,-1,Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Nd,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},Rc),j,-1,[0,Q,-1],Ne,Q,-1],nl=[0,j,-2],rl=class extends C{constructor(e){super(e)}},sl=[0],ol=[0,ae,Q,1,Q,-3],He=class extends C{constructor(e){super(e,2)}},ve={};ve[336783863]=[0,j,Q,-1,ae,[0,[1,2,3,4,5,6,7,8,9],G,sl,G,il,G,nl,G,ol,G,tl,G,[0,j,-2],G,[0,j,Ne],G,[0,Ne,j,-1],G,[0,Ne,-1]],[0,j],Q,[0,[1,3],[2,4],G,[0,gr],-1,G,[0,ke],-1,we,[0,j,-1]],j];var al=[0,_o,-1,Ri,-3,_o,gr,zt,Di,_o,-1,Ri,Di,Ri,-2,zt];function Ue(e,t){Ws(e,2,xi(t),"")}function X(e,t){tr(e,3,t)}function $(e,t){tr(e,4,t)}var Me=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,7,e)}},vn=[-1,{}],cl=[0,j,1,vn],ll=[0,j,ke,vn];function Ve(e,t){ir(e,1,Me,t)}function Y(e,t){tr(e,10,t)}function H(e,t){tr(e,15,t)}var De=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,1001,e)}},hl=[-500,we,[-500,zt,-1,ke,-3,[-2,ve,Q],we,Jc,Di,-1,cl,ll,we,[0,zt,Ri],zt,al,Di,ke,987,ke],4,we,[-500,j,-1,[-1,{}],998,j],we,[-500,j,ke,-1,[-2,{},Q],997,ke,-1],Di,we,[-500,j,ke,vn,998,ke],ke,Di,cl,ll,we,[0,zt,-1,vn],ke,-2,al,zt,-1,Ri,[0,Ri,Xd],978,vn,we,Jc];De.prototype.g=vr(hl);var Qd=Zt(De,hl),e0=class extends C{constructor(e){super(e)}},dl=class extends C{constructor(e){super(e)}g(){return At(this,e0,1)}},ul=[0,we,[0,ae,ge,j,-1]],br=Zt(dl,ul),t0=class extends C{constructor(e){super(e)}},i0=class extends C{constructor(e){super(e)}},Eo=class extends C{constructor(e){super(e)}h(){return N(this,t0,2)}g(){return At(this,i0,5)}},pl=Zt(class extends C{constructor(e){super(e)}},[0,ke,gr,yo,[0,Ne,[0,ae,-3],[0,ge,-3],[0,ae,-1,[0,we,[0,ae,-2]]],we,[0,ge,-1,j,ge]],j,-1,Gt,we,[0,ae,ge],ke,Gt]),fl=class extends C{constructor(e){super(e)}},Oi=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),ml=class extends C{constructor(e){super(e)}},bn=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),n0=class extends C{constructor(e){super(e)}},r0=[0,ae,-1,yo,Ne],gl=class extends C{constructor(e){super(e)}};gl.prototype.g=vr([0,ge,-4,Gt]);var s0=class extends C{constructor(e){super(e)}},o0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,1,ae,j,ul],Gt]),vl=class extends C{constructor(e){super(e)}},a0=class extends C{constructor(e){super(e)}ma(){const e=vc(this);return e==null?ti():e}},c0=class extends C{constructor(e){super(e)}},bl=[1,2],l0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,bl,G,[0,yo],G,[0,Yc],ae,j],Gt]),xo=class extends C{constructor(e){super(e)}},wl=[0,j,ae,ge,ke,-1],yl=class extends C{constructor(e){super(e)}},h0=[0,Q,-1],_l=class extends C{constructor(e){super(e)}},wr=[1,2,3,4,5],yr=class extends C{constructor(e){super(e)}g(){return vc(this)!=null}h(){return Ke(this,2)!=null}},ee=class extends C{constructor(e){super(e)}g(){var e;return(e=nc(Ai(this,2)))!=null?e:!1}},Cl=[0,Yc,j,[0,ae,Gt,-1],[0,qd,Gt]],de=[0,Cl,Q,[0,wr,G,ol,G,il,G,tl,G,sl,G,nl],Ne],_r=class extends C{constructor(e){super(e)}},ko=[0,de,ge,-1,ae],d0=lt(502141897,_r);ve[502141897]=ko;var u0=Zt(class extends C{constructor(e){super(e)}},[0,[0,Ne,-1,Zd,Wd],r0]),El=class extends C{constructor(e){super(e)}},xl=class extends C{constructor(e){super(e)}},Ao=[0,de,ge,[0,de],Q],kl=[0,de,ko,Ao,ge,[0,[0,Cl]]],p0=lt(508968150,xl);ve[508968150]=kl,ve[508968149]=Ao;var Al=class extends C{constructor(e){super(e)}},f0=lt(513916220,Al);ve[513916220]=[0,de,kl,ae];var Pi=class extends C{constructor(e){super(e)}h(){return N(this,xo,2)}g(){W(this,2)}},Sl=[0,de,wl];ve[478825465]=Sl;var m0=class extends C{constructor(e){super(e)}},Ll=class extends C{constructor(e){super(e)}},So=class extends C{constructor(e){super(e)}},Lo=class extends C{constructor(e){super(e)}},Ml=class extends C{constructor(e){super(e)}},Tl=[0,de,[0,de],Sl,-1],Il=[0,de,ge,ae],Mo=[0,de,ge],Fl=[0,de,Il,Mo,ge],g0=lt(479097054,Ml);ve[479097054]=[0,de,Fl,Tl],ve[463370452]=Tl,ve[464864288]=Il;var v0=lt(462713202,Lo);ve[462713202]=Fl,ve[474472470]=Mo;var b0=class extends C{constructor(e){super(e)}},Bl=class extends C{constructor(e){super(e)}},Dl=class extends C{constructor(e){super(e)}},Rl=class extends C{constructor(e){super(e)}},To=[0,de,ge,-1,ae],Io=[0,de,ge,Q];Rl.prototype.g=vr([0,de,Mo,[0,de],ko,Ao,To,Io]);var Ol=class extends C{constructor(e){super(e)}},w0=lt(456383383,Ol);ve[456383383]=[0,de,wl];var Pl=class extends C{constructor(e){super(e)}},y0=lt(476348187,Pl);ve[476348187]=[0,de,h0];var $l=class extends C{constructor(e){super(e)}},Nl=class extends C{constructor(e){super(e)}},Hl=[0,Ne,-1],_0=lt(458105876,class extends C{constructor(e){super(e)}g(){var e=this.u;const t=0|e[k],i=2&t;return e=function(n,r,s){var o=Nl;const a=2&r;let c=!1;if(s==null){if(a)return fc();s=[]}else if(s.constructor===ut){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?c=!!(2&(0|s[k])):s=[];if(a){if(!s.length)return fc();c||(c=!0,_i(s))}else c&&(c=!1,s=bc(s));return c||(64&(0|s[k])?s[k]&=-33:32&r&&jn(s,32)),ne(n,r,2,o=new ut(s,o,Ld,void 0)),o}(e,t,xt(e,t,2)),!i&&Nl&&(e.pa=!0),e}});ve[458105876]=[0,Hl,zd,[!0,Gt,[0,j,-1,ke]]];var Fo=class extends C{constructor(e){super(e)}},Ul=lt(458105758,Fo);ve[458105758]=[0,de,j,Hl];var Vl=class extends C{constructor(e){super(e)}},C0=lt(443442058,Vl);ve[443442058]=[0,de,j,ae,ge,ke,-1,Q,ge],ve[514774813]=To;var jl=class extends C{constructor(e){super(e)}},E0=lt(516587230,jl);function Bo(e,t){return t=t?t.clone():new xo,e.displayNamesLocale!==void 0?W(t,1,xi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&W(t,1),e.maxResults!==void 0?pt(t,2,e.maxResults):"maxResults"in e&&W(t,2),e.scoreThreshold!==void 0?x(t,3,e.scoreThreshold):"scoreThreshold"in e&&W(t,3),e.categoryAllowlist!==void 0?nr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&W(t,4),e.categoryDenylist!==void 0?nr(t,5,e.categoryDenylist):"categoryDenylist"in e&&W(t,5),t}function Do(e,t=-1,i=""){return{categories:e.map(n=>{var r,s,o,a,c,l,d;return{index:(s=(r=Ye(n,1))!=null?r:0)!=null?s:-1,score:(o=he(n,2))!=null?o:0,categoryName:(c=(a=Ke(n,3))!=null?a:"")!=null?c:"",displayName:(d=(l=Ke(n,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function Gl(e){var o,a,c,l,d,h,u,p,f,m,v,g,b;var t=ri(e,3,Ht,ni()),i=ri(e,2,Ei,ni()),n=ri(e,1,ki,ni()),r=ri(e,9,ki,ni());const s={categories:[],keypoints:[]};for(let _=0;_<t.length;_++)s.categories.push({score:t[_],index:(o=i[_])!=null?o:-1,categoryName:(a=n[_])!=null?a:"",displayName:(c=r[_])!=null?c:""});if((t=(l=N(e,Eo,4))==null?void 0:l.h())&&(s.boundingBox={originX:(d=Ye(t,1))!=null?d:0,originY:(h=Ye(t,2))!=null?h:0,width:(u=Ye(t,3))!=null?u:0,height:(p=Ye(t,4))!=null?p:0,angle:0}),(f=N(e,Eo,4))==null?void 0:f.g().length)for(const _ of N(e,Eo,4).g())s.keypoints.push({x:(m=er(_,1))!=null?m:0,y:(v=er(_,2))!=null?v:0,score:(g=er(_,4))!=null?g:0,label:(b=Ke(_,3))!=null?b:""});return s}function Cr(e){var i,n,r,s;const t=[];for(const o of At(e,ml,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function wn(e){var i,n,r,s;const t=[];for(const o of At(e,fl,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function zl(e){return Array.from(e,t=>t>127?t-256:t)}function Zl(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let i=0,n=0,r=0;for(let s=0;s<e.length;s++)i+=e[s]*t[s],n+=e[s]*e[s],r+=t[s]*t[s];if(n<=0||r<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(n*r)}let Er;ve[516587230]=[0,de,To,Io,ge],ve[518928384]=Io;const x0=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function ql(){return L(this,null,function*(){if(Er===void 0)try{yield WebAssembly.instantiate(x0),Er=!0}catch(e){Er=!1}return Er})}function yn(i){return L(this,arguments,function*(e,t=Kd``){const n=(yield ql())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}})}var ai=class{};function Wl(){var e=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}function Xl(e){return L(this,null,function*(){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((i,n)=>{t.addEventListener("load",()=>{i()},!1),t.addEventListener("error",r=>{n(r)},!1),document.body.appendChild(t)})}importScripts(e.toString())})}function Yl(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function A(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Kl(e,t,i){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(i?e.i._bindTextureToStream(i):e.i._bindTextureToCanvas(),!(i=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[n,r]=Yl(t);return!e.l||n===e.i.canvas.width&&r===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=r),[n,r]}function Jl(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let r=0;r<t.length;r++)n[r]=e.i.stringToNewUTF8(t[r]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),i(t);for(const r of n)e.i._free(r);e.i._free(t)}function ft(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function qt(e,t,i){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(r,s,o)=>{s?(i(n,o),n=[]):n.push(r)}}ai.forVisionTasks=function(e){return yn("vision",e)},ai.forTextTasks=function(e){return yn("text",e)},ai.forGenAiExperimentalTasks=function(e){return yn("genai_experimental",e)},ai.forGenAiTasks=function(e){return yn("genai",e)},ai.forAudioTasks=function(e){return yn("audio",e)},ai.isSimdSupported=function(){return ql()};function k0(e,t,i,n){return L(this,null,function*(){return e=yield((r,s,o,a,c)=>L(this,null,function*(){if(s&&(yield Xl(s)),!self.ModuleFactory||o&&(yield Xl(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new r(c,a)}))(e,i.wasmLoaderPath,i.assetLoaderPath,t,{locateFile:r=>r.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&r.endsWith(".data")?i.assetBinaryPath.toString():r}),yield e.o(n),e})}function Ro(e,t){const i=N(e.baseOptions,yr,1)||new yr;typeof t=="string"?(W(i,2,xi(t)),W(i,1)):t instanceof Uint8Array&&(W(i,1,Is(t,!1)),W(i,2)),S(e.baseOptions,0,1,i)}function Ql(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(i=>i.message).join(", "))}finally{e.G=[]}}function y(e,t){e.B=Math.max(e.B,t)}function xr(e,t){e.A=new Me,Ue(e.A,"PassThroughCalculator"),X(e.A,"free_memory"),$(e.A,"free_memory_unused_out"),Y(t,"free_memory"),Ve(t,e.A)}function $i(e,t){X(e.A,t),$(e.A,t+"_unused_out")}function kr(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Oo=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var i,n,r,s,o,a;if(t){const c=e.baseOptions||{};if((i=e.baseOptions)!=null&&i.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((r=N(this.baseOptions,yr,1))!=null&&r.g()||(s=N(this.baseOptions,yr,1))!=null&&s.h()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(a=e.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(l,d){let h=N(l.baseOptions,_l,3);if(!h){var u=h=new _l,p=new rl;pn(u,4,wr,p)}"delegate"in d&&(d.delegate==="GPU"?(d=h,u=new Jd,pn(d,2,wr,u)):(d=h,u=new rl,pn(d,4,wr,u))),S(l.baseOptions,0,3,h)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(l=>{if(l.ok)return l.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${l.status})`)}).then(l=>{try{this.g.i.FS_unlink("/model.dat")}catch(d){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(l),!0,!1,!1),Ro(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Ro(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return L(this,null,function*(){const d=[];for(var h=0;;){const{done:u,value:p}=yield l.read();if(u)break;d.push(p),h+=p.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];l=new Uint8Array(h),h=0;for(const u of d)l.set(u,h),h+=u.length;return l})}(c.modelAssetBuffer).then(l=>{Ro(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Qd(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((i,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Ql(this)}finishProcessing(){this.g.finishProcessing(),Ql(this)}close(){this.A=void 0,this.g.closeGraph()}};function Te(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Oo.prototype.close=Oo.prototype.close;class A0{constructor(t,i,n,r){this.g=t,this.h=i,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function e2(e,t,i){const n=e.g;if(i=Te(n.createShader(i),"Failed to create WebGL shader"),n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(i)}`);return n.attachShader(e.h,i),i}function t2(e,t){const i=e.g,n=Te(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(n);const r=Te(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(e.P),i.vertexAttribPointer(e.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const s=Te(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,s),i.enableVertexAttribArray(e.J),i.vertexAttribPointer(e.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new A0(i,n,r,s)}function Po(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function _n(e,t,i,n){return Po(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=t2(e,!0)),i=e.s):(e.v||(e.v=t2(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=n(),i.g.bindVertexArray(null),e}function Wt(e,t,i){return Po(e,t),e=Te(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i!=null?i:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i!=null?i:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Ar(e,t,i){Po(e,t),e.A||(e.A=Te(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}function $o(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ni=class{G(){return`
|
|
3103
|
+
`}class J4 extends HTMLElement{constructor(){super(),this.templateString=Y4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||y("selfie.review.title")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){var t,i;this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",J4);var mr,G,Bu,Du,si,Ru,Ou,Pu,$u,Ys,Js,Qs,gr={},Nu=[],Q4=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vr=Array.isArray;function vt(e,t){for(var i in t)e[i]=t[i];return e}function ea(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Lt(e,t,i){var r,n,o,s={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?mr.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return br(e,s,r,n,null)}function br(e,t,i,r,n){var o={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n==null?++Bu:n,__i:-1,__u:0};return n==null&&G.vnode!=null&&G.vnode(o),o}function qt(e){return e.children}function yr(e,t){this.props=e,this.context=t}function ki(e,t){if(t==null)return e.__?ki(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?ki(e):null}function Hu(e){var t,i;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null){e.__e=e.__c.base=i.__e;break}return Hu(e)}}function Uu(e){(!e.__d&&(e.__d=!0)&&si.push(e)&&!Xr.__r++||Ru!=G.debounceRendering)&&((Ru=G.debounceRendering)||Ou)(Xr)}function Xr(){for(var e,t,i,r,n,o,s,a=1;si.length;)si.length>a&&si.sort(Pu),e=si.shift(),a=si.length,e.__d&&(i=void 0,n=(r=(t=e).__v).__e,o=[],s=[],t.__P&&((i=vt({},r)).__v=r.__v+1,G.vnode&&G.vnode(i),ta(t.__P,i,r,t.__n,t.__P.namespaceURI,32&r.__u?[n]:null,o,n==null?ki(r):n,!!(32&r.__u),s),i.__v=r.__v,i.__.__k[i.__i]=i,Zu(o,i,s),i.__e!=n&&Hu(i)));Xr.__r=0}function qu(e,t,i,r,n,o,s,a,c,l,d){var u,h,f,p,m,v,g=r&&r.__k||Nu,b=t.length;for(c=ef(i,t,g,c,b),u=0;u<b;u++)(f=i.__k[u])!=null&&(h=f.__i==-1?gr:g[f.__i]||gr,f.__i=u,v=ta(e,f,h,n,o,s,a,c,l,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ra(h.ref,null,f),d.push(f.ref,f.__c||p,f)),m==null&&p!=null&&(m=p),4&f.__u||h.__k===f.__k?c=Vu(f,c,e):typeof f.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),f.__u&=-7);return i.__e=m,c}function ef(e,t,i,r,n){var o,s,a,c,l,d=i.length,u=d,h=0;for(e.__k=new Array(n),o=0;o<n;o++)(s=t[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=o+h,(s=e.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?br(null,s,null,null,null):vr(s)?br(qt,{children:s},null,null,null):s.constructor==null&&s.__b>0?br(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(l=s.__i=tf(s,i,c,u))!=-1&&(u--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(n>d?h--:n<d&&h++),typeof s.type!="function"&&(s.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,s.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<d;o++)(a=i[o])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=ki(a)),Xu(a,a));return r}function Vu(e,t,i){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=Vu(r[n],t,i));return t}e.__e!=t&&(t&&e.type&&!i.contains(t)&&(t=ki(e)),i.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ju(e,t){return t=t||[],e==null||typeof e=="boolean"||(vr(e)?e.some(function(i){ju(i,t)}):t.push(e)),t}function tf(e,t,i,r){var n,o,s,a=e.key,c=e.type,l=t[i],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return i;if(r>(d?1:0)){for(n=i-1,o=i+1;n>=0||o<t.length;)if((l=t[s=n>=0?n--:o++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return s}return-1}function zu(e,t,i){t[0]=="-"?e.setProperty(t,i==null?"":i):e[t]=i==null?"":typeof i!="number"||Q4.test(t)?i:i+"px"}function Kr(e,t,i,r,n){var o,s;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||zu(e.style,t,"");if(i)for(t in i)r&&i[t]==r[t]||zu(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace($u,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=i,i?r?i.u=r.u:(i.u=Ys,e.addEventListener(t,o?Qs:Js,o)):e.removeEventListener(t,o?Qs:Js,o);else{if(n=="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]=i==null?"":i;break e}catch(a){}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function Gu(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ys++;else if(t.t<i.u)return;return i(G.event?G.event(t):t)}}}function ta(e,t,i,r,n,o,s,a,c,l){var d,u,h,f,p,m,v,g,b,_,M,P,x,D,C,R,F,E=t.type;if(t.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),o=[a=t.__e=i.__e]),(d=G.__b)&&d(t);e:if(typeof E=="function")try{if(g=t.props,b="prototype"in E&&E.prototype.render,_=(d=E.contextType)&&r[d.__c],M=d?_?_.props.value:d.__:r,i.__c?v=(u=t.__c=i.__c).__=u.__E:(b?t.__c=u=new E(g,M):(t.__c=u=new yr(g,M),u.constructor=E,u.render=nf),_&&_.sub(u),u.props=g,u.state||(u.state={}),u.context=M,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&E.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=vt({},u.__s)),vt(u.__s,E.getDerivedStateFromProps(g,u.__s))),f=u.props,p=u.state,u.__v=t,h)b&&E.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&E.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,M),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,M)===!1||t.__v==i.__v){for(t.__v!=i.__v&&(u.props=g,u.state=u.__s,u.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(j){j&&(j.__=t)}),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,M),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,m)})}if(u.context=M,u.props=g,u.__P=e,u.__e=!1,x=G.__r,D=0,b){for(u.state=u.__s,u.__d=!1,x&&x(t),d=u.render(u.props,u.state,u.context),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[]}else do u.__d=!1,x&&x(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++D<25);u.state=u.__s,u.getChildContext!=null&&(r=vt(vt({},r),u.getChildContext())),b&&!h&&u.getSnapshotBeforeUpdate!=null&&(m=u.getSnapshotBeforeUpdate(f,p)),R=d,d!=null&&d.type===qt&&d.key==null&&(R=Wu(d.props.children)),a=qu(e,vr(R)?R:[R],t,i,r,n,o,s,a,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),v&&(u.__E=u.__=null)}catch(j){if(t.__v=null,c||o!=null)if(j.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,t.__e=a}else{for(F=o.length;F--;)ea(o[F]);ia(t)}else t.__e=i.__e,t.__k=i.__k,j.then||ia(t);G.__e(j,t,i)}else o==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=rf(i.__e,t,i,r,n,o,s,c,l);return(d=G.diffed)&&d(t),128&t.__u?void 0:a}function ia(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ia)}function Zu(e,t,i){for(var r=0;r<i.length;r++)ra(i[r],i[++r],i[++r]);G.__c&&G.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){G.__e(o,n.__v)}})}function Wu(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:vr(e)?e.map(Wu):vt({},e)}function rf(e,t,i,r,n,o,s,a,c){var l,d,u,h,f,p,m,v=i.props,g=t.props,b=t.type;if(b=="svg"?n="http://www.w3.org/2000/svg":b=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;l<o.length;l++)if((f=o[l])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,o[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(n,b,g.is&&g),a&&(G.__m&&G.__m(t,o),a=!1),o=null}if(b==null)v===g||a&&e.data==g||(e.data=g);else{if(o=o&&mr.call(e.childNodes),v=i.props||gr,!a&&o!=null)for(v={},l=0;l<e.attributes.length;l++)v[(f=e.attributes[l]).name]=f.value;for(l in v)if(f=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=f;else if(!(l in g)){if(l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g)continue;Kr(e,l,null,f,n)}}for(l in g)f=g[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?d=f:l=="value"?p=f:l=="checked"?m=f:a&&typeof f!="function"||v[l]===f||Kr(e,l,f,v[l],n);if(d)a||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),qu(t.type=="template"?e.content:e,vr(h)?h:[h],t,i,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:i.__k&&ki(i,0),a,c),o!=null)for(l=o.length;l--;)ea(o[l]);a||(l="value",b=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[l]||b=="progress"&&!p||b=="option"&&p!=v[l])&&Kr(e,l,p,v[l],n),l="checked",m!=null&&m!=e[l]&&Kr(e,l,m,v[l],n))}return e}function ra(e,t,i){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(n){G.__e(n,i)}}function Xu(e,t,i){var r,n;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ra(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){G.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&Xu(r[n],t,i||typeof e.type!="function");i||ea(e.__e),e.__c=e.__=e.__e=void 0}function nf(e,t,i){return this.constructor(e,i)}function Yr(e,t,i){var r,n,o,s;t==document&&(t=document.documentElement),G.__&&G.__(e,t),n=(r=typeof i=="function")?null:i&&i.__k||t.__k,o=[],s=[],ta(t,e=(!r&&i||t).__k=Lt(qt,null,[e]),n||gr,gr,t.namespaceURI,!r&&i?[i]:n?null:t.firstChild?mr.call(t.childNodes):null,o,!r&&i?i:n?n.__e:t.firstChild,r,s),Zu(o,e,s)}function Ku(e,t){Yr(e,t,Ku)}function Yu(e,t,i){var r,n,o,s,a=vt({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:a[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?mr.call(arguments,2):i),br(e.type,a,r||e.key,n||e.ref,null)}mr=Nu.slice,G={__e:function(e,t,i,r){for(var n,o,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),s=n.__d),s)return n.__E=n}catch(a){e=a}throw e}},Bu=0,Du=function(e){return e!=null&&e.constructor==null},yr.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=vt({},this.state),typeof e=="function"&&(e=e(vt({},i),this.props)),e&&vt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Uu(this))},yr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Uu(this))},yr.prototype.render=qt,si=[],Ou=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pu=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,$u=/(PointerCapture)$|Capture$/i,Ys=0,Js=Gu(!1),Qs=Gu(!0);var of=0;function N(e,t,i,r,n,o){t||(t={});var s,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?s=t[a]:c[a]=t[a];var l={type:e,props:c,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--of,__i:-1,__u:0,__source:n,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return G.vnode&&G.vnode(l),l}var _r,he,na,Ju,Jr=0,Qu=[],ve=G,e2=ve.__b,t2=ve.__r,i2=ve.diffed,r2=ve.__c,n2=ve.unmount,o2=ve.__;function oa(e,t){ve.__h&&ve.__h(he,e,Jr||t),Jr=0;var i=he.__H||(he.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function ai(e){return Jr=1,sf(c2,e)}function sf(e,t,i){var r=oa(_r++,2);if(r.t=e,!r.__c&&(r.__=[c2(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,a);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=he,!he.__f)){var n=function(a,c,l){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!o||o.call(this,a,c,l);var u=r.__c.props!==a;return d.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(u=!0)}}),o&&o.call(this,a,c,l)||u};he.__f=!0;var o=he.shouldComponentUpdate,s=he.componentWillUpdate;he.componentWillUpdate=function(a,c,l){if(this.__e){var d=o;o=void 0,n(a,c,l),o=d}s&&s.call(this,a,c,l)},he.shouldComponentUpdate=n}return r.__N||r.__}function Je(e,t){var i=oa(_r++,3);!ve.__s&&a2(i.__H,t)&&(i.__=e,i.u=t,he.__H.__h.push(i))}function Ae(e){return Jr=5,Qr(function(){return{current:e}},[])}function Qr(e,t){var i=oa(_r++,7);return a2(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function af(){for(var e;e=Qu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(sa),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){he=null,e2&&e2(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),o2&&o2(e,t)},ve.__r=function(e){t2&&t2(e),_r=0;var t=(he=e.__c).__H;t&&(na===he?(t.__h=[],he.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(sa),t.__h=[],_r=0)),na=he},ve.diffed=function(e){i2&&i2(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Qu.push(t)!==1&&Ju===ve.requestAnimationFrame||((Ju=ve.requestAnimationFrame)||cf)(af)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),na=he=null},ve.__c=function(e,t){t.some(function(i){try{i.__h.forEach(en),i.__h=i.__h.filter(function(r){return!r.__||sa(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],ve.__e(r,i.__v)}}),r2&&r2(e,t)},ve.unmount=function(e){n2&&n2(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(r){try{en(r)}catch(n){t=n}}),i.__H=void 0,t&&ve.__e(t,i.__v))};var s2=typeof requestAnimationFrame=="function";function cf(e){var t,i=function(){clearTimeout(r),s2&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,35);s2&&(t=requestAnimationFrame(i))}function en(e){var t=he,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),he=t}function sa(e){var t=he;e.__c=e.__(),he=t}function a2(e,t){return!e||e.length!==t.length||t.some(function(i,r){return i!==e[r]})}function c2(e,t){return typeof t=="function"?t(e):t}var lf={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const uf=(e,t,i,r)=>{const n=p=>{var m=p,{color:o="currentColor",size:s=24,stroke:a=2,title:c,children:l,className:d="",class:u="",style:h}=m,f=hl(m,["color","size","stroke","title","children","className","class","style"]);return Lt("svg",Re(nr(Re({},lf[e]),{width:String(s),height:String(s),class:["tabler-icon",`tabler-icon-${t}`,u,d].join(" "),"stroke-width":a,stroke:o,style:h}),f),[c&&Lt("title",{},c),...r.map(([v,g])=>Lt(v,g)),...ju(l)])};return n.displayName=`${i}`,n};var df=uf("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function aa(){return(aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var hf=["context","children"];function ff(e){this.getChildContext=function(){return e.context};var t=e.children,i=function(r,n){if(r==null)return{};var o,s,a={},c=Object.keys(r);for(s=0;s<c.length;s++)n.indexOf(o=c[s])>=0||(a[o]=r[o]);return a}(e,hf);return Yu(t,i)}function pf(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Lt(ff,aa({},this._props,{context:e.detail.context}),function t(i,r){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var n=[],o={},s=0,a=i.attributes,c=i.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(o[a[s].name]=a[s].value,o[l2(a[s].name)]=a[s].value);for(s=c.length;s--;){var l=t(c[s],null),d=c[s].slot;d?o[d]=Lt(u2,{name:d},l):n[s]=l}var u=r?Lt(u2,null,n):n;return Lt(r||i.nodeName.toLowerCase(),o,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ku:Yr)(this._vdom,this._root)}function l2(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function mf(e,t,i){if(this._vdom){var r={};r[e]=i=i==null?void 0:i,r[l2(e)]=i,this._vdom=Yu(this._vdom,r),Yr(this._vdom,this._root)}}function gf(){Yr(this._vdom=null,this._root)}function u2(e,t){var i=this;return Lt("slot",aa({},e,{ref:function(r){r?(i.ref=r,i._listener||(i._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function d2(e,t,i,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=pf,n.prototype.attributeChangedCallback=mf,n.prototype.disconnectedCallback=gf,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=i,i.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(s){this._vdom?this.attributeChangedCallback(o,null,s):(this._props||(this._props={}),this._props[o]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}const ci=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t;var vf=Symbol.for("preact-signals");function tn(){if(Vt>1)Vt--;else{for(var e,t=!1;wr!==void 0;){var i=wr;for(wr=void 0,ca++;i!==void 0;){var r=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&m2(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=r}}if(ca=0,Vt--,t)throw e}}function bf(e){if(Vt>0)return e();Vt++;try{return e()}finally{tn()}}var Z=void 0;function h2(e){var t=Z;Z=void 0;try{return e()}finally{Z=t}}var wr=void 0,Vt=0,ca=0,rn=0;function f2(e){if(Z!==void 0){var t=e.n;if(t===void 0||t.t!==Z)return t={i:0,S:e,p:Z.s,n:void 0,t:Z,e:void 0,x:void 0,r:t},Z.s!==void 0&&(Z.s.n=t),Z.s=t,e.n=t,32&Z.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Z.s,t.n=void 0,Z.s.n=t,Z.s=t),t}}function ke(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}ke.prototype.brand=vf,ke.prototype.h=function(){return!0},ke.prototype.S=function(e){var t=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:h2(function(){var r;(r=t.W)==null||r.call(t)}))},ke.prototype.U=function(e){var t=this;if(this.t!==void 0){var i=e.e,r=e.x;i!==void 0&&(i.x=r,e.e=void 0),r!==void 0&&(r.e=i,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&h2(function(){var n;(n=t.Z)==null||n.call(t)}))}},ke.prototype.subscribe=function(e){var t=this;return Cr(function(){var i=t.value,r=Z;Z=void 0;try{e(i)}finally{Z=r}})},ke.prototype.valueOf=function(){return this.value},ke.prototype.toString=function(){return this.value+""},ke.prototype.toJSON=function(){return this.value},ke.prototype.peek=function(){var e=Z;Z=void 0;try{return this.value}finally{Z=e}},Object.defineProperty(ke.prototype,"value",{get:function(){var e=f2(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ca>100)throw new Error("Cycle detected");this.v=e,this.i++,rn++,Vt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{tn()}}}});function p2(e,t){return new ke(e,t)}function m2(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function g2(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function v2(e){for(var t=e.s,i=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=i}function li(e,t){ke.call(this,void 0),this.x=e,this.s=void 0,this.g=rn-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}li.prototype=new ke,li.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===rn))return!0;if(this.g=rn,this.f|=1,this.i>0&&!m2(this))return this.f&=-2,!0;var e=Z;try{g2(this),Z=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return Z=e,v2(this),this.f&=-2,!0},li.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ke.prototype.S.call(this,e)},li.prototype.U=function(e){if(this.t!==void 0&&(ke.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},li.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(li.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=f2(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function la(e,t){return new li(e,t)}function b2(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Vt++;var i=Z;Z=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ua(e),r}finally{Z=i,tn()}}}function ua(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,b2(e)}function yf(e){if(Z!==this)throw new Error("Out-of-order effect");v2(this),Z=e,this.f&=-2,8&this.f&&ua(this),tn()}function Ai(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ai.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Ai.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b2(this),g2(this),Vt++;var e=Z;return Z=this,yf.bind(this,e)},Ai.prototype.N=function(){2&this.f||(this.f|=2,this.o=wr,wr=this)},Ai.prototype.d=function(){this.f|=8,1&this.f||ua(this)},Ai.prototype.dispose=function(){this.d()};function Cr(e){var t=new Ai(e);try{t.c()}catch(r){throw t.d(),r}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var y2,nn,da,_2=[];Cr(function(){y2=this.N})();function Si(e,t){G[e]=t.bind(null,G[e]||function(){})}function on(e){da&&da(),da=e&&e.S()}function w2(e){var t=this,i=e.data,r=le(i);r.value=i;var n=Qr(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=la(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),d=la(function(){return!Array.isArray(l.value)&&!Du(l.value)}),u=Cr(function(){if(this.N=C2,d.value){var f=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=f)}}),h=t.__$u.d;return t.__$u.d=function(){u(),h.call(this)},[d,l]},[]),o=n[0],s=n[1];return o.value?s.peek():s.value}w2.displayName="_st",Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:w2},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Si("__b",function(e,t){if(typeof t.type=="string"){var i,r=t.props;for(var n in r)if(n!=="children"){var o=r[n];o instanceof ke&&(i||(t.__np=i={}),i[n]=o,r[n]=o.peek())}}e(t)}),Si("__r",function(e,t){if(t.type!==qt){on();var i,r=t.__c;r&&(r.__$f&=-2,(i=r.__$u)===void 0&&(r.__$u=i=function(n){var o;return Cr(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),nn=r,on(i)}e(t)}),Si("__e",function(e,t,i,r){on(),nn=void 0,e(t,i,r)}),Si("diffed",function(e,t){on(),nn=void 0;var i;if(typeof t.type=="string"&&(i=t.__e)){var r=t.__np,n=t.props;if(r){var o=i.U;if(o)for(var s in o){var a=o[s];a!==void 0&&!(s in r)&&(a.d(),o[s]=void 0)}else o={},i.U=o;for(var c in r){var l=o[c],d=r[c];l===void 0?(l=_f(i,c,d,n),o[c]=l):l.o(d,n)}}}e(t)});function _f(e,t,i,r){var n=t in e&&e.ownerSVGElement===void 0,o=p2(i);return{o:function(s,a){o.value=s,r=a},d:Cr(function(){this.N=C2;var s=o.value.value;r[t]!==s&&(r[t]=s,n?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}Si("unmount",function(e,t){if(typeof t.type=="string"){var i=t.__e;if(i){var r=i.U;if(r){i.U=void 0;for(var n in r){var o=r[n];o&&o.d()}}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),Si("__h",function(e,t,i,r){(r<3||r===9)&&(t.__$f|=2),e(t,i,r)}),yr.prototype.shouldComponentUpdate=function(e,t){var i=this.__$u,r=i&&i.s!==void 0;for(var n in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(r||o||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function le(e,t){return Qr(function(){return p2(e,t)},[])}function ha(e,t){var i=Ae(e);return i.current=e,nn.__$f|=4,Qr(function(){return la(function(){return i.current()},t)},[])}var wf=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Cf(){bf(function(){for(var e;e=_2.shift();)y2.call(e)})}function C2(){_2.push(this)===1&&(G.requestAnimationFrame||wf)(Cf)}var fa,E2;function Ef(){if(E2)return fa;E2=1;var e=oi(),t=function(){return e.Date.now()};return fa=t,fa}var pa,x2;function xf(){if(x2)return pa;x2=1;var e=/\s/;function t(i){for(var r=i.length;r--&&e.test(i.charAt(r)););return r}return pa=t,pa}var ma,k2;function kf(){if(k2)return ma;k2=1;var e=xf(),t=/^\s+/;function i(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return ma=i,ma}var ga,A2;function Af(){if(A2)return ga;A2=1;var e=ar(),t=Ci(),i="[object Symbol]";function r(n){return typeof n=="symbol"||t(n)&&e(n)==i}return ga=r,ga}var va,S2;function Sf(){if(S2)return va;S2=1;var e=kf(),t=gt(),i=Af(),r=NaN,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(i(l))return r;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var u=o.test(l);return u||s.test(l)?a(l.slice(2),u?2:8):n.test(l)?r:+l}return va=c,va}var ba,L2;function Lf(){if(L2)return ba;L2=1;var e=gt(),t=Ef(),i=Sf(),r="Expected a function",n=Math.max,o=Math.min;function s(a,c,l){var d,u,h,f,p,m,v=0,g=!1,b=!1,_=!0;if(typeof a!="function")throw new TypeError(r);c=i(c)||0,e(l)&&(g=!!l.leading,b="maxWait"in l,h=b?n(i(l.maxWait)||0,c):h,_="trailing"in l?!!l.trailing:_);function M(O){var ae=d,me=u;return d=u=void 0,v=O,f=a.apply(me,ae),f}function P(O){return v=O,p=setTimeout(C,c),g?M(O):f}function x(O){var ae=O-m,me=O-v,Le=c-ae;return b?o(Le,h-me):Le}function D(O){var ae=O-m,me=O-v;return m===void 0||ae>=c||ae<0||b&&me>=h}function C(){var O=t();if(D(O))return R(O);p=setTimeout(C,x(O))}function R(O){return p=void 0,_&&d?M(O):(d=u=void 0,f)}function F(){p!==void 0&&clearTimeout(p),v=0,d=m=u=p=void 0}function E(){return p===void 0?f:R(t())}function j(){var O=t(),ae=D(O);if(d=arguments,u=this,m=O,ae){if(p===void 0)return P(m);if(b)return clearTimeout(p),p=setTimeout(C,c),M(m)}return p===void 0&&(p=setTimeout(C,c)),f}return j.cancel=F,j.flush=E,j}return ba=s,ba}var ya,T2;function Tf(){if(T2)return ya;T2=1;var e=Lf(),t=gt(),i="Expected a function";function r(n,o,s){var a=!0,c=!0;if(typeof n!="function")throw new TypeError(i);return t(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),e(n,o,{leading:a,maxWait:o,trailing:c})}return ya=r,ya}var Mf=Tf();const M2=te(Mf),If=(e="user")=>{var v;const t=Ae(null),i=Ae(null),[r,n]=ai(e),[o,s]=ai(!1),a=Ae(null),c=Ae(!1),l=Ae(new Set),d=g=>{a.current=g};Je(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const _=setTimeout(()=>{var M;(M=a.current)==null||M.call(a),c.current=!1,l.current.delete(_)},100);l.current.add(_)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(_=>clearTimeout(_)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),Je(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const u=(g,b)=>S(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(F=>F.stop()),i.current=null),t.current&&(t.current.srcObject=null);const _=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||r}});i.current=_;const x=_.getVideoTracks()[0].getSettings().facingMode;(x&&x!==(g||r)||x&&x!==r)&&n(x);const R=(yield navigator.mediaDevices.enumerateDevices()).find(F=>F.kind==="videoinput"&&_.getVideoTracks()[0].getSettings().deviceId===F.deviceId);b==null||b(R==null?void 0:R.label),t.current&&(t.current.srcObject=_,yield t.current.play())}catch(_){console.error("Failed to start camera:",_)}}),h=()=>S(this,null,function*(){const g=r==="user"?"environment":"user";c.current=!0;const b=r;try{n(g),i.current&&(i.current.getTracks().forEach(_=>_.stop()),i.current=null),yield u(g)}catch(_){n(b),c.current=!1;try{yield u(b)}catch(M){console.error("Failed to restore previous camera:",M)}}}),f=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),_="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",M=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||_||M,isChromium:g.includes("chrome")||g.includes("chromium")||g.includes("edge"),isWebKit:g.includes("webkit")&&!g.includes("chrome")}};return{videoRef:t,streamRef:i,facingMode:r,agentSupported:o,startCamera:u,switchCamera:h,checkAgentSupport:()=>S(this,null,function*(){var g,b;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){s(!0);return}const{isGecko:M}=f();let P=null,x=null;try{const C=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});P=(g=C.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,C.getTracks().forEach(R=>R.stop())}catch(C){}try{const C=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});x=(b=C.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,C.getTracks().forEach(R=>R.stop())}catch(C){}if(!(P&&x&&P!==x)){s(!1);return}s(!M)}catch(_){s(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(g=>g.stop()),i.current=null),t.current&&(t.current.srcObject=null,t.current.load())},registerCameraSwitchCallback:d}};var Li=typeof self!="undefined"?self:{};function ui(){throw Error("Invalid UTF8")}function I2(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let sn,_a;const Ff=typeof TextDecoder!="undefined";let Bf;const Df=typeof TextEncoder!="undefined";function F2(e){if(Df)e=(Bf||(Bf=new TextEncoder)).encode(e);else{let i=0;const r=new Uint8Array(3*e.length);for(let n=0;n<e.length;n++){var t=e.charCodeAt(n);if(t<128)r[i++]=t;else{if(t<2048)r[i++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&n<e.length){const o=e.charCodeAt(++n);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,r[i++]=t>>18|240,r[i++]=t>>12&63|128,r[i++]=t>>6&63|128,r[i++]=63&t|128;continue}n--}t=65533}r[i++]=t>>12|224,r[i++]=t>>6&63|128}r[i++]=63&t|128}}e=i===r.length?r:r.subarray(0,i)}return e}var wa,an;e:{for(var B2=["CLOSURE_FLAGS"],Ca=Li,Ea=0;Ea<B2.length;Ea++)if((Ca=Ca[B2[Ea]])==null){an=null;break e}an=Ca}var Er,D2=an&&an[610401301];wa=D2!=null&&D2;const R2=Li.navigator;function xa(e){return!!wa&&!!Er&&Er.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Qe(e){var t;return(t=Li.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function jt(){return!!wa&&!!Er&&Er.brands.length>0}function ka(){return jt()?xa("Chromium"):(Qe("Chrome")||Qe("CriOS"))&&!(!jt()&&Qe("Edge"))||Qe("Silk")}function cn(e){return cn[" "](e),e}Er=R2&&R2.userAgentData||null,cn[" "]=function(){};var Rf=!jt()&&(Qe("Trident")||Qe("MSIE"));!Qe("Android")||ka(),ka(),Qe("Safari")&&(ka()||!jt()&&Qe("Coast")||!jt()&&Qe("Opera")||!jt()&&Qe("Edge")||(jt()?xa("Microsoft Edge"):Qe("Edg/"))||jt()&&xa("Opera"));var O2={},xr=null;function Of(e){const t=e.length;let i=3*t/4;i%3?i=Math.floor(i):"=.".indexOf(e[t-1])!=-1&&(i="=.".indexOf(e[t-2])!=-1?i-2:i-1);const r=new Uint8Array(i);let n=0;return function(o,s){function a(l){for(;c<o.length;){const d=o.charAt(c++),u=xr[d];if(u!=null)return u;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}P2();let c=0;for(;;){const l=a(-1),d=a(0),u=a(64),h=a(64);if(h===64&&l===-1)break;s(l<<2|d>>4),u!=64&&(s(d<<4&240|u>>2),h!=64&&s(u<<6&192|h))}}(e,function(o){r[n++]=o}),n!==i?r.subarray(0,n):r}function P2(){if(!xr){xr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const r=e.concat(t[i].split(""));O2[i]=r;for(let n=0;n<r.length;n++){const o=r[n];xr[o]===void 0&&(xr[o]=n)}}}}var $2=typeof Uint8Array!="undefined",N2=!Rf&&typeof btoa=="function";function H2(e){if(!N2){var t;t===void 0&&(t=0),P2(),t=O2[t];var i=Array(Math.floor(e.length/3)),r=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var n=e[c],o=e[c+1],s=e[c+2],a=t[n>>2];n=t[(3&n)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],i[l++]=a+n+o+s}switch(a=0,s=r,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||r;case 1:e=e[c],i[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+r}return i.join("")}for(t="",i=0,r=e.length-10240;i<r;)t+=String.fromCharCode.apply(null,e.subarray(i,i+=10240));return t+=String.fromCharCode.apply(null,i?e.subarray(i):e),btoa(t)}const U2=/[-_.]/g,Pf={"-":"+",_:"/",".":"="};function $f(e){return Pf[e]||""}function q2(e){if(!N2)return Of(e);U2.test(e)&&(e=e.replace(U2,$f)),e=atob(e);const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function di(e){return $2&&e!=null&&e instanceof Uint8Array}var Ti={};function hi(){return Nf||(Nf=new Tt(null,Ti))}function Aa(e){V2(Ti);var t=e.g;return(t=t==null||di(t)?t:typeof t=="string"?q2(t):null)==null?t:e.g=t}var Tt=class{h(){return new Uint8Array(Aa(this)||0)}constructor(e,t){if(V2(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Nf,Sa;function V2(e){if(e!==Ti)throw Error("illegal external caller")}function j2(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function La(e){return j2(e=Error(e),"warning"),e}function Ta(e){if(e!=null){var t=Sa!=null?Sa:Sa={},i=t[e]||0;i>=5||(t[e]=i+1,j2(e=Error(),"incident"),function(r){Li.setTimeout(()=>{throw r},0)}(e))}}var ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Mi(e,t,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var Hf=Mi("jas",void 0,!0),z2=Mi(void 0,"0di"),kr=Mi(void 0,"1oa"),Ii=Mi(void 0,Symbol()),Uf=Mi(void 0,"0actk"),G2=Mi(void 0,"8utk");const L=ln?Hf:"Ea",Z2={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},W2=Object.defineProperties;function un(e,t){ln||L in e||W2(e,Z2),e[L]|=t}function be(e,t){ln||L in e||W2(e,Z2),e[L]=t}function Fi(e){return un(e,34),e}function qf(e,t){be(t,-15615&(0|e))}function Ma(e,t){be(t,-15581&(34|e))}function dn(){return typeof BigInt=="function"}function Oe(e){return Array.prototype.slice.call(e)}var Ia,Ar={};function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Fa(e,t){if(e!=null){if(typeof e=="string")e=e?new Tt(e,Ti):hi();else if(e.constructor!==Tt)if(di(e))e=e.length?new Tt(new Uint8Array(e),Ti):hi();else{if(!t)throw Error();e=void 0}}return e}const X2=[];function zt(e){if(2&e)throw Error()}be(X2,55),Ia=Object.freeze(X2);class K2{constructor(t,i,r){this.g=t,this.h=i,this.l=r}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function Ba(e){return Ii?e[Ii]:void 0}var Vf=Object.freeze({});function fn(e){return e.Na=!0,e}var jf=fn(e=>typeof e=="number"),Y2=fn(e=>typeof e=="string"),zf=fn(e=>typeof e=="boolean"),pn=typeof Li.BigInt=="function"&&typeof Li.BigInt(0)=="bigint";function Gt(e){var t=e;if(Y2(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(jf(t)&&!Number.isSafeInteger(t))throw Error(String(t));return pn?BigInt(e):e=zf(e)?e?"1":"0":Y2(e)?e.trim()||"0":String(e)}var Da=fn(e=>pn?e>=Zf&&e<=Xf:e[0]==="-"?J2(e,Gf):J2(e,Wf));const Gf=Number.MIN_SAFE_INTEGER.toString(),Zf=pn?BigInt(Number.MIN_SAFE_INTEGER):void 0,Wf=Number.MAX_SAFE_INTEGER.toString(),Xf=pn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function J2(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let i=0;i<e.length;i++){const r=e[i],n=t[i];if(r>n)return!1;if(r<n)return!0}}const Kf=typeof Uint8Array.prototype.slice=="function";let Q2,Y=0,ue=0;function ed(e){const t=e>>>0;Y=t,ue=(e-t)/4294967296>>>0}function fi(e){if(e<0){ed(-e);const[t,i]=$a(Y,ue);Y=t>>>0,ue=i>>>0}else ed(e)}function Ra(e){const t=Q2||(Q2=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ue=0,Y=t.getUint32(0,!0)}function Oa(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:Sr(e,t)}function Pa(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Oa(e,t))=="number"?i?-e:e:i?"-"+e:e}function Sr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var i=""+(4294967296*t+e);else dn()?i=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(i=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,e>=1e7&&(i+=e/1e7>>>0,e%=1e7),i>=1e7&&(t+=i/1e7>>>0,i%=1e7),i=t+td(i)+td(e));return i}function td(e){return e=String(e),"0000000".slice(e.length)+e}function id(){var e=Y,t=ue;if(2147483648&t)if(dn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,r]=$a(e,t);e="-"+Sr(i,r)}else e=Sr(e,t);return e}function mn(e){if(e.length<16)fi(Number(e));else if(dn())e=BigInt(e),Y=Number(e&BigInt(4294967295))>>>0,ue=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ue=Y=0;const i=e.length;for(let r=t,n=(i-t)%6+t;n<=i;r=n,n+=6){const o=Number(e.slice(r,n));ue*=1e6,Y=1e6*Y+o,Y>=4294967296&&(ue+=Math.trunc(Y/4294967296),ue>>>=0,Y>>>=0)}if(t){const[r,n]=$a(Y,ue);Y=r,ue=n}}}function $a(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Lr=typeof BigInt=="function"?BigInt.asIntN:void 0,Yf=typeof BigInt=="function"?BigInt.asUintN:void 0,Zt=Number.isSafeInteger,gn=Number.isFinite,Bi=Math.trunc,Jf=Gt(0);function Wt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function rd(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Qf=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Tr(e){switch(typeof e){case"bigint":return!0;case"number":return gn(e);case"string":return Qf.test(e);default:return!1}}function Di(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return gn(e)?0|e:void 0}function nd(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return gn(e)?e>>>0:void 0}function od(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function sd(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function ad(e){return sd(e)?e:(mn(e),id())}function Na(e){return e=Bi(e),Zt(e)||(fi(e),e=Pa(Y,ue)),e}function cd(e){var t=Bi(Number(e));return Zt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),ad(e))}function ld(e){var t=Bi(Number(e));return Zt(t)?Gt(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),dn()?Gt(Lr(64,BigInt(e))):Gt(ad(e)))}function ud(e){if(Zt(e))e=Gt(Na(e));else{if(e=Bi(e),Zt(e))e=String(e);else{const t=String(e);sd(t)?e=t:(fi(e),e=id())}e=Gt(e)}return e}function Ha(e){return e==null?e:typeof e=="bigint"?(Da(e)?e=Number(e):(e=Lr(64,e),e=Da(e)?Number(e):String(e)),e):Tr(e)?typeof e=="number"?Na(e):cd(e):void 0}function ep(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Yf(64,e));if(Tr(e)){if(t==="string")return t=Bi(Number(e)),Zt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),od(e)||(mn(e),e=Sr(Y,ue))),e;if(t==="number")return(e=Bi(e))>=0&&Zt(e)?e:function(i){if(i<0){fi(i);var r=Sr(Y,ue);return i=Number(r),Zt(i)?i:r}return od(r=String(i))?r:(fi(i),Oa(Y,ue))}(e)}}function dd(e){if(typeof e!="string")throw Error();return e}function Ri(e){if(e!=null&&typeof e!="string")throw Error();return e}function Oi(e){return e==null||typeof e=="string"?e:void 0}function Ua(e,t,i,r){if(e!=null&&typeof e=="object"&&e.W===Ar)return e;if(!Array.isArray(e))return i?2&r?((e=t[z2])||(Fi((e=new t).u),e=t[z2]=e),t=e):t=new t:t=void 0,t;let n=i=0|e[L];return n===0&&(n|=32&r),n|=2&r,n!==i&&be(e,n),new t(e)}function tp(e,t,i){if(t)e:{if(!Tr(t=e))throw La("int64");switch(typeof t){case"string":t=ld(t);break e;case"bigint":t=Gt(Lr(64,t));break e;default:t=ud(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?Gt(Lr(64,t)):Tr(t)?e==="string"?ld(t):ud(t):void 0;return(e=t)==null?i?Jf:void 0:e}function ip(e){return e}const rp={};let np=function(){try{return cn(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class qa{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,i){return this.g.set(t,i),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}[Symbol.iterator](){return this.entries()}}const op=np?(Object.setPrototypeOf(qa.prototype,Map.prototype),Object.defineProperties(qa.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),qa):class extends Map{constructor(){super()}};function hd(e){return e}function Va(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var bt=class extends op{constructor(e,t,i=hd,r=hd){super();let n=0|e[L];n|=64,be(e,n),this.M=n,this.I=t,this.S=i,this.X=this.I?sp:r;for(let o=0;o<e.length;o++){const s=e[o],a=i(s[0],!1,!0);let c=s[1];t?c===void 0&&(c=null):c=r(s[1],!1,!0,void 0,void 0,n),super.set(a,c)}}La(){var e=dp;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=ap){const t=[],i=super.entries();for(var r;!(r=i.next()).done;)(r=r.value)[0]=e(r[0]),r[1]=e(r[1]),t.push(r);return t}clear(){Va(this),super.clear()}delete(e){return Va(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new K2(e,cp,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new K2(e,bt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((i,r,n)=>{e.call(t,n.get(r),r,n)}):super.forEach(e,t)}set(e,t){return Va(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var i=this.I;return i?((i=this.X(t,!1,!0,i,this.pa,this.M))!==t&&super.set(e,i),i):t}}[Symbol.iterator](){return this.entries()}};function sp(e,t,i,r,n,o){return e=Ua(e,r,i,o),n&&(e=_n(e)),e}function ap(e){return e}function cp(e){return[e,this.get(e)]}let lp,vn,fd,up;function pd(){return lp||(lp=new bt(Fi([]),void 0,void 0,void 0,rp))}function ja(e,t,i,r,n){if(e!=null){if(Array.isArray(e)){const o=0|e[L];return e.length===0&&1&o?void 0:n&&2&o?e:bn(e,t,i,r!==void 0,n)}return t(e,r)}}function bn(e,t,i,r,n){const o=r||i?0|e[L]:0,s=r?!!(32&o):void 0;let a=0;const c=(r=Oe(e)).length;for(let p=0;p<c;p++){var l=r[p];if(p===c-1&&hn(l)){var d=t,u=i,h=s,f=n;let m;for(let v in l){const g=ja(l[v],d,u,h,f);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=ja(r[p],t,i,s,n);r[p]=l,l!=null&&(a=p+1)}return a<c&&(r.length=a),i&&((e=Ba(e))&&(r[Ii]=Oe(e)),i(o,r)),r}function dp(e){return ja(e,za,void 0,void 0,!1)}function za(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Da(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(di(e))return di(e)&&Ta(G2),H2(e);if(e.W===Ar)return md(e);if(e instanceof Tt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=H2(t)}return e instanceof bt?e.La():void 0}return e}function md(e){var t=e.u;e=bn(t,za,void 0,void 0,!1);var i=0|t[L];if((t=e.length)&&!(512&i)){var r=e[t-1],n=!1;hn(r)?(t--,n=!0):r=void 0;var o=t-(i=512&i?0:-1),s=(vn!=null?vn:ip)(o,i,e,r);if(r&&(e[t]=void 0),o<s&&r){for(var a in o=!0,r){const c=+a;c<=s?(e[n=c+i]=r[a],t=Math.max(n+1,t),n=!1,delete r[a]):o=!1}o&&(r=void 0)}for(o=t-1;t>0;o=t-1)if((a=e[o])==null)t--,n=!0;else{if(!((o-=i)>=s))break;(r!=null?r:r={})[o]=a,t--,n=!0}n&&(e.length=t),r&&e.push(r)}return e}function Xt(e,t,i){return e=gd(e,t[0],t[1],i?1:2),t!==fd&&i&&un(e,8192),e}function gd(e,t,i,r){if(e==null){var n=96;i?(e=[i],n|=512):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(n=0|e[L])||!(64&n)||2&n||Ta(Uf),1024&n)throw Error("farr");if(64&n)return e;if(r===1||r===2||(n|=64),i&&(n|=512,i!==e[0]))throw Error("mid");e:{var o=(i=e).length;if(o){var s=o-1;if(hn(r=i[s])){if((s-=t=512&(n|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in r)(o=+a)<s&&(i[o+t]=r[a],delete r[a]);n=-16760833&n|(1023&s)<<14;break e}}if(t){if((a=Math.max(t,o-(512&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&a)<<14}}}return be(e,n),e}function Ga(e,t,i=Ma){if(e!=null){if($2&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var r=0|e[L];return 2&r?e:(t&&(t=r===0||!!(32&r)&&!(64&r||!(16&r))),t?(be(e,34|r),4&r&&Object.freeze(e),e):bn(e,Ga,4&r?Ma:i,!0,!0))}return e.W===Ar?e=2&(r=0|(i=e.u)[L])?e:new e.constructor(yn(i,r,!0)):e instanceof bt&&!(2&e.M)&&(i=Fi(e.da(Ga)),e=new bt(i,e.I,e.S,e.X)),e}}function yn(e,t,i){const r=i||2&t?Ma:qf,n=!!(32&t);return e=function(o,s,a){const c=Oe(o);var l=c.length;const d=256&s?c[l-1]:void 0;for(l+=d?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(d){s=c[s]={};for(const u in d)s[u]=a(d[u])}return(o=Ba(o))&&(c[Ii]=Oe(o)),c}(e,t,o=>Ga(o,n,r)),un(e,32|(i?2:0)),e}function _n(e){const t=e.u,i=0|t[L];return 2&i?new e.constructor(yn(t,i,!1)):e}function Pi(e,t){return Mt(e=e.u,0|e[L],t)}function Mt(e,t,i){if(i===-1)return null;const r=i+(512&t?0:-1),n=e.length-1;return r>=n&&256&t?e[n][i]:r<=n?e[r]:void 0}function Q(e,t,i){const r=e.u;let n=0|r[L];return zt(n),ce(r,n,t,i),e}function ce(e,t,i,r){const n=512&t?0:-1,o=i+n;var s=e.length-1;return o>=s&&256&t?(e[s][i]=r,t):o<=s?(e[o]=r,t):(r!==void 0&&(i>=(s=t>>14&1023||536870912)?r!=null&&(e[s+n]={[i]:r},be(e,t|=256)):e[o]=r),t)}function wn(e,t){let i=0|(e=e.u)[L];const r=Mt(e,i,t),n=Wt(r);return n!=null&&n!==r&&ce(e,i,t,n),n}function vd(e){let t=0|(e=e.u)[L];const i=Mt(e,t,1),r=Fa(i,!0);return r!=null&&r!==i&&ce(e,t,1,r),r}function pi(){return Vf===void 0?2:4}function mi(e,t,i,r,n){const o=e.u,s=2&(e=0|o[L])?1:r;n=!!n;let a=0|(r=Za(o,e,t))[L];if(!(4&a)){4&a&&(r=Oe(r),a=Bt(a,e),e=ce(o,e,t,r));let c=0,l=0;for(;c<r.length;c++){const d=i(r[c]);d!=null&&(r[l++]=d)}l<c&&(r.length=l),a=Wa(a,e),i=-2049&(20|a),a=i&=-4097,be(r,a),2&a&&Object.freeze(r)}return s===1||s===4&&32&a?It(a)||(n=a,a|=2,a!==n&&be(r,a),Object.freeze(r)):(s===2&&It(a)&&(r=Oe(r),a=Bt(a,e),a=Kt(a,e,n),be(r,a),e=ce(o,e,t,r)),It(a)||(t=a,a=Kt(a,e,n),a!==t&&be(r,a))),r}function Za(e,t,i){return e=Mt(e,t,i),Array.isArray(e)?e:Ia}function Wa(e,t){return e===0&&(e=Bt(e,t)),1|e}function It(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function bd(e){e=Oe(e);for(let t=0;t<e.length;t++){const i=e[t]=Oe(e[t]);Array.isArray(i[1])&&(i[1]=Fi(i[1]))}return e}function Xa(e,t,i,r){let n=0|(e=e.u)[L];zt(n),ce(e,n,t,(r==="0"?Number(i)===0:i===r)?void 0:i)}function $i(e,t,i,r){zt(t);let n=Za(e,t,i);const o=n!==Ia;if(64&t||!(8192&t)||!o){const s=o?0|n[L]:0;let a=s;(!o||2&a||It(a)||4&a&&!(32&a))&&(n=Oe(n),a=Bt(a,t),t=ce(e,t,i,n)),a=-13&Wa(a,t),a=Kt(r?-17&a:16|a,t,!0),a!==s&&be(n,a)}return n}function Ka(e,t){var i=bh;return Ja(Ya(e=e.u),e,0|e[L],i)===t?t:-1}function Ya(e){var i;if(ln)return(i=e[kr])!=null?i:e[kr]=new Map;if(kr in e)return e[kr];const t=new Map;return Object.defineProperty(e,kr,{value:t}),t}function yd(e,t,i,r){const n=Ya(e),o=Ja(n,e,t,i);return o!==r&&(o&&(t=ce(e,t,o)),n.set(i,r)),t}function Ja(e,t,i,r){let n=e.get(r);if(n!=null)return n;n=0;for(let o=0;o<r.length;o++){const s=r[o];Mt(t,i,s)!=null&&(n!==0&&(i=ce(t,i,n)),n=s)}return e.set(r,n),n}function Qa(e,t,i){let r=0|e[L];const n=Mt(e,r,i);let o;if(n!=null&&n.W===Ar)return(t=_n(n))!==n&&ce(e,r,i,t),t.u;if(Array.isArray(n)){const s=0|n[L];o=2&s?Xt(yn(n,s,!1),t,!0):64&s?n:Xt(o,t,!0)}else o=Xt(void 0,t,!0);return o!==n&&ce(e,r,i,o),o}function _d(e,t,i){let r=0|(e=e.u)[L];const n=Mt(e,r,i);return(t=Ua(n,t,!1,r))!==n&&t!=null&&ce(e,r,i,t),t}function V(e,t,i){if((t=_d(e,t,i))==null)return t;let r=0|(e=e.u)[L];if(!(2&r)){const n=_n(t);n!==t&&ce(e,r,i,t=n)}return t}function wd(e,t,i,r,n,o,s){e=e.u;var a=!!(2&t);const c=a?1:n;o=!!o,s&&(s=!a);var l=0|(n=Za(e,t,r))[L];if(!(a=!!(4&l))){var d=n,u=t;const h=!!(2&(l=Wa(l,t)));h&&(u|=2);let f=!h,p=!0,m=0,v=0;for(;m<d.length;m++){const g=Ua(d[m],i,!1,u);if(g instanceof i){if(!h){const b=!!(2&(0|g.u[L]));f&&(f=!b),p&&(p=b)}d[v++]=g}}v<m&&(d.length=v),l|=4,l=p?16|l:-17&l,be(d,l=f?8|l:-9&l),h&&Object.freeze(d)}if(s&&!(8&l||!n.length&&(c===1||c===4&&32&l))){for(It(l)&&(n=Oe(n),l=Bt(l,t),t=ce(e,t,r,n)),i=n,s=l,d=0;d<i.length;d++)(l=i[d])!==(u=_n(l))&&(i[d]=u);s|=8,be(i,s=i.length?-17&s:16|s),l=s}return c===1||c===4&&32&l?It(l)||(t=l,(l|=!n.length||16&l&&(!a||32&l)?2:1024)!==t&&be(n,l),Object.freeze(n)):(c===2&&It(l)&&(be(n=Oe(n),l=Kt(l=Bt(l,t),t,o)),t=ce(e,t,r,n)),It(l)||(r=l,(l=Kt(l,t,o))!==r&&be(n,l))),n}function Ft(e,t,i){const r=0|e.u[L];return wd(e,r,t,i,pi(),!1,!(2&r))}function I(e,t,i,r){return r==null&&(r=void 0),Q(e,i,r)}function Mr(e,t,i,r){r==null&&(r=void 0);e:{let n=0|(e=e.u)[L];if(zt(n),r==null){const o=Ya(e);if(Ja(o,e,n,i)!==t)break e;o.set(i,0)}else n=yd(e,n,i,t);ce(e,n,t,r)}}function Bt(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Kt(e,t,i){return 32&t&&i||(e&=-33),e}function Cn(e,t,i){zt(0|e.u[L]),mi(e,t,Oi,2,!0).push(dd(i))}function En(e,t,i,r){const n=0|e.u[L];zt(n),e=wd(e,n,i,t,2,!0),r=r!=null?r:new i,e.push(r),e[L]=2&(0|r.u[L])?-9&e[L]:-17&e[L]}function et(e,t){return Di(Pi(e,t))}function tt(e,t){return Oi(Pi(e,t))}function fe(e,t){var i;return(i=wn(e,t))!=null?i:0}function Ir(e,t,i){if(i!=null&&typeof i!="boolean")throw e=typeof i,Error(`Expected boolean but got ${e!="object"?e:i?Array.isArray(i)?"array":e:"null"}: ${i}`);Q(e,t,i)}function yt(e,t,i){if(i!=null){if(typeof i!="number"||!gn(i))throw La("int32");i|=0}Q(e,t,i)}function A(e,t,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);Q(e,t,i)}function xn(e,t,i){{const s=e.u;let a=0|s[L];if(zt(a),i==null)ce(s,a,t);else{var r=e=0|i[L],n=It(e),o=n||Object.isFrozen(i);for(n||(e=0),o||(i=Oe(i),r=0,e=Kt(e=Bt(e,a),a,!0),o=!1),e|=21,n=0;n<i.length;n++){const c=i[n],l=dd(c);Object.is(c,l)||(o&&(i=Oe(i),r=0,e=Kt(e=Bt(e,a),a,!0),o=!1),i[n]=l)}e!==r&&(o&&(i=Oe(i),e=Kt(e=Bt(e,a),a,!0)),be(i,e)),ce(s,a,t,i)}}}function Cd(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function ec(){return Error("Failed to read varint, encoding is invalid.")}function Ed(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function tc(e){if(typeof e=="string")return{buffer:q2(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Tt)return{buffer:Aa(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function ic(e,t){let i,r=0,n=0,o=0;const s=e.h;let a=e.g;do i=s[a++],r|=(127&i)<<o,o+=7;while(o<32&&128&i);for(o>32&&(n|=(127&i)>>4),o=3;o<32&&128&i;o+=7)i=s[a++],n|=(127&i)<<o;if(gi(e,a),i<128)return t(r>>>0,n>>>0);throw ec()}function rc(e){let t=0,i=e.g;const r=i+10,n=e.h;for(;i<r;){const o=n[i++];if(t|=o,(128&o)==0)return gi(e,i),!!(127&t)}throw ec()}function Yt(e){const t=e.h;let i=e.g,r=t[i++],n=127&r;if(128&r&&(r=t[i++],n|=(127&r)<<7,128&r&&(r=t[i++],n|=(127&r)<<14,128&r&&(r=t[i++],n|=(127&r)<<21,128&r&&(r=t[i++],n|=r<<28,128&r&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++])))))throw ec();return gi(e,i),n}function Dt(e){return Yt(e)>>>0}function nc(e){var t=e.h;const i=e.g,r=t[i],n=t[i+1],o=t[i+2];return t=t[i+3],gi(e,e.g+4),(r<<0|n<<8|o<<16|t<<24)>>>0}function oc(e){var t=nc(e);e=2*(t>>31)+1;const i=t>>>23&255;return t&=8388607,i==255?t?NaN:e*(1/0):i==0?1401298464324817e-60*e*t:e*Math.pow(2,i-150)*(t+8388608)}function hp(e){return Yt(e)}function sc(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=tc(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function gi(e,t){if(e.g=t,t>e.l)throw Ed(e.l,t)}function xd(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const i=e.g,r=i+t;if(r>e.l)throw Ed(t,e.l-i);return e.g=r,i}function kd(e,t){if(t==0)return hi();var i=xd(e,t);return e.aa&&e.m?i=e.h.subarray(i,i+t):(e=e.h,i=i===(t=i+t)?new Uint8Array(0):Kf?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?hi():new Tt(i,Ti)}bt.prototype.toJSON=void 0;var Ad=[];function Sd(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Dt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw Cd(i,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=i,!0}function kn(e){switch(e.h){case 0:e.h!=0?kn(e):rc(e.g);break;case 1:gi(e=e.g,e.g+8);break;case 2:if(e.h!=2)kn(e);else{var t=Dt(e.g);gi(e=e.g,e.g+t)}break;case 5:gi(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Sd(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}kn(e)}break;default:throw Cd(e.h,e.l)}}function Fr(e,t,i){const r=e.g.l,n=Dt(e.g),o=e.g.g+n;let s=o-r;if(s<=0&&(e.g.l=o,i(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=o,e.g.l=r,t}function ac(e){var t=Dt(e.g),i=xd(e=e.g,t);if(e=e.h,Ff){var r,n=e;(r=_a)||(r=_a=new TextDecoder("utf-8",{fatal:!0})),t=i+t,n=i===0&&t===n.length?n:n.subarray(i,t);try{var o=r.decode(n)}catch(a){if(sn===void 0){try{r.decode(new Uint8Array([128]))}catch(c){}try{r.decode(new Uint8Array([97])),sn=!0}catch(c){sn=!1}}throw!sn&&(_a=void 0),a}}else{t=(o=i)+t,i=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?i.push(s):s<224?o>=t?ui():(a=e[o++],s<194||(192&a)!=128?(o--,ui()):i.push((31&s)<<6|63&a)):s<240?o>=t-1?ui():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(r=e[o++]))!=128?(o--,ui()):i.push((15&s)<<12|(63&a)<<6|63&r)):s<=244?o>=t-2?ui():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(r=e[o++]))!=128||(192&(n=e[o++]))!=128?(o--,ui()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&n,s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))):ui(),i.length>=8192&&(c=I2(c,i),i.length=0)}o=I2(c,i)}return o}function Ld(e){const t=Dt(e.g);return kd(e.g,t)}function An(e,t,i){var r=Dt(e.g);for(r=e.g.g+r;e.g.g<r;)i.push(t(e.g))}var Sn=[];function ht(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var k=class{constructor(e,t){this.u=gd(e,t)}toJSON(){try{var e=md(this)}finally{vn=void 0}return e}l(){var e=Wp;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(yn(e,0|e[L],!1))}O(){return!!(2&(0|this.u[L]))}};function Td(e){return e?/^\d+$/.test(e)?(mn(e),new cc(Y,ue)):null:fp||(fp=new cc(0,0))}k.prototype.W=Ar,k.prototype.toString=function(){return this.u.toString()};var cc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let fp;function Md(e){return e?/^-?\d+$/.test(e)?(mn(e),new lc(Y,ue)):null:pp||(pp=new lc(0,0))}var lc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let pp;function Ni(e,t,i){for(;i>0||t>127;)e.g.push(127&t|128),t=(t>>>7|i<<25)>>>0,i>>>=7;e.g.push(t)}function Hi(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Ln(e,t){if(t>=0)Hi(e,t);else{for(let i=0;i<9;i++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Br(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Ui(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function He(e,t,i){Hi(e.g,8*t+i)}function uc(e,t){return He(e,t,2),t=e.g.end(),Ui(e,t),t.push(e.h),t}function dc(e,t){var i=t.pop();for(i=e.h+e.g.length()-i;i>127;)t.push(127&i|128),i>>>=7,e.h++;t.push(i),e.h++}function Tn(e,t,i){He(e,t,2),Hi(e.g,i.length),Ui(e,e.g.end()),Ui(e,i)}function Mn(e,t,i,r){i!=null&&(t=uc(e,t),r(i,e),dc(e,t))}function ft(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var hc=ft(),Id=ft(),fc=ft(),pc=ft(),Fd=ft(),Bd=ft(),mc=ft(),Dd=ft(),Rd=ft(),qi=class{constructor(e,t,i){this.g=e,this.h=t,e=hc,this.l=!!e&&i===e||!1}};function In(e,t){return new qi(e,t,hc)}function Od(e,t,i,r,n){Mn(e,i,Hd(t,r),n)}const mp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Qa(t,r,i),n),!0)},Od),gp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Qa(t,r,i),n),!0)},Od);var Fn=Symbol(),gc=Symbol(),Pd=Symbol(),$d=Symbol();let Bn,Dn;function vi(e,t,i,r){var n=r[e];if(n)return n;(n={}).Ma=r,n.T=function(u){switch(typeof u){case"boolean":return fd||(fd=[0,void 0,!0]);case"number":return u>0?void 0:u===0?up||(up=[0,void 0]):[-u,void 0];case"string":return[0,u];case"object":return u}}(r[0]);var o=r[1];let s=1;o&&o.constructor===Object&&(n.ga=o,typeof(o=r[++s])=="function"&&(n.la=!0,Bn!=null||(Bn=o),Dn!=null||(Dn=r[s+1]),o=r[s+=2]));const a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=r[++s]}for(c=1;o!==void 0;){let u;typeof o=="number"&&(c+=o,o=r[++s]);var l=void 0;if(o instanceof qi?u=o:(u=mp,s--),u==null?void 0:u.l){o=r[++s],l=r;var d=s;typeof o=="function"&&(o=o(),l[d]=o),l=o}for(d=c+1,typeof(o=r[++s])=="number"&&o<0&&(d-=o,o=r[++s]);c<d;c++){const h=a[c];l?i(n,c,u,l,h):t(n,c,u,h)}}return r[e]=n}function Nd(e){return Array.isArray(e)?e[0]instanceof qi?e:[gp,e]:[e,void 0]}function Hd(e,t){return e instanceof k?e.u:Array.isArray(e)?Xt(e,t,!1):void 0}function vc(e,t,i,r){const n=i.g;e[t]=r?(o,s,a)=>n(o,s,a,r):n}function bc(e,t,i,r,n){const o=i.g;let s,a;e[t]=(c,l,d)=>o(c,l,d,a||(a=vi(gc,vc,bc,r).T),s||(s=yc(r)),n)}function yc(e){let t=e[Pd];if(t!=null)return t;const i=vi(gc,vc,bc,e);return t=i.la?(r,n)=>Bn(r,n,i):(r,n)=>{const o=0|r[L];for(;Sd(n)&&n.h!=4;){var s=n.m,a=i[s];if(a==null){var c=i.ga;c&&(c=c[s])&&(c=vp(c))!=null&&(a=i[s]=c)}a!=null&&a(n,r,s)||(s=(a=n).l,kn(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=kd(a.g,c)),s=r,a&&((c=s[Ii])?c.push(a):s[Ii]=[a]))}return 8192&o&&Fi(r),!0},e[Pd]=t}function vp(e){const t=(e=Nd(e))[0].g;if(e=e[1]){const i=yc(e),r=vi(gc,vc,bc,e).T;return(n,o,s)=>t(n,o,s,r,i)}return t}function Rn(e,t,i){e[t]=i.h}function On(e,t,i,r){let n,o;const s=i.h;e[t]=(a,c,l)=>s(a,c,l,o||(o=vi(Fn,Rn,On,r).T),n||(n=Ud(r)))}function Ud(e){let t=e[$d];if(!t){const i=vi(Fn,Rn,On,e);t=(r,n)=>qd(r,n,i),e[$d]=t}return t}function qd(e,t,i){(function(r,n,o){const s=512&n?0:-1,a=r.length,c=a+((n=64&n?256&n:!!a&&hn(r[a-1]))?-1:0);for(let l=0;l<c;l++)o(l-s,r[l]);if(n){r=r[a-1];for(const l in r)!isNaN(l)&&o(+l,r[l])}})(e,0|e[L]|(i.T[1]?512:0),(r,n)=>{if(n!=null){var o=function(s,a){var c=s[a];if(c)return c;if((c=s.ga)&&(c=c[a])){var l=(c=Nd(c))[0].h;if(c=c[1]){const d=Ud(c),u=vi(Fn,Rn,On,c).T;c=s.la?Dn(u,d):(h,f,p)=>l(h,f,p,u,d)}else c=l;return s[a]=c}}(i,r);o&&o(t,n,r)}}),(e=Ba(e))&&function(r,n){Ui(r,r.g.end());for(let o=0;o<n.length;o++)Ui(r,Aa(n[o])||new Uint8Array(0))}(t,e)}function Vi(e,t){if(Array.isArray(t)){var i=0|t[L];if(4&i)return t;for(var r=0,n=0;r<t.length;r++){const o=e(t[r]);o!=null&&(t[n++]=o)}return n<r&&(t.length=n),be(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Me(e,t,i){return new qi(e,t,i)}function ji(e,t,i){return new qi(e,t,i)}function Ie(e,t,i){ce(e,0|e[L],t,i)}var bp=In(function(e,t,i,r,n){return e.h===2&&(e=Fr(e,Xt([void 0,void 0],r,!0),n),zt(r=0|t[L]),(n=Mt(t,r,i))instanceof bt?(2&n.M)!=0?((n=n.da()).push(e),ce(t,r,i,n)):n.Ja(e):Array.isArray(n)?(2&(0|n[L])&&ce(t,r,i,n=bd(n)),n.push(e)):ce(t,r,i,[e]),!0)},function(e,t,i,r,n){if(t instanceof bt)t.forEach((o,s)=>{Mn(e,i,Xt([s,o],r,!1),n)});else if(Array.isArray(t))for(let o=0;o<t.length;o++){const s=t[o];Array.isArray(s)&&Mn(e,i,Xt(s,r,!1),n)}});function Vd(e,t,i){if(t=function(r){if(r==null)return r;const n=typeof r;if(n==="bigint")return String(Lr(64,r));if(Tr(r)){if(n==="string")return cd(r);if(n==="number")return Na(r)}}(t),t!=null&&(typeof t=="string"&&Md(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,fi(t),Ni(e,Y,ue);break;case"bigint":i=BigInt.asUintN(64,t),i=new lc(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ni(e.g,i.h,i.g);break;default:i=Md(t),Ni(e.g,i.h,i.g)}}function jd(e,t,i){(t=Di(t))!=null&&t!=null&&(He(e,i,0),Ln(e.g,t))}function zd(e,t,i){(t=rd(t))!=null&&(He(e,i,0),e.g.g.push(t?1:0))}function Gd(e,t,i){(t=Oi(t))!=null&&Tn(e,i,F2(t))}function Zd(e,t,i,r,n){Mn(e,i,Hd(t,r),n)}function Wd(e,t,i){t==null||typeof t=="string"||t instanceof Tt||(di(t)?di(t)&&Ta(G2):t=void 0),t!=null&&Tn(e,i,tc(t).buffer)}function Xd(e,t,i){return(e.h===5||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,oc,t):t.push(oc(e.g)),!0)}var Rt=Me(function(e,t,i){if(e.h!==1)return!1;var r=e.g;e=nc(r);const n=nc(r);r=2*(n>>31)+1;const o=n>>>20&2047;return e=4294967296*(1048575&n)+e,Ie(t,i,o==2047?e?NaN:r*(1/0):o==0?5e-324*r*e:r*Math.pow(2,o-1075)*(e+4503599627370496)),!0},function(e,t,i){(t=Wt(t))!=null&&(He(e,i,1),e=e.g,(i=Q2||(Q2=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),Y=i.getUint32(0,!0),ue=i.getUint32(4,!0),Br(e,Y),Br(e,ue))},ft()),ye=Me(function(e,t,i){return e.h===5&&(Ie(t,i,oc(e.g)),!0)},function(e,t,i){(t=Wt(t))!=null&&(He(e,i,5),e=e.g,Ra(t),Br(e,Y))},mc),yp=ji(Xd,function(e,t,i){if((t=Vi(Wt,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(He(r,n,5),r=r.g,Ra(o),Br(r,Y))}},mc),_c=ji(Xd,function(e,t,i){if((t=Vi(Wt,t))!=null&&t.length){He(e,i,2),Hi(e.g,4*t.length);for(let r=0;r<t.length;r++)i=e.g,Ra(t[r]),Br(i,Y)}},mc),Jt=Me(function(e,t,i){return e.h===0&&(Ie(t,i,ic(e.g,Pa)),!0)},Vd,Bd),wc=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=ic(e.g,Pa))===0?void 0:e),!0)},Vd,Bd),_p=Me(function(e,t,i){return e.h===0&&(Ie(t,i,ic(e.g,Oa)),!0)},function(e,t,i){if((t=ep(t))!=null&&(typeof t=="string"&&Td(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,fi(t),Ni(e,Y,ue);break;case"bigint":i=BigInt.asUintN(64,t),i=new cc(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ni(e.g,i.h,i.g);break;default:i=Td(t),Ni(e.g,i.h,i.g)}},ft()),de=Me(function(e,t,i){return e.h===0&&(Ie(t,i,Yt(e.g)),!0)},jd,pc),Pn=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,Yt,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=uc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);dc(e,i)}},pc),zi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=Yt(e.g))===0?void 0:e),!0)},jd,pc),ne=Me(function(e,t,i){return e.h===0&&(Ie(t,i,rc(e.g)),!0)},zd,Id),Gi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=rc(e.g))===!1?void 0:e),!0)},zd,Id),Se=ji(function(e,t,i){return e.h===2&&(e=ac(e),$i(t,0|t[L],i,!1).push(e),!0)},function(e,t,i){if((t=Vi(Oi,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&Tn(r,n,F2(o))}},fc),Qt=Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=ac(e))===""?void 0:e),!0)},Gd,fc),W=Me(function(e,t,i){return e.h===2&&(Ie(t,i,ac(e)),!0)},Gd,fc),we=function(e,t,i=hc){return new qi(e,t,i)}(function(e,t,i,r,n){return e.h===2&&(r=Xt(void 0,r,!0),$i(t,0|t[L],i,!0).push(r),Fr(e,r,n),!0)},function(e,t,i,r,n){if(Array.isArray(t))for(let o=0;o<t.length;o++)Zd(e,t[o],i,r,n)}),X=In(function(e,t,i,r,n,o){return e.h===2&&(yd(t,0|t[L],o,i),Fr(e,t=Qa(t,r,i),n),!0)},Zd),Kd=Me(function(e,t,i){return e.h===2&&(Ie(t,i,Ld(e)),!0)},Wd,Dd),wp=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,Dt,t):t.push(Dt(e.g)),!0)},function(e,t,i){if((t=Vi(nd,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(He(r,n,0),Hi(r.g,o))}},Fd),Cp=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=Dt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=nd(t))!=null&&t!=null&&(He(e,i,0),Hi(e.g,t))},Fd),Ue=Me(function(e,t,i){return e.h===0&&(Ie(t,i,Yt(e.g)),!0)},function(e,t,i){(t=Di(t))!=null&&(t=parseInt(t,10),He(e,i,0),Ln(e.g,t))},Rd);class Ep{constructor(t,i){this.h=t,this.g=i,this.l=V,this.m=I,this.defaultValue=void 0}register(){cn(this)}}function pt(e,t){return new Ep(e,t)}function ei(e,t){return(i,r)=>{if(Sn.length){const o=Sn.pop();o.o(r),sc(o.g,i,r),i=o}else i=new class{constructor(o,s){if(Ad.length){const a=Ad.pop();sc(a,o,s),o=a}else o=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,sc(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(o,s);this.g=o,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:o=!1}={}){this.fa=o}}(i,r);try{const o=new e,s=o.u;yc(t)(s,i);var n=o}finally{i.g.clear(),i.m=-1,i.h=-1,Sn.length<100&&Sn.push(i)}return n}}function $n(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const s=this.g;return this.g=[],s}}}};qd(this.u,t,vi(Fn,Rn,On,e)),Ui(t,t.g.end());const i=new Uint8Array(t.h),r=t.l,n=r.length;let o=0;for(let s=0;s<n;s++){const a=r[s];i.set(a,o),o+=a.length}return t.l=[i],i}}var Yd=class extends k{constructor(e){super(e)}},Jd=[0,Qt,Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=Ld(e))===hi()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof k){const r=t.Oa;return void(r&&(t=r(t),t!=null&&Tn(e,i,tc(t).buffer)))}if(Array.isArray(t))return}Wd(e,t,i)},Dd)];let Cc,Qd=globalThis.trustedTypes;function eh(e){Cc===void 0&&(Cc=function(){let i=null;if(!Qd)return i;try{const r=n=>n;i=Qd.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(r){}return i}());var t=Cc;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function xp(e,...t){if(t.length===0)return eh(e[0]);let i=e[0];for(let r=0;r<t.length;r++)i+=encodeURIComponent(t[r])+e[r+1];return eh(i)}var th=[0,de,Ue,ne,-1,Pn,Ue,-1],kp=class extends k{constructor(e){super(e)}},ih=[0,ne,W,ne,Ue,-1,ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,hp,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=uc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);dc(e,i)}},Rd),W,-1,[0,ne,-1],Ue,ne,-1],rh=[0,W,-2],nh=class extends k{constructor(e){super(e)}},oh=[0],sh=[0,de,ne,1,ne,-3],qe=class extends k{constructor(e){super(e,2)}},_e={};_e[336783863]=[0,W,ne,-1,de,[0,[1,2,3,4,5,6,7,8,9],X,oh,X,ih,X,rh,X,sh,X,th,X,[0,W,-2],X,[0,W,Ue],X,[0,Ue,W,-1],X,[0,Ue,-1]],[0,W],ne,[0,[1,3],[2,4],X,[0,Pn],-1,X,[0,Se],-1,we,[0,W,-1]],W];var ah=[0,wc,-1,Gi,-3,wc,Pn,Qt,zi,wc,-1,Gi,zi,Gi,-2,Qt];function Ve(e,t){Xa(e,2,Ri(t),"")}function ee(e,t){Cn(e,3,t)}function q(e,t){Cn(e,4,t)}var Fe=class extends k{constructor(e){super(e,500)}o(e){return I(this,0,7,e)}},Dr=[-1,{}],ch=[0,W,1,Dr],lh=[0,W,Se,Dr];function je(e,t){En(e,1,Fe,t)}function ie(e,t){Cn(e,10,t)}function z(e,t){Cn(e,15,t)}var Pe=class extends k{constructor(e){super(e,500)}o(e){return I(this,0,1001,e)}},uh=[-500,we,[-500,Qt,-1,Se,-3,[-2,_e,ne],we,Jd,zi,-1,ch,lh,we,[0,Qt,Gi],Qt,ah,zi,Se,987,Se],4,we,[-500,W,-1,[-1,{}],998,W],we,[-500,W,Se,-1,[-2,{},ne],997,Se,-1],zi,we,[-500,W,Se,Dr,998,Se],Se,zi,ch,lh,we,[0,Qt,-1,Dr],Se,-2,ah,Qt,-1,Gi,[0,Gi,Cp],978,Dr,we,Jd];Pe.prototype.g=$n(uh);var Ap=ei(Pe,uh),Sp=class extends k{constructor(e){super(e)}},dh=class extends k{constructor(e){super(e)}g(){return Ft(this,Sp,1)}},hh=[0,we,[0,de,ye,W,-1]],Nn=ei(dh,hh),Lp=class extends k{constructor(e){super(e)}},Tp=class extends k{constructor(e){super(e)}},Ec=class extends k{constructor(e){super(e)}h(){return V(this,Lp,2)}g(){return Ft(this,Tp,5)}},fh=ei(class extends k{constructor(e){super(e)}},[0,Se,Pn,_c,[0,Ue,[0,de,-3],[0,ye,-3],[0,de,-1,[0,we,[0,de,-2]]],we,[0,ye,-1,W,ye]],W,-1,Jt,we,[0,de,ye],Se,Jt]),ph=class extends k{constructor(e){super(e)}},Zi=ei(class extends k{constructor(e){super(e)}},[0,we,[0,ye,-4]]),mh=class extends k{constructor(e){super(e)}},Rr=ei(class extends k{constructor(e){super(e)}},[0,we,[0,ye,-4]]),Mp=class extends k{constructor(e){super(e)}},Ip=[0,de,-1,_c,Ue],gh=class extends k{constructor(e){super(e)}};gh.prototype.g=$n([0,ye,-4,Jt]);var Fp=class extends k{constructor(e){super(e)}},Bp=ei(class extends k{constructor(e){super(e)}},[0,we,[0,1,de,W,hh],Jt]),vh=class extends k{constructor(e){super(e)}},Dp=class extends k{constructor(e){super(e)}ma(){const e=vd(this);return e==null?hi():e}},Rp=class extends k{constructor(e){super(e)}},bh=[1,2],Op=ei(class extends k{constructor(e){super(e)}},[0,we,[0,bh,X,[0,_c],X,[0,Kd],de,W],Jt]),xc=class extends k{constructor(e){super(e)}},yh=[0,W,de,ye,Se,-1],_h=class extends k{constructor(e){super(e)}},Pp=[0,ne,-1],wh=class extends k{constructor(e){super(e)}},Hn=[1,2,3,4,5],Un=class extends k{constructor(e){super(e)}g(){return vd(this)!=null}h(){return tt(this,2)!=null}},oe=class extends k{constructor(e){super(e)}g(){var e;return(e=rd(Pi(this,2)))!=null?e:!1}},Ch=[0,Kd,W,[0,de,Jt,-1],[0,_p,Jt]],pe=[0,Ch,ne,[0,Hn,X,sh,X,ih,X,th,X,oh,X,rh],Ue],qn=class extends k{constructor(e){super(e)}},kc=[0,pe,ye,-1,de],$p=pt(502141897,qn);_e[502141897]=kc;var Np=ei(class extends k{constructor(e){super(e)}},[0,[0,Ue,-1,yp,wp],Ip]),Eh=class extends k{constructor(e){super(e)}},xh=class extends k{constructor(e){super(e)}},Ac=[0,pe,ye,[0,pe],ne],kh=[0,pe,kc,Ac,ye,[0,[0,Ch]]],Hp=pt(508968150,xh);_e[508968150]=kh,_e[508968149]=Ac;var Ah=class extends k{constructor(e){super(e)}},Up=pt(513916220,Ah);_e[513916220]=[0,pe,kh,de];var Wi=class extends k{constructor(e){super(e)}h(){return V(this,xc,2)}g(){Q(this,2)}},Sh=[0,pe,yh];_e[478825465]=Sh;var qp=class extends k{constructor(e){super(e)}},Lh=class extends k{constructor(e){super(e)}},Sc=class extends k{constructor(e){super(e)}},Lc=class extends k{constructor(e){super(e)}},Th=class extends k{constructor(e){super(e)}},Mh=[0,pe,[0,pe],Sh,-1],Ih=[0,pe,ye,de],Tc=[0,pe,ye],Fh=[0,pe,Ih,Tc,ye],Vp=pt(479097054,Th);_e[479097054]=[0,pe,Fh,Mh],_e[463370452]=Mh,_e[464864288]=Ih;var jp=pt(462713202,Lc);_e[462713202]=Fh,_e[474472470]=Tc;var zp=class extends k{constructor(e){super(e)}},Bh=class extends k{constructor(e){super(e)}},Dh=class extends k{constructor(e){super(e)}},Rh=class extends k{constructor(e){super(e)}},Mc=[0,pe,ye,-1,de],Ic=[0,pe,ye,ne];Rh.prototype.g=$n([0,pe,Tc,[0,pe],kc,Ac,Mc,Ic]);var Oh=class extends k{constructor(e){super(e)}},Gp=pt(456383383,Oh);_e[456383383]=[0,pe,yh];var Ph=class extends k{constructor(e){super(e)}},Zp=pt(476348187,Ph);_e[476348187]=[0,pe,Pp];var $h=class extends k{constructor(e){super(e)}},Nh=class extends k{constructor(e){super(e)}},Hh=[0,Ue,-1],Wp=pt(458105876,class extends k{constructor(e){super(e)}g(){var e=this.u;const t=0|e[L],i=2&t;return e=function(r,n,o){var s=Nh;const a=2&n;let c=!1;if(o==null){if(a)return pd();o=[]}else if(o.constructor===bt){if((2&o.M)==0||a)return o;o=o.da()}else Array.isArray(o)?c=!!(2&(0|o[L])):o=[];if(a){if(!o.length)return pd();c||(c=!0,Fi(o))}else c&&(c=!1,o=bd(o));return c||(64&(0|o[L])?o[L]&=-33:32&n&&un(o,32)),ce(r,n,2,s=new bt(o,s,tp,void 0)),s}(e,t,Mt(e,t,2)),!i&&Nh&&(e.pa=!0),e}});_e[458105876]=[0,Hh,bp,[!0,Jt,[0,W,-1,Se]]];var Fc=class extends k{constructor(e){super(e)}},Uh=pt(458105758,Fc);_e[458105758]=[0,pe,W,Hh];var qh=class extends k{constructor(e){super(e)}},Xp=pt(443442058,qh);_e[443442058]=[0,pe,W,de,ye,Se,-1,ne,ye],_e[514774813]=Mc;var Vh=class extends k{constructor(e){super(e)}},Kp=pt(516587230,Vh);function Bc(e,t){return t=t?t.clone():new xc,e.displayNamesLocale!==void 0?Q(t,1,Ri(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Q(t,1),e.maxResults!==void 0?yt(t,2,e.maxResults):"maxResults"in e&&Q(t,2),e.scoreThreshold!==void 0?A(t,3,e.scoreThreshold):"scoreThreshold"in e&&Q(t,3),e.categoryAllowlist!==void 0?xn(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Q(t,4),e.categoryDenylist!==void 0?xn(t,5,e.categoryDenylist):"categoryDenylist"in e&&Q(t,5),t}function Dc(e,t=-1,i=""){return{categories:e.map(r=>{var n,o,s,a,c,l,d;return{index:(o=(n=et(r,1))!=null?n:0)!=null?o:-1,score:(s=fe(r,2))!=null?s:0,categoryName:(c=(a=tt(r,3))!=null?a:"")!=null?c:"",displayName:(d=(l=tt(r,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function jh(e){var s,a,c,l,d,u,h,f,p,m,v,g,b;var t=mi(e,3,Wt,pi()),i=mi(e,2,Di,pi()),r=mi(e,1,Oi,pi()),n=mi(e,9,Oi,pi());const o={categories:[],keypoints:[]};for(let _=0;_<t.length;_++)o.categories.push({score:t[_],index:(s=i[_])!=null?s:-1,categoryName:(a=r[_])!=null?a:"",displayName:(c=n[_])!=null?c:""});if((t=(l=V(e,Ec,4))==null?void 0:l.h())&&(o.boundingBox={originX:(d=et(t,1))!=null?d:0,originY:(u=et(t,2))!=null?u:0,width:(h=et(t,3))!=null?h:0,height:(f=et(t,4))!=null?f:0,angle:0}),(p=V(e,Ec,4))==null?void 0:p.g().length)for(const _ of V(e,Ec,4).g())o.keypoints.push({x:(m=wn(_,1))!=null?m:0,y:(v=wn(_,2))!=null?v:0,score:(g=wn(_,4))!=null?g:0,label:(b=tt(_,3))!=null?b:""});return o}function Vn(e){var i,r,n,o;const t=[];for(const s of Ft(e,mh,1))t.push({x:(i=fe(s,1))!=null?i:0,y:(r=fe(s,2))!=null?r:0,z:(n=fe(s,3))!=null?n:0,visibility:(o=fe(s,4))!=null?o:0});return t}function Or(e){var i,r,n,o;const t=[];for(const s of Ft(e,ph,1))t.push({x:(i=fe(s,1))!=null?i:0,y:(r=fe(s,2))!=null?r:0,z:(n=fe(s,3))!=null?n:0,visibility:(o=fe(s,4))!=null?o:0});return t}function zh(e){return Array.from(e,t=>t>127?t-256:t)}function Gh(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let i=0,r=0,n=0;for(let o=0;o<e.length;o++)i+=e[o]*t[o],r+=e[o]*e[o],n+=t[o]*t[o];if(r<=0||n<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(r*n)}let jn;_e[516587230]=[0,pe,Mc,Ic,ye],_e[518928384]=Ic;const Yp=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function Zh(){return S(this,null,function*(){if(jn===void 0)try{yield WebAssembly.instantiate(Yp),jn=!0}catch(e){jn=!1}return jn})}function Pr(i){return S(this,arguments,function*(e,t=xp``){const r=(yield Zh())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}})}var bi=class{};function Wh(){var e=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}function Xh(e){return S(this,null,function*(){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((i,r)=>{t.addEventListener("load",()=>{i()},!1),t.addEventListener("error",n=>{r(n)},!1),document.body.appendChild(t)})}importScripts(e.toString())})}function Kh(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function T(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Yh(e,t,i){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(i?e.i._bindTextureToStream(i):e.i._bindTextureToCanvas(),!(i=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[r,n]=Kh(t);return!e.l||r===e.i.canvas.width&&n===e.i.canvas.height||(e.i.canvas.width=r,e.i.canvas.height=n),[r,n]}function Jh(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(t.length);for(let n=0;n<t.length;n++)r[n]=e.i.stringToNewUTF8(t[n]);t=e.i._malloc(4*r.length),e.i.HEAPU32.set(r,t>>2),i(t);for(const n of r)e.i._free(n);e.i._free(t)}function _t(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function ti(e,t,i){let r=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(n,o,s)=>{o?(i(r,s),r=[]):r.push(n)}}bi.forVisionTasks=function(e){return Pr("vision",e)},bi.forTextTasks=function(e){return Pr("text",e)},bi.forGenAiExperimentalTasks=function(e){return Pr("genai_experimental",e)},bi.forGenAiTasks=function(e){return Pr("genai",e)},bi.forAudioTasks=function(e){return Pr("audio",e)},bi.isSimdSupported=function(){return Zh()};function Jp(e,t,i,r){return S(this,null,function*(){return e=yield((n,o,s,a,c)=>S(this,null,function*(){if(o&&(yield Xh(o)),!self.ModuleFactory||s&&(yield Xh(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((o=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new n(c,a)}))(e,i.wasmLoaderPath,i.assetLoaderPath,t,{locateFile:n=>n.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&n.endsWith(".data")?i.assetBinaryPath.toString():n}),yield e.o(r),e})}function Rc(e,t){const i=V(e.baseOptions,Un,1)||new Un;typeof t=="string"?(Q(i,2,Ri(t)),Q(i,1)):t instanceof Uint8Array&&(Q(i,1,Fa(t,!1)),Q(i,2)),I(e.baseOptions,0,1,i)}function Qh(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(i=>i.message).join(", "))}finally{e.G=[]}}function w(e,t){e.B=Math.max(e.B,t)}function zn(e,t){e.A=new Fe,Ve(e.A,"PassThroughCalculator"),ee(e.A,"free_memory"),q(e.A,"free_memory_unused_out"),ie(t,"free_memory"),je(t,e.A)}function Xi(e,t){ee(e.A,t),q(e.A,t+"_unused_out")}function Gn(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Oc=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var i,r,n,o,s,a;if(t){const c=e.baseOptions||{};if((i=e.baseOptions)!=null&&i.modelAssetBuffer&&((r=e.baseOptions)!=null&&r.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((n=V(this.baseOptions,Un,1))!=null&&n.g()||(o=V(this.baseOptions,Un,1))!=null&&o.h()||(s=e.baseOptions)!=null&&s.modelAssetBuffer||(a=e.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(l,d){let u=V(l.baseOptions,wh,3);if(!u){var h=u=new wh,f=new nh;Mr(h,4,Hn,f)}"delegate"in d&&(d.delegate==="GPU"?(d=u,h=new kp,Mr(d,2,Hn,h)):(d=u,h=new nh,Mr(d,4,Hn,h))),I(l.baseOptions,0,3,u)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(l=>{if(l.ok)return l.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${l.status})`)}).then(l=>{try{this.g.i.FS_unlink("/model.dat")}catch(d){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(l),!0,!1,!1),Rc(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Rc(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return S(this,null,function*(){const d=[];for(var u=0;;){const{done:h,value:f}=yield l.read();if(h)break;d.push(f),u+=f.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];l=new Uint8Array(u),u=0;for(const h of d)l.set(h,u),u+=h.length;return l})}(c.modelAssetBuffer).then(l=>{Rc(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Ap(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((i,r)=>{this.G.push(Error(r))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Qh(this)}finishProcessing(){this.g.finishProcessing(),Qh(this)}close(){this.A=void 0,this.g.closeGraph()}};function Be(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Oc.prototype.close=Oc.prototype.close;class Qp{constructor(t,i,r,n){this.g=t,this.h=i,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function e0(e,t,i){const r=e.g;if(i=Be(r.createShader(i),"Failed to create WebGL shader"),r.shaderSource(i,t),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(i)}`);return r.attachShader(e.h,i),i}function t0(e,t){const i=e.g,r=Be(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(r);const n=Be(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,n),i.enableVertexAttribArray(e.P),i.vertexAttribPointer(e.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const o=Be(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,o),i.enableVertexAttribArray(e.J),i.vertexAttribPointer(e.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new Qp(i,r,n,o)}function Pc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function $r(e,t,i,r){return Pc(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=t0(e,!0)),i=e.s):(e.v||(e.v=t0(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=r(),i.g.bindVertexArray(null),e}function ii(e,t,i){return Pc(e,t),e=Be(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i!=null?i:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i!=null?i:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Zn(e,t,i){Pc(e,t),e.A||(e.A=Be(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}function $c(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ki=class{G(){return`
|
|
3120
3104
|
precision mediump float;
|
|
3121
3105
|
varying vec2 vTex;
|
|
3122
3106
|
uniform sampler2D inputTexture;
|
|
3123
3107
|
void main() {
|
|
3124
3108
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
3125
3109
|
}
|
|
3126
|
-
`}m(){const e=this.g;if(this.h=
|
|
3110
|
+
`}m(){const e=this.g;if(this.h=Be(e.createProgram(),"Failed to create WebGL program"),this.Z=e0(this,`
|
|
3127
3111
|
attribute vec2 aVertex;
|
|
3128
3112
|
attribute vec2 aTex;
|
|
3129
3113
|
varying vec2 vTex;
|
|
3130
3114
|
void main(void) {
|
|
3131
3115
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
3132
3116
|
vTex = aTex;
|
|
3133
|
-
}`,e.VERTEX_SHADER),this.Y=
|
|
3117
|
+
}`,e.VERTEX_SHADER),this.Y=e0(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},e5=class extends Ki{G(){return`
|
|
3134
3118
|
precision mediump float;
|
|
3135
3119
|
uniform sampler2D backgroundTexture;
|
|
3136
3120
|
uniform sampler2D maskTexture;
|
|
@@ -3142,7 +3126,7 @@ ${this.hideAttribution?"":`
|
|
|
3142
3126
|
vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
|
|
3143
3127
|
gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
|
|
3144
3128
|
}
|
|
3145
|
-
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.B=
|
|
3129
|
+
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.B=ii(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=ii(this,e,e.NEAREST)}m(){super.m();const e=this.g;this.L=Be(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=Be(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=Be(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.K,0),e.uniform1i(this.L,1),e.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},t5=class extends Ki{G(){return`
|
|
3146
3130
|
precision mediump float;
|
|
3147
3131
|
uniform sampler2D maskTexture;
|
|
3148
3132
|
uniform sampler2D defaultTexture;
|
|
@@ -3156,7 +3140,7 @@ ${this.hideAttribution?"":`
|
|
|
3156
3140
|
overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
|
|
3157
3141
|
gl_FragColor = mix(defaultColor, overlayColor, confidence);
|
|
3158
3142
|
}
|
|
3159
|
-
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.j=Wt(this,e),e.activeTexture(e.TEXTURE2),this.B=Wt(this,e)}m(){super.m();const e=this.g;this.K=Te(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Te(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Te(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.K,1),e.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Tt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof Uint8Array);case 1:return e.g.find(i=>i instanceof Float32Array);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function No(e){var t=Tt(e,1);if(!t){if(t=Tt(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=Hi(e);var i=Ho(e);if(Ar(i,n,i2(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,i);for(let r=0,s=0;r<t.length;++r,s+=4)t[r]=i[s]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function i2(e){let t=Tt(e,2);if(!t){const i=Hi(e);t=r2(e);const n=No(e),r=n2(e);i.texImage2D(i.TEXTURE_2D,0,r,e.width,e.height,0,i.RED,i.FLOAT,n),Uo(e)}return t}function Hi(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Te(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function n2(e){if(e=Hi(e),!Sr)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sr=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sr=e.R16F}return Sr}function Ho(e){return e.l||(e.l=new Ni),e.l}function r2(e){const t=Hi(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Tt(e,2);return i||(i=Wt(Ho(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Uo(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sr,ye=class{constructor(e,t,i,n,r,s,o){this.g=e,this.m=t,this.j=i,this.canvas=n,this.l=r,this.width=s,this.height=o,this.j&&--s2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Tt(this,0)}ja(){return!!Tt(this,1)}R(){return!!Tt(this,2)}ia(){return(t=Tt(e=this,0))||(t=No(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return No(this)}N(){return i2(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof Uint8Array)i=new Uint8Array(t);else if(t instanceof Float32Array)i=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=Hi(this),r=Ho(this);n.activeTexture(n.TEXTURE1),i=Wt(r,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,i);const s=n2(this);n.texImage2D(n.TEXTURE_2D,0,s,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),Ar(r,n,i),_n(r,n,!1,()=>{r2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),Uo(this)}),$o(r),Uo(this)}}e.push(i)}return new ye(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Hi(this).deleteTexture(Tt(this,2)),s2=-1}};ye.prototype.close=ye.prototype.close,ye.prototype.clone=ye.prototype.clone,ye.prototype.getAsWebGLTexture=ye.prototype.N,ye.prototype.getAsFloat32Array=ye.prototype.ha,ye.prototype.getAsUint8Array=ye.prototype.ia,ye.prototype.hasWebGLTexture=ye.prototype.R,ye.prototype.hasFloat32Array=ye.prototype.ja,ye.prototype.hasUint8Array=ye.prototype.Da;var s2=250;const M0={color:"white",lineWidth:4,radius:6};function Vo(e){return Fe(qi(Fe({},M0),{fillColor:(e=e||{}).color}),e)}function It(e,t){return e instanceof Function?e(t):e}function o2(e,t,i){return Math.max(Math.min(t,i),Math.min(Math.max(t,i),e))}function Cn(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function En(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function a2(e,t,i){var n;if(t.R())i(t.N());else{const r=t.ja()?t.ha():t.ia();e.m=(n=e.m)!=null?n:new Ni;const s=En(e);i((e=new ye([r],t.m,!1,s.canvas,e.m,t.width,t.height)).N()),e.close()}}function c2(e,t,i,n){const r=function(a){return a.g||(a.g=new S0),a.g}(e),s=En(e),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;_n(r,s,!0,()=>{(function(c,l,d,h){const u=c.g;if(u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,c.B),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,d),c.H&&function(p,f){if(p!==f)return!1;p=p.entries(),f=f.entries();for(const[v,g]of p){p=v;const b=g;var m=f.next();if(m.done)return!1;const[_,E]=m.value;if(m=E,p!==_||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!f.next().done}(c.H,h))u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j);else{c.H=h;const p=Array(1024).fill(0);h.forEach((f,m)=>{if(f.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);p[4*m]=f[0],p[4*m+1]=f[1],p[4*m+2]=f[2],p[4*m+3]=f[3]}),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,256,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(p))}})(r,t,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const a=r.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function l2(e,t,i,n){const r=En(e),s=function(c){return c.h||(c.h=new L0),c.h}(e),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;_n(s,r,!0,()=>{var c=s.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,s.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,o),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,s.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),r.bindTexture(r.TEXTURE_2D,null),(c=s.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var Ie=class{constructor(e,t){typeof CanvasRenderingContext2D!="undefined"&&e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}wa(e,t){if(e){var i=Cn(this);t=Vo(t),i.save();var n=i.canvas,r=0;for(const s of e)i.fillStyle=It(t.fillColor,{index:r,from:s}),i.strokeStyle=It(t.color,{index:r,from:s}),i.lineWidth=It(t.lineWidth,{index:r,from:s}),(e=new Path2D).arc(s.x*n.width,s.y*n.height,It(t.radius,{index:r,from:s}),0,2*Math.PI),i.fill(e),i.stroke(e),++r;i.restore()}}va(e,t,i){if(e&&t){var n=Cn(this);i=Vo(i),n.save();var r=n.canvas,s=0;for(const o of t){n.beginPath(),t=e[o.start];const a=e[o.end];t&&a&&(n.strokeStyle=It(i.color,{index:s,from:t,to:a}),n.lineWidth=It(i.lineWidth,{index:s,from:t,to:a}),n.moveTo(t.x*r.width,t.y*r.height),n.lineTo(a.x*r.width,a.y*r.height)),++s,n.stroke()}n.restore()}}sa(e,t){const i=Cn(this);t=Vo(t),i.save(),i.beginPath(),i.lineWidth=It(t.lineWidth,{}),i.strokeStyle=It(t.color,{}),i.fillStyle=It(t.fillColor,{}),i.moveTo(e.originX,e.originY),i.lineTo(e.originX+e.width,e.originY),i.lineTo(e.originX+e.width,e.originY+e.height),i.lineTo(e.originX,e.originY+e.height),i.lineTo(e.originX,e.originY),i.stroke(),i.fill(),i.restore()}ta(e,t,i=[0,0,0,255]){this.l?function(n,r,s,o){const a=En(n);a2(n,r,c=>{c2(n,c,s,o),(c=Cn(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):c2(this,e.N(),i,t)}ua(e,t,i){this.l?function(n,r,s,o){const a=En(n);a2(n,r,c=>{l2(n,c,s,o),(c=Cn(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):l2(this,e.N(),t,i)}close(){var e,t,i;(e=this.g)==null||e.close(),this.g=void 0,(t=this.h)==null||t.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function mt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof ImageData);case 1:return e.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function h2(e){var t=mt(e,0);if(!t){t=Ui(e);const i=Mr(e),n=new Uint8Array(e.width*e.height*4);Ar(i,t,Lr(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,n),$o(i),t=new ImageData(new Uint8ClampedArray(n.buffer),e.width,e.height),e.g.push(t)}return t}function Lr(e){let t=mt(e,2);if(!t){const i=Ui(e);t=Tr(e);const n=mt(e,1)||h2(e);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),xn(e)}return t}function Ui(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Te(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Mr(e){return e.l||(e.l=new Ni),e.l}function Tr(e){const t=Ui(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=mt(e,2);return i||(i=Wt(Mr(e),t),e.g.push(i),e.m=!0),t.bindTexture(t.TEXTURE_2D,i),i}function xn(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function d2(e){const t=Ui(e);return _n(Mr(e),t,!0,()=>function(i,n){const r=i.canvas;if(r.width===i.width&&r.height===i.height)return n();const s=r.width,o=r.height;return r.width=i.width,r.height=i.height,i=n(),r.width=s,r.height=o,i}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}Ie.prototype.close=Ie.prototype.close,Ie.prototype.drawConfidenceMask=Ie.prototype.ua,Ie.prototype.drawCategoryMask=Ie.prototype.ta,Ie.prototype.drawBoundingBox=Ie.prototype.sa,Ie.prototype.drawConnectors=Ie.prototype.va,Ie.prototype.drawLandmarks=Ie.prototype.wa,Ie.lerp=function(e,t,i,n,r){return o2(n*(1-(e-t)/(i-t))+r*(1-(i-e)/(i-t)),n,r)},Ie.clamp=o2;var _e=class{constructor(e,t,i,n,r,s,o){this.g=e,this.j=t,this.m=i,this.canvas=n,this.l=r,this.width=s,this.height=o,(this.j||this.m)&&--u2===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!mt(this,0)}ka(){return!!mt(this,1)}R(){return!!mt(this,2)}Aa(){return h2(this)}za(){var e=mt(this,1);return e||(Lr(this),Tr(this),e=d2(this),xn(this),this.g.push(e),this.j=!0),e}N(){return Lr(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof ImageData)i=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const n=Ui(this),r=Mr(this);n.activeTexture(n.TEXTURE1),i=Wt(r,n),n.bindTexture(n.TEXTURE_2D,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),Ar(r,n,i),_n(r,n,!1,()=>{Tr(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),xn(this)}),$o(r),xn(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Lr(this),Tr(this),i=d2(this),xn(this)}e.push(i)}return new _e(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&mt(this,1).close(),this.m&&Ui(this).deleteTexture(mt(this,2)),u2=-1}};_e.prototype.close=_e.prototype.close,_e.prototype.clone=_e.prototype.clone,_e.prototype.getAsWebGLTexture=_e.prototype.N,_e.prototype.getAsImageBitmap=_e.prototype.za,_e.prototype.getAsImageData=_e.prototype.Aa,_e.prototype.hasWebGLTexture=_e.prototype.R,_e.prototype.hasImageBitmap=_e.prototype.ka,_e.prototype.hasImageData=_e.prototype.Ca;var u2=250;function ht(...e){return e.map(([t,i])=>({start:t,end:i}))}const T0=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((p2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Wl()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}initializeGraph(e){return L(this,null,function*(){const t=yield(yield fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)})}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const i=e.length,n=this.i._malloc(i);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(i,n):this.i._changeTextGraph(i,n),this.i._free(n)}configureAudio(e,t,i,n,r){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),A(this,n||"input_audio",s=>{A(this,r=r||"audio_header",o=>{this.i._configureAudio(s,o,e,t!=null?t:0,i)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){ft(this,"__graph_config__",t=>{e(t)}),A(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,i){this.addAudioToStreamWithShape(e,0,0,t,i)}addAudioToStreamWithShape(e,t,i,n,r){const s=4*e.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(e,this.g/4),A(this,n,o=>{this.i._addAudioToInputStream(this.g,t,i,o,r)})}addGpuBufferToStream(e,t,i){A(this,t,n=>{const[r,s]=Kl(this,e,n);this.i._addBoundTextureToStream(n,r,s,i)})}addBoolToStream(e,t,i){A(this,t,n=>{this.i._addBoolToInputStream(e,n,i)})}addDoubleToStream(e,t,i){A(this,t,n=>{this.i._addDoubleToInputStream(e,n,i)})}addFloatToStream(e,t,i){A(this,t,n=>{this.i._addFloatToInputStream(e,n,i)})}addIntToStream(e,t,i){A(this,t,n=>{this.i._addIntToInputStream(e,n,i)})}addUintToStream(e,t,i){A(this,t,n=>{this.i._addUintToInputStream(e,n,i)})}addStringToStream(e,t,i){A(this,t,n=>{A(this,e,r=>{this.i._addStringToInputStream(r,n,i)})})}addStringRecordToStream(e,t,i){A(this,t,n=>{Jl(this,Object.keys(e),r=>{Jl(this,Object.values(e),s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(e).length,n,i)})})})}addProtoToStream(e,t,i,n){A(this,i,r=>{A(this,t,s=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,s,r,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){A(this,e,i=>{this.i._addEmptyPacketToInputStream(i,t)})}addBoolVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputStream(r,n,i)})}addDoubleVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputStream(r,n,i)})}addFloatVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputStream(r,n,i)})}addIntVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputStream(r,n,i)})}addUintVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputStream(r,n,i)})}addStringVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of e)A(this,s,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputStream(r,n,i)})}addBoolToInputSidePacket(e,t){A(this,t,i=>{this.i._addBoolToInputSidePacket(e,i)})}addDoubleToInputSidePacket(e,t){A(this,t,i=>{this.i._addDoubleToInputSidePacket(e,i)})}addFloatToInputSidePacket(e,t){A(this,t,i=>{this.i._addFloatToInputSidePacket(e,i)})}addIntToInputSidePacket(e,t){A(this,t,i=>{this.i._addIntToInputSidePacket(e,i)})}addUintToInputSidePacket(e,t){A(this,t,i=>{this.i._addUintToInputSidePacket(e,i)})}addStringToInputSidePacket(e,t){A(this,t,i=>{A(this,e,n=>{this.i._addStringToInputSidePacket(n,i)})})}addProtoToInputSidePacket(e,t,i){A(this,i,n=>{A(this,t,r=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputSidePacket(s,e.length,r,n),this.i._free(s)})})}addBoolVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const r of e)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputSidePacket(n,i)})}addDoubleVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const r of e)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputSidePacket(n,i)})}addFloatVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const r of e)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputSidePacket(n,i)})}addIntVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const r of e)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputSidePacket(n,i)})}addUintVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of e)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputSidePacket(n,i)})}addStringVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const r of e)A(this,r,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputSidePacket(n,i)})}attachBoolListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(e,t,i){ft(this,e,t),A(this,e,n=>{this.i._attachProtoListener(n,i||!1)})}attachProtoVectorListener(e,t,i){qt(this,e,t),A(this,e,n=>{this.i._attachProtoVectorListener(n,i||!1)})}attachAudioListener(e,t,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ft(this,e,(n,r)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,r)}),A(this,e,n=>{this.i._attachAudioListener(n,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends p2{get ea(){return this.i}oa(e,t,i){A(this,t,n=>{const[r,s]=Kl(this,e,n);this.ea._addBoundTextureAsImageToStream(n,r,s,i)})}V(e,t){ft(this,e,t),A(this,e,i=>{this.ea._attachImageListener(i)})}ba(e,t){qt(this,e,t),A(this,e,i=>{this.ea._attachImageVectorListener(i)})}}));var p2,Je=class extends T0{};function R(e,t,i){return L(this,null,function*(){var n;return function(r,s,o,a){return L(this,null,function*(){return k0(r,s,o,a)})}(e,(n=i.canvas)!=null?n:Wl()?void 0:document.createElement("canvas"),t,i)})}function f2(e,t,i,n){if(e.U){const s=new gl;if(i!=null&&i.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var r=i.regionOfInterest;if(r.left>=r.right||r.top>=r.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(r.left<0||r.top<0||r.right>1||r.bottom>1)throw Error("Expected RectF values to be in [0,1].");x(s,1,(r.left+r.right)/2),x(s,2,(r.top+r.bottom)/2),x(s,4,r.right-r.left),x(s,3,r.bottom-r.top)}else x(s,1,.5),x(s,2,.5),x(s,4,1),x(s,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(x(s,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[o,a]=Yl(t);i=he(s,3)*a/o,r=he(s,4)*o/a,x(s,4,i),x(s,3,r)}}e.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.oa(t,e.Z,n!=null?n:performance.now()),e.finishProcessing()}function Qe(e,t,i){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");f2(e,t,i,e.B+1)}function gt(e,t,i,n){var r;if(!((r=e.baseOptions)!=null&&r.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");f2(e,t,i,n)}function Vi(e,t,i,n){var r=t.data;const s=t.width,o=s*(t=t.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==o)throw Error("Unsupported channel count: "+r.length/o);return e=new ye([r],i,!1,e.g.i.canvas,e.P,s,t),n?e.clone():e}var Re=class extends Oo{constructor(e,t,i,n){super(e),this.g=e,this.Z=t,this.U=i,this.na=n,this.P=new Ni}l(e,t=!0){if("runningMode"in e&&fn(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Re.prototype.close=Re.prototype.close;var et=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},S(e=this.h=new _r,0,1,t=new ee),x(this.h,2,.5),x(this.h,3,.3)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return"minDetectionConfidence"in e&&x(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&x(this.h,3,(i=e.minSuppressionThreshold)!=null?i:.3),this.l(e)}D(e,t){return this.j={detections:[]},Qe(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect_in"),H(e,"detections");const t=new He;at(t,d0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect_in"),$(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=pl(s),this.j.detections.push(Gl(n));y(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};et.prototype.detectForVideo=et.prototype.F,et.prototype.detect=et.prototype.D,et.prototype.setOptions=et.prototype.o,et.createFromModelPath=function(e,t){return L(this,null,function*(){return R(et,e,{baseOptions:{modelAssetPath:t}})})},et.createFromModelBuffer=function(e,t){return R(et,e,{baseOptions:{modelAssetBuffer:t}})},et.createFromOptions=function(e,t){return R(et,e,t)};var jo=ht([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Go=ht([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),zo=ht([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),m2=ht([474,475],[475,476],[476,477],[477,474]),Zo=ht([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),qo=ht([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),g2=ht([469,470],[470,471],[471,472],[472,469]),Wo=ht([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),v2=[...jo,...Go,...zo,...Zo,...qo,...Wo],b2=ht([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function w2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var K=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,S(e=this.h=new xl,0,1,t=new ee),this.v=new El,S(this.h,0,3,this.v),this.s=new _r,S(this.h,0,2,this.s),pt(this.s,4,1),x(this.s,2,.5),x(this.v,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r;return"numFaces"in e&&pt(this.s,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&x(this.s,2,(i=e.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minFacePresenceConfidence"in e&&x(this.v,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return w2(this),Qe(this,e,t),this.j}F(e,t,i){return w2(this),gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"face_landmarks");const t=new He;at(t,p0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"NORM_LANDMARKS:face_landmarks"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("face_landmarks",(n,r)=>{for(const s of n)n=bn(s),this.j.faceLandmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{y(this,n)}),this.outputFaceBlendshapes&&(H(e,"blendshapes"),$(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,r)=>{var s;if(this.outputFaceBlendshapes)for(const o of n)n=br(o),this.j.faceBlendshapes.push(Do((s=n.g())!=null?s:[]));y(this,r)}),this.g.attachEmptyPacketListener("blendshapes",n=>{y(this,n)})),this.outputFacialTransformationMatrixes&&(H(e,"face_geometry"),$(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,r)=>{var s,o,a,c,l;if(this.outputFacialTransformationMatrixes)for(const d of n)(n=N(u0(d),n0,2))&&this.j.facialTransformationMatrixes.push({rows:(o=(s=Ye(n,1))!=null?s:0)!=null?o:0,columns:(c=(a=Ye(n,2))!=null?a:0)!=null?c:0,data:(l=ri(n,3,Ht,ni()).slice())!=null?l:[]});y(this,r)}),this.g.attachEmptyPacketListener("face_geometry",n=>{y(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};K.prototype.detectForVideo=K.prototype.F,K.prototype.detect=K.prototype.D,K.prototype.setOptions=K.prototype.o,K.createFromModelPath=function(e,t){return R(K,e,{baseOptions:{modelAssetPath:t}})},K.createFromModelBuffer=function(e,t){return R(K,e,{baseOptions:{modelAssetBuffer:t}})},K.createFromOptions=function(e,t){return R(K,e,t)},K.FACE_LANDMARKS_LIPS=jo,K.FACE_LANDMARKS_LEFT_EYE=Go,K.FACE_LANDMARKS_LEFT_EYEBROW=zo,K.FACE_LANDMARKS_LEFT_IRIS=m2,K.FACE_LANDMARKS_RIGHT_EYE=Zo,K.FACE_LANDMARKS_RIGHT_EYEBROW=qo,K.FACE_LANDMARKS_RIGHT_IRIS=g2,K.FACE_LANDMARKS_FACE_OVAL=Wo,K.FACE_LANDMARKS_CONTOURS=v2,K.FACE_LANDMARKS_TESSELATION=b2;var vt=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!0),S(e=this.j=new Al,0,1,t=new ee)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,i){const n=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:i,Qe(this,e,n!=null?n:{}),!this.h)return this.s}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"stylized_image");const t=new He;at(t,f0,this.j);const i=new Me;Ue(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"STYLIZED_IMAGE:stylized_image"),i.o(t),Ve(e,i),this.g.V("stylized_image",(n,r)=>{var s=!this.h,o=n.data,a=n.width;const c=a*(n=n.height);if(o instanceof Uint8Array)if(o.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=o[3*d],l[4*d+1]=o[3*d+1],l[4*d+2]=o[3*d+2],l[4*d+3]=255;o=new ImageData(l,a,n)}else{if(o.length!==4*c)throw Error("Unsupported channel count: "+o.length/c);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),a,n)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);a=new _e([o],!1,!1,this.g.i.canvas,this.P,a,n),this.s=s=s?a.clone():a,this.h&&this.h(s),y(this,r)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};vt.prototype.stylize=vt.prototype.Ka,vt.prototype.setOptions=vt.prototype.o,vt.createFromModelPath=function(e,t){return R(vt,e,{baseOptions:{modelAssetPath:t}})},vt.createFromModelBuffer=function(e,t){return R(vt,e,{baseOptions:{modelAssetBuffer:t}})},vt.createFromOptions=function(e,t){return R(vt,e,t)};var Xo=ht([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function y2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function _2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function C2(e,t=!0){var r,s,o,a,c,l;const i=[];for(const d of e){var n=br(d);e=[];for(const h of n.g())n=t&&Ye(h,1)!=null?(r=Ye(h,1))!=null?r:0:-1,e.push({score:(s=he(h,2))!=null?s:0,index:n,categoryName:(a=(o=Ke(h,3))!=null?o:"")!=null?a:"",displayName:(l=(c=Ke(h,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var je=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.j=new Ml,0,1,t=new ee),this.s=new Lo,S(this.j,0,2,this.s),this.C=new So,S(this.s,0,3,this.C),this.v=new Ll,S(this.s,0,2,this.v),this.h=new m0,S(this.j,0,3,this.h),x(this.v,2,.5),x(this.s,4,.5),x(this.C,2,.5)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var r,s,o,a,c,l,d,h;if(pt(this.v,3,(r=e.numHands)!=null?r:1),"minHandDetectionConfidence"in e&&x(this.v,2,(s=e.minHandDetectionConfidence)!=null?s:.5),"minTrackingConfidence"in e&&x(this.s,4,(o=e.minTrackingConfidence)!=null?o:.5),"minHandPresenceConfidence"in e&&x(this.C,2,(a=e.minHandPresenceConfidence)!=null?a:.5),e.cannedGesturesClassifierOptions){var t=new Pi,i=t,n=Bo(e.cannedGesturesClassifierOptions,(c=N(this.h,Pi,3))==null?void 0:c.h());S(i,0,2,n),S(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=N(this.h,Pi,3))==null||l.g());return e.customGesturesClassifierOptions?(S(i=t=new Pi,0,2,n=Bo(e.customGesturesClassifierOptions,(d=N(this.h,Pi,4))==null?void 0:d.h())),S(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((h=N(this.h,Pi,4))==null||h.g()),this.l(e)}Fa(e,t){return y2(this),Qe(this,e,t),_2(this)}Ga(e,t,i){return y2(this),gt(this,e,i,t),_2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"hand_gestures"),H(e,"hand_landmarks"),H(e,"world_hand_landmarks"),H(e,"handedness");const t=new He;at(t,g0,this.j);const i=new Me;Ue(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"HAND_GESTURES:hand_gestures"),$(i,"LANDMARKS:hand_landmarks"),$(i,"WORLD_LANDMARKS:world_hand_landmarks"),$(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{var s,o,a,c;for(const l of n){n=bn(l);const d=[];for(const h of At(n,ml,1))d.push({x:(s=he(h,1))!=null?s:0,y:(o=he(h,2))!=null?o:0,z:(a=he(h,3))!=null?a:0,visibility:(c=he(h,4))!=null?c:0});this.landmarks.push(d)}y(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{var s,o,a,c;for(const l of n){n=Oi(l);const d=[];for(const h of At(n,fl,1))d.push({x:(s=he(h,1))!=null?s:0,y:(o=he(h,2))!=null?o:0,z:(a=he(h,3))!=null?a:0,visibility:(c=he(h,4))!=null?c:0});this.worldLandmarks.push(d)}y(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,r)=>{this.gestures.push(...C2(n,!1)),y(this,r)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{y(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{this.handedness.push(...C2(n)),y(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function E2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}je.prototype.recognizeForVideo=je.prototype.Ga,je.prototype.recognize=je.prototype.Fa,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return R(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return R(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return R(je,e,t)},je.HAND_CONNECTIONS=Xo;var Ge=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.h=new Lo,0,1,t=new ee),this.s=new So,S(this.h,0,3,this.s),this.j=new Ll,S(this.h,0,2,this.j),pt(this.j,3,1),x(this.j,2,.5),x(this.s,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r;return"numHands"in e&&pt(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&x(this.j,2,(i=e.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minHandPresenceConfidence"in e&&x(this.s,2,(r=e.minHandPresenceConfidence)!=null?r:.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Qe(this,e,t),E2(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],gt(this,e,i,t),E2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"hand_landmarks"),H(e,"world_hand_landmarks"),H(e,"handedness");const t=new He;at(t,v0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"LANDMARKS:hand_landmarks"),$(i,"WORLD_LANDMARKS:world_hand_landmarks"),$(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n)n=bn(s),this.landmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n)n=Oi(s),this.worldLandmarks.push(wn(n));y(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{var c,l,d,h,u,p,f;var s=this.handedness,o=s.push;const a=[];for(const m of n){n=br(m);const v=[];for(const g of n.g())v.push({score:(c=he(g,2))!=null?c:0,index:(d=(l=Ye(g,1))!=null?l:0)!=null?d:-1,categoryName:(u=(h=Ke(g,3))!=null?h:"")!=null?u:"",displayName:(f=(p=Ke(g,4))!=null?p:"")!=null?f:""});a.push(v)}o.call(s,...a),y(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ge.prototype.detectForVideo=Ge.prototype.F,Ge.prototype.detect=Ge.prototype.D,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return R(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return R(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return R(Ge,e,t)},Ge.HAND_CONNECTIONS=Xo;var x2=ht([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function k2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function A2(e){try{if(!e.C)return e.h;e.C(e.h)}finally{kr(e)}}function Ir(e,t){e=bn(e),t.push(Cr(e))}var te=class extends Re{constructor(e,t){super(new Je(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,S(e=this.j=new Rl,0,1,t=new ee),this.K=new So,S(this.j,0,2,this.K),this.Y=new b0,S(this.j,0,3,this.Y),this.s=new _r,S(this.j,0,4,this.s),this.H=new El,S(this.j,0,5,this.H),this.v=new Bl,S(this.j,0,6,this.v),this.L=new Dl,S(this.j,0,7,this.L),x(this.s,2,.5),x(this.s,3,.3),x(this.H,2,.5),x(this.v,2,.5),x(this.v,3,.3),x(this.L,2,.5),x(this.K,2,.5)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var t,i,n,r,s,o,a;return"minFaceDetectionConfidence"in e&&x(this.s,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&x(this.s,3,(i=e.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in e&&x(this.H,2,(n=e.minFacePresenceConfidence)!=null?n:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&x(this.v,2,(r=e.minPoseDetectionConfidence)!=null?r:.5),"minPoseSuppressionThreshold"in e&&x(this.v,3,(s=e.minPoseSuppressionThreshold)!=null?s:.3),"minPosePresenceConfidence"in e&&x(this.L,2,(o=e.minPosePresenceConfidence)!=null?o:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&x(this.K,2,(a=e.minHandLandmarksConfidence)!=null?a:.5),this.l(e)}D(e,t,i){const n=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:i,k2(this),Qe(this,e,n),A2(this)}F(e,t,i,n){const r=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:n,k2(this),gt(this,e,r,t),A2(this)}m(){var e=new De;Y(e,"input_frames_image"),H(e,"pose_landmarks"),H(e,"pose_world_landmarks"),H(e,"face_landmarks"),H(e,"left_hand_landmarks"),H(e,"left_hand_world_landmarks"),H(e,"right_hand_landmarks"),H(e,"right_hand_world_landmarks");const t=new He,i=new Kc;Ws(i,1,xi("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(r,s){if(s!=null)if(Array.isArray(s))W(r,2,Kn(s,Gs,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof Et||ei(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Ws(r,2,Is(s,!1),ti())}}(i,this.j.g());const n=new Me;Ue(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ir(n,8,Kc,i),X(n,"IMAGE:input_frames_image"),$(n,"POSE_LANDMARKS:pose_landmarks"),$(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),$(n,"FACE_LANDMARKS:face_landmarks"),$(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),$(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),$(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),$(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ve(e,n),xr(this,e),this.g.attachProtoListener("pose_landmarks",(r,s)=>{Ir(r,this.h.poseLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("pose_world_landmarks",(r,s)=>{var o=this.h.poseWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",r=>{y(this,r)}),this.outputPoseSegmentationMasks&&($(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),$i(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(r,s)=>{this.h.poseSegmentationMasks=[Vi(this,r,!0,!this.C)],y(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",r=>{this.h.poseSegmentationMasks=[],y(this,r)})),this.g.attachProtoListener("face_landmarks",(r,s)=>{Ir(r,this.h.faceLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{y(this,r)}),this.outputFaceBlendshapes&&(H(e,"extra_blendshapes"),$(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(r,s)=>{var a;var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(r=br(r),o.push(Do((a=r.g())!=null?a:[]))),y(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",r=>{y(this,r)})),this.g.attachProtoListener("left_hand_landmarks",(r,s)=>{Ir(r,this.h.leftHandLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("left_hand_world_landmarks",(r,s)=>{var o=this.h.leftHandWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("right_hand_landmarks",(r,s)=>{Ir(r,this.h.rightHandLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("right_hand_world_landmarks",(r,s)=>{var o=this.h.rightHandWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",r=>{y(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};te.prototype.detectForVideo=te.prototype.F,te.prototype.detect=te.prototype.D,te.prototype.setOptions=te.prototype.o,te.createFromModelPath=function(e,t){return R(te,e,{baseOptions:{modelAssetPath:t}})},te.createFromModelBuffer=function(e,t){return R(te,e,{baseOptions:{modelAssetBuffer:t}})},te.createFromOptions=function(e,t){return R(te,e,t)},te.HAND_CONNECTIONS=Xo,te.POSE_CONNECTIONS=x2,te.FACE_LANDMARKS_LIPS=jo,te.FACE_LANDMARKS_LEFT_EYE=Go,te.FACE_LANDMARKS_LEFT_EYEBROW=zo,te.FACE_LANDMARKS_LEFT_IRIS=m2,te.FACE_LANDMARKS_RIGHT_EYE=Zo,te.FACE_LANDMARKS_RIGHT_EYEBROW=qo,te.FACE_LANDMARKS_RIGHT_IRIS=g2,te.FACE_LANDMARKS_FACE_OVAL=Wo,te.FACE_LANDMARKS_CONTOURS=v2,te.FACE_LANDMARKS_TESSELATION=b2;var tt=class extends Re{constructor(e,t){super(new Je(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},S(e=this.h=new Ol,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return S(this.h,0,2,Bo(e,N(this.h,xo,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},Qe(this,e,t),this.j}ra(e,t,i){return this.j={classifications:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"input_image"),Y(e,"norm_rect"),H(e,"classifications");const t=new He;at(t,w0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),X(i,"IMAGE:input_image"),X(i,"NORM_RECT:norm_rect"),$(i,"CLASSIFICATIONS:classifications"),i.o(t),Ve(e,i),this.g.attachProtoListener("classifications",(n,r)=>{this.j=function(s){var a;const o={classifications:At(s,s0,1).map(c=>{var l,d,h,u;return Do((d=(l=N(c,dl,4))==null?void 0:l.g())!=null?d:[],(h=Ye(c,2))!=null?h:0,(u=Ke(c,3))!=null?u:"")})};return Ns(Ai(s,2))!=null&&(o.timestampMs=(a=Ns(Ai(s,2)))!=null?a:0),o}(o0(n)),y(this,r)}),this.g.attachEmptyPacketListener("classifications",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};tt.prototype.classifyForVideo=tt.prototype.ra,tt.prototype.classify=tt.prototype.qa,tt.prototype.setOptions=tt.prototype.o,tt.createFromModelPath=function(e,t){return R(tt,e,{baseOptions:{modelAssetPath:t}})},tt.createFromModelBuffer=function(e,t){return R(tt,e,{baseOptions:{modelAssetBuffer:t}})},tt.createFromOptions=function(e,t){return R(tt,e,t)};var ze=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!0),this.h=new Pl,this.embeddings={embeddings:[]},S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t=this.h,i=N(this.h,yl,2);return i=i?i.clone():new yl,e.l2Normalize!==void 0?fn(i,1,e.l2Normalize):"l2Normalize"in e&&W(i,1),e.quantize!==void 0?fn(i,2,e.quantize):"quantize"in e&&W(i,2),S(t,0,2,i),this.l(e)}xa(e,t){return Qe(this,e,t),this.embeddings}ya(e,t,i){return gt(this,e,i,t),this.embeddings}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"embeddings_out");const t=new He;at(t,y0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"EMBEDDINGS:embeddings_out"),i.o(t),Ve(e,i),this.g.attachProtoListener("embeddings_out",(n,r)=>{n=l0(n),this.embeddings=function(s){var o;return{embeddings:At(s,c0,1).map(a=>{var l,d,h,u,p,f,m;const c={headIndex:(d=(l=Ye(a,3))!=null?l:0)!=null?d:-1,headName:(u=(h=Ke(a,4))!=null?h:"")!=null?u:""};if(yc(a,vl,Xs(a,1))!==void 0)a=ri(a=N(a,vl,Xs(a,1)),1,Ht,ni()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(f=(p=N(a,a0,Xs(a,2)))==null?void 0:p.ma())==null?void 0:f.h())!=null?m:v}return c}),timestampMs:(o=Ns(Ai(s,2)))!=null?o:0}}(n),y(this,r)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ze.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Zl(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Zl(zl(e.quantizedEmbedding),zl(t.quantizedEmbedding))}return e},ze.prototype.embedForVideo=ze.prototype.ya,ze.prototype.embed=ze.prototype.xa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return R(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return R(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return R(ze,e,t)};var Yo=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};function S2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function L2(e){try{const t=new Yo(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kr(e)}}Yo.prototype.close=Yo.prototype.close;var Oe=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fo,this.v=new $l,S(this.h,0,3,this.v),S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return e.displayNamesLocale!==void 0?W(this.h,2,xi(e.displayNamesLocale)):"displayNamesLocale"in e&&W(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}J(){(function(e){var i,n,r;const t=At(e.ca(),Me,1).filter(s=>{var o;return((o=Ke(s,1))!=null?o:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&((r=(n=(i=N(t[0],He,7))==null?void 0:i.l())==null?void 0:n.g())!=null?r:new Map).forEach((s,o)=>{var a;e.s[Number(o)]=(a=Ke(s,1))!=null?a:""})})(this)}segment(e,t,i){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,S2(this),Qe(this,e,n),L2(this)}Ia(e,t,i,n){const r=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:n,S2(this),gt(this,e,r,t),L2(this)}Ba(){return this.s}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect");const t=new He;at(t,Ul,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),i.o(t),Ve(e,i),xr(this,e),this.outputConfidenceMasks&&(H(e,"confidence_masks"),$(i,"CONFIDENCE_MASKS:confidence_masks"),$i(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Vi(this,s,!0,!this.j)),y(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],y(this,n)})),this.outputCategoryMask&&(H(e,"category_mask"),$(i,"CATEGORY_MASK:category_mask"),$i(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Vi(this,n,!1,!this.j),y(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,y(this,n)})),H(e,"quality_scores"),$(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,y(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Oe.prototype.getLabels=Oe.prototype.Ba,Oe.prototype.segmentForVideo=Oe.prototype.Ia,Oe.prototype.segment=Oe.prototype.segment,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return R(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return R(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return R(Oe,e,t)};var Ko=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};Ko.prototype.close=Ko.prototype.close;var I0=class extends C{constructor(e){super(e)}},ji=[0,ae,-2],Fr=[0,Mt,-3,Q,Mt,-1],M2=[0,Fr],T2=[0,Fr,ae,-1],Jo=class extends C{constructor(e){super(e)}},I2=[0,Mt,-1,Q],F0=class extends C{constructor(e){super(e)}},F2=class extends C{constructor(e){super(e)}},Qo=[1,2,3,4,5,6,7,8,9,10,14,15],B2=class extends C{constructor(e){super(e)}};B2.prototype.g=vr([0,we,[0,Qo,G,Fr,G,[0,Fr,ji],G,M2,G,[0,M2,ji],G,I2,G,[0,Mt,-3,Q,Ne],G,[0,Mt,-3,Q],G,[0,j,Mt,-2,Q,ae,Q,-1,2,Mt,ji],G,T2,G,[0,T2,ji],Mt,ji,j,G,[0,Mt,-3,Q,ji,-1],G,[0,we,I2]],j,[0,j,ae,-1,Q]]);var bt=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fo,this.s=new $l,S(this.h,0,3,this.s),S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}segment(e,t,i,n){const r=typeof i!="function"?i:{};this.j=typeof i=="function"?i:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,n=new B2;const s=new F2;var o=new I0;if(pt(o,1,255),S(s,0,12,o),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Jo;fn(a,3,!0),x(a,1,t.keypoint.x),x(a,2,t.keypoint.y),pn(s,5,Qo,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new F0,t.scribble))fn(t=new Jo,3,!0),x(t,1,a.x),x(t,2,a.y),ir(o,1,Jo,t);pn(s,15,Qo,o)}ir(n,1,F2,s),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",i),Qe(this,e,r);e:{try{const l=new Ko(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{kr(this)}c=void 0}return c}m(){var e=new De;Y(e,"image_in"),Y(e,"roi_in"),Y(e,"norm_rect_in");const t=new He;at(t,Ul,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),X(i,"IMAGE:image_in"),X(i,"ROI:roi_in"),X(i,"NORM_RECT:norm_rect_in"),i.o(t),Ve(e,i),xr(this,e),this.outputConfidenceMasks&&(H(e,"confidence_masks"),$(i,"CONFIDENCE_MASKS:confidence_masks"),$i(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Vi(this,s,!0,!this.j)),y(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],y(this,n)})),this.outputCategoryMask&&(H(e,"category_mask"),$(i,"CATEGORY_MASK:category_mask"),$i(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Vi(this,n,!1,!this.j),y(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,y(this,n)})),H(e,"quality_scores"),$(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,y(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};bt.prototype.segment=bt.prototype.segment,bt.prototype.setOptions=bt.prototype.o,bt.createFromModelPath=function(e,t){return R(bt,e,{baseOptions:{modelAssetPath:t}})},bt.createFromModelBuffer=function(e,t){return R(bt,e,{baseOptions:{modelAssetBuffer:t}})},bt.createFromOptions=function(e,t){return R(bt,e,t)};var it=class extends Re{constructor(e,t){super(new Je(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},S(e=this.h=new Vl,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?W(this.h,2,xi(e.displayNamesLocale)):"displayNamesLocale"in e&&W(this.h,2),e.maxResults!==void 0?pt(this.h,3,e.maxResults):"maxResults"in e&&W(this.h,3),e.scoreThreshold!==void 0?x(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&W(this.h,4),e.categoryAllowlist!==void 0?nr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&W(this.h,5),e.categoryDenylist!==void 0?nr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&W(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},Qe(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"input_frame_gpu"),Y(e,"norm_rect"),H(e,"detections");const t=new He;at(t,C0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),X(i,"IMAGE:input_frame_gpu"),X(i,"NORM_RECT:norm_rect"),$(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=pl(s),this.j.detections.push(Gl(n));y(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};it.prototype.detectForVideo=it.prototype.F,it.prototype.detect=it.prototype.D,it.prototype.setOptions=it.prototype.o,it.createFromModelPath=function(e,t){return L(this,null,function*(){return R(it,e,{baseOptions:{modelAssetPath:t}})})},it.createFromModelBuffer=function(e,t){return R(it,e,{baseOptions:{modelAssetBuffer:t}})},it.createFromOptions=function(e,t){return R(it,e,t)};var ea=class{constructor(e,t,i){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=i}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function D2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function R2(e){try{const t=new ea(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{kr(e)}}ea.prototype.close=ea.prototype.close;var Ze=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,S(e=this.h=new jl,0,1,t=new ee),this.v=new Dl,S(this.h,0,3,this.v),this.j=new Bl,S(this.h,0,2,this.j),pt(this.j,4,1),x(this.j,2,.5),x(this.v,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r,s;return"numPoses"in e&&pt(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&x(this.j,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minPosePresenceConfidence"in e&&x(this.v,2,(r=e.minPosePresenceConfidence)!=null?r:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=(s=e.outputSegmentationMasks)!=null?s:!1),this.l(e)}D(e,t,i){const n=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:i,D2(this),Qe(this,e,n),R2(this)}F(e,t,i,n){const r=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:n,D2(this),gt(this,e,r,t),R2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"normalized_landmarks"),H(e,"world_landmarks"),H(e,"segmentation_masks");const t=new He;at(t,E0,this.h);const i=new Me;Ue(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"NORM_LANDMARKS:normalized_landmarks"),$(i,"WORLD_LANDMARKS:world_landmarks"),i.o(t),Ve(e,i),xr(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,r)=>{this.landmarks=[];for(const s of n)n=bn(s),this.landmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],y(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,r)=>{this.worldLandmarks=[];for(const s of n)n=Oi(s),this.worldLandmarks.push(wn(n));y(this,r)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],y(this,n)}),this.outputSegmentationMasks&&($(i,"SEGMENTATION_MASK:segmentation_masks"),$i(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,r)=>{this.segmentationMasks=n.map(s=>Vi(this,s,!0,!this.s)),y(this,r)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],y(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ze.prototype.detectForVideo=Ze.prototype.F,Ze.prototype.detect=Ze.prototype.D,Ze.prototype.setOptions=Ze.prototype.o,Ze.createFromModelPath=function(e,t){return R(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return R(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return R(Ze,e,t)},Ze.POSE_CONNECTIONS=x2;const B0=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;let i=1,n=0,r=1,s=0;t.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),n=Math.max(n,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y))});const o=n-i,a=s-r;return Math.max(o,a)},D0=(e,t)=>{if(!e||e.length===0)return!1;const i=e[0];let n=1,r=0,s=1,o=0;i.forEach(re=>{n=Math.min(n,re.x),r=Math.max(r,re.x),s=Math.min(s,re.y),o=Math.max(o,re.y)});const a=.5,c=.6,l=t>1;let d,h;l?(d=.4,h=.3):(d=.35,h=.5);const u=(n+r)/2,p=(s+o)/2,f=.2,m=d*(1+f),v=h*(1+f),b=((re,Z)=>{const ue=(re-a)/m,pe=(Z-c)/v;return ue*ue+pe*pe<=1})(u,p),_=.2,E=.1,M=d*(1+_),w=h*(1+E),T=(re,Z)=>{const ue=(re-a)/M,pe=(Z-c)/w;return ue*ue+pe*pe<=1},I=T(n,s),O=T(r,s),be=T(n,o),ce=T(r,o);return b&&I&&O&&be&&ce},R0=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;const i=t[13],n=t[14];if(!i||!n)return 0;const r=Math.abs(n.y-i.y),s=Math.min(...t.map(c=>c.y)),a=Math.max(...t.map(c=>c.y))-s;return a>0?r/a:0},O0=e=>{const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return null;const n=e.videoWidth,r=e.videoHeight,s=Math.min(n,r),o=(n-s)/2,a=(r-s)/2;return t.width=s,t.height=s,i.drawImage(e,o,a,s,s,0,0,s,s),t},O2=(e,t,i,n)=>{const r=e.getContext("2d");if(!r)return;const s=e.width,o=e.height;r.clearRect(0,0,s,o);const a=new Ie(r);t.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;r.strokeStyle="rgba(255, 255, 255, 0.6)",r.lineWidth=d,r.lineCap="round",r.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,K.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=n&&a.drawConnectors(c,K.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},P2=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height)},P0=(e,t=!1)=>{const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const r=e.videoHeight>e.videoWidth;t?r?(i.width=480,i.height=Math.max(640,i.width*e.videoHeight/e.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*e.videoHeight/e.videoWidth)):r?(i.width=240,i.height=Math.max(320,i.width*e.videoHeight/e.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*e.videoHeight/e.videoWidth));const s=1,o=e.videoWidth*s,a=e.videoHeight*s,c=(o-e.videoWidth)/2,l=(a-e.videoHeight)/2;return n.drawImage(e,-c,-l-0,o,a,0,0,i.width,i.height),i.toDataURL("image/jpeg")},$2={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},N2={"multiple-faces":"Ensure only one face is visible","no-face":"Position your face in the oval","out-of-bounds":"Position your face in the oval","too-close":"Move farther away","too-far":"Move closer","neutral-expression":"Neutral expression","smile-required":"Smile!","open-mouth-smile":"Wider smile - teeth visible",initializing:"Initializing..."},$0=["sm-s936","sm-s931","sm-s938"],N0=()=>L(this,null,function*(){if(typeof navigator!="undefined"&&navigator.userAgentData)try{const{model:e}=yield navigator.userAgentData.getHighEntropyValues(["model"]);if(!e)return!1;const t=e.toLowerCase();return $0.some(i=>t.includes(i))}catch(e){return console.warn("UA-CH model fetch failed, falling back to UA string check.",e),!1}return!1}),H0=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const i=t.getExtension("OES_texture_half_float"),n=t.getExtension("OES_texture_half_float_linear"),r=t.getExtension("EXT_color_buffer_half_float");return!!(i&&r&&n)},H2=()=>L(this,null,function*(){window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const e=window.__smileIdentityMediapipe;return e.loaded&&e.instance?e.instance:(e.loading||(e.loading=L(this,null,function*(){try{const t=yield ai.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield N0(),n=yield K.createFromOptions(t,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:i||!H0()?"CPU":"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return e.instance=n,e.loaded=!0,e.loading=null,n}catch(t){throw e.loading=null,t}})),e.loading)}),kn=Xi.version,U0=({videoRef:e,canvasRef:t,interval:i,duration:n,smileThreshold:r,mouthOpenThreshold:s,minFaceSize:o,maxFaceSize:a,smileCooldown:c,getFacingMode:l})=>{const d=xe(null),h=xe(null),u=xe(null),p=xe(null),f=se(!1),m=se(!1),v=se("good"),g=se(!1),b=se(16/9),_=se([]),E=se(0),M=se(0),w=se(0),T=se(0),I=se(""),O=se(!0),be=se(!1),ce=se(!1),re=se(0),Z=se([]),ue=se(null),pe=se(1),Ae=se(0),z2=se(!1),Gi=is(()=>Math.floor(pe.value*.4)),Z2=is(()=>Math.floor(pe.value*.2)),cu=is(()=>f.value&&m.value&&v.value==="good"&&!g.value),ra=z=>{z&&N2[z]?I.value=N2[z]:I.value=""},qe=xe(T1(z=>{ra(z)},600)).current,lu=()=>L(this,null,function*(){var z,Ce;try{((z=window.__smileIdentityMediapipe)==null?void 0:z.loaded)&&((Ce=window.__smileIdentityMediapipe)==null?void 0:Ce.instance)||(O.value=!0,ra("initializing")),d.current=yield H2(),O.value=!1}catch(yt){console.error("Failed to initialize MediaPipe:",yt),O.value=!1}}),hu=()=>{if(e.current&&t.current){const{videoWidth:z,videoHeight:Ce}=e.current;b.value=z/Ce,t.current.width=z,t.current.height=Ce,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},du=()=>{const z=Ae.value<Z2.value,Ce=Ae.value>=Gi.value;z?I.value="Capturing...":Ce?Date.now()-T.value>c?E.value>=r&&w.value<s?qe("open-mouth-smile"):qe("smile-required"):I.value="Keep smiling!":qe(null)},uu=()=>{O.value?ra("initializing"):g.value?qe("multiple-faces"):f.value?v.value==="too-close"?qe("too-close"):v.value==="too-far"?qe("too-far"):m.value?be.value?du():I.value="Ready to capture":qe("out-of-bounds"):qe("no-face")},sa=()=>{h.current&&(cancelAnimationFrame(h.current),h.current=null)},oa=()=>L(this,null,function*(){var z,Ce;if(!d.current||!e.current){sa();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){h.current=requestAnimationFrame(oa);return}try{O.value&&(O.value=!1);const yt=O0(e.current),aa=yt||e.current,We=d.current.detectForVideo(aa,performance.now());if(_.value=We.faceLandmarks||[],We.faceLandmarks&&t.current&&e.current)if(yt){const Xt=e.current.videoWidth,ci=e.current.videoHeight,zi=Math.min(Xt,ci),ca=(Xt-zi)/(2*Xt),Rr=(ci-zi)/(2*ci),Or=zi/Xt,Zi=zi/ci,mu=We.faceLandmarks.map(gu=>gu.map(la=>({x:la.x*Or+ca,y:la.y*Zi+Rr,z:la.z})));O2(t.current,mu,Ae.value,Gi.value)}else O2(t.current,We.faceLandmarks,Ae.value,Gi.value);else t.current&&P2(t.current);const X2=We.faceLandmarks?We.faceLandmarks.length:0;g.value=X2>1;const Y2=We.faceBlendshapes&&We.faceBlendshapes.length>0&&X2===1;if(f.value=Y2,Y2&&We.faceLandmarks){const Xt=B0(We.faceLandmarks);M.value=Xt,Xt>a?v.value="too-close":Xt<o?v.value="too-far":v.value="good",m.value=D0(We.faceLandmarks,b.value);const ci=We.faceBlendshapes[0].categories,zi=((z=ci.find(Zi=>Zi.categoryName==="mouthSmileLeft"))==null?void 0:z.score)||0,ca=((Ce=ci.find(Zi=>Zi.categoryName==="mouthSmileRight"))==null?void 0:Ce.score)||0,Rr=R0(We.faceLandmarks),Or=(zi+ca)/2;E.value=Or,w.value=Rr,Or>=r&&Rr>=s&&(T.value=Date.now(),ce.value&&be.value&&p.current&&setTimeout(()=>{Date.now()-T.value<=100&&ce.value&&be.value&&p.current&&p.current()},0))}else E.value=0,M.value=0,w.value=0,m.value=!1,v.value="good";uu()}catch(yt){f.value=!1,m.value=!1,g.value=!1,v.value="good",w.value=0,be.value&&qe("no-face")}h.current=requestAnimationFrame(oa)}),pu=()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(oa)},fu=()=>{if(!e.current)return;const z=Ae.value===pe.value-1,Ce=P0(e.current,z);Ce&&(z?ue.value=Ce:Z.value=[...Z.value,Ce],Ae.value++,re.value=pe.value-Ae.value)},Dr=()=>{if(u.current&&(clearInterval(u.current),u.current=null),be.value=!1,ce.value=!1,Ae.value>=pe.value&&ue.value){const z=Z.value.map(aa=>({image:aa.split(",")[1],image_type_id:$2.LIVENESS_IMAGE_BASE64})),Ce={image:ue.value.split(",")[1],image_type_id:$2.SELFIE_IMAGE_BASE64},yt={images:[...z,Ce],referenceImage:ue.value,previewImage:ue.value,facingMode:l(),meta:{libraryVersion:kn}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:yt})),z2.value=!0}},An=()=>{u.current&&(clearInterval(u.current),u.current=null),ce.value=!0,!g.value&&f.value&&m.value&&v.value==="good"&&qe("smile-required")},q2=()=>{u.current&&clearInterval(u.current),u.current=setInterval(()=>{if(Ae.value>=pe.value){Dr();return}if(g.value){An();return}if(!f.value)return;if(!m.value){An();return}if(v.value!=="good"){An();return}if(Ae.value>=Gi.value&&Date.now()-T.value>c){An();return}fu()},i)},W2=()=>{if(f.value&&v.value==="good"&&m.value&&!g.value){if(Ae.value>=Gi.value&&Date.now()-T.value>c)return;ce.value=!1,qe(null),q2()}};return p.current=W2,{faceDetected:f,faceInBounds:m,faceProximity:v,multipleFaces:g,videoAspectRatio:b,faceLandmarks:_,currentSmileScore:E,currentFaceSize:M,currentMouthOpen:w,lastSmileTime:T,alertTitle:I,isInitializing:O,isReadyToCapture:cu,isCapturing:be,isPaused:ce,countdown:re,capturedImages:Z,referencePhoto:ue,totalCaptures:pe,capturesTaken:Ae,hasFinishedCapture:z2,smileCheckpoint:Gi,neutralZone:Z2,initializeFaceLandmarker:lu,setupCanvas:hu,startDetectionLoop:pu,stopDetectionLoop:sa,updateAlert:qe,startCapture:()=>L(this,null,function*(){Z.value=[],be.value=!0,ce.value=!1,pe.value=Math.ceil(n/i),Ae.value=0,re.value=pe.value;const z=document.querySelector("smart-camera-web");z==null||z.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),z==null||z.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[l()]}})),q2()}),stopCapture:Dr,pauseCapture:An,resumeCapture:W2,handleCancel:()=>{Dr(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:kn}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:kn}}}))},handleClose:()=>{Dr(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:kn}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:kn}}}))},cleanup:()=>{u.current&&clearInterval(u.current),sa(),qe.cancel()},resetFaceDetectionState:()=>{f.value=!1,m.value=!1,v.value="good",g.value=!1,_.value=[],E.value=0,M.value=0,w.value=0,T.value=0,t.current&&P2(t.current)}}},V0=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const n=xe(null),r=xe(e);return ot(()=>{const s=n.current;if(!s)return;const o=s.getTotalLength();s.style.opacity=e>0?"1":"0";const a=o*(1-r.current),c=o*(1-e);a!==c&&(s.style.transition="none",s.style.strokeDasharray=`${o} ${o}`,s.style.strokeDashoffset=`${a}`,s.getBoundingClientRect(),s.style.transition=`stroke-dashoffset ${t}ms ease-out`,s.style.strokeDashoffset=`${c}`,r.current=e)},[e,t]),D("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:D("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[D("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:D("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),D("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),D("path",{ref:n,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},j0=({videoRef:e,canvasRef:t,facingMode:i,multipleFaces:n,progress:r,interval:s,themeColor:o})=>D(Dt,{children:[D("div",{className:"camera-preview-container",children:[D("div",{className:"video-wrapper",style:{clipPath:n?"none":"url(#selfie-clip-path)"},children:D("div",{className:"video-container",children:[D("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),D("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!n&&D(V0,{progress:r,duration:s,themeColor:o})]}),D("style",{children:`
|
|
3143
|
+
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.j=ii(this,e),e.activeTexture(e.TEXTURE2),this.B=ii(this,e)}m(){super.m();const e=this.g;this.K=Be(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Be(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Be(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.K,1),e.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Ot(e,t){switch(t){case 0:return e.g.find(i=>i instanceof Uint8Array);case 1:return e.g.find(i=>i instanceof Float32Array);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Nc(e){var t=Ot(e,1);if(!t){if(t=Ot(e,0))t=new Float32Array(t).map(r=>r/255);else{t=new Float32Array(e.width*e.height);const r=Yi(e);var i=Hc(e);if(Zn(i,r,i0(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(e.width*e.height*4),r.readPixels(0,0,e.width,e.height,r.RGBA,r.FLOAT,i);for(let n=0,o=0;n<t.length;++n,o+=4)t[n]=i[o]}else r.readPixels(0,0,e.width,e.height,r.RED,r.FLOAT,t)}e.g.push(t)}return t}function i0(e){let t=Ot(e,2);if(!t){const i=Yi(e);t=n0(e);const r=Nc(e),n=r0(e);i.texImage2D(i.TEXTURE_2D,0,n,e.width,e.height,0,i.RED,i.FLOAT,r),Uc(e)}return t}function Yi(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function r0(e){if(e=Yi(e),!Wn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Wn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Wn=e.R16F}return Wn}function Hc(e){return e.l||(e.l=new Ki),e.l}function n0(e){const t=Yi(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Ot(e,2);return i||(i=ii(Hc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Uc(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Wn,Ce=class{constructor(e,t,i,r,n,o,s){this.g=e,this.m=t,this.j=i,this.canvas=r,this.l=n,this.width=o,this.height=s,this.j&&--o0===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Ot(this,0)}ja(){return!!Ot(this,1)}R(){return!!Ot(this,2)}ia(){return(t=Ot(e=this,0))||(t=Nc(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return Nc(this)}N(){return i0(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof Uint8Array)i=new Uint8Array(t);else if(t instanceof Float32Array)i=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const r=Yi(this),n=Hc(this);r.activeTexture(r.TEXTURE1),i=ii(n,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,i);const o=r0(this);r.texImage2D(r.TEXTURE_2D,0,o,this.width,this.height,0,r.RED,r.FLOAT,null),r.bindTexture(r.TEXTURE_2D,null),Zn(n,r,i),$r(n,r,!1,()=>{n0(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Uc(this)}),$c(n),Uc(this)}}e.push(i)}return new Ce(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Yi(this).deleteTexture(Ot(this,2)),o0=-1}};Ce.prototype.close=Ce.prototype.close,Ce.prototype.clone=Ce.prototype.clone,Ce.prototype.getAsWebGLTexture=Ce.prototype.N,Ce.prototype.getAsFloat32Array=Ce.prototype.ha,Ce.prototype.getAsUint8Array=Ce.prototype.ia,Ce.prototype.hasWebGLTexture=Ce.prototype.R,Ce.prototype.hasFloat32Array=Ce.prototype.ja,Ce.prototype.hasUint8Array=Ce.prototype.Da;var o0=250;const i5={color:"white",lineWidth:4,radius:6};function qc(e){return Re(nr(Re({},i5),{fillColor:(e=e||{}).color}),e)}function Pt(e,t){return e instanceof Function?e(t):e}function s0(e,t,i){return Math.max(Math.min(t,i),Math.min(Math.max(t,i),e))}function Nr(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Hr(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function a0(e,t,i){var r;if(t.R())i(t.N());else{const n=t.ja()?t.ha():t.ia();e.m=(r=e.m)!=null?r:new Ki;const o=Hr(e);i((e=new Ce([n],t.m,!1,o.canvas,e.m,t.width,t.height)).N()),e.close()}}function c0(e,t,i,r){const n=function(a){return a.g||(a.g=new e5),a.g}(e),o=Hr(e),s=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;$r(n,o,!0,()=>{(function(c,l,d,u){const h=c.g;if(h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,l),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,c.B),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,d),c.H&&function(f,p){if(f!==p)return!1;f=f.entries(),p=p.entries();for(const[v,g]of f){f=v;const b=g;var m=p.next();if(m.done)return!1;const[_,M]=m.value;if(m=M,f!==_||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!p.next().done}(c.H,u))h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.j);else{c.H=u;const f=Array(1024).fill(0);u.forEach((p,m)=>{if(p.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);f[4*m]=p[0],f[4*m+1]=p[1],f[4*m+2]=p[2],f[4*m+3]=p[3]}),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.j),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,256,1,0,h.RGBA,h.UNSIGNED_BYTE,new Uint8Array(f))}})(n,t,s,r),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4);const a=n.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function l0(e,t,i,r){const n=Hr(e),o=function(c){return c.h||(c.h=new t5),c.h}(e),s=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;$r(o,n,!0,()=>{var c=o.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,o.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,o.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),n.bindTexture(n.TEXTURE_2D,null),(c=o.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var De=class{constructor(e,t){typeof CanvasRenderingContext2D!="undefined"&&e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}wa(e,t){if(e){var i=Nr(this);t=qc(t),i.save();var r=i.canvas,n=0;for(const o of e)i.fillStyle=Pt(t.fillColor,{index:n,from:o}),i.strokeStyle=Pt(t.color,{index:n,from:o}),i.lineWidth=Pt(t.lineWidth,{index:n,from:o}),(e=new Path2D).arc(o.x*r.width,o.y*r.height,Pt(t.radius,{index:n,from:o}),0,2*Math.PI),i.fill(e),i.stroke(e),++n;i.restore()}}va(e,t,i){if(e&&t){var r=Nr(this);i=qc(i),r.save();var n=r.canvas,o=0;for(const s of t){r.beginPath(),t=e[s.start];const a=e[s.end];t&&a&&(r.strokeStyle=Pt(i.color,{index:o,from:t,to:a}),r.lineWidth=Pt(i.lineWidth,{index:o,from:t,to:a}),r.moveTo(t.x*n.width,t.y*n.height),r.lineTo(a.x*n.width,a.y*n.height)),++o,r.stroke()}r.restore()}}sa(e,t){const i=Nr(this);t=qc(t),i.save(),i.beginPath(),i.lineWidth=Pt(t.lineWidth,{}),i.strokeStyle=Pt(t.color,{}),i.fillStyle=Pt(t.fillColor,{}),i.moveTo(e.originX,e.originY),i.lineTo(e.originX+e.width,e.originY),i.lineTo(e.originX+e.width,e.originY+e.height),i.lineTo(e.originX,e.originY+e.height),i.lineTo(e.originX,e.originY),i.stroke(),i.fill(),i.restore()}ta(e,t,i=[0,0,0,255]){this.l?function(r,n,o,s){const a=Hr(r);a0(r,n,c=>{c0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):c0(this,e.N(),i,t)}ua(e,t,i){this.l?function(r,n,o,s){const a=Hr(r);a0(r,n,c=>{l0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):l0(this,e.N(),t,i)}close(){var e,t,i;(e=this.g)==null||e.close(),this.g=void 0,(t=this.h)==null||t.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function wt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof ImageData);case 1:return e.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function u0(e){var t=wt(e,0);if(!t){t=Ji(e);const i=Kn(e),r=new Uint8Array(e.width*e.height*4);Zn(i,t,Xn(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),$c(i),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function Xn(e){let t=wt(e,2);if(!t){const i=Ji(e);t=Yn(e);const r=wt(e,1)||u0(e);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),Ur(e)}return t}function Ji(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Kn(e){return e.l||(e.l=new Ki),e.l}function Yn(e){const t=Ji(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=wt(e,2);return i||(i=ii(Kn(e),t),e.g.push(i),e.m=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Ur(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function d0(e){const t=Ji(e);return $r(Kn(e),t,!0,()=>function(i,r){const n=i.canvas;if(n.width===i.width&&n.height===i.height)return r();const o=n.width,s=n.height;return n.width=i.width,n.height=i.height,i=r(),n.width=o,n.height=s,i}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}De.prototype.close=De.prototype.close,De.prototype.drawConfidenceMask=De.prototype.ua,De.prototype.drawCategoryMask=De.prototype.ta,De.prototype.drawBoundingBox=De.prototype.sa,De.prototype.drawConnectors=De.prototype.va,De.prototype.drawLandmarks=De.prototype.wa,De.lerp=function(e,t,i,r,n){return s0(r*(1-(e-t)/(i-t))+n*(1-(i-e)/(i-t)),r,n)},De.clamp=s0;var xe=class{constructor(e,t,i,r,n,o,s){this.g=e,this.j=t,this.m=i,this.canvas=r,this.l=n,this.width=o,this.height=s,(this.j||this.m)&&--h0===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!wt(this,0)}ka(){return!!wt(this,1)}R(){return!!wt(this,2)}Aa(){return u0(this)}za(){var e=wt(this,1);return e||(Xn(this),Yn(this),e=d0(this),Ur(this),this.g.push(e),this.j=!0),e}N(){return Xn(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof ImageData)i=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const r=Ji(this),n=Kn(this);r.activeTexture(r.TEXTURE1),i=ii(n,r),r.bindTexture(r.TEXTURE_2D,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,this.width,this.height,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindTexture(r.TEXTURE_2D,null),Zn(n,r,i),$r(n,r,!1,()=>{Yn(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Ur(this)}),$c(n),Ur(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Xn(this),Yn(this),i=d0(this),Ur(this)}e.push(i)}return new xe(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&wt(this,1).close(),this.m&&Ji(this).deleteTexture(wt(this,2)),h0=-1}};xe.prototype.close=xe.prototype.close,xe.prototype.clone=xe.prototype.clone,xe.prototype.getAsWebGLTexture=xe.prototype.N,xe.prototype.getAsImageBitmap=xe.prototype.za,xe.prototype.getAsImageData=xe.prototype.Aa,xe.prototype.hasWebGLTexture=xe.prototype.R,xe.prototype.hasImageBitmap=xe.prototype.ka,xe.prototype.hasImageData=xe.prototype.Ca;var h0=250;function mt(...e){return e.map(([t,i])=>({start:t,end:i}))}const r5=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((f0=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Wh()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}initializeGraph(e){return S(this,null,function*(){const t=yield(yield fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)})}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const i=e.length,r=this.i._malloc(i);this.i.HEAPU8.set(e,r),t?this.i._changeBinaryGraph(i,r):this.i._changeTextGraph(i,r),this.i._free(r)}configureAudio(e,t,i,r,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),T(this,r||"input_audio",o=>{T(this,n=n||"audio_header",s=>{this.i._configureAudio(o,s,e,t!=null?t:0,i)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){_t(this,"__graph_config__",t=>{e(t)}),T(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,i){this.addAudioToStreamWithShape(e,0,0,t,i)}addAudioToStreamWithShape(e,t,i,r,n){const o=4*e.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(e,this.g/4),T(this,r,s=>{this.i._addAudioToInputStream(this.g,t,i,s,n)})}addGpuBufferToStream(e,t,i){T(this,t,r=>{const[n,o]=Yh(this,e,r);this.i._addBoundTextureToStream(r,n,o,i)})}addBoolToStream(e,t,i){T(this,t,r=>{this.i._addBoolToInputStream(e,r,i)})}addDoubleToStream(e,t,i){T(this,t,r=>{this.i._addDoubleToInputStream(e,r,i)})}addFloatToStream(e,t,i){T(this,t,r=>{this.i._addFloatToInputStream(e,r,i)})}addIntToStream(e,t,i){T(this,t,r=>{this.i._addIntToInputStream(e,r,i)})}addUintToStream(e,t,i){T(this,t,r=>{this.i._addUintToInputStream(e,r,i)})}addStringToStream(e,t,i){T(this,t,r=>{T(this,e,n=>{this.i._addStringToInputStream(n,r,i)})})}addStringRecordToStream(e,t,i){T(this,t,r=>{Jh(this,Object.keys(e),n=>{Jh(this,Object.values(e),o=>{this.i._addFlatHashMapToInputStream(n,o,Object.keys(e).length,r,i)})})})}addProtoToStream(e,t,i,r){T(this,i,n=>{T(this,t,o=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,o,n,r),this.i._free(s)})})}addEmptyPacketToStream(e,t){T(this,e,i=>{this.i._addEmptyPacketToInputStream(i,t)})}addBoolVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const o of e)this.i._addBoolVectorEntry(n,o);this.i._addBoolVectorToInputStream(n,r,i)})}addDoubleVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const o of e)this.i._addDoubleVectorEntry(n,o);this.i._addDoubleVectorToInputStream(n,r,i)})}addFloatVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const o of e)this.i._addFloatVectorEntry(n,o);this.i._addFloatVectorToInputStream(n,r,i)})}addIntVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const o of e)this.i._addIntVectorEntry(n,o);this.i._addIntVectorToInputStream(n,r,i)})}addUintVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const o of e)this.i._addUintVectorEntry(n,o);this.i._addUintVectorToInputStream(n,r,i)})}addStringVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const o of e)T(this,o,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputStream(n,r,i)})}addBoolToInputSidePacket(e,t){T(this,t,i=>{this.i._addBoolToInputSidePacket(e,i)})}addDoubleToInputSidePacket(e,t){T(this,t,i=>{this.i._addDoubleToInputSidePacket(e,i)})}addFloatToInputSidePacket(e,t){T(this,t,i=>{this.i._addFloatToInputSidePacket(e,i)})}addIntToInputSidePacket(e,t){T(this,t,i=>{this.i._addIntToInputSidePacket(e,i)})}addUintToInputSidePacket(e,t){T(this,t,i=>{this.i._addUintToInputSidePacket(e,i)})}addStringToInputSidePacket(e,t){T(this,t,i=>{T(this,e,r=>{this.i._addStringToInputSidePacket(r,i)})})}addProtoToInputSidePacket(e,t,i){T(this,i,r=>{T(this,t,n=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputSidePacket(o,e.length,n,r),this.i._free(o)})})}addBoolVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const n of e)this.i._addBoolVectorEntry(r,n);this.i._addBoolVectorToInputSidePacket(r,i)})}addDoubleVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const n of e)this.i._addDoubleVectorEntry(r,n);this.i._addDoubleVectorToInputSidePacket(r,i)})}addFloatVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const n of e)this.i._addFloatVectorEntry(r,n);this.i._addFloatVectorToInputSidePacket(r,i)})}addIntVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const n of e)this.i._addIntVectorEntry(r,n);this.i._addIntVectorToInputSidePacket(r,i)})}addUintVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of e)this.i._addUintVectorEntry(r,n);this.i._addUintVectorToInputSidePacket(r,i)})}addStringVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const n of e)T(this,n,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputSidePacket(r,i)})}attachBoolListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(e,t,i){_t(this,e,t),T(this,e,r=>{this.i._attachProtoListener(r,i||!1)})}attachProtoVectorListener(e,t,i){ti(this,e,t),T(this,e,r=>{this.i._attachProtoVectorListener(r,i||!1)})}attachAudioListener(e,t,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),_t(this,e,(r,n)=>{r=new Float32Array(r.buffer,r.byteOffset,r.length/4),t(r,n)}),T(this,e,r=>{this.i._attachAudioListener(r,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends f0{get ea(){return this.i}oa(e,t,i){T(this,t,r=>{const[n,o]=Yh(this,e,r);this.ea._addBoundTextureAsImageToStream(r,n,o,i)})}V(e,t){_t(this,e,t),T(this,e,i=>{this.ea._attachImageListener(i)})}ba(e,t){ti(this,e,t),T(this,e,i=>{this.ea._attachImageVectorListener(i)})}}));var f0,it=class extends r5{};function U(e,t,i){return S(this,null,function*(){var r;return function(n,o,s,a){return S(this,null,function*(){return Jp(n,o,s,a)})}(e,(r=i.canvas)!=null?r:Wh()?void 0:document.createElement("canvas"),t,i)})}function p0(e,t,i,r){if(e.U){const o=new gh;if(i!=null&&i.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var n=i.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(n.left<0||n.top<0||n.right>1||n.bottom>1)throw Error("Expected RectF values to be in [0,1].");A(o,1,(n.left+n.right)/2),A(o,2,(n.top+n.bottom)/2),A(o,4,n.right-n.left),A(o,3,n.bottom-n.top)}else A(o,1,.5),A(o,2,.5),A(o,4,1),A(o,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(A(o,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[s,a]=Kh(t);i=fe(o,3)*a/s,n=fe(o,4)*s/a,A(o,4,i),A(o,3,n)}}e.g.addProtoToStream(o.g(),"mediapipe.NormalizedRect",e.U,r)}e.g.oa(t,e.Z,r!=null?r:performance.now()),e.finishProcessing()}function rt(e,t,i){var r;if((r=e.baseOptions)!=null&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");p0(e,t,i,e.B+1)}function Ct(e,t,i,r){var n;if(!((n=e.baseOptions)!=null&&n.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");p0(e,t,i,r)}function Qi(e,t,i,r){var n=t.data;const o=t.width,s=o*(t=t.height);if((n instanceof Uint8Array||n instanceof Float32Array)&&n.length!==s)throw Error("Unsupported channel count: "+n.length/s);return e=new Ce([n],i,!1,e.g.i.canvas,e.P,o,t),r?e.clone():e}var $e=class extends Oc{constructor(e,t,i,r){super(e),this.g=e,this.Z=t,this.U=i,this.na=r,this.P=new Ki}l(e,t=!0){if("runningMode"in e&&Ir(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};$e.prototype.close=$e.prototype.close;var nt=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},I(e=this.h=new qn,0,1,t=new oe),A(this.h,2,.5),A(this.h,3,.3)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return"minDetectionConfidence"in e&&A(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&A(this.h,3,(i=e.minSuppressionThreshold)!=null?i:.3),this.l(e)}D(e,t){return this.j={detections:[]},rt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect_in"),z(e,"detections");const t=new qe;ht(t,$p,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect_in"),q(i,"DETECTIONS:detections"),i.o(t),je(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=fh(o),this.j.detections.push(jh(r));w(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};nt.prototype.detectForVideo=nt.prototype.F,nt.prototype.detect=nt.prototype.D,nt.prototype.setOptions=nt.prototype.o,nt.createFromModelPath=function(e,t){return S(this,null,function*(){return U(nt,e,{baseOptions:{modelAssetPath:t}})})},nt.createFromModelBuffer=function(e,t){return U(nt,e,{baseOptions:{modelAssetBuffer:t}})},nt.createFromOptions=function(e,t){return U(nt,e,t)};var Vc=mt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),jc=mt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),zc=mt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),m0=mt([474,475],[475,476],[476,477],[477,474]),Gc=mt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Zc=mt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),g0=mt([469,470],[470,471],[471,472],[472,469]),Wc=mt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),v0=[...Vc,...jc,...zc,...Gc,...Zc,...Wc],b0=mt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function y0(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var re=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,I(e=this.h=new xh,0,1,t=new oe),this.v=new Eh,I(this.h,0,3,this.v),this.s=new qn,I(this.h,0,2,this.s),yt(this.s,4,1),A(this.s,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n;return"numFaces"in e&&yt(this.s,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&A(this.s,2,(i=e.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minFacePresenceConfidence"in e&&A(this.v,2,(n=e.minFacePresenceConfidence)!=null?n:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return y0(this),rt(this,e,t),this.j}F(e,t,i){return y0(this),Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"face_landmarks");const t=new qe;ht(t,Hp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"NORM_LANDMARKS:face_landmarks"),i.o(t),je(e,i),this.g.attachProtoVectorListener("face_landmarks",(r,n)=>{for(const o of r)r=Rr(o),this.j.faceLandmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{w(this,r)}),this.outputFaceBlendshapes&&(z(e,"blendshapes"),q(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(r,n)=>{var o;if(this.outputFaceBlendshapes)for(const s of r)r=Nn(s),this.j.faceBlendshapes.push(Dc((o=r.g())!=null?o:[]));w(this,n)}),this.g.attachEmptyPacketListener("blendshapes",r=>{w(this,r)})),this.outputFacialTransformationMatrixes&&(z(e,"face_geometry"),q(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(r,n)=>{var o,s,a,c,l;if(this.outputFacialTransformationMatrixes)for(const d of r)(r=V(Np(d),Mp,2))&&this.j.facialTransformationMatrixes.push({rows:(s=(o=et(r,1))!=null?o:0)!=null?s:0,columns:(c=(a=et(r,2))!=null?a:0)!=null?c:0,data:(l=mi(r,3,Wt,pi()).slice())!=null?l:[]});w(this,n)}),this.g.attachEmptyPacketListener("face_geometry",r=>{w(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};re.prototype.detectForVideo=re.prototype.F,re.prototype.detect=re.prototype.D,re.prototype.setOptions=re.prototype.o,re.createFromModelPath=function(e,t){return U(re,e,{baseOptions:{modelAssetPath:t}})},re.createFromModelBuffer=function(e,t){return U(re,e,{baseOptions:{modelAssetBuffer:t}})},re.createFromOptions=function(e,t){return U(re,e,t)},re.FACE_LANDMARKS_LIPS=Vc,re.FACE_LANDMARKS_LEFT_EYE=jc,re.FACE_LANDMARKS_LEFT_EYEBROW=zc,re.FACE_LANDMARKS_LEFT_IRIS=m0,re.FACE_LANDMARKS_RIGHT_EYE=Gc,re.FACE_LANDMARKS_RIGHT_EYEBROW=Zc,re.FACE_LANDMARKS_RIGHT_IRIS=g0,re.FACE_LANDMARKS_FACE_OVAL=Wc,re.FACE_LANDMARKS_CONTOURS=v0,re.FACE_LANDMARKS_TESSELATION=b0;var Et=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!0),I(e=this.j=new Ah,0,1,t=new oe)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,i){const r=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:i,rt(this,e,r!=null?r:{}),!this.h)return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"stylized_image");const t=new qe;ht(t,Up,this.j);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"STYLIZED_IMAGE:stylized_image"),i.o(t),je(e,i),this.g.V("stylized_image",(r,n)=>{var o=!this.h,s=r.data,a=r.width;const c=a*(r=r.height);if(s instanceof Uint8Array)if(s.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=s[3*d],l[4*d+1]=s[3*d+1],l[4*d+2]=s[3*d+2],l[4*d+3]=255;s=new ImageData(l,a,r)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,r)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new xe([s],!1,!1,this.g.i.canvas,this.P,a,r),this.s=o=o?a.clone():a,this.h&&this.h(o),w(this,n)}),this.g.attachEmptyPacketListener("stylized_image",r=>{this.s=null,this.h&&this.h(null),w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Et.prototype.stylize=Et.prototype.Ka,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(e,t){return U(Et,e,{baseOptions:{modelAssetPath:t}})},Et.createFromModelBuffer=function(e,t){return U(Et,e,{baseOptions:{modelAssetBuffer:t}})},Et.createFromOptions=function(e,t){return U(Et,e,t)};var Xc=mt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function _0(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function w0(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function C0(e,t=!0){var n,o,s,a,c,l;const i=[];for(const d of e){var r=Nn(d);e=[];for(const u of r.g())r=t&&et(u,1)!=null?(n=et(u,1))!=null?n:0:-1,e.push({score:(o=fe(u,2))!=null?o:0,index:r,categoryName:(a=(s=tt(u,3))!=null?s:"")!=null?a:"",displayName:(l=(c=tt(u,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var ze=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.j=new Th,0,1,t=new oe),this.s=new Lc,I(this.j,0,2,this.s),this.C=new Sc,I(this.s,0,3,this.C),this.v=new Lh,I(this.s,0,2,this.v),this.h=new qp,I(this.j,0,3,this.h),A(this.v,2,.5),A(this.s,4,.5),A(this.C,2,.5)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){var n,o,s,a,c,l,d,u;if(yt(this.v,3,(n=e.numHands)!=null?n:1),"minHandDetectionConfidence"in e&&A(this.v,2,(o=e.minHandDetectionConfidence)!=null?o:.5),"minTrackingConfidence"in e&&A(this.s,4,(s=e.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in e&&A(this.C,2,(a=e.minHandPresenceConfidence)!=null?a:.5),e.cannedGesturesClassifierOptions){var t=new Wi,i=t,r=Bc(e.cannedGesturesClassifierOptions,(c=V(this.h,Wi,3))==null?void 0:c.h());I(i,0,2,r),I(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=V(this.h,Wi,3))==null||l.g());return e.customGesturesClassifierOptions?(I(i=t=new Wi,0,2,r=Bc(e.customGesturesClassifierOptions,(d=V(this.h,Wi,4))==null?void 0:d.h())),I(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((u=V(this.h,Wi,4))==null||u.g()),this.l(e)}Fa(e,t){return _0(this),rt(this,e,t),w0(this)}Ga(e,t,i){return _0(this),Ct(this,e,i,t),w0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"hand_gestures"),z(e,"hand_landmarks"),z(e,"world_hand_landmarks"),z(e,"handedness");const t=new qe;ht(t,Vp,this.j);const i=new Fe;Ve(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"HAND_GESTURES:hand_gestures"),q(i,"LANDMARKS:hand_landmarks"),q(i,"WORLD_LANDMARKS:world_hand_landmarks"),q(i,"HANDEDNESS:handedness"),i.o(t),je(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Rr(l);const d=[];for(const u of Ft(r,mh,1))d.push({x:(o=fe(u,1))!=null?o:0,y:(s=fe(u,2))!=null?s:0,z:(a=fe(u,3))!=null?a:0,visibility:(c=fe(u,4))!=null?c:0});this.landmarks.push(d)}w(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Zi(l);const d=[];for(const u of Ft(r,ph,1))d.push({x:(o=fe(u,1))!=null?o:0,y:(s=fe(u,2))!=null?s:0,z:(a=fe(u,3))!=null?a:0,visibility:(c=fe(u,4))!=null?c:0});this.worldLandmarks.push(d)}w(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("hand_gestures",(r,n)=>{this.gestures.push(...C0(r,!1)),w(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",r=>{w(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{this.handedness.push(...C0(r)),w(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function E0(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}ze.prototype.recognizeForVideo=ze.prototype.Ga,ze.prototype.recognize=ze.prototype.Fa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return U(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return U(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return U(ze,e,t)},ze.HAND_CONNECTIONS=Xc;var Ge=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.h=new Lc,0,1,t=new oe),this.s=new Sc,I(this.h,0,3,this.s),this.j=new Lh,I(this.h,0,2,this.j),yt(this.j,3,1),A(this.j,2,.5),A(this.s,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n;return"numHands"in e&&yt(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&A(this.j,2,(i=e.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minHandPresenceConfidence"in e&&A(this.s,2,(n=e.minHandPresenceConfidence)!=null?n:.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],rt(this,e,t),E0(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ct(this,e,i,t),E0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"hand_landmarks"),z(e,"world_hand_landmarks"),z(e,"handedness");const t=new qe;ht(t,jp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"LANDMARKS:hand_landmarks"),q(i,"WORLD_LANDMARKS:world_hand_landmarks"),q(i,"HANDEDNESS:handedness"),i.o(t),je(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{for(const o of r)r=Rr(o),this.landmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{for(const o of r)r=Zi(o),this.worldLandmarks.push(Or(r));w(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{var c,l,d,u,h,f,p;var o=this.handedness,s=o.push;const a=[];for(const m of r){r=Nn(m);const v=[];for(const g of r.g())v.push({score:(c=fe(g,2))!=null?c:0,index:(d=(l=et(g,1))!=null?l:0)!=null?d:-1,categoryName:(h=(u=tt(g,3))!=null?u:"")!=null?h:"",displayName:(p=(f=tt(g,4))!=null?f:"")!=null?p:""});a.push(v)}s.call(o,...a),w(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ge.prototype.detectForVideo=Ge.prototype.F,Ge.prototype.detect=Ge.prototype.D,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return U(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return U(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return U(Ge,e,t)},Ge.HAND_CONNECTIONS=Xc;var x0=mt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function k0(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function A0(e){try{if(!e.C)return e.h;e.C(e.h)}finally{Gn(e)}}function Jn(e,t){e=Rr(e),t.push(Vn(e))}var se=class extends $e{constructor(e,t){super(new it(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,I(e=this.j=new Rh,0,1,t=new oe),this.K=new Sc,I(this.j,0,2,this.K),this.Y=new zp,I(this.j,0,3,this.Y),this.s=new qn,I(this.j,0,4,this.s),this.H=new Eh,I(this.j,0,5,this.H),this.v=new Bh,I(this.j,0,6,this.v),this.L=new Dh,I(this.j,0,7,this.L),A(this.s,2,.5),A(this.s,3,.3),A(this.H,2,.5),A(this.v,2,.5),A(this.v,3,.3),A(this.L,2,.5),A(this.K,2,.5)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){var t,i,r,n,o,s,a;return"minFaceDetectionConfidence"in e&&A(this.s,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&A(this.s,3,(i=e.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in e&&A(this.H,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&A(this.v,2,(n=e.minPoseDetectionConfidence)!=null?n:.5),"minPoseSuppressionThreshold"in e&&A(this.v,3,(o=e.minPoseSuppressionThreshold)!=null?o:.3),"minPosePresenceConfidence"in e&&A(this.L,2,(s=e.minPosePresenceConfidence)!=null?s:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&A(this.K,2,(a=e.minHandLandmarksConfidence)!=null?a:.5),this.l(e)}D(e,t,i){const r=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:i,k0(this),rt(this,e,r),A0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:r,k0(this),Ct(this,e,n,t),A0(this)}m(){var e=new Pe;ie(e,"input_frames_image"),z(e,"pose_landmarks"),z(e,"pose_world_landmarks"),z(e,"face_landmarks"),z(e,"left_hand_landmarks"),z(e,"left_hand_world_landmarks"),z(e,"right_hand_landmarks"),z(e,"right_hand_world_landmarks");const t=new qe,i=new Yd;Xa(i,1,Ri("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(n,o){if(o!=null)if(Array.isArray(o))Q(n,2,bn(o,za,void 0,void 0,!1));else{if(!(typeof o=="string"||o instanceof Tt||di(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Xa(n,2,Fa(o,!1),hi())}}(i,this.j.g());const r=new Fe;Ve(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),En(r,8,Yd,i),ee(r,"IMAGE:input_frames_image"),q(r,"POSE_LANDMARKS:pose_landmarks"),q(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),q(r,"FACE_LANDMARKS:face_landmarks"),q(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),q(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),q(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),q(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(t),je(e,r),zn(this,e),this.g.attachProtoListener("pose_landmarks",(n,o)=>{Jn(n,this.h.poseLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("pose_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("pose_world_landmarks",(n,o)=>{var s=this.h.poseWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{w(this,n)}),this.outputPoseSegmentationMasks&&(q(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Xi(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(n,o)=>{this.h.poseSegmentationMasks=[Qi(this,n,!0,!this.C)],w(this,o)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",n=>{this.h.poseSegmentationMasks=[],w(this,n)})),this.g.attachProtoListener("face_landmarks",(n,o)=>{Jn(n,this.h.faceLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{w(this,n)}),this.outputFaceBlendshapes&&(z(e,"extra_blendshapes"),q(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(n,o)=>{var a;var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(n=Nn(n),s.push(Dc((a=n.g())!=null?a:[]))),w(this,o)}),this.g.attachEmptyPacketListener("extra_blendshapes",n=>{w(this,n)})),this.g.attachProtoListener("left_hand_landmarks",(n,o)=>{Jn(n,this.h.leftHandLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("left_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("left_hand_world_landmarks",(n,o)=>{var s=this.h.leftHandWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("right_hand_landmarks",(n,o)=>{Jn(n,this.h.rightHandLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("right_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("right_hand_world_landmarks",(n,o)=>{var s=this.h.rightHandWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",n=>{w(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};se.prototype.detectForVideo=se.prototype.F,se.prototype.detect=se.prototype.D,se.prototype.setOptions=se.prototype.o,se.createFromModelPath=function(e,t){return U(se,e,{baseOptions:{modelAssetPath:t}})},se.createFromModelBuffer=function(e,t){return U(se,e,{baseOptions:{modelAssetBuffer:t}})},se.createFromOptions=function(e,t){return U(se,e,t)},se.HAND_CONNECTIONS=Xc,se.POSE_CONNECTIONS=x0,se.FACE_LANDMARKS_LIPS=Vc,se.FACE_LANDMARKS_LEFT_EYE=jc,se.FACE_LANDMARKS_LEFT_EYEBROW=zc,se.FACE_LANDMARKS_LEFT_IRIS=m0,se.FACE_LANDMARKS_RIGHT_EYE=Gc,se.FACE_LANDMARKS_RIGHT_EYEBROW=Zc,se.FACE_LANDMARKS_RIGHT_IRIS=g0,se.FACE_LANDMARKS_FACE_OVAL=Wc,se.FACE_LANDMARKS_CONTOURS=v0,se.FACE_LANDMARKS_TESSELATION=b0;var ot=class extends $e{constructor(e,t){super(new it(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},I(e=this.h=new Oh,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){return I(this.h,0,2,Bc(e,V(this.h,xc,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},rt(this,e,t),this.j}ra(e,t,i){return this.j={classifications:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"input_image"),ie(e,"norm_rect"),z(e,"classifications");const t=new qe;ht(t,Gp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),ee(i,"IMAGE:input_image"),ee(i,"NORM_RECT:norm_rect"),q(i,"CLASSIFICATIONS:classifications"),i.o(t),je(e,i),this.g.attachProtoListener("classifications",(r,n)=>{this.j=function(o){var a;const s={classifications:Ft(o,Fp,1).map(c=>{var l,d,u,h;return Dc((d=(l=V(c,dh,4))==null?void 0:l.g())!=null?d:[],(u=et(c,2))!=null?u:0,(h=tt(c,3))!=null?h:"")})};return Ha(Pi(o,2))!=null&&(s.timestampMs=(a=Ha(Pi(o,2)))!=null?a:0),s}(Bp(r)),w(this,n)}),this.g.attachEmptyPacketListener("classifications",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ot.prototype.classifyForVideo=ot.prototype.ra,ot.prototype.classify=ot.prototype.qa,ot.prototype.setOptions=ot.prototype.o,ot.createFromModelPath=function(e,t){return U(ot,e,{baseOptions:{modelAssetPath:t}})},ot.createFromModelBuffer=function(e,t){return U(ot,e,{baseOptions:{modelAssetBuffer:t}})},ot.createFromOptions=function(e,t){return U(ot,e,t)};var Ze=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!0),this.h=new Ph,this.embeddings={embeddings:[]},I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t=this.h,i=V(this.h,_h,2);return i=i?i.clone():new _h,e.l2Normalize!==void 0?Ir(i,1,e.l2Normalize):"l2Normalize"in e&&Q(i,1),e.quantize!==void 0?Ir(i,2,e.quantize):"quantize"in e&&Q(i,2),I(t,0,2,i),this.l(e)}xa(e,t){return rt(this,e,t),this.embeddings}ya(e,t,i){return Ct(this,e,i,t),this.embeddings}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"embeddings_out");const t=new qe;ht(t,Zp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"EMBEDDINGS:embeddings_out"),i.o(t),je(e,i),this.g.attachProtoListener("embeddings_out",(r,n)=>{r=Op(r),this.embeddings=function(o){var s;return{embeddings:Ft(o,Rp,1).map(a=>{var l,d,u,h,f,p,m;const c={headIndex:(d=(l=et(a,3))!=null?l:0)!=null?d:-1,headName:(h=(u=tt(a,4))!=null?u:"")!=null?h:""};if(_d(a,vh,Ka(a,1))!==void 0)a=mi(a=V(a,vh,Ka(a,1)),1,Wt,pi()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(p=(f=V(a,Dp,Ka(a,2)))==null?void 0:f.ma())==null?void 0:p.h())!=null?m:v}return c}),timestampMs:(s=Ha(Pi(o,2)))!=null?s:0}}(r),w(this,n)}),this.g.attachEmptyPacketListener("embeddings_out",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ze.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Gh(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Gh(zh(e.quantizedEmbedding),zh(t.quantizedEmbedding))}return e},Ze.prototype.embedForVideo=Ze.prototype.ya,Ze.prototype.embed=Ze.prototype.xa,Ze.prototype.setOptions=Ze.prototype.o,Ze.createFromModelPath=function(e,t){return U(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return U(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return U(Ze,e,t)};var Kc=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};function S0(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function L0(e){try{const t=new Kc(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gn(e)}}Kc.prototype.close=Kc.prototype.close;var Ne=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fc,this.v=new $h,I(this.h,0,3,this.v),I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return e.displayNamesLocale!==void 0?Q(this.h,2,Ri(e.displayNamesLocale)):"displayNamesLocale"in e&&Q(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}J(){(function(e){var i,r,n;const t=Ft(e.ca(),Fe,1).filter(o=>{var s;return((s=tt(o,1))!=null?s:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&((n=(r=(i=V(t[0],qe,7))==null?void 0:i.l())==null?void 0:r.g())!=null?n:new Map).forEach((o,s)=>{var a;e.s[Number(s)]=(a=tt(o,1))!=null?a:""})})(this)}segment(e,t,i){const r=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,S0(this),rt(this,e,r),L0(this)}Ia(e,t,i,r){const n=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:r,S0(this),Ct(this,e,n,t),L0(this)}Ba(){return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect");const t=new qe;ht(t,Uh,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),i.o(t),je(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),q(i,"CONFIDENCE_MASKS:confidence_masks"),Xi(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>Qi(this,o,!0,!this.j)),w(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],w(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),q(i,"CATEGORY_MASK:category_mask"),Xi(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=Qi(this,r,!1,!this.j),w(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,w(this,r)})),z(e,"quality_scores"),q(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,w(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.getLabels=Ne.prototype.Ba,Ne.prototype.segmentForVideo=Ne.prototype.Ia,Ne.prototype.segment=Ne.prototype.segment,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=function(e,t){return U(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return U(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return U(Ne,e,t)};var Yc=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};Yc.prototype.close=Yc.prototype.close;var n5=class extends k{constructor(e){super(e)}},er=[0,de,-2],Qn=[0,Rt,-3,ne,Rt,-1],T0=[0,Qn],M0=[0,Qn,de,-1],Jc=class extends k{constructor(e){super(e)}},I0=[0,Rt,-1,ne],o5=class extends k{constructor(e){super(e)}},F0=class extends k{constructor(e){super(e)}},Qc=[1,2,3,4,5,6,7,8,9,10,14,15],B0=class extends k{constructor(e){super(e)}};B0.prototype.g=$n([0,we,[0,Qc,X,Qn,X,[0,Qn,er],X,T0,X,[0,T0,er],X,I0,X,[0,Rt,-3,ne,Ue],X,[0,Rt,-3,ne],X,[0,W,Rt,-2,ne,de,ne,-1,2,Rt,er],X,M0,X,[0,M0,er],Rt,er,W,X,[0,Rt,-3,ne,er,-1],X,[0,we,I0]],W,[0,W,de,-1,ne]]);var xt=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fc,this.s=new $h,I(this.h,0,3,this.s),I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}segment(e,t,i,r){const n=typeof i!="function"?i:{};this.j=typeof i=="function"?i:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,r=new B0;const o=new F0;var s=new n5;if(yt(s,1,255),I(o,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Jc;Ir(a,3,!0),A(a,1,t.keypoint.x),A(a,2,t.keypoint.y),Mr(o,5,Qc,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new o5,t.scribble))Ir(t=new Jc,3,!0),A(t,1,a.x),A(t,2,a.y),En(s,1,Jc,t);Mr(o,15,Qc,s)}En(r,1,F0,o),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",i),rt(this,e,n);e:{try{const l=new Yc(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{Gn(this)}c=void 0}return c}m(){var e=new Pe;ie(e,"image_in"),ie(e,"roi_in"),ie(e,"norm_rect_in");const t=new qe;ht(t,Uh,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),ee(i,"IMAGE:image_in"),ee(i,"ROI:roi_in"),ee(i,"NORM_RECT:norm_rect_in"),i.o(t),je(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),q(i,"CONFIDENCE_MASKS:confidence_masks"),Xi(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>Qi(this,o,!0,!this.j)),w(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],w(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),q(i,"CATEGORY_MASK:category_mask"),Xi(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=Qi(this,r,!1,!this.j),w(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,w(this,r)})),z(e,"quality_scores"),q(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,w(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.segment=xt.prototype.segment,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=function(e,t){return U(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return U(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return U(xt,e,t)};var st=class extends $e{constructor(e,t){super(new it(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},I(e=this.h=new qh,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Q(this.h,2,Ri(e.displayNamesLocale)):"displayNamesLocale"in e&&Q(this.h,2),e.maxResults!==void 0?yt(this.h,3,e.maxResults):"maxResults"in e&&Q(this.h,3),e.scoreThreshold!==void 0?A(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Q(this.h,4),e.categoryAllowlist!==void 0?xn(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Q(this.h,5),e.categoryDenylist!==void 0?xn(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Q(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},rt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"input_frame_gpu"),ie(e,"norm_rect"),z(e,"detections");const t=new qe;ht(t,Xp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),ee(i,"IMAGE:input_frame_gpu"),ee(i,"NORM_RECT:norm_rect"),q(i,"DETECTIONS:detections"),i.o(t),je(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=fh(o),this.j.detections.push(jh(r));w(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};st.prototype.detectForVideo=st.prototype.F,st.prototype.detect=st.prototype.D,st.prototype.setOptions=st.prototype.o,st.createFromModelPath=function(e,t){return S(this,null,function*(){return U(st,e,{baseOptions:{modelAssetPath:t}})})},st.createFromModelBuffer=function(e,t){return U(st,e,{baseOptions:{modelAssetBuffer:t}})},st.createFromOptions=function(e,t){return U(st,e,t)};var el=class{constructor(e,t,i){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=i}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function D0(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function R0(e){try{const t=new el(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gn(e)}}el.prototype.close=el.prototype.close;var We=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,I(e=this.h=new Vh,0,1,t=new oe),this.v=new Dh,I(this.h,0,3,this.v),this.j=new Bh,I(this.h,0,2,this.j),yt(this.j,4,1),A(this.j,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n,o;return"numPoses"in e&&yt(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&A(this.j,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minPosePresenceConfidence"in e&&A(this.v,2,(n=e.minPosePresenceConfidence)!=null?n:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=(o=e.outputSegmentationMasks)!=null?o:!1),this.l(e)}D(e,t,i){const r=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:i,D0(this),rt(this,e,r),R0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:r,D0(this),Ct(this,e,n,t),R0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"normalized_landmarks"),z(e,"world_landmarks"),z(e,"segmentation_masks");const t=new qe;ht(t,Kp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"NORM_LANDMARKS:normalized_landmarks"),q(i,"WORLD_LANDMARKS:world_landmarks"),i.o(t),je(e,i),zn(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(r,n)=>{this.landmarks=[];for(const o of r)r=Rr(o),this.landmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("normalized_landmarks",r=>{this.landmarks=[],w(this,r)}),this.g.attachProtoVectorListener("world_landmarks",(r,n)=>{this.worldLandmarks=[];for(const o of r)r=Zi(o),this.worldLandmarks.push(Or(r));w(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",r=>{this.worldLandmarks=[],w(this,r)}),this.outputSegmentationMasks&&(q(i,"SEGMENTATION_MASK:segmentation_masks"),Xi(this,"segmentation_masks"),this.g.ba("segmentation_masks",(r,n)=>{this.segmentationMasks=r.map(o=>Qi(this,o,!0,!this.s)),w(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",r=>{this.segmentationMasks=[],w(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};We.prototype.detectForVideo=We.prototype.F,We.prototype.detect=We.prototype.D,We.prototype.setOptions=We.prototype.o,We.createFromModelPath=function(e,t){return U(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return U(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return U(We,e,t)},We.POSE_CONNECTIONS=x0;const s5=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;let i=1,r=0,n=1,o=0;t.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),o=Math.max(o,l.y))});const s=r-i,a=o-n;return Math.max(s,a)},a5=(e,t)=>{if(!e||e.length===0)return!1;const i=e[0];let r=1,n=0,o=1,s=0;i.forEach(j=>{r=Math.min(r,j.x),n=Math.max(n,j.x),o=Math.min(o,j.y),s=Math.max(s,j.y)});const a=.5,c=.6,l=t>1;let d,u;l?(d=.4,u=.3):(d=.35,u=.5);const h=(r+n)/2,f=(o+s)/2,p=.2,m=d*(1+p),v=u*(1+p),b=((j,O)=>{const ae=(j-a)/m,me=(O-c)/v;return ae*ae+me*me<=1})(h,f),_=.2,M=.1,P=d*(1+_),x=u*(1+M),D=(j,O)=>{const ae=(j-a)/P,me=(O-c)/x;return ae*ae+me*me<=1},C=D(r,o),R=D(n,o),F=D(r,s),E=D(n,s);return b&&C&&R&&F&&E},c5=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;const i=t[13],r=t[14];if(!i||!r)return 0;const n=Math.abs(r.y-i.y),o=Math.min(...t.map(c=>c.y)),a=Math.max(...t.map(c=>c.y))-o;return a>0?n/a:0},l5=e=>{const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return null;const r=e.videoWidth,n=e.videoHeight,o=Math.min(r,n),s=(r-o)/2,a=(n-o)/2;return t.width=o,t.height=o,i.drawImage(e,s,a,o,o,0,0,o,o),t},O0=(e,t,i,r)=>{const n=e.getContext("2d");if(!n)return;const o=e.width,s=e.height;n.clearRect(0,0,o,s);const a=new De(n);t.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;n.strokeStyle="rgba(255, 255, 255, 0.6)",n.lineWidth=d,n.lineCap="round",n.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,re.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=r&&a.drawConnectors(c,re.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},P0=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height)},u5=(e,t=!1)=>{const i=document.createElement("canvas"),r=i.getContext("2d");if(!r)return null;const n=e.videoHeight>e.videoWidth;t?n?(i.width=480,i.height=Math.max(640,i.width*e.videoHeight/e.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*e.videoHeight/e.videoWidth)):n?(i.width=240,i.height=Math.max(320,i.width*e.videoHeight/e.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*e.videoHeight/e.videoWidth));const o=1,s=e.videoWidth*o,a=e.videoHeight*o,c=(s-e.videoWidth)/2,l=(a-e.videoHeight)/2;return r.drawImage(e,-c,-l-0,s,a,0,0,i.width,i.height),i.toDataURL("image/jpeg",Ht)},$0={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},eo={"multiple-faces":()=>y("selfie.smart.alert.multipleFaces"),"no-face":()=>y("selfie.smart.alert.noFace"),"out-of-bounds":()=>y("selfie.smart.alert.outOfBounds"),"too-close":()=>y("selfie.smart.alert.tooClose"),"too-far":()=>y("selfie.smart.alert.tooFar"),"neutral-expression":()=>y("selfie.smart.alert.neutralExpression"),"smile-required":()=>y("selfie.smart.alert.smileRequired"),"open-mouth-smile":()=>y("selfie.smart.alert.openMouthSmile"),initializing:()=>y("selfie.smart.alert.initializing")},d5=["sm-s936","sm-s931","sm-s938"],h5=()=>S(this,null,function*(){if(typeof navigator!="undefined"&&navigator.userAgentData)try{const{model:e}=yield navigator.userAgentData.getHighEntropyValues(["model"]);if(!e)return!1;const t=e.toLowerCase();return d5.some(i=>t.includes(i))}catch(e){return console.warn("UA-CH model fetch failed, falling back to UA string check.",e),!1}return!1}),f5=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const i=t.getExtension("OES_texture_half_float"),r=t.getExtension("OES_texture_half_float_linear"),n=t.getExtension("EXT_color_buffer_half_float");return!!(i&&n&&r)},N0=()=>S(this,null,function*(){window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const e=window.__smileIdentityMediapipe;return e.loaded&&e.instance?e.instance:(e.loading||(e.loading=S(this,null,function*(){try{const t=yield bi.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield h5(),r=yield re.createFromOptions(t,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:i||!f5()?"CPU":"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return e.instance=r,e.loaded=!0,e.loading=null,r}catch(t){throw e.loading=null,t}})),e.loading)}),qr=fr.version,p5=({videoRef:e,canvasRef:t,interval:i,duration:r,smileThreshold:n,mouthOpenThreshold:o,minFaceSize:s,maxFaceSize:a,smileCooldown:c,getFacingMode:l})=>{const d=Ae(null),u=Ae(null),h=Ae(null),f=Ae(null),p=le(!1),m=le(!1),v=le("good"),g=le(!1),b=le(16/9),_=le([]),M=le(0),P=le(0),x=le(0),D=le(0),C=le(""),R=le(!0),F=le(!1),E=le(!1),j=le(0),O=le([]),ae=le(null),me=le(1),Le=le(0),j0=le(!1),tr=ha(()=>Math.floor(me.value*.4)),z0=ha(()=>Math.floor(me.value*.2)),P5=ha(()=>p.value&&m.value&&v.value==="good"&&!g.value),nl=K=>{var ge;K&&eo[K]?C.value=(ge=eo[K])==null?void 0:ge.call(eo):C.value=""},Xe=Ae(M2(K=>{nl(K)},600)).current,$5=()=>S(this,null,function*(){var K,ge;try{((K=window.__smileIdentityMediapipe)==null?void 0:K.loaded)&&((ge=window.__smileIdentityMediapipe)==null?void 0:ge.instance)||(R.value=!0,nl("initializing")),d.current=yield N0(),R.value=!1}catch(At){console.error("Failed to initialize MediaPipe:",At),R.value=!1}}),N5=()=>{if(e.current&&t.current){const{videoWidth:K,videoHeight:ge}=e.current;b.value=K/ge,t.current.width=K,t.current.height=ge,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},H5=()=>{const K=Le.value<z0.value,ge=Le.value>=tr.value;K?C.value=y("selfie.smart.status.capturing"):ge?Date.now()-D.value>c?M.value>=n&&x.value<o?Xe("open-mouth-smile"):Xe("smile-required"):C.value=y("selfie.smart.status.keepSmiling"):Xe(null)},U5=()=>{R.value?nl("initializing"):g.value?Xe("multiple-faces"):p.value?v.value==="too-close"?Xe("too-close"):v.value==="too-far"?Xe("too-far"):m.value?F.value?H5():C.value=y("selfie.smart.status.readyToCapture"):Xe("out-of-bounds"):Xe("no-face")},ol=()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)},sl=()=>S(this,null,function*(){var K,ge;if(!d.current||!e.current){ol();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){u.current=requestAnimationFrame(sl);return}try{R.value&&(R.value=!1);const At=l5(e.current),al=At||e.current,Ke=d.current.detectForVideo(al,performance.now());if(_.value=Ke.faceLandmarks||[],Ke.faceLandmarks&&t.current&&e.current)if(At){const ri=e.current.videoWidth,yi=e.current.videoHeight,ir=Math.min(ri,yi),cl=(ri-ir)/(2*ri),ro=(yi-ir)/(2*yi),no=ir/ri,rr=ir/yi,j5=Ke.faceLandmarks.map(z5=>z5.map(ll=>({x:ll.x*no+cl,y:ll.y*rr+ro,z:ll.z})));O0(t.current,j5,Le.value,tr.value)}else O0(t.current,Ke.faceLandmarks,Le.value,tr.value);else t.current&&P0(t.current);const W0=Ke.faceLandmarks?Ke.faceLandmarks.length:0;g.value=W0>1;const X0=Ke.faceBlendshapes&&Ke.faceBlendshapes.length>0&&W0===1;if(p.value=X0,X0&&Ke.faceLandmarks){const ri=s5(Ke.faceLandmarks);P.value=ri,ri>a?v.value="too-close":ri<s?v.value="too-far":v.value="good",m.value=a5(Ke.faceLandmarks,b.value);const yi=Ke.faceBlendshapes[0].categories,ir=((K=yi.find(rr=>rr.categoryName==="mouthSmileLeft"))==null?void 0:K.score)||0,cl=((ge=yi.find(rr=>rr.categoryName==="mouthSmileRight"))==null?void 0:ge.score)||0,ro=c5(Ke.faceLandmarks),no=(ir+cl)/2;M.value=no,x.value=ro,no>=n&&ro>=o&&(D.value=Date.now(),E.value&&F.value&&f.current&&setTimeout(()=>{Date.now()-D.value<=100&&E.value&&F.value&&f.current&&f.current()},0))}else M.value=0,P.value=0,x.value=0,m.value=!1,v.value="good";U5()}catch(At){p.value=!1,m.value=!1,g.value=!1,v.value="good",x.value=0,F.value&&Xe("no-face")}u.current=requestAnimationFrame(sl)}),q5=()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(sl)},V5=()=>{if(!e.current)return;const K=Le.value===me.value-1,ge=u5(e.current,K);ge&&(K?ae.value=ge:O.value=[...O.value,ge],Le.value++,j.value=me.value-Le.value)},io=()=>{if(h.current&&(clearInterval(h.current),h.current=null),F.value=!1,E.value=!1,Le.value>=me.value&&ae.value){const K=O.value.map(al=>({image:al.split(",")[1],image_type_id:$0.LIVENESS_IMAGE_BASE64})),ge={image:ae.value.split(",")[1],image_type_id:$0.SELFIE_IMAGE_BASE64},At={images:[...K,ge],referenceImage:ae.value,previewImage:ae.value,facingMode:l(),meta:{libraryVersion:qr}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:At})),j0.value=!0}},Vr=()=>{h.current&&(clearInterval(h.current),h.current=null),E.value=!0,!g.value&&p.value&&m.value&&v.value==="good"&&Xe("smile-required")},G0=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(Le.value>=me.value){io();return}if(g.value){Vr();return}if(!p.value)return;if(!m.value){Vr();return}if(v.value!=="good"){Vr();return}if(Le.value>=tr.value&&Date.now()-D.value>c){Vr();return}V5()},i)},Z0=()=>{if(p.value&&v.value==="good"&&m.value&&!g.value){if(Le.value>=tr.value&&Date.now()-D.value>c)return;E.value=!1,Xe(null),G0()}};return f.current=Z0,{faceDetected:p,faceInBounds:m,faceProximity:v,multipleFaces:g,videoAspectRatio:b,faceLandmarks:_,currentSmileScore:M,currentFaceSize:P,currentMouthOpen:x,lastSmileTime:D,alertTitle:C,isInitializing:R,isReadyToCapture:P5,isCapturing:F,isPaused:E,countdown:j,capturedImages:O,referencePhoto:ae,totalCaptures:me,capturesTaken:Le,hasFinishedCapture:j0,smileCheckpoint:tr,neutralZone:z0,initializeFaceLandmarker:$5,setupCanvas:N5,startDetectionLoop:q5,stopDetectionLoop:ol,updateAlert:Xe,startCapture:()=>S(this,null,function*(){O.value=[],F.value=!0,E.value=!1,me.value=Math.ceil(r/i),Le.value=0,j.value=me.value;const K=document.querySelector("smart-camera-web");K==null||K.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),K==null||K.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[l()]}})),G0()}),stopCapture:io,pauseCapture:Vr,resumeCapture:Z0,handleCancel:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:qr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:qr}}}))},handleClose:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:qr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:qr}}}))},cleanup:()=>{h.current&&clearInterval(h.current),ol(),Xe.cancel()},resetFaceDetectionState:()=>{p.value=!1,m.value=!1,v.value="good",g.value=!1,_.value=[],M.value=0,P.value=0,x.value=0,D.value=0,t.current&&P0(t.current)}}},m5=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const r=Ae(null),n=Ae(e);return Je(()=>{const o=r.current;if(!o)return;const s=o.getTotalLength();o.style.opacity=e>0?"1":"0";const a=s*(1-n.current),c=s*(1-e);a!==c&&(o.style.transition="none",o.style.strokeDasharray=`${s} ${s}`,o.style.strokeDashoffset=`${a}`,o.getBoundingClientRect(),o.style.transition=`stroke-dashoffset ${t}ms ease-out`,o.style.strokeDashoffset=`${c}`,n.current=e)},[e,t]),N("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:N("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[N("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:N("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),N("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),N("path",{ref:r,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},g5=({videoRef:e,canvasRef:t,facingMode:i,multipleFaces:r,progress:n,interval:o,themeColor:s})=>N(qt,{children:[N("div",{className:"camera-preview-container",children:[N("div",{className:"video-wrapper",style:{clipPath:r?"none":"url(#selfie-clip-path)"},children:N("div",{className:"video-container",children:[N("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),N("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!r&&N(m5,{progress:n,duration:o,themeColor:s})]}),N("style",{children:`
|
|
3160
3144
|
.camera-preview-container {
|
|
3161
3145
|
position: relative;
|
|
3162
3146
|
width: 100%;
|
|
@@ -3197,7 +3181,7 @@ ${this.hideAttribution?"":`
|
|
|
3197
3181
|
.camera-canvas {
|
|
3198
3182
|
pointer-events: none;
|
|
3199
3183
|
}
|
|
3200
|
-
`})]}),
|
|
3184
|
+
`})]}),v5=({alertTitle:e})=>e?N(qt,{children:[N("div",{className:"alert-message",children:N("div",{className:"alert-title",children:e})}),N("style",{children:`
|
|
3201
3185
|
.alert-message {
|
|
3202
3186
|
margin-top: 1.5rem;
|
|
3203
3187
|
color: #000;
|
|
@@ -3213,7 +3197,7 @@ ${this.hideAttribution?"":`
|
|
|
3213
3197
|
font-weight: bold;
|
|
3214
3198
|
text-align: center;
|
|
3215
3199
|
}
|
|
3216
|
-
`})]}):null,
|
|
3200
|
+
`})]}):null,b5=({isCapturing:e,hasFinishedCapture:t,isReadyToCapture:i,allowAgentMode:r,agentSupported:n,showAgentModeForTests:o,facingMode:s,themeColor:a="#001096",onStartCapture:c,onSwitchCamera:l})=>N(qt,{children:[N("div",{className:"controls",children:[N("button",{id:"start-image-capture",class:"btn-primary",onClick:c,disabled:e||t||!i,children:y("selfie.capture.button.startCapture")}),r&&(n||o)&&N("button",{id:"switch-camera",onClick:l,className:"agent-mode-btn",disabled:e||t,children:y(s==="user"?"selfie.capture.agentMode.off":"selfie.capture.agentMode.on")})]}),N("style",{children:`
|
|
3217
3201
|
.controls {
|
|
3218
3202
|
margin: 1.5rem 0;
|
|
3219
3203
|
display: flex;
|
|
@@ -3238,7 +3222,7 @@ ${this.hideAttribution?"":`
|
|
|
3238
3222
|
background: #ccc;
|
|
3239
3223
|
cursor: not-allowed;
|
|
3240
3224
|
}
|
|
3241
|
-
`})]}),
|
|
3225
|
+
`})]}),tl=({interval:e=350,duration:t=2800,"theme-color":i="#001096","show-navigation":r=!1,"allow-agent-mode":n=!1,"show-agent-mode-for-tests":o=!1,"hide-attribution":s=!1})=>{const a=Ae(null),c=Ae(null),l=ci(r),d=ci(n),u=ci(o),h=ci(s),f=300,p=.25,m=.05,v=.35,g=.5,b=d?"environment":"user",_=If(b),M=le(!1),P=Ae(M2(D=>{M.value=D},100)).current,x=p5({videoRef:_.videoRef,canvasRef:a,interval:e,duration:t,smileThreshold:p,mouthOpenThreshold:m,minFaceSize:v,maxFaceSize:g,smileCooldown:f,getFacingMode:()=>_.facingMode});return Je(()=>{const D=()=>S(this,null,function*(){yield _.startCamera(b,C=>{const R=document.querySelector("smart-camera-web");R==null||R.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:C}}))}),yield _.checkAgentSupport(),yield x.initializeFaceLandmarker(),setTimeout(()=>{x.setupCanvas(),x.startDetectionLoop()},500)});return _.registerCameraSwitchCallback(()=>{try{x.resetFaceDetectionState(),x.setupCanvas(),x.stopDetectionLoop(),x.startDetectionLoop()}catch(C){console.error("Error during camera switch callback:",C)}}),D(),()=>{x.stopDetectionLoop(),_.stopCamera(),x.cleanup(),P.cancel()}},[]),Je(()=>{P(x.multipleFaces.value)},[x.multipleFaces.value]),Je(()=>{const D=c.current;if(D&&l){const C=()=>{x.handleCancel()},R=()=>{x.handleClose()};return D.addEventListener("navigation.back",C),D.addEventListener("navigation.close",R),()=>{D.removeEventListener("navigation.back",C),D.removeEventListener("navigation.close",R)}}},[l]),Je(()=>{if(x.hasFinishedCapture.value){const D=document.querySelector("smart-camera-web");D==null||D.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[x.hasFinishedCapture.value]),N("div",{className:"smartselfie-capture",children:[l&&N("smileid-navigation",{ref:c,"theme-color":i}),N(g5,{videoRef:_.videoRef,canvasRef:a,facingMode:_.facingMode,multipleFaces:M.value,progress:x.capturesTaken.value>0?x.capturesTaken.value/x.totalCaptures.value:0,interval:e,themeColor:i}),N(v5,{alertTitle:x.alertTitle.value}),!x.isCapturing.value&&!x.hasFinishedCapture.value&&N(b5,{isCapturing:x.isCapturing.value,hasFinishedCapture:x.hasFinishedCapture.value,isReadyToCapture:x.isReadyToCapture.value,allowAgentMode:d,agentSupported:_.agentSupported,showAgentModeForTests:u,facingMode:_.facingMode,themeColor:i,onStartCapture:x.startCapture,onSwitchCamera:_.switchCamera}),!h&&N("powered-by-smile-id",{}),N("style",{children:`
|
|
3242
3226
|
* {
|
|
3243
3227
|
box-sizing: border-box;
|
|
3244
3228
|
}
|
|
@@ -3286,8 +3270,8 @@ ${this.hideAttribution?"":`
|
|
|
3286
3270
|
padding: 1rem;
|
|
3287
3271
|
font-family: sans-serif;
|
|
3288
3272
|
}
|
|
3289
|
-
`})]})};customElements.get("smartselfie-capture")||
|
|
3290
|
-
${
|
|
3273
|
+
`})]})};customElements.get("smartselfie-capture")||d2(tl,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const y5=fr.version,_5=8;function w5(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function C5(e,t=_5){const i=[];if(e<t)throw new Error(Nt("selfie.capture.error.minFrames",{count:t}));const r=t-1,n=Math.floor(e/r);let o=1;for(let a=0;a<e;a+=n)i.length<8?i.push(a):(i[o]=a,i.sort((c,l)=>c-l),o+=1);const s=e-1;return i.length<8&&!i.includes(s)&&i.push(s),i}function E5(){return`
|
|
3274
|
+
${dt(this.themeColor)}
|
|
3291
3275
|
<style>
|
|
3292
3276
|
:host {
|
|
3293
3277
|
--theme-color: ${this.themeColor||"#001096"};
|
|
@@ -3368,7 +3352,7 @@ ${this.hideAttribution?"":`
|
|
|
3368
3352
|
.title-color {
|
|
3369
3353
|
color: ${this.themeColor};
|
|
3370
3354
|
}
|
|
3371
|
-
|
|
3355
|
+
|
|
3372
3356
|
.theme-color {
|
|
3373
3357
|
color: ${this.themeColor};
|
|
3374
3358
|
}
|
|
@@ -3731,10 +3715,10 @@ ${this.hideAttribution?"":`
|
|
|
3731
3715
|
margin-inline-start; 1em;
|
|
3732
3716
|
}
|
|
3733
3717
|
</style>
|
|
3734
|
-
<div id='selfie-capture-screen' class='flow center'>
|
|
3718
|
+
<div id='selfie-capture-screen' class='flow center' dir='${this.direction}'>
|
|
3735
3719
|
<smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
|
|
3736
3720
|
|
|
3737
|
-
<div class='tips'
|
|
3721
|
+
<div class='tips'>${y("selfie.capture.tip.fitHead")}</div>
|
|
3738
3722
|
|
|
3739
3723
|
<div className="error">
|
|
3740
3724
|
${this.cameraError?`<p class="color-red">${this.cameraError}</p>`:""}
|
|
@@ -3766,33 +3750,33 @@ ${this.hideAttribution?"":`
|
|
|
3766
3750
|
</svg>
|
|
3767
3751
|
</div>
|
|
3768
3752
|
<div>
|
|
3769
|
-
<p id='smile-cta'
|
|
3753
|
+
<p id='smile-cta'>${y("selfie.capture.cta.smile")}</p>
|
|
3770
3754
|
</div>
|
|
3771
3755
|
</div>
|
|
3772
3756
|
</div>
|
|
3773
3757
|
|
|
3774
|
-
${this.allowAgentMode?`<button data-variant='outline small' id='switch-camera' class='button | center' type='button'>${this.inAgentMode?"
|
|
3758
|
+
${this.allowAgentMode?`<button data-variant='outline small' id='switch-camera' class='button | center' type='button'>${this.inAgentMode?y("selfie.capture.agentMode.on"):y("selfie.capture.agentMode.off")}</button>`:""}
|
|
3775
3759
|
|
|
3776
3760
|
<button data-variant='solid' id='start-image-capture' class='button | center' type='button'>
|
|
3777
|
-
|
|
3761
|
+
${y("selfie.capture.button.takeSelfie")}
|
|
3778
3762
|
</button>
|
|
3779
3763
|
|
|
3780
3764
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
3781
3765
|
</div>
|
|
3782
3766
|
</div>
|
|
3783
|
-
`}function U2(i){return L(this,arguments,function*(e,t={facingMode:"user"}){try{const n=yield F.getMedia({audio:!1,video:t}),s=(yield navigator.mediaDevices.enumerateDevices()).find(a=>a.kind==="videoinput"&&n.getVideoTracks()[0].getSettings().deviceId===a.deviceId),o=document.querySelector("smart-camera-web");o==null||o.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:s==null?void 0:s.label}})),e==null||e.removeAttribute("data-camera-error"),e==null||e.setAttribute("data-camera-ready",!0)}catch(n){e==null||e.removeAttribute("data-camera-ready"),e==null||e.setAttribute("data-camera-error",F.handleCameraError(n))}})}class K0 extends HTMLElement{constructor(){super(),this.templateString=Y0.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:Z0}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const t=document.querySelector("smart-camera-web");t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.inAgentMode?"environment":"user"]}}));const i=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${i} ${i}`,this.imageOutline.style.strokeDashoffset=i,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent="WIDER SMILE",this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return L(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,F.stopMedia(),yield U2(this,{facingMode:this.facingMode}),this.handleStream(F.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),F.stopMedia();const t=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=X0(t);this._data.images=this._data.images.concat(i.map(n=>({image:this._rawImages[n].split(",")[1],image_type_id:di.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(t){console.error(t)}}_capturePOLPhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=240,t.height=Math.max(320,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=240,t.width=Math.max(320,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!1),this._rawImages.push(t.toDataURL("image/jpeg"))}_captureReferencePhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=480,t.height=Math.max(640,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=480,t.width=Math.max(640,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!this.disableImageTests);const n=t.toDataURL("image/jpeg");this._referenceImage=n,this._data.images.push({image:n.split(",")[1],image_type_id:di.SELFIE_IMAGE_BASE64})}_publishImages(){const t=qi(Fe({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:t}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(t,i=!0,n=this._video){const r=t.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,t.width,t.height),i){const s=r.getImageData(0,0,t.width,t.height);if(W0(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleStream(t){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const n=this.shadowRoot.querySelector("video");let r=null;n?r=this.shadowRoot.querySelector("video"):r=document.createElement("video"),r.autoplay=!0,r.playsInline=!0,r.muted=!0,"srcObject"in r?r.srcObject=t:r.src=window.URL.createObjectURL(t),r.onloadedmetadata=()=>{r.play()},this._video=r,this._data.permissionGranted=!0,n||i.prepend(r)}catch(i){this.setAttribute("data-camera-error",F.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),F.stopMedia()}}setUpEventListeners(){var t;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(t=this.switchCamera)==null||t.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),F.stream?this.handleStream(F.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&U2(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){F.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return L(this,null,function*(){var i,n,r,s;if(!this.allowAgentMode)return;(yield F.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(n=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||n.remove("agent-mode"):(s=(r=this.shadowRoot.querySelector("video"))==null?void 0:r.classList)==null||s.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&F.stream&&this.handleStream(F.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),F.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",K0);const J0=r=>{var s=r,{timeout:e=2e4,"start-countdown":t=!1,hidden:i=!1}=s,n=ua(s,["timeout","start-countdown","hidden"]);const a=(()=>{try{return!!window.parent.Cypress||window.parent.navigator.userAgent.includes("Electron")&&window.parent.__Cypress}catch(E){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,c=fi(i),l=fi(t),[d,h]=Kt(!1),[u,p]=Kt(a?100:0),[f,m]=Kt(!1),[v,g]=Kt(!1),[b,_]=Kt(!1);if(ot(()=>{if(d||v||a)return;L(this,null,function*(){g(!0);try{yield H2(),h(!0)}catch(M){console.error("Failed to load Mediapipe:",M)}g(!1)})},[d,v]),ot(()=>{if(c||!l||d)return;const E=setInterval(()=>{p(M=>Math.min(M+1,100))},e/100);return()=>{clearInterval(E)}},[c,l,e,d]),ot(()=>{if(c||d||u<100)return;const M=setTimeout(()=>{const w=document.querySelector("selfie-capture");if(w&&!w.hasAttribute("data-backup-events-setup")){w.setAttribute("data-backup-events-setup","true");const T=I=>{const O=I;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return w.addEventListener("selfie-capture.publish",T),w.addEventListener("selfie-capture.cancelled",T),w.addEventListener("selfie-capture.close",T),()=>{w.removeEventListener("selfie-capture.publish",T),w.removeEventListener("selfie-capture.cancelled",T),w.removeEventListener("selfie-capture.close",T)}}},200);return()=>{clearTimeout(M)}},[c,d,u]),ot(()=>{if(c||v)return;const E=document.querySelector("smart-camera-web");E==null||E.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:b?"0.0.1":"1.0.0"}}))},[b,c,v]),c)return null;if(f&&d&&!b)return D(ta,Fe({},n));if(!f&&d&&!b)return D(ta,Fe({},n));if(u>=100){b||_(!0);const E=Fe({},n);return delete E.hidden,D("selfie-capture",qi(Fe({},E),{ref:M=>{if(M&&!M.hasAttribute("data-events-setup")){M.setAttribute("data-events-setup","true");const w=T=>{const I=T;(I.type==="selfie-capture.publish"||I.type==="selfie-capture.cancelled"||I.type==="selfie-capture.close")&&m(!0),window.dispatchEvent(new CustomEvent(I.type,{detail:I.detail,bubbles:!0}))};M.addEventListener("selfie-capture.publish",w),M.addEventListener("selfie-capture.cancelled",w),M.addEventListener("selfie-capture.close",w)}}}))}return D("div",{style:{textAlign:"center",marginTop:"20%"},children:[D("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:D(Bh,{size:48,style:{animation:"spin 1s linear infinite"}})}),D("p",{children:["Loading... ",u,"%"]}),D("style",{children:`
|
|
3767
|
+
`}function H0(i){return S(this,arguments,function*(e,t={facingMode:"user"}){try{const r=yield $.getMedia({audio:!1,video:t}),o=(yield navigator.mediaDevices.enumerateDevices()).find(a=>a.kind==="videoinput"&&r.getVideoTracks()[0].getSettings().deviceId===a.deviceId),s=document.querySelector("smart-camera-web");s==null||s.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:o==null?void 0:o.label}})),e==null||e.removeAttribute("data-camera-error"),e==null||e.setAttribute("data-camera-ready",!0)}catch(r){e==null||e.removeAttribute("data-camera-ready"),e==null||e.setAttribute("data-camera-error",$.handleCameraError(r))}})}class x5 extends HTMLElement{constructor(){super(),this.templateString=E5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:y5}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const t=document.querySelector("smart-camera-web");t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.inAgentMode?"environment":"user"]}}));const i=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${i} ${i}`,this.imageOutline.style.strokeDashoffset=i,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent=y("selfie.capture.cta.widerSmile"),this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return S(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,$.stopMedia(),yield H0(this,{facingMode:this.facingMode}),this.handleStream($.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),$.stopMedia();const t=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=C5(t);this._data.images=this._data.images.concat(i.map(r=>({image:this._rawImages[r].split(",")[1],image_type_id:Ei.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(t){console.error(t)}}_capturePOLPhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=240,t.height=Math.max(320,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=240,t.width=Math.max(320,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!1),this._rawImages.push(t.toDataURL("image/jpeg",Ht))}_captureReferencePhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=480,t.height=Math.max(640,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=480,t.width=Math.max(640,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!this.disableImageTests);const r=t.toDataURL("image/jpeg",Ht);this._referenceImage=r,this._data.images.push({image:r.split(",")[1],image_type_id:Ei.SELFIE_IMAGE_BASE64})}_publishImages(){const t=nr(Re({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:t}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(t,i=!0,r=this._video){const n=t.getContext("2d");if(n.drawImage(r,0,0,r.videoWidth,r.videoHeight,0,0,t.width,t.height),i){const o=n.getImageData(0,0,t.width,t.height);if(w5(o.data))return n;throw new Error(y("selfie.capture.error.webcamCapture"))}else return n}handleStream(t){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const r=this.shadowRoot.querySelector("video");let n=null;r?n=this.shadowRoot.querySelector("video"):n=document.createElement("video"),n.autoplay=!0,n.playsInline=!0,n.muted=!0,"srcObject"in n?n.srcObject=t:n.src=window.URL.createObjectURL(t),n.onloadedmetadata=()=>{n.play()},this._video=n,this._data.permissionGranted=!0,r||i.prepend(n)}catch(i){this.setAttribute("data-camera-error",$.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),$.stopMedia()}}setUpEventListeners(){var t,i,r;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(t=this.switchCamera)==null||t.addEventListener("click",()=>{this._switchCamera()}),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.closeWindow()}),$.stream?this.handleStream($.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&H0(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){$.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return S(this,null,function*(){var i,r,n,o;if(!this.allowAgentMode)return;(yield $.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(r=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||r.remove("agent-mode"):(o=(n=this.shadowRoot.querySelector("video"))==null?void 0:n.classList)==null||o.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||y("selfie.instructions.title")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&$.stream&&this.handleStream($.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),$.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",x5);const k5=90*1e3,A5=20*1e3,S5=o=>{var s=o,{timeout:e=k5,"start-countdown":t=!1,"allow-legacy-selfie-fallback":i=!1,hidden:r=!1}=s,n=hl(s,["timeout","start-countdown","allow-legacy-selfie-fallback","hidden"]);const c=(()=>{try{return!!window.parent.Cypress||window.parent.navigator.userAgent.includes("Electron")&&window.parent.__Cypress}catch(C){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,l=ci(r),d=ci(t),u=ci(i),h=u?A5:e,[f,p]=ai(!1),[m,v]=ai(c?100:0),[g,b]=ai(!1),[_,M]=ai(!1),[P,x]=ai(!1);if(Je(()=>{if(f||_||c)return;S(this,null,function*(){M(!0);try{yield N0(),p(!0)}catch(R){console.error("Failed to load Mediapipe:",R)}M(!1)})},[f,_]),Je(()=>{if(l||!d||f)return;const C=setInterval(()=>{v(R=>Math.min(R+1,100))},h/100);return()=>{clearInterval(C)}},[l,d,h,f]),Je(()=>{if(l||f||m<100)return;const R=setTimeout(()=>{const F=document.querySelector("selfie-capture");if(F&&!F.hasAttribute("data-backup-events-setup")){F.setAttribute("data-backup-events-setup","true");const E=j=>{const O=j;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return F.addEventListener("selfie-capture.publish",E),F.addEventListener("selfie-capture.cancelled",E),F.addEventListener("selfie-capture.close",E),()=>{F.removeEventListener("selfie-capture.publish",E),F.removeEventListener("selfie-capture.cancelled",E),F.removeEventListener("selfie-capture.close",E)}}},200);return()=>{clearTimeout(R)}},[l,f,m]),Je(()=>{if(l)return;const C=document.querySelector("smart-camera-web");C==null||C.dispatchEvent(new CustomEvent("metadata.allow-legacy-selfie-fallback",{detail:{allow_legacy_selfie_fallback:u}}))},[l,u]),Je(()=>{if(l||_)return;const C=document.querySelector("smart-camera-web");C==null||C.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:P?"0.0.1":"1.0.0"}}))},[P,l,_]),l)return null;if(g&&f&&!P)return N(tl,Re({},n));if(!g&&f&&!P)return N(tl,Re({},n));if(m>=100){if(u||c){P||x(!0);const R=Re({},n);return delete R.hidden,N("selfie-capture",nr(Re({},R),{ref:F=>{if(F&&!F.hasAttribute("data-events-setup")){F.setAttribute("data-events-setup","true");const E=j=>{const O=j;(O.type==="selfie-capture.publish"||O.type==="selfie-capture.cancelled"||O.type==="selfie-capture.close")&&b(!0),window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};F.addEventListener("selfie-capture.publish",E),F.addEventListener("selfie-capture.cancelled",E),F.addEventListener("selfie-capture.close",E)}}}))}return N("div",{style:{textAlign:"center",marginTop:"20%",padding:"0 20px"},children:N("p",{style:{fontSize:"1.2rem",color:"#333"},children:Xs("selfie.capture.loading.connectionError")})})}return N("div",{style:{textAlign:"center",marginTop:"20%"},children:[N("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:N(df,{size:48,style:{animation:"spin 1s linear infinite"}})}),m>=44?N("p",{children:Xs("selfie.capture.loading.slowConnection")}):N("p",{children:Cu("selfie.capture.loading.progress",{progress:m})}),N("style",{children:`
|
|
3784
3768
|
@keyframes spin {
|
|
3785
3769
|
from { transform: rotate(0deg); }
|
|
3786
3770
|
to { transform: rotate(360deg); }
|
|
3787
3771
|
}
|
|
3788
|
-
`})]})};customElements.get("selfie-capture-wrapper")||
|
|
3789
|
-
${
|
|
3772
|
+
`})]})};customElements.get("selfie-capture-wrapper")||d2(S5,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","allow-legacy-selfie-fallback","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const L5=fr.version,at=document.querySelector("smart-camera-web"),T5=(e,t=0,i=0)=>new Promise((r,n)=>{if(!e||typeof e!="string"){n(new Error("Invalid data URI provided"));return}if(t<0||t>=99||i<0||i>=99){n(new Error("Crop percentages must be between 0 and 99"));return}const o=new Image;o.onload=()=>{try{const s=document.createElement("canvas"),a=s.getContext("2d"),c=o.width,l=o.height,d=c*t/100,u=l*i/100,h=c-d*2,f=l-u*2;s.width=h,s.height=f,a.drawImage(o,d,u,h,f,0,0,h,f);const p=s.toDataURL("image/jpeg",Ht);r(p)}catch(s){n(new Error(`Failed to process image: ${s.message}`))}},o.onerror=()=>{n(new Error("Failed to load image from data URI"))},o.src=e});class U0 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,at==null||at.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
3773
|
+
${dt(this.themeColor)}
|
|
3790
3774
|
<div style="height: 100%;">
|
|
3791
3775
|
<selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
|
|
3792
|
-
<selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
|
|
3776
|
+
<selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} ${this.allowLegacySelfieFallback} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
|
|
3793
3777
|
<selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
|
|
3794
3778
|
</div>
|
|
3795
|
-
`,this._data={images:[],meta:{libraryVersion:Q0}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){F.stopMedia(),nt==null||nt.dispatchEvent(new CustomEvent("metadata.cleanup")),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:t,handler:i})=>{window.removeEventListener(t,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>L(this,null,function*(){this.setActiveScreen(this.selfieCapture)})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>L(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return L(this,null,function*(){F.stopMedia(),this._remountKey++;const t=this.querySelector("div"),i=this.selfieCapture;if(i&&t){const n=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(o=>{n.setAttribute(o.name,o.value)}),i.remove(),yield new Promise(o=>{setTimeout(o,50)}),n.setAttribute("key",this._remountKey.toString()),n.setAttribute("start-countdown","false"),n.setAttribute("hidden","");const s=t.querySelector("selfie-capture-review");s?t.insertBefore(n,s):t.appendChild(n),this.selfieCapture=n,this.setupSelfieWrapperEventListeners()}return new Promise(n=>{setTimeout(()=>{n()},200)})})}setActiveScreen(t){var i;this.activeScreen!==t&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t,t===this.selfieCapture?t.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.removeEventListener(r,s)});const t=()=>L(this,null,function*(){if(F.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>L(this,null,function*(){F.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),n=r=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield eu(r.detail.referenceImage,20,20));const s=r.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",s?"true":"false"),this._data.images=r.detail.images,F.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:t},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:n}],this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.addEventListener(r,s)}),this.addEventListener("selfie-capture.publish",n)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",V2);class Br{constructor(t,i,n,r){if(isNaN(t)||isNaN(i))throw new Error(`Point is invalid: (${t}, ${i})`);this.x=+t,this.y=+i,this.pressure=n||0,this.time=r||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class ia{static fromPoints(t,i){const n=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new ia(t[1],n,r,t[2],i.start,i.end)}static calculateControlPoints(t,i,n){const r=t.x-i.x,s=t.y-i.y,o=i.x-n.x,a=i.y-n.y,c={x:(t.x+i.x)/2,y:(t.y+i.y)/2},l={x:(i.x+n.x)/2,y:(i.y+n.y)/2},d=Math.sqrt(r*r+s*s),h=Math.sqrt(o*o+a*a),u=c.x-l.x,p=c.y-l.y,f=d+h==0?0:h/(d+h),m={x:l.x+u*f,y:l.y+p*f},v=i.x-m.x,g=i.y-m.y;return{c1:new Br(c.x+v,c.y+g),c2:new Br(l.x+v,l.y+g)}}constructor(t,i,n,r,s,o){this.startPoint=t,this.control2=i,this.control1=n,this.endPoint=r,this.startWidth=s,this.endWidth=o}length(){let i=0,n,r;for(let s=0;s<=10;s+=1){const o=s/10,a=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const l=a-n,d=c-r;i+=Math.sqrt(l*l+d*d)}n=a,r=c}return i}point(t,i,n,r,s){return i*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+s*t*t*t}}class tu{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,i,n){this._et.addEventListener(t,i,n)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,i,n){this._et.removeEventListener(t,i,n)}}function iu(e,t=250){let i=0,n=null,r,s,o;const a=()=>{i=Date.now(),n=null,r=e.apply(s,o),n||(s=null,o=[])};return function(...l){const d=Date.now(),h=t-(d-i);return s=this,o=l,h<=0||h>t?(n&&(clearTimeout(n),n=null),i=d,r=e.apply(s,o),n||(s=null,o=[])):n||(n=window.setTimeout(a,h)),r}}let nu=class pa extends tu{constructor(t,i={}){var n,r,s;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(n=i.throttle)!==null&&n!==void 0?n:16,this.minDistance=(r=i.minDistance)!==null&&r!==void 0?r:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(s=i.canvasContextOptions)!==null&&s!==void 0?s:{},this._strokeMoveUpdate=this.throttle?iu(pa.prototype._strokeUpdate,this.throttle):pa.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:i}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,i.width,i.height),t.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,i={}){return new Promise((n,r)=>{const s=new Image,o=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/o,c=i.height||this.canvas.height/o,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,l,d,a,c),n()},s.onerror=h=>{r(h)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1})}toDataURL(t="image/png",i){switch(t){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(t,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const i=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:i=!0}={}){i&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,i){return i?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const i=t.changedTouches[0];return{event:t,type:t.type,x:i.clientX,y:i.clientY,pressure:i.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,i=!1){return typeof this._strokePointerId=="undefined"?i:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:n}=this._getListenerFunctions();switch(t.event.type){case"mousedown":n("mousemove",this._handleMouseMove,{passive:!1}),n("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":n("touchmove",this._handleTouchMove,{passive:!1}),n("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":n("pointermove",this._handlePointerMove,{passive:!1}),n("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const r=this._getPointGroupOptions(),s=Object.assign(Object.assign({},r),{points:[]});this._data.push(s),this._reset(r),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const i=this._createPoint(t.x,t.y,t.pressure),n=this._data[this._data.length-1],r=n.points,s=r.length>0&&r[r.length-1],o=s?i.distanceTo(s)<=this.minDistance:!1,a=this._getPointGroupOptions(n);if(!s||!(s&&o)){const c=this._addPoint(i,a);s?c&&this._drawCurve(c,a):this._drawDot(i,a),r.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,i,n){const r=this.canvas.getBoundingClientRect();return new Br(t-r.left,i-r.top,n,new Date().getTime())}_addPoint(t,i){const{_lastPoints:n}=this;if(n.push(t),n.length>2){n.length===3&&n.unshift(n[0]);const r=this._calculateCurveWidths(n[1],n[2],i),s=ia.fromPoints(n,r);return n.shift(),s}return null}_calculateCurveWidths(t,i,n){const r=n.velocityFilterWeight*i.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(r,n),o={end:s,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=s,o}_strokeWidth(t,i){return Math.max(i.maxWidth/(t+1),i.minWidth)}_drawCurveSegment(t,i,n){const r=this._ctx;r.moveTo(t,i),r.arc(t,i,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,i){const n=this._ctx,r=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;n.beginPath(),n.fillStyle=i.penColor;for(let o=0;o<s;o+=1){const a=o/s,c=a*a,l=c*a,d=1-a,h=d*d,u=h*d;let p=u*t.startPoint.x;p+=3*h*a*t.control1.x,p+=3*d*c*t.control2.x,p+=l*t.endPoint.x;let f=u*t.startPoint.y;f+=3*h*a*t.control1.y,f+=3*d*c*t.control2.y,f+=l*t.endPoint.y;const m=Math.min(t.startWidth+l*r,i.maxWidth);this._drawCurveSegment(p,f,m)}n.closePath(),n.fill()}_drawDot(t,i){const n=this._ctx,r=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=i.penColor,n.fill()}_fromData(t,i,n){for(const r of t){const{points:s}=r,o=this._getPointGroupOptions(r);if(s.length>1)for(let a=0;a<s.length;a+=1){const c=s[a],l=new Br(c.x,c.y,c.pressure,c.time);a===0&&this._reset(o);const d=this._addPoint(l,o);d&&i(d,o)}else this._reset(o),n(s[0],o)}}toSVG({includeBackgroundColor:t=!1}={}){const i=this._data,n=Math.max(window.devicePixelRatio||1,1),r=0,s=0,o=this.canvas.width/n,a=this.canvas.height/n,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${r} ${s} ${o} ${a}`),c.setAttribute("width",o.toString()),c.setAttribute("height",a.toString()),t&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const h=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const u=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;h.setAttribute("d",u),h.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),h.setAttribute("stroke",d),h.setAttribute("fill","none"),h.setAttribute("stroke-linecap","round"),c.appendChild(h)}},(l,{penColor:d,dotSize:h,minWidth:u,maxWidth:p})=>{const f=document.createElement("circle"),m=h>0?h:(u+p)/2;f.setAttribute("r",m.toString()),f.setAttribute("cx",l.x.toString()),f.setAttribute("cy",l.y.toString()),f.setAttribute("fill",d),c.appendChild(f)}),c.outerHTML}};const Ft=class Ft{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),r=t/da(1024,n);return n===0?`${t} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(t){return new Promise((i,n)=>{const r=new FileReader;r.onload=s=>{i(s.target.result)},r.onerror=()=>{n(new Error("An error occurred reading the file. Please check the file, and try again"))},r.readAsDataURL(t)})}static retrieve(t){return L(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!Ft.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>Ft.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ft.getHumanSize(Ft.memoryLimit)}.`);return yield Ft.getData(i)})}};li(Ft,"memoryLimit",2048e3),li(Ft,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let na=Ft;class j2 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
3779
|
+
`,this._data={images:[],meta:{libraryVersion:L5}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){$.stopMedia(),at==null||at.dispatchEvent(new CustomEvent("metadata.cleanup")),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:t,handler:i})=>{window.removeEventListener(t,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>S(this,null,function*(){this.setActiveScreen(this.selfieCapture)})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>S(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>S(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return S(this,null,function*(){$.stopMedia(),this._remountKey++;const t=this.querySelector("div"),i=this.selfieCapture;if(i&&t){const r=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(s=>{r.setAttribute(s.name,s.value)}),i.remove(),yield new Promise(s=>{setTimeout(s,50)}),r.setAttribute("key",this._remountKey.toString()),r.setAttribute("start-countdown","false"),r.setAttribute("hidden","");const o=t.querySelector("selfie-capture-review");o?t.insertBefore(r,o):t.appendChild(r),this.selfieCapture=r,this.setupSelfieWrapperEventListeners()}return new Promise(r=>{setTimeout(()=>{r()},200)})})}setActiveScreen(t){var i;this.activeScreen!==t&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t,t===this.selfieCapture?t.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:n,handler:o})=>{window.removeEventListener(n,o)});const t=()=>S(this,null,function*(){if($.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>S(this,null,function*(){$.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),r=n=>S(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield T5(n.detail.referenceImage,20,20));const o=n.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",o?"true":"false"),this._data.images=n.detail.images,$.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:t},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:r}],this._selfieWrapperListeners.forEach(({event:n,handler:o})=>{window.addEventListener(n,o)}),this.addEventListener("selfie-capture.publish",r)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get allowLegacySelfieFallback(){return this.hasAttribute("allow-legacy-selfie-fallback")?`allow-legacy-selfie-fallback='${this.getAttribute("allow-legacy-selfie-fallback")}'`:""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","allow-legacy-selfie-fallback","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"allow-legacy-selfie-fallback":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",U0);class to{constructor(t,i,r,n){if(isNaN(t)||isNaN(i))throw new Error(`Point is invalid: (${t}, ${i})`);this.x=+t,this.y=+i,this.pressure=r||0,this.time=n||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class il{static fromPoints(t,i){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,n=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new il(t[1],r,n,t[2],i.start,i.end)}static calculateControlPoints(t,i,r){const n=t.x-i.x,o=t.y-i.y,s=i.x-r.x,a=i.y-r.y,c={x:(t.x+i.x)/2,y:(t.y+i.y)/2},l={x:(i.x+r.x)/2,y:(i.y+r.y)/2},d=Math.sqrt(n*n+o*o),u=Math.sqrt(s*s+a*a),h=c.x-l.x,f=c.y-l.y,p=d+u==0?0:u/(d+u),m={x:l.x+h*p,y:l.y+f*p},v=i.x-m.x,g=i.y-m.y;return{c1:new to(c.x+v,c.y+g),c2:new to(l.x+v,l.y+g)}}constructor(t,i,r,n,o,s){this.startPoint=t,this.control2=i,this.control1=r,this.endPoint=n,this.startWidth=o,this.endWidth=s}length(){let i=0,r,n;for(let o=0;o<=10;o+=1){const s=o/10,a=this.point(s,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(s,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){const l=a-r,d=c-n;i+=Math.sqrt(l*l+d*d)}r=a,n=c}return i}point(t,i,r,n,o){return i*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*n*(1-t)*t*t+o*t*t*t}}class M5{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,i,r){this._et.addEventListener(t,i,r)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,i,r){this._et.removeEventListener(t,i,r)}}function I5(e,t=250){let i=0,r=null,n,o,s;const a=()=>{i=Date.now(),r=null,n=e.apply(o,s),r||(o=null,s=[])};return function(...l){const d=Date.now(),u=t-(d-i);return o=this,s=l,u<=0||u>t?(r&&(clearTimeout(r),r=null),i=d,n=e.apply(o,s),r||(o=null,s=[])):r||(r=window.setTimeout(a,u)),n}}let F5=class fl extends M5{constructor(t,i={}){var r,n,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(r=i.throttle)!==null&&r!==void 0?r:16,this.minDistance=(n=i.minDistance)!==null&&n!==void 0?n:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(o=i.canvasContextOptions)!==null&&o!==void 0?o:{},this._strokeMoveUpdate=this.throttle?I5(fl.prototype._strokeUpdate,this.throttle):fl.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:i}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,i.width,i.height),t.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,i={}){return new Promise((r,n)=>{const o=new Image,s=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/s,c=i.height||this.canvas.height/s,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,l,d,a,c),r()},o.onerror=u=>{n(u)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}toDataURL(t="image/png",i){switch(t){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(t,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const i=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:i=!0}={}){i&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,i){return i?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const i=t.changedTouches[0];return{event:t,type:t.type,x:i.clientX,y:i.clientY,pressure:i.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,i=!1){return typeof this._strokePointerId=="undefined"?i:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const n=this._getPointGroupOptions(),o=Object.assign(Object.assign({},n),{points:[]});this._data.push(o),this._reset(n),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const i=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],n=r.points,o=n.length>0&&n[n.length-1],s=o?i.distanceTo(o)<=this.minDistance:!1,a=this._getPointGroupOptions(r);if(!o||!(o&&s)){const c=this._addPoint(i,a);o?c&&this._drawCurve(c,a):this._drawDot(i,a),n.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,i,r){const n=this.canvas.getBoundingClientRect();return new to(t-n.left,i-n.top,r,new Date().getTime())}_addPoint(t,i){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const n=this._calculateCurveWidths(r[1],r[2],i),o=il.fromPoints(r,n);return r.shift(),o}return null}_calculateCurveWidths(t,i,r){const n=r.velocityFilterWeight*i.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(n,r),s={end:o,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=o,s}_strokeWidth(t,i){return Math.max(i.maxWidth/(t+1),i.minWidth)}_drawCurveSegment(t,i,r){const n=this._ctx;n.moveTo(t,i),n.arc(t,i,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,i){const r=this._ctx,n=t.endWidth-t.startWidth,o=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=i.penColor;for(let s=0;s<o;s+=1){const a=s/o,c=a*a,l=c*a,d=1-a,u=d*d,h=u*d;let f=h*t.startPoint.x;f+=3*u*a*t.control1.x,f+=3*d*c*t.control2.x,f+=l*t.endPoint.x;let p=h*t.startPoint.y;p+=3*u*a*t.control1.y,p+=3*d*c*t.control2.y,p+=l*t.endPoint.y;const m=Math.min(t.startWidth+l*n,i.maxWidth);this._drawCurveSegment(f,p,m)}r.closePath(),r.fill()}_drawDot(t,i){const r=this._ctx,n=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,n),r.closePath(),r.fillStyle=i.penColor,r.fill()}_fromData(t,i,r){for(const n of t){const{points:o}=n,s=this._getPointGroupOptions(n);if(o.length>1)for(let a=0;a<o.length;a+=1){const c=o[a],l=new to(c.x,c.y,c.pressure,c.time);a===0&&this._reset(s);const d=this._addPoint(l,s);d&&i(d,s)}else this._reset(s),r(o[0],s)}}toSVG({includeBackgroundColor:t=!1}={}){const i=this._data,r=Math.max(window.devicePixelRatio||1,1),n=0,o=0,s=this.canvas.width/r,a=this.canvas.height/r,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${n} ${o} ${s} ${a}`),c.setAttribute("width",s.toString()),c.setAttribute("height",a.toString()),t&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const u=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const h=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;u.setAttribute("d",h),u.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),u.setAttribute("stroke",d),u.setAttribute("fill","none"),u.setAttribute("stroke-linecap","round"),c.appendChild(u)}},(l,{penColor:d,dotSize:u,minWidth:h,maxWidth:f})=>{const p=document.createElement("circle"),m=u>0?u:(h+f)/2;p.setAttribute("r",m.toString()),p.setAttribute("cx",l.x.toString()),p.setAttribute("cy",l.y.toString()),p.setAttribute("fill",d),c.appendChild(p)}),c.outerHTML}};const $t=class $t{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),n=t/dl(1024,r);return r===0?`${t} bytes`:`${n.toFixed(0)} ${i[r]}`}static getData(t){return new Promise((i,r)=>{const n=new FileReader;n.onload=o=>{i(o.target.result)},n.onerror=()=>{r(new Error("An error occurred reading the file. Please check the file, and try again"))},n.readAsDataURL(t)})}static retrieve(t){return S(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!$t.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>$t.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${$t.getHumanSize($t.memoryLimit)}.`);return yield $t.getData(i)})}};_i($t,"memoryLimit",2048e3),_i($t,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let rl=$t;class q0 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
3796
3780
|
:host {
|
|
3797
3781
|
display: block;
|
|
3798
3782
|
block-size: auto;
|
|
@@ -3923,9 +3907,9 @@ button:active {
|
|
|
3923
3907
|
button:disabled {
|
|
3924
3908
|
--button-color: var(--color-disabled);
|
|
3925
3909
|
}
|
|
3926
|
-
`;const
|
|
3910
|
+
`;const r=document.createElement("div"),n=document.createElement("div");n.innerHTML=`
|
|
3927
3911
|
<p id="error" class="color-red | center"><p>
|
|
3928
|
-
`;const
|
|
3912
|
+
`;const o=document.createElement("div");o.setAttribute("id","controls"),o.setAttribute("part","signature-controls"),o.innerHTML=`
|
|
3929
3913
|
<button data-variant="icon" type="button" name="clear" id="clear">
|
|
3930
3914
|
<span class="visually-hidden">
|
|
3931
3915
|
Clear Signature
|
|
@@ -3934,7 +3918,7 @@ button:disabled {
|
|
|
3934
3918
|
<path d="M3.314 15.646a8.004 8.004 0 01-2.217-4.257 8.06 8.06 0 01.545-4.655l1.789.788a6.062 6.062 0 001.264 6.737 6.033 6.033 0 008.551 0c2.358-2.37 2.358-6.224 0-8.592a5.996 5.996 0 00-4.405-1.782l.662 2.354-3.128-.796-3.127-.796 2.25-2.324L7.748 0l.55 1.953a7.966 7.966 0 016.33 2.326 8.004 8.004 0 012.342 5.684 8.005 8.005 0 01-2.343 5.683A7.928 7.928 0 018.97 18a7.928 7.928 0 01-5.656-2.354z" fill="currentColor" />
|
|
3935
3919
|
</svg>
|
|
3936
3920
|
</button>
|
|
3937
|
-
`;const
|
|
3921
|
+
`;const s=document.createElement("canvas"),l=this.parentElement.closest(":not([hidden])").querySelector(":not([hidden])").offsetWidth,u=30*getComputedStyle(document.documentElement).fontSize.split("px")[0],h=2;s.width=l<u?l:u,s.height=(l<u?l:u)/h,s.setAttribute("id","signature-canvas"),s.setAttribute("part","canvas");const f=document.createElement("div");f.setAttribute("id","signature-upload-wrapper"),f.innerHTML=`
|
|
3938
3922
|
<p part="upload">
|
|
3939
3923
|
<strong>or</strong>
|
|
3940
3924
|
<label>
|
|
@@ -3952,7 +3936,7 @@ button:disabled {
|
|
|
3952
3936
|
<span>upload a signature</span>
|
|
3953
3937
|
</label>
|
|
3954
3938
|
</p>
|
|
3955
|
-
`;const
|
|
3939
|
+
`;const p=document.createElement("p");p.innerHTML=`
|
|
3956
3940
|
<button data-variant="solid" type="button" name="publish" id="publish">
|
|
3957
3941
|
<span>
|
|
3958
3942
|
Continue
|
|
@@ -3973,8 +3957,8 @@ button:disabled {
|
|
|
3973
3957
|
/>
|
|
3974
3958
|
</svg>
|
|
3975
3959
|
</button>
|
|
3976
|
-
`,
|
|
3977
|
-
${
|
|
3960
|
+
`,r.appendChild(n),r.appendChild(o),r.appendChild(s),this.allowUpload&&r.appendChild(f),r.appendChild(p),t.appendChild(i),t.appendChild(r),this.core=new F5(s),this.errorMessage=n.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=o.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=f.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",m=>this.uploadSignature(m)),this.publishSignatureButton=p.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",t=>this.uploadSignature(t))}resizeCanvas(){const t=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);t.width=(t.offsetWidth||t.width)*i,t.height=(t.offsetHeight||t.height)*i,t.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const t=this.shadowRoot.querySelector("img");let i=t?t.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(t){this.handleError(t.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(t){this.errorMessage.textContent=t}clearSignature(){this.resetErrorMessage();const t=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),t.removeAttribute("hidden")),this.core.clear()}previewUpload(t){const i=this.shadowRoot.querySelector("canvas");let r=this.shadowRoot.querySelector("img");r||(r=document.createElement("img")),r.src=t,r.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",r)}uploadSignature(t){return S(this,null,function*(){try{this.resetErrorMessage();const{files:i}=t.target,r=yield rl.retrieve(i);this.previewUpload(r)}catch(i){this.handleError(i.message)}})}get allowUpload(){return this.hasAttribute("allow-upload")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}"customElements"in window&&!window.customElements.get("smileid-signature-pad")&&window.customElements.define("smileid-signature-pad",q0);function B5(){return`
|
|
3961
|
+
${dt(this.themeColor)}
|
|
3978
3962
|
<style>
|
|
3979
3963
|
.camera-permission-screen {
|
|
3980
3964
|
display: flex;
|
|
@@ -3999,8 +3983,8 @@ button:disabled {
|
|
|
3999
3983
|
text-align: center;
|
|
4000
3984
|
}
|
|
4001
3985
|
</style>
|
|
4002
|
-
<div class='camera-permission-screen flow center'>
|
|
4003
|
-
|
|
3986
|
+
<div class='camera-permission-screen flow center' dir='${this.direction}'>
|
|
3987
|
+
${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
|
|
4004
3988
|
<div class='flow center'>
|
|
4005
3989
|
<p class='color-red | center' id='error'>
|
|
4006
3990
|
</p>
|
|
@@ -4038,31 +4022,31 @@ button:disabled {
|
|
|
4038
4022
|
</clipPath>
|
|
4039
4023
|
</defs>
|
|
4040
4024
|
</svg>
|
|
4041
|
-
<p class='text-2xl font-bold'
|
|
4025
|
+
<p class='text-2xl font-bold'>${y("camera.permission.description")}</p>
|
|
4042
4026
|
<div class='flow action-buttons'>
|
|
4043
4027
|
<button data-variant='solid full-width' class='button' type='button' id='request-camera-access'>
|
|
4044
|
-
|
|
4028
|
+
${y("camera.permission.requestButton")}
|
|
4045
4029
|
</button>
|
|
4046
4030
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
4047
4031
|
</div>
|
|
4048
4032
|
</div>
|
|
4049
4033
|
</div>
|
|
4050
4034
|
</div>
|
|
4051
|
-
`}class
|
|
4035
|
+
`}class D5 extends HTMLElement{connectedCallback(){this.templateString=B5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const t=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");t.textContent="",i.addEventListener("click",()=>S(this,null,function*(){i.setAttribute("disabled",!0);try{yield $.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(r){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:r})),t.textContent=$.handleCameraError(r)}i.removeAttribute("disabled")}))}get showNavigation(){return this.hasAttribute("show-navigation")}get hideAttribution(){return this.hasAttribute("hide-attribution")}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",D5);const R5=fr.version;function O5(){return`
|
|
4052
4036
|
<style>
|
|
4053
4037
|
:host {
|
|
4054
4038
|
display: block;
|
|
4055
4039
|
height: 100%;
|
|
4056
4040
|
}
|
|
4057
4041
|
</style>
|
|
4058
|
-
${
|
|
4042
|
+
${dt(this.themeColor)}
|
|
4059
4043
|
<div style="height: 100%;">
|
|
4060
4044
|
<camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}></camera-permission>
|
|
4061
4045
|
<selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
|
|
4062
|
-
${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
|
|
4046
|
+
${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.allowLegacySelfieFallback}
|
|
4063
4047
|
></selfie-capture-screens>
|
|
4064
4048
|
<document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
|
|
4065
4049
|
${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
|
|
4066
4050
|
</div>
|
|
4067
|
-
`}class
|
|
4051
|
+
`}class V0 extends HTMLElement{constructor(){super(),this.scwTemplateString=O5.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:R5}},"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?this.setUpEventListeners():this.shadowRoot.innerHTML='<h1 class="error-message">Your browser does not support this integration</h1>'}disconnectedCallback(){$.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","allow-legacy-selfie-fallback","disable-image-tests","document-capture-modes","document-type","hide-attribution","hide-back-of-id","hide-back-to-host","show-navigation","theme-color"]}attributeChangedCallback(t){switch(t){case"allow-agent-mode":case"allow-legacy-selfie-fallback":case"disable-image-tests":case"document-capture-modes":case"document-type":case"hide-attribution":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":case"theme-color":this.disconnectedCallback(),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.cameraPermission=this.shadowRoot.querySelector("camera-permission"),this.SelfieCaptureScreens=this.shadowRoot.querySelector("selfie-capture-screens"),this.documentCapture=this.shadowRoot.querySelector("document-capture-screens"),this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.setActiveScreen(this.SelfieCaptureScreens),this.cameraPermission.addEventListener("camera-permission.granted",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.publish",t=>{this._data.images=t.detail.images,this.captureId?this.setActiveScreen(this.documentCapture):this._publishSelectedImages()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.cancelled",()=>{this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.handleBackEvents()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.back",()=>{this.hideInstructions||this.setActiveScreen(this.cameraPermission)}),this.documentCapture.addEventListener("document-capture-screens.publish",t=>{this._data.images=[...this._data.images,...t.detail.images],this._publishSelectedImages()}),this.documentCapture.addEventListener("document-capture-screens.cancelled",()=>{this.SelfieCaptureScreens.setAttribute("initial-screen","selfie-capture"),this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),[this.cameraPermission,this.SelfieCaptureScreens,this.documentCapture].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvent())}),this.documentCapture.addEventListener("document-capture-screens.back",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.reset()})}reset(){this.disconnectedCallback(),this.connectedCallback()}handleBackEvents(){this.dispatchEvent(new CustomEvent("smart-camera-web.cancelled"))}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("smart-camera-web.publish",{detail:this._data}))}get captureId(){return this.hasAttribute("capture-id")}get documentType(){return this.getAttribute("document-type")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get hideInstructions(){return this.hasAttribute("hide-instructions")?"hide-instructions":""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")?"hide-back-of-id":""}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get hideBackToHost(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?"hide-back":""}get allowAgentMode(){return this.hasAttribute("allow-agent-mode")?`allow-agent-mode=${this.getAttribute("allow-agent-mode")}`:""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?"show-agent-mode-for-tests":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?"disable-image-tests":""}get allowLegacySelfieFallback(){return this.hasAttribute("allow-legacy-selfie-fallback")?`allow-legacy-selfie-fallback='${this.getAttribute("allow-legacy-selfie-fallback")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get hasThemeColor(){return this.hasAttribute("theme-color")&&![null,void 0,"null","undefined"].includes(this.getAttribute("theme-color"))}get themeColor(){return this.hasThemeColor?this.getAttribute("theme-color"):"#001096"}get applyComponentThemeColor(){return this.hasThemeColor?`theme-color='${this.themeColor}'`:""}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}handleCloseEvent(){this.dispatchEvent(new CustomEvent("smart-camera-web.close"))}}return"customElements"in window&&!customElements.get("smart-camera-web")&&customElements.define("smart-camera-web",V0),B.DocumentCaptureScreens=Tu,B.EndUserConsent=Fu,B.List=Au,B.Navigation=Lu,B.Option=Su,B.Root=xu,B.SelfieCaptureScreens=U0,B.SignaturePad=q0,B.SmartCameraWeb=V0,B.TotpConsent=Iu,B.Trigger=ku,B.deepMerge=vu,B.escapeHtml=hr,B.getCurrentLocale=y4,B.getDefaultLocale=_4,B.getDirection=ut,B.hasLocale=w4,B.loadLocale=_u,B.registerLocale=Wr,B.registerLocaleUrl=yu,B.setCurrentLocale=b4,B.setDocumentDir=C4,B.t=y,B.tHtml=Nt,B.translate=Xs,B.translateHtml=Cu,B.validateLocale=wu,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),B}({});
|
|
4068
4052
|
//# sourceMappingURL=smart-camera-web.js.map
|