@incodetech/welcome 1.75.2-rc.20241029001543 → 1.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/onBoarding.mjs +2 -2
- package/dist/onBoarding.umd.js +2 -2
- package/package.json +1 -1
package/dist/onBoarding.mjs
CHANGED
|
@@ -3314,7 +3314,7 @@ class OnboardingAnalytics {
|
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
3316
|
const OnboardingAnalytics$1 = OnboardingAnalytics.getInstance();
|
|
3317
|
-
var define_import_meta_env_default = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, PACKAGE_VERSION: "1.75.2
|
|
3317
|
+
var define_import_meta_env_default = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, PACKAGE_VERSION: "1.75.2" };
|
|
3318
3318
|
class DetectionSetup {
|
|
3319
3319
|
constructor() {
|
|
3320
3320
|
this.setupDetectPromise = null, this.isSetupDetect = !1, this.pipelinesBundle = null, this.profiles = null;
|
|
@@ -52589,7 +52589,7 @@ function renderUserConsent(me, {
|
|
|
52589
52589
|
Xe
|
|
52590
52590
|
);
|
|
52591
52591
|
}
|
|
52592
|
-
const version$1 = "1.75.2
|
|
52592
|
+
const version$1 = "1.75.2";
|
|
52593
52593
|
function r$1(me) {
|
|
52594
52594
|
for (var ue = "", Qe = 0; Qe < me.length; ++Qe) if (Qe > 0) {
|
|
52595
52595
|
var Ue = me[Qe].toLowerCase();
|
package/dist/onBoarding.umd.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* LICENSE.md file in the root directory of this source tree.
|
|
9
9
|
*
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/const DataRouterContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(DataRouterContext.displayName="DataRouter");const DataRouterStateContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(DataRouterStateContext.displayName="DataRouterState");const AwaitContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(AwaitContext.displayName="Await");const NavigationContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(NavigationContext.displayName="Navigation");const LocationContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(LocationContext.displayName="Location");const RouteContext=React__namespace.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(RouteContext.displayName="Route");const RouteErrorContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(RouteErrorContext.displayName="RouteError");function useParams(){let{matches:me}=React__namespace.useContext(RouteContext),ue=me[me.length-1];return ue?ue.params:{}}new Promise(()=>{});var uaParser={exports:{}};(function(me,ue){(function(Qe,Ue){var He="1.0.37",Ge="",Xe="?",Ke="function",$e="undefined",Je="object",Ze="string",nt="major",tt="model",et="name",rt="type",it="vendor",ot="version",at="architecture",st="console",ut="mobile",lt="tablet",dt="smarttv",At="wearable",pt="embedded",gt=500,wt="Amazon",Bt="Apple",Tt="ASUS",yt="BlackBerry",Ct="Browser",ht="Chrome",It="Edge",vt="Firefox",Et="Google",bt="Huawei",Rt="LG",St="Microsoft",kt="Motorola",jt="Opera",Pt="Samsung",Qt="Sharp",qt="Sony",_t="Xiaomi",Yt="Zebra",Xt="Facebook",Ut="Chromium OS",Lt="Mac OS",Ot=function(Jt,an){var cn={};for(var dn in Jt)an[dn]&&an[dn].length%2===0?cn[dn]=an[dn].concat(Jt[dn]):cn[dn]=Jt[dn];return cn},ft=function(Jt){for(var an={},cn=0;cn<Jt.length;cn++)an[Jt[cn].toUpperCase()]=Jt[cn];return an},Dt=function(Jt,an){return typeof Jt===Ze?Mt(an).indexOf(Mt(Jt))!==-1:!1},Mt=function(Jt){return Jt.toLowerCase()},Ft=function(Jt){return typeof Jt===Ze?Jt.replace(/[^\d\.]/g,Ge).split(".")[0]:Ue},Gt=function(Jt,an){if(typeof Jt===Ze)return Jt=Jt.replace(/^\s\s*/,Ge),typeof an===$e?Jt:Jt.substring(0,gt)},zt=function(Jt,an){for(var cn=0,dn,yn,Nn,Rn,rn,ln;cn<an.length&&!rn;){var pn=an[cn],Sn=an[cn+1];for(dn=yn=0;dn<pn.length&&!rn&&pn[dn];)if(rn=pn[dn++].exec(Jt),rn)for(Nn=0;Nn<Sn.length;Nn++)ln=rn[++yn],Rn=Sn[Nn],typeof Rn===Je&&Rn.length>0?Rn.length===2?typeof Rn[1]==Ke?this[Rn[0]]=Rn[1].call(this,ln):this[Rn[0]]=Rn[1]:Rn.length===3?typeof Rn[1]===Ke&&!(Rn[1].exec&&Rn[1].test)?this[Rn[0]]=ln?Rn[1].call(this,ln,Rn[2]):Ue:this[Rn[0]]=ln?ln.replace(Rn[1],Rn[2]):Ue:Rn.length===4&&(this[Rn[0]]=ln?Rn[3].call(this,ln.replace(Rn[1],Rn[2])):Ue):this[Rn]=ln||Ue;cn+=2}},$t=function(Jt,an){for(var cn in an)if(typeof an[cn]===Je&&an[cn].length>0){for(var dn=0;dn<an[cn].length;dn++)if(Dt(an[cn][dn],Jt))return cn===Xe?Ue:cn}else if(Dt(an[cn],Jt))return cn===Xe?Ue:cn;return Jt},Ht={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},hn={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},un={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[ot,[et,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[ot,[et,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[et,ot],[/opios[\/ ]+([\w\.]+)/i],[ot,[et,jt+" Mini"]],[/\bopr\/([\w\.]+)/i],[ot,[et,jt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[ot,[et,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[et,ot],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[ot,[et,"UC"+Ct]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[ot,[et,"WeChat"]],[/konqueror\/([\w\.]+)/i],[ot,[et,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[ot,[et,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[ot,[et,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[ot,[et,"Smart Lenovo "+Ct]],[/(avast|avg)\/([\w\.]+)/i],[[et,/(.+)/,"$1 Secure "+Ct],ot],[/\bfocus\/([\w\.]+)/i],[ot,[et,vt+" Focus"]],[/\bopt\/([\w\.]+)/i],[ot,[et,jt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[ot,[et,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[ot,[et,"Dolphin"]],[/coast\/([\w\.]+)/i],[ot,[et,jt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[ot,[et,"MIUI "+Ct]],[/fxios\/([-\w\.]+)/i],[ot,[et,vt]],[/\bqihu|(qi?ho?o?|360)browser/i],[[et,"360 "+Ct]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[et,/(.+)/,"$1 "+Ct],ot],[/samsungbrowser\/([\w\.]+)/i],[ot,[et,Pt+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[et,/_/g," "],ot],[/metasr[\/ ]?([\d\.]+)/i],[ot,[et,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[et,"Sogou Mobile"],ot],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[et,ot],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[et],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[et,Xt],ot],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[et,ot],[/\bgsa\/([\w\.]+) .*safari\//i],[ot,[et,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[ot,[et,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[ot,[et,ht+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[et,ht+" WebView"],ot],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[ot,[et,"Android "+Ct]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[et,ot],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[ot,[et,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[ot,et],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[et,[ot,$t,Ht]],[/(webkit|khtml)\/([\w\.]+)/i],[et,ot],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[et,"Netscape"],ot],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[ot,[et,vt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[et,ot],[/(cobalt)\/([\w\.]+)/i],[et,[ot,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[at,"amd64"]],[/(ia32(?=;))/i],[[at,Mt]],[/((?:i[346]|x)86)[;\)]/i],[[at,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[at,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[at,"armhf"]],[/windows (ce|mobile); ppc;/i],[[at,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[at,/ower/,Ge,Mt]],[/(sun4\w)[;\)]/i],[[at,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[at,Mt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[tt,[it,Pt],[rt,lt]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[tt,[it,Pt],[rt,ut]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[tt,[it,Bt],[rt,ut]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[tt,[it,Bt],[rt,lt]],[/(macintosh);/i],[tt,[it,Bt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[tt,[it,Qt],[rt,ut]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[tt,[it,bt],[rt,lt]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[tt,[it,bt],[rt,ut]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[tt,/_/g," "],[it,_t],[rt,ut]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[tt,/_/g," "],[it,_t],[rt,lt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[tt,[it,"OPPO"],[rt,ut]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[tt,[it,"Vivo"],[rt,ut]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[tt,[it,"Realme"],[rt,ut]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[tt,[it,kt],[rt,ut]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[tt,[it,kt],[rt,lt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[tt,[it,Rt],[rt,lt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[tt,[it,Rt],[rt,ut]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[tt,[it,"Lenovo"],[rt,lt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[tt,/_/g," "],[it,"Nokia"],[rt,ut]],[/(pixel c)\b/i],[tt,[it,Et],[rt,lt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[tt,[it,Et],[rt,ut]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[tt,[it,qt],[rt,ut]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[tt,"Xperia Tablet"],[it,qt],[rt,lt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[tt,[it,"OnePlus"],[rt,ut]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[tt,[it,wt],[rt,lt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[tt,/(.+)/g,"Fire Phone $1"],[it,wt],[rt,ut]],[/(playbook);[-\w\),; ]+(rim)/i],[tt,it,[rt,lt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[tt,[it,yt],[rt,ut]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[tt,[it,Tt],[rt,lt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[tt,[it,Tt],[rt,ut]],[/(nexus 9)/i],[tt,[it,"HTC"],[rt,lt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[it,[tt,/_/g," "],[rt,ut]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[tt,[it,"Acer"],[rt,lt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[tt,[it,"Meizu"],[rt,ut]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[tt,[it,"Ulefone"],[rt,ut]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[it,tt,[rt,ut]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[it,tt,[rt,lt]],[/(surface duo)/i],[tt,[it,St],[rt,lt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[tt,[it,"Fairphone"],[rt,ut]],[/(u304aa)/i],[tt,[it,"AT&T"],[rt,ut]],[/\bsie-(\w*)/i],[tt,[it,"Siemens"],[rt,ut]],[/\b(rct\w+) b/i],[tt,[it,"RCA"],[rt,lt]],[/\b(venue[\d ]{2,7}) b/i],[tt,[it,"Dell"],[rt,lt]],[/\b(q(?:mv|ta)\w+) b/i],[tt,[it,"Verizon"],[rt,lt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[tt,[it,"Barnes & Noble"],[rt,lt]],[/\b(tm\d{3}\w+) b/i],[tt,[it,"NuVision"],[rt,lt]],[/\b(k88) b/i],[tt,[it,"ZTE"],[rt,lt]],[/\b(nx\d{3}j) b/i],[tt,[it,"ZTE"],[rt,ut]],[/\b(gen\d{3}) b.+49h/i],[tt,[it,"Swiss"],[rt,ut]],[/\b(zur\d{3}) b/i],[tt,[it,"Swiss"],[rt,lt]],[/\b((zeki)?tb.*\b) b/i],[tt,[it,"Zeki"],[rt,lt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[it,"Dragon Touch"],tt,[rt,lt]],[/\b(ns-?\w{0,9}) b/i],[tt,[it,"Insignia"],[rt,lt]],[/\b((nxa|next)-?\w{0,9}) b/i],[tt,[it,"NextBook"],[rt,lt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[it,"Voice"],tt,[rt,ut]],[/\b(lvtel\-)?(v1[12]) b/i],[[it,"LvTel"],tt,[rt,ut]],[/\b(ph-1) /i],[tt,[it,"Essential"],[rt,ut]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[tt,[it,"Envizen"],[rt,lt]],[/\b(trio[-\w\. ]+) b/i],[tt,[it,"MachSpeed"],[rt,lt]],[/\btu_(1491) b/i],[tt,[it,"Rotor"],[rt,lt]],[/(shield[\w ]+) b/i],[tt,[it,"Nvidia"],[rt,lt]],[/(sprint) (\w+)/i],[it,tt,[rt,ut]],[/(kin\.[onetw]{3})/i],[[tt,/\./g," "],[it,St],[rt,ut]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[tt,[it,Yt],[rt,lt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[tt,[it,Yt],[rt,ut]],[/smart-tv.+(samsung)/i],[it,[rt,dt]],[/hbbtv.+maple;(\d+)/i],[[tt,/^/,"SmartTV"],[it,Pt],[rt,dt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[it,Rt],[rt,dt]],[/(apple) ?tv/i],[it,[tt,Bt+" TV"],[rt,dt]],[/crkey/i],[[tt,ht+"cast"],[it,Et],[rt,dt]],[/droid.+aft(\w+)( bui|\))/i],[tt,[it,wt],[rt,dt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[tt,[it,Qt],[rt,dt]],[/(bravia[\w ]+)( bui|\))/i],[tt,[it,qt],[rt,dt]],[/(mitv-\w{5}) bui/i],[tt,[it,_t],[rt,dt]],[/Hbbtv.*(technisat) (.*);/i],[it,tt,[rt,dt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[it,Gt],[tt,Gt],[rt,dt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[rt,dt]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[it,tt,[rt,st]],[/droid.+; (shield) bui/i],[tt,[it,"Nvidia"],[rt,st]],[/(playstation [345portablevi]+)/i],[tt,[it,qt],[rt,st]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[tt,[it,St],[rt,st]],[/((pebble))app/i],[it,tt,[rt,At]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[tt,[it,Bt],[rt,At]],[/droid.+; (glass) \d/i],[tt,[it,Et],[rt,At]],[/droid.+; (wt63?0{2,3})\)/i],[tt,[it,Yt],[rt,At]],[/(quest( 2| pro)?)/i],[tt,[it,Xt],[rt,At]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[it,[rt,pt]],[/(aeobc)\b/i],[tt,[it,wt],[rt,pt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[tt,[rt,ut]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[tt,[rt,lt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[rt,lt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[rt,ut]],[/(android[-\w\. ]{0,9});.+buil/i],[tt,[it,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[ot,[et,It+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[ot,[et,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[et,ot],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[ot,et]],os:[[/microsoft (windows) (vista|xp)/i],[et,ot],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[et,[ot,$t,hn]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[ot,$t,hn],[et,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[ot,/_/g,"."],[et,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[et,Lt],[ot,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[ot,et],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[et,ot],[/\(bb(10);/i],[ot,[et,yt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[ot,[et,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[ot,[et,vt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[ot,[et,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[ot,[et,"watchOS"]],[/crkey\/([\d\.]+)/i],[ot,[et,ht+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[et,Ut],ot],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[et,ot],[/(sunos) ?([\w\.\d]*)/i],[[et,"Solaris"],ot],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[et,ot]]},An=function(Jt,an){if(typeof Jt===Je&&(an=Jt,Jt=Ue),!(this instanceof An))return new An(Jt,an).getResult();var cn=typeof Qe!==$e&&Qe.navigator?Qe.navigator:Ue,dn=Jt||(cn&&cn.userAgent?cn.userAgent:Ge),yn=cn&&cn.userAgentData?cn.userAgentData:Ue,Nn=an?Ot(un,an):un,Rn=cn&&cn.userAgent==dn;return this.getBrowser=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.browser),rn[nt]=Ft(rn[ot]),Rn&&cn&&cn.brave&&typeof cn.brave.isBrave==Ke&&(rn[et]="Brave"),rn},this.getCPU=function(){var rn={};return rn[at]=Ue,zt.call(rn,dn,Nn.cpu),rn},this.getDevice=function(){var rn={};return rn[it]=Ue,rn[tt]=Ue,rn[rt]=Ue,zt.call(rn,dn,Nn.device),Rn&&!rn[rt]&&yn&&yn.mobile&&(rn[rt]=ut),Rn&&rn[tt]=="Macintosh"&&cn&&typeof cn.standalone!==$e&&cn.maxTouchPoints&&cn.maxTouchPoints>2&&(rn[tt]="iPad",rn[rt]=lt),rn},this.getEngine=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.engine),rn},this.getOS=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.os),Rn&&!rn[et]&&yn&&yn.platform!="Unknown"&&(rn[et]=yn.platform.replace(/chrome os/i,Ut).replace(/macos/i,Lt)),rn},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return dn},this.setUA=function(rn){return dn=typeof rn===Ze&&rn.length>gt?Gt(rn,gt):rn,this},this.setUA(dn),this};An.VERSION=He,An.BROWSER=ft([et,ot,nt]),An.CPU=ft([at]),An.DEVICE=ft([tt,it,rt,st,ut,dt,lt,At,pt]),An.ENGINE=An.OS=ft([et,ot]),me.exports&&(ue=me.exports=An),ue.UAParser=An;var mn=typeof Qe!==$e&&(Qe.jQuery||Qe.Zepto);if(mn&&!mn.ua){var En=new An;mn.ua=En.getResult(),mn.ua.get=function(){return En.getUA()},mn.ua.set=function(Jt){En.setUA(Jt);var an=En.getResult();for(var cn in an)mn.ua[cn]=an[cn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);let uxType=null;const setUxType=me=>{if(me==="desktop"||me==="mobile"||me===null)uxType=me;else throw new Error("Invalid value for uxType. Accepted values are 'desktop', 'mobile', or null.")},getUxType=()=>uxType,parser$1=new UAParser,uaResult=parser$1.getResult(),isTouchDevice=()=>navigator.maxTouchPoints>0||"ontouchstart"in document.documentElement,isTabletWithoutAndroid=()=>!uaResult.device.type&&uaResult.os.name==="Linux"&&uaResult.browser.name==="Chrome"&&isTouchDevice(),mobile={Android:()=>uaResult.os.name==="Android",iOS:()=>["iOS","iPadOS"].includes(uaResult.os.name||""),isIpad:()=>uaResult.device.model==="iPad",isFBInAppBrowser:()=>/\[FB/.test(uaResult.ua),isInstagramAppBrowser:()=>/Instagram/.test(uaResult.ua),any:()=>uxType?uxType==="mobile":!!(uaResult.device.type==="mobile"||uaResult.device.type==="tablet"||isTabletWithoutAndroid()),isDesktop:()=>uxType?uxType==="desktop":!mobile.any(),isAppleDevice:()=>["iOS","Mac OS","iPadOS"].includes(uaResult.os.name||""),isBrowserSupported:()=>{const{browser:me,os:ue}=uaResult;return ue.name==="iOS"||ue.name==="iPadOS"?["Mobile Safari","Chrome"].includes(me.name||""):ue.name==="Mac OS"?["Safari","Chrome"].includes(me.name||""):me.name==="Chrome"}},browserName=uaResult.browser.name,desktop={isEdge:()=>browserName==="Edge",isChrome:()=>["Chrome","Chrome WebView","Chrome Headless"].includes(browserName),isFirefox:()=>["Firefox","Firefox Focus","Firefox Reality"].includes(browserName),isOpera:()=>["Opera","Opera Mini","Opera Touch"].includes(browserName),isSafari:()=>["Safari","Mobile Safari"].includes(browserName)},getHasLiedBrowser=()=>{let me=navigator.userAgent.toLowerCase(),ue=navigator.productSub,Qe;if(me.indexOf("edge/")>=0||me.indexOf("iemobile/")>=0)return!1;if(me.indexOf("opera mini")>=0)return!1;if(me.indexOf("firefox/")>=0?Qe="Firefox":me.indexOf("opera/")>=0||me.indexOf(" opr/")>=0?Qe="Opera":me.indexOf("chrome/")>=0?Qe="Chrome":me.indexOf("safari/")>=0?me.indexOf("android 1.")>=0||me.indexOf("android 2.")>=0||me.indexOf("android 3.")>=0||me.indexOf("android 4.")>=0?Qe="AOSP":Qe="Safari":me.indexOf("trident/")>=0?Qe="Internet Explorer":Qe="Other",(Qe==="Chrome"||Qe==="Safari"||Qe==="Opera")&&ue!=="20030107")return!0;let Ue=eval.toString().length;if(Ue===37&&Qe!=="Safari"&&Qe!=="Firefox"&&Qe!=="Other")return!0;if(Ue===39&&Qe!=="Internet Explorer"&&Qe!=="Other")return!0;if(Ue===33&&Qe!=="Chrome"&&Qe!=="AOSP"&&Qe!=="Opera"&&Qe!=="Other")return!0;let He;try{throw"a"}catch(Ge){try{Ge.toSource(),He=!0}catch{He=!1}}return He&&Qe!=="Firefox"&&Qe!=="Other"},getUAParserResults=()=>uaResult,isBrowserSimulation=()=>getUAParserResults().browser.name?isTouchDevice()&&navigator.maxTouchPoints!==1?!1:isTouchDevice()&&(getHasLiedBrowser()||window.navigator.userAgent.indexOf("Mobile")!==-1)||mobile.iOS()&&typeof window.ontouchstart>"u":!0,isMobile=mobile.any()&&!isBrowserSimulation(),isWebRtcSupported=()=>!!(window.navigator.mediaDevices&&window.navigator.mediaDevices.getUserMedia),isSurfaceTablet=()=>{const me=navigator.userAgent.indexOf("Windows")>-1,ue=navigator.maxTouchPoints,Qe="ontouchstart"in window||ue>0||(matchMedia==null?void 0:matchMedia("(any-pointer: coarse)").matches);return me&&Qe},deviceClass={MOBILE:"MOBILE",DESKTOP:"DESKTOP"},getDeviceClass=()=>isMobile?deviceClass.MOBILE:deviceClass.DESKTOP,useEventListener=(me,ue,Qe=window)=>{const Ue=React.useRef(()=>{});React.useEffect(()=>{Ue.current=ue},[ue]),React.useEffect(()=>{if(!(Qe&&Qe.addEventListener))return;const Ge=Xe=>{var Ke;return(Ke=Ue==null?void 0:Ue.current)==null?void 0:Ke.call(Ue,Xe)};return Qe.addEventListener(me,Ge),()=>{Qe.removeEventListener(me,Ge)}},[me,Qe])},globalState={},createGlobalState=(me,ue,Qe)=>(globalState[me]||(globalState[me]={callbacks:[],value:Qe}),globalState[me].callbacks.push(ue),{deregister(){const Ue=globalState[me].callbacks,He=Ue.indexOf(ue);He>-1&&Ue.splice(He,1)},emit(Ue){globalState[me].value!==Ue&&(globalState[me].value=Ue,globalState[me].callbacks.forEach(He=>{ue!==He&&He(Ue)}))}}),usePersistedState=(me,ue,{get:Qe,set:Ue})=>{const He=React.useRef(null),[Ge,Xe]=React.useState(()=>Qe(ue,me));return useEventListener("storage",({key:Ke,newValue:$e})=>{if(Ke===ue){const Je=JSON.parse($e);Ge!==Je&&Xe(Je)}}),React.useEffect(()=>(He.current=createGlobalState(ue,Xe,me),()=>{var Ke,$e;($e=(Ke=He==null?void 0:He.current)==null?void 0:Ke.deregister)==null||$e.call(Ke)}),[]),React.useEffect(()=>{var Ke,$e;Ue(ue,Ge),($e=(Ke=He==null?void 0:He.current)==null?void 0:Ke.emit)==null||$e.call(Ke,Ge)},[ue,Ue,Ge]),[Ge,Xe]},createStorage=me=>({get(ue,Qe){const Ue=me.getItem(ue);return Ue===null?typeof Qe=="function"?Qe():Qe:JSON.parse(Ue)},set(ue,Qe){me.setItem(ue,JSON.stringify(Qe))}}),createPersistedState=(me,ue)=>{if(!ue&&typeof window<"u")try{ue=localStorage}catch{ue=null}if(ue){const Qe=createStorage(ue);return Ue=>usePersistedState(Ue,me,Qe)}return React.useState},useSessionState=createPersistedState("sessionData");function usePermissions(){const[me,ue]=React.useState(!1),[Qe,Ue]=React.useState(!1);return React.useEffect(()=>{var He;if(!navigator.permissions){Ue(!0);return}(He=navigator.permissions)==null||He.query({name:"camera"}).then(function(Ge){Ge.state==="granted"&&(ue(!0),Ue(!1)),Ge.state==="prompt"&&Ue(!0)}).catch(()=>{ue(!1),Ue(!1)})},[]),[me,ue,Qe]}function useInterval(me,ue){const Qe=React.useRef(me),Ue=React.useRef(null);return Qe.current=me,React.useEffect(()=>{function He(){Qe.current()}if(ue!==null)return Ue.current=setInterval(He,ue),()=>clearInterval(Ue.current)},[ue]),Ue.current}const resize=async()=>{await sleep(100);const me=window.innerWidth*.01,ue=window.innerHeight*.01;document.documentElement.style.setProperty("--vw",`${me}px`),document.documentElement.style.setProperty("--vh",`${ue}px`)},useResize=me=>{const{isRotated:ue}=useOrientation();useEventListener("resize",()=>{mobile.any()&&!me||resize()},window),React.useLayoutEffect(()=>{mobile.any()&&ue&&!me||resize()},[ue,me])},isPortrait=()=>{var me;return((me=screen.orientation)==null?void 0:me.type.includes("portrait"))||Math.abs(window.orientation)===0};function useOrientation(){const me=getUxType(),ue=me==="mobile"?!1:!isPortrait(),[Qe,Ue]=React.useState(ue),He=mobile.isDesktop();return React.useEffect(()=>{if(me==="mobile")return;function Ge(){Ue(!isPortrait()),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),window.focus()}return screen.orientation?screen.orientation.addEventListener("change",Ge):window.addEventListener("orientationchange",Ge),()=>{screen.orientation?screen.orientation.removeEventListener("change",Ge):window.removeEventListener("orientationchange",Ge)}},[me]),useEventListener("resize",()=>{isMobile&&Ue(!isPortrait())},window),{isRotated:He?!1:Qe}}const handleUnmountRoot=(me,ue,Qe)=>(...Ue)=>{setTimeout(()=>{if(me(...Ue),"createRoot"in ReactDOM__namespace)ue.unmount();else if(typeof ReactDOM__namespace.unmountComponentAtNode=="function")ReactDOM__namespace.unmountComponentAtNode(Qe);else throw new Error("Unsupported React version")},0)},createRoot$1=me=>{if("createRoot"in ReactDOM__namespace)return ReactDOM__namespace.createRoot(me);if(typeof ReactDOM__namespace.render=="function")return ReactDOM__namespace.render;throw new Error("Unsupported React version")},customRender=(me,ue,Qe)=>{if("createRoot"in ReactDOM__namespace)Qe.render(me);else if(typeof Qe=="function")Qe(me,ue);else throw new Error("Unsupported React version")};function useQuery(){return React.useMemo(()=>new URLSearchParams(window.location.search),[])}function useSteps(me=0){const[ue,Qe]=React.useState(me),Ue=React.useCallback(()=>{Qe(He=>He+1)},[]);return{currentStep:ue,setStep:Qe,nextStep:Ue}}function useOffline(me=emptyFunc){useEventListener("offline",()=>{navigator.onLine||me()})}function useToggle(me=!1){const[ue,Qe]=React.useState(me);return{state:ue,actions:{on:()=>{Qe(!0)},off:()=>{Qe(!1)},toggle:()=>{Qe(He=>!He)},reset:()=>{Qe(me)}}}}function useClickOutside(me,ue){const Qe=React.useRef();React.useEffect(()=>{Qe.current=ue;const Ue=He=>{var Ge;!(me!=null&&me.current)||(Ge=me==null?void 0:me.current)!=null&&Ge.contains(He.target)||ue()};return document.addEventListener("mousedown",Ue,!0),document.addEventListener("touchstart",Ue,!0),()=>{document.removeEventListener("mousedown",Ue),document.removeEventListener("touchstart",Ue)}},[ue,me])}const useAutoFocus=(me,ue=!1)=>{React.useEffect(()=>(me.current&&me.current.focus(),()=>{ue&&me.current&&me.current.blur()}),[me,ue])};let _deviceId=null;function useDeviceId(){const[me,ue]=React.useState(_deviceId);return[me,Ue=>{_deviceId=Ue,ue(Ue)}]}const backCameraKeywords=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"],cameraObjects=new Map;let getCamerasPromise;function isBackCameraLabel(me){const ue=me.toLowerCase();return backCameraKeywords.some(Qe=>ue.includes(Qe))}function createCamera(me,ue,Qe){var Ze,nt;if(cameraObjects.has(me.deviceId))return cameraObjects.get(me.deviceId);const Ue=me.label,He=me.getCapabilities(),Ge=(Ze=He==null?void 0:He.width)==null?void 0:Ze.max,Xe=(nt=He==null?void 0:He.height)==null?void 0:nt.max,Ke=He==null?void 0:He.aspectRatio;let $e;Qe.every(tt=>tt.label==="")?$e=Qe.length===1||ue+1<=Qe.length/2?"front":"back":$e=isBackCameraLabel(Ue)?"back":"front";const Je={deviceId:me.deviceId,label:Ue,cameraType:$e,width:Ge,height:Xe,aspectRatio:Ke};return cameraObjects.set(me.deviceId,Je),Je}function extractCamerasFromDevices(me){const ue=me.filter(Qe=>Qe.kind==="videoinput").map(createCamera);if(ue.length>1&&!ue.some(Qe=>Qe.cameraType==="back")){let Qe=ue.length-1;const Ue=ue.map(He=>{const Ge=He.label.match(/\b([0-9]+)MP?\b/i);return Ge!=null?parseInt(Ge[1],10):NaN});Ue.some(He=>isNaN(He))||(Qe=Ue.lastIndexOf(Math.max(...Ue))),ue[Qe].cameraType="back"}return ue}function adjustCamerasFromCameraStream(me,ue){const Qe=me.getSettings(),Ue=ue.find(He=>He.deviceId===Qe.deviceId||He.label!==""&&He.label===me.label);if(Ue!==void 0){if((Qe!=null&&Qe.facingMode==="environment"||isBackCameraLabel(me.label))&&ue.length>1)return ue.forEach(Ge=>{Ge.deviceId===Ue.deviceId?Ge.cameraType="back":isBackCameraLabel(Ge.label)||(Ge.cameraType="front")}),ue.filter(Ge=>Ge.cameraType==="back").sort((Ge,Xe)=>Ge.label.localeCompare(Xe.label))[0];if(ue.length===1)return Ue}}function getCameras(){return getCamerasPromise!=null||(getCamerasPromise=new Promise(async me=>{const ue=await navigator.mediaDevices.enumerateDevices(),Qe=extractCamerasFromDevices(ue);return me(Qe)})),getCamerasPromise}function getUserMediaVideoParams(me){const ue={resizeMode:"none",facingMode:"environment"};switch(me){case 0:return{...ue,height:{ideal:720},aspectRatio:{ideal:19.5/9}};case 1:return{...ue,width:{min:3200,ideal:3840,max:4096},height:{min:1800,ideal:2160,max:2400}};case 2:return{...ue,width:{min:1400,ideal:1920,max:2160},height:{min:900,ideal:1080,max:1440}};case 3:return{...ue,width:{min:640,ideal:640,max:800},height:{min:480,ideal:480,max:600}};case 4:return{...ue,width:{min:640,ideal:800,max:960},height:{min:480,ideal:480,max:480}};default:return{}}}const selfieConstraints={video:{facingMode:"user",height:{ideal:480},width:{ideal:640}}},killStream=(me,ue=!1)=>{if(ue){me.getVideoTracks().forEach(Qe=>Qe.stop());return}me.getTracks().forEach(Qe=>Qe.stop())},selfieChecks=({confidence:me,isBright:ue,hasLenses:Qe,hasFaceMask:Ue,hasClosedEyes:He,hasHeadCover:Ge})=>{const Xe=me===0,Ke=ue,$e=!Qe,Je=!Ue,Ze=!He,nt=!Ge;return{livenessPassed:Xe,brightnessPassed:Ke,lensesPassed:$e,maskPassed:Je,closedEyesPassed:Ze,headCoverPassed:nt,hasErrors:!Xe||!Ke||!$e||!Je||!Ze||!nt}},logSelfieChecks=(me,ue,Qe,Ue,He)=>{const Ge=[{passed:ue.headCoverPassed,log:"headCoverDected",notification:"notifications.removeHeadwear",message:"Lenses detected"},{passed:ue.lensesPassed,log:"lensesDetected",notification:"notifications.lenses",message:"Lenses detected"},{passed:ue.brightnessPassed,log:"badBrightness",notification:"notifications.brightness",message:"Bad brightness"},{passed:ue.maskPassed,log:"badMask",notification:"notifications.mask",message:"Mask detected"},{passed:ue.livenessPassed,log:"spoofAttempt",notification:"notifications.spoof",message:"Spoof attempt detected"},{passed:ue.closedEyesPassed,log:"closedEyes",notification:"notifications.closedEyes",message:"Closed eyes detected"}];for(const{passed:Xe,log:Ke,message:$e,notification:Je}of Ge)if(!Xe){Qe(getLogObject(Ke,{response:me,message:$e})),Ue(He(Je));break}},getIdealContraintsDefault=(me=720)=>({audio:!1,video:{resizeMode:"none",facingMode:"environment",height:{ideal:me},aspectRatio:{ideal:19.5/9}}}),getStream=async(me,ue=0)=>{if(me==="user")return navigator.mediaDevices.getUserMedia(selfieConstraints);if(mobile.iOS()){const Ue=await navigator.mediaDevices.getUserMedia(getIOSConstraints());return await Ue.getVideoTracks()[0].applyConstraints({advanced:[{focusDistance:1}]}),Ue}try{const Ue=await getCameras(),He=await navigator.mediaDevices.getUserMedia({video:getUserMediaVideoParams(ue)}),Ge=He.getVideoTracks()[0],Xe=adjustCamerasFromCameraStream(Ge,Ue);killStream(He);let Ke=1280,$e=720;if(ue>1){const{width:nt,height:tt}=getUserMediaVideoParams(ue);Ke=nt.ideal,$e=tt.ideal}const Je={video:{deviceId:{exact:Xe.deviceId},width:{ideal:Ke},height:{ideal:$e}}};return await navigator.mediaDevices.getUserMedia(Je)}catch(Ue){if(ue===5)throw Ue;return getStream(me,ue+1)}},getIOSConstraints=()=>getIdealContraintsDefault(localStorage.getItem("isHighPerformance")==="true"?1080:720);async function chooseNonUltraFrontCameraMultilingual(){const me=["front","frontal","vorderseite","avant","前面","正面","앞"],ue=["ultra","ウルトラ","울트라"];try{const Ue=(await navigator.mediaDevices.enumerateDevices()).find(He=>{const Ge=He.label.toLowerCase();return He.kind==="videoinput"&&me.some(Xe=>Ge.includes(Xe.toLowerCase()))&&!ue.some(Xe=>Ge.includes(Xe.toLowerCase()))});return Ue?Ue.deviceId:null}catch{return null}}async function getNonUltraWideFrontCameraStream(){const me=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user"},audio:!1});killStream(me);const ue=await chooseNonUltraFrontCameraMultilingual();return navigator.mediaDevices.getUserMedia({video:{deviceId:ue}})}const zoomCameraToTheMax=async me=>{const ue=me.getVideoTracks()[0],Qe=ue.getCapabilities();return Qe.zoom?await zoomCamera(ue,Qe.zoom.max):!1},zoomCamera=async(me,ue)=>{if(!me)return!1;const Qe=me.getSettings(),Ue=me.getCapabilities();return"zoom"in Qe||Ue.zoom?(await me.applyConstraints({advanced:[{zoom:Ue.zoom.min&&ue<Ue.zoom.min||Ue.zoom.max&&ue>Ue.zoom.max||ue}]}),!0):!1};async function base64ToImageData(me){const Qe=await(await fetch(`data:image/jpeg;base64,${me}`)).blob(),Ue=new Image,He=new Promise((Ke,$e)=>{Ue.onload=Ke,Ue.onerror=$e});Ue.src=URL.createObjectURL(Qe),await He;const Ge=document.createElement("canvas");Ge.width=Ue.width,Ge.height=Ue.height;const Xe=Ge.getContext("2d");return Xe.drawImage(Ue,0,0),Xe.getImageData(0,0,Ue.width,Ue.height)}function getChosenCameraInfo(me,ue=null,Qe=null){const Ue=me.getCapabilities(),He=me.getSettings(),{focusMode:Ge=!1}=navigator.mediaDevices.getSupportedConstraints();return{label:me.label,deviceId:He.deviceId,fallbackOption:ue,videoSource:Qe,resolution:`${He.width}x${He.height}`,autofocus:Ge,facingMode:He.facingMode,currentFrameRate:He.frameRate,zoom:Ue.zoom?{current:He.zoom,min:Ue.zoom.min,max:Ue.zoom.max,step:Ue.zoom.step}:void 0,focusDistance:Ue.focusDistance?{current:He.focusDistance,min:Ue.focusDistance.min,max:Ue.focusDistance.max,step:Ue.focusDistance.step}:void 0}}async function getDeviceCapabilities(){const me={};try{(await navigator.mediaDevices.enumerateDevices()).filter(Ue=>Ue.kind==="videoinput").forEach((Ue,He)=>{const Ge=Ue.getCapabilities();me[`camera${He+1}`]={label:Ue.label,width:{min:Ge.width.min,max:Ge.width.max},height:{min:Ge.height.min,max:Ge.height.max},frameRate:{min:Ge.frameRate.min,max:Ge.frameRate.max},facingMode:Ge.facingMode,focusMode:Ge.focusMode||void 0,focusDistance:Ge.focusDistance?{min:Ge.focusDistance.min,max:Ge.focusDistance.max}:void 0}})}catch(ue){console.log("Unable to get device capabilities: ",ue)}return me}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(me){exports.api=me}const deviceStatsQueue=[];let isReady=!1;function addDeviceStats(me,ue){if(!isReady){deviceStatsQueue.push(ue);return}return exports.api.post("/omni/device/stats",ue,{headers:{"X-Incode-Hardware-Id":me}}).catch(()=>{})}function emptyDeviceStatsQueue(me){isReady=!0,deviceStatsQueue.forEach(ue=>{addDeviceStats(me,ue)})}const eventsQueue=[];function addEvent(me){const{token:ue,code:Qe,module:Ue,screen:He,clientTimestamp:Ge,payload:Xe={}}=me;if(!ue){eventsQueue.push(me);return}return exports.api.post("/omni/interview-events",[{code:Qe,module:Ue,screen:He,clientTimestamp:Ge??new Date().getTime(),payload:Xe}],{headers:{"X-Incode-Hardware-Id":ue}}).catch(()=>{})}function emptyQueue(me){eventsQueue.forEach(ue=>{addEvent({...ue,token:me})})}const state={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=me=>(options={...options,...me},options);var PipelineProfileName=(me=>(me[me.IdCapture_2_01=0]="IdCapture_2_01",me[me.IdVideoSelfie_2_01=1]="IdVideoSelfie_2_01",me[me.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",me))(PipelineProfileName||{});class PipelineProfile{constructor(ue,Qe,Ue,He,Ge,Xe=null,Ke=""){this.pipelineType=ue,this.name=Qe,this.detectionType=Ue,this.modelNames=He,this.parameters=Ge,this.paramsConfigurator=Xe,this.description=Ke}reconfigureParams(ue=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,ue)}}var DetectionType=(me=>(me[me.IDCapture=0]="IDCapture",me[me.Selfie=1]="Selfie",me[me.IdVideoSelfie=2]="IdVideoSelfie",me))(DetectionType||{}),WasmPipelineType=(me=>(me[me.IdCapturePipeline=0]="IdCapturePipeline",me[me.IdVideoSelfiePipeline=1]="IdVideoSelfiePipeline",me[me.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",me[me.IdFaceDetectionPipeline=4]="IdFaceDetectionPipeline",me))(WasmPipelineType||{});function IdCaptureParamsConfigurator(me,ue,Qe){Object.assign(me,{areaDown:Qe?55e3:25e3,areaUp:Qe?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:ue==WasmPipelineType.IdCapturePipeline?125:180,widthIOSDown:ue==WasmPipelineType.IdCapturePipeline?85:150,widthDown:Qe?185:135,widthUp:Qe?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.59},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdCapturePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics")];function getProfile(me){const ue=pipelineProfiles.find(Qe=>Qe.name===me);if(!ue)throw new Error(`Profile not found for type: ${me}`);return ue}const probabilityThreshold=.6,wasmVersion="v1.8.8",pipelineBundles=new Map([["selfieAggregationMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithAggregationMetrics]],["selfieQualityMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithQualityMetrics]]]);function switchBundle(){return Math.random()<probabilityThreshold?"selfieAggregationMetrics":"selfieQualityMetrics"}function getInitializationParams(me){const Qe=me?switchBundle():"selfieAggregationMetrics",Ue="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",He=`${Ue}/${wasmVersion}/webLib.wasm`,Ge=`${Ue}/${wasmVersion}/webLibSimd.wasm`,Xe=`${Ue}/${wasmVersion}/webLib.js`,Ke=`${Ue}/${wasmVersion}/versions.json`;let $e=new Map,Je=new Map;for(const Ze of pipelineBundles.get(Qe)){const nt=getProfile(Ze);if(!nt)throw new Error(`Profile not found: ${Ze}`);const tt=nt.modelNames;let et=[];for(const rt of tt)et.push(`${Ue}/${wasmVersion}/models/${rt}`);$e.set(nt.pipelineType,et),Je.set(nt.detectionType,nt)}return{wasmModulePath:He,wasmSimdModulePath:Ge,glueCodePath:Xe,versionsFilePath:Ke,pipelineModels:$e,enableSIMD:!0,bundle:Qe,profiles:Je,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async ue=>{this.Module=(await import(ue)).Module}}async initialize(ue,Qe,Ue,He,Ge,Xe){await this.freeResources(),this.pipelines_=Xe,this.versionsFile=Ge,await this.loadModule(Ue);const Ke=await this.loadWasm(He,ue,Qe);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,Ke}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(ue,Qe){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(ue&&Qe&&ue==this.imageWidth_&&Qe==this.imageHeight_&&this.inputImageBuffer&&ue*Qe*4===this.inputImageBuffer.length)&&(this.imageWidth_=ue,this.imageHeight_=Qe,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(ue,Qe,4))}async handleDetectionCallAndUpdateState(ue){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.toWasmEnum(ue))}async encryptImage(ue){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(ue)}isVirtualCamera(ue){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),ue)return this.wasmApiHelpers.isVirtualCamera(ue)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(ue){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(ue.width,ue.height),this.inputImageBuffer.set(ue.data),this.wasmApiHelpers.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(ue){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.toWasmEnum(ue))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[ue,Qe]of this.pipelines_)this.resetPipeline(ue)}async process(ue,Qe){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(ue.data),Qe){case WasmPipelineType.IdCapturePipeline:return this.idCaptureWasmApi.runIdCapturePipeline();case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.toWasmEnum(Qe));default:throw new Error("Unknown pipeline type")}}async runIdCapture(ue){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(ue){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceDetectionThresholds(ue,Qe,Ue,He,Ge,Xe,Ke){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke)}async setFaceAttributesThresholds(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceAttributesEnabled(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceDetectionMode(ue,Qe){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.toWasmEnum(ue),Qe)}async setFaceDetectionCallbacks(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et,rt,it,ot,at){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et,rt,it,ot,at)}async setIdCaptureThresholds(ue,Qe,Ue,He,Ge,Xe){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe)}async setIdCaptureCallbacks(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt)}async setIdCaptureGeometryParams(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et)}async setIdCaptureConfigParams(ue,Qe,Ue,He,Ge,Xe){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe)}async getVersions(){const Qe=await(await fetch(this.versionsFile)).text();return JSON.parse(Qe)}async loadWasm(ue,Qe,Ue){const He=ue?Ue:Qe;try{window.wasmArrayBuffer=await fetch(He).then(Ge=>Ge.arrayBuffer()).then(Ge=>new Uint8Array(Ge)),this.wasmModule=await this.Module()}catch(Ge){if(console.log(Ge,ue,"useSmd"),ue)return await this.loadWasm(!1,Qe,Ue);throw Ge}return ue}async loadModels(){var He;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let ue=new this.wasmModule.PipelineTypeToIntMap,Qe=new Map,Ue=new Map;for(let[Ge,Xe]of this.pipelines_){let Ke=this.toWasmEnum(Ge),$e=[],Je=new this.wasmModule.VectorInt;for(let Ze of Xe){if(!Ue.has(Ze)){let tt=await fetch(Ze).then(et=>et.arrayBuffer()).then(et=>new Uint8Array(et));Ue.set(Ze,tt)}let nt=Ue.get(Ze);Je.push_back(nt.byteLength),$e.push(nt)}ue.set(Ke,Je),Qe.set(Ke,$e)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(ue);for(let[Ge,Xe]of Qe){let Ke=(He=this.modelsBuffers)==null?void 0:He.get(Ge);for(let $e=0;$e<Ke.size();$e++){let Je=Ke==null?void 0:Ke.get($e);if(Je)Je.set(Xe[$e]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.wasmApiHelpers.initializePipelines()}async setProductionMode(ue){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(ue)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.fromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}toWasmEnum(ue){switch(ue){case WasmPipelineType.IdCapturePipeline:return this.wasmModule.PipelineType.IdCapturePipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}fromWasmEnum(ue){switch(ue){case this.wasmModule.PipelineType.IdCapturePipeline:return WasmPipelineType.IdCapturePipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}checkWasmInitialization(ue){if(!this.isInitialized())throw new Error(ue)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(et=>{document.addEventListener("click",async()=>{const rt=await this.requestMotionPermission();et(rt)},{once:!0})}),this.deviceMotionListener=et=>{if(et.accelerationIncludingGravity){const rt={x:et.accelerationIncludingGravity.x,y:et.accelerationIncludingGravity.y,z:et.accelerationIncludingGravity.z};this.checkFields(rt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,rt))}if(et.acceleration){const rt={x:et.acceleration.x,y:et.acceleration.y,z:et.acceleration.z};this.checkFields(rt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,rt))}if(et.rotationRate){const rt={x:et.rotationRate.alpha,y:et.rotationRate.beta,z:et.rotationRate.gamma};this.checkFields(rt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,rt))}},this.deviceOrientationListener=et=>{const rt={x:et.alpha,y:et.beta,z:et.gamma};this.checkFields(rt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,rt))},this.accThreshold_=ue,this.gyroThreshold_=Qe,this.accGrOldThreshold_=Ue,this.accOldThreshold_=He,this.gyroscopeOldThreshold_=Ge,this.orientationOldThreshold_=Xe,this.maeAccThreshold_=Ke,this.maeGyroThreshold_=$e,this.maeAccGrOldThreshold_=Je,this.maeAccOldThreshold_=Ze,this.maeGyroscopeOldThreshold_=nt,this.maeOrientationOldThreshold_=tt}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(ue=>{ue!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const ue={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(ue)&&this.updateParams(this.paramsAcc_,ue)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const ue={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(ue)&&this.updateParams(this.paramsGyro_,ue)}}check(){if(!this.permission_)return"UNCLEAR";const ue=this.checkStability();return ue===null?"UNCLEAR":ue?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Qe=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(Ke=>Ke!==null),Ue=Qe.length>0?Qe.every(Ke=>Ke):null,Ge=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(Ke=>Ke!==null),Xe=Ge.length>0?Ge.every(Ke=>Ke):null;return Ue===null?Xe===null?null:Xe:Xe!==null?Ue&&Xe:Ue}updateParams(ue,Qe){const Ue=Qe.x-ue.meanX,He=Qe.y-ue.meanY,Ge=Qe.z-ue.meanZ;ue.meanX+=Ue/ue.ptsNum,ue.meanY+=He/ue.ptsNum,ue.meanZ+=Ge/ue.ptsNum,ue.m2X+=Ue*(Qe.x-ue.meanX),ue.m2Y+=He*(Qe.y-ue.meanY),ue.m2Z+=Ge*(Qe.z-ue.meanZ),ue.cumulativeAbsErrorX+=Math.abs(Qe.x-ue.meanX),ue.cumulativeAbsErrorY+=Math.abs(Qe.y-ue.meanY),ue.cumulativeAbsErrorZ+=Math.abs(Qe.z-ue.meanZ)}calculateStd(ue){const Qe={x:ue.m2X/ue.ptsNum,y:ue.m2Y/ue.ptsNum,z:ue.m2Z/ue.ptsNum};return{x:Math.sqrt(Qe.x),y:Math.sqrt(Qe.y),z:Math.sqrt(Qe.z)}}calculateMae(ue){return{x:ue.cumulativeAbsErrorX/ue.ptsNum,y:ue.cumulativeAbsErrorY/ue.ptsNum,z:ue.cumulativeAbsErrorZ/ue.ptsNum}}checkFields(ue){return ue.x!==null&&ue.y!==null&&ue.z!==null}isBelowStdThreshold(ue,Qe){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ue=this.calculateStd(ue);return Ue.x<Qe&&Ue.y<Qe&&Ue.z<Qe}isBelowMaeThreshold(ue,Qe){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ue=this.calculateMae(ue);return Ue.x<Qe&&Ue.y<Qe&&Ue.z<Qe}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs="",this.pipelinesBundle=null,this.simdIsEnabled=null,this.wasmVersion=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setPipelinesBundle(ue){this.pipelinesBundle=ue}setSimdIsEnabled(ue){this.simdIsEnabled=ue}setWasmVersion(ue){this.wasmVersion=ue}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(ue){const Qe=await base64ToImageData(ue);await MlWasmJSApi$1.analyzeFrame(Qe),this.updatePipelineStats()}async checkForVirtualCameraByLabel(ue=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!ue){const Ue=await getDeviceCapabilities();for(const He of Object.keys(Ue)){const Ge=Ue[He];if(MlWasmJSApi$1.isVirtualCamera(Ge==null?void 0:Ge.label)){const Xe={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Xe}}}const Qe=getChosenCameraInfo(ue);if(MlWasmJSApi$1.isVirtualCamera(Qe==null?void 0:Qe.label)){const Ue={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ue}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Qe){console.log(`Exception: ${Qe}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const ue=MlWasmJSApi$1.getPipelineState();if(ue!==""){const Qe=JSON.parse(ue);this.analysisStatus=Qe.statsAnalysisStatus,Qe.pipelinesBundle=this.pipelinesBundle?this.pipelinesBundle:"unknown",Qe.estimatedPerformance=this.estimatedPerformance,Qe.simdIsEnabled=this.simdIsEnabled,Qe.wasmVersion=this.wasmVersion,this.pipelineLogs=JSON.stringify(Qe),this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(ue){console.error(`Exception: ${ue}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,PACKAGE_VERSION:"1.75.2-rc.20241029001543"};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.pipelinesBundle=null,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getPipelinesBundle(){return this.pipelinesBundle}getProfile(ue){var Qe;return((Qe=this.profiles)==null?void 0:Qe.get(ue))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(ue=>setTimeout(ue,100))}async _runSetupDetect(){var Ge,Xe,Ke;if(this.isSetupDetect)return;addEvent({token:(Ge=state.token)==null?void 0:Ge.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const ue=getInitializationParams(options.hostingApp==="Incode ID");this.pipelinesBundle=ue.bundle,this.profiles=ue.profiles,OnboardingAnalytics$1.setPipelinesBundle(this.pipelinesBundle),OnboardingAnalytics$1.startOnboardingCheck();const Qe=await MlWasmJSApi$1.initialize(ue.wasmModulePath,ue.wasmSimdModulePath,ue.glueCodePath,ue.enableSIMD,ue.versionsFilePath,ue.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise($e=>setTimeout($e,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(ue.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(Qe);const Ue=await OnboardingAnalytics$1.checkForVirtualCameraByLabel();Ue!=null&&Ue.isDetected&&!Ue.hasPriorDetection&&addDeviceStats((Xe=state.token)==null?void 0:Xe.token,{cameraLabelInspectionStatus:"FAIL"}),await MlWasmJSApi$1.initializePipelines();const He=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(He)}catch($e){console.error(`Exception: ${$e}`)}this.isSetupDetect=!0,addEvent({token:(Ke=state.token)==null?void 0:Ke.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(me){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$a(me)}function _classCallCheck$m(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function toPrimitive(me,ue){if(_typeof$a(me)!="object"||!me)return me;var Qe=me[Symbol.toPrimitive];if(Qe!==void 0){var Ue=Qe.call(me,ue||"default");if(_typeof$a(Ue)!="object")return Ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ue==="string"?String:Number)(me)}function toPropertyKey(me){var ue=toPrimitive(me,"string");return _typeof$a(ue)=="symbol"?ue:String(ue)}function _defineProperties$9(me,ue){for(var Qe=0;Qe<ue.length;Qe++){var Ue=ue[Qe];Ue.enumerable=Ue.enumerable||!1,Ue.configurable=!0,"value"in Ue&&(Ue.writable=!0),Object.defineProperty(me,toPropertyKey(Ue.key),Ue)}}function _createClass$l(me,ue,Qe){return ue&&_defineProperties$9(me.prototype,ue),Qe&&_defineProperties$9(me,Qe),Object.defineProperty(me,"prototype",{writable:!1}),me}function _assertThisInitialized$1(me){if(me===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return me}function _setPrototypeOf$1(me,ue){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ue,He){return Ue.__proto__=He,Ue},_setPrototypeOf$1(me,ue)}function _inherits$c(me,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function");me.prototype=Object.create(ue&&ue.prototype,{constructor:{value:me,writable:!0,configurable:!0}}),Object.defineProperty(me,"prototype",{writable:!1}),ue&&_setPrototypeOf$1(me,ue)}function _possibleConstructorReturn$c(me,ue){if(ue&&(_typeof$a(ue)==="object"||typeof ue=="function"))return ue;if(ue!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(me)}function _getPrototypeOf$1(me){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Qe){return Qe.__proto__||Object.getPrototypeOf(Qe)},_getPrototypeOf$1(me)}function _defineProperty$6(me,ue,Qe){return ue=toPropertyKey(ue),ue in me?Object.defineProperty(me,ue,{value:Qe,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Qe,me}function _arrayWithHoles$3(me){if(Array.isArray(me))return me}function _iterableToArray(me){if(typeof Symbol<"u"&&me[Symbol.iterator]!=null||me["@@iterator"]!=null)return Array.from(me)}function _arrayLikeToArray$b(me,ue){(ue==null||ue>me.length)&&(ue=me.length);for(var Qe=0,Ue=new Array(ue);Qe<ue;Qe++)Ue[Qe]=me[Qe];return Ue}function _unsupportedIterableToArray$b(me,ue){if(me){if(typeof me=="string")return _arrayLikeToArray$b(me,ue);var Qe=Object.prototype.toString.call(me).slice(8,-1);if(Qe==="Object"&&me.constructor&&(Qe=me.constructor.name),Qe==="Map"||Qe==="Set")return Array.from(me);if(Qe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Qe))return _arrayLikeToArray$b(me,ue)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
11
|
+
*/const DataRouterContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(DataRouterContext.displayName="DataRouter");const DataRouterStateContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(DataRouterStateContext.displayName="DataRouterState");const AwaitContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(AwaitContext.displayName="Await");const NavigationContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(NavigationContext.displayName="Navigation");const LocationContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(LocationContext.displayName="Location");const RouteContext=React__namespace.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(RouteContext.displayName="Route");const RouteErrorContext=React__namespace.createContext(null);process.env.NODE_ENV!=="production"&&(RouteErrorContext.displayName="RouteError");function useParams(){let{matches:me}=React__namespace.useContext(RouteContext),ue=me[me.length-1];return ue?ue.params:{}}new Promise(()=>{});var uaParser={exports:{}};(function(me,ue){(function(Qe,Ue){var He="1.0.37",Ge="",Xe="?",Ke="function",$e="undefined",Je="object",Ze="string",nt="major",tt="model",et="name",rt="type",it="vendor",ot="version",at="architecture",st="console",ut="mobile",lt="tablet",dt="smarttv",At="wearable",pt="embedded",gt=500,wt="Amazon",Bt="Apple",Tt="ASUS",yt="BlackBerry",Ct="Browser",ht="Chrome",It="Edge",vt="Firefox",Et="Google",bt="Huawei",Rt="LG",St="Microsoft",kt="Motorola",jt="Opera",Pt="Samsung",Qt="Sharp",qt="Sony",_t="Xiaomi",Yt="Zebra",Xt="Facebook",Ut="Chromium OS",Lt="Mac OS",Ot=function(Jt,an){var cn={};for(var dn in Jt)an[dn]&&an[dn].length%2===0?cn[dn]=an[dn].concat(Jt[dn]):cn[dn]=Jt[dn];return cn},ft=function(Jt){for(var an={},cn=0;cn<Jt.length;cn++)an[Jt[cn].toUpperCase()]=Jt[cn];return an},Dt=function(Jt,an){return typeof Jt===Ze?Mt(an).indexOf(Mt(Jt))!==-1:!1},Mt=function(Jt){return Jt.toLowerCase()},Ft=function(Jt){return typeof Jt===Ze?Jt.replace(/[^\d\.]/g,Ge).split(".")[0]:Ue},Gt=function(Jt,an){if(typeof Jt===Ze)return Jt=Jt.replace(/^\s\s*/,Ge),typeof an===$e?Jt:Jt.substring(0,gt)},zt=function(Jt,an){for(var cn=0,dn,yn,Nn,Rn,rn,ln;cn<an.length&&!rn;){var pn=an[cn],Sn=an[cn+1];for(dn=yn=0;dn<pn.length&&!rn&&pn[dn];)if(rn=pn[dn++].exec(Jt),rn)for(Nn=0;Nn<Sn.length;Nn++)ln=rn[++yn],Rn=Sn[Nn],typeof Rn===Je&&Rn.length>0?Rn.length===2?typeof Rn[1]==Ke?this[Rn[0]]=Rn[1].call(this,ln):this[Rn[0]]=Rn[1]:Rn.length===3?typeof Rn[1]===Ke&&!(Rn[1].exec&&Rn[1].test)?this[Rn[0]]=ln?Rn[1].call(this,ln,Rn[2]):Ue:this[Rn[0]]=ln?ln.replace(Rn[1],Rn[2]):Ue:Rn.length===4&&(this[Rn[0]]=ln?Rn[3].call(this,ln.replace(Rn[1],Rn[2])):Ue):this[Rn]=ln||Ue;cn+=2}},$t=function(Jt,an){for(var cn in an)if(typeof an[cn]===Je&&an[cn].length>0){for(var dn=0;dn<an[cn].length;dn++)if(Dt(an[cn][dn],Jt))return cn===Xe?Ue:cn}else if(Dt(an[cn],Jt))return cn===Xe?Ue:cn;return Jt},Ht={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},hn={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},un={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[ot,[et,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[ot,[et,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[et,ot],[/opios[\/ ]+([\w\.]+)/i],[ot,[et,jt+" Mini"]],[/\bopr\/([\w\.]+)/i],[ot,[et,jt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[ot,[et,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[et,ot],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[ot,[et,"UC"+Ct]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[ot,[et,"WeChat"]],[/konqueror\/([\w\.]+)/i],[ot,[et,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[ot,[et,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[ot,[et,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[ot,[et,"Smart Lenovo "+Ct]],[/(avast|avg)\/([\w\.]+)/i],[[et,/(.+)/,"$1 Secure "+Ct],ot],[/\bfocus\/([\w\.]+)/i],[ot,[et,vt+" Focus"]],[/\bopt\/([\w\.]+)/i],[ot,[et,jt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[ot,[et,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[ot,[et,"Dolphin"]],[/coast\/([\w\.]+)/i],[ot,[et,jt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[ot,[et,"MIUI "+Ct]],[/fxios\/([-\w\.]+)/i],[ot,[et,vt]],[/\bqihu|(qi?ho?o?|360)browser/i],[[et,"360 "+Ct]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[et,/(.+)/,"$1 "+Ct],ot],[/samsungbrowser\/([\w\.]+)/i],[ot,[et,Pt+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[et,/_/g," "],ot],[/metasr[\/ ]?([\d\.]+)/i],[ot,[et,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[et,"Sogou Mobile"],ot],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[et,ot],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[et],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[et,Xt],ot],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[et,ot],[/\bgsa\/([\w\.]+) .*safari\//i],[ot,[et,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[ot,[et,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[ot,[et,ht+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[et,ht+" WebView"],ot],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[ot,[et,"Android "+Ct]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[et,ot],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[ot,[et,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[ot,et],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[et,[ot,$t,Ht]],[/(webkit|khtml)\/([\w\.]+)/i],[et,ot],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[et,"Netscape"],ot],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[ot,[et,vt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[et,ot],[/(cobalt)\/([\w\.]+)/i],[et,[ot,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[at,"amd64"]],[/(ia32(?=;))/i],[[at,Mt]],[/((?:i[346]|x)86)[;\)]/i],[[at,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[at,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[at,"armhf"]],[/windows (ce|mobile); ppc;/i],[[at,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[at,/ower/,Ge,Mt]],[/(sun4\w)[;\)]/i],[[at,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[at,Mt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[tt,[it,Pt],[rt,lt]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[tt,[it,Pt],[rt,ut]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[tt,[it,Bt],[rt,ut]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[tt,[it,Bt],[rt,lt]],[/(macintosh);/i],[tt,[it,Bt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[tt,[it,Qt],[rt,ut]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[tt,[it,bt],[rt,lt]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[tt,[it,bt],[rt,ut]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[tt,/_/g," "],[it,_t],[rt,ut]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[tt,/_/g," "],[it,_t],[rt,lt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[tt,[it,"OPPO"],[rt,ut]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[tt,[it,"Vivo"],[rt,ut]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[tt,[it,"Realme"],[rt,ut]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[tt,[it,kt],[rt,ut]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[tt,[it,kt],[rt,lt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[tt,[it,Rt],[rt,lt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[tt,[it,Rt],[rt,ut]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[tt,[it,"Lenovo"],[rt,lt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[tt,/_/g," "],[it,"Nokia"],[rt,ut]],[/(pixel c)\b/i],[tt,[it,Et],[rt,lt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[tt,[it,Et],[rt,ut]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[tt,[it,qt],[rt,ut]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[tt,"Xperia Tablet"],[it,qt],[rt,lt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[tt,[it,"OnePlus"],[rt,ut]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[tt,[it,wt],[rt,lt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[tt,/(.+)/g,"Fire Phone $1"],[it,wt],[rt,ut]],[/(playbook);[-\w\),; ]+(rim)/i],[tt,it,[rt,lt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[tt,[it,yt],[rt,ut]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[tt,[it,Tt],[rt,lt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[tt,[it,Tt],[rt,ut]],[/(nexus 9)/i],[tt,[it,"HTC"],[rt,lt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[it,[tt,/_/g," "],[rt,ut]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[tt,[it,"Acer"],[rt,lt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[tt,[it,"Meizu"],[rt,ut]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[tt,[it,"Ulefone"],[rt,ut]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[it,tt,[rt,ut]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[it,tt,[rt,lt]],[/(surface duo)/i],[tt,[it,St],[rt,lt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[tt,[it,"Fairphone"],[rt,ut]],[/(u304aa)/i],[tt,[it,"AT&T"],[rt,ut]],[/\bsie-(\w*)/i],[tt,[it,"Siemens"],[rt,ut]],[/\b(rct\w+) b/i],[tt,[it,"RCA"],[rt,lt]],[/\b(venue[\d ]{2,7}) b/i],[tt,[it,"Dell"],[rt,lt]],[/\b(q(?:mv|ta)\w+) b/i],[tt,[it,"Verizon"],[rt,lt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[tt,[it,"Barnes & Noble"],[rt,lt]],[/\b(tm\d{3}\w+) b/i],[tt,[it,"NuVision"],[rt,lt]],[/\b(k88) b/i],[tt,[it,"ZTE"],[rt,lt]],[/\b(nx\d{3}j) b/i],[tt,[it,"ZTE"],[rt,ut]],[/\b(gen\d{3}) b.+49h/i],[tt,[it,"Swiss"],[rt,ut]],[/\b(zur\d{3}) b/i],[tt,[it,"Swiss"],[rt,lt]],[/\b((zeki)?tb.*\b) b/i],[tt,[it,"Zeki"],[rt,lt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[it,"Dragon Touch"],tt,[rt,lt]],[/\b(ns-?\w{0,9}) b/i],[tt,[it,"Insignia"],[rt,lt]],[/\b((nxa|next)-?\w{0,9}) b/i],[tt,[it,"NextBook"],[rt,lt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[it,"Voice"],tt,[rt,ut]],[/\b(lvtel\-)?(v1[12]) b/i],[[it,"LvTel"],tt,[rt,ut]],[/\b(ph-1) /i],[tt,[it,"Essential"],[rt,ut]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[tt,[it,"Envizen"],[rt,lt]],[/\b(trio[-\w\. ]+) b/i],[tt,[it,"MachSpeed"],[rt,lt]],[/\btu_(1491) b/i],[tt,[it,"Rotor"],[rt,lt]],[/(shield[\w ]+) b/i],[tt,[it,"Nvidia"],[rt,lt]],[/(sprint) (\w+)/i],[it,tt,[rt,ut]],[/(kin\.[onetw]{3})/i],[[tt,/\./g," "],[it,St],[rt,ut]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[tt,[it,Yt],[rt,lt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[tt,[it,Yt],[rt,ut]],[/smart-tv.+(samsung)/i],[it,[rt,dt]],[/hbbtv.+maple;(\d+)/i],[[tt,/^/,"SmartTV"],[it,Pt],[rt,dt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[it,Rt],[rt,dt]],[/(apple) ?tv/i],[it,[tt,Bt+" TV"],[rt,dt]],[/crkey/i],[[tt,ht+"cast"],[it,Et],[rt,dt]],[/droid.+aft(\w+)( bui|\))/i],[tt,[it,wt],[rt,dt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[tt,[it,Qt],[rt,dt]],[/(bravia[\w ]+)( bui|\))/i],[tt,[it,qt],[rt,dt]],[/(mitv-\w{5}) bui/i],[tt,[it,_t],[rt,dt]],[/Hbbtv.*(technisat) (.*);/i],[it,tt,[rt,dt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[it,Gt],[tt,Gt],[rt,dt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[rt,dt]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[it,tt,[rt,st]],[/droid.+; (shield) bui/i],[tt,[it,"Nvidia"],[rt,st]],[/(playstation [345portablevi]+)/i],[tt,[it,qt],[rt,st]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[tt,[it,St],[rt,st]],[/((pebble))app/i],[it,tt,[rt,At]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[tt,[it,Bt],[rt,At]],[/droid.+; (glass) \d/i],[tt,[it,Et],[rt,At]],[/droid.+; (wt63?0{2,3})\)/i],[tt,[it,Yt],[rt,At]],[/(quest( 2| pro)?)/i],[tt,[it,Xt],[rt,At]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[it,[rt,pt]],[/(aeobc)\b/i],[tt,[it,wt],[rt,pt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[tt,[rt,ut]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[tt,[rt,lt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[rt,lt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[rt,ut]],[/(android[-\w\. ]{0,9});.+buil/i],[tt,[it,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[ot,[et,It+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[ot,[et,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[et,ot],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[ot,et]],os:[[/microsoft (windows) (vista|xp)/i],[et,ot],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[et,[ot,$t,hn]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[ot,$t,hn],[et,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[ot,/_/g,"."],[et,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[et,Lt],[ot,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[ot,et],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[et,ot],[/\(bb(10);/i],[ot,[et,yt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[ot,[et,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[ot,[et,vt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[ot,[et,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[ot,[et,"watchOS"]],[/crkey\/([\d\.]+)/i],[ot,[et,ht+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[et,Ut],ot],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[et,ot],[/(sunos) ?([\w\.\d]*)/i],[[et,"Solaris"],ot],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[et,ot]]},An=function(Jt,an){if(typeof Jt===Je&&(an=Jt,Jt=Ue),!(this instanceof An))return new An(Jt,an).getResult();var cn=typeof Qe!==$e&&Qe.navigator?Qe.navigator:Ue,dn=Jt||(cn&&cn.userAgent?cn.userAgent:Ge),yn=cn&&cn.userAgentData?cn.userAgentData:Ue,Nn=an?Ot(un,an):un,Rn=cn&&cn.userAgent==dn;return this.getBrowser=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.browser),rn[nt]=Ft(rn[ot]),Rn&&cn&&cn.brave&&typeof cn.brave.isBrave==Ke&&(rn[et]="Brave"),rn},this.getCPU=function(){var rn={};return rn[at]=Ue,zt.call(rn,dn,Nn.cpu),rn},this.getDevice=function(){var rn={};return rn[it]=Ue,rn[tt]=Ue,rn[rt]=Ue,zt.call(rn,dn,Nn.device),Rn&&!rn[rt]&&yn&&yn.mobile&&(rn[rt]=ut),Rn&&rn[tt]=="Macintosh"&&cn&&typeof cn.standalone!==$e&&cn.maxTouchPoints&&cn.maxTouchPoints>2&&(rn[tt]="iPad",rn[rt]=lt),rn},this.getEngine=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.engine),rn},this.getOS=function(){var rn={};return rn[et]=Ue,rn[ot]=Ue,zt.call(rn,dn,Nn.os),Rn&&!rn[et]&&yn&&yn.platform!="Unknown"&&(rn[et]=yn.platform.replace(/chrome os/i,Ut).replace(/macos/i,Lt)),rn},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return dn},this.setUA=function(rn){return dn=typeof rn===Ze&&rn.length>gt?Gt(rn,gt):rn,this},this.setUA(dn),this};An.VERSION=He,An.BROWSER=ft([et,ot,nt]),An.CPU=ft([at]),An.DEVICE=ft([tt,it,rt,st,ut,dt,lt,At,pt]),An.ENGINE=An.OS=ft([et,ot]),me.exports&&(ue=me.exports=An),ue.UAParser=An;var mn=typeof Qe!==$e&&(Qe.jQuery||Qe.Zepto);if(mn&&!mn.ua){var En=new An;mn.ua=En.getResult(),mn.ua.get=function(){return En.getUA()},mn.ua.set=function(Jt){En.setUA(Jt);var an=En.getResult();for(var cn in an)mn.ua[cn]=an[cn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);let uxType=null;const setUxType=me=>{if(me==="desktop"||me==="mobile"||me===null)uxType=me;else throw new Error("Invalid value for uxType. Accepted values are 'desktop', 'mobile', or null.")},getUxType=()=>uxType,parser$1=new UAParser,uaResult=parser$1.getResult(),isTouchDevice=()=>navigator.maxTouchPoints>0||"ontouchstart"in document.documentElement,isTabletWithoutAndroid=()=>!uaResult.device.type&&uaResult.os.name==="Linux"&&uaResult.browser.name==="Chrome"&&isTouchDevice(),mobile={Android:()=>uaResult.os.name==="Android",iOS:()=>["iOS","iPadOS"].includes(uaResult.os.name||""),isIpad:()=>uaResult.device.model==="iPad",isFBInAppBrowser:()=>/\[FB/.test(uaResult.ua),isInstagramAppBrowser:()=>/Instagram/.test(uaResult.ua),any:()=>uxType?uxType==="mobile":!!(uaResult.device.type==="mobile"||uaResult.device.type==="tablet"||isTabletWithoutAndroid()),isDesktop:()=>uxType?uxType==="desktop":!mobile.any(),isAppleDevice:()=>["iOS","Mac OS","iPadOS"].includes(uaResult.os.name||""),isBrowserSupported:()=>{const{browser:me,os:ue}=uaResult;return ue.name==="iOS"||ue.name==="iPadOS"?["Mobile Safari","Chrome"].includes(me.name||""):ue.name==="Mac OS"?["Safari","Chrome"].includes(me.name||""):me.name==="Chrome"}},browserName=uaResult.browser.name,desktop={isEdge:()=>browserName==="Edge",isChrome:()=>["Chrome","Chrome WebView","Chrome Headless"].includes(browserName),isFirefox:()=>["Firefox","Firefox Focus","Firefox Reality"].includes(browserName),isOpera:()=>["Opera","Opera Mini","Opera Touch"].includes(browserName),isSafari:()=>["Safari","Mobile Safari"].includes(browserName)},getHasLiedBrowser=()=>{let me=navigator.userAgent.toLowerCase(),ue=navigator.productSub,Qe;if(me.indexOf("edge/")>=0||me.indexOf("iemobile/")>=0)return!1;if(me.indexOf("opera mini")>=0)return!1;if(me.indexOf("firefox/")>=0?Qe="Firefox":me.indexOf("opera/")>=0||me.indexOf(" opr/")>=0?Qe="Opera":me.indexOf("chrome/")>=0?Qe="Chrome":me.indexOf("safari/")>=0?me.indexOf("android 1.")>=0||me.indexOf("android 2.")>=0||me.indexOf("android 3.")>=0||me.indexOf("android 4.")>=0?Qe="AOSP":Qe="Safari":me.indexOf("trident/")>=0?Qe="Internet Explorer":Qe="Other",(Qe==="Chrome"||Qe==="Safari"||Qe==="Opera")&&ue!=="20030107")return!0;let Ue=eval.toString().length;if(Ue===37&&Qe!=="Safari"&&Qe!=="Firefox"&&Qe!=="Other")return!0;if(Ue===39&&Qe!=="Internet Explorer"&&Qe!=="Other")return!0;if(Ue===33&&Qe!=="Chrome"&&Qe!=="AOSP"&&Qe!=="Opera"&&Qe!=="Other")return!0;let He;try{throw"a"}catch(Ge){try{Ge.toSource(),He=!0}catch{He=!1}}return He&&Qe!=="Firefox"&&Qe!=="Other"},getUAParserResults=()=>uaResult,isBrowserSimulation=()=>getUAParserResults().browser.name?isTouchDevice()&&navigator.maxTouchPoints!==1?!1:isTouchDevice()&&(getHasLiedBrowser()||window.navigator.userAgent.indexOf("Mobile")!==-1)||mobile.iOS()&&typeof window.ontouchstart>"u":!0,isMobile=mobile.any()&&!isBrowserSimulation(),isWebRtcSupported=()=>!!(window.navigator.mediaDevices&&window.navigator.mediaDevices.getUserMedia),isSurfaceTablet=()=>{const me=navigator.userAgent.indexOf("Windows")>-1,ue=navigator.maxTouchPoints,Qe="ontouchstart"in window||ue>0||(matchMedia==null?void 0:matchMedia("(any-pointer: coarse)").matches);return me&&Qe},deviceClass={MOBILE:"MOBILE",DESKTOP:"DESKTOP"},getDeviceClass=()=>isMobile?deviceClass.MOBILE:deviceClass.DESKTOP,useEventListener=(me,ue,Qe=window)=>{const Ue=React.useRef(()=>{});React.useEffect(()=>{Ue.current=ue},[ue]),React.useEffect(()=>{if(!(Qe&&Qe.addEventListener))return;const Ge=Xe=>{var Ke;return(Ke=Ue==null?void 0:Ue.current)==null?void 0:Ke.call(Ue,Xe)};return Qe.addEventListener(me,Ge),()=>{Qe.removeEventListener(me,Ge)}},[me,Qe])},globalState={},createGlobalState=(me,ue,Qe)=>(globalState[me]||(globalState[me]={callbacks:[],value:Qe}),globalState[me].callbacks.push(ue),{deregister(){const Ue=globalState[me].callbacks,He=Ue.indexOf(ue);He>-1&&Ue.splice(He,1)},emit(Ue){globalState[me].value!==Ue&&(globalState[me].value=Ue,globalState[me].callbacks.forEach(He=>{ue!==He&&He(Ue)}))}}),usePersistedState=(me,ue,{get:Qe,set:Ue})=>{const He=React.useRef(null),[Ge,Xe]=React.useState(()=>Qe(ue,me));return useEventListener("storage",({key:Ke,newValue:$e})=>{if(Ke===ue){const Je=JSON.parse($e);Ge!==Je&&Xe(Je)}}),React.useEffect(()=>(He.current=createGlobalState(ue,Xe,me),()=>{var Ke,$e;($e=(Ke=He==null?void 0:He.current)==null?void 0:Ke.deregister)==null||$e.call(Ke)}),[]),React.useEffect(()=>{var Ke,$e;Ue(ue,Ge),($e=(Ke=He==null?void 0:He.current)==null?void 0:Ke.emit)==null||$e.call(Ke,Ge)},[ue,Ue,Ge]),[Ge,Xe]},createStorage=me=>({get(ue,Qe){const Ue=me.getItem(ue);return Ue===null?typeof Qe=="function"?Qe():Qe:JSON.parse(Ue)},set(ue,Qe){me.setItem(ue,JSON.stringify(Qe))}}),createPersistedState=(me,ue)=>{if(!ue&&typeof window<"u")try{ue=localStorage}catch{ue=null}if(ue){const Qe=createStorage(ue);return Ue=>usePersistedState(Ue,me,Qe)}return React.useState},useSessionState=createPersistedState("sessionData");function usePermissions(){const[me,ue]=React.useState(!1),[Qe,Ue]=React.useState(!1);return React.useEffect(()=>{var He;if(!navigator.permissions){Ue(!0);return}(He=navigator.permissions)==null||He.query({name:"camera"}).then(function(Ge){Ge.state==="granted"&&(ue(!0),Ue(!1)),Ge.state==="prompt"&&Ue(!0)}).catch(()=>{ue(!1),Ue(!1)})},[]),[me,ue,Qe]}function useInterval(me,ue){const Qe=React.useRef(me),Ue=React.useRef(null);return Qe.current=me,React.useEffect(()=>{function He(){Qe.current()}if(ue!==null)return Ue.current=setInterval(He,ue),()=>clearInterval(Ue.current)},[ue]),Ue.current}const resize=async()=>{await sleep(100);const me=window.innerWidth*.01,ue=window.innerHeight*.01;document.documentElement.style.setProperty("--vw",`${me}px`),document.documentElement.style.setProperty("--vh",`${ue}px`)},useResize=me=>{const{isRotated:ue}=useOrientation();useEventListener("resize",()=>{mobile.any()&&!me||resize()},window),React.useLayoutEffect(()=>{mobile.any()&&ue&&!me||resize()},[ue,me])},isPortrait=()=>{var me;return((me=screen.orientation)==null?void 0:me.type.includes("portrait"))||Math.abs(window.orientation)===0};function useOrientation(){const me=getUxType(),ue=me==="mobile"?!1:!isPortrait(),[Qe,Ue]=React.useState(ue),He=mobile.isDesktop();return React.useEffect(()=>{if(me==="mobile")return;function Ge(){Ue(!isPortrait()),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),window.focus()}return screen.orientation?screen.orientation.addEventListener("change",Ge):window.addEventListener("orientationchange",Ge),()=>{screen.orientation?screen.orientation.removeEventListener("change",Ge):window.removeEventListener("orientationchange",Ge)}},[me]),useEventListener("resize",()=>{isMobile&&Ue(!isPortrait())},window),{isRotated:He?!1:Qe}}const handleUnmountRoot=(me,ue,Qe)=>(...Ue)=>{setTimeout(()=>{if(me(...Ue),"createRoot"in ReactDOM__namespace)ue.unmount();else if(typeof ReactDOM__namespace.unmountComponentAtNode=="function")ReactDOM__namespace.unmountComponentAtNode(Qe);else throw new Error("Unsupported React version")},0)},createRoot$1=me=>{if("createRoot"in ReactDOM__namespace)return ReactDOM__namespace.createRoot(me);if(typeof ReactDOM__namespace.render=="function")return ReactDOM__namespace.render;throw new Error("Unsupported React version")},customRender=(me,ue,Qe)=>{if("createRoot"in ReactDOM__namespace)Qe.render(me);else if(typeof Qe=="function")Qe(me,ue);else throw new Error("Unsupported React version")};function useQuery(){return React.useMemo(()=>new URLSearchParams(window.location.search),[])}function useSteps(me=0){const[ue,Qe]=React.useState(me),Ue=React.useCallback(()=>{Qe(He=>He+1)},[]);return{currentStep:ue,setStep:Qe,nextStep:Ue}}function useOffline(me=emptyFunc){useEventListener("offline",()=>{navigator.onLine||me()})}function useToggle(me=!1){const[ue,Qe]=React.useState(me);return{state:ue,actions:{on:()=>{Qe(!0)},off:()=>{Qe(!1)},toggle:()=>{Qe(He=>!He)},reset:()=>{Qe(me)}}}}function useClickOutside(me,ue){const Qe=React.useRef();React.useEffect(()=>{Qe.current=ue;const Ue=He=>{var Ge;!(me!=null&&me.current)||(Ge=me==null?void 0:me.current)!=null&&Ge.contains(He.target)||ue()};return document.addEventListener("mousedown",Ue,!0),document.addEventListener("touchstart",Ue,!0),()=>{document.removeEventListener("mousedown",Ue),document.removeEventListener("touchstart",Ue)}},[ue,me])}const useAutoFocus=(me,ue=!1)=>{React.useEffect(()=>(me.current&&me.current.focus(),()=>{ue&&me.current&&me.current.blur()}),[me,ue])};let _deviceId=null;function useDeviceId(){const[me,ue]=React.useState(_deviceId);return[me,Ue=>{_deviceId=Ue,ue(Ue)}]}const backCameraKeywords=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"],cameraObjects=new Map;let getCamerasPromise;function isBackCameraLabel(me){const ue=me.toLowerCase();return backCameraKeywords.some(Qe=>ue.includes(Qe))}function createCamera(me,ue,Qe){var Ze,nt;if(cameraObjects.has(me.deviceId))return cameraObjects.get(me.deviceId);const Ue=me.label,He=me.getCapabilities(),Ge=(Ze=He==null?void 0:He.width)==null?void 0:Ze.max,Xe=(nt=He==null?void 0:He.height)==null?void 0:nt.max,Ke=He==null?void 0:He.aspectRatio;let $e;Qe.every(tt=>tt.label==="")?$e=Qe.length===1||ue+1<=Qe.length/2?"front":"back":$e=isBackCameraLabel(Ue)?"back":"front";const Je={deviceId:me.deviceId,label:Ue,cameraType:$e,width:Ge,height:Xe,aspectRatio:Ke};return cameraObjects.set(me.deviceId,Je),Je}function extractCamerasFromDevices(me){const ue=me.filter(Qe=>Qe.kind==="videoinput").map(createCamera);if(ue.length>1&&!ue.some(Qe=>Qe.cameraType==="back")){let Qe=ue.length-1;const Ue=ue.map(He=>{const Ge=He.label.match(/\b([0-9]+)MP?\b/i);return Ge!=null?parseInt(Ge[1],10):NaN});Ue.some(He=>isNaN(He))||(Qe=Ue.lastIndexOf(Math.max(...Ue))),ue[Qe].cameraType="back"}return ue}function adjustCamerasFromCameraStream(me,ue){const Qe=me.getSettings(),Ue=ue.find(He=>He.deviceId===Qe.deviceId||He.label!==""&&He.label===me.label);if(Ue!==void 0){if((Qe!=null&&Qe.facingMode==="environment"||isBackCameraLabel(me.label))&&ue.length>1)return ue.forEach(Ge=>{Ge.deviceId===Ue.deviceId?Ge.cameraType="back":isBackCameraLabel(Ge.label)||(Ge.cameraType="front")}),ue.filter(Ge=>Ge.cameraType==="back").sort((Ge,Xe)=>Ge.label.localeCompare(Xe.label))[0];if(ue.length===1)return Ue}}function getCameras(){return getCamerasPromise!=null||(getCamerasPromise=new Promise(async me=>{const ue=await navigator.mediaDevices.enumerateDevices(),Qe=extractCamerasFromDevices(ue);return me(Qe)})),getCamerasPromise}function getUserMediaVideoParams(me){const ue={resizeMode:"none",facingMode:"environment"};switch(me){case 0:return{...ue,height:{ideal:720},aspectRatio:{ideal:19.5/9}};case 1:return{...ue,width:{min:3200,ideal:3840,max:4096},height:{min:1800,ideal:2160,max:2400}};case 2:return{...ue,width:{min:1400,ideal:1920,max:2160},height:{min:900,ideal:1080,max:1440}};case 3:return{...ue,width:{min:640,ideal:640,max:800},height:{min:480,ideal:480,max:600}};case 4:return{...ue,width:{min:640,ideal:800,max:960},height:{min:480,ideal:480,max:480}};default:return{}}}const selfieConstraints={video:{facingMode:"user",height:{ideal:480},width:{ideal:640}}},killStream=(me,ue=!1)=>{if(ue){me.getVideoTracks().forEach(Qe=>Qe.stop());return}me.getTracks().forEach(Qe=>Qe.stop())},selfieChecks=({confidence:me,isBright:ue,hasLenses:Qe,hasFaceMask:Ue,hasClosedEyes:He,hasHeadCover:Ge})=>{const Xe=me===0,Ke=ue,$e=!Qe,Je=!Ue,Ze=!He,nt=!Ge;return{livenessPassed:Xe,brightnessPassed:Ke,lensesPassed:$e,maskPassed:Je,closedEyesPassed:Ze,headCoverPassed:nt,hasErrors:!Xe||!Ke||!$e||!Je||!Ze||!nt}},logSelfieChecks=(me,ue,Qe,Ue,He)=>{const Ge=[{passed:ue.headCoverPassed,log:"headCoverDected",notification:"notifications.removeHeadwear",message:"Lenses detected"},{passed:ue.lensesPassed,log:"lensesDetected",notification:"notifications.lenses",message:"Lenses detected"},{passed:ue.brightnessPassed,log:"badBrightness",notification:"notifications.brightness",message:"Bad brightness"},{passed:ue.maskPassed,log:"badMask",notification:"notifications.mask",message:"Mask detected"},{passed:ue.livenessPassed,log:"spoofAttempt",notification:"notifications.spoof",message:"Spoof attempt detected"},{passed:ue.closedEyesPassed,log:"closedEyes",notification:"notifications.closedEyes",message:"Closed eyes detected"}];for(const{passed:Xe,log:Ke,message:$e,notification:Je}of Ge)if(!Xe){Qe(getLogObject(Ke,{response:me,message:$e})),Ue(He(Je));break}},getIdealContraintsDefault=(me=720)=>({audio:!1,video:{resizeMode:"none",facingMode:"environment",height:{ideal:me},aspectRatio:{ideal:19.5/9}}}),getStream=async(me,ue=0)=>{if(me==="user")return navigator.mediaDevices.getUserMedia(selfieConstraints);if(mobile.iOS()){const Ue=await navigator.mediaDevices.getUserMedia(getIOSConstraints());return await Ue.getVideoTracks()[0].applyConstraints({advanced:[{focusDistance:1}]}),Ue}try{const Ue=await getCameras(),He=await navigator.mediaDevices.getUserMedia({video:getUserMediaVideoParams(ue)}),Ge=He.getVideoTracks()[0],Xe=adjustCamerasFromCameraStream(Ge,Ue);killStream(He);let Ke=1280,$e=720;if(ue>1){const{width:nt,height:tt}=getUserMediaVideoParams(ue);Ke=nt.ideal,$e=tt.ideal}const Je={video:{deviceId:{exact:Xe.deviceId},width:{ideal:Ke},height:{ideal:$e}}};return await navigator.mediaDevices.getUserMedia(Je)}catch(Ue){if(ue===5)throw Ue;return getStream(me,ue+1)}},getIOSConstraints=()=>getIdealContraintsDefault(localStorage.getItem("isHighPerformance")==="true"?1080:720);async function chooseNonUltraFrontCameraMultilingual(){const me=["front","frontal","vorderseite","avant","前面","正面","앞"],ue=["ultra","ウルトラ","울트라"];try{const Ue=(await navigator.mediaDevices.enumerateDevices()).find(He=>{const Ge=He.label.toLowerCase();return He.kind==="videoinput"&&me.some(Xe=>Ge.includes(Xe.toLowerCase()))&&!ue.some(Xe=>Ge.includes(Xe.toLowerCase()))});return Ue?Ue.deviceId:null}catch{return null}}async function getNonUltraWideFrontCameraStream(){const me=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user"},audio:!1});killStream(me);const ue=await chooseNonUltraFrontCameraMultilingual();return navigator.mediaDevices.getUserMedia({video:{deviceId:ue}})}const zoomCameraToTheMax=async me=>{const ue=me.getVideoTracks()[0],Qe=ue.getCapabilities();return Qe.zoom?await zoomCamera(ue,Qe.zoom.max):!1},zoomCamera=async(me,ue)=>{if(!me)return!1;const Qe=me.getSettings(),Ue=me.getCapabilities();return"zoom"in Qe||Ue.zoom?(await me.applyConstraints({advanced:[{zoom:Ue.zoom.min&&ue<Ue.zoom.min||Ue.zoom.max&&ue>Ue.zoom.max||ue}]}),!0):!1};async function base64ToImageData(me){const Qe=await(await fetch(`data:image/jpeg;base64,${me}`)).blob(),Ue=new Image,He=new Promise((Ke,$e)=>{Ue.onload=Ke,Ue.onerror=$e});Ue.src=URL.createObjectURL(Qe),await He;const Ge=document.createElement("canvas");Ge.width=Ue.width,Ge.height=Ue.height;const Xe=Ge.getContext("2d");return Xe.drawImage(Ue,0,0),Xe.getImageData(0,0,Ue.width,Ue.height)}function getChosenCameraInfo(me,ue=null,Qe=null){const Ue=me.getCapabilities(),He=me.getSettings(),{focusMode:Ge=!1}=navigator.mediaDevices.getSupportedConstraints();return{label:me.label,deviceId:He.deviceId,fallbackOption:ue,videoSource:Qe,resolution:`${He.width}x${He.height}`,autofocus:Ge,facingMode:He.facingMode,currentFrameRate:He.frameRate,zoom:Ue.zoom?{current:He.zoom,min:Ue.zoom.min,max:Ue.zoom.max,step:Ue.zoom.step}:void 0,focusDistance:Ue.focusDistance?{current:He.focusDistance,min:Ue.focusDistance.min,max:Ue.focusDistance.max,step:Ue.focusDistance.step}:void 0}}async function getDeviceCapabilities(){const me={};try{(await navigator.mediaDevices.enumerateDevices()).filter(Ue=>Ue.kind==="videoinput").forEach((Ue,He)=>{const Ge=Ue.getCapabilities();me[`camera${He+1}`]={label:Ue.label,width:{min:Ge.width.min,max:Ge.width.max},height:{min:Ge.height.min,max:Ge.height.max},frameRate:{min:Ge.frameRate.min,max:Ge.frameRate.max},facingMode:Ge.facingMode,focusMode:Ge.focusMode||void 0,focusDistance:Ge.focusDistance?{min:Ge.focusDistance.min,max:Ge.focusDistance.max}:void 0}})}catch(ue){console.log("Unable to get device capabilities: ",ue)}return me}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(me){exports.api=me}const deviceStatsQueue=[];let isReady=!1;function addDeviceStats(me,ue){if(!isReady){deviceStatsQueue.push(ue);return}return exports.api.post("/omni/device/stats",ue,{headers:{"X-Incode-Hardware-Id":me}}).catch(()=>{})}function emptyDeviceStatsQueue(me){isReady=!0,deviceStatsQueue.forEach(ue=>{addDeviceStats(me,ue)})}const eventsQueue=[];function addEvent(me){const{token:ue,code:Qe,module:Ue,screen:He,clientTimestamp:Ge,payload:Xe={}}=me;if(!ue){eventsQueue.push(me);return}return exports.api.post("/omni/interview-events",[{code:Qe,module:Ue,screen:He,clientTimestamp:Ge??new Date().getTime(),payload:Xe}],{headers:{"X-Incode-Hardware-Id":ue}}).catch(()=>{})}function emptyQueue(me){eventsQueue.forEach(ue=>{addEvent({...ue,token:me})})}const state={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=me=>(options={...options,...me},options);var PipelineProfileName=(me=>(me[me.IdCapture_2_01=0]="IdCapture_2_01",me[me.IdVideoSelfie_2_01=1]="IdVideoSelfie_2_01",me[me.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",me))(PipelineProfileName||{});class PipelineProfile{constructor(ue,Qe,Ue,He,Ge,Xe=null,Ke=""){this.pipelineType=ue,this.name=Qe,this.detectionType=Ue,this.modelNames=He,this.parameters=Ge,this.paramsConfigurator=Xe,this.description=Ke}reconfigureParams(ue=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,ue)}}var DetectionType=(me=>(me[me.IDCapture=0]="IDCapture",me[me.Selfie=1]="Selfie",me[me.IdVideoSelfie=2]="IdVideoSelfie",me))(DetectionType||{}),WasmPipelineType=(me=>(me[me.IdCapturePipeline=0]="IdCapturePipeline",me[me.IdVideoSelfiePipeline=1]="IdVideoSelfiePipeline",me[me.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",me[me.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",me[me.IdFaceDetectionPipeline=4]="IdFaceDetectionPipeline",me))(WasmPipelineType||{});function IdCaptureParamsConfigurator(me,ue,Qe){Object.assign(me,{areaDown:Qe?55e3:25e3,areaUp:Qe?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:ue==WasmPipelineType.IdCapturePipeline?125:180,widthIOSDown:ue==WasmPipelineType.IdCapturePipeline?85:150,widthDown:Qe?185:135,widthUp:Qe?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.59},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdCapturePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics")];function getProfile(me){const ue=pipelineProfiles.find(Qe=>Qe.name===me);if(!ue)throw new Error(`Profile not found for type: ${me}`);return ue}const probabilityThreshold=.6,wasmVersion="v1.8.8",pipelineBundles=new Map([["selfieAggregationMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithAggregationMetrics]],["selfieQualityMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithQualityMetrics]]]);function switchBundle(){return Math.random()<probabilityThreshold?"selfieAggregationMetrics":"selfieQualityMetrics"}function getInitializationParams(me){const Qe=me?switchBundle():"selfieAggregationMetrics",Ue="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",He=`${Ue}/${wasmVersion}/webLib.wasm`,Ge=`${Ue}/${wasmVersion}/webLibSimd.wasm`,Xe=`${Ue}/${wasmVersion}/webLib.js`,Ke=`${Ue}/${wasmVersion}/versions.json`;let $e=new Map,Je=new Map;for(const Ze of pipelineBundles.get(Qe)){const nt=getProfile(Ze);if(!nt)throw new Error(`Profile not found: ${Ze}`);const tt=nt.modelNames;let et=[];for(const rt of tt)et.push(`${Ue}/${wasmVersion}/models/${rt}`);$e.set(nt.pipelineType,et),Je.set(nt.detectionType,nt)}return{wasmModulePath:He,wasmSimdModulePath:Ge,glueCodePath:Xe,versionsFilePath:Ke,pipelineModels:$e,enableSIMD:!0,bundle:Qe,profiles:Je,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async ue=>{this.Module=(await import(ue)).Module}}async initialize(ue,Qe,Ue,He,Ge,Xe){await this.freeResources(),this.pipelines_=Xe,this.versionsFile=Ge,await this.loadModule(Ue);const Ke=await this.loadWasm(He,ue,Qe);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,Ke}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(ue,Qe){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(ue&&Qe&&ue==this.imageWidth_&&Qe==this.imageHeight_&&this.inputImageBuffer&&ue*Qe*4===this.inputImageBuffer.length)&&(this.imageWidth_=ue,this.imageHeight_=Qe,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(ue,Qe,4))}async handleDetectionCallAndUpdateState(ue){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.toWasmEnum(ue))}async encryptImage(ue){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(ue)}isVirtualCamera(ue){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),ue)return this.wasmApiHelpers.isVirtualCamera(ue)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(ue){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(ue.width,ue.height),this.inputImageBuffer.set(ue.data),this.wasmApiHelpers.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(ue){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.toWasmEnum(ue))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[ue,Qe]of this.pipelines_)this.resetPipeline(ue)}async process(ue,Qe){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(ue.data),Qe){case WasmPipelineType.IdCapturePipeline:return this.idCaptureWasmApi.runIdCapturePipeline();case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.toWasmEnum(Qe));default:throw new Error("Unknown pipeline type")}}async runIdCapture(ue){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(ue){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(ue.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceDetectionThresholds(ue,Qe,Ue,He,Ge,Xe,Ke){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke)}async setFaceAttributesThresholds(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceAttributesEnabled(ue,Qe,Ue,He,Ge){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.toWasmEnum(ue),Qe,Ue,He,Ge)}async setFaceDetectionMode(ue,Qe){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.toWasmEnum(ue),Qe)}async setFaceDetectionCallbacks(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et,rt,it,ot,at){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et,rt,it,ot,at)}async setIdCaptureThresholds(ue,Qe,Ue,He,Ge,Xe){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe)}async setIdCaptureCallbacks(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt)}async setIdCaptureGeometryParams(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt,et)}async setIdCaptureConfigParams(ue,Qe,Ue,He,Ge,Xe){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.toWasmEnum(ue),Qe,Ue,He,Ge,Xe)}async getVersions(){const Qe=await(await fetch(this.versionsFile)).text();return JSON.parse(Qe)}async loadWasm(ue,Qe,Ue){const He=ue?Ue:Qe;try{window.wasmArrayBuffer=await fetch(He).then(Ge=>Ge.arrayBuffer()).then(Ge=>new Uint8Array(Ge)),this.wasmModule=await this.Module()}catch(Ge){if(console.log(Ge,ue,"useSmd"),ue)return await this.loadWasm(!1,Qe,Ue);throw Ge}return ue}async loadModels(){var He;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let ue=new this.wasmModule.PipelineTypeToIntMap,Qe=new Map,Ue=new Map;for(let[Ge,Xe]of this.pipelines_){let Ke=this.toWasmEnum(Ge),$e=[],Je=new this.wasmModule.VectorInt;for(let Ze of Xe){if(!Ue.has(Ze)){let tt=await fetch(Ze).then(et=>et.arrayBuffer()).then(et=>new Uint8Array(et));Ue.set(Ze,tt)}let nt=Ue.get(Ze);Je.push_back(nt.byteLength),$e.push(nt)}ue.set(Ke,Je),Qe.set(Ke,$e)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(ue);for(let[Ge,Xe]of Qe){let Ke=(He=this.modelsBuffers)==null?void 0:He.get(Ge);for(let $e=0;$e<Ke.size();$e++){let Je=Ke==null?void 0:Ke.get($e);if(Je)Je.set(Xe[$e]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.wasmApiHelpers.initializePipelines()}async setProductionMode(ue){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(ue)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.fromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}toWasmEnum(ue){switch(ue){case WasmPipelineType.IdCapturePipeline:return this.wasmModule.PipelineType.IdCapturePipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}fromWasmEnum(ue){switch(ue){case this.wasmModule.PipelineType.IdCapturePipeline:return WasmPipelineType.IdCapturePipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}checkWasmInitialization(ue){if(!this.isInitialized())throw new Error(ue)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(ue,Qe,Ue,He,Ge,Xe,Ke,$e,Je,Ze,nt,tt){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(et=>{document.addEventListener("click",async()=>{const rt=await this.requestMotionPermission();et(rt)},{once:!0})}),this.deviceMotionListener=et=>{if(et.accelerationIncludingGravity){const rt={x:et.accelerationIncludingGravity.x,y:et.accelerationIncludingGravity.y,z:et.accelerationIncludingGravity.z};this.checkFields(rt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,rt))}if(et.acceleration){const rt={x:et.acceleration.x,y:et.acceleration.y,z:et.acceleration.z};this.checkFields(rt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,rt))}if(et.rotationRate){const rt={x:et.rotationRate.alpha,y:et.rotationRate.beta,z:et.rotationRate.gamma};this.checkFields(rt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,rt))}},this.deviceOrientationListener=et=>{const rt={x:et.alpha,y:et.beta,z:et.gamma};this.checkFields(rt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,rt))},this.accThreshold_=ue,this.gyroThreshold_=Qe,this.accGrOldThreshold_=Ue,this.accOldThreshold_=He,this.gyroscopeOldThreshold_=Ge,this.orientationOldThreshold_=Xe,this.maeAccThreshold_=Ke,this.maeGyroThreshold_=$e,this.maeAccGrOldThreshold_=Je,this.maeAccOldThreshold_=Ze,this.maeGyroscopeOldThreshold_=nt,this.maeOrientationOldThreshold_=tt}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(ue=>{ue!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const ue={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(ue)&&this.updateParams(this.paramsAcc_,ue)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const ue={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(ue)&&this.updateParams(this.paramsGyro_,ue)}}check(){if(!this.permission_)return"UNCLEAR";const ue=this.checkStability();return ue===null?"UNCLEAR":ue?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Qe=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(Ke=>Ke!==null),Ue=Qe.length>0?Qe.every(Ke=>Ke):null,Ge=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(Ke=>Ke!==null),Xe=Ge.length>0?Ge.every(Ke=>Ke):null;return Ue===null?Xe===null?null:Xe:Xe!==null?Ue&&Xe:Ue}updateParams(ue,Qe){const Ue=Qe.x-ue.meanX,He=Qe.y-ue.meanY,Ge=Qe.z-ue.meanZ;ue.meanX+=Ue/ue.ptsNum,ue.meanY+=He/ue.ptsNum,ue.meanZ+=Ge/ue.ptsNum,ue.m2X+=Ue*(Qe.x-ue.meanX),ue.m2Y+=He*(Qe.y-ue.meanY),ue.m2Z+=Ge*(Qe.z-ue.meanZ),ue.cumulativeAbsErrorX+=Math.abs(Qe.x-ue.meanX),ue.cumulativeAbsErrorY+=Math.abs(Qe.y-ue.meanY),ue.cumulativeAbsErrorZ+=Math.abs(Qe.z-ue.meanZ)}calculateStd(ue){const Qe={x:ue.m2X/ue.ptsNum,y:ue.m2Y/ue.ptsNum,z:ue.m2Z/ue.ptsNum};return{x:Math.sqrt(Qe.x),y:Math.sqrt(Qe.y),z:Math.sqrt(Qe.z)}}calculateMae(ue){return{x:ue.cumulativeAbsErrorX/ue.ptsNum,y:ue.cumulativeAbsErrorY/ue.ptsNum,z:ue.cumulativeAbsErrorZ/ue.ptsNum}}checkFields(ue){return ue.x!==null&&ue.y!==null&&ue.z!==null}isBelowStdThreshold(ue,Qe){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ue=this.calculateStd(ue);return Ue.x<Qe&&Ue.y<Qe&&Ue.z<Qe}isBelowMaeThreshold(ue,Qe){if(ue.ptsNum<this.minNumberOfFrames_)return null;const Ue=this.calculateMae(ue);return Ue.x<Qe&&Ue.y<Qe&&Ue.z<Qe}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs="",this.pipelinesBundle=null,this.simdIsEnabled=null,this.wasmVersion=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setPipelinesBundle(ue){this.pipelinesBundle=ue}setSimdIsEnabled(ue){this.simdIsEnabled=ue}setWasmVersion(ue){this.wasmVersion=ue}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(ue){const Qe=await base64ToImageData(ue);await MlWasmJSApi$1.analyzeFrame(Qe),this.updatePipelineStats()}async checkForVirtualCameraByLabel(ue=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!ue){const Ue=await getDeviceCapabilities();for(const He of Object.keys(Ue)){const Ge=Ue[He];if(MlWasmJSApi$1.isVirtualCamera(Ge==null?void 0:Ge.label)){const Xe={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Xe}}}const Qe=getChosenCameraInfo(ue);if(MlWasmJSApi$1.isVirtualCamera(Qe==null?void 0:Qe.label)){const Ue={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ue}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Qe){console.log(`Exception: ${Qe}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const ue=MlWasmJSApi$1.getPipelineState();if(ue!==""){const Qe=JSON.parse(ue);this.analysisStatus=Qe.statsAnalysisStatus,Qe.pipelinesBundle=this.pipelinesBundle?this.pipelinesBundle:"unknown",Qe.estimatedPerformance=this.estimatedPerformance,Qe.simdIsEnabled=this.simdIsEnabled,Qe.wasmVersion=this.wasmVersion,this.pipelineLogs=JSON.stringify(Qe),this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(ue){console.error(`Exception: ${ue}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,PACKAGE_VERSION:"1.75.2"};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.pipelinesBundle=null,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getPipelinesBundle(){return this.pipelinesBundle}getProfile(ue){var Qe;return((Qe=this.profiles)==null?void 0:Qe.get(ue))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(ue=>setTimeout(ue,100))}async _runSetupDetect(){var Ge,Xe,Ke;if(this.isSetupDetect)return;addEvent({token:(Ge=state.token)==null?void 0:Ge.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const ue=getInitializationParams(options.hostingApp==="Incode ID");this.pipelinesBundle=ue.bundle,this.profiles=ue.profiles,OnboardingAnalytics$1.setPipelinesBundle(this.pipelinesBundle),OnboardingAnalytics$1.startOnboardingCheck();const Qe=await MlWasmJSApi$1.initialize(ue.wasmModulePath,ue.wasmSimdModulePath,ue.glueCodePath,ue.enableSIMD,ue.versionsFilePath,ue.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise($e=>setTimeout($e,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(ue.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(Qe);const Ue=await OnboardingAnalytics$1.checkForVirtualCameraByLabel();Ue!=null&&Ue.isDetected&&!Ue.hasPriorDetection&&addDeviceStats((Xe=state.token)==null?void 0:Xe.token,{cameraLabelInspectionStatus:"FAIL"}),await MlWasmJSApi$1.initializePipelines();const He=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(He)}catch($e){console.error(`Exception: ${$e}`)}this.isSetupDetect=!0,addEvent({token:(Ke=state.token)==null?void 0:Ke.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(me){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$a(me)}function _classCallCheck$m(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function toPrimitive(me,ue){if(_typeof$a(me)!="object"||!me)return me;var Qe=me[Symbol.toPrimitive];if(Qe!==void 0){var Ue=Qe.call(me,ue||"default");if(_typeof$a(Ue)!="object")return Ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ue==="string"?String:Number)(me)}function toPropertyKey(me){var ue=toPrimitive(me,"string");return _typeof$a(ue)=="symbol"?ue:String(ue)}function _defineProperties$9(me,ue){for(var Qe=0;Qe<ue.length;Qe++){var Ue=ue[Qe];Ue.enumerable=Ue.enumerable||!1,Ue.configurable=!0,"value"in Ue&&(Ue.writable=!0),Object.defineProperty(me,toPropertyKey(Ue.key),Ue)}}function _createClass$l(me,ue,Qe){return ue&&_defineProperties$9(me.prototype,ue),Qe&&_defineProperties$9(me,Qe),Object.defineProperty(me,"prototype",{writable:!1}),me}function _assertThisInitialized$1(me){if(me===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return me}function _setPrototypeOf$1(me,ue){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ue,He){return Ue.__proto__=He,Ue},_setPrototypeOf$1(me,ue)}function _inherits$c(me,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function");me.prototype=Object.create(ue&&ue.prototype,{constructor:{value:me,writable:!0,configurable:!0}}),Object.defineProperty(me,"prototype",{writable:!1}),ue&&_setPrototypeOf$1(me,ue)}function _possibleConstructorReturn$c(me,ue){if(ue&&(_typeof$a(ue)==="object"||typeof ue=="function"))return ue;if(ue!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(me)}function _getPrototypeOf$1(me){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Qe){return Qe.__proto__||Object.getPrototypeOf(Qe)},_getPrototypeOf$1(me)}function _defineProperty$6(me,ue,Qe){return ue=toPropertyKey(ue),ue in me?Object.defineProperty(me,ue,{value:Qe,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Qe,me}function _arrayWithHoles$3(me){if(Array.isArray(me))return me}function _iterableToArray(me){if(typeof Symbol<"u"&&me[Symbol.iterator]!=null||me["@@iterator"]!=null)return Array.from(me)}function _arrayLikeToArray$b(me,ue){(ue==null||ue>me.length)&&(ue=me.length);for(var Qe=0,Ue=new Array(ue);Qe<ue;Qe++)Ue[Qe]=me[Qe];return Ue}function _unsupportedIterableToArray$b(me,ue){if(me){if(typeof me=="string")return _arrayLikeToArray$b(me,ue);var Qe=Object.prototype.toString.call(me).slice(8,-1);if(Qe==="Object"&&me.constructor&&(Qe=me.constructor.name),Qe==="Map"||Qe==="Set")return Array.from(me);if(Qe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Qe))return _arrayLikeToArray$b(me,ue)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
12
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toArray(me){return _arrayWithHoles$3(me)||_iterableToArray(me)||_unsupportedIterableToArray$b(me)||_nonIterableRest$3()}function ownKeys$8(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$8(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$8(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$8(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}var consoleLogger={type:"logger",log:function(ue){this.output("log",ue)},warn:function(ue){this.output("warn",ue)},error:function(ue){this.output("error",ue)},output:function(ue,Qe){console&&console[ue]&&console[ue].apply(console,Qe)}},Logger=function(){function me(ue){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.init(ue,Qe)}return _createClass$l(me,[{key:"init",value:function(Qe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=Ue.prefix||"i18next:",this.logger=Qe||consoleLogger,this.options=Ue,this.debug=Ue.debug}},{key:"setDebug",value:function(Qe){this.debug=Qe}},{key:"log",value:function(){for(var Qe=arguments.length,Ue=new Array(Qe),He=0;He<Qe;He++)Ue[He]=arguments[He];return this.forward(Ue,"log","",!0)}},{key:"warn",value:function(){for(var Qe=arguments.length,Ue=new Array(Qe),He=0;He<Qe;He++)Ue[He]=arguments[He];return this.forward(Ue,"warn","",!0)}},{key:"error",value:function(){for(var Qe=arguments.length,Ue=new Array(Qe),He=0;He<Qe;He++)Ue[He]=arguments[He];return this.forward(Ue,"error","")}},{key:"deprecate",value:function(){for(var Qe=arguments.length,Ue=new Array(Qe),He=0;He<Qe;He++)Ue[He]=arguments[He];return this.forward(Ue,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(Qe,Ue,He,Ge){return Ge&&!this.debug?null:(typeof Qe[0]=="string"&&(Qe[0]="".concat(He).concat(this.prefix," ").concat(Qe[0])),this.logger[Ue](Qe))}},{key:"create",value:function(Qe){return new me(this.logger,_objectSpread$8(_objectSpread$8({},{prefix:"".concat(this.prefix,":").concat(Qe,":")}),this.options))}},{key:"clone",value:function(Qe){return Qe=Qe||this.options,Qe.prefix=Qe.prefix||this.prefix,new me(this.logger,Qe)}}]),me}(),baseLogger=new Logger,EventEmitter$6=function(){function me(){_classCallCheck$m(this,me),this.observers={}}return _createClass$l(me,[{key:"on",value:function(Qe,Ue){var He=this;return Qe.split(" ").forEach(function(Ge){He.observers[Ge]=He.observers[Ge]||[],He.observers[Ge].push(Ue)}),this}},{key:"off",value:function(Qe,Ue){if(this.observers[Qe]){if(!Ue){delete this.observers[Qe];return}this.observers[Qe]=this.observers[Qe].filter(function(He){return He!==Ue})}}},{key:"emit",value:function(Qe){for(var Ue=arguments.length,He=new Array(Ue>1?Ue-1:0),Ge=1;Ge<Ue;Ge++)He[Ge-1]=arguments[Ge];if(this.observers[Qe]){var Xe=[].concat(this.observers[Qe]);Xe.forEach(function($e){$e.apply(void 0,He)})}if(this.observers["*"]){var Ke=[].concat(this.observers["*"]);Ke.forEach(function($e){$e.apply($e,[Qe].concat(He))})}}}]),me}();function defer(){var me,ue,Qe=new Promise(function(Ue,He){me=Ue,ue=He});return Qe.resolve=me,Qe.reject=ue,Qe}function makeString(me){return me==null?"":""+me}function copy(me,ue,Qe){me.forEach(function(Ue){ue[Ue]&&(Qe[Ue]=ue[Ue])})}function getLastOfPath(me,ue,Qe){function Ue(Ke){return Ke&&Ke.indexOf("###")>-1?Ke.replace(/###/g,"."):Ke}function He(){return!me||typeof me=="string"}for(var Ge=typeof ue!="string"?[].concat(ue):ue.split(".");Ge.length>1;){if(He())return{};var Xe=Ue(Ge.shift());!me[Xe]&&Qe&&(me[Xe]=new Qe),Object.prototype.hasOwnProperty.call(me,Xe)?me=me[Xe]:me={}}return He()?{}:{obj:me,k:Ue(Ge.shift())}}function setPath(me,ue,Qe){var Ue=getLastOfPath(me,ue,Object),He=Ue.obj,Ge=Ue.k;He[Ge]=Qe}function pushPath(me,ue,Qe,Ue){var He=getLastOfPath(me,ue,Object),Ge=He.obj,Xe=He.k;Ge[Xe]=Ge[Xe]||[],Ge[Xe].push(Qe)}function getPath$1(me,ue){var Qe=getLastOfPath(me,ue),Ue=Qe.obj,He=Qe.k;if(Ue)return Ue[He]}function getPathWithDefaults(me,ue,Qe){var Ue=getPath$1(me,Qe);return Ue!==void 0?Ue:getPath$1(ue,Qe)}function deepExtend(me,ue,Qe){for(var Ue in ue)Ue!=="__proto__"&&Ue!=="constructor"&&(Ue in me?typeof me[Ue]=="string"||me[Ue]instanceof String||typeof ue[Ue]=="string"||ue[Ue]instanceof String?Qe&&(me[Ue]=ue[Ue]):deepExtend(me[Ue],ue[Ue],Qe):me[Ue]=ue[Ue]);return me}function regexEscape(me){return me.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(me){return typeof me=="string"?me.replace(/[&<>"'\/]/g,function(ue){return _entityMap[ue]}):me}var isIE10=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(me,ue,Qe){ue=ue||"",Qe=Qe||"";var Ue=chars.filter(function(Ke){return ue.indexOf(Ke)<0&&Qe.indexOf(Ke)<0});if(Ue.length===0)return!0;var He=new RegExp("(".concat(Ue.map(function(Ke){return Ke==="?"?"\\?":Ke}).join("|"),")")),Ge=!He.test(me);if(!Ge){var Xe=me.indexOf(Qe);Xe>0&&!He.test(me.substring(0,Xe))&&(Ge=!0)}return Ge}function ownKeys$1$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$1$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$1$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$1$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function _createSuper$1(me){var ue=_isNativeReflectConstruct$1();return function(){var Ue=_getPrototypeOf$1(me),He;if(ue){var Ge=_getPrototypeOf$1(this).constructor;He=Reflect.construct(Ue,arguments,Ge)}else He=Ue.apply(this,arguments);return _possibleConstructorReturn$c(this,He)}}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function deepFind(me,ue){var Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(me){if(me[ue])return me[ue];for(var Ue=ue.split(Qe),He=me,Ge=0;Ge<Ue.length;++Ge){if(!He||typeof He[Ue[Ge]]=="string"&&Ge+1<Ue.length)return;if(He[Ue[Ge]]===void 0){for(var Xe=2,Ke=Ue.slice(Ge,Ge+Xe).join(Qe),$e=He[Ke];$e===void 0&&Ue.length>Ge+Xe;)Xe++,Ke=Ue.slice(Ge,Ge+Xe).join(Qe),$e=He[Ke];if($e===void 0)return;if($e===null)return null;if(ue.endsWith(Ke)){if(typeof $e=="string")return $e;if(Ke&&typeof $e[Ke]=="string")return $e[Ke]}var Je=Ue.slice(Ge+Xe).join(Qe);return Je?deepFind($e,Je,Qe):void 0}He=He[Ue[Ge]]}return He}}var ResourceStore=function(me){_inherits$c(Qe,me);var ue=_createSuper$1(Qe);function Qe(Ue){var He,Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck$m(this,Qe),He=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(He)),He.data=Ue||{},He.options=Ge,He.options.keySeparator===void 0&&(He.options.keySeparator="."),He.options.ignoreJSONStructure===void 0&&(He.options.ignoreJSONStructure=!0),He}return _createClass$l(Qe,[{key:"addNamespaces",value:function(He){this.options.ns.indexOf(He)<0&&this.options.ns.push(He)}},{key:"removeNamespaces",value:function(He){var Ge=this.options.ns.indexOf(He);Ge>-1&&this.options.ns.splice(Ge,1)}},{key:"getResource",value:function(He,Ge,Xe){var Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},$e=Ke.keySeparator!==void 0?Ke.keySeparator:this.options.keySeparator,Je=Ke.ignoreJSONStructure!==void 0?Ke.ignoreJSONStructure:this.options.ignoreJSONStructure,Ze=[He,Ge];Xe&&typeof Xe!="string"&&(Ze=Ze.concat(Xe)),Xe&&typeof Xe=="string"&&(Ze=Ze.concat($e?Xe.split($e):Xe)),He.indexOf(".")>-1&&(Ze=He.split("."));var nt=getPath$1(this.data,Ze);return nt||!Je||typeof Xe!="string"?nt:deepFind(this.data&&this.data[He]&&this.data[He][Ge],Xe,$e)}},{key:"addResource",value:function(He,Ge,Xe,Ke){var $e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},Je=this.options.keySeparator;Je===void 0&&(Je=".");var Ze=[He,Ge];Xe&&(Ze=Ze.concat(Je?Xe.split(Je):Xe)),He.indexOf(".")>-1&&(Ze=He.split("."),Ke=Ge,Ge=Ze[1]),this.addNamespaces(Ge),setPath(this.data,Ze,Ke),$e.silent||this.emit("added",He,Ge,Xe,Ke)}},{key:"addResources",value:function(He,Ge,Xe){var Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var $e in Xe)(typeof Xe[$e]=="string"||Object.prototype.toString.apply(Xe[$e])==="[object Array]")&&this.addResource(He,Ge,$e,Xe[$e],{silent:!0});Ke.silent||this.emit("added",He,Ge,Xe)}},{key:"addResourceBundle",value:function(He,Ge,Xe,Ke,$e){var Je=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},Ze=[He,Ge];He.indexOf(".")>-1&&(Ze=He.split("."),Ke=Xe,Xe=Ge,Ge=Ze[1]),this.addNamespaces(Ge);var nt=getPath$1(this.data,Ze)||{};Ke?deepExtend(nt,Xe,$e):nt=_objectSpread$1$1(_objectSpread$1$1({},nt),Xe),setPath(this.data,Ze,nt),Je.silent||this.emit("added",He,Ge,Xe)}},{key:"removeResourceBundle",value:function(He,Ge){this.hasResourceBundle(He,Ge)&&delete this.data[He][Ge],this.removeNamespaces(Ge),this.emit("removed",He,Ge)}},{key:"hasResourceBundle",value:function(He,Ge){return this.getResource(He,Ge)!==void 0}},{key:"getResourceBundle",value:function(He,Ge){return Ge||(Ge=this.options.defaultNS),this.options.compatibilityAPI==="v1"?_objectSpread$1$1(_objectSpread$1$1({},{}),this.getResource(He,Ge)):this.getResource(He,Ge)}},{key:"getDataByLanguage",value:function(He){return this.data[He]}},{key:"hasLanguageSomeTranslations",value:function(He){var Ge=this.getDataByLanguage(He),Xe=Ge&&Object.keys(Ge)||[];return!!Xe.find(function(Ke){return Ge[Ke]&&Object.keys(Ge[Ke]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),Qe}(EventEmitter$6),postProcessor={processors:{},addPostProcessor:function(ue){this.processors[ue.name]=ue},handle:function(ue,Qe,Ue,He,Ge){var Xe=this;return ue.forEach(function(Ke){Xe.processors[Ke]&&(Qe=Xe.processors[Ke].process(Qe,Ue,He,Ge))}),Qe}};function ownKeys$2$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$2$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$2$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$2$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function _createSuper$1$1(me){var ue=_isNativeReflectConstruct$1$1();return function(){var Ue=_getPrototypeOf$1(me),He;if(ue){var Ge=_getPrototypeOf$1(this).constructor;He=Reflect.construct(Ue,arguments,Ge)}else He=Ue.apply(this,arguments);return _possibleConstructorReturn$c(this,He)}}function _isNativeReflectConstruct$1$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var checkedLoadedFor={},Translator=function(me){_inherits$c(Qe,me);var ue=_createSuper$1$1(Qe);function Qe(Ue){var He,Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _classCallCheck$m(this,Qe),He=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(He)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],Ue,_assertThisInitialized$1(He)),He.options=Ge,He.options.keySeparator===void 0&&(He.options.keySeparator="."),He.logger=baseLogger.create("translator"),He}return _createClass$l(Qe,[{key:"changeLanguage",value:function(He){He&&(this.language=He)}},{key:"exists",value:function(He){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(He==null)return!1;var Xe=this.resolve(He,Ge);return Xe&&Xe.res!==void 0}},{key:"extractFromKey",value:function(He,Ge){var Xe=Ge.nsSeparator!==void 0?Ge.nsSeparator:this.options.nsSeparator;Xe===void 0&&(Xe=":");var Ke=Ge.keySeparator!==void 0?Ge.keySeparator:this.options.keySeparator,$e=Ge.ns||this.options.defaultNS||[],Je=Xe&&He.indexOf(Xe)>-1,Ze=!this.options.userDefinedKeySeparator&&!Ge.keySeparator&&!this.options.userDefinedNsSeparator&&!Ge.nsSeparator&&!looksLikeObjectPath(He,Xe,Ke);if(Je&&!Ze){var nt=He.match(this.interpolator.nestingRegexp);if(nt&&nt.length>0)return{key:He,namespaces:$e};var tt=He.split(Xe);(Xe!==Ke||Xe===Ke&&this.options.ns.indexOf(tt[0])>-1)&&($e=tt.shift()),He=tt.join(Ke)}return typeof $e=="string"&&($e=[$e]),{key:He,namespaces:$e}}},{key:"translate",value:function(He,Ge,Xe){var Ke=this;if(_typeof$a(Ge)!=="object"&&this.options.overloadTranslationOptionHandler&&(Ge=this.options.overloadTranslationOptionHandler(arguments)),Ge||(Ge={}),He==null)return"";Array.isArray(He)||(He=[String(He)]);var $e=Ge.returnDetails!==void 0?Ge.returnDetails:this.options.returnDetails,Je=Ge.keySeparator!==void 0?Ge.keySeparator:this.options.keySeparator,Ze=this.extractFromKey(He[He.length-1],Ge),nt=Ze.key,tt=Ze.namespaces,et=tt[tt.length-1],rt=Ge.lng||this.language,it=Ge.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(rt&&rt.toLowerCase()==="cimode"){if(it){var ot=Ge.nsSeparator||this.options.nsSeparator;return $e?(at.res="".concat(et).concat(ot).concat(nt),at):"".concat(et).concat(ot).concat(nt)}return $e?(at.res=nt,at):nt}var at=this.resolve(He,Ge),st=at&&at.res,ut=at&&at.usedKey||nt,lt=at&&at.exactUsedKey||nt,dt=Object.prototype.toString.apply(st),At=["[object Number]","[object Function]","[object RegExp]"],pt=Ge.joinArrays!==void 0?Ge.joinArrays:this.options.joinArrays,gt=!this.i18nFormat||this.i18nFormat.handleAsObject,wt=typeof st!="string"&&typeof st!="boolean"&&typeof st!="number";if(gt&&st&&wt&&At.indexOf(dt)<0&&!(typeof pt=="string"&&dt==="[object Array]")){if(!Ge.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var Bt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(ut,st,_objectSpread$2$1(_objectSpread$2$1({},Ge),{},{ns:tt})):"key '".concat(nt," (").concat(this.language,")' returned an object instead of string.");return $e?(at.res=Bt,at):Bt}if(Je){var Tt=dt==="[object Array]",yt=Tt?[]:{},Ct=Tt?lt:ut;for(var ht in st)if(Object.prototype.hasOwnProperty.call(st,ht)){var It="".concat(Ct).concat(Je).concat(ht);yt[ht]=this.translate(It,_objectSpread$2$1(_objectSpread$2$1({},Ge),{joinArrays:!1,ns:tt})),yt[ht]===It&&(yt[ht]=st[ht])}st=yt}}else if(gt&&typeof pt=="string"&&dt==="[object Array]")st=st.join(pt),st&&(st=this.extendTranslation(st,He,Ge,Xe));else{var vt=!1,Et=!1,bt=Ge.count!==void 0&&typeof Ge.count!="string",Rt=Qe.hasDefaultValue(Ge),St=bt?this.pluralResolver.getSuffix(rt,Ge.count,Ge):"",kt=Ge["defaultValue".concat(St)]||Ge.defaultValue;!this.isValidLookup(st)&&Rt&&(vt=!0,st=kt),this.isValidLookup(st)||(Et=!0,st=nt);var jt=Ge.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Pt=jt&&Et?void 0:st,Qt=Rt&&kt!==st&&this.options.updateMissing;if(Et||vt||Qt){if(this.logger.log(Qt?"updateKey":"missingKey",rt,et,nt,Qt?kt:st),Je){var qt=this.resolve(nt,_objectSpread$2$1(_objectSpread$2$1({},Ge),{},{keySeparator:!1}));qt&&qt.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var _t=[],Yt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Ge.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Yt&&Yt[0])for(var Xt=0;Xt<Yt.length;Xt++)_t.push(Yt[Xt]);else this.options.saveMissingTo==="all"?_t=this.languageUtils.toResolveHierarchy(Ge.lng||this.language):_t.push(Ge.lng||this.language);var Ut=function(Ot,ft,Dt){var Mt=Rt&&Dt!==st?Dt:Pt;Ke.options.missingKeyHandler?Ke.options.missingKeyHandler(Ot,et,ft,Mt,Qt,Ge):Ke.backendConnector&&Ke.backendConnector.saveMissing&&Ke.backendConnector.saveMissing(Ot,et,ft,Mt,Qt,Ge),Ke.emit("missingKey",Ot,et,ft,st)};this.options.saveMissing&&(this.options.saveMissingPlurals&&bt?_t.forEach(function(Lt){Ke.pluralResolver.getSuffixes(Lt,Ge).forEach(function(Ot){Ut([Lt],nt+Ot,Ge["defaultValue".concat(Ot)]||kt)})}):Ut(_t,nt,kt))}st=this.extendTranslation(st,He,Ge,at,Xe),Et&&st===nt&&this.options.appendNamespaceToMissingKey&&(st="".concat(et,":").concat(nt)),(Et||vt)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?st=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(et,":").concat(nt):nt,vt?st:void 0):st=this.options.parseMissingKeyHandler(st))}return $e?(at.res=st,at):st}},{key:"extendTranslation",value:function(He,Ge,Xe,Ke,$e){var Je=this;if(this.i18nFormat&&this.i18nFormat.parse)He=this.i18nFormat.parse(He,_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),Xe),Ke.usedLng,Ke.usedNS,Ke.usedKey,{resolved:Ke});else if(!Xe.skipInterpolation){Xe.interpolation&&this.interpolator.init(_objectSpread$2$1(_objectSpread$2$1({},Xe),{interpolation:_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation),Xe.interpolation)}));var Ze=typeof He=="string"&&(Xe&&Xe.interpolation&&Xe.interpolation.skipOnVariables!==void 0?Xe.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),nt;if(Ze){var tt=He.match(this.interpolator.nestingRegexp);nt=tt&&tt.length}var et=Xe.replace&&typeof Xe.replace!="string"?Xe.replace:Xe;if(this.options.interpolation.defaultVariables&&(et=_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),et)),He=this.interpolator.interpolate(He,et,Xe.lng||this.language,Xe),Ze){var rt=He.match(this.interpolator.nestingRegexp),it=rt&&rt.length;nt<it&&(Xe.nest=!1)}Xe.nest!==!1&&(He=this.interpolator.nest(He,function(){for(var st=arguments.length,ut=new Array(st),lt=0;lt<st;lt++)ut[lt]=arguments[lt];return $e&&$e[0]===ut[0]&&!Xe.context?(Je.logger.warn("It seems you are nesting recursively key: ".concat(ut[0]," in key: ").concat(Ge[0])),null):Je.translate.apply(Je,ut.concat([Ge]))},Xe)),Xe.interpolation&&this.interpolator.reset()}var ot=Xe.postProcess||this.options.postProcess,at=typeof ot=="string"?[ot]:ot;return He!=null&&at&&at.length&&Xe.applyPostProcessor!==!1&&(He=postProcessor.handle(at,He,Ge,this.options&&this.options.postProcessPassResolved?_objectSpread$2$1({i18nResolved:Ke},Xe):Xe,this)),He}},{key:"resolve",value:function(He){var Ge=this,Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ke,$e,Je,Ze,nt;return typeof He=="string"&&(He=[He]),He.forEach(function(tt){if(!Ge.isValidLookup(Ke)){var et=Ge.extractFromKey(tt,Xe),rt=et.key;$e=rt;var it=et.namespaces;Ge.options.fallbackNS&&(it=it.concat(Ge.options.fallbackNS));var ot=Xe.count!==void 0&&typeof Xe.count!="string",at=ot&&!Xe.ordinal&&Xe.count===0&&Ge.pluralResolver.shouldUseIntlApi(),st=Xe.context!==void 0&&(typeof Xe.context=="string"||typeof Xe.context=="number")&&Xe.context!=="",ut=Xe.lngs?Xe.lngs:Ge.languageUtils.toResolveHierarchy(Xe.lng||Ge.language,Xe.fallbackLng);it.forEach(function(lt){Ge.isValidLookup(Ke)||(nt=lt,!checkedLoadedFor["".concat(ut[0],"-").concat(lt)]&&Ge.utils&&Ge.utils.hasLoadedNamespace&&!Ge.utils.hasLoadedNamespace(nt)&&(checkedLoadedFor["".concat(ut[0],"-").concat(lt)]=!0,Ge.logger.warn('key "'.concat($e,'" for languages "').concat(ut.join(", "),`" won't get resolved as namespace "`).concat(nt,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),ut.forEach(function(dt){if(!Ge.isValidLookup(Ke)){Ze=dt;var At=[rt];if(Ge.i18nFormat&&Ge.i18nFormat.addLookupKeys)Ge.i18nFormat.addLookupKeys(At,rt,dt,lt,Xe);else{var pt;ot&&(pt=Ge.pluralResolver.getSuffix(dt,Xe.count,Xe));var gt="".concat(Ge.options.pluralSeparator,"zero");if(ot&&(At.push(rt+pt),at&&At.push(rt+gt)),st){var wt="".concat(rt).concat(Ge.options.contextSeparator).concat(Xe.context);At.push(wt),ot&&(At.push(wt+pt),at&&At.push(wt+gt))}}for(var Bt;Bt=At.pop();)Ge.isValidLookup(Ke)||(Je=Bt,Ke=Ge.getResource(dt,lt,Bt,Xe))}}))})}}),{res:Ke,usedKey:$e,exactUsedKey:Je,usedLng:Ze,usedNS:nt}}},{key:"isValidLookup",value:function(He){return He!==void 0&&!(!this.options.returnNull&&He===null)&&!(!this.options.returnEmptyString&&He==="")}},{key:"getResource",value:function(He,Ge,Xe){var Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(He,Ge,Xe,Ke):this.resourceStore.getResource(He,Ge,Xe,Ke)}}],[{key:"hasDefaultValue",value:function(He){var Ge="defaultValue";for(var Xe in He)if(Object.prototype.hasOwnProperty.call(He,Xe)&&Ge===Xe.substring(0,Ge.length)&&He[Xe]!==void 0)return!0;return!1}}]),Qe}(EventEmitter$6);function capitalize(me){return me.charAt(0).toUpperCase()+me.slice(1)}var LanguageUtil=function(){function me(ue){_classCallCheck$m(this,me),this.options=ue,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass$l(me,[{key:"getScriptPartFromCode",value:function(Qe){if(!Qe||Qe.indexOf("-")<0)return null;var Ue=Qe.split("-");return Ue.length===2||(Ue.pop(),Ue[Ue.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(Ue.join("-"))}},{key:"getLanguagePartFromCode",value:function(Qe){if(!Qe||Qe.indexOf("-")<0)return Qe;var Ue=Qe.split("-");return this.formatLanguageCode(Ue[0])}},{key:"formatLanguageCode",value:function(Qe){if(typeof Qe=="string"&&Qe.indexOf("-")>-1){var Ue=["hans","hant","latn","cyrl","cans","mong","arab"],He=Qe.split("-");return this.options.lowerCaseLng?He=He.map(function(Ge){return Ge.toLowerCase()}):He.length===2?(He[0]=He[0].toLowerCase(),He[1]=He[1].toUpperCase(),Ue.indexOf(He[1].toLowerCase())>-1&&(He[1]=capitalize(He[1].toLowerCase()))):He.length===3&&(He[0]=He[0].toLowerCase(),He[1].length===2&&(He[1]=He[1].toUpperCase()),He[0]!=="sgn"&&He[2].length===2&&(He[2]=He[2].toUpperCase()),Ue.indexOf(He[1].toLowerCase())>-1&&(He[1]=capitalize(He[1].toLowerCase())),Ue.indexOf(He[2].toLowerCase())>-1&&(He[2]=capitalize(He[2].toLowerCase()))),He.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?Qe.toLowerCase():Qe}},{key:"isSupportedCode",value:function(Qe){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(Qe=this.getLanguagePartFromCode(Qe)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(Qe)>-1}},{key:"getBestMatchFromCodes",value:function(Qe){var Ue=this;if(!Qe)return null;var He;return Qe.forEach(function(Ge){if(!He){var Xe=Ue.formatLanguageCode(Ge);(!Ue.options.supportedLngs||Ue.isSupportedCode(Xe))&&(He=Xe)}}),!He&&this.options.supportedLngs&&Qe.forEach(function(Ge){if(!He){var Xe=Ue.getLanguagePartFromCode(Ge);if(Ue.isSupportedCode(Xe))return He=Xe;He=Ue.options.supportedLngs.find(function(Ke){if(Ke.indexOf(Xe)===0)return Ke})}}),He||(He=this.getFallbackCodes(this.options.fallbackLng)[0]),He}},{key:"getFallbackCodes",value:function(Qe,Ue){if(!Qe)return[];if(typeof Qe=="function"&&(Qe=Qe(Ue)),typeof Qe=="string"&&(Qe=[Qe]),Object.prototype.toString.apply(Qe)==="[object Array]")return Qe;if(!Ue)return Qe.default||[];var He=Qe[Ue];return He||(He=Qe[this.getScriptPartFromCode(Ue)]),He||(He=Qe[this.formatLanguageCode(Ue)]),He||(He=Qe[this.getLanguagePartFromCode(Ue)]),He||(He=Qe.default),He||[]}},{key:"toResolveHierarchy",value:function(Qe,Ue){var He=this,Ge=this.getFallbackCodes(Ue||this.options.fallbackLng||[],Qe),Xe=[],Ke=function(Je){Je&&(He.isSupportedCode(Je)?Xe.push(Je):He.logger.warn("rejecting language code not found in supportedLngs: ".concat(Je)))};return typeof Qe=="string"&&Qe.indexOf("-")>-1?(this.options.load!=="languageOnly"&&Ke(this.formatLanguageCode(Qe)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&Ke(this.getScriptPartFromCode(Qe)),this.options.load!=="currentOnly"&&Ke(this.getLanguagePartFromCode(Qe))):typeof Qe=="string"&&Ke(this.formatLanguageCode(Qe)),Ge.forEach(function($e){Xe.indexOf($e)<0&&Ke(He.formatLanguageCode($e))}),Xe}}]),me}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(ue){return+(ue>1)},2:function(ue){return+(ue!=1)},3:function(ue){return 0},4:function(ue){return ue%10==1&&ue%100!=11?0:ue%10>=2&&ue%10<=4&&(ue%100<10||ue%100>=20)?1:2},5:function(ue){return ue==0?0:ue==1?1:ue==2?2:ue%100>=3&&ue%100<=10?3:ue%100>=11?4:5},6:function(ue){return ue==1?0:ue>=2&&ue<=4?1:2},7:function(ue){return ue==1?0:ue%10>=2&&ue%10<=4&&(ue%100<10||ue%100>=20)?1:2},8:function(ue){return ue==1?0:ue==2?1:ue!=8&&ue!=11?2:3},9:function(ue){return+(ue>=2)},10:function(ue){return ue==1?0:ue==2?1:ue<7?2:ue<11?3:4},11:function(ue){return ue==1||ue==11?0:ue==2||ue==12?1:ue>2&&ue<20?2:3},12:function(ue){return+(ue%10!=1||ue%100==11)},13:function(ue){return+(ue!==0)},14:function(ue){return ue==1?0:ue==2?1:ue==3?2:3},15:function(ue){return ue%10==1&&ue%100!=11?0:ue%10>=2&&(ue%100<10||ue%100>=20)?1:2},16:function(ue){return ue%10==1&&ue%100!=11?0:ue!==0?1:2},17:function(ue){return ue==1||ue%10==1&&ue%100!=11?0:1},18:function(ue){return ue==0?0:ue==1?1:2},19:function(ue){return ue==1?0:ue==0||ue%100>1&&ue%100<11?1:ue%100>10&&ue%100<20?2:3},20:function(ue){return ue==1?0:ue==0||ue%100>0&&ue%100<20?1:2},21:function(ue){return ue%100==1?1:ue%100==2?2:ue%100==3||ue%100==4?3:0},22:function(ue){return ue==1?0:ue==2?1:(ue<0||ue>10)&&ue%10==0?2:3}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var me={};return sets.forEach(function(ue){ue.lngs.forEach(function(Qe){me[Qe]={numbers:ue.nr,plurals:_rulesPluralsTypes[ue.fc]}})}),me}var PluralResolver=function(){function me(ue){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.languageUtils=ue,this.options=Qe,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass$l(me,[{key:"addRule",value:function(Qe,Ue){this.rules[Qe]=Ue}},{key:"getRule",value:function(Qe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Qe,{type:Ue.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[Qe]||this.rules[this.languageUtils.getLanguagePartFromCode(Qe)]}},{key:"needsPlural",value:function(Qe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},He=this.getRule(Qe,Ue);return this.shouldUseIntlApi()?He&&He.resolvedOptions().pluralCategories.length>1:He&&He.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(Qe,Ue){var He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(Qe,He).map(function(Ge){return"".concat(Ue).concat(Ge)})}},{key:"getSuffixes",value:function(Qe){var Ue=this,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ge=this.getRule(Qe,He);return Ge?this.shouldUseIntlApi()?Ge.resolvedOptions().pluralCategories.sort(function(Xe,Ke){return suffixesOrder[Xe]-suffixesOrder[Ke]}).map(function(Xe){return"".concat(Ue.options.prepend).concat(Xe)}):Ge.numbers.map(function(Xe){return Ue.getSuffix(Qe,Xe,He)}):[]}},{key:"getSuffix",value:function(Qe,Ue){var He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ge=this.getRule(Qe,He);return Ge?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(Ge.select(Ue)):this.getSuffixRetroCompatible(Ge,Ue):(this.logger.warn("no plural rule found for: ".concat(Qe)),"")}},{key:"getSuffixRetroCompatible",value:function(Qe,Ue){var He=this,Ge=Qe.noAbs?Qe.plurals(Ue):Qe.plurals(Math.abs(Ue)),Xe=Qe.numbers[Ge];this.options.simplifyPluralSuffix&&Qe.numbers.length===2&&Qe.numbers[0]===1&&(Xe===2?Xe="plural":Xe===1&&(Xe=""));var Ke=function(){return He.options.prepend&&Xe.toString()?He.options.prepend+Xe.toString():Xe.toString()};return this.options.compatibilityJSON==="v1"?Xe===1?"":typeof Xe=="number"?"_plural_".concat(Xe.toString()):Ke():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&Qe.numbers.length===2&&Qe.numbers[0]===1?Ke():this.options.prepend&&Ge.toString()?this.options.prepend+Ge.toString():Ge.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),me}();function ownKeys$3$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$3$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$3$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$3$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}var Interpolator=function(){function me(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,me),this.logger=baseLogger.create("interpolator"),this.options=ue,this.format=ue.interpolation&&ue.interpolation.format||function(Qe){return Qe},this.init(ue)}return _createClass$l(me,[{key:"init",value:function(){var Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qe.interpolation||(Qe.interpolation={escapeValue:!0});var Ue=Qe.interpolation;this.escape=Ue.escape!==void 0?Ue.escape:escape$1,this.escapeValue=Ue.escapeValue!==void 0?Ue.escapeValue:!0,this.useRawValueToEscape=Ue.useRawValueToEscape!==void 0?Ue.useRawValueToEscape:!1,this.prefix=Ue.prefix?regexEscape(Ue.prefix):Ue.prefixEscaped||"{{",this.suffix=Ue.suffix?regexEscape(Ue.suffix):Ue.suffixEscaped||"}}",this.formatSeparator=Ue.formatSeparator?Ue.formatSeparator:Ue.formatSeparator||",",this.unescapePrefix=Ue.unescapeSuffix?"":Ue.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":Ue.unescapeSuffix||"",this.nestingPrefix=Ue.nestingPrefix?regexEscape(Ue.nestingPrefix):Ue.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=Ue.nestingSuffix?regexEscape(Ue.nestingSuffix):Ue.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=Ue.nestingOptionsSeparator?Ue.nestingOptionsSeparator:Ue.nestingOptionsSeparator||",",this.maxReplaces=Ue.maxReplaces?Ue.maxReplaces:1e3,this.alwaysFormat=Ue.alwaysFormat!==void 0?Ue.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var Qe="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(Qe,"g");var Ue="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(Ue,"g");var He="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(He,"g")}},{key:"interpolate",value:function(Qe,Ue,He,Ge){var Xe=this,Ke,$e,Je,Ze=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function nt(ot){return ot.replace(/\$/g,"$$$$")}var tt=function(at){if(at.indexOf(Xe.formatSeparator)<0){var st=getPathWithDefaults(Ue,Ze,at);return Xe.alwaysFormat?Xe.format(st,void 0,He,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ge),Ue),{},{interpolationkey:at})):st}var ut=at.split(Xe.formatSeparator),lt=ut.shift().trim(),dt=ut.join(Xe.formatSeparator).trim();return Xe.format(getPathWithDefaults(Ue,Ze,lt),dt,He,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ge),Ue),{},{interpolationkey:lt}))};this.resetRegExp();var et=Ge&&Ge.missingInterpolationHandler||this.options.missingInterpolationHandler,rt=Ge&&Ge.interpolation&&Ge.interpolation.skipOnVariables!==void 0?Ge.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,it=[{regex:this.regexpUnescape,safeValue:function(at){return nt(at)}},{regex:this.regexp,safeValue:function(at){return Xe.escapeValue?nt(Xe.escape(at)):nt(at)}}];return it.forEach(function(ot){for(Je=0;Ke=ot.regex.exec(Qe);){var at=Ke[1].trim();if($e=tt(at),$e===void 0)if(typeof et=="function"){var st=et(Qe,Ke,Ge);$e=typeof st=="string"?st:""}else if(Ge&&Ge.hasOwnProperty(at))$e="";else if(rt){$e=Ke[0];continue}else Xe.logger.warn("missed to pass in variable ".concat(at," for interpolating ").concat(Qe)),$e="";else typeof $e!="string"&&!Xe.useRawValueToEscape&&($e=makeString($e));var ut=ot.safeValue($e);if(Qe=Qe.replace(Ke[0],ut),rt?(ot.regex.lastIndex+=$e.length,ot.regex.lastIndex-=Ke[0].length):ot.regex.lastIndex=0,Je++,Je>=Xe.maxReplaces)break}}),Qe}},{key:"nest",value:function(Qe,Ue){var He=this,Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Xe,Ke,$e=_objectSpread$3$1({},Ge);$e.applyPostProcessor=!1,delete $e.defaultValue;function Je(et,rt){var it=this.nestingOptionsSeparator;if(et.indexOf(it)<0)return et;var ot=et.split(new RegExp("".concat(it,"[ ]*{"))),at="{".concat(ot[1]);et=ot[0],at=this.interpolate(at,$e);var st=at.match(/'/g),ut=at.match(/"/g);(st&&st.length%2===0&&!ut||ut.length%2!==0)&&(at=at.replace(/'/g,'"'));try{$e=JSON.parse(at),rt&&($e=_objectSpread$3$1(_objectSpread$3$1({},rt),$e))}catch(lt){return this.logger.warn("failed parsing options string in nesting for key ".concat(et),lt),"".concat(et).concat(it).concat(at)}return delete $e.defaultValue,et}for(;Xe=this.nestingRegexp.exec(Qe);){var Ze=[],nt=!1;if(Xe[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(Xe[1])){var tt=Xe[1].split(this.formatSeparator).map(function(et){return et.trim()});Xe[1]=tt.shift(),Ze=tt,nt=!0}if(Ke=Ue(Je.call(this,Xe[1].trim(),$e),$e),Ke&&Xe[0]===Qe&&typeof Ke!="string")return Ke;typeof Ke!="string"&&(Ke=makeString(Ke)),Ke||(this.logger.warn("missed to resolve ".concat(Xe[1]," for nesting ").concat(Qe)),Ke=""),nt&&(Ke=Ze.reduce(function(et,rt){return He.format(et,rt,Ge.lng,_objectSpread$3$1(_objectSpread$3$1({},Ge),{},{interpolationkey:Xe[1].trim()}))},Ke.trim())),Qe=Qe.replace(Xe[0],Ke),this.regexp.lastIndex=0}return Qe}}]),me}();function ownKeys$4$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$4$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$4$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$4$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function parseFormatStr(me){var ue=me.toLowerCase().trim(),Qe={};if(me.indexOf("(")>-1){var Ue=me.split("(");ue=Ue[0].toLowerCase().trim();var He=Ue[1].substring(0,Ue[1].length-1);if(ue==="currency"&&He.indexOf(":")<0)Qe.currency||(Qe.currency=He.trim());else if(ue==="relativetime"&&He.indexOf(":")<0)Qe.range||(Qe.range=He.trim());else{var Ge=He.split(";");Ge.forEach(function(Xe){if(Xe){var Ke=Xe.split(":"),$e=_toArray(Ke),Je=$e[0],Ze=$e.slice(1),nt=Ze.join(":").trim().replace(/^'+|'+$/g,"");Qe[Je.trim()]||(Qe[Je.trim()]=nt),nt==="false"&&(Qe[Je.trim()]=!1),nt==="true"&&(Qe[Je.trim()]=!0),isNaN(nt)||(Qe[Je.trim()]=parseInt(nt,10))}})}}return{formatName:ue,formatOptions:Qe}}function createCachedFormatter(me){var ue={};return function(Ue,He,Ge){var Xe=He+JSON.stringify(Ge),Ke=ue[Xe];return Ke||(Ke=me(He,Ge),ue[Xe]=Ke),Ke(Ue)}}var Formatter$1=function(){function me(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,me),this.logger=baseLogger.create("formatter"),this.options=ue,this.formats={number:createCachedFormatter(function(Qe,Ue){var He=new Intl.NumberFormat(Qe,Ue);return function(Ge){return He.format(Ge)}}),currency:createCachedFormatter(function(Qe,Ue){var He=new Intl.NumberFormat(Qe,_objectSpread$4$1(_objectSpread$4$1({},Ue),{},{style:"currency"}));return function(Ge){return He.format(Ge)}}),datetime:createCachedFormatter(function(Qe,Ue){var He=new Intl.DateTimeFormat(Qe,_objectSpread$4$1({},Ue));return function(Ge){return He.format(Ge)}}),relativetime:createCachedFormatter(function(Qe,Ue){var He=new Intl.RelativeTimeFormat(Qe,_objectSpread$4$1({},Ue));return function(Ge){return He.format(Ge,Ue.range||"day")}}),list:createCachedFormatter(function(Qe,Ue){var He=new Intl.ListFormat(Qe,_objectSpread$4$1({},Ue));return function(Ge){return He.format(Ge)}})},this.init(ue)}return _createClass$l(me,[{key:"init",value:function(Qe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},He=Ue.interpolation;this.formatSeparator=He.formatSeparator?He.formatSeparator:He.formatSeparator||","}},{key:"add",value:function(Qe,Ue){this.formats[Qe.toLowerCase().trim()]=Ue}},{key:"addCached",value:function(Qe,Ue){this.formats[Qe.toLowerCase().trim()]=createCachedFormatter(Ue)}},{key:"format",value:function(Qe,Ue,He,Ge){var Xe=this,Ke=Ue.split(this.formatSeparator),$e=Ke.reduce(function(Je,Ze){var nt=parseFormatStr(Ze),tt=nt.formatName,et=nt.formatOptions;if(Xe.formats[tt]){var rt=Je;try{var it=Ge&&Ge.formatParams&&Ge.formatParams[Ge.interpolationkey]||{},ot=it.locale||it.lng||Ge.locale||Ge.lng||He;rt=Xe.formats[tt](Je,ot,_objectSpread$4$1(_objectSpread$4$1(_objectSpread$4$1({},et),Ge),it))}catch(at){Xe.logger.warn(at)}return rt}else Xe.logger.warn("there was no format function for ".concat(tt));return Je},Qe);return $e}}]),me}();function ownKeys$5$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$5$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$5$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$5$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function _createSuper$2(me){var ue=_isNativeReflectConstruct$2();return function(){var Ue=_getPrototypeOf$1(me),He;if(ue){var Ge=_getPrototypeOf$1(this).constructor;He=Reflect.construct(Ue,arguments,Ge)}else He=Ue.apply(this,arguments);return _possibleConstructorReturn$c(this,He)}}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function removePending(me,ue){me.pending[ue]!==void 0&&(delete me.pending[ue],me.pendingCount--)}var Connector=function(me){_inherits$c(Qe,me);var ue=_createSuper$2(Qe);function Qe(Ue,He,Ge){var Xe,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _classCallCheck$m(this,Qe),Xe=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Xe)),Xe.backend=Ue,Xe.store=He,Xe.services=Ge,Xe.languageUtils=Ge.languageUtils,Xe.options=Ke,Xe.logger=baseLogger.create("backendConnector"),Xe.waitingReads=[],Xe.maxParallelReads=Ke.maxParallelReads||10,Xe.readingCalls=0,Xe.maxRetries=Ke.maxRetries>=0?Ke.maxRetries:5,Xe.retryTimeout=Ke.retryTimeout>=1?Ke.retryTimeout:350,Xe.state={},Xe.queue=[],Xe.backend&&Xe.backend.init&&Xe.backend.init(Ge,Ke.backend,Ke),Xe}return _createClass$l(Qe,[{key:"queueLoad",value:function(He,Ge,Xe,Ke){var $e=this,Je={},Ze={},nt={},tt={};return He.forEach(function(et){var rt=!0;Ge.forEach(function(it){var ot="".concat(et,"|").concat(it);!Xe.reload&&$e.store.hasResourceBundle(et,it)?$e.state[ot]=2:$e.state[ot]<0||($e.state[ot]===1?Ze[ot]===void 0&&(Ze[ot]=!0):($e.state[ot]=1,rt=!1,Ze[ot]===void 0&&(Ze[ot]=!0),Je[ot]===void 0&&(Je[ot]=!0),tt[it]===void 0&&(tt[it]=!0)))}),rt||(nt[et]=!0)}),(Object.keys(Je).length||Object.keys(Ze).length)&&this.queue.push({pending:Ze,pendingCount:Object.keys(Ze).length,loaded:{},errors:[],callback:Ke}),{toLoad:Object.keys(Je),pending:Object.keys(Ze),toLoadLanguages:Object.keys(nt),toLoadNamespaces:Object.keys(tt)}}},{key:"loaded",value:function(He,Ge,Xe){var Ke=He.split("|"),$e=Ke[0],Je=Ke[1];Ge&&this.emit("failedLoading",$e,Je,Ge),Xe&&this.store.addResourceBundle($e,Je,Xe),this.state[He]=Ge?-1:2;var Ze={};this.queue.forEach(function(nt){pushPath(nt.loaded,[$e],Je),removePending(nt,He),Ge&&nt.errors.push(Ge),nt.pendingCount===0&&!nt.done&&(Object.keys(nt.loaded).forEach(function(tt){Ze[tt]||(Ze[tt]={});var et=nt.loaded[tt];et.length&&et.forEach(function(rt){Ze[tt][rt]===void 0&&(Ze[tt][rt]=!0)})}),nt.done=!0,nt.errors.length?nt.callback(nt.errors):nt.callback())}),this.emit("loaded",Ze),this.queue=this.queue.filter(function(nt){return!nt.done})}},{key:"read",value:function(He,Ge,Xe){var Ke=this,$e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,Je=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,Ze=arguments.length>5?arguments[5]:void 0;if(!He.length)return Ze(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:He,ns:Ge,fcName:Xe,tried:$e,wait:Je,callback:Ze});return}return this.readingCalls++,this.backend[Xe](He,Ge,function(nt,tt){if(Ke.readingCalls--,Ke.waitingReads.length>0){var et=Ke.waitingReads.shift();Ke.read(et.lng,et.ns,et.fcName,et.tried,et.wait,et.callback)}if(nt&&tt&&$e<Ke.maxRetries){setTimeout(function(){Ke.read.call(Ke,He,Ge,Xe,$e+1,Je*2,Ze)},Je);return}Ze(nt,tt)})}},{key:"prepareLoading",value:function(He,Ge){var Xe=this,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$e=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),$e&&$e();typeof He=="string"&&(He=this.languageUtils.toResolveHierarchy(He)),typeof Ge=="string"&&(Ge=[Ge]);var Je=this.queueLoad(He,Ge,Ke,$e);if(!Je.toLoad.length)return Je.pending.length||$e(),null;Je.toLoad.forEach(function(Ze){Xe.loadOne(Ze)})}},{key:"load",value:function(He,Ge,Xe){this.prepareLoading(He,Ge,{},Xe)}},{key:"reload",value:function(He,Ge,Xe){this.prepareLoading(He,Ge,{reload:!0},Xe)}},{key:"loadOne",value:function(He){var Ge=this,Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",Ke=He.split("|"),$e=Ke[0],Je=Ke[1];this.read($e,Je,"read",void 0,void 0,function(Ze,nt){Ze&&Ge.logger.warn("".concat(Xe,"loading namespace ").concat(Je," for language ").concat($e," failed"),Ze),!Ze&&nt&&Ge.logger.log("".concat(Xe,"loaded namespace ").concat(Je," for language ").concat($e),nt),Ge.loaded(He,Ze,nt)})}},{key:"saveMissing",value:function(He,Ge,Xe,Ke,$e){var Je=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(Ge)){this.logger.warn('did not save key "'.concat(Xe,'" as the namespace "').concat(Ge,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}Xe==null||Xe===""||(this.backend&&this.backend.create&&this.backend.create(He,Ge,Xe,Ke,null,_objectSpread$5$1(_objectSpread$5$1({},Je),{},{isUpdate:$e})),!(!He||!He[0])&&this.store.addResource(He[0],Ge,Xe,Ke))}}]),Qe}(EventEmitter$6);function get$1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(ue){var Qe={};if(_typeof$a(ue[1])==="object"&&(Qe=ue[1]),typeof ue[1]=="string"&&(Qe.defaultValue=ue[1]),typeof ue[2]=="string"&&(Qe.tDescription=ue[2]),_typeof$a(ue[2])==="object"||_typeof$a(ue[3])==="object"){var Ue=ue[3]||ue[2];Object.keys(Ue).forEach(function(He){Qe[He]=Ue[He]})}return Qe},interpolation:{escapeValue:!0,format:function(ue,Qe,Ue,He){return ue},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(me){return typeof me.ns=="string"&&(me.ns=[me.ns]),typeof me.fallbackLng=="string"&&(me.fallbackLng=[me.fallbackLng]),typeof me.fallbackNS=="string"&&(me.fallbackNS=[me.fallbackNS]),me.supportedLngs&&me.supportedLngs.indexOf("cimode")<0&&(me.supportedLngs=me.supportedLngs.concat(["cimode"])),me}function ownKeys$6$1(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$6$1(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$6$1(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$6$1(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function _createSuper$3(me){var ue=_isNativeReflectConstruct$3();return function(){var Ue=_getPrototypeOf$1(me),He;if(ue){var Ge=_getPrototypeOf$1(this).constructor;He=Reflect.construct(Ue,arguments,Ge)}else He=Ue.apply(this,arguments);return _possibleConstructorReturn$c(this,He)}}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function noop$1(){}function bindMemberFunctions(me){var ue=Object.getOwnPropertyNames(Object.getPrototypeOf(me));ue.forEach(function(Qe){typeof me[Qe]=="function"&&(me[Qe]=me[Qe].bind(me))})}var I18n=function(me){_inherits$c(Qe,me);var ue=_createSuper$3(Qe);function Qe(){var Ue,He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ge=arguments.length>1?arguments[1]:void 0;if(_classCallCheck$m(this,Qe),Ue=ue.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(Ue)),Ue.options=transformOptions(He),Ue.services={},Ue.logger=baseLogger,Ue.modules={external:[]},bindMemberFunctions(_assertThisInitialized$1(Ue)),Ge&&!Ue.isInitialized&&!He.isClone){if(!Ue.options.initImmediate)return Ue.init(He,Ge),_possibleConstructorReturn$c(Ue,_assertThisInitialized$1(Ue));setTimeout(function(){Ue.init(He,Ge)},0)}return Ue}return _createClass$l(Qe,[{key:"init",value:function(){var He=this,Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Xe=arguments.length>1?arguments[1]:void 0;typeof Ge=="function"&&(Xe=Ge,Ge={}),!Ge.defaultNS&&Ge.defaultNS!==!1&&Ge.ns&&(typeof Ge.ns=="string"?Ge.defaultNS=Ge.ns:Ge.ns.indexOf("translation")<0&&(Ge.defaultNS=Ge.ns[0]));var Ke=get$1();this.options=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},Ke),this.options),transformOptions(Ge)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=_objectSpread$6$1(_objectSpread$6$1({},Ke.interpolation),this.options.interpolation)),Ge.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=Ge.keySeparator),Ge.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=Ge.nsSeparator);function $e(at){return at?typeof at=="function"?new at:at:null}if(!this.options.isClone){this.modules.logger?baseLogger.init($e(this.modules.logger),this.options):baseLogger.init(null,this.options);var Je;this.modules.formatter?Je=this.modules.formatter:typeof Intl<"u"&&(Je=Formatter$1);var Ze=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var nt=this.services;nt.logger=baseLogger,nt.resourceStore=this.store,nt.languageUtils=Ze,nt.pluralResolver=new PluralResolver(Ze,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),Je&&(!this.options.interpolation.format||this.options.interpolation.format===Ke.interpolation.format)&&(nt.formatter=$e(Je),nt.formatter.init(nt,this.options),this.options.interpolation.format=nt.formatter.format.bind(nt.formatter)),nt.interpolator=new Interpolator(this.options),nt.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},nt.backendConnector=new Connector($e(this.modules.backend),nt.resourceStore,nt,this.options),nt.backendConnector.on("*",function(at){for(var st=arguments.length,ut=new Array(st>1?st-1:0),lt=1;lt<st;lt++)ut[lt-1]=arguments[lt];He.emit.apply(He,[at].concat(ut))}),this.modules.languageDetector&&(nt.languageDetector=$e(this.modules.languageDetector),nt.languageDetector.init(nt,this.options.detection,this.options)),this.modules.i18nFormat&&(nt.i18nFormat=$e(this.modules.i18nFormat),nt.i18nFormat.init&&nt.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(at){for(var st=arguments.length,ut=new Array(st>1?st-1:0),lt=1;lt<st;lt++)ut[lt-1]=arguments[lt];He.emit.apply(He,[at].concat(ut))}),this.modules.external.forEach(function(at){at.init&&at.init(He)})}if(this.format=this.options.interpolation.format,Xe||(Xe=noop$1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var tt=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);tt.length>0&&tt[0]!=="dev"&&(this.options.lng=tt[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var et=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];et.forEach(function(at){He[at]=function(){var st;return(st=He.store)[at].apply(st,arguments)}});var rt=["addResource","addResources","addResourceBundle","removeResourceBundle"];rt.forEach(function(at){He[at]=function(){var st;return(st=He.store)[at].apply(st,arguments),He}});var it=defer(),ot=function(){var st=function(lt,dt){He.isInitialized&&!He.initializedStoreOnce&&He.logger.warn("init: i18next is already initialized. You should call init just once!"),He.isInitialized=!0,He.options.isClone||He.logger.log("initialized",He.options),He.emit("initialized",He.options),it.resolve(dt),Xe(lt,dt)};if(He.languages&&He.options.compatibilityAPI!=="v1"&&!He.isInitialized)return st(null,He.t.bind(He));He.changeLanguage(He.options.lng,st)};return this.options.resources||!this.options.initImmediate?ot():setTimeout(ot,0),it}},{key:"loadResources",value:function(He){var Ge=this,Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,Ke=Xe,$e=typeof He=="string"?He:this.language;if(typeof He=="function"&&(Ke=He),!this.options.resources||this.options.partialBundledLanguages){if($e&&$e.toLowerCase()==="cimode")return Ke();var Je=[],Ze=function(et){if(et){var rt=Ge.services.languageUtils.toResolveHierarchy(et);rt.forEach(function(it){Je.indexOf(it)<0&&Je.push(it)})}};if($e)Ze($e);else{var nt=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);nt.forEach(function(tt){return Ze(tt)})}this.options.preload&&this.options.preload.forEach(function(tt){return Ze(tt)}),this.services.backendConnector.load(Je,this.options.ns,function(tt){!tt&&!Ge.resolvedLanguage&&Ge.language&&Ge.setResolvedLanguage(Ge.language),Ke(tt)})}else Ke(null)}},{key:"reloadResources",value:function(He,Ge,Xe){var Ke=defer();return He||(He=this.languages),Ge||(Ge=this.options.ns),Xe||(Xe=noop$1),this.services.backendConnector.reload(He,Ge,function($e){Ke.resolve(),Xe($e)}),Ke}},{key:"use",value:function(He){if(!He)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!He.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return He.type==="backend"&&(this.modules.backend=He),(He.type==="logger"||He.log&&He.warn&&He.error)&&(this.modules.logger=He),He.type==="languageDetector"&&(this.modules.languageDetector=He),He.type==="i18nFormat"&&(this.modules.i18nFormat=He),He.type==="postProcessor"&&postProcessor.addPostProcessor(He),He.type==="formatter"&&(this.modules.formatter=He),He.type==="3rdParty"&&this.modules.external.push(He),this}},{key:"setResolvedLanguage",value:function(He){if(!(!He||!this.languages)&&!(["cimode","dev"].indexOf(He)>-1))for(var Ge=0;Ge<this.languages.length;Ge++){var Xe=this.languages[Ge];if(!(["cimode","dev"].indexOf(Xe)>-1)&&this.store.hasLanguageSomeTranslations(Xe)){this.resolvedLanguage=Xe;break}}}},{key:"changeLanguage",value:function(He,Ge){var Xe=this;this.isLanguageChangingTo=He;var Ke=defer();this.emit("languageChanging",He);var $e=function(tt){Xe.language=tt,Xe.languages=Xe.services.languageUtils.toResolveHierarchy(tt),Xe.resolvedLanguage=void 0,Xe.setResolvedLanguage(tt)},Je=function(tt,et){et?($e(et),Xe.translator.changeLanguage(et),Xe.isLanguageChangingTo=void 0,Xe.emit("languageChanged",et),Xe.logger.log("languageChanged",et)):Xe.isLanguageChangingTo=void 0,Ke.resolve(function(){return Xe.t.apply(Xe,arguments)}),Ge&&Ge(tt,function(){return Xe.t.apply(Xe,arguments)})},Ze=function(tt){!He&&!tt&&Xe.services.languageDetector&&(tt=[]);var et=typeof tt=="string"?tt:Xe.services.languageUtils.getBestMatchFromCodes(tt);et&&(Xe.language||$e(et),Xe.translator.language||Xe.translator.changeLanguage(et),Xe.services.languageDetector&&Xe.services.languageDetector.cacheUserLanguage(et)),Xe.loadResources(et,function(rt){Je(rt,et)})};return!He&&this.services.languageDetector&&!this.services.languageDetector.async?Ze(this.services.languageDetector.detect()):!He&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(Ze):Ze(He),Ke}},{key:"getFixedT",value:function(He,Ge,Xe){var Ke=this,$e=function Je(Ze,nt){var tt;if(_typeof$a(nt)!=="object"){for(var et=arguments.length,rt=new Array(et>2?et-2:0),it=2;it<et;it++)rt[it-2]=arguments[it];tt=Ke.options.overloadTranslationOptionHandler([Ze,nt].concat(rt))}else tt=_objectSpread$6$1({},nt);tt.lng=tt.lng||Je.lng,tt.lngs=tt.lngs||Je.lngs,tt.ns=tt.ns||Je.ns,tt.keyPrefix=tt.keyPrefix||Xe||Je.keyPrefix;var ot=Ke.options.keySeparator||".",at=tt.keyPrefix?"".concat(tt.keyPrefix).concat(ot).concat(Ze):Ze;return Ke.t(at,tt)};return typeof He=="string"?$e.lng=He:$e.lngs=He,$e.ns=Ge,$e.keyPrefix=Xe,$e}},{key:"t",value:function(){var He;return this.translator&&(He=this.translator).translate.apply(He,arguments)}},{key:"exists",value:function(){var He;return this.translator&&(He=this.translator).exists.apply(He,arguments)}},{key:"setDefaultNamespace",value:function(He){this.options.defaultNS=He}},{key:"hasLoadedNamespace",value:function(He){var Ge=this,Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var Ke=this.resolvedLanguage||this.languages[0],$e=this.options?this.options.fallbackLng:!1,Je=this.languages[this.languages.length-1];if(Ke.toLowerCase()==="cimode")return!0;var Ze=function(et,rt){var it=Ge.services.backendConnector.state["".concat(et,"|").concat(rt)];return it===-1||it===2};if(Xe.precheck){var nt=Xe.precheck(this,Ze);if(nt!==void 0)return nt}return!!(this.hasResourceBundle(Ke,He)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||Ze(Ke,He)&&(!$e||Ze(Je,He)))}},{key:"loadNamespaces",value:function(He,Ge){var Xe=this,Ke=defer();return this.options.ns?(typeof He=="string"&&(He=[He]),He.forEach(function($e){Xe.options.ns.indexOf($e)<0&&Xe.options.ns.push($e)}),this.loadResources(function($e){Ke.resolve(),Ge&&Ge($e)}),Ke):(Ge&&Ge(),Promise.resolve())}},{key:"loadLanguages",value:function(He,Ge){var Xe=defer();typeof He=="string"&&(He=[He]);var Ke=this.options.preload||[],$e=He.filter(function(Je){return Ke.indexOf(Je)<0});return $e.length?(this.options.preload=Ke.concat($e),this.loadResources(function(Je){Xe.resolve(),Ge&&Ge(Je)}),Xe):(Ge&&Ge(),Promise.resolve())}},{key:"dir",value:function(He){if(He||(He=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!He)return"rtl";var Ge=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return Ge.indexOf(this.services.languageUtils.getLanguagePartFromCode(He))>-1||He.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var He=this,Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,Ke=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},this.options),Ge),{isClone:!0}),$e=new Qe(Ke);(Ge.debug!==void 0||Ge.prefix!==void 0)&&($e.logger=$e.logger.clone(Ge));var Je=["store","services","language"];return Je.forEach(function(Ze){$e[Ze]=He[Ze]}),$e.services=_objectSpread$6$1({},this.services),$e.services.utils={hasLoadedNamespace:$e.hasLoadedNamespace.bind($e)},$e.translator=new Translator($e.services,$e.options),$e.translator.on("*",function(Ze){for(var nt=arguments.length,tt=new Array(nt>1?nt-1:0),et=1;et<nt;et++)tt[et-1]=arguments[et];$e.emit.apply($e,[Ze].concat(tt))}),$e.init(Ke,Xe),$e.translator.options=$e.options,$e.translator.backendConnector.services.utils={hasLoadedNamespace:$e.hasLoadedNamespace.bind($e)},$e}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),Qe}(EventEmitter$6);_defineProperty$6(I18n,"createInstance",function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=arguments.length>1?arguments[1]:void 0;return new I18n(me,ue)});var instance=I18n.createInstance();instance.createInstance=I18n.createInstance,instance.createInstance,instance.init,instance.loadResources,instance.reloadResources,instance.use,instance.changeLanguage,instance.getFixedT,instance.t,instance.exists,instance.setDefaultNamespace,instance.hasLoadedNamespace,instance.loadNamespaces,instance.loadLanguages;function _typeof$9(me){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$9(me)}var arr$1=[],each$1=arr$1.forEach,slice$1=arr$1.slice;function defaults$6(me){return each$1.call(slice$1.call(arguments,1),function(ue){if(ue)for(var Qe in ue)me[Qe]===void 0&&(me[Qe]=ue[Qe])}),me}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$9(XMLHttpRequest))==="object"}function isPromise(me){return!!me&&typeof me.then=="function"}function makePromise(me){return isPromise(me)?me:Promise.resolve(me)}function commonjsRequire(me){throw new Error('Could not dynamically require "'+me+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(me,ue){var Qe=typeof self<"u"?self:commonjsGlobal,Ue=function(){function Ge(){this.fetch=!1,this.DOMException=Qe.DOMException}return Ge.prototype=Qe,new Ge}();(function(Ge){(function(Xe){var Ke={searchParams:"URLSearchParams"in Ge,iterable:"Symbol"in Ge&&"iterator"in Symbol,blob:"FileReader"in Ge&&"Blob"in Ge&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Ge,arrayBuffer:"ArrayBuffer"in Ge};function $e(ht){return ht&&DataView.prototype.isPrototypeOf(ht)}if(Ke.arrayBuffer)var Je=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ze=ArrayBuffer.isView||function(ht){return ht&&Je.indexOf(Object.prototype.toString.call(ht))>-1};function nt(ht){if(typeof ht!="string"&&(ht=String(ht)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(ht))throw new TypeError("Invalid character in header field name");return ht.toLowerCase()}function tt(ht){return typeof ht!="string"&&(ht=String(ht)),ht}function et(ht){var It={next:function(){var vt=ht.shift();return{done:vt===void 0,value:vt}}};return Ke.iterable&&(It[Symbol.iterator]=function(){return It}),It}function rt(ht){this.map={},ht instanceof rt?ht.forEach(function(It,vt){this.append(vt,It)},this):Array.isArray(ht)?ht.forEach(function(It){this.append(It[0],It[1])},this):ht&&Object.getOwnPropertyNames(ht).forEach(function(It){this.append(It,ht[It])},this)}rt.prototype.append=function(ht,It){ht=nt(ht),It=tt(It);var vt=this.map[ht];this.map[ht]=vt?vt+", "+It:It},rt.prototype.delete=function(ht){delete this.map[nt(ht)]},rt.prototype.get=function(ht){return ht=nt(ht),this.has(ht)?this.map[ht]:null},rt.prototype.has=function(ht){return this.map.hasOwnProperty(nt(ht))},rt.prototype.set=function(ht,It){this.map[nt(ht)]=tt(It)},rt.prototype.forEach=function(ht,It){for(var vt in this.map)this.map.hasOwnProperty(vt)&&ht.call(It,this.map[vt],vt,this)},rt.prototype.keys=function(){var ht=[];return this.forEach(function(It,vt){ht.push(vt)}),et(ht)},rt.prototype.values=function(){var ht=[];return this.forEach(function(It){ht.push(It)}),et(ht)},rt.prototype.entries=function(){var ht=[];return this.forEach(function(It,vt){ht.push([vt,It])}),et(ht)},Ke.iterable&&(rt.prototype[Symbol.iterator]=rt.prototype.entries);function it(ht){if(ht.bodyUsed)return Promise.reject(new TypeError("Already read"));ht.bodyUsed=!0}function ot(ht){return new Promise(function(It,vt){ht.onload=function(){It(ht.result)},ht.onerror=function(){vt(ht.error)}})}function at(ht){var It=new FileReader,vt=ot(It);return It.readAsArrayBuffer(ht),vt}function st(ht){var It=new FileReader,vt=ot(It);return It.readAsText(ht),vt}function ut(ht){for(var It=new Uint8Array(ht),vt=new Array(It.length),Et=0;Et<It.length;Et++)vt[Et]=String.fromCharCode(It[Et]);return vt.join("")}function lt(ht){if(ht.slice)return ht.slice(0);var It=new Uint8Array(ht.byteLength);return It.set(new Uint8Array(ht)),It.buffer}function dt(){return this.bodyUsed=!1,this._initBody=function(ht){this._bodyInit=ht,ht?typeof ht=="string"?this._bodyText=ht:Ke.blob&&Blob.prototype.isPrototypeOf(ht)?this._bodyBlob=ht:Ke.formData&&FormData.prototype.isPrototypeOf(ht)?this._bodyFormData=ht:Ke.searchParams&&URLSearchParams.prototype.isPrototypeOf(ht)?this._bodyText=ht.toString():Ke.arrayBuffer&&Ke.blob&&$e(ht)?(this._bodyArrayBuffer=lt(ht.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ke.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(ht)||Ze(ht))?this._bodyArrayBuffer=lt(ht):this._bodyText=ht=Object.prototype.toString.call(ht):this._bodyText="",this.headers.get("content-type")||(typeof ht=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ke.searchParams&&URLSearchParams.prototype.isPrototypeOf(ht)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ke.blob&&(this.blob=function(){var ht=it(this);if(ht)return ht;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?it(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(at)}),this.text=function(){var ht=it(this);if(ht)return ht;if(this._bodyBlob)return st(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ut(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Ke.formData&&(this.formData=function(){return this.text().then(wt)}),this.json=function(){return this.text().then(JSON.parse)},this}var At=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function pt(ht){var It=ht.toUpperCase();return At.indexOf(It)>-1?It:ht}function gt(ht,It){It=It||{};var vt=It.body;if(ht instanceof gt){if(ht.bodyUsed)throw new TypeError("Already read");this.url=ht.url,this.credentials=ht.credentials,It.headers||(this.headers=new rt(ht.headers)),this.method=ht.method,this.mode=ht.mode,this.signal=ht.signal,!vt&&ht._bodyInit!=null&&(vt=ht._bodyInit,ht.bodyUsed=!0)}else this.url=String(ht);if(this.credentials=It.credentials||this.credentials||"same-origin",(It.headers||!this.headers)&&(this.headers=new rt(It.headers)),this.method=pt(It.method||this.method||"GET"),this.mode=It.mode||this.mode||null,this.signal=It.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&vt)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(vt)}gt.prototype.clone=function(){return new gt(this,{body:this._bodyInit})};function wt(ht){var It=new FormData;return ht.trim().split("&").forEach(function(vt){if(vt){var Et=vt.split("="),bt=Et.shift().replace(/\+/g," "),Rt=Et.join("=").replace(/\+/g," ");It.append(decodeURIComponent(bt),decodeURIComponent(Rt))}}),It}function Bt(ht){var It=new rt,vt=ht.replace(/\r?\n[\t ]+/g," ");return vt.split(/\r?\n/).forEach(function(Et){var bt=Et.split(":"),Rt=bt.shift().trim();if(Rt){var St=bt.join(":").trim();It.append(Rt,St)}}),It}dt.call(gt.prototype);function Tt(ht,It){It||(It={}),this.type="default",this.status=It.status===void 0?200:It.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in It?It.statusText:"OK",this.headers=new rt(It.headers),this.url=It.url||"",this._initBody(ht)}dt.call(Tt.prototype),Tt.prototype.clone=function(){return new Tt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new rt(this.headers),url:this.url})},Tt.error=function(){var ht=new Tt(null,{status:0,statusText:""});return ht.type="error",ht};var yt=[301,302,303,307,308];Tt.redirect=function(ht,It){if(yt.indexOf(It)===-1)throw new RangeError("Invalid status code");return new Tt(null,{status:It,headers:{location:ht}})},Xe.DOMException=Ge.DOMException;try{new Xe.DOMException}catch{Xe.DOMException=function(It,vt){this.message=It,this.name=vt;var Et=Error(It);this.stack=Et.stack},Xe.DOMException.prototype=Object.create(Error.prototype),Xe.DOMException.prototype.constructor=Xe.DOMException}function Ct(ht,It){return new Promise(function(vt,Et){var bt=new gt(ht,It);if(bt.signal&&bt.signal.aborted)return Et(new Xe.DOMException("Aborted","AbortError"));var Rt=new XMLHttpRequest;function St(){Rt.abort()}Rt.onload=function(){var kt={status:Rt.status,statusText:Rt.statusText,headers:Bt(Rt.getAllResponseHeaders()||"")};kt.url="responseURL"in Rt?Rt.responseURL:kt.headers.get("X-Request-URL");var jt="response"in Rt?Rt.response:Rt.responseText;vt(new Tt(jt,kt))},Rt.onerror=function(){Et(new TypeError("Network request failed"))},Rt.ontimeout=function(){Et(new TypeError("Network request failed"))},Rt.onabort=function(){Et(new Xe.DOMException("Aborted","AbortError"))},Rt.open(bt.method,bt.url,!0),bt.credentials==="include"?Rt.withCredentials=!0:bt.credentials==="omit"&&(Rt.withCredentials=!1),"responseType"in Rt&&Ke.blob&&(Rt.responseType="blob"),bt.headers.forEach(function(kt,jt){Rt.setRequestHeader(jt,kt)}),bt.signal&&(bt.signal.addEventListener("abort",St),Rt.onreadystatechange=function(){Rt.readyState===4&&bt.signal.removeEventListener("abort",St)}),Rt.send(typeof bt._bodyInit>"u"?null:bt._bodyInit)})}return Ct.polyfill=!0,Ge.fetch||(Ge.fetch=Ct,Ge.Headers=rt,Ge.Request=gt,Ge.Response=Tt),Xe.Headers=rt,Xe.Request=gt,Xe.Response=Tt,Xe.fetch=Ct,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe})({})})(Ue),Ue.fetch.ponyfill=!0,delete Ue.fetch.polyfill;var He=Ue;ue=He.fetch,ue.default=He.fetch,ue.fetch=He.fetch,ue.Headers=He.Headers,ue.Request=He.Request,ue.Response=He.Response,me.exports=ue}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(me,ue){var Qe;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?Qe=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?Qe=window.fetch:Qe=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var Ue=Qe||requireBrowserPonyfill();Ue.default&&(Ue=Ue.default),ue.default=Ue,me.exports=ue.default}})(getFetch$1,getFetch$1.exports);var getFetchExports=getFetch$1.exports;const getFetch=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch},[getFetchExports]);function _typeof$8(me){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},_typeof$8(me)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject)),!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch||fetchNode),typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function(ue,Qe){if(Qe&&_typeof$8(Qe)==="object"){var Ue="";for(var He in Qe)Ue+="&"+encodeURIComponent(He)+"="+encodeURIComponent(Qe[He]);if(!Ue)return ue;ue=ue+(ue.indexOf("?")!==-1?"&":"?")+Ue.slice(1)}return ue},fetchIt=function(ue,Qe,Ue){fetchApi(ue,Qe).then(function(He){if(!He.ok)return Ue(He.statusText||"Error",{status:He.status});He.text().then(function(Ge){Ue(null,{status:He.status,data:Ge})}).catch(Ue)}).catch(Ue)},omitFetchOptions=!1,requestWithFetch=function(ue,Qe,Ue,He){ue.queryStringParams&&(Qe=addQueryString(Qe,ue.queryStringParams));var Ge=defaults$6({},typeof ue.customHeaders=="function"?ue.customHeaders():ue.customHeaders);Ue&&(Ge["Content-Type"]="application/json");var Xe=typeof ue.requestOptions=="function"?ue.requestOptions(Ue):ue.requestOptions,Ke=defaults$6({method:Ue?"POST":"GET",body:Ue?ue.stringify(Ue):void 0,headers:Ge},omitFetchOptions?{}:Xe);try{fetchIt(Qe,Ke,He)}catch($e){if(!Xe||Object.keys(Xe).length===0||!$e.message||$e.message.indexOf("not implemented")<0)return He($e);try{Object.keys(Xe).forEach(function(Je){delete Ke[Je]}),fetchIt(Qe,Ke,He),omitFetchOptions=!0}catch(Je){He(Je)}}},requestWithXmlHttpRequest=function(ue,Qe,Ue,He){Ue&&_typeof$8(Ue)==="object"&&(Ue=addQueryString("",Ue).slice(1)),ue.queryStringParams&&(Qe=addQueryString(Qe,ue.queryStringParams));try{var Ge;XmlHttpRequestApi?Ge=new XmlHttpRequestApi:Ge=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),Ge.open(Ue?"POST":"GET",Qe,1),ue.crossDomain||Ge.setRequestHeader("X-Requested-With","XMLHttpRequest"),Ge.withCredentials=!!ue.withCredentials,Ue&&Ge.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),Ge.overrideMimeType&&Ge.overrideMimeType("application/json");var Xe=ue.customHeaders;if(Xe=typeof Xe=="function"?Xe():Xe,Xe)for(var Ke in Xe)Ge.setRequestHeader(Ke,Xe[Ke]);Ge.onreadystatechange=function(){Ge.readyState>3&&He(Ge.status>=400?Ge.statusText:null,{status:Ge.status,data:Ge.responseText})},Ge.send(Ue)}catch($e){console&&console.log($e)}},request=function(ue,Qe,Ue,He){if(typeof Ue=="function"&&(He=Ue,Ue=void 0),He=He||function(){},fetchApi)return requestWithFetch(ue,Qe,Ue,He);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(ue,Qe,Ue,He);He(new Error("No fetch and no xhr implementation found!"))};function _classCallCheck$l(me,ue){if(!(me instanceof ue))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(me,ue){for(var Qe=0;Qe<ue.length;Qe++){var Ue=ue[Qe];Ue.enumerable=Ue.enumerable||!1,Ue.configurable=!0,"value"in Ue&&(Ue.writable=!0),Object.defineProperty(me,Ue.key,Ue)}}function _createClass$k(me,ue,Qe){return ue&&_defineProperties$8(me.prototype,ue),Object.defineProperty(me,"prototype",{writable:!1}),me}function _defineProperty$5(me,ue,Qe){return ue in me?Object.defineProperty(me,ue,{value:Qe,enumerable:!0,configurable:!0,writable:!0}):me[ue]=Qe,me}var getDefaults$2=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(Qe){return JSON.parse(Qe)},stringify:JSON.stringify,parsePayload:function(Qe,Ue,He){return _defineProperty$5({},Ue,He||"")},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function me(ue){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck$l(this,me),this.services=ue,this.options=Qe,this.allOptions=Ue,this.type="backend",this.init(ue,Qe,Ue)}return _createClass$k(me,[{key:"init",value:function(Qe){var Ue=this,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Qe,this.options=defaults$6(He,this.options||{},getDefaults$2()),this.allOptions=Ge,this.services&&this.options.reloadInterval&&setInterval(function(){return Ue.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(Qe,Ue,He){this._readAny(Qe,Qe,Ue,Ue,He)}},{key:"read",value:function(Qe,Ue,He){this._readAny([Qe],Qe,[Ue],Ue,He)}},{key:"_readAny",value:function(Qe,Ue,He,Ge,Xe){var Ke=this,$e=this.options.loadPath;typeof this.options.loadPath=="function"&&($e=this.options.loadPath(Qe,He)),$e=makePromise($e),$e.then(function(Je){if(!Je)return Xe(null,{});var Ze=Ke.services.interpolator.interpolate(Je,{lng:Qe.join("+"),ns:He.join("+")});Ke.loadUrl(Ze,Xe,Ue,Ge)})}},{key:"loadUrl",value:function(Qe,Ue,He,Ge){var Xe=this;this.options.request(this.options,Qe,void 0,function(Ke,$e){if($e&&($e.status>=500&&$e.status<600||!$e.status))return Ue("failed loading "+Qe+"; status code: "+$e.status,!0);if($e&&$e.status>=400&&$e.status<500)return Ue("failed loading "+Qe+"; status code: "+$e.status,!1);if(!$e&&Ke&&Ke.message&&Ke.message.indexOf("Failed to fetch")>-1)return Ue("failed loading "+Qe+": "+Ke.message,!0);if(Ke)return Ue(Ke,!1);var Je,Ze;try{typeof $e.data=="string"?Je=Xe.options.parse($e.data,He,Ge):Je=$e.data}catch{Ze="failed parsing "+Qe+" to json"}if(Ze)return Ue(Ze,!1);Ue(null,Je)})}},{key:"create",value:function(Qe,Ue,He,Ge,Xe){var Ke=this;if(this.options.addPath){typeof Qe=="string"&&(Qe=[Qe]);var $e=this.options.parsePayload(Ue,He,Ge),Je=0,Ze=[],nt=[];Qe.forEach(function(tt){var et=Ke.options.addPath;typeof Ke.options.addPath=="function"&&(et=Ke.options.addPath(tt,Ue));var rt=Ke.services.interpolator.interpolate(et,{lng:tt,ns:Ue});Ke.options.request(Ke.options,rt,$e,function(it,ot){Je+=1,Ze.push(it),nt.push(ot),Je===Qe.length&&Xe&&Xe(Ze,nt)})})}}},{key:"reload",value:function(){var Qe=this,Ue=this.services,He=Ue.backendConnector,Ge=Ue.languageUtils,Xe=Ue.logger,Ke=He.language;if(!(Ke&&Ke.toLowerCase()==="cimode")){var $e=[],Je=function(nt){var tt=Ge.toResolveHierarchy(nt);tt.forEach(function(et){$e.indexOf(et)<0&&$e.push(et)})};Je(Ke),this.allOptions.preload&&this.allOptions.preload.forEach(function(Ze){return Je(Ze)}),$e.forEach(function(Ze){Qe.allOptions.ns.forEach(function(nt){He.read(Ze,nt,"read",null,null,function(tt,et){tt&&Xe.warn("loading namespace ".concat(nt," for language ").concat(Ze," failed"),tt),!tt&&et&&Xe.log("loaded namespace ".concat(nt," for language ").concat(Ze),et),He.loaded("".concat(Ze,"|").concat(nt),tt,et)})})})}}}]),me}();Backend.type="backend";var arr=[],each=arr.forEach,slice=arr.slice;function defaults$5(me){return each.call(slice.call(arguments,1),function(ue){if(ue)for(var Qe in ue)me[Qe]===void 0&&(me[Qe]=ue[Qe])}),me}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(ue,Qe,Ue){var He=Ue||{};He.path=He.path||"/";var Ge=encodeURIComponent(Qe),Xe="".concat(ue,"=").concat(Ge);if(He.maxAge>0){var Ke=He.maxAge-0;if(Number.isNaN(Ke))throw new Error("maxAge should be a Number");Xe+="; Max-Age=".concat(Math.floor(Ke))}if(He.domain){if(!fieldContentRegExp.test(He.domain))throw new TypeError("option domain is invalid");Xe+="; Domain=".concat(He.domain)}if(He.path){if(!fieldContentRegExp.test(He.path))throw new TypeError("option path is invalid");Xe+="; Path=".concat(He.path)}if(He.expires){if(typeof He.expires.toUTCString!="function")throw new TypeError("option expires is invalid");Xe+="; Expires=".concat(He.expires.toUTCString())}if(He.httpOnly&&(Xe+="; HttpOnly"),He.secure&&(Xe+="; Secure"),He.sameSite){var $e=typeof He.sameSite=="string"?He.sameSite.toLowerCase():He.sameSite;switch($e){case!0:Xe+="; SameSite=Strict";break;case"lax":Xe+="; SameSite=Lax";break;case"strict":Xe+="; SameSite=Strict";break;case"none":Xe+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return Xe},cookie={create:function(ue,Qe,Ue,He){var Ge=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};Ue&&(Ge.expires=new Date,Ge.expires.setTime(Ge.expires.getTime()+Ue*60*1e3)),He&&(Ge.domain=He),document.cookie=serializeCookie(ue,encodeURIComponent(Qe),Ge)},read:function(ue){for(var Qe="".concat(ue,"="),Ue=document.cookie.split(";"),He=0;He<Ue.length;He++){for(var Ge=Ue[He];Ge.charAt(0)===" ";)Ge=Ge.substring(1,Ge.length);if(Ge.indexOf(Qe)===0)return Ge.substring(Qe.length,Ge.length)}return null},remove:function(ue){this.create(ue,"",-1)}},cookie$1={name:"cookie",lookup:function(ue){var Qe;if(ue.lookupCookie&&typeof document<"u"){var Ue=cookie.read(ue.lookupCookie);Ue&&(Qe=Ue)}return Qe},cacheUserLanguage:function(ue,Qe){Qe.lookupCookie&&typeof document<"u"&&cookie.create(Qe.lookupCookie,ue,Qe.cookieMinutes,Qe.cookieDomain,Qe.cookieOptions)}},querystring={name:"querystring",lookup:function(ue){var Qe;if(typeof window<"u"){var Ue=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(Ue=window.location.hash.substring(window.location.hash.indexOf("?")));for(var He=Ue.substring(1),Ge=He.split("&"),Xe=0;Xe<Ge.length;Xe++){var Ke=Ge[Xe].indexOf("=");if(Ke>0){var $e=Ge[Xe].substring(0,Ke);$e===ue.lookupQuerystring&&(Qe=Ge[Xe].substring(Ke+1))}}}return Qe}},hasLocalStorageSupport=null,localStorageAvailable=function(){if(hasLocalStorageSupport!==null)return hasLocalStorageSupport;try{hasLocalStorageSupport=window!=="undefined"&&window.localStorage!==null;var ue="i18next.translate.boo";window.localStorage.setItem(ue,"foo"),window.localStorage.removeItem(ue)}catch{hasLocalStorageSupport=!1}return hasLocalStorageSupport},localStorage$1={name:"localStorage",lookup:function(ue){var Qe;if(ue.lookupLocalStorage&&localStorageAvailable()){var Ue=window.localStorage.getItem(ue.lookupLocalStorage);Ue&&(Qe=Ue)}return Qe},cacheUserLanguage:function(ue,Qe){Qe.lookupLocalStorage&&localStorageAvailable()&&window.localStorage.setItem(Qe.lookupLocalStorage,ue)}},hasSessionStorageSupport=null,sessionStorageAvailable=function(){if(hasSessionStorageSupport!==null)return hasSessionStorageSupport;try{hasSessionStorageSupport=window!=="undefined"&&window.sessionStorage!==null;var ue="i18next.translate.boo";window.sessionStorage.setItem(ue,"foo"),window.sessionStorage.removeItem(ue)}catch{hasSessionStorageSupport=!1}return hasSessionStorageSupport},sessionStorage$1={name:"sessionStorage",lookup:function(ue){var Qe;if(ue.lookupSessionStorage&&sessionStorageAvailable()){var Ue=window.sessionStorage.getItem(ue.lookupSessionStorage);Ue&&(Qe=Ue)}return Qe},cacheUserLanguage:function(ue,Qe){Qe.lookupSessionStorage&&sessionStorageAvailable()&&window.sessionStorage.setItem(Qe.lookupSessionStorage,ue)}},navigator$1={name:"navigator",lookup:function(ue){var Qe=[];if(typeof navigator<"u"){if(navigator.languages)for(var Ue=0;Ue<navigator.languages.length;Ue++)Qe.push(navigator.languages[Ue]);navigator.userLanguage&&Qe.push(navigator.userLanguage),navigator.language&&Qe.push(navigator.language)}return Qe.length>0?Qe:void 0}},htmlTag={name:"htmlTag",lookup:function(ue){var Qe,Ue=ue.htmlTag||(typeof document<"u"?document.documentElement:null);return Ue&&typeof Ue.getAttribute=="function"&&(Qe=Ue.getAttribute("lang")),Qe}},path$1={name:"path",lookup:function(ue){var Qe;if(typeof window<"u"){var Ue=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Ue instanceof Array)if(typeof ue.lookupFromPathIndex=="number"){if(typeof Ue[ue.lookupFromPathIndex]!="string")return;Qe=Ue[ue.lookupFromPathIndex].replace("/","")}else Qe=Ue[0].replace("/","")}return Qe}},subdomain={name:"subdomain",lookup:function(ue){var Qe=typeof ue.lookupFromSubdomainIndex=="number"?ue.lookupFromSubdomainIndex+1:1,Ue=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(Ue)return Ue[Qe]}};function getDefaults$1(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function me(ue){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,me),this.type="languageDetector",this.detectors={},this.init(ue,Qe)}return _createClass$l(me,[{key:"init",value:function(Qe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Qe,this.options=defaults$5(Ue,this.options||{},getDefaults$1()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=He,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage$1),this.addDetector(sessionStorage$1),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path$1),this.addDetector(subdomain)}},{key:"addDetector",value:function(Qe){this.detectors[Qe.name]=Qe}},{key:"detect",value:function(Qe){var Ue=this;Qe||(Qe=this.options.order);var He=[];return Qe.forEach(function(Ge){if(Ue.detectors[Ge]){var Xe=Ue.detectors[Ge].lookup(Ue.options);Xe&&typeof Xe=="string"&&(Xe=[Xe]),Xe&&(He=He.concat(Xe))}}),this.services.languageUtils.getBestMatchFromCodes?He:He.length>0?He[0]:null}},{key:"cacheUserLanguage",value:function(Qe,Ue){var He=this;Ue||(Ue=this.options.caches),Ue&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(Qe)>-1||Ue.forEach(function(Ge){He.detectors[Ge]&&He.detectors[Ge].cacheUserLanguage(Qe,He.options)}))}}]),me}();Browser.type="languageDetector";function _objectWithoutPropertiesLoose(me,ue){if(me==null)return{};var Qe={},Ue=Object.keys(me),He,Ge;for(Ge=0;Ge<Ue.length;Ge++)He=Ue[Ge],!(ue.indexOf(He)>=0)&&(Qe[He]=me[He]);return Qe}function _objectWithoutProperties$4(me,ue){if(me==null)return{};var Qe=_objectWithoutPropertiesLoose(me,ue),Ue,He;if(Object.getOwnPropertySymbols){var Ge=Object.getOwnPropertySymbols(me);for(He=0;He<Ge.length;He++)Ue=Ge[He],!(ue.indexOf(Ue)>=0)&&Object.prototype.propertyIsEnumerable.call(me,Ue)&&(Qe[Ue]=me[Ue])}return Qe}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const e=getDefaultExportFromCjs(voidElements);var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(me){var ue={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},Qe=me.match(/<\/?([^\s]+?)[/\s>]/);if(Qe&&(ue.name=Qe[1],(e[Qe[1]]||me.charAt(me.length-2)==="/")&&(ue.voidElement=!0),ue.name.startsWith("!--"))){var Ue=me.indexOf("-->");return{type:"comment",comment:Ue!==-1?me.slice(4,Ue):""}}for(var He=new RegExp(t$1),Ge=null;(Ge=He.exec(me))!==null;)if(Ge[0].trim())if(Ge[1]){var Xe=Ge[1].trim(),Ke=[Xe,""];Xe.indexOf("=")>-1&&(Ke=Xe.split("=")),ue.attrs[Ke[0]]=Ke[1],He.lastIndex--}else Ge[2]&&(ue.attrs[Ge[2]]=Ge[3].trim().substring(1,Ge[3].length-1));return ue}var r$2=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i$4=/^\s*$/,s$2=Object.create(null);function a$2(me,ue){switch(ue.type){case"text":return me+ue.content;case"tag":return me+="<"+ue.name+(ue.attrs?function(Qe){var Ue=[];for(var He in Qe)Ue.push(He+'="'+Qe[He]+'"');return Ue.length?" "+Ue.join(" "):""}(ue.attrs):"")+(ue.voidElement?"/>":">"),ue.voidElement?me:me+ue.children.reduce(a$2,"")+"</"+ue.name+">";case"comment":return me+"<!--"+ue.comment+"-->"}}var c$2={parse:function(me,ue){ue||(ue={}),ue.components||(ue.components=s$2);var Qe,Ue=[],He=[],Ge=-1,Xe=!1;if(me.indexOf("<")!==0){var Ke=me.indexOf("<");Ue.push({type:"text",content:Ke===-1?me:me.substring(0,Ke)})}return me.replace(r$2,function($e,Je){if(Xe){if($e!=="</"+Qe.name+">")return;Xe=!1}var Ze,nt=$e.charAt(1)!=="/",tt=$e.startsWith("<!--"),et=Je+$e.length,rt=me.charAt(et);if(tt){var it=n($e);return Ge<0?(Ue.push(it),Ue):((Ze=He[Ge]).children.push(it),Ue)}if(nt&&(Ge++,(Qe=n($e)).type==="tag"&&ue.components[Qe.name]&&(Qe.type="component",Xe=!0),Qe.voidElement||Xe||!rt||rt==="<"||Qe.children.push({type:"text",content:me.slice(et,me.indexOf("<",et))}),Ge===0&&Ue.push(Qe),(Ze=He[Ge-1])&&Ze.children.push(Qe),He[Ge]=Qe),(!nt||Qe.voidElement)&&(Ge>-1&&(Qe.voidElement||Qe.name===$e.slice(2,-1))&&(Ge--,Qe=Ge===-1?Ue:He[Ge]),!Xe&&rt!=="<"&&rt)){Ze=Ge===-1?Ue:He[Ge].children;var ot=me.indexOf("<",et),at=me.slice(et,ot===-1?void 0:ot);i$4.test(at)&&(at=" "),(ot>-1&&Ge+Ze.length>=0||at!==" ")&&Ze.push({type:"text",content:at})}}),Ue},stringify:function(me){return me.reduce(function(ue,Qe){return ue+a$2("",Qe)},"")}},matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function(ue){return htmlEntities[ue]},unescape$1=function(ue){return ue.replace(matchHtmlEntity,unescapeHtmlEntity)};function ownKeys$7(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$7(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$7(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$7(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}var defaultOptions$1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1},i18nInstance$1,I18nContext=React.createContext();function setDefaults(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions$1=_objectSpread$7(_objectSpread$7({},defaultOptions$1),me)}function getDefaults(){return defaultOptions$1}var ReportNamespaces=function(){function me(){_classCallCheck$m(this,me),this.usedNamespaces={}}return _createClass$l(me,[{key:"addUsedNamespaces",value:function(Qe){var Ue=this;Qe.forEach(function(He){Ue.usedNamespaces[He]||(Ue.usedNamespaces[He]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),me}();function setI18n(me){i18nInstance$1=me}function getI18n(){return i18nInstance$1}var initReactI18next={type:"3rdParty",init:function(ue){setDefaults(ue.options.react),setI18n(ue)}};function warn$1(){if(console&&console.warn){for(var me,ue=arguments.length,Qe=new Array(ue),Ue=0;Ue<ue;Ue++)Qe[Ue]=arguments[Ue];typeof Qe[0]=="string"&&(Qe[0]="react-i18next:: ".concat(Qe[0])),(me=console).warn.apply(me,Qe)}}var alreadyWarned={};function warnOnce$1(){for(var me=arguments.length,ue=new Array(me),Qe=0;Qe<me;Qe++)ue[Qe]=arguments[Qe];typeof ue[0]=="string"&&alreadyWarned[ue[0]]||(typeof ue[0]=="string"&&(alreadyWarned[ue[0]]=new Date),warn$1.apply(void 0,ue))}function loadNamespaces(me,ue,Qe){me.loadNamespaces(ue,function(){if(me.isInitialized)Qe();else{var Ue=function He(){setTimeout(function(){me.off("initialized",He)},0),Qe()};me.on("initialized",Ue)}})}function oldI18nextHasLoadedNamespace(me,ue){var Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ue=ue.languages[0],He=ue.options?ue.options.fallbackLng:!1,Ge=ue.languages[ue.languages.length-1];if(Ue.toLowerCase()==="cimode")return!0;var Xe=function($e,Je){var Ze=ue.services.backendConnector.state["".concat($e,"|").concat(Je)];return Ze===-1||Ze===2};return Qe.bindI18n&&Qe.bindI18n.indexOf("languageChanging")>-1&&ue.services.backendConnector.backend&&ue.isLanguageChangingTo&&!Xe(ue.isLanguageChangingTo,me)?!1:!!(ue.hasResourceBundle(Ue,me)||!ue.services.backendConnector.backend||ue.options.resources&&!ue.options.partialBundledLanguages||Xe(Ue,me)&&(!He||Xe(Ge,me)))}function hasLoadedNamespace(me,ue){var Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!ue.languages||!ue.languages.length)return warnOnce$1("i18n.languages were undefined or empty",ue.languages),!0;var Ue=ue.options.ignoreJSONStructure!==void 0;return Ue?ue.hasLoadedNamespace(me,{precheck:function(Ge,Xe){if(Qe.bindI18n&&Qe.bindI18n.indexOf("languageChanging")>-1&&Ge.services.backendConnector.backend&&Ge.isLanguageChangingTo&&!Xe(Ge.isLanguageChangingTo,me))return!1}}):oldI18nextHasLoadedNamespace(me,ue,Qe)}var _excluded=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$6(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$6(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$6(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$6(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}function hasChildren(me,ue){if(!me)return!1;var Qe=me.props?me.props.children:me.children;return ue?Qe.length>0:!!Qe}function getChildren$1(me){return me?me.props?me.props.children:me.children:[]}function hasValidReactChildren(me){return Object.prototype.toString.call(me)!=="[object Array]"?!1:me.every(function(ue){return React.isValidElement(ue)})}function getAsArray(me){return Array.isArray(me)?me:[me]}function mergeProps(me,ue){var Qe=_objectSpread$6({},ue);return Qe.props=Object.assign(me.props,ue.props),Qe}function nodesToString(me,ue){if(!me)return"";var Qe="",Ue=getAsArray(me),He=ue.transSupportBasicHtmlNodes&&ue.transKeepBasicHtmlNodesFor?ue.transKeepBasicHtmlNodesFor:[];return Ue.forEach(function(Ge,Xe){if(typeof Ge=="string")Qe+="".concat(Ge);else if(React.isValidElement(Ge)){var Ke=Object.keys(Ge.props).length,$e=He.indexOf(Ge.type)>-1,Je=Ge.props.children;if(!Je&&$e&&Ke===0)Qe+="<".concat(Ge.type,"/>");else if(!Je&&(!$e||Ke!==0))Qe+="<".concat(Xe,"></").concat(Xe,">");else if(Ge.props.i18nIsDynamicList)Qe+="<".concat(Xe,"></").concat(Xe,">");else if($e&&Ke===1&&typeof Je=="string")Qe+="<".concat(Ge.type,">").concat(Je,"</").concat(Ge.type,">");else{var Ze=nodesToString(Je,ue);Qe+="<".concat(Xe,">").concat(Ze,"</").concat(Xe,">")}}else if(Ge===null)warn$1("Trans: the passed in value is invalid - seems you passed in a null child.");else if(_typeof$a(Ge)==="object"){var nt=Ge.format,tt=_objectWithoutProperties$4(Ge,_excluded),et=Object.keys(tt);if(et.length===1){var rt=nt?"".concat(et[0],", ").concat(nt):et[0];Qe+="{{".concat(rt,"}}")}else warn$1("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",Ge)}else warn$1("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",Ge)}),Qe}function renderNodes(me,ue,Qe,Ue,He,Ge){if(ue==="")return[];var Xe=Ue.transKeepBasicHtmlNodesFor||[],Ke=ue&&new RegExp(Xe.join("|")).test(ue);if(!me&&!Ke)return[ue];var $e={};function Je(ot){var at=getAsArray(ot);at.forEach(function(st){typeof st!="string"&&(hasChildren(st)?Je(getChildren$1(st)):_typeof$a(st)==="object"&&!React.isValidElement(st)&&Object.assign($e,st))})}Je(me);var Ze=c$2.parse("<0>".concat(ue,"</0>")),nt=_objectSpread$6(_objectSpread$6({},$e),He);function tt(ot,at,st){var ut=getChildren$1(ot),lt=rt(ut,at.children,st);return hasValidReactChildren(ut)&<.length===0?ut:lt}function et(ot,at,st,ut,lt){ot.dummy&&(ot.children=at),st.push(React.cloneElement(ot,_objectSpread$6(_objectSpread$6({},ot.props),{},{key:ut}),lt?void 0:at))}function rt(ot,at,st){var ut=getAsArray(ot),lt=getAsArray(at);return lt.reduce(function(dt,At,pt){var gt=At.children&&At.children[0]&&At.children[0].content&&Qe.services.interpolator.interpolate(At.children[0].content,nt,Qe.language);if(At.type==="tag"){var wt=ut[parseInt(At.name,10)];!wt&&st.length===1&&st[0][At.name]&&(wt=st[0][At.name]),wt||(wt={});var Bt=Object.keys(At.attrs).length!==0?mergeProps({props:At.attrs},wt):wt,Tt=React.isValidElement(Bt),yt=Tt&&hasChildren(At,!0)&&!At.voidElement,Ct=Ke&&_typeof$a(Bt)==="object"&&Bt.dummy&&!Tt,ht=_typeof$a(me)==="object"&&me!==null&&Object.hasOwnProperty.call(me,At.name);if(typeof Bt=="string"){var It=Qe.services.interpolator.interpolate(Bt,nt,Qe.language);dt.push(It)}else if(hasChildren(Bt)||yt){var vt=tt(Bt,At,st);et(Bt,vt,dt,pt)}else if(Ct){var Et=rt(ut,At.children,st);dt.push(React.cloneElement(Bt,_objectSpread$6(_objectSpread$6({},Bt.props),{},{key:pt}),Et))}else if(Number.isNaN(parseFloat(At.name)))if(ht){var bt=tt(Bt,At,st);et(Bt,bt,dt,pt,At.voidElement)}else if(Ue.transSupportBasicHtmlNodes&&Xe.indexOf(At.name)>-1)if(At.voidElement)dt.push(React.createElement(At.name,{key:"".concat(At.name,"-").concat(pt)}));else{var Rt=rt(ut,At.children,st);dt.push(React.createElement(At.name,{key:"".concat(At.name,"-").concat(pt)},Rt))}else if(At.voidElement)dt.push("<".concat(At.name," />"));else{var St=rt(ut,At.children,st);dt.push("<".concat(At.name,">").concat(St,"</").concat(At.name,">"))}else if(_typeof$a(Bt)==="object"&&!Tt){var kt=At.children[0]?gt:null;kt&&dt.push(kt)}else At.children.length===1&>?dt.push(React.cloneElement(Bt,_objectSpread$6(_objectSpread$6({},Bt.props),{},{key:pt}),gt)):dt.push(React.cloneElement(Bt,_objectSpread$6(_objectSpread$6({},Bt.props),{},{key:pt})))}else if(At.type==="text"){var jt=Ue.transWrapTextNodes,Pt=Ge?Ue.unescape(Qe.services.interpolator.interpolate(At.content,nt,Qe.language)):Qe.services.interpolator.interpolate(At.content,nt,Qe.language);jt?dt.push(React.createElement(jt,{key:"".concat(At.name,"-").concat(pt)},Pt)):dt.push(Pt)}return dt},[])}var it=rt([{dummy:!0,children:me||[]}],Ze,getAsArray(me||[]));return getChildren$1(it[0])}function Trans(me){var ue=me.children,Qe=me.count,Ue=me.parent,He=me.i18nKey,Ge=me.context,Xe=me.tOptions,Ke=Xe===void 0?{}:Xe,$e=me.values,Je=me.defaults,Ze=me.components,nt=me.ns,tt=me.i18n,et=me.t,rt=me.shouldUnescape,it=_objectWithoutProperties$4(me,_excluded2),ot=React.useContext(I18nContext)||{},at=ot.i18n,st=ot.defaultNS,ut=tt||at||getI18n();if(!ut)return warnOnce$1("You will need to pass in an i18next instance by using i18nextReactModule"),ue;var lt=et||ut.t.bind(ut)||function(It){return It};Ge&&(Ke.context=Ge);var dt=_objectSpread$6(_objectSpread$6({},getDefaults()),ut.options&&ut.options.react),At=nt||lt.ns||st||ut.options&&ut.options.defaultNS;At=typeof At=="string"?[At]:At||["translation"];var pt=Je||nodesToString(ue,dt)||dt.transEmptyNodeValue||He,gt=dt.hashTransKey,wt=He||(gt?gt(pt):pt),Bt=$e?Ke.interpolation:{interpolation:_objectSpread$6(_objectSpread$6({},Ke.interpolation),{},{prefix:"#$?",suffix:"?$#"})},Tt=_objectSpread$6(_objectSpread$6(_objectSpread$6(_objectSpread$6({},Ke),{},{count:Qe},$e),Bt),{},{defaultValue:pt,ns:At}),yt=wt?lt(wt,Tt):pt,Ct=renderNodes(Ze||ue,yt,ut,dt,Tt,rt),ht=Ue!==void 0?Ue:dt.defaultTransParent;return ht?React.createElement(ht,it,Ct):Ct}function _iterableToArrayLimit$3(me,ue){var Qe=me==null?null:typeof Symbol<"u"&&me[Symbol.iterator]||me["@@iterator"];if(Qe!=null){var Ue,He,Ge,Xe,Ke=[],$e=!0,Je=!1;try{if(Ge=(Qe=Qe.call(me)).next,ue!==0)for(;!($e=(Ue=Ge.call(Qe)).done)&&(Ke.push(Ue.value),Ke.length!==ue);$e=!0);}catch(Ze){Je=!0,He=Ze}finally{try{if(!$e&&Qe.return!=null&&(Xe=Qe.return(),Object(Xe)!==Xe))return}finally{if(Je)throw He}}return Ke}}function _slicedToArray$3(me,ue){return _arrayWithHoles$3(me)||_iterableToArrayLimit$3(me,ue)||_unsupportedIterableToArray$b(me,ue)||_nonIterableRest$3()}function ownKeys$5(me,ue){var Qe=Object.keys(me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(me);ue&&(Ue=Ue.filter(function(He){return Object.getOwnPropertyDescriptor(me,He).enumerable})),Qe.push.apply(Qe,Ue)}return Qe}function _objectSpread$5(me){for(var ue=1;ue<arguments.length;ue++){var Qe=arguments[ue]!=null?arguments[ue]:{};ue%2?ownKeys$5(Object(Qe),!0).forEach(function(Ue){_defineProperty$6(me,Ue,Qe[Ue])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(Qe)):ownKeys$5(Object(Qe)).forEach(function(Ue){Object.defineProperty(me,Ue,Object.getOwnPropertyDescriptor(Qe,Ue))})}return me}var usePrevious=function(ue,Qe){var Ue=React.useRef();return React.useEffect(function(){Ue.current=ue},[ue,Qe]),Ue.current};function useTranslation(me){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=ue.i18n,Ue=React.useContext(I18nContext)||{},He=Ue.i18n,Ge=Ue.defaultNS,Xe=Qe||He||getI18n();if(Xe&&!Xe.reportNamespaces&&(Xe.reportNamespaces=new ReportNamespaces),!Xe){warnOnce$1("You will need to pass in an i18next instance by using initReactI18next");var Ke=function(wt){return Array.isArray(wt)?wt[wt.length-1]:wt},$e=[Ke,{},!1];return $e.t=Ke,$e.i18n={},$e.ready=!1,$e}Xe.options.react&&Xe.options.react.wait!==void 0&&warnOnce$1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var Je=_objectSpread$5(_objectSpread$5(_objectSpread$5({},getDefaults()),Xe.options.react),ue),Ze=Je.useSuspense,nt=Je.keyPrefix,tt=Ge||Xe.options&&Xe.options.defaultNS;tt=typeof tt=="string"?[tt]:tt||["translation"],Xe.reportNamespaces.addUsedNamespaces&&Xe.reportNamespaces.addUsedNamespaces(tt);var et=(Xe.isInitialized||Xe.initializedStoreOnce)&&tt.every(function(gt){return hasLoadedNamespace(gt,Xe,Je)});function rt(){return Xe.getFixedT(null,Je.nsMode==="fallback"?tt:tt[0],nt)}var it=React.useState(rt),ot=_slicedToArray$3(it,2),at=ot[0],st=ot[1],ut=tt.join(),lt=usePrevious(ut),dt=React.useRef(!0);React.useEffect(function(){var gt=Je.bindI18n,wt=Je.bindI18nStore;dt.current=!0,!et&&!Ze&&loadNamespaces(Xe,tt,function(){dt.current&&st(rt)}),et&<&<!==ut&&dt.current&&st(rt);function Bt(){dt.current&&st(rt)}return gt&&Xe&&Xe.on(gt,Bt),wt&&Xe&&Xe.store.on(wt,Bt),function(){dt.current=!1,gt&&Xe&>.split(" ").forEach(function(Tt){return Xe.off(Tt,Bt)}),wt&&Xe&&wt.split(" ").forEach(function(Tt){return Xe.store.off(Tt,Bt)})}},[Xe,ut]);var At=React.useRef(!0);React.useEffect(function(){dt.current&&!At.current&&st(rt),At.current=!1},[Xe,nt]);var pt=[at,Xe,et];if(pt.t=at,pt.i18n=Xe,pt.ready=et,et||!et&&!Ze)return pt;throw new Promise(function(gt){loadNamespaces(Xe,tt,function(){gt()})})}function I18nextProvider(me){var ue=me.i18n,Qe=me.defaultNS,Ue=me.children,He=React.useMemo(function(){return{i18n:ue,defaultNS:Qe}},[ue,Qe]);return React.createElement(I18nContext.Provider,{value:He},Ue)}const supportedLngs=["en","en-DG","es","es-ES","sr","sr-Latn","fr","pt-BR","pt","bn","zh","hi","id","ms","tr","vi","ht","it","de","nl","tl-PH","pl","hu","ro"],languageDetector=new Browser;languageDetector.addDetector({name:"navigatorOnlyLanguage",lookup(){if(typeof navigator>"u")return"en";const me=navigator.language;return supportedLngs.includes(me)?me:me.split("-")[0]}});const apiKey="cg41dUINoxdp8BaHDQLJhA",loadPath=`https://api.i18nexus.com/project_resources/translations/{{lng}}/{{ns}}.json?api_key=${apiKey}`,i18nInstance=instance.createInstance();i18nInstance.use(initReactI18next).use(Backend).use(languageDetector).init({fallbackLng:"en",supportedLngs,ns:["default"],detection:{order:["querystring","cookie","localStorage","sessionStorage","navigatorOnlyLanguage","htmlTag","path","subdomain"],lookupQuerystring:"lang"},defaultNS:"default",parseMissingKeyHandler:me=>{const ue=me.split("."),Qe=ue[ue.length-1];return camelToStartCase(Qe)},partialBundledLanguages:!0,keySeparator:".",interpolation:{escapeValue:!1},backend:{loadPath},react:{useSuspense:!1},initImmediate:!1});const addCustomFields=({token:me,fields:ue})=>exports.api.post("/omni/add/custom-fields",{customFields:{...ue}},{headers:{"X-Incode-Hardware-Id":me}}).then(Qe=>Qe.data).catch(Qe=>Promise.reject(Qe.response.data));async function addContract({token:me,image:ue}){const{url:Qe,contractId:Ue}=await getContractURL({token:me});return await fetch(Qe,{method:"PUT",body:ue,headers:{"x-ms-blob-type":"BlockBlob"}}),{url:Qe,contractId:Ue}}function getContractURL({token:me}){return exports.api.post("/omni/generateContractUploadUrl",null,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>ue.data)}async function addDocument({token:me,type:ue,image:Qe,onProgress:Ue=emptyFunc}){if(ue==="contract"){const{url:He,contractId:Ge}=await addContract({token:me,image:b64toBlob(Qe)});return{success:!0,sessionStatus:"Alive",additionalInformation:{contractId:Ge,url:He}}}return exports.api.post(`/omni/add/document/v2?type=${ue}`,{base64Image:Qe},{headers:{"X-Incode-Hardware-Id":me},onUploadProgress:({loaded:He,total:Ge})=>Ue(He/Ge*100)}).then(He=>He.data).catch(He=>Promise.reject(He.response.data))}function addName({token:me,name:ue}){return exports.api.post("/omni/add/name",{name:ue},{headers:{"X-Incode-Hardware-Id":me}}).catch(Qe=>Promise.reject(Qe.response.data))}const addQrUrl="/omni/qr";function addQr({token:me}){return exports.api.get(addQrUrl,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>ue.data)}function approve({token:me}){return exports.api.post("/omni/process/approve",null,{headers:{"X-Incode-Hardware-Id":me}}).then(ue=>{const{uuid:Qe,...Ue}=ue.data;return{...Ue,customerId:Qe}}).catch(ue=>{var Qe;return Promise.reject((Qe=ue.response)==null?void 0:Qe.data)})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.min.js
|
|
@@ -2682,7 +2682,7 @@ newPrivacyConsent.text4
|
|
|
2682
2682
|
`).filter(it=>!!it.trim());return jsxRuntimeExports.jsxs(ConsentWrapper$1,{role:"region","aria-live":"assertive",className:`
|
|
2683
2683
|
${ue.default?"IncodeDefaultConsent":"IncodeCustomConsent"}
|
|
2684
2684
|
`,children:[jsxRuntimeExports.jsx(ConsentTitle,{tabIndex:0,children:et}),rt.map((it,ot)=>jsxRuntimeExports.jsx(ConsentParagraph,{tabIndex:0,children:ue.default?jsxRuntimeExports.jsx(Markdown,{disallowedElements:disallowedMarkdownElements,children:Ge(it)}):jsxRuntimeExports.jsx(Markdown,{disallowedElements:disallowedMarkdownElements,children:it})},ot)),jsxRuntimeExports.jsx(AcceptCheck$2,{consentChecked:Xe,setConsentChecked:Ke,text:nt,id:"one"}),He?jsxRuntimeExports.jsx(AcceptCheck$2,{consentChecked:$e,setConsentChecked:Je,text:Ge("privacyCheck.aeromexico"),id:"two"}):null,jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Button$a,{tabIndex:0,"aria-disabled":tt,disabled:tt,onClick:Ze,children:Ge("privacyConsent.button.continue")})})]})}function PrivacyConsent({session:me,title:ue,text:Qe,goNext:Ue,isAeroMexicoClient:He}){const{t:Ge}=useTranslation(),[Xe,Ke]=React.useState(null);React.useEffect(()=>{Object.hasOwn||(Object.hasOwn=(Ze,nt)=>Object.prototype.hasOwnProperty.call(Ze,nt))},[]);const $e=Ze=>{const nt=Ze.split(`
|
|
2685
|
-
`);return nt.length===1?nt.join(" "):nt.filter(tt=>!!tt.trim()).map(tt=>Ge(tt)).join(" ")},Je=({title:Ze,content:nt,isDefault:tt})=>{addConsent({title:`${tt?Ge(Ze):Ze}`,content:tt?$e(nt):nt,status:!0,session:me})};return React.useEffect(()=>{if(ue||Qe){Ke({title:ue||defaultPrivacyConsent.title,text:Qe||defaultPrivacyConsent.text,consentType:defaultPrivacyConsent.consentType,default:!Qe});return}getPrivacyConsentData({session:me,type:"PRIVACY"}).then(({consents:Ze})=>{const nt=Ze.find(({consentType:tt})=>tt==="PRIVACY");nt!=null&&nt.text?Ke({...nt,title:(nt==null?void 0:nt.title.trim())||defaultPrivacyConsent.title,text:nt.text.trim()||defaultPrivacyConsent.text,default:!(nt!=null&&nt.text)}):Ke(defaultPrivacyConsent)}).catch(()=>{Ke(defaultPrivacyConsent)})},[me,ue,Qe]),Xe?jsxRuntimeExports.jsx(NormalPrivacyConsent,{consent:Xe,goNext:Ue,addPrivacyConsent:Je,session:me,isAeroMexicoClient:He}):null}function renderUserConsent(me,{session:ue,onSuccess:Qe,title:Ue,text:He,isAeroMexicoClient:Ge=!1}){const Xe=createRoot$1(me),Ke=handleUnmountRoot(Qe,Xe,me);customRender(jsxRuntimeExports.jsx(App$1,{token:ue.token,children:jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Ke,session:ue,title:Ue,text:He,isAeroMexicoClient:Ge})}),me,Xe)}const version$1="1.75.2-rc.20241029001543";function r$1(me){for(var ue="",Qe=0;Qe<me.length;++Qe)if(Qe>0){var Ue=me[Qe].toLowerCase();Ue!==me[Qe]?ue+=" ".concat(Ue):ue+=me[Qe]}else ue+=me[Qe].toUpperCase();return ue}function o(me,ue){return function(Qe,Ue){return Object.prototype.hasOwnProperty.call(Qe,Ue)}(me,ue)?me[ue]:void 0}var i$1={default:"endpoint"},u={default:"tlsEndpoint"},a="Client timeout",R="Network connection error",c="Network request aborted",s="Response cannot be parsed",E="Blocked by CSP",f="The endpoint parameter is not a valid URL",d=r$1("WrongRegion"),l=r$1("SubscriptionNotActive"),_=r$1("UnsupportedVersion"),p=r$1("InstallationMethodRestricted"),v=r$1("HostnameRestricted"),O=r$1("IntegrationFailed"),I="API key required",h="API key not found",N="API key expired",T="Request cannot be parsed",m="Request failed",w="Request failed to process",A="Too many requests, rate limit exceeded",P="Not available for this origin",y="Not available with restricted header",D=I,S=h,L=N,U="3.8.6",b="9319";function g(me,ue){var Qe=[];return function(Ue,He){var Ge=5,Xe=(tt=Ue,et=__spreadArray$1([],tt,!0),{current:function(){return et[0]},postpone:function(){var it=et.shift();it!==void 0&&et.push(it)},exclude:function(){et.shift()}}),Ke=(Je=100,Ze=3e3,nt=0,function(){return Math.random()*Math.min(Ze,Je*Math.pow(2,nt++))}),$e=Xe.current(),Je,Ze,nt,tt,et;if($e===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var rt=function(it,ot){return He(it).catch(function(at){if(ot+1>=Ge)throw at;(function(lt){if(!(lt instanceof Error))return!1;var dt=lt.message;return dt===E||dt===b})(at)?Xe.exclude():Xe.postpone();var st,ut=Xe.current();if(ut===void 0)throw at;return(st=Ke(),new Promise(function(lt){return setTimeout(lt,st)})).then(function(){return rt(ut,ot+1)})})};return rt($e,0)}(me,function(Ue){var He=new Date,Ge=function(Ke){return Qe.push({url:Ue,startedAt:He,finishedAt:new Date,error:Ke})},Xe=ue(Ue);return Xe.then(function(){return Ge()},Ge),Xe}).then(function(Ue){return[Ue,Qe]})}var C="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",K=C,M="Failed to load the JS script of the agent";function B(me){var ue;me.scriptUrlPattern;var Qe=me.token,Ue=me.apiKey,He=Ue===void 0?Qe:Ue,Ge=__rest$3(me,["scriptUrlPattern","token","apiKey"]),Xe=(ue=o(me,"scriptUrlPattern"))!==null&&ue!==void 0?ue:C,Ke=function(){var Ze=[],nt=function(){Ze.push({time:new Date,state:document.visibilityState})},tt=function(et,rt,it,ot){return et.addEventListener(rt,it,ot),function(){return et.removeEventListener(rt,it,ot)}}(document,"visibilitychange",nt);return nt(),[Ze,tt]}(),$e=Ke[0],Je=Ke[1];return Promise.resolve().then(function(){if(!He||typeof He!="string")throw new Error(I);var Ze=function(nt,tt){return(Array.isArray(nt)?nt:[nt]).map(function(et){return function(rt,it){var ot=encodeURIComponent;return rt.replace(/<[^<>]+>/g,function(at){return at==="<version>"?"3":at==="<apiKey>"?ot(it):at==="<loaderVersion>"?ot(U):at})}(String(et),tt)})}(Xe,He);return g(Ze,F)}).catch(function(Ze){throw Je(),function(nt){return nt instanceof Error&&nt.message===b?new Error(M):nt}(Ze)}).then(function(Ze){var nt=Ze[0],tt=Ze[1];return Je(),nt.load(__assign$2(__assign$2({},Ge),{ldi:{attempts:tt,visibilityStates:$e}}))})}function F(me){return function(ue,Qe,Ue,He){var Ge,Xe=document,Ke="securitypolicyviolation",$e=function(Ze){var nt=new URL(ue,location.href),tt=Ze.blockedURI;tt!==nt.href&&tt!==nt.protocol.slice(0,-1)&&tt!==nt.origin||(Ge=Ze,Je())};Xe.addEventListener(Ke,$e);var Je=function(){return Xe.removeEventListener(Ke,$e)};return Promise.resolve().then(Qe).then(function(Ze){return Je(),Ze},function(Ze){return new Promise(function(nt){return setTimeout(nt)}).then(function(){if(Je(),Ge)return Ue(Ge);throw Ze})})}(me,function(){return function(ue){return new Promise(function(Qe,Ue){var He=document.createElement("script"),Ge=function(){var Ke;return(Ke=He.parentNode)===null||Ke===void 0?void 0:Ke.removeChild(He)},Xe=document.head||document.getElementsByTagName("head")[0];He.onload=function(){Ge(),Qe()},He.onerror=function(){Ge(),Ue(new Error(M))},He.async=!0,He.src=ue,Xe.appendChild(He)})}(me)},function(){throw new Error(E)}).then(V)}function V(){var me=window,ue="__fpjs_p_l_b",Qe=me[ue];if(function(Ue,He){var Ge,Xe=(Ge=Object.getOwnPropertyDescriptor)===null||Ge===void 0?void 0:Ge.call(Object,Ue,He);Xe!=null&&Xe.configurable?delete Ue[He]:Xe&&!Xe.writable||(Ue[He]=void 0)}(me,ue),typeof(Qe==null?void 0:Qe.load)!="function")throw new Error(b);return Qe}var k={load:B,defaultScriptUrlPattern:K,ERROR_SCRIPT_LOAD_FAIL:M,ERROR_API_KEY_EXPIRED:N,ERROR_API_KEY_INVALID:h,ERROR_API_KEY_MISSING:I,ERROR_BAD_REQUEST_FORMAT:T,ERROR_BAD_RESPONSE_FORMAT:s,ERROR_CLIENT_TIMEOUT:a,ERROR_CSP_BLOCK:E,ERROR_FORBIDDEN_ENDPOINT:v,ERROR_FORBIDDEN_HEADER:y,ERROR_FORBIDDEN_ORIGIN:P,ERROR_GENERAL_SERVER_FAILURE:m,ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_INTEGRATION_FAILURE:O,ERROR_INVALID_ENDPOINT:f,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:R,ERROR_RATE_LIMIT:A,ERROR_SERVER_TIMEOUT:w,ERROR_SUBSCRIPTION_NOT_ACTIVE:l,ERROR_TOKEN_EXPIRED:L,ERROR_TOKEN_INVALID:S,ERROR_TOKEN_MISSING:D,ERROR_UNSUPPORTED_VERSION:_,ERROR_WRONG_REGION:d,defaultEndpoint:i$1,defaultTlsEndpoint:u};let fingerprintApiKey;function setFingerprintApiKey(me){fingerprintApiKey=me}async function getFingerPrint(){return k.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(me=>me.get({extendedResult:!0}))}const fingerPrintUrl="/omni/add/device-fingerprint";function postFingerprint({hash:me,ip:ue,deviceType:Qe,token:Ue,data:He,osVersion:Ge,deviceModel:Xe,browser:Ke,sdkVersion:$e,hasLiedBrowser:Je,hostingApp:Ze,ipLocation:nt}){return exports.api.post(fingerPrintUrl,{hash:me,ip:ue,deviceType:Qe,data:He,osVersion:Ge,deviceModel:Xe,browser:Ke,hasLiedBrowser:Je,sdkVersion:$e,hostingApp:Ze,ipLocation:nt},{headers:{"X-Incode-Hardware-Id":Ue}}).then(tt=>tt.data).catch(tt=>Promise.reject(tt.response.data))}function formatDeviceModel({vendor:me,model:ue}){return`${me||""} ${ue||""}`.trim()}const emptyFingerprint={visitorId:void 0,ip:void 0,ipLocation:{country:{name:void 0},subdivisions:[],city:{name:void 0},latitude:void 0,longitude:void 0}};async function sendFingerprint({token:me},ue=!0,Qe=!0){var $e,Je,Ze;const Ue="WEBAPP",{os:He,device:Ge,browser:Xe}=getUAParserResults(),Ke=Qe?await getFingerPrint().catch(nt=>(addEvent({code:"fingerprintFetchFailed",payload:{message:nt.message},token:me}),emptyFingerprint)):emptyFingerprint;return postFingerprint({hash:Ke.visitorId||"",ip:ue&&Ke.ip||"",deviceType:Ue,token:me,data:JSON.stringify(Ke),osVersion:`${He.name} ${He.version}`,deviceModel:formatDeviceModel(Ge),browser:`${Xe.name} ${Xe.version}`,hasLiedBrowser:isBrowserSimulation(),hostingApp:options.hostingApp,sdkVersion:version$1,ipLocation:{ipCountry:($e=Ke.ipLocation.country)==null?void 0:$e.name,ipRegion:(Je=Ke.ipLocation.subdivisions)==null?void 0:Je[0].name,ipCity:(Ze=Ke.ipLocation.city)==null?void 0:Ze.name,ipLatitude:Ke.ipLocation.latitude,ipLongitude:Ke.ipLocation.longitude}}).then(nt=>(emptyDeviceStatsQueue(me),nt))}function mapI18nLang(me){const ue={en:"en-US",es:"es-ES",pt:"pt-BR"},Qe=me==null?void 0:me.substring(0,2);return ue[Qe]||"en-US"}const createSessionUrl="/omni/start";async function createNewSession({externalId:me,externalCustomerId:ue,configurationId:Qe,uuid:Ue,interviewId:He,customFields:Ge,language:Xe}={}){const Ke=Xe||mapI18nLang(i18nInstance.language);try{const $e=await exports.api.post(createSessionUrl,{externalId:me,externalCustomerId:ue,configurationId:Qe,uuid:Ue,interviewId:He,customFields:Ge,language:Ke});state.token=$e.data;const Je=$e.data;emptyQueue(Je.token);const Ze=await sendFingerprint({token:Je.token,interviewId:Je.interviewId}).catch(()=>({regulationType:"",showMandatoryConsent:!1}));Je.regulationType=Ze.regulationType??"",Je.showMandatoryConsent=Ze.showMandatoryConsent??!1;const tt=new UAParser().getResult();return addEvent({code:"browser",payload:{userAgent:window.navigator.userAgent,isWebRtcSupported:isWebRtcSupported(),...tt},token:Je.token}),Je}catch($e){throw $e!=null&&$e.response?$e.response.data:$e}}const createRedirectUrl=async({session:me})=>{const{url:ue}=await exports.api.get("/omni/onboarding-url",{params:{clientId:me.clientId},headers:{"X-Incode-Hardware-Id":me.token}}).then(Qe=>Qe.data);return ue};async function createSession$3(me,ue,{externalCustomerId:Qe,configurationId:Ue,uuid:He,interviewId:Ge,customFields:Xe,language:Ke}={}){return createNewSession({externalId:ue,externalCustomerId:Qe,configurationId:Ue,uuid:He,interviewId:Ge,customFields:Xe,language:Ke})}var isHTMLElement=me=>me instanceof HTMLElement;const EVENTS={BLUR:"blur",CHANGE:"change",INPUT:"input"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},SELECT="select",UNDEFINED="undefined",INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};function attachEventListeners({ref:me},ue,Qe){isHTMLElement(me)&&Qe&&(me.addEventListener(ue?EVENTS.CHANGE:EVENTS.INPUT,Qe),me.addEventListener(EVENTS.BLUR,Qe))}var isNullOrUndefined=me=>me==null;const isObjectType=me=>typeof me=="object";var isObject$4=me=>!isNullOrUndefined(me)&&!Array.isArray(me)&&isObjectType(me)&&!(me instanceof Date),isKey=me=>/^\w*$/.test(me),compact=me=>me.filter(Boolean),stringToPath=me=>compact(me.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function set(me,ue,Qe){let Ue=-1;const He=isKey(ue)?[ue]:stringToPath(ue),Ge=He.length,Xe=Ge-1;for(;++Ue<Ge;){const Ke=He[Ue];let $e=Qe;if(Ue!==Xe){const Je=me[Ke];$e=isObject$4(Je)||Array.isArray(Je)?Je:isNaN(+He[Ue+1])?{}:[]}me[Ke]=$e,me=me[Ke]}return me}var transformToNestObject=(me,ue={})=>{for(const Qe in me)isKey(Qe)?ue[Qe]=me[Qe]:set(ue,Qe,me[Qe]);return ue},isUndefined$1=me=>me===void 0,get=(me={},ue,Qe)=>{const Ue=compact(ue.split(/[,[\].]+?/)).reduce((He,Ge)=>isNullOrUndefined(He)?He:He[Ge],me);return isUndefined$1(Ue)||Ue===me?isUndefined$1(me[ue])?Qe:me[ue]:Ue},focusOnErrorField=(me,ue)=>{for(const Qe in me)if(get(ue,Qe)){const Ue=me[Qe];if(Ue){if(Ue.ref.focus&&isUndefined$1(Ue.ref.focus()))break;if(Ue.options){Ue.options[0].ref.focus();break}}}},removeAllEventListeners=(me,ue)=>{isHTMLElement(me)&&me.removeEventListener&&(me.removeEventListener(EVENTS.INPUT,ue),me.removeEventListener(EVENTS.CHANGE,ue),me.removeEventListener(EVENTS.BLUR,ue))};const defaultReturn={isValid:!1,value:null};var getRadioValue=me=>Array.isArray(me)?me.reduce((ue,Qe)=>Qe&&Qe.ref.checked?{isValid:!0,value:Qe.ref.value}:ue,defaultReturn):defaultReturn,getMultipleSelectValue=me=>[...me].filter(({selected:ue})=>ue).map(({value:ue})=>ue),isRadioInput=me=>me.type==="radio",isFileInput=me=>me.type==="file",isCheckBoxInput=me=>me.type==="checkbox",isMultipleSelect=me=>me.type===`${SELECT}-multiple`;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=me=>{if(Array.isArray(me)){if(me.length>1){const He=me.filter(Ge=>Ge&&Ge.ref.checked).map(({ref:{value:Ge}})=>Ge);return{value:He,isValid:!!He.length}}const{checked:ue,value:Qe,attributes:Ue}=me[0].ref;return ue?Ue&&!isUndefined$1(Ue.value)?isUndefined$1(Qe)||Qe===""?validResult:{value:Qe,isValid:!0}:validResult:defaultResult}return defaultResult};function getFieldValue(me,ue,Qe,Ue,He){const Ge=me.current[ue];if(Ge){const{ref:{value:Xe,disabled:Ke},ref:$e,valueAsNumber:Je,valueAsDate:Ze,setValueAs:nt}=Ge;return Ke&&Ue?void 0:isFileInput($e)?$e.files:isRadioInput($e)?getRadioValue(Ge.options).value:isMultipleSelect($e)?getMultipleSelectValue($e.options):isCheckBoxInput($e)?getCheckboxValue(Ge.options).value:He?Xe:Je?Xe===""?NaN:+Xe:Ze?$e.valueAsDate:nt?nt(Xe):Xe}if(Qe)return get(Qe.current,ue)}function isDetached(me){return me?!(me instanceof HTMLElement)||me.nodeType===Node.DOCUMENT_NODE?!1:isDetached(me.parentNode):!0}var isEmptyObject=me=>isObject$4(me)&&!Object.keys(me).length,isBoolean=me=>typeof me=="boolean";function baseGet(me,ue){const Qe=ue.slice(0,-1).length;let Ue=0;for(;Ue<Qe;)me=isUndefined$1(me)?Ue++:me[ue[Ue++]];return me}function unset(me,ue){const Qe=isKey(ue)?[ue]:stringToPath(ue),Ue=Qe.length==1?me:baseGet(me,Qe),He=Qe[Qe.length-1];let Ge;Ue&&delete Ue[He];for(let Xe=0;Xe<Qe.slice(0,-1).length;Xe++){let Ke=-1,$e;const Je=Qe.slice(0,-(Xe+1)),Ze=Je.length-1;for(Xe>0&&(Ge=me);++Ke<Je.length;){const nt=Je[Ke];$e=$e?$e[nt]:me[nt],Ze===Ke&&(isObject$4($e)&&isEmptyObject($e)||Array.isArray($e)&&!$e.filter(tt=>isObject$4(tt)&&!isEmptyObject(tt)||isBoolean(tt)).length)&&(Ge?delete Ge[nt]:delete me[nt]),Ge=$e}}return me}const isSameRef=(me,ue)=>me&&me.ref===ue;function findRemovedFieldAndRemoveListener(me,ue,Qe,Ue,He,Ge){const{ref:Xe,ref:{name:Ke}}=Qe,$e=me.current[Ke];if(!He){const Je=getFieldValue(me,Ke,Ue);!isUndefined$1(Je)&&set(Ue.current,Ke,Je)}if(!Xe.type||!$e){delete me.current[Ke];return}isRadioInput(Xe)||isCheckBoxInput(Xe)?Array.isArray($e.options)&&$e.options.length?(compact($e.options).forEach((Je={},Ze)=>{(isDetached(Je.ref)&&isSameRef(Je,Je.ref)||Ge)&&(removeAllEventListeners(Je.ref,ue),unset($e.options,`[${Ze}]`))}),$e.options&&!compact($e.options).length&&delete me.current[Ke]):delete me.current[Ke]:(isDetached(Xe)&&isSameRef($e,Xe)||Ge)&&(removeAllEventListeners(Xe,ue),delete me.current[Ke])}var isPrimitive=me=>isNullOrUndefined(me)||!isObjectType(me);function deepMerge(me,ue){if(isPrimitive(me)||isPrimitive(ue))return ue;for(const Qe in ue){const Ue=me[Qe],He=ue[Qe];try{me[Qe]=isObject$4(Ue)&&isObject$4(He)||Array.isArray(Ue)&&Array.isArray(He)?deepMerge(Ue,He):He}catch{}}return me}function deepEqual(me,ue,Qe){if(isPrimitive(me)||isPrimitive(ue)||me instanceof Date||ue instanceof Date)return me===ue;if(!React.isValidElement(me)){const Ue=Object.keys(me),He=Object.keys(ue);if(Ue.length!==He.length)return!1;for(const Ge of Ue){const Xe=me[Ge];if(!(Qe&&Ge==="ref")){const Ke=ue[Ge];if((isObject$4(Xe)||Array.isArray(Xe))&&(isObject$4(Ke)||Array.isArray(Ke))?!deepEqual(Xe,Ke,Qe):Xe!==Ke)return!1}}}return!0}function setDirtyFields(me,ue,Qe,Ue,He){let Ge=-1;for(;++Ge<me.length;){for(const Xe in me[Ge])Array.isArray(me[Ge][Xe])?(!Qe[Ge]&&(Qe[Ge]={}),Qe[Ge][Xe]=[],setDirtyFields(me[Ge][Xe],get(ue[Ge]||{},Xe,[]),Qe[Ge][Xe],Qe[Ge],Xe)):deepEqual(get(ue[Ge]||{},Xe),me[Ge][Xe])?set(Qe[Ge]||{},Xe):Qe[Ge]=Object.assign(Object.assign({},Qe[Ge]),{[Xe]:!0});Ue&&!Qe.length&&delete Ue[He]}return Qe}var setFieldArrayDirtyFields=(me,ue,Qe)=>deepMerge(setDirtyFields(me,ue,Qe.slice(0,me.length)),setDirtyFields(ue,me,Qe.slice(0,me.length))),isString$2=me=>typeof me=="string",getFieldsValues=(me,ue,Qe,Ue,He)=>{const Ge={};for(const Xe in me.current)(isUndefined$1(He)||(isString$2(He)?Xe.startsWith(He):Array.isArray(He)&&He.find(Ke=>Xe.startsWith(Ke))))&&(Ge[Xe]=getFieldValue(me,Xe,void 0,Ue));return Qe?transformToNestObject(Ge):deepMerge(ue,transformToNestObject(Ge))},isErrorStateChanged=({errors:me,name:ue,error:Qe,validFields:Ue,fieldsWithValidation:He})=>{const Ge=isUndefined$1(Qe),Xe=get(me,ue);return Ge&&!!Xe||!Ge&&!deepEqual(Xe,Qe,!0)||Ge&&get(He,ue)&&!get(Ue,ue)},isRegex=me=>me instanceof RegExp,getValueAndMessage=me=>isObject$4(me)&&!isRegex(me)?me:{value:me,message:""},isFunction$1=me=>typeof me=="function",isMessage=me=>isString$2(me)||React.isValidElement(me);function getValidateError(me,ue,Qe="validate"){if(isMessage(me)||isBoolean(me)&&!me)return{type:Qe,message:isMessage(me)?me:"",ref:ue}}var appendErrors=(me,ue,Qe,Ue,He)=>ue?Object.assign(Object.assign({},Qe[me]),{types:Object.assign(Object.assign({},Qe[me]&&Qe[me].types?Qe[me].types:{}),{[Ue]:He||!0})}):{},validateField=async(me,ue,{ref:Qe,ref:{value:Ue},options:He,required:Ge,maxLength:Xe,minLength:Ke,min:$e,max:Je,pattern:Ze,validate:nt},tt)=>{const et=Qe.name,rt={},it=isRadioInput(Qe),ot=isCheckBoxInput(Qe),at=it||ot,st=Ue==="",ut=appendErrors.bind(null,et,ue,rt),lt=(dt,At,pt,gt=INPUT_VALIDATION_RULES.maxLength,wt=INPUT_VALIDATION_RULES.minLength)=>{const Bt=dt?At:pt;rt[et]=Object.assign({type:dt?gt:wt,message:Bt,ref:Qe},ut(dt?gt:wt,Bt))};if(Ge&&(!it&&!ot&&(st||isNullOrUndefined(Ue))||isBoolean(Ue)&&!Ue||ot&&!getCheckboxValue(He).isValid||it&&!getRadioValue(He).isValid)){const{value:dt,message:At}=isMessage(Ge)?{value:!!Ge,message:Ge}:getValueAndMessage(Ge);if(dt&&(rt[et]=Object.assign({type:INPUT_VALIDATION_RULES.required,message:At,ref:at?((me.current[et].options||[])[0]||{}).ref:Qe},ut(INPUT_VALIDATION_RULES.required,At)),!ue))return rt}if((!isNullOrUndefined($e)||!isNullOrUndefined(Je))&&Ue!==""){let dt,At;const pt=getValueAndMessage(Je),gt=getValueAndMessage($e);if(isNaN(Ue)){const wt=Qe.valueAsDate||new Date(Ue);isString$2(pt.value)&&(dt=wt>new Date(pt.value)),isString$2(gt.value)&&(At=wt<new Date(gt.value))}else{const wt=Qe.valueAsNumber||parseFloat(Ue);isNullOrUndefined(pt.value)||(dt=wt>pt.value),isNullOrUndefined(gt.value)||(At=wt<gt.value)}if((dt||At)&&(lt(!!dt,pt.message,gt.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!ue))return rt}if(isString$2(Ue)&&!st&&(Xe||Ke)){const dt=getValueAndMessage(Xe),At=getValueAndMessage(Ke),pt=!isNullOrUndefined(dt.value)&&Ue.length>dt.value,gt=!isNullOrUndefined(At.value)&&Ue.length<At.value;if((pt||gt)&&(lt(pt,dt.message,At.message),!ue))return rt}if(isString$2(Ue)&&Ze&&!st){const{value:dt,message:At}=getValueAndMessage(Ze);if(isRegex(dt)&&!dt.test(Ue)&&(rt[et]=Object.assign({type:INPUT_VALIDATION_RULES.pattern,message:At,ref:Qe},ut(INPUT_VALIDATION_RULES.pattern,At)),!ue))return rt}if(nt){const dt=getFieldValue(me,et,tt,!1,!0),At=at&&He?He[0].ref:Qe;if(isFunction$1(nt)){const pt=await nt(dt),gt=getValidateError(pt,At);if(gt&&(rt[et]=Object.assign(Object.assign({},gt),ut(INPUT_VALIDATION_RULES.validate,gt.message)),!ue))return rt}else if(isObject$4(nt)){let pt={};for(const[gt,wt]of Object.entries(nt)){if(!isEmptyObject(pt)&&!ue)break;const Bt=await wt(dt),Tt=getValidateError(Bt,At,gt);Tt&&(pt=Object.assign(Object.assign({},Tt),ut(gt,Tt.message)),ue&&(rt[et]=pt))}if(!isEmptyObject(pt)&&(rt[et]=Object.assign({ref:At},pt),!ue))return rt}}return rt};const getPath=(me,ue,Qe=[])=>{for(const Ue in ue){const He=me+(isObject$4(ue)?`.${Ue}`:`[${Ue}]`);isPrimitive(ue[Ue])?Qe.push(He):getPath(He,ue[Ue],Qe)}return Qe};var assignWatchFields=(me,ue,Qe,Ue,He)=>{let Ge;return Qe.add(ue),isEmptyObject(me)||(Ge=get(me,ue),(isObject$4(Ge)||Array.isArray(Ge))&&getPath(ue,Ge).forEach(Xe=>Qe.add(Xe))),isUndefined$1(Ge)?He?Ue:get(Ue,ue):Ge},skipValidation=({isOnBlur:me,isOnChange:ue,isOnTouch:Qe,isTouched:Ue,isReValidateOnBlur:He,isReValidateOnChange:Ge,isBlurEvent:Xe,isSubmitted:Ke,isOnAll:$e})=>$e?!1:!Ke&&Qe?!(Ue||Xe):(Ke?He:me)?!Xe:(Ke?Ge:ue)?Xe:!0,getFieldArrayParentName=me=>me.substring(0,me.indexOf("["));const isMatchFieldArrayName=(me,ue)=>RegExp(`^${ue}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(me);var isNameInFieldArray=(me,ue)=>[...me].some(Qe=>isMatchFieldArrayName(ue,Qe)),isSelectInput=me=>me.type===`${SELECT}-one`;function onDomRemove(me,ue){const Qe=new MutationObserver(()=>{for(const Ue of Object.values(me.current))if(Ue&&Ue.options)for(const He of Ue.options)He&&He.ref&&isDetached(He.ref)&&ue(Ue);else Ue&&isDetached(Ue.ref)&&ue(Ue)});return Qe.observe(window.document,{childList:!0,subtree:!0}),Qe}var isWeb=typeof window!==UNDEFINED&&typeof document!==UNDEFINED;function cloneObject(me){var ue;let Qe;if(isPrimitive(me)||isWeb&&(me instanceof File||isHTMLElement(me))||!["Set","Map","Object","Date","Array"].includes((ue=me.constructor)===null||ue===void 0?void 0:ue.name))return me;if(me instanceof Date)return Qe=new Date(me.getTime()),Qe;if(me instanceof Set){Qe=new Set;for(const Ue of me)Qe.add(Ue);return Qe}if(me instanceof Map){Qe=new Map;for(const Ue of me.keys())Qe.set(Ue,cloneObject(me.get(Ue)));return Qe}Qe=Array.isArray(me)?[]:{};for(const Ue in me)Qe[Ue]=cloneObject(me[Ue]);return Qe}var modeChecker=me=>({isOnSubmit:!me||me===VALIDATION_MODE.onSubmit,isOnBlur:me===VALIDATION_MODE.onBlur,isOnChange:me===VALIDATION_MODE.onChange,isOnAll:me===VALIDATION_MODE.all,isOnTouch:me===VALIDATION_MODE.onTouched}),isRadioOrCheckboxFunction=me=>isRadioInput(me)||isCheckBoxInput(me);const isWindowUndefined=typeof window===UNDEFINED,isProxyEnabled=isWeb?"Proxy"in window:typeof Proxy!==UNDEFINED;function useForm({mode:me=VALIDATION_MODE.onSubmit,reValidateMode:ue=VALIDATION_MODE.onChange,resolver:Qe,context:Ue,defaultValues:He={},shouldFocusError:Ge=!0,shouldUnregister:Xe=!0,criteriaMode:Ke}={}){const $e=React.useRef({}),Je=React.useRef({}),Ze=React.useRef({}),nt=React.useRef(new Set),tt=React.useRef({}),et=React.useRef({}),rt=React.useRef({}),it=React.useRef({}),ot=React.useRef(He),at=React.useRef(!1),st=React.useRef(!1),ut=React.useRef(),lt=React.useRef({}),dt=React.useRef({}),At=React.useRef(Ue),pt=React.useRef(Qe),gt=React.useRef(new Set),wt=React.useRef(modeChecker(me)),{isOnSubmit:Bt,isOnTouch:Tt}=wt.current,yt=Ke===VALIDATION_MODE.all,[Ct,ht]=React.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!Bt,errors:{}}),It=React.useRef({isDirty:!isProxyEnabled,dirtyFields:!isProxyEnabled,touched:!isProxyEnabled||Tt,isValidating:!isProxyEnabled,isSubmitting:!isProxyEnabled,isValid:!isProxyEnabled}),vt=React.useRef(Ct),Et=React.useRef(),{isOnBlur:bt,isOnChange:Rt}=React.useRef(modeChecker(ue)).current;At.current=Ue,pt.current=Qe,vt.current=Ct,lt.current=Xe?{}:isEmptyObject(lt.current)?cloneObject(He):lt.current;const St=React.useCallback((rn={})=>{at.current||(vt.current=Object.assign(Object.assign({},vt.current),rn),ht(vt.current))},[]),kt=()=>It.current.isValidating&&St({isValidating:!0}),jt=React.useCallback((rn,ln,pn=!1,Sn={},In)=>{let Bn=pn||isErrorStateChanged({errors:vt.current.errors,error:ln,name:rn,validFields:it.current,fieldsWithValidation:rt.current});const kn=get(vt.current.errors,rn);ln?(unset(it.current,rn),Bn=Bn||!kn||!deepEqual(kn,ln,!0),set(vt.current.errors,rn,ln)):((get(rt.current,rn)||pt.current)&&(set(it.current,rn,!0),Bn=Bn||kn),unset(vt.current.errors,rn)),(Bn&&!isNullOrUndefined(pn)||!isEmptyObject(Sn)||It.current.isValidating)&&St(Object.assign(Object.assign(Object.assign({},Sn),pt.current?{isValid:!!In}:{}),{isValidating:!1}))},[]),Pt=React.useCallback((rn,ln)=>{const{ref:pn,options:Sn}=$e.current[rn],In=isWeb&&isHTMLElement(pn)&&isNullOrUndefined(ln)?"":ln;isRadioInput(pn)?(Sn||[]).forEach(({ref:Bn})=>Bn.checked=Bn.value===In):isFileInput(pn)&&!isString$2(In)?pn.files=In:isMultipleSelect(pn)?[...pn.options].forEach(Bn=>Bn.selected=In.includes(Bn.value)):isCheckBoxInput(pn)&&Sn?Sn.length>1?Sn.forEach(({ref:Bn})=>Bn.checked=Array.isArray(In)?!!In.find(kn=>kn===Bn.value):In===Bn.value):Sn[0].ref.checked=!!In:pn.value=In},[]),Qt=React.useCallback((rn,ln)=>{if(It.current.isDirty){const pn=Ft();return rn&&ln&&set(pn,rn,ln),!deepEqual(pn,ot.current)}return!1},[]),qt=React.useCallback((rn,ln=!0)=>{if(It.current.isDirty||It.current.dirtyFields){const pn=!deepEqual(get(ot.current,rn),getFieldValue($e,rn,lt)),Sn=get(vt.current.dirtyFields,rn),In=vt.current.isDirty;pn?set(vt.current.dirtyFields,rn,!0):unset(vt.current.dirtyFields,rn);const Bn={isDirty:Qt(),dirtyFields:vt.current.dirtyFields},kn=It.current.isDirty&&In!==Bn.isDirty||It.current.dirtyFields&&Sn!==get(vt.current.dirtyFields,rn);return kn&&ln&&St(Bn),kn?Bn:{}}return{}},[]),_t=React.useCallback(async(rn,ln)=>{if(process.env.NODE_ENV!=="production"&&!$e.current[rn])return console.warn("📋 Field is missing with `name` attribute: ",rn),!1;const pn=(await validateField($e,yt,$e.current[rn],lt))[rn];return jt(rn,pn,ln),isUndefined$1(pn)},[jt,yt]),Yt=React.useCallback(async rn=>{const{errors:ln}=await pt.current(Ft(),At.current,yt),pn=vt.current.isValid;if(Array.isArray(rn)){const Sn=rn.map(In=>{const Bn=get(ln,In);return Bn?set(vt.current.errors,In,Bn):unset(vt.current.errors,In),!Bn}).every(Boolean);return St({isValid:isEmptyObject(ln),isValidating:!1}),Sn}else{const Sn=get(ln,rn);return jt(rn,Sn,pn!==isEmptyObject(ln),{},isEmptyObject(ln)),!Sn}},[jt,yt]),Xt=React.useCallback(async rn=>{const ln=rn||Object.keys($e.current);if(kt(),pt.current)return Yt(ln);if(Array.isArray(ln)){!rn&&(vt.current.errors={});const pn=await Promise.all(ln.map(async Sn=>await _t(Sn,null)));return St({isValidating:!1}),pn.every(Boolean)}return await _t(ln)},[Yt,_t]),Ut=React.useCallback((rn,ln,{shouldDirty:pn,shouldValidate:Sn})=>{const In={};set(In,rn,ln);for(const Bn of getPath(rn,ln))$e.current[Bn]&&(Pt(Bn,get(In,Bn)),pn&&qt(Bn),Sn&&Xt(Bn))},[Xt,Pt,qt]),Lt=React.useCallback((rn,ln,pn)=>{if(!Xe&&!isPrimitive(ln)&&set(lt.current,rn,Array.isArray(ln)?[...ln]:Object.assign({},ln)),$e.current[rn])Pt(rn,ln),pn.shouldDirty&&qt(rn),pn.shouldValidate&&Xt(rn);else if(!isPrimitive(ln)&&(Ut(rn,ln,pn),gt.current.has(rn))){const Sn=getFieldArrayParentName(rn)||rn;set(Je.current,rn,ln),dt.current[Sn]({[Sn]:get(Je.current,Sn)}),(It.current.isDirty||It.current.dirtyFields)&&pn.shouldDirty&&(set(vt.current.dirtyFields,rn,setFieldArrayDirtyFields(ln,get(ot.current,rn,[]),get(vt.current.dirtyFields,rn,[]))),St({isDirty:!deepEqual(Object.assign(Object.assign({},Ft()),{[rn]:ln}),ot.current)}))}!Xe&&set(lt.current,rn,ln)},[qt,Pt,Ut]),Ot=rn=>st.current||nt.current.has(rn)||nt.current.has((rn.match(/\w+/)||[])[0]),ft=rn=>{let ln=!0;if(!isEmptyObject(tt.current))for(const pn in tt.current)(!rn||!tt.current[pn].size||tt.current[pn].has(rn)||tt.current[pn].has(getFieldArrayParentName(rn)))&&(et.current[pn](),ln=!1);return ln};function Dt(rn,ln,pn){Lt(rn,ln,pn||{}),Ot(rn)&&St(),ft(rn)}ut.current=ut.current?ut.current:async({type:rn,target:ln})=>{let pn=ln.name;const Sn=$e.current[pn];let In,Bn;if(Sn){const kn=rn===EVENTS.BLUR,Yn=skipValidation(Object.assign({isBlurEvent:kn,isReValidateOnChange:Rt,isReValidateOnBlur:bt,isTouched:!!get(vt.current.touched,pn),isSubmitted:vt.current.isSubmitted},wt.current));let sr=qt(pn,!1),Cr=!isEmptyObject(sr)||!kn&&Ot(pn);if(kn&&!get(vt.current.touched,pn)&&It.current.touched&&(set(vt.current.touched,pn,!0),sr=Object.assign(Object.assign({},sr),{touched:vt.current.touched})),!Xe&&isCheckBoxInput(ln)&&set(lt.current,pn,getFieldValue($e,pn)),Yn)return!kn&&ft(pn),(!isEmptyObject(sr)||Cr&&isEmptyObject(sr))&&St(sr);if(kt(),pt.current){const{errors:hr}=await pt.current(Ft(),At.current,yt),jr=vt.current.isValid;if(In=get(hr,pn),isCheckBoxInput(ln)&&!In&&pt.current){const li=getFieldArrayParentName(pn),Un=get(hr,li,{});Un.type&&Un.message&&(In=Un),li&&(Un||get(vt.current.errors,li))&&(pn=li)}Bn=isEmptyObject(hr),jr!==Bn&&(Cr=!0)}else In=(await validateField($e,yt,Sn,lt))[pn];!kn&&ft(pn),jt(pn,In,Cr,sr,Bn)}};function Mt(rn){if(!Xe){let ln=cloneObject(rn);for(const pn of gt.current)isKey(pn)&&!ln[pn]&&(ln=Object.assign(Object.assign({},ln),{[pn]:[]}));return ln}return rn}function Ft(rn){if(isString$2(rn))return getFieldValue($e,rn,lt);if(Array.isArray(rn)){const ln={};for(const pn of rn)set(ln,pn,getFieldValue($e,pn,lt));return ln}return Mt(getFieldsValues($e,cloneObject(lt.current),Xe))}const Gt=React.useCallback(async(rn={})=>{const ln=isEmptyObject($e.current)?ot.current:{},{errors:pn}=await pt.current(Object.assign(Object.assign(Object.assign({},ln),Ft()),rn),At.current,yt)||{},Sn=isEmptyObject(pn);vt.current.isValid!==Sn&&St({isValid:Sn})},[yt]),zt=React.useCallback((rn,ln)=>{findRemovedFieldAndRemoveListener($e,ut.current,rn,lt,Xe,ln),Xe&&(unset(it.current,rn.ref.name),unset(rt.current,rn.ref.name))},[Xe]),$t=React.useCallback(rn=>{if(st.current)St();else{for(const ln of nt.current)if(ln.startsWith(rn)){St();break}ft(rn)}},[]),Ht=React.useCallback((rn,ln)=>{rn&&(zt(rn,ln),Xe&&!compact(rn.options||[]).length&&(unset(vt.current.errors,rn.ref.name),set(vt.current.dirtyFields,rn.ref.name,!0),St({isDirty:Qt()}),It.current.isValid&&pt.current&&Gt(),$t(rn.ref.name)))},[Gt,zt]);function hn(rn){rn&&(Array.isArray(rn)?rn:[rn]).forEach(ln=>$e.current[ln]&&isKey(ln)?delete vt.current.errors[ln]:unset(vt.current.errors,ln)),St({errors:rn?vt.current.errors:{}})}function un(rn,ln){const pn=($e.current[rn]||{}).ref;set(vt.current.errors,rn,Object.assign(Object.assign({},ln),{ref:pn})),St({isValid:!1}),ln.shouldFocus&&pn&&pn.focus&&pn.focus()}const An=React.useCallback((rn,ln,pn)=>{const Sn=pn?tt.current[pn]:nt.current;let In=getFieldsValues($e,cloneObject(lt.current),Xe,!1,rn);if(isString$2(rn)){const kn=getFieldArrayParentName(rn)||rn;return gt.current.has(kn)&&(In=Object.assign(Object.assign({},Ze.current),In)),assignWatchFields(In,rn,Sn,isUndefined$1(get(ot.current,rn))?ln:get(ot.current,rn),!0)}const Bn=isUndefined$1(ln)?ot.current:ln;return Array.isArray(rn)?rn.reduce((kn,Yn)=>Object.assign(Object.assign({},kn),{[Yn]:assignWatchFields(In,Yn,Sn,Bn)}),{}):(st.current=isUndefined$1(pn),transformToNestObject(!isEmptyObject(In)&&In||Bn))},[]);function mn(rn,ln){return An(rn,ln)}function En(rn){for(const ln of Array.isArray(rn)?rn:[rn])Ht($e.current[ln],!0)}function Jt(rn,ln={}){if(process.env.NODE_ENV!=="production"){if(!rn.name)return console.warn("📋 Field is missing `name` attribute",rn,"https://react-hook-form.com/api#useForm");if(gt.current.has(rn.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${rn.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(rn.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',rn,"https://react-hook-form.com/api#useFieldArray")}const{name:pn,type:Sn,value:In}=rn,Bn=Object.assign({ref:rn},ln),kn=$e.current,Yn=isRadioOrCheckboxFunction(rn),sr=isNameInFieldArray(gt.current,pn),Cr=qn=>isWeb&&(!isHTMLElement(rn)||qn===rn);let hr=kn[pn],jr=!0,li;if(hr&&(Yn?Array.isArray(hr.options)&&compact(hr.options).find(qn=>In===qn.ref.value&&Cr(qn.ref)):Cr(hr.ref))){kn[pn]=Object.assign(Object.assign({},hr),ln);return}Sn?hr=Yn?Object.assign({options:[...compact(hr&&hr.options||[]),{ref:rn}],ref:{type:Sn,name:pn}},ln):Object.assign({},Bn):hr=Bn,kn[pn]=hr;const Un=isUndefined$1(get(lt.current,pn));(!isEmptyObject(ot.current)||!Un)&&(li=get(Un?ot.current:lt.current,pn),jr=isUndefined$1(li),!jr&&!sr&&Pt(pn,li)),isEmptyObject(ln)||(set(rt.current,pn,!0),!Bt&&It.current.isValid&&validateField($e,yt,hr,lt).then(qn=>{const pr=vt.current.isValid;isEmptyObject(qn)?set(it.current,pn,!0):unset(it.current,pn),pr!==isEmptyObject(qn)&&St()})),Xe&&!(sr&&jr)&&!sr&&unset(vt.current.dirtyFields,pn),Sn&&attachEventListeners(Yn&&hr.options?hr.options[hr.options.length-1]:hr,Yn||isSelectInput(rn),ut.current)}function an(rn,ln){if(!isWindowUndefined)if(isString$2(rn))Jt({name:rn},ln);else if(isObject$4(rn)&&"name"in rn)Jt(rn,ln);else return pn=>pn&&Jt(pn,rn)}const cn=React.useCallback((rn,ln)=>async pn=>{pn&&pn.preventDefault&&(pn.preventDefault(),pn.persist());let Sn={},In=Mt(getFieldsValues($e,cloneObject(lt.current),Xe,!0));It.current.isSubmitting&&St({isSubmitting:!0});try{if(pt.current){const{errors:Bn,values:kn}=await pt.current(In,At.current,yt);vt.current.errors=Sn=Bn,In=kn}else for(const Bn of Object.values($e.current))if(Bn){const{name:kn}=Bn.ref,Yn=await validateField($e,yt,Bn,lt);Yn[kn]?(set(Sn,kn,Yn[kn]),unset(it.current,kn)):get(rt.current,kn)&&(unset(vt.current.errors,kn),set(it.current,kn,!0))}isEmptyObject(Sn)&&Object.keys(vt.current.errors).every(Bn=>Bn in $e.current)?(St({errors:{},isSubmitting:!0}),await rn(In,pn)):(vt.current.errors=Object.assign(Object.assign({},vt.current.errors),Sn),ln&&await ln(vt.current.errors,pn),Ge&&focusOnErrorField($e.current,vt.current.errors))}finally{vt.current.isSubmitting=!1,St({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(vt.current.errors),submitCount:vt.current.submitCount+1})}},[Ge,yt]),dn=({errors:rn,isDirty:ln,isSubmitted:pn,touched:Sn,isValid:In,submitCount:Bn,dirtyFields:kn})=>{In||(it.current={},rt.current={}),Je.current={},nt.current=new Set,st.current=!1,St({submitCount:Bn?vt.current.submitCount:0,isDirty:ln?vt.current.isDirty:!1,isSubmitted:pn?vt.current.isSubmitted:!1,isValid:In?vt.current.isValid:!1,dirtyFields:kn?vt.current.dirtyFields:{},touched:Sn?vt.current.touched:{},errors:rn?vt.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},yn=(rn,ln={})=>{if(isWeb){for(const pn of Object.values($e.current))if(pn){const{ref:Sn,options:In}=pn,Bn=isRadioOrCheckboxFunction(Sn)&&Array.isArray(In)?In[0].ref:Sn;if(isHTMLElement(Bn))try{Bn.closest("form").reset();break}catch{}}}$e.current={},ot.current=Object.assign({},rn||ot.current),rn&&ft(""),Object.values(dt.current).forEach(pn=>isFunction$1(pn)&&pn()),lt.current=Xe?{}:cloneObject(rn||ot.current),dn(ln)};React.useEffect(()=>{Qe&&It.current.isValid&&Gt(),Et.current=Et.current||!isWeb?Et.current:onDomRemove($e,Ht)},[Ht,ot.current]),React.useEffect(()=>()=>{Et.current&&Et.current.disconnect(),at.current=!0,process.env.NODE_ENV==="production"&&Object.values($e.current).forEach(rn=>Ht(rn,!0))},[]),!Qe&&It.current.isValid&&(Ct.isValid=deepEqual(it.current,rt.current)&&isEmptyObject(vt.current.errors));const Nn={trigger:Xt,setValue:React.useCallback(Dt,[Lt,Xt]),getValues:React.useCallback(Ft,[]),register:React.useCallback(an,[ot.current]),unregister:React.useCallback(En,[]),formState:isProxyEnabled?new Proxy(Ct,{get:(rn,ln)=>{if(process.env.NODE_ENV!=="production"&&ln==="isValid"&&Bt&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),ln in rn)return It.current[ln]=!0,rn[ln]}}):Ct},Rn=React.useMemo(()=>Object.assign({isFormDirty:Qt,updateWatchedValue:$t,shouldUnregister:Xe,updateFormState:St,removeFieldEventListener:zt,watchInternal:An,mode:wt.current,reValidateMode:{isReValidateOnBlur:bt,isReValidateOnChange:Rt},validateResolver:Qe?Gt:void 0,fieldsRef:$e,resetFieldArrayFunctionRef:dt,useWatchFieldsRef:tt,useWatchRenderFunctionsRef:et,fieldArrayDefaultValuesRef:Je,validFieldsRef:it,fieldsWithValidationRef:rt,fieldArrayNamesRef:gt,readFormStateRef:It,formStateRef:vt,defaultValuesRef:ot,shallowFieldsStateRef:lt,fieldArrayValuesRef:Ze},Nn),[ot.current,$t,Xe,zt,An]);return Object.assign({watch:mn,control:Rn,handleSubmit:cn,reset:React.useCallback(yn,[]),clearErrors:React.useCallback(hn,[]),setError:React.useCallback(un,[]),errors:Ct.errors},Nn)}/*! *****************************************************************************
|
|
2685
|
+
`);return nt.length===1?nt.join(" "):nt.filter(tt=>!!tt.trim()).map(tt=>Ge(tt)).join(" ")},Je=({title:Ze,content:nt,isDefault:tt})=>{addConsent({title:`${tt?Ge(Ze):Ze}`,content:tt?$e(nt):nt,status:!0,session:me})};return React.useEffect(()=>{if(ue||Qe){Ke({title:ue||defaultPrivacyConsent.title,text:Qe||defaultPrivacyConsent.text,consentType:defaultPrivacyConsent.consentType,default:!Qe});return}getPrivacyConsentData({session:me,type:"PRIVACY"}).then(({consents:Ze})=>{const nt=Ze.find(({consentType:tt})=>tt==="PRIVACY");nt!=null&&nt.text?Ke({...nt,title:(nt==null?void 0:nt.title.trim())||defaultPrivacyConsent.title,text:nt.text.trim()||defaultPrivacyConsent.text,default:!(nt!=null&&nt.text)}):Ke(defaultPrivacyConsent)}).catch(()=>{Ke(defaultPrivacyConsent)})},[me,ue,Qe]),Xe?jsxRuntimeExports.jsx(NormalPrivacyConsent,{consent:Xe,goNext:Ue,addPrivacyConsent:Je,session:me,isAeroMexicoClient:He}):null}function renderUserConsent(me,{session:ue,onSuccess:Qe,title:Ue,text:He,isAeroMexicoClient:Ge=!1}){const Xe=createRoot$1(me),Ke=handleUnmountRoot(Qe,Xe,me);customRender(jsxRuntimeExports.jsx(App$1,{token:ue.token,children:jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Ke,session:ue,title:Ue,text:He,isAeroMexicoClient:Ge})}),me,Xe)}const version$1="1.75.2";function r$1(me){for(var ue="",Qe=0;Qe<me.length;++Qe)if(Qe>0){var Ue=me[Qe].toLowerCase();Ue!==me[Qe]?ue+=" ".concat(Ue):ue+=me[Qe]}else ue+=me[Qe].toUpperCase();return ue}function o(me,ue){return function(Qe,Ue){return Object.prototype.hasOwnProperty.call(Qe,Ue)}(me,ue)?me[ue]:void 0}var i$1={default:"endpoint"},u={default:"tlsEndpoint"},a="Client timeout",R="Network connection error",c="Network request aborted",s="Response cannot be parsed",E="Blocked by CSP",f="The endpoint parameter is not a valid URL",d=r$1("WrongRegion"),l=r$1("SubscriptionNotActive"),_=r$1("UnsupportedVersion"),p=r$1("InstallationMethodRestricted"),v=r$1("HostnameRestricted"),O=r$1("IntegrationFailed"),I="API key required",h="API key not found",N="API key expired",T="Request cannot be parsed",m="Request failed",w="Request failed to process",A="Too many requests, rate limit exceeded",P="Not available for this origin",y="Not available with restricted header",D=I,S=h,L=N,U="3.8.6",b="9319";function g(me,ue){var Qe=[];return function(Ue,He){var Ge=5,Xe=(tt=Ue,et=__spreadArray$1([],tt,!0),{current:function(){return et[0]},postpone:function(){var it=et.shift();it!==void 0&&et.push(it)},exclude:function(){et.shift()}}),Ke=(Je=100,Ze=3e3,nt=0,function(){return Math.random()*Math.min(Ze,Je*Math.pow(2,nt++))}),$e=Xe.current(),Je,Ze,nt,tt,et;if($e===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var rt=function(it,ot){return He(it).catch(function(at){if(ot+1>=Ge)throw at;(function(lt){if(!(lt instanceof Error))return!1;var dt=lt.message;return dt===E||dt===b})(at)?Xe.exclude():Xe.postpone();var st,ut=Xe.current();if(ut===void 0)throw at;return(st=Ke(),new Promise(function(lt){return setTimeout(lt,st)})).then(function(){return rt(ut,ot+1)})})};return rt($e,0)}(me,function(Ue){var He=new Date,Ge=function(Ke){return Qe.push({url:Ue,startedAt:He,finishedAt:new Date,error:Ke})},Xe=ue(Ue);return Xe.then(function(){return Ge()},Ge),Xe}).then(function(Ue){return[Ue,Qe]})}var C="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",K=C,M="Failed to load the JS script of the agent";function B(me){var ue;me.scriptUrlPattern;var Qe=me.token,Ue=me.apiKey,He=Ue===void 0?Qe:Ue,Ge=__rest$3(me,["scriptUrlPattern","token","apiKey"]),Xe=(ue=o(me,"scriptUrlPattern"))!==null&&ue!==void 0?ue:C,Ke=function(){var Ze=[],nt=function(){Ze.push({time:new Date,state:document.visibilityState})},tt=function(et,rt,it,ot){return et.addEventListener(rt,it,ot),function(){return et.removeEventListener(rt,it,ot)}}(document,"visibilitychange",nt);return nt(),[Ze,tt]}(),$e=Ke[0],Je=Ke[1];return Promise.resolve().then(function(){if(!He||typeof He!="string")throw new Error(I);var Ze=function(nt,tt){return(Array.isArray(nt)?nt:[nt]).map(function(et){return function(rt,it){var ot=encodeURIComponent;return rt.replace(/<[^<>]+>/g,function(at){return at==="<version>"?"3":at==="<apiKey>"?ot(it):at==="<loaderVersion>"?ot(U):at})}(String(et),tt)})}(Xe,He);return g(Ze,F)}).catch(function(Ze){throw Je(),function(nt){return nt instanceof Error&&nt.message===b?new Error(M):nt}(Ze)}).then(function(Ze){var nt=Ze[0],tt=Ze[1];return Je(),nt.load(__assign$2(__assign$2({},Ge),{ldi:{attempts:tt,visibilityStates:$e}}))})}function F(me){return function(ue,Qe,Ue,He){var Ge,Xe=document,Ke="securitypolicyviolation",$e=function(Ze){var nt=new URL(ue,location.href),tt=Ze.blockedURI;tt!==nt.href&&tt!==nt.protocol.slice(0,-1)&&tt!==nt.origin||(Ge=Ze,Je())};Xe.addEventListener(Ke,$e);var Je=function(){return Xe.removeEventListener(Ke,$e)};return Promise.resolve().then(Qe).then(function(Ze){return Je(),Ze},function(Ze){return new Promise(function(nt){return setTimeout(nt)}).then(function(){if(Je(),Ge)return Ue(Ge);throw Ze})})}(me,function(){return function(ue){return new Promise(function(Qe,Ue){var He=document.createElement("script"),Ge=function(){var Ke;return(Ke=He.parentNode)===null||Ke===void 0?void 0:Ke.removeChild(He)},Xe=document.head||document.getElementsByTagName("head")[0];He.onload=function(){Ge(),Qe()},He.onerror=function(){Ge(),Ue(new Error(M))},He.async=!0,He.src=ue,Xe.appendChild(He)})}(me)},function(){throw new Error(E)}).then(V)}function V(){var me=window,ue="__fpjs_p_l_b",Qe=me[ue];if(function(Ue,He){var Ge,Xe=(Ge=Object.getOwnPropertyDescriptor)===null||Ge===void 0?void 0:Ge.call(Object,Ue,He);Xe!=null&&Xe.configurable?delete Ue[He]:Xe&&!Xe.writable||(Ue[He]=void 0)}(me,ue),typeof(Qe==null?void 0:Qe.load)!="function")throw new Error(b);return Qe}var k={load:B,defaultScriptUrlPattern:K,ERROR_SCRIPT_LOAD_FAIL:M,ERROR_API_KEY_EXPIRED:N,ERROR_API_KEY_INVALID:h,ERROR_API_KEY_MISSING:I,ERROR_BAD_REQUEST_FORMAT:T,ERROR_BAD_RESPONSE_FORMAT:s,ERROR_CLIENT_TIMEOUT:a,ERROR_CSP_BLOCK:E,ERROR_FORBIDDEN_ENDPOINT:v,ERROR_FORBIDDEN_HEADER:y,ERROR_FORBIDDEN_ORIGIN:P,ERROR_GENERAL_SERVER_FAILURE:m,ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_INTEGRATION_FAILURE:O,ERROR_INVALID_ENDPOINT:f,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:R,ERROR_RATE_LIMIT:A,ERROR_SERVER_TIMEOUT:w,ERROR_SUBSCRIPTION_NOT_ACTIVE:l,ERROR_TOKEN_EXPIRED:L,ERROR_TOKEN_INVALID:S,ERROR_TOKEN_MISSING:D,ERROR_UNSUPPORTED_VERSION:_,ERROR_WRONG_REGION:d,defaultEndpoint:i$1,defaultTlsEndpoint:u};let fingerprintApiKey;function setFingerprintApiKey(me){fingerprintApiKey=me}async function getFingerPrint(){return k.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(me=>me.get({extendedResult:!0}))}const fingerPrintUrl="/omni/add/device-fingerprint";function postFingerprint({hash:me,ip:ue,deviceType:Qe,token:Ue,data:He,osVersion:Ge,deviceModel:Xe,browser:Ke,sdkVersion:$e,hasLiedBrowser:Je,hostingApp:Ze,ipLocation:nt}){return exports.api.post(fingerPrintUrl,{hash:me,ip:ue,deviceType:Qe,data:He,osVersion:Ge,deviceModel:Xe,browser:Ke,hasLiedBrowser:Je,sdkVersion:$e,hostingApp:Ze,ipLocation:nt},{headers:{"X-Incode-Hardware-Id":Ue}}).then(tt=>tt.data).catch(tt=>Promise.reject(tt.response.data))}function formatDeviceModel({vendor:me,model:ue}){return`${me||""} ${ue||""}`.trim()}const emptyFingerprint={visitorId:void 0,ip:void 0,ipLocation:{country:{name:void 0},subdivisions:[],city:{name:void 0},latitude:void 0,longitude:void 0}};async function sendFingerprint({token:me},ue=!0,Qe=!0){var $e,Je,Ze;const Ue="WEBAPP",{os:He,device:Ge,browser:Xe}=getUAParserResults(),Ke=Qe?await getFingerPrint().catch(nt=>(addEvent({code:"fingerprintFetchFailed",payload:{message:nt.message},token:me}),emptyFingerprint)):emptyFingerprint;return postFingerprint({hash:Ke.visitorId||"",ip:ue&&Ke.ip||"",deviceType:Ue,token:me,data:JSON.stringify(Ke),osVersion:`${He.name} ${He.version}`,deviceModel:formatDeviceModel(Ge),browser:`${Xe.name} ${Xe.version}`,hasLiedBrowser:isBrowserSimulation(),hostingApp:options.hostingApp,sdkVersion:version$1,ipLocation:{ipCountry:($e=Ke.ipLocation.country)==null?void 0:$e.name,ipRegion:(Je=Ke.ipLocation.subdivisions)==null?void 0:Je[0].name,ipCity:(Ze=Ke.ipLocation.city)==null?void 0:Ze.name,ipLatitude:Ke.ipLocation.latitude,ipLongitude:Ke.ipLocation.longitude}}).then(nt=>(emptyDeviceStatsQueue(me),nt))}function mapI18nLang(me){const ue={en:"en-US",es:"es-ES",pt:"pt-BR"},Qe=me==null?void 0:me.substring(0,2);return ue[Qe]||"en-US"}const createSessionUrl="/omni/start";async function createNewSession({externalId:me,externalCustomerId:ue,configurationId:Qe,uuid:Ue,interviewId:He,customFields:Ge,language:Xe}={}){const Ke=Xe||mapI18nLang(i18nInstance.language);try{const $e=await exports.api.post(createSessionUrl,{externalId:me,externalCustomerId:ue,configurationId:Qe,uuid:Ue,interviewId:He,customFields:Ge,language:Ke});state.token=$e.data;const Je=$e.data;emptyQueue(Je.token);const Ze=await sendFingerprint({token:Je.token,interviewId:Je.interviewId}).catch(()=>({regulationType:"",showMandatoryConsent:!1}));Je.regulationType=Ze.regulationType??"",Je.showMandatoryConsent=Ze.showMandatoryConsent??!1;const tt=new UAParser().getResult();return addEvent({code:"browser",payload:{userAgent:window.navigator.userAgent,isWebRtcSupported:isWebRtcSupported(),...tt},token:Je.token}),Je}catch($e){throw $e!=null&&$e.response?$e.response.data:$e}}const createRedirectUrl=async({session:me})=>{const{url:ue}=await exports.api.get("/omni/onboarding-url",{params:{clientId:me.clientId},headers:{"X-Incode-Hardware-Id":me.token}}).then(Qe=>Qe.data);return ue};async function createSession$3(me,ue,{externalCustomerId:Qe,configurationId:Ue,uuid:He,interviewId:Ge,customFields:Xe,language:Ke}={}){return createNewSession({externalId:ue,externalCustomerId:Qe,configurationId:Ue,uuid:He,interviewId:Ge,customFields:Xe,language:Ke})}var isHTMLElement=me=>me instanceof HTMLElement;const EVENTS={BLUR:"blur",CHANGE:"change",INPUT:"input"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},SELECT="select",UNDEFINED="undefined",INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};function attachEventListeners({ref:me},ue,Qe){isHTMLElement(me)&&Qe&&(me.addEventListener(ue?EVENTS.CHANGE:EVENTS.INPUT,Qe),me.addEventListener(EVENTS.BLUR,Qe))}var isNullOrUndefined=me=>me==null;const isObjectType=me=>typeof me=="object";var isObject$4=me=>!isNullOrUndefined(me)&&!Array.isArray(me)&&isObjectType(me)&&!(me instanceof Date),isKey=me=>/^\w*$/.test(me),compact=me=>me.filter(Boolean),stringToPath=me=>compact(me.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function set(me,ue,Qe){let Ue=-1;const He=isKey(ue)?[ue]:stringToPath(ue),Ge=He.length,Xe=Ge-1;for(;++Ue<Ge;){const Ke=He[Ue];let $e=Qe;if(Ue!==Xe){const Je=me[Ke];$e=isObject$4(Je)||Array.isArray(Je)?Je:isNaN(+He[Ue+1])?{}:[]}me[Ke]=$e,me=me[Ke]}return me}var transformToNestObject=(me,ue={})=>{for(const Qe in me)isKey(Qe)?ue[Qe]=me[Qe]:set(ue,Qe,me[Qe]);return ue},isUndefined$1=me=>me===void 0,get=(me={},ue,Qe)=>{const Ue=compact(ue.split(/[,[\].]+?/)).reduce((He,Ge)=>isNullOrUndefined(He)?He:He[Ge],me);return isUndefined$1(Ue)||Ue===me?isUndefined$1(me[ue])?Qe:me[ue]:Ue},focusOnErrorField=(me,ue)=>{for(const Qe in me)if(get(ue,Qe)){const Ue=me[Qe];if(Ue){if(Ue.ref.focus&&isUndefined$1(Ue.ref.focus()))break;if(Ue.options){Ue.options[0].ref.focus();break}}}},removeAllEventListeners=(me,ue)=>{isHTMLElement(me)&&me.removeEventListener&&(me.removeEventListener(EVENTS.INPUT,ue),me.removeEventListener(EVENTS.CHANGE,ue),me.removeEventListener(EVENTS.BLUR,ue))};const defaultReturn={isValid:!1,value:null};var getRadioValue=me=>Array.isArray(me)?me.reduce((ue,Qe)=>Qe&&Qe.ref.checked?{isValid:!0,value:Qe.ref.value}:ue,defaultReturn):defaultReturn,getMultipleSelectValue=me=>[...me].filter(({selected:ue})=>ue).map(({value:ue})=>ue),isRadioInput=me=>me.type==="radio",isFileInput=me=>me.type==="file",isCheckBoxInput=me=>me.type==="checkbox",isMultipleSelect=me=>me.type===`${SELECT}-multiple`;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=me=>{if(Array.isArray(me)){if(me.length>1){const He=me.filter(Ge=>Ge&&Ge.ref.checked).map(({ref:{value:Ge}})=>Ge);return{value:He,isValid:!!He.length}}const{checked:ue,value:Qe,attributes:Ue}=me[0].ref;return ue?Ue&&!isUndefined$1(Ue.value)?isUndefined$1(Qe)||Qe===""?validResult:{value:Qe,isValid:!0}:validResult:defaultResult}return defaultResult};function getFieldValue(me,ue,Qe,Ue,He){const Ge=me.current[ue];if(Ge){const{ref:{value:Xe,disabled:Ke},ref:$e,valueAsNumber:Je,valueAsDate:Ze,setValueAs:nt}=Ge;return Ke&&Ue?void 0:isFileInput($e)?$e.files:isRadioInput($e)?getRadioValue(Ge.options).value:isMultipleSelect($e)?getMultipleSelectValue($e.options):isCheckBoxInput($e)?getCheckboxValue(Ge.options).value:He?Xe:Je?Xe===""?NaN:+Xe:Ze?$e.valueAsDate:nt?nt(Xe):Xe}if(Qe)return get(Qe.current,ue)}function isDetached(me){return me?!(me instanceof HTMLElement)||me.nodeType===Node.DOCUMENT_NODE?!1:isDetached(me.parentNode):!0}var isEmptyObject=me=>isObject$4(me)&&!Object.keys(me).length,isBoolean=me=>typeof me=="boolean";function baseGet(me,ue){const Qe=ue.slice(0,-1).length;let Ue=0;for(;Ue<Qe;)me=isUndefined$1(me)?Ue++:me[ue[Ue++]];return me}function unset(me,ue){const Qe=isKey(ue)?[ue]:stringToPath(ue),Ue=Qe.length==1?me:baseGet(me,Qe),He=Qe[Qe.length-1];let Ge;Ue&&delete Ue[He];for(let Xe=0;Xe<Qe.slice(0,-1).length;Xe++){let Ke=-1,$e;const Je=Qe.slice(0,-(Xe+1)),Ze=Je.length-1;for(Xe>0&&(Ge=me);++Ke<Je.length;){const nt=Je[Ke];$e=$e?$e[nt]:me[nt],Ze===Ke&&(isObject$4($e)&&isEmptyObject($e)||Array.isArray($e)&&!$e.filter(tt=>isObject$4(tt)&&!isEmptyObject(tt)||isBoolean(tt)).length)&&(Ge?delete Ge[nt]:delete me[nt]),Ge=$e}}return me}const isSameRef=(me,ue)=>me&&me.ref===ue;function findRemovedFieldAndRemoveListener(me,ue,Qe,Ue,He,Ge){const{ref:Xe,ref:{name:Ke}}=Qe,$e=me.current[Ke];if(!He){const Je=getFieldValue(me,Ke,Ue);!isUndefined$1(Je)&&set(Ue.current,Ke,Je)}if(!Xe.type||!$e){delete me.current[Ke];return}isRadioInput(Xe)||isCheckBoxInput(Xe)?Array.isArray($e.options)&&$e.options.length?(compact($e.options).forEach((Je={},Ze)=>{(isDetached(Je.ref)&&isSameRef(Je,Je.ref)||Ge)&&(removeAllEventListeners(Je.ref,ue),unset($e.options,`[${Ze}]`))}),$e.options&&!compact($e.options).length&&delete me.current[Ke]):delete me.current[Ke]:(isDetached(Xe)&&isSameRef($e,Xe)||Ge)&&(removeAllEventListeners(Xe,ue),delete me.current[Ke])}var isPrimitive=me=>isNullOrUndefined(me)||!isObjectType(me);function deepMerge(me,ue){if(isPrimitive(me)||isPrimitive(ue))return ue;for(const Qe in ue){const Ue=me[Qe],He=ue[Qe];try{me[Qe]=isObject$4(Ue)&&isObject$4(He)||Array.isArray(Ue)&&Array.isArray(He)?deepMerge(Ue,He):He}catch{}}return me}function deepEqual(me,ue,Qe){if(isPrimitive(me)||isPrimitive(ue)||me instanceof Date||ue instanceof Date)return me===ue;if(!React.isValidElement(me)){const Ue=Object.keys(me),He=Object.keys(ue);if(Ue.length!==He.length)return!1;for(const Ge of Ue){const Xe=me[Ge];if(!(Qe&&Ge==="ref")){const Ke=ue[Ge];if((isObject$4(Xe)||Array.isArray(Xe))&&(isObject$4(Ke)||Array.isArray(Ke))?!deepEqual(Xe,Ke,Qe):Xe!==Ke)return!1}}}return!0}function setDirtyFields(me,ue,Qe,Ue,He){let Ge=-1;for(;++Ge<me.length;){for(const Xe in me[Ge])Array.isArray(me[Ge][Xe])?(!Qe[Ge]&&(Qe[Ge]={}),Qe[Ge][Xe]=[],setDirtyFields(me[Ge][Xe],get(ue[Ge]||{},Xe,[]),Qe[Ge][Xe],Qe[Ge],Xe)):deepEqual(get(ue[Ge]||{},Xe),me[Ge][Xe])?set(Qe[Ge]||{},Xe):Qe[Ge]=Object.assign(Object.assign({},Qe[Ge]),{[Xe]:!0});Ue&&!Qe.length&&delete Ue[He]}return Qe}var setFieldArrayDirtyFields=(me,ue,Qe)=>deepMerge(setDirtyFields(me,ue,Qe.slice(0,me.length)),setDirtyFields(ue,me,Qe.slice(0,me.length))),isString$2=me=>typeof me=="string",getFieldsValues=(me,ue,Qe,Ue,He)=>{const Ge={};for(const Xe in me.current)(isUndefined$1(He)||(isString$2(He)?Xe.startsWith(He):Array.isArray(He)&&He.find(Ke=>Xe.startsWith(Ke))))&&(Ge[Xe]=getFieldValue(me,Xe,void 0,Ue));return Qe?transformToNestObject(Ge):deepMerge(ue,transformToNestObject(Ge))},isErrorStateChanged=({errors:me,name:ue,error:Qe,validFields:Ue,fieldsWithValidation:He})=>{const Ge=isUndefined$1(Qe),Xe=get(me,ue);return Ge&&!!Xe||!Ge&&!deepEqual(Xe,Qe,!0)||Ge&&get(He,ue)&&!get(Ue,ue)},isRegex=me=>me instanceof RegExp,getValueAndMessage=me=>isObject$4(me)&&!isRegex(me)?me:{value:me,message:""},isFunction$1=me=>typeof me=="function",isMessage=me=>isString$2(me)||React.isValidElement(me);function getValidateError(me,ue,Qe="validate"){if(isMessage(me)||isBoolean(me)&&!me)return{type:Qe,message:isMessage(me)?me:"",ref:ue}}var appendErrors=(me,ue,Qe,Ue,He)=>ue?Object.assign(Object.assign({},Qe[me]),{types:Object.assign(Object.assign({},Qe[me]&&Qe[me].types?Qe[me].types:{}),{[Ue]:He||!0})}):{},validateField=async(me,ue,{ref:Qe,ref:{value:Ue},options:He,required:Ge,maxLength:Xe,minLength:Ke,min:$e,max:Je,pattern:Ze,validate:nt},tt)=>{const et=Qe.name,rt={},it=isRadioInput(Qe),ot=isCheckBoxInput(Qe),at=it||ot,st=Ue==="",ut=appendErrors.bind(null,et,ue,rt),lt=(dt,At,pt,gt=INPUT_VALIDATION_RULES.maxLength,wt=INPUT_VALIDATION_RULES.minLength)=>{const Bt=dt?At:pt;rt[et]=Object.assign({type:dt?gt:wt,message:Bt,ref:Qe},ut(dt?gt:wt,Bt))};if(Ge&&(!it&&!ot&&(st||isNullOrUndefined(Ue))||isBoolean(Ue)&&!Ue||ot&&!getCheckboxValue(He).isValid||it&&!getRadioValue(He).isValid)){const{value:dt,message:At}=isMessage(Ge)?{value:!!Ge,message:Ge}:getValueAndMessage(Ge);if(dt&&(rt[et]=Object.assign({type:INPUT_VALIDATION_RULES.required,message:At,ref:at?((me.current[et].options||[])[0]||{}).ref:Qe},ut(INPUT_VALIDATION_RULES.required,At)),!ue))return rt}if((!isNullOrUndefined($e)||!isNullOrUndefined(Je))&&Ue!==""){let dt,At;const pt=getValueAndMessage(Je),gt=getValueAndMessage($e);if(isNaN(Ue)){const wt=Qe.valueAsDate||new Date(Ue);isString$2(pt.value)&&(dt=wt>new Date(pt.value)),isString$2(gt.value)&&(At=wt<new Date(gt.value))}else{const wt=Qe.valueAsNumber||parseFloat(Ue);isNullOrUndefined(pt.value)||(dt=wt>pt.value),isNullOrUndefined(gt.value)||(At=wt<gt.value)}if((dt||At)&&(lt(!!dt,pt.message,gt.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!ue))return rt}if(isString$2(Ue)&&!st&&(Xe||Ke)){const dt=getValueAndMessage(Xe),At=getValueAndMessage(Ke),pt=!isNullOrUndefined(dt.value)&&Ue.length>dt.value,gt=!isNullOrUndefined(At.value)&&Ue.length<At.value;if((pt||gt)&&(lt(pt,dt.message,At.message),!ue))return rt}if(isString$2(Ue)&&Ze&&!st){const{value:dt,message:At}=getValueAndMessage(Ze);if(isRegex(dt)&&!dt.test(Ue)&&(rt[et]=Object.assign({type:INPUT_VALIDATION_RULES.pattern,message:At,ref:Qe},ut(INPUT_VALIDATION_RULES.pattern,At)),!ue))return rt}if(nt){const dt=getFieldValue(me,et,tt,!1,!0),At=at&&He?He[0].ref:Qe;if(isFunction$1(nt)){const pt=await nt(dt),gt=getValidateError(pt,At);if(gt&&(rt[et]=Object.assign(Object.assign({},gt),ut(INPUT_VALIDATION_RULES.validate,gt.message)),!ue))return rt}else if(isObject$4(nt)){let pt={};for(const[gt,wt]of Object.entries(nt)){if(!isEmptyObject(pt)&&!ue)break;const Bt=await wt(dt),Tt=getValidateError(Bt,At,gt);Tt&&(pt=Object.assign(Object.assign({},Tt),ut(gt,Tt.message)),ue&&(rt[et]=pt))}if(!isEmptyObject(pt)&&(rt[et]=Object.assign({ref:At},pt),!ue))return rt}}return rt};const getPath=(me,ue,Qe=[])=>{for(const Ue in ue){const He=me+(isObject$4(ue)?`.${Ue}`:`[${Ue}]`);isPrimitive(ue[Ue])?Qe.push(He):getPath(He,ue[Ue],Qe)}return Qe};var assignWatchFields=(me,ue,Qe,Ue,He)=>{let Ge;return Qe.add(ue),isEmptyObject(me)||(Ge=get(me,ue),(isObject$4(Ge)||Array.isArray(Ge))&&getPath(ue,Ge).forEach(Xe=>Qe.add(Xe))),isUndefined$1(Ge)?He?Ue:get(Ue,ue):Ge},skipValidation=({isOnBlur:me,isOnChange:ue,isOnTouch:Qe,isTouched:Ue,isReValidateOnBlur:He,isReValidateOnChange:Ge,isBlurEvent:Xe,isSubmitted:Ke,isOnAll:$e})=>$e?!1:!Ke&&Qe?!(Ue||Xe):(Ke?He:me)?!Xe:(Ke?Ge:ue)?Xe:!0,getFieldArrayParentName=me=>me.substring(0,me.indexOf("["));const isMatchFieldArrayName=(me,ue)=>RegExp(`^${ue}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(me);var isNameInFieldArray=(me,ue)=>[...me].some(Qe=>isMatchFieldArrayName(ue,Qe)),isSelectInput=me=>me.type===`${SELECT}-one`;function onDomRemove(me,ue){const Qe=new MutationObserver(()=>{for(const Ue of Object.values(me.current))if(Ue&&Ue.options)for(const He of Ue.options)He&&He.ref&&isDetached(He.ref)&&ue(Ue);else Ue&&isDetached(Ue.ref)&&ue(Ue)});return Qe.observe(window.document,{childList:!0,subtree:!0}),Qe}var isWeb=typeof window!==UNDEFINED&&typeof document!==UNDEFINED;function cloneObject(me){var ue;let Qe;if(isPrimitive(me)||isWeb&&(me instanceof File||isHTMLElement(me))||!["Set","Map","Object","Date","Array"].includes((ue=me.constructor)===null||ue===void 0?void 0:ue.name))return me;if(me instanceof Date)return Qe=new Date(me.getTime()),Qe;if(me instanceof Set){Qe=new Set;for(const Ue of me)Qe.add(Ue);return Qe}if(me instanceof Map){Qe=new Map;for(const Ue of me.keys())Qe.set(Ue,cloneObject(me.get(Ue)));return Qe}Qe=Array.isArray(me)?[]:{};for(const Ue in me)Qe[Ue]=cloneObject(me[Ue]);return Qe}var modeChecker=me=>({isOnSubmit:!me||me===VALIDATION_MODE.onSubmit,isOnBlur:me===VALIDATION_MODE.onBlur,isOnChange:me===VALIDATION_MODE.onChange,isOnAll:me===VALIDATION_MODE.all,isOnTouch:me===VALIDATION_MODE.onTouched}),isRadioOrCheckboxFunction=me=>isRadioInput(me)||isCheckBoxInput(me);const isWindowUndefined=typeof window===UNDEFINED,isProxyEnabled=isWeb?"Proxy"in window:typeof Proxy!==UNDEFINED;function useForm({mode:me=VALIDATION_MODE.onSubmit,reValidateMode:ue=VALIDATION_MODE.onChange,resolver:Qe,context:Ue,defaultValues:He={},shouldFocusError:Ge=!0,shouldUnregister:Xe=!0,criteriaMode:Ke}={}){const $e=React.useRef({}),Je=React.useRef({}),Ze=React.useRef({}),nt=React.useRef(new Set),tt=React.useRef({}),et=React.useRef({}),rt=React.useRef({}),it=React.useRef({}),ot=React.useRef(He),at=React.useRef(!1),st=React.useRef(!1),ut=React.useRef(),lt=React.useRef({}),dt=React.useRef({}),At=React.useRef(Ue),pt=React.useRef(Qe),gt=React.useRef(new Set),wt=React.useRef(modeChecker(me)),{isOnSubmit:Bt,isOnTouch:Tt}=wt.current,yt=Ke===VALIDATION_MODE.all,[Ct,ht]=React.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!Bt,errors:{}}),It=React.useRef({isDirty:!isProxyEnabled,dirtyFields:!isProxyEnabled,touched:!isProxyEnabled||Tt,isValidating:!isProxyEnabled,isSubmitting:!isProxyEnabled,isValid:!isProxyEnabled}),vt=React.useRef(Ct),Et=React.useRef(),{isOnBlur:bt,isOnChange:Rt}=React.useRef(modeChecker(ue)).current;At.current=Ue,pt.current=Qe,vt.current=Ct,lt.current=Xe?{}:isEmptyObject(lt.current)?cloneObject(He):lt.current;const St=React.useCallback((rn={})=>{at.current||(vt.current=Object.assign(Object.assign({},vt.current),rn),ht(vt.current))},[]),kt=()=>It.current.isValidating&&St({isValidating:!0}),jt=React.useCallback((rn,ln,pn=!1,Sn={},In)=>{let Bn=pn||isErrorStateChanged({errors:vt.current.errors,error:ln,name:rn,validFields:it.current,fieldsWithValidation:rt.current});const kn=get(vt.current.errors,rn);ln?(unset(it.current,rn),Bn=Bn||!kn||!deepEqual(kn,ln,!0),set(vt.current.errors,rn,ln)):((get(rt.current,rn)||pt.current)&&(set(it.current,rn,!0),Bn=Bn||kn),unset(vt.current.errors,rn)),(Bn&&!isNullOrUndefined(pn)||!isEmptyObject(Sn)||It.current.isValidating)&&St(Object.assign(Object.assign(Object.assign({},Sn),pt.current?{isValid:!!In}:{}),{isValidating:!1}))},[]),Pt=React.useCallback((rn,ln)=>{const{ref:pn,options:Sn}=$e.current[rn],In=isWeb&&isHTMLElement(pn)&&isNullOrUndefined(ln)?"":ln;isRadioInput(pn)?(Sn||[]).forEach(({ref:Bn})=>Bn.checked=Bn.value===In):isFileInput(pn)&&!isString$2(In)?pn.files=In:isMultipleSelect(pn)?[...pn.options].forEach(Bn=>Bn.selected=In.includes(Bn.value)):isCheckBoxInput(pn)&&Sn?Sn.length>1?Sn.forEach(({ref:Bn})=>Bn.checked=Array.isArray(In)?!!In.find(kn=>kn===Bn.value):In===Bn.value):Sn[0].ref.checked=!!In:pn.value=In},[]),Qt=React.useCallback((rn,ln)=>{if(It.current.isDirty){const pn=Ft();return rn&&ln&&set(pn,rn,ln),!deepEqual(pn,ot.current)}return!1},[]),qt=React.useCallback((rn,ln=!0)=>{if(It.current.isDirty||It.current.dirtyFields){const pn=!deepEqual(get(ot.current,rn),getFieldValue($e,rn,lt)),Sn=get(vt.current.dirtyFields,rn),In=vt.current.isDirty;pn?set(vt.current.dirtyFields,rn,!0):unset(vt.current.dirtyFields,rn);const Bn={isDirty:Qt(),dirtyFields:vt.current.dirtyFields},kn=It.current.isDirty&&In!==Bn.isDirty||It.current.dirtyFields&&Sn!==get(vt.current.dirtyFields,rn);return kn&&ln&&St(Bn),kn?Bn:{}}return{}},[]),_t=React.useCallback(async(rn,ln)=>{if(process.env.NODE_ENV!=="production"&&!$e.current[rn])return console.warn("📋 Field is missing with `name` attribute: ",rn),!1;const pn=(await validateField($e,yt,$e.current[rn],lt))[rn];return jt(rn,pn,ln),isUndefined$1(pn)},[jt,yt]),Yt=React.useCallback(async rn=>{const{errors:ln}=await pt.current(Ft(),At.current,yt),pn=vt.current.isValid;if(Array.isArray(rn)){const Sn=rn.map(In=>{const Bn=get(ln,In);return Bn?set(vt.current.errors,In,Bn):unset(vt.current.errors,In),!Bn}).every(Boolean);return St({isValid:isEmptyObject(ln),isValidating:!1}),Sn}else{const Sn=get(ln,rn);return jt(rn,Sn,pn!==isEmptyObject(ln),{},isEmptyObject(ln)),!Sn}},[jt,yt]),Xt=React.useCallback(async rn=>{const ln=rn||Object.keys($e.current);if(kt(),pt.current)return Yt(ln);if(Array.isArray(ln)){!rn&&(vt.current.errors={});const pn=await Promise.all(ln.map(async Sn=>await _t(Sn,null)));return St({isValidating:!1}),pn.every(Boolean)}return await _t(ln)},[Yt,_t]),Ut=React.useCallback((rn,ln,{shouldDirty:pn,shouldValidate:Sn})=>{const In={};set(In,rn,ln);for(const Bn of getPath(rn,ln))$e.current[Bn]&&(Pt(Bn,get(In,Bn)),pn&&qt(Bn),Sn&&Xt(Bn))},[Xt,Pt,qt]),Lt=React.useCallback((rn,ln,pn)=>{if(!Xe&&!isPrimitive(ln)&&set(lt.current,rn,Array.isArray(ln)?[...ln]:Object.assign({},ln)),$e.current[rn])Pt(rn,ln),pn.shouldDirty&&qt(rn),pn.shouldValidate&&Xt(rn);else if(!isPrimitive(ln)&&(Ut(rn,ln,pn),gt.current.has(rn))){const Sn=getFieldArrayParentName(rn)||rn;set(Je.current,rn,ln),dt.current[Sn]({[Sn]:get(Je.current,Sn)}),(It.current.isDirty||It.current.dirtyFields)&&pn.shouldDirty&&(set(vt.current.dirtyFields,rn,setFieldArrayDirtyFields(ln,get(ot.current,rn,[]),get(vt.current.dirtyFields,rn,[]))),St({isDirty:!deepEqual(Object.assign(Object.assign({},Ft()),{[rn]:ln}),ot.current)}))}!Xe&&set(lt.current,rn,ln)},[qt,Pt,Ut]),Ot=rn=>st.current||nt.current.has(rn)||nt.current.has((rn.match(/\w+/)||[])[0]),ft=rn=>{let ln=!0;if(!isEmptyObject(tt.current))for(const pn in tt.current)(!rn||!tt.current[pn].size||tt.current[pn].has(rn)||tt.current[pn].has(getFieldArrayParentName(rn)))&&(et.current[pn](),ln=!1);return ln};function Dt(rn,ln,pn){Lt(rn,ln,pn||{}),Ot(rn)&&St(),ft(rn)}ut.current=ut.current?ut.current:async({type:rn,target:ln})=>{let pn=ln.name;const Sn=$e.current[pn];let In,Bn;if(Sn){const kn=rn===EVENTS.BLUR,Yn=skipValidation(Object.assign({isBlurEvent:kn,isReValidateOnChange:Rt,isReValidateOnBlur:bt,isTouched:!!get(vt.current.touched,pn),isSubmitted:vt.current.isSubmitted},wt.current));let sr=qt(pn,!1),Cr=!isEmptyObject(sr)||!kn&&Ot(pn);if(kn&&!get(vt.current.touched,pn)&&It.current.touched&&(set(vt.current.touched,pn,!0),sr=Object.assign(Object.assign({},sr),{touched:vt.current.touched})),!Xe&&isCheckBoxInput(ln)&&set(lt.current,pn,getFieldValue($e,pn)),Yn)return!kn&&ft(pn),(!isEmptyObject(sr)||Cr&&isEmptyObject(sr))&&St(sr);if(kt(),pt.current){const{errors:hr}=await pt.current(Ft(),At.current,yt),jr=vt.current.isValid;if(In=get(hr,pn),isCheckBoxInput(ln)&&!In&&pt.current){const li=getFieldArrayParentName(pn),Un=get(hr,li,{});Un.type&&Un.message&&(In=Un),li&&(Un||get(vt.current.errors,li))&&(pn=li)}Bn=isEmptyObject(hr),jr!==Bn&&(Cr=!0)}else In=(await validateField($e,yt,Sn,lt))[pn];!kn&&ft(pn),jt(pn,In,Cr,sr,Bn)}};function Mt(rn){if(!Xe){let ln=cloneObject(rn);for(const pn of gt.current)isKey(pn)&&!ln[pn]&&(ln=Object.assign(Object.assign({},ln),{[pn]:[]}));return ln}return rn}function Ft(rn){if(isString$2(rn))return getFieldValue($e,rn,lt);if(Array.isArray(rn)){const ln={};for(const pn of rn)set(ln,pn,getFieldValue($e,pn,lt));return ln}return Mt(getFieldsValues($e,cloneObject(lt.current),Xe))}const Gt=React.useCallback(async(rn={})=>{const ln=isEmptyObject($e.current)?ot.current:{},{errors:pn}=await pt.current(Object.assign(Object.assign(Object.assign({},ln),Ft()),rn),At.current,yt)||{},Sn=isEmptyObject(pn);vt.current.isValid!==Sn&&St({isValid:Sn})},[yt]),zt=React.useCallback((rn,ln)=>{findRemovedFieldAndRemoveListener($e,ut.current,rn,lt,Xe,ln),Xe&&(unset(it.current,rn.ref.name),unset(rt.current,rn.ref.name))},[Xe]),$t=React.useCallback(rn=>{if(st.current)St();else{for(const ln of nt.current)if(ln.startsWith(rn)){St();break}ft(rn)}},[]),Ht=React.useCallback((rn,ln)=>{rn&&(zt(rn,ln),Xe&&!compact(rn.options||[]).length&&(unset(vt.current.errors,rn.ref.name),set(vt.current.dirtyFields,rn.ref.name,!0),St({isDirty:Qt()}),It.current.isValid&&pt.current&&Gt(),$t(rn.ref.name)))},[Gt,zt]);function hn(rn){rn&&(Array.isArray(rn)?rn:[rn]).forEach(ln=>$e.current[ln]&&isKey(ln)?delete vt.current.errors[ln]:unset(vt.current.errors,ln)),St({errors:rn?vt.current.errors:{}})}function un(rn,ln){const pn=($e.current[rn]||{}).ref;set(vt.current.errors,rn,Object.assign(Object.assign({},ln),{ref:pn})),St({isValid:!1}),ln.shouldFocus&&pn&&pn.focus&&pn.focus()}const An=React.useCallback((rn,ln,pn)=>{const Sn=pn?tt.current[pn]:nt.current;let In=getFieldsValues($e,cloneObject(lt.current),Xe,!1,rn);if(isString$2(rn)){const kn=getFieldArrayParentName(rn)||rn;return gt.current.has(kn)&&(In=Object.assign(Object.assign({},Ze.current),In)),assignWatchFields(In,rn,Sn,isUndefined$1(get(ot.current,rn))?ln:get(ot.current,rn),!0)}const Bn=isUndefined$1(ln)?ot.current:ln;return Array.isArray(rn)?rn.reduce((kn,Yn)=>Object.assign(Object.assign({},kn),{[Yn]:assignWatchFields(In,Yn,Sn,Bn)}),{}):(st.current=isUndefined$1(pn),transformToNestObject(!isEmptyObject(In)&&In||Bn))},[]);function mn(rn,ln){return An(rn,ln)}function En(rn){for(const ln of Array.isArray(rn)?rn:[rn])Ht($e.current[ln],!0)}function Jt(rn,ln={}){if(process.env.NODE_ENV!=="production"){if(!rn.name)return console.warn("📋 Field is missing `name` attribute",rn,"https://react-hook-form.com/api#useForm");if(gt.current.has(rn.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${rn.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(rn.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',rn,"https://react-hook-form.com/api#useFieldArray")}const{name:pn,type:Sn,value:In}=rn,Bn=Object.assign({ref:rn},ln),kn=$e.current,Yn=isRadioOrCheckboxFunction(rn),sr=isNameInFieldArray(gt.current,pn),Cr=qn=>isWeb&&(!isHTMLElement(rn)||qn===rn);let hr=kn[pn],jr=!0,li;if(hr&&(Yn?Array.isArray(hr.options)&&compact(hr.options).find(qn=>In===qn.ref.value&&Cr(qn.ref)):Cr(hr.ref))){kn[pn]=Object.assign(Object.assign({},hr),ln);return}Sn?hr=Yn?Object.assign({options:[...compact(hr&&hr.options||[]),{ref:rn}],ref:{type:Sn,name:pn}},ln):Object.assign({},Bn):hr=Bn,kn[pn]=hr;const Un=isUndefined$1(get(lt.current,pn));(!isEmptyObject(ot.current)||!Un)&&(li=get(Un?ot.current:lt.current,pn),jr=isUndefined$1(li),!jr&&!sr&&Pt(pn,li)),isEmptyObject(ln)||(set(rt.current,pn,!0),!Bt&&It.current.isValid&&validateField($e,yt,hr,lt).then(qn=>{const pr=vt.current.isValid;isEmptyObject(qn)?set(it.current,pn,!0):unset(it.current,pn),pr!==isEmptyObject(qn)&&St()})),Xe&&!(sr&&jr)&&!sr&&unset(vt.current.dirtyFields,pn),Sn&&attachEventListeners(Yn&&hr.options?hr.options[hr.options.length-1]:hr,Yn||isSelectInput(rn),ut.current)}function an(rn,ln){if(!isWindowUndefined)if(isString$2(rn))Jt({name:rn},ln);else if(isObject$4(rn)&&"name"in rn)Jt(rn,ln);else return pn=>pn&&Jt(pn,rn)}const cn=React.useCallback((rn,ln)=>async pn=>{pn&&pn.preventDefault&&(pn.preventDefault(),pn.persist());let Sn={},In=Mt(getFieldsValues($e,cloneObject(lt.current),Xe,!0));It.current.isSubmitting&&St({isSubmitting:!0});try{if(pt.current){const{errors:Bn,values:kn}=await pt.current(In,At.current,yt);vt.current.errors=Sn=Bn,In=kn}else for(const Bn of Object.values($e.current))if(Bn){const{name:kn}=Bn.ref,Yn=await validateField($e,yt,Bn,lt);Yn[kn]?(set(Sn,kn,Yn[kn]),unset(it.current,kn)):get(rt.current,kn)&&(unset(vt.current.errors,kn),set(it.current,kn,!0))}isEmptyObject(Sn)&&Object.keys(vt.current.errors).every(Bn=>Bn in $e.current)?(St({errors:{},isSubmitting:!0}),await rn(In,pn)):(vt.current.errors=Object.assign(Object.assign({},vt.current.errors),Sn),ln&&await ln(vt.current.errors,pn),Ge&&focusOnErrorField($e.current,vt.current.errors))}finally{vt.current.isSubmitting=!1,St({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(vt.current.errors),submitCount:vt.current.submitCount+1})}},[Ge,yt]),dn=({errors:rn,isDirty:ln,isSubmitted:pn,touched:Sn,isValid:In,submitCount:Bn,dirtyFields:kn})=>{In||(it.current={},rt.current={}),Je.current={},nt.current=new Set,st.current=!1,St({submitCount:Bn?vt.current.submitCount:0,isDirty:ln?vt.current.isDirty:!1,isSubmitted:pn?vt.current.isSubmitted:!1,isValid:In?vt.current.isValid:!1,dirtyFields:kn?vt.current.dirtyFields:{},touched:Sn?vt.current.touched:{},errors:rn?vt.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},yn=(rn,ln={})=>{if(isWeb){for(const pn of Object.values($e.current))if(pn){const{ref:Sn,options:In}=pn,Bn=isRadioOrCheckboxFunction(Sn)&&Array.isArray(In)?In[0].ref:Sn;if(isHTMLElement(Bn))try{Bn.closest("form").reset();break}catch{}}}$e.current={},ot.current=Object.assign({},rn||ot.current),rn&&ft(""),Object.values(dt.current).forEach(pn=>isFunction$1(pn)&&pn()),lt.current=Xe?{}:cloneObject(rn||ot.current),dn(ln)};React.useEffect(()=>{Qe&&It.current.isValid&&Gt(),Et.current=Et.current||!isWeb?Et.current:onDomRemove($e,Ht)},[Ht,ot.current]),React.useEffect(()=>()=>{Et.current&&Et.current.disconnect(),at.current=!0,process.env.NODE_ENV==="production"&&Object.values($e.current).forEach(rn=>Ht(rn,!0))},[]),!Qe&&It.current.isValid&&(Ct.isValid=deepEqual(it.current,rt.current)&&isEmptyObject(vt.current.errors));const Nn={trigger:Xt,setValue:React.useCallback(Dt,[Lt,Xt]),getValues:React.useCallback(Ft,[]),register:React.useCallback(an,[ot.current]),unregister:React.useCallback(En,[]),formState:isProxyEnabled?new Proxy(Ct,{get:(rn,ln)=>{if(process.env.NODE_ENV!=="production"&&ln==="isValid"&&Bt&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),ln in rn)return It.current[ln]=!0,rn[ln]}}):Ct},Rn=React.useMemo(()=>Object.assign({isFormDirty:Qt,updateWatchedValue:$t,shouldUnregister:Xe,updateFormState:St,removeFieldEventListener:zt,watchInternal:An,mode:wt.current,reValidateMode:{isReValidateOnBlur:bt,isReValidateOnChange:Rt},validateResolver:Qe?Gt:void 0,fieldsRef:$e,resetFieldArrayFunctionRef:dt,useWatchFieldsRef:tt,useWatchRenderFunctionsRef:et,fieldArrayDefaultValuesRef:Je,validFieldsRef:it,fieldsWithValidationRef:rt,fieldArrayNamesRef:gt,readFormStateRef:It,formStateRef:vt,defaultValuesRef:ot,shallowFieldsStateRef:lt,fieldArrayValuesRef:Ze},Nn),[ot.current,$t,Xe,zt,An]);return Object.assign({watch:mn,control:Rn,handleSubmit:cn,reset:React.useCallback(yn,[]),clearErrors:React.useCallback(hn,[]),setError:React.useCallback(un,[]),errors:Ct.errors},Nn)}/*! *****************************************************************************
|
|
2686
2686
|
Copyright (c) Microsoft Corporation.
|
|
2687
2687
|
|
|
2688
2688
|
Permission to use, copy, modify, and/or distribute this software for any
|