@smileid/web-components 11.2.0 → 11.4.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/dist/esm/{DocumentCaptureScreens-BbtA-WkX.js → DocumentCaptureScreens-DbU8ZxMx.js} +5 -5
- package/dist/esm/{DocumentCaptureScreens-BbtA-WkX.js.map → DocumentCaptureScreens-DbU8ZxMx.js.map} +1 -1
- package/dist/esm/{EndUserConsent-HVufMamg.js → EndUserConsent-BGO3oZ-m.js} +3 -3
- package/dist/esm/{EndUserConsent-HVufMamg.js.map → EndUserConsent-BGO3oZ-m.js.map} +1 -1
- package/dist/esm/{Navigation-B-dqPkZj.js → Navigation-DH44dkMT.js} +2 -2
- package/dist/esm/{Navigation-B-dqPkZj.js.map → Navigation-DH44dkMT.js.map} +1 -1
- package/dist/esm/{SelfieCaptureScreens-ChAMfKi3.js → SelfieCaptureScreens-bmwnmeS9.js} +2186 -2159
- package/dist/esm/SelfieCaptureScreens-bmwnmeS9.js.map +1 -0
- package/dist/esm/{TotpConsent-XxR8TNxy.js → TotpConsent-V3_Ip2Kw.js} +2 -2
- package/dist/esm/{TotpConsent-XxR8TNxy.js.map → TotpConsent-V3_Ip2Kw.js.map} +1 -1
- package/dist/esm/combobox.js +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 → index-Dnpp-kwk.js} +87 -87
- package/dist/esm/{index-B_ozpejI.js.map → index-Dnpp-kwk.js.map} +1 -1
- package/dist/esm/localisation.js +1 -1
- package/dist/esm/main.js +6 -6
- package/dist/esm/navigation.js +1 -1
- package/dist/esm/{package-u3FEJ3Fm.js → package-7J5h4EOW.js} +3 -3
- package/dist/esm/{package-u3FEJ3Fm.js.map → package-7J5h4EOW.js.map} +1 -1
- package/dist/esm/selfie.js +1 -1
- package/dist/esm/smart-camera-web.js +5 -5
- package/dist/esm/totp-consent.js +1 -1
- package/dist/package.json +1 -1
- package/dist/smart-camera-web.js +38 -38
- package/dist/smart-camera-web.js.map +1 -1
- package/dist/types/document-auto-capture.d.ts +34 -0
- package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +3 -15
- package/lib/components/selfie/src/smartselfie-capture/components/CameraPreview.tsx +6 -10
- package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +7 -1
- package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +33 -19
- package/lib/components/selfie/src/smartselfie-capture/utils/alertMessages.ts +0 -1
- package/lib/components/selfie/src/smartselfie-capture/utils/mediapipeManager.ts +127 -30
- package/lib/components/signature-pad/package-lock.json +15 -12
- package/lib/components/signature-pad/package.json +1 -1
- package/package.json +2 -1
- package/dist/esm/SelfieCaptureScreens-ChAMfKi3.js.map +0 -1
package/dist/smart-camera-web.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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"?`
|
|
1
|
+
var SmartCameraWeb=function(F){"use strict";var e6=Object.defineProperty,t6=Object.defineProperties;var i6=Object.getOwnPropertyDescriptors;var so=Object.getOwnPropertySymbols;var e3=Object.prototype.hasOwnProperty,t3=Object.prototype.propertyIsEnumerable;var fl=Math.pow,hl=(F,J,te)=>J in F?e6(F,J,{enumerable:!0,configurable:!0,writable:!0,value:te}):F[J]=te,De=(F,J)=>{for(var te in J||(J={}))e3.call(J,te)&&hl(F,te,J[te]);if(so)for(var te of so(J))t3.call(J,te)&&hl(F,te,J[te]);return F},or=(F,J)=>t6(F,i6(J));var pl=(F,J)=>{var te={};for(var Le in F)e3.call(F,Le)&&J.indexOf(Le)<0&&(te[Le]=F[Le]);if(F!=null&&so)for(var Le of so(F))J.indexOf(Le)<0&&t3.call(F,Le)&&(te[Le]=F[Le]);return te};var wi=(F,J,te)=>hl(F,typeof J!="symbol"?J+"":J,te);var A=(F,J,te)=>new Promise((Le,sr)=>{var ao=Ke=>{try{Ci(te.next(Ke))}catch(oi){sr(oi)}},ar=Ke=>{try{Ci(te.throw(Ke))}catch(oi){sr(oi)}},Ci=Ke=>Ke.done?Le(Ke.value):Promise.resolve(Ke.value).then(ao,ar);Ci((te=te.apply(F,J)).next())});var st;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 Le,sr;function ao(){if(sr)return Le;sr=1;function e(){this.__data__=[],this.size=0}return Le=e,Le}var ar,Ci;function Ke(){if(Ci)return ar;Ci=1;function e(t,i){return t===i||t!==t&&i!==i}return ar=e,ar}var oi,gl;function jr(){if(gl)return oi;gl=1;var e=Ke();function t(i,r){for(var n=i.length;n--;)if(e(i[n][0],r))return n;return-1}return oi=t,oi}var co,vl;function i3(){if(vl)return co;vl=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 co=r,co}var lo,bl;function r3(){if(bl)return lo;bl=1;var e=jr();function t(i){var r=this.__data__,n=e(r,i);return n<0?void 0:r[n][1]}return lo=t,lo}var uo,yl;function n3(){if(yl)return uo;yl=1;var e=jr();function t(i){return e(this.__data__,i)>-1}return uo=t,uo}var ho,_l;function o3(){if(_l)return ho;_l=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 ho=t,ho}var fo,wl;function zr(){if(wl)return fo;wl=1;var e=ao(),t=i3(),i=r3(),r=n3(),n=o3();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,fo=o,fo}var po,Cl;function s3(){if(Cl)return po;Cl=1;var e=zr();function t(){this.__data__=new e,this.size=0}return po=t,po}var mo,El;function a3(){if(El)return mo;El=1;function e(t){var i=this.__data__,r=i.delete(t);return this.size=i.size,r}return mo=e,mo}var go,xl;function c3(){if(xl)return go;xl=1;function e(t){return this.__data__.get(t)}return go=e,go}var vo,kl;function l3(){if(kl)return vo;kl=1;function e(t){return this.__data__.has(t)}return vo=e,vo}var bo,Al;function Sl(){if(Al)return bo;Al=1;var e=typeof J=="object"&&J&&J.Object===Object&&J;return bo=e,bo}var yo,Ll;function si(){if(Ll)return yo;Ll=1;var e=Sl(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return yo=i,yo}var _o,Tl;function Ml(){if(Tl)return _o;Tl=1;var e=si(),t=e.Symbol;return _o=t,_o}var wo,Il;function u3(){if(Il)return wo;Il=1;var e=Ml(),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 wo=o,wo}var Co,Fl;function d3(){if(Fl)return Co;Fl=1;var e=Object.prototype,t=e.toString;function i(r){return t.call(r)}return Co=i,Co}var Eo,Bl;function cr(){if(Bl)return Eo;Bl=1;var e=Ml(),t=u3(),i=d3(),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 Eo=s,Eo}var xo,Dl;function vt(){if(Dl)return xo;Dl=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return xo=e,xo}var ko,Rl;function Ao(){if(Rl)return ko;Rl=1;var e=cr(),t=vt(),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 ko=s,ko}var So,Ol;function h3(){if(Ol)return So;Ol=1;var e=si(),t=e["__core-js_shared__"];return So=t,So}var Lo,Pl;function f3(){if(Pl)return Lo;Pl=1;var e=h3(),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 Lo=i,Lo}var To,$l;function p3(){if($l)return To;$l=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 To=i,To}var Mo,Nl;function m3(){if(Nl)return Mo;Nl=1;var e=Ao(),t=f3(),i=vt(),r=p3(),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 Mo=u,Mo}var Io,Ul;function g3(){if(Ul)return Io;Ul=1;function e(t,i){return t==null?void 0:t[i]}return Io=e,Io}var Fo,Hl;function Bo(){if(Hl)return Fo;Hl=1;var e=m3(),t=g3();function i(r,n){var o=t(r,n);return e(o)?o:void 0}return Fo=i,Fo}var Do,ql;function Vl(){if(ql)return Do;ql=1;var e=Bo(),t=si(),i=e(t,"Map");return Do=i,Do}var Ro,jl;function Gr(){if(jl)return Ro;jl=1;var e=Bo(),t=e(Object,"create");return Ro=t,Ro}var Oo,zl;function v3(){if(zl)return Oo;zl=1;var e=Gr();function t(){this.__data__=e?e(null):{},this.size=0}return Oo=t,Oo}var Po,Gl;function b3(){if(Gl)return Po;Gl=1;function e(t){var i=this.has(t)&&delete this.__data__[t];return this.size-=i?1:0,i}return Po=e,Po}var $o,Zl;function y3(){if(Zl)return $o;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 $o=n,$o}var No,Wl;function _3(){if(Wl)return No;Wl=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 No=r,No}var Uo,Xl;function w3(){if(Xl)return Uo;Xl=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 Uo=i,Uo}var Ho,Kl;function C3(){if(Kl)return Ho;Kl=1;var e=v3(),t=b3(),i=y3(),r=_3(),n=w3();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 qo,Yl;function E3(){if(Yl)return qo;Yl=1;var e=C3(),t=zr(),i=Vl();function r(){this.size=0,this.__data__={hash:new e,map:new(i||t),string:new e}}return qo=r,qo}var Vo,Jl;function x3(){if(Jl)return Vo;Jl=1;function e(t){var i=typeof t;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?t!=="__proto__":t===null}return Vo=e,Vo}var jo,Ql;function Zr(){if(Ql)return jo;Ql=1;var e=x3();function t(i,r){var n=i.__data__;return e(r)?n[typeof r=="string"?"string":"hash"]:n.map}return jo=t,jo}var zo,e1;function k3(){if(e1)return zo;e1=1;var e=Zr();function t(i){var r=e(this,i).delete(i);return this.size-=r?1:0,r}return zo=t,zo}var Go,t1;function A3(){if(t1)return Go;t1=1;var e=Zr();function t(i){return e(this,i).get(i)}return Go=t,Go}var Zo,i1;function S3(){if(i1)return Zo;i1=1;var e=Zr();function t(i){return e(this,i).has(i)}return Zo=t,Zo}var Wo,r1;function L3(){if(r1)return Wo;r1=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 Wo=t,Wo}var Xo,n1;function T3(){if(n1)return Xo;n1=1;var e=E3(),t=k3(),i=A3(),r=S3(),n=L3();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,Xo=o,Xo}var Ko,o1;function M3(){if(o1)return Ko;o1=1;var e=zr(),t=Vl(),i=T3(),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 Ko=n,Ko}var Yo,s1;function I3(){if(s1)return Yo;s1=1;var e=zr(),t=s3(),i=a3(),r=c3(),n=l3(),o=M3();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,Yo=s,Yo}var Jo,a1;function c1(){if(a1)return Jo;a1=1;var e=Bo(),t=function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch(r){}}();return Jo=t,Jo}var Qo,l1;function es(){if(l1)return Qo;l1=1;var e=c1();function t(i,r,n){r=="__proto__"&&e?e(i,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):i[r]=n}return Qo=t,Qo}var ts,u1;function d1(){if(u1)return ts;u1=1;var e=es(),t=Ke();function i(r,n,o){(o!==void 0&&!t(r[n],o)||o===void 0&&!(n in r))&&e(r,n,o)}return ts=i,ts}var is,h1;function F3(){if(h1)return is;h1=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 is=e,is}var rs,f1;function B3(){if(f1)return rs;f1=1;var e=F3(),t=e();return rs=t,rs}var lr={exports:{}};lr.exports;var p1;function D3(){return p1||(p1=1,function(e,t){var i=si(),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}(lr,lr.exports)),lr.exports}var ns,m1;function R3(){if(m1)return ns;m1=1;var e=si(),t=e.Uint8Array;return ns=t,ns}var os,g1;function O3(){if(g1)return os;g1=1;var e=R3();function t(i){var r=new i.constructor(i.byteLength);return new e(r).set(new e(i)),r}return os=t,os}var ss,v1;function P3(){if(v1)return ss;v1=1;var e=O3();function t(i,r){var n=r?e(i.buffer):i.buffer;return new i.constructor(n,i.byteOffset,i.length)}return ss=t,ss}var as,b1;function $3(){if(b1)return as;b1=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 as=e,as}var cs,y1;function N3(){if(y1)return cs;y1=1;var e=vt(),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 cs=i,cs}var ls,_1;function U3(){if(_1)return ls;_1=1;function e(t,i){return function(r){return t(i(r))}}return ls=e,ls}var us,w1;function C1(){if(w1)return us;w1=1;var e=U3(),t=e(Object.getPrototypeOf,Object);return us=t,us}var ds,E1;function x1(){if(E1)return ds;E1=1;var e=Object.prototype;function t(i){var r=i&&i.constructor,n=typeof r=="function"&&r.prototype||e;return i===n}return ds=t,ds}var hs,k1;function H3(){if(k1)return hs;k1=1;var e=N3(),t=C1(),i=x1();function r(n){return typeof n.constructor=="function"&&!i(n)?e(t(n)):{}}return hs=r,hs}var fs,A1;function Ei(){if(A1)return fs;A1=1;function e(t){return t!=null&&typeof t=="object"}return fs=e,fs}var ps,S1;function q3(){if(S1)return ps;S1=1;var e=cr(),t=Ei(),i="[object Arguments]";function r(n){return t(n)&&e(n)==i}return ps=r,ps}var ms,L1;function T1(){if(L1)return ms;L1=1;var e=q3(),t=Ei(),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 ms=o,ms}var gs,M1;function I1(){if(M1)return gs;M1=1;var e=Array.isArray;return gs=e,gs}var vs,F1;function B1(){if(F1)return vs;F1=1;var e=9007199254740991;function t(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return vs=t,vs}var bs,D1;function ys(){if(D1)return bs;D1=1;var e=Ao(),t=B1();function i(r){return r!=null&&t(r.length)&&!e(r)}return bs=i,bs}var _s,R1;function V3(){if(R1)return _s;R1=1;var e=ys(),t=Ei();function i(r){return t(r)&&e(r)}return _s=i,_s}var ur={exports:{}},ws,O1;function j3(){if(O1)return ws;O1=1;function e(){return!1}return ws=e,ws}ur.exports;var P1;function $1(){return P1||(P1=1,function(e,t){var i=si(),r=j3(),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}(ur,ur.exports)),ur.exports}var Cs,N1;function z3(){if(N1)return Cs;N1=1;var e=cr(),t=C1(),i=Ei(),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 Cs=l,Cs}var Es,U1;function G3(){if(U1)return Es;U1=1;var e=cr(),t=B1(),i=Ei(),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]",w="[object Float64Array]",_="[object Int8Array]",I="[object Int16Array]",D="[object Int32Array]",$="[object Uint8Array]",S="[object Uint8ClampedArray]",N="[object Uint16Array]",B="[object Uint32Array]",E={};E[b]=E[w]=E[_]=E[I]=E[D]=E[$]=E[S]=E[N]=E[B]=!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 H(R){return i(R)&&t(R.length)&&!!E[e(R)]}return Es=H,Es}var xs,H1;function Z3(){if(H1)return xs;H1=1;function e(t){return function(i){return t(i)}}return xs=e,xs}var dr={exports:{}};dr.exports;var q1;function W3(){return q1||(q1=1,function(e,t){var i=Sl(),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}(dr,dr.exports)),dr.exports}var ks,V1;function j1(){if(V1)return ks;V1=1;var e=G3(),t=Z3(),i=W3(),r=i&&i.isTypedArray,n=r?t(r):e;return ks=n,ks}var As,z1;function G1(){if(z1)return As;z1=1;function e(t,i){if(!(i==="constructor"&&typeof t[i]=="function")&&i!="__proto__")return t[i]}return As=e,As}var Ss,Z1;function X3(){if(Z1)return Ss;Z1=1;var e=es(),t=Ke(),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 Ss=n,Ss}var Ls,W1;function K3(){if(W1)return Ls;W1=1;var e=X3(),t=es();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 Ls=i,Ls}var Ts,X1;function Y3(){if(X1)return Ts;X1=1;function e(t,i){for(var r=-1,n=Array(t);++r<t;)n[r]=i(r);return n}return Ts=e,Ts}var Ms,K1;function Y1(){if(K1)return Ms;K1=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 Ms=i,Ms}var Is,J1;function J3(){if(J1)return Is;J1=1;var e=Y3(),t=T1(),i=I1(),r=$1(),n=Y1(),o=j1(),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 Is=c,Is}var Fs,Q1;function Q3(){if(Q1)return Fs;Q1=1;function e(t){var i=[];if(t!=null)for(var r in Object(t))i.push(r);return i}return Fs=e,Fs}var Bs,eu;function e4(){if(eu)return Bs;eu=1;var e=vt(),t=x1(),i=Q3(),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 Bs=o,Bs}var Ds,tu;function iu(){if(tu)return Ds;tu=1;var e=J3(),t=e4(),i=ys();function r(n){return i(n)?e(n,!0):t(n)}return Ds=r,Ds}var Rs,ru;function t4(){if(ru)return Rs;ru=1;var e=K3(),t=iu();function i(r){return e(r,t(r))}return Rs=i,Rs}var Os,nu;function i4(){if(nu)return Os;nu=1;var e=d1(),t=D3(),i=P3(),r=$3(),n=H3(),o=T1(),s=I1(),a=V3(),c=$1(),l=Ao(),d=vt(),u=z3(),h=j1(),f=G1(),p=t4();function m(v,g,b,w,_,I,D){var $=f(v,b),S=f(g,b),N=D.get(S);if(N){e(v,b,N);return}var B=I?I($,S,b+"",v,g,D):void 0,E=B===void 0;if(E){var H=s(S),R=!H&&c(S),ce=!H&&!R&&h(S);B=S,H||R||ce?s($)?B=$:a($)?B=r($):R?(E=!1,B=t(S,!0)):ce?(E=!1,B=i(S,!0)):B=[]:u(S)||o(S)?(B=$,o($)?B=p($):(!d($)||l($))&&(B=n(S))):E=!1}E&&(D.set(S,B),_(B,S,w,I,D),D.delete(S)),e(v,b,B)}return Os=m,Os}var Ps,ou;function r4(){if(ou)return Ps;ou=1;var e=I3(),t=d1(),i=B3(),r=i4(),n=vt(),o=iu(),s=G1();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 Ps=a,Ps}var $s,su;function au(){if(su)return $s;su=1;function e(t){return t}return $s=e,$s}var Ns,cu;function n4(){if(cu)return Ns;cu=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 Ns=e,Ns}var Us,lu;function o4(){if(lu)return Us;lu=1;var e=n4(),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 Us=i,Us}var Hs,uu;function s4(){if(uu)return Hs;uu=1;function e(t){return function(){return t}}return Hs=e,Hs}var qs,du;function a4(){if(du)return qs;du=1;var e=s4(),t=c1(),i=au(),r=t?function(n,o){return t(n,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:i;return qs=r,qs}var Vs,hu;function c4(){if(hu)return Vs;hu=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 Vs=r,Vs}var js,fu;function l4(){if(fu)return js;fu=1;var e=a4(),t=c4(),i=t(e);return js=i,js}var zs,pu;function u4(){if(pu)return zs;pu=1;var e=au(),t=o4(),i=l4();function r(n,o){return i(t(n,o,e),n+"")}return zs=r,zs}var Gs,mu;function d4(){if(mu)return Gs;mu=1;var e=Ke(),t=ys(),i=Y1(),r=vt();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 Gs=n,Gs}var Zs,gu;function h4(){if(gu)return Zs;gu=1;var e=u4(),t=d4();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 Zs=i,Zs}var Ws,vu;function f4(){if(vu)return Ws;vu=1;var e=r4(),t=h4(),i=t(function(r,n,o){e(r,n,o)});return Ws=i,Ws}var p4=f4();const m4=te(p4),g4={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:{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}} غير صالح"}}},v4={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:{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"}}},b4={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:{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"}}},bu={ar:"ar-EG",en:"en-GB",fr:"fr-FR"};function hr(e){return bu[e]||e}const Lt="en-GB",y4=5e3;let lt=Lt;const Ce={"ar-EG":g4,"en-GB":v4,"fr-FR":b4};function Wr(e,t){Ce[e]=t}function yu(e,t){return!t||typeof t!="object"?e:!e||typeof e!="object"?t:m4({},e,t)}const _u=["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 _4(i){return A(this,arguments,function*(e,t=y4){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return yield fetch(e,{signal:r.signal})}finally{clearTimeout(n)}})}function wu(e,t){return A(this,null,function*(){try{const i=yield _4(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!==Lt&&Ce[Lt])return console.warn(`Falling back to default locale '${Lt}'`),Ce[Lt];throw i}})}function Cu(e,t){return A(this,null,function*(){const i=hr(e);return Ce[i]?Ce[i]:t?wu(e,t):(console.warn(`Locale '${e}' not found and no URL provided, using default '${Lt}'`),Ce[Lt]||{})})}function Xs(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 Eu(e){if(!e||typeof e!="object")return{missingKeys:_u,valid:!1};const t=_u.filter(i=>i==="direction"?!e.direction:!Xs(e,i));return{missingKeys:t,valid:t.length===0}}function y(e){const t=hr(lt),i=Ce[t],r=Xs(i,e);if(r)return r;const n=hr(Lt);if(t!==n){const o=Xs(Ce[n],e);if(o)return o}return console.warn(`Translation key '${e}' not found in any locale`),e}const Ks=y,w4={'"':""","&":"&","'":"'","<":"<",">":">"};function fr(e){return e.replace(/[&<>"']/g,t=>w4[t])}function Ut(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=fr(String(n.value||"")),a=fr(String(n.className||""));i=i.split(o).join(a?`<span class="${a}">${s}</span>`:s)}else i=i.split(o).join(fr(String(n)))}),i}const xu=Ut;function C4(o){return A(this,arguments,function*(e,{url:t,translation:i,locales:r,validate:n=!1}={}){if(lt=hr(e),r&&typeof r=="object"&&Object.entries(r).forEach(([a,c])=>{if(!c||typeof c!="object")return;const l=hr(a);Ce[l]?Ce[l]=yu(Ce[l],c):(Wr(l,c),a!==l&&(bu[a]=l))}),!Ce[lt])if(i)Wr(lt,i);else if(t)try{yield Cu(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&&Ce[lt]){const a=Eu(Ce[lt]);a.valid||console.warn(`Locale '${e}' is missing required keys:`,a.missingKeys)}const s=Ce[lt];return s&&s.direction&&(document!=null&&document.documentElement)&&(document.documentElement.dir=s.direction),!0})}function E4(){return lt}function x4(){return Lt}function k4(e){return e in Ce}function A4(e){const t=Ce[e];t&&t.direction&&(document.documentElement.dir=t.direction)}function ut(){const e=Ce[lt];return(e==null?void 0:e.direction)||"ltr"}function ku(e){const t=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${e}-${t}`}function S4(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 L4(e){return e&&e.clientHeight<e.scrollHeight}function T4(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 M4 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 I4 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
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 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
|
|
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 F4 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
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",ku("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,L4(this)&&T4(this.selectedNode,this),S4(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(r=>r.setAttribute("aria-activedescendant",i.id))}}class B4 extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",ku("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 Au=M4,Su=I4,Lu=F4,Tu=B4;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",Au),window.customElements.define("smileid-combobox-trigger",Su),window.customElements.define("smileid-combobox-listbox",Lu),window.customElements.define("smileid-combobox-option",Tu));const xi={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,D4=`
|
|
13
13
|
.text-xs {
|
|
14
14
|
font-size: 0.75rem;
|
|
15
15
|
line-height: 1rem;
|
|
@@ -65,7 +65,7 @@ var SmartCameraWeb=function(B){"use strict";var G5=Object.defineProperty,Z5=Obje
|
|
|
65
65
|
as="style"
|
|
66
66
|
/>
|
|
67
67
|
<style>
|
|
68
|
-
${
|
|
68
|
+
${D4}
|
|
69
69
|
:host {
|
|
70
70
|
--theme-color: ${e||"#001096"};
|
|
71
71
|
--color-active: #001096;
|
|
@@ -423,7 +423,7 @@ ${M4}
|
|
|
423
423
|
left: 1.25rem;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
</style>`,
|
|
426
|
+
</style>`,At=class At{static getMedia(t){return A(this,null,function*(){return At.stream=yield navigator.mediaDevices.getUserMedia(t),At.stream})}static stopMedia(){At.stream&&(At.stream.getTracks().forEach(t=>t.stop()),At.stream=null)}static supportsAgentMode(){return A(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}}};wi(At,"stream",null),wi(At,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:At.isSamsungMultiCameraDevice()?2:1});let O=At;class Mu extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=ut(),r=document.createElement("style");r.textContent=`
|
|
427
427
|
:host {
|
|
428
428
|
display: flex;
|
|
429
429
|
max-inline-size: 100%;
|
|
@@ -533,7 +533,7 @@ button[data-type="icon"] {
|
|
|
533
533
|
<span class="visually-hidden"
|
|
534
534
|
>${y("navigation.closeVerificationFrame")}</span
|
|
535
535
|
>
|
|
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",
|
|
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",Mu);function R4(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 O4(){return`
|
|
537
537
|
<style>
|
|
538
538
|
.visually-hidden {
|
|
539
539
|
border: 0;
|
|
@@ -706,7 +706,7 @@ button[data-type="icon"] {
|
|
|
706
706
|
</div>
|
|
707
707
|
</div>
|
|
708
708
|
</div>
|
|
709
|
-
`}const
|
|
709
|
+
`}const ki=.6;class P4 extends HTMLElement{constructor(){super(),this.templateString=O4.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 A(this,null,function*(){if(!O.stream&&this.hasAttribute("data-camera-error")){try{yield O.getMedia({audio:!1,video:or(De({},O.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(t){console.error(t.constraint),console.error(t.message)}this.handleIDStream(O.stream)}})}_captureIDImage(){const t=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:De({},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 De({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 De({image:s,originalHeight:i.height,originalWidth:i.width,previewImage:a},this.idCardRegion)}_drawImage(t,i=!0,r=O.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(R4(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",O.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),O.stopMedia()}}_drawLandscapeImage(t,i=this._IDVideo,r=ki,n=ki){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=ki,n=ki){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=ki,n=ki){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,w=l*v,_=d*m;t.getContext("2d").drawImage(a,w,_,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"),O.stream&&this.handleIDStream(O.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")),O.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),O.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",P4);function $4(){return`
|
|
710
710
|
<style>
|
|
711
711
|
.retake-photo.button[data-variant~="ghost"] {
|
|
712
712
|
color: #FF5805;
|
|
@@ -949,7 +949,7 @@ button[data-type="icon"] {
|
|
|
949
949
|
`}
|
|
950
950
|
</div>
|
|
951
951
|
</div>
|
|
952
|
-
`}class
|
|
952
|
+
`}class N4 extends HTMLElement{constructor(){super(),this.templateString=$4.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",N4);let U4=(st=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/fl(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 A(this,null,function*(){if(t.length>1)throw new Error(y("fileUpload.error.multipleFiles"));const i=t[0];if(!st.supportedTypes.includes(i.type))throw new Error(y("fileUpload.error.unsupportedFormat"));if(i.size>st.memoryLimit)throw new Error(Ut("fileUpload.error.fileTooLarge",{filename:i.name,size:st.getHumanSize(st.memoryLimit)}));return yield st.getData(i)})}},wi(st,"memoryLimit",1024e4),wi(st,"supportedTypes",["image/jpeg","image/png"]),st);function H4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
|
|
953
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"/>
|
|
954
954
|
<g filter="url(#filter0_d_1281_4127)">
|
|
955
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)"/>
|
|
@@ -1057,7 +1057,7 @@ button[data-type="icon"] {
|
|
|
1057
1057
|
<stop offset="0.71" stop-color="#FF766A"/>
|
|
1058
1058
|
</linearGradient>
|
|
1059
1059
|
</defs>
|
|
1060
|
-
</svg>`}function
|
|
1060
|
+
</svg>`}function q4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
|
|
1061
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"/>
|
|
1062
1062
|
<g filter="url(#filter0_d_1281_4284)">
|
|
1063
1063
|
<mask id="path-2-inside-1_1281_4284" fill="white">
|
|
@@ -1092,7 +1092,7 @@ button[data-type="icon"] {
|
|
|
1092
1092
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4284" result="shape"/>
|
|
1093
1093
|
</filter>
|
|
1094
1094
|
</defs>
|
|
1095
|
-
</svg>`}function
|
|
1095
|
+
</svg>`}function V4(){return`
|
|
1096
1096
|
<style>
|
|
1097
1097
|
h1 {
|
|
1098
1098
|
font-size: 1.25rem;
|
|
@@ -1136,8 +1136,8 @@ button[data-type="icon"] {
|
|
|
1136
1136
|
</div>
|
|
1137
1137
|
<div class="content-body">
|
|
1138
1138
|
<header>
|
|
1139
|
-
${this.isFrontOfId?
|
|
1140
|
-
<h1 class='title-color font-bold'>${
|
|
1139
|
+
${this.isFrontOfId?H4():q4()}
|
|
1140
|
+
<h1 class='title-color font-bold'>${fr(this.title)}</h1>
|
|
1141
1141
|
<p class="description text-sm font-normal">
|
|
1142
1142
|
${y("document.instructions.description")}
|
|
1143
1143
|
</p>
|
|
@@ -1341,7 +1341,7 @@ ${this.hideAttribution?"":`
|
|
|
1341
1341
|
</div>
|
|
1342
1342
|
</div>
|
|
1343
1343
|
${dt(this.themeColor)}
|
|
1344
|
-
`}class
|
|
1344
|
+
`}class j4 extends HTMLElement{constructor(){super(),this.templateString=V4.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=>A(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:o}=n.target,s=yield U4.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",j4);const pr={version:"11.4.0"},z4=pr.version,U=document.querySelector("smart-camera-web");function qt(e){return A(this,null,function*(){try{const t=yield O.getMedia({audio:!1,video:O.environmentOptions}),r=(yield navigator.mediaDevices.enumerateDevices()).find(n=>n.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===n.deviceId);U==null||U.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",O.handleCameraError(t))}})}class Iu extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),U==null||U.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
1345
1345
|
${dt(this.themeColor)}
|
|
1346
1346
|
<div style="height: 100%;">
|
|
1347
1347
|
<document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
|
|
@@ -1362,7 +1362,7 @@ ${this.hideAttribution?"":`
|
|
|
1362
1362
|
<document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1363
1363
|
<document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1364
1364
|
</div>
|
|
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`
|
|
1365
|
+
`,this._data={images:[],meta:{libraryVersion:z4}},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?(qt(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){O.stopMedia(),U==null||U.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",()=>A(this,null,function*(){U==null||U.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),U==null||U.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield qt(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>A(this,null,function*(){U==null||U.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:xi.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{U==null||U.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:xi.ID_CARD_IMAGE_BASE64}),O.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",()=>A(this,null,function*(){U==null||U.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield qt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>A(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield qt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>A(this,null,function*(){U==null||U.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),U==null||U.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield qt(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>A(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield qt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>A(this,null,function*(){U==null||U.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:xi.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{U==null||U.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:xi.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),O.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>A(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield qt(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>A(this,null,function*(){U==null||U.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield qt(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",Iu);var mr={exports:{}};var G4=mr.exports,Fu;function Z4(){return Fu||(Fu=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(_,I){return _>I},greaterThanOrEqualTo:function(_,I){return _>=I},equalTo:function(_,I){return _===I},lessThan:function(_,I){return _<I},lessThanOrEqualTo:function(_,I){return _<=I},divisibleBy:function(_,I){return _%I===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),w=c[b]||this[b]||this.message||"must be %{type} %{count}";h.push(s.format(w,{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(G4,t,e,null)}(mr,mr.exports)),mr.exports}var W4=Z4();const X4=te(W4);function Ys(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 K4(){return`
|
|
1366
1366
|
<style>
|
|
1367
1367
|
*,
|
|
1368
1368
|
*::before,
|
|
@@ -1829,7 +1829,7 @@ ${this.hideAttribution?"":`
|
|
|
1829
1829
|
</form>
|
|
1830
1830
|
</div>
|
|
1831
1831
|
</div>
|
|
1832
|
-
`}class
|
|
1832
|
+
`}class Bu extends HTMLElement{constructor(){super(),this.templateString=K4.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=X4({id_number:t},i);return r&&this.handleIdNumberValidationErrors(r),r}queryOtpModes(t){return A(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 Ys(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 A(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 Ys(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 A(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 Ys(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",Bu);class Y4 extends HTMLElement{constructor(){super();const t=document.createElement("template");t.innerHTML=`
|
|
1833
1833
|
<p style='margin-inline: auto; max-inline-size: 10rem'>
|
|
1834
1834
|
<svg viewBox="0 0 90 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1835
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"/>
|
|
@@ -1851,7 +1851,7 @@ ${this.hideAttribution?"":`
|
|
|
1851
1851
|
</defs>
|
|
1852
1852
|
</svg>
|
|
1853
1853
|
</p>
|
|
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",
|
|
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",Y4);function J4(){return`
|
|
1855
1855
|
<style>
|
|
1856
1856
|
*,
|
|
1857
1857
|
*::before,
|
|
@@ -2197,10 +2197,10 @@ ${this.hideAttribution?"":`
|
|
|
2197
2197
|
</span>
|
|
2198
2198
|
</p>
|
|
2199
2199
|
<h1 class='text-base font-bold'>
|
|
2200
|
-
${
|
|
2200
|
+
${Ut("consent.accessRequest",{idTypeLabel:{className:"theme",value:this.idTypeLabel},partnerName:{className:"theme",value:this.partnerName}})}
|
|
2201
2201
|
</h1>
|
|
2202
2202
|
<p class='text-base font-normal'>
|
|
2203
|
-
${
|
|
2203
|
+
${Ut("consent.allowPartner",{partnerName:this.partnerName})}
|
|
2204
2204
|
</p>
|
|
2205
2205
|
</section>
|
|
2206
2206
|
|
|
@@ -2255,12 +2255,12 @@ ${this.hideAttribution?"":`
|
|
|
2255
2255
|
|
|
2256
2256
|
<section class='callout | flow center' style='--flow-space: 2rem; margin: var(--flow-space) auto;'>
|
|
2257
2257
|
<p>
|
|
2258
|
-
${
|
|
2258
|
+
${Ut("consent.privacyPolicy",{partnerName:this.partnerName})}
|
|
2259
2259
|
<a class='theme' href='${this.partnerPolicyURL}' rel='noreferer noopener' target='_blank'>${y("consent.privacyPolicyLink")}</a>
|
|
2260
2260
|
</p>
|
|
2261
2261
|
|
|
2262
2262
|
<p style='--flow-space: .75rem'>
|
|
2263
|
-
${
|
|
2263
|
+
${Ut("consent.grantConsent",{partnerName:this.partnerName})}
|
|
2264
2264
|
</p>
|
|
2265
2265
|
</section>
|
|
2266
2266
|
|
|
@@ -2423,7 +2423,7 @@ ${this.hideAttribution?"":`
|
|
|
2423
2423
|
|
|
2424
2424
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
2425
2425
|
</div>
|
|
2426
|
-
`}class
|
|
2426
|
+
`}class Du extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=J4.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:De({},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",Du);function Q4(){return`
|
|
2427
2427
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
2428
2428
|
<link
|
|
2429
2429
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap"
|
|
@@ -3019,7 +3019,7 @@ ${this.hideAttribution?"":`
|
|
|
3019
3019
|
</div>
|
|
3020
3020
|
</div>
|
|
3021
3021
|
</div>
|
|
3022
|
-
`}class
|
|
3022
|
+
`}class ef extends HTMLElement{constructor(){super(),this.templateString=Q4.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",ef);function tf(){return`
|
|
3023
3023
|
<style>
|
|
3024
3024
|
.retake-photo.button[data-variant~="ghost"] {
|
|
3025
3025
|
color: #FF5805;
|
|
@@ -3100,21 +3100,21 @@ ${this.hideAttribution?"":`
|
|
|
3100
3100
|
`}
|
|
3101
3101
|
</div>
|
|
3102
3102
|
</div>
|
|
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`
|
|
3103
|
+
`}class rf extends HTMLElement{constructor(){super(),this.templateString=tf.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",rf);var gr,G,Ru,Ou,ai,Pu,$u,Nu,Uu,Js,Qs,ea,vr={},Hu=[],nf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,br=Array.isArray;function bt(e,t){for(var i in t)e[i]=t[i];return e}function ta(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Tt(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?gr.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 yr(e,s,r,n,null)}function yr(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?++Ru:n,__i:-1,__u:0};return n==null&&G.vnode!=null&&G.vnode(o),o}function Vt(e){return e.children}function _r(e,t){this.props=e,this.context=t}function Ai(e,t){if(t==null)return e.__?Ai(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"?Ai(e):null}function qu(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 qu(e)}}function Vu(e){(!e.__d&&(e.__d=!0)&&ai.push(e)&&!Xr.__r++||Pu!=G.debounceRendering)&&((Pu=G.debounceRendering)||$u)(Xr)}function Xr(){for(var e,t,i,r,n,o,s,a=1;ai.length;)ai.length>a&&ai.sort(Nu),e=ai.shift(),a=ai.length,e.__d&&(i=void 0,r=void 0,n=(r=(t=e).__v).__e,o=[],s=[],t.__P&&((i=bt({},r)).__v=r.__v+1,G.vnode&&G.vnode(i),ia(t.__P,i,r,t.__n,t.__P.namespaceURI,32&r.__u?[n]:null,o,n==null?Ai(r):n,!!(32&r.__u),s),i.__v=r.__v,i.__.__k[i.__i]=i,Xu(o,i,s),r.__e=r.__=null,i.__e!=n&&qu(i)));Xr.__r=0}function ju(e,t,i,r,n,o,s,a,c,l,d){var u,h,f,p,m,v,g,b=r&&r.__k||Hu,w=t.length;for(c=of(i,t,b,c,w),u=0;u<w;u++)(f=i.__k[u])!=null&&(h=f.__i==-1?vr:b[f.__i]||vr,f.__i=u,v=ia(e,f,h,n,o,s,a,c,l,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&na(h.ref,null,f),d.push(f.ref,f.__c||p,f)),m==null&&p!=null&&(m=p),(g=!!(4&f.__u))||h.__k===f.__k?c=zu(f,c,e,g):typeof f.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),f.__u&=-7);return i.__e=m,c}function of(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?yr(null,s,null,null,null):br(s)?yr(Vt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?yr(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=sf(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=Ai(a)),Yu(a,a));return r}function zu(e,t,i,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=zu(n[o],t,i,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Ai(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Gu(e,t){return t=t||[],e==null||typeof e=="boolean"||(br(e)?e.some(function(i){Gu(i,t)}):t.push(e)),t}function sf(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"||nf.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(Uu,"$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=Js,e.addEventListener(t,o?ea:Qs,o)):e.removeEventListener(t,o?ea:Qs,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 Wu(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Js++;else if(t.t<i.u)return;return i(G.event?G.event(t):t)}}}function ia(e,t,i,r,n,o,s,a,c,l){var d,u,h,f,p,m,v,g,b,w,_,I,D,$,S,N,B,E=t.type;if(t.constructor!==void 0)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,w=(d=E.contextType)&&r[d.__c],_=d?w?w.props.value:d.__:r,i.__c?v=(u=t.__c=i.__c).__=u.__E:(b?t.__c=u=new E(g,_):(t.__c=u=new _r(g,_),u.constructor=E,u.render=cf),w&&w.sub(u),u.props=g,u.state||(u.state={}),u.context=_,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=bt({},u.__s)),bt(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,_),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,_)===!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(H){H&&(H.__=t)}),I=0;I<u._sb.length;I++)u.__h.push(u._sb[I]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,_),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,m)})}if(u.context=_,u.props=g,u.__P=e,u.__e=!1,D=G.__r,$=0,b){for(u.state=u.__s,u.__d=!1,D&&D(t),d=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,D&&D(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++$<25);u.state=u.__s,u.getChildContext!=null&&(r=bt(bt({},r),u.getChildContext())),b&&!h&&u.getSnapshotBeforeUpdate!=null&&(m=u.getSnapshotBeforeUpdate(f,p)),N=d,d!=null&&d.type===Vt&&d.key==null&&(N=Ku(d.props.children)),a=ju(e,br(N)?N:[N],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(H){if(t.__v=null,c||o!=null)if(H.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(B=o.length;B--;)ta(o[B]);ra(t)}else t.__e=i.__e,t.__k=i.__k,H.then||ra(t);G.__e(H,t,i)}else o==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=af(i.__e,t,i,r,n,o,s,c,l);return(d=G.diffed)&&d(t),128&t.__u?void 0:a}function ra(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ra)}function Xu(e,t,i){for(var r=0;r<i.length;r++)na(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 Ku(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:br(e)?e.map(Ku):bt({},e)}function af(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&&gr.call(e.childNodes),v=i.props||vr,!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=""),ju(t.type=="template"?e.content:e,br(h)?h:[h],t,i,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:i.__k&&Ai(i,0),a,c),o!=null)for(l=o.length;l--;)ta(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 na(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 Yu(e,t,i){var r,n;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||na(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]&&Yu(r[n],t,i||typeof e.type!="function");i||ta(e.__e),e.__c=e.__=e.__e=void 0}function cf(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=[],ia(t,e=(!r&&i||t).__k=Tt(Vt,null,[e]),n||vr,vr,t.namespaceURI,!r&&i?[i]:n?null:t.firstChild?gr.call(t.childNodes):null,o,!r&&i?i:n?n.__e:t.firstChild,r,s),Xu(o,e,s)}function Ju(e,t){Yr(e,t,Ju)}function Qu(e,t,i){var r,n,o,s,a=bt({},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?gr.call(arguments,2):i),yr(e.type,a,r||e.key,n||e.ref,null)}gr=Hu.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}},Ru=0,Ou=function(e){return e!=null&&e.constructor===void 0},_r.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=bt({},this.state),typeof e=="function"&&(e=e(bt({},i),this.props)),e&&bt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Vu(this))},_r.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Vu(this))},_r.prototype.render=Vt,ai=[],$u=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Nu=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,Uu=/(PointerCapture)$|Capture$/i,Js=0,Qs=Wu(!1),ea=Wu(!0);var lf=0;function P(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:--lf,__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 wr,de,oa,e2,Jr=0,t2=[],ge=G,i2=ge.__b,r2=ge.__r,n2=ge.diffed,o2=ge.__c,s2=ge.unmount,a2=ge.__;function sa(e,t){ge.__h&&ge.__h(de,e,Jr||t),Jr=0;var i=de.__H||(de.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function ci(e){return Jr=1,uf(u2,e)}function uf(e,t,i){var r=sa(wr++,2);if(r.t=e,!r.__c&&(r.__=[u2(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=de,!de.__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};de.__f=!0;var o=de.shouldComponentUpdate,s=de.componentWillUpdate;de.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)},de.shouldComponentUpdate=n}return r.__N||r.__}function ht(e,t){var i=sa(wr++,3);!ge.__s&&l2(i.__H,t)&&(i.__=e,i.u=t,de.__H.__h.push(i))}function Ae(e){return Jr=5,Qr(function(){return{current:e}},[])}function Qr(e,t){var i=sa(wr++,7);return l2(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function df(){for(var e;e=t2.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(aa),e.__H.__h=[]}catch(t){e.__H.__h=[],ge.__e(t,e.__v)}}ge.__b=function(e){de=null,i2&&i2(e)},ge.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),a2&&a2(e,t)},ge.__r=function(e){r2&&r2(e),wr=0;var t=(de=e.__c).__H;t&&(oa===de?(t.__h=[],de.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(aa),t.__h=[],wr=0)),oa=de},ge.diffed=function(e){n2&&n2(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(t2.push(t)!==1&&e2===ge.requestAnimationFrame||((e2=ge.requestAnimationFrame)||hf)(df)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),oa=de=null},ge.__c=function(e,t){t.some(function(i){try{i.__h.forEach(en),i.__h=i.__h.filter(function(r){return!r.__||aa(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],ge.__e(r,i.__v)}}),o2&&o2(e,t)},ge.unmount=function(e){s2&&s2(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&&ge.__e(t,i.__v))};var c2=typeof requestAnimationFrame=="function";function hf(e){var t,i=function(){clearTimeout(r),c2&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,35);c2&&(t=requestAnimationFrame(i))}function en(e){var t=de,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),de=t}function aa(e){var t=de;e.__c=e.__(),de=t}function l2(e,t){return!e||e.length!==t.length||t.some(function(i,r){return i!==e[r]})}function u2(e,t){return typeof t=="function"?t(e):t}var ff={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 pf=(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=pl(m,["color","size","stroke","title","children","className","class","style"]);return Tt("svg",De(or(De({},ff[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&&Tt("title",{},c),...r.map(([v,g])=>Tt(v,g)),...Gu(l)])};return n.displayName=`${i}`,n};var mf=pf("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function ca(){return(ca=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 gf=["context","children"];function vf(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,gf);return Qu(t,i)}function bf(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Tt(vf,ca({},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[d2(a[s].name)]=a[s].value);for(s=c.length;s--;){var l=t(c[s],null),d=c[s].slot;d?o[d]=Tt(h2,{name:d},l):n[s]=l}var u=r?Tt(h2,null,n):n;return Tt(r||i.nodeName.toLowerCase(),o,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ju:Yr)(this._vdom,this._root)}function d2(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function yf(e,t,i){if(this._vdom){var r={};r[e]=i=i==null?void 0:i,r[d2(e)]=i,this._vdom=Qu(this._vdom,r),Yr(this._vdom,this._root)}}function _f(){Yr(this._vdom=null,this._root)}function h2(e,t){var i=this;return Tt("slot",ca({},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 f2(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=bf,n.prototype.attributeChangedCallback=yf,n.prototype.disconnectedCallback=_f,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 li=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t,wf=(e="user")=>{var v;const t=Ae(null),i=Ae(null),[r,n]=ci(e),[o,s]=ci(!1),a=Ae(null),c=Ae(!1),l=Ae(new Set),d=g=>{a.current=g};ht(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const w=setTimeout(()=>{var _;(_=a.current)==null||_.call(a),c.current=!1,l.current.delete(w)},100);l.current.add(w)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(w=>clearTimeout(w)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),ht(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const u=(g,b)=>A(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(B=>B.stop()),i.current=null),t.current&&(t.current.srcObject=null);const w=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||r}});i.current=w;const D=w.getVideoTracks()[0].getSettings().facingMode;(D&&D!==(g||r)||D&&D!==r)&&n(D);const N=(yield navigator.mediaDevices.enumerateDevices()).find(B=>B.kind==="videoinput"&&w.getVideoTracks()[0].getSettings().deviceId===B.deviceId);b==null||b(N==null?void 0:N.label),t.current&&(t.current.srcObject=w,yield t.current.play())}catch(w){console.error("Failed to start camera:",w)}}),h=()=>A(this,null,function*(){const g=r==="user"?"environment":"user";c.current=!0;const b=r;try{n(g),i.current&&(i.current.getTracks().forEach(w=>w.stop()),i.current=null),yield u(g)}catch(w){n(b),c.current=!1;try{yield u(b)}catch(_){console.error("Failed to restore previous camera:",_)}}}),f=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),w="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",_=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||w||_,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:()=>A(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:_}=f();let I=null,D=null;try{const S=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});I=(g=S.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,S.getTracks().forEach(N=>N.stop())}catch(S){}try{const S=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});D=(b=S.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,S.getTracks().forEach(N=>N.stop())}catch(S){}if(!(I&&D&&I!==D)){s(!1);return}s(!_)}catch(w){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 Cf=Symbol.for("preact-signals");function tn(){if(jt>1)jt--;else{for(var e,t=!1;Cr!==void 0;){var i=Cr;for(Cr=void 0,la++;i!==void 0;){var r=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&v2(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=r}}if(la=0,jt--,t)throw e}}function Ef(e){if(jt>0)return e();jt++;try{return e()}finally{tn()}}var Z=void 0;function p2(e){var t=Z;Z=void 0;try{return e()}finally{Z=t}}var Cr=void 0,jt=0,la=0,rn=0;function m2(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=Cf,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:p2(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&&p2(function(){var n;(n=t.Z)==null||n.call(t)}))}},ke.prototype.subscribe=function(e){var t=this;return Er(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=m2(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(la>100)throw new Error("Cycle detected");this.v=e,this.i++,rn++,jt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{tn()}}}});function g2(e,t){return new ke(e,t)}function v2(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 b2(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 y2(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 ui(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}ui.prototype=new ke,ui.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&&!v2(this))return this.f&=-2,!0;var e=Z;try{b2(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,y2(this),this.f&=-2,!0},ui.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)},ui.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)}},ui.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(ui.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=m2(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ua(e,t){return new ui(e,t)}function _2(e){var t=e.u;if(e.u=void 0,typeof t=="function"){jt++;var i=Z;Z=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,da(e),r}finally{Z=i,tn()}}}function da(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,_2(e)}function xf(e){if(Z!==this)throw new Error("Out-of-order effect");y2(this),Z=e,this.f&=-2,8&this.f&&da(this),tn()}function Si(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Si.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()}},Si.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_2(this),b2(this),jt++;var e=Z;return Z=this,xf.bind(this,e)},Si.prototype.N=function(){2&this.f||(this.f|=2,this.o=Cr,Cr=this)},Si.prototype.d=function(){this.f|=8,1&this.f||da(this)},Si.prototype.dispose=function(){this.d()};function Er(e){var t=new Si(e);try{t.c()}catch(r){throw t.d(),r}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var w2,nn,ha,C2=[];Er(function(){w2=this.N})();function Li(e,t){G[e]=t.bind(null,G[e]||function(){})}function on(e){ha&&ha(),ha=e&&e.S()}function E2(e){var t=this,i=e.data,r=he(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=ua(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),d=ua(function(){return!Array.isArray(l.value)&&!Ou(l.value)}),u=Er(function(){if(this.N=x2,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}E2.displayName="_st",Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:E2},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Li("__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)}),Li("__r",function(e,t){if(t.type!==Vt){on();var i,r=t.__c;r&&(r.__$f&=-2,(i=r.__$u)===void 0&&(r.__$u=i=function(n){var o;return Er(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),nn=r,on(i)}e(t)}),Li("__e",function(e,t,i,r){on(),nn=void 0,e(t,i,r)}),Li("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=kf(i,c,d,n),o[c]=l):l.o(d,n)}}}e(t)});function kf(e,t,i,r){var n=t in e&&e.ownerSVGElement===void 0,o=g2(i);return{o:function(s,a){o.value=s,r=a},d:Er(function(){this.N=x2;var s=o.value.value;r[t]!==s&&(r[t]=s,n?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}Li("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)}),Li("__h",function(e,t,i,r){(r<3||r===9)&&(t.__$f|=2),e(t,i,r)}),_r.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 he(e,t){return Qr(function(){return g2(e,t)},[])}function fa(e,t){var i=Ae(e);return i.current=e,nn.__$f|=4,Qr(function(){return ua(function(){return i.current()},t)},[])}var Af=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Sf(){Ef(function(){for(var e;e=C2.shift();)w2.call(e)})}function x2(){C2.push(this)===1&&(G.requestAnimationFrame||Af)(Sf)}var Ti=typeof self!="undefined"?self:{};function di(){throw Error("Invalid UTF8")}function k2(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let sn,pa;const Lf=typeof TextDecoder!="undefined";let Tf;const Mf=typeof TextEncoder!="undefined";function A2(e){if(Mf)e=(Tf||(Tf=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 ma,an;e:{for(var S2=["CLOSURE_FLAGS"],ga=Ti,va=0;va<S2.length;va++)if((ga=ga[S2[va]])==null){an=null;break e}an=ga}var xr,L2=an&&an[610401301];ma=L2!=null&&L2;const T2=Ti.navigator;function ba(e){return!!ma&&!!xr&&xr.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Ye(e){var t;return(t=Ti.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function zt(){return!!ma&&!!xr&&xr.brands.length>0}function ya(){return zt()?ba("Chromium"):(Ye("Chrome")||Ye("CriOS"))&&!(!zt()&&Ye("Edge"))||Ye("Silk")}function cn(e){return cn[" "](e),e}xr=T2&&T2.userAgentData||null,cn[" "]=function(){};var If=!zt()&&(Ye("Trident")||Ye("MSIE"));!Ye("Android")||ya(),ya(),Ye("Safari")&&(ya()||!zt()&&Ye("Coast")||!zt()&&Ye("Opera")||!zt()&&Ye("Edge")||(zt()?ba("Microsoft Edge"):Ye("Edg/"))||zt()&&ba("Opera"));var M2={},kr=null;function Ff(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=kr[d];if(u!=null)return u;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}I2();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 I2(){if(!kr){kr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const r=e.concat(t[i].split(""));M2[i]=r;for(let n=0;n<r.length;n++){const o=r[n];kr[o]===void 0&&(kr[o]=n)}}}}var F2=typeof Uint8Array!="undefined",B2=!If&&typeof btoa=="function";function D2(e){if(!B2){var t;t===void 0&&(t=0),I2(),t=M2[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 R2=/[-_.]/g,Bf={"-":"+",_:"/",".":"="};function Df(e){return Bf[e]||""}function O2(e){if(!B2)return Ff(e);R2.test(e)&&(e=e.replace(R2,Df)),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 hi(e){return F2&&e!=null&&e instanceof Uint8Array}var Mi={};function fi(){return Rf||(Rf=new Mt(null,Mi))}function _a(e){P2(Mi);var t=e.g;return(t=t==null||hi(t)?t:typeof t=="string"?O2(t):null)==null?t:e.g=t}var Mt=class{h(){return new Uint8Array(_a(this)||0)}constructor(e,t){if(P2(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Rf,wa;function P2(e){if(e!==Mi)throw Error("illegal external caller")}function $2(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Ca(e){return $2(e=Error(e),"warning"),e}function Ea(e){if(e!=null){var t=wa!=null?wa:wa={},i=t[e]||0;i>=5||(t[e]=i+1,$2(e=Error(),"incident"),function(r){Ti.setTimeout(()=>{throw r},0)}(e))}}var ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Ii(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 Of=Ii("jas",void 0,!0),N2=Ii(void 0,"0di"),Ar=Ii(void 0,"1oa"),Fi=Ii(void 0,Symbol()),Pf=Ii(void 0,"0actk"),U2=Ii(void 0,"8utk");const L=ln?Of:"Ea",H2={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},q2=Object.defineProperties;function un(e,t){ln||L in e||q2(e,H2),e[L]|=t}function ve(e,t){ln||L in e||q2(e,H2),e[L]=t}function Bi(e){return un(e,34),e}function $f(e,t){ve(t,-15615&(0|e))}function xa(e,t){ve(t,-15581&(34|e))}function dn(){return typeof BigInt=="function"}function Re(e){return Array.prototype.slice.call(e)}var ka,Sr={};function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Aa(e,t){if(e!=null){if(typeof e=="string")e=e?new Mt(e,Mi):fi();else if(e.constructor!==Mt)if(hi(e))e=e.length?new Mt(new Uint8Array(e),Mi):fi();else{if(!t)throw Error();e=void 0}}return e}const V2=[];function Gt(e){if(2&e)throw Error()}ve(V2,55),ka=Object.freeze(V2);class j2{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 Sa(e){return Fi?e[Fi]:void 0}var Nf=Object.freeze({});function fn(e){return e.Na=!0,e}var Uf=fn(e=>typeof e=="number"),z2=fn(e=>typeof e=="string"),Hf=fn(e=>typeof e=="boolean"),pn=typeof Ti.BigInt=="function"&&typeof Ti.BigInt(0)=="bigint";function Zt(e){var t=e;if(z2(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Uf(t)&&!Number.isSafeInteger(t))throw Error(String(t));return pn?BigInt(e):e=Hf(e)?e?"1":"0":z2(e)?e.trim()||"0":String(e)}var La=fn(e=>pn?e>=Vf&&e<=zf:e[0]==="-"?G2(e,qf):G2(e,jf));const qf=Number.MIN_SAFE_INTEGER.toString(),Vf=pn?BigInt(Number.MIN_SAFE_INTEGER):void 0,jf=Number.MAX_SAFE_INTEGER.toString(),zf=pn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function G2(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 Gf=typeof Uint8Array.prototype.slice=="function";let Z2,Y=0,le=0;function W2(e){const t=e>>>0;Y=t,le=(e-t)/4294967296>>>0}function pi(e){if(e<0){W2(-e);const[t,i]=Fa(Y,le);Y=t>>>0,le=i>>>0}else W2(e)}function Ta(e){const t=Z2||(Z2=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),le=0,Y=t.getUint32(0,!0)}function Ma(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:Lr(e,t)}function Ia(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Ma(e,t))=="number"?i?-e:e:i?"-"+e:e}function Lr(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+X2(i)+X2(e));return i}function X2(e){return e=String(e),"0000000".slice(e.length)+e}function K2(){var e=Y,t=le;if(2147483648&t)if(dn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,r]=Fa(e,t);e="-"+Lr(i,r)}else e=Lr(e,t);return e}function mn(e){if(e.length<16)pi(Number(e));else if(dn())e=BigInt(e),Y=Number(e&BigInt(4294967295))>>>0,le=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");le=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));le*=1e6,Y=1e6*Y+o,Y>=4294967296&&(le+=Math.trunc(Y/4294967296),le>>>=0,Y>>>=0)}if(t){const[r,n]=Fa(Y,le);Y=r,le=n}}}function Fa(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Tr=typeof BigInt=="function"?BigInt.asIntN:void 0,Zf=typeof BigInt=="function"?BigInt.asUintN:void 0,Wt=Number.isSafeInteger,gn=Number.isFinite,Di=Math.trunc,Wf=Zt(0);function Xt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Y2(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Xf=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Mr(e){switch(typeof e){case"bigint":return!0;case"number":return gn(e);case"string":return Xf.test(e);default:return!1}}function Ri(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 J2(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 Q2(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function ed(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 td(e){return ed(e)?e:(mn(e),K2())}function Ba(e){return e=Di(e),Wt(e)||(pi(e),e=Ia(Y,le)),e}function id(e){var t=Di(Number(e));return Wt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),td(e))}function rd(e){var t=Di(Number(e));return Wt(t)?Zt(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),dn()?Zt(Tr(64,BigInt(e))):Zt(td(e)))}function nd(e){if(Wt(e))e=Zt(Ba(e));else{if(e=Di(e),Wt(e))e=String(e);else{const t=String(e);ed(t)?e=t:(pi(e),e=K2())}e=Zt(e)}return e}function Da(e){return e==null?e:typeof e=="bigint"?(La(e)?e=Number(e):(e=Tr(64,e),e=La(e)?Number(e):String(e)),e):Mr(e)?typeof e=="number"?Ba(e):id(e):void 0}function Kf(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Zf(64,e));if(Mr(e)){if(t==="string")return t=Di(Number(e)),Wt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Q2(e)||(mn(e),e=Lr(Y,le))),e;if(t==="number")return(e=Di(e))>=0&&Wt(e)?e:function(i){if(i<0){pi(i);var r=Lr(Y,le);return i=Number(r),Wt(i)?i:r}return Q2(r=String(i))?r:(pi(i),Ma(Y,le))}(e)}}function od(e){if(typeof e!="string")throw Error();return e}function Oi(e){if(e!=null&&typeof e!="string")throw Error();return e}function Pi(e){return e==null||typeof e=="string"?e:void 0}function Ra(e,t,i,r){if(e!=null&&typeof e=="object"&&e.W===Sr)return e;if(!Array.isArray(e))return i?2&r?((e=t[N2])||(Bi((e=new t).u),e=t[N2]=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&&ve(e,n),new t(e)}function Yf(e,t,i){if(t)e:{if(!Mr(t=e))throw Ca("int64");switch(typeof t){case"string":t=rd(t);break e;case"bigint":t=Zt(Tr(64,t));break e;default:t=nd(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?Zt(Tr(64,t)):Mr(t)?e==="string"?rd(t):nd(t):void 0;return(e=t)==null?i?Wf:void 0:e}function Jf(e){return e}const Qf={};let ep=function(){try{return cn(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class Oa{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 tp=ep?(Object.setPrototypeOf(Oa.prototype,Map.prototype),Object.defineProperties(Oa.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Oa):class extends Map{constructor(){super()}};function sd(e){return e}function Pa(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var yt=class extends tp{constructor(e,t,i=sd,r=sd){super();let n=0|e[L];n|=64,ve(e,n),this.M=n,this.I=t,this.S=i,this.X=this.I?ip: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=ap;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=rp){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(){Pa(this),super.clear()}delete(e){return Pa(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new j2(e,np,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new j2(e,yt.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 Pa(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 ip(e,t,i,r,n,o){return e=Ra(e,r,i,o),n&&(e=_n(e)),e}function rp(e){return e}function np(e){return[e,this.get(e)]}let op,vn,ad,sp;function cd(){return op||(op=new yt(Bi([]),void 0,void 0,void 0,Qf))}function $a(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=Re(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=$a(l[v],d,u,h,f);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=$a(r[p],t,i,s,n);r[p]=l,l!=null&&(a=p+1)}return a<c&&(r.length=a),i&&((e=Sa(e))&&(r[Fi]=Re(e)),i(o,r)),r}function ap(e){return $a(e,Na,void 0,void 0,!1)}function Na(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return La(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(hi(e))return hi(e)&&Ea(U2),D2(e);if(e.W===Sr)return ld(e);if(e instanceof Mt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=D2(t)}return e instanceof yt?e.La():void 0}return e}function ld(e){var t=e.u;e=bn(t,Na,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:Jf)(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 Kt(e,t,i){return e=ud(e,t[0],t[1],i?1:2),t!==ad&&i&&un(e,8192),e}function ud(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||Ea(Pf),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 ve(e,n),e}function Ua(e,t,i=xa){if(e!=null){if(F2&&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?(ve(e,34|r),4&r&&Object.freeze(e),e):bn(e,Ua,4&r?xa:i,!0,!0))}return e.W===Sr?e=2&(r=0|(i=e.u)[L])?e:new e.constructor(yn(i,r,!0)):e instanceof yt&&!(2&e.M)&&(i=Bi(e.da(Ua)),e=new yt(i,e.I,e.S,e.X)),e}}function yn(e,t,i){const r=i||2&t?xa:$f,n=!!(32&t);return e=function(o,s,a){const c=Re(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=Sa(o))&&(c[Fi]=Re(o)),c}(e,t,o=>Ua(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 $i(e,t){return It(e=e.u,0|e[L],t)}function It(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 Gt(n),ae(r,n,t,i),e}function ae(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},ve(e,t|=256)):e[o]=r),t)}function wn(e,t){let i=0|(e=e.u)[L];const r=It(e,i,t),n=Xt(r);return n!=null&&n!==r&&ae(e,i,t,n),n}function dd(e){let t=0|(e=e.u)[L];const i=It(e,t,1),r=Aa(i,!0);return r!=null&&r!==i&&ae(e,t,1,r),r}function mi(){return Nf===void 0?2:4}function gi(e,t,i,r,n){const o=e.u,s=2&(e=0|o[L])?1:r;n=!!n;let a=0|(r=Ha(o,e,t))[L];if(!(4&a)){4&a&&(r=Re(r),a=Dt(a,e),e=ae(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=qa(a,e),i=-2049&(20|a),a=i&=-4097,ve(r,a),2&a&&Object.freeze(r)}return s===1||s===4&&32&a?Ft(a)||(n=a,a|=2,a!==n&&ve(r,a),Object.freeze(r)):(s===2&&Ft(a)&&(r=Re(r),a=Dt(a,e),a=Yt(a,e,n),ve(r,a),e=ae(o,e,t,r)),Ft(a)||(t=a,a=Yt(a,e,n),a!==t&&ve(r,a))),r}function Ha(e,t,i){return e=It(e,t,i),Array.isArray(e)?e:ka}function qa(e,t){return e===0&&(e=Dt(e,t)),1|e}function Ft(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function hd(e){e=Re(e);for(let t=0;t<e.length;t++){const i=e[t]=Re(e[t]);Array.isArray(i[1])&&(i[1]=Bi(i[1]))}return e}function Va(e,t,i,r){let n=0|(e=e.u)[L];Gt(n),ae(e,n,t,(r==="0"?Number(i)===0:i===r)?void 0:i)}function Ni(e,t,i,r){Gt(t);let n=Ha(e,t,i);const o=n!==ka;if(64&t||!(8192&t)||!o){const s=o?0|n[L]:0;let a=s;(!o||2&a||Ft(a)||4&a&&!(32&a))&&(n=Re(n),a=Dt(a,t),t=ae(e,t,i,n)),a=-13&qa(a,t),a=Yt(r?-17&a:16|a,t,!0),a!==s&&ve(n,a)}return n}function ja(e,t){var i=hh;return Ga(za(e=e.u),e,0|e[L],i)===t?t:-1}function za(e){var i;if(ln)return(i=e[Ar])!=null?i:e[Ar]=new Map;if(Ar in e)return e[Ar];const t=new Map;return Object.defineProperty(e,Ar,{value:t}),t}function fd(e,t,i,r){const n=za(e),o=Ga(n,e,t,i);return o!==r&&(o&&(t=ae(e,t,o)),n.set(i,r)),t}function Ga(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];It(t,i,s)!=null&&(n!==0&&(i=ae(t,i,n)),n=s)}return e.set(r,n),n}function Za(e,t,i){let r=0|e[L];const n=It(e,r,i);let o;if(n!=null&&n.W===Sr)return(t=_n(n))!==n&&ae(e,r,i,t),t.u;if(Array.isArray(n)){const s=0|n[L];o=2&s?Kt(yn(n,s,!1),t,!0):64&s?n:Kt(o,t,!0)}else o=Kt(void 0,t,!0);return o!==n&&ae(e,r,i,o),o}function pd(e,t,i){let r=0|(e=e.u)[L];const n=It(e,r,i);return(t=Ra(n,t,!1,r))!==n&&t!=null&&ae(e,r,i,t),t}function j(e,t,i){if((t=pd(e,t,i))==null)return t;let r=0|(e=e.u)[L];if(!(2&r)){const n=_n(t);n!==t&&ae(e,r,i,t=n)}return t}function md(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=Ha(e,t,r))[L];if(!(a=!!(4&l))){var d=n,u=t;const h=!!(2&(l=qa(l,t)));h&&(u|=2);let f=!h,p=!0,m=0,v=0;for(;m<d.length;m++){const g=Ra(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,ve(d,l=f?8|l:-9&l),h&&Object.freeze(d)}if(s&&!(8&l||!n.length&&(c===1||c===4&&32&l))){for(Ft(l)&&(n=Re(n),l=Dt(l,t),t=ae(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,ve(i,s=i.length?-17&s:16|s),l=s}return c===1||c===4&&32&l?Ft(l)||(t=l,(l|=!n.length||16&l&&(!a||32&l)?2:1024)!==t&&ve(n,l),Object.freeze(n)):(c===2&&Ft(l)&&(ve(n=Re(n),l=Yt(l=Dt(l,t),t,o)),t=ae(e,t,r,n)),Ft(l)||(r=l,(l=Yt(l,t,o))!==r&&ve(n,l))),n}function Bt(e,t,i){const r=0|e.u[L];return md(e,r,t,i,mi(),!1,!(2&r))}function M(e,t,i,r){return r==null&&(r=void 0),Q(e,i,r)}function Ir(e,t,i,r){r==null&&(r=void 0);e:{let n=0|(e=e.u)[L];if(Gt(n),r==null){const o=za(e);if(Ga(o,e,n,i)!==t)break e;o.set(i,0)}else n=fd(e,n,i,t);ae(e,n,t,r)}}function Dt(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Yt(e,t,i){return 32&t&&i||(e&=-33),e}function Cn(e,t,i){Gt(0|e.u[L]),gi(e,t,Pi,2,!0).push(od(i))}function En(e,t,i,r){const n=0|e.u[L];Gt(n),e=md(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 Je(e,t){return Ri($i(e,t))}function Qe(e,t){return Pi($i(e,t))}function fe(e,t){var i;return(i=wn(e,t))!=null?i:0}function Fr(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 _t(e,t,i){if(i!=null){if(typeof i!="number"||!gn(i))throw Ca("int32");i|=0}Q(e,t,i)}function k(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(Gt(a),i==null)ae(s,a,t);else{var r=e=0|i[L],n=Ft(e),o=n||Object.isFrozen(i);for(n||(e=0),o||(i=Re(i),r=0,e=Yt(e=Dt(e,a),a,!0),o=!1),e|=21,n=0;n<i.length;n++){const c=i[n],l=od(c);Object.is(c,l)||(o&&(i=Re(i),r=0,e=Yt(e=Dt(e,a),a,!0),o=!1),i[n]=l)}e!==r&&(o&&(i=Re(i),e=Yt(e=Dt(e,a),a,!0)),ve(i,e)),ae(s,a,t,i)}}}function gd(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Wa(){return Error("Failed to read varint, encoding is invalid.")}function vd(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function Xa(e){if(typeof e=="string")return{buffer:O2(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===Mt)return{buffer:_a(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 Ka(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(vi(e,a),i<128)return t(r>>>0,n>>>0);throw Wa()}function Ya(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 vi(e,i),!!(127&t)}throw Wa()}function Jt(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 Wa();return vi(e,i),n}function Rt(e){return Jt(e)>>>0}function Ja(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],vi(e,e.g+4),(r<<0|n<<8|o<<16|t<<24)>>>0}function Qa(e){var t=Ja(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 cp(e){return Jt(e)}function ec(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=Xa(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function vi(e,t){if(e.g=t,t>e.l)throw vd(e.l,t)}function bd(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 vd(t,e.l-i);return e.g=r,i}function yd(e,t){if(t==0)return fi();var i=bd(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):Gf?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?fi():new Mt(i,Mi)}yt.prototype.toJSON=void 0;var _d=[];function wd(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Rt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw gd(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):Ya(e.g);break;case 1:vi(e=e.g,e.g+8);break;case 2:if(e.h!=2)kn(e);else{var t=Rt(e.g);vi(e=e.g,e.g+t)}break;case 5:vi(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!wd(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 gd(e.h,e.l)}}function Br(e,t,i){const r=e.g.l,n=Rt(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 tc(e){var t=Rt(e.g),i=bd(e=e.g,t);if(e=e.h,Lf){var r,n=e;(r=pa)||(r=pa=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&&(pa=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?di():(a=e[o++],s<194||(192&a)!=128?(o--,di()):i.push((31&s)<<6|63&a)):s<240?o>=t-1?di():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(r=e[o++]))!=128?(o--,di()):i.push((15&s)<<12|(63&a)<<6|63&r)):s<=244?o>=t-2?di():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(r=e[o++]))!=128||(192&(n=e[o++]))!=128?(o--,di()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&n,s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))):di(),i.length>=8192&&(c=k2(c,i),i.length=0)}o=k2(c,i)}return o}function Cd(e){const t=Rt(e.g);return yd(e.g,t)}function An(e,t,i){var r=Rt(e.g);for(r=e.g.g+r;e.g.g<r;)i.push(t(e.g))}var Sn=[];function ft(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var x=class{constructor(e,t){this.u=ud(e,t)}toJSON(){try{var e=ld(this)}finally{vn=void 0}return e}l(){var e=jp;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 Ed(e){return e?/^\d+$/.test(e)?(mn(e),new ic(Y,le)):null:lp||(lp=new ic(0,0))}x.prototype.W=Sr,x.prototype.toString=function(){return this.u.toString()};var ic=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let lp;function xd(e){return e?/^-?\d+$/.test(e)?(mn(e),new rc(Y,le)):null:up||(up=new rc(0,0))}var rc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let up;function Ui(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 Dr(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 qi(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ne(e,t,i){Hi(e.g,8*t+i)}function nc(e,t){return Ne(e,t,2),t=e.g.end(),qi(e,t),t.push(e.h),t}function oc(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){Ne(e,t,2),Hi(e.g,i.length),qi(e,e.g.end()),qi(e,i)}function Mn(e,t,i,r){i!=null&&(t=nc(e,t),r(i,e),oc(e,t))}function pt(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var sc=pt(),kd=pt(),ac=pt(),cc=pt(),Ad=pt(),Sd=pt(),lc=pt(),Ld=pt(),Td=pt(),Vi=class{constructor(e,t,i){this.g=e,this.h=t,e=sc,this.l=!!e&&i===e||!1}};function In(e,t){return new Vi(e,t,sc)}function Md(e,t,i,r,n){Mn(e,i,Dd(t,r),n)}const dp=In(function(e,t,i,r,n){return e.h===2&&(Br(e,Za(t,r,i),n),!0)},Md),hp=In(function(e,t,i,r,n){return e.h===2&&(Br(e,Za(t,r,i),n),!0)},Md);var Fn=Symbol(),uc=Symbol(),Id=Symbol(),Fd=Symbol();let Bn,Dn;function bi(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 ad||(ad=[0,void 0,!0]);case"number":return u>0?void 0:u===0?sp||(sp=[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 Vi?u=o:(u=dp,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 Bd(e){return Array.isArray(e)?e[0]instanceof Vi?e:[hp,e]:[e,void 0]}function Dd(e,t){return e instanceof x?e.u:Array.isArray(e)?Kt(e,t,!1):void 0}function dc(e,t,i,r){const n=i.g;e[t]=r?(o,s,a)=>n(o,s,a,r):n}function hc(e,t,i,r,n){const o=i.g;let s,a;e[t]=(c,l,d)=>o(c,l,d,a||(a=bi(uc,dc,hc,r).T),s||(s=fc(r)),n)}function fc(e){let t=e[Id];if(t!=null)return t;const i=bi(uc,dc,hc,e);return t=i.la?(r,n)=>Bn(r,n,i):(r,n)=>{const o=0|r[L];for(;wd(n)&&n.h!=4;){var s=n.m,a=i[s];if(a==null){var c=i.ga;c&&(c=c[s])&&(c=fp(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=yd(a.g,c)),s=r,a&&((c=s[Fi])?c.push(a):s[Fi]=[a]))}return 8192&o&&Bi(r),!0},e[Id]=t}function fp(e){const t=(e=Bd(e))[0].g;if(e=e[1]){const i=fc(e),r=bi(uc,dc,hc,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=bi(Fn,Rn,On,r).T),n||(n=Rd(r)))}function Rd(e){let t=e[Fd];if(!t){const i=bi(Fn,Rn,On,e);t=(r,n)=>Od(r,n,i),e[Fd]=t}return t}function Od(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=Bd(c))[0].h;if(c=c[1]){const d=Rd(c),u=bi(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=Sa(e))&&function(r,n){qi(r,r.g.end());for(let o=0;o<n.length;o++)qi(r,_a(n[o])||new Uint8Array(0))}(t,e)}function ji(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),ve(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Te(e,t,i){return new Vi(e,t,i)}function zi(e,t,i){return new Vi(e,t,i)}function Me(e,t,i){ae(e,0|e[L],t,i)}var pp=In(function(e,t,i,r,n){return e.h===2&&(e=Br(e,Kt([void 0,void 0],r,!0),n),Gt(r=0|t[L]),(n=It(t,r,i))instanceof yt?(2&n.M)!=0?((n=n.da()).push(e),ae(t,r,i,n)):n.Ja(e):Array.isArray(n)?(2&(0|n[L])&&ae(t,r,i,n=hd(n)),n.push(e)):ae(t,r,i,[e]),!0)},function(e,t,i,r,n){if(t instanceof yt)t.forEach((o,s)=>{Mn(e,i,Kt([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,Kt(s,r,!1),n)}});function Pd(e,t,i){if(t=function(r){if(r==null)return r;const n=typeof r;if(n==="bigint")return String(Tr(64,r));if(Mr(r)){if(n==="string")return id(r);if(n==="number")return Ba(r)}}(t),t!=null&&(typeof t=="string"&&xd(t),t!=null))switch(Ne(e,i,0),typeof t){case"number":e=e.g,pi(t),Ui(e,Y,le);break;case"bigint":i=BigInt.asUintN(64,t),i=new rc(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ui(e.g,i.h,i.g);break;default:i=xd(t),Ui(e.g,i.h,i.g)}}function $d(e,t,i){(t=Ri(t))!=null&&t!=null&&(Ne(e,i,0),Ln(e.g,t))}function Nd(e,t,i){(t=Y2(t))!=null&&(Ne(e,i,0),e.g.g.push(t?1:0))}function Ud(e,t,i){(t=Pi(t))!=null&&Tn(e,i,A2(t))}function Hd(e,t,i,r,n){Mn(e,i,Dd(t,r),n)}function qd(e,t,i){t==null||typeof t=="string"||t instanceof Mt||(hi(t)?hi(t)&&Ea(U2):t=void 0),t!=null&&Tn(e,i,Xa(t).buffer)}function Vd(e,t,i){return(e.h===5||e.h===2)&&(t=Ni(t,0|t[L],i,!1),e.h==2?An(e,Qa,t):t.push(Qa(e.g)),!0)}var Ot=Te(function(e,t,i){if(e.h!==1)return!1;var r=e.g;e=Ja(r);const n=Ja(r);r=2*(n>>31)+1;const o=n>>>20&2047;return e=4294967296*(1048575&n)+e,Me(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=Xt(t))!=null&&(Ne(e,i,1),e=e.g,(i=Z2||(Z2=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),Y=i.getUint32(0,!0),le=i.getUint32(4,!0),Dr(e,Y),Dr(e,le))},pt()),be=Te(function(e,t,i){return e.h===5&&(Me(t,i,Qa(e.g)),!0)},function(e,t,i){(t=Xt(t))!=null&&(Ne(e,i,5),e=e.g,Ta(t),Dr(e,Y))},lc),mp=zi(Vd,function(e,t,i){if((t=ji(Xt,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(Ne(r,n,5),r=r.g,Ta(o),Dr(r,Y))}},lc),pc=zi(Vd,function(e,t,i){if((t=ji(Xt,t))!=null&&t.length){Ne(e,i,2),Hi(e.g,4*t.length);for(let r=0;r<t.length;r++)i=e.g,Ta(t[r]),Dr(i,Y)}},lc),Qt=Te(function(e,t,i){return e.h===0&&(Me(t,i,Ka(e.g,Ia)),!0)},Pd,Sd),mc=Te(function(e,t,i){return e.h===0&&(Me(t,i,(e=Ka(e.g,Ia))===0?void 0:e),!0)},Pd,Sd),gp=Te(function(e,t,i){return e.h===0&&(Me(t,i,Ka(e.g,Ma)),!0)},function(e,t,i){if((t=Kf(t))!=null&&(typeof t=="string"&&Ed(t),t!=null))switch(Ne(e,i,0),typeof t){case"number":e=e.g,pi(t),Ui(e,Y,le);break;case"bigint":i=BigInt.asUintN(64,t),i=new ic(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ui(e.g,i.h,i.g);break;default:i=Ed(t),Ui(e.g,i.h,i.g)}},pt()),ue=Te(function(e,t,i){return e.h===0&&(Me(t,i,Jt(e.g)),!0)},$d,cc),Pn=zi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Ni(t,0|t[L],i,!1),e.h==2?An(e,Jt,t):t.push(Jt(e.g)),!0)},function(e,t,i){if((t=ji(Ri,t))!=null&&t.length){i=nc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);oc(e,i)}},cc),Gi=Te(function(e,t,i){return e.h===0&&(Me(t,i,(e=Jt(e.g))===0?void 0:e),!0)},$d,cc),ne=Te(function(e,t,i){return e.h===0&&(Me(t,i,Ya(e.g)),!0)},Nd,kd),Zi=Te(function(e,t,i){return e.h===0&&(Me(t,i,(e=Ya(e.g))===!1?void 0:e),!0)},Nd,kd),Se=zi(function(e,t,i){return e.h===2&&(e=tc(e),Ni(t,0|t[L],i,!1).push(e),!0)},function(e,t,i){if((t=ji(Pi,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&Tn(r,n,A2(o))}},ac),ei=Te(function(e,t,i){return e.h===2&&(Me(t,i,(e=tc(e))===""?void 0:e),!0)},Ud,ac),W=Te(function(e,t,i){return e.h===2&&(Me(t,i,tc(e)),!0)},Ud,ac),_e=function(e,t,i=sc){return new Vi(e,t,i)}(function(e,t,i,r,n){return e.h===2&&(r=Kt(void 0,r,!0),Ni(t,0|t[L],i,!0).push(r),Br(e,r,n),!0)},function(e,t,i,r,n){if(Array.isArray(t))for(let o=0;o<t.length;o++)Hd(e,t[o],i,r,n)}),X=In(function(e,t,i,r,n,o){return e.h===2&&(fd(t,0|t[L],o,i),Br(e,t=Za(t,r,i),n),!0)},Hd),jd=Te(function(e,t,i){return e.h===2&&(Me(t,i,Cd(e)),!0)},qd,Ld),vp=zi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Ni(t,0|t[L],i,!1),e.h==2?An(e,Rt,t):t.push(Rt(e.g)),!0)},function(e,t,i){if((t=ji(J2,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(Ne(r,n,0),Hi(r.g,o))}},Ad),bp=Te(function(e,t,i){return e.h===0&&(Me(t,i,(e=Rt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=J2(t))!=null&&t!=null&&(Ne(e,i,0),Hi(e.g,t))},Ad),Ue=Te(function(e,t,i){return e.h===0&&(Me(t,i,Jt(e.g)),!0)},function(e,t,i){(t=Ri(t))!=null&&(t=parseInt(t,10),Ne(e,i,0),Ln(e.g,t))},Td);class yp{constructor(t,i){this.h=t,this.g=i,this.l=j,this.m=M,this.defaultValue=void 0}register(){cn(this)}}function mt(e,t){return new yp(e,t)}function ti(e,t){return(i,r)=>{if(Sn.length){const o=Sn.pop();o.o(r),ec(o.g,i,r),i=o}else i=new class{constructor(o,s){if(_d.length){const a=_d.pop();ec(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,ec(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;fc(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}}}};Od(this.u,t,bi(Fn,Rn,On,e)),qi(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 zd=class extends x{constructor(e){super(e)}},Gd=[0,ei,Te(function(e,t,i){return e.h===2&&(Me(t,i,(e=Cd(e))===fi()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof x){const r=t.Oa;return void(r&&(t=r(t),t!=null&&Tn(e,i,Xa(t).buffer)))}if(Array.isArray(t))return}qd(e,t,i)},Ld)];let gc,Zd=globalThis.trustedTypes;function Wd(e){gc===void 0&&(gc=function(){let i=null;if(!Zd)return i;try{const r=n=>n;i=Zd.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(r){}return i}());var t=gc;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function _p(e,...t){if(t.length===0)return Wd(e[0]);let i=e[0];for(let r=0;r<t.length;r++)i+=encodeURIComponent(t[r])+e[r+1];return Wd(i)}var Xd=[0,ue,Ue,ne,-1,Pn,Ue,-1],wp=class extends x{constructor(e){super(e)}},Kd=[0,ne,W,ne,Ue,-1,zi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Ni(t,0|t[L],i,!1),e.h==2?An(e,cp,t):t.push(Jt(e.g)),!0)},function(e,t,i){if((t=ji(Ri,t))!=null&&t.length){i=nc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);oc(e,i)}},Td),W,-1,[0,ne,-1],Ue,ne,-1],Yd=[0,W,-2],Jd=class extends x{constructor(e){super(e)}},Qd=[0],eh=[0,ue,ne,1,ne,-3],He=class extends x{constructor(e){super(e,2)}},ye={};ye[336783863]=[0,W,ne,-1,ue,[0,[1,2,3,4,5,6,7,8,9],X,Qd,X,Kd,X,Yd,X,eh,X,Xd,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,_e,[0,W,-1]],W];var th=[0,mc,-1,Zi,-3,mc,Pn,ei,Gi,mc,-1,Zi,Gi,Zi,-2,ei];function qe(e,t){Va(e,2,Oi(t),"")}function ee(e,t){Cn(e,3,t)}function V(e,t){Cn(e,4,t)}var Ie=class extends x{constructor(e){super(e,500)}o(e){return M(this,0,7,e)}},Rr=[-1,{}],ih=[0,W,1,Rr],rh=[0,W,Se,Rr];function Ve(e,t){En(e,1,Ie,t)}function ie(e,t){Cn(e,10,t)}function z(e,t){Cn(e,15,t)}var Oe=class extends x{constructor(e){super(e,500)}o(e){return M(this,0,1001,e)}},nh=[-500,_e,[-500,ei,-1,Se,-3,[-2,ye,ne],_e,Gd,Gi,-1,ih,rh,_e,[0,ei,Zi],ei,th,Gi,Se,987,Se],4,_e,[-500,W,-1,[-1,{}],998,W],_e,[-500,W,Se,-1,[-2,{},ne],997,Se,-1],Gi,_e,[-500,W,Se,Rr,998,Se],Se,Gi,ih,rh,_e,[0,ei,-1,Rr],Se,-2,th,ei,-1,Zi,[0,Zi,bp],978,Rr,_e,Gd];Oe.prototype.g=$n(nh);var Cp=ti(Oe,nh),Ep=class extends x{constructor(e){super(e)}},oh=class extends x{constructor(e){super(e)}g(){return Bt(this,Ep,1)}},sh=[0,_e,[0,ue,be,W,-1]],Nn=ti(oh,sh),xp=class extends x{constructor(e){super(e)}},kp=class extends x{constructor(e){super(e)}},vc=class extends x{constructor(e){super(e)}h(){return j(this,xp,2)}g(){return Bt(this,kp,5)}},ah=ti(class extends x{constructor(e){super(e)}},[0,Se,Pn,pc,[0,Ue,[0,ue,-3],[0,be,-3],[0,ue,-1,[0,_e,[0,ue,-2]]],_e,[0,be,-1,W,be]],W,-1,Qt,_e,[0,ue,be],Se,Qt]),ch=class extends x{constructor(e){super(e)}},Wi=ti(class extends x{constructor(e){super(e)}},[0,_e,[0,be,-4]]),lh=class extends x{constructor(e){super(e)}},Or=ti(class extends x{constructor(e){super(e)}},[0,_e,[0,be,-4]]),Ap=class extends x{constructor(e){super(e)}},Sp=[0,ue,-1,pc,Ue],uh=class extends x{constructor(e){super(e)}};uh.prototype.g=$n([0,be,-4,Qt]);var Lp=class extends x{constructor(e){super(e)}},Tp=ti(class extends x{constructor(e){super(e)}},[0,_e,[0,1,ue,W,sh],Qt]),dh=class extends x{constructor(e){super(e)}},Mp=class extends x{constructor(e){super(e)}ma(){const e=dd(this);return e==null?fi():e}},Ip=class extends x{constructor(e){super(e)}},hh=[1,2],Fp=ti(class extends x{constructor(e){super(e)}},[0,_e,[0,hh,X,[0,pc],X,[0,jd],ue,W],Qt]),bc=class extends x{constructor(e){super(e)}},fh=[0,W,ue,be,Se,-1],ph=class extends x{constructor(e){super(e)}},Bp=[0,ne,-1],mh=class extends x{constructor(e){super(e)}},Un=[1,2,3,4,5],Hn=class extends x{constructor(e){super(e)}g(){return dd(this)!=null}h(){return Qe(this,2)!=null}},oe=class extends x{constructor(e){super(e)}g(){var e;return(e=Y2($i(this,2)))!=null?e:!1}},gh=[0,jd,W,[0,ue,Qt,-1],[0,gp,Qt]],pe=[0,gh,ne,[0,Un,X,eh,X,Kd,X,Xd,X,Qd,X,Yd],Ue],qn=class extends x{constructor(e){super(e)}},yc=[0,pe,be,-1,ue],Dp=mt(502141897,qn);ye[502141897]=yc;var Rp=ti(class extends x{constructor(e){super(e)}},[0,[0,Ue,-1,mp,vp],Sp]),vh=class extends x{constructor(e){super(e)}},bh=class extends x{constructor(e){super(e)}},_c=[0,pe,be,[0,pe],ne],yh=[0,pe,yc,_c,be,[0,[0,gh]]],Op=mt(508968150,bh);ye[508968150]=yh,ye[508968149]=_c;var _h=class extends x{constructor(e){super(e)}},Pp=mt(513916220,_h);ye[513916220]=[0,pe,yh,ue];var Xi=class extends x{constructor(e){super(e)}h(){return j(this,bc,2)}g(){Q(this,2)}},wh=[0,pe,fh];ye[478825465]=wh;var $p=class extends x{constructor(e){super(e)}},Ch=class extends x{constructor(e){super(e)}},wc=class extends x{constructor(e){super(e)}},Cc=class extends x{constructor(e){super(e)}},Eh=class extends x{constructor(e){super(e)}},xh=[0,pe,[0,pe],wh,-1],kh=[0,pe,be,ue],Ec=[0,pe,be],Ah=[0,pe,kh,Ec,be],Np=mt(479097054,Eh);ye[479097054]=[0,pe,Ah,xh],ye[463370452]=xh,ye[464864288]=kh;var Up=mt(462713202,Cc);ye[462713202]=Ah,ye[474472470]=Ec;var Hp=class extends x{constructor(e){super(e)}},Sh=class extends x{constructor(e){super(e)}},Lh=class extends x{constructor(e){super(e)}},Th=class extends x{constructor(e){super(e)}},xc=[0,pe,be,-1,ue],kc=[0,pe,be,ne];Th.prototype.g=$n([0,pe,Ec,[0,pe],yc,_c,xc,kc]);var Mh=class extends x{constructor(e){super(e)}},qp=mt(456383383,Mh);ye[456383383]=[0,pe,fh];var Ih=class extends x{constructor(e){super(e)}},Vp=mt(476348187,Ih);ye[476348187]=[0,pe,Bp];var Fh=class extends x{constructor(e){super(e)}},Bh=class extends x{constructor(e){super(e)}},Dh=[0,Ue,-1],jp=mt(458105876,class extends x{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=Bh;const a=2&n;let c=!1;if(o==null){if(a)return cd();o=[]}else if(o.constructor===yt){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 cd();c||(c=!0,Bi(o))}else c&&(c=!1,o=hd(o));return c||(64&(0|o[L])?o[L]&=-33:32&n&&un(o,32)),ae(r,n,2,s=new yt(o,s,Yf,void 0)),s}(e,t,It(e,t,2)),!i&&Bh&&(e.pa=!0),e}});ye[458105876]=[0,Dh,pp,[!0,Qt,[0,W,-1,Se]]];var Ac=class extends x{constructor(e){super(e)}},Rh=mt(458105758,Ac);ye[458105758]=[0,pe,W,Dh];var Oh=class extends x{constructor(e){super(e)}},zp=mt(443442058,Oh);ye[443442058]=[0,pe,W,ue,be,Se,-1,ne,be],ye[514774813]=xc;var Ph=class extends x{constructor(e){super(e)}},Gp=mt(516587230,Ph);function Sc(e,t){return t=t?t.clone():new bc,e.displayNamesLocale!==void 0?Q(t,1,Oi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Q(t,1),e.maxResults!==void 0?_t(t,2,e.maxResults):"maxResults"in e&&Q(t,2),e.scoreThreshold!==void 0?k(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 Lc(e,t=-1,i=""){return{categories:e.map(r=>{var n,o,s,a,c,l,d;return{index:(o=(n=Je(r,1))!=null?n:0)!=null?o:-1,score:(s=fe(r,2))!=null?s:0,categoryName:(c=(a=Qe(r,3))!=null?a:"")!=null?c:"",displayName:(d=(l=Qe(r,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function $h(e){var s,a,c,l,d,u,h,f,p,m,v,g,b;var t=gi(e,3,Xt,mi()),i=gi(e,2,Ri,mi()),r=gi(e,1,Pi,mi()),n=gi(e,9,Pi,mi());const o={categories:[],keypoints:[]};for(let w=0;w<t.length;w++)o.categories.push({score:t[w],index:(s=i[w])!=null?s:-1,categoryName:(a=r[w])!=null?a:"",displayName:(c=n[w])!=null?c:""});if((t=(l=j(e,vc,4))==null?void 0:l.h())&&(o.boundingBox={originX:(d=Je(t,1))!=null?d:0,originY:(u=Je(t,2))!=null?u:0,width:(h=Je(t,3))!=null?h:0,height:(f=Je(t,4))!=null?f:0,angle:0}),(p=j(e,vc,4))==null?void 0:p.g().length)for(const w of j(e,vc,4).g())o.keypoints.push({x:(m=wn(w,1))!=null?m:0,y:(v=wn(w,2))!=null?v:0,score:(g=wn(w,4))!=null?g:0,label:(b=Qe(w,3))!=null?b:""});return o}function Vn(e){var i,r,n,o;const t=[];for(const s of Bt(e,lh,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 Pr(e){var i,r,n,o;const t=[];for(const s of Bt(e,ch,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 Nh(e){return Array.from(e,t=>t>127?t-256:t)}function Uh(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;ye[516587230]=[0,pe,xc,kc,be],ye[518928384]=kc;const Zp=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 Hh(){return A(this,null,function*(){if(jn===void 0)try{yield WebAssembly.instantiate(Zp),jn=!0}catch(e){jn=!1}return jn})}function $r(i){return A(this,arguments,function*(e,t=_p``){const r=(yield Hh())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}})}var yi=class{};function qh(){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 Vh(e){return A(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 jh(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 zh(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]=jh(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 Gh(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 wt(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function ii(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)}}yi.forVisionTasks=function(e){return $r("vision",e)},yi.forTextTasks=function(e){return $r("text",e)},yi.forGenAiExperimentalTasks=function(e){return $r("genai_experimental",e)},yi.forGenAiTasks=function(e){return $r("genai",e)},yi.forAudioTasks=function(e){return $r("audio",e)},yi.isSimdSupported=function(){return Hh()};function Wp(e,t,i,r){return A(this,null,function*(){return e=yield((n,o,s,a,c)=>A(this,null,function*(){if(o&&(yield Vh(o)),!self.ModuleFactory||s&&(yield Vh(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 Tc(e,t){const i=j(e.baseOptions,Hn,1)||new Hn;typeof t=="string"?(Q(i,2,Oi(t)),Q(i,1)):t instanceof Uint8Array&&(Q(i,1,Aa(t,!1)),Q(i,2)),M(e.baseOptions,0,1,i)}function Zh(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 C(e,t){e.B=Math.max(e.B,t)}function zn(e,t){e.A=new Ie,qe(e.A,"PassThroughCalculator"),ee(e.A,"free_memory"),V(e.A,"free_memory_unused_out"),ie(t,"free_memory"),Ve(t,e.A)}function Ki(e,t){ee(e.A,t),V(e.A,t+"_unused_out")}function Gn(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Mc=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=j(this.baseOptions,Hn,1))!=null&&n.g()||(o=j(this.baseOptions,Hn,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=j(l.baseOptions,mh,3);if(!u){var h=u=new mh,f=new Jd;Ir(h,4,Un,f)}"delegate"in d&&(d.delegate==="GPU"?(d=u,h=new wp,Ir(d,2,Un,h)):(d=u,h=new Jd,Ir(d,4,Un,h))),M(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),Tc(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Tc(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return A(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=>{Tc(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Cp(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,Zh(this)}finishProcessing(){this.g.finishProcessing(),Zh(this)}close(){this.A=void 0,this.g.closeGraph()}};function Fe(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Mc.prototype.close=Mc.prototype.close;class Xp{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 Wh(e,t,i){const r=e.g;if(i=Fe(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 Xh(e,t){const i=e.g,r=Fe(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(r);const n=Fe(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=Fe(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 Xp(i,r,n,o)}function Ic(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Nr(e,t,i,r){return Ic(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=Xh(e,!0)),i=e.s):(e.v||(e.v=Xh(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=r(),i.g.bindVertexArray(null),e}function ri(e,t,i){return Ic(e,t),e=Fe(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){Ic(e,t),e.A||(e.A=Fe(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 Fc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Yi=class{G(){return`
|
|
3104
3104
|
precision mediump float;
|
|
3105
3105
|
varying vec2 vTex;
|
|
3106
3106
|
uniform sampler2D inputTexture;
|
|
3107
3107
|
void main() {
|
|
3108
3108
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
3109
3109
|
}
|
|
3110
|
-
`}m(){const e=this.g;if(this.h=
|
|
3110
|
+
`}m(){const e=this.g;if(this.h=Fe(e.createProgram(),"Failed to create WebGL program"),this.Z=Wh(this,`
|
|
3111
3111
|
attribute vec2 aVertex;
|
|
3112
3112
|
attribute vec2 aTex;
|
|
3113
3113
|
varying vec2 vTex;
|
|
3114
3114
|
void main(void) {
|
|
3115
3115
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
3116
3116
|
vTex = aTex;
|
|
3117
|
-
}`,e.VERTEX_SHADER),this.Y=
|
|
3117
|
+
}`,e.VERTEX_SHADER),this.Y=Wh(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()}},Kp=class extends Yi{G(){return`
|
|
3118
3118
|
precision mediump float;
|
|
3119
3119
|
uniform sampler2D backgroundTexture;
|
|
3120
3120
|
uniform sampler2D maskTexture;
|
|
@@ -3126,7 +3126,7 @@ ${this.hideAttribution?"":`
|
|
|
3126
3126
|
vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
|
|
3127
3127
|
gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
|
|
3128
3128
|
}
|
|
3129
|
-
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.B=
|
|
3129
|
+
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.B=ri(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=ri(this,e,e.NEAREST)}m(){super.m();const e=this.g;this.L=Fe(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=Fe(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=Fe(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()}},Yp=class extends Yi{G(){return`
|
|
3130
3130
|
precision mediump float;
|
|
3131
3131
|
uniform sampler2D maskTexture;
|
|
3132
3132
|
uniform sampler2D defaultTexture;
|
|
@@ -3140,7 +3140,7 @@ ${this.hideAttribution?"":`
|
|
|
3140
3140
|
overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
|
|
3141
3141
|
gl_FragColor = mix(defaultColor, overlayColor, confidence);
|
|
3142
3142
|
}
|
|
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:`
|
|
3143
|
+
`}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.j=ri(this,e),e.activeTexture(e.TEXTURE2),this.B=ri(this,e)}m(){super.m();const e=this.g;this.K=Fe(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Fe(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Fe(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 Pt(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 Bc(e){var t=Pt(e,1);if(!t){if(t=Pt(e,0))t=new Float32Array(t).map(r=>r/255);else{t=new Float32Array(e.width*e.height);const r=Ji(e);var i=Dc(e);if(Zn(i,r,Kh(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 Kh(e){let t=Pt(e,2);if(!t){const i=Ji(e);t=Jh(e);const r=Bc(e),n=Yh(e);i.texImage2D(i.TEXTURE_2D,0,n,e.width,e.height,0,i.RED,i.FLOAT,r),Rc(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=Fe(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Yh(e){if(e=Ji(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 Dc(e){return e.l||(e.l=new Yi),e.l}function Jh(e){const t=Ji(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Pt(e,2);return i||(i=ri(Dc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Rc(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Wn,we=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&&--Qh===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Pt(this,0)}ja(){return!!Pt(this,1)}R(){return!!Pt(this,2)}ia(){return(t=Pt(e=this,0))||(t=Bc(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return Bc(this)}N(){return Kh(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=Ji(this),n=Dc(this);r.activeTexture(r.TEXTURE1),i=ri(n,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,i);const o=Yh(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),Nr(n,r,!1,()=>{Jh(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Rc(this)}),Fc(n),Rc(this)}}e.push(i)}return new we(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ji(this).deleteTexture(Pt(this,2)),Qh=-1}};we.prototype.close=we.prototype.close,we.prototype.clone=we.prototype.clone,we.prototype.getAsWebGLTexture=we.prototype.N,we.prototype.getAsFloat32Array=we.prototype.ha,we.prototype.getAsUint8Array=we.prototype.ia,we.prototype.hasWebGLTexture=we.prototype.R,we.prototype.hasFloat32Array=we.prototype.ja,we.prototype.hasUint8Array=we.prototype.Da;var Qh=250;const Jp={color:"white",lineWidth:4,radius:6};function Oc(e){return De(or(De({},Jp),{fillColor:(e=e||{}).color}),e)}function $t(e,t){return e instanceof Function?e(t):e}function e0(e,t,i){return Math.max(Math.min(t,i),Math.min(Math.max(t,i),e))}function Ur(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 t0(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 Yi;const o=Hr(e);i((e=new we([n],t.m,!1,o.canvas,e.m,t.width,t.height)).N()),e.close()}}function i0(e,t,i,r){const n=function(a){return a.g||(a.g=new Kp),a.g}(e),o=Hr(e),s=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;Nr(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[w,_]=m.value;if(m=_,f!==w||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 r0(e,t,i,r){const n=Hr(e),o=function(c){return c.h||(c.h=new Yp),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;Nr(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 Be=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=Ur(this);t=Oc(t),i.save();var r=i.canvas,n=0;for(const o of e)i.fillStyle=$t(t.fillColor,{index:n,from:o}),i.strokeStyle=$t(t.color,{index:n,from:o}),i.lineWidth=$t(t.lineWidth,{index:n,from:o}),(e=new Path2D).arc(o.x*r.width,o.y*r.height,$t(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=Ur(this);i=Oc(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=$t(i.color,{index:o,from:t,to:a}),r.lineWidth=$t(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=Ur(this);t=Oc(t),i.save(),i.beginPath(),i.lineWidth=$t(t.lineWidth,{}),i.strokeStyle=$t(t.color,{}),i.fillStyle=$t(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);t0(r,n,c=>{i0(r,c,o,s),(c=Ur(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):i0(this,e.N(),i,t)}ua(e,t,i){this.l?function(r,n,o,s){const a=Hr(r);t0(r,n,c=>{r0(r,c,o,s),(c=Ur(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):r0(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 Ct(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 n0(e){var t=Ct(e,0);if(!t){t=Qi(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),Fc(i),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function Xn(e){let t=Ct(e,2);if(!t){const i=Qi(e);t=Yn(e);const r=Ct(e,1)||n0(e);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),qr(e)}return t}function Qi(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=Fe(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 Yi),e.l}function Yn(e){const t=Qi(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Ct(e,2);return i||(i=ri(Kn(e),t),e.g.push(i),e.m=!0),t.bindTexture(t.TEXTURE_2D,i),i}function qr(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function o0(e){const t=Qi(e);return Nr(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()}))}Be.prototype.close=Be.prototype.close,Be.prototype.drawConfidenceMask=Be.prototype.ua,Be.prototype.drawCategoryMask=Be.prototype.ta,Be.prototype.drawBoundingBox=Be.prototype.sa,Be.prototype.drawConnectors=Be.prototype.va,Be.prototype.drawLandmarks=Be.prototype.wa,Be.lerp=function(e,t,i,r,n){return e0(r*(1-(e-t)/(i-t))+n*(1-(i-e)/(i-t)),r,n)},Be.clamp=e0;var Ee=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)&&--s0===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!Ct(this,0)}ka(){return!!Ct(this,1)}R(){return!!Ct(this,2)}Aa(){return n0(this)}za(){var e=Ct(this,1);return e||(Xn(this),Yn(this),e=o0(this),qr(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=Qi(this),n=Kn(this);r.activeTexture(r.TEXTURE1),i=ri(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),Nr(n,r,!1,()=>{Yn(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),qr(this)}),Fc(n),qr(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Xn(this),Yn(this),i=o0(this),qr(this)}e.push(i)}return new Ee(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ct(this,1).close(),this.m&&Qi(this).deleteTexture(Ct(this,2)),s0=-1}};Ee.prototype.close=Ee.prototype.close,Ee.prototype.clone=Ee.prototype.clone,Ee.prototype.getAsWebGLTexture=Ee.prototype.N,Ee.prototype.getAsImageBitmap=Ee.prototype.za,Ee.prototype.getAsImageData=Ee.prototype.Aa,Ee.prototype.hasWebGLTexture=Ee.prototype.R,Ee.prototype.hasImageBitmap=Ee.prototype.ka,Ee.prototype.hasImageData=Ee.prototype.Ca;var s0=250;function gt(...e){return e.map(([t,i])=>({start:t,end:i}))}const Qp=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((a0=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:qh()?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 A(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){wt(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]=zh(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=>{Gh(this,Object.keys(e),n=>{Gh(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){wt(this,e,t),T(this,e,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(e,t){wt(this,e,t),T(this,e,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(e,t){wt(this,e,t),T(this,e,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(e,t){wt(this,e,t),T(this,e,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(e,t){wt(this,e,t),T(this,e,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(e,t){wt(this,e,t),T(this,e,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(e,t){ii(this,e,t),T(this,e,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(e,t,i){wt(this,e,t),T(this,e,r=>{this.i._attachProtoListener(r,i||!1)})}attachProtoVectorListener(e,t,i){ii(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?'),wt(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 a0{get ea(){return this.i}oa(e,t,i){T(this,t,r=>{const[n,o]=zh(this,e,r);this.ea._addBoundTextureAsImageToStream(r,n,o,i)})}V(e,t){wt(this,e,t),T(this,e,i=>{this.ea._attachImageListener(i)})}ba(e,t){ii(this,e,t),T(this,e,i=>{this.ea._attachImageVectorListener(i)})}}));var a0,et=class extends Qp{};function q(e,t,i){return A(this,null,function*(){var r;return function(n,o,s,a){return A(this,null,function*(){return Wp(n,o,s,a)})}(e,(r=i.canvas)!=null?r:qh()?void 0:document.createElement("canvas"),t,i)})}function c0(e,t,i,r){if(e.U){const o=new uh;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].");k(o,1,(n.left+n.right)/2),k(o,2,(n.top+n.bottom)/2),k(o,4,n.right-n.left),k(o,3,n.bottom-n.top)}else k(o,1,.5),k(o,2,.5),k(o,4,1),k(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(k(o,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[s,a]=jh(t);i=fe(o,3)*a/s,n=fe(o,4)*s/a,k(o,4,i),k(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 tt(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'.");c0(e,t,i,e.B+1)}function Et(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'.");c0(e,t,i,r)}function er(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 we([n],i,!1,e.g.i.canvas,e.P,o,t),r?e.clone():e}var Pe=class extends Mc{constructor(e,t,i,r){super(e),this.g=e,this.Z=t,this.U=i,this.na=r,this.P=new Yi}l(e,t=!0){if("runningMode"in e&&Fr(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()}};Pe.prototype.close=Pe.prototype.close;var it=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},M(e=this.h=new qn,0,1,t=new oe),k(this.h,2,.5),k(this.h,3,.3)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t,i;return"minDetectionConfidence"in e&&k(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&k(this.h,3,(i=e.minSuppressionThreshold)!=null?i:.3),this.l(e)}D(e,t){return this.j={detections:[]},tt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Et(this,e,i,t),this.j}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect_in"),z(e,"detections");const t=new He;ft(t,Dp,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect_in"),V(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=ah(o),this.j.detections.push($h(r));C(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{C(this,r)}),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 A(this,null,function*(){return q(it,e,{baseOptions:{modelAssetPath:t}})})},it.createFromModelBuffer=function(e,t){return q(it,e,{baseOptions:{modelAssetBuffer:t}})},it.createFromOptions=function(e,t){return q(it,e,t)};var Pc=gt([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]),$c=gt([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]),Nc=gt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),l0=gt([474,475],[475,476],[476,477],[477,474]),Uc=gt([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]),Hc=gt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),u0=gt([469,470],[470,471],[471,472],[472,469]),qc=gt([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]),d0=[...Pc,...$c,...Nc,...Uc,...Hc,...qc],h0=gt([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 f0(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var re=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,M(e=this.h=new bh,0,1,t=new oe),this.v=new vh,M(this.h,0,3,this.v),this.s=new qn,M(this.h,0,2,this.s),_t(this.s,4,1),k(this.s,2,.5),k(this.v,2,.5),k(this.h,4,.5)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t,i,r,n;return"numFaces"in e&&_t(this.s,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&k(this.s,2,(i=e.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&k(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minFacePresenceConfidence"in e&&k(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 f0(this),tt(this,e,t),this.j}F(e,t,i){return f0(this),Et(this,e,i,t),this.j}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"face_landmarks");const t=new He;ft(t,Op,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"NORM_LANDMARKS:face_landmarks"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("face_landmarks",(r,n)=>{for(const o of r)r=Or(o),this.j.faceLandmarks.push(Vn(r));C(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{C(this,r)}),this.outputFaceBlendshapes&&(z(e,"blendshapes"),V(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(Lc((o=r.g())!=null?o:[]));C(this,n)}),this.g.attachEmptyPacketListener("blendshapes",r=>{C(this,r)})),this.outputFacialTransformationMatrixes&&(z(e,"face_geometry"),V(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=j(Rp(d),Ap,2))&&this.j.facialTransformationMatrixes.push({rows:(s=(o=Je(r,1))!=null?o:0)!=null?s:0,columns:(c=(a=Je(r,2))!=null?a:0)!=null?c:0,data:(l=gi(r,3,Xt,mi()).slice())!=null?l:[]});C(this,n)}),this.g.attachEmptyPacketListener("face_geometry",r=>{C(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 q(re,e,{baseOptions:{modelAssetPath:t}})},re.createFromModelBuffer=function(e,t){return q(re,e,{baseOptions:{modelAssetBuffer:t}})},re.createFromOptions=function(e,t){return q(re,e,t)},re.FACE_LANDMARKS_LIPS=Pc,re.FACE_LANDMARKS_LEFT_EYE=$c,re.FACE_LANDMARKS_LEFT_EYEBROW=Nc,re.FACE_LANDMARKS_LEFT_IRIS=l0,re.FACE_LANDMARKS_RIGHT_EYE=Uc,re.FACE_LANDMARKS_RIGHT_EYEBROW=Hc,re.FACE_LANDMARKS_RIGHT_IRIS=u0,re.FACE_LANDMARKS_FACE_OVAL=qc,re.FACE_LANDMARKS_CONTOURS=d0,re.FACE_LANDMARKS_TESSELATION=h0;var xt=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!0),M(e=this.j=new _h,0,1,t=new oe)}get baseOptions(){return j(this.j,oe,1)}set baseOptions(e){M(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,tt(this,e,r!=null?r:{}),!this.h)return this.s}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"stylized_image");const t=new He;ft(t,Pp,this.j);const i=new Ie;qe(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"STYLIZED_IMAGE:stylized_image"),i.o(t),Ve(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 Ee([s],!1,!1,this.g.i.canvas,this.P,a,r),this.s=o=o?a.clone():a,this.h&&this.h(o),C(this,n)}),this.g.attachEmptyPacketListener("stylized_image",r=>{this.s=null,this.h&&this.h(null),C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.stylize=xt.prototype.Ka,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=function(e,t){return q(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return q(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return q(xt,e,t)};var Vc=gt([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 p0(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function m0(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 g0(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&&Je(u,1)!=null?(n=Je(u,1))!=null?n:0:-1,e.push({score:(o=fe(u,2))!=null?o:0,index:r,categoryName:(a=(s=Qe(u,3))!=null?s:"")!=null?a:"",displayName:(l=(c=Qe(u,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var je=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],M(e=this.j=new Eh,0,1,t=new oe),this.s=new Cc,M(this.j,0,2,this.s),this.C=new wc,M(this.s,0,3,this.C),this.v=new Ch,M(this.s,0,2,this.v),this.h=new $p,M(this.j,0,3,this.h),k(this.v,2,.5),k(this.s,4,.5),k(this.C,2,.5)}get baseOptions(){return j(this.j,oe,1)}set baseOptions(e){M(this.j,0,1,e)}o(e){var n,o,s,a,c,l,d,u;if(_t(this.v,3,(n=e.numHands)!=null?n:1),"minHandDetectionConfidence"in e&&k(this.v,2,(o=e.minHandDetectionConfidence)!=null?o:.5),"minTrackingConfidence"in e&&k(this.s,4,(s=e.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in e&&k(this.C,2,(a=e.minHandPresenceConfidence)!=null?a:.5),e.cannedGesturesClassifierOptions){var t=new Xi,i=t,r=Sc(e.cannedGesturesClassifierOptions,(c=j(this.h,Xi,3))==null?void 0:c.h());M(i,0,2,r),M(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=j(this.h,Xi,3))==null||l.g());return e.customGesturesClassifierOptions?(M(i=t=new Xi,0,2,r=Sc(e.customGesturesClassifierOptions,(d=j(this.h,Xi,4))==null?void 0:d.h())),M(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((u=j(this.h,Xi,4))==null||u.g()),this.l(e)}Fa(e,t){return p0(this),tt(this,e,t),m0(this)}Ga(e,t,i){return p0(this),Et(this,e,i,t),m0(this)}m(){var e=new Oe;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 He;ft(t,Np,this.j);const i=new Ie;qe(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"HAND_GESTURES:hand_gestures"),V(i,"LANDMARKS:hand_landmarks"),V(i,"WORLD_LANDMARKS:world_hand_landmarks"),V(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Or(l);const d=[];for(const u of Bt(r,lh,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)}C(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{C(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Wi(l);const d=[];for(const u of Bt(r,ch,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)}C(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{C(this,r)}),this.g.attachProtoVectorListener("hand_gestures",(r,n)=>{this.gestures.push(...g0(r,!1)),C(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",r=>{C(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{this.handedness.push(...g0(r)),C(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function v0(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 q(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return q(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return q(je,e,t)},je.HAND_CONNECTIONS=Vc;var ze=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],M(e=this.h=new Cc,0,1,t=new oe),this.s=new wc,M(this.h,0,3,this.s),this.j=new Ch,M(this.h,0,2,this.j),_t(this.j,3,1),k(this.j,2,.5),k(this.s,2,.5),k(this.h,4,.5)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t,i,r,n;return"numHands"in e&&_t(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&k(this.j,2,(i=e.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&k(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minHandPresenceConfidence"in e&&k(this.s,2,(n=e.minHandPresenceConfidence)!=null?n:.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],tt(this,e,t),v0(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Et(this,e,i,t),v0(this)}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"hand_landmarks"),z(e,"world_hand_landmarks"),z(e,"handedness");const t=new He;ft(t,Up,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"LANDMARKS:hand_landmarks"),V(i,"WORLD_LANDMARKS:world_hand_landmarks"),V(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{for(const o of r)r=Or(o),this.landmarks.push(Vn(r));C(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{C(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{for(const o of r)r=Wi(o),this.worldLandmarks.push(Pr(r));C(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{C(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=Je(g,1))!=null?l:0)!=null?d:-1,categoryName:(h=(u=Qe(g,3))!=null?u:"")!=null?h:"",displayName:(p=(f=Qe(g,4))!=null?f:"")!=null?p:""});a.push(v)}s.call(o,...a),C(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{C(this,r)}),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 q(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return q(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return q(ze,e,t)},ze.HAND_CONNECTIONS=Vc;var b0=gt([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 y0(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function _0(e){try{if(!e.C)return e.h;e.C(e.h)}finally{Gn(e)}}function Jn(e,t){e=Or(e),t.push(Vn(e))}var se=class extends Pe{constructor(e,t){super(new et(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,M(e=this.j=new Th,0,1,t=new oe),this.K=new wc,M(this.j,0,2,this.K),this.Y=new Hp,M(this.j,0,3,this.Y),this.s=new qn,M(this.j,0,4,this.s),this.H=new vh,M(this.j,0,5,this.H),this.v=new Sh,M(this.j,0,6,this.v),this.L=new Lh,M(this.j,0,7,this.L),k(this.s,2,.5),k(this.s,3,.3),k(this.H,2,.5),k(this.v,2,.5),k(this.v,3,.3),k(this.L,2,.5),k(this.K,2,.5)}get baseOptions(){return j(this.j,oe,1)}set baseOptions(e){M(this.j,0,1,e)}o(e){var t,i,r,n,o,s,a;return"minFaceDetectionConfidence"in e&&k(this.s,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&k(this.s,3,(i=e.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in e&&k(this.H,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&k(this.v,2,(n=e.minPoseDetectionConfidence)!=null?n:.5),"minPoseSuppressionThreshold"in e&&k(this.v,3,(o=e.minPoseSuppressionThreshold)!=null?o:.3),"minPosePresenceConfidence"in e&&k(this.L,2,(s=e.minPosePresenceConfidence)!=null?s:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&k(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,y0(this),tt(this,e,r),_0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:r,y0(this),Et(this,e,n,t),_0(this)}m(){var e=new Oe;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 He,i=new zd;Va(i,1,Oi("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,Na,void 0,void 0,!1));else{if(!(typeof o=="string"||o instanceof Mt||hi(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Va(n,2,Aa(o,!1),fi())}}(i,this.j.g());const r=new Ie;qe(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),En(r,8,zd,i),ee(r,"IMAGE:input_frames_image"),V(r,"POSE_LANDMARKS:pose_landmarks"),V(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),V(r,"FACE_LANDMARKS:face_landmarks"),V(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),V(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),V(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),V(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(t),Ve(e,r),zn(this,e),this.g.attachProtoListener("pose_landmarks",(n,o)=>{Jn(n,this.h.poseLandmarks),C(this,o)}),this.g.attachEmptyPacketListener("pose_landmarks",n=>{C(this,n)}),this.g.attachProtoListener("pose_world_landmarks",(n,o)=>{var s=this.h.poseWorldLandmarks;n=Wi(n),s.push(Pr(n)),C(this,o)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{C(this,n)}),this.outputPoseSegmentationMasks&&(V(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Ki(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(n,o)=>{this.h.poseSegmentationMasks=[er(this,n,!0,!this.C)],C(this,o)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",n=>{this.h.poseSegmentationMasks=[],C(this,n)})),this.g.attachProtoListener("face_landmarks",(n,o)=>{Jn(n,this.h.faceLandmarks),C(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{C(this,n)}),this.outputFaceBlendshapes&&(z(e,"extra_blendshapes"),V(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(Lc((a=n.g())!=null?a:[]))),C(this,o)}),this.g.attachEmptyPacketListener("extra_blendshapes",n=>{C(this,n)})),this.g.attachProtoListener("left_hand_landmarks",(n,o)=>{Jn(n,this.h.leftHandLandmarks),C(this,o)}),this.g.attachEmptyPacketListener("left_hand_landmarks",n=>{C(this,n)}),this.g.attachProtoListener("left_hand_world_landmarks",(n,o)=>{var s=this.h.leftHandWorldLandmarks;n=Wi(n),s.push(Pr(n)),C(this,o)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",n=>{C(this,n)}),this.g.attachProtoListener("right_hand_landmarks",(n,o)=>{Jn(n,this.h.rightHandLandmarks),C(this,o)}),this.g.attachEmptyPacketListener("right_hand_landmarks",n=>{C(this,n)}),this.g.attachProtoListener("right_hand_world_landmarks",(n,o)=>{var s=this.h.rightHandWorldLandmarks;n=Wi(n),s.push(Pr(n)),C(this,o)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",n=>{C(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 q(se,e,{baseOptions:{modelAssetPath:t}})},se.createFromModelBuffer=function(e,t){return q(se,e,{baseOptions:{modelAssetBuffer:t}})},se.createFromOptions=function(e,t){return q(se,e,t)},se.HAND_CONNECTIONS=Vc,se.POSE_CONNECTIONS=b0,se.FACE_LANDMARKS_LIPS=Pc,se.FACE_LANDMARKS_LEFT_EYE=$c,se.FACE_LANDMARKS_LEFT_EYEBROW=Nc,se.FACE_LANDMARKS_LEFT_IRIS=l0,se.FACE_LANDMARKS_RIGHT_EYE=Uc,se.FACE_LANDMARKS_RIGHT_EYEBROW=Hc,se.FACE_LANDMARKS_RIGHT_IRIS=u0,se.FACE_LANDMARKS_FACE_OVAL=qc,se.FACE_LANDMARKS_CONTOURS=d0,se.FACE_LANDMARKS_TESSELATION=h0;var rt=class extends Pe{constructor(e,t){super(new et(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},M(e=this.h=new Mh,0,1,t=new oe)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){return M(this.h,0,2,Sc(e,j(this.h,bc,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},tt(this,e,t),this.j}ra(e,t,i){return this.j={classifications:[]},Et(this,e,i,t),this.j}m(){var e=new Oe;ie(e,"input_image"),ie(e,"norm_rect"),z(e,"classifications");const t=new He;ft(t,qp,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),ee(i,"IMAGE:input_image"),ee(i,"NORM_RECT:norm_rect"),V(i,"CLASSIFICATIONS:classifications"),i.o(t),Ve(e,i),this.g.attachProtoListener("classifications",(r,n)=>{this.j=function(o){var a;const s={classifications:Bt(o,Lp,1).map(c=>{var l,d,u,h;return Lc((d=(l=j(c,oh,4))==null?void 0:l.g())!=null?d:[],(u=Je(c,2))!=null?u:0,(h=Qe(c,3))!=null?h:"")})};return Da($i(o,2))!=null&&(s.timestampMs=(a=Da($i(o,2)))!=null?a:0),s}(Tp(r)),C(this,n)}),this.g.attachEmptyPacketListener("classifications",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};rt.prototype.classifyForVideo=rt.prototype.ra,rt.prototype.classify=rt.prototype.qa,rt.prototype.setOptions=rt.prototype.o,rt.createFromModelPath=function(e,t){return q(rt,e,{baseOptions:{modelAssetPath:t}})},rt.createFromModelBuffer=function(e,t){return q(rt,e,{baseOptions:{modelAssetBuffer:t}})},rt.createFromOptions=function(e,t){return q(rt,e,t)};var Ge=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!0),this.h=new Ih,this.embeddings={embeddings:[]},M(e=this.h,0,1,t=new oe)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t=this.h,i=j(this.h,ph,2);return i=i?i.clone():new ph,e.l2Normalize!==void 0?Fr(i,1,e.l2Normalize):"l2Normalize"in e&&Q(i,1),e.quantize!==void 0?Fr(i,2,e.quantize):"quantize"in e&&Q(i,2),M(t,0,2,i),this.l(e)}xa(e,t){return tt(this,e,t),this.embeddings}ya(e,t,i){return Et(this,e,i,t),this.embeddings}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"embeddings_out");const t=new He;ft(t,Vp,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"EMBEDDINGS:embeddings_out"),i.o(t),Ve(e,i),this.g.attachProtoListener("embeddings_out",(r,n)=>{r=Fp(r),this.embeddings=function(o){var s;return{embeddings:Bt(o,Ip,1).map(a=>{var l,d,u,h,f,p,m;const c={headIndex:(d=(l=Je(a,3))!=null?l:0)!=null?d:-1,headName:(h=(u=Qe(a,4))!=null?u:"")!=null?h:""};if(pd(a,dh,ja(a,1))!==void 0)a=gi(a=j(a,dh,ja(a,1)),1,Xt,mi()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(p=(f=j(a,Mp,ja(a,2)))==null?void 0:f.ma())==null?void 0:p.h())!=null?m:v}return c}),timestampMs:(s=Da($i(o,2)))!=null?s:0}}(r),C(this,n)}),this.g.attachEmptyPacketListener("embeddings_out",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ge.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Uh(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Uh(Nh(e.quantizedEmbedding),Nh(t.quantizedEmbedding))}return e},Ge.prototype.embedForVideo=Ge.prototype.ya,Ge.prototype.embed=Ge.prototype.xa,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return q(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return q(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return q(Ge,e,t)};var jc=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 w0(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function C0(e){try{const t=new jc(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gn(e)}}jc.prototype.close=jc.prototype.close;var $e=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ac,this.v=new Fh,M(this.h,0,3,this.v),M(e=this.h,0,1,t=new oe)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t,i;return e.displayNamesLocale!==void 0?Q(this.h,2,Oi(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=Bt(e.ca(),Ie,1).filter(o=>{var s;return((s=Qe(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=j(t[0],He,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=Qe(o,1))!=null?a:""})})(this)}segment(e,t,i){const r=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,w0(this),tt(this,e,r),C0(this)}Ia(e,t,i,r){const n=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:r,w0(this),Et(this,e,n,t),C0(this)}Ba(){return this.s}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect");const t=new He;ft(t,Rh,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),i.o(t),Ve(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),V(i,"CONFIDENCE_MASKS:confidence_masks"),Ki(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>er(this,o,!0,!this.j)),C(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],C(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),V(i,"CATEGORY_MASK:category_mask"),Ki(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=er(this,r,!1,!this.j),C(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,C(this,r)})),z(e,"quality_scores"),V(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,C(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};$e.prototype.getLabels=$e.prototype.Ba,$e.prototype.segmentForVideo=$e.prototype.Ia,$e.prototype.segment=$e.prototype.segment,$e.prototype.setOptions=$e.prototype.o,$e.createFromModelPath=function(e,t){return q($e,e,{baseOptions:{modelAssetPath:t}})},$e.createFromModelBuffer=function(e,t){return q($e,e,{baseOptions:{modelAssetBuffer:t}})},$e.createFromOptions=function(e,t){return q($e,e,t)};var zc=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()}};zc.prototype.close=zc.prototype.close;var e5=class extends x{constructor(e){super(e)}},tr=[0,ue,-2],Qn=[0,Ot,-3,ne,Ot,-1],E0=[0,Qn],x0=[0,Qn,ue,-1],Gc=class extends x{constructor(e){super(e)}},k0=[0,Ot,-1,ne],t5=class extends x{constructor(e){super(e)}},A0=class extends x{constructor(e){super(e)}},Zc=[1,2,3,4,5,6,7,8,9,10,14,15],S0=class extends x{constructor(e){super(e)}};S0.prototype.g=$n([0,_e,[0,Zc,X,Qn,X,[0,Qn,tr],X,E0,X,[0,E0,tr],X,k0,X,[0,Ot,-3,ne,Ue],X,[0,Ot,-3,ne],X,[0,W,Ot,-2,ne,ue,ne,-1,2,Ot,tr],X,x0,X,[0,x0,tr],Ot,tr,W,X,[0,Ot,-3,ne,tr,-1],X,[0,_e,k0]],W,[0,W,ue,-1,ne]]);var kt=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ac,this.s=new Fh,M(this.h,0,3,this.s),M(e=this.h,0,1,t=new oe)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(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 S0;const o=new A0;var s=new e5;if(_t(s,1,255),M(o,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Gc;Fr(a,3,!0),k(a,1,t.keypoint.x),k(a,2,t.keypoint.y),Ir(o,5,Zc,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new t5,t.scribble))Fr(t=new Gc,3,!0),k(t,1,a.x),k(t,2,a.y),En(s,1,Gc,t);Ir(o,15,Zc,s)}En(r,1,A0,o),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",i),tt(this,e,n);e:{try{const l=new zc(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 Oe;ie(e,"image_in"),ie(e,"roi_in"),ie(e,"norm_rect_in");const t=new He;ft(t,Rh,this.h);const i=new Ie;qe(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),Ve(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),V(i,"CONFIDENCE_MASKS:confidence_masks"),Ki(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>er(this,o,!0,!this.j)),C(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],C(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),V(i,"CATEGORY_MASK:category_mask"),Ki(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=er(this,r,!1,!this.j),C(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,C(this,r)})),z(e,"quality_scores"),V(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,C(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};kt.prototype.segment=kt.prototype.segment,kt.prototype.setOptions=kt.prototype.o,kt.createFromModelPath=function(e,t){return q(kt,e,{baseOptions:{modelAssetPath:t}})},kt.createFromModelBuffer=function(e,t){return q(kt,e,{baseOptions:{modelAssetBuffer:t}})},kt.createFromOptions=function(e,t){return q(kt,e,t)};var nt=class extends Pe{constructor(e,t){super(new et(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},M(e=this.h=new Oh,0,1,t=new oe)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Q(this.h,2,Oi(e.displayNamesLocale)):"displayNamesLocale"in e&&Q(this.h,2),e.maxResults!==void 0?_t(this.h,3,e.maxResults):"maxResults"in e&&Q(this.h,3),e.scoreThreshold!==void 0?k(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:[]},tt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Et(this,e,i,t),this.j}m(){var e=new Oe;ie(e,"input_frame_gpu"),ie(e,"norm_rect"),z(e,"detections");const t=new He;ft(t,zp,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),ee(i,"IMAGE:input_frame_gpu"),ee(i,"NORM_RECT:norm_rect"),V(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=ah(o),this.j.detections.push($h(r));C(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{C(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 A(this,null,function*(){return q(nt,e,{baseOptions:{modelAssetPath:t}})})},nt.createFromModelBuffer=function(e,t){return q(nt,e,{baseOptions:{modelAssetBuffer:t}})},nt.createFromOptions=function(e,t){return q(nt,e,t)};var Wc=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 L0(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function T0(e){try{const t=new Wc(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gn(e)}}Wc.prototype.close=Wc.prototype.close;var Ze=class extends Pe{constructor(e,t){super(new et(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,M(e=this.h=new Ph,0,1,t=new oe),this.v=new Lh,M(this.h,0,3,this.v),this.j=new Sh,M(this.h,0,2,this.j),_t(this.j,4,1),k(this.j,2,.5),k(this.v,2,.5),k(this.h,4,.5)}get baseOptions(){return j(this.h,oe,1)}set baseOptions(e){M(this.h,0,1,e)}o(e){var t,i,r,n,o;return"numPoses"in e&&_t(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&k(this.j,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&k(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minPosePresenceConfidence"in e&&k(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,L0(this),tt(this,e,r),T0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:r,L0(this),Et(this,e,n,t),T0(this)}m(){var e=new Oe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"normalized_landmarks"),z(e,"world_landmarks"),z(e,"segmentation_masks");const t=new He;ft(t,Gp,this.h);const i=new Ie;qe(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),V(i,"NORM_LANDMARKS:normalized_landmarks"),V(i,"WORLD_LANDMARKS:world_landmarks"),i.o(t),Ve(e,i),zn(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(r,n)=>{this.landmarks=[];for(const o of r)r=Or(o),this.landmarks.push(Vn(r));C(this,n)}),this.g.attachEmptyPacketListener("normalized_landmarks",r=>{this.landmarks=[],C(this,r)}),this.g.attachProtoVectorListener("world_landmarks",(r,n)=>{this.worldLandmarks=[];for(const o of r)r=Wi(o),this.worldLandmarks.push(Pr(r));C(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",r=>{this.worldLandmarks=[],C(this,r)}),this.outputSegmentationMasks&&(V(i,"SEGMENTATION_MASK:segmentation_masks"),Ki(this,"segmentation_masks"),this.g.ba("segmentation_masks",(r,n)=>{this.segmentationMasks=r.map(o=>er(this,o,!0,!this.s)),C(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",r=>{this.segmentationMasks=[],C(this,r)})),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 q(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return q(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return q(Ze,e,t)},Ze.POSE_CONNECTIONS=b0;var Xc,M0;function i5(){if(M0)return Xc;M0=1;var e=si(),t=function(){return e.Date.now()};return Xc=t,Xc}var Kc,I0;function r5(){if(I0)return Kc;I0=1;var e=/\s/;function t(i){for(var r=i.length;r--&&e.test(i.charAt(r)););return r}return Kc=t,Kc}var Yc,F0;function n5(){if(F0)return Yc;F0=1;var e=r5(),t=/^\s+/;function i(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Yc=i,Yc}var Jc,B0;function o5(){if(B0)return Jc;B0=1;var e=cr(),t=Ei(),i="[object Symbol]";function r(n){return typeof n=="symbol"||t(n)&&e(n)==i}return Jc=r,Jc}var Qc,D0;function s5(){if(D0)return Qc;D0=1;var e=n5(),t=vt(),i=o5(),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 Qc=c,Qc}var el,R0;function a5(){if(R0)return el;R0=1;var e=vt(),t=i5(),i=s5(),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,w=!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,w="trailing"in l?!!l.trailing:w);function _(R){var ce=d,xe=u;return d=u=void 0,v=R,f=a.apply(xe,ce),f}function I(R){return v=R,p=setTimeout(S,c),g?_(R):f}function D(R){var ce=R-m,xe=R-v,at=c-ce;return b?o(at,h-xe):at}function $(R){var ce=R-m,xe=R-v;return m===void 0||ce>=c||ce<0||b&&xe>=h}function S(){var R=t();if($(R))return N(R);p=setTimeout(S,D(R))}function N(R){return p=void 0,w&&d?_(R):(d=u=void 0,f)}function B(){p!==void 0&&clearTimeout(p),v=0,d=m=u=p=void 0}function E(){return p===void 0?f:N(t())}function H(){var R=t(),ce=$(R);if(d=arguments,u=this,m=R,ce){if(p===void 0)return I(m);if(b)return clearTimeout(p),p=setTimeout(S,c),_(m)}return p===void 0&&(p=setTimeout(S,c)),f}return H.cancel=B,H.flush=E,H}return el=s,el}var tl,O0;function c5(){if(O0)return tl;O0=1;var e=a5(),t=vt(),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 tl=r,tl}var l5=c5();const u5=te(l5),d5=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)},h5=(e,t)=>{if(!e||e.length===0)return!1;const i=e[0];let r=1,n=0,o=1,s=0;i.forEach(H=>{r=Math.min(r,H.x),n=Math.max(n,H.x),o=Math.min(o,H.y),s=Math.max(s,H.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=((H,R)=>{const ce=(H-a)/m,xe=(R-c)/v;return ce*ce+xe*xe<=1})(h,f),w=.2,_=.1,I=d*(1+w),D=u*(1+_),$=(H,R)=>{const ce=(H-a)/I,xe=(R-c)/D;return ce*ce+xe*xe<=1},S=$(r,o),N=$(n,o),B=$(r,s),E=$(n,s);return b&&S&&N&&B&&E},f5=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},p5=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},P0=(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 Be(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})})},$0=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height)},m5=(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)},N0={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},eo={"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")},g5=["adreno-830","adreno-8xx","adreno-9xx","adreno-840","adreno-810"],U0=e=>e.toLowerCase().replace(/\(tm\)|\btm\b/g,"").replace(/[^a-z0-9]/g,""),H0=e=>{const t=U0(e);return g5.some(i=>{const r=U0(i);if(r.endsWith("xx")){const n=r.slice(0,-2);return new RegExp(`${n}\\d{2}`).test(t)}return t.includes(r)})},q0=()=>{try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t||!(t instanceof WebGLRenderingContext))return null;const i=t.getExtension("WEBGL_debug_renderer_info");return i?t.getParameter(i.UNMASKED_RENDERER_WEBGL):null}catch(e){return null}},v5=e=>{var i,r;const t=(r=(i=e!=null?e:q0())==null?void 0:i.toLowerCase())!=null?r:"";return t?H0(t):!1},b5=()=>A(this,null,function*(){if(typeof navigator=="undefined"||!navigator.userAgentData)return null;try{const e=yield navigator.userAgentData.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]);return JSON.stringify(e).toLowerCase()}catch(e){return console.warn("UA-CH architecture hints fetch failed.",e),null}}),y5=()=>A(this,null,function*(){const e=q0(),t=!!e;if(v5(e))return console.info(`[SmileID] Excluded GPU via WebGL: ${e}. Using CPU.`),"CPU";const i=yield b5(),r=!!i;return i&&H0(i)?(console.info("[SmileID] Excluded GPU via UA-CH hints. Using CPU."),"CPU"):!t&&!r?(console.info("[SmileID] No WebGL renderer or UA-CH hints available. Using CPU."),"CPU"):(console.info(`[SmileID] No excluded GPU detected. WebGL renderer: ${e!=null?e:"unavailable"}. Using GPU.`),"GPU")}),_5=()=>{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)},V0=()=>A(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=A(this,null,function*(){try{const t=yield yi.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),r=(yield y5())==="CPU"||!_5()?"CPU":"GPU",n=yield re.createFromOptions(t,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:r},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)}),Vr=pr.version,w5=({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=Ae(null),m=he(!1),v=he(!1),g=he("good"),b=he(16/9),w=he([]),_=he(0),I=he(0),D=he(0),$=he(0),S=he(""),N=he(!0),B=he(!1),E=he(!1),H=he(!1),R=he(0),ce=he([]),xe=he(null),at=he(1),We=he(0),W0=he(!1),ir=fa(()=>Math.floor(at.value*.4)),X0=fa(()=>Math.floor(at.value*.2)),K0=fa(()=>m.value&&v.value&&g.value==="good"),ol=K=>{var me;K&&eo[K]?S.value=(me=eo[K])==null?void 0:me.call(eo):S.value=""},ct=Ae(u5(K=>{ol(K)},600)).current,j5=1e4,sl=()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{K0.value||(B.value=!0)},j5)},z5=()=>A(this,null,function*(){var K,me;try{((K=window.__smileIdentityMediapipe)==null?void 0:K.loaded)&&((me=window.__smileIdentityMediapipe)==null?void 0:me.instance)||(N.value=!0,ol("initializing")),d.current=yield V0(),N.value=!1,sl()}catch(St){console.error("Failed to initialize MediaPipe:",St),N.value=!1,sl()}sl()}),G5=()=>{if(e.current&&t.current){const{videoWidth:K,videoHeight:me}=e.current;b.value=K/me,t.current.width=K,t.current.height=me,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},Z5=()=>{const K=We.value<X0.value,me=We.value>=ir.value;K?S.value=y("selfie.smart.status.capturing"):me?Date.now()-$.value>c?_.value>=n&&D.value<o?ct("open-mouth-smile"):ct("smile-required"):S.value=y("selfie.smart.status.keepSmiling"):ct(null)},W5=()=>{N.value?ol("initializing"):m.value?g.value==="too-close"?ct("too-close"):g.value==="too-far"?ct("too-far"):v.value?E.value?Z5():S.value=y("selfie.smart.status.readyToCapture"):ct("out-of-bounds"):ct("no-face")},al=()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)},cl=()=>A(this,null,function*(){var K,me;if(!d.current||!e.current){al();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){u.current=requestAnimationFrame(cl);return}try{N.value&&(N.value=!1);const St=p5(e.current),ll=St||e.current,Xe=d.current.detectForVideo(ll,performance.now());if(w.value=Xe.faceLandmarks||[],Xe.faceLandmarks&&t.current&&e.current)if(St){const ni=e.current.videoWidth,_i=e.current.videoHeight,rr=Math.min(ni,_i),ul=(ni-rr)/(2*ni),no=(_i-rr)/(2*_i),oo=rr/ni,nr=rr/_i,J5=Xe.faceLandmarks.map(Q5=>Q5.map(dl=>({x:dl.x*oo+ul,y:dl.y*nr+no,z:dl.z})));P0(t.current,J5,We.value,ir.value)}else P0(t.current,Xe.faceLandmarks,We.value,ir.value);else t.current&&$0(t.current);const Y5=Xe.faceLandmarks?Xe.faceLandmarks.length:0,Q0=Xe.faceBlendshapes&&Xe.faceBlendshapes.length>0&&Y5>=1;if(m.value=Q0,Q0&&Xe.faceLandmarks){const ni=d5(Xe.faceLandmarks);I.value=ni,ni>a?g.value="too-close":ni<s?g.value="too-far":g.value="good",v.value=h5(Xe.faceLandmarks,b.value);const _i=Xe.faceBlendshapes[0].categories,rr=((K=_i.find(nr=>nr.categoryName==="mouthSmileLeft"))==null?void 0:K.score)||0,ul=((me=_i.find(nr=>nr.categoryName==="mouthSmileRight"))==null?void 0:me.score)||0,no=f5(Xe.faceLandmarks),oo=(rr+ul)/2;_.value=oo,D.value=no,oo>=n&&no>=o&&($.value=Date.now(),H.value&&E.value&&f.current&&setTimeout(()=>{Date.now()-$.value<=100&&H.value&&E.value&&f.current&&f.current()},0))}else _.value=0,I.value=0,D.value=0,v.value=!1,g.value="good";W5()}catch(St){m.value=!1,v.value=!1,g.value="good",D.value=0,E.value&&ct("no-face")}u.current=requestAnimationFrame(cl)}),X5=()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(cl)},K5=()=>{if(!e.current)return;const K=We.value===at.value-1,me=m5(e.current,K);me&&(K?xe.value=me:ce.value=[...ce.value,me],We.value++,R.value=at.value-We.value)},io=()=>{if(h.current&&(clearInterval(h.current),h.current=null),E.value=!1,H.value=!1,We.value>=at.value&&xe.value){const K=ce.value.map(ll=>({image:ll.split(",")[1],image_type_id:N0.LIVENESS_IMAGE_BASE64})),me={image:xe.value.split(",")[1],image_type_id:N0.SELFIE_IMAGE_BASE64},St={images:[...K,me],referenceImage:xe.value,previewImage:xe.value,facingMode:l(),meta:{libraryVersion:Vr}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:St})),W0.value=!0}},ro=()=>{h.current&&(clearInterval(h.current),h.current=null),H.value=!0,m.value&&v.value&&g.value==="good"&&ct("smile-required")},Y0=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(We.value>=at.value){io();return}if(!m.value)return;if(!v.value){ro();return}if(g.value!=="good"){ro();return}if(We.value>=ir.value&&Date.now()-$.value>c){ro();return}K5()},i)},J0=()=>{if(m.value&&g.value==="good"&&v.value){if(We.value>=ir.value&&Date.now()-$.value>c)return;H.value=!1,ct(null),Y0()}};return f.current=J0,{faceDetected:m,faceInBounds:v,faceProximity:g,videoAspectRatio:b,faceLandmarks:w,currentSmileScore:_,currentFaceSize:I,currentMouthOpen:D,lastSmileTime:$,alertTitle:S,isInitializing:N,isReadyToCapture:K0,captureButtonFallbackEnabled:B,isCapturing:E,isPaused:H,countdown:R,capturedImages:ce,referencePhoto:xe,totalCaptures:at,capturesTaken:We,hasFinishedCapture:W0,smileCheckpoint:ir,neutralZone:X0,initializeFaceLandmarker:z5,setupCanvas:G5,startDetectionLoop:X5,stopDetectionLoop:al,updateAlert:ct,startCapture:()=>A(this,null,function*(){ce.value=[],E.value=!0,H.value=!1,at.value=Math.ceil(r/i),We.value=0,R.value=at.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()]}})),Y0()}),stopCapture:io,pauseCapture:ro,resumeCapture:J0,handleCancel:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:Vr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:Vr}}}))},handleClose:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:Vr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:Vr}}}))},cleanup:()=>{h.current&&clearInterval(h.current),p.current&&clearTimeout(p.current),al(),ct.cancel()},resetFaceDetectionState:()=>{m.value=!1,v.value=!1,g.value="good",w.value=[],_.value=0,I.value=0,D.value=0,$.value=0,B.value=!1,p.current&&(clearTimeout(p.current),p.current=null),t.current&&$0(t.current)}}},C5=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const r=Ae(null),n=Ae(e);return ht(()=>{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]),P("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:P("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[P("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:P("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"})}),P("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"}}),P("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"})]})})},E5=({videoRef:e,canvasRef:t,facingMode:i,progress:r,interval:n,themeColor:o})=>P(Vt,{children:[P("div",{className:"camera-preview-container",children:[P("div",{className:"video-wrapper",style:{clipPath:"url(#selfie-clip-path)"},children:P("div",{className:"video-container",children:[P("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),P("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),P(C5,{progress:r,duration:n,themeColor:o})]}),P("style",{children:`
|
|
3144
3144
|
.camera-preview-container {
|
|
3145
3145
|
position: relative;
|
|
3146
3146
|
width: 100%;
|
|
@@ -3181,7 +3181,7 @@ ${this.hideAttribution?"":`
|
|
|
3181
3181
|
.camera-canvas {
|
|
3182
3182
|
pointer-events: none;
|
|
3183
3183
|
}
|
|
3184
|
-
`})]}),
|
|
3184
|
+
`})]}),x5=({alertTitle:e})=>e?P(Vt,{children:[P("div",{className:"alert-message",children:P("div",{className:"alert-title",children:e})}),P("style",{children:`
|
|
3185
3185
|
.alert-message {
|
|
3186
3186
|
margin-top: 1.5rem;
|
|
3187
3187
|
color: #000;
|
|
@@ -3197,7 +3197,7 @@ ${this.hideAttribution?"":`
|
|
|
3197
3197
|
font-weight: bold;
|
|
3198
3198
|
text-align: center;
|
|
3199
3199
|
}
|
|
3200
|
-
`})]}):null,
|
|
3200
|
+
`})]}):null,k5=({isCapturing:e,hasFinishedCapture:t,isReadyToCapture:i,captureButtonFallbackEnabled:r,allowAgentMode:n,agentSupported:o,showAgentModeForTests:s,facingMode:a,themeColor:c="#001096",onStartCapture:l,onSwitchCamera:d})=>P(Vt,{children:[P("div",{className:"controls",children:[P("button",{id:"start-image-capture",class:"btn-primary",onClick:l,disabled:e||t||!i&&!r,children:y("selfie.capture.button.startCapture")}),n&&(o||s)&&P("button",{id:"switch-camera",onClick:d,className:"agent-mode-btn",disabled:e||t,children:y(a==="user"?"selfie.capture.agentMode.off":"selfie.capture.agentMode.on")})]}),P("style",{children:`
|
|
3201
3201
|
.controls {
|
|
3202
3202
|
margin: 1.5rem 0;
|
|
3203
3203
|
display: flex;
|
|
@@ -3211,7 +3211,7 @@ ${this.hideAttribution?"":`
|
|
|
3211
3211
|
.agent-mode-btn {
|
|
3212
3212
|
padding: 8px 16px;
|
|
3213
3213
|
font-size: 14px;
|
|
3214
|
-
background: ${
|
|
3214
|
+
background: ${c};
|
|
3215
3215
|
color: white;
|
|
3216
3216
|
border: none;
|
|
3217
3217
|
border-radius: 4px;
|
|
@@ -3222,7 +3222,7 @@ ${this.hideAttribution?"":`
|
|
|
3222
3222
|
background: #ccc;
|
|
3223
3223
|
cursor: not-allowed;
|
|
3224
3224
|
}
|
|
3225
|
-
`})]}),
|
|
3225
|
+
`})]}),il=({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=li(r),d=li(n),u=li(o),h=li(s),f=300,p=.25,m=.05,v=.35,g=.5,b=d?"environment":"user",w=wf(b),_=w5({videoRef:w.videoRef,canvasRef:a,interval:e,duration:t,smileThreshold:p,mouthOpenThreshold:m,minFaceSize:v,maxFaceSize:g,smileCooldown:f,getFacingMode:()=>w.facingMode});return ht(()=>{const I=()=>A(this,null,function*(){yield w.startCamera(b,D=>{const $=document.querySelector("smart-camera-web");$==null||$.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:D}}))}),yield w.checkAgentSupport(),yield _.initializeFaceLandmarker(),setTimeout(()=>{_.setupCanvas(),_.startDetectionLoop()},500)});return w.registerCameraSwitchCallback(()=>{try{_.resetFaceDetectionState(),_.setupCanvas(),_.stopDetectionLoop(),_.startDetectionLoop()}catch(D){console.error("Error during camera switch callback:",D)}}),I(),()=>{_.stopDetectionLoop(),w.stopCamera(),_.cleanup()}},[]),ht(()=>{const I=c.current;if(I&&l){const D=()=>{_.handleCancel()},$=()=>{_.handleClose()};return I.addEventListener("navigation.back",D),I.addEventListener("navigation.close",$),()=>{I.removeEventListener("navigation.back",D),I.removeEventListener("navigation.close",$)}}},[l]),ht(()=>{if(_.hasFinishedCapture.value){const I=document.querySelector("smart-camera-web");I==null||I.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[_.hasFinishedCapture.value]),P("div",{className:"smartselfie-capture",children:[l&&P("smileid-navigation",{ref:c,"theme-color":i}),P(E5,{videoRef:w.videoRef,canvasRef:a,facingMode:w.facingMode,progress:_.capturesTaken.value>0?_.capturesTaken.value/_.totalCaptures.value:0,interval:e,themeColor:i}),P(x5,{alertTitle:_.alertTitle.value}),!_.isCapturing.value&&!_.hasFinishedCapture.value&&P(k5,{isCapturing:_.isCapturing.value,hasFinishedCapture:_.hasFinishedCapture.value,isReadyToCapture:_.isReadyToCapture.value,captureButtonFallbackEnabled:_.captureButtonFallbackEnabled.value,allowAgentMode:d,agentSupported:w.agentSupported,showAgentModeForTests:u,facingMode:w.facingMode,themeColor:i,onStartCapture:_.startCapture,onSwitchCamera:w.switchCamera}),!h&&P("powered-by-smile-id",{}),P("style",{children:`
|
|
3226
3226
|
* {
|
|
3227
3227
|
box-sizing: border-box;
|
|
3228
3228
|
}
|
|
@@ -3270,7 +3270,7 @@ ${this.hideAttribution?"":`
|
|
|
3270
3270
|
padding: 1rem;
|
|
3271
3271
|
font-family: sans-serif;
|
|
3272
3272
|
}
|
|
3273
|
-
`})]})};customElements.get("smartselfie-capture")||
|
|
3273
|
+
`})]})};customElements.get("smartselfie-capture")||f2(il,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const A5=pr.version,S5=8;function L5(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 T5(e,t=S5){const i=[];if(e<t)throw new Error(Ut("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 M5(){return`
|
|
3274
3274
|
${dt(this.themeColor)}
|
|
3275
3275
|
<style>
|
|
3276
3276
|
:host {
|
|
@@ -3764,19 +3764,19 @@ ${this.hideAttribution?"":`
|
|
|
3764
3764
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
3765
3765
|
</div>
|
|
3766
3766
|
</div>
|
|
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:`
|
|
3767
|
+
`}function j0(i){return A(this,arguments,function*(e,t={facingMode:"user"}){try{const r=yield O.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",O.handleCameraError(r))}})}class I5 extends HTMLElement{constructor(){super(),this.templateString=M5.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:A5}},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 A(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,O.stopMedia(),yield j0(this,{facingMode:this.facingMode}),this.handleStream(O.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),O.stopMedia();const t=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=T5(t);this._data.images=this._data.images.concat(i.map(r=>({image:this._rawImages[r].split(",")[1],image_type_id:xi.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:xi.SELFIE_IMAGE_BASE64})}_publishImages(){const t=or(De({},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(L5(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",O.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),O.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()}),O.stream?this.handleStream(O.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&j0(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){O.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 A(this,null,function*(){var i,r,n,o;if(!this.allowAgentMode)return;(yield O.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")&&O.stream&&this.handleStream(O.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"),O.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",I5);const F5=90*1e3,B5=20*1e3,D5=o=>{var s=o,{timeout:e=F5,"start-countdown":t=!1,"allow-legacy-selfie-fallback":i=!1,hidden:r=!1}=s,n=pl(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(S){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,l=li(r),d=li(t),u=li(i),h=u?B5:e,[f,p]=ci(!1),[m,v]=ci(c?100:0),[g,b]=ci(!1),[w,_]=ci(!1),[I,D]=ci(!1);if(ht(()=>{if(f||w||c)return;A(this,null,function*(){_(!0);try{yield V0(),p(!0)}catch(N){console.error("Failed to load Mediapipe:",N)}_(!1)})},[f,w]),ht(()=>{if(l||!d||f)return;const S=setInterval(()=>{v(N=>Math.min(N+1,100))},h/100);return()=>{clearInterval(S)}},[l,d,h,f]),ht(()=>{if(l||f||m<100)return;const N=setTimeout(()=>{const B=document.querySelector("selfie-capture");if(B&&!B.hasAttribute("data-backup-events-setup")){B.setAttribute("data-backup-events-setup","true");const E=H=>{const R=H;window.dispatchEvent(new CustomEvent(R.type,{detail:R.detail,bubbles:!0}))};return B.addEventListener("selfie-capture.publish",E),B.addEventListener("selfie-capture.cancelled",E),B.addEventListener("selfie-capture.close",E),()=>{B.removeEventListener("selfie-capture.publish",E),B.removeEventListener("selfie-capture.cancelled",E),B.removeEventListener("selfie-capture.close",E)}}},200);return()=>{clearTimeout(N)}},[l,f,m]),ht(()=>{if(l)return;const S=document.querySelector("smart-camera-web");S==null||S.dispatchEvent(new CustomEvent("metadata.allow-legacy-selfie-fallback",{detail:{allow_legacy_selfie_fallback:u}}))},[l,u]),ht(()=>{if(l||w)return;const S=document.querySelector("smart-camera-web");S==null||S.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:I?"0.0.1":"1.0.0"}}))},[I,l,w]),l)return null;if(g&&f&&!I)return P(il,De({},n));if(!g&&f&&!I)return P(il,De({},n));if(m>=100){if(u||c){I||D(!0);const N=De({},n);return delete N.hidden,P("selfie-capture",or(De({},N),{ref:B=>{if(B&&!B.hasAttribute("data-events-setup")){B.setAttribute("data-events-setup","true");const E=H=>{const R=H;(R.type==="selfie-capture.publish"||R.type==="selfie-capture.cancelled"||R.type==="selfie-capture.close")&&b(!0),window.dispatchEvent(new CustomEvent(R.type,{detail:R.detail,bubbles:!0}))};B.addEventListener("selfie-capture.publish",E),B.addEventListener("selfie-capture.cancelled",E),B.addEventListener("selfie-capture.close",E)}}}))}return P("div",{style:{textAlign:"center",marginTop:"20%",padding:"0 20px"},children:P("p",{style:{fontSize:"1.2rem",color:"#333"},children:Ks("selfie.capture.loading.connectionError")})})}return P("div",{style:{textAlign:"center",marginTop:"20%"},children:[P("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:P(mf,{size:48,style:{animation:"spin 1s linear infinite"}})}),m>=44?P("p",{children:Ks("selfie.capture.loading.slowConnection")}):P("p",{children:xu("selfie.capture.loading.progress",{progress:m})}),P("style",{children:`
|
|
3768
3768
|
@keyframes spin {
|
|
3769
3769
|
from { transform: rotate(0deg); }
|
|
3770
3770
|
to { transform: rotate(360deg); }
|
|
3771
3771
|
}
|
|
3772
|
-
`})]})};customElements.get("selfie-capture-wrapper")||
|
|
3772
|
+
`})]})};customElements.get("selfie-capture-wrapper")||f2(D5,"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 R5=pr.version,ot=document.querySelector("smart-camera-web"),O5=(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 z0 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,ot==null||ot.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
3773
3773
|
${dt(this.themeColor)}
|
|
3774
3774
|
<div style="height: 100%;">
|
|
3775
3775
|
<selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
|
|
3776
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>
|
|
3777
3777
|
<selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
|
|
3778
3778
|
</div>
|
|
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=`
|
|
3779
|
+
`,this._data={images:[],meta:{libraryVersion:R5}},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(){O.stopMedia(),ot==null||ot.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",()=>A(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",()=>A(this,null,function*(){ot==null||ot.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",()=>A(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return A(this,null,function*(){O.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=()=>A(this,null,function*(){if(O.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>A(this,null,function*(){O.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),r=n=>A(this,null,function*(){ot==null||ot.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield O5(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,O.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",z0);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 rl{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 rl(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 P5{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 $5(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 N5=class ml extends P5{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?$5(ml.prototype._strokeUpdate,this.throttle):ml.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=rl.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 Nt=class Nt{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/fl(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 A(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!Nt.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>Nt.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Nt.getHumanSize(Nt.memoryLimit)}.`);return yield Nt.getData(i)})}};wi(Nt,"memoryLimit",2048e3),wi(Nt,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let nl=Nt;class G0 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
3780
3780
|
:host {
|
|
3781
3781
|
display: block;
|
|
3782
3782
|
block-size: auto;
|
|
@@ -3957,7 +3957,7 @@ button:disabled {
|
|
|
3957
3957
|
/>
|
|
3958
3958
|
</svg>
|
|
3959
3959
|
</button>
|
|
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
|
|
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 N5(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 A(this,null,function*(){try{this.resetErrorMessage();const{files:i}=t.target,r=yield nl.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",G0);function U5(){return`
|
|
3961
3961
|
${dt(this.themeColor)}
|
|
3962
3962
|
<style>
|
|
3963
3963
|
.camera-permission-screen {
|
|
@@ -4032,7 +4032,7 @@ button:disabled {
|
|
|
4032
4032
|
</div>
|
|
4033
4033
|
</div>
|
|
4034
4034
|
</div>
|
|
4035
|
-
`}class
|
|
4035
|
+
`}class H5 extends HTMLElement{connectedCallback(){this.templateString=U5.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",()=>A(this,null,function*(){i.setAttribute("disabled",!0);try{yield O.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=O.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",H5);const q5=pr.version;function V5(){return`
|
|
4036
4036
|
<style>
|
|
4037
4037
|
:host {
|
|
4038
4038
|
display: block;
|
|
@@ -4048,5 +4048,5 @@ button:disabled {
|
|
|
4048
4048
|
<document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
|
|
4049
4049
|
${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
|
|
4050
4050
|
</div>
|
|
4051
|
-
`}class
|
|
4051
|
+
`}class Z0 extends HTMLElement{constructor(){super(),this.scwTemplateString=V5.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:q5}},"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(){O.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",Z0),F.DocumentCaptureScreens=Iu,F.EndUserConsent=Du,F.List=Lu,F.Navigation=Mu,F.Option=Tu,F.Root=Au,F.SelfieCaptureScreens=z0,F.SignaturePad=G0,F.SmartCameraWeb=Z0,F.TotpConsent=Bu,F.Trigger=Su,F.deepMerge=yu,F.escapeHtml=fr,F.getCurrentLocale=E4,F.getDefaultLocale=x4,F.getDirection=ut,F.hasLocale=k4,F.loadLocale=Cu,F.registerLocale=Wr,F.registerLocaleUrl=wu,F.setCurrentLocale=C4,F.setDocumentDir=A4,F.t=y,F.tHtml=Ut,F.translate=Ks,F.translateHtml=xu,F.validateLocale=Eu,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),F}({});
|
|
4052
4052
|
//# sourceMappingURL=smart-camera-web.js.map
|