@smileid/web-components 11.1.0 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/esm/{DocumentCaptureScreens-DHAfE8VG.js → DocumentCaptureScreens-BbtA-WkX.js} +13 -13
  2. package/dist/esm/DocumentCaptureScreens-BbtA-WkX.js.map +1 -0
  3. package/dist/esm/{EndUserConsent-DE6OBSGG.js → EndUserConsent-HVufMamg.js} +3 -3
  4. package/dist/esm/{EndUserConsent-DE6OBSGG.js.map → EndUserConsent-HVufMamg.js.map} +1 -1
  5. package/dist/esm/{Navigation-kjll5SgE.js → Navigation-B-dqPkZj.js} +2 -2
  6. package/dist/esm/{Navigation-kjll5SgE.js.map → Navigation-B-dqPkZj.js.map} +1 -1
  7. package/dist/esm/{SelfieCaptureScreens-DaREKFi4.js → SelfieCaptureScreens-ChAMfKi3.js} +1591 -1574
  8. package/dist/esm/SelfieCaptureScreens-ChAMfKi3.js.map +1 -0
  9. package/dist/esm/{TotpConsent-DsMJhXD8.js → TotpConsent-XxR8TNxy.js} +2 -2
  10. package/dist/esm/{TotpConsent-DsMJhXD8.js.map → TotpConsent-XxR8TNxy.js.map} +1 -1
  11. package/dist/esm/combobox.js +1 -1
  12. package/dist/esm/document.js +1 -1
  13. package/dist/esm/end-user-consent.js +1 -1
  14. package/dist/esm/{index-LJce6hoU.js → index-B_ozpejI.js} +76 -76
  15. package/dist/esm/{index-LJce6hoU.js.map → index-B_ozpejI.js.map} +1 -1
  16. package/dist/esm/localisation.js +1 -1
  17. package/dist/esm/main.js +6 -6
  18. package/dist/esm/navigation.js +1 -1
  19. package/dist/esm/{package-BoRHLVSv.js → package-u3FEJ3Fm.js} +3 -3
  20. package/dist/esm/{package-BoRHLVSv.js.map → package-u3FEJ3Fm.js.map} +1 -1
  21. package/dist/esm/selfie.js +1 -1
  22. package/dist/esm/smart-camera-web.js +21 -16
  23. package/dist/esm/smart-camera-web.js.map +1 -1
  24. package/dist/esm/totp-consent.js +1 -1
  25. package/dist/package.json +1 -1
  26. package/dist/smart-camera-web.js +45 -45
  27. package/dist/smart-camera-web.js.map +1 -1
  28. package/lib/components/camera-permission/CameraPermission.js +1 -1
  29. package/lib/components/document/src/document-capture/DocumentCapture.js +3 -3
  30. package/lib/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +3 -3
  31. package/lib/components/document/src/document-capture-review/DocumentCaptureReview.js +3 -3
  32. package/lib/components/selfie/src/SelfieCaptureScreens.js +9 -1
  33. package/lib/components/selfie/src/selfie-capture/SelfieCapture.js +2 -2
  34. package/lib/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +3 -3
  35. package/lib/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +3 -3
  36. package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +97 -46
  37. package/lib/components/signature-pad/package.json +1 -1
  38. package/lib/components/smart-camera-web/src/SmartCameraWeb.js +9 -1
  39. package/package.json +2 -2
  40. package/dist/esm/DocumentCaptureScreens-DHAfE8VG.js.map +0 -1
  41. package/dist/esm/SelfieCaptureScreens-DaREKFi4.js.map +0 -1
  42. package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.stories.js +0 -47
