1import{j as l,h as Bt,d as en,B as Ee,dW as tn,dX as hr,e as we,s as rn,r as H,bS as nn,ce as et,d8 as gr,b3 as on,dY as sn,dZ as _r,F as Ht,dl as an,aL as gt,a4 as ln,L as Kt,d_ as cn,d$ as un,a_ as mr,ab as yr,bj as dn,e0 as pn,cd as vr,e1 as Sr,e2 as fn,dC as hn}from"./index-CmAj2QZM.js";import{C as gn,B as _n,R as mn}from"./RoutineBudgetQuestion-oPGbneri.js";const er={under_5:4,under_5_hours:4,less_than_5_hours:4,menos_de_5_horas:4,"5_6":5.5,"5-6":5.5,"5-6_hours":5.5,"5_to_6_hours":5.5,"5_a_6_horas":5.5,"7_8":7.5,"7-8":7.5,"7-8_hours":7.5,"7_to_8_hours":7.5,"7_a_8_horas":7.5,"9_plus":9,more_than_8_hours:9,"9_or_more_hours":9,"9_ou_mais_horas":9},yn={under_3:"under_3",under_3_glasses:"under_3",menos_de_3_copos:"under_3",low:"under_3","3_5":"3_5","3-5":"3_5","3_to_5_glasses":"3_5","3_a_5_copos":"3_5",moderate:"3_5","6_8":"6_8","6-8":"6_8","6_to_8_glasses":"6_8","6_a_8_copos":"6_8","8_plus":"8_plus","8_or_more":"8_plus","8_or_more_glasses":"8_plus","8_ou_mais":"8_plus",high:"8_plus"},vn={low:"low",baixo:"low",moderate:"moderate",moderado:"moderate",high:"high",alto:"high"},xn={minimal:"minimal",baixa:"minimal",low:"minimal",moderate:"moderate",moderada:"moderate",frequent:"frequent",frequente:"frequent",high:"frequent"},bn={never:"never",nunca:"never",sometimes:"sometimes",as_vezes:"sometimes",daily:"daily",diariamente:"daily",reapply:"reapply",daily_and_reapply:"reapply",diariamente_e_reaplico:"reapply"};function Fr(s){return String(s||"").trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[ââ]/g,"-").replace(/\s+/g,"_")}function It(s,o){return s==null||s===""?"":o[Fr(s)]||""}function Lr(s){if(s==null||s==="")return null;if(typeof s=="number")return Number.isFinite(s)?s:null;const o=Fr(s);if(o in er)return er[o];const g=Number(String(s).trim().replace(",","."));return Number.isFinite(g)?g:null}function xr(s){return er[s]??null}function Ut(s={}){const o=It(s.sun_exposure_level??s.sun_exposure,xn);return{...s,water_cups:It(s.water_cups,yn),sleep_hours:Lr(s.sleep_hours),stress_level:It(s.stress_level,vn),sun_exposure_level:o,sun_exposure:o,sunscreen_frequency:It(s.sunscreen_frequency,bn)}}function br({language:s="en",isAuthenticated:o=!1,onCreateAccount:g,onLogin:_,onContinue:j}){const p=s==="pt"?{eyebrow:"Análise gratuita GlowBox AI",title:"Comece sua análise gratuita.",body:"Você responderá algumas perguntas rápidas e enviará uma foto.",create:"Create account to continue",login:"I already have an account",continue:"Continue"}:{eyebrow:"GlowBox AI free analysis",title:"Start your free analysis.",body:"Answer a few quick questions and upload one photo.",create:"Create account to continue",login:"I already have an account",continue:"Continue"};return l.jsx("div",{className:"min-h-screen bg-[linear-gradient(180deg,#fff_0%,#fff8fb_45%,#fff_100%)] px-4 py-10 pb-28 md:py-14",children:l.jsx("div",{className:"mx-auto max-w-3xl",children:l.jsx(Bt,{className:"overflow-hidden border-[#E91E63]/10 bg-white shadow-[0_24px_80px_rgba(17,17,17,0.08)]",children:l.jsxs("div",{className:"p-6 md:p-10 text-center",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-[#FFF0F6] px-4 py-2 text-sm font-semibold text-[#E91E63]",children:[l.jsx(en,{className:"h-4 w-4"})," ",p.eyebrow]}),l.jsx("h1",{className:"mt-5 text-3xl font-semibold leading-tight text-[#111111] md:text-5xl",children:p.title}),l.jsx("p",{className:"mt-4 text-sm leading-7 text-[#2D2D2D]/70 md:text-base",children:p.body}),l.jsx("div",{className:"mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center",children:o?l.jsx(Ee,{onClick:j,className:"rounded-xl bg-[#E91E63] px-6 text-white hover:bg-[#d81b60]",children:p.continue}):l.jsxs(l.Fragment,{children:[l.jsx(Ee,{onClick:g,className:"rounded-xl bg-[#E91E63] px-6 text-white hover:bg-[#d81b60]",children:p.create}),l.jsxs(Ee,{variant:"outline",onClick:_,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111] hover:bg-[#FFF8FB]",children:[l.jsx(tn,{className:"mr-2 h-4 w-4"}),p.login]})]})})]})})})})}var Qt={},wr;function wn(){return wr||(wr=1,(function(){var s;function o(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var g=typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};function _(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof hr=="object"&&hr];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}var j=_(this);function p(e,t){if(t)e:{var r=j;e=e.split(".");for(var n=0;n<e.length-1;n++){var a=e[n];if(!(a in r))break e;r=r[a]}e=e[e.length-1],n=r[e],t=t(n),t!=n&&t!=null&&g(r,e,{configurable:!0,writable:!0,value:t})}}p("Symbol",function(e){function t(u){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new r(n+(u||"")+"_"+a++,u)}function r(u,c){this.g=u,g(this,"description",{configurable:!0,writable:!0,value:c})}if(e)return e;r.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",a=0;return t}),p("Symbol.iterator",function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),r=0;r<t.length;r++){var n=j[t[r]];typeof n=="function"&&typeof n.prototype[e]!="function"&&g(n.prototype,e,{configurable:!0,writable:!0,value:function(){return U(o(this))}})}return e});function U(e){return e={next:e},e[Symbol.iterator]=function(){return this},e}function b(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:o(e)}}function F(e){if(!(e instanceof Array)){e=b(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}var k=typeof Object.create=="function"?Object.create:function(e){function t(){}return t.prototype=e,new t},Q;
vendor: 37,699 bytes, lines 1-18
1if(typeof Object.setPrototypeOf=="function")Q=Object.setPrototypeOf;else{var y;e:{var L={a:!0},ee={};try{ee.__proto__=L,y=ee.a;break e}catch{}y=!1}Q=y?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var se=Q;function re(e,t){if(e.prototype=k(t.prototype),e.prototype.constructor=e,se)se(e,t);else for(var r in t)if(r!="prototype")if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r];e.ea=t.prototype}function ue(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function fe(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}ue.prototype.o=function(e){this.h=e};function ae(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}ue.prototype.return=function(e){this.j={return:e},this.g=this.s};function J(e,t,r){return e.g=r,{value:t}}function G(e){this.g=new ue,this.h=e}function ne(e,t){fe(e.g);var r=e.g.i;return r?ke(e,"return"in r?r.return:function(n){return{value:n,done:!0}},t,e.g.return):(e.g.return(t),Z(e))}function ke(e,t,r,n){try{var a=t.call(e.g.i,r);if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");if(!a.done)return e.g.l=!1,a;var u=a.value}catch(c){return e.g.i=null,ae(e.g,c),Z(e)}return e.g.i=null,n.call(e.g,u),Z(e)}function Z(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(r){e.g.h=void 0,ae(e.g,r)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function he(e){this.next=function(t){return fe(e.g),e.g.i?t=ke(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=Z(e)),t},this.throw=function(t){return fe(e.g),e.g.i?t=ke(e,e.g.i.throw,t,e.g.o):(ae(e.g,t),t=Z(e)),t},this.return=function(t){return ne(e,t)},this[Symbol.iterator]=function(){return this}}function C(e,t){return t=new he(new G(t)),se&&e.prototype&&se(t,e.prototype),t}function Be(e,t){e instanceof String&&(e+="");var r=0,n=!1,a={next:function(){if(!n&&r<e.length){var u=r++;return{value:t(u,e[u]),done:!1}}return n=!0,{done:!0,value:void 0}}};return a[Symbol.iterator]=function(){return a},a}var nt=typeof Object.assign=="function"?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};p("Object.assign",function(e){return e||nt}),p("Promise",function(e){function t(c){this.h=0,this.i=void 0,this.g=[],this.o=!1;var d=this.j();try{c(d.resolve,d.reject)}catch(f){d.reject(f)}}function r(){this.g=null}function n(c){return c instanceof t?c:new t(function(d){d(c)})}if(e)return e;r.prototype.h=function(c){if(this.g==null){this.g=[];var d=this;this.i(function(){d.l()})}this.g.push(c)};var a=j.setTimeout;r.prototype.i=function(c){a(c,0)},r.prototype.l=function(){for(;this.g&&this.g.length;){var c=this.g;this.g=[];for(var d=0;d<c.length;++d){var f=c[d];c[d]=null;try{f()}catch(v){this.j(v)}}}this.g=null},r.prototype.j=function(c){this.i(function(){throw c})},t.prototype.j=function(){function c(v){return function(N){f||(f=!0,v.call(d,N))}}var d=this,f=!1;return{resolve:c(this.C),reject:c(this.l)}},t.prototype.C=function(c){if(c===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(c instanceof t)this.F(c);else{e:switch(typeof c){case"object":var d=c!=null;break e;case"function":d=!0;break e;default:d=!1}d?this.u(c):this.m(c)}},t.prototype.u=function(c){var d=void 0;try{d=c.then}catch(f){this.l(f);return}typeof d=="function"?this.G(d,c):this.m(c)},t.prototype.l=function(c){this.s(2,c)},t.prototype.m=function(c){this.s(1,c)},t.prototype.s=function(c,d){if(this.h!=0)throw Error("Cannot settle("+c+", "+d+"): Promise already settled in state"+this.h);this.h=c,this.i=d,this.h===2&&this.D(),this.A()},t.prototype.D=function(){var c=this;a(function(){if(c.B()){var d=j.console;typeof d<"u"&&d.error(c.i)}},1)},t.prototype.B=function(){if(this.o)return!1;var c=j.CustomEvent,d=j.Event,f=j.dispatchEvent;return typeof f>"u"?!0:(typeof c=="function"?c=new c("unhandledrejection",{cancelable:!0}):typeof d=="function"?c=new d("unhandledrejection",{cancelable:!0}):(c=j.document.createEvent("CustomEvent"),c.initCustomEvent("unhandledrejection",!1,!0,c)),c.promise=this,c.reason=this.i,f(c))},t.prototype.A=function(){if(this.g!=null){for(var c=0;c<this.g.length;++c)u.h(this.g[c]);this.g=null}};var u=new r;return t.prototype.F=function(c){var d=this.j();c.J(d.resolve,d.reject)},t.prototype.G=function(c,d){var f=this.j();try{c.call(d,f.resolve,f.reject)}catch(v){f.reject(v)}},t.prototype.then=function(c,d){function f(B,S){return typeof B=="function"?function(w){try{v(B(w))}catch(E){N(E)}}:S}var v,N,K=new t(function(B,S){v=B,N=S});return this.J(f(c,v),f(d,N)),K},t.prototype.catch=function(c){return this.then(void 0,c)},t.prototype.J=function(c,d){function f(){switch(v.h){case 1:c(v.i);break;case 2:d(v.i);break;default:throw Error("Unexpected state: "+v.h)}}var v=this;this.g==null?u.h(f):this.g.push(f),this.o=!0},t.resolve=n,t.reject=function(c){return new t(function(d,f){f(c)})},t.race=function(c){return new t(function(d,f){for(var v=b(c),N=v.next();!N.done;N=v.next())n(N.value).J(d,f)})},t.all=function(c){var d=b(c),f=d.next();return f.done?n([]):new t(function(v,N){function K(w){return function(E){B[w]=E,S--,S==0&&v(B)}}var B=[],S=0;do B.push(void 0),S++,n(f.value).J(K(B.length-1),N),f=d.next();while(!f.done)})},t}),p("Object.is",function(e){return e||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}}),p("Array.prototype.includes",function(e){return e||function(t,r){var n=this;n instanceof String&&(n=String(n));var a=n.length;for(r=r||0,0>r&&(r=Math.max(r+a,0));r<a;r++){var u=n[r];if(u===t||Object.is(u,t))return!0}return!1}}),p("String.prototype.includes",function(e){return e||function(t,r){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(t,r||0)!==-1}}),p("Array.prototype.keys",function(e){return e||function(){return Be(this,function(t){return t})}});var Ve=this||self;function q(e,t){e=e.split(".");var r=Ve;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)e.length||t===void 0?r[n]&&r[n]!==Object.prototype[n]?r=r[n]:r=r[n]={}:r[n]=t}function Pe(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var ye,mt=typeof TextDecoder<"u",it,ot=typeof TextEncoder<"u";function st(e){if(ot)e=(it||(it=new TextEncoder)).encode(e);else{var t=void 0;t=t===void 0?!1:t;for(var r=0,n=new Uint8Array(3*e.length),a=0;a<e.length;a++){var u=e.charCodeAt(a);if(128>u)n[r++]=u;else{if(2048>u)n[r++]=u>>6|192;else{if(55296<=u&&57343>=u){if(56319>=u&&a<e.length){var c=e.charCodeAt(++a);if(56320<=c&&57343>=c){u=1024*(u-55296)+c-56320+65536,n[r++]=u>>18|240,n[r++]=u>>12&63|128,n[r++]=u>>6&63|128,n[r++]=u&63|128;continue}else a--}if(t)throw Error("Found an unpaired surrogate");u=65533}n[r++]=u>>12|224,n[r++]=u>>6&63|128}n[r++]=u&63|128}}e=n.subarray(0,r)}return e}var Et={},Ie=null;function At(e,t){t===void 0&&(t=0),Qe(),t=Et[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",a=0,u=0;a<e.length-2;a+=3){var c=e[a],d=e[a+1],f=e[a+2],v=t[c>>2];c=t[(c&3)<<4|d>>4],d=t[(d&15)<<2|f>>6],f=t[f&63],r[u++]=v+c+d+f}switch(v=0,f=n,e.length-a){case 2:v=e[a+1],f=t[(v&15)<<2]||n;case 1:e=e[a],r[u]=t[e>>2]+t[(e&3)<<4|v>>4]+f+n}return r.join("")}function St(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);var n=new Uint8Array(r),a=0;return Ft(e,function(u){n[a++]=u}),n.subarray(0,a)}function Ft(e,t){function r(f){for(;n<e.length;){var v=e.charAt(n++),N=Ie[v];if(N!=null)return N;if(!/^[\s\xa0]*$/.test(v))throw Error("Unknown base64 encoding at char: "+v)}return f}Qe();for(var n=0;;){var a=r(-1),u=r(0),c=r(64),d=r(64);if(d===64&&a===-1)break;t(a<<2|u>>4),c!=64&&(t(u<<4&240|c>>2),d!=64&&t(c<<6&192|d))}}function Qe(){if(!Ie){Ie={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));Et[r]=n;for(var a=0;a<n.length;a++){var u=n[a];Ie[u]===void 0&&(Ie[u]=a)}}}}var Dt=typeof Uint8Array.prototype.slice=="function",Ge;function A(e,t,r){return t===r?Ge||(Ge=new Uint8Array(0)):Dt?e.slice(t,r):new Uint8Array(e.subarray(t,r))}var Ae=0,ze=0;function Se(e,t){t=t===void 0?{}:t,t=t.v===void 0?!1:t.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=t,e&&yt(this,e)}function yt(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer?new Uint8Array(t):t.constructor===Array?new Uint8Array(t):t.constructor===String?St(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.l=0,e.j=e.h.length,e.g=e.l}Se.prototype.reset=function(){this.g=this.l};function at(e){for(var t=128,r=0,n=0,a=0;4>a&&128<=t;a++)t=e.h[e.g++],r|=(t&127)<<7*a;if(128<=t&&(t=e.h[e.g++],r|=(t&127)<<28,n|=(t&127)>>4),128<=t)for(a=0;5>a&&128<=t;a++)t=e.h[e.g++],n|=(t&127)<<7*a+3;if(128>t)return e=r>>>0,t=n>>>0,(n=t&2147483648)&&(e=~e+1>>>0,t=~t>>>0,e==0&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),n?-e:e;e.m=!0}Se.prototype.i=function(){var e=this.h,t=e[this.g],r=t&127;return 128>t?(this.g+=1,r):(t=e[this.g+1],r|=(t&127)<<7,128>t?(this.g+=2,r):(t=e[this.g+2],r|=(t&127)<<14,128>t?(this.g+=3,r):(t=e[this.g+3],r|=(t&127)<<21,128>t?(this.g+=4,r):(t=e[this.g+4],r|=(t&15)<<28,128>t?(this.g+=5,r>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,r)))))},Se.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],r=this.h[this.g+2],n=this.h[this.g+3];return this.g+=4,r=(e<<0|t<<8|r<<16|n<<24)>>>0,e=2*(r>>31)+1,t=r>>>23&255,r&=8388607,t==255?r?NaN:1/0*e:t==0?e*Math.pow(2,-149)*r:e*Math.pow(2,t-150)*(r+Math.pow(2,23))};var vt=[];function ge(){this.g=new Uint8Array(64),this.h=0}ge.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},ge.prototype.length=function(){return this.h},ge.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,A(e,0,t)};function De(e,t){for(;127<t;)e.push(t&127|128),t>>>=7;e.push(t)}function tt(e){var t={},r=t.N===void 0?!1:t.N;this.o={v:t.v===void 0?!1:t.v},this.N=r,t=this.o,vt.length?(r=vt.pop(),t&&(r.v=t.v),e&&yt(r,e),e=r):e=new Se(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}tt.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};function Oe(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=e.g,t=t.m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g,t=e.g.i();var r=t&7;return r!=0&&r!=5&&r!=1&&r!=2&&r!=3&&r!=4?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=r,!0)}function Xe(e){switch(e.h){case 0:if(e.h!=0)Xe(e);else{for(e=e.g;e.h[e.g]&128;)e.g++;e.g++}break;case 1:e.h!=1?Xe(e):(e=e.g,e.g+=8);break;case 2:if(e.h!=2)Xe(e);else{var t=e.g.i();e=e.g,e.g+=t}break;case 5:e.h!=5?Xe(e):(e=e.g,e.g+=4);break;case 3:t=e.l;do{if(!Oe(e)){e.j=!0;break}if(e.h==4){e.l!=t&&(e.j=!0);break}Xe(e)}while(!0);break;default:e.j=!0}}function lt(e,t,r){var n=e.g.j,a=e.g.i(),u=e.g.g+a;if(e.g.j=u,r(t,e),r=u-e.g.g,r!==0)throw Error("Message parsing ended unexpectedly. Expected to read "+a+" bytes, instead read "+(a-r)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=u,e.g.j=n,t}function ve(e){return e.g.o()}function Lt(e){var t=e.g.i();e=e.g;var r=e.g;e.g+=t,e=e.h;var n;if(mt)(n=ye)||(n=ye=new TextDecoder("utf-8",{fatal:!1})),n=n.decode(e.subarray(r,r+t));else{t=r+t;for(var a=[],u=null,c,d,f;r<t;)c=e[r++],128>c?a.push(c):224>c?r>=t?a.push(65533):(d=e[r++],194>c||(d&192)!==128?(r--,a.push(65533)):a.push((c&31)<<6|d&63)):240>c?r>=t-1?a.push(65533):(d=e[r++],(d&192)!==128||c===224&&160>d||c===237&&160<=d||((n=e[r++])&192)!==128?(r--,a.push(65533)):a.push((c&15)<<12|(d&63)<<6|n&63)):244>=c?r>=t-2?a.push(65533):(d=e[r++],(d&192)!==128||(c<<28)+(d-144)>>30!==0||((n=e[r++])&192)!==128||((f=e[r++])&192)!==128?(r--,a.push(65533)):(c=(c&7)<<18|(d&63)<<12|(n&63)<<6|f&63,c-=65536,a.push((c>>10&1023)+55296,(c&1023)+56320))):a.push(65533),8192<=a.length&&(u=Pe(u,a),a.length=0);n=Pe(u,a)}return n}function xt(e,t,r){var n=e.g.i();for(n=e.g.g+n;e.g.g<n;)r.push(t.call(e.g))}function bt(e,t){e.h==2?xt(e,Se.prototype.o,t):t.push(ve(e))}function wt(){this.h=[],this.i=0,this.g=new ge}function rt(e,t){t.length!==0&&(e.h.push(t),e.i+=t.length)}function ct(e){var t=e.i+e.g.length();if(t===0)return new Uint8Array(0);t=new Uint8Array(t);for(var r=e.h,n=r.length,a=0,u=0;u<n;u++){var c=r[u];c.length!==0&&(t.set(c,a),a+=c.length)}return r=e.g,n=r.h,n!==0&&(t.set(r.g.subarray(0,n),a),r.h=0),e.h=[t],t}function Fe(e,t,r){if(r!=null){De(e.g,8*t+5),e=e.g;var n=r;n=(r=0>n?1:0)?-n:n,n===0?0<1/n?Ae=ze=0:(ze=0,Ae=2147483648):isNaN(n)?(ze=0,Ae=2147483647):34028234663852886e22<n?(ze=0,Ae=(r<<31|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),ze=0,Ae=(r<<31|n)>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),n=Math.round(8388608*n),16777216<=n&&++t,ze=0,Ae=(r<<31|t+127<<23|n&8388607)>>>0),r=Ae,e.push(r>>>0&255),e.push(r>>>8&255),e.push(r>>>16&255),e.push(r>>>24&255)}}var i=typeof Uint8Array=="function";function h(e,t,r){if(e!=null)return typeof e=="object"?i&&e instanceof Uint8Array?r(e):je(e,t,r):t(e)}function je(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),a=0;a<e.length;a++)n[a]=h(e[a],t,r);return Array.isArray(e)&&e.W&&Ne(n),n}n={};for(a in e)n[a]=h(e[a],t,r);return n}function Le(e){return typeof e=="number"?isFinite(e)?e:String(e):e}var Je={W:{value:!0,configurable:!0}};function Ne(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,Je),e}var Te;function te(e,t,r){var n=Te;Te=null,e||(e=n),n=this.constructor.ca,e||(e=n?[n]:[]),this.j=n?0:-1,this.m=this.g=null,this.h=e;e:{if(n=this.h.length,e=n-1,n&&(n=this.h[e],!(n===null||typeof n!="object"||Array.isArray(n)||i&&n instanceof Uint8Array))){this.l=e-this.j,this.i=n;break e}t!==void 0&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE}if(r)for(t=0;t<r.length;t++)e=r[t],e<this.l?(e+=this.j,(n=this.h[e])?Ne(n):this.h[e]=ie):(Re(this),(n=this.i[e])?Ne(n):this.i[e]=ie)}var ie=Object.freeze(Ne([]));function Re(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function R(e,t,r){return t===-1?null:r!==void 0&&r||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function qe(e,t){var r=r===void 0?!1:r,n=R(e,t,r);return n==null&&(n=ie),n===ie&&(n=Ne([]),P(e,t,n,r)),n}function Ze(e){var t=qe(e,3);if(e.m||(e.m={}),!e.m[3]){for(var r=0;r<t.length;r++)t[r]=+t[r];e.m[3]=!0}return t}function oe(e,t,r){return e=R(e,t),e??r}function _e(e,t,r){return e=R(e,t),e=e==null?e:+e,e??(r===void 0?0:r)}function P(e,t,r,n){n!==void 0&&n||t>=e.l?(Re(e),e.i[t]=r):e.h[t+e.j]=r}function Me(e,t,r){if(r===-1)return null;if(e.g||(e.g={}),!e.g[r]){var n=R(e,r,!1);n&&(e.g[r]=new t(n))}return e.g[r]}function $e(e,t){e.g||(e.g={});var r=e.g[1];if(!r){var n=qe(e,1);r=[];for(var a=0;a<n.length;a++)r[a]=new t(n[a]);e.g[1]=r}return r}function xe(e,t,r){var n=n===void 0?!1:n;e.g||(e.g={});var a=r&&We(r);e.g[t]=r,P(e,t,a,n)}function kt(e,t,r,n){var a=$e(e,r);t=t||new r,e=qe(e,1),n!=null?(a.splice(n,0,t),e.splice(n,0,We(t))):(a.push(t),e.push(We(t)))}te.prototype.toJSON=function(){var e=We(this);return je(e,Le,At)};function We(e,t){if(e.g)for(var r in e.g){var n=e.g[r];if(Array.isArray(n))for(var a=0;a<n.length;a++)n[a]&&We(n[a]);else n&&We(n)}return e.h}te.prototype.toString=function(){return We(this).toString()};function ut(e,t){if(e=e.o){rt(t,t.g.end());for(var r=0;r<e.length;r++)rt(t,e[r])}}function Ue(e,t){if(t.h==4)return!1;var r=t.m;return Xe(t),t.N||(t=A(t.g.h,r,t.g.g),(r=e.o)?r.push(t):e.o=[t]),!0}function Ye(e){te.call(this,e,-1,Ct)}re(Ye,te),Ye.prototype.getRows=function(){return R(this,1)},Ye.prototype.getCols=function(){return R(this,2)},Ye.prototype.getPackedDataList=function(){return Ze(this)},Ye.prototype.getLayout=function(){return oe(this,4,0)};function Rt(e,t){for(;Oe(t);)switch(t.i){case 8:var r=t.g.i();P(e,1,r);break;case 16:r=t.g.i(),P(e,2,r);break;case 29:case 26:bt(t,e.getPackedDataList());break;case 32:r=at(t.g),P(e,4,r);break;default:if(!Ue(e,t))return e}return e}var Ct=[3];function me(e,t){var r=void 0;return new(r||(r=Promise))(function(n,a){function u(f){try{d(t.next(f))}catch(v){a(v)}}function c(f){try{d(t.throw(f))}catch(v){a(v)}}function d(f){f.done?n(f.value):new r(function(v){v(f.value)}).then(u,c)}d((t=t.apply(e,void 0)).next())})}function x(e){te.call(this,e)}re(x,te);function jt(e,t){for(;Oe(t);)switch(t.i){case 8:var r=t.g.i();P(e,1,r);break;case 21:r=ve(t),P(e,2,r);break;case 26:r=Lt(t),P(e,3,r);break;case 34:r=Lt(t),P(e,4,r);break;default:if(!Ue(e,t))return e}return e}function dt(e){te.call(this,e,-1,Pt)}re(dt,te),dt.prototype.addClassification=function(e,t){return kt(this,e,x,t),this};var Pt=[1];function m(e){te.call(this,e)}re(m,te);function Ot(e,t){for(;Oe(t);)switch(t.i){case 13:var r=ve(t);P(e,1,r);break;case 21:r=ve(t),P(e,2,r);break;case 29:r=ve(t),P(e,3,r);break;case 37:r=ve(t),P(e,4,r);break;case 45:r=ve(t),P(e,5,r);break;default:if(!Ue(e,t))return e}return e}function O(e){te.call(this,e,-1,Tt)}re(O,te);function pt(e){e:{var t=new O;for(e=new tt(e);Oe(e);)switch(e.i){case 10:var r=lt(e,new m,Ot);kt(t,r,m,void 0);break;default:if(!Ue(t,e))break e}}return t}var Tt=[1];function ft(e){te.call(this,e)}re(ft,te);function He(e){te.call(this,e,-1,Tr)}re(He,te),He.prototype.getVertexType=function(){return oe(this,1,0)},He.prototype.getPrimitiveType=function(){return oe(this,2,0)},He.prototype.getVertexBufferList=function(){return Ze(this)},He.prototype.getIndexBufferList=function(){return qe(this,4)};function qt(e,t){for(;Oe(t);)switch(t.i){case 8:var r=at(t.g);P(e,1,r);break;case 16:r=at(t.g),P(e,2,r);break;case 29:case 26:bt(t,e.getVertexBufferList());break;case 32:case 34:r=t;var n=e.getIndexBufferList();r.h==2?xt(r,Se.prototype.i,n):n.push(r.g.i());break;default:if(!Ue(e,t))return e}return e}var Tr=[3,4];function Mt(e){te.call(this,e)}re(Mt,te),Mt.prototype.getMesh=function(){return Me(this,He,1)},Mt.prototype.getPoseTransformMatrix=function(){return Me(this,Ye,2)};function qr(e){e:{var t=new Mt;for(e=new tt(e);Oe(e);)switch(e.i){case 10:var r=lt(e,new He,qt);xe(t,1,r);break;case 18:r=lt(e,new Ye,Rt),xe(t,2,r);break;default:if(!Ue(t,e))break e}}return t}function nr(e,t,r){if(r=e.createShader(r===0?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error(`Could not compile WebGL shader. 2 3`+e.getShaderInfoLog(r));return r}function Mr(e){return $e(e,x).map(function(t){return{index:oe(t,1,0),Y:_e(t,2),label:R(t,3)!=null?oe(t,3,""):void 0,displayName:R(t,4)!=null?oe(t,4,""):void 0}})}function ir(e){return{x:_e(e,1),y:_e(e,2),z:_e(e,3),visibility:R(e,4)!=null?_e(e,4):void 0}}function $t(e,t){this.h=e,this.g=t,this.l=0}function or(e,t,r){return Ir(e,t),typeof e.g.canvas.transferToImageBitmap=="function"?Promise.resolve(e.g.canvas.transferToImageBitmap()):r?Promise.resolve(e.g.canvas):typeof createImageBitmap=="function"?createImageBitmap(e.g.canvas):(e.i===void 0&&(e.i=document.createElement("canvas")),new Promise(function(n){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),n(e.i)}))}function Ir(e,t){var r=e.g;if(e.m===void 0){var n=nr(r,` 4 attribute vec2 aVertex; 5 attribute vec2 aTex; 6 varying vec2 vTex; 7 void main(void) { 8 gl_Position = vec4(aVertex, 0.0, 1.0); 9 vTex = aTex; 10 }`,0),a=nr(r,` 11 precision mediump float; 12 varying vec2 vTex; 13 uniform sampler2D sampler0; 14 void main(){ 15 gl_FragColor = texture2D(sampler0, vTex); 16 }`,1),u=r.createProgram();if(r.attachShader(u,n),r.attachShader(u,a),r.linkProgram(u),!r.getProgramParameter(u,r.LINK_STATUS))throw Error(`Could not compile WebGL program. 17 18`+r.getProgramInfoLog(u));n=e.m=u,r.useProgram(n),a=r.getUniformLocation(n,"sampler0"),e.j={I:r.getAttribLocation(n,"aVertex"),H:r.getAttribLocation(n,"aTex"),da:a},e.s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.enableVertexAttribArray(e.j.I),r.vertexAttribPointer(e.j.I,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),e.o=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.enableVertexAttribArray(e.j.H),r.vertexAttribPointer(e.j.H,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(a,0)}n=e.j,r.useProgram(e.m),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.h.bindTexture2d(t.glName),r.enableVertexAttribArray(n.I),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.vertexAttribPointer(n.I,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.vertexAttribPointer(n.H,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.I),r.disableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}function Ur(e){this.g=e}var Br=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Vr(e,t){return t+e}function sr(e,t){window[e]=t}function Gr(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise(function(r){t.addEventListener("load",function(){r()},!1),t.addEventListener("error",function(){r()},!1),document.body.appendChild(t)})}function zr(){return me(this,function e(){return C(e,function(t){switch(t.g){case 1:return t.m=2,J(t,WebAssembly.instantiate(Br),4);case 4:t.g=3,t.m=0;break;case 2:return t.m=0,t.j=null,t.return(!1);case 3:return t.return(!0)}})})}function Wt(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||Vr,typeof window=="object")var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.S=t,e.options){t=b(Object.keys(e.options));for(var r=t.next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;n!==void 0&&(this.j[r]=typeof n=="function"?n():n)}}}s=Wt.prototype,s.close=function(){return this.i&&this.i.delete(),Promise.resolve()};function Dr(e,t){return e.g.files===void 0?[]:typeof e.g.files=="function"?e.g.files(t):e.g.files}function $r(e){return me(e,function t(){var r=this,n,a,u,c,d,f,v,N,K,B,S;return C(t,function(w){switch(w.g){case 1:return n=r,r.R?(a=Dr(r,r.j),J(w,zr(),2)):w.return();case 2:if(u=w.h,typeof window=="object")return sr("createMediapipeSolutionsWasm",{locateFile:r.locateFile}),sr("createMediapipeSolutionsPackedAssets",{locateFile:r.locateFile}),f=a.filter(function(E){return E.data!==void 0}),v=a.filter(function(E){return E.data===void 0}),N=Promise.all(f.map(function(E){var M=Yt(n,E.url);if(E.path!==void 0){var z=E.path;M=M.then(function(de){return n.overrideFile(z,de),Promise.resolve(de)})}return M})),K=Promise.all(v.map(function(E){return E.simd===void 0||E.simd&&u||!E.simd&&!u?Gr(n.locateFile(E.url,n.S)):Promise.resolve()})).then(function(){return me(n,function E(){var M,z,de=this;return C(E,function(X){if(X.g==1)return M=window.createMediapipeSolutionsWasm,z=window.createMediapipeSolutionsPackedAssets,J(X,M(z),2);de.h=X.h,X.g=0})})}),B=(function(){return me(n,function E(){var M=this;return C(E,function(z){return M.g.graph&&M.g.graph.url?z=J(z,Yt(M,M.g.graph.url),0):(z.g=0,z=void 0),z})})})(),J(w,Promise.all([K,N,B]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return c=a.filter(function(E){return E.simd===void 0||E.simd&&u||!E.simd&&!u}).map(function(E){return n.locateFile(E.url,n.S)}),importScripts.apply(null,F(c)),J(w,createMediapipeSolutionsWasm(Module),6);case 6:r.h=w.h,r.l=new OffscreenCanvas(1,1),r.h.canvas=r.l,d=r.h.GL.createContext(r.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),r.h.GL.makeContextCurrent(d),w.g=4;break;case 7:if(r.l=document.createElement("canvas"),S=r.l.getContext("webgl2",{}),!S&&(S=r.l.getContext("webgl",{}),!S))return alert("Failed to create WebGL canvas context when passing video frame."),w.return();r.D=S,r.h.canvas=r.l,r.h.createContext(r.l,!0,!0,{});case 4:r.i=new r.h.SolutionWasm,r.R=!1,w.g=0}})})}function Wr(e){return me(e,function t(){var r=this,n,a,u,c,d,f,v,N;return C(t,function(K){if(K.g==1){if(r.g.graph&&r.g.graph.url&&r.P===r.g.graph.url)return K.return();if(r.o=!0,!r.g.graph||!r.g.graph.url){K.g=2;return}return r.P=r.g.graph.url,J(K,Yt(r,r.g.graph.url),3)}for(K.g!=2&&(n=K.h,r.i.loadGraph(n)),a=b(Object.keys(r.B)),u=a.next();!u.done;u=a.next())c=u.value,r.i.overrideFile(c,r.B[c]);if(r.B={},r.g.listeners)for(d=b(r.g.listeners),f=d.next();!f.done;f=d.next())v=f.value,Qr(r,v);N=r.j,r.j={},r.setOptions(N),K.g=0})})}s.reset=function(){return me(this,function e(){var t=this;return C(e,function(r){t.i&&(t.i.reset(),t.m={},t.s={}),r.g=0})})},s.setOptions=function(e,t){var r=this;if(t=t||this.g.options){for(var n=[],a=[],u={},c=b(Object.keys(e)),d=c.next();!d.done;u={K:u.K,L:u.L},d=c.next()){var f=d.value;f in this.j&&this.j[f]===e[f]||(this.j[f]=e[f],d=t[f],d!==void 0&&(d.onChange&&(u.K=d.onChange,u.L=e[f],n.push((function(v){return function(){return me(r,function N(){var K,B=this;return C(N,function(S){if(S.g==1)return J(S,v.K(v.L),2);K=S.h,K===!0&&(B.o=!0),S.g=0})})}})(u))),d.graphOptionXref&&(f={valueNumber:d.type===1?e[f]:0,valueBoolean:d.type===0?e[f]:!1,valueString:d.type===2?e[f]:""},d=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),d.graphOptionXref),f),a.push(d))))}(n.length!==0||a.length!==0)&&(this.o=!0,this.A=(this.A===void 0?[]:this.A).concat(a),this.u=(this.u===void 0?[]:this.u).concat(n))}};function Yr(e){return me(e,function t(){var r=this,n,a,u,c,d,f,v;return C(t,function(N){switch(N.g){case 1:if(!r.o)return N.return();if(!r.u){N.g=2;break}n=b(r.u),a=n.next();case 3:if(a.done){N.g=5;break}return u=a.value,J(N,u(),4);case 4:a=n.next(),N.g=3;break;case 5:r.u=void 0;case 2:if(r.A){for(c=new r.h.GraphOptionChangeRequestList,d=b(r.A),f=d.next();!f.done;f=d.next())v=f.value,c.push_back(v);r.i.changeOptions(c),c.delete(),r.A=void 0}r.o=!1,N.g=0}})})}s.initialize=function(){return me(this,function e(){var t=this;return C(e,function(r){return r.g==1?J(r,$r(t),2):r.g!=3?J(r,Wr(t),3):J(r,Yr(t),0)})})};function Yt(e,t){return me(e,function r(){var n=this,a,u;return C(r,function(c){return t in n.F?c.return(n.F[t]):(a=n.locateFile(t,""),u=fetch(a).then(function(d){return d.arrayBuffer()}),n.F[t]=u,c.return(u))})})}s.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},s.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},s.send=function(e,t){return me(this,function r(){var n=this,a,u,c,d,f,v,N,K,B;return C(r,function(S){switch(S.g){case 1:return n.g.inputs?(a=1e3*(t??performance.now()),J(S,n.C,2)):S.return();case 2:return J(S,n.initialize(),3);case 3:for(u=new n.h.PacketDataList,c=b(Object.keys(e)),d=c.next();!d.done;d=c.next())if(f=d.value,v=n.g.inputs[f]){e:{var w=n,E=e[f];switch(v.type){case"video":var M=w.m[v.stream];if(M||(M=new $t(w.h,w.D),w.m[v.stream]=M),w=M,w.l===0&&(w.l=w.h.createTexture()),typeof HTMLVideoElement<"u"&&E instanceof HTMLVideoElement){var z=E.videoWidth;M=E.videoHeight}else typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(z=E.naturalWidth,M=E.naturalHeight):(z=E.width,M=E.height);M={glName:w.l,width:z,height:M},z=w.g,z.canvas.width=M.width,z.canvas.height=M.height,z.activeTexture(z.TEXTURE0),w.h.bindTexture2d(w.l),z.texImage2D(z.TEXTURE_2D,0,z.RGBA,z.RGBA,z.UNSIGNED_BYTE,E),w.h.bindTexture2d(0),w=M;break e;case"detections":for(M=w.m[v.stream],M||(M=new Ur(w.h),w.m[v.stream]=M),w=M,w.data||(w.data=new w.g.DetectionListData),w.data.reset(E.length),M=0;M<E.length;++M){z=E[M];var de=w.data,X=de.setBoundingBox,be=M,le=z.T,T=new ft;P(T,1,le.Z),P(T,2,le.$),P(T,3,le.height),P(T,4,le.width),P(T,5,le.rotation),P(T,6,le.X);var D=le=new wt;Fe(D,1,R(T,1)),Fe(D,2,R(T,2)),Fe(D,3,R(T,3)),Fe(D,4,R(T,4)),Fe(D,5,R(T,5));var W=R(T,6);if(W!=null&&W!=null){De(D.g,48);var V=D.g,$=W;W=0>$,$=Math.abs($);var Y=$>>>0;for($=Math.floor(($-Y)/4294967296),$>>>=0,W&&($=~$>>>0,Y=(~Y>>>0)+1,4294967295<Y&&(Y=0,$++,4294967295<$&&($=0))),Ae=Y,ze=$,W=Ae,Y=ze;0<Y||127<W;)V.push(W&127|128),W=(W>>>7|Y<<25)>>>0,Y>>>=7;V.push(W)}if(ut(T,D),le=ct(le),X.call(de,be,le),z.O)for(de=0;de<z.O.length;++de)T=z.O[de],D=!!T.visibility,X=w.data,be=X.addNormalizedLandmark,le=M,T=Object.assign(Object.assign({},T),{visibility:D?T.visibility:0}),D=new m,P(D,1,T.x),P(D,2,T.y),P(D,3,T.z),T.visibility&&P(D,4,T.visibility),V=T=new wt,Fe(V,1,R(D,1)),Fe(V,2,R(D,2)),Fe(V,3,R(D,3)),Fe(V,4,R(D,4)),Fe(V,5,R(D,5)),ut(D,V),T=ct(T),be.call(X,le,T);if(z.M)for(de=0;de<z.M.length;++de){if(X=w.data,be=X.addClassification,le=M,T=z.M[de],D=new x,P(D,2,T.Y),T.index&&P(D,1,T.index),T.label&&P(D,3,T.label),T.displayName&&P(D,4,T.displayName),V=T=new wt,Y=R(D,1),Y!=null&&Y!=null)if(De(V.g,8),W=V.g,0<=Y)De(W,Y);else{for($=0;9>$;$++)W.push(Y&127|128),Y>>=7;W.push(1)}Fe(V,2,R(D,2)),W=R(D,3),W!=null&&(W=st(W),De(V.g,26),De(V.g,W.length),rt(V,V.g.end()),rt(V,W)),W=R(D,4),W!=null&&(W=st(W),De(V.g,34),De(V.g,W.length),rt(V,V.g.end()),rt(V,W)),ut(D,V),T=ct(T),be.call(X,le,T)}}w=w.data;break e;default:w={}}}switch(N=w,K=v.stream,v.type){case"video":u.pushTexture2d(Object.assign(Object.assign({},N),{stream:K,timestamp:a}));break;case"detections":B=N,B.stream=K,B.timestamp=a,u.pushDetectionList(B);break;default:throw Error("Unknown input config type: '"+v.type+"'")}}return n.i.send(u),J(S,n.C,4);case 4:u.delete(),S.g=0}})})};function Hr(e,t,r){return me(e,function n(){var a,u,c,d,f,v,N=this,K,B,S,w,E,M,z,de;return C(n,function(X){switch(X.g){case 1:if(!r)return X.return(t);for(a={},u=0,c=b(Object.keys(r)),d=c.next();!d.done;d=c.next())f=d.value,v=r[f],typeof v!="string"&&v.type==="texture"&&t[v.stream]!==void 0&&++u;1<u&&(N.G=!1),K=b(Object.keys(r)),d=K.next();case 2:if(d.done){X.g=4;break}if(B=d.value,S=r[B],typeof S=="string")return z=a,de=B,J(X,Kr(N,B,t[S]),14);if(w=t[S.stream],S.type==="detection_list"){if(w){for(var be=w.getRectList(),le=w.getLandmarksList(),T=w.getClassificationsList(),D=[],W=0;W<be.size();++W){var V=be.get(W);e:{var $=new ft;for(V=new tt(V);Oe(V);)switch(V.i){case 13:var Y=ve(V);P($,1,Y);break;case 21:Y=ve(V),P($,2,Y);break;case 29:Y=ve(V),P($,3,Y);break;case 37:Y=ve(V),P($,4,Y);break;case 45:Y=ve(V),P($,5,Y);break;case 48:Y=at(V.g),P($,6,Y);break;default:if(!Ue($,V))break e}}$={Z:_e($,1),$:_e($,2),height:_e($,3),width:_e($,4),rotation:_e($,5,0),X:oe($,6,0)},V=$e(pt(le.get(W)),m).map(ir);var ht=T.get(W);e:for(Y=new dt,ht=new tt(ht);Oe(ht);)switch(ht.i){case 10:Y.addClassification(lt(ht,new x,jt));break;default:if(!Ue(Y,ht))break e}$={T:$,O:V,M:Mr(Y)},D.push($)}be=D}else be=[];a[B]=be,X.g=7;break}if(S.type==="proto_list"){if(w){for(be=Array(w.size()),le=0;le<w.size();le++)be[le]=w.get(le);w.delete()}else be=[];a[B]=be,X.g=7;break}if(w===void 0){X.g=3;break}if(S.type==="float_list"){a[B]=w,X.g=7;break}if(S.type==="proto"){a[B]=w,X.g=7;break}if(S.type!=="texture")throw Error("Unknown output config type: '"+S.type+"'");return E=N.s[B],E||(E=new $t(N.h,N.D),N.s[B]=E),J(X,or(E,w,N.G),13);case 13:M=X.h,a[B]=M;case 7:S.transform&&a[B]&&(a[B]=S.transform(a[B])),X.g=3;break;case 14:z[de]=X.h;case 3:d=K.next(),X.g=2;break;case 4:return X.return(a)}})})}function Kr(e,t,r){return me(e,function n(){var a=this,u;return C(n,function(c){return typeof r=="number"||r instanceof Uint8Array||r instanceof a.h.Uint8BlobList?c.return(r):r instanceof a.h.Texture2dDataOut?(u=a.s[t],u||(u=new $t(a.h,a.D),a.s[t]=u),c.return(or(u,r,a.G))):c.return(void 0)})})}function Qr(e,t){for(var r=t.name||"$",n=[].concat(F(t.wants)),a=new e.h.StringList,u=b(t.wants),c=u.next();!c.done;c=u.next())a.push_back(c.value);u=e.h.PacketListener.implement({onResults:function(d){for(var f={},v=0;v<t.wants.length;++v)f[n[v]]=d.get(v);var N=e.listeners[r];N&&(e.C=Hr(e,f,t.outs).then(function(K){K=N(K);for(var B=0;B<t.wants.length;++B){var S=f[n[B]];typeof S=="object"&&S.hasOwnProperty&&S.hasOwnProperty("delete")&&S.delete()}K&&(e.C=K)}))}}),e.i.attachMultiListener(a,u),a.delete()}s.onResults=function(e,t){this.listeners[t||"$"]=e},q("Solution",Wt),q("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});function Xr(e){e=qr(e);var t=e.getMesh();if(!t)return e;var r=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return r};var n=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return n},e}var Jr={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(Xr)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map(function(t){return $e(pt(t),m).map(ir)})}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ar=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],lr=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],cr=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ur=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],dr=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],pr=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Zr=[].concat(F(ar),F(lr),F(cr),F(ur),F(dr),F(pr));function fr(e){e=e||{},e=Object.assign(Object.assign({},Jr),e),this.g=new Wt(e)}s=fr.prototype,s.close=function(){return this.g.close(),Promise.resolve()},s.onResults=function(e){this.g.onResults(e)},s.initialize=function(){return me(this,function e(){var t=this;return C(e,function(r){return J(r,t.g.initialize(),0)})})},s.reset=function(){this.g.reset()},s.send=function(e){return me(this,function t(){var r=this;return C(t,function(n){return J(n,r.g.send(e),0)})})},s.setOptions=function(e){this.g.setOptions(e)},q("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),q("FaceMesh",fr),q("FACEMESH_LIPS",ar),q("FACEMESH_LEFT_EYE",lr),q("FACEMESH_LEFT_EYEBROW",cr),q("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]
18]),q("FACEMESH_RIGHT_EYE",ur),q("FACEMESH_RIGHT_EYEBROW",dr),q("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),q("FACEMESH_FACE_OVAL",pr),q("FACEMESH_CONTOURS",Zr),q("FACEMESH_TESSELATION",[
vendor: 14,069 bytes, line 18
18[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,23
vendor: 10,272 bytes, line 18
181],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]
18]),q("matrixDataToMatrix",function(e){for(var t=e.getCols(),r=e.getRows(),n=e.getPackedDataList(),a=[],u=0;u<r;u++)a.push(Array(t));for(u=0;u<r;u++)for(var c=0;c<t;c++){var d=e.getLayout()===1?u*t+c:c*r+u;a[u][c]=n[d]}return a}),q("VERSION","0.4.1633559619")}).call(Qt)),Qt}var kn=wn();const Rr=[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],Vt={face_outline:Rr,forehead:[10,338,297,332,284,251,389,356,454,323,361,340,346,347,348,349,350,264,447,366,401,435,367,364,394,430,434,416,285,295,282,283,276,300,293,334,296,336,9,107,66,105,63,70,156,143,116,123,147,213],left_eyebrow:[70,63,105,66,107,55,65,52,53,46],right_eyebrow:[300,293,334,296,336,285,295,282,283,276],left_eye:[33,246,161,160,159,158,157,173,133,155,154,153,145,144,163,7],right_eye:[263,466,388,387,386,385,384,398,362,382,381,380,374,373,390,249],left_under_eye:[130,25,110,24,23,22,26,112,243,244,245,128,121,120,119,118,117,111],right_under_eye:[359,255,339,254,253,252,256,341,463,464,465,357,350,349,348,347,346,340],nose:[6,197,195,5,4,1,2,98,97,326,327,168],left_cheek:[50,187,205,206,203,142,126,100,36,117],right_cheek:[280,411,425,426,423,371,355,329,266,346],upper_lip_area:[61,185,40,39,37,0,267,269,270,409,291],lower_lip_area:[146,91,181,84,17,314,405,321,375,291],chin:[175,199,200,18,17,16,15,14,13,312,311,310,415,308,324],jawline:[172,136,149,176,148,152,377,400,378,379,365,397,288],left_temple:[54,68,71,162,127,234,93,132,58,172],right_temple:[284,298,301,389,356,454,323,361,288,397],glabella:[9,8,168,6,197,195,5,4,45,220,115]},jn=[{region_id:"forehead",label:"Forehead",groupKey:"forehead"},{region_id:"glabella",label:"Glabella",groupKey:"glabella"},{region_id:"left_temple",label:"Left temple",groupKey:"left_temple"},{region_id:"right_temple",label:"Right temple",groupKey:"right_temple"},{region_id:"left_eye_area",label:"Left eye area",groupKey:"left_under_eye"},{region_id:"right_eye_area",label:"Right eye area",groupKey:"right_under_eye"},{region_id:"left_cheek",label:"Left cheek",groupKey:"left_cheek"},{region_id:"right_cheek",label:"Right cheek",groupKey:"right_cheek"},{region_id:"nose",label:"Nose",groupKey:"nose"},{region_id:"nose_sides",label:"Nose sides",groupKey:"nose"},{region_id:"upper_lip",label:"Upper lip",groupKey:"upper_lip_area"},{region_id:"chin",label:"Chin",groupKey:"chin"},{region_id:"jawline",label:"Jawline",groupKey:"jawline"}];function Nn(s="front"){return s==="left_profile"?"left":s==="right_profile"?"right":String(s).startsWith("closeup")?"front":s||"front"}function Cr(s,o){return{index:o,x:Number(s.x.toFixed(6)),y:Number(s.y.toFixed(6)),z:Number((s.z||0).toFixed(6))}}function Gt(s=[],o=[]){return o.map(g=>s[g]).filter(Boolean).map((g,_)=>Cr(g,o[_]))}function Pr(s=[]){if(!s.length)return null;const o=s.map(b=>b.x),g=s.map(b=>b.y),_=Math.min(...o),j=Math.max(...o),p=Math.min(...g),U=Math.max(...g);return{x:Number(_.toFixed(6)),y:Number(p.toFixed(6)),width:Number((j-_).toFixed(6)),height:Number((U-p).toFixed(6))}}function Or(s=[]){if(!s.length)return null;const o=s.reduce((g,_)=>({x:g.x+_.x,y:g.y+_.y}),{x:0,y:0});return{x:Number((o.x/s.length).toFixed(6)),y:Number((o.y/s.length).toFixed(6))}}const kr={en:{noFace:"We could not clearly find your face. Move into better light and try again.",multipleFaces:"More than one face was detected. Please take a photo with only your face visible.",smallFace:"Move closer so your face fills more of the frame.",offCenter:"Center your face in the frame and try again.",lowResolution:"Use a clearer photo. Your face needs to be larger and sharper in the image.",blurry:"The image is blurry. Hold the camera still and retake the photo.",dark:"Your photo is too dark. Move closer to natural light and try again.",bright:"Your photo is too bright. Avoid direct glare and retake the photo.",underexposed:"Your face is too shadowed. Use softer front lighting and try again.",overexposed:"Some areas are washed out. Reduce harsh light and retake the photo.",obstructed:"Your face is partially covered. Move hair away from your cheeks and forehead.",poseFront:"Look directly at the camera and keep your head upright.",poseLeft:"Turn slightly so your left side is visible and keep your whole face in frame.",poseRight:"Turn slightly so your right side is visible and keep your whole face in frame.",extremePose:"Keep your head more upright and avoid turning too far to the side.",beautyFilter:"Turn beauty mode off and use the original camera look for a more accurate scan.",ready:"Your photo is ready for analysis.",warning:"Your photo is usable, but a clearer retake could improve accuracy."},pt:{noFace:"Não conseguimos identificar seu rosto com clareza. Vá para uma luz melhor e tente novamente.",multipleFaces:"Mais de um rosto foi detectado. Tire a foto com apenas o seu rosto visÃvel.",smallFace:"Aproxime-se para que seu rosto ocupe mais espaço na imagem.",offCenter:"Centralize seu rosto no enquadramento e tente novamente.",lowResolution:"Use uma foto mais nÃtida. Seu rosto precisa aparecer maior e mais claro.",blurry:"A imagem está borrada. Segure a câmera com firmeza e refaça a foto.",dark:"Sua foto está escura. Aproxime-se de uma luz natural e tente novamente.",bright:"Sua foto está clara demais. Evite brilho forte direto e refaça a foto.",underexposed:"Seu rosto está com muita sombra. Use uma luz frontal mais suave e tente novamente.",overexposed:"Algumas áreas ficaram estouradas. Reduza a luz forte e refaça a foto.",obstructed:"Seu rosto está parcialmente coberto. Afaste o cabelo das bochechas e da testa.",poseFront:"Olhe diretamente para a câmera e mantenha a cabeça reta.",poseLeft:"Vire um pouco para mostrar o lado esquerdo e mantenha o rosto inteiro no enquadramento.",poseRight:"Vire um pouco para mostrar o lado direito e mantenha o rosto inteiro no enquadramento.",extremePose:"Mantenha a cabeça mais reta e evite girar demais para o lado.",beautyFilter:"Desative o modo beleza e use a aparência original da câmera para uma análise mais precisa.",ready:"Sua foto está pronta para análise.",warning:"Sua foto pode ser usada, mas uma nova foto mais clara pode melhorar a precisão."}};function Ce(s,o=0,g=100){return Math.max(o,Math.min(g,s))}function En(s){const o=document.createElement("canvas");
18o.width=s.naturalWidth||s.width,o.height=s.naturalHeight||s.height;const g=o.getContext("2d",{willReadFrequently:!0});return g.drawImage(s,0,0,o.width,o.height),{canvas:o,context:g}}function An(s,o,g){return s?{left:Ce(Math.floor(s.x*o),0,o-1),top:Ce(Math.floor(s.y*g),0,g-1),width:Ce(Math.floor(s.width*o),1,o),height:Ce(Math.floor(s.height*g),1,g)}:{left:0,top:0,width:o,height:g}}function Sn(s,o,g,_){const{left:j,top:p,width:U,height:b}=_,{data:F}=s.getImageData(j,p,U,b);let k=0,Q=0,y=0,L=0,ee=0,se=0;const re=new Array(U*b);for(let G=0;G<F.length;G+=4){const ne=F[G],ke=F[G+1],Z=F[G+2],he=.2126*ne+.7152*ke+.0722*Z,C=G/4;re[C]=he,k+=he,Q+=he*he,he<35&&(y+=1),he>225&&(L+=1),se+=1}for(let G=1;G<b-1;G+=2)for(let ne=1;ne<U-1;ne+=2){const ke=re[G*U+ne],Z=Math.abs(re[G*U+(ne+1)]-re[G*U+(ne-1)]),he=Math.abs(re[(G+1)*U+ne]-re[(G-1)*U+ne]);ee+=Math.abs(4*ke-re[G*U+(ne-1)]-re[G*U+(ne+1)]-re[(G-1)*U+ne]-re[(G+1)*U+ne])+Z+he}const ue=k/Math.max(se,1),fe=Math.max(Q/Math.max(se,1)-ue*ue,0),ae=Math.sqrt(fe),J=ee/Math.max(U*b/4,1);return{meanLuminance:ue,contrast:ae,darkRatio:y/Math.max(se,1),brightRatio:L/Math.max(se,1),sharpnessRaw:J}}function Xt(s=[]){return Or(s)||{x:.5,y:.5}}function Jt(s,o){return Math.hypot((s.x||0)-(o.x||0),(s.y||0)-(o.y||0))}function Fn(s=[]){const o=Xt(Gt(s,Vt.left_eye)),g=Xt(Gt(s,Vt.right_eye)),_=Xt(Gt(s,Vt.nose)),j=Math.max(Jt(o,g),1e-4),p=Jt(o,_),b=(Jt(g,_)-p)/j,F=Math.atan2(g.y-o.y,g.x-o.x)*(180/Math.PI);let k="front";return b>=.18&&(k="left"),b<=-.18&&(k="right"),{detectedAngle:k,yawScore:Ce(100-Math.abs(b)*180),rollDegrees:F,asymmetry:b}}function Ln(s,o){const g=Math.min(s,o);return g>=1400?100:g>=1080?95:g>=900?88:g>=720?78:g>=640?62:g>=480?40:18}function Rn(s=[],o="en",g="ready"){const _=kr[o]||kr.en;return s.length?s.map(j=>_[j]).filter(Boolean):[g==="acceptable_with_warning"?_.warning:_.ready]}function Cn({image:s,landmarks:o=[],faceCount:g=0,expectedAngle:_="front",language:j="en"}){const p=Nn(_),{canvas:U,context:b}=En(s),F=U.width,k=U.height,Q=o.length?o.map((ot,st)=>({index:st,x:ot.x,y:ot.y,z:ot.z||0})):[],y=Pr(Q.length?Q:Gt(o,Rr)),L=An(y,F,k),ee=Sn(b,F,k,L),se=y?y.width*y.height:0,re=y?{x:y.x+y.width/2,y:y.y+y.height/2}:{x:.5,y:.5},ue=Math.abs(re.x-.5),fe=Math.abs(re.y-.48),ae=Fn(o),J=y?Ce(Math.min(y.x,y.y,1-(y.x+y.width),1-(y.y+y.height))*650):0,G=Ce(100-(ue*190+fe*170)),ne=Ce(se/.2*100),ke=Ce(100-Math.abs(ee.meanLuminance-132)*1.05-ee.darkRatio*160-ee.brightRatio*160),Z=Ce((ee.sharpnessRaw-10)*2.8),he=Ce(Math.min(ae.yawScore,100-Math.abs(ae.rollDegrees)*2.4)),C=Ce(J*.6+G*.4),Be=Ln(F,k),nt=ee.contrast<18&&Z<30&&ke>65,Ve=[],q=[],Pe=[];g===0&&Ve.push("noFace"),g>1&&Ve.push("multipleFaces"),Be<35&&Ve.push("lowResolution"),Ve.length||((se<.1||ne<50)&&q.push("smallFace"),(ue>.18||fe>.2)&&q.push("offCenter"),Z<42&&q.push("blurry"),ee.meanLuminance<78&&q.push("dark"),ee.meanLuminance>188&&q.push("bright"),ee.darkRatio>.3&&q.push("underexposed"),ee.brightRatio>.22&&q.push("overexposed"),(C<46||J<22)&&q.push("obstructed"),(Math.abs(ae.rollDegrees)>22||Math.abs(ae.asymmetry)>.5)&&q.push("extremePose"),p==="front"&&ae.detectedAngle!=="front"&&q.push("poseFront"),p==="left"&&ae.detectedAngle!=="left"&&q.push("poseLeft"),p==="right"&&ae.detectedAngle!=="right"&&q.push("poseRight"),nt&&Pe.push("beautyFilter"),ke<60&&!q.includes("dark")&&!q.includes("bright")&&Pe.push(ee.meanLuminance<120?"dar
18k":"bright"));let ye="ready";Ve.length?ye="invalid":q.length?ye="retry_required":Pe.length&&(ye="acceptable_with_warning");const mt=ye==="invalid"?Ve:ye==="retry_required"?q:Pe,it=Math.round(Ce(ke*.18+Z*.22+he*.2+C*.14+Be*.16+G*.05+ne*.05-(nt?8:0)));return{validation_status:ye,overall_quality_score:it,face_count:g,brightness_score:Math.round(ke),sharpness_score:Math.round(Z),pose_score:Math.round(he),obstruction_score:Math.round(C),image_resolution_score:Math.round(Be),detected_angle:g===1?ae.detectedAngle:"unknown",retry_required:ye==="retry_required"||ye==="invalid",user_guidance:Rn(mt,j,ye),quality_flags:{expected_angle:p,face_area_ratio:Number(se.toFixed(4)),center_offset_x:Number(ue.toFixed(4)),center_offset_y:Number(fe.toFixed(4)),mean_luminance:Number(ee.meanLuminance.toFixed(2)),dark_ratio:Number(ee.darkRatio.toFixed(4)),bright_ratio:Number(ee.brightRatio.toFixed(4)),contrast:Number(ee.contrast.toFixed(2)),sharpness_raw:Number(ee.sharpnessRaw.toFixed(2)),roll_degrees:Number(ae.rollDegrees.toFixed(2)),angle_asymmetry:Number(ae.asymmetry.toFixed(4)),beauty_filter_likely:nt}}}const tr="glowbox_face_geometry_v1",jr="mediapipe_face_mesh_browser_v1";function Pn(s){return Math.max(0,Math.min(1,s))}function On(s){return new Promise((o,g)=>{const _=new Image;_.crossOrigin="anonymous",_.onload=()=>o(_),_.onerror=()=>g(new Error("Could not load the selected image.")),_.src=s})}async function Tn(s){var g;const o=new kn.FaceMesh({locateFile:_=>`https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/${_}`});o.setOptions({maxNumFaces:2,refineLandmarks:!0,minDetectionConfidence:.5,minTrackingConfidence:.5});try{return await new Promise((_,j)=>{let p=!1;const U=window.setTimeout(()=>{p||(p=!0,j(new Error("Face scan timed out.")))},15e3);o.onResults(b=>{p||(p=!0,window.clearTimeout(U),_(b||{}))}),o.send({image:s}).catch(b=>{p||(p=!0,window.clearTimeout(U),j(b))})})}finally{(g=o.close)==null||g.call(o)}}function qn(s=[]){return Object.entries(Vt).reduce((o,[g,_])=>(o[g]=_.map(j=>s[j]).filter(Boolean).map((j,p)=>Cr(j,_[p])),o),{})}function Mn(s,o,g,_){const j=Pn((o.overall_quality_score||0)/100);return{normalized_space:"0_to_1",regions:jn.map(U=>{const b=s[U.groupKey]||[],F=Pr(b)||{x:0,y:0,width:0,height:0},k=Or(b)||{x:.5,y:.5};return{region_id:U.region_id,region_name:U.label,polygon:b,center_point:k,bounding_box:F,confidence:Number(j.toFixed(4)),source_image_angle:_,image_width:g.width,image_height:g.height,geometry_version:tr}})}}async function In({imageUrl:s,expectedAngle:o="front",language:g="en",onStageChange:_}={}){_==null||_("checking_quality");const j=await On(s),p={width:j.naturalWidth||j.width,height:j.naturalHeight||j.height,aspect_ratio:Number(((j.naturalWidth||j.width)/Math.max(j.naturalHeight||j.height,1)).toFixed(4))},U=await Tn(j),b=(U==null?void 0:U.multiFaceLandmarks)||[],F=b.length;F===1&&(_==null||_("face_detected"));const k=b[0]||[],Q=Cn({image:j,landmarks:k,faceCount:F,expectedAngle:o,language:g});if(F===1&&(_==null||_("checking_lighting")),Q.validation_status==="retry_required"||Q.validation_status==="invalid"||F!==1)return{image_meta:p,quality_validation:Q,landmarks:null,facial_regions:null,geometry_version:tr,model_or_method:jr,processing_status:Q.validation_status==="acceptable_with_warning"?"validation_warning":"validation_failed"};_==null||_("mapping_facial_regions");const y=qn(k),L=Mn(y,Q,p,Q.detected_angle);return _==null||_("photo_ready"),{image_meta:p,quality_validation:Q,landmarks:{normalized_space:"0_to_1",face_count:F,detected_angle:Q.detected_angle,groups:y},facial_regions:L,geometry_version:tr,model_or_method:jr,processing_status:Q.validation_status==="acceptable_with_warning"?"validation_warning":"geometry_ready"}}async function Un({userId:s,analysisId:o="",imageId:g,imageAngle:_,originalImageReference:j,qualityValidation:p,landmarks:U,facialRegions:b,geometryVersion:F,generatedAt:k,modelOrMethod:Q,processingStatus:y}){return we.entities.FacialAnalysisGeometry.create({analysis_id:o||"",user_id:s,image_id:g,image_angle:_,original_image_reference:j,quality_validation:p,landmarks:U||{},facial_regions:b||{},geometry_version:F,generated_at:k,model_or_method:Q,processing_status:y})}
18async function Bn(s=[],o){const g=[...new Set((s||[]).filter(Boolean))];await Promise.all(g.map(_=>we.entities.FacialAnalysisGeometry.update(_,{analysis_id:o,processing_status:"analysis_complete"})))}const Ke=20,Nr=3600,Vn="public_flow_v1",Er={en:{title:"Free Skin Analysis",subtitle:"Answer a few questions and take one clear photo with the live camera.",back:"Back",continue:"Continue",saveLater:"Save and continue later",photoTitle:"Take your photo now",photoBody:"Before taking the photo: wash and dry your face, remove all makeup and glasses, turn off beauty filters, face the camera and use soft natural daylight. Keep your full face visible and send a recent photo of only you.",photoChecklist:["Clean, dry skin with no makeup","Soft natural daylight, facing a window","One real face, front-facing and fully visible","No glasses, filters, retouching or blurred image"],preparationConsent:"I confirm that my face is clean, with no makeup or filter, and that the photo follows the instructions above.",consent:"I agree to use this photo for my skin analysis.",safetyChecking:"Checking that your photo is safe and suitableâ¦",preparationValidation:"Please confirm that your face is clean, with no makeup or filter, before continuing.",faceValidation:"We need a new photo before continuing. Please show one real face, front-facing and fully visible in clear natural light.",takePhoto:"Open camera",capturePhoto:"Take photo now",cancelCamera:"Cancel",cameraError:"We could not open your camera. Allow camera access in your browser and try again.",usePhoto:"Use this photo",chooseAnother:"Choose another photo",processing:"Processing your analysisâ¦",processingDetail:"We are analyzing your questionnaire and photo now.",retry:"Try again",unlock:"Unlock My Full Results",openResults:"Open full results",returnToAnalysis:"Return to analysis",noAnalysis:"Finish your analysis first.",saved:"Your progress has been saved.",validation:"Please answer this question to continue.",photoValidation:"Please choose a valid photo to continue.",q1:"What is your skin type?",q2:"What are your main skin concerns?",q3:"How sensitive is your skin?",q4:"How often do you experience acne or breakouts?",q5:"Do you currently have dark spots or hyperpigmentation?",q6:"What is your current skincare routine?",q7:"Which products do you currently use?",q8:"Have you experienced reactions to skincare products?",q8Details:"Describe your allergies",q9:"What are your main skincare goals?",q10:"Are you currently using prescription skincare or strong active ingredients?",q11:"Do you have any diagnosed skin conditions or current irritation?",q12:"Are you pregnant, breastfeeding, or trying to become pregnant?",q13:"Do any of these lifestyle factors apply to you?",q14:"Which eating pattern best describes you?",q15:"Do you practise facial massage?",q16:"What is the climate like where you live?",q17:"Where do you currently live?",q18:"Do you have any preferred skincare brands?",q19:"What is your preferred budget for a complete skincare routine?",q20:"Lifestyle information",water:"Average daily water intake",sleep:"Average sleep",stress:"Stress level",sun:"Sun exposure",sunscreen:"Sunscreen use"},pt:{title:"Análise de Pele Gratuita",subtitle:"Responda algumas perguntas e tire uma foto nÃtida com a câmera ao vivo.",back:"Voltar",continue:"Continuar",saveLater:"Salvar e continuar depois",photoTitle:"Tire sua foto agora",photoBody:"Antes da foto: lave e seque o rosto, retire toda a maquiagem e os óculos, desative filtros de beleza, olhe de frente para a câmera e use luz natural suave. Mostre o rosto inteiro e envie uma foto recente somente sua.",photoChecklist:["Pele limpa, seca e sem maquiagem","Luz natural suave, de frente para uma janela","Um único rosto real, de frente e totalmente visÃvel","Sem óculos, filtros, retoques ou imagem borrada"],preparationConsent:"Confirmo que meu rosto está limpo, sem maquiagem e sem filtro, e que a foto segue as instruções acima.",consent:"Concordo em usar esta foto para minha análise de pele.",safetyChecking:"Verificando se sua foto é segura e adequadaâ¦",preparationValidation:"Confirme que seu rosto está limpo, sem maquiagem e sem filtro antes de continuar.",faceValidation:"Precisamos de uma nova foto antes de continuar. Mostre um único rosto real, de frente, inteiro e com luz natural clara.",takePhoto:"Abrir câmera",capturePhoto:"Tirar foto agora",cancelCamera:"Cancelar",cameraError:"Não conseguimos abrir sua câmera. Autorize o acesso à câmera no navegador e tente novamente.",usePhoto:"Usar esta foto",chooseAnother:"Escolher outra foto",processing:"Processando sua análiseâ¦",processingDetail:"Estamos analisando seu questionário e sua foto agora.",retry:"Tentar novamente",unlock:"Unlock My Full Results",openResults:"Abrir resultado completo",returnToAnalysis:"Voltar para a análise",noAnalysis:"Conclua sua análise primeiro.",saved:"Seu progresso foi salvo.",validation:"Responda esta pergunta para continuar.",photoValidation:"Escolha uma foto válida para continuar.",q1:"Qual é o seu tipo de pele?",q2:"Quais são as suas principais preocupações com a pele?",q3:"Qual é o nÃvel de sensibilidade da sua pele?",q4:"Com que frequência você tem acne ou espinhas?",q5:"Você tem manchas ou hiperpigmentação atualmente?",q6:"Como é a sua rotina de skincare hoje?",q7:"Quais produtos você usa atualmente?",q8:"Você já teve reações a produtos de skincare?",q8Details:"Descreva suas alergias",q9:"Quais são os seus principais objetivos de skincare?",q10:"Você usa algum tratamento prescrito ou ativo forte atualmente?",q11:"Você possui alguma condição de pele diagnosticada ou irritação atual?",q12:"Você está grávida, amamentando ou tentando engravi
18dar?",q13:"Algum destes fatores de estilo de vida se aplica a você?",q14:"Qual tipo de alimentação melhor descreve você?",q15:"Você pratica massagem facial?",q16:"Como é o clima onde você mora?",q17:"Onde você mora atualmente?",q18:"Você tem marcas de skincare preferidas?",q19:"Qual é o seu orçamento preferido para uma rotina completa?",q20:"Informações de estilo de vida",water:"Ingestão média diária de água",sleep:"Sono médio",stress:"NÃvel de estresse",sun:"Exposição solar",sunscreen:"Uso de protetor solar"}},I={skinType:["oily","dry","combination","normal","not_sure"],skinTypeLabel:{oily:{en:"Oily",pt:"Oleosa"},dry:{en:"Dry",pt:"Seca"},combination:{en:"Combination",pt:"Mista"},normal:{en:"Normal",pt:"Normal"},not_sure:{en:"Not sure",pt:"Não sei"}},concerns:["Acne and breakouts","Dark spots","Uneven skin tone","Fine lines and wrinkles","Dryness","Oiliness","Redness","Large pores","Sensitivity","Dullness"],sensitivity:["not_sensitive","slightly_sensitive","moderately_sensitive","very_sensitive","not_sure"],sensitivityLabel:{not_sensitive:{en:"Not sensitive",pt:"Não sensÃvel"},slightly_sensitive:{en:"Slightly sensitive",pt:"Levemente sensÃvel"},moderately_sensitive:{en:"Moderately sensitive",pt:"Moderadamente sensÃvel"},very_sensitive:{en:"Very sensitive",pt:"Muito sensÃvel"},not_sure:{en:"Not sure",pt:"Não sei"}},acneFrequency:["never","occasionally","frequently","almost_every_day"],acneFrequencyLabel:{never:{en:"Never",pt:"Nunca"},occasionally:{en:"Occasionally",pt:"Ocasionalmente"},frequently:{en:"Frequently",pt:"Frequentemente"},almost_every_day:{en:"Almost every day",pt:"Quase todos os dias"}},darkSpots:["no","a_little","moderate","significant"],darkSpotsLabel:{no:{en:"No",pt:"Não"},a_little:{en:"A little",pt:"Um pouco"},moderate:{en:"Moderate",pt:"Moderado"},significant:{en:"Significant",pt:"Significativo"}},routineLevel:["no_routine","basic_routine","regular_routine","advanced_routine"],routineLevelLabel:{no_routine:{en:"I do not have a routine",pt:"Eu não tenho rotina"},basic_routine:{en:"Basic routine",pt:"Rotina básica"},regular_routine:{en:"Regular routine",pt:"Rotina regular"},advanced_routine:{en:"Advanced routine",pt:"Rotina avançada"}},products:["Cleanser","Toner","Serum","Moisturizer","Sunscreen","Retinol","Exfoliant","Eye cream","Acne treatment","None"],reactionHistory:["never","occasionally","frequently","known_allergies"],reactionHistoryLabel:{never:{en:"Never",pt:"Nunca"},occasionally:{en:"Occasionally",pt:"Ocasionalmente"},frequently:{en:"Frequently",pt:"Frequentemente"},known_allergies:{en:"I have known allergies",pt:"Tenho alergias conhecidas"}},goals:["Clearer skin","More hydration","Brighter skin","Reduce dark spots","Reduce signs of ageing","Control oil","Reduce sensitivity","Improve skin texture"],activeTreatments:["none","prescription_retinoid","oral_isotretinoin","retinol_retinal","exfoliating_acids","benzoyl_peroxide","other_prescription"],activeTreatmentsLabel:{none:{en:"None",pt:"Nenhum"},prescription_retinoid:{en:"Prescription retinoid (such as tretinoin or adapalene)",pt:"Retinoide prescrito (como tretinoÃna ou adapaleno)"},oral_isotretinoin:{en:"Oral isotretinoin",pt:"IsotretinoÃna oral"},retinol_retinal:{en:"Retinol or retinal",pt:"Retinol ou retinal"},exfoliating_acids:{en:"Exfoliating acids (AHA, BHA or PHA)",pt:"Ãcidos esfoliantes (AHA, BHA ou PHA)"},benzoyl_peroxide:{en:"Benzoyl peroxide",pt:"Peróxido de benzoÃla"},other_prescription:{en:"Other prescription skin treatment",pt:"Outro tratamento de pele prescrito"}},diagnosedConditions:["none","eczema_dermatitis","rosacea","psoriasis","active_infection","open_healing_skin","under_medical_care","prefer_not_to_say"],diagnosedConditionsLabel:{none:{en:"None",pt:"Nenhuma"},eczema_dermatitis:{en:"Eczema or dermatitis",pt:"Eczema ou dermatite"},rosacea:{en:"Rosacea",pt:"Rosácea"},psoriasis:{en:"Psoriasis",pt:"PsorÃase"},active_infection:{en:"Active skin infection",pt:"Infecção de pele ativa"},open_healing_skin:{en:"Open, damaged, or healing skin",pt:"Pele aberta, lesionada ou em cicatrização"},under_medical_care:{en:"Another condition under medical care",pt:"Outra condição sob acompanhamento médico"},prefer_not_to_say:{en:"Prefer not to say",pt:"Prefiro não informar"}},pregnancyStatus:["no","pregnant","breastfeeding","trying_to_conceive","prefer_not_to_say"],pregnancyStatusLabel:{no:{en:"No",pt:"Não"},pregnant:{en:"Pregnant",pt:"Grávida"},breastfeeding:{en:"Breastfeeding",pt:"Amamentando"},trying_to_conceive:{en:"Trying to become pregnant",pt:"Tentando engravi
18dar"},prefer_not_to_say:{en:"Prefer not to say",pt:"Prefiro não informar"}},lifestyleFactors:["none","smoking","vaping","alcohol","recreational_substances","prefer_not_to_say"],lifestyleFactorsLabel:{none:{en:"None",pt:"Nenhum"},smoking:{en:"I smoke cigarettes",pt:"Fumo cigarros"},vaping:{en:"I vape",pt:"Uso vape"},alcohol:{en:"I drink alcohol",pt:"Consumo álcool"},recreational_substances:{en:"I use other recreational substances",pt:"Uso outras substâncias recreativas"},prefer_not_to_say:{en:"Prefer not to say",pt:"Prefiro não informar"}},dietaryPatterns:["omnivore","carnivore","pescatarian","vegetarian","vegan","plant_forward","other","prefer_not_to_say"],dietaryPatternsLabel:{omnivore:{en:"Omnivore",pt:"OnÃvora"},carnivore:{en:"Carnivore diet",pt:"CarnÃvora"},pescatarian:{en:"Pescatarian",pt:"Pescetariana"},vegetarian:{en:"Vegetarian",pt:"Vegetariana"},vegan:{en:"Vegan",pt:"Vegana"},plant_forward:{en:"Mostly plant-based",pt:"Principalmente baseada em plantas"},other:{en:"Other",pt:"Outra"},prefer_not_to_say:{en:"Prefer not to say",pt:"Prefiro não informar"}},facialMassage:["regularly","sometimes","want_to_learn","not_interested"],facialMassageLabel:{regularly:{en:"Yes, regularly",pt:"Sim, regularmente"},sometimes:{en:"Sometimes",pt:"Ãs vezes"},want_to_learn:{en:"Not yet â I would like to learn",pt:"Ainda não â quero aprender"},not_interested:{en:"No, and I am not interested",pt:"Não, e não tenho interesse"}},climates:["hot_humid","hot_dry","mild","cold_dry","cold_humid","variable","not_sure"],climatesLabel:{hot_humid:{en:"Tropical, hot and humid",pt:"Tropical, quente e úmido"},hot_dry:{en:"Hot and dry",pt:"Quente e seco"},mild:{en:"Temperate or mild",pt:"Temperado ou ameno"},cold_dry:{en:"Cold and dry",pt:"Frio e seco"},cold_humid:{en:"Cold and humid",pt:"Frio e úmido"},variable:{en:"Very changeable across the year",pt:"Varia muito ao longo do ano"},not_sure:{en:"Not sure",pt:"Não sei"}},water:["under_3","3_5","6_8","8_plus"],waterLabel:{under_3:{en:"Under 3 glasses (less than 0.75 L)",pt:"Menos de 3 copos (menos de 0,75 L)"},"3_5":{en:"3 to 5 glasses (about 0.75â1.25 L)",pt:"3 a 5 copos (aprox. 0,75â1,25 L)"},"6_8":{en:"6 to 8 glasses (about 1.5â2 L)",pt:"6 a 8 copos (aprox. 1,5â2 L)"},"8_plus":{en:"More than 8 glasses (over 2 L)",pt:"Mais de 8 copos (acima de 2 L)"}},sleep:["under_5","5_6","7_8","9_plus"],sleepLabel:{under_5:{en:"Under 5 hours",pt:"Menos de 5 horas"},"5_6":{en:"5 to 6 hours",pt:"5 a 6 horas"},"7_8":{en:"7 to 8 hours",pt:"7 a 8 horas"},"9_plus":{en:"9 or more hours",pt:"9 ou mais horas"}},stress:["low","moderate","high"],stressLabel:{low:{en:"Low",pt:"Baixo"},moderate:{en:"Moderate",pt:"Moderado"},high:{en:"High",pt:"Alto"}},sun:["minimal","moderate","frequent"],sunLabel:{minimal:{en:"Minimal",pt:"Baixa"},moderate:{en:"Moderate",pt:"Moderada"},frequent:{en:"Frequent",pt:"Frequente"}},sunscreen:["never","sometimes","daily","reapply"],sunscreenLabel:{never:{en:"Never",pt:"Nunca"},sometimes:{en:"Sometimes",pt:"Ãs vezes"},daily:{en:"Daily",pt:"Diariamente"},reapply:{en:"Daily and reapply",pt:"Diariamente e reaplico"}}};function Nt(s){return`glowbox_skin_analysis_progress_${s}`}function Zt(){return{skin_type:"",skin_concerns_user_reported:[],skin_goals:[],sensitivity_level:"",acne_frequency:"",dark_spots_level:"",current_routine_level:"",current_products:[],reaction_history:"",allergy_details:"",active_skincare_treatments:[],diagnosed_skin_conditions:[],pregnancy_breastfeeding_status:"",lifestyle_factors:[],dietary_pattern:"",facial_massage_experience:"",climate:"",water_cups:"",sleep_hours:null,stress_level:"",sun_exposure_level:"",sunscreen_frequency:"",country:"",country_code:"",country_name:"",preferred_currency:"",shipping_market:"",confirmed_market:null,country_confirmed:!1,preferred_product_origins:[],glowbox_only:!1,preferred_brands:[],excluded_brands:[],excluded_products:[],brand_preferences_answered:!1,routine_budget:"no_preference",currency:"",facial_consent_confirmed:!1,facial_consent_accepted_at:"",photo_preparation_confirmed:!1,facial_image_retention:"delete_after_analysis",photo_url:"",private_photo_uri:""}}function pe(s,o,g){var _,j;return((_=s[o])==null?void 0:_[g])||((j=s[o])==null?void 0:j.en)||o}function _t(s,o,g=[]){return s.includes(o)?s.filter(_=>_!==o):g.includes(o)?[o]:[...s.filter(_=>!g.includes(_)),o]}function Ar(s){return{not_sensitive:"low",slightly_sensitive:"moderate",moderately_sensitive:"high",very_sensitive:"very_high",not_sure:"not_sure"}[s]||"not_sure"}
18function Gn(s){return{no_routine:"simple",basic_routine:"simple",regular_routine:"moderate",advanced_routine:"advanced"}[s]||"simple"}function zn(s){return{no_routine:"never",basic_routine:"sometimes",regular_routine:"every_day",advanced_routine:"every_day"}[s]||"sometimes"}function Dn(s){return{under_3:"low","3_5":"moderate","6_8":"high","8_plus":"high"}[s]||null}function $n(s){return Array.from(new Set([...s.skin_concerns_user_reported||[],...s.skin_goals||[]]))}function Wn({formData:s,photoAnalysis:o,language:g}){return`You are GlowBox AI. Build a real skincare analysis in ${Sr({userLanguage:g})} using ONLY the questionnaire answers and the real photo analysis below. 19 20QUESTIONNAIRE 21- Skin type: ${s.skin_type} 22- Main concerns: ${(s.skin_concerns_user_reported||[]).join(", ")} 23- Sensitivity: ${s.sensitivity_level} 24- Acne frequency: ${s.acne_frequency} 25- Dark spots: ${s.dark_spots_level} 26- Routine level: ${s.current_routine_level} 27- Current products: ${(s.current_products||[]).join(", ")} 28- Reaction history: ${s.reaction_history} 29- Allergy details: ${s.allergy_details} 30- Goals: ${(s.skin_goals||[]).join(", ")} 31- Current prescription treatments or strong actives: ${(s.active_skincare_treatments||[]).join(", ")} 32- Diagnosed skin conditions or current irritation: ${(s.diagnosed_skin_conditions||[]).join(", ")} 33- Pregnancy or breastfeeding status: ${s.pregnancy_breastfeeding_status} 34- Lifestyle factors: ${(s.lifestyle_factors||[]).join(", ")} 35- Dietary pattern: ${s.dietary_pattern} 36- Facial massage experience: ${s.facial_massage_experience} 37- Climate: ${s.climate} 38- Water: ${s.water_cups} 39- Sleep: ${s.sleep_hours} 40- Stress: ${s.stress_level} 41- Sun exposure: ${s.sun_exposure_level} 42- Sunscreen use: ${s.sunscreen_frequency} 43- Country code: ${s.country_code||s.country} 44- Country name: ${s.country_name} 45- Currency: ${s.preferred_currency||s.currency} 46- Shipping market: ${s.shipping_market} 47- Preferred product origins: ${(s.preferred_product_origins||[]).join(", ")} 48- GlowBox only: ${s.glowbox_only?"yes":"no"} 49- Preferred brands: ${(s.preferred_brands||[]).join(", ")} 50- Excluded brands: ${(s.excluded_brands||[]).join(", ")} 51- Excluded products: ${(s.excluded_products||[]).join(", ")} 52- Routine budget: ${s.routine_budget} 53 54REAL PHOTO ANALYSIS 55${JSON.stringify(o,null,2)} 56 57RULES 58- Do not invent issues. 59- Keep every statement grounded in the questionnaire or the photo analysis. 60- Product guidance must prioritize safety, compatibility, goals, market availability, origin and brand preferences, then budget. 61- Treat declared prescriptions, strong actives, diagnosed conditions, irritation, pregnancy, breastfeeding, or trying to conceive as safety constraints. 62- Use lifestyle factors only for general skincare context; never judge the user or make a medical diagnosis from them. 63- Do not diagnose medical conditions. Recommend professional medical guidance when the answers indicate active infection, damaged skin, or ongoing medical care. 64- Never force a GlowBox product if it is not safe or appropriate. 65- Return only JSON. 66 67Return JSON with keys diagnosis, skin_profile, personalized_routine, ingredients, evolution_plan, premium_notes, treatment_plan, internal_skin_profile.`}function Yn(s,o){return[o.q1,o.q2,o.q3,o.q4,o.q5,o.q6,o.q7,o.q8,o.q9,o.q10,o.q11,o.q12,o.q13,o.q14,o.q15,o.q16,o.q17,o.q18,o.q19,o.q20][s]||""}function rr(s,o){return s===0?!!o.skin_type:s===1?(o.skin_concerns_user_reported||[]).length>0:s===2?!!o.sensitivity_level:s===3?!!o.acne_frequency:s===4?!!o.dark_spots_level:s===5?!!o.current_routine_level:s===6?(o.current_products||[]).length>0:s===7?!!o.reaction_history&&(o.reaction_history!=="known_allergies"||!!o.allergy_details.trim()):s===8?(o.skin_goals||[]).length>0:s===9?(o.active_skincare_treatments||[]).length>0:s===10?(o.diagnosed_skin_conditions||[]).length>0:s===11?!!o.pregnancy_breastfeeding_status:s===12?(o.lifestyle_factors||[]).length>0:s===13?!!o.dietary_pattern:s===14?!!o.facial_massage_experience:s===15?!!o.climate:s===16?!!(o.country_confirmed&&o.country_code):s===17?!!(o.brand_preferences_answered||(o.preferred_brands||[]).length>0||(o.excluded_brands||[]).length>0||(o.excluded_products||[]).length>0):s===18?!!o.routine_budget:s===19?!!(o.water_cups&&o.sleep_hours!==null&&o.stress_level&&o.sun_exp
67osure_level&&o.sunscreen_frequency):!1}function zt(s){for(let o=0;o<Ke;o+=1)if(!rr(o,s))return o;return-1}function Hn(s){return zt(s)===-1}function ce({label:s,selected:o,onClick:g}){return l.jsx("button",{type:"button",onClick:g,className:`w-full rounded-2xl border px-4 py-4 text-left text-sm font-medium transition ${o?"border-[#E91E63] bg-[#FFF1F6] text-[#111111]":"border-[#EBD6DD] bg-white text-[#111111] hover:bg-[#FFF8FB]"}`,children:s})}function Xn(){const s=rn(),[o,g]=H.useState(null),[_,j]=H.useState(!1),[p,U]=H.useState("en"),[b,F]=H.useState("intro"),[k,Q]=H.useState(0),[y,L]=H.useState(Zt()),[ee,se]=H.useState(""),[re,ue]=H.useState(""),[fe,ae]=H.useState(""),[J,G]=H.useState(""),[ne,ke]=H.useState(!1),[Z,he]=H.useState(null),[C,Be]=H.useState(null),[nt,Ve]=H.useState(!1),[q,Pe]=H.useState(!1),[ye,mt]=H.useState(null),[it,ot]=H.useState([]),[st,Et]=H.useState([]),Ie=H.useRef(null),At=H.useRef(!1),St=H.useRef(!1),Ft=H.useRef(!1),{entitlements:Qe,isLoading:Dt}=nn({user:o,enabled:!!o}),Ge=!!(Qe!=null&&Qe.isAdmin||Qe!=null&&Qe.canUsePremiumAI),A=Er[p]||Er.en,Ae=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,ze=Ae.get("entry")||"",Se=Ae.get("step")||"",yt=Number(Ae.get("q")||"1"),at="/SkinAnalysis?entry=public&step=questionnaire",vt=ze==="public"||!o,ge=H.useMemo(()=>Ut(y),[y]);H.useEffect(()=>{De()},[]),H.useEffect(()=>{!Z||!Ie.current||(Ie.current.srcObject=Z,Ie.current.play().catch(()=>{}))},[Z]),H.useEffect(()=>()=>{Z==null||Z.getTracks().forEach(i=>i.stop())},[Z]),H.useEffect(()=>{!_||b!=="intro"||St.current||(St.current=!0,et("analysis_intro_viewed",{source:"skin_analysis",language:p}))},[_,b,p]),H.useEffect(()=>{!_||!(o!=null&&o.id)||C||localStorage.setItem(Nt(o.id),JSON.stringify({phase:b,currentQuestionIndex:k,formData:ge,selectedFileName:fe}))},[_,o==null?void 0:o.id,C,b,k,ge,fe]),H.useEffect(()=>{!_||C||b!=="questionnaire"||At.current||(At.current=!0,et("questionnaire_started",{source:"skin_analysis",language:p,userId:(o==null?void 0:o.id)||""}))},[_,o==null?void 0:o.id,C,b,p]),H.useEffect(()=>{if(!_||!(o!=null&&o.id))return;const i=new URLSearchParams(window.location.search);i.set("entry","public"),C&&Ge?(i.set("step","full"),i.delete("q")):C?(i.set("step","preview"),i.delete("q")):b==="photo"?(i.set("step","photo"),i.delete("q")):b==="questionnaire"&&(i.set("step","questionnaire"),i.set("q",String(k+1))),window.history.replaceState({},"",`/SkinAnalysis?${i.toString()}`)},[_,o==null?void 0:o.id,b,k,C,Ge]);async function De(){var i,h,je,Le,Je,Ne,Te,te,ie,Re,R,qe,Ze,oe,_e,P,Me,$e,xe,kt,We,ut,Ue,Ye,Rt,Ct;try{if(!await we.auth.isAuthenticated()){g(null),U(gr()),F("intro"),j(!0);return}const x=await we.auth.me();g(x),U(on(x));const[jt,dt]=await Promise.all([we.entities.SkinAnalysis.filter({user_id:x.id},"-created_date",1),we.entities.Product.list("-updated_date",500).catch(()=>[])]);ot([...new Set(dt.map(O=>O.brand_name||O.brand).filter(Boolean))].sort()),Et([...new Set(dt.map(O=>O.name).filter(Boolean))].sort()),mt(sn({existingCode:x.country_code||x.country,locale:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}));const Pt=(jt==null?void 0:jt[0])||null;if(_r(Pt)){Be(Pt),F(Ge?"full":"preview"),j(!0);return}const m=x.confirmed_market||(x.country_code||x.country?{country_code:x.country_code||x.country,country_name:x.country_name||"",preferred_currency:x.preferred_currency||Ht(x.currency)||an(x.country_code||x.country,x.currency)||"GBP",shipping_market:x.shipping_market||""}:null),Ot=localStorage.getItem(Nt(x.id));if(Ot){const O=JSON.parse(Ot),pt={...Zt(),...O.formData,confirmed_market:((i=O.formData)==null?void 0:i.confirmed_market)||m||null,country_code:((h=O.formData)==null?void 0:h.country_code)||((je=O.formData)==null?void 0:je.country)||(m==null?void 0:m.country_code)||"",country_name:((Le=O.formData)==null?void 0:Le.country_name)||(m==null?void 0:m.country_name)||"",preferred_currency:((Je=O.formData)==null?void 0:Je.preferred_currency)||((Ne=O.formData)==null?void 0:Ne.currency)||(m==null?void 0:m.preferred_currency)||"",shipping_market:((Te=O.formData)==null?void 0:Te.shipping_market)||(m==null?void 0:m.shipping_market)||"",country_confirmed:!!((te=O.formData)!=null&&te.country_confirmed||(ie=O.formData)!=null&&ie.country_code||m!=null&&m.country_code),preferred_product_origins:((Re=O.formData)==null?void 0:Re.preferred_product_origins)||x.preferred_product_origins||[],glowbox_only:((R=O.formData)==null?void 0:R.glowbox_only)===!0||x.glowbox_only===!0,preferred_brands:((qe=O.formData)==null?void 0:qe.preferred_brands)||x.preferred_brands||[],excluded_brands:((Ze=O.formData)==null?void 0:Ze.excluded_brands)||x.excluded_brands||[],excluded_products:((oe=O.formData)==null?void 0:oe.excluded_products)||x.excluded_products||[],active_skincare_treatments:((_e=O.formData)==null?void 0:_e.active_skincare_treatments)||x.active_skincare_treatments||[],diagnosed_skin_conditions:((P=O.formData)==null?void 0:P.diagnosed_skin_conditions)||x.diagnosed_skin_conditions||[],pregnancy_breastfeeding_status:((Me=O.formData)==null?void 0:Me.pregnancy_breastfeeding_status)||x.pregnancy_breastfeeding_status||"",lifestyle_factors:(($e=O.formData)==null?void 0:$e.lifestyle_factors)||x.lifestyle_factors||[],dietary_pattern:((xe=O.formData)==null?void 0:xe.dietary_pattern)||x.dietary_pattern||"",facial_massage_experience:((kt=O.formData)==null?void 0:kt.facial_massage_experience)||x.facial_massage_experience||"",climate:((We=O.formData)==null?void 0:We.climate)||x.climate||"",routine_budget:((ut=O.formData)==null?void 0:ut.routine_budget)||x.routine_budget||"no_preference",country:((Ue=O.formData)==null?void 0:Ue.country_code)||((Ye=O.formData)==null?void 0:Ye.country)||(m==null?void 0:m.country_code)||"",currency:((Rt=O.formData)==null?void 0:Rt.preferred_currency)||((Ct=O.formData)==null?void 0:Ct.currency)||(m==null?void 0:m.preferred_currency)||""},Tt=Ut(pt),ft=zt(Tt),He=O.phase||(Se==="photo"?"photo":"questionnaire"),qt=ft===-1;L(Tt),Q(qt?Math.min(Math.max(Number(O.currentQuestionIndex||yt-1||0),0),Ke-1):ft),ae(O.selectedFileName||""),F(He==="photo"&&!qt?"questionnaire":He),Ve(!0)}else{L(pt=>({...pt,confirmed_market:m,country_code:(m==null?void 0:m.country_code)||"",country_name:(m==null?void 0:m.country_name)||"",preferred_currency:(m==null?void 0:m.preferred_currency)||"",shipping_market:(m==null?void 0:m.shipping_market)||"",country_confirmed:!!(m!=null&&m.country_code),preferred_product_origins:x.preferred_product_origins||[],glowbox_only:x.glowbox_only===!0,preferred_brands:x.preferred_brands||[],excluded_brands:x.excluded_brands||[],excluded_products:x.excluded_products||[],active_skincare_treatments:x.active_skincare_treatments||[],diagnosed_skin_conditions:x.diagnosed_skin_conditions||[],pregnancy_breastfeeding_status:x.pregnancy_breastfeeding_status||"",lifestyle_factors:x.lifestyle_factors||[],dietary_pattern:x.dietary_pattern||"",facial_massage_experience:x.facial_massage_experience||"",climate:x.climate||"",routine_budget:x.routine_budget||"no_preference",country:(m==null?void 0:m.country_code)||"",currency:(m==null?void 0:m.preferred_currency)||""}));const O=zt(Ut({...Zt(),...x,confirmed_market:m,country_code:(m==null?void 0:m.country_code)||"",country_name:(m==null?void 0:m.country_name)||"",preferred_currency:(m==null?void 0:m.preferred_currency)||"",shipping_market:(m==null?void 0:m.shipping_market)||"",country_confirmed:!!(m!=null&&m.country_code),preferred_product_origins:x.preferred_product_origins||[],glowbox_only:x.glowbox_only===!0,preferred_brands:x.preferred_brands||[],excluded_brands:x.excluded_brands||[],excluded_products:x.excluded_products||[],active_skincare_treatments:x.active_skincare_treatments||[],diagnosed_skin_conditions:x.diagnosed_skin_conditions||[],pregnancy_breastfeeding_status:x.pregnancy_breastfeeding_status||"",lifestyle_factors:x.lifestyle_factors||[],dietary_pattern:x.dietary_pattern||"",facial_massage_experience:x.facial_massage_experience||"",climate:x.climate||"",routine_budget:x.routine_budget||"no_preference",country:(m==null?void 0:m.country_code)||"",currency:(m==null?void 0:m.preferred_currency)||""}));Q(Se==="photo"?Math.max(O,0):Math.min(Math.max(yt-1,0),Ke-1)),F(Se==="photo"&&O!==-1?"questionnaire":Se==="questionnaire"||Se==="photo"?Se:"intro")}j(!0)}catch{g(null),U(gr()),F("intro"),j(!0)}}H.useEffect(()=>{C&&F(Ge?"full":"preview")},[C,Ge]),H.useEffect(()=>{!(C!=null&&C.id)||b!=="preview"||Ft.current||(Ft.current=!0,et("preview_viewed",{source:"skin_analysis",language:p,userId:(o==null?void 0:o.id)||"",metadata:{analysis_i
67d:C.id}}))},[C==null?void 0:C.id,b,p,o==null?void 0:o.id]);const tt=()=>{pn("register"),et("create_account_clicked",{source:"skin_analysis",language:p}),window.location.assign(`/register?next=${encodeURIComponent(at)}`)},Oe=()=>{et("login_requested",{source:"skin_analysis",language:p}),window.location.assign(`/login?next=${encodeURIComponent(at)}`)},Xe=()=>{o!=null&&o.id&&localStorage.setItem(Nt(o.id),JSON.stringify({phase:b,currentQuestionIndex:k,formData:ge,selectedFileName:fe})),s("/",{replace:!0})},lt=()=>{if(!rr(k,ge)){se(A.validation);return}if(se(""),k===Ke-1){vt&&et("questionnaire_completed",{source:"skin_analysis",language:p,userId:(o==null?void 0:o.id)||""}),vr("glowbox_questionnaire_completed",{userId:(o==null?void 0:o.id)||""},{onceKey:`questionnaire-complete-${(o==null?void 0:o.id)||"guest"}`}),F("photo");return}Q(i=>i+1)},ve=()=>{if(se(""),b==="photo"){F("questionnaire"),Q(Ke-1);return}Q(i=>Math.max(i-1,0))},Lt=async i=>{const{file_uri:h}=await we.integrations.Core.UploadPrivateFile({file:i}),{signed_url:je}=await we.integrations.Core.CreateFileSignedUrl({file_uri:h,expires_in:Nr});return{file_uri:h,signed_url:je}},xt=()=>{Z==null||Z.getTracks().forEach(i=>i.stop()),he(null)},bt=async()=>{if(!ne){G("");try{const i=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"user",width:{ideal:1280},height:{ideal:1280}}});he(i)}catch{G(A.cameraError)}}},wt=async()=>{const i=Ie.current;if(!(i!=null&&i.videoWidth)||!(i!=null&&i.videoHeight)){G(A.cameraError);return}const h=document.createElement("canvas");h.width=i.videoWidth,h.height=i.videoHeight;const je=h.getContext("2d");je.translate(h.width,0),je.scale(-1,1),je.drawImage(i,0,0,h.width,h.height),G(""),se(""),ue(""),Pe(!0);try{const Le=await new Promise((Te,te)=>h.toBlob(ie=>ie?Te(ie):te(new Error("Unable to capture photo")),"image/jpeg",.94)),Je=new File([Le],`glowbox-live-${Date.now()}.jpg`,{type:"image/jpeg",lastModified:Date.now()}),Ne=await Lt(Je);L(Te=>({...Te,photo_url:Ne.signed_url,private_photo_uri:Ne.file_uri})),ae(p==="pt"?"Foto tirada agora":"Photo taken now"),xt()}catch(Le){G((Le==null?void 0:Le.message)||A.photoValidation)}finally{Pe(!1)}},rt=()=>{L(i=>({...i,photo_url:"",private_photo_uri:"",photo_preparation_confirmed:!1})),ae(""),G("")},ct=async()=>{var h,je,Le,Je,Ne,Te,te;if(o!=null&&o.id&&!Ge){const ie=await we.entities.SkinAnalysis.filter({user_id:o.id},"-created_date",1).catch(()=>[]),Re=(ie==null?void 0:ie[0])||null;if(_r(Re)){Be(Re),F("preview"),G(p==="pt"?"A análise gratuita desta conta já foi utilizada. Assine para fazer uma nova análise.":"This account has already used its free analysis. Subscribe to run a new analysis.");return}}const i=Ut(y);if(!i.facial_consent_confirmed||!i.photo_url){se(A.photoValidation);return}if(!i.photo_preparation_confirmed){se(A.preparationValidation);return}if(!Hn(i)){F("questionnaire"),Q(Math.max(zt(i),0)),G(A.validation);return}L(i),o!=null&&o.id&&localStorage.setItem(Nt(o.id),JSON.stringify({phase:b,currentQuestionIndex:k,formData:i,selectedFileName:fe})),G(""),se(""),Pe(!0),et("photo_submitted",{source:"skin_analysis",language:p,userId:(o==null?void 0:o.id)||"",metadata:{capture_method:"live_camera"}});try{ue(A.safetyChecking);const ie=await we.functions.invoke("validateSkinAnalysisImage",{imageUrl:i.photo_url,imageId:`skin-analysis-${Date.now()}`}),Re=(ie==null?void 0:ie.data)||ie||{};if(!Re.allowed){Re.accountRestricted&&ke(!0),G(p==="pt"?Re.messagePt||A.faceValidation:Re.messageEn||A.faceValidation),L(xe=>({...xe,photo_url:"",private_photo_uri:"",photo_preparation_confirmed:!1})),ae("");return}ue(p==="pt"?"Verificando a qualidade da fotoâ¦":"Checking photo qualityâ¦");const R=await In({imageUrl:i.photo_url,expectedAngle:"front",language:p,onStageChange:xe=>ue(xe||"Checking photo qualityâ¦")});if(R.processing_status!=="geometry_ready"||!R.landmarks||((h=R.quality_validation)==null?void 0:h.face_count)!==1){const xe=(je=R.quality_validation)==null?void 0:je.user_guidance;G(Array.isArray(xe)&&xe.length?xe.join(" "):A.faceValidation);return}et("photo_validated",{source:"skin_analysis",language:p,userId:(o==null?void 0:o.id)||"",metadata:{face_count:((Le=R.quality_validation)==null?void 0:Le.face_count)||1,processing_status:R.processing_status}});const qe=await Un({userId:o.id,imageId:i.private_photo_uri||`front-${Date.now()}`,imageAngle:"front",originalImageReference:{storage_type:"private_file",file_uri:i.private_photo_uri,image_width:((Je=R.image_meta)==null?void 0:Je.width)||0,image_height:((Ne=R.image_meta)==null?void 0:Ne.height)||0},qualityValidation:R.quality_validation,landmarks:R.landmarks,facialRegions:R.facial_regions,geometryVersion:R.geometry_version,generatedAt:new Date().toISOString(),modelOrMethod:R.model_or_method,processingStatus:R.processing_status});ue("Analyzing photoâ¦");const Ze=await we.integrations.Core.InvokeLLM({prompt:`You are GlowBox AI. Analyze this real face photo for skincare guidance in ${Sr({userLanguage:p})}. Use only visible evidence. Return only JSON.`,file_urls:[i.photo_url],response_json_schema:{type:"object",properties:{overall_skin_health_score:{type:"number"},diagnostic_summary:{type:"string"},detected_concerns:{type:"array",items:{type:"string"}},not_detected_findings:{type:"array",items:{type:"string"}},confidence_scores:{type:"object"},trait_assessment:{type:"object"},skin_texture:{type:"string"},hydration_level:{type:"string"},problem_areas:{type:"array",items:{type:"object",properties:{area:{type:"string"},issue:{type:"string"},severity:{type:"string"}}}},personalized_recommendations:{type:"array",items:{type:"string"}}}}});ue("Building your resultâ¦");const oe=await we.integrations.Core.InvokeLLM({prompt:Wn({formData:i,photoAnalysis:Ze,language:p}),response_json_schema:{type:"object",properties:{diagnosis:{type:"object"},skin_profile:{type:"object"}
67,personalized_routine:{type:"object"},ingredients:{type:"object"},evolution_plan:{type:"object"},premium_notes:{type:"array",items:{type:"string"}},treatment_plan:{type:"object"},internal_skin_profile:{type:"object"}}}}),_e={questionnaire_version:"public_flow_v1",quiz_answers:i,diagnosis:oe.diagnosis||{},skin_profile:oe.skin_profile||{},personalized_routine:oe.personalized_routine||{},ingredients:oe.ingredients||{},evolution_plan:oe.evolution_plan||{},premium_notes:oe.premium_notes||[],treatment_plan:oe.treatment_plan||{},internal_skin_profile:oe.internal_skin_profile||{},privacy:{consent_version:Vn,consent_accepted_at:i.facial_consent_accepted_at,face_image_used:!0,storage_mode:"private",signed_url_ttl_seconds:Nr,private_photo_uri:i.private_photo_uri},flow:{questionnaire_completed:!0,photo_uploaded:!0,processing_completed:!0,saved_successfully:!0}},P=$n(i),Me=await we.entities.SkinAnalysis.create({user_id:o.id,skin_type:i.skin_type==="not_sure"?"normal":i.skin_type,concerns:P,age_range:"26-35",allergies:i.allergy_details?[i.allergy_details]:[],disliked_ingredients:[],sensitivity_level:Ar(i.sensitivity_level),sensitivity_triggers:i.reaction_history==="known_allergies"&&i.allergy_details?[i.allergy_details]:[],current_routine:{has_routine:i.current_routine_level!=="no_routine",products_used:i.current_products,frequency:zn(i.current_routine_level),routine_preference:Gn(i.current_routine_level)},goals:i.skin_goals,active_skincare_treatments:i.active_skincare_treatments,diagnosed_skin_conditions:i.diagnosed_skin_conditions,pregnancy_breastfeeding_status:i.pregnancy_breastfeeding_status,lifestyle_factors:i.lifestyle_factors,dietary_pattern:i.dietary_pattern,facial_massage_experience:i.facial_massage_experience,climate:i.climate,lifestyle:{sleep_hours:i.sleep_hours,water_intake:Dn(i.water_cups),stress_level:i.stress_level,sun_exposure:i.sun_exposure_level,sunscreen_frequency:i.sunscreen_frequency},analysis_result:_e,holistic_insights:{lifestyle_impact:((Te=oe.diagnosis)==null?void 0:Te.summary)||"",recommendations:oe.premium_notes||[],personalized_routine:oe.personalized_routine||{},safety_alerts:((te=oe.diagnosis)==null?void 0:te.safety_alerts)||[]},photo_url:null,photos:null,ai_photo_analysis:Ze,facial_region_map:null,analysis_date:new Date().toISOString()}),$e=fn({id:Me.id,ai_photo_analysis:Ze,analysis_result:_e},{sourceAnalysisId:Me.id});await we.entities.SkinAnalysis.update(Me.id,{facial_region_map:$e}),qe!=null&&qe.id&&await Bn([qe.id],Me.id),await we.auth.updateMe(hn({onboarding_completed:!0,skin_type:i.skin_type==="not_sure"?"normal":i.skin_type,skin_concerns_user_reported:i.skin_concerns_user_reported,sensitivity_level:Ar(i.sensitivity_level),reacts_easily:i.sensitivity_level,allergy_status:i.reaction_history==="known_allergies"?"yes":"no",previous_reaction_status:i.reaction_history==="never"?"no":"yes",confirmed_allergies:i.allergy_details?[i.allergy_details]:[],active_skincare_treatments:i.active_skincare_treatments,diagnosed_skin_conditions:i.diagnosed_skin_conditions,lifestyle_factors:i.lifestyle_factors,dietary_pattern:i.dietary_pattern,facial_massage_experience:i.facial_massage_experience,climate:i.climate,prescription_skincare_active:i.active_skincare_treatments.some(xe=>["prescription_retinoid","oral_isotretinoin","other_prescription"].includes(xe)),prescription_skincare_notes:i.active_skincare_treatments.join(", "),pregnancy_breastfeeding_status:i.pregnancy_breastfeeding_status,smoking_status:i.lifestyle_factors.includes("smoking")||i.lifestyle_factors.includes("vaping")?"yes":"no",alcohol_consumption:i.lifestyle_factors.includes("alcohol")?"yes":"no",confirmed_market:i.confirmed_market,country:i.country_code||i.country,country_code:i.country_code||i.country,country_name:i.country_name,preferred_currency:Ht(i.preferred_currency||i.currency)||"GBP",shipping_market:i.shipping_market,preferred_product_origins:i.preferred_product_origins,glowbox_only:i.glowbox_only,preferred_brands:i.preferred_brands,excluded_brands:i.excluded_brands,excluded_products:i.excluded_products,routine_budget:i.routine_budget,currency:Ht(i.preferred_currency||i.currency)||"GBP",primary_skin_goal:i.skin_goals[0]||i.skin_concerns_user_reported[0]||"",profile_last_updated:new Date().toISOString()},o)),localStorage.removeItem(Nt(o.id)),Be({...Me,facial_region_map:$e}),vr("glowbox_analysis_processed",{userId:o.id,usedPhoto:!0},{onceKey:`analysis-processed-${Me.id}`}),vt&&et("analysis_processed",{source:"skin_analysis",language:p,userId:o.id})}
67catch(ie){G((ie==null?void 0:ie.message)||"Unable to process your analysis right now.")}finally{Pe(!1),ue("")}},Fe=H.useMemo(()=>k===0?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.skinType.map(i=>l.jsx(ce,{label:pe(I.skinTypeLabel,i,p),selected:y.skin_type===i,onClick:()=>L(h=>({...h,skin_type:i}))},i))}):k===1?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.concerns.map(i=>l.jsx(ce,{label:i,selected:y.skin_concerns_user_reported.includes(i),onClick:()=>L(h=>({...h,skin_concerns_user_reported:_t(h.skin_concerns_user_reported,i)}))},i))}):k===2?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.sensitivity.map(i=>l.jsx(ce,{label:pe(I.sensitivityLabel,i,p),selected:y.sensitivity_level===i,onClick:()=>L(h=>({...h,sensitivity_level:i}))},i))}):k===3?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.acneFrequency.map(i=>l.jsx(ce,{label:pe(I.acneFrequencyLabel,i,p),selected:y.acne_frequency===i,onClick:()=>L(h=>({...h,acne_frequency:i}))},i))}):k===4?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.darkSpots.map(i=>l.jsx(ce,{label:pe(I.darkSpotsLabel,i,p),selected:y.dark_spots_level===i,onClick:()=>L(h=>({...h,dark_spots_level:i}))},i))}):k===5?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.routineLevel.map(i=>l.jsx(ce,{label:pe(I.routineLevelLabel,i,p),selected:y.current_routine_level===i,onClick:()=>L(h=>({...h,current_routine_level:i}))},i))}):k===6?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.products.map(i=>l.jsx(ce,{label:i,selected:y.current_products.includes(i),onClick:()=>L(h=>({...h,current_products:_t(h.current_products,i,["None"])}))},i))}):k===7?l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.reactionHistory.map(i=>l.jsx(ce,{label:pe(I.reactionHistoryLabel,i,p),selected:y.reaction_history===i,onClick:()=>L(h=>({...h,reaction_history:i}))},i))}),y.reaction_history==="known_allergies"?l.jsxs("div",{children:[l.jsx(gt,{className:"text-sm text-[#111111]",children:A.q8Details}),l.jsx(ln,{value:y.allergy_details,onChange:i=>L(h=>({...h,allergy_details:i.target.value}
67)),className:"mt-2 min-h-[120px] rounded-2xl border-[#EBD6DD]"})]}):null]}):k===8?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.goals.map(i=>l.jsx(ce,{label:i,selected:y.skin_goals.includes(i),onClick:()=>L(h=>({...h,skin_goals:_t(h.skin_goals,i)}))},i))}):k===9?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.activeTreatments.map(i=>l.jsx(ce,{label:pe(I.activeTreatmentsLabel,i,p),selected:y.active_skincare_treatments.includes(i),onClick:()=>L(h=>({...h,active_skincare_treatments:_t(h.active_skincare_treatments,i,["none"])}))},i))}):k===10?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.diagnosedConditions.map(i=>l.jsx(ce,{label:pe(I.diagnosedConditionsLabel,i,p),selected:y.diagnosed_skin_conditions.includes(i),onClick:()=>L(h=>({...h,diagnosed_skin_conditions:_t(h.diagnosed_skin_conditions,i,["none","prefer_not_to_say"])}))},i))}):k===11?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.pregnancyStatus.map(i=>l.jsx(ce,{label:pe(I.pregnancyStatusLabel,i,p),selected:y.pregnancy_breastfeeding_status===i,onClick:()=>L(h=>({...h,pregnancy_breastfeeding_status:i}))},i))}):k===12?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.lifestyleFactors.map(i=>l.jsx(ce,{label:pe(I.lifestyleFactorsLabel,i,p),selected:y.lifestyle_factors.includes(i),onClick:()=>L(h=>({...h,lifestyle_factors:_t(h.lifestyle_factors,i,["none","prefer_not_to_say"])}))},i))}):k===13?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.dietaryPatterns.map(i=>l.jsx(ce,{label:pe(I.dietaryPatternsLabel,i,p),selected:y.dietary_pattern===i,onClick:()=>L(h=>({...h,dietary_pattern:i}))},i))}):k===14?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.facialMassage.map(i=>l.jsx(ce,{label:pe(I.facialMassageLabel,i,p),selected:y.facial_massage_experience===i,onClick:()=>L(h=>({...h,facial_massage_experience:i}))},i))}):k===15?l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.climates.map(i=>l.jsx(ce,{label:pe(I.climatesLabel,i,p),selected:y.climate===i,onClick:()=>L(h=>({...h,climate:i}))},i))}):k===16?l.jsx(gn,{value:y,suggestedCountry:ye,language:p,onChange:i=>L(h=>({...h,...i}))}):k===17?l.jsx(_n,{preferredBrands:y.preferred_brands||[],excludedBrands:y.excluded_brands||[],excludedProducts:y.excluded_products||[],brandSuggestions:it,productSuggestions:st,language:p,onChange:i=>L(h=>({...h,...i,brand_preferences_answered:!0}))}):k===18?l.jsx(mn,{currency:y.preferred_currency||y.currency||"USD",value:y.routine_budget||"no_preference",onChange:i=>L(h=>({...h,routine_budget:i}))}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx(gt,{className:"mb-2 block text-sm text-[#111111]",children:A.water}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.water.map(i=>l.jsx(ce,{label:pe(I.waterLabel,i,p),selected:ge.water_cups===i,onClick:()=>L(h=>({...h,water_cups:i}))},i))})]}),l.jsxs("div",{children:[l.jsx(gt,{className:"mb-2 block text-sm text-[#111111]",children:A.sleep}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.sleep.map(i=>l.jsx(ce,{label:pe(I.sleepLabel,i,p),selected:Lr(ge.sleep_hours)===xr(i),onClick:()=>L(h=>({...h,sleep_hours:xr(i)}))},i))})]}),l.jsxs("div",{children:[l.jsx(gt,{className:"mb-2 block text-sm text-[#111111]",children:A.stress}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.stress.map(i=>l.jsx(ce,{label:pe(I.stressLabel,i,p),selected:ge.stress_level===i,onClick:()=>L(h=>({...h,stress_level:i}))},i))})]}),l.jsxs("div",{children:[l.jsx(gt,{className:"mb-2 block text-sm text-[#111111]",children:A.sun}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.sun.map(i=>l.jsx(ce,{label:pe(I.sunLabel,i,p),selected:ge.sun_exposure_level===i,onClick:()=>L(h=>({...h,sun_exposure_level:i}))},i))})]}),l.jsxs("div",{children:[l.jsx(gt,{className:"mb-2 block text-sm text-[#111111]",children:A.sunscreen}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:I.sunscreen.map(i=>l.jsx(ce,{label:pe(I.sunscreenLabel,i,p),selected:ge.sunscreen_frequency===i,onClick:()=>L(h=>({...h,sunscreen_frequency:i}))},i))})]})]}),[it,k,y,p,ge,st,ye,A]);return!_||o&&Dt?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsx(Kt,{className:"h-8 w-8 animate-spin text-[#E91E63]"})}):o?C?l.jsx("div",{className:"min-h-screen bg-white px-4 py-10 md:px-6 md:py-14",children:l.jsx("div",{className:"mx-auto max-w-7xl",children:Ge?l.jsx(cn,{analysis:C,language:p,onViewRoutines:()=>s("/OfficialRoutine"),onRefineRecommendations:()=>s("/Profile?section=skincare"),onShopRecommendations:()=>s("/Shop?personalized=1&source=skin-analysis"),onSurpriseBox:()=>s("/MyBox?mode=surprise&source=skin-analysis"),onRetake:()=>{Be(null),F("questionnaire"),Q(0)}}):l.jsx(un,{analysis:C,language:p,isAuthenticated:!0,onUnlock:()=>s("/Subscriptions?next=/SkinAnalysis")})})}):q&&!y.photo_url?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsx(Kt,{className:"h-8 w-8 animate-spin text-[#E91E63]"})}):q&&y.photo_url?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[linear-gradient(180deg,#fff_0%,#fff8fb_45%,#fff_100%)] px-4",children:l.jsxs(Bt,{className:"max-w-md border border-[#
67E91E63]/10 bg-white p-8 text-center shadow-[0_24px_80px_rgba(17,17,17,0.08)]",children:[l.jsx(Kt,{className:"mx-auto h-12 w-12 animate-spin text-[#E91E63]"}),l.jsx("h1",{className:"mt-4 text-2xl font-semibold text-[#111111]",children:A.processing}),l.jsx("p",{className:"mt-3 text-sm text-[#2D2D2D]/65",children:re||A.processingDetail})]})}):b==="intro"?l.jsx(br,{language:p,isAuthenticated:!0,onCreateAccount:tt,onLogin:Oe,onContinue:()=>F("questionnaire")}):b==="photo"?l.jsx("div",{className:"min-h-screen bg-[linear-gradient(180deg,#fff_0%,#fff8fb_45%,#fff_100%)] px-4 py-10 pb-28",children:l.jsx("div",{className:"mx-auto max-w-4xl space-y-6",children:l.jsxs(Bt,{className:"border border-[#E91E63]/10 bg-white p-6 shadow-[0_24px_80px_rgba(17,17,17,0.08)] md:p-8",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium uppercase tracking-[0.18em] text-[#E91E63]",children:`${Ke}/${Ke}`}),l.jsx("h1",{className:"mt-2 text-3xl font-semibold text-[#111111]",children:A.photoTitle}),l.jsx("p",{className:"mt-3 text-sm leading-7 text-[#2D2D2D]/68",children:A.photoBody}),l.jsx("ul",{className:"mt-4 grid gap-2 text-sm text-[#2D2D2D]/75 sm:grid-cols-2",children:A.photoChecklist.map(i=>l.jsxs("li",{className:"flex gap-2",children:[l.jsx("span",{className:"font-bold text-[#E91E63]",children:"â"}),l.jsx("span",{children:i})]},i))})]}),l.jsx(Ee,{variant:"outline",onClick:ve,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111]",children:A.back})]}),l.jsxs("div",{className:"mt-6 space-y-3 rounded-2xl border border-[#EBD6DD] bg-[#FFF8FB] p-4",children:[l.jsxs("label",{className:"flex items-start gap-3 text-sm text-[#111111]",children:[l.jsx("input",{type:"checkbox",checked:y.photo_preparation_confirmed,onChange:i=>L(h=>({...h,photo_preparation_confirmed:i.target.checked})),className:"mt-1"}),l.jsx("span",{children:A.preparationConsent})]}),l.jsxs("label",{className:"flex items-start gap-3 text-sm text-[#111111]",children:[l.jsx("input",{type:"checkbox",checked:y.facial_consent_confirmed,onChange:i=>L(h=>({...h,facial_consent_confirmed:i.target.checked,facial_consent_accepted_at:i.target.checked?new Date().toISOString():""})),className:"mt-1"}),l.jsx("span",{children:A.consent})]})]}),!y.photo_url&&!Z?l.jsx("div",{className:"mt-6 flex justify-center",children:l.jsxs(Ee,{type:"button",variant:"outline",disabled:ne||q,onClick:bt,className:"h-14 w-full max-w-sm rounded-2xl border-[#
67E91E63]/20 bg-white text-[#111111]",children:[l.jsx(mr,{className:"mr-2 h-4 w-4"}),A.takePhoto]})}):null,!y.photo_url&&Z?l.jsxs("div",{className:"mt-6 space-y-4",children:[l.jsx("video",{ref:Ie,autoPlay:!0,playsInline:!0,muted:!0,className:"mx-auto aspect-square w-full max-w-sm -scale-x-100 rounded-3xl bg-black object-cover shadow-sm"}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-center",children:[l.jsxs(Ee,{type:"button",disabled:q,onClick:wt,className:"rounded-xl bg-[#E91E63] px-6 text-white hover:bg-[#d81b60]",children:[l.jsx(mr,{className:"mr-2 h-4 w-4"}),A.capturePhoto]}),l.jsx(Ee,{type:"button",variant:"outline",disabled:q,onClick:xt,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111]",children:A.cancelCamera})]})]}):null,y.photo_url?l.jsxs("div",{className:"mt-6 space-y-4",children:[l.jsx("img",{src:y.photo_url,alt:"Selected face",className:"mx-auto h-80 w-full max-w-sm rounded-3xl object-cover shadow-sm"}),fe?l.jsx("p",{className:"text-center text-sm text-[#2D2D2D]/60",children:fe}):null,l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-center",children:[l.jsxs(Ee,{type:"button",disabled:ne||q||!y.photo_preparation_confirmed||!y.facial_consent_confirmed,onClick:ct,className:"rounded-xl bg-[#E91E63] px-6 text-white hover:bg-[#d81b60]",children:[A.usePhoto,l.jsx(yr,{className:"ml-2 h-4 w-4"})]}),l.jsx(Ee,{type:"button",variant:"outline",onClick:rt,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111]",children:A.chooseAnother})]})]}):null,ee?l.jsx("p",{className:"mt-4 rounded-2xl border border-[#F4C6D6] bg-[#FFF1F6] px-4 py-3 text-sm text-[#B42318]",children:ee}):null,J?l.jsxs("div",{className:"mt-4 rounded-2xl border border-[#F4C6D6] bg-[#FFF1F6] px-4 py-3 text-sm text-[#B42318]",children:[J,ne?null:l.jsx("div",{className:"mt-3",children:l.jsx(Ee,{type:"button",variant:"outline",onClick:y.photo_url?ct:bt,className:"rounded-xl",children:A.retry})})]}):null,l.jsx("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:justify-between",children:l.jsx(Ee,{type:"button",variant:"outline",onClick:Xe,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111]",children:A.saveLater})})]})})}):l.jsx("div",{className:"min-h-screen bg-[linear-gradient(180deg,#fff_0%,#fff8fb_45%,#fff_100%)] px-4 py-10 pb-28 md:px-6 md:py-14",children:l.jsxs("div",{className:"mx-auto max-w-4xl",children:[l.jsxs("div",{className:"mb-8 text-center",children:[l.jsx("h1",{className:"text-4xl font-semibold text-[#111111] md:text-5xl",children:A.title}),l.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-sm leading-7 text-[#2D2D2D]/68",children:A.subtitle}),nt?l.jsx("p",{className:"mt-3 text-sm font-medium text-[#E91E63]",children:A.saved}):null]}),l.jsxs("div",{className:"mb-6 rounded-[2rem] border border-[#E91E63]/10 bg-white p-4 shadow-sm",children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between text-xs font-semibold uppercase tracking-[0.22em] text-[#E91E63]/70",children:[l.jsx("span",{children:`Question ${k+1} / ${Ke}`}),l.jsx("span",{children:`${Math.round((k+1)/Ke*100)}%`})]}),l.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-[#F3F4F6]",children:l.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#E91E63] to-[#FF77A8]",style:{width:`${(k+1)/Ke*100}%`}})})]}),l.jsxs(Bt,{className:"border border-[#E91E63]/10 bg-white p-6 shadow-[0_24px_80px_rgba(17,17,17,0.08)] md:p-8",children:[l.jsx("h2",{className:"text-2xl font-semibold text-[#111111]",children:Yn(k,A)}),l.jsx("div",{className:"mt-6",children:Fe}),ee?l.jsx("p",{className:"mt-6 rounded-2xl border border-[#F4C6D6] bg-[#FFF1F6] px-4 py-3 text-sm text-[#B42318]",children:ee}):null,l.jsx("div",{className:"relative z-10 mt-6 rounded-[1.5rem] border border-[#E91E63]/12 bg-white p-4 pointer-events-auto",children:l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[l.jsxs(Ee,{type:"button",variant:"outline",onClick:ve,disabled:k===0,className:"rounded-xl border-[#E91E63]/20 bg-white text-[#111111]",children:[l.jsx(dn,{className:"mr-2 h-4 w-4"}),A.back]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[l.jsx(Ee,{type:"button",variant:"outline",onClick:Xe,className:"rounded-xl border-[#
67E91E63]/20 bg-white text-[#111111]",children:A.saveLater}),l.jsxs(Ee,{type:"button",onClick:lt,disabled:!rr(k,ge),className:"w-full rounded-xl bg-[#E91E63] px-6 text-white hover:bg-[#d81b60] disabled:opacity-50 sm:w-auto",children:[A.continue,l.jsx(yr,{className:"ml-2 h-4 w-4"})]})]})]})})]})]})}):l.jsx(br,{language:p,isAuthenticated:!1,onCreateAccount:tt,onLogin:Oe,onContinue:()=>{}})}export{Xn as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.