@@ -1,4 +1,4 @@
1
- var SmartCameraWeb=function(D){"use strict";var j5=Object.defineProperty,z5=Object.defineProperties;var G5=Object.getOwnPropertyDescriptors;var oo=Object.getOwnPropertySymbols;var W0=Object.prototype.hasOwnProperty,X0=Object.prototype.propertyIsEnumerable;var ul=Math.pow,ll=(D,J,te)=>J in D?j5(D,J,{enumerable:!0,configurable:!0,writable:!0,value:te}):D[J]=te,Re=(D,J)=>{for(var te in J||(J={}))W0.call(J,te)&&ll(D,te,J[te]);if(oo)for(var te of oo(J))X0.call(J,te)&&ll(D,te,J[te]);return D},nr=(D,J)=>z5(D,G5(J));var dl=(D,J)=>{var te={};for(var Te in D)W0.call(D,Te)&&J.indexOf(Te)<0&&(te[Te]=D[Te]);if(D!=null&&oo)for(var Te of oo(D))J.indexOf(Te)<0&&X0.call(D,Te)&&(te[Te]=D[Te]);return te};var yi=(D,J,te)=>ll(D,typeof J!="symbol"?J+"":J,te);var S=(D,J,te)=>new Promise((Te,or)=>{var so=Ye=>{try{_i(te.next(Ye))}catch(ni){or(ni)}},sr=Ye=>{try{_i(te.throw(Ye))}catch(ni){or(ni)}},_i=Ye=>Ye.done?Te(Ye.value):Promise.resolve(Ye.value).then(so,sr);_i((te=te.apply(D,J)).next())});var at;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,_i;function Ye(){if(_i)return sr;_i=1;function e(t,i){return t===i||t!==t&&i!==i}return sr=e,sr}var ni,fl;function jr(){if(fl)return ni;fl=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,pl;function K0(){if(pl)return ao;pl=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,ml;function Y0(){if(ml)return co;ml=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,gl;function J0(){if(gl)return lo;gl=1;var e=jr();function t(i){return e(this.__data__,i)>-1}return lo=t,lo}var uo,vl;function Q0(){if(vl)return uo;vl=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,bl;function zr(){if(bl)return ho;bl=1;var e=so(),t=K0(),i=Y0(),r=J0(),n=Q0();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,yl;function e3(){if(yl)return fo;yl=1;var e=zr();function t(){this.__data__=new e,this.size=0}return fo=t,fo}var po,_l;function t3(){if(_l)return po;_l=1;function e(t){var i=this.__data__,r=i.delete(t);return this.size=i.size,r}return po=e,po}var mo,wl;function i3(){if(wl)return mo;wl=1;function e(t){return this.__data__.get(t)}return mo=e,mo}var go,Cl;function r3(){if(Cl)return go;Cl=1;function e(t){return this.__data__.has(t)}return go=e,go}var vo,El;function xl(){if(El)return vo;El=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=xl(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return bo=i,bo}var yo,kl;function Sl(){if(kl)return yo;kl=1;var e=oi(),t=e.Symbol;return yo=t,yo}var _o,Ll;function n3(){if(Ll)return _o;Ll=1;var e=Sl(),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,Tl;function o3(){if(Tl)return wo;Tl=1;var e=Object.prototype,t=e.toString;function i(r){return t.call(r)}return wo=i,wo}var Co,Ml;function ar(){if(Ml)return Co;Ml=1;var e=Sl(),t=n3(),i=o3(),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,Il;function gt(){if(Il)return Eo;Il=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return Eo=e,Eo}var xo,Fl;function Ao(){if(Fl)return xo;Fl=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 ko,Bl;function s3(){if(Bl)return ko;Bl=1;var e=oi(),t=e["__core-js_shared__"];return ko=t,ko}var So,Dl;function a3(){if(Dl)return So;Dl=1;var e=s3(),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,Rl;function c3(){if(Rl)return Lo;Rl=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,Ol;function l3(){if(Ol)return To;Ol=1;var e=Ao(),t=a3(),i=gt(),r=c3(),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,Pl;function u3(){if(Pl)return Mo;Pl=1;function e(t,i){return t==null?void 0:t[i]}return Mo=e,Mo}var Io,$l;function Fo(){if($l)return Io;$l=1;var e=l3(),t=u3();function i(r,n){var o=t(r,n);return e(o)?o:void 0}return Io=i,Io}var Bo,Nl;function Hl(){if(Nl)return Bo;Nl=1;var e=Fo(),t=oi(),i=e(t,"Map");return Bo=i,Bo}var Do,Ul;function Gr(){if(Ul)return Do;Ul=1;var e=Fo(),t=e(Object,"create");return Do=t,Do}var Ro,ql;function d3(){if(ql)return Ro;ql=1;var e=Gr();function t(){this.__data__=e?e(null):{},this.size=0}return Ro=t,Ro}var Oo,Vl;function h3(){if(Vl)return Oo;Vl=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,jl;function f3(){if(jl)return Po;jl=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,zl;function p3(){if(zl)return $o;zl=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,Gl;function m3(){if(Gl)return No;Gl=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,Zl;function g3(){if(Zl)return Ho;Zl=1;var e=d3(),t=h3(),i=f3(),r=p3(),n=m3();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,Wl;function v3(){if(Wl)return Uo;Wl=1;var e=g3(),t=zr(),i=Hl();function r(){this.size=0,this.__data__={hash:new e,map:new(i||t),string:new e}}return Uo=r,Uo}var qo,Xl;function b3(){if(Xl)return qo;Xl=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,Kl;function Zr(){if(Kl)return Vo;Kl=1;var e=b3();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,Yl;function y3(){if(Yl)return jo;Yl=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,Jl;function _3(){if(Jl)return zo;Jl=1;var e=Zr();function t(i){return e(this,i).get(i)}return zo=t,zo}var Go,Ql;function w3(){if(Ql)return Go;Ql=1;var e=Zr();function t(i){return e(this,i).has(i)}return Go=t,Go}var Zo,e1;function C3(){if(e1)return Zo;e1=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,t1;function E3(){if(t1)return Wo;t1=1;var e=v3(),t=y3(),i=_3(),r=w3(),n=C3();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,i1;function x3(){if(i1)return Xo;i1=1;var e=zr(),t=Hl(),i=E3(),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,r1;function A3(){if(r1)return Ko;r1=1;var e=zr(),t=e3(),i=t3(),r=i3(),n=r3(),o=x3();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,n1;function o1(){if(n1)return Yo;n1=1;var e=Fo(),t=function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch(r){}}();return Yo=t,Yo}var Jo,s1;function Qo(){if(s1)return Jo;s1=1;var e=o1();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,a1;function c1(){if(a1)return es;a1=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,l1;function k3(){if(l1)return ts;l1=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,u1;function S3(){if(u1)return is;u1=1;var e=k3(),t=e();return is=t,is}var cr={exports:{}};cr.exports;var d1;function L3(){return d1||(d1=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,h1;function T3(){if(h1)return rs;h1=1;var e=oi(),t=e.Uint8Array;return rs=t,rs}var ns,f1;function M3(){if(f1)return ns;f1=1;var e=T3();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,p1;function I3(){if(p1)return os;p1=1;var e=M3();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,m1;function F3(){if(m1)return ss;m1=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,g1;function B3(){if(g1)return as;g1=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,v1;function D3(){if(v1)return cs;v1=1;function e(t,i){return function(r){return t(i(r))}}return cs=e,cs}var ls,b1;function y1(){if(b1)return ls;b1=1;var e=D3(),t=e(Object.getPrototypeOf,Object);return ls=t,ls}var us,_1;function w1(){if(_1)return us;_1=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,C1;function R3(){if(C1)return ds;C1=1;var e=B3(),t=y1(),i=w1();function r(n){return typeof n.constructor=="function"&&!i(n)?e(t(n)):{}}return ds=r,ds}var hs,E1;function wi(){if(E1)return hs;E1=1;function e(t){return t!=null&&typeof t=="object"}return hs=e,hs}var fs,x1;function O3(){if(x1)return fs;x1=1;var e=ar(),t=wi(),i="[object Arguments]";function r(n){return t(n)&&e(n)==i}return fs=r,fs}var ps,A1;function k1(){if(A1)return ps;A1=1;var e=O3(),t=wi(),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,S1;function L1(){if(S1)return ms;S1=1;var e=Array.isArray;return ms=e,ms}var gs,T1;function M1(){if(T1)return gs;T1=1;var e=9007199254740991;function t(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return gs=t,gs}var vs,I1;function bs(){if(I1)return vs;I1=1;var e=Ao(),t=M1();function i(r){return r!=null&&t(r.length)&&!e(r)}return vs=i,vs}var ys,F1;function P3(){if(F1)return ys;F1=1;var e=bs(),t=wi();function i(r){return t(r)&&e(r)}return ys=i,ys}var lr={exports:{}},_s,B1;function $3(){if(B1)return _s;B1=1;function e(){return!1}return _s=e,_s}lr.exports;var D1;function R1(){return D1||(D1=1,function(e,t){var i=oi(),r=$3(),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,O1;function N3(){if(O1)return ws;O1=1;var e=ar(),t=y1(),i=wi(),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,P1;function H3(){if(P1)return Cs;P1=1;var e=ar(),t=M1(),i=wi(),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]",E="[object Int8Array]",B="[object Int16Array]",_="[object Int32Array]",M="[object Uint8Array]",k="[object Uint8ClampedArray]",O="[object Uint16Array]",U="[object Uint32Array]",F={};F[b]=F[w]=F[E]=F[B]=F[_]=F[M]=F[k]=F[O]=F[U]=!0,F[r]=F[n]=F[v]=F[o]=F[g]=F[s]=F[a]=F[c]=F[l]=F[d]=F[u]=F[h]=F[f]=F[p]=F[m]=!1;function K(N){return i(N)&&t(N.length)&&!!F[e(N)]}return Cs=K,Cs}var Es,$1;function U3(){if($1)return Es;$1=1;function e(t){return function(i){return t(i)}}return Es=e,Es}var ur={exports:{}};ur.exports;var N1;function q3(){return N1||(N1=1,function(e,t){var i=xl(),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,H1;function U1(){if(H1)return xs;H1=1;var e=H3(),t=U3(),i=q3(),r=i&&i.isTypedArray,n=r?t(r):e;return xs=n,xs}var As,q1;function V1(){if(q1)return As;q1=1;function e(t,i){if(!(i==="constructor"&&typeof t[i]=="function")&&i!="__proto__")return t[i]}return As=e,As}var ks,j1;function V3(){if(j1)return ks;j1=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 ks=n,ks}var Ss,z1;function j3(){if(z1)return Ss;z1=1;var e=V3(),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,G1;function z3(){if(G1)return Ls;G1=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,Z1;function W1(){if(Z1)return Ts;Z1=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,X1;function G3(){if(X1)return Ms;X1=1;var e=z3(),t=k1(),i=L1(),r=R1(),n=W1(),o=U1(),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,K1;function Z3(){if(K1)return Is;K1=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,Y1;function W3(){if(Y1)return Fs;Y1=1;var e=gt(),t=w1(),i=Z3(),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,J1;function Q1(){if(J1)return Bs;J1=1;var e=G3(),t=W3(),i=bs();function r(n){return i(n)?e(n,!0):t(n)}return Bs=r,Bs}var Ds,eu;function X3(){if(eu)return Ds;eu=1;var e=j3(),t=Q1();function i(r){return e(r,t(r))}return Ds=i,Ds}var Rs,tu;function K3(){if(tu)return Rs;tu=1;var e=c1(),t=L3(),i=I3(),r=F3(),n=R3(),o=k1(),s=L1(),a=P3(),c=R1(),l=Ao(),d=gt(),u=N3(),h=U1(),f=V1(),p=X3();function m(v,g,b,w,E,B,_){var M=f(v,b),k=f(g,b),O=_.get(k);if(O){e(v,b,O);return}var U=B?B(M,k,b+"",v,g,_):void 0,F=U===void 0;if(F){var K=s(k),N=!K&&c(k),ae=!K&&!N&&h(k);U=k,K||N||ae?s(M)?U=M:a(M)?U=r(M):N?(F=!1,U=t(k,!0)):ae?(F=!1,U=i(k,!0)):U=[]:u(k)||o(k)?(U=M,o(M)?U=p(M):(!d(M)||l(M))&&(U=n(k))):F=!1}F&&(_.set(k,U),E(U,k,w,B,_),_.delete(k)),e(v,b,U)}return Rs=m,Rs}var Os,iu;function Y3(){if(iu)return Os;iu=1;var e=A3(),t=c1(),i=S3(),r=K3(),n=gt(),o=Q1(),s=V1();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,ru;function nu(){if(ru)return Ps;ru=1;function e(t){return t}return Ps=e,Ps}var $s,ou;function J3(){if(ou)return $s;ou=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,su;function Q3(){if(su)return Ns;su=1;var e=J3(),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,au;function e4(){if(au)return Hs;au=1;function e(t){return function(){return t}}return Hs=e,Hs}var Us,cu;function t4(){if(cu)return Us;cu=1;var e=e4(),t=o1(),i=nu(),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,lu;function i4(){if(lu)return qs;lu=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,uu;function r4(){if(uu)return Vs;uu=1;var e=t4(),t=i4(),i=t(e);return Vs=i,Vs}var js,du;function n4(){if(du)return js;du=1;var e=nu(),t=Q3(),i=r4();function r(n,o){return i(t(n,o,e),n+"")}return js=r,js}var zs,hu;function o4(){if(hu)return zs;hu=1;var e=Ye(),t=bs(),i=W1(),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,fu;function s4(){if(fu)return Gs;fu=1;var e=n4(),t=o4();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,pu;function a4(){if(pu)return Zs;pu=1;var e=Y3(),t=s4(),i=t(function(r,n,o){e(r,n,o)});return Zs=i,Zs}var c4=a4();const l4=te(c4),u4={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:"تعذر التقاط صور كاميرا الويب - يرجى تجربة جهاز آخر"}},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}} غير صالح"}}},d4={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"}},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"}}},h4={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"}},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"}}},mu={ar:"ar-EG",en:"en-GB",fr:"fr-FR"};function dr(e){return mu[e]||e}const St="en-GB",f4=5e3;let ct=St;const Ee={"ar-EG":u4,"en-GB":d4,"fr-FR":h4};function Wr(e,t){Ee[e]=t}function gu(e,t){return!t||typeof t!="object"?e:!e||typeof e!="object"?t:l4({},e,t)}const vu=["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 p4(i){return S(this,arguments,function*(e,t=f4){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return yield fetch(e,{signal:r.signal})}finally{clearTimeout(n)}})}function bu(e,t){return S(this,null,function*(){try{const i=yield p4(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 yu(e,t){return S(this,null,function*(){const i=dr(e);return Ee[i]?Ee[i]:t?bu(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 _u(e){if(!e||typeof e!="object")return{missingKeys:vu,valid:!1};const t=vu.filter(i=>i==="direction"?!e.direction:!Ws(e,i));return{missingKeys:t,valid:t.length===0}}function y(e){const t=dr(ct),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 m4=y,g4={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"};function hr(e){return e.replace(/[&<>"']/g,t=>g4[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 v4=Nt;function b4(o){return S(this,arguments,function*(e,{url:t,translation:i,locales:r,validate:n=!1}={}){if(ct=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]=gu(Ee[l],c):(Wr(l,c),a!==l&&(mu[a]=l))}),!Ee[ct])if(i)Wr(ct,i);else if(t)try{yield yu(ct,t)}catch(a){return console.error(`Failed to load locale '${e}', keeping current locale '${ct}'`),!1}else return console.warn(`Locale '${e}' not registered and no URL provided`),!1;if(n&&Ee[ct]){const a=_u(Ee[ct]);a.valid||console.warn(`Locale '${e}' is missing required keys:`,a.missingKeys)}const s=Ee[ct];return s&&s.direction&&(document!=null&&document.documentElement)&&(document.documentElement.dir=s.direction),!0})}function y4(){return ct}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 lt(){const e=Ee[ct];return(e==null?void 0:e.direction)||"ltr"}function wu(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 A4(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 k4 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(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={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"};function hr(e){return e.replace(/[&<>"']/g,t=>v4[t])}function Nt(e,t={}){let i=y(e);return Object.keys(t).forEach(r=>{const n=t[r],o=`{{${r}}}`;if(n&&typeof n=="object"&&"value"in n){const s=hr(String(n.value||"")),a=hr(String(n.className||""));i=i.split(o).join(a?`<span class="${a}">${s}</span>`:s)}else i=i.split(o).join(hr(String(n)))}),i}const Cu=Nt;function b4(o){return S(this,arguments,function*(e,{url:t,translation:i,locales:r,validate:n=!1}={}){if(lt=dr(e),r&&typeof r=="object"&&Object.entries(r).forEach(([a,c])=>{if(!c||typeof c!="object")return;const l=dr(a);Ee[l]?Ee[l]=vu(Ee[l],c):(Wr(l,c),a!==l&&(gu[a]=l))}),!Ee[lt])if(i)Wr(lt,i);else if(t)try{yield _u(lt,t)}catch(a){return console.error(`Failed to load locale '${e}', keeping current locale '${lt}'`),!1}else return console.warn(`Locale '${e}' not registered and no URL provided`),!1;if(n&&Ee[lt]){const a=wu(Ee[lt]);a.valid||console.warn(`Locale '${e}' is missing required keys:`,a.missingKeys)}const s=Ee[lt];return s&&s.direction&&(document!=null&&document.documentElement)&&(document.documentElement.dir=s.direction),!0})}function y4(){return lt}function _4(){return St}function w4(e){return e in Ee}function C4(e){const t=Ee[e];t&&t.direction&&(document.documentElement.dir=t.direction)}function ut(){const e=Ee[lt];return(e==null?void 0:e.direction)||"ltr"}function Eu(e){const t=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${e}-${t}`}function E4(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function x4(e){return e&&e.clientHeight<e.scrollHeight}function k4(e,t){const{offsetHeight:i,offsetTop:r}=e,{offsetHeight:n,scrollTop:o}=t,s=r<o,a=r+i>o+n;s?t.scrollTo(0,r):a&&t.scrollTo(0,r-n+i)}class A4 extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(t){const i=t.relatedTarget||t.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class S4 extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
2
2
  <div>
3
3
  <input ${this.value?`value="${this.value}" `:""}${this.disabled?" disabled ":""}type="text" placeholder="${this.label}" />
4
4
  <button ${this.disabled?"disabled ":""}tabindex='-1' type='button'>
@@ -9,7 +9,7 @@ var SmartCameraWeb=function(D){"use strict";var j5=Object.defineProperty,z5=Obje
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",wu("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(t=>t.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(t=>!t.hasAttribute("hidden")&&t.hasAttribute("aria-selected"))||this.optionNodes.filter(t=>!t.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(t=>{t.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(t,i,r){switch(t){case"search-term":i&&!r?this.optionNodes.forEach(n=>{n.removeAttribute("hidden")}):r&&this.filterNodes(r);break}}filterNodes(t){this.optionNodes.forEach(n=>{const o=n.getAttribute("value").toLowerCase(),s=n.getAttribute("label").toLowerCase();o.includes(t.toLowerCase())||s.includes(t.toLowerCase())?n.removeAttribute("hidden"):n.setAttribute("hidden",!0)});const i=this.optionNodes.find(n=>!n.hasAttribute("hidden")),r=this.querySelector("#empty-state");!i&&!r?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&r&&this.removeChild(r)}handleFilter(t){const i=t.detail;this.setAttribute("search-term",i)}handleFocus(t){this.setSelected(t.detail.direction)}handleReset(){this.optionNodes.forEach(t=>t.setAttribute("tabindex","-1"))}handleOptionSelection(t){this.triggers.filter(r=>r.tagName==="INPUT")[0]&&this.setAttribute("search-term",t.detail.label)}setSelected(t){const i=this.optionNodes.filter(s=>!s.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const r=i.findIndex(s=>s===this.selectedNode),n=i.length-1;let o;switch(t){case"First":o=0;break;case"Last":o=n;break;case"Up":r===0?o=n:o=r-1;break;default:r===n?o=0:o=r+1;break}r!==o&&this.swapSelected(this.selectedNode,i[o])}swapSelected(t,i){t.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,x4(this)&&A4(this.selectedNode,this),E4(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(r=>r.setAttribute("aria-activedescendant",i.id))}}class T4 extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",wu("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 Cu=k4,Eu=S4,xu=L4,Au=T4;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",Cu),window.customElements.define("smileid-combobox-trigger",Eu),window.customElements.define("smileid-combobox-listbox",xu),window.customElements.define("smileid-combobox-option",Au));const Ci={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},Ht=.92,M4=`
12
+ `}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",Eu("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(t=>t.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(t=>!t.hasAttribute("hidden")&&t.hasAttribute("aria-selected"))||this.optionNodes.filter(t=>!t.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(t=>{t.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(t,i,r){switch(t){case"search-term":i&&!r?this.optionNodes.forEach(n=>{n.removeAttribute("hidden")}):r&&this.filterNodes(r);break}}filterNodes(t){this.optionNodes.forEach(n=>{const o=n.getAttribute("value").toLowerCase(),s=n.getAttribute("label").toLowerCase();o.includes(t.toLowerCase())||s.includes(t.toLowerCase())?n.removeAttribute("hidden"):n.setAttribute("hidden",!0)});const i=this.optionNodes.find(n=>!n.hasAttribute("hidden")),r=this.querySelector("#empty-state");!i&&!r?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&r&&this.removeChild(r)}handleFilter(t){const i=t.detail;this.setAttribute("search-term",i)}handleFocus(t){this.setSelected(t.detail.direction)}handleReset(){this.optionNodes.forEach(t=>t.setAttribute("tabindex","-1"))}handleOptionSelection(t){this.triggers.filter(r=>r.tagName==="INPUT")[0]&&this.setAttribute("search-term",t.detail.label)}setSelected(t){const i=this.optionNodes.filter(s=>!s.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const r=i.findIndex(s=>s===this.selectedNode),n=i.length-1;let o;switch(t){case"First":o=0;break;case"Last":o=n;break;case"Up":r===0?o=n:o=r-1;break;default:r===n?o=0:o=r+1;break}r!==o&&this.swapSelected(this.selectedNode,i[o])}swapSelected(t,i){t.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,x4(this)&&k4(this.selectedNode,this),E4(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(r=>r.setAttribute("aria-activedescendant",i.id))}}class T4 extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",Eu("option")),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.addEventListener("click",this.select)}disconnectedCallback(){this.removeEventListener("click",this.select)}get value(){return this.getAttribute("value")}get label(){return this.getAttribute("label")}select(){const t=this.options.find(i=>i.getAttribute("aria-selected"));t&&t.removeAttribute("aria-selected"),this.setAttribute("aria-selected",!0),this.dispatchEvent(new CustomEvent("combobox.option.select",{detail:{id:this.getAttribute("id"),label:this.label,value:this.value}}))}}const xu=A4,ku=S4,Au=L4,Su=T4;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",xu),window.customElements.define("smileid-combobox-trigger",ku),window.customElements.define("smileid-combobox-listbox",Au),window.customElements.define("smileid-combobox-option",Su));const Ei={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},Ht=.92,M4=`
13
13
  .text-xs {
14
14
  font-size: 0.75rem;
15
15
  line-height: 1rem;
@@ -58,7 +58,7 @@ var SmartCameraWeb=function(D){"use strict";var j5=Object.defineProperty,z5=Obje
58
58
  .font-normal {
59
59
  font-weight: 400;
60
60
  }
61
- `,ut=e=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
61
+ `,dt=e=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
62
62
  <link
63
63
  href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"
64
64
  rel="stylesheet"
@@ -423,7 +423,7 @@ ${M4}
423
423
  left: 1.25rem;
424
424
  }
425
425
 
426
- </style>`,At=class At{static getMedia(t){return S(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 S(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(n=>n.kind==="videoinput");let r=!1;return i.forEach(n=>n.label.toLowerCase().includes("back")||n.label.toLowerCase().includes("rear")?(r=!0,!0):!1),r}catch(t){return console.warn("Error accessing media devices: ",t),!1}})}static isSamsungMultiCameraDevice(){const t=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!t)return!1;const i=parseInt(t[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(t){switch(t.name){case"NotAllowedError":case"SecurityError":return y("camera.error.notAllowed");case"AbortError":return y("camera.error.abort");case"NotReadableError":return y("camera.error.notReadable");case"NotFoundError":return y("camera.error.notFound");case"TypeError":return y("camera.error.insecure");default:return t.message}}};yi(At,"stream",null),yi(At,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:At.isSamsungMultiCameraDevice()?2:1});let R=At;class ku extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=lt(),r=document.createElement("style");r.textContent=`
426
+ </style>`,kt=class kt{static getMedia(t){return S(this,null,function*(){return kt.stream=yield navigator.mediaDevices.getUserMedia(t),kt.stream})}static stopMedia(){kt.stream&&(kt.stream.getTracks().forEach(t=>t.stop()),kt.stream=null)}static supportsAgentMode(){return S(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(n=>n.kind==="videoinput");let r=!1;return i.forEach(n=>n.label.toLowerCase().includes("back")||n.label.toLowerCase().includes("rear")?(r=!0,!0):!1),r}catch(t){return console.warn("Error accessing media devices: ",t),!1}})}static isSamsungMultiCameraDevice(){const t=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!t)return!1;const i=parseInt(t[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(t){switch(t.name){case"NotAllowedError":case"SecurityError":return y("camera.error.notAllowed");case"AbortError":return y("camera.error.abort");case"NotReadableError":return y("camera.error.notReadable");case"NotFoundError":return y("camera.error.notFound");case"TypeError":return y("camera.error.insecure");default:return t.message}}};_i(kt,"stream",null),_i(kt,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:kt.isSamsungMultiCameraDevice()?2:1});let $=kt;class Lu extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=ut(),r=document.createElement("style");r.textContent=`
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",ku);function I4(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function F4(){return`
536
+ `,t.appendChild(r),this.showBackButton&&t.appendChild(n),t.appendChild(o),this.setAttribute("dir",i),this.backButton=n,this.backButton.addEventListener("click",()=>this.handleBack()),this.closeButton=o,this.closeButton.addEventListener("click",()=>this.handleClose())}disconnectedCallback(){this.backButton.removeEventListener("click",()=>this.handleBack()),this.closeButton.removeEventListener("click",()=>this.handleClose())}handleBack(){this.dispatchEvent(new CustomEvent("navigation.back"))}handleClose(){this.dispatchEvent(new CustomEvent("navigation.close"))}get showBackButton(){return!this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hasThemeColor(){var t;return(t=this.getAttribute("theme-color"))==null?void 0:t.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",Lu);function I4(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function F4(){return`
537
537
  <style>
538
538
  .visually-hidden {
539
539
  border: 0;
@@ -678,9 +678,9 @@ button[data-type="icon"] {
678
678
  padding-top: 10px;
679
679
  }
680
680
  </style>
681
- ${ut(this.themeColor)}
681
+ ${dt(this.themeColor)}
682
682
  <div id='document-capture-screen' class='flow center flex-column' dir='${this.direction}'>
683
- <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
683
+ ${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' show-navigation ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
684
684
  <h2 class='text-base font-bold title-color'>${this.documentName}</h2>
685
685
  <div class="circle-progress" id="loader">
686
686
  ${this.cameraError?"":'<p class="spinner"></p>'}
@@ -706,7 +706,7 @@ button[data-type="icon"] {
706
706
  </div>
707
707
  </div>
708
708
  </div>
709
- `}const Ei=.6;class B4 extends HTMLElement{constructor(){super(),this.templateString=F4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return S(this,null,function*(){if(!R.stream&&this.hasAttribute("data-camera-error")){try{yield R.getMedia({audio:!1,video:nr(Re({},R.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(t){console.error(t.constraint),console.error(t.message)}this.handleIDStream(R.stream)}})}_captureIDImage(){const t=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Re({},t)}))}_drawIDImage(t=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=t.videoWidth,i.height=i.width*16/9;const c=document.createElement("canvas");c.width=i.width,c.height=i.height,this.updatePortraitId(i,t,1,1),this.updatePortraitId(c,t);const l=i.toDataURL("image/jpeg",Ht),d=c.toDataURL("image/jpeg",Ht);return Re({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:d},this.idCardRegion)}i.width=2240,i.height=1260;const r=i.width/(t.videoWidth/t.videoHeight);i.height=r;const n=document.createElement("canvas");if(n.height=i.height,n.width=i.width,t.videoWidth<t.videoHeight){const c=document.createElement("canvas");n.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(c,t),this._drawLandscapeImageFromCanvas(i,c,1,1),this._drawLandscapeImageFromCanvas(n,c)}else this._drawLandscapeImage(i,t,1,1),this._drawLandscapeImage(n,t);const s=i.toDataURL("image/jpeg",Ht),a=n.toDataURL("image/jpeg",Ht);return Re({image:s,originalHeight:i.height,originalWidth:i.width,previewImage:a},this.idCardRegion)}_drawImage(t,i=!0,r=R.stream){this.resetErrorMessage();const n=t.getContext("2d");if(n.drawImage(r,0,0,r.videoWidth,r.videoHeight,0,0,t.width,t.height),i){const o=n.getImageData(0,0,t.width,t.height);if(I4(o.data))return n;throw new Error("Unable to capture webcam images - Please try another device")}else return n}handleIDStream(t){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let r=null,n=null;r=document.createElement("video"),n=document.createElement("canvas");const o=this.shadowRoot.querySelector(".id-video-container");r.muted=!0,r.setAttribute("muted","true"),r.autoplay=!0,r.playsInline=!0,"srcObject"in r?r.srcObject=t:r.src=window.URL.createObjectURL(t),n.width=o.clientWidth,n.height=o.clientWidth*9/16,this.isPortraitCaptureView&&(n.height=o.clientWidth*16/9),r.onloadedmetadata=()=>{r.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||o.prepend(n)};const s=()=>{if(r.paused||r.ended)return;r.removeEventListener("playing",s);const c=r.videoWidth/r.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(n,r),requestAnimationFrame(s);return}if(c){o.classList.add("mobile-camera-screen");const l=document.createElement("canvas");this._capturePortraitToLandscapeImage(l,r),this._drawLandscapeImageFromCanvas(n,l)}else this._drawLandscapeImage(n,r);requestAnimationFrame(s)};r.addEventListener("playing",s),this._IDStream=t,this._IDVideo=r}catch(i){this.setAttribute("data-camera-error",R.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),R.stopMedia()}}_drawLandscapeImage(t,i=this._IDVideo,r=Ei,n=Ei){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=Ei,n=Ei){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=Ei,n=Ei){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,E=d*m;t.getContext("2d").drawImage(a,w,E,g,b,0,0,t.width,t.height)}}_stopIDVideoStream(t=this._IDStream){t.getTracks().forEach(i=>i.stop())}setUpEventListeners(){this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),R.stream&&this.handleIDStream(R.stream),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.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")||lt()||"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")),R.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),R.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",B4);function D4(){return`
709
+ `}const xi=.6;class B4 extends HTMLElement{constructor(){super(),this.templateString=F4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return S(this,null,function*(){if(!$.stream&&this.hasAttribute("data-camera-error")){try{yield $.getMedia({audio:!1,video:nr(Re({},$.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(t){console.error(t.constraint),console.error(t.message)}this.handleIDStream($.stream)}})}_captureIDImage(){const t=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Re({},t)}))}_drawIDImage(t=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=t.videoWidth,i.height=i.width*16/9;const c=document.createElement("canvas");c.width=i.width,c.height=i.height,this.updatePortraitId(i,t,1,1),this.updatePortraitId(c,t);const l=i.toDataURL("image/jpeg",Ht),d=c.toDataURL("image/jpeg",Ht);return Re({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:d},this.idCardRegion)}i.width=2240,i.height=1260;const r=i.width/(t.videoWidth/t.videoHeight);i.height=r;const n=document.createElement("canvas");if(n.height=i.height,n.width=i.width,t.videoWidth<t.videoHeight){const c=document.createElement("canvas");n.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(c,t),this._drawLandscapeImageFromCanvas(i,c,1,1),this._drawLandscapeImageFromCanvas(n,c)}else this._drawLandscapeImage(i,t,1,1),this._drawLandscapeImage(n,t);const s=i.toDataURL("image/jpeg",Ht),a=n.toDataURL("image/jpeg",Ht);return Re({image:s,originalHeight:i.height,originalWidth:i.width,previewImage:a},this.idCardRegion)}_drawImage(t,i=!0,r=$.stream){this.resetErrorMessage();const n=t.getContext("2d");if(n.drawImage(r,0,0,r.videoWidth,r.videoHeight,0,0,t.width,t.height),i){const o=n.getImageData(0,0,t.width,t.height);if(I4(o.data))return n;throw new Error("Unable to capture webcam images - Please try another device")}else return n}handleIDStream(t){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let r=null,n=null;r=document.createElement("video"),n=document.createElement("canvas");const o=this.shadowRoot.querySelector(".id-video-container");r.muted=!0,r.setAttribute("muted","true"),r.autoplay=!0,r.playsInline=!0,"srcObject"in r?r.srcObject=t:r.src=window.URL.createObjectURL(t),n.width=o.clientWidth,n.height=o.clientWidth*9/16,this.isPortraitCaptureView&&(n.height=o.clientWidth*16/9),r.onloadedmetadata=()=>{r.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||o.prepend(n)};const s=()=>{if(r.paused||r.ended)return;r.removeEventListener("playing",s);const c=r.videoWidth/r.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(n,r),requestAnimationFrame(s);return}if(c){o.classList.add("mobile-camera-screen");const l=document.createElement("canvas");this._capturePortraitToLandscapeImage(l,r),this._drawLandscapeImageFromCanvas(n,l)}else this._drawLandscapeImage(n,r);requestAnimationFrame(s)};r.addEventListener("playing",s),this._IDStream=t,this._IDVideo=r}catch(i){this.setAttribute("data-camera-error",$.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),$.stopMedia()}}_drawLandscapeImage(t,i=this._IDVideo,r=xi,n=xi){const o=this.height?this.height/i.videoHeight:r,s=this.width?this.width/i.videoWidth:n,a=(1-r)/2,c=(1-n)/2,l=i.videoWidth*s,d=i.videoHeight*o,u=i.videoWidth*c,h=i.videoHeight*a;t.getContext("2d").drawImage(i,u,h,l,d,0,0,t.width,t.height)}_capturePortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:r,videoWidth:n}=i,o=n,s=n*9/16,a=0,c=(r-s)/2;t.width=o,t.height=s,t.getContext("2d").drawImage(i,a,c,o,s,0,0,t.width,t.height)}_drawLandscapeImageFromCanvas(t,i,r=xi,n=xi){const o=this.height?this.height/i.height:r,s=this.width?this.width/i.width:n,a=(1-r)/2,c=(1-n)/2,l=i.width*s,d=i.height*o,u=i.width*c,h=i.height*a;t.getContext("2d").drawImage(i,u,h,l,d,0,0,t.width,t.height)}_drawPortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:r,videoWidth:n}=i,o=600,s=400;t.width=o,t.height=s;const a=(n-o)/2,c=(r-s)/2;t.getContext("2d").drawImage(i,a,c,o,s,0,0,t.width,t.height)}updatePortraitId(t,i=this._IDVideo,r=xi,n=xi){const{videoWidth:o,videoHeight:s}=i;if(o&&s){const a=document.createElement("canvas"),c=9/16;let l,d,u,h;o/s>c?(d=s,l=d*c,u=(o-l)/2,h=0):(l=o,d=l,u=0,h=0),a.height=d,a.width=l,a.getContext("2d").drawImage(i,u,h,l,d,0,0,a.width,a.height);const f=this.height?this.height/l:r,p=this.width?this.width/d:n,m=(1-r)/2,v=(1-n)/2,g=l*p,b=d*f,_=l*v,M=d*m;t.getContext("2d").drawImage(a,_,M,g,b,0,0,t.width,t.height)}}_stopIDVideoStream(t=this._IDStream){t.getTracks().forEach(i=>i.stop())}setUpEventListeners(){var t,i;this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),$.stream&&this.handleIDStream($.stream),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.captureIDImage.addEventListener("click",()=>{this._captureIDImage()}),this.getUserMedia()}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||`${this.IdSides[this.sideOfId]} of ${this.documentName}`}get height(){return this.getAttribute("height")}get width(){return this.getAttribute("width")}get hidden(){return this.getAttribute("hidden")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get documentType(){return this.getAttribute("document-type")||""}get documentName(){return this.getAttribute("document-name")||y("document.name.default")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get cameraError(){return this.getAttribute("data-camera-error")}static get observedAttributes(){return["data-camera-error","data-camera-ready","document-name","document-type","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"data-camera-ready":case"document-name":case"document-type":case"hidden":case"title":this.connectedCallback();break}}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture.cancelled")),$.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),$.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",B4);function D4(){return`
710
710
  <style>
711
711
  .retake-photo.button[data-variant~="ghost"] {
712
712
  color: #FF5805;
@@ -921,9 +921,9 @@ button[data-type="icon"] {
921
921
  line-height: 1.5rem;
922
922
  }
923
923
  </style>
924
- ${ut(this.themeColor)}
924
+ ${dt(this.themeColor)}
925
925
  <div id='document-capture-review-screen' class='flow center' dir='${this.direction}'>
926
- <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
926
+ ${this.showNavigation?"<smileid-navigation show-navigation hide-back></smileid-navigation>":""}
927
927
  <h1 class="header-title title-color">
928
928
  ${y("document.review.question")}
929
929
  </h1>
@@ -949,7 +949,7 @@ button[data-type="icon"] {
949
949
  `}
950
950
  </div>
951
951
  </div>
952
- `}class R4 extends HTMLElement{constructor(){super(),this.templateString=D4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get title(){return this.getAttribute("title")||y("document.title.front")}get direction(){return this.getAttribute("dir")||lt()||"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(){this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",R4);let O4=(at=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/ul(1024,r);return r===0?`${t} bytes`:`${n.toFixed(0)} ${i[r]}`}static getData(t){return new Promise((i,r)=>{const n=new FileReader;n.onload=o=>{i(o.target.result)},n.onerror=()=>{r(new Error(y("fileUpload.error.readingFile")))},n.readAsDataURL(t)})}static retrieve(t){return S(this,null,function*(){if(t.length>1)throw new Error(y("fileUpload.error.multipleFiles"));const i=t[0];if(!at.supportedTypes.includes(i.type))throw new Error(y("fileUpload.error.unsupportedFormat"));if(i.size>at.memoryLimit)throw new Error(Nt("fileUpload.error.fileTooLarge",{filename:i.name,size:at.getHumanSize(at.memoryLimit)}));return yield at.getData(i)})}},yi(at,"memoryLimit",1024e4),yi(at,"supportedTypes",["image/jpeg","image/png"]),at);function P4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
952
+ `}class R4 extends HTMLElement{constructor(){super(),this.templateString=D4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get title(){return this.getAttribute("title")||y("document.title.front")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){var t,i;this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",R4);let O4=(ct=class{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),n=t/dl(1024,r);return r===0?`${t} bytes`:`${n.toFixed(0)} ${i[r]}`}static getData(t){return new Promise((i,r)=>{const n=new FileReader;n.onload=o=>{i(o.target.result)},n.onerror=()=>{r(new Error(y("fileUpload.error.readingFile")))},n.readAsDataURL(t)})}static retrieve(t){return S(this,null,function*(){if(t.length>1)throw new Error(y("fileUpload.error.multipleFiles"));const i=t[0];if(!ct.supportedTypes.includes(i.type))throw new Error(y("fileUpload.error.unsupportedFormat"));if(i.size>ct.memoryLimit)throw new Error(Nt("fileUpload.error.fileTooLarge",{filename:i.name,size:ct.getHumanSize(ct.memoryLimit)}));return yield ct.getData(i)})}},_i(ct,"memoryLimit",1024e4),_i(ct,"supportedTypes",["image/jpeg","image/png"]),ct);function P4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
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)"/>
@@ -1132,7 +1132,7 @@ button[data-type="icon"] {
1132
1132
  <div id="document-capture-instructions-screen" class="flow center" dir="${this.direction}">
1133
1133
  <div class="content-root">
1134
1134
  <div class="content-header">
1135
- <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
1135
+ ${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' show-navigation ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
1136
1136
  </div>
1137
1137
  <div class="content-body">
1138
1138
  <header>
@@ -1340,9 +1340,9 @@ ${this.hideAttribution?"":`
1340
1340
  </div>
1341
1341
  </div>
1342
1342
  </div>
1343
- ${ut(this.themeColor)}
1344
- `}class H4 extends HTMLElement{constructor(){super(),this.templateString=N4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){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"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.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",i=>S(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:r}=i.target,n=yield O4.retrieve(r);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:n,previewImage:n}}))}catch(r){this.shadowRoot.querySelector("#error").innerHTML=r.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")||lt()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",H4);const fr={version:"11.1.0"},U4=fr.version,P=document.querySelector("smart-camera-web");function Ut(e){return S(this,null,function*(){try{const t=yield R.getMedia({audio:!1,video:R.environmentOptions}),r=(yield navigator.mediaDevices.enumerateDevices()).find(n=>n.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===n.deviceId);P==null||P.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",R.handleCameraError(t))}})}class Su extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),P==null||P.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1345
- ${ut(this.themeColor)}
1343
+ ${dt(this.themeColor)}
1344
+ `}class H4 extends HTMLElement{constructor(){super(),this.templateString=N4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){var i,r;const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",n=>S(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:o}=n.target,s=yield O4.retrieve(o);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:s,previewImage:s}}))}catch(o){this.shadowRoot.querySelector("#error").innerHTML=o.message}}))}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||y("document.title.front")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",H4);const fr={version:"11.2.0"},U4=fr.version,H=document.querySelector("smart-camera-web");function Ut(e){return S(this,null,function*(){try{const t=yield $.getMedia({audio:!1,video:$.environmentOptions}),r=(yield navigator.mediaDevices.enumerateDevices()).find(n=>n.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===n.deviceId);H==null||H.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:r==null?void 0:r.label}})),e.removeAttribute("data-camera-error"),e.setAttribute("data-camera-ready",!0)}catch(t){e.removeAttribute("data-camera-ready"),e.setAttribute("data-camera-error",$.handleCameraError(t))}})}class Tu extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),H==null||H.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1345
+ ${dt(this.themeColor)}
1346
1346
  <div style="height: 100%;">
1347
1347
  <document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
1348
1348
  ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions?"hidden":""}
@@ -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(){R.stopMedia(),P==null||P.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*(){P==null||P.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),P==null||P.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*(){P==null||P.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:Ci.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{P==null||P.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:Ci.ID_CARD_IMAGE_BASE64}),R.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*(){P==null||P.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*(){P==null||P.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),P==null||P.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*(){P==null||P.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:Ci.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{P==null||P.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:Ci.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),R.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*(){P==null||P.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",Su);var pr={exports:{}};var q4=pr.exports,Lu;function V4(){return Lu||(Lu=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(E,B){return E>B},greaterThanOrEqualTo:function(E,B){return E>=B},equalTo:function(E,B){return E===B},lessThan:function(E,B){return E<B},lessThanOrEqualTo:function(E,B){return E<=B},divisibleBy:function(E,B){return E%B===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(q4,t,e,null)}(pr,pr.exports)),pr.exports}var j4=V4();const z4=te(j4);function Xs(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: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`
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 Tu extends HTMLElement{constructor(){super(),this.templateString=G4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(t){switch(t){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const r=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);r.hidden=!1,this.shadowRoot.replaceChild(r,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(r);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const t=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),t.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const t=window.parent;[t.parent,t].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(r=>r.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(r=>r.remove())}handleIdNumberValidationErrors(t){Object.keys(t).forEach(r=>{const n=this.activeScreen.querySelector(`#${r}`);n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",`${r}-hint`);const o=document.createElement("div");o.setAttribute("id",`${r}-hint`),o.setAttribute("class","validation-message"),o.textContent=t[r][0],n.insertAdjacentElement("afterend",o)})}handleActiveScreenErrors(t){const i=this.activeScreen.querySelector('[type="submit"]'),r=document.createElement("div");r.setAttribute("class","validation-message"),r.textContent=t,i.insertAdjacentElement("beforebegin",r)}validateIdNumber(t){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},r=z4({id_number:t},i);return r&&this.handleIdNumberValidationErrors(r),r}queryOtpModes(t){return S(this,null,function*(){t&&(t.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const r={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},n=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const o=yield Xs(n,r),s=yield o.json();this.toggleLoading(),o.ok?(this.sessionId=s.session_id,this.modes=s.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",s.modes)):this.handleActiveScreenErrors(s.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}}})}selectOtpMode(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,n=>n.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const n=yield Xs(r,i),o=yield n.json();this.toggleLoading(),n.ok?(this.selectedOtpDeliveryMode=this.modes.filter(s=>s[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(o.error)}catch(n){this.toggleLoading(),this.handleActiveScreenErrors(n.message)}})}submitOtp(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const n=yield Xs(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")||lt()||"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",Tu);class Z4 extends HTMLElement{constructor(){super();const t=document.createElement("template");t.innerHTML=`
1832
+ `}class Iu extends HTMLElement{constructor(){super(),this.templateString=G4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(t){switch(t){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const r=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);r.hidden=!1,this.shadowRoot.replaceChild(r,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(r);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const t=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),t.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const t=window.parent;[t.parent,t].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(r=>r.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(r=>r.remove())}handleIdNumberValidationErrors(t){Object.keys(t).forEach(r=>{const n=this.activeScreen.querySelector(`#${r}`);n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",`${r}-hint`);const o=document.createElement("div");o.setAttribute("id",`${r}-hint`),o.setAttribute("class","validation-message"),o.textContent=t[r][0],n.insertAdjacentElement("afterend",o)})}handleActiveScreenErrors(t){const i=this.activeScreen.querySelector('[type="submit"]'),r=document.createElement("div");r.setAttribute("class","validation-message"),r.textContent=t,i.insertAdjacentElement("beforebegin",r)}validateIdNumber(t){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},r=z4({id_number:t},i);return r&&this.handleIdNumberValidationErrors(r),r}queryOtpModes(t){return S(this,null,function*(){t&&(t.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const r={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},n=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const o=yield Ks(n,r),s=yield o.json();this.toggleLoading(),o.ok?(this.sessionId=s.session_id,this.modes=s.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",s.modes)):this.handleActiveScreenErrors(s.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}}})}selectOtpMode(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,n=>n.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const n=yield Ks(r,i),o=yield n.json();this.toggleLoading(),n.ok?(this.selectedOtpDeliveryMode=this.modes.filter(s=>s[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(o.error)}catch(n){this.toggleLoading(),this.handleActiveScreenErrors(n.message)}})}submitOtp(t){return S(this,null,function*(){t.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},r=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const n=yield Ks(r,i),o=yield n.json();this.toggleLoading(),n.ok?this.handleTotpConsentGrant(t):this.handleActiveScreenErrors(o.error)}catch(n){this.toggleLoading(),this.handleActiveScreenErrors(n.message)}})}toggleLoading(){const t=this.activeScreen.querySelector('button[type="submit"]'),i=t.querySelector(".text"),r=t.querySelector("svg"),n=t.querySelector(".spinner");t.toggleAttribute("disabled"),i.toggleAttribute("hidden"),r.toggleAttribute("hidden"),n.toggleAttribute("hidden")}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get idNumber(){return localStorage.getItem("idNumber")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get token(){return this.getAttribute("token")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}handleTotpConsentGrant(){const t=new CustomEvent("end-user-consent.totp.granted",{detail:{consented:{contact_information:!0,document_information:!0,personal_details:!0},id_number:this.idNumber,session_id:this.sessionId}});this.dispatchEvent(t)}handleTotpConsentContactMethodsOutdated(){const t="end-user-consent.totp.denied.contact-methods-outdated",i=new CustomEvent(t,{detail:{data:{id_number:this.idNumber,session_id:this.sessionId},message:t}});this.dispatchEvent(i)}}"customElements"in window&&!window.customElements.get("totp-consent")&&window.customElements.define("totp-consent",Iu);class Z4 extends HTMLElement{constructor(){super();const t=document.createElement("template");t.innerHTML=`
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"/>
@@ -2163,7 +2163,7 @@ ${this.hideAttribution?"":`
2163
2163
  color: var(--color-danger);
2164
2164
  }
2165
2165
  </style>
2166
- ${ut(this.themeColor)}
2166
+ ${dt(this.themeColor)}
2167
2167
  <div id='consent-screen' dir='${this.direction}'>
2168
2168
  <section class='flow center'>
2169
2169
  <div class="nav ${this.hideBack?"justify-right":""}">
@@ -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 Mu extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=W4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.rejectButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",r=>this.handleConsentRejection(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",r=>this.handleBackEvents(r)),this.backButton.addEventListener("click",r=>{this.handleBackEvents(r)}),i.forEach(r=>{r.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get direction(){return this.getAttribute("dir")||lt()||"ltr"}get token(){return this.getAttribute("token")}handleConsentGrant(t){const i=t.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(t){const i=new CustomEvent(t.type,{detail:Re({},t.detail)});this.dispatchEvent(i)}handleBackEvents(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",Mu);function X4(){return`
2426
+ `}class Fu extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=W4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.rejectButton.addEventListener("click",r=>this.handleConsentGrant(r)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",r=>this.handleConsentRejection(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",r=>this.handleTotpConsentEvents(r)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",r=>this.handleBackEvents(r)),this.backButton.addEventListener("click",r=>{this.handleBackEvents(r)}),i.forEach(r=>{r.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get token(){return this.getAttribute("token")}handleConsentGrant(t){const i=t.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(t){const i=new CustomEvent(t.type,{detail:Re({},t.detail)});this.dispatchEvent(i)}handleBackEvents(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",Fu);function X4(){return`
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"
@@ -2759,11 +2759,11 @@ ${this.hideAttribution?"":`
2759
2759
  text-align: justify;
2760
2760
  }
2761
2761
  </style>
2762
- ${ut(this.themeColor)}
2762
+ ${dt(this.themeColor)}
2763
2763
  <div id="selfie-capture-instruction-screen" class="center" dir="${this.direction}">
2764
2764
  <div class="content-root">
2765
2765
  <div class="content-header">
2766
- <smileid-navigation theme-color=${this.themeColor} ${this.hideBack?"hide-back":""} ${this.showNavigation?"":"hidden"}></smileid-navigation>
2766
+ ${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
2767
2767
  </div>
2768
2768
  <div class="content-body">
2769
2769
  <header>
@@ -3019,7 +3019,7 @@ ${this.hideAttribution?"":`
3019
3019
  </div>
3020
3020
  </div>
3021
3021
  </div>
3022
- `}class K4 extends HTMLElement{constructor(){super(),this.templateString=X4.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.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),this.navigation.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")||lt()||"ltr"}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",K4);function Y4(){return`
3022
+ `}class K4 extends HTMLElement{constructor(){super(),this.templateString=X4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){var i,r;this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.handleCloseEvents()},!1)}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.cancelled"))}get showNavigation(){return this.hasAttribute("show-navigation")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",K4);function Y4(){return`
3023
3023
  <style>
3024
3024
  .retake-photo.button[data-variant~="ghost"] {
3025
3025
  color: #FF5805;
@@ -3071,9 +3071,9 @@ ${this.hideAttribution?"":`
3071
3071
  margin-top: 0;
3072
3072
  }
3073
3073
  </style>
3074
- ${ut(this.themeColor)}
3074
+ ${dt(this.themeColor)}
3075
3075
  <div id='selfie-capture-review-screen' class='center' dir='${this.direction}'>
3076
- <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
3076
+ ${this.showNavigation?"<smileid-navigation hide-back></smileid-navigation>":""}
3077
3077
  <h1 class="header-title title-color font-bold">
3078
3078
  ${y("selfie.review.question")}
3079
3079
  </h1>
@@ -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")||lt()||"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(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",J4);var mr,z,Iu,Fu,si,Bu,Du,Ru,Ou,Ks,Ys,Js,gr={},Pu=[],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 Qs(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?++Iu:n,__i:-1,__u:0};return n==null&&z.vnode!=null&&z.vnode(o),o}function qt(e){return e.children}function yr(e,t){this.props=e,this.context=t}function xi(e,t){if(t==null)return e.__?xi(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"?xi(e):null}function $u(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 $u(e)}}function Nu(e){(!e.__d&&(e.__d=!0)&&si.push(e)&&!Xr.__r++||Bu!=z.debounceRendering)&&((Bu=z.debounceRendering)||Du)(Xr)}function Xr(){for(var e,t,i,r,n,o,s,a=1;si.length;)si.length>a&&si.sort(Ru),e=si.shift(),a=si.length,e.__d&&(i=void 0,r=void 0,n=(r=(t=e).__v).__e,o=[],s=[],t.__P&&((i=vt({},r)).__v=r.__v+1,z.vnode&&z.vnode(i),ea(t.__P,i,r,t.__n,t.__P.namespaceURI,32&r.__u?[n]:null,o,n==null?xi(r):n,!!(32&r.__u),s),i.__v=r.__v,i.__.__k[i.__i]=i,zu(o,i,s),r.__e=r.__=null,i.__e!=n&&$u(i)));Xr.__r=0}function Hu(e,t,i,r,n,o,s,a,c,l,d){var u,h,f,p,m,v,g,b=r&&r.__k||Pu,w=t.length;for(c=ef(i,t,b,c,w),u=0;u<w;u++)(f=i.__k[u])!=null&&(h=f.__i==-1?gr:b[f.__i]||gr,f.__i=u,v=ea(e,f,h,n,o,s,a,c,l,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ia(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=Uu(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 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===void 0&&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=xi(a)),Zu(a,a));return r}function Uu(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=Uu(n[o],t,i,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=xi(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function qu(e,t){return t=t||[],e==null||typeof e=="boolean"||(vr(e)?e.some(function(i){qu(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 Vu(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||Vu(e.style,t,"");if(i)for(t in i)r&&i[t]==r[t]||Vu(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Ou,"$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=Ks,e.addEventListener(t,o?Js:Ys,o)):e.removeEventListener(t,o?Js:Ys,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 ju(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ks++;else if(t.t<i.u)return;return i(z.event?z.event(t):t)}}}function ea(e,t,i,r,n,o,s,a,c,l){var d,u,h,f,p,m,v,g,b,w,E,B,_,M,k,O,U,F=t.type;if(t.constructor!==void 0)return null;128&i.__u&&(c=!!(32&i.__u),o=[a=t.__e=i.__e]),(d=z.__b)&&d(t);e:if(typeof F=="function")try{if(g=t.props,b="prototype"in F&&F.prototype.render,w=(d=F.contextType)&&r[d.__c],E=d?w?w.props.value:d.__:r,i.__c?v=(u=t.__c=i.__c).__=u.__E:(b?t.__c=u=new F(g,E):(t.__c=u=new yr(g,E),u.constructor=F,u.render=nf),w&&w.sub(u),u.props=g,u.state||(u.state={}),u.context=E,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&F.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=vt({},u.__s)),vt(u.__s,F.getDerivedStateFromProps(g,u.__s))),f=u.props,p=u.state,u.__v=t,h)b&&F.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&F.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,E),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,E)===!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(K){K&&(K.__=t)}),B=0;B<u._sb.length;B++)u.__h.push(u._sb[B]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,E),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,m)})}if(u.context=E,u.props=g,u.__P=e,u.__e=!1,_=z.__r,M=0,b){for(u.state=u.__s,u.__d=!1,_&&_(t),d=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do u.__d=!1,_&&_(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++M<25);u.state=u.__s,u.getChildContext!=null&&(r=vt(vt({},r),u.getChildContext())),b&&!h&&u.getSnapshotBeforeUpdate!=null&&(m=u.getSnapshotBeforeUpdate(f,p)),O=d,d!=null&&d.type===qt&&d.key==null&&(O=Gu(d.props.children)),a=Hu(e,vr(O)?O:[O],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(K){if(t.__v=null,c||o!=null)if(K.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(U=o.length;U--;)Qs(o[U]);ta(t)}else t.__e=i.__e,t.__k=i.__k,K.then||ta(t);z.__e(K,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=z.diffed)&&d(t),128&t.__u?void 0:a}function ta(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ta)}function zu(e,t,i){for(var r=0;r<i.length;r++)ia(i[r],i[++r],i[++r]);z.__c&&z.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){z.__e(o,n.__v)}})}function Gu(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:vr(e)?e.map(Gu):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&&(z.__m&&z.__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=""),Hu(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&&xi(i,0),a,c),o!=null)for(l=o.length;l--;)Qs(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 ia(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){z.__e(n,i)}}function Zu(e,t,i){var r,n;if(z.unmount&&z.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ia(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){z.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&Zu(r[n],t,i||typeof e.type!="function");i||Qs(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),z.__&&z.__(e,t),n=(r=typeof i=="function")?null:i&&i.__k||t.__k,o=[],s=[],ea(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 Wu(e,t){Yr(e,t,Wu)}function Xu(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=Pu.slice,z={__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}},Iu=0,Fu=function(e){return e!=null&&e.constructor===void 0},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),Nu(this))},yr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Nu(this))},yr.prototype.render=qt,si=[],Du=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ru=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,Ou=/(PointerCapture)$|Capture$/i,Ks=0,Ys=ju(!1),Js=ju(!0);var of=0;function $(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 z.vnode&&z.vnode(l),l}var _r,he,ra,Ku,Jr=0,Yu=[],ve=z,Ju=ve.__b,Qu=ve.__r,e2=ve.diffed,t2=ve.__c,i2=ve.unmount,r2=ve.__;function na(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(s2,e)}function sf(e,t,i){var r=na(_r++,2);if(r.t=e,!r.__c&&(r.__=[s2(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 dt(e,t){var i=na(_r++,3);!ve.__s&&o2(i.__H,t)&&(i.__=e,i.u=t,he.__H.__h.push(i))}function ke(e){return Jr=5,Qr(function(){return{current:e}},[])}function Qr(e,t){var i=na(_r++,7);return o2(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function af(){for(var e;e=Yu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(oa),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){he=null,Ju&&Ju(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),r2&&r2(e,t)},ve.__r=function(e){Qu&&Qu(e),_r=0;var t=(he=e.__c).__H;t&&(ra===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(oa),t.__h=[],_r=0)),ra=he},ve.diffed=function(e){e2&&e2(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Yu.push(t)!==1&&Ku===ve.requestAnimationFrame||((Ku=ve.requestAnimationFrame)||cf)(af)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),ra=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.__||oa(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],ve.__e(r,i.__v)}}),t2&&t2(e,t)},ve.unmount=function(e){i2&&i2(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 n2=typeof requestAnimationFrame=="function";function cf(e){var t,i=function(){clearTimeout(r),n2&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,35);n2&&(t=requestAnimationFrame(i))}function en(e){var t=he,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),he=t}function oa(e){var t=he;e.__c=e.__(),he=t}function o2(e,t){return!e||e.length!==t.length||t.some(function(i,r){return i!==e[r]})}function s2(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=dl(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)),...qu(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 sa(){return(sa=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 Xu(t,i)}function pf(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Lt(ff,sa({},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[a2(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(c2,{name:d},l):n[s]=l}var u=r?Lt(c2,null,n):n;return Lt(r||i.nodeName.toLowerCase(),o,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Wu:Yr)(this._vdom,this._root)}function a2(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[a2(e)]=i,this._vdom=Xu(this._vdom,r),Yr(this._vdom,this._root)}}function gf(){Yr(this._vdom=null,this._root)}function c2(e,t){var i=this;return Lt("slot",sa({},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 l2(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 Ai=(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,aa++;i!==void 0;){var r=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&f2(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=r}}if(aa=0,Vt--,t)throw e}}function bf(e){if(Vt>0)return e();Vt++;try{return e()}finally{tn()}}var G=void 0;function u2(e){var t=G;G=void 0;try{return e()}finally{G=t}}var wr=void 0,Vt=0,aa=0,rn=0;function d2(e){if(G!==void 0){var t=e.n;if(t===void 0||t.t!==G)return t={i:0,S:e,p:G.s,n:void 0,t:G,e:void 0,x:void 0,r:t},G.s!==void 0&&(G.s.n=t),G.s=t,e.n=t,32&G.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=G.s,t.n=void 0,G.s.n=t,G.s=t),t}}function Ae(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}Ae.prototype.brand=vf,Ae.prototype.h=function(){return!0},Ae.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:u2(function(){var r;(r=t.W)==null||r.call(t)}))},Ae.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&&u2(function(){var n;(n=t.Z)==null||n.call(t)}))}},Ae.prototype.subscribe=function(e){var t=this;return Cr(function(){var i=t.value,r=G;G=void 0;try{e(i)}finally{G=r}})},Ae.prototype.valueOf=function(){return this.value},Ae.prototype.toString=function(){return this.value+""},Ae.prototype.toJSON=function(){return this.value},Ae.prototype.peek=function(){var e=G;G=void 0;try{return this.value}finally{G=e}},Object.defineProperty(Ae.prototype,"value",{get:function(){var e=d2(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(aa>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 h2(e,t){return new Ae(e,t)}function f2(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 p2(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 m2(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 ci(e,t){Ae.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}ci.prototype=new Ae,ci.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&&!f2(this))return this.f&=-2,!0;var e=G;try{p2(this),G=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 G=e,m2(this),this.f&=-2,!0},ci.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)}Ae.prototype.S.call(this,e)},ci.prototype.U=function(e){if(this.t!==void 0&&(Ae.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)}},ci.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(ci.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=d2(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ca(e,t){return new ci(e,t)}function g2(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Vt++;var i=G;G=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,la(e),r}finally{G=i,tn()}}}function la(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,g2(e)}function yf(e){if(G!==this)throw new Error("Out-of-order effect");m2(this),G=e,this.f&=-2,8&this.f&&la(this),tn()}function ki(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ki.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()}},ki.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,g2(this),p2(this),Vt++;var e=G;return G=this,yf.bind(this,e)},ki.prototype.N=function(){2&this.f||(this.f|=2,this.o=wr,wr=this)},ki.prototype.d=function(){this.f|=8,1&this.f||la(this)},ki.prototype.dispose=function(){this.d()};function Cr(e){var t=new ki(e);try{t.c()}catch(r){throw t.d(),r}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var v2,nn,ua,b2=[];Cr(function(){v2=this.N})();function Si(e,t){z[e]=t.bind(null,z[e]||function(){})}function on(e){ua&&ua(),ua=e&&e.S()}function y2(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=ca(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),d=ca(function(){return!Array.isArray(l.value)&&!Fu(l.value)}),u=Cr(function(){if(this.N=_2,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}y2.displayName="_st",Object.defineProperties(Ae.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:y2},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 Ae&&(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=h2(i);return{o:function(s,a){o.value=s,r=a},d:Cr(function(){this.N=_2;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 h2(e,t)},[])}function da(e,t){var i=ke(e);return i.current=e,nn.__$f|=4,Qr(function(){return ca(function(){return i.current()},t)},[])}var wf=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Cf(){bf(function(){for(var e;e=b2.shift();)v2.call(e)})}function _2(){b2.push(this)===1&&(z.requestAnimationFrame||wf)(Cf)}var ha,w2;function Ef(){if(w2)return ha;w2=1;var e=oi(),t=function(){return e.Date.now()};return ha=t,ha}var fa,C2;function xf(){if(C2)return fa;C2=1;var e=/\s/;function t(i){for(var r=i.length;r--&&e.test(i.charAt(r)););return r}return fa=t,fa}var pa,E2;function Af(){if(E2)return pa;E2=1;var e=xf(),t=/^\s+/;function i(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return pa=i,pa}var ma,x2;function kf(){if(x2)return ma;x2=1;var e=ar(),t=wi(),i="[object Symbol]";function r(n){return typeof n=="symbol"||t(n)&&e(n)==i}return ma=r,ma}var ga,A2;function Sf(){if(A2)return ga;A2=1;var e=Af(),t=gt(),i=kf(),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 ga=c,ga}var va,k2;function Lf(){if(k2)return va;k2=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,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 E(N){var ae=d,me=u;return d=u=void 0,v=N,f=a.apply(me,ae),f}function B(N){return v=N,p=setTimeout(k,c),g?E(N):f}function _(N){var ae=N-m,me=N-v,Le=c-ae;return b?o(Le,h-me):Le}function M(N){var ae=N-m,me=N-v;return m===void 0||ae>=c||ae<0||b&&me>=h}function k(){var N=t();if(M(N))return O(N);p=setTimeout(k,_(N))}function O(N){return p=void 0,w&&d?E(N):(d=u=void 0,f)}function U(){p!==void 0&&clearTimeout(p),v=0,d=m=u=p=void 0}function F(){return p===void 0?f:O(t())}function K(){var N=t(),ae=M(N);if(d=arguments,u=this,m=N,ae){if(p===void 0)return B(m);if(b)return clearTimeout(p),p=setTimeout(k,c),E(m)}return p===void 0&&(p=setTimeout(k,c)),f}return K.cancel=U,K.flush=F,K}return va=s,va}var ba,S2;function Tf(){if(S2)return ba;S2=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 ba=r,ba}var Mf=Tf();const L2=te(Mf),If=(e="user")=>{var v;const t=ke(null),i=ke(null),[r,n]=ai(e),[o,s]=ai(!1),a=ke(null),c=ke(!1),l=ke(new Set),d=g=>{a.current=g};dt(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const w=setTimeout(()=>{var E;(E=a.current)==null||E.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]),dt(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const u=(g,b)=>S(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(U=>U.stop()),i.current=null),t.current&&(t.current.srcObject=null);const w=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||r}});i.current=w;const _=w.getVideoTracks()[0].getSettings().facingMode;(_&&_!==(g||r)||_&&_!==r)&&n(_);const O=(yield navigator.mediaDevices.enumerateDevices()).find(U=>U.kind==="videoinput"&&w.getVideoTracks()[0].getSettings().deviceId===U.deviceId);b==null||b(O==null?void 0:O.label),t.current&&(t.current.srcObject=w,yield t.current.play())}catch(w){console.error("Failed to start camera:",w)}}),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(w=>w.stop()),i.current=null),yield u(g)}catch(w){n(b),c.current=!1;try{yield u(b)}catch(E){console.error("Failed to restore previous camera:",E)}}}),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",E=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||w||E,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:E}=f();let B=null,_=null;try{const k=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});B=(g=k.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,k.getTracks().forEach(O=>O.stop())}catch(k){}try{const k=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});_=(b=k.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,k.getTracks().forEach(O=>O.stop())}catch(k){}if(!(B&&_&&B!==_)){s(!1);return}s(!E)}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 Li=typeof self!="undefined"?self:{};function li(){throw Error("Invalid UTF8")}function T2(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let sn,ya;const Ff=typeof TextDecoder!="undefined";let Bf;const Df=typeof TextEncoder!="undefined";function M2(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 _a,an;e:{for(var I2=["CLOSURE_FLAGS"],wa=Li,Ca=0;Ca<I2.length;Ca++)if((wa=wa[I2[Ca]])==null){an=null;break e}an=wa}var Er,F2=an&&an[610401301];_a=F2!=null&&F2;const B2=Li.navigator;function Ea(e){return!!_a&&!!Er&&Er.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Je(e){var t;return(t=Li.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function jt(){return!!_a&&!!Er&&Er.brands.length>0}function xa(){return jt()?Ea("Chromium"):(Je("Chrome")||Je("CriOS"))&&!(!jt()&&Je("Edge"))||Je("Silk")}function cn(e){return cn[" "](e),e}Er=B2&&B2.userAgentData||null,cn[" "]=function(){};var Rf=!jt()&&(Je("Trident")||Je("MSIE"));!Je("Android")||xa(),xa(),Je("Safari")&&(xa()||!jt()&&Je("Coast")||!jt()&&Je("Opera")||!jt()&&Je("Edge")||(jt()?Ea("Microsoft Edge"):Je("Edg/"))||jt()&&Ea("Opera"));var D2={},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}R2();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 R2(){if(!xr){xr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const r=e.concat(t[i].split(""));D2[i]=r;for(let n=0;n<r.length;n++){const o=r[n];xr[o]===void 0&&(xr[o]=n)}}}}var O2=typeof Uint8Array!="undefined",P2=!Rf&&typeof btoa=="function";function $2(e){if(!P2){var t;t===void 0&&(t=0),R2(),t=D2[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 N2=/[-_.]/g,Pf={"-":"+",_:"/",".":"="};function $f(e){return Pf[e]||""}function H2(e){if(!P2)return Of(e);N2.test(e)&&(e=e.replace(N2,$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 ui(e){return O2&&e!=null&&e instanceof Uint8Array}var Ti={};function di(){return Nf||(Nf=new Tt(null,Ti))}function Aa(e){U2(Ti);var t=e.g;return(t=t==null||ui(t)?t:typeof t=="string"?H2(t):null)==null?t:e.g=t}var Tt=class{h(){return new Uint8Array(Aa(this)||0)}constructor(e,t){if(U2(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Nf,ka;function U2(e){if(e!==Ti)throw Error("illegal external caller")}function q2(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Sa(e){return q2(e=Error(e),"warning"),e}function La(e){if(e!=null){var t=ka!=null?ka:ka={},i=t[e]||0;i>=5||(t[e]=i+1,q2(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),V2=Mi(void 0,"0di"),Ar=Mi(void 0,"1oa"),Ii=Mi(void 0,Symbol()),Uf=Mi(void 0,"0actk"),j2=Mi(void 0,"8utk");const L=ln?Hf:"Ea",z2={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},G2=Object.defineProperties;function un(e,t){ln||L in e||G2(e,z2),e[L]|=t}function be(e,t){ln||L in e||G2(e,z2),e[L]=t}function Fi(e){return un(e,34),e}function qf(e,t){be(t,-15615&(0|e))}function Ta(e,t){be(t,-15581&(34|e))}function dn(){return typeof BigInt=="function"}function Oe(e){return Array.prototype.slice.call(e)}var Ma,kr={};function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Ia(e,t){if(e!=null){if(typeof e=="string")e=e?new Tt(e,Ti):di();else if(e.constructor!==Tt)if(ui(e))e=e.length?new Tt(new Uint8Array(e),Ti):di();else{if(!t)throw Error();e=void 0}}return e}const Z2=[];function zt(e){if(2&e)throw Error()}be(Z2,55),Ma=Object.freeze(Z2);class W2{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 Fa(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"),X2=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(X2(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":X2(e)?e.trim()||"0":String(e)}var Ba=fn(e=>pn?e>=Zf&&e<=Xf:e[0]==="-"?K2(e,Gf):K2(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 K2(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 Y2,Y=0,ue=0;function J2(e){const t=e>>>0;Y=t,ue=(e-t)/4294967296>>>0}function hi(e){if(e<0){J2(-e);const[t,i]=Pa(Y,ue);Y=t>>>0,ue=i>>>0}else J2(e)}function Da(e){const t=Y2||(Y2=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ue=0,Y=t.getUint32(0,!0)}function Ra(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:Sr(e,t)}function Oa(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Ra(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+Q2(i)+Q2(e));return i}function Q2(e){return e=String(e),"0000000".slice(e.length)+e}function ed(){var e=Y,t=ue;if(2147483648&t)if(dn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,r]=Pa(e,t);e="-"+Sr(i,r)}else e=Sr(e,t);return e}function mn(e){if(e.length<16)hi(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]=Pa(Y,ue);Y=r,ue=n}}}function Pa(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 td(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 id(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 rd(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function nd(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 od(e){return nd(e)?e:(mn(e),ed())}function $a(e){return e=Bi(e),Zt(e)||(hi(e),e=Oa(Y,ue)),e}function sd(e){var t=Bi(Number(e));return Zt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),od(e))}function ad(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(od(e)))}function cd(e){if(Zt(e))e=Gt($a(e));else{if(e=Bi(e),Zt(e))e=String(e);else{const t=String(e);nd(t)?e=t:(hi(e),e=ed())}e=Gt(e)}return e}function Na(e){return e==null?e:typeof e=="bigint"?(Ba(e)?e=Number(e):(e=Lr(64,e),e=Ba(e)?Number(e):String(e)),e):Tr(e)?typeof e=="number"?$a(e):sd(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)),rd(e)||(mn(e),e=Sr(Y,ue))),e;if(t==="number")return(e=Bi(e))>=0&&Zt(e)?e:function(i){if(i<0){hi(i);var r=Sr(Y,ue);return i=Number(r),Zt(i)?i:r}return rd(r=String(i))?r:(hi(i),Ra(Y,ue))}(e)}}function ld(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 Ha(e,t,i,r){if(e!=null&&typeof e=="object"&&e.W===kr)return e;if(!Array.isArray(e))return i?2&r?((e=t[V2])||(Fi((e=new t).u),e=t[V2]=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 Sa("int64");switch(typeof t){case"string":t=ad(t);break e;case"bigint":t=Gt(Lr(64,t));break e;default:t=cd(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?Gt(Lr(64,t)):Tr(t)?e==="string"?ad(t):cd(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 Ua{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(Ua.prototype,Map.prototype),Object.defineProperties(Ua.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Ua):class extends Map{constructor(){super()}};function ud(e){return e}function qa(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var bt=class extends op{constructor(e,t,i=ud,r=ud){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(){qa(this),super.clear()}delete(e){return qa(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new W2(e,cp,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new W2(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 qa(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=Ha(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,dd,up;function hd(){return lp||(lp=new bt(Fi([]),void 0,void 0,void 0,rp))}function Va(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=Va(l[v],d,u,h,f);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=Va(r[p],t,i,s,n);r[p]=l,l!=null&&(a=p+1)}return a<c&&(r.length=a),i&&((e=Fa(e))&&(r[Ii]=Oe(e)),i(o,r)),r}function dp(e){return Va(e,ja,void 0,void 0,!1)}function ja(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Ba(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(ui(e))return ui(e)&&La(j2),$2(e);if(e.W===kr)return fd(e);if(e instanceof Tt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=$2(t)}return e instanceof bt?e.La():void 0}return e}function fd(e){var t=e.u;e=bn(t,ja,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=pd(e,t[0],t[1],i?1:2),t!==dd&&i&&un(e,8192),e}function pd(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||La(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 za(e,t,i=Ta){if(e!=null){if(O2&&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,za,4&r?Ta:i,!0,!0))}return e.W===kr?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(za)),e=new bt(i,e.I,e.S,e.X)),e}}function yn(e,t,i){const r=i||2&t?Ta: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=Fa(o))&&(c[Ii]=Oe(o)),c}(e,t,o=>za(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 md(e){let t=0|(e=e.u)[L];const i=Mt(e,t,1),r=Ia(i,!0);return r!=null&&r!==i&&ce(e,t,1,r),r}function fi(){return Vf===void 0?2:4}function pi(e,t,i,r,n){const o=e.u,s=2&(e=0|o[L])?1:r;n=!!n;let a=0|(r=Ga(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=Za(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 Ga(e,t,i){return e=Mt(e,t,i),Array.isArray(e)?e:Ma}function Za(e,t){return e===0&&(e=Bt(e,t)),1|e}function It(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function gd(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 Wa(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=Ga(e,t,i);const o=n!==Ma;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&Za(a,t),a=Kt(r?-17&a:16|a,t,!0),a!==s&&be(n,a)}return n}function Xa(e,t){var i=gh;return Ya(Ka(e=e.u),e,0|e[L],i)===t?t:-1}function Ka(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 vd(e,t,i,r){const n=Ka(e),o=Ya(n,e,t,i);return o!==r&&(o&&(t=ce(e,t,o)),n.set(i,r)),t}function Ya(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 Ja(e,t,i){let r=0|e[L];const n=Mt(e,r,i);let o;if(n!=null&&n.W===kr)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 bd(e,t,i){let r=0|(e=e.u)[L];const n=Mt(e,r,i);return(t=Ha(n,t,!1,r))!==n&&t!=null&&ce(e,r,i,t),t}function V(e,t,i){if((t=bd(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 yd(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=Ga(e,t,r))[L];if(!(a=!!(4&l))){var d=n,u=t;const h=!!(2&(l=Za(l,t)));h&&(u|=2);let f=!h,p=!0,m=0,v=0;for(;m<d.length;m++){const g=Ha(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 yd(e,r,t,i,fi(),!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=Ka(e);if(Ya(o,e,n,i)!==t)break e;o.set(i,0)}else n=vd(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]),pi(e,t,Oi,2,!0).push(ld(i))}function En(e,t,i,r){const n=0|e.u[L];zt(n),e=yd(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 Qe(e,t){return Di(Pi(e,t))}function et(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 Sa("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=ld(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 _d(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Qa(){return Error("Failed to read varint, encoding is invalid.")}function wd(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function ec(e){if(typeof e=="string")return{buffer:H2(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 tc(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(mi(e,a),i<128)return t(r>>>0,n>>>0);throw Qa()}function ic(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 mi(e,i),!!(127&t)}throw Qa()}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 Qa();return mi(e,i),n}function Dt(e){return Yt(e)>>>0}function rc(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],mi(e,e.g+4),(r<<0|n<<8|o<<16|t<<24)>>>0}function nc(e){var t=rc(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 oc(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=ec(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function mi(e,t){if(e.g=t,t>e.l)throw wd(e.l,t)}function Cd(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 wd(t,e.l-i);return e.g=r,i}function Ed(e,t){if(t==0)return di();var i=Cd(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?di():new Tt(i,Ti)}bt.prototype.toJSON=void 0;var xd=[];function Ad(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 _d(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 An(e){switch(e.h){case 0:e.h!=0?An(e):ic(e.g);break;case 1:mi(e=e.g,e.g+8);break;case 2:if(e.h!=2)An(e);else{var t=Dt(e.g);mi(e=e.g,e.g+t)}break;case 5:mi(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Ad(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}An(e)}break;default:throw _d(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 sc(e){var t=Dt(e.g),i=Cd(e=e.g,t);if(e=e.h,Ff){var r,n=e;(r=ya)||(r=ya=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&&(ya=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?li():(a=e[o++],s<194||(192&a)!=128?(o--,li()):i.push((31&s)<<6|63&a)):s<240?o>=t-1?li():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(r=e[o++]))!=128?(o--,li()):i.push((15&s)<<12|(63&a)<<6|63&r)):s<=244?o>=t-2?li():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(r=e[o++]))!=128||(192&(n=e[o++]))!=128?(o--,li()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&n,s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))):li(),i.length>=8192&&(c=T2(c,i),i.length=0)}o=T2(c,i)}return o}function kd(e){const t=Dt(e.g);return Ed(e.g,t)}function kn(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 x=class{constructor(e,t){this.u=pd(e,t)}toJSON(){try{var e=fd(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 Sd(e){return e?/^\d+$/.test(e)?(mn(e),new ac(Y,ue)):null:fp||(fp=new ac(0,0))}x.prototype.W=kr,x.prototype.toString=function(){return this.u.toString()};var ac=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let fp;function Ld(e){return e?/^-?\d+$/.test(e)?(mn(e),new cc(Y,ue)):null:pp||(pp=new cc(0,0))}var cc=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 lc(e,t){return He(e,t,2),t=e.g.end(),Ui(e,t),t.push(e.h),t}function uc(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=lc(e,t),r(i,e),uc(e,t))}function ft(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var dc=ft(),Td=ft(),hc=ft(),fc=ft(),Md=ft(),Id=ft(),pc=ft(),Fd=ft(),Bd=ft(),qi=class{constructor(e,t,i){this.g=e,this.h=t,e=dc,this.l=!!e&&i===e||!1}};function In(e,t){return new qi(e,t,dc)}function Dd(e,t,i,r,n){Mn(e,i,$d(t,r),n)}const mp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Ja(t,r,i),n),!0)},Dd),gp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Ja(t,r,i),n),!0)},Dd);var Fn=Symbol(),mc=Symbol(),Rd=Symbol(),Od=Symbol();let Bn,Dn;function gi(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 dd||(dd=[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 Pd(e){return Array.isArray(e)?e[0]instanceof qi?e:[gp,e]:[e,void 0]}function $d(e,t){return e instanceof x?e.u:Array.isArray(e)?Xt(e,t,!1):void 0}function gc(e,t,i,r){const n=i.g;e[t]=r?(o,s,a)=>n(o,s,a,r):n}function vc(e,t,i,r,n){const o=i.g;let s,a;e[t]=(c,l,d)=>o(c,l,d,a||(a=gi(mc,gc,vc,r).T),s||(s=bc(r)),n)}function bc(e){let t=e[Rd];if(t!=null)return t;const i=gi(mc,gc,vc,e);return t=i.la?(r,n)=>Bn(r,n,i):(r,n)=>{const o=0|r[L];for(;Ad(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,An(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=Ed(a.g,c)),s=r,a&&((c=s[Ii])?c.push(a):s[Ii]=[a]))}return 8192&o&&Fi(r),!0},e[Rd]=t}function vp(e){const t=(e=Pd(e))[0].g;if(e=e[1]){const i=bc(e),r=gi(mc,gc,vc,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=gi(Fn,Rn,On,r).T),n||(n=Nd(r)))}function Nd(e){let t=e[Od];if(!t){const i=gi(Fn,Rn,On,e);t=(r,n)=>Hd(r,n,i),e[Od]=t}return t}function Hd(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=Pd(c))[0].h;if(c=c[1]){const d=Nd(c),u=gi(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=Fa(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=gd(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 Ud(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 sd(r);if(n==="number")return $a(r)}}(t),t!=null&&(typeof t=="string"&&Ld(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,hi(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=Ld(t),Ni(e.g,i.h,i.g)}}function qd(e,t,i){(t=Di(t))!=null&&t!=null&&(He(e,i,0),Ln(e.g,t))}function Vd(e,t,i){(t=td(t))!=null&&(He(e,i,0),e.g.g.push(t?1:0))}function jd(e,t,i){(t=Oi(t))!=null&&Tn(e,i,M2(t))}function zd(e,t,i,r,n){Mn(e,i,$d(t,r),n)}function Gd(e,t,i){t==null||typeof t=="string"||t instanceof Tt||(ui(t)?ui(t)&&La(j2):t=void 0),t!=null&&Tn(e,i,ec(t).buffer)}function Zd(e,t,i){return(e.h===5||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?kn(e,nc,t):t.push(nc(e.g)),!0)}var Rt=Me(function(e,t,i){if(e.h!==1)return!1;var r=e.g;e=rc(r);const n=rc(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=Y2||(Y2=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,nc(e.g)),!0)},function(e,t,i){(t=Wt(t))!=null&&(He(e,i,5),e=e.g,Da(t),Br(e,Y))},pc),yp=ji(Zd,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,Da(o),Br(r,Y))}},pc),yc=ji(Zd,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,Da(t[r]),Br(i,Y)}},pc),Jt=Me(function(e,t,i){return e.h===0&&(Ie(t,i,tc(e.g,Oa)),!0)},Ud,Id),_c=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=tc(e.g,Oa))===0?void 0:e),!0)},Ud,Id),_p=Me(function(e,t,i){return e.h===0&&(Ie(t,i,tc(e.g,Ra)),!0)},function(e,t,i){if((t=ep(t))!=null&&(typeof t=="string"&&Sd(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,hi(t),Ni(e,Y,ue);break;case"bigint":i=BigInt.asUintN(64,t),i=new ac(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ni(e.g,i.h,i.g);break;default:i=Sd(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)},qd,fc),Pn=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?kn(e,Yt,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=lc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);uc(e,i)}},fc),zi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=Yt(e.g))===0?void 0:e),!0)},qd,fc),ne=Me(function(e,t,i){return e.h===0&&(Ie(t,i,ic(e.g)),!0)},Vd,Td),Gi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=ic(e.g))===!1?void 0:e),!0)},Vd,Td),Se=ji(function(e,t,i){return e.h===2&&(e=sc(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,M2(o))}},hc),Qt=Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=sc(e))===""?void 0:e),!0)},jd,hc),Z=Me(function(e,t,i){return e.h===2&&(Ie(t,i,sc(e)),!0)},jd,hc),we=function(e,t,i=dc){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)}),W=In(function(e,t,i,r,n,o){return e.h===2&&(vd(t,0|t[L],o,i),Fr(e,t=Ja(t,r,i),n),!0)},zd),Wd=Me(function(e,t,i){return e.h===2&&(Ie(t,i,kd(e)),!0)},Gd,Fd),wp=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?kn(e,Dt,t):t.push(Dt(e.g)),!0)},function(e,t,i){if((t=Vi(id,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))}},Md),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=id(t))!=null&&t!=null&&(He(e,i,0),Hi(e.g,t))},Md),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))},Bd);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),oc(o.g,i,r),i=o}else i=new class{constructor(o,s){if(xd.length){const a=xd.pop();oc(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,oc(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;bc(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}}}};Hd(this.u,t,gi(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 Xd=class extends x{constructor(e){super(e)}},Kd=[0,Qt,Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=kd(e))===di()?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,ec(t).buffer)))}if(Array.isArray(t))return}Gd(e,t,i)},Fd)];let wc,Yd=globalThis.trustedTypes;function Jd(e){wc===void 0&&(wc=function(){let i=null;if(!Yd)return i;try{const r=n=>n;i=Yd.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(r){}return i}());var t=wc;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 Jd(e[0]);let i=e[0];for(let r=0;r<t.length;r++)i+=encodeURIComponent(t[r])+e[r+1];return Jd(i)}var Qd=[0,de,Ue,ne,-1,Pn,Ue,-1],Ap=class extends x{constructor(e){super(e)}},eh=[0,ne,Z,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?kn(e,hp,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=lc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);uc(e,i)}},Bd),Z,-1,[0,ne,-1],Ue,ne,-1],th=[0,Z,-2],ih=class extends x{constructor(e){super(e)}},rh=[0],nh=[0,de,ne,1,ne,-3],qe=class extends x{constructor(e){super(e,2)}},_e={};_e[336783863]=[0,Z,ne,-1,de,[0,[1,2,3,4,5,6,7,8,9],W,rh,W,eh,W,th,W,nh,W,Qd,W,[0,Z,-2],W,[0,Z,Ue],W,[0,Ue,Z,-1],W,[0,Ue,-1]],[0,Z],ne,[0,[1,3],[2,4],W,[0,Pn],-1,W,[0,Se],-1,we,[0,Z,-1]],Z];var oh=[0,_c,-1,Gi,-3,_c,Pn,Qt,zi,_c,-1,Gi,zi,Gi,-2,Qt];function Ve(e,t){Wa(e,2,Ri(t),"")}function ee(e,t){Cn(e,3,t)}function q(e,t){Cn(e,4,t)}var Fe=class extends x{constructor(e){super(e,500)}o(e){return I(this,0,7,e)}},Dr=[-1,{}],sh=[0,Z,1,Dr],ah=[0,Z,Se,Dr];function je(e,t){En(e,1,Fe,t)}function ie(e,t){Cn(e,10,t)}function j(e,t){Cn(e,15,t)}var Pe=class extends x{constructor(e){super(e,500)}o(e){return I(this,0,1001,e)}},ch=[-500,we,[-500,Qt,-1,Se,-3,[-2,_e,ne],we,Kd,zi,-1,sh,ah,we,[0,Qt,Gi],Qt,oh,zi,Se,987,Se],4,we,[-500,Z,-1,[-1,{}],998,Z],we,[-500,Z,Se,-1,[-2,{},ne],997,Se,-1],zi,we,[-500,Z,Se,Dr,998,Se],Se,zi,sh,ah,we,[0,Qt,-1,Dr],Se,-2,oh,Qt,-1,Gi,[0,Gi,Cp],978,Dr,we,Kd];Pe.prototype.g=$n(ch);var kp=ei(Pe,ch),Sp=class extends x{constructor(e){super(e)}},lh=class extends x{constructor(e){super(e)}g(){return Ft(this,Sp,1)}},uh=[0,we,[0,de,ye,Z,-1]],Nn=ei(lh,uh),Lp=class extends x{constructor(e){super(e)}},Tp=class extends x{constructor(e){super(e)}},Cc=class extends x{constructor(e){super(e)}h(){return V(this,Lp,2)}g(){return Ft(this,Tp,5)}},dh=ei(class extends x{constructor(e){super(e)}},[0,Se,Pn,yc,[0,Ue,[0,de,-3],[0,ye,-3],[0,de,-1,[0,we,[0,de,-2]]],we,[0,ye,-1,Z,ye]],Z,-1,Jt,we,[0,de,ye],Se,Jt]),hh=class extends x{constructor(e){super(e)}},Zi=ei(class extends x{constructor(e){super(e)}},[0,we,[0,ye,-4]]),fh=class extends x{constructor(e){super(e)}},Rr=ei(class extends x{constructor(e){super(e)}},[0,we,[0,ye,-4]]),Mp=class extends x{constructor(e){super(e)}},Ip=[0,de,-1,yc,Ue],ph=class extends x{constructor(e){super(e)}};ph.prototype.g=$n([0,ye,-4,Jt]);var Fp=class extends x{constructor(e){super(e)}},Bp=ei(class extends x{constructor(e){super(e)}},[0,we,[0,1,de,Z,uh],Jt]),mh=class extends x{constructor(e){super(e)}},Dp=class extends x{constructor(e){super(e)}ma(){const e=md(this);return e==null?di():e}},Rp=class extends x{constructor(e){super(e)}},gh=[1,2],Op=ei(class extends x{constructor(e){super(e)}},[0,we,[0,gh,W,[0,yc],W,[0,Wd],de,Z],Jt]),Ec=class extends x{constructor(e){super(e)}},vh=[0,Z,de,ye,Se,-1],bh=class extends x{constructor(e){super(e)}},Pp=[0,ne,-1],yh=class extends x{constructor(e){super(e)}},Hn=[1,2,3,4,5],Un=class extends x{constructor(e){super(e)}g(){return md(this)!=null}h(){return et(this,2)!=null}},oe=class extends x{constructor(e){super(e)}g(){var e;return(e=td(Pi(this,2)))!=null?e:!1}},_h=[0,Wd,Z,[0,de,Jt,-1],[0,_p,Jt]],pe=[0,_h,ne,[0,Hn,W,nh,W,eh,W,Qd,W,rh,W,th],Ue],qn=class extends x{constructor(e){super(e)}},xc=[0,pe,ye,-1,de],$p=pt(502141897,qn);_e[502141897]=xc;var Np=ei(class extends x{constructor(e){super(e)}},[0,[0,Ue,-1,yp,wp],Ip]),wh=class extends x{constructor(e){super(e)}},Ch=class extends x{constructor(e){super(e)}},Ac=[0,pe,ye,[0,pe],ne],Eh=[0,pe,xc,Ac,ye,[0,[0,_h]]],Hp=pt(508968150,Ch);_e[508968150]=Eh,_e[508968149]=Ac;var xh=class extends x{constructor(e){super(e)}},Up=pt(513916220,xh);_e[513916220]=[0,pe,Eh,de];var Wi=class extends x{constructor(e){super(e)}h(){return V(this,Ec,2)}g(){Q(this,2)}},Ah=[0,pe,vh];_e[478825465]=Ah;var qp=class extends x{constructor(e){super(e)}},kh=class extends x{constructor(e){super(e)}},kc=class extends x{constructor(e){super(e)}},Sc=class extends x{constructor(e){super(e)}},Sh=class extends x{constructor(e){super(e)}},Lh=[0,pe,[0,pe],Ah,-1],Th=[0,pe,ye,de],Lc=[0,pe,ye],Mh=[0,pe,Th,Lc,ye],Vp=pt(479097054,Sh);_e[479097054]=[0,pe,Mh,Lh],_e[463370452]=Lh,_e[464864288]=Th;var jp=pt(462713202,Sc);_e[462713202]=Mh,_e[474472470]=Lc;var zp=class extends x{constructor(e){super(e)}},Ih=class extends x{constructor(e){super(e)}},Fh=class extends x{constructor(e){super(e)}},Bh=class extends x{constructor(e){super(e)}},Tc=[0,pe,ye,-1,de],Mc=[0,pe,ye,ne];Bh.prototype.g=$n([0,pe,Lc,[0,pe],xc,Ac,Tc,Mc]);var Dh=class extends x{constructor(e){super(e)}},Gp=pt(456383383,Dh);_e[456383383]=[0,pe,vh];var Rh=class extends x{constructor(e){super(e)}},Zp=pt(476348187,Rh);_e[476348187]=[0,pe,Pp];var Oh=class extends x{constructor(e){super(e)}},Ph=class extends x{constructor(e){super(e)}},$h=[0,Ue,-1],Wp=pt(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=Ph;const a=2&n;let c=!1;if(o==null){if(a)return hd();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 hd();c||(c=!0,Fi(o))}else c&&(c=!1,o=gd(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&&Ph&&(e.pa=!0),e}});_e[458105876]=[0,$h,bp,[!0,Jt,[0,Z,-1,Se]]];var Ic=class extends x{constructor(e){super(e)}},Nh=pt(458105758,Ic);_e[458105758]=[0,pe,Z,$h];var Hh=class extends x{constructor(e){super(e)}},Xp=pt(443442058,Hh);_e[443442058]=[0,pe,Z,de,ye,Se,-1,ne,ye],_e[514774813]=Tc;var Uh=class extends x{constructor(e){super(e)}},Kp=pt(516587230,Uh);function Fc(e,t){return t=t?t.clone():new Ec,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 Bc(e,t=-1,i=""){return{categories:e.map(r=>{var n,o,s,a,c,l,d;return{index:(o=(n=Qe(r,1))!=null?n:0)!=null?o:-1,score:(s=fe(r,2))!=null?s:0,categoryName:(c=(a=et(r,3))!=null?a:"")!=null?c:"",displayName:(d=(l=et(r,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function qh(e){var s,a,c,l,d,u,h,f,p,m,v,g,b;var t=pi(e,3,Wt,fi()),i=pi(e,2,Di,fi()),r=pi(e,1,Oi,fi()),n=pi(e,9,Oi,fi());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=V(e,Cc,4))==null?void 0:l.h())&&(o.boundingBox={originX:(d=Qe(t,1))!=null?d:0,originY:(u=Qe(t,2))!=null?u:0,width:(h=Qe(t,3))!=null?h:0,height:(f=Qe(t,4))!=null?f:0,angle:0}),(p=V(e,Cc,4))==null?void 0:p.g().length)for(const w of V(e,Cc,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=et(w,3))!=null?b:""});return o}function Vn(e){var i,r,n,o;const t=[];for(const s of Ft(e,fh,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,hh,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 Vh(e){return Array.from(e,t=>t>127?t-256:t)}function jh(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,Tc,Mc,ye],_e[518928384]=Mc;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 vi=class{};function Gh(){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 Zh(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 Wh(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 Xh(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]=Wh(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 Kh(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)}}vi.forVisionTasks=function(e){return Pr("vision",e)},vi.forTextTasks=function(e){return Pr("text",e)},vi.forGenAiExperimentalTasks=function(e){return Pr("genai_experimental",e)},vi.forGenAiTasks=function(e){return Pr("genai",e)},vi.forAudioTasks=function(e){return Pr("audio",e)},vi.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 Zh(o)),!self.ModuleFactory||s&&(yield Zh(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 Dc(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,Ia(t,!1)),Q(i,2)),I(e.baseOptions,0,1,i)}function Yh(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 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 Rc=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,yh,3);if(!u){var h=u=new yh,f=new ih;Mr(h,4,Hn,f)}"delegate"in d&&(d.delegate==="GPU"?(d=u,h=new Ap,Mr(d,2,Hn,h)):(d=u,h=new ih,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),Dc(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Dc(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=>{Dc(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=kp(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,Yh(this)}finishProcessing(){this.g.finishProcessing(),Yh(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}Rc.prototype.close=Rc.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 Jh(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 Qh(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 Oc(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 Oc(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=Qh(e,!0)),i=e.s):(e.v||(e.v=Qh(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 Oc(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){Oc(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 Pc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ki=class{G(){return`
3103
+ `}class J4 extends HTMLElement{constructor(){super(),this.templateString=Y4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||y("selfie.review.title")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){var t,i;this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),(t=this.navigation)==null||t.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(i=this.navigation)==null||i.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",J4);var mr,G,Bu,Du,si,Ru,Ou,Pu,$u,Ys,Js,Qs,gr={},Nu=[],Q4=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vr=Array.isArray;function vt(e,t){for(var i in t)e[i]=t[i];return e}function ea(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Lt(e,t,i){var r,n,o,s={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?mr.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return br(e,s,r,n,null)}function br(e,t,i,r,n){var o={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n==null?++Bu:n,__i:-1,__u:0};return n==null&&G.vnode!=null&&G.vnode(o),o}function qt(e){return e.children}function yr(e,t){this.props=e,this.context=t}function ki(e,t){if(t==null)return e.__?ki(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?ki(e):null}function Hu(e){var t,i;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null){e.__e=e.__c.base=i.__e;break}return Hu(e)}}function Uu(e){(!e.__d&&(e.__d=!0)&&si.push(e)&&!Xr.__r++||Ru!=G.debounceRendering)&&((Ru=G.debounceRendering)||Ou)(Xr)}function Xr(){for(var e,t,i,r,n,o,s,a=1;si.length;)si.length>a&&si.sort(Pu),e=si.shift(),a=si.length,e.__d&&(i=void 0,n=(r=(t=e).__v).__e,o=[],s=[],t.__P&&((i=vt({},r)).__v=r.__v+1,G.vnode&&G.vnode(i),ta(t.__P,i,r,t.__n,t.__P.namespaceURI,32&r.__u?[n]:null,o,n==null?ki(r):n,!!(32&r.__u),s),i.__v=r.__v,i.__.__k[i.__i]=i,Zu(o,i,s),i.__e!=n&&Hu(i)));Xr.__r=0}function qu(e,t,i,r,n,o,s,a,c,l,d){var u,h,f,p,m,v,g=r&&r.__k||Nu,b=t.length;for(c=ef(i,t,g,c,b),u=0;u<b;u++)(f=i.__k[u])!=null&&(h=f.__i==-1?gr:g[f.__i]||gr,f.__i=u,v=ta(e,f,h,n,o,s,a,c,l,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ra(h.ref,null,f),d.push(f.ref,f.__c||p,f)),m==null&&p!=null&&(m=p),4&f.__u||h.__k===f.__k?c=Vu(f,c,e):typeof f.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),f.__u&=-7);return i.__e=m,c}function ef(e,t,i,r,n){var o,s,a,c,l,d=i.length,u=d,h=0;for(e.__k=new Array(n),o=0;o<n;o++)(s=t[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=o+h,(s=e.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?br(null,s,null,null,null):vr(s)?br(qt,{children:s},null,null,null):s.constructor==null&&s.__b>0?br(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(l=s.__i=tf(s,i,c,u))!=-1&&(u--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(n>d?h--:n<d&&h++),typeof s.type!="function"&&(s.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,s.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<d;o++)(a=i[o])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=ki(a)),Xu(a,a));return r}function Vu(e,t,i){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=Vu(r[n],t,i));return t}e.__e!=t&&(t&&e.type&&!i.contains(t)&&(t=ki(e)),i.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ju(e,t){return t=t||[],e==null||typeof e=="boolean"||(vr(e)?e.some(function(i){ju(i,t)}):t.push(e)),t}function tf(e,t,i,r){var n,o,s,a=e.key,c=e.type,l=t[i],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return i;if(r>(d?1:0)){for(n=i-1,o=i+1;n>=0||o<t.length;)if((l=t[s=n>=0?n--:o++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return s}return-1}function zu(e,t,i){t[0]=="-"?e.setProperty(t,i==null?"":i):e[t]=i==null?"":typeof i!="number"||Q4.test(t)?i:i+"px"}function Kr(e,t,i,r,n){var o,s;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||zu(e.style,t,"");if(i)for(t in i)r&&i[t]==r[t]||zu(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace($u,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=i,i?r?i.u=r.u:(i.u=Ys,e.addEventListener(t,o?Qs:Js,o)):e.removeEventListener(t,o?Qs:Js,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=i==null?"":i;break e}catch(a){}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function Gu(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ys++;else if(t.t<i.u)return;return i(G.event?G.event(t):t)}}}function ta(e,t,i,r,n,o,s,a,c,l){var d,u,h,f,p,m,v,g,b,_,M,P,x,D,C,R,F,E=t.type;if(t.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),o=[a=t.__e=i.__e]),(d=G.__b)&&d(t);e:if(typeof E=="function")try{if(g=t.props,b="prototype"in E&&E.prototype.render,_=(d=E.contextType)&&r[d.__c],M=d?_?_.props.value:d.__:r,i.__c?v=(u=t.__c=i.__c).__=u.__E:(b?t.__c=u=new E(g,M):(t.__c=u=new yr(g,M),u.constructor=E,u.render=nf),_&&_.sub(u),u.props=g,u.state||(u.state={}),u.context=M,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&E.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=vt({},u.__s)),vt(u.__s,E.getDerivedStateFromProps(g,u.__s))),f=u.props,p=u.state,u.__v=t,h)b&&E.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&E.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,M),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,M)===!1||t.__v==i.__v){for(t.__v!=i.__v&&(u.props=g,u.state=u.__s,u.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(j){j&&(j.__=t)}),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,M),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,m)})}if(u.context=M,u.props=g,u.__P=e,u.__e=!1,x=G.__r,D=0,b){for(u.state=u.__s,u.__d=!1,x&&x(t),d=u.render(u.props,u.state,u.context),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[]}else do u.__d=!1,x&&x(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++D<25);u.state=u.__s,u.getChildContext!=null&&(r=vt(vt({},r),u.getChildContext())),b&&!h&&u.getSnapshotBeforeUpdate!=null&&(m=u.getSnapshotBeforeUpdate(f,p)),R=d,d!=null&&d.type===qt&&d.key==null&&(R=Wu(d.props.children)),a=qu(e,vr(R)?R:[R],t,i,r,n,o,s,a,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),v&&(u.__E=u.__=null)}catch(j){if(t.__v=null,c||o!=null)if(j.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,t.__e=a}else{for(F=o.length;F--;)ea(o[F]);ia(t)}else t.__e=i.__e,t.__k=i.__k,j.then||ia(t);G.__e(j,t,i)}else o==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=rf(i.__e,t,i,r,n,o,s,c,l);return(d=G.diffed)&&d(t),128&t.__u?void 0:a}function ia(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ia)}function Zu(e,t,i){for(var r=0;r<i.length;r++)ra(i[r],i[++r],i[++r]);G.__c&&G.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){G.__e(o,n.__v)}})}function Wu(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:vr(e)?e.map(Wu):vt({},e)}function rf(e,t,i,r,n,o,s,a,c){var l,d,u,h,f,p,m,v=i.props,g=t.props,b=t.type;if(b=="svg"?n="http://www.w3.org/2000/svg":b=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;l<o.length;l++)if((f=o[l])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,o[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(n,b,g.is&&g),a&&(G.__m&&G.__m(t,o),a=!1),o=null}if(b==null)v===g||a&&e.data==g||(e.data=g);else{if(o=o&&mr.call(e.childNodes),v=i.props||gr,!a&&o!=null)for(v={},l=0;l<e.attributes.length;l++)v[(f=e.attributes[l]).name]=f.value;for(l in v)if(f=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=f;else if(!(l in g)){if(l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g)continue;Kr(e,l,null,f,n)}}for(l in g)f=g[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?d=f:l=="value"?p=f:l=="checked"?m=f:a&&typeof f!="function"||v[l]===f||Kr(e,l,f,v[l],n);if(d)a||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),qu(t.type=="template"?e.content:e,vr(h)?h:[h],t,i,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,s,o?o[0]:i.__k&&ki(i,0),a,c),o!=null)for(l=o.length;l--;)ea(o[l]);a||(l="value",b=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[l]||b=="progress"&&!p||b=="option"&&p!=v[l])&&Kr(e,l,p,v[l],n),l="checked",m!=null&&m!=e[l]&&Kr(e,l,m,v[l],n))}return e}function ra(e,t,i){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){G.__e(n,i)}}function Xu(e,t,i){var r,n;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ra(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){G.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&Xu(r[n],t,i||typeof e.type!="function");i||ea(e.__e),e.__c=e.__=e.__e=void 0}function nf(e,t,i){return this.constructor(e,i)}function Yr(e,t,i){var r,n,o,s;t==document&&(t=document.documentElement),G.__&&G.__(e,t),n=(r=typeof i=="function")?null:i&&i.__k||t.__k,o=[],s=[],ta(t,e=(!r&&i||t).__k=Lt(qt,null,[e]),n||gr,gr,t.namespaceURI,!r&&i?[i]:n?null:t.firstChild?mr.call(t.childNodes):null,o,!r&&i?i:n?n.__e:t.firstChild,r,s),Zu(o,e,s)}function Ku(e,t){Yr(e,t,Ku)}function Yu(e,t,i){var r,n,o,s,a=vt({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:a[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?mr.call(arguments,2):i),br(e.type,a,r||e.key,n||e.ref,null)}mr=Nu.slice,G={__e:function(e,t,i,r){for(var n,o,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),s=n.__d),s)return n.__E=n}catch(a){e=a}throw e}},Bu=0,Du=function(e){return e!=null&&e.constructor==null},yr.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=vt({},this.state),typeof e=="function"&&(e=e(vt({},i),this.props)),e&&vt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Uu(this))},yr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Uu(this))},yr.prototype.render=qt,si=[],Ou=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pu=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,$u=/(PointerCapture)$|Capture$/i,Ys=0,Js=Gu(!1),Qs=Gu(!0);var of=0;function N(e,t,i,r,n,o){t||(t={});var s,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?s=t[a]:c[a]=t[a];var l={type:e,props:c,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--of,__i:-1,__u:0,__source:n,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return G.vnode&&G.vnode(l),l}var _r,he,na,Ju,Jr=0,Qu=[],ve=G,e2=ve.__b,t2=ve.__r,i2=ve.diffed,r2=ve.__c,n2=ve.unmount,o2=ve.__;function oa(e,t){ve.__h&&ve.__h(he,e,Jr||t),Jr=0;var i=he.__H||(he.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function ai(e){return Jr=1,sf(c2,e)}function sf(e,t,i){var r=oa(_r++,2);if(r.t=e,!r.__c&&(r.__=[c2(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,a);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=he,!he.__f)){var n=function(a,c,l){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!o||o.call(this,a,c,l);var u=r.__c.props!==a;return d.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(u=!0)}}),o&&o.call(this,a,c,l)||u};he.__f=!0;var o=he.shouldComponentUpdate,s=he.componentWillUpdate;he.componentWillUpdate=function(a,c,l){if(this.__e){var d=o;o=void 0,n(a,c,l),o=d}s&&s.call(this,a,c,l)},he.shouldComponentUpdate=n}return r.__N||r.__}function Je(e,t){var i=oa(_r++,3);!ve.__s&&a2(i.__H,t)&&(i.__=e,i.u=t,he.__H.__h.push(i))}function Ae(e){return Jr=5,Qr(function(){return{current:e}},[])}function Qr(e,t){var i=oa(_r++,7);return a2(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function af(){for(var e;e=Qu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(sa),e.__H.__h=[]}catch(t){e.__H.__h=[],ve.__e(t,e.__v)}}ve.__b=function(e){he=null,e2&&e2(e)},ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),o2&&o2(e,t)},ve.__r=function(e){t2&&t2(e),_r=0;var t=(he=e.__c).__H;t&&(na===he?(t.__h=[],he.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(sa),t.__h=[],_r=0)),na=he},ve.diffed=function(e){i2&&i2(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Qu.push(t)!==1&&Ju===ve.requestAnimationFrame||((Ju=ve.requestAnimationFrame)||cf)(af)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),na=he=null},ve.__c=function(e,t){t.some(function(i){try{i.__h.forEach(en),i.__h=i.__h.filter(function(r){return!r.__||sa(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],ve.__e(r,i.__v)}}),r2&&r2(e,t)},ve.unmount=function(e){n2&&n2(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(r){try{en(r)}catch(n){t=n}}),i.__H=void 0,t&&ve.__e(t,i.__v))};var s2=typeof requestAnimationFrame=="function";function cf(e){var t,i=function(){clearTimeout(r),s2&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,35);s2&&(t=requestAnimationFrame(i))}function en(e){var t=he,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),he=t}function sa(e){var t=he;e.__c=e.__(),he=t}function a2(e,t){return!e||e.length!==t.length||t.some(function(i,r){return i!==e[r]})}function c2(e,t){return typeof t=="function"?t(e):t}var lf={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const uf=(e,t,i,r)=>{const n=p=>{var m=p,{color:o="currentColor",size:s=24,stroke:a=2,title:c,children:l,className:d="",class:u="",style:h}=m,f=hl(m,["color","size","stroke","title","children","className","class","style"]);return Lt("svg",Re(nr(Re({},lf[e]),{width:String(s),height:String(s),class:["tabler-icon",`tabler-icon-${t}`,u,d].join(" "),"stroke-width":a,stroke:o,style:h}),f),[c&&Lt("title",{},c),...r.map(([v,g])=>Lt(v,g)),...ju(l)])};return n.displayName=`${i}`,n};var df=uf("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function aa(){return(aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var hf=["context","children"];function ff(e){this.getChildContext=function(){return e.context};var t=e.children,i=function(r,n){if(r==null)return{};var o,s,a={},c=Object.keys(r);for(s=0;s<c.length;s++)n.indexOf(o=c[s])>=0||(a[o]=r[o]);return a}(e,hf);return Yu(t,i)}function pf(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Lt(ff,aa({},this._props,{context:e.detail.context}),function t(i,r){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var n=[],o={},s=0,a=i.attributes,c=i.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(o[a[s].name]=a[s].value,o[l2(a[s].name)]=a[s].value);for(s=c.length;s--;){var l=t(c[s],null),d=c[s].slot;d?o[d]=Lt(u2,{name:d},l):n[s]=l}var u=r?Lt(u2,null,n):n;return Lt(r||i.nodeName.toLowerCase(),o,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ku:Yr)(this._vdom,this._root)}function l2(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function mf(e,t,i){if(this._vdom){var r={};r[e]=i=i==null?void 0:i,r[l2(e)]=i,this._vdom=Yu(this._vdom,r),Yr(this._vdom,this._root)}}function gf(){Yr(this._vdom=null,this._root)}function u2(e,t){var i=this;return Lt("slot",aa({},e,{ref:function(r){r?(i.ref=r,i._listener||(i._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function d2(e,t,i,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=pf,n.prototype.attributeChangedCallback=mf,n.prototype.disconnectedCallback=gf,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=i,i.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(s){this._vdom?this.attributeChangedCallback(o,null,s):(this._props||(this._props={}),this._props[o]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}const ci=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t;var vf=Symbol.for("preact-signals");function tn(){if(Vt>1)Vt--;else{for(var e,t=!1;wr!==void 0;){var i=wr;for(wr=void 0,ca++;i!==void 0;){var r=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&m2(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=r}}if(ca=0,Vt--,t)throw e}}function bf(e){if(Vt>0)return e();Vt++;try{return e()}finally{tn()}}var Z=void 0;function h2(e){var t=Z;Z=void 0;try{return e()}finally{Z=t}}var wr=void 0,Vt=0,ca=0,rn=0;function f2(e){if(Z!==void 0){var t=e.n;if(t===void 0||t.t!==Z)return t={i:0,S:e,p:Z.s,n:void 0,t:Z,e:void 0,x:void 0,r:t},Z.s!==void 0&&(Z.s.n=t),Z.s=t,e.n=t,32&Z.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Z.s,t.n=void 0,Z.s.n=t,Z.s=t),t}}function ke(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}ke.prototype.brand=vf,ke.prototype.h=function(){return!0},ke.prototype.S=function(e){var t=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:h2(function(){var r;(r=t.W)==null||r.call(t)}))},ke.prototype.U=function(e){var t=this;if(this.t!==void 0){var i=e.e,r=e.x;i!==void 0&&(i.x=r,e.e=void 0),r!==void 0&&(r.e=i,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&h2(function(){var n;(n=t.Z)==null||n.call(t)}))}},ke.prototype.subscribe=function(e){var t=this;return Cr(function(){var i=t.value,r=Z;Z=void 0;try{e(i)}finally{Z=r}})},ke.prototype.valueOf=function(){return this.value},ke.prototype.toString=function(){return this.value+""},ke.prototype.toJSON=function(){return this.value},ke.prototype.peek=function(){var e=Z;Z=void 0;try{return this.value}finally{Z=e}},Object.defineProperty(ke.prototype,"value",{get:function(){var e=f2(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ca>100)throw new Error("Cycle detected");this.v=e,this.i++,rn++,Vt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{tn()}}}});function p2(e,t){return new ke(e,t)}function m2(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function g2(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function v2(e){for(var t=e.s,i=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=i}function li(e,t){ke.call(this,void 0),this.x=e,this.s=void 0,this.g=rn-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}li.prototype=new ke,li.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===rn))return!0;if(this.g=rn,this.f|=1,this.i>0&&!m2(this))return this.f&=-2,!0;var e=Z;try{g2(this),Z=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return Z=e,v2(this),this.f&=-2,!0},li.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ke.prototype.S.call(this,e)},li.prototype.U=function(e){if(this.t!==void 0&&(ke.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},li.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(li.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=f2(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function la(e,t){return new li(e,t)}function b2(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Vt++;var i=Z;Z=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ua(e),r}finally{Z=i,tn()}}}function ua(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,b2(e)}function yf(e){if(Z!==this)throw new Error("Out-of-order effect");v2(this),Z=e,this.f&=-2,8&this.f&&ua(this),tn()}function Ai(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ai.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Ai.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b2(this),g2(this),Vt++;var e=Z;return Z=this,yf.bind(this,e)},Ai.prototype.N=function(){2&this.f||(this.f|=2,this.o=wr,wr=this)},Ai.prototype.d=function(){this.f|=8,1&this.f||ua(this)},Ai.prototype.dispose=function(){this.d()};function Cr(e){var t=new Ai(e);try{t.c()}catch(r){throw t.d(),r}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var y2,nn,da,_2=[];Cr(function(){y2=this.N})();function Si(e,t){G[e]=t.bind(null,G[e]||function(){})}function on(e){da&&da(),da=e&&e.S()}function w2(e){var t=this,i=e.data,r=le(i);r.value=i;var n=Qr(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=la(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),d=la(function(){return!Array.isArray(l.value)&&!Du(l.value)}),u=Cr(function(){if(this.N=C2,d.value){var f=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=f)}}),h=t.__$u.d;return t.__$u.d=function(){u(),h.call(this)},[d,l]},[]),o=n[0],s=n[1];return o.value?s.peek():s.value}w2.displayName="_st",Object.defineProperties(ke.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:w2},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Si("__b",function(e,t){if(typeof t.type=="string"){var i,r=t.props;for(var n in r)if(n!=="children"){var o=r[n];o instanceof ke&&(i||(t.__np=i={}),i[n]=o,r[n]=o.peek())}}e(t)}),Si("__r",function(e,t){if(t.type!==qt){on();var i,r=t.__c;r&&(r.__$f&=-2,(i=r.__$u)===void 0&&(r.__$u=i=function(n){var o;return Cr(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),nn=r,on(i)}e(t)}),Si("__e",function(e,t,i,r){on(),nn=void 0,e(t,i,r)}),Si("diffed",function(e,t){on(),nn=void 0;var i;if(typeof t.type=="string"&&(i=t.__e)){var r=t.__np,n=t.props;if(r){var o=i.U;if(o)for(var s in o){var a=o[s];a!==void 0&&!(s in r)&&(a.d(),o[s]=void 0)}else o={},i.U=o;for(var c in r){var l=o[c],d=r[c];l===void 0?(l=_f(i,c,d,n),o[c]=l):l.o(d,n)}}}e(t)});function _f(e,t,i,r){var n=t in e&&e.ownerSVGElement===void 0,o=p2(i);return{o:function(s,a){o.value=s,r=a},d:Cr(function(){this.N=C2;var s=o.value.value;r[t]!==s&&(r[t]=s,n?e[t]=s:s?e.setAttribute(t,s):e.removeAttribute(t))})}}Si("unmount",function(e,t){if(typeof t.type=="string"){var i=t.__e;if(i){var r=i.U;if(r){i.U=void 0;for(var n in r){var o=r[n];o&&o.d()}}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),Si("__h",function(e,t,i,r){(r<3||r===9)&&(t.__$f|=2),e(t,i,r)}),yr.prototype.shouldComponentUpdate=function(e,t){var i=this.__$u,r=i&&i.s!==void 0;for(var n in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(r||o||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function le(e,t){return Qr(function(){return p2(e,t)},[])}function ha(e,t){var i=Ae(e);return i.current=e,nn.__$f|=4,Qr(function(){return la(function(){return i.current()},t)},[])}var wf=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Cf(){bf(function(){for(var e;e=_2.shift();)y2.call(e)})}function C2(){_2.push(this)===1&&(G.requestAnimationFrame||wf)(Cf)}var fa,E2;function Ef(){if(E2)return fa;E2=1;var e=oi(),t=function(){return e.Date.now()};return fa=t,fa}var pa,x2;function xf(){if(x2)return pa;x2=1;var e=/\s/;function t(i){for(var r=i.length;r--&&e.test(i.charAt(r)););return r}return pa=t,pa}var ma,k2;function kf(){if(k2)return ma;k2=1;var e=xf(),t=/^\s+/;function i(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return ma=i,ma}var ga,A2;function Af(){if(A2)return ga;A2=1;var e=ar(),t=Ci(),i="[object Symbol]";function r(n){return typeof n=="symbol"||t(n)&&e(n)==i}return ga=r,ga}var va,S2;function Sf(){if(S2)return va;S2=1;var e=kf(),t=gt(),i=Af(),r=NaN,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(i(l))return r;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var u=o.test(l);return u||s.test(l)?a(l.slice(2),u?2:8):n.test(l)?r:+l}return va=c,va}var ba,L2;function Lf(){if(L2)return ba;L2=1;var e=gt(),t=Ef(),i=Sf(),r="Expected a function",n=Math.max,o=Math.min;function s(a,c,l){var d,u,h,f,p,m,v=0,g=!1,b=!1,_=!0;if(typeof a!="function")throw new TypeError(r);c=i(c)||0,e(l)&&(g=!!l.leading,b="maxWait"in l,h=b?n(i(l.maxWait)||0,c):h,_="trailing"in l?!!l.trailing:_);function M(O){var ae=d,me=u;return d=u=void 0,v=O,f=a.apply(me,ae),f}function P(O){return v=O,p=setTimeout(C,c),g?M(O):f}function x(O){var ae=O-m,me=O-v,Le=c-ae;return b?o(Le,h-me):Le}function D(O){var ae=O-m,me=O-v;return m===void 0||ae>=c||ae<0||b&&me>=h}function C(){var O=t();if(D(O))return R(O);p=setTimeout(C,x(O))}function R(O){return p=void 0,_&&d?M(O):(d=u=void 0,f)}function F(){p!==void 0&&clearTimeout(p),v=0,d=m=u=p=void 0}function E(){return p===void 0?f:R(t())}function j(){var O=t(),ae=D(O);if(d=arguments,u=this,m=O,ae){if(p===void 0)return P(m);if(b)return clearTimeout(p),p=setTimeout(C,c),M(m)}return p===void 0&&(p=setTimeout(C,c)),f}return j.cancel=F,j.flush=E,j}return ba=s,ba}var ya,T2;function Tf(){if(T2)return ya;T2=1;var e=Lf(),t=gt(),i="Expected a function";function r(n,o,s){var a=!0,c=!0;if(typeof n!="function")throw new TypeError(i);return t(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),e(n,o,{leading:a,maxWait:o,trailing:c})}return ya=r,ya}var Mf=Tf();const M2=te(Mf),If=(e="user")=>{var v;const t=Ae(null),i=Ae(null),[r,n]=ai(e),[o,s]=ai(!1),a=Ae(null),c=Ae(!1),l=Ae(new Set),d=g=>{a.current=g};Je(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const _=setTimeout(()=>{var M;(M=a.current)==null||M.call(a),c.current=!1,l.current.delete(_)},100);l.current.add(_)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(_=>clearTimeout(_)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),Je(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const u=(g,b)=>S(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(F=>F.stop()),i.current=null),t.current&&(t.current.srcObject=null);const _=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||r}});i.current=_;const x=_.getVideoTracks()[0].getSettings().facingMode;(x&&x!==(g||r)||x&&x!==r)&&n(x);const R=(yield navigator.mediaDevices.enumerateDevices()).find(F=>F.kind==="videoinput"&&_.getVideoTracks()[0].getSettings().deviceId===F.deviceId);b==null||b(R==null?void 0:R.label),t.current&&(t.current.srcObject=_,yield t.current.play())}catch(_){console.error("Failed to start camera:",_)}}),h=()=>S(this,null,function*(){const g=r==="user"?"environment":"user";c.current=!0;const b=r;try{n(g),i.current&&(i.current.getTracks().forEach(_=>_.stop()),i.current=null),yield u(g)}catch(_){n(b),c.current=!1;try{yield u(b)}catch(M){console.error("Failed to restore previous camera:",M)}}}),f=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),_="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",M=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||_||M,isChromium:g.includes("chrome")||g.includes("chromium")||g.includes("edge"),isWebKit:g.includes("webkit")&&!g.includes("chrome")}};return{videoRef:t,streamRef:i,facingMode:r,agentSupported:o,startCamera:u,switchCamera:h,checkAgentSupport:()=>S(this,null,function*(){var g,b;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){s(!0);return}const{isGecko:M}=f();let P=null,x=null;try{const C=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});P=(g=C.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,C.getTracks().forEach(R=>R.stop())}catch(C){}try{const C=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});x=(b=C.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,C.getTracks().forEach(R=>R.stop())}catch(C){}if(!(P&&x&&P!==x)){s(!1);return}s(!M)}catch(_){s(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(g=>g.stop()),i.current=null),t.current&&(t.current.srcObject=null,t.current.load())},registerCameraSwitchCallback:d}};var Li=typeof self!="undefined"?self:{};function ui(){throw Error("Invalid UTF8")}function I2(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let sn,_a;const Ff=typeof TextDecoder!="undefined";let Bf;const Df=typeof TextEncoder!="undefined";function F2(e){if(Df)e=(Bf||(Bf=new TextEncoder)).encode(e);else{let i=0;const r=new Uint8Array(3*e.length);for(let n=0;n<e.length;n++){var t=e.charCodeAt(n);if(t<128)r[i++]=t;else{if(t<2048)r[i++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&n<e.length){const o=e.charCodeAt(++n);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,r[i++]=t>>18|240,r[i++]=t>>12&63|128,r[i++]=t>>6&63|128,r[i++]=63&t|128;continue}n--}t=65533}r[i++]=t>>12|224,r[i++]=t>>6&63|128}r[i++]=63&t|128}}e=i===r.length?r:r.subarray(0,i)}return e}var wa,an;e:{for(var B2=["CLOSURE_FLAGS"],Ca=Li,Ea=0;Ea<B2.length;Ea++)if((Ca=Ca[B2[Ea]])==null){an=null;break e}an=Ca}var Er,D2=an&&an[610401301];wa=D2!=null&&D2;const R2=Li.navigator;function xa(e){return!!wa&&!!Er&&Er.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Qe(e){var t;return(t=Li.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function jt(){return!!wa&&!!Er&&Er.brands.length>0}function ka(){return jt()?xa("Chromium"):(Qe("Chrome")||Qe("CriOS"))&&!(!jt()&&Qe("Edge"))||Qe("Silk")}function cn(e){return cn[" "](e),e}Er=R2&&R2.userAgentData||null,cn[" "]=function(){};var Rf=!jt()&&(Qe("Trident")||Qe("MSIE"));!Qe("Android")||ka(),ka(),Qe("Safari")&&(ka()||!jt()&&Qe("Coast")||!jt()&&Qe("Opera")||!jt()&&Qe("Edge")||(jt()?xa("Microsoft Edge"):Qe("Edg/"))||jt()&&xa("Opera"));var O2={},xr=null;function Of(e){const t=e.length;let i=3*t/4;i%3?i=Math.floor(i):"=.".indexOf(e[t-1])!=-1&&(i="=.".indexOf(e[t-2])!=-1?i-2:i-1);const r=new Uint8Array(i);let n=0;return function(o,s){function a(l){for(;c<o.length;){const d=o.charAt(c++),u=xr[d];if(u!=null)return u;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}P2();let c=0;for(;;){const l=a(-1),d=a(0),u=a(64),h=a(64);if(h===64&&l===-1)break;s(l<<2|d>>4),u!=64&&(s(d<<4&240|u>>2),h!=64&&s(u<<6&192|h))}}(e,function(o){r[n++]=o}),n!==i?r.subarray(0,n):r}function P2(){if(!xr){xr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const r=e.concat(t[i].split(""));O2[i]=r;for(let n=0;n<r.length;n++){const o=r[n];xr[o]===void 0&&(xr[o]=n)}}}}var $2=typeof Uint8Array!="undefined",N2=!Rf&&typeof btoa=="function";function H2(e){if(!N2){var t;t===void 0&&(t=0),P2(),t=O2[t];var i=Array(Math.floor(e.length/3)),r=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var n=e[c],o=e[c+1],s=e[c+2],a=t[n>>2];n=t[(3&n)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],i[l++]=a+n+o+s}switch(a=0,s=r,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||r;case 1:e=e[c],i[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+r}return i.join("")}for(t="",i=0,r=e.length-10240;i<r;)t+=String.fromCharCode.apply(null,e.subarray(i,i+=10240));return t+=String.fromCharCode.apply(null,i?e.subarray(i):e),btoa(t)}const U2=/[-_.]/g,Pf={"-":"+",_:"/",".":"="};function $f(e){return Pf[e]||""}function q2(e){if(!N2)return Of(e);U2.test(e)&&(e=e.replace(U2,$f)),e=atob(e);const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function di(e){return $2&&e!=null&&e instanceof Uint8Array}var Ti={};function hi(){return Nf||(Nf=new Tt(null,Ti))}function Aa(e){V2(Ti);var t=e.g;return(t=t==null||di(t)?t:typeof t=="string"?q2(t):null)==null?t:e.g=t}var Tt=class{h(){return new Uint8Array(Aa(this)||0)}constructor(e,t){if(V2(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Nf,Sa;function V2(e){if(e!==Ti)throw Error("illegal external caller")}function j2(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function La(e){return j2(e=Error(e),"warning"),e}function Ta(e){if(e!=null){var t=Sa!=null?Sa:Sa={},i=t[e]||0;i>=5||(t[e]=i+1,j2(e=Error(),"incident"),function(r){Li.setTimeout(()=>{throw r},0)}(e))}}var ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Mi(e,t,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var Hf=Mi("jas",void 0,!0),z2=Mi(void 0,"0di"),kr=Mi(void 0,"1oa"),Ii=Mi(void 0,Symbol()),Uf=Mi(void 0,"0actk"),G2=Mi(void 0,"8utk");const L=ln?Hf:"Ea",Z2={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},W2=Object.defineProperties;function un(e,t){ln||L in e||W2(e,Z2),e[L]|=t}function be(e,t){ln||L in e||W2(e,Z2),e[L]=t}function Fi(e){return un(e,34),e}function qf(e,t){be(t,-15615&(0|e))}function Ma(e,t){be(t,-15581&(34|e))}function dn(){return typeof BigInt=="function"}function Oe(e){return Array.prototype.slice.call(e)}var Ia,Ar={};function hn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Fa(e,t){if(e!=null){if(typeof e=="string")e=e?new Tt(e,Ti):hi();else if(e.constructor!==Tt)if(di(e))e=e.length?new Tt(new Uint8Array(e),Ti):hi();else{if(!t)throw Error();e=void 0}}return e}const X2=[];function zt(e){if(2&e)throw Error()}be(X2,55),Ia=Object.freeze(X2);class K2{constructor(t,i,r){this.g=t,this.h=i,this.l=r}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function Ba(e){return Ii?e[Ii]:void 0}var Vf=Object.freeze({});function fn(e){return e.Na=!0,e}var jf=fn(e=>typeof e=="number"),Y2=fn(e=>typeof e=="string"),zf=fn(e=>typeof e=="boolean"),pn=typeof Li.BigInt=="function"&&typeof Li.BigInt(0)=="bigint";function Gt(e){var t=e;if(Y2(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(jf(t)&&!Number.isSafeInteger(t))throw Error(String(t));return pn?BigInt(e):e=zf(e)?e?"1":"0":Y2(e)?e.trim()||"0":String(e)}var Da=fn(e=>pn?e>=Zf&&e<=Xf:e[0]==="-"?J2(e,Gf):J2(e,Wf));const Gf=Number.MIN_SAFE_INTEGER.toString(),Zf=pn?BigInt(Number.MIN_SAFE_INTEGER):void 0,Wf=Number.MAX_SAFE_INTEGER.toString(),Xf=pn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function J2(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let i=0;i<e.length;i++){const r=e[i],n=t[i];if(r>n)return!1;if(r<n)return!0}}const Kf=typeof Uint8Array.prototype.slice=="function";let Q2,Y=0,ue=0;function ed(e){const t=e>>>0;Y=t,ue=(e-t)/4294967296>>>0}function fi(e){if(e<0){ed(-e);const[t,i]=$a(Y,ue);Y=t>>>0,ue=i>>>0}else ed(e)}function Ra(e){const t=Q2||(Q2=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ue=0,Y=t.getUint32(0,!0)}function Oa(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:Sr(e,t)}function Pa(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Oa(e,t))=="number"?i?-e:e:i?"-"+e:e}function Sr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var i=""+(4294967296*t+e);else dn()?i=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(i=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,e>=1e7&&(i+=e/1e7>>>0,e%=1e7),i>=1e7&&(t+=i/1e7>>>0,i%=1e7),i=t+td(i)+td(e));return i}function td(e){return e=String(e),"0000000".slice(e.length)+e}function id(){var e=Y,t=ue;if(2147483648&t)if(dn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,r]=$a(e,t);e="-"+Sr(i,r)}else e=Sr(e,t);return e}function mn(e){if(e.length<16)fi(Number(e));else if(dn())e=BigInt(e),Y=Number(e&BigInt(4294967295))>>>0,ue=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ue=Y=0;const i=e.length;for(let r=t,n=(i-t)%6+t;n<=i;r=n,n+=6){const o=Number(e.slice(r,n));ue*=1e6,Y=1e6*Y+o,Y>=4294967296&&(ue+=Math.trunc(Y/4294967296),ue>>>=0,Y>>>=0)}if(t){const[r,n]=$a(Y,ue);Y=r,ue=n}}}function $a(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Lr=typeof BigInt=="function"?BigInt.asIntN:void 0,Yf=typeof BigInt=="function"?BigInt.asUintN:void 0,Zt=Number.isSafeInteger,gn=Number.isFinite,Bi=Math.trunc,Jf=Gt(0);function Wt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function rd(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Qf=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Tr(e){switch(typeof e){case"bigint":return!0;case"number":return gn(e);case"string":return Qf.test(e);default:return!1}}function Di(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return gn(e)?0|e:void 0}function nd(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return gn(e)?e>>>0:void 0}function od(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function sd(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function ad(e){return sd(e)?e:(mn(e),id())}function Na(e){return e=Bi(e),Zt(e)||(fi(e),e=Pa(Y,ue)),e}function cd(e){var t=Bi(Number(e));return Zt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),ad(e))}function ld(e){var t=Bi(Number(e));return Zt(t)?Gt(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),dn()?Gt(Lr(64,BigInt(e))):Gt(ad(e)))}function ud(e){if(Zt(e))e=Gt(Na(e));else{if(e=Bi(e),Zt(e))e=String(e);else{const t=String(e);sd(t)?e=t:(fi(e),e=id())}e=Gt(e)}return e}function Ha(e){return e==null?e:typeof e=="bigint"?(Da(e)?e=Number(e):(e=Lr(64,e),e=Da(e)?Number(e):String(e)),e):Tr(e)?typeof e=="number"?Na(e):cd(e):void 0}function ep(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Yf(64,e));if(Tr(e)){if(t==="string")return t=Bi(Number(e)),Zt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),od(e)||(mn(e),e=Sr(Y,ue))),e;if(t==="number")return(e=Bi(e))>=0&&Zt(e)?e:function(i){if(i<0){fi(i);var r=Sr(Y,ue);return i=Number(r),Zt(i)?i:r}return od(r=String(i))?r:(fi(i),Oa(Y,ue))}(e)}}function dd(e){if(typeof e!="string")throw Error();return e}function Ri(e){if(e!=null&&typeof e!="string")throw Error();return e}function Oi(e){return e==null||typeof e=="string"?e:void 0}function Ua(e,t,i,r){if(e!=null&&typeof e=="object"&&e.W===Ar)return e;if(!Array.isArray(e))return i?2&r?((e=t[z2])||(Fi((e=new t).u),e=t[z2]=e),t=e):t=new t:t=void 0,t;let n=i=0|e[L];return n===0&&(n|=32&r),n|=2&r,n!==i&&be(e,n),new t(e)}function tp(e,t,i){if(t)e:{if(!Tr(t=e))throw La("int64");switch(typeof t){case"string":t=ld(t);break e;case"bigint":t=Gt(Lr(64,t));break e;default:t=ud(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?Gt(Lr(64,t)):Tr(t)?e==="string"?ld(t):ud(t):void 0;return(e=t)==null?i?Jf:void 0:e}function ip(e){return e}const rp={};let np=function(){try{return cn(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class qa{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,i){return this.g.set(t,i),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}[Symbol.iterator](){return this.entries()}}const op=np?(Object.setPrototypeOf(qa.prototype,Map.prototype),Object.defineProperties(qa.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),qa):class extends Map{constructor(){super()}};function hd(e){return e}function Va(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var bt=class extends op{constructor(e,t,i=hd,r=hd){super();let n=0|e[L];n|=64,be(e,n),this.M=n,this.I=t,this.S=i,this.X=this.I?sp:r;for(let o=0;o<e.length;o++){const s=e[o],a=i(s[0],!1,!0);let c=s[1];t?c===void 0&&(c=null):c=r(s[1],!1,!0,void 0,void 0,n),super.set(a,c)}}La(){var e=dp;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=ap){const t=[],i=super.entries();for(var r;!(r=i.next()).done;)(r=r.value)[0]=e(r[0]),r[1]=e(r[1]),t.push(r);return t}clear(){Va(this),super.clear()}delete(e){return Va(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new K2(e,cp,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new K2(e,bt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((i,r,n)=>{e.call(t,n.get(r),r,n)}):super.forEach(e,t)}set(e,t){return Va(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var i=this.I;return i?((i=this.X(t,!1,!0,i,this.pa,this.M))!==t&&super.set(e,i),i):t}}[Symbol.iterator](){return this.entries()}};function sp(e,t,i,r,n,o){return e=Ua(e,r,i,o),n&&(e=_n(e)),e}function ap(e){return e}function cp(e){return[e,this.get(e)]}let lp,vn,fd,up;function pd(){return lp||(lp=new bt(Fi([]),void 0,void 0,void 0,rp))}function ja(e,t,i,r,n){if(e!=null){if(Array.isArray(e)){const o=0|e[L];return e.length===0&&1&o?void 0:n&&2&o?e:bn(e,t,i,r!==void 0,n)}return t(e,r)}}function bn(e,t,i,r,n){const o=r||i?0|e[L]:0,s=r?!!(32&o):void 0;let a=0;const c=(r=Oe(e)).length;for(let p=0;p<c;p++){var l=r[p];if(p===c-1&&hn(l)){var d=t,u=i,h=s,f=n;let m;for(let v in l){const g=ja(l[v],d,u,h,f);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=ja(r[p],t,i,s,n);r[p]=l,l!=null&&(a=p+1)}return a<c&&(r.length=a),i&&((e=Ba(e))&&(r[Ii]=Oe(e)),i(o,r)),r}function dp(e){return ja(e,za,void 0,void 0,!1)}function za(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Da(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(di(e))return di(e)&&Ta(G2),H2(e);if(e.W===Ar)return md(e);if(e instanceof Tt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=H2(t)}return e instanceof bt?e.La():void 0}return e}function md(e){var t=e.u;e=bn(t,za,void 0,void 0,!1);var i=0|t[L];if((t=e.length)&&!(512&i)){var r=e[t-1],n=!1;hn(r)?(t--,n=!0):r=void 0;var o=t-(i=512&i?0:-1),s=(vn!=null?vn:ip)(o,i,e,r);if(r&&(e[t]=void 0),o<s&&r){for(var a in o=!0,r){const c=+a;c<=s?(e[n=c+i]=r[a],t=Math.max(n+1,t),n=!1,delete r[a]):o=!1}o&&(r=void 0)}for(o=t-1;t>0;o=t-1)if((a=e[o])==null)t--,n=!0;else{if(!((o-=i)>=s))break;(r!=null?r:r={})[o]=a,t--,n=!0}n&&(e.length=t),r&&e.push(r)}return e}function Xt(e,t,i){return e=gd(e,t[0],t[1],i?1:2),t!==fd&&i&&un(e,8192),e}function gd(e,t,i,r){if(e==null){var n=96;i?(e=[i],n|=512):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(n=0|e[L])||!(64&n)||2&n||Ta(Uf),1024&n)throw Error("farr");if(64&n)return e;if(r===1||r===2||(n|=64),i&&(n|=512,i!==e[0]))throw Error("mid");e:{var o=(i=e).length;if(o){var s=o-1;if(hn(r=i[s])){if((s-=t=512&(n|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in r)(o=+a)<s&&(i[o+t]=r[a],delete r[a]);n=-16760833&n|(1023&s)<<14;break e}}if(t){if((a=Math.max(t,o-(512&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&a)<<14}}}return be(e,n),e}function Ga(e,t,i=Ma){if(e!=null){if($2&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var r=0|e[L];return 2&r?e:(t&&(t=r===0||!!(32&r)&&!(64&r||!(16&r))),t?(be(e,34|r),4&r&&Object.freeze(e),e):bn(e,Ga,4&r?Ma:i,!0,!0))}return e.W===Ar?e=2&(r=0|(i=e.u)[L])?e:new e.constructor(yn(i,r,!0)):e instanceof bt&&!(2&e.M)&&(i=Fi(e.da(Ga)),e=new bt(i,e.I,e.S,e.X)),e}}function yn(e,t,i){const r=i||2&t?Ma:qf,n=!!(32&t);return e=function(o,s,a){const c=Oe(o);var l=c.length;const d=256&s?c[l-1]:void 0;for(l+=d?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(d){s=c[s]={};for(const u in d)s[u]=a(d[u])}return(o=Ba(o))&&(c[Ii]=Oe(o)),c}(e,t,o=>Ga(o,n,r)),un(e,32|(i?2:0)),e}function _n(e){const t=e.u,i=0|t[L];return 2&i?new e.constructor(yn(t,i,!1)):e}function Pi(e,t){return Mt(e=e.u,0|e[L],t)}function Mt(e,t,i){if(i===-1)return null;const r=i+(512&t?0:-1),n=e.length-1;return r>=n&&256&t?e[n][i]:r<=n?e[r]:void 0}function Q(e,t,i){const r=e.u;let n=0|r[L];return zt(n),ce(r,n,t,i),e}function ce(e,t,i,r){const n=512&t?0:-1,o=i+n;var s=e.length-1;return o>=s&&256&t?(e[s][i]=r,t):o<=s?(e[o]=r,t):(r!==void 0&&(i>=(s=t>>14&1023||536870912)?r!=null&&(e[s+n]={[i]:r},be(e,t|=256)):e[o]=r),t)}function wn(e,t){let i=0|(e=e.u)[L];const r=Mt(e,i,t),n=Wt(r);return n!=null&&n!==r&&ce(e,i,t,n),n}function vd(e){let t=0|(e=e.u)[L];const i=Mt(e,t,1),r=Fa(i,!0);return r!=null&&r!==i&&ce(e,t,1,r),r}function pi(){return Vf===void 0?2:4}function mi(e,t,i,r,n){const o=e.u,s=2&(e=0|o[L])?1:r;n=!!n;let a=0|(r=Za(o,e,t))[L];if(!(4&a)){4&a&&(r=Oe(r),a=Bt(a,e),e=ce(o,e,t,r));let c=0,l=0;for(;c<r.length;c++){const d=i(r[c]);d!=null&&(r[l++]=d)}l<c&&(r.length=l),a=Wa(a,e),i=-2049&(20|a),a=i&=-4097,be(r,a),2&a&&Object.freeze(r)}return s===1||s===4&&32&a?It(a)||(n=a,a|=2,a!==n&&be(r,a),Object.freeze(r)):(s===2&&It(a)&&(r=Oe(r),a=Bt(a,e),a=Kt(a,e,n),be(r,a),e=ce(o,e,t,r)),It(a)||(t=a,a=Kt(a,e,n),a!==t&&be(r,a))),r}function Za(e,t,i){return e=Mt(e,t,i),Array.isArray(e)?e:Ia}function Wa(e,t){return e===0&&(e=Bt(e,t)),1|e}function It(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function bd(e){e=Oe(e);for(let t=0;t<e.length;t++){const i=e[t]=Oe(e[t]);Array.isArray(i[1])&&(i[1]=Fi(i[1]))}return e}function Xa(e,t,i,r){let n=0|(e=e.u)[L];zt(n),ce(e,n,t,(r==="0"?Number(i)===0:i===r)?void 0:i)}function $i(e,t,i,r){zt(t);let n=Za(e,t,i);const o=n!==Ia;if(64&t||!(8192&t)||!o){const s=o?0|n[L]:0;let a=s;(!o||2&a||It(a)||4&a&&!(32&a))&&(n=Oe(n),a=Bt(a,t),t=ce(e,t,i,n)),a=-13&Wa(a,t),a=Kt(r?-17&a:16|a,t,!0),a!==s&&be(n,a)}return n}function Ka(e,t){var i=bh;return Ja(Ya(e=e.u),e,0|e[L],i)===t?t:-1}function Ya(e){var i;if(ln)return(i=e[kr])!=null?i:e[kr]=new Map;if(kr in e)return e[kr];const t=new Map;return Object.defineProperty(e,kr,{value:t}),t}function yd(e,t,i,r){const n=Ya(e),o=Ja(n,e,t,i);return o!==r&&(o&&(t=ce(e,t,o)),n.set(i,r)),t}function Ja(e,t,i,r){let n=e.get(r);if(n!=null)return n;n=0;for(let o=0;o<r.length;o++){const s=r[o];Mt(t,i,s)!=null&&(n!==0&&(i=ce(t,i,n)),n=s)}return e.set(r,n),n}function Qa(e,t,i){let r=0|e[L];const n=Mt(e,r,i);let o;if(n!=null&&n.W===Ar)return(t=_n(n))!==n&&ce(e,r,i,t),t.u;if(Array.isArray(n)){const s=0|n[L];o=2&s?Xt(yn(n,s,!1),t,!0):64&s?n:Xt(o,t,!0)}else o=Xt(void 0,t,!0);return o!==n&&ce(e,r,i,o),o}function _d(e,t,i){let r=0|(e=e.u)[L];const n=Mt(e,r,i);return(t=Ua(n,t,!1,r))!==n&&t!=null&&ce(e,r,i,t),t}function V(e,t,i){if((t=_d(e,t,i))==null)return t;let r=0|(e=e.u)[L];if(!(2&r)){const n=_n(t);n!==t&&ce(e,r,i,t=n)}return t}function wd(e,t,i,r,n,o,s){e=e.u;var a=!!(2&t);const c=a?1:n;o=!!o,s&&(s=!a);var l=0|(n=Za(e,t,r))[L];if(!(a=!!(4&l))){var d=n,u=t;const h=!!(2&(l=Wa(l,t)));h&&(u|=2);let f=!h,p=!0,m=0,v=0;for(;m<d.length;m++){const g=Ua(d[m],i,!1,u);if(g instanceof i){if(!h){const b=!!(2&(0|g.u[L]));f&&(f=!b),p&&(p=b)}d[v++]=g}}v<m&&(d.length=v),l|=4,l=p?16|l:-17&l,be(d,l=f?8|l:-9&l),h&&Object.freeze(d)}if(s&&!(8&l||!n.length&&(c===1||c===4&&32&l))){for(It(l)&&(n=Oe(n),l=Bt(l,t),t=ce(e,t,r,n)),i=n,s=l,d=0;d<i.length;d++)(l=i[d])!==(u=_n(l))&&(i[d]=u);s|=8,be(i,s=i.length?-17&s:16|s),l=s}return c===1||c===4&&32&l?It(l)||(t=l,(l|=!n.length||16&l&&(!a||32&l)?2:1024)!==t&&be(n,l),Object.freeze(n)):(c===2&&It(l)&&(be(n=Oe(n),l=Kt(l=Bt(l,t),t,o)),t=ce(e,t,r,n)),It(l)||(r=l,(l=Kt(l,t,o))!==r&&be(n,l))),n}function Ft(e,t,i){const r=0|e.u[L];return wd(e,r,t,i,pi(),!1,!(2&r))}function I(e,t,i,r){return r==null&&(r=void 0),Q(e,i,r)}function Mr(e,t,i,r){r==null&&(r=void 0);e:{let n=0|(e=e.u)[L];if(zt(n),r==null){const o=Ya(e);if(Ja(o,e,n,i)!==t)break e;o.set(i,0)}else n=yd(e,n,i,t);ce(e,n,t,r)}}function Bt(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Kt(e,t,i){return 32&t&&i||(e&=-33),e}function Cn(e,t,i){zt(0|e.u[L]),mi(e,t,Oi,2,!0).push(dd(i))}function En(e,t,i,r){const n=0|e.u[L];zt(n),e=wd(e,n,i,t,2,!0),r=r!=null?r:new i,e.push(r),e[L]=2&(0|r.u[L])?-9&e[L]:-17&e[L]}function et(e,t){return Di(Pi(e,t))}function tt(e,t){return Oi(Pi(e,t))}function fe(e,t){var i;return(i=wn(e,t))!=null?i:0}function Ir(e,t,i){if(i!=null&&typeof i!="boolean")throw e=typeof i,Error(`Expected boolean but got ${e!="object"?e:i?Array.isArray(i)?"array":e:"null"}: ${i}`);Q(e,t,i)}function yt(e,t,i){if(i!=null){if(typeof i!="number"||!gn(i))throw La("int32");i|=0}Q(e,t,i)}function A(e,t,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);Q(e,t,i)}function xn(e,t,i){{const s=e.u;let a=0|s[L];if(zt(a),i==null)ce(s,a,t);else{var r=e=0|i[L],n=It(e),o=n||Object.isFrozen(i);for(n||(e=0),o||(i=Oe(i),r=0,e=Kt(e=Bt(e,a),a,!0),o=!1),e|=21,n=0;n<i.length;n++){const c=i[n],l=dd(c);Object.is(c,l)||(o&&(i=Oe(i),r=0,e=Kt(e=Bt(e,a),a,!0),o=!1),i[n]=l)}e!==r&&(o&&(i=Oe(i),e=Kt(e=Bt(e,a),a,!0)),be(i,e)),ce(s,a,t,i)}}}function Cd(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function ec(){return Error("Failed to read varint, encoding is invalid.")}function Ed(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function tc(e){if(typeof e=="string")return{buffer:q2(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Tt)return{buffer:Aa(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function ic(e,t){let i,r=0,n=0,o=0;const s=e.h;let a=e.g;do i=s[a++],r|=(127&i)<<o,o+=7;while(o<32&&128&i);for(o>32&&(n|=(127&i)>>4),o=3;o<32&&128&i;o+=7)i=s[a++],n|=(127&i)<<o;if(gi(e,a),i<128)return t(r>>>0,n>>>0);throw ec()}function rc(e){let t=0,i=e.g;const r=i+10,n=e.h;for(;i<r;){const o=n[i++];if(t|=o,(128&o)==0)return gi(e,i),!!(127&t)}throw ec()}function Yt(e){const t=e.h;let i=e.g,r=t[i++],n=127&r;if(128&r&&(r=t[i++],n|=(127&r)<<7,128&r&&(r=t[i++],n|=(127&r)<<14,128&r&&(r=t[i++],n|=(127&r)<<21,128&r&&(r=t[i++],n|=r<<28,128&r&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++])))))throw ec();return gi(e,i),n}function Dt(e){return Yt(e)>>>0}function nc(e){var t=e.h;const i=e.g,r=t[i],n=t[i+1],o=t[i+2];return t=t[i+3],gi(e,e.g+4),(r<<0|n<<8|o<<16|t<<24)>>>0}function oc(e){var t=nc(e);e=2*(t>>31)+1;const i=t>>>23&255;return t&=8388607,i==255?t?NaN:e*(1/0):i==0?1401298464324817e-60*e*t:e*Math.pow(2,i-150)*(t+8388608)}function hp(e){return Yt(e)}function sc(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=tc(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function gi(e,t){if(e.g=t,t>e.l)throw Ed(e.l,t)}function xd(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const i=e.g,r=i+t;if(r>e.l)throw Ed(t,e.l-i);return e.g=r,i}function kd(e,t){if(t==0)return hi();var i=xd(e,t);return e.aa&&e.m?i=e.h.subarray(i,i+t):(e=e.h,i=i===(t=i+t)?new Uint8Array(0):Kf?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?hi():new Tt(i,Ti)}bt.prototype.toJSON=void 0;var Ad=[];function Sd(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Dt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw Cd(i,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=i,!0}function kn(e){switch(e.h){case 0:e.h!=0?kn(e):rc(e.g);break;case 1:gi(e=e.g,e.g+8);break;case 2:if(e.h!=2)kn(e);else{var t=Dt(e.g);gi(e=e.g,e.g+t)}break;case 5:gi(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Sd(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}kn(e)}break;default:throw Cd(e.h,e.l)}}function Fr(e,t,i){const r=e.g.l,n=Dt(e.g),o=e.g.g+n;let s=o-r;if(s<=0&&(e.g.l=o,i(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=o,e.g.l=r,t}function ac(e){var t=Dt(e.g),i=xd(e=e.g,t);if(e=e.h,Ff){var r,n=e;(r=_a)||(r=_a=new TextDecoder("utf-8",{fatal:!0})),t=i+t,n=i===0&&t===n.length?n:n.subarray(i,t);try{var o=r.decode(n)}catch(a){if(sn===void 0){try{r.decode(new Uint8Array([128]))}catch(c){}try{r.decode(new Uint8Array([97])),sn=!0}catch(c){sn=!1}}throw!sn&&(_a=void 0),a}}else{t=(o=i)+t,i=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?i.push(s):s<224?o>=t?ui():(a=e[o++],s<194||(192&a)!=128?(o--,ui()):i.push((31&s)<<6|63&a)):s<240?o>=t-1?ui():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(r=e[o++]))!=128?(o--,ui()):i.push((15&s)<<12|(63&a)<<6|63&r)):s<=244?o>=t-2?ui():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(r=e[o++]))!=128||(192&(n=e[o++]))!=128?(o--,ui()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&n,s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))):ui(),i.length>=8192&&(c=I2(c,i),i.length=0)}o=I2(c,i)}return o}function Ld(e){const t=Dt(e.g);return kd(e.g,t)}function An(e,t,i){var r=Dt(e.g);for(r=e.g.g+r;e.g.g<r;)i.push(t(e.g))}var Sn=[];function ht(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var k=class{constructor(e,t){this.u=gd(e,t)}toJSON(){try{var e=md(this)}finally{vn=void 0}return e}l(){var e=Wp;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(yn(e,0|e[L],!1))}O(){return!!(2&(0|this.u[L]))}};function Td(e){return e?/^\d+$/.test(e)?(mn(e),new cc(Y,ue)):null:fp||(fp=new cc(0,0))}k.prototype.W=Ar,k.prototype.toString=function(){return this.u.toString()};var cc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let fp;function Md(e){return e?/^-?\d+$/.test(e)?(mn(e),new lc(Y,ue)):null:pp||(pp=new lc(0,0))}var lc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let pp;function Ni(e,t,i){for(;i>0||t>127;)e.g.push(127&t|128),t=(t>>>7|i<<25)>>>0,i>>>=7;e.g.push(t)}function Hi(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Ln(e,t){if(t>=0)Hi(e,t);else{for(let i=0;i<9;i++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Br(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Ui(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function He(e,t,i){Hi(e.g,8*t+i)}function uc(e,t){return He(e,t,2),t=e.g.end(),Ui(e,t),t.push(e.h),t}function dc(e,t){var i=t.pop();for(i=e.h+e.g.length()-i;i>127;)t.push(127&i|128),i>>>=7,e.h++;t.push(i),e.h++}function Tn(e,t,i){He(e,t,2),Hi(e.g,i.length),Ui(e,e.g.end()),Ui(e,i)}function Mn(e,t,i,r){i!=null&&(t=uc(e,t),r(i,e),dc(e,t))}function ft(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var hc=ft(),Id=ft(),fc=ft(),pc=ft(),Fd=ft(),Bd=ft(),mc=ft(),Dd=ft(),Rd=ft(),qi=class{constructor(e,t,i){this.g=e,this.h=t,e=hc,this.l=!!e&&i===e||!1}};function In(e,t){return new qi(e,t,hc)}function Od(e,t,i,r,n){Mn(e,i,Hd(t,r),n)}const mp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Qa(t,r,i),n),!0)},Od),gp=In(function(e,t,i,r,n){return e.h===2&&(Fr(e,Qa(t,r,i),n),!0)},Od);var Fn=Symbol(),gc=Symbol(),Pd=Symbol(),$d=Symbol();let Bn,Dn;function vi(e,t,i,r){var n=r[e];if(n)return n;(n={}).Ma=r,n.T=function(u){switch(typeof u){case"boolean":return fd||(fd=[0,void 0,!0]);case"number":return u>0?void 0:u===0?up||(up=[0,void 0]):[-u,void 0];case"string":return[0,u];case"object":return u}}(r[0]);var o=r[1];let s=1;o&&o.constructor===Object&&(n.ga=o,typeof(o=r[++s])=="function"&&(n.la=!0,Bn!=null||(Bn=o),Dn!=null||(Dn=r[s+1]),o=r[s+=2]));const a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=r[++s]}for(c=1;o!==void 0;){let u;typeof o=="number"&&(c+=o,o=r[++s]);var l=void 0;if(o instanceof qi?u=o:(u=mp,s--),u==null?void 0:u.l){o=r[++s],l=r;var d=s;typeof o=="function"&&(o=o(),l[d]=o),l=o}for(d=c+1,typeof(o=r[++s])=="number"&&o<0&&(d-=o,o=r[++s]);c<d;c++){const h=a[c];l?i(n,c,u,l,h):t(n,c,u,h)}}return r[e]=n}function Nd(e){return Array.isArray(e)?e[0]instanceof qi?e:[gp,e]:[e,void 0]}function Hd(e,t){return e instanceof k?e.u:Array.isArray(e)?Xt(e,t,!1):void 0}function vc(e,t,i,r){const n=i.g;e[t]=r?(o,s,a)=>n(o,s,a,r):n}function bc(e,t,i,r,n){const o=i.g;let s,a;e[t]=(c,l,d)=>o(c,l,d,a||(a=vi(gc,vc,bc,r).T),s||(s=yc(r)),n)}function yc(e){let t=e[Pd];if(t!=null)return t;const i=vi(gc,vc,bc,e);return t=i.la?(r,n)=>Bn(r,n,i):(r,n)=>{const o=0|r[L];for(;Sd(n)&&n.h!=4;){var s=n.m,a=i[s];if(a==null){var c=i.ga;c&&(c=c[s])&&(c=vp(c))!=null&&(a=i[s]=c)}a!=null&&a(n,r,s)||(s=(a=n).l,kn(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=kd(a.g,c)),s=r,a&&((c=s[Ii])?c.push(a):s[Ii]=[a]))}return 8192&o&&Fi(r),!0},e[Pd]=t}function vp(e){const t=(e=Nd(e))[0].g;if(e=e[1]){const i=yc(e),r=vi(gc,vc,bc,e).T;return(n,o,s)=>t(n,o,s,r,i)}return t}function Rn(e,t,i){e[t]=i.h}function On(e,t,i,r){let n,o;const s=i.h;e[t]=(a,c,l)=>s(a,c,l,o||(o=vi(Fn,Rn,On,r).T),n||(n=Ud(r)))}function Ud(e){let t=e[$d];if(!t){const i=vi(Fn,Rn,On,e);t=(r,n)=>qd(r,n,i),e[$d]=t}return t}function qd(e,t,i){(function(r,n,o){const s=512&n?0:-1,a=r.length,c=a+((n=64&n?256&n:!!a&&hn(r[a-1]))?-1:0);for(let l=0;l<c;l++)o(l-s,r[l]);if(n){r=r[a-1];for(const l in r)!isNaN(l)&&o(+l,r[l])}})(e,0|e[L]|(i.T[1]?512:0),(r,n)=>{if(n!=null){var o=function(s,a){var c=s[a];if(c)return c;if((c=s.ga)&&(c=c[a])){var l=(c=Nd(c))[0].h;if(c=c[1]){const d=Ud(c),u=vi(Fn,Rn,On,c).T;c=s.la?Dn(u,d):(h,f,p)=>l(h,f,p,u,d)}else c=l;return s[a]=c}}(i,r);o&&o(t,n,r)}}),(e=Ba(e))&&function(r,n){Ui(r,r.g.end());for(let o=0;o<n.length;o++)Ui(r,Aa(n[o])||new Uint8Array(0))}(t,e)}function Vi(e,t){if(Array.isArray(t)){var i=0|t[L];if(4&i)return t;for(var r=0,n=0;r<t.length;r++){const o=e(t[r]);o!=null&&(t[n++]=o)}return n<r&&(t.length=n),be(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Me(e,t,i){return new qi(e,t,i)}function ji(e,t,i){return new qi(e,t,i)}function Ie(e,t,i){ce(e,0|e[L],t,i)}var bp=In(function(e,t,i,r,n){return e.h===2&&(e=Fr(e,Xt([void 0,void 0],r,!0),n),zt(r=0|t[L]),(n=Mt(t,r,i))instanceof bt?(2&n.M)!=0?((n=n.da()).push(e),ce(t,r,i,n)):n.Ja(e):Array.isArray(n)?(2&(0|n[L])&&ce(t,r,i,n=bd(n)),n.push(e)):ce(t,r,i,[e]),!0)},function(e,t,i,r,n){if(t instanceof bt)t.forEach((o,s)=>{Mn(e,i,Xt([s,o],r,!1),n)});else if(Array.isArray(t))for(let o=0;o<t.length;o++){const s=t[o];Array.isArray(s)&&Mn(e,i,Xt(s,r,!1),n)}});function Vd(e,t,i){if(t=function(r){if(r==null)return r;const n=typeof r;if(n==="bigint")return String(Lr(64,r));if(Tr(r)){if(n==="string")return cd(r);if(n==="number")return Na(r)}}(t),t!=null&&(typeof t=="string"&&Md(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,fi(t),Ni(e,Y,ue);break;case"bigint":i=BigInt.asUintN(64,t),i=new lc(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ni(e.g,i.h,i.g);break;default:i=Md(t),Ni(e.g,i.h,i.g)}}function jd(e,t,i){(t=Di(t))!=null&&t!=null&&(He(e,i,0),Ln(e.g,t))}function zd(e,t,i){(t=rd(t))!=null&&(He(e,i,0),e.g.g.push(t?1:0))}function Gd(e,t,i){(t=Oi(t))!=null&&Tn(e,i,F2(t))}function Zd(e,t,i,r,n){Mn(e,i,Hd(t,r),n)}function Wd(e,t,i){t==null||typeof t=="string"||t instanceof Tt||(di(t)?di(t)&&Ta(G2):t=void 0),t!=null&&Tn(e,i,tc(t).buffer)}function Xd(e,t,i){return(e.h===5||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,oc,t):t.push(oc(e.g)),!0)}var Rt=Me(function(e,t,i){if(e.h!==1)return!1;var r=e.g;e=nc(r);const n=nc(r);r=2*(n>>31)+1;const o=n>>>20&2047;return e=4294967296*(1048575&n)+e,Ie(t,i,o==2047?e?NaN:r*(1/0):o==0?5e-324*r*e:r*Math.pow(2,o-1075)*(e+4503599627370496)),!0},function(e,t,i){(t=Wt(t))!=null&&(He(e,i,1),e=e.g,(i=Q2||(Q2=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),Y=i.getUint32(0,!0),ue=i.getUint32(4,!0),Br(e,Y),Br(e,ue))},ft()),ye=Me(function(e,t,i){return e.h===5&&(Ie(t,i,oc(e.g)),!0)},function(e,t,i){(t=Wt(t))!=null&&(He(e,i,5),e=e.g,Ra(t),Br(e,Y))},mc),yp=ji(Xd,function(e,t,i){if((t=Vi(Wt,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(He(r,n,5),r=r.g,Ra(o),Br(r,Y))}},mc),_c=ji(Xd,function(e,t,i){if((t=Vi(Wt,t))!=null&&t.length){He(e,i,2),Hi(e.g,4*t.length);for(let r=0;r<t.length;r++)i=e.g,Ra(t[r]),Br(i,Y)}},mc),Jt=Me(function(e,t,i){return e.h===0&&(Ie(t,i,ic(e.g,Pa)),!0)},Vd,Bd),wc=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=ic(e.g,Pa))===0?void 0:e),!0)},Vd,Bd),_p=Me(function(e,t,i){return e.h===0&&(Ie(t,i,ic(e.g,Oa)),!0)},function(e,t,i){if((t=ep(t))!=null&&(typeof t=="string"&&Td(t),t!=null))switch(He(e,i,0),typeof t){case"number":e=e.g,fi(t),Ni(e,Y,ue);break;case"bigint":i=BigInt.asUintN(64,t),i=new cc(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Ni(e.g,i.h,i.g);break;default:i=Td(t),Ni(e.g,i.h,i.g)}},ft()),de=Me(function(e,t,i){return e.h===0&&(Ie(t,i,Yt(e.g)),!0)},jd,pc),Pn=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,Yt,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=uc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);dc(e,i)}},pc),zi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=Yt(e.g))===0?void 0:e),!0)},jd,pc),ne=Me(function(e,t,i){return e.h===0&&(Ie(t,i,rc(e.g)),!0)},zd,Id),Gi=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=rc(e.g))===!1?void 0:e),!0)},zd,Id),Se=ji(function(e,t,i){return e.h===2&&(e=ac(e),$i(t,0|t[L],i,!1).push(e),!0)},function(e,t,i){if((t=Vi(Oi,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&Tn(r,n,F2(o))}},fc),Qt=Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=ac(e))===""?void 0:e),!0)},Gd,fc),W=Me(function(e,t,i){return e.h===2&&(Ie(t,i,ac(e)),!0)},Gd,fc),we=function(e,t,i=hc){return new qi(e,t,i)}(function(e,t,i,r,n){return e.h===2&&(r=Xt(void 0,r,!0),$i(t,0|t[L],i,!0).push(r),Fr(e,r,n),!0)},function(e,t,i,r,n){if(Array.isArray(t))for(let o=0;o<t.length;o++)Zd(e,t[o],i,r,n)}),X=In(function(e,t,i,r,n,o){return e.h===2&&(yd(t,0|t[L],o,i),Fr(e,t=Qa(t,r,i),n),!0)},Zd),Kd=Me(function(e,t,i){return e.h===2&&(Ie(t,i,Ld(e)),!0)},Wd,Dd),wp=ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,Dt,t):t.push(Dt(e.g)),!0)},function(e,t,i){if((t=Vi(nd,t))!=null)for(let s=0;s<t.length;s++){var r=e,n=i,o=t[s];o!=null&&(He(r,n,0),Hi(r.g,o))}},Fd),Cp=Me(function(e,t,i){return e.h===0&&(Ie(t,i,(e=Dt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=nd(t))!=null&&t!=null&&(He(e,i,0),Hi(e.g,t))},Fd),Ue=Me(function(e,t,i){return e.h===0&&(Ie(t,i,Yt(e.g)),!0)},function(e,t,i){(t=Di(t))!=null&&(t=parseInt(t,10),He(e,i,0),Ln(e.g,t))},Rd);class Ep{constructor(t,i){this.h=t,this.g=i,this.l=V,this.m=I,this.defaultValue=void 0}register(){cn(this)}}function pt(e,t){return new Ep(e,t)}function ei(e,t){return(i,r)=>{if(Sn.length){const o=Sn.pop();o.o(r),sc(o.g,i,r),i=o}else i=new class{constructor(o,s){if(Ad.length){const a=Ad.pop();sc(a,o,s),o=a}else o=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,sc(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(o,s);this.g=o,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:o=!1}={}){this.fa=o}}(i,r);try{const o=new e,s=o.u;yc(t)(s,i);var n=o}finally{i.g.clear(),i.m=-1,i.h=-1,Sn.length<100&&Sn.push(i)}return n}}function $n(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const s=this.g;return this.g=[],s}}}};qd(this.u,t,vi(Fn,Rn,On,e)),Ui(t,t.g.end());const i=new Uint8Array(t.h),r=t.l,n=r.length;let o=0;for(let s=0;s<n;s++){const a=r[s];i.set(a,o),o+=a.length}return t.l=[i],i}}var Yd=class extends k{constructor(e){super(e)}},Jd=[0,Qt,Me(function(e,t,i){return e.h===2&&(Ie(t,i,(e=Ld(e))===hi()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof k){const r=t.Oa;return void(r&&(t=r(t),t!=null&&Tn(e,i,tc(t).buffer)))}if(Array.isArray(t))return}Wd(e,t,i)},Dd)];let Cc,Qd=globalThis.trustedTypes;function eh(e){Cc===void 0&&(Cc=function(){let i=null;if(!Qd)return i;try{const r=n=>n;i=Qd.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(r){}return i}());var t=Cc;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function xp(e,...t){if(t.length===0)return eh(e[0]);let i=e[0];for(let r=0;r<t.length;r++)i+=encodeURIComponent(t[r])+e[r+1];return eh(i)}var th=[0,de,Ue,ne,-1,Pn,Ue,-1],kp=class extends k{constructor(e){super(e)}},ih=[0,ne,W,ne,Ue,-1,ji(function(e,t,i){return(e.h===0||e.h===2)&&(t=$i(t,0|t[L],i,!1),e.h==2?An(e,hp,t):t.push(Yt(e.g)),!0)},function(e,t,i){if((t=Vi(Di,t))!=null&&t.length){i=uc(e,i);for(let r=0;r<t.length;r++)Ln(e.g,t[r]);dc(e,i)}},Rd),W,-1,[0,ne,-1],Ue,ne,-1],rh=[0,W,-2],nh=class extends k{constructor(e){super(e)}},oh=[0],sh=[0,de,ne,1,ne,-3],qe=class extends k{constructor(e){super(e,2)}},_e={};_e[336783863]=[0,W,ne,-1,de,[0,[1,2,3,4,5,6,7,8,9],X,oh,X,ih,X,rh,X,sh,X,th,X,[0,W,-2],X,[0,W,Ue],X,[0,Ue,W,-1],X,[0,Ue,-1]],[0,W],ne,[0,[1,3],[2,4],X,[0,Pn],-1,X,[0,Se],-1,we,[0,W,-1]],W];var ah=[0,wc,-1,Gi,-3,wc,Pn,Qt,zi,wc,-1,Gi,zi,Gi,-2,Qt];function Ve(e,t){Xa(e,2,Ri(t),"")}function ee(e,t){Cn(e,3,t)}function q(e,t){Cn(e,4,t)}var Fe=class extends k{constructor(e){super(e,500)}o(e){return I(this,0,7,e)}},Dr=[-1,{}],ch=[0,W,1,Dr],lh=[0,W,Se,Dr];function je(e,t){En(e,1,Fe,t)}function ie(e,t){Cn(e,10,t)}function z(e,t){Cn(e,15,t)}var Pe=class extends k{constructor(e){super(e,500)}o(e){return I(this,0,1001,e)}},uh=[-500,we,[-500,Qt,-1,Se,-3,[-2,_e,ne],we,Jd,zi,-1,ch,lh,we,[0,Qt,Gi],Qt,ah,zi,Se,987,Se],4,we,[-500,W,-1,[-1,{}],998,W],we,[-500,W,Se,-1,[-2,{},ne],997,Se,-1],zi,we,[-500,W,Se,Dr,998,Se],Se,zi,ch,lh,we,[0,Qt,-1,Dr],Se,-2,ah,Qt,-1,Gi,[0,Gi,Cp],978,Dr,we,Jd];Pe.prototype.g=$n(uh);var Ap=ei(Pe,uh),Sp=class extends k{constructor(e){super(e)}},dh=class extends k{constructor(e){super(e)}g(){return Ft(this,Sp,1)}},hh=[0,we,[0,de,ye,W,-1]],Nn=ei(dh,hh),Lp=class extends k{constructor(e){super(e)}},Tp=class extends k{constructor(e){super(e)}},Ec=class extends k{constructor(e){super(e)}h(){return V(this,Lp,2)}g(){return Ft(this,Tp,5)}},fh=ei(class extends k{constructor(e){super(e)}},[0,Se,Pn,_c,[0,Ue,[0,de,-3],[0,ye,-3],[0,de,-1,[0,we,[0,de,-2]]],we,[0,ye,-1,W,ye]],W,-1,Jt,we,[0,de,ye],Se,Jt]),ph=class extends k{constructor(e){super(e)}},Zi=ei(class extends k{constructor(e){super(e)}},[0,we,[0,ye,-4]]),mh=class extends k{constructor(e){super(e)}},Rr=ei(class extends k{constructor(e){super(e)}},[0,we,[0,ye,-4]]),Mp=class extends k{constructor(e){super(e)}},Ip=[0,de,-1,_c,Ue],gh=class extends k{constructor(e){super(e)}};gh.prototype.g=$n([0,ye,-4,Jt]);var Fp=class extends k{constructor(e){super(e)}},Bp=ei(class extends k{constructor(e){super(e)}},[0,we,[0,1,de,W,hh],Jt]),vh=class extends k{constructor(e){super(e)}},Dp=class extends k{constructor(e){super(e)}ma(){const e=vd(this);return e==null?hi():e}},Rp=class extends k{constructor(e){super(e)}},bh=[1,2],Op=ei(class extends k{constructor(e){super(e)}},[0,we,[0,bh,X,[0,_c],X,[0,Kd],de,W],Jt]),xc=class extends k{constructor(e){super(e)}},yh=[0,W,de,ye,Se,-1],_h=class extends k{constructor(e){super(e)}},Pp=[0,ne,-1],wh=class extends k{constructor(e){super(e)}},Hn=[1,2,3,4,5],Un=class extends k{constructor(e){super(e)}g(){return vd(this)!=null}h(){return tt(this,2)!=null}},oe=class extends k{constructor(e){super(e)}g(){var e;return(e=rd(Pi(this,2)))!=null?e:!1}},Ch=[0,Kd,W,[0,de,Jt,-1],[0,_p,Jt]],pe=[0,Ch,ne,[0,Hn,X,sh,X,ih,X,th,X,oh,X,rh],Ue],qn=class extends k{constructor(e){super(e)}},kc=[0,pe,ye,-1,de],$p=pt(502141897,qn);_e[502141897]=kc;var Np=ei(class extends k{constructor(e){super(e)}},[0,[0,Ue,-1,yp,wp],Ip]),Eh=class extends k{constructor(e){super(e)}},xh=class extends k{constructor(e){super(e)}},Ac=[0,pe,ye,[0,pe],ne],kh=[0,pe,kc,Ac,ye,[0,[0,Ch]]],Hp=pt(508968150,xh);_e[508968150]=kh,_e[508968149]=Ac;var Ah=class extends k{constructor(e){super(e)}},Up=pt(513916220,Ah);_e[513916220]=[0,pe,kh,de];var Wi=class extends k{constructor(e){super(e)}h(){return V(this,xc,2)}g(){Q(this,2)}},Sh=[0,pe,yh];_e[478825465]=Sh;var qp=class extends k{constructor(e){super(e)}},Lh=class extends k{constructor(e){super(e)}},Sc=class extends k{constructor(e){super(e)}},Lc=class extends k{constructor(e){super(e)}},Th=class extends k{constructor(e){super(e)}},Mh=[0,pe,[0,pe],Sh,-1],Ih=[0,pe,ye,de],Tc=[0,pe,ye],Fh=[0,pe,Ih,Tc,ye],Vp=pt(479097054,Th);_e[479097054]=[0,pe,Fh,Mh],_e[463370452]=Mh,_e[464864288]=Ih;var jp=pt(462713202,Lc);_e[462713202]=Fh,_e[474472470]=Tc;var zp=class extends k{constructor(e){super(e)}},Bh=class extends k{constructor(e){super(e)}},Dh=class extends k{constructor(e){super(e)}},Rh=class extends k{constructor(e){super(e)}},Mc=[0,pe,ye,-1,de],Ic=[0,pe,ye,ne];Rh.prototype.g=$n([0,pe,Tc,[0,pe],kc,Ac,Mc,Ic]);var Oh=class extends k{constructor(e){super(e)}},Gp=pt(456383383,Oh);_e[456383383]=[0,pe,yh];var Ph=class extends k{constructor(e){super(e)}},Zp=pt(476348187,Ph);_e[476348187]=[0,pe,Pp];var $h=class extends k{constructor(e){super(e)}},Nh=class extends k{constructor(e){super(e)}},Hh=[0,Ue,-1],Wp=pt(458105876,class extends k{constructor(e){super(e)}g(){var e=this.u;const t=0|e[L],i=2&t;return e=function(r,n,o){var s=Nh;const a=2&n;let c=!1;if(o==null){if(a)return pd();o=[]}else if(o.constructor===bt){if((2&o.M)==0||a)return o;o=o.da()}else Array.isArray(o)?c=!!(2&(0|o[L])):o=[];if(a){if(!o.length)return pd();c||(c=!0,Fi(o))}else c&&(c=!1,o=bd(o));return c||(64&(0|o[L])?o[L]&=-33:32&n&&un(o,32)),ce(r,n,2,s=new bt(o,s,tp,void 0)),s}(e,t,Mt(e,t,2)),!i&&Nh&&(e.pa=!0),e}});_e[458105876]=[0,Hh,bp,[!0,Jt,[0,W,-1,Se]]];var Fc=class extends k{constructor(e){super(e)}},Uh=pt(458105758,Fc);_e[458105758]=[0,pe,W,Hh];var qh=class extends k{constructor(e){super(e)}},Xp=pt(443442058,qh);_e[443442058]=[0,pe,W,de,ye,Se,-1,ne,ye],_e[514774813]=Mc;var Vh=class extends k{constructor(e){super(e)}},Kp=pt(516587230,Vh);function Bc(e,t){return t=t?t.clone():new xc,e.displayNamesLocale!==void 0?Q(t,1,Ri(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Q(t,1),e.maxResults!==void 0?yt(t,2,e.maxResults):"maxResults"in e&&Q(t,2),e.scoreThreshold!==void 0?A(t,3,e.scoreThreshold):"scoreThreshold"in e&&Q(t,3),e.categoryAllowlist!==void 0?xn(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Q(t,4),e.categoryDenylist!==void 0?xn(t,5,e.categoryDenylist):"categoryDenylist"in e&&Q(t,5),t}function Dc(e,t=-1,i=""){return{categories:e.map(r=>{var n,o,s,a,c,l,d;return{index:(o=(n=et(r,1))!=null?n:0)!=null?o:-1,score:(s=fe(r,2))!=null?s:0,categoryName:(c=(a=tt(r,3))!=null?a:"")!=null?c:"",displayName:(d=(l=tt(r,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function jh(e){var s,a,c,l,d,u,h,f,p,m,v,g,b;var t=mi(e,3,Wt,pi()),i=mi(e,2,Di,pi()),r=mi(e,1,Oi,pi()),n=mi(e,9,Oi,pi());const o={categories:[],keypoints:[]};for(let _=0;_<t.length;_++)o.categories.push({score:t[_],index:(s=i[_])!=null?s:-1,categoryName:(a=r[_])!=null?a:"",displayName:(c=n[_])!=null?c:""});if((t=(l=V(e,Ec,4))==null?void 0:l.h())&&(o.boundingBox={originX:(d=et(t,1))!=null?d:0,originY:(u=et(t,2))!=null?u:0,width:(h=et(t,3))!=null?h:0,height:(f=et(t,4))!=null?f:0,angle:0}),(p=V(e,Ec,4))==null?void 0:p.g().length)for(const _ of V(e,Ec,4).g())o.keypoints.push({x:(m=wn(_,1))!=null?m:0,y:(v=wn(_,2))!=null?v:0,score:(g=wn(_,4))!=null?g:0,label:(b=tt(_,3))!=null?b:""});return o}function Vn(e){var i,r,n,o;const t=[];for(const s of Ft(e,mh,1))t.push({x:(i=fe(s,1))!=null?i:0,y:(r=fe(s,2))!=null?r:0,z:(n=fe(s,3))!=null?n:0,visibility:(o=fe(s,4))!=null?o:0});return t}function Or(e){var i,r,n,o;const t=[];for(const s of Ft(e,ph,1))t.push({x:(i=fe(s,1))!=null?i:0,y:(r=fe(s,2))!=null?r:0,z:(n=fe(s,3))!=null?n:0,visibility:(o=fe(s,4))!=null?o:0});return t}function zh(e){return Array.from(e,t=>t>127?t-256:t)}function Gh(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let i=0,r=0,n=0;for(let o=0;o<e.length;o++)i+=e[o]*t[o],r+=e[o]*e[o],n+=t[o]*t[o];if(r<=0||n<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(r*n)}let jn;_e[516587230]=[0,pe,Mc,Ic,ye],_e[518928384]=Ic;const Yp=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function Zh(){return S(this,null,function*(){if(jn===void 0)try{yield WebAssembly.instantiate(Yp),jn=!0}catch(e){jn=!1}return jn})}function Pr(i){return S(this,arguments,function*(e,t=xp``){const r=(yield Zh())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}})}var bi=class{};function Wh(){var e=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}function Xh(e){return S(this,null,function*(){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((i,r)=>{t.addEventListener("load",()=>{i()},!1),t.addEventListener("error",n=>{r(n)},!1),document.body.appendChild(t)})}importScripts(e.toString())})}function Kh(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function T(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Yh(e,t,i){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(i?e.i._bindTextureToStream(i):e.i._bindTextureToCanvas(),!(i=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[r,n]=Kh(t);return!e.l||r===e.i.canvas.width&&n===e.i.canvas.height||(e.i.canvas.width=r,e.i.canvas.height=n),[r,n]}function Jh(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(t.length);for(let n=0;n<t.length;n++)r[n]=e.i.stringToNewUTF8(t[n]);t=e.i._malloc(4*r.length),e.i.HEAPU32.set(r,t>>2),i(t);for(const n of r)e.i._free(n);e.i._free(t)}function _t(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function ti(e,t,i){let r=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(n,o,s)=>{o?(i(r,s),r=[]):r.push(n)}}bi.forVisionTasks=function(e){return Pr("vision",e)},bi.forTextTasks=function(e){return Pr("text",e)},bi.forGenAiExperimentalTasks=function(e){return Pr("genai_experimental",e)},bi.forGenAiTasks=function(e){return Pr("genai",e)},bi.forAudioTasks=function(e){return Pr("audio",e)},bi.isSimdSupported=function(){return Zh()};function Jp(e,t,i,r){return S(this,null,function*(){return e=yield((n,o,s,a,c)=>S(this,null,function*(){if(o&&(yield Xh(o)),!self.ModuleFactory||s&&(yield Xh(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((o=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new n(c,a)}))(e,i.wasmLoaderPath,i.assetLoaderPath,t,{locateFile:n=>n.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&n.endsWith(".data")?i.assetBinaryPath.toString():n}),yield e.o(r),e})}function Rc(e,t){const i=V(e.baseOptions,Un,1)||new Un;typeof t=="string"?(Q(i,2,Ri(t)),Q(i,1)):t instanceof Uint8Array&&(Q(i,1,Fa(t,!1)),Q(i,2)),I(e.baseOptions,0,1,i)}function Qh(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(i=>i.message).join(", "))}finally{e.G=[]}}function w(e,t){e.B=Math.max(e.B,t)}function zn(e,t){e.A=new Fe,Ve(e.A,"PassThroughCalculator"),ee(e.A,"free_memory"),q(e.A,"free_memory_unused_out"),ie(t,"free_memory"),je(t,e.A)}function Xi(e,t){ee(e.A,t),q(e.A,t+"_unused_out")}function Gn(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Oc=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var i,r,n,o,s,a;if(t){const c=e.baseOptions||{};if((i=e.baseOptions)!=null&&i.modelAssetBuffer&&((r=e.baseOptions)!=null&&r.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((n=V(this.baseOptions,Un,1))!=null&&n.g()||(o=V(this.baseOptions,Un,1))!=null&&o.h()||(s=e.baseOptions)!=null&&s.modelAssetBuffer||(a=e.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(l,d){let u=V(l.baseOptions,wh,3);if(!u){var h=u=new wh,f=new nh;Mr(h,4,Hn,f)}"delegate"in d&&(d.delegate==="GPU"?(d=u,h=new kp,Mr(d,2,Hn,h)):(d=u,h=new nh,Mr(d,4,Hn,h))),I(l.baseOptions,0,3,u)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(l=>{if(l.ok)return l.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${l.status})`)}).then(l=>{try{this.g.i.FS_unlink("/model.dat")}catch(d){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(l),!0,!1,!1),Rc(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Rc(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return S(this,null,function*(){const d=[];for(var u=0;;){const{done:h,value:f}=yield l.read();if(h)break;d.push(f),u+=f.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];l=new Uint8Array(u),u=0;for(const h of d)l.set(h,u),u+=h.length;return l})}(c.modelAssetBuffer).then(l=>{Rc(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Ap(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((i,r)=>{this.G.push(Error(r))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Qh(this)}finishProcessing(){this.g.finishProcessing(),Qh(this)}close(){this.A=void 0,this.g.closeGraph()}};function Be(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Oc.prototype.close=Oc.prototype.close;class Qp{constructor(t,i,r,n){this.g=t,this.h=i,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function e0(e,t,i){const r=e.g;if(i=Be(r.createShader(i),"Failed to create WebGL shader"),r.shaderSource(i,t),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(i)}`);return r.attachShader(e.h,i),i}function t0(e,t){const i=e.g,r=Be(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(r);const n=Be(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,n),i.enableVertexAttribArray(e.P),i.vertexAttribPointer(e.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const o=Be(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,o),i.enableVertexAttribArray(e.J),i.vertexAttribPointer(e.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new Qp(i,r,n,o)}function Pc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function $r(e,t,i,r){return Pc(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=t0(e,!0)),i=e.s):(e.v||(e.v=t0(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=r(),i.g.bindVertexArray(null),e}function ii(e,t,i){return Pc(e,t),e=Be(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i!=null?i:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i!=null?i:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Zn(e,t,i){Pc(e,t),e.A||(e.A=Be(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}function $c(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ki=class{G(){return`
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=Be(e.createProgram(),"Failed to create WebGL program"),this.Z=Jh(this,`
3110
+ `}m(){const e=this.g;if(this.h=Be(e.createProgram(),"Failed to create WebGL program"),this.Z=e0(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=Jh(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},e5=class extends Ki{G(){return`
3117
+ }`,e.VERTEX_SHADER),this.Y=e0(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},e5=class extends Ki{G(){return`
3118
3118
  precision mediump float;
3119
3119
  uniform sampler2D backgroundTexture;
3120
3120
  uniform sampler2D maskTexture;
@@ -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 $c(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=Nc(e);if(Zn(i,r,e0(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 e0(e){let t=Ot(e,2);if(!t){const i=Yi(e);t=i0(e);const r=$c(e),n=t0(e);i.texImage2D(i.TEXTURE_2D,0,n,e.width,e.height,0,i.RED,i.FLOAT,r),Hc(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 t0(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 Nc(e){return e.l||(e.l=new Ki),e.l}function i0(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(Nc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Hc(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&&--r0===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=$c(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return $c(this)}N(){return e0(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=Nc(this);r.activeTexture(r.TEXTURE1),i=ii(n,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,i);const o=t0(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,()=>{i0(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Hc(this)}),Pc(n),Hc(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)),r0=-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 r0=250;const i5={color:"white",lineWidth:4,radius:6};function Uc(e){return Re(nr(Re({},i5),{fillColor:(e=e||{}).color}),e)}function Pt(e,t){return e instanceof Function?e(t):e}function n0(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 o0(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 s0(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[w,E]=m.value;if(m=E,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 a0(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=Uc(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=Uc(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=Uc(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);o0(r,n,c=>{s0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):s0(this,e.N(),i,t)}ua(e,t,i){this.l?function(r,n,o,s){const a=Hr(r);o0(r,n,c=>{a0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):a0(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 c0(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),Pc(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)||c0(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 l0(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 n0(r*(1-(e-t)/(i-t))+n*(1-(i-e)/(i-t)),r,n)},De.clamp=n0;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)&&--u0===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 c0(this)}za(){var e=wt(this,1);return e||(Xn(this),Yn(this),e=l0(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)}),Pc(n),Ur(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Xn(this),Yn(this),i=l0(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)),u0=-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 u0=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()}}}((d0=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:Gh()?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]=Xh(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=>{Kh(this,Object.keys(e),n=>{Kh(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 d0{get ea(){return this.i}oa(e,t,i){T(this,t,r=>{const[n,o]=Xh(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 d0,tt=class extends r5{};function H(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:Gh()?void 0:document.createElement("canvas"),t,i)})}function h0(e,t,i,r){if(e.U){const o=new ph;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]=Wh(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 it(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'.");h0(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'.");h0(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 Rc{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 rt=class extends $e{constructor(e,t){super(new tt(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:[]},it(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"),j(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=dh(o),this.j.detections.push(qh(r));C(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};rt.prototype.detectForVideo=rt.prototype.F,rt.prototype.detect=rt.prototype.D,rt.prototype.setOptions=rt.prototype.o,rt.createFromModelPath=function(e,t){return S(this,null,function*(){return H(rt,e,{baseOptions:{modelAssetPath:t}})})},rt.createFromModelBuffer=function(e,t){return H(rt,e,{baseOptions:{modelAssetBuffer:t}})},rt.createFromOptions=function(e,t){return H(rt,e,t)};var qc=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]),Vc=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]),jc=mt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),f0=mt([474,475],[475,476],[476,477],[477,474]),zc=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]),Gc=mt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),p0=mt([469,470],[470,471],[471,472],[472,469]),Zc=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]),m0=[...qc,...Vc,...jc,...zc,...Gc,...Zc],g0=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 v0(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var re=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,I(e=this.h=new Ch,0,1,t=new oe),this.v=new wh,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 v0(this),it(this,e,t),this.j}F(e,t,i){return v0(this),Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),j(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));C(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{C(this,r)}),this.outputFaceBlendshapes&&(j(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(Bc((o=r.g())!=null?o:[]));C(this,n)}),this.g.attachEmptyPacketListener("blendshapes",r=>{C(this,r)})),this.outputFacialTransformationMatrixes&&(j(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=Qe(r,1))!=null?o:0)!=null?s:0,columns:(c=(a=Qe(r,2))!=null?a:0)!=null?c:0,data:(l=pi(r,3,Wt,fi()).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 H(re,e,{baseOptions:{modelAssetPath:t}})},re.createFromModelBuffer=function(e,t){return H(re,e,{baseOptions:{modelAssetBuffer:t}})},re.createFromOptions=function(e,t){return H(re,e,t)},re.FACE_LANDMARKS_LIPS=qc,re.FACE_LANDMARKS_LEFT_EYE=Vc,re.FACE_LANDMARKS_LEFT_EYEBROW=jc,re.FACE_LANDMARKS_LEFT_IRIS=f0,re.FACE_LANDMARKS_RIGHT_EYE=zc,re.FACE_LANDMARKS_RIGHT_EYEBROW=Gc,re.FACE_LANDMARKS_RIGHT_IRIS=p0,re.FACE_LANDMARKS_FACE_OVAL=Zc,re.FACE_LANDMARKS_CONTOURS=m0,re.FACE_LANDMARKS_TESSELATION=g0;var Et=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!0),I(e=this.j=new xh,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,it(this,e,r!=null?r:{}),!this.h)return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),j(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),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)}};Et.prototype.stylize=Et.prototype.Ka,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(e,t){return H(Et,e,{baseOptions:{modelAssetPath:t}})},Et.createFromModelBuffer=function(e,t){return H(Et,e,{baseOptions:{modelAssetBuffer:t}})},Et.createFromOptions=function(e,t){return H(Et,e,t)};var Wc=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 b0(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function y0(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 _0(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&&Qe(u,1)!=null?(n=Qe(u,1))!=null?n:0:-1,e.push({score:(o=fe(u,2))!=null?o:0,index:r,categoryName:(a=(s=et(u,3))!=null?s:"")!=null?a:"",displayName:(l=(c=et(u,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var ze=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.j=new Sh,0,1,t=new oe),this.s=new Sc,I(this.j,0,2,this.s),this.C=new kc,I(this.s,0,3,this.C),this.v=new kh,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=Fc(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=Fc(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 b0(this),it(this,e,t),y0(this)}Ga(e,t,i){return b0(this),Ct(this,e,i,t),y0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),j(e,"hand_gestures"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(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,fh,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=Zi(l);const d=[];for(const u of Ft(r,hh,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(..._0(r,!1)),C(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",r=>{C(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{this.handedness.push(..._0(r)),C(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function w0(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 H(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return H(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return H(ze,e,t)},ze.HAND_CONNECTIONS=Wc;var Ge=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.h=new Sc,0,1,t=new oe),this.s=new kc,I(this.h,0,3,this.s),this.j=new kh,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=[],it(this,e,t),w0(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ct(this,e,i,t),w0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),j(e,"hand_landmarks"),j(e,"world_hand_landmarks"),j(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));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=Zi(o),this.worldLandmarks.push(Or(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=Qe(g,1))!=null?l:0)!=null?d:-1,categoryName:(h=(u=et(g,3))!=null?u:"")!=null?h:"",displayName:(p=(f=et(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)}};Ge.prototype.detectForVideo=Ge.prototype.F,Ge.prototype.detect=Ge.prototype.D,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return H(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return H(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return H(Ge,e,t)},Ge.HAND_CONNECTIONS=Wc;var C0=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 E0(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function x0(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 tt(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 Bh,0,1,t=new oe),this.K=new kc,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 wh,I(this.j,0,5,this.H),this.v=new Ih,I(this.j,0,6,this.v),this.L=new Fh,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,E0(this),it(this,e,r),x0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:r,E0(this),Ct(this,e,n,t),x0(this)}m(){var e=new Pe;ie(e,"input_frames_image"),j(e,"pose_landmarks"),j(e,"pose_world_landmarks"),j(e,"face_landmarks"),j(e,"left_hand_landmarks"),j(e,"left_hand_world_landmarks"),j(e,"right_hand_landmarks"),j(e,"right_hand_world_landmarks");const t=new qe,i=new Xd;Wa(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,ja,void 0,void 0,!1));else{if(!(typeof o=="string"||o instanceof Tt||ui(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Wa(n,2,Ia(o,!1),di())}}(i,this.j.g());const r=new Fe;Ve(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),En(r,8,Xd,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),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=Zi(n),s.push(Or(n)),C(this,o)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{C(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)],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&&(j(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(Bc((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=Zi(n),s.push(Or(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=Zi(n),s.push(Or(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 H(se,e,{baseOptions:{modelAssetPath:t}})},se.createFromModelBuffer=function(e,t){return H(se,e,{baseOptions:{modelAssetBuffer:t}})},se.createFromOptions=function(e,t){return H(se,e,t)},se.HAND_CONNECTIONS=Wc,se.POSE_CONNECTIONS=C0,se.FACE_LANDMARKS_LIPS=qc,se.FACE_LANDMARKS_LEFT_EYE=Vc,se.FACE_LANDMARKS_LEFT_EYEBROW=jc,se.FACE_LANDMARKS_LEFT_IRIS=f0,se.FACE_LANDMARKS_RIGHT_EYE=zc,se.FACE_LANDMARKS_RIGHT_EYEBROW=Gc,se.FACE_LANDMARKS_RIGHT_IRIS=p0,se.FACE_LANDMARKS_FACE_OVAL=Zc,se.FACE_LANDMARKS_CONTOURS=m0,se.FACE_LANDMARKS_TESSELATION=g0;var nt=class extends $e{constructor(e,t){super(new tt(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},I(e=this.h=new Dh,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,Fc(e,V(this.h,Ec,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},it(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"),j(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 Bc((d=(l=V(c,lh,4))==null?void 0:l.g())!=null?d:[],(u=Qe(c,2))!=null?u:0,(h=et(c,3))!=null?h:"")})};return Na(Pi(o,2))!=null&&(s.timestampMs=(a=Na(Pi(o,2)))!=null?a:0),s}(Bp(r)),C(this,n)}),this.g.attachEmptyPacketListener("classifications",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};nt.prototype.classifyForVideo=nt.prototype.ra,nt.prototype.classify=nt.prototype.qa,nt.prototype.setOptions=nt.prototype.o,nt.createFromModelPath=function(e,t){return H(nt,e,{baseOptions:{modelAssetPath:t}})},nt.createFromModelBuffer=function(e,t){return H(nt,e,{baseOptions:{modelAssetBuffer:t}})},nt.createFromOptions=function(e,t){return H(nt,e,t)};var Ze=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!0),this.h=new Rh,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,bh,2);return i=i?i.clone():new bh,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 it(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"),j(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=Qe(a,3))!=null?l:0)!=null?d:-1,headName:(h=(u=et(a,4))!=null?u:"")!=null?h:""};if(bd(a,mh,Xa(a,1))!==void 0)a=pi(a=V(a,mh,Xa(a,1)),1,Wt,fi()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(p=(f=V(a,Dp,Xa(a,2)))==null?void 0:f.ma())==null?void 0:p.h())!=null?m:v}return c}),timestampMs:(s=Na(Pi(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)}};Ze.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=jh(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=jh(Vh(e.quantizedEmbedding),Vh(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 H(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return H(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return H(Ze,e,t)};var Xc=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 A0(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function k0(e){try{const t=new Xc(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gn(e)}}Xc.prototype.close=Xc.prototype.close;var Ne=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ic,this.v=new Oh,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=et(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=et(o,1))!=null?a:""})})(this)}segment(e,t,i){const r=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,A0(this),it(this,e,r),k0(this)}Ia(e,t,i,r){const n=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:r,A0(this),Ct(this,e,n,t),k0(this)}Ba(){return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect");const t=new qe;ht(t,Nh,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&&(j(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)),C(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],C(this,r)})),this.outputCategoryMask&&(j(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),C(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,C(this,r)})),j(e,"quality_scores"),q(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)}};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 H(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return H(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return H(Ne,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()}};Kc.prototype.close=Kc.prototype.close;var n5=class extends x{constructor(e){super(e)}},er=[0,de,-2],Qn=[0,Rt,-3,ne,Rt,-1],S0=[0,Qn],L0=[0,Qn,de,-1],Yc=class extends x{constructor(e){super(e)}},T0=[0,Rt,-1,ne],o5=class extends x{constructor(e){super(e)}},M0=class extends x{constructor(e){super(e)}},Jc=[1,2,3,4,5,6,7,8,9,10,14,15],I0=class extends x{constructor(e){super(e)}};I0.prototype.g=$n([0,we,[0,Jc,W,Qn,W,[0,Qn,er],W,S0,W,[0,S0,er],W,T0,W,[0,Rt,-3,ne,Ue],W,[0,Rt,-3,ne],W,[0,Z,Rt,-2,ne,de,ne,-1,2,Rt,er],W,L0,W,[0,L0,er],Rt,er,Z,W,[0,Rt,-3,ne,er,-1],W,[0,we,T0]],Z,[0,Z,de,-1,ne]]);var xt=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ic,this.s=new Oh,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 I0;const o=new M0;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 Yc;Ir(a,3,!0),A(a,1,t.keypoint.x),A(a,2,t.keypoint.y),Mr(o,5,Jc,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 Yc,3,!0),A(t,1,a.x),A(t,2,a.y),En(s,1,Yc,t);Mr(o,15,Jc,s)}En(r,1,M0,o),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",i),it(this,e,n);e:{try{const l=new Kc(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,Nh,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&&(j(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)),C(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],C(this,r)})),this.outputCategoryMask&&(j(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),C(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,C(this,r)})),j(e,"quality_scores"),q(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)}};xt.prototype.segment=xt.prototype.segment,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=function(e,t){return H(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return H(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return H(xt,e,t)};var ot=class extends $e{constructor(e,t){super(new tt(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},I(e=this.h=new Hh,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:[]},it(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"),j(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=dh(o),this.j.detections.push(qh(r));C(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{C(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ot.prototype.detectForVideo=ot.prototype.F,ot.prototype.detect=ot.prototype.D,ot.prototype.setOptions=ot.prototype.o,ot.createFromModelPath=function(e,t){return S(this,null,function*(){return H(ot,e,{baseOptions:{modelAssetPath:t}})})},ot.createFromModelBuffer=function(e,t){return H(ot,e,{baseOptions:{modelAssetBuffer:t}})},ot.createFromOptions=function(e,t){return H(ot,e,t)};var Qc=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 F0(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function B0(e){try{const t=new Qc(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gn(e)}}Qc.prototype.close=Qc.prototype.close;var We=class extends $e{constructor(e,t){super(new tt(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,I(e=this.h=new Uh,0,1,t=new oe),this.v=new Fh,I(this.h,0,3,this.v),this.j=new Ih,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,F0(this),it(this,e,r),B0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:r,F0(this),Ct(this,e,n,t),B0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),j(e,"normalized_landmarks"),j(e,"world_landmarks"),j(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));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=Zi(o),this.worldLandmarks.push(Or(r));C(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",r=>{this.worldLandmarks=[],C(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)),C(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",r=>{this.segmentationMasks=[],C(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 H(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return H(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return H(We,e,t)},We.POSE_CONNECTIONS=C0;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(K=>{r=Math.min(r,K.x),n=Math.max(n,K.x),o=Math.min(o,K.y),s=Math.max(s,K.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=((K,N)=>{const ae=(K-a)/m,me=(N-c)/v;return ae*ae+me*me<=1})(h,f),w=.2,E=.1,B=d*(1+w),_=u*(1+E),M=(K,N)=>{const ae=(K-a)/B,me=(N-c)/_;return ae*ae+me*me<=1},k=M(r,o),O=M(n,o),U=M(r,s),F=M(n,s);return b&&k&&O&&U&&F},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},D0=(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})})},R0=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)},O0={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)},P0=()=>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 vi.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=ke(null),u=ke(null),h=ke(null),f=ke(null),p=le(!1),m=le(!1),v=le("good"),g=le(!1),b=le(16/9),w=le([]),E=le(0),B=le(0),_=le(0),M=le(0),k=le(""),O=le(!0),U=le(!1),F=le(!1),K=le(0),N=le([]),ae=le(null),me=le(1),Le=le(0),q0=le(!1),tr=da(()=>Math.floor(me.value*.4)),V0=da(()=>Math.floor(me.value*.2)),R5=da(()=>p.value&&m.value&&v.value==="good"&&!g.value),rl=X=>{var ge;X&&eo[X]?k.value=(ge=eo[X])==null?void 0:ge.call(eo):k.value=""},Xe=ke(L2(X=>{rl(X)},600)).current,O5=()=>S(this,null,function*(){var X,ge;try{((X=window.__smileIdentityMediapipe)==null?void 0:X.loaded)&&((ge=window.__smileIdentityMediapipe)==null?void 0:ge.instance)||(O.value=!0,rl("initializing")),d.current=yield P0(),O.value=!1}catch(kt){console.error("Failed to initialize MediaPipe:",kt),O.value=!1}}),P5=()=>{if(e.current&&t.current){const{videoWidth:X,videoHeight:ge}=e.current;b.value=X/ge,t.current.width=X,t.current.height=ge,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},$5=()=>{const X=Le.value<V0.value,ge=Le.value>=tr.value;X?k.value=y("selfie.smart.status.capturing"):ge?Date.now()-M.value>c?E.value>=n&&_.value<o?Xe("open-mouth-smile"):Xe("smile-required"):k.value=y("selfie.smart.status.keepSmiling"):Xe(null)},N5=()=>{O.value?rl("initializing"):g.value?Xe("multiple-faces"):p.value?v.value==="too-close"?Xe("too-close"):v.value==="too-far"?Xe("too-far"):m.value?U.value?$5():k.value=y("selfie.smart.status.readyToCapture"):Xe("out-of-bounds"):Xe("no-face")},nl=()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)},ol=()=>S(this,null,function*(){var X,ge;if(!d.current||!e.current){nl();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){u.current=requestAnimationFrame(ol);return}try{O.value&&(O.value=!1);const kt=l5(e.current),sl=kt||e.current,Ke=d.current.detectForVideo(sl,performance.now());if(w.value=Ke.faceLandmarks||[],Ke.faceLandmarks&&t.current&&e.current)if(kt){const ri=e.current.videoWidth,bi=e.current.videoHeight,ir=Math.min(ri,bi),al=(ri-ir)/(2*ri),ro=(bi-ir)/(2*bi),no=ir/ri,rr=ir/bi,q5=Ke.faceLandmarks.map(V5=>V5.map(cl=>({x:cl.x*no+al,y:cl.y*rr+ro,z:cl.z})));D0(t.current,q5,Le.value,tr.value)}else D0(t.current,Ke.faceLandmarks,Le.value,tr.value);else t.current&&R0(t.current);const G0=Ke.faceLandmarks?Ke.faceLandmarks.length:0;g.value=G0>1;const Z0=Ke.faceBlendshapes&&Ke.faceBlendshapes.length>0&&G0===1;if(p.value=Z0,Z0&&Ke.faceLandmarks){const ri=s5(Ke.faceLandmarks);B.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 bi=Ke.faceBlendshapes[0].categories,ir=((X=bi.find(rr=>rr.categoryName==="mouthSmileLeft"))==null?void 0:X.score)||0,al=((ge=bi.find(rr=>rr.categoryName==="mouthSmileRight"))==null?void 0:ge.score)||0,ro=c5(Ke.faceLandmarks),no=(ir+al)/2;E.value=no,_.value=ro,no>=n&&ro>=o&&(M.value=Date.now(),F.value&&U.value&&f.current&&setTimeout(()=>{Date.now()-M.value<=100&&F.value&&U.value&&f.current&&f.current()},0))}else E.value=0,B.value=0,_.value=0,m.value=!1,v.value="good";N5()}catch(kt){p.value=!1,m.value=!1,g.value=!1,v.value="good",_.value=0,U.value&&Xe("no-face")}u.current=requestAnimationFrame(ol)}),H5=()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(ol)},U5=()=>{if(!e.current)return;const X=Le.value===me.value-1,ge=u5(e.current,X);ge&&(X?ae.value=ge:N.value=[...N.value,ge],Le.value++,K.value=me.value-Le.value)},io=()=>{if(h.current&&(clearInterval(h.current),h.current=null),U.value=!1,F.value=!1,Le.value>=me.value&&ae.value){const X=N.value.map(sl=>({image:sl.split(",")[1],image_type_id:O0.LIVENESS_IMAGE_BASE64})),ge={image:ae.value.split(",")[1],image_type_id:O0.SELFIE_IMAGE_BASE64},kt={images:[...X,ge],referenceImage:ae.value,previewImage:ae.value,facingMode:l(),meta:{libraryVersion:qr}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:kt})),q0.value=!0}},Vr=()=>{h.current&&(clearInterval(h.current),h.current=null),F.value=!0,!g.value&&p.value&&m.value&&v.value==="good"&&Xe("smile-required")},j0=()=>{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()-M.value>c){Vr();return}U5()},i)},z0=()=>{if(p.value&&v.value==="good"&&m.value&&!g.value){if(Le.value>=tr.value&&Date.now()-M.value>c)return;F.value=!1,Xe(null),j0()}};return f.current=z0,{faceDetected:p,faceInBounds:m,faceProximity:v,multipleFaces:g,videoAspectRatio:b,faceLandmarks:w,currentSmileScore:E,currentFaceSize:B,currentMouthOpen:_,lastSmileTime:M,alertTitle:k,isInitializing:O,isReadyToCapture:R5,isCapturing:U,isPaused:F,countdown:K,capturedImages:N,referencePhoto:ae,totalCaptures:me,capturesTaken:Le,hasFinishedCapture:q0,smileCheckpoint:tr,neutralZone:V0,initializeFaceLandmarker:O5,setupCanvas:P5,startDetectionLoop:H5,stopDetectionLoop:nl,updateAlert:Xe,startCapture:()=>S(this,null,function*(){N.value=[],U.value=!0,F.value=!1,me.value=Math.ceil(r/i),Le.value=0,K.value=me.value;const X=document.querySelector("smart-camera-web");X==null||X.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),X==null||X.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[l()]}})),j0()}),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),nl(),Xe.cancel()},resetFaceDetectionState:()=>{p.value=!1,m.value=!1,v.value="good",g.value=!1,w.value=[],E.value=0,B.value=0,_.value=0,M.value=0,t.current&&R0(t.current)}}},m5=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const r=ke(null),n=ke(e);return dt(()=>{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]),$("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:$("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[$("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:$("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"})}),$("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"}}),$("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})=>$(qt,{children:[$("div",{className:"camera-preview-container",children:[$("div",{className:"video-wrapper",style:{clipPath:r?"none":"url(#selfie-clip-path)"},children:$("div",{className:"video-container",children:[$("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),$("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!r&&$(m5,{progress:n,duration:o,themeColor:s})]}),$("style",{children:`
3143
+ `}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.j=ii(this,e),e.activeTexture(e.TEXTURE2),this.B=ii(this,e)}m(){super.m();const e=this.g;this.K=Be(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Be(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Be(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.K,1),e.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Ot(e,t){switch(t){case 0:return e.g.find(i=>i instanceof Uint8Array);case 1:return e.g.find(i=>i instanceof Float32Array);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Nc(e){var t=Ot(e,1);if(!t){if(t=Ot(e,0))t=new Float32Array(t).map(r=>r/255);else{t=new Float32Array(e.width*e.height);const r=Yi(e);var i=Hc(e);if(Zn(i,r,i0(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(e.width*e.height*4),r.readPixels(0,0,e.width,e.height,r.RGBA,r.FLOAT,i);for(let n=0,o=0;n<t.length;++n,o+=4)t[n]=i[o]}else r.readPixels(0,0,e.width,e.height,r.RED,r.FLOAT,t)}e.g.push(t)}return t}function i0(e){let t=Ot(e,2);if(!t){const i=Yi(e);t=n0(e);const r=Nc(e),n=r0(e);i.texImage2D(i.TEXTURE_2D,0,n,e.width,e.height,0,i.RED,i.FLOAT,r),Uc(e)}return t}function Yi(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function r0(e){if(e=Yi(e),!Wn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Wn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Wn=e.R16F}return Wn}function Hc(e){return e.l||(e.l=new Ki),e.l}function n0(e){const t=Yi(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Ot(e,2);return i||(i=ii(Hc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Uc(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Wn,Ce=class{constructor(e,t,i,r,n,o,s){this.g=e,this.m=t,this.j=i,this.canvas=r,this.l=n,this.width=o,this.height=s,this.j&&--o0===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Ot(this,0)}ja(){return!!Ot(this,1)}R(){return!!Ot(this,2)}ia(){return(t=Ot(e=this,0))||(t=Nc(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return Nc(this)}N(){return i0(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof Uint8Array)i=new Uint8Array(t);else if(t instanceof Float32Array)i=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const r=Yi(this),n=Hc(this);r.activeTexture(r.TEXTURE1),i=ii(n,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,i);const o=r0(this);r.texImage2D(r.TEXTURE_2D,0,o,this.width,this.height,0,r.RED,r.FLOAT,null),r.bindTexture(r.TEXTURE_2D,null),Zn(n,r,i),$r(n,r,!1,()=>{n0(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Uc(this)}),$c(n),Uc(this)}}e.push(i)}return new Ce(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Yi(this).deleteTexture(Ot(this,2)),o0=-1}};Ce.prototype.close=Ce.prototype.close,Ce.prototype.clone=Ce.prototype.clone,Ce.prototype.getAsWebGLTexture=Ce.prototype.N,Ce.prototype.getAsFloat32Array=Ce.prototype.ha,Ce.prototype.getAsUint8Array=Ce.prototype.ia,Ce.prototype.hasWebGLTexture=Ce.prototype.R,Ce.prototype.hasFloat32Array=Ce.prototype.ja,Ce.prototype.hasUint8Array=Ce.prototype.Da;var o0=250;const i5={color:"white",lineWidth:4,radius:6};function qc(e){return Re(nr(Re({},i5),{fillColor:(e=e||{}).color}),e)}function Pt(e,t){return e instanceof Function?e(t):e}function s0(e,t,i){return Math.max(Math.min(t,i),Math.min(Math.max(t,i),e))}function Nr(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Hr(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function a0(e,t,i){var r;if(t.R())i(t.N());else{const n=t.ja()?t.ha():t.ia();e.m=(r=e.m)!=null?r:new Ki;const o=Hr(e);i((e=new Ce([n],t.m,!1,o.canvas,e.m,t.width,t.height)).N()),e.close()}}function c0(e,t,i,r){const n=function(a){return a.g||(a.g=new e5),a.g}(e),o=Hr(e),s=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;$r(n,o,!0,()=>{(function(c,l,d,u){const h=c.g;if(h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,l),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,c.B),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,d),c.H&&function(f,p){if(f!==p)return!1;f=f.entries(),p=p.entries();for(const[v,g]of f){f=v;const b=g;var m=p.next();if(m.done)return!1;const[_,M]=m.value;if(m=M,f!==_||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!p.next().done}(c.H,u))h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.j);else{c.H=u;const f=Array(1024).fill(0);u.forEach((p,m)=>{if(p.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);f[4*m]=p[0],f[4*m+1]=p[1],f[4*m+2]=p[2],f[4*m+3]=p[3]}),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.j),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,256,1,0,h.RGBA,h.UNSIGNED_BYTE,new Uint8Array(f))}})(n,t,s,r),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4);const a=n.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function l0(e,t,i,r){const n=Hr(e),o=function(c){return c.h||(c.h=new t5),c.h}(e),s=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;$r(o,n,!0,()=>{var c=o.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,o.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,o.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),n.bindTexture(n.TEXTURE_2D,null),(c=o.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var De=class{constructor(e,t){typeof CanvasRenderingContext2D!="undefined"&&e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}wa(e,t){if(e){var i=Nr(this);t=qc(t),i.save();var r=i.canvas,n=0;for(const o of e)i.fillStyle=Pt(t.fillColor,{index:n,from:o}),i.strokeStyle=Pt(t.color,{index:n,from:o}),i.lineWidth=Pt(t.lineWidth,{index:n,from:o}),(e=new Path2D).arc(o.x*r.width,o.y*r.height,Pt(t.radius,{index:n,from:o}),0,2*Math.PI),i.fill(e),i.stroke(e),++n;i.restore()}}va(e,t,i){if(e&&t){var r=Nr(this);i=qc(i),r.save();var n=r.canvas,o=0;for(const s of t){r.beginPath(),t=e[s.start];const a=e[s.end];t&&a&&(r.strokeStyle=Pt(i.color,{index:o,from:t,to:a}),r.lineWidth=Pt(i.lineWidth,{index:o,from:t,to:a}),r.moveTo(t.x*n.width,t.y*n.height),r.lineTo(a.x*n.width,a.y*n.height)),++o,r.stroke()}r.restore()}}sa(e,t){const i=Nr(this);t=qc(t),i.save(),i.beginPath(),i.lineWidth=Pt(t.lineWidth,{}),i.strokeStyle=Pt(t.color,{}),i.fillStyle=Pt(t.fillColor,{}),i.moveTo(e.originX,e.originY),i.lineTo(e.originX+e.width,e.originY),i.lineTo(e.originX+e.width,e.originY+e.height),i.lineTo(e.originX,e.originY+e.height),i.lineTo(e.originX,e.originY),i.stroke(),i.fill(),i.restore()}ta(e,t,i=[0,0,0,255]){this.l?function(r,n,o,s){const a=Hr(r);a0(r,n,c=>{c0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):c0(this,e.N(),i,t)}ua(e,t,i){this.l?function(r,n,o,s){const a=Hr(r);a0(r,n,c=>{l0(r,c,o,s),(c=Nr(r)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):l0(this,e.N(),t,i)}close(){var e,t,i;(e=this.g)==null||e.close(),this.g=void 0,(t=this.h)==null||t.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function wt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof ImageData);case 1:return e.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function u0(e){var t=wt(e,0);if(!t){t=Ji(e);const i=Kn(e),r=new Uint8Array(e.width*e.height*4);Zn(i,t,Xn(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),$c(i),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function Xn(e){let t=wt(e,2);if(!t){const i=Ji(e);t=Yn(e);const r=wt(e,1)||u0(e);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),Ur(e)}return t}function Ji(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Be(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Kn(e){return e.l||(e.l=new Ki),e.l}function Yn(e){const t=Ji(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=wt(e,2);return i||(i=ii(Kn(e),t),e.g.push(i),e.m=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Ur(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function d0(e){const t=Ji(e);return $r(Kn(e),t,!0,()=>function(i,r){const n=i.canvas;if(n.width===i.width&&n.height===i.height)return r();const o=n.width,s=n.height;return n.width=i.width,n.height=i.height,i=r(),n.width=o,n.height=s,i}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}De.prototype.close=De.prototype.close,De.prototype.drawConfidenceMask=De.prototype.ua,De.prototype.drawCategoryMask=De.prototype.ta,De.prototype.drawBoundingBox=De.prototype.sa,De.prototype.drawConnectors=De.prototype.va,De.prototype.drawLandmarks=De.prototype.wa,De.lerp=function(e,t,i,r,n){return s0(r*(1-(e-t)/(i-t))+n*(1-(i-e)/(i-t)),r,n)},De.clamp=s0;var xe=class{constructor(e,t,i,r,n,o,s){this.g=e,this.j=t,this.m=i,this.canvas=r,this.l=n,this.width=o,this.height=s,(this.j||this.m)&&--h0===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!wt(this,0)}ka(){return!!wt(this,1)}R(){return!!wt(this,2)}Aa(){return u0(this)}za(){var e=wt(this,1);return e||(Xn(this),Yn(this),e=d0(this),Ur(this),this.g.push(e),this.j=!0),e}N(){return Xn(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof ImageData)i=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const r=Ji(this),n=Kn(this);r.activeTexture(r.TEXTURE1),i=ii(n,r),r.bindTexture(r.TEXTURE_2D,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,this.width,this.height,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindTexture(r.TEXTURE_2D,null),Zn(n,r,i),$r(n,r,!1,()=>{Yn(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),Ur(this)}),$c(n),Ur(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Xn(this),Yn(this),i=d0(this),Ur(this)}e.push(i)}return new xe(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&wt(this,1).close(),this.m&&Ji(this).deleteTexture(wt(this,2)),h0=-1}};xe.prototype.close=xe.prototype.close,xe.prototype.clone=xe.prototype.clone,xe.prototype.getAsWebGLTexture=xe.prototype.N,xe.prototype.getAsImageBitmap=xe.prototype.za,xe.prototype.getAsImageData=xe.prototype.Aa,xe.prototype.hasWebGLTexture=xe.prototype.R,xe.prototype.hasImageBitmap=xe.prototype.ka,xe.prototype.hasImageData=xe.prototype.Ca;var h0=250;function mt(...e){return e.map(([t,i])=>({start:t,end:i}))}const r5=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((f0=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Wh()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}initializeGraph(e){return S(this,null,function*(){const t=yield(yield fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)})}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const i=e.length,r=this.i._malloc(i);this.i.HEAPU8.set(e,r),t?this.i._changeBinaryGraph(i,r):this.i._changeTextGraph(i,r),this.i._free(r)}configureAudio(e,t,i,r,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),T(this,r||"input_audio",o=>{T(this,n=n||"audio_header",s=>{this.i._configureAudio(o,s,e,t!=null?t:0,i)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){_t(this,"__graph_config__",t=>{e(t)}),T(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,i){this.addAudioToStreamWithShape(e,0,0,t,i)}addAudioToStreamWithShape(e,t,i,r,n){const o=4*e.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(e,this.g/4),T(this,r,s=>{this.i._addAudioToInputStream(this.g,t,i,s,n)})}addGpuBufferToStream(e,t,i){T(this,t,r=>{const[n,o]=Yh(this,e,r);this.i._addBoundTextureToStream(r,n,o,i)})}addBoolToStream(e,t,i){T(this,t,r=>{this.i._addBoolToInputStream(e,r,i)})}addDoubleToStream(e,t,i){T(this,t,r=>{this.i._addDoubleToInputStream(e,r,i)})}addFloatToStream(e,t,i){T(this,t,r=>{this.i._addFloatToInputStream(e,r,i)})}addIntToStream(e,t,i){T(this,t,r=>{this.i._addIntToInputStream(e,r,i)})}addUintToStream(e,t,i){T(this,t,r=>{this.i._addUintToInputStream(e,r,i)})}addStringToStream(e,t,i){T(this,t,r=>{T(this,e,n=>{this.i._addStringToInputStream(n,r,i)})})}addStringRecordToStream(e,t,i){T(this,t,r=>{Jh(this,Object.keys(e),n=>{Jh(this,Object.values(e),o=>{this.i._addFlatHashMapToInputStream(n,o,Object.keys(e).length,r,i)})})})}addProtoToStream(e,t,i,r){T(this,i,n=>{T(this,t,o=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,o,n,r),this.i._free(s)})})}addEmptyPacketToStream(e,t){T(this,e,i=>{this.i._addEmptyPacketToInputStream(i,t)})}addBoolVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const o of e)this.i._addBoolVectorEntry(n,o);this.i._addBoolVectorToInputStream(n,r,i)})}addDoubleVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const o of e)this.i._addDoubleVectorEntry(n,o);this.i._addDoubleVectorToInputStream(n,r,i)})}addFloatVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const o of e)this.i._addFloatVectorEntry(n,o);this.i._addFloatVectorToInputStream(n,r,i)})}addIntVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const o of e)this.i._addIntVectorEntry(n,o);this.i._addIntVectorToInputStream(n,r,i)})}addUintVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const o of e)this.i._addUintVectorEntry(n,o);this.i._addUintVectorToInputStream(n,r,i)})}addStringVectorToStream(e,t,i){T(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const o of e)T(this,o,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputStream(n,r,i)})}addBoolToInputSidePacket(e,t){T(this,t,i=>{this.i._addBoolToInputSidePacket(e,i)})}addDoubleToInputSidePacket(e,t){T(this,t,i=>{this.i._addDoubleToInputSidePacket(e,i)})}addFloatToInputSidePacket(e,t){T(this,t,i=>{this.i._addFloatToInputSidePacket(e,i)})}addIntToInputSidePacket(e,t){T(this,t,i=>{this.i._addIntToInputSidePacket(e,i)})}addUintToInputSidePacket(e,t){T(this,t,i=>{this.i._addUintToInputSidePacket(e,i)})}addStringToInputSidePacket(e,t){T(this,t,i=>{T(this,e,r=>{this.i._addStringToInputSidePacket(r,i)})})}addProtoToInputSidePacket(e,t,i){T(this,i,r=>{T(this,t,n=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputSidePacket(o,e.length,n,r),this.i._free(o)})})}addBoolVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const n of e)this.i._addBoolVectorEntry(r,n);this.i._addBoolVectorToInputSidePacket(r,i)})}addDoubleVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const n of e)this.i._addDoubleVectorEntry(r,n);this.i._addDoubleVectorToInputSidePacket(r,i)})}addFloatVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const n of e)this.i._addFloatVectorEntry(r,n);this.i._addFloatVectorToInputSidePacket(r,i)})}addIntVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const n of e)this.i._addIntVectorEntry(r,n);this.i._addIntVectorToInputSidePacket(r,i)})}addUintVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of e)this.i._addUintVectorEntry(r,n);this.i._addUintVectorToInputSidePacket(r,i)})}addStringVectorToInputSidePacket(e,t){T(this,t,i=>{const r=this.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const n of e)T(this,n,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputSidePacket(r,i)})}attachBoolListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(e,t){_t(this,e,t),T(this,e,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(e,t){ti(this,e,t),T(this,e,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(e,t,i){_t(this,e,t),T(this,e,r=>{this.i._attachProtoListener(r,i||!1)})}attachProtoVectorListener(e,t,i){ti(this,e,t),T(this,e,r=>{this.i._attachProtoVectorListener(r,i||!1)})}attachAudioListener(e,t,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),_t(this,e,(r,n)=>{r=new Float32Array(r.buffer,r.byteOffset,r.length/4),t(r,n)}),T(this,e,r=>{this.i._attachAudioListener(r,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends f0{get ea(){return this.i}oa(e,t,i){T(this,t,r=>{const[n,o]=Yh(this,e,r);this.ea._addBoundTextureAsImageToStream(r,n,o,i)})}V(e,t){_t(this,e,t),T(this,e,i=>{this.ea._attachImageListener(i)})}ba(e,t){ti(this,e,t),T(this,e,i=>{this.ea._attachImageVectorListener(i)})}}));var f0,it=class extends r5{};function U(e,t,i){return S(this,null,function*(){var r;return function(n,o,s,a){return S(this,null,function*(){return Jp(n,o,s,a)})}(e,(r=i.canvas)!=null?r:Wh()?void 0:document.createElement("canvas"),t,i)})}function p0(e,t,i,r){if(e.U){const o=new gh;if(i!=null&&i.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var n=i.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(n.left<0||n.top<0||n.right>1||n.bottom>1)throw Error("Expected RectF values to be in [0,1].");A(o,1,(n.left+n.right)/2),A(o,2,(n.top+n.bottom)/2),A(o,4,n.right-n.left),A(o,3,n.bottom-n.top)}else A(o,1,.5),A(o,2,.5),A(o,4,1),A(o,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(A(o,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[s,a]=Kh(t);i=fe(o,3)*a/s,n=fe(o,4)*s/a,A(o,4,i),A(o,3,n)}}e.g.addProtoToStream(o.g(),"mediapipe.NormalizedRect",e.U,r)}e.g.oa(t,e.Z,r!=null?r:performance.now()),e.finishProcessing()}function rt(e,t,i){var r;if((r=e.baseOptions)!=null&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");p0(e,t,i,e.B+1)}function Ct(e,t,i,r){var n;if(!((n=e.baseOptions)!=null&&n.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");p0(e,t,i,r)}function Qi(e,t,i,r){var n=t.data;const o=t.width,s=o*(t=t.height);if((n instanceof Uint8Array||n instanceof Float32Array)&&n.length!==s)throw Error("Unsupported channel count: "+n.length/s);return e=new Ce([n],i,!1,e.g.i.canvas,e.P,o,t),r?e.clone():e}var $e=class extends Oc{constructor(e,t,i,r){super(e),this.g=e,this.Z=t,this.U=i,this.na=r,this.P=new Ki}l(e,t=!0){if("runningMode"in e&&Ir(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};$e.prototype.close=$e.prototype.close;var nt=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},I(e=this.h=new qn,0,1,t=new oe),A(this.h,2,.5),A(this.h,3,.3)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return"minDetectionConfidence"in e&&A(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&A(this.h,3,(i=e.minSuppressionThreshold)!=null?i:.3),this.l(e)}D(e,t){return this.j={detections:[]},rt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect_in"),z(e,"detections");const t=new qe;ht(t,$p,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect_in"),q(i,"DETECTIONS:detections"),i.o(t),je(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=fh(o),this.j.detections.push(jh(r));w(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};nt.prototype.detectForVideo=nt.prototype.F,nt.prototype.detect=nt.prototype.D,nt.prototype.setOptions=nt.prototype.o,nt.createFromModelPath=function(e,t){return S(this,null,function*(){return U(nt,e,{baseOptions:{modelAssetPath:t}})})},nt.createFromModelBuffer=function(e,t){return U(nt,e,{baseOptions:{modelAssetBuffer:t}})},nt.createFromOptions=function(e,t){return U(nt,e,t)};var Vc=mt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),jc=mt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),zc=mt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),m0=mt([474,475],[475,476],[476,477],[477,474]),Gc=mt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Zc=mt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),g0=mt([469,470],[470,471],[471,472],[472,469]),Wc=mt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),v0=[...Vc,...jc,...zc,...Gc,...Zc,...Wc],b0=mt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function y0(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var re=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,I(e=this.h=new xh,0,1,t=new oe),this.v=new Eh,I(this.h,0,3,this.v),this.s=new qn,I(this.h,0,2,this.s),yt(this.s,4,1),A(this.s,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n;return"numFaces"in e&&yt(this.s,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&A(this.s,2,(i=e.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minFacePresenceConfidence"in e&&A(this.v,2,(n=e.minFacePresenceConfidence)!=null?n:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return y0(this),rt(this,e,t),this.j}F(e,t,i){return y0(this),Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"face_landmarks");const t=new qe;ht(t,Hp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"NORM_LANDMARKS:face_landmarks"),i.o(t),je(e,i),this.g.attachProtoVectorListener("face_landmarks",(r,n)=>{for(const o of r)r=Rr(o),this.j.faceLandmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{w(this,r)}),this.outputFaceBlendshapes&&(z(e,"blendshapes"),q(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(r,n)=>{var o;if(this.outputFaceBlendshapes)for(const s of r)r=Nn(s),this.j.faceBlendshapes.push(Dc((o=r.g())!=null?o:[]));w(this,n)}),this.g.attachEmptyPacketListener("blendshapes",r=>{w(this,r)})),this.outputFacialTransformationMatrixes&&(z(e,"face_geometry"),q(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(r,n)=>{var o,s,a,c,l;if(this.outputFacialTransformationMatrixes)for(const d of r)(r=V(Np(d),Mp,2))&&this.j.facialTransformationMatrixes.push({rows:(s=(o=et(r,1))!=null?o:0)!=null?s:0,columns:(c=(a=et(r,2))!=null?a:0)!=null?c:0,data:(l=mi(r,3,Wt,pi()).slice())!=null?l:[]});w(this,n)}),this.g.attachEmptyPacketListener("face_geometry",r=>{w(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};re.prototype.detectForVideo=re.prototype.F,re.prototype.detect=re.prototype.D,re.prototype.setOptions=re.prototype.o,re.createFromModelPath=function(e,t){return U(re,e,{baseOptions:{modelAssetPath:t}})},re.createFromModelBuffer=function(e,t){return U(re,e,{baseOptions:{modelAssetBuffer:t}})},re.createFromOptions=function(e,t){return U(re,e,t)},re.FACE_LANDMARKS_LIPS=Vc,re.FACE_LANDMARKS_LEFT_EYE=jc,re.FACE_LANDMARKS_LEFT_EYEBROW=zc,re.FACE_LANDMARKS_LEFT_IRIS=m0,re.FACE_LANDMARKS_RIGHT_EYE=Gc,re.FACE_LANDMARKS_RIGHT_EYEBROW=Zc,re.FACE_LANDMARKS_RIGHT_IRIS=g0,re.FACE_LANDMARKS_FACE_OVAL=Wc,re.FACE_LANDMARKS_CONTOURS=v0,re.FACE_LANDMARKS_TESSELATION=b0;var Et=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!0),I(e=this.j=new Ah,0,1,t=new oe)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,i){const r=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:i,rt(this,e,r!=null?r:{}),!this.h)return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"stylized_image");const t=new qe;ht(t,Up,this.j);const i=new Fe;Ve(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"STYLIZED_IMAGE:stylized_image"),i.o(t),je(e,i),this.g.V("stylized_image",(r,n)=>{var o=!this.h,s=r.data,a=r.width;const c=a*(r=r.height);if(s instanceof Uint8Array)if(s.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=s[3*d],l[4*d+1]=s[3*d+1],l[4*d+2]=s[3*d+2],l[4*d+3]=255;s=new ImageData(l,a,r)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,r)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new xe([s],!1,!1,this.g.i.canvas,this.P,a,r),this.s=o=o?a.clone():a,this.h&&this.h(o),w(this,n)}),this.g.attachEmptyPacketListener("stylized_image",r=>{this.s=null,this.h&&this.h(null),w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Et.prototype.stylize=Et.prototype.Ka,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(e,t){return U(Et,e,{baseOptions:{modelAssetPath:t}})},Et.createFromModelBuffer=function(e,t){return U(Et,e,{baseOptions:{modelAssetBuffer:t}})},Et.createFromOptions=function(e,t){return U(Et,e,t)};var Xc=mt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function _0(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function w0(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function C0(e,t=!0){var n,o,s,a,c,l;const i=[];for(const d of e){var r=Nn(d);e=[];for(const u of r.g())r=t&&et(u,1)!=null?(n=et(u,1))!=null?n:0:-1,e.push({score:(o=fe(u,2))!=null?o:0,index:r,categoryName:(a=(s=tt(u,3))!=null?s:"")!=null?a:"",displayName:(l=(c=tt(u,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var ze=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.j=new Th,0,1,t=new oe),this.s=new Lc,I(this.j,0,2,this.s),this.C=new Sc,I(this.s,0,3,this.C),this.v=new Lh,I(this.s,0,2,this.v),this.h=new qp,I(this.j,0,3,this.h),A(this.v,2,.5),A(this.s,4,.5),A(this.C,2,.5)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){var n,o,s,a,c,l,d,u;if(yt(this.v,3,(n=e.numHands)!=null?n:1),"minHandDetectionConfidence"in e&&A(this.v,2,(o=e.minHandDetectionConfidence)!=null?o:.5),"minTrackingConfidence"in e&&A(this.s,4,(s=e.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in e&&A(this.C,2,(a=e.minHandPresenceConfidence)!=null?a:.5),e.cannedGesturesClassifierOptions){var t=new Wi,i=t,r=Bc(e.cannedGesturesClassifierOptions,(c=V(this.h,Wi,3))==null?void 0:c.h());I(i,0,2,r),I(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=V(this.h,Wi,3))==null||l.g());return e.customGesturesClassifierOptions?(I(i=t=new Wi,0,2,r=Bc(e.customGesturesClassifierOptions,(d=V(this.h,Wi,4))==null?void 0:d.h())),I(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((u=V(this.h,Wi,4))==null||u.g()),this.l(e)}Fa(e,t){return _0(this),rt(this,e,t),w0(this)}Ga(e,t,i){return _0(this),Ct(this,e,i,t),w0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"hand_gestures"),z(e,"hand_landmarks"),z(e,"world_hand_landmarks"),z(e,"handedness");const t=new qe;ht(t,Vp,this.j);const i=new Fe;Ve(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"HAND_GESTURES:hand_gestures"),q(i,"LANDMARKS:hand_landmarks"),q(i,"WORLD_LANDMARKS:world_hand_landmarks"),q(i,"HANDEDNESS:handedness"),i.o(t),je(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Rr(l);const d=[];for(const u of Ft(r,mh,1))d.push({x:(o=fe(u,1))!=null?o:0,y:(s=fe(u,2))!=null?s:0,z:(a=fe(u,3))!=null?a:0,visibility:(c=fe(u,4))!=null?c:0});this.landmarks.push(d)}w(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{var o,s,a,c;for(const l of r){r=Zi(l);const d=[];for(const u of Ft(r,ph,1))d.push({x:(o=fe(u,1))!=null?o:0,y:(s=fe(u,2))!=null?s:0,z:(a=fe(u,3))!=null?a:0,visibility:(c=fe(u,4))!=null?c:0});this.worldLandmarks.push(d)}w(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("hand_gestures",(r,n)=>{this.gestures.push(...C0(r,!1)),w(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",r=>{w(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{this.handedness.push(...C0(r)),w(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function E0(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}ze.prototype.recognizeForVideo=ze.prototype.Ga,ze.prototype.recognize=ze.prototype.Fa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return U(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return U(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return U(ze,e,t)},ze.HAND_CONNECTIONS=Xc;var Ge=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],I(e=this.h=new Lc,0,1,t=new oe),this.s=new Sc,I(this.h,0,3,this.s),this.j=new Lh,I(this.h,0,2,this.j),yt(this.j,3,1),A(this.j,2,.5),A(this.s,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n;return"numHands"in e&&yt(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&A(this.j,2,(i=e.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minHandPresenceConfidence"in e&&A(this.s,2,(n=e.minHandPresenceConfidence)!=null?n:.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],rt(this,e,t),E0(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ct(this,e,i,t),E0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"hand_landmarks"),z(e,"world_hand_landmarks"),z(e,"handedness");const t=new qe;ht(t,jp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"LANDMARKS:hand_landmarks"),q(i,"WORLD_LANDMARKS:world_hand_landmarks"),q(i,"HANDEDNESS:handedness"),i.o(t),je(e,i),this.g.attachProtoVectorListener("hand_landmarks",(r,n)=>{for(const o of r)r=Rr(o),this.landmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,n)=>{for(const o of r)r=Zi(o),this.worldLandmarks.push(Or(r));w(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoVectorListener("handedness",(r,n)=>{var c,l,d,u,h,f,p;var o=this.handedness,s=o.push;const a=[];for(const m of r){r=Nn(m);const v=[];for(const g of r.g())v.push({score:(c=fe(g,2))!=null?c:0,index:(d=(l=et(g,1))!=null?l:0)!=null?d:-1,categoryName:(h=(u=tt(g,3))!=null?u:"")!=null?h:"",displayName:(p=(f=tt(g,4))!=null?f:"")!=null?p:""});a.push(v)}s.call(o,...a),w(this,n)}),this.g.attachEmptyPacketListener("handedness",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ge.prototype.detectForVideo=Ge.prototype.F,Ge.prototype.detect=Ge.prototype.D,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return U(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return U(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return U(Ge,e,t)},Ge.HAND_CONNECTIONS=Xc;var x0=mt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function k0(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function A0(e){try{if(!e.C)return e.h;e.C(e.h)}finally{Gn(e)}}function Jn(e,t){e=Rr(e),t.push(Vn(e))}var se=class extends $e{constructor(e,t){super(new it(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,I(e=this.j=new Rh,0,1,t=new oe),this.K=new Sc,I(this.j,0,2,this.K),this.Y=new zp,I(this.j,0,3,this.Y),this.s=new qn,I(this.j,0,4,this.s),this.H=new Eh,I(this.j,0,5,this.H),this.v=new Bh,I(this.j,0,6,this.v),this.L=new Dh,I(this.j,0,7,this.L),A(this.s,2,.5),A(this.s,3,.3),A(this.H,2,.5),A(this.v,2,.5),A(this.v,3,.3),A(this.L,2,.5),A(this.K,2,.5)}get baseOptions(){return V(this.j,oe,1)}set baseOptions(e){I(this.j,0,1,e)}o(e){var t,i,r,n,o,s,a;return"minFaceDetectionConfidence"in e&&A(this.s,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&A(this.s,3,(i=e.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in e&&A(this.H,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&A(this.v,2,(n=e.minPoseDetectionConfidence)!=null?n:.5),"minPoseSuppressionThreshold"in e&&A(this.v,3,(o=e.minPoseSuppressionThreshold)!=null?o:.3),"minPosePresenceConfidence"in e&&A(this.L,2,(s=e.minPosePresenceConfidence)!=null?s:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&A(this.K,2,(a=e.minHandLandmarksConfidence)!=null?a:.5),this.l(e)}D(e,t,i){const r=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:i,k0(this),rt(this,e,r),A0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:r,k0(this),Ct(this,e,n,t),A0(this)}m(){var e=new Pe;ie(e,"input_frames_image"),z(e,"pose_landmarks"),z(e,"pose_world_landmarks"),z(e,"face_landmarks"),z(e,"left_hand_landmarks"),z(e,"left_hand_world_landmarks"),z(e,"right_hand_landmarks"),z(e,"right_hand_world_landmarks");const t=new qe,i=new Yd;Xa(i,1,Ri("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(n,o){if(o!=null)if(Array.isArray(o))Q(n,2,bn(o,za,void 0,void 0,!1));else{if(!(typeof o=="string"||o instanceof Tt||di(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Xa(n,2,Fa(o,!1),hi())}}(i,this.j.g());const r=new Fe;Ve(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),En(r,8,Yd,i),ee(r,"IMAGE:input_frames_image"),q(r,"POSE_LANDMARKS:pose_landmarks"),q(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),q(r,"FACE_LANDMARKS:face_landmarks"),q(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),q(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),q(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),q(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(t),je(e,r),zn(this,e),this.g.attachProtoListener("pose_landmarks",(n,o)=>{Jn(n,this.h.poseLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("pose_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("pose_world_landmarks",(n,o)=>{var s=this.h.poseWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{w(this,n)}),this.outputPoseSegmentationMasks&&(q(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Xi(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(n,o)=>{this.h.poseSegmentationMasks=[Qi(this,n,!0,!this.C)],w(this,o)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",n=>{this.h.poseSegmentationMasks=[],w(this,n)})),this.g.attachProtoListener("face_landmarks",(n,o)=>{Jn(n,this.h.faceLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{w(this,n)}),this.outputFaceBlendshapes&&(z(e,"extra_blendshapes"),q(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(n,o)=>{var a;var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(n=Nn(n),s.push(Dc((a=n.g())!=null?a:[]))),w(this,o)}),this.g.attachEmptyPacketListener("extra_blendshapes",n=>{w(this,n)})),this.g.attachProtoListener("left_hand_landmarks",(n,o)=>{Jn(n,this.h.leftHandLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("left_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("left_hand_world_landmarks",(n,o)=>{var s=this.h.leftHandWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("right_hand_landmarks",(n,o)=>{Jn(n,this.h.rightHandLandmarks),w(this,o)}),this.g.attachEmptyPacketListener("right_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoListener("right_hand_world_landmarks",(n,o)=>{var s=this.h.rightHandWorldLandmarks;n=Zi(n),s.push(Or(n)),w(this,o)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",n=>{w(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};se.prototype.detectForVideo=se.prototype.F,se.prototype.detect=se.prototype.D,se.prototype.setOptions=se.prototype.o,se.createFromModelPath=function(e,t){return U(se,e,{baseOptions:{modelAssetPath:t}})},se.createFromModelBuffer=function(e,t){return U(se,e,{baseOptions:{modelAssetBuffer:t}})},se.createFromOptions=function(e,t){return U(se,e,t)},se.HAND_CONNECTIONS=Xc,se.POSE_CONNECTIONS=x0,se.FACE_LANDMARKS_LIPS=Vc,se.FACE_LANDMARKS_LEFT_EYE=jc,se.FACE_LANDMARKS_LEFT_EYEBROW=zc,se.FACE_LANDMARKS_LEFT_IRIS=m0,se.FACE_LANDMARKS_RIGHT_EYE=Gc,se.FACE_LANDMARKS_RIGHT_EYEBROW=Zc,se.FACE_LANDMARKS_RIGHT_IRIS=g0,se.FACE_LANDMARKS_FACE_OVAL=Wc,se.FACE_LANDMARKS_CONTOURS=v0,se.FACE_LANDMARKS_TESSELATION=b0;var ot=class extends $e{constructor(e,t){super(new it(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},I(e=this.h=new Oh,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){return I(this.h,0,2,Bc(e,V(this.h,xc,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},rt(this,e,t),this.j}ra(e,t,i){return this.j={classifications:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"input_image"),ie(e,"norm_rect"),z(e,"classifications");const t=new qe;ht(t,Gp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),ee(i,"IMAGE:input_image"),ee(i,"NORM_RECT:norm_rect"),q(i,"CLASSIFICATIONS:classifications"),i.o(t),je(e,i),this.g.attachProtoListener("classifications",(r,n)=>{this.j=function(o){var a;const s={classifications:Ft(o,Fp,1).map(c=>{var l,d,u,h;return Dc((d=(l=V(c,dh,4))==null?void 0:l.g())!=null?d:[],(u=et(c,2))!=null?u:0,(h=tt(c,3))!=null?h:"")})};return Ha(Pi(o,2))!=null&&(s.timestampMs=(a=Ha(Pi(o,2)))!=null?a:0),s}(Bp(r)),w(this,n)}),this.g.attachEmptyPacketListener("classifications",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ot.prototype.classifyForVideo=ot.prototype.ra,ot.prototype.classify=ot.prototype.qa,ot.prototype.setOptions=ot.prototype.o,ot.createFromModelPath=function(e,t){return U(ot,e,{baseOptions:{modelAssetPath:t}})},ot.createFromModelBuffer=function(e,t){return U(ot,e,{baseOptions:{modelAssetBuffer:t}})},ot.createFromOptions=function(e,t){return U(ot,e,t)};var Ze=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!0),this.h=new Ph,this.embeddings={embeddings:[]},I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t=this.h,i=V(this.h,_h,2);return i=i?i.clone():new _h,e.l2Normalize!==void 0?Ir(i,1,e.l2Normalize):"l2Normalize"in e&&Q(i,1),e.quantize!==void 0?Ir(i,2,e.quantize):"quantize"in e&&Q(i,2),I(t,0,2,i),this.l(e)}xa(e,t){return rt(this,e,t),this.embeddings}ya(e,t,i){return Ct(this,e,i,t),this.embeddings}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"embeddings_out");const t=new qe;ht(t,Zp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"EMBEDDINGS:embeddings_out"),i.o(t),je(e,i),this.g.attachProtoListener("embeddings_out",(r,n)=>{r=Op(r),this.embeddings=function(o){var s;return{embeddings:Ft(o,Rp,1).map(a=>{var l,d,u,h,f,p,m;const c={headIndex:(d=(l=et(a,3))!=null?l:0)!=null?d:-1,headName:(h=(u=tt(a,4))!=null?u:"")!=null?h:""};if(_d(a,vh,Ka(a,1))!==void 0)a=mi(a=V(a,vh,Ka(a,1)),1,Wt,pi()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(p=(f=V(a,Dp,Ka(a,2)))==null?void 0:f.ma())==null?void 0:p.h())!=null?m:v}return c}),timestampMs:(s=Ha(Pi(o,2)))!=null?s:0}}(r),w(this,n)}),this.g.attachEmptyPacketListener("embeddings_out",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ze.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Gh(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Gh(zh(e.quantizedEmbedding),zh(t.quantizedEmbedding))}return e},Ze.prototype.embedForVideo=Ze.prototype.ya,Ze.prototype.embed=Ze.prototype.xa,Ze.prototype.setOptions=Ze.prototype.o,Ze.createFromModelPath=function(e,t){return U(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return U(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return U(Ze,e,t)};var Kc=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};function S0(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function L0(e){try{const t=new Kc(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gn(e)}}Kc.prototype.close=Kc.prototype.close;var Ne=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fc,this.v=new $h,I(this.h,0,3,this.v),I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return e.displayNamesLocale!==void 0?Q(this.h,2,Ri(e.displayNamesLocale)):"displayNamesLocale"in e&&Q(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}J(){(function(e){var i,r,n;const t=Ft(e.ca(),Fe,1).filter(o=>{var s;return((s=tt(o,1))!=null?s:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&((n=(r=(i=V(t[0],qe,7))==null?void 0:i.l())==null?void 0:r.g())!=null?n:new Map).forEach((o,s)=>{var a;e.s[Number(s)]=(a=tt(o,1))!=null?a:""})})(this)}segment(e,t,i){const r=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,S0(this),rt(this,e,r),L0(this)}Ia(e,t,i,r){const n=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:r,S0(this),Ct(this,e,n,t),L0(this)}Ba(){return this.s}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect");const t=new qe;ht(t,Uh,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),i.o(t),je(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),q(i,"CONFIDENCE_MASKS:confidence_masks"),Xi(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>Qi(this,o,!0,!this.j)),w(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],w(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),q(i,"CATEGORY_MASK:category_mask"),Xi(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=Qi(this,r,!1,!this.j),w(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,w(this,r)})),z(e,"quality_scores"),q(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,w(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.getLabels=Ne.prototype.Ba,Ne.prototype.segmentForVideo=Ne.prototype.Ia,Ne.prototype.segment=Ne.prototype.segment,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=function(e,t){return U(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return U(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return U(Ne,e,t)};var Yc=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};Yc.prototype.close=Yc.prototype.close;var n5=class extends k{constructor(e){super(e)}},er=[0,de,-2],Qn=[0,Rt,-3,ne,Rt,-1],T0=[0,Qn],M0=[0,Qn,de,-1],Jc=class extends k{constructor(e){super(e)}},I0=[0,Rt,-1,ne],o5=class extends k{constructor(e){super(e)}},F0=class extends k{constructor(e){super(e)}},Qc=[1,2,3,4,5,6,7,8,9,10,14,15],B0=class extends k{constructor(e){super(e)}};B0.prototype.g=$n([0,we,[0,Qc,X,Qn,X,[0,Qn,er],X,T0,X,[0,T0,er],X,I0,X,[0,Rt,-3,ne,Ue],X,[0,Rt,-3,ne],X,[0,W,Rt,-2,ne,de,ne,-1,2,Rt,er],X,M0,X,[0,M0,er],Rt,er,W,X,[0,Rt,-3,ne,er,-1],X,[0,we,I0]],W,[0,W,de,-1,ne]]);var xt=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fc,this.s=new $h,I(this.h,0,3,this.s),I(e=this.h,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i;return"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}segment(e,t,i,r){const n=typeof i!="function"?i:{};this.j=typeof i=="function"?i:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,r=new B0;const o=new F0;var s=new n5;if(yt(s,1,255),I(o,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Jc;Ir(a,3,!0),A(a,1,t.keypoint.x),A(a,2,t.keypoint.y),Mr(o,5,Qc,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new o5,t.scribble))Ir(t=new Jc,3,!0),A(t,1,a.x),A(t,2,a.y),En(s,1,Jc,t);Mr(o,15,Qc,s)}En(r,1,F0,o),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",i),rt(this,e,n);e:{try{const l=new Yc(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{Gn(this)}c=void 0}return c}m(){var e=new Pe;ie(e,"image_in"),ie(e,"roi_in"),ie(e,"norm_rect_in");const t=new qe;ht(t,Uh,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),ee(i,"IMAGE:image_in"),ee(i,"ROI:roi_in"),ee(i,"NORM_RECT:norm_rect_in"),i.o(t),je(e,i),zn(this,e),this.outputConfidenceMasks&&(z(e,"confidence_masks"),q(i,"CONFIDENCE_MASKS:confidence_masks"),Xi(this,"confidence_masks"),this.g.ba("confidence_masks",(r,n)=>{this.confidenceMasks=r.map(o=>Qi(this,o,!0,!this.j)),w(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],w(this,r)})),this.outputCategoryMask&&(z(e,"category_mask"),q(i,"CATEGORY_MASK:category_mask"),Xi(this,"category_mask"),this.g.V("category_mask",(r,n)=>{this.categoryMask=Qi(this,r,!1,!this.j),w(this,n)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,w(this,r)})),z(e,"quality_scores"),q(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,n)=>{this.qualityScores=r,w(this,n)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.segment=xt.prototype.segment,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=function(e,t){return U(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return U(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return U(xt,e,t)};var st=class extends $e{constructor(e,t){super(new it(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},I(e=this.h=new qh,0,1,t=new oe)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Q(this.h,2,Ri(e.displayNamesLocale)):"displayNamesLocale"in e&&Q(this.h,2),e.maxResults!==void 0?yt(this.h,3,e.maxResults):"maxResults"in e&&Q(this.h,3),e.scoreThreshold!==void 0?A(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Q(this.h,4),e.categoryAllowlist!==void 0?xn(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Q(this.h,5),e.categoryDenylist!==void 0?xn(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Q(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},rt(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},Ct(this,e,i,t),this.j}m(){var e=new Pe;ie(e,"input_frame_gpu"),ie(e,"norm_rect"),z(e,"detections");const t=new qe;ht(t,Xp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),ee(i,"IMAGE:input_frame_gpu"),ee(i,"NORM_RECT:norm_rect"),q(i,"DETECTIONS:detections"),i.o(t),je(e,i),this.g.attachProtoVectorListener("detections",(r,n)=>{for(const o of r)r=fh(o),this.j.detections.push(jh(r));w(this,n)}),this.g.attachEmptyPacketListener("detections",r=>{w(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};st.prototype.detectForVideo=st.prototype.F,st.prototype.detect=st.prototype.D,st.prototype.setOptions=st.prototype.o,st.createFromModelPath=function(e,t){return S(this,null,function*(){return U(st,e,{baseOptions:{modelAssetPath:t}})})},st.createFromModelBuffer=function(e,t){return U(st,e,{baseOptions:{modelAssetBuffer:t}})},st.createFromOptions=function(e,t){return U(st,e,t)};var el=class{constructor(e,t,i){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=i}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function D0(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function R0(e){try{const t=new el(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gn(e)}}el.prototype.close=el.prototype.close;var We=class extends $e{constructor(e,t){super(new it(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,I(e=this.h=new Vh,0,1,t=new oe),this.v=new Dh,I(this.h,0,3,this.v),this.j=new Bh,I(this.h,0,2,this.j),yt(this.j,4,1),A(this.j,2,.5),A(this.v,2,.5),A(this.h,4,.5)}get baseOptions(){return V(this.h,oe,1)}set baseOptions(e){I(this.h,0,1,e)}o(e){var t,i,r,n,o;return"numPoses"in e&&yt(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&A(this.j,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&A(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minPosePresenceConfidence"in e&&A(this.v,2,(n=e.minPosePresenceConfidence)!=null?n:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=(o=e.outputSegmentationMasks)!=null?o:!1),this.l(e)}D(e,t,i){const r=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:i,D0(this),rt(this,e,r),R0(this)}F(e,t,i,r){const n=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:r,D0(this),Ct(this,e,n,t),R0(this)}m(){var e=new Pe;ie(e,"image_in"),ie(e,"norm_rect"),z(e,"normalized_landmarks"),z(e,"world_landmarks"),z(e,"segmentation_masks");const t=new qe;ht(t,Kp,this.h);const i=new Fe;Ve(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),ee(i,"IMAGE:image_in"),ee(i,"NORM_RECT:norm_rect"),q(i,"NORM_LANDMARKS:normalized_landmarks"),q(i,"WORLD_LANDMARKS:world_landmarks"),i.o(t),je(e,i),zn(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(r,n)=>{this.landmarks=[];for(const o of r)r=Rr(o),this.landmarks.push(Vn(r));w(this,n)}),this.g.attachEmptyPacketListener("normalized_landmarks",r=>{this.landmarks=[],w(this,r)}),this.g.attachProtoVectorListener("world_landmarks",(r,n)=>{this.worldLandmarks=[];for(const o of r)r=Zi(o),this.worldLandmarks.push(Or(r));w(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",r=>{this.worldLandmarks=[],w(this,r)}),this.outputSegmentationMasks&&(q(i,"SEGMENTATION_MASK:segmentation_masks"),Xi(this,"segmentation_masks"),this.g.ba("segmentation_masks",(r,n)=>{this.segmentationMasks=r.map(o=>Qi(this,o,!0,!this.s)),w(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",r=>{this.segmentationMasks=[],w(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};We.prototype.detectForVideo=We.prototype.F,We.prototype.detect=We.prototype.D,We.prototype.setOptions=We.prototype.o,We.createFromModelPath=function(e,t){return U(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return U(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return U(We,e,t)},We.POSE_CONNECTIONS=x0;const s5=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;let i=1,r=0,n=1,o=0;t.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),o=Math.max(o,l.y))});const s=r-i,a=o-n;return Math.max(s,a)},a5=(e,t)=>{if(!e||e.length===0)return!1;const i=e[0];let r=1,n=0,o=1,s=0;i.forEach(j=>{r=Math.min(r,j.x),n=Math.max(n,j.x),o=Math.min(o,j.y),s=Math.max(s,j.y)});const a=.5,c=.6,l=t>1;let d,u;l?(d=.4,u=.3):(d=.35,u=.5);const h=(r+n)/2,f=(o+s)/2,p=.2,m=d*(1+p),v=u*(1+p),b=((j,O)=>{const ae=(j-a)/m,me=(O-c)/v;return ae*ae+me*me<=1})(h,f),_=.2,M=.1,P=d*(1+_),x=u*(1+M),D=(j,O)=>{const ae=(j-a)/P,me=(O-c)/x;return ae*ae+me*me<=1},C=D(r,o),R=D(n,o),F=D(r,s),E=D(n,s);return b&&C&&R&&F&&E},c5=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;const i=t[13],r=t[14];if(!i||!r)return 0;const n=Math.abs(r.y-i.y),o=Math.min(...t.map(c=>c.y)),a=Math.max(...t.map(c=>c.y))-o;return a>0?n/a:0},l5=e=>{const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return null;const r=e.videoWidth,n=e.videoHeight,o=Math.min(r,n),s=(r-o)/2,a=(n-o)/2;return t.width=o,t.height=o,i.drawImage(e,s,a,o,o,0,0,o,o),t},O0=(e,t,i,r)=>{const n=e.getContext("2d");if(!n)return;const o=e.width,s=e.height;n.clearRect(0,0,o,s);const a=new De(n);t.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;n.strokeStyle="rgba(255, 255, 255, 0.6)",n.lineWidth=d,n.lineCap="round",n.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,re.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=r&&a.drawConnectors(c,re.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},P0=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height)},u5=(e,t=!1)=>{const i=document.createElement("canvas"),r=i.getContext("2d");if(!r)return null;const n=e.videoHeight>e.videoWidth;t?n?(i.width=480,i.height=Math.max(640,i.width*e.videoHeight/e.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*e.videoHeight/e.videoWidth)):n?(i.width=240,i.height=Math.max(320,i.width*e.videoHeight/e.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*e.videoHeight/e.videoWidth));const o=1,s=e.videoWidth*o,a=e.videoHeight*o,c=(s-e.videoWidth)/2,l=(a-e.videoHeight)/2;return r.drawImage(e,-c,-l-0,s,a,0,0,i.width,i.height),i.toDataURL("image/jpeg",Ht)},$0={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},eo={"multiple-faces":()=>y("selfie.smart.alert.multipleFaces"),"no-face":()=>y("selfie.smart.alert.noFace"),"out-of-bounds":()=>y("selfie.smart.alert.outOfBounds"),"too-close":()=>y("selfie.smart.alert.tooClose"),"too-far":()=>y("selfie.smart.alert.tooFar"),"neutral-expression":()=>y("selfie.smart.alert.neutralExpression"),"smile-required":()=>y("selfie.smart.alert.smileRequired"),"open-mouth-smile":()=>y("selfie.smart.alert.openMouthSmile"),initializing:()=>y("selfie.smart.alert.initializing")},d5=["sm-s936","sm-s931","sm-s938"],h5=()=>S(this,null,function*(){if(typeof navigator!="undefined"&&navigator.userAgentData)try{const{model:e}=yield navigator.userAgentData.getHighEntropyValues(["model"]);if(!e)return!1;const t=e.toLowerCase();return d5.some(i=>t.includes(i))}catch(e){return console.warn("UA-CH model fetch failed, falling back to UA string check.",e),!1}return!1}),f5=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const i=t.getExtension("OES_texture_half_float"),r=t.getExtension("OES_texture_half_float_linear"),n=t.getExtension("EXT_color_buffer_half_float");return!!(i&&n&&r)},N0=()=>S(this,null,function*(){window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const e=window.__smileIdentityMediapipe;return e.loaded&&e.instance?e.instance:(e.loading||(e.loading=S(this,null,function*(){try{const t=yield bi.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield h5(),r=yield re.createFromOptions(t,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:i||!f5()?"CPU":"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return e.instance=r,e.loaded=!0,e.loading=null,r}catch(t){throw e.loading=null,t}})),e.loading)}),qr=fr.version,p5=({videoRef:e,canvasRef:t,interval:i,duration:r,smileThreshold:n,mouthOpenThreshold:o,minFaceSize:s,maxFaceSize:a,smileCooldown:c,getFacingMode:l})=>{const d=Ae(null),u=Ae(null),h=Ae(null),f=Ae(null),p=le(!1),m=le(!1),v=le("good"),g=le(!1),b=le(16/9),_=le([]),M=le(0),P=le(0),x=le(0),D=le(0),C=le(""),R=le(!0),F=le(!1),E=le(!1),j=le(0),O=le([]),ae=le(null),me=le(1),Le=le(0),j0=le(!1),tr=ha(()=>Math.floor(me.value*.4)),z0=ha(()=>Math.floor(me.value*.2)),P5=ha(()=>p.value&&m.value&&v.value==="good"&&!g.value),nl=K=>{var ge;K&&eo[K]?C.value=(ge=eo[K])==null?void 0:ge.call(eo):C.value=""},Xe=Ae(M2(K=>{nl(K)},600)).current,$5=()=>S(this,null,function*(){var K,ge;try{((K=window.__smileIdentityMediapipe)==null?void 0:K.loaded)&&((ge=window.__smileIdentityMediapipe)==null?void 0:ge.instance)||(R.value=!0,nl("initializing")),d.current=yield N0(),R.value=!1}catch(At){console.error("Failed to initialize MediaPipe:",At),R.value=!1}}),N5=()=>{if(e.current&&t.current){const{videoWidth:K,videoHeight:ge}=e.current;b.value=K/ge,t.current.width=K,t.current.height=ge,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},H5=()=>{const K=Le.value<z0.value,ge=Le.value>=tr.value;K?C.value=y("selfie.smart.status.capturing"):ge?Date.now()-D.value>c?M.value>=n&&x.value<o?Xe("open-mouth-smile"):Xe("smile-required"):C.value=y("selfie.smart.status.keepSmiling"):Xe(null)},U5=()=>{R.value?nl("initializing"):g.value?Xe("multiple-faces"):p.value?v.value==="too-close"?Xe("too-close"):v.value==="too-far"?Xe("too-far"):m.value?F.value?H5():C.value=y("selfie.smart.status.readyToCapture"):Xe("out-of-bounds"):Xe("no-face")},ol=()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)},sl=()=>S(this,null,function*(){var K,ge;if(!d.current||!e.current){ol();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){u.current=requestAnimationFrame(sl);return}try{R.value&&(R.value=!1);const At=l5(e.current),al=At||e.current,Ke=d.current.detectForVideo(al,performance.now());if(_.value=Ke.faceLandmarks||[],Ke.faceLandmarks&&t.current&&e.current)if(At){const ri=e.current.videoWidth,yi=e.current.videoHeight,ir=Math.min(ri,yi),cl=(ri-ir)/(2*ri),ro=(yi-ir)/(2*yi),no=ir/ri,rr=ir/yi,j5=Ke.faceLandmarks.map(z5=>z5.map(ll=>({x:ll.x*no+cl,y:ll.y*rr+ro,z:ll.z})));O0(t.current,j5,Le.value,tr.value)}else O0(t.current,Ke.faceLandmarks,Le.value,tr.value);else t.current&&P0(t.current);const W0=Ke.faceLandmarks?Ke.faceLandmarks.length:0;g.value=W0>1;const X0=Ke.faceBlendshapes&&Ke.faceBlendshapes.length>0&&W0===1;if(p.value=X0,X0&&Ke.faceLandmarks){const ri=s5(Ke.faceLandmarks);P.value=ri,ri>a?v.value="too-close":ri<s?v.value="too-far":v.value="good",m.value=a5(Ke.faceLandmarks,b.value);const yi=Ke.faceBlendshapes[0].categories,ir=((K=yi.find(rr=>rr.categoryName==="mouthSmileLeft"))==null?void 0:K.score)||0,cl=((ge=yi.find(rr=>rr.categoryName==="mouthSmileRight"))==null?void 0:ge.score)||0,ro=c5(Ke.faceLandmarks),no=(ir+cl)/2;M.value=no,x.value=ro,no>=n&&ro>=o&&(D.value=Date.now(),E.value&&F.value&&f.current&&setTimeout(()=>{Date.now()-D.value<=100&&E.value&&F.value&&f.current&&f.current()},0))}else M.value=0,P.value=0,x.value=0,m.value=!1,v.value="good";U5()}catch(At){p.value=!1,m.value=!1,g.value=!1,v.value="good",x.value=0,F.value&&Xe("no-face")}u.current=requestAnimationFrame(sl)}),q5=()=>{u.current&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(sl)},V5=()=>{if(!e.current)return;const K=Le.value===me.value-1,ge=u5(e.current,K);ge&&(K?ae.value=ge:O.value=[...O.value,ge],Le.value++,j.value=me.value-Le.value)},io=()=>{if(h.current&&(clearInterval(h.current),h.current=null),F.value=!1,E.value=!1,Le.value>=me.value&&ae.value){const K=O.value.map(al=>({image:al.split(",")[1],image_type_id:$0.LIVENESS_IMAGE_BASE64})),ge={image:ae.value.split(",")[1],image_type_id:$0.SELFIE_IMAGE_BASE64},At={images:[...K,ge],referenceImage:ae.value,previewImage:ae.value,facingMode:l(),meta:{libraryVersion:qr}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:At})),j0.value=!0}},Vr=()=>{h.current&&(clearInterval(h.current),h.current=null),E.value=!0,!g.value&&p.value&&m.value&&v.value==="good"&&Xe("smile-required")},G0=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(Le.value>=me.value){io();return}if(g.value){Vr();return}if(!p.value)return;if(!m.value){Vr();return}if(v.value!=="good"){Vr();return}if(Le.value>=tr.value&&Date.now()-D.value>c){Vr();return}V5()},i)},Z0=()=>{if(p.value&&v.value==="good"&&m.value&&!g.value){if(Le.value>=tr.value&&Date.now()-D.value>c)return;E.value=!1,Xe(null),G0()}};return f.current=Z0,{faceDetected:p,faceInBounds:m,faceProximity:v,multipleFaces:g,videoAspectRatio:b,faceLandmarks:_,currentSmileScore:M,currentFaceSize:P,currentMouthOpen:x,lastSmileTime:D,alertTitle:C,isInitializing:R,isReadyToCapture:P5,isCapturing:F,isPaused:E,countdown:j,capturedImages:O,referencePhoto:ae,totalCaptures:me,capturesTaken:Le,hasFinishedCapture:j0,smileCheckpoint:tr,neutralZone:z0,initializeFaceLandmarker:$5,setupCanvas:N5,startDetectionLoop:q5,stopDetectionLoop:ol,updateAlert:Xe,startCapture:()=>S(this,null,function*(){O.value=[],F.value=!0,E.value=!1,me.value=Math.ceil(r/i),Le.value=0,j.value=me.value;const K=document.querySelector("smart-camera-web");K==null||K.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),K==null||K.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[l()]}})),G0()}),stopCapture:io,pauseCapture:Vr,resumeCapture:Z0,handleCancel:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:qr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:qr}}}))},handleClose:()=>{io(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:qr}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:qr}}}))},cleanup:()=>{h.current&&clearInterval(h.current),ol(),Xe.cancel()},resetFaceDetectionState:()=>{p.value=!1,m.value=!1,v.value="good",g.value=!1,_.value=[],M.value=0,P.value=0,x.value=0,D.value=0,t.current&&P0(t.current)}}},m5=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const r=Ae(null),n=Ae(e);return Je(()=>{const o=r.current;if(!o)return;const s=o.getTotalLength();o.style.opacity=e>0?"1":"0";const a=s*(1-n.current),c=s*(1-e);a!==c&&(o.style.transition="none",o.style.strokeDasharray=`${s} ${s}`,o.style.strokeDashoffset=`${a}`,o.getBoundingClientRect(),o.style.transition=`stroke-dashoffset ${t}ms ease-out`,o.style.strokeDashoffset=`${c}`,n.current=e)},[e,t]),N("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:N("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[N("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:N("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),N("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),N("path",{ref:r,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},g5=({videoRef:e,canvasRef:t,facingMode:i,multipleFaces:r,progress:n,interval:o,themeColor:s})=>N(qt,{children:[N("div",{className:"camera-preview-container",children:[N("div",{className:"video-wrapper",style:{clipPath:r?"none":"url(#selfie-clip-path)"},children:N("div",{className:"video-container",children:[N("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),N("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!r&&N(m5,{progress:n,duration:o,themeColor:s})]}),N("style",{children:`
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
- `})]}),v5=({alertTitle:e})=>e?$(qt,{children:[$("div",{className:"alert-message",children:$("div",{className:"alert-title",children:e})}),$("style",{children:`
3184
+ `})]}),v5=({alertTitle:e})=>e?N(qt,{children:[N("div",{className:"alert-message",children:N("div",{className:"alert-title",children:e})}),N("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,b5=({isCapturing:e,hasFinishedCapture:t,isReadyToCapture:i,allowAgentMode:r,agentSupported:n,showAgentModeForTests:o,facingMode:s,themeColor:a="#001096",onStartCapture:c,onSwitchCamera:l})=>$(qt,{children:[$("div",{className:"controls",children:[$("button",{id:"start-image-capture",class:"btn-primary",onClick:c,disabled:e||t||!i,children:y("selfie.capture.button.startCapture")}),r&&(n||o)&&$("button",{id:"switch-camera",onClick:l,className:"agent-mode-btn",disabled:e||t,children:y(s==="user"?"selfie.capture.agentMode.off":"selfie.capture.agentMode.on")})]}),$("style",{children:`
3200
+ `})]}):null,b5=({isCapturing:e,hasFinishedCapture:t,isReadyToCapture:i,allowAgentMode:r,agentSupported:n,showAgentModeForTests:o,facingMode:s,themeColor:a="#001096",onStartCapture:c,onSwitchCamera:l})=>N(qt,{children:[N("div",{className:"controls",children:[N("button",{id:"start-image-capture",class:"btn-primary",onClick:c,disabled:e||t||!i,children:y("selfie.capture.button.startCapture")}),r&&(n||o)&&N("button",{id:"switch-camera",onClick:l,className:"agent-mode-btn",disabled:e||t,children:y(s==="user"?"selfie.capture.agentMode.off":"selfie.capture.agentMode.on")})]}),N("style",{children:`
3201
3201
  .controls {
3202
3202
  margin: 1.5rem 0;
3203
3203
  display: flex;
@@ -3222,7 +3222,7 @@ ${this.hideAttribution?"":`
3222
3222
  background: #ccc;
3223
3223
  cursor: not-allowed;
3224
3224
  }
3225
- `})]}),el=({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=ke(null),c=ke(null),l=Ai(r),d=Ai(n),u=Ai(o),h=Ai(s),f=300,p=.25,m=.05,v=.35,g=.5,b=d?"environment":"user",w=If(b),E=le(!1),B=ke(L2(M=>{E.value=M},100)).current,_=p5({videoRef:w.videoRef,canvasRef:a,interval:e,duration:t,smileThreshold:p,mouthOpenThreshold:m,minFaceSize:v,maxFaceSize:g,smileCooldown:f,getFacingMode:()=>w.facingMode});return dt(()=>{const M=()=>S(this,null,function*(){yield w.startCamera(b,k=>{const O=document.querySelector("smart-camera-web");O==null||O.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:k}}))}),yield w.checkAgentSupport(),yield _.initializeFaceLandmarker(),setTimeout(()=>{_.setupCanvas(),_.startDetectionLoop()},500)});return w.registerCameraSwitchCallback(()=>{try{_.resetFaceDetectionState(),_.setupCanvas(),_.stopDetectionLoop(),_.startDetectionLoop()}catch(k){console.error("Error during camera switch callback:",k)}}),M(),()=>{_.stopDetectionLoop(),w.stopCamera(),_.cleanup(),B.cancel()}},[]),dt(()=>{B(_.multipleFaces.value)},[_.multipleFaces.value]),dt(()=>{const M=c.current;if(M&&l){const k=()=>{_.handleCancel()},O=()=>{_.handleClose()};return M.addEventListener("navigation.back",k),M.addEventListener("navigation.close",O),()=>{M.removeEventListener("navigation.back",k),M.removeEventListener("navigation.close",O)}}},[l]),dt(()=>{if(_.hasFinishedCapture.value){const M=document.querySelector("smart-camera-web");M==null||M.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[_.hasFinishedCapture.value]),$("div",{className:"smartselfie-capture",children:[l&&$("smileid-navigation",{ref:c,"theme-color":i}),$(g5,{videoRef:w.videoRef,canvasRef:a,facingMode:w.facingMode,multipleFaces:E.value,progress:_.capturesTaken.value>0?_.capturesTaken.value/_.totalCaptures.value:0,interval:e,themeColor:i}),$(v5,{alertTitle:_.alertTitle.value}),!_.isCapturing.value&&!_.hasFinishedCapture.value&&$(b5,{isCapturing:_.isCapturing.value,hasFinishedCapture:_.hasFinishedCapture.value,isReadyToCapture:_.isReadyToCapture.value,allowAgentMode:d,agentSupported:w.agentSupported,showAgentModeForTests:u,facingMode:w.facingMode,themeColor:i,onStartCapture:_.startCapture,onSwitchCamera:w.switchCamera}),!h&&$("powered-by-smile-id",{}),$("style",{children:`
3225
+ `})]}),tl=({interval:e=350,duration:t=2800,"theme-color":i="#001096","show-navigation":r=!1,"allow-agent-mode":n=!1,"show-agent-mode-for-tests":o=!1,"hide-attribution":s=!1})=>{const a=Ae(null),c=Ae(null),l=ci(r),d=ci(n),u=ci(o),h=ci(s),f=300,p=.25,m=.05,v=.35,g=.5,b=d?"environment":"user",_=If(b),M=le(!1),P=Ae(M2(D=>{M.value=D},100)).current,x=p5({videoRef:_.videoRef,canvasRef:a,interval:e,duration:t,smileThreshold:p,mouthOpenThreshold:m,minFaceSize:v,maxFaceSize:g,smileCooldown:f,getFacingMode:()=>_.facingMode});return Je(()=>{const D=()=>S(this,null,function*(){yield _.startCamera(b,C=>{const R=document.querySelector("smart-camera-web");R==null||R.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:C}}))}),yield _.checkAgentSupport(),yield x.initializeFaceLandmarker(),setTimeout(()=>{x.setupCanvas(),x.startDetectionLoop()},500)});return _.registerCameraSwitchCallback(()=>{try{x.resetFaceDetectionState(),x.setupCanvas(),x.stopDetectionLoop(),x.startDetectionLoop()}catch(C){console.error("Error during camera switch callback:",C)}}),D(),()=>{x.stopDetectionLoop(),_.stopCamera(),x.cleanup(),P.cancel()}},[]),Je(()=>{P(x.multipleFaces.value)},[x.multipleFaces.value]),Je(()=>{const D=c.current;if(D&&l){const C=()=>{x.handleCancel()},R=()=>{x.handleClose()};return D.addEventListener("navigation.back",C),D.addEventListener("navigation.close",R),()=>{D.removeEventListener("navigation.back",C),D.removeEventListener("navigation.close",R)}}},[l]),Je(()=>{if(x.hasFinishedCapture.value){const D=document.querySelector("smart-camera-web");D==null||D.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[x.hasFinishedCapture.value]),N("div",{className:"smartselfie-capture",children:[l&&N("smileid-navigation",{ref:c,"theme-color":i}),N(g5,{videoRef:_.videoRef,canvasRef:a,facingMode:_.facingMode,multipleFaces:M.value,progress:x.capturesTaken.value>0?x.capturesTaken.value/x.totalCaptures.value:0,interval:e,themeColor:i}),N(v5,{alertTitle:x.alertTitle.value}),!x.isCapturing.value&&!x.hasFinishedCapture.value&&N(b5,{isCapturing:x.isCapturing.value,hasFinishedCapture:x.hasFinishedCapture.value,isReadyToCapture:x.isReadyToCapture.value,allowAgentMode:d,agentSupported:_.agentSupported,showAgentModeForTests:u,facingMode:_.facingMode,themeColor:i,onStartCapture:x.startCapture,onSwitchCamera:_.switchCamera}),!h&&N("powered-by-smile-id",{}),N("style",{children:`
3226
3226
  * {
3227
3227
  box-sizing: border-box;
3228
3228
  }
@@ -3270,8 +3270,8 @@ ${this.hideAttribution?"":`
3270
3270
  padding: 1rem;
3271
3271
  font-family: sans-serif;
3272
3272
  }
3273
- `})]})};customElements.get("smartselfie-capture")||l2(el,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const y5=fr.version,_5=8;function w5(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function C5(e,t=_5){const i=[];if(e<t)throw new Error(Nt("selfie.capture.error.minFrames",{count:t}));const r=t-1,n=Math.floor(e/r);let o=1;for(let a=0;a<e;a+=n)i.length<8?i.push(a):(i[o]=a,i.sort((c,l)=>c-l),o+=1);const s=e-1;return i.length<8&&!i.includes(s)&&i.push(s),i}function E5(){return`
3274
- ${ut(this.themeColor)}
3273
+ `})]})};customElements.get("smartselfie-capture")||d2(tl,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const y5=fr.version,_5=8;function w5(e,t=16){const i=new Set;for(let r=0;r<Math.min(e.length,1e4);r+=4)if(i.add(e[r]<<16|e[r+1]<<8|e[r+2]),i.size>t)return!0;return!1}function C5(e,t=_5){const i=[];if(e<t)throw new Error(Nt("selfie.capture.error.minFrames",{count:t}));const r=t-1,n=Math.floor(e/r);let o=1;for(let a=0;a<e;a+=n)i.length<8?i.push(a):(i[o]=a,i.sort((c,l)=>c-l),o+=1);const s=e-1;return i.length<8&&!i.includes(s)&&i.push(s),i}function E5(){return`
3274
+ ${dt(this.themeColor)}
3275
3275
  <style>
3276
3276
  :host {
3277
3277
  --theme-color: ${this.themeColor||"#001096"};
@@ -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 $0(i){return S(this,arguments,function*(e,t={facingMode:"user"}){try{const r=yield R.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",R.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,R.stopMedia(),yield $0(this,{facingMode:this.facingMode}),this.handleStream(R.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),R.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:Ci.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:Ci.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",R.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),R.stopMedia()}}setUpEventListeners(){var t;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(t=this.switchCamera)==null||t.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),R.stream?this.handleStream(R.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&$0(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){R.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 R.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")||lt()||"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")&&R.stream&&this.handleStream(R.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"),R.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",x5);const A5=n=>{var o=n,{timeout:e=2e4,"start-countdown":t=!1,hidden:i=!1}=o,r=dl(o,["timeout","start-countdown","hidden"]);const a=(()=>{try{return!!window.parent.Cypress||window.parent.navigator.userAgent.includes("Electron")&&window.parent.__Cypress}catch(E){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,c=Ai(i),l=Ai(t),[d,u]=ai(!1),[h,f]=ai(a?100:0),[p,m]=ai(!1),[v,g]=ai(!1),[b,w]=ai(!1);if(dt(()=>{if(d||v||a)return;S(this,null,function*(){g(!0);try{yield P0(),u(!0)}catch(B){console.error("Failed to load Mediapipe:",B)}g(!1)})},[d,v]),dt(()=>{if(c||!l||d)return;const E=setInterval(()=>{f(B=>Math.min(B+1,100))},e/100);return()=>{clearInterval(E)}},[c,l,e,d]),dt(()=>{if(c||d||h<100)return;const B=setTimeout(()=>{const _=document.querySelector("selfie-capture");if(_&&!_.hasAttribute("data-backup-events-setup")){_.setAttribute("data-backup-events-setup","true");const M=k=>{const O=k;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return _.addEventListener("selfie-capture.publish",M),_.addEventListener("selfie-capture.cancelled",M),_.addEventListener("selfie-capture.close",M),()=>{_.removeEventListener("selfie-capture.publish",M),_.removeEventListener("selfie-capture.cancelled",M),_.removeEventListener("selfie-capture.close",M)}}},200);return()=>{clearTimeout(B)}},[c,d,h]),dt(()=>{if(c||v)return;const E=document.querySelector("smart-camera-web");E==null||E.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:b?"0.0.1":"1.0.0"}}))},[b,c,v]),c)return null;if(p&&d&&!b)return $(el,Re({},r));if(!p&&d&&!b)return $(el,Re({},r));if(h>=100){b||w(!0);const E=Re({},r);return delete E.hidden,$("selfie-capture",nr(Re({},E),{ref:B=>{if(B&&!B.hasAttribute("data-events-setup")){B.setAttribute("data-events-setup","true");const _=M=>{const k=M;(k.type==="selfie-capture.publish"||k.type==="selfie-capture.cancelled"||k.type==="selfie-capture.close")&&m(!0),window.dispatchEvent(new CustomEvent(k.type,{detail:k.detail,bubbles:!0}))};B.addEventListener("selfie-capture.publish",_),B.addEventListener("selfie-capture.cancelled",_),B.addEventListener("selfie-capture.close",_)}}}))}return $("div",{style:{textAlign:"center",marginTop:"20%"},children:[$("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:$(df,{size:48,style:{animation:"spin 1s linear infinite"}})}),$("p",{children:["Loading... ",h,"%"]}),$("style",{children:`
3767
+ `}function H0(i){return S(this,arguments,function*(e,t={facingMode:"user"}){try{const r=yield $.getMedia({audio:!1,video:t}),o=(yield navigator.mediaDevices.enumerateDevices()).find(a=>a.kind==="videoinput"&&r.getVideoTracks()[0].getSettings().deviceId===a.deviceId),s=document.querySelector("smart-camera-web");s==null||s.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:o==null?void 0:o.label}})),e==null||e.removeAttribute("data-camera-error"),e==null||e.setAttribute("data-camera-ready",!0)}catch(r){e==null||e.removeAttribute("data-camera-ready"),e==null||e.setAttribute("data-camera-error",$.handleCameraError(r))}})}class x5 extends HTMLElement{constructor(){super(),this.templateString=E5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:y5}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const t=document.querySelector("smart-camera-web");t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.inAgentMode?"environment":"user"]}}));const i=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${i} ${i}`,this.imageOutline.style.strokeDashoffset=i,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent=y("selfie.capture.cta.widerSmile"),this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return S(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,$.stopMedia(),yield H0(this,{facingMode:this.facingMode}),this.handleStream($.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),$.stopMedia();const t=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=C5(t);this._data.images=this._data.images.concat(i.map(r=>({image:this._rawImages[r].split(",")[1],image_type_id:Ei.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(t){console.error(t)}}_capturePOLPhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=240,t.height=Math.max(320,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=240,t.width=Math.max(320,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!1),this._rawImages.push(t.toDataURL("image/jpeg",Ht))}_captureReferencePhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=480,t.height=Math.max(640,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=480,t.width=Math.max(640,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!this.disableImageTests);const r=t.toDataURL("image/jpeg",Ht);this._referenceImage=r,this._data.images.push({image:r.split(",")[1],image_type_id:Ei.SELFIE_IMAGE_BASE64})}_publishImages(){const t=nr(Re({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:t}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(t,i=!0,r=this._video){const n=t.getContext("2d");if(n.drawImage(r,0,0,r.videoWidth,r.videoHeight,0,0,t.width,t.height),i){const o=n.getImageData(0,0,t.width,t.height);if(w5(o.data))return n;throw new Error(y("selfie.capture.error.webcamCapture"))}else return n}handleStream(t){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const r=this.shadowRoot.querySelector("video");let n=null;r?n=this.shadowRoot.querySelector("video"):n=document.createElement("video"),n.autoplay=!0,n.playsInline=!0,n.muted=!0,"srcObject"in n?n.srcObject=t:n.src=window.URL.createObjectURL(t),n.onloadedmetadata=()=>{n.play()},this._video=n,this._data.permissionGranted=!0,r||i.prepend(n)}catch(i){this.setAttribute("data-camera-error",$.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),$.stopMedia()}}setUpEventListeners(){var t,i,r;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(t=this.switchCamera)==null||t.addEventListener("click",()=>{this._switchCamera()}),(i=this.navigation)==null||i.addEventListener("navigation.back",()=>{this.handleBackEvents()}),(r=this.navigation)==null||r.addEventListener("navigation.close",()=>{this.closeWindow()}),$.stream?this.handleStream($.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&H0(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){$.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return S(this,null,function*(){var i,r,n,o;if(!this.allowAgentMode)return;(yield $.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(r=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||r.remove("agent-mode"):(o=(n=this.shadowRoot.querySelector("video"))==null?void 0:n.classList)==null||o.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||y("selfie.instructions.title")}get direction(){return this.getAttribute("dir")||ut()||"ltr"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&$.stream&&this.handleStream($.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),$.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",x5);const k5=90*1e3,A5=20*1e3,S5=o=>{var s=o,{timeout:e=k5,"start-countdown":t=!1,"allow-legacy-selfie-fallback":i=!1,hidden:r=!1}=s,n=hl(s,["timeout","start-countdown","allow-legacy-selfie-fallback","hidden"]);const c=(()=>{try{return!!window.parent.Cypress||window.parent.navigator.userAgent.includes("Electron")&&window.parent.__Cypress}catch(C){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,l=ci(r),d=ci(t),u=ci(i),h=u?A5:e,[f,p]=ai(!1),[m,v]=ai(c?100:0),[g,b]=ai(!1),[_,M]=ai(!1),[P,x]=ai(!1);if(Je(()=>{if(f||_||c)return;S(this,null,function*(){M(!0);try{yield N0(),p(!0)}catch(R){console.error("Failed to load Mediapipe:",R)}M(!1)})},[f,_]),Je(()=>{if(l||!d||f)return;const C=setInterval(()=>{v(R=>Math.min(R+1,100))},h/100);return()=>{clearInterval(C)}},[l,d,h,f]),Je(()=>{if(l||f||m<100)return;const R=setTimeout(()=>{const F=document.querySelector("selfie-capture");if(F&&!F.hasAttribute("data-backup-events-setup")){F.setAttribute("data-backup-events-setup","true");const E=j=>{const O=j;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return F.addEventListener("selfie-capture.publish",E),F.addEventListener("selfie-capture.cancelled",E),F.addEventListener("selfie-capture.close",E),()=>{F.removeEventListener("selfie-capture.publish",E),F.removeEventListener("selfie-capture.cancelled",E),F.removeEventListener("selfie-capture.close",E)}}},200);return()=>{clearTimeout(R)}},[l,f,m]),Je(()=>{if(l)return;const C=document.querySelector("smart-camera-web");C==null||C.dispatchEvent(new CustomEvent("metadata.allow-legacy-selfie-fallback",{detail:{allow_legacy_selfie_fallback:u}}))},[l,u]),Je(()=>{if(l||_)return;const C=document.querySelector("smart-camera-web");C==null||C.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:P?"0.0.1":"1.0.0"}}))},[P,l,_]),l)return null;if(g&&f&&!P)return N(tl,Re({},n));if(!g&&f&&!P)return N(tl,Re({},n));if(m>=100){if(u||c){P||x(!0);const R=Re({},n);return delete R.hidden,N("selfie-capture",nr(Re({},R),{ref:F=>{if(F&&!F.hasAttribute("data-events-setup")){F.setAttribute("data-events-setup","true");const E=j=>{const O=j;(O.type==="selfie-capture.publish"||O.type==="selfie-capture.cancelled"||O.type==="selfie-capture.close")&&b(!0),window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};F.addEventListener("selfie-capture.publish",E),F.addEventListener("selfie-capture.cancelled",E),F.addEventListener("selfie-capture.close",E)}}}))}return N("div",{style:{textAlign:"center",marginTop:"20%",padding:"0 20px"},children:N("p",{style:{fontSize:"1.2rem",color:"#333"},children:Xs("selfie.capture.loading.connectionError")})})}return N("div",{style:{textAlign:"center",marginTop:"20%"},children:[N("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:N(df,{size:48,style:{animation:"spin 1s linear infinite"}})}),m>=44?N("p",{children:Xs("selfie.capture.loading.slowConnection")}):N("p",{children:Cu("selfie.capture.loading.progress",{progress:m})}),N("style",{children:`
3768
3768
  @keyframes spin {
3769
3769
  from { transform: rotate(0deg); }
3770
3770
  to { transform: rotate(360deg); }
3771
3771
  }
3772
- `})]})};customElements.get("selfie-capture-wrapper")||l2(A5,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const k5=fr.version,st=document.querySelector("smart-camera-web"),S5=(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 N0 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,st==null||st.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
3773
- ${ut(this.themeColor)}
3772
+ `})]})};customElements.get("selfie-capture-wrapper")||d2(S5,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","allow-legacy-selfie-fallback","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const L5=fr.version,at=document.querySelector("smart-camera-web"),T5=(e,t=0,i=0)=>new Promise((r,n)=>{if(!e||typeof e!="string"){n(new Error("Invalid data URI provided"));return}if(t<0||t>=99||i<0||i>=99){n(new Error("Crop percentages must be between 0 and 99"));return}const o=new Image;o.onload=()=>{try{const s=document.createElement("canvas"),a=s.getContext("2d"),c=o.width,l=o.height,d=c*t/100,u=l*i/100,h=c-d*2,f=l-u*2;s.width=h,s.height=f,a.drawImage(o,d,u,h,f,0,0,h,f);const p=s.toDataURL("image/jpeg",Ht);r(p)}catch(s){n(new Error(`Failed to process image: ${s.message}`))}},o.onerror=()=>{n(new Error("Failed to load image from data URI"))},o.src=e});class U0 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,at==null||at.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
3773
+ ${dt(this.themeColor)}
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
- <selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
3776
+ <selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} ${this.allowLegacySelfieFallback} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
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:k5}},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(){R.stopMedia(),st==null||st.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*(){st==null||st.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*(){R.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(R.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>S(this,null,function*(){R.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),r=n=>S(this,null,function*(){st==null||st.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield S5(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,R.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 themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",N0);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 tl{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 tl(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 L5{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 T5(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 M5=class hl extends L5{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?T5(hl.prototype._strokeUpdate,this.throttle):hl.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=tl.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/ul(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)})}};yi($t,"memoryLimit",2048e3),yi($t,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let il=$t;class H0 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3779
+ `,this._data={images:[],meta:{libraryVersion:L5}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){$.stopMedia(),at==null||at.dispatchEvent(new CustomEvent("metadata.cleanup")),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:t,handler:i})=>{window.removeEventListener(t,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>S(this,null,function*(){this.setActiveScreen(this.selfieCapture)})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>S(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>S(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return S(this,null,function*(){$.stopMedia(),this._remountKey++;const t=this.querySelector("div"),i=this.selfieCapture;if(i&&t){const r=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(s=>{r.setAttribute(s.name,s.value)}),i.remove(),yield new Promise(s=>{setTimeout(s,50)}),r.setAttribute("key",this._remountKey.toString()),r.setAttribute("start-countdown","false"),r.setAttribute("hidden","");const o=t.querySelector("selfie-capture-review");o?t.insertBefore(r,o):t.appendChild(r),this.selfieCapture=r,this.setupSelfieWrapperEventListeners()}return new Promise(r=>{setTimeout(()=>{r()},200)})})}setActiveScreen(t){var i;this.activeScreen!==t&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t,t===this.selfieCapture?t.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:n,handler:o})=>{window.removeEventListener(n,o)});const t=()=>S(this,null,function*(){if($.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>S(this,null,function*(){$.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),r=n=>S(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield T5(n.detail.referenceImage,20,20));const o=n.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",o?"true":"false"),this._data.images=n.detail.images,$.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:t},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:r}],this._selfieWrapperListeners.forEach(({event:n,handler:o})=>{window.addEventListener(n,o)}),this.addEventListener("selfie-capture.publish",r)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get allowLegacySelfieFallback(){return this.hasAttribute("allow-legacy-selfie-fallback")?`allow-legacy-selfie-fallback='${this.getAttribute("allow-legacy-selfie-fallback")}'`:""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","allow-legacy-selfie-fallback","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"allow-legacy-selfie-fallback":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",U0);class to{constructor(t,i,r,n){if(isNaN(t)||isNaN(i))throw new Error(`Point is invalid: (${t}, ${i})`);this.x=+t,this.y=+i,this.pressure=r||0,this.time=n||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class il{static fromPoints(t,i){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,n=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new il(t[1],r,n,t[2],i.start,i.end)}static calculateControlPoints(t,i,r){const n=t.x-i.x,o=t.y-i.y,s=i.x-r.x,a=i.y-r.y,c={x:(t.x+i.x)/2,y:(t.y+i.y)/2},l={x:(i.x+r.x)/2,y:(i.y+r.y)/2},d=Math.sqrt(n*n+o*o),u=Math.sqrt(s*s+a*a),h=c.x-l.x,f=c.y-l.y,p=d+u==0?0:u/(d+u),m={x:l.x+h*p,y:l.y+f*p},v=i.x-m.x,g=i.y-m.y;return{c1:new to(c.x+v,c.y+g),c2:new to(l.x+v,l.y+g)}}constructor(t,i,r,n,o,s){this.startPoint=t,this.control2=i,this.control1=r,this.endPoint=n,this.startWidth=o,this.endWidth=s}length(){let i=0,r,n;for(let o=0;o<=10;o+=1){const s=o/10,a=this.point(s,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(s,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){const l=a-r,d=c-n;i+=Math.sqrt(l*l+d*d)}r=a,n=c}return i}point(t,i,r,n,o){return i*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*n*(1-t)*t*t+o*t*t*t}}class M5{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,i,r){this._et.addEventListener(t,i,r)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,i,r){this._et.removeEventListener(t,i,r)}}function I5(e,t=250){let i=0,r=null,n,o,s;const a=()=>{i=Date.now(),r=null,n=e.apply(o,s),r||(o=null,s=[])};return function(...l){const d=Date.now(),u=t-(d-i);return o=this,s=l,u<=0||u>t?(r&&(clearTimeout(r),r=null),i=d,n=e.apply(o,s),r||(o=null,s=[])):r||(r=window.setTimeout(a,u)),n}}let F5=class fl extends M5{constructor(t,i={}){var r,n,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(r=i.throttle)!==null&&r!==void 0?r:16,this.minDistance=(n=i.minDistance)!==null&&n!==void 0?n:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(o=i.canvasContextOptions)!==null&&o!==void 0?o:{},this._strokeMoveUpdate=this.throttle?I5(fl.prototype._strokeUpdate,this.throttle):fl.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:i}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,i.width,i.height),t.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,i={}){return new Promise((r,n)=>{const o=new Image,s=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/s,c=i.height||this.canvas.height/s,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,l,d,a,c),r()},o.onerror=u=>{n(u)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}toDataURL(t="image/png",i){switch(t){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(t,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const i=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:i=!0}={}){i&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,i){return i?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const i=t.changedTouches[0];return{event:t,type:t.type,x:i.clientX,y:i.clientY,pressure:i.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,i=!1){return typeof this._strokePointerId=="undefined"?i:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const n=this._getPointGroupOptions(),o=Object.assign(Object.assign({},n),{points:[]});this._data.push(o),this._reset(n),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const i=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],n=r.points,o=n.length>0&&n[n.length-1],s=o?i.distanceTo(o)<=this.minDistance:!1,a=this._getPointGroupOptions(r);if(!o||!(o&&s)){const c=this._addPoint(i,a);o?c&&this._drawCurve(c,a):this._drawDot(i,a),n.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,i,r){const n=this.canvas.getBoundingClientRect();return new to(t-n.left,i-n.top,r,new Date().getTime())}_addPoint(t,i){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const n=this._calculateCurveWidths(r[1],r[2],i),o=il.fromPoints(r,n);return r.shift(),o}return null}_calculateCurveWidths(t,i,r){const n=r.velocityFilterWeight*i.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(n,r),s={end:o,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=o,s}_strokeWidth(t,i){return Math.max(i.maxWidth/(t+1),i.minWidth)}_drawCurveSegment(t,i,r){const n=this._ctx;n.moveTo(t,i),n.arc(t,i,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,i){const r=this._ctx,n=t.endWidth-t.startWidth,o=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=i.penColor;for(let s=0;s<o;s+=1){const a=s/o,c=a*a,l=c*a,d=1-a,u=d*d,h=u*d;let f=h*t.startPoint.x;f+=3*u*a*t.control1.x,f+=3*d*c*t.control2.x,f+=l*t.endPoint.x;let p=h*t.startPoint.y;p+=3*u*a*t.control1.y,p+=3*d*c*t.control2.y,p+=l*t.endPoint.y;const m=Math.min(t.startWidth+l*n,i.maxWidth);this._drawCurveSegment(f,p,m)}r.closePath(),r.fill()}_drawDot(t,i){const r=this._ctx,n=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,n),r.closePath(),r.fillStyle=i.penColor,r.fill()}_fromData(t,i,r){for(const n of t){const{points:o}=n,s=this._getPointGroupOptions(n);if(o.length>1)for(let a=0;a<o.length;a+=1){const c=o[a],l=new to(c.x,c.y,c.pressure,c.time);a===0&&this._reset(s);const d=this._addPoint(l,s);d&&i(d,s)}else this._reset(s),r(o[0],s)}}toSVG({includeBackgroundColor:t=!1}={}){const i=this._data,r=Math.max(window.devicePixelRatio||1,1),n=0,o=0,s=this.canvas.width/r,a=this.canvas.height/r,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${n} ${o} ${s} ${a}`),c.setAttribute("width",s.toString()),c.setAttribute("height",a.toString()),t&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const u=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const h=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;u.setAttribute("d",h),u.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),u.setAttribute("stroke",d),u.setAttribute("fill","none"),u.setAttribute("stroke-linecap","round"),c.appendChild(u)}},(l,{penColor:d,dotSize:u,minWidth:h,maxWidth:f})=>{const p=document.createElement("circle"),m=u>0?u:(h+f)/2;p.setAttribute("r",m.toString()),p.setAttribute("cx",l.x.toString()),p.setAttribute("cy",l.y.toString()),p.setAttribute("fill",d),c.appendChild(p)}),c.outerHTML}};const $t=class $t{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),n=t/dl(1024,r);return r===0?`${t} bytes`:`${n.toFixed(0)} ${i[r]}`}static getData(t){return new Promise((i,r)=>{const n=new FileReader;n.onload=o=>{i(o.target.result)},n.onerror=()=>{r(new Error("An error occurred reading the file. Please check the file, and try again"))},n.readAsDataURL(t)})}static retrieve(t){return S(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!$t.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>$t.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${$t.getHumanSize($t.memoryLimit)}.`);return yield $t.getData(i)})}};_i($t,"memoryLimit",2048e3),_i($t,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let rl=$t;class q0 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3780
3780
  :host {
3781
3781
  display: block;
3782
3782
  block-size: auto;
@@ -3957,8 +3957,8 @@ 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 M5(s),this.errorMessage=n.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=o.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=f.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",m=>this.uploadSignature(m)),this.publishSignatureButton=p.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",t=>this.uploadSignature(t))}resizeCanvas(){const t=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);t.width=(t.offsetWidth||t.width)*i,t.height=(t.offsetHeight||t.height)*i,t.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const t=this.shadowRoot.querySelector("img");let i=t?t.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(t){this.handleError(t.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(t){this.errorMessage.textContent=t}clearSignature(){this.resetErrorMessage();const t=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),t.removeAttribute("hidden")),this.core.clear()}previewUpload(t){const i=this.shadowRoot.querySelector("canvas");let r=this.shadowRoot.querySelector("img");r||(r=document.createElement("img")),r.src=t,r.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",r)}uploadSignature(t){return S(this,null,function*(){try{this.resetErrorMessage();const{files:i}=t.target,r=yield il.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",H0);function I5(){return`
3961
- ${ut(this.themeColor)}
3960
+ `,r.appendChild(n),r.appendChild(o),r.appendChild(s),this.allowUpload&&r.appendChild(f),r.appendChild(p),t.appendChild(i),t.appendChild(r),this.core=new F5(s),this.errorMessage=n.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=o.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=f.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",m=>this.uploadSignature(m)),this.publishSignatureButton=p.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",t=>this.uploadSignature(t))}resizeCanvas(){const t=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);t.width=(t.offsetWidth||t.width)*i,t.height=(t.offsetHeight||t.height)*i,t.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const t=this.shadowRoot.querySelector("img");let i=t?t.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(t){this.handleError(t.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(t){this.errorMessage.textContent=t}clearSignature(){this.resetErrorMessage();const t=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),t.removeAttribute("hidden")),this.core.clear()}previewUpload(t){const i=this.shadowRoot.querySelector("canvas");let r=this.shadowRoot.querySelector("img");r||(r=document.createElement("img")),r.src=t,r.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",r)}uploadSignature(t){return S(this,null,function*(){try{this.resetErrorMessage();const{files:i}=t.target,r=yield rl.retrieve(i);this.previewUpload(r)}catch(i){this.handleError(i.message)}})}get allowUpload(){return this.hasAttribute("allow-upload")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}"customElements"in window&&!window.customElements.get("smileid-signature-pad")&&window.customElements.define("smileid-signature-pad",q0);function B5(){return`
3961
+ ${dt(this.themeColor)}
3962
3962
  <style>
3963
3963
  .camera-permission-screen {
3964
3964
  display: flex;
@@ -3984,7 +3984,7 @@ button:disabled {
3984
3984
  }
3985
3985
  </style>
3986
3986
  <div class='camera-permission-screen flow center' dir='${this.direction}'>
3987
- <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
3987
+ ${this.showNavigation?`<smileid-navigation theme-color='${this.themeColor}' ${this.hideBack?"hide-back":""}></smileid-navigation>`:""}
3988
3988
  <div class='flow center'>
3989
3989
  <p class='color-red | center' id='error'>
3990
3990
  </p>
@@ -4032,21 +4032,21 @@ button:disabled {
4032
4032
  </div>
4033
4033
  </div>
4034
4034
  </div>
4035
- `}class F5 extends HTMLElement{connectedCallback(){this.templateString=I5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const t=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");t.textContent="",i.addEventListener("click",()=>S(this,null,function*(){i.setAttribute("disabled",!0);try{yield R.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=R.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")||lt()||"ltr"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",F5);const B5=fr.version;function D5(){return`
4035
+ `}class D5 extends HTMLElement{connectedCallback(){this.templateString=B5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const t=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");t.textContent="",i.addEventListener("click",()=>S(this,null,function*(){i.setAttribute("disabled",!0);try{yield $.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(r){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:r})),t.textContent=$.handleCameraError(r)}i.removeAttribute("disabled")}))}get showNavigation(){return this.hasAttribute("show-navigation")}get hideAttribution(){return this.hasAttribute("hide-attribution")}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get direction(){return this.getAttribute("dir")||ut()||"ltr"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",D5);const R5=fr.version;function O5(){return`
4036
4036
  <style>
4037
4037
  :host {
4038
4038
  display: block;
4039
4039
  height: 100%;
4040
4040
  }
4041
4041
  </style>
4042
- ${ut(this.themeColor)}
4042
+ ${dt(this.themeColor)}
4043
4043
  <div style="height: 100%;">
4044
4044
  <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}></camera-permission>
4045
4045
  <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
4046
- ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
4046
+ ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.allowLegacySelfieFallback}
4047
4047
  ></selfie-capture-screens>
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 U0 extends HTMLElement{constructor(){super(),this.scwTemplateString=D5.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:B5}},"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(){R.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","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"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 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",U0),D.DocumentCaptureScreens=Su,D.EndUserConsent=Mu,D.List=xu,D.Navigation=ku,D.Option=Au,D.Root=Cu,D.SelfieCaptureScreens=N0,D.SignaturePad=H0,D.SmartCameraWeb=U0,D.TotpConsent=Tu,D.Trigger=Eu,D.deepMerge=gu,D.escapeHtml=hr,D.getCurrentLocale=y4,D.getDefaultLocale=_4,D.getDirection=lt,D.hasLocale=w4,D.loadLocale=yu,D.registerLocale=Wr,D.registerLocaleUrl=bu,D.setCurrentLocale=b4,D.setDocumentDir=C4,D.t=y,D.tHtml=Nt,D.translate=m4,D.translateHtml=v4,D.validateLocale=_u,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),D}({});
4051
+ `}class V0 extends HTMLElement{constructor(){super(),this.scwTemplateString=O5.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:R5}},"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?this.setUpEventListeners():this.shadowRoot.innerHTML='<h1 class="error-message">Your browser does not support this integration</h1>'}disconnectedCallback(){$.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","allow-legacy-selfie-fallback","disable-image-tests","document-capture-modes","document-type","hide-attribution","hide-back-of-id","hide-back-to-host","show-navigation","theme-color"]}attributeChangedCallback(t){switch(t){case"allow-agent-mode":case"allow-legacy-selfie-fallback":case"disable-image-tests":case"document-capture-modes":case"document-type":case"hide-attribution":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":case"theme-color":this.disconnectedCallback(),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.cameraPermission=this.shadowRoot.querySelector("camera-permission"),this.SelfieCaptureScreens=this.shadowRoot.querySelector("selfie-capture-screens"),this.documentCapture=this.shadowRoot.querySelector("document-capture-screens"),this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.setActiveScreen(this.SelfieCaptureScreens),this.cameraPermission.addEventListener("camera-permission.granted",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.publish",t=>{this._data.images=t.detail.images,this.captureId?this.setActiveScreen(this.documentCapture):this._publishSelectedImages()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.cancelled",()=>{this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.handleBackEvents()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.back",()=>{this.hideInstructions||this.setActiveScreen(this.cameraPermission)}),this.documentCapture.addEventListener("document-capture-screens.publish",t=>{this._data.images=[...this._data.images,...t.detail.images],this._publishSelectedImages()}),this.documentCapture.addEventListener("document-capture-screens.cancelled",()=>{this.SelfieCaptureScreens.setAttribute("initial-screen","selfie-capture"),this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),[this.cameraPermission,this.SelfieCaptureScreens,this.documentCapture].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvent())}),this.documentCapture.addEventListener("document-capture-screens.back",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.reset()})}reset(){this.disconnectedCallback(),this.connectedCallback()}handleBackEvents(){this.dispatchEvent(new CustomEvent("smart-camera-web.cancelled"))}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("smart-camera-web.publish",{detail:this._data}))}get captureId(){return this.hasAttribute("capture-id")}get documentType(){return this.getAttribute("document-type")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get hideInstructions(){return this.hasAttribute("hide-instructions")?"hide-instructions":""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")?"hide-back-of-id":""}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get hideBackToHost(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?"hide-back":""}get allowAgentMode(){return this.hasAttribute("allow-agent-mode")?`allow-agent-mode=${this.getAttribute("allow-agent-mode")}`:""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?"show-agent-mode-for-tests":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?"disable-image-tests":""}get allowLegacySelfieFallback(){return this.hasAttribute("allow-legacy-selfie-fallback")?`allow-legacy-selfie-fallback='${this.getAttribute("allow-legacy-selfie-fallback")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get hasThemeColor(){return this.hasAttribute("theme-color")&&![null,void 0,"null","undefined"].includes(this.getAttribute("theme-color"))}get themeColor(){return this.hasThemeColor?this.getAttribute("theme-color"):"#001096"}get applyComponentThemeColor(){return this.hasThemeColor?`theme-color='${this.themeColor}'`:""}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}handleCloseEvent(){this.dispatchEvent(new CustomEvent("smart-camera-web.close"))}}return"customElements"in window&&!customElements.get("smart-camera-web")&&customElements.define("smart-camera-web",V0),B.DocumentCaptureScreens=Tu,B.EndUserConsent=Fu,B.List=Au,B.Navigation=Lu,B.Option=Su,B.Root=xu,B.SelfieCaptureScreens=U0,B.SignaturePad=q0,B.SmartCameraWeb=V0,B.TotpConsent=Iu,B.Trigger=ku,B.deepMerge=vu,B.escapeHtml=hr,B.getCurrentLocale=y4,B.getDefaultLocale=_4,B.getDirection=ut,B.hasLocale=w4,B.loadLocale=_u,B.registerLocale=Wr,B.registerLocaleUrl=yu,B.setCurrentLocale=b4,B.setDocumentDir=C4,B.t=y,B.tHtml=Nt,B.translate=Xs,B.translateHtml=Cu,B.validateLocale=wu,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),B}({});
4052
4052
  //# sourceMappingURL=smart-camera-web.js.map