vue-face-age
Version:
Vue.js wrapper for Face age
170 lines • 221 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.VueFaceAge = factory());
}(this, (function () { 'use strict';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var faceage = createCommonjsModule(function (module, exports) {
/*! For license information please see faceage.js.LICENSE.txt */
!function(e,t){module.exports=t();}(commonjsGlobal,(()=>(()=>{var e={135:function(e,t,n){(function(){function e(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var i=e[t];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function r(e,n){if(n)e:{var r=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in r))break e;r=r[a];}(n=n(o=r[e=e[e.length-1]]))!=o&&null!=n&&t(r,e,{configurable:!0,writable:!0,value:n});}}function o(e){return (e={next:e})[Symbol.iterator]=function(){return this},e}function a(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}function s(){this.i=!1,this.g=null,this.o=void 0,this.j=1,this.m=0,this.h=null;}function l(e){if(e.i)throw new TypeError("Generator is already running");e.i=!0;}function c(e,t){e.h={F:t,G:!0},e.j=e.m;}function u(e){this.g=new s,this.h=e;}function h(e,t,n,i){try{var r=t.call(e.g.g,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.i=!1,r;var o=r.value;}catch(t){return e.g.g=null,c(e.g,t),d(e)}return e.g.g=null,i.call(e.g,o),d(e)}function d(e){for(;e.g.j;)try{var t=e.h(e.g);if(t)return e.g.i=!1,{value:t.value,done:!1}}catch(t){e.g.o=void 0,c(e.g,t);}if(e.g.i=!1,e.g.h){if(t=e.g.h,e.g.h=null,t.G)throw t.F;return {value:t.return,done:!0}}return {value:void 0,done:!0}}function p(e){this.next=function(t){return l(e.g),e.g.g?t=h(e,e.g.g.next,t,e.g.l):(e.g.l(t),t=d(e)),t},this.throw=function(t){return l(e.g),e.g.g?t=h(e,e.g.g.throw,t,e.g.l):(c(e.g,t),t=d(e)),t},this.return=function(t){return function(e,t){l(e.g);var n=e.g.g;return n?h(e,"return"in n?n.return:function(e){return {value:e,done:!0}},t,e.g.return):(e.g.return(t),d(e))}(e,t)},this[Symbol.iterator]=function(){return this};}function f(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(i,r){!function e(o){o.done?i(o.value):Promise.resolve(o.value).then(t,n).then(e,r);}(e.next());}))}r("Symbol",(function(e){function n(e,n){this.g=e,t(this,"description",{configurable:!0,writable:!0,value:n});}if(e)return e;n.prototype.toString=function(){return this.g};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",r=0;return function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new n(i+(t||"")+"_"+r++,t)}})),r("Symbol.iterator",(function(n){if(n)return n;n=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<r.length;a++){var s=i[r[a]];"function"==typeof s&&"function"!=typeof s.prototype[n]&&t(s.prototype,n,{configurable:!0,writable:!0,value:function(){return o(e(this))}});}return n})),s.prototype.l=function(e){this.o=e;},s.prototype.return=function(e){this.h={return:e},this.j=this.m;},r("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject);}catch(e){t.reject(e);}}function n(){this.g=null;}function r(e){return e instanceof t?e:new t((function(t){t(e);}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l();}));}this.g.push(e);};var o=i.setTimeout;n.prototype.i=function(e){o(e,0);},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n();}catch(e){this.j(e);}}}this.g=null;},n.prototype.j=function(e){this.i((function(){throw e}));},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i));}}var t=this,n=!1;return {resolve:e(this.A),reject:e(this.l)}},t.prototype.A=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.C(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1;}n?this.v(e):this.m(e);}},t.prototype.v=function(e){var t=void 0;try{t=e.then;}catch(e){return void this.l(e)}"function"==typeof t?this.D(t,e):this.m(e);},t.prototype.l=function(e){this.u(2,e);},t.prototype.m=function(e){this.u(1,e);},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.B(),this.H();},t.prototype.B=function(){var e=this;o((function(){if(e.I()){var t=i.console;void 0!==t&&t.error(e.i);}}),1);},t.prototype.I=function(){if(this.o)return !1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.H=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null;}};var s=new n;return t.prototype.C=function(e){var t=this.j();e.s(t.resolve,t.reject);},t.prototype.D=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject);}catch(e){n.reject(e);}},t.prototype.then=function(e,n){function i(e,t){return "function"==typeof e?function(t){try{r(e(t));}catch(e){o(e);}}:t}var r,o,a=new t((function(e,t){r=e,o=t;}));return this.s(i(e,r),i(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.s=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?s.h(n):this.g.push(n),this.o=!0;},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e);}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).s(t,n);}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--s&&e(a);}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).s(o(a.length-1),t),i=n.next();}while(!i.done)}))},t}));var g="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);}return e};r("Object.assign",(function(e){return e||g}));var m=this||self,v={facingMode:"user",width:640,height:480};function y(e,t){this.video=e,this.i=0,this.h=Object.assign(Object.assign({},v),t);}function b(e){window.requestAnimationFrame((function(){!function(e){var t=null;e.video.paused||e.video.currentTime===e.i||(e.i=e.video.currentTime,t=e.h.onFrame()),t?t.then((function(){b(e);})):b(e);}(e);}));}y.prototype.stop=function(){var e,t,n,i=this;return f(new p(new u((function(r){if(i.g){for(e=i.g.getTracks(),t=a(e),n=t.next();!n.done;n=t.next())n.value.stop();i.g=void 0;}r.j=0;}))))},y.prototype.start=function(){var e,t=this;return f(new p(new u((function(n){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||alert("No navigator.mediaDevices.getUserMedia exists."),e=t.h,n.return(navigator.mediaDevices.getUserMedia({video:{facingMode:e.facingMode,width:e.width,height:e.height}}).then((function(e){!function(e,t){e.g=t,e.video.srcObject=t,e.video.onloadedmetadata=function(){e.video.play(),b(e);};}(t,e);})).catch((function(e){var t="Failed to acquire camera feed: "+e;throw console.error(t),alert(t),e})))}))))};var w,x=["Camera"],C=m;x[0]in C||void 0===C.execScript||C.execScript("var "+x[0]);for(;x.length&&(w=x.shift());)x.length||void 0===y?C=C[w]&&C[w]!==Object.prototype[w]?C[w]:C[w]={}:C[w]=y;}).call(this);},982:function(e,t,n){(function(){var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var i,r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},o=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var i=e[t];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function a(e,t){if(t)e:{var n=o;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in n))break e;n=n[a];}(t=t(i=n[e=e[e.length-1]]))!=i&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t});}}function s(e){return (e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n;}return e}if(a("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t});}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<n.length;i++){var a=o[n[i]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(t(this))}});}return e})),"function"==typeof Object.setPrototypeOf)i=Object.setPrototypeOf;else{var u;e:{var h={};try{h.__proto__={a:!0},u=h.a;break e}catch(e){}u=!1;}i=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null;}var d=i;function p(){this.l=!1,this.h=null,this.j=void 0,this.g=1,this.s=this.m=0,this.i=null;}function f(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0;}function g(e,t){e.i={K:t,L:!0},e.g=e.m||e.s;}function m(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new p,this.h=e;}function y(e,t,n,i){try{var r=t.call(e.g.h,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.g.l=!1,r;var o=r.value;}catch(t){return e.g.h=null,g(e.g,t),b(e)}return e.g.h=null,i.call(e.g,o),b(e)}function b(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(t){e.g.j=void 0,g(e.g,t);}if(e.g.l=!1,e.g.i){if(t=e.g.i,e.g.i=null,t.L)throw t.K;return {value:t.return,done:!0}}return {value:void 0,done:!0}}function w(e){this.next=function(t){return f(e.g),e.g.h?t=y(e,e.g.h.next,t,e.g.o):(e.g.o(t),t=b(e)),t},this.throw=function(t){return f(e.g),e.g.h?t=y(e,e.g.h.throw,t,e.g.o):(g(e.g,t),t=b(e)),t},this.return=function(t){return function(e,t){f(e.g);var n=e.g.h;return n?y(e,"return"in n?n.return:function(e){return {value:e,done:!0}},t,e.g.return):(e.g.return(t),b(e))}(e,t)},this[Symbol.iterator]=function(){return this};}function x(e,t){return t=new w(new v(t)),d&&e.prototype&&d(t,e.prototype),t}p.prototype.o=function(e){this.j=e;},p.prototype.return=function(e){this.i={return:e},this.g=this.s;};var C="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var i=arguments[n];if(i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);}return e};a("Object.assign",(function(e){return e||C})),a("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject);}catch(e){t.reject(e);}}function n(){this.g=null;}function i(e){return e instanceof t?e:new t((function(t){t(e);}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l();}));}this.g.push(e);};var r=o.setTimeout;n.prototype.i=function(e){r(e,0);},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n();}catch(e){this.j(e);}}}this.g=null;},n.prototype.j=function(e){this.i((function(){throw e}));},t.prototype.j=function(){function e(e){return function(i){n||(n=!0,e.call(t,i));}}var t=this,n=!1;return {resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.I(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1;}n?this.C(e):this.m(e);}},t.prototype.C=function(e){var t=void 0;try{t=e.then;}catch(e){return void this.l(e)}"function"==typeof t?this.J(t,e):this.m(e);},t.prototype.l=function(e){this.s(2,e);},t.prototype.m=function(e){this.s(1,e);},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.H(),this.A();},t.prototype.H=function(){var e=this;r((function(){if(e.B()){var t=o.console;void 0!==t&&t.error(e.i);}}),1);},t.prototype.B=function(){if(this.o)return !1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null;}};var a=new n;return t.prototype.I=function(e){var t=this.j();e.F(t.resolve,t.reject);},t.prototype.J=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject);}catch(e){n.reject(e);}},t.prototype.then=function(e,n){function i(e,t){return "function"==typeof e?function(t){try{r(e(t));}catch(e){o(e);}}:t}var r,o,a=new t((function(e,t){r=e,o=t;}));return this.F(i(e,r),i(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.F=function(e,t){function n(){switch(i.h){case 1:e(i.i);break;case 2:t(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(n):this.g.push(n),this.o=!0;},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e);}))},t.race=function(e){return new t((function(t,n){for(var r=l(e),o=r.next();!o.done;o=r.next())i(o.value).F(t,n);}))},t.all=function(e){var n=l(e),r=n.next();return r.done?i([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--s&&e(a);}}var a=[],s=0;do{a.push(void 0),s++,i(r.value).F(o(a.length-1),t),r=n.next();}while(!r.done)}))},t})),a("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return {value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r}(this,(function(e){return e}))}}));var k=this||self;function S(e,t){e=e.split(".");var n,i=k;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=t;}function E(e,t){var n=void 0;return new(n||(n=Promise))((function(i,r){function o(e){try{s(t.next(e));}catch(e){r(e);}}function a(e){try{s(t.throw(e));}catch(e){r(e);}}function s(e){e.done?i(e.value):new n((function(t){t(e.value);})).then(o,a);}s((t=t.apply(e,void 0)).next());}))}var B=[[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]],R=[[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]],O=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],_=[[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]],j=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],T=[[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]],P=[].concat(c(B),c(R),c(O),c(_),c(j),c(T));function L(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function A(e,t){this.g=e,this.i=t,this.j=0;}function I(e,t){var n=e.i;if(void 0===e.l){var i=L(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),r=L(n,"\n precision highp float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,i),n.attachShader(o,r),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));i=e.l=o,n.useProgram(i),r=n.getUniformLocation(i,"sampler0"),e.h={v:n.getAttribLocation(i,"aVertex"),u:n.getAttribLocation(i,"aTex"),M:r},e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.h.v),n.vertexAttribPointer(e.h.v,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.m=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.m),n.enableVertexAttribArray(e.h.u),n.vertexAttribPointer(e.h.u,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(r,0);}i=e.h,n.useProgram(e.l),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.g.bindTexture2d(t.glName),n.enableVertexAttribArray(i.v),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(i.v,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(i.u),n.bindBuffer(n.ARRAY_BUFFER,e.m),n.vertexAttribPointer(i.u,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(i.v),n.disableVertexAttribArray(i.u),n.bindBuffer(n.ARRAY_BUFFER,null),e.g.bindTexture2d(0);}function D(e){this.g=e;}var M=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 F(e,t){return t+e}function N(e,t){window[e]=t;}function H(e){for(var t=[],n=e.size(),i=0;i<n;++i){var r=e.get(i);t.push({x:r.x,y:r.y,z:r.z,visibility:r.hasVisibility?r.visibility:void 0});}return t}function z(e){for(var t=[],n=e.size(),i=0;i<n;++i){var r=e.get(i);t.push({index:r.index,score:r.score,label:r.hasLabel?r.label:void 0,displayName:r.hasDisplayName?r.displayName:void 0});}return t}function G(e,t,n){this.graph=e,this.locateFile=t,this.g=n;}function W(e){if(this.h=e,this.listeners={},this.j={},this.l={},this.s=this.D=!0,this.B=Promise.resolve(),this.locateFile=e&&e.locateFile||F,"object"==typeof window)e=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");e=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";}this.C=e;}function U(e,t,n){if(n.isNumber())return n.getNumber();if(n.isRect())return n.getRect();if(n.isLandmarks())return n.getLandmarks();if(n.isLandmarksList())return n.getLandmarksList();if(n.isClassificationsList())return n.getClassificationsList();if(n.isObjectDetectionList())return n.getObjectDetectionList();if(n.isTexture2d()){var i=e.l[t];return i||(i=new A(e.g,e.o),e.l[t]=i),I(e=i,n=n.getTexture2d()),e.i.canvas}}function Y(e,t){for(var n=t.name||"$",i=[].concat(c(t.wants)),r=new e.g.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())r.push_back(a.value);o=e.g.PacketListener.implement({onResults:function(r){return E(e,(function e(){var o,a,s,c,u,h=this;return x(e,(function(e){if(1==e.g){for(o={},a=0;a<t.wants.length;++a)o[i[a]]=r.get(a);var d;if(d=t.outs){for(var p={},f=l(Object.keys(d)),g=f.next();!g.done;g=f.next()){var v=d[g=g.value];if("string"==typeof v)p[g]=U(h,g,o[v]);else{var y=o[v.stream];if(void 0!==y){if("detection_list"===v.type){var b=y.getRectList(),w=y.getLandmarksList();y=y.getClassificationsList();var x=[];if(b)for(var C=0;C<b.size();++C){var k={boundingBox:b.get(C),landmarks:H(w.get(C)),G:z(y.get(C))};x.push(k);}p[g]=x;}else if("landmarks"===v.type)b=y.getLandmarks(),p[g]=b?H(b):void 0;else if("landmarks_list"===v.type){if(b=y.getLandmarksList()){for(w=[],y=b.size(),x=0;x<y;++x)C=b.get(x),w.push(H(C));b=w;}else b=void 0;p[g]=b;}else if("rect_list"===v.type){if(b=y.getRectList()){for(w=[],y=b.size(),x=0;x<y;++x)C=b.get(x),w.push(C);b=w;}else b=void 0;p[g]=b;}else if("classifications_list"===v.type){if(b=y.getClassificationsList()){for(w=[],y=b.size(),x=0;x<y;++x)C=b.get(x),w.push(z(C));b=w;}else b=void 0;p[g]=b;}else if("object_detection_list"===v.type){if(b=y.getObjectDetectionList()){for(w=[],y=b.size(),x=0;x<y;++x){var S=b.get(x);k=(C=w).push;for(var E=S.id,B=S.keypoints,R=[],O=B.size(),_=0;_<O;++_){var j=B.get(_);R.push({id:j.id,point3d:{x:j.point3d.x,y:j.point3d.y,z:j.point3d.z},point2d:{x:j.point2d.x,y:j.point2d.y,depth:j.point2d.depth}});}k.call(C,{id:E,keypoints:R,visibility:S.visibility});}b=w;}else b=void 0;p[g]=b;}else{if("texture"!==v.type)throw Error("Unknown output config type: '"+v.type+"'");(b=h.l[g])||(b=new A(h.g,h.o),h.l[g]=b),I(b,w=y.getTexture2d()),p[g]=b.i.canvas;}v.transform&&p[g]&&(p[g]=v.transform(p[g]));}}}d=p;}else d=o;return s=d,(c=h.listeners[n])?e=m(e,h.B,3):(e.g=0,e=void 0),e}if(u=c(s))return h.B=u,e.return(u);e.g=0;}))}))}}),e.i.attachMultiListener(r,o),r.delete();}function X(e){e=e||{},this.g=new W({locateFile:e.locateFile,files:[{url:"face_detection_solution_packed_assets_loader.js"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:{url:"face_detection.binarypb"},listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{selfieMode:{type:1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},minDetectionConfidence:{type:0,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionfrontgpu__facedetectionfrontcommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}}}});}G.prototype.toArrayBuffer=function(){return E(this,(function e(){var t,n=this;return x(e,(function(e){return 1==e.g?(n.graph.url?e=m(e,fetch(n.locateFile(n.graph.url,n.g)),3):(e.g=2,e=void 0),e):2!=e.g&&(t=e.j).body?e.return(t.arrayBuffer()):e.return(new ArrayBuffer(0))}))}))},(e=W.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return E(this,(function e(){var t=this;return x(e,(function(e){t.i&&(t.i.reset(),t.j={},t.l={}),e.g=0;}))}))},e.setOptions=function(e){if(this.h.options){for(var t=[],n=l(Object.keys(e)),i=n.next();!i.done;i=n.next()){var r=i.value;(i=this.h.options[r])&&i.graphOptionXref&&(r={valueNumber:0===i.type?e[r]:0,valueBoolean:1===i.type&&e[r]},i=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),i.graphOptionXref),r),t.push(i));}0!==t.length&&(this.s=!0,this.A=t);}},e.initialize=function(){return E(this,(function e(){var t=this;return x(e,(function(e){return 1==e.g?m(e,E(t,(function e(){var t,n,i,r,o,a,s,c,u,h=this;return x(e,(function(e){switch(e.g){case 1:return t=h,h.D?(N("createMediapipeSolutionsWasm",{locateFile:h.locateFile}),N("createMediapipeSolutionsPackedAssets",{locateFile:h.locateFile}),n=h.h.files||[],m(e,function(){return E(this,(function e(){return x(e,(function(e){switch(e.g){case 1:return e.m=2,m(e,WebAssembly.instantiate(M),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.i=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:return i=e.j,m(e,Promise.all(n.map((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),document.body.appendChild(t),new Promise((function(e){t.addEventListener("load",(function(){e();}),!1);}))}(t.locateFile(e.url,t.C)):Promise.resolve()}))),3);case 3:return r=window.createMediapipeSolutionsWasm,o=window.createMediapipeSolutionsPackedAssets,m(e,r(o),4);case 4:return h.g=e.j,h.m=document.createElement("canvas"),h.g.canvas=h.m,h.g.createContext(h.m,!0,!0,{}),h.i=new h.g.SolutionWasm,a=new G(h.h.graph,h.locateFile,h.C),m(e,h.loadGraph(a),5);case 5:if(h.h.listeners)for(s=l(h.h.listeners),c=s.next();!c.done;c=s.next())u=c.value,Y(h,u);h.D=!1,e.g=0;}}))})),2):m(e,E(t,(function e(){var t,n,i,r,o,a=this;return x(e,(function(e){if(!a.s)return e.return();if(!(t=a.m.getContext("webgl2"))&&!(t=a.m.getContext("webgl")))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();if(a.o=t,a.A){for(n=new a.g.GraphOptionChangeRequestList,i=l(a.A),r=i.next();!r.done;r=i.next())o=r.value,n.push_back(o);a.i.changeOptions(n),n.delete(),a.A=void 0;}a.s=!1,e.g=0;}))})),0)}))}))},e.loadGraph=function(e){return E(this,(function t(){var n,i=this;return x(t,(function(t){if(1==t.g)return m(t,e.toArrayBuffer(),2);n=t.j,i.i.loadGraph(n),t.g=0;}))}))},e.send=function(e,t){return E(this,(function n(){var i,r,o,a,s,c,u,h,d,p=this;return x(n,(function(n){if(1==n.g)return p.h.inputs?(i=1e3*(t||performance.now()),m(n,p.B,2)):n.return();if(3!=n.g)return m(n,p.initialize(),3);for(r=new p.g.PacketDataList,o=l(Object.keys(e)),a=o.next();!a.done;a=o.next())if(s=a.value,c=p.h.inputs[s]){e:{var f=p,g=e[s];switch(c.type){case"video":var v=f.j[c.stream];if(v||(v=new A(f.g,f.o),f.j[c.stream]=v),0===(f=v).j&&(f.j=f.g.createTexture()),g instanceof HTMLVideoElement){var y=g.videoWidth;v=g.videoHeight;}else g instanceof HTMLImageElement?(y=g.naturalWidth,v=g.naturalHeight):(y=g.width,v=g.height);v={glName:f.j,width:y,height:v},(y=f.i).canvas.width=v.width,y.canvas.height=v.height,y.activeTexture(y.TEXTURE0),f.g.bindTexture2d(f.j),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,g),f.g.bindTexture2d(0),f=v;break e;case"detections":for((v=f.j[c.stream])||(v=new D(f.g),f.j[c.stream]=v),(f=v).data||(f.data=new f.g.DetectionListData),f.data.reset(g.length),v=0;v<g.length;++v){y=g[v],f.data.setBoundingBox(v,y.boundingBox);for(var b=0;b<y.landmarks.length;++b){var w=y.landmarks[b],x=!!w.visibility;f.data.addNormalizedLandmark(v,Object.assign(Object.assign({},w),{hasVisibility:x,visibility:x?w.visibility:0}));}for(b=0;b<y.G.length;++b){x=!!(w=y.G[b]).index;var C=!!w.label,k=!!w.displayName;f.data.addClassification(v,{score:w.score,hasIndex:x,index:x?w.index:-1,hasLabel:C,label:C?w.label:"",hasDisplayName:k,displayName:k?w.displayName:""});}}f=f.data;break e;default:f={};}}switch(u=f,h=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:h,timestamp:i}));break;case"detections":(d=u).stream=h,d.timestamp=i,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}p.i.send(r),r.delete(),n.g=0;}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e;},S("Solution",W),S("OptionType",{NUMBER:0,BOOL:1,0:"NUMBER",1:"BOOL"}),(e=X.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e);},e.initialize=function(){return E(this,(function e(){var t=this;return x(e,(function(e){return m(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset();},e.send=function(e){return E(this,(function t(){var n=this;return x(t,(function(t){return m(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e);},S("FaceDetection",X),S("FACEDETECTION_LIPS",B),S("FACEDETECTION_LEFT_EYE",R),S("FACEDETECTION_LEFT_EYEBROW",O),S("FACEDETECTION_RIGHT_EYE",_),S("FACEDETECTION_RIGHT_EYEBROW",j),S("FACEDETECTION_FACE_OVAL",T),S("FACEDETECTION_CONTOURS",P),S("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]);}).call(this);},129:function(e){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i);}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){var n,r,o;n=t,r=e,o=i[e],(r=a(r))in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o;})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e));}));}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i);}}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===t?String:Number)(e)}(e,"string");return "symbol"==typeof t?t:String(t)}var s="undefined"!=typeof window&&void 0!==window.document,l=s?window:{},c=!(!s||!l.document.documentElement)&&"ontouchstart"in l.document.documentElement,u=!!s&&"PointerEvent"in l,h="cropper",d="all",p="crop",f="move",g="zoom",m="e",v="w",y="s",b="n",w="ne",x="nw",C="se",k="sw",S="".concat(h,"-crop"),E="".concat(h,"-disabled"),B="".concat(h,"-hidden"),R="".concat(h,"-hide"),O="".concat(h,"-invisible"),_="".concat(h,"-modal"),j="".concat(h,"-move"),T="".concat(h,"Action"),P="".concat(h,"Preview"),L="crop",A="move",I="none",D="crop",M="cropend",F="cropmove",N="cropstart",H="dblclick",z=u?"pointerdown":c?"touchstart":"mousedown",G=u?"pointermove":c?"touchmove":"mousemove",W=u?"pointerup pointercancel":c?"touchend touchcancel":"mouseup",U="ready",Y="resize",X="wheel",q="zoom",V="image/jpeg",J=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,$=/^data:/,K=/^data:image\/jpeg;base64,/,Q=/^img|canvas$/i,Z={viewMode:0,dragMode:L,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ee=Number.isNaN||l.isNaN;function te(e){return "number"==typeof e&&!ee(e)}var ne=function(e){return e>0&&e<1/0};function ie(e){return void 0===e}function re(e){return "object"===n(e)&&null!==e}var oe=Object.prototype.hasOwnProperty;function ae(e){if(!re(e))return !1;try{var t=e.constructor,n=t.prototype;return t&&n&&oe.call(n,"isPrototypeOf")}catch(e){return !1}}function se(e){return "function"==typeof e}var le=Array.prototype.slice;function ce(e){return Array.from?Array.from(e):le.call(e)}function ue(e,t){return e&&se(t)&&(Array.isArray(e)||te(e.length)?ce(e).forEach((function(n,i){t.call(e,n,i,e);})):re(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e);}))),e}var he=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return re(e)&&n.length>0&&n.forEach((function(t){re(t)&&Object.keys(t).forEach((function(n){e[n]=t[n];}));})),e},de=/\.\d*(?:0|9){12}\d*$/;function pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return de.test(e)?Math.round(e*t)/t:e}var fe=/^width|height|left|top|marginLeft|marginTop$/;function ge(e,t){var n=e.style;ue(t,(function(e,t){fe.test(t)&&te(e)&&(e="".concat(e,"px")),n[t]=e;}));}function me(e,t){if(t)if(te(e.length))ue(e,(function(e){me(e,t);}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t;}}function ve(e,t){t&&(te(e.length)?ue(e,(function(e){ve(e,t);})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")));}function ye(e,t,n){t&&(te(e.length)?ue(e,(function(e){ye(e,t,n);})):n?me(e,t):ve(e,t));}var be=/([a-z\d])([A-Z])/g;function we(e){return e.replace(be,"$1-$2").toLowerCase()}function xe(e,t){return re(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(we(t)))}function Ce(e,t,n){re(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(we(t)),n);}var ke=/\s\s*/,Se=function(){var e=!1;if(s){var t=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e;}});l.addEventListener("test",n,i),l.removeEventListener("test",n,i);}return e}();function Ee(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;t.trim().split(ke).forEach((function(t){if(!Se){var o=e.listeners;o&&o[t]&&o[t][n]&&(r=o[t][n],delete o[t][n],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners);}e.removeEventListener(t,r,i);}));}function Be(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;t.trim().split(ke).forEach((function(t){if(i.once&&!Se){var o=e.listeners,a=void 0===o?{}:o;r=function(){delete a[t][n],e.removeEventListener(t,r,i);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(e,s);},a[t]||(a[t]={}),a[t][n]&&e.removeEventListener(t,a[t][n],i),a[t][n]=r,e.listeners=a;}e.addEventListener(t,r,i);}));}function Re(e,t,n){var i;return se(Event)&&se(CustomEvent)?i=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(i)}function Oe(e){var t=e.getBoundingClientRect();return {left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var _e=l.location,je=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Te(e){var t=e.match(je);return null!==t&&(t[1]!==_e.protocol||t[2]!==_e.hostname||t[3]!==_e.port)}function Pe(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function Le(e){var t=e.rotate,n=e.scaleX,i=e.scaleY,r=e.translateX,o=e.translateY,a=[];te(r)&&0!==r&&a.push("translateX(".concat(r,"px)")),te(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),te(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),te(n)&&1!==n&&a.push("scaleX(".concat(n,")")),te(i)&&1!==i&&a.push("scaleY(".concat(i,")"));var s=a.length?a.join(" "):"none";return {WebkitTransform:s,msTransform:s,transform:s}}function Ae(e,n){var i=e.pageX,r=e.pageY,o={endX:i,endY:r};return n?o:t({startX:i,startY:r},o)}function Ie(e){var t=e.aspectRatio,n=e.height,i=e.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=ne(i),a=ne(n);if(o&&a){var s=n*t;"contain"===r&&s>i||"cover"===r&&s<i?n=i/t:i=n*t;}else o?n=i/t:a&&(i=n*t);return {width:i,height:n}}var De=String.fromCharCode;var Me=/^data:.*,/;function Fe(e){var t,n=new DataView(e);try{var i,r,o;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var a=n.byteLength,s=2;s+1<a;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s;break}s+=1;}if(r){var l=r+10;if("Exif"===function(e,t,n){var i="";n+=t;for(var r=t;r<n;r+=1)i+=De(e.getUint8(r));return i}(n,r+4,4)){var c=n.getUint16(l);if(((i=18761===c)||19789===c)&&42===n.getUint16(l+2,i)){var u=n.getUint32(l+4,i);u>=8&&(o=l+u);}}}if(o){var h,d,p=n.getUint16(o,i);for(d=0;d<p;d+=1)if(h=o+12*d+2,274===n.getUint16(h,i)){h+=8,t=n.getUint16(h,i),n.setUint16(h,1,i);break}}}catch(e){t=1;}return t}var Ne={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox();},initContainer:function(){var e=this.element,t=this.options,n=this.container,i=this.cropper,r=Number(t.minContainerWidth),o=Number(t.minContainerHeight);me(i,B),ve(e,B);var a={width:Math.max(n.offsetWidth,r>=0?r:200),height:Math.max(n.offsetHeight,o>=0?o:100)};this.containerData=a,ge(i,{width:a.width,height:a.height}),me(e,B),ve(i,B);},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,i=Math.abs(t.rotate)%180==90,r=i?t.naturalHeight:t.naturalWidth,o=i?t.naturalWidth:t.naturalHeight,a=r/o,s=e.width,l=e.height;e.height*a>e.width?3===n?s=e.height*a:l=e.width/a:3===n?l=e.width/a:s=e.height*a;var c={aspectRatio:a,naturalWidth:r,naturalHeight:o,width:s,height:l};this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(e.width-c.width)/2,c.top=(e.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=he({},c);},limitCanvas:function(e,t){var n=this.options,i=this.containerData,r=this.canvasData,o=this.cropBoxData,a=n.viewMode,s=r.aspectRatio,l=this.cropped&&o;if(e){var c=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(c=Math.max(c,i.width),u=Math.max(u,i.height),3===a&&(u*s>c?c=u*s:u=c/s)):a>0&&(c?c=Math.max(c,l?o.width:0):u?u=Math.max(u,l?o.height:0):l&&(c=o.width,(u=o.height)*s>c?c=u*s:u=c/s));var h=Ie({aspectRatio:s,width:c,height:u});c=h.width,u=h.height,r.minWidth=c,r.minHeight=u,r.maxWidth=1/0,r.maxHeight=1/0;}if(t)if(a>(l?0:1)){var d=i.width-r.width,p=i.height-r.height;r.minLeft=Math.min(0,d),r.minTop=Math.min(0,p),r.maxLeft=Math.max(0,d),r.maxTop=Math.max(0,p),l&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,2===a&&(r.width>=i.width&&(r.minLeft=Math.min(0,d),r.maxLeft=Math.max(0,d)),r.height>=i.height&&(r.minTop=Math.min(0,p),r.maxTop=Math.max(0,p))));}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height;},renderCanvas:function(e,t){var n=this.canvasData,i=this.imageData;if(t){var r=function(e){var t=e.width,n=e.height,i=e.degree;if(90==(i=Math.abs(i)%180))return {width:n,height:t};var r=i%90*Math.PI/180,o=Math.sin(r),a=Math.cos(r),s=t*a+n*o,l=t*o+n*a;return i>90?{width:l,height:s}:{width:s,height:l}}({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),o=r.width,a=r.height,s=n.width*(o/n.naturalWidth),l=n.height*(a/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(l-n.height)/2,n.width=s,n.height=l,n.aspectRatio=o/a,n.naturalWidth=o,n.naturalHeight=a,this.limitCanvas(!0,!1);}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,ge(this.canvas,he({width:n.width,height:n.height},Le({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0);},renderImage:function(e){var t=this.canvasData,n=this.imageData,i=n.naturalWidth*(t.width/t.naturalWidth),r=n.naturalHeight*(t.height/t.naturalHeight);he(n,{width:i,height:r,left:(t.width-i)/2,top:(t.height-r)/2}),ge(this.image,he({width:n.width,height:n.height},Le(he({translateX:n.left,translateY:n.top},n)))),e&&this.output();},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,i=Number(e.autoCropArea)||.8,r={width:t.width,height:t.height};n&&(t.height*n>t.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=t.left+(t.width-r.width)/2,r.top=t.top+(t.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=he({},r);},limitCropBox:function(e,t){var n=this.options,i=this.containerData,r=this.canvasData,o=this.cropBoxData,a=this.limited,s=n.aspectRatio;if(e){var l=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,u=a?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,h=a?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;l=Math.min(l,i.width),c=Math.min(c,i.height),s&&(l&&c?c*s>l?c=l/s:l=c*s:l?c=l/s:c&&(l=c*s),h*s>u?h=u/s:u=h*s),o.minWidth=Math.min(l,u),o.minHeight=Math.min(c,h),o.maxWidth=u,o.maxHeight=h;}t&&(a?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(i.width,r.left+r.width)-o.width,o.maxTop=Math.min(i.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=i.width-o.width,o.maxTop=i.height-o.height));},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&Ce(this.face,T,n.width>=t.width&&n.height>=t.height?f:d),ge(this.cropBox,he({width:n.width,height:n.height},Le({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output();},output:function(){this.preview(),Re(this.element,D,this.getData());}},He={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,i=t?this.crossOriginUrl:this.url,r=e.alt||"The image to preview",o=document.createElement("img");if(t&&(o.crossOrigin=t),o.src=i,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,n){var a=n;"string"==typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,ue(a,(function(e){var n=document.createElement("img");Ce(e,P,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n);}));}},resetPreview:function(){ue(this.previews,(function(e){var t=xe(e,P);ge(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(re(e[t]))try{delete e[t];}catch(n){e[t]=void 0;}else if(e.dataset)try{delete e.dataset[t];}catch(n){e.dataset[t]=void 0;}else e.removeAttribute("data-".concat(we(t)));}(e,P);}));},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,o=e.width,a=e.height,s=n.left-t.left-e.left,l=n.top-t.top-e.top;this.cropped&&!this.disabled&&(ge(this.viewBoxImage,he({width:o,height:a},Le(he({translateX:-s,translateY:-l},e)))),ue(this.previews,(function(t){var n=xe(t,P),c=n.width,u=n.height,h=c,d=u,p=1;i&&(d=r*(p=c/i)),r&&d>u&&(h=i*(p=u/r),d=u),ge(t,{width:h,height:d}),ge(t.getElementsByTagName("img")[0],he({width:o*p,height:a*p},Le(he({translateX:-s*p,translateY:-l*p},e))));})));}},ze={bind:function(){var e=this.element,t=this.options,n=this.cropper;se(t.cropstart)&&Be(e,N,t.cropstart),se(t.cropmove)&&Be(e,F,t.cropmove),se(t.cropend)&&Be(e,M,t.cropend),se(t.crop)&&Be(e,D,t.crop),se(t.zoom)&&Be(e,q,t.zoom),Be(n,z,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Be(n,X,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Be(n,H,this.onDblclick=this.dblclick.bind(this)),Be(e.ownerDocument,G,this.onCropMove=this.cropMove.bind(this)),Be(e.ownerDocument,W,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Be(window,Y,this.onResize=this.resize.bind(this));},unbind:function(){var e=this.element,t=this.options,n=this.cropper;se(t.cropstart)&&Ee(e,N,t.cropstart),se(t.cropmove)&&Ee(e,F,t.cropmove),se(t.cropend)&&Ee(e,M,t.cropend),se(t.crop)&&Ee(e,D,t.crop),se(t.zoom)&&Ee(e,q,t.zoom),Ee(n,z,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Ee(n,X,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ee(n,H,this.onDblclick),Ee(e.ownerDocument,G,this.onCropMove),Ee(e.ownerDocument,W,this.onCropEnd),t.responsive&&Ee(window,Y,this.onResize);}},Ge={resize:function(){if(!this.disabled){var e,t,n=this.options,i=this.container,r=this.containerData,o=i.offsetWidth/r.width,a=i.offsetHeight/r.height,s=Math.abs(o-1)>Math.abs(a-1)?o:a;1!==s&&(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(ue(e,(function(t,n){e[n]=t*s;}))),this.setCropBoxData(ue(t,(function(e,n){t[n]=e*s;})))));}},dblclick:function(){var e,t;this.disabled||this.options.dragMode===I||this.setDragMode((e=this.dragBox,t=S,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?A:L));},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1;}),50),e.deltaY?i=e.deltaY>0?1:-1:e.wheelDelta?i=-e.wheelDelta/120:e.detail&&(i=e.detail>0?1:-1),this.zoom(-i*n,e)));},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(te(t)&&1!==t||te(n)&&0!==n||e.ctrlKey))){var i,r=this.options,o=this.pointers;e.changedTouches?ue(e.changedTouches,(function(e){o[e.identifier]=Ae(e);})):o[e.pointerId||0]=Ae(e),i=Object.keys(o).length>1&&r.zoomable&&r.zoomOnTouch?g:xe(e.target,T),J.test(i)&&!1!==Re(this.element,N,{originalEvent:e,action:i})&&(e.preventDefault(),this.action=i,this.cropping=!1,i===p&&(this.cropping=!0,me(this.dragBox,_)));}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==Re(this.element,F,{originalEvent:e,action:t})&&(e.changedTouches?ue(e.changedTouches,(function(e){he(n[e.identifier]||{},Ae(e,!0));})):he(n[e.pointerId||0]||{},Ae(e,!0)),this.change(e));}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?ue(e.changedTouches,(function(e){delete n[e.identifier];})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,ye(this.dragBox,_,this.cropped&&this.options.modal)),Re(this.element,M,{originalEvent:e,action:t}));}}},We={change:function(e){var n,i=this.options,r=this.canvasData,o=this.containerData,a=this.cropBoxData,s=this.pointers,l=this.action,c=i.aspectRatio,u=a.left,h=a.top,S=a.width,E=a.height,R=u+S,O=h+E,_=0,j=0,T=o.width,P=o.height,L=!0;!c&&e.shiftKey&&(c=S&&E?S/E:1),this.limited&&(_=a.minLeft,j=a.minTop,T=_+Math.min(o.width,r.width,r.left+r.width),P=j+Math.min(o.height,r.height,r.top+r.height));var A=s[Object.keys(s)[0]],I={x:A.endX-A.startX,y:A.endY-A.startY},D=function(e){switch(e){case m:R+I.x>T&&(I.x=T-R);break;case v:u+I.x<_&&(I.x=_-u);break;case b:h+I.y<j&&(I.y=j-h);break;case y:O+I.y>P&&(I.y=P-O);}};switch(l){case d:u+=I.x,h+=I.y;break;case m:if(I.x>=0&&(R>=T||c&&(h<=j||O>=P))){L=!1;break}D(m),(S+=I.x)<0&&(l=v,u-=S=-S),c&&(E=S/c,h+=(a.height-E)/2);break;case b:if(I.y<=0&&(h<=j||c&&(u<=_||R>=T))){L=!1;break}D(b),E-=I.y,h+=I.y,E<0&&(l=y,h-=E=-E),c&&(S=E*c,u+=(a.width-S)/2);break;case v:if(I.x<=0&&(u<=_||c&&(h<=j||O>=P))){L=!1;break}D(v),S-=I.x,u+=I.x,S<0&&(l=m,u-=S=-S),c&&(E=S/c,h+=(a.height-E)/2);break;case y:if(I.y>=0&&(O>=P||c&&(u<=_||R>=T))){L=!1;break}D(y),(E+=I.y)<0&&(l=b,h-=E=-E),c&&(S=E*c,u+=(a.width-S)/2);break;case w:if(c){if(I.y<=0&&(h<=j||R>=T)){L=!1;break}D(b),E-=I.y,h+=I.y,S=E*c;}else D(b),D(m),I.x>=0?R<T?S+=I.x:I.y<=0&&h<=j&&(L=!1):S+=I.x,I.y<=0?h>j&&(E-=I.y,h+=I.y):(E-=I.y,h+=I.y);S<0&&E<0?(l=k,h-=E=-E,u-=S=-S):S<0?(l=x,u-=S=-S):E<0&&(l=C,h-=E=-E);break;case x:if(c){if(I.y<=0&&(h<=j||u<=_)){L=!1;break}D(b),E-=I.y,h+=I.y,S=E*c,u+=a.width-S;}else D(b),D(v),I.x<=0?u>_?(S-=I.x,u+=I.x):I.y<=0&&h<=j&&(L=!1):(S-=I.x,u+=I.x),I.y<=0?h>j&&(E-=I.y,h+=I.y):(E-=I.y,h+=I.y);S<0&&E<0?(l=C,h-=E=-E,u-=S=-S):S<0?(l=w,u-=S=-S):E<0&&(l=k,h-=E=-E);break;case k:if(c){if(I.x<=0&&(u<=_||O>=P)){L=!1;break}D(v),S-=I.x,u+=I.x,E=S/c;}else D(y),D(v),I.x<=0?u>_?(S-=I.x,u+=I.x):I.y>=0&&O>=P&&(L=!1):(S-=I.x,u+=I.x),I.y>=0?O<P&&(E+=I.y):E+=I.y;S<0&&E<0?(l=w,h-=E=-E,u-=S=-S):S<0?(l=C,u-=S=-S):E<0&&(l=x,h-=E=-E);break;case C:if(c){if(I.x>=0&&(R>=T||O>=P)){L=!1;break}D(m),E=(S+=I.x)/c;}else D(y),D(m),I.x>=0?R<T?S+=I.x:I.y>=0&&O>=P&&(L=!1):S+=I.x,I.y>=0?O<P&&(E+=I.y):E+=I.y;S<0&&E<0?(l=x,h-=E=-E,u-=S=-S):S<0?(l=k,u-=S=-S):E<0&&(l=w,h-=E=-E);break;case f:this.move(I.x,I.y),L=!1;break;case g:this.zoom(function(e){var n=t({},e),i=0;return ue(e,(function(e,t){delete n[t],ue(n,(function(t){var n=Math.abs(e.startX-t.startX),r=Math.abs(e.startY-t.startY),o=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),s=Math.sqrt(n*n+r*r),l=(Math.sqrt(o*o+a*a)-s)/s;Math.abs(l)>Math.abs(i)&&(i=l);}));})),i}(s),e),L=!1;break;case p:if(!I.x||!I.y){L=!1;break}n=Oe(this.cropper),u=A.startX-n.left,h=A.startY-n.top,S=a.minWidth,E=a.minHeight,I.x>0?l=I.y>0?C:w:I.x<0&&(u-=S,l=I.y>0?k:x),I.y<0&&(h-=E),this.cropped||(ve(this.cropBox,B),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));}L&&(a.width=S,a.height=E,a.left=u,a.top=h,this.action=l,this.renderCropBox()),ue(s,(function(e){e.startX=e.endX,e.startY=e.endY;}));}},Ue={crop:function(){return !this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&me(this.dragBox,_),ve(this.cropBox,B),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=he({},this.initialImageData),this.canvasData=he({},this.initialCanvasData),this.cropBoxData=he({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(he(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ve(this.dragBox,_),me(this.cropBox,B)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return !this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,ue(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e;})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ve(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,me(this.cropper,E)),this},destroy:function(){var e=this.element;return e[h]?(e[h]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(ie(e)?e:i+Number(e),ie(t)?t:r+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(te(e)&&(n.left=e,i=!0),te(t)&&(n.top=t,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var i=this.options,r=this.canvasData,o=r.width,a=r.height,s=r.naturalWidth,l=r.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*e,u=l*e;if(!1===Re(this.element,q,{ratio:e,oldRatio:o/s,originalEvent:n}))return this;if(n){var h=this.pointers,d=Oe(this.cropper),p=h&&Object.keys(h).length?function(e){var t=0,n=0,i=0;return ue(e,(function(e){var r=e.startX,o=e.startY;t+=r,n+=o,i+=1;})),{pageX:t/=i,pageY:n/=i}}(h):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-o)*((p.pageX-d.left-r.left)/o),r.top-=(u-a)*((p.pageY-d.top-r.top)/a);}else ae(t)&&te(t.x)&&te(t.y)?(r.left-=(c-o)*((t.x-r.left)/o),r.top-=(u-a)*((t.y-r.top)/a)):(r.left-=(c-o)/2,r.top-=(u-a)/2);r.width=c,r.height=u,this.renderCanvas(!0);}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return te(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,te(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(te(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(te(e)&&(n.scaleX=e,i=!0),te(t)&&(n.scaleY=t,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){e={x:o.left-r.left,y:o.top-r.top,width:o.width,height:o.height};var a=i.width/i.naturalWidth;if(ue(e,(function(t,n){e[n]=t/a;})),t){var s=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=s-e.y;}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=i.rotate||0),n.scalable&&(e.scaleX=i.scaleX||1,e.scaleY=i.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&ae(e)){var o=!1;t.rotatable&&te(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,o=!0),t.scalable&&(te(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,o=!0),te(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;te(e.x)&&(r.left=e.x*a+i.left),te(e.y)&&(r.top=e.y*a+i.top),te(e.width)&&(r.width=e.width*a),te(e.height)&&(r.height=e.height*a),this.setCropBoxData(r);}return this},getContainerData:function(){return this.ready?he({},this.containerData):{}},getImageData:function(){return this.sized?he({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&ue(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n];})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&ae(e)&&(te(e.left)&&(t.left=e.left),te(e.top)&&(t.top=e.top),te(e.width)?(t.width=e.width,t.height=e.width/n):te(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ae(e)&&(te(e.left)&&(i.left=e.left),te(e.top)&&(i.top=e.top),te(e.width)&&e.width!==i.width&&(t=!0,i.width=e.width),te(e.height)&&e.height!==i.height&&(n=!0,i.height=e.height),r&&(t?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=function(e,t,n,i){var o=t.aspectRatio,a=t.naturalWidth,s=t.naturalHeight,l=t.rotate,c=void 0===l?0:l,u=t.scaleX,h=void 0===u?1:u,d=t.scaleY,p=void 0===d?1:d,f=n.aspectRatio,g=n.naturalWidth,m=n.naturalHeight,v=i.fillColor,y=void 0===v?"transparent":v,b=i.imageSmoothingEnabled,w=void 0===b||b,x=i.imageSmoothingQuality,C=void 0===x?"low":x,k=i.maxWidth,S=void 0===k?1/0:k,E=i.maxHeight,B=void 0===E?1/0:E,R=i.minWidth,O=void 0===R?0:R,_=i.minHeight,j=void 0===_?0:_,T=document.createElement("canvas"),P=T.getContext("2d"),L=Ie({aspectRatio:f,width:S,height:B}),A=Ie({aspectRatio:f,width:O,height:j},"cover"),I=Math.min(L.width,Math.max(A.width,g)),D=Math.min(L.height,Math.max(A.height,m)),M=Ie({aspectRatio:o,width:S,height:B}),F=Ie({aspectRatio:o,width:O,height:j},"cover"),N=Math.min(M.width,Math.max(F.width,a)),H=Math.min(M.height,Math.max(F.height,s)),z=[-N/2,-H/2,N,H];return T.width=pe(I),T.height=pe(D),P.fillStyle=y,P.fillRect(0,0,I,D),P.save(),P.translate(I/2,D/2),P.rotate(c*Math.PI/180),P.scale(h,p),P.imageSmoothingEnabled=w,P.imageSmoothingQuality=C,P.drawImage.apply(P,[e].concat(r(z.map((function(e){return Math.floor(pe(e))}))))),P.restore(),T}(this.image,this.imageData,t,e);if(!this.cropped)return n;var i=this.getData(e.rounded),o=i.x,a=i.y,s=i.width,l=i.height,c=n.width/Math.floor(t.naturalWidth);1!==c&&(o*=c,a*=c,s*=c,l*=c);var u=s/l,h=Ie({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=Ie({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),p=Ie({aspectRatio:u,width:e.width||(1!==c?n.width:s),height:e.height||(1!==c?n.height:l)}),f=p.width,g=p.height;f=Math.min(h.width,Math.max(d.width,f)),g=Math.min(h.height,Math.max(d.height,g));var m=document.createElement("canvas"),v=m.getContext("2d");m.width=pe(f),m.height=pe(g),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,f,g);var y=e.imageSmoothingEnabled,b=void 0===y||y,w=e.imageSmoothingQuality;v.imageSmoothingEnabled=b,w&&(v.imageSmoothingQuality=w);var x,C,k,S,E,B,R=n.width,O=n.height,_=o,j=a;_<=-s||_>R?(_=0,x=0,k=0,E=0):_<=0?(k=-_,_=0,E=x=Math.min(R,s+_)):_<=R&&(k=0,E=x=Math.min(s,R-_)),x<=0||j<=-l||j>O?(j=0,C=0,S=0,B=0):j<=0?(S=-j,j=0,B=C=Math.min(O,l+j)):j<=O&&(S=0,B=C=Math.min(l,O-j));var T=[_,j,x,C];if(E>0&&B>0){var P=f/s;T.push(k*P,S*P,E*P,B*P);}return v.drawImage.apply(v,[n].concat(r(T.map((function(e){return Math.floor(pe(e))}))))),m},setAspectRatio:function(e){var t=this.options;return this.disabled||ie(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r=e===L,o=t.movable&&e===A;e=r||o?e:I,t.dragMode=e,Ce(n,T,e),ye(n,S,r),ye(n,j,o),t.cropBoxMovable||(Ce(i,T,e),ye(i,S,r),ye(i,j,o));}return this}},Ye=l.Cropper,Xe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!Q.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=he({},Z,ae(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init();}return t=e,r=[{key:"noConflict",value:function(){return window.Cropper=Ye,e}},{key:"setDefaults",value:function(e){he(Z,ae(e)&&e);}}],(n=[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t[h]){if(t[h]=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src;}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e);}}},{key:"load",value:function(e){var t,n,i,r,o=this;if(e){this.url=e,this.imageData={};var a=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if($.test(e))K.test(e)?this.read((t=e.replace(Me,""),n=atob(t),i=new ArrayBuffer(n.length),ue(r=new Uint8Array(i),(function(e,t){r[t]=n.charCodeAt(t);})),i)):this.clone();else{var l=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=c,l.onerror=c,l.ontimeout=c,l.onprogress=function(){l.getResponseHeader("content-type")!==V&&l.abort();},l.onload=function(){o.read(l.response);},l.onloadend=function(){o.reloading=!1,o.xhr=null;},s.checkCrossOrigin&&Te(e)&&a.crossOrigin&&(e=Pe(e)),l.open("GET",e,!0),l.responseType="arraybuffer",l.withCredentials="use-credentials"===a.crossOrigin,l.send();}else this.clone();}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,i=Fe(e),r=0,o=1,a=1;if(i>1){this.url=function(e,t){for(var n=[],i=new Uint8Array(e);i.length>0;)n.push(De.apply(null,ce(i.subarray(0,8192)))),i=i.subarray(8192);return "data:".concat(t,";base64,").concat(btoa(n.join("")))}(e,V);var s=function(e){var t=0,n=1,i=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;}return {rotate:t,scaleX:n,scaleY:i}}(i);r=s.rotate,o=s.scaleX,a=s.scaleY;}t.rotatable&&(n.rotate=r),t.scalable&&(n.scaleX=o,n.scaleY=a),this.clone();}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,i=t;this.options.checkCrossOrigin&&Te(t)&&(n||(n="anonymous"),i=Pe(t)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||t,r.alt=e.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),me(r,R),e.parentNode.insertBefore(r,e.nextSibling);}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent),i=function(t,n){he(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.initialImageData=he({},e.imageData),e.sizing=!1,e.sized=!0,e.build();};if(!t.naturalWidth||n){var r=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||o.removeChild(r);},r.src=t.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(r));}else i(t.naturalWidth,t.naturalHeight);}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null;}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,i=e.parentNode,r=document.createElement("div");r.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var o=r.querySelector(".".concat(h,"-container")),a=o.querySelector(".".concat(h,"-canvas")),s=o.querySelector(".".concat(h,"-drag-box")),l=o.querySelector(".".concat(h,"-crop-box")),c=l.querySelector(".".concat(h,"-face"));this.container=i,this.cropper=o,this.canvas=a,this.dragBox=s,this.cropBox=l,this.viewBox=o.querySelector(".".concat(h,"-view-box")),this.face=c,a.appendChild(n),me(e,B),i.insertBefore(o,e.nextSibling),ve(n,R),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,me(l,B),t.guides||me(l.getElementsByClassName("".concat(h,"-dashed")),B),t.center||me(l.getElementsByClassName("".concat(h,"-center")),B),t.background&&me(o,"".concat(h,"-bg")),t.highlight||me(c,O),t.cropBoxMovable&&(me(c,j),Ce(c,T,d)),t.cropBoxResizable||(me(l.getElementsByClassName("".concat(h,"-line")),B),me(l.getElementsByClassName("".concat(h,"-point")),B)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),se(t.ready)&&Be(e,U,t.ready,{once:!0}),Re(e,U);}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),ve(this.element,B);}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop();}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e;var t,n,r;}();return he(Xe.prototype,Ne,He,ze,Ge,We,Ue),Xe}();}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]});},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return (()=>{function e(e,t){return function(){return e.apply(t,arguments)}}n.d(i,{default:()=>xn});const{toString:t}=Object.prototype,{getPrototypeOf:r}=Object,o=(a=Object.create(null),e=>{const n=t.call(e);return a[n]||(a[n]=n.slice(8,-1).toLowerCase())});var a;const s=e=>(e=e.toLowerCase(),t=>o(t)===e),l=e=>t=>typeof t===e,{isArray:c}=Array,u=l("undefined"),h=s("ArrayBuffer"),d=l("string"),p=l("function"),f=l("number"),g=e=>null!==e&&"object"==typeof e,m=e=>{if("object"!==o(e))return !1;const t=r(e);return !(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=s("Date"),y=s("File"),b=s("Blob"),w=s("FileList"),x=s("URLSearchParams");function C(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,r;if("object"!=typeof e&&(e=[e]),c(e))for(i=0,r=e.length;i<r;i++)t.call(null,e[i],i,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),o=r.length;let a;for(i=0;i<o;i++)a=r[i],t.call(null,e[a],a,e);}}function k(e,t){t=t.toLowerCase();const n=Object.keys(e);let i,r=n.length;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:commonjsGlobal,E=e=>!u(e)&&e!==S,B=(R="undefined"!=typeof Uint8Array&&r(Uint8Array),e=>R&&e instanceof R);var R;const O=s("HTMLFormElement"),_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),j=s("RegExp"),T=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};C(n,((n,r)=>{let o;!1!==(o=t(n,r,e))&&(i[r]=o||n);})),Object.defineProperties(e,i);},P="abcdefghijklmnopqrstuvwxyz",L="0123456789",A={DIGIT:L,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+L},I=s("AsyncFunction"),D={isArray:c,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=o(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:d,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:m,isUndefined:u,isDate:v,isFile:y,isBlob:b,isRegExp:j,isFunction:p,isStream:e=>g(e)&&p(e.pipe),isURLSearchParams:x,isTypedArray:B,isFileList:w,forEach:C,merge:function e(){const{caseless:t}=E(this)&&this||{},n={},i=(i,r)=>{const o=t&&k(n,r)||r;m(n[o])&&m(i)?n[o]=e(n[o],i):m(i)?n[o]=e({},i):c(i)?n[o]=i.slice():n[o]=i;};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&C(arguments[e],i);return n},extend:(t,n,i,{allOwnKeys:r}={})=>(C(n,((n,r)=>{i&&p(n)?t[r]=e(n,i):t[r]=n;}),{allOwnKeys:r}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n);},toFlatObject:(e,t,n,i)=>{let o,a,s;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)s=o[a],i&&!i(s,e,t)||l[s]||(t[s]=e[s],l[s]=!0);e=!1!==n&&r(e);}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:s,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return -1!==i&&i===n},toArray:e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!f(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1]);}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:O,hasOwnProperty:_,hasOwnProp:_,reduceDescriptors:T,freezeMethods:e=>{T(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return !1;const i=e[n];p(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}));}));},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach((e=>{n[e]=!0;}));};return c(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:k,global:S,isContextDefined:E,ALPHABET:A,generateString:(e=16,t=A.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n},isSpecCompliantForm:function(e){return !!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const r=c(e)?[]:{};return C(e,((e,t)=>{const o=n(e,i+1);!u(o)&&(r[t]=o);})),t[i]=void 0,r}}return e};return n(e,0)},isAsyncFn:I,isThenable:e=>e&&(g(e)||p(e))&&p(e.then)&&p(e.catch)};function M(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r);}D.inherits(M,Error,{toJSON:function(){return {message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const F=M.prototype,N={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{N[e]={value:e};})),Object.defineProperties(M,N),Object.defineProperty(F,"isAxiosError",{value:!0}),M.from=(e,t,n,i,r,o)=>{const a=Object.create(F);return D.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),M.call(a,e.message,t,n,i,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const H=M;function z(e){return D.isPlainObject(e)||D.isArray(e)}function G(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=G(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const U=D.toFlatObject(D,{},null,(function(e){return /^is[A-Z]/.test(e)})),Y=function(e,t,n){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(n=D.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return !D.isUndefined(t[e])}))).metaTokens,r=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return "";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,r){let s=e;if(e&&!r&&"object"==typeof e)if(D.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(z)}(e)||(D.isFileList(e)||D.endsWith(n,"[]"))&&(s=D.toArray(e)))return n=G(n),s.forEach((function(e,i){!D.isUndefined(e)&&null!==e&&t.append(!0===a?W([n],i,o):null===a?n:n+"[]",l(e));})),!1;return !!z(e)||(t.append(W(r,n,o),l(e)),!1)}const u=[],h=Object.assign(U,{defaultVisitor:c,convertValue:l,isVisitable:z});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!D.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+i.join("."));u.push(n),D.forEach(n,(function(n,o){!0===(!(D.isUndefined(n)||null===n)&&r.call(t,n,D.isString(o)?o.trim():o,i,h))&&e(n,i?i.concat(o):[o]);})),u.pop();}}(e),t};function X(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function q(e,t){this._pairs=[],e&&Y(e,this,t);}const V=q.prototype;V.append=function(e,t){this._pairs.push([e,t]);},V.toString=function(e){const t=e?function(t){return e.call(this,t,X)}:X;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const J=q;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function K(e,t,n){if(!t)return e;const i=n&&n.encode||$,r=n&&n.serialize;let o;if(o=r?r(t,n):D.isURLSearchParams(t)?t.toString():new J(t,n).toString(i),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o;}return e}const Q=class{constructor(){this.handlers=[];}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null);}clear(){this.handlers&&(this.handlers=[]);}forEach(e){D.forEach(this.handlers,(function(t){null!==t&&e(t);}));}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:J,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return ("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},te=function(e){function t(e,n,i,r){let o=e[r++];const a=Number.isFinite(+o),s=r>=e.length;return o=!o&&D.isArray(i)?i.length:o,s?(D.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):(i[o]&&D.isObject(i[o])||(i[o]=[]),t(e,n,i[o],r)&&D.isArray(i[o])&&(i[o]=function(e){const t={},n=Object.keys(e);let i;const r=n.length;let o;for(i=0;i<r;i++)o=n[i],t[o]=e[o];return t}(i[o])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const n={};return D.forEachEntry(e,((e,i)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0);})),n}return null},ne={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=D.isObject(e);if(r&&D.isHTMLForm(e)&&(e=new FormData(e)),D.isFormData(e))return i&&i?JSON.stringify(te(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Y(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=D.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Y(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),function(e,t,n){if(D.isString(e))try{return (0, JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return (0, JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&D.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],(e=>{ne.headers[e]={};}));const ie=ne,re=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oe=Symbol("internals");function ae(e){return e&&String(e).trim().toLowerCase()}function se(e){return !1===e||null==e?e:D.isArray(e)?e.map(se):String(e)}function le(e,t,n,i,r){return D.isFunction(i)?i.call(this,t,n):(r&&(t=n),D.isString(t)?D.isString(i)?-1!==t.indexOf(i):D.isRegExp(i)?i.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e);}set(e,t,n){const i=this;function r(e,t,n){const r=ae(t);if(!r)throw new Error("header name must be a non-empty string");const o=D.findKey(i,r);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=se(e));}const o=(e,t)=>D.forEach(e,((e,n)=>r(e,n,t)));return D.isPlainObject(e)||e instanceof this.constructor?o(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let n,i,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),i=e.substring(r+1).trim(),!n||t[n]&&re[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i);})),t})(e),t):null!=e&&r(t,e,n),this}get(e,t){if(e=ae(e)){const n=D.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(D.isFunction(t))return t.call(this,e,n);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ae(e)){const n=D.findKey(this,e);return !(!n||void 0===this[n]||t&&!le(0,this[n],n,t))}return !1}delete(e,t){const n=this;let i=!1;function r(e){if(e=ae(e)){const r=D.findKey(n,e);!r||t&&!le(0,n[r],r,t)||(delete n[r],i=!0);}}return D.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const r=t[n];e&&!le(0,this[r],r,e,!0)||(delete this[r],i=!0);}return i}normalize(e){const t=this,n={};return D.forEach(this,((i,r)=>{const o=D.findKey(n,r);if(o)return t[o]=se(i),void delete t[r];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(r):String(r).trim();a!==r&&delete t[r],t[a]=se(i),n[a]=!0;})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&D.isArray(n)?n.join(", "):n);})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return "AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=ae(e);t[i]||(function(e,t){const n=D.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,r){return this[i].call(this,t,e,n,r)},configurable:!0});}));}(n,e),t[i]=!0);}return D.isArray(e)?e.forEach(i):i(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(ce.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return {get:()=>e,set(e){this[n]=e;}}})),D.freezeMethods(ce);const ue=ce;function he(e,t){const n=this||ie,i=t||n,r=ue.from(i.headers);let o=i.data;return D.forEach(e,(function(e){o=e.call(n,o,r.normalize(),t?t.status:void 0);})),r.normalize(),o}function de(e){return !(!e||!e.__CANCEL__)}function pe(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError";}D.inherits(pe,H,{__CANCEL__:!0});const fe=pe,ge=ee.isStandardBrowserEnv?{write:function(e,t,n,i,r,o){const a=[];a.push(e+"="+encodeURIComponent(t)),D.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),D.isString(i)&&a.push("path="+i),D.isString(r)&&a.push("domain="+r),!0===o&&a.push("secure"),document.cookie=a.join("; ");},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5);}}:{write:function(){},read:function(){return null},remove:function(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ve=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=D.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return !0};function ye(e,t){let n=0;const i=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=i[a];r||(r=l),n[o]=s,i[o]=l;let u=a,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-r<t)return;const d=c&&l-c;return d?Math.round(1e3*h/d):void 0}}(50,250);return r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,s=o-n,l=i(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:r};c[t?"download":"upload"]=!0,e(c);}}const be={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const r=ue.from(e.headers).normalize(),o=e.responseType;let a,s;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a);}D.isFormData(i)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?D.isString(s=r.getContentType())&&r.setContentType(s.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+n));}const u=me(e.baseURL,e.url);function h(){if(!c)return;const i=ue.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n);}((function(e){t(e),l();}),(function(e){n(e),l();}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null;}if(c.open(e.method.toUpperCase(),K(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h);},c.onabort=function(){c&&(n(new H("Request aborted",H.ECONNABORTED,e,c)),c=null);},c.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,c)),c=null;},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,i.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,c)),c=null;},ee.isStandardBrowserEnv){const t=(e.withCredentials||ve(u))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t);}void 0===i&&r.setContentType(null),"setRequestHeader"in c&&D.forEach(r.toJSON(),(function(e,t){c.setRequestHeader(t,e);})),D.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(n(!t||t.type?new fe(null,e,c):t),c.abort(),c=null);},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===ee.protocols.indexOf(d)?n(new H("Unsupported protocol "+d+":",H.ERR_BAD_REQUEST,e)):c.send(i||null);}))}};D.forEach(be,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t});}catch(e){}Object.defineProperty(e,"adapterName",{value:t});}}));const we=e=>`- ${e}`,xe=e=>D.isFunction(e)||null===e||!1===e,Ce=e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let o=0;o<t;o++){let t;if(n=e[o],i=n,!xe(n)&&(i=be[(t=String(n)).toLowerCase()],void 0===i))throw new H(`Unknown adapter '${t}'`);if(i)break;r[t||"#"+o]=i;}if(!i){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(we).join("\n"):" "+we(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return i};function ke(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fe(null,e)}function Se(e){return ke(e),e.headers=ue.from(e.headers),e.data=he.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ce(e.adapter||ie.adapter)(e).then((function(t){return ke(e),t.data=he.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return de(t)||(ke(e),t&&t.response&&(t.response.data=he.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const Ee=e=>e instanceof ue?e.toJSON():e;function Be(e,t){t=t||{};const n={};function i(e,t,n){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:n},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function r(e,t,n){return D.isUndefined(t)?D.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function o(e,t){if(!D.isUndefined(t))return i(void 0,t)}function a(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function s(n,r,o){return o in t?i(n,r):o in e?i(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>r(Ee(e),Ee(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(i){const o=l[i]||r,a=o(e[i],t[i],i);D.isUndefined(a)&&o!==s||(n[i]=a);})),n}const Re={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Re[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e};}));const Oe={};Re.transitional=function(e,t,n){function i(e,t){return "[Axios v1.5.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return (n,r,o)=>{if(!1===e)throw new H(i(r," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!Oe[r]&&(Oe[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}};const _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const o=i[r],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new H("option "+o+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+o,H.ERR_BAD_OPTION)}},validators:Re},je=_e.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q};}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Be(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:r}=t;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:je.transitional(je.boolean),forcedJSONParsing:je.transitional(je.boolean),clarifyTimeoutError:je.transitional(je.boolean)},!1),null!=i&&(D.isFunction(i)?t.paramsSerializer={serialize:i}:_e.assertOptions(i,{encode:je.function,serialize:je.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&D.merge(r.common,r[t.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e];})),t.headers=ue.concat(o,r);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected));}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected);}));let u,h=0;if(!s){const e=[Se.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);h<u;)c=c.then(e[h++],e[h++]);return c}u=a.length;let d=t;for(h=0;h<u;){const e=a[h++],t=a[h++];try{d=e(d);}catch(e){t.call(this,e);break}}try{c=Se.call(this,d);}catch(e){return Promise.reject(e)}for(h=0,u=l.length;h<u;)c=c.then(l[h++],l[h++]);return c}getUri(e){return K(me((e=Be(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}D.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,n){return this.request(Be(n||{},{method:e,url:t,data:(n||{}).data}))};})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,r){return this.request(Be(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0);}));const Pe=Te;class Le{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e;}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null;})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e;})).then(e);return i.cancel=function(){n.unsubscribe(t);},i},e((function(e,i,r){n.reason||(n.reason=new fe(e,i,r),t(n.reason));}));}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e];}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1);}static source(){let e;return {token:new Le((function(t){e=t;})),cancel:e}}}const Ae=Le,Ie={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ie).forEach((([e,t])=>{Ie[t]=e;}));const De=Ie,Me=function t(n){const i=new Pe(n),r=e(Pe.prototype.request,i);return D.extend(r,Pe.prototype,i,{allOwnKeys:!0}),D.extend(r,i,null,{allOwnKeys:!0}),r.create=function(e){return t(Be(n,e))},r}(ie);Me.Axios=Pe,Me.CanceledError=fe,Me.CancelToken=Ae,Me.isCancel=de,Me.VERSION="1.5.1",Me.toFormData=Y,Me.AxiosError=H,Me.Cancel=Me.CanceledError,Me.all=function(e){return Promise.all(e)},Me.spread=function(e){return function(t){return e.apply(null,t)}},Me.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},Me.mergeConfig=Be,Me.AxiosHeaders=ue,Me.formToJSON=e=>te(D.isHTMLForm(e)?new FormData(e):e),Me.getAdapter=Ce,Me.HttpStatusCode=De,Me.default=Me;const Fe=Me;function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i);}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){We(e,t,n[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));}));}return e}function Ge(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Ue(i.key),i);}}function We(e,t,n){return (t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(e){var t=function(e,t){if("object"!==Ne(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Ne(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===Ne(t)?t:String(t)}var Ye="".concat("https://").concat("core.getfaceage.com").concat("/api/"),Xe={authorize:"v1/business/authorize",skinanalyze:"v1/skin-analyzer/analyze"},qe={baseURL:Ye,responseType:"json"},Ve={Accept:"application/json","Content-Type":"application/json"},Je=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),We(this,"session",void 0),We(this,"request",(function(e,n,i,r,o){var a=ze(ze({},qe),{},{headers:ze(ze({},Ve),r)},o),s=n;n in Xe&&(s=Xe[n]);var l=e.toLowerCase();switch(l){case"get":case"options":case"head":case"delete":return t.session[l](s,a);case"post":case"patch":case"put":return t.session[l](s,i,a)}return null})),this.session=Fe.create(ze({},qe));}var t,n;return t=e,n=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&Ge(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();We(Je,"instance",void 0);const $e=Je.getInstance();function Ke(e){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(e)}function Qe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==Ke(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Ke(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===Ke(r)?r:String(r)),i);}var r;}var Ze=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.opts=t,this.defaultType=["skincare","skincare-analyzer"];}var t,n;return t=e,(n=[{key:"init",value:function(e){e.responsiveOverride;var t=this.opts;if(!t||"object"!==Ke(t))throw new Error("pleas enter options.");if(t.arrTypes=this.defaultType,void 0===t.faceageId||!t.faceageId)throw new Error("pleas enter face age Id.");if(void 0===t.type&&(t.type="skincare"),-1===this.defaultType.indexOf(t.type))throw new Error("Type is not valid");if(void 0!==t.access&&Array.isArray(t.access)||(t.access=["dark_circle","eye_bag","eye_wrinkles","deep_wrinkles","wrinkles","acnes","pores","pigment"]),void 0===t.iframeWidth&&(t.iframeWidth="360px"),void 0===t.iframeHeight&&(t.iframeHeight="480px"),"skincare-analyzer"===t.type&&(t.iframeWidth="100%",t.iframeHeight="550px"),void 0===t.showFacePoint&&(t.showFacePoint=!0),void 0===t.showCamera&&(t.showCamera=!0),void 0===t.showUpload&&(t.showUpload=!0),!t.showCamera&&!t.showUpload)throw new Error("There are no input ways to receive the image.");return t}}])&&Qe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function et(e){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===et(r)?r:String(r)),i);}var r;}var nt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);}var t,n;return t=e,(n=[{key:"initGlobalVars",value:function(e){e.skinAnalyzeData=[];}},{key:"globalVars",value:function(e){return {faceID:null,dom:{},showCamera:!0,showUpload:!0,iframeWidth:"360px",iframeHeight:"480px",showFacePoint:!0,showCopyRight:!0,cameraPermission:null,faceDetection:null,boundingBox:[]}}},{key:"init",value:function(e){var t=this.globalVars(e);return this.initGlobalVars(t),t}}])&&tt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function it(e){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},it(e)}function rt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==it(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==it(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===it(r)?r:String(r)),i);}var r;}var ot=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.opts=t;}var t,n;return t=e,(n=[{key:"init",value:function(){var e=new Ze(this.opts).init({responsiveOverride:!1});return {config:e,globals:(new nt).init(e)}}}])&&rt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function at(e){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==at(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==at(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===at(r)?r:String(r)),i);}var r;}const lt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.ctx=t,this.w=t.w;}var t,n;return t=e,n=[{key:"setAttrs",value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&e.setAttribute(n,t[n]);}},{key:"getLevelColor",value:function(e){return e<=30?"#5CB85C":e>=70?"#DA005C":"#5C7BB8"}}],n&&st(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();var ct=n(982),ut=n(135);function ht(e){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(e)}function dt(){dt=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value;},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"");}catch(e){c=function(e,t,n){return e[t]=n};}function u(e,t,n,i){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new j(i||[]);return r(a,"_invoke",{value:B(e,n,s)}),a}function h(e,t,n){try{return {type:"normal",arg:e.call(t,n)}}catch(e){return {type:"throw",arg:e}}}t.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var x=Object.getPrototypeOf,C=x&&x(x(T([])));C&&C!==n&&i.call(C,a)&&(w=C);var k=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}));}));}function E(e,t){function n(r,o,a,s){var l=h(e[r],e,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==ht(u)&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s);}),(function(e){n("throw",e,a,s);})):t.resolve(u).then((function(e){c.value=e,a(c);}),(function(e){return n("throw",e,a,s)}))}s(l.arg);}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r);}))}return o=o?o.then(r,r):r()}});}function B(t,n,i){var r=d;return function(o,a){if(r===f)throw new Error("Generator is already running");if(r===g){if("throw"===o)throw a;return {value:e,done:!0}}for(i.method=o,i.arg=a;;){var s=i.delegate;if(s){var l=R(s,i);if(l){if(l===m)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===d)throw r=g,i.arg;i.dispatchException(i.arg);}else"return"===i.method&&i.abrupt("return",i.arg);r=f;var c=h(t,n,i);if("normal"===c.type){if(r=i.done?g:p,c.arg===m)continue;return {value:c.arg,done:i.done}}"throw"===c.type&&(r=g,i.method="throw",i.arg=c.arg);}}}function R(t,n){var i=n.method,r=t.iterator[i];if(r===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,R(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;var o=h(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t);}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t;}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0);}function T(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(ht(t)+" is not iterable")}return y.prototype=b,r(k,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return !!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return {__await:e}},S(E.prototype),c(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new E(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(k),c(k,l,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return "[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=T,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e);},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return s.type="throw",s.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return "break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;_(n);}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:T(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),m}},t}function pt(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value;}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r);}function ft(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){pt(o,i,r,a,s,"next",e);}function s(e){pt(o,i,r,a,s,"throw",e);}a(void 0);}))}}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,mt(i.key),i);}}function mt(e){var t=function(e,t){if("object"!==ht(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==ht(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===ht(t)?t:String(t)}var vt=function(){function e(t,n,i,r,o,a){var s,l,c,u=this,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"video";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s=this,(l=mt(l="isLoading"))in s?Object.defineProperty(s,l,{value:true,enumerable:!0,configurable:!0,writable:!0}):s[l]=true,this.srcElement=t,this.boundingBoxElement=n,this.handleOnResults=o,this.handleLoading=a,this.faceDetectionModel=new ct.FaceDetection({locateFile:function(e){return "https://cdn.jsdelivr.net/npm/@mediapipe/face_detection@0.3/".concat(e)}}),this.faceDetectionModel.setOptions({modelSelection:1,enableTracking:10,minDetectionConfidence:.5}),this.onClose=this.onClose.bind(this),this.faceDetectionModel.onResults("video"===h?this.onResultsVideo.bind(this):this.onResultsImage.bind(this)),"video"===h?(this.camera=new ut.Camera(this.srcElement,{onFrame:(c=ft(dt().mark((function e(){return dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.faceDetectionModel.send({image:u.srcElement});case 2:u.isLoading&&(u.isLoading=!0,u.handleLoading());case 3:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)}),width:r,height:r}),this.camera.start()):this.handleImageFaceDetection();}var t,n,i;return t=e,n=[{key:"handleImageFaceDetection",value:(i=ft(dt().mark((function e(){return dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.faceDetectionModel.send({image:this.srcElement});case 2:this.isLoading&&(this.isLoading=!0,this.handleLoading&&this.handleLoading());case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"onResultsVideo",value:function(e){var t=this,n=e.detections;this.boundingBoxElement.innerHTML="";var i=[];n.map((function(e){var n=e.boundingBox.xCenter-e.boundingBox.width/2,r={width:e.boundingBox.width,height:e.boundingBox.height,yCenter:e.boundingBox.yCenter-e.boundingBox.height/2,xCenter:n,landmarks:e.landmarks};i.push(r);var o=document.createElement("div");lt.setAttrs(o,{style:"border: 1px solid rgb(255, 213, 0); position: absolute; top: "+100*r.yCenter+"%; right: "+100*r.xCenter+"%; width: "+100*r.width+"%; height: "+100*r.height+"%; z-index: 3;"}),t.boundingBoxElement.appendChild(o);})),this.handleOnResults&&this.handleOnResults(i);}},{key:"onResultsImage",value:function(e){var t=e.detections.map((function(e){var t=e.boundingBox.xCenter-e.boundingBox.width/2;return {width:e.boundingBox.width,height:e.boundingBox.height,yCenter:e.boundingBox.yCenter-e.boundingBox.height/2,xCenter:t,landmarks:e.landmarks}}));this.handleOnResults&&this.handleOnResults(t);}},{key:"onClose",value:function(){this.faceDetectionModel.close();}}],n&>(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function wt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Ct(i.key),i);}}function xt(e,t,n){return (t=Ct(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e){var t=function(e,t){if("object"!==yt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==yt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===yt(t)?t:String(t)}var kt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xt(this,"_facingMode","user"),xt(this,"_webcamList",[]),xt(this,"_streamList",[]),xt(this,"_selectedDeviceId",""),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.snap=this.snap.bind(this),this.startStream=this.startStream.bind(this);}var t,n;return t=e,n=[{key:"facingMode",get:function(){return this._facingMode},set:function(e){this._facingMode=e;}},{key:"webcamList",get:function(){return this._webcamList}},{key:"webcamCount",get:function(){return this._webcamList.length}},{key:"selectedDeviceId",get:function(){return this._selectedDeviceId}},{key:"getVideoInputs",value:function(e){var t=this;return this._webcamList=[],e.forEach((function(e){"videoinput"===e.kind&&t._webcamList.push(e);})),1==this._webcamList.length&&(this._facingMode="user"),this._webcamList}},{key:"getMediaConstraints",value:function(e){var t={};return ""==this._selectedDeviceId?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:e.width},t.height={exact:e.height},{video:t,audio:!1}}},{key:"selectCamera",value:function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return {s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return {s:function(){n=n.call(e);},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e;},f:function(){try{a||null==n.return||n.return();}finally{if(s)throw o}}}}(this._webcamList);try{for(t.s();!(e=t.n()).done;){var n=e.value;if("user"==this._facingMode&&n.label.toLowerCase().includes("front")||"enviroment"==this._facingMode&&n.label.toLowerCase().includes("back")){this._selectedDeviceId=n.deviceId;break}}}catch(e){t.e(e);}finally{t.f();}}},{key:"flip",value:function(){this._facingMode="user"==this._facingMode?"enviroment":"user",this.selectCamera();}},{key:"start",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise((function(r,o){t.stop(),navigator.mediaDevices.getUserMedia(t.getMediaConstraints(e)).then((function(n){t._streamList.push(n),t.info().then((function(n){t.selectCamera(),i?t.startStream(e).then((function(e){r(t._facingMode);})).catch((function(e){o(e);})):r(t._selectedDeviceId);})).catch((function(e){o(e);}));})).catch((function(e){n&&n(e.name),o(e);}));}))}},{key:"info",value:function(){var e=this;return new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._webcamList);})).catch((function(e){n(e);}));}))}},{key:"startStream",value:function(e){var t=this;return new Promise((function(n,i){navigator.mediaDevices.getUserMedia(t.getMediaConstraints(e)).then((function(i){t._streamList.push(i),e.srcObject=i,"user"==t._facingMode&&(e.style.transform="scale(-1,1)");var r=e;setTimeout((function(){r.play();}),1e3),n(t._facingMode);})).catch((function(e){i(e);}));}))}},{key:"stop",value:function(){this._streamList.forEach((function(e){e.getTracks().forEach((function(e){e.stop();}));}));}},{key:"snap",value:function(e){var t=document.createElement("canvas");t.height=e.scrollHeight,t.width=e.scrollWidth;var n=t.getContext("2d");"user"===this._facingMode&&(n.translate(t.width,0),n.scale(-1,1)),n.clearRect(0,0,t.width,t.height),n.drawImage(e,0,0,t.width,t.height);var i=t.toDataURL("image/jpeg");return "data:,"===i&&(i=null),t.remove(),i}}],n&&wt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function St(e){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},St(e)}function Et(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Rt(i.key),i);}}function Bt(e,t,n){return (t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){var t=function(e,t){if("object"!==St(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==St(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===St(t)?t:String(t)}var Ot=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:360,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:480,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Bt(this,"_facingMode","user"),Bt(this,"_webcamList",[]),Bt(this,"_streamList",[]),Bt(this,"_selectedDeviceId",""),Bt(this,"_canvasElement",null),Bt(this,"loadModel",!1),Bt(this,"flash",!1),Bt(this,"facePosition",!1),Bt(this,"lookStraight",!1),Bt(this,"lighting",!1),Bt(this,"fixStatus",!1),Bt(this,"isCountry",0),Bt(this,"ready",!1),Bt(this,"logs",""),Bt(this,"timeInv",void 0),Bt(this,"setSnap",!1),Bt(this,"image",null),Bt(this,"detection",!1),Bt(this,"faceDetection",void 0),this.el=t,this.gl=n,this.width=i,this.height=r,this.handleSubmit=o,this.loading=a,this.setPosition=this.setPosition.bind(this),this.capture=this.capture.bind(this),this.errorCameraPermission=this.errorCameraPermission.bind(this),this.render();}var t,n;return t=e,n=[{key:"render",value:function(){var e=this,t=this.el,n=this.gl;n.dom.elwebcam=document.createElement("div"),n.dom.elwebcam.innerHTML='<div style="display: flex; justify-content: center;"><div style="min-width: 480px; min-height: 480px; max-height: 480px; display: block; position: relative;"><div class="face_detect_age"></div><video class="webcamRef" autoplay muted playsinline style="position: absolute; top: 0px; right: 0px; /*opacity: 0; visibility: hidden; z-index: 2; */ border-radius: 10px; width: auto; transform: scaleX(-1);"></video></div></div><div class="faceController"><ul><li><div class="item_ctl face_position" style="background-color: rgb(218, 0, 92);"><span class="title">Face Position</span><span class="value">Not Good</span></div></li><li><div class="item_ctl look_straight" style="background-color: rgb(218, 0, 92);"><span class="title">Look Straight</span><span class="value">Not Good</span></div></li></ul></div><div class="facePositionMap" id="face_position_map"></div><div class="facePosition"><svg viewBox="0 0 360 480"><defs><ellipse class="face-ellipse" id="face-ellipse" cx="50%" cy="55%" rx="133.2" ry="153.6" style="stroke: rgb(255, 255, 255);"></ellipse><mask id="mask"><rect x="0" y="0" width="100%" height="100%" fill="#fff" fill-opacity="0.3"></rect><use xlink:href="#face-ellipse"></use></mask></defs><rect x="0" y="0" width="100%" height="100%" mask="url(#mask)"></rect><use xlink:href="#face-ellipse" fill-opacity="0" stroke="white" stroke-width="2"></use></svg><div id="assertive" class="assertive"></div></div>',t.appendChild(n.dom.elwebcam),n.dom.elwebcamLoad=document.createElement("div"),n.dom.elwebcamLoad.innerHTML='<div class="loading_request"><div class="FaceCircularProgress-root FaceCircularProgress-colorPrimary FaceCircularProgress-indeterminate" role="progressbar" style="width: 40px; height: 40px;"><svg class="FaceCircularProgress-svg" viewBox="22 22 44 44"><circle class="FaceCircularProgress-circle FaceCircularProgress-circleIndeterminate" cx="44" cy="44" r="20.2" fill="none" stroke-width="3.6"></circle></svg></div></div>',n.dom.elwebcam.appendChild(n.dom.elwebcamLoad),n.dom.elwebcam.ref=n.dom.elwebcam.getElementsByClassName("webcamRef")[0],n.dom.elwebcam.faceDetact=n.dom.elwebcam.getElementsByClassName("face_detect_age")[0],n.dom.elwebcam.facePosition=n.dom.elwebcam.getElementsByClassName("face_position")[0],n.dom.elwebcam.lookStraight=n.dom.elwebcam.getElementsByClassName("look_straight")[0],n.dom.elwebcam.ref.width=this.width,n.dom.elwebcam.ref.height=this.height;var i=this;(new kt).start(n.dom.elwebcam.ref,this.errorCameraPermission).then((function(t){i.facePosition=new vt(n.dom.elwebcam.ref,n.dom.elwebcam.faceDetact,e.width,e.height,(function(e){return i.setPosition(e)}),(function(){return i.loadingDetection()}));})).catch((function(e){}));}},{key:"setPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.gl,n=this;if(1===e.length&&!this.fixStatus){var i=t.dom.elIframe.contentDocument.getElementById("face_age_analyzer");if(i&&t.dom.elwebcam.ref){var r=i.getBoundingClientRect().width,o=i.getBoundingClientRect().height,a=t.dom.elwebcam.ref.offsetWidth,s=t.dom.elwebcam.ref.offsetHeight,l=a-r,c=e[0],u=a*(100*c.width)/100*100/r,h=s*(100*c.height)/100*100/o,d=100*c.yCenter,p=100*(a*(100*c.xCenter)/100-l/2)/r,f=100*c.landmarks[2].y,g=100*c.landmarks[2].x;Math.round(g)-Math.round(p)>u/3&&Math.round(g)-Math.round(p)<u/2.5*1.5&&Math.round(f)-Math.round(d)>h/3&&Math.round(f)-Math.round(d)<h/2.5*1.5?this.lookStraight=!0:this.lookStraight=!1;var m=!1,v=!1,y=!1;if(u>=55&&(u>85?this.logs="Your distance is close to the camera":(this.logs=null,m=!0)),p>=10&&p<35&&(v=!0),d>=15&&d<75&&(y=!0),m&&v&&y)if(this.logs=null,this.facePosition=!0,this.lookStraight){if(!this.ready){this.ready=!0;var b=3;n.timeInv=setInterval((function(){n.isCountry=b,b<=1?n.setSnap||(n.setSnap=!0,clearInterval(n.timeInv),setTimeout((function(){n.flash=!0,n.capture();}),700)):b=--b;}),800);}}else this.ready=!1,this.isCountry=0,clearInterval(n.timeInv);else m?(this.facePosition=!1,this.logs="Keep your face inside the circle",this.ready=!1,this.isCountry=0,clearInterval(n.timeInv)):(this.facePosition=!1,this.ready=!1,this.isCountry=0,clearInterval(n.timeInv));}}if(t.dom.elwebcam.facePosition.style.backgroundColor=this.facePosition?"rgb(0, 218, 100)":"rgb(218, 0, 92)",t.dom.elwebcam.facePosition.getElementsByClassName("value")[0].innerHTML=this.facePosition?"Good":"Not Good",t.dom.elwebcam.getElementsByClassName("face-ellipse")[0]&&(t.dom.elwebcam.getElementsByClassName("face-ellipse")[0].style.stroke=this.facePosition?"rgba(255,255,255,0.32)":"#fff"),t.dom.elwebcam.lookStraight.style.backgroundColor=this.lookStraight?"rgb(0, 218, 100)":"rgb(218, 0, 92)",t.dom.elwebcam.lookStraight.getElementsByClassName("value")[0].innerHTML=this.lookStraight?"Good":"Not Good",t.dom.elwebcam.getElementsByClassName("assertive")[0]){var w=t.dom.elwebcam.getElementsByClassName("assertive")[0];e.length<=0?w.innerHTML="Please stand in front of the camera":e.length>1?w.innerHTML="There is more than one person in the picture":this.logs?w.innerHTML=this.logs:this.isCountry?w.innerHTML='<div class="countryPhoto">'+this.isCountry+"</div>":w.innerHTML="";}}},{key:"capture",value:function(){var e=this.gl;if(clearInterval(this.timeInv),e.imageWebCam)return !1;var t=new kt;e.imageWebCam=t.snap(e.dom.elwebcam.ref),t.stop();var n='<div><div style="display: flex; justify-content: center;"><div style="position: relative;"><img src="'+e.imageWebCam+'" alt="" style="width: auto; height: 480px; max-height: 480px; position: relative;"></div></div><div class="faceActionSubmit"><button class="FaceButtonBase-root FaceIconButton-root handle-back" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"></path></svg></span><span class="FaceTouchRipple-root"></span></button><button class="FaceButtonBase-root FaceIconButton-root handle-submit" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"></path></svg></span><span class="FaceTouchRipple-root"></span></button></div></div>';e.dom.elwebcam.innerHTML=n,e.dom.elwebcam.handleImage=e.dom.elwebcam.getElementsByClassName("handle-submit")[0],e.dom.elwebcam.handleBack=e.dom.elwebcam.getElementsByClassName("handle-back")[0];var i=this;e.dom.elwebcam.handleImage.addEventListener("click",(function(){i.handleSubmit(e.imageWebCam);})),e.dom.elwebcam.handleBack.addEventListener("click",(function(){e.dom.elwebcam.innerHTML="",e.imageWebCam=null,i.isCountry=0,i.ready=!1,i.setSnap=!1,i.image=null,i.logs=null,i.facePosition=!1,i.lookStraight=!1,i.render();}));}},{key:"errorCameraPermission",value:function(e){var t='<div><div class="mainDragArea"><div class="dragArea" style="height: 480px;"><svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="DirtyLensTwoToneIcon"><path d="M14.12 5H9.88L8.05 7H4v12h7.27c.14-.98.42-2.05-.16-2.43-.89-.59-1.27 2.06-2.8 1.35-1.39-1.12 1.05-1.29.5-3.27-.22-.79-2.28.36-2.4-1.24-.08-1 1.49-.74 1.51-1.49.03-.75-1.03-1.05-.25-1.91.22-.24.71-.26.91-.19.79.27 1.55 1.82 2.51 1.19 1.03-.66-1.88-2.35 0-2.86 1.64-.44 1.31 2.08 2.65 2.44 1.94.52 2.65-4.55 4.41-2.33 1.85 2.33-3.43 2.27-2.85 4.01.34 1.01 2.15-1.2 2.76.53.64 1.83-3.09.82-3.04 1.66.06.83 2.41.55 1.64 2.12-1.14 1.86-3-1.03-3.81.09-.39.57-.09 1.49.13 2.33H20V7h-4.05l-1.83-2zM19 17.15c0 .48-.38.86-.86.86-.47 0-.86-.38-.86-.86s.38-.86.86-.86c.47 0 .86.38.86.86z" opacity=".3"></path><path d="M20 5h-3.17L15 3H9L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 14h-7.02c-.22-.84-.52-1.76-.13-2.33.81-1.12 2.67 1.77 3.81-.09.77-1.57-1.58-1.29-1.64-2.12-.05-.84 3.68.17 3.04-1.66-.61-1.73-2.42.48-2.76-.53-.58-1.74 4.7-1.68 2.85-4.01-1.76-2.22-2.47 2.85-4.41 2.33-1.34-.36-1.01-2.88-2.65-2.44-1.88.51 1.03 2.2 0 2.86-.96.63-1.72-.92-2.51-1.19-.2-.07-.69-.05-.91.19-.78.86.28 1.16.25 1.91-.02.75-1.59.49-1.51 1.49.12 1.6 2.18.45 2.4 1.24.55 1.98-1.89 2.15-.5 3.27 1.53.71 1.91-1.94 2.8-1.35.58.38.3 1.45.16 2.43H4V7h4.05l1.83-2h4.24l1.83 2H20v12z"></path><path d="M17.28 17.15c0 .48.39.86.86.86.48 0 .86-.38.86-.86s-.39-.86-.86-.86c-.48 0-.86.38-.86.86z"></path></svg><div class="headerBox">Error</div><div class="support">'+("NotAllowedError"===e||"PermissionDeniedError"===e?"Camera permission denied.":"Unable to access the camera.")+"</div></div></div></div>";this.gl.dom.elwebcam.innerHTML=t;}},{key:"loadingDetection",value:function(){this.gl.dom.elwebcamLoad.style.display="none",this.detection=!0;}},{key:"stop",value:function(){(new kt).stop();}}],n&&Et(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_t=n(129),jt=n.n(_t);function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Pt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,At(i.key),i);}}function Lt(e,t,n){return (t=At(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function At(e){var t=function(e,t){if("object"!==Tt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Tt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===Tt(t)?t:String(t)}var It=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:360,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:480,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt(this,"fileUrl",null),Lt(this,"image",null),Lt(this,"logs",null),this.el=t,this.gl=n,this.width=i,this.height=r,this.handleSubmit=o,this.loading=a,this.handelDragOver=this.handelDragOver.bind(this),this.handelDragLeave=this.handelDragLeave.bind(this),this.handelDrop=this.handelDrop.bind(this),this.handelClick=this.handelClick.bind(this),this.handelChangeInput=this.handelChangeInput.bind(this),this.displayFile=this.displayFile.bind(this),this.showCropMode=this.showCropMode.bind(this),this.render();}var t,n;return t=e,(n=[{key:"render",value:function(){var e=this,t=this.el,n=this.gl;n.dom.elupload=document.createElement("div");var i='<div class="mainDragArea"><div class="dragArea" style="height: '+this.height+'px;"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 40px; height: 40px;"><path d="M8 16h12V4H8v12zm3.5-4.33l1.69 2.26 2.48-3.09L19 15H9l2.5-3.33z" opacity=".3"></path><path d="M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-2 0H8V4h12v12zm-4.33-5.17l-2.48 3.09-1.69-2.25L9 15h10zM4 22h14v-2H4V6H2v14c0 1.1.9 2 2 2z"></path></svg><div class="headerBox dragTitle">Drag & Drop</div><div class="headerBox">Or <span class="buttonUpload">browse</span></div><input type="file" class="upload_file_image" id="upload_file_image" hidden=""><span class="support">Supports: JPEG, JPG, PNG</span></div></div>';n.dom.elupload.innerHTML=i,t.appendChild(n.dom.elupload),n.dom.elupload.dragArea=n.dom.elupload.getElementsByClassName("dragArea")[0],this.dragTitle=n.dom.elupload.getElementsByClassName("dragTitle")[0],n.dom.elupload.buttonUpload=n.dom.elupload.getElementsByClassName("buttonUpload")[0],n.dom.elupload.uploadFile=n.dom.elupload.getElementsByClassName("upload_file_image")[0],n.dom.elupload.dragArea.addEventListener("dragover",this.handelDragOver),n.dom.elupload.dragArea.addEventListener("dragleave",this.handelDragLeave),n.dom.elupload.dragArea.addEventListener("drop",this.handelDrop),n.dom.elupload.buttonUpload.addEventListener("click",(function(){return e.handelClick(n.dom.elupload.uploadFile)})),n.dom.elupload.uploadFile.addEventListener("change",(function(t){return e.handelChangeInput(t)}));}},{key:"handelDragOver",value:function(e){e.preventDefault(),this.dragTitle.innerHTML="Release to Upload",e.target.classList.add("active");}},{key:"handelDragLeave",value:function(e){this.dragTitle.innerHTML="Drag & Drop",e.target.classList.remove("active");}},{key:"handelDrop",value:function(e){e.preventDefault();var t=e.dataTransfer.files[0];t&&this.displayFile(t),this.dragTitle.innerHTML="Drag & Drop",e.target.classList.remove("active");}},{key:"handelClick",value:function(e){e&&e.click();}},{key:"handelChangeInput",value:function(e){var t=e.target.files[0];t&&this.displayFile(t);}},{key:"displayFile",value:function(e){var t=this,n=e.type;if(["image/png","image/jpeg","image/jpg"].includes(n)){var i=new FileReader;i.onload=function(){t.fileUrl=i.result,t.cropImage();},i.readAsDataURL(e);}}},{key:"cropImage",value:function(){var e=this.el,t=this.gl;t.dom.elupload.remove(),t.dom.elupload=document.createElement("div");var n='<div class="mainDragArea"><div class="cropImg" style="height: '+this.height+'px;"><div style="display: block; width: 100%;" class="face_crop_img"></div></div></div><div class="faceAction_upload"><button class="FaceButtonBase-root FaceIconButton-root handle-back" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"></path></svg></span><span class="FaceTouchRipple-root"></span></button><button class="FaceButtonBase-root FaceIconButton-root handle-submit" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"></path></svg></span><span class="FaceTouchRipple-root"></span></button></div>';t.dom.elupload.innerHTML=n,e.appendChild(t.dom.elupload),t.dom.eluploadLoad=document.createElement("div"),t.dom.eluploadLoad.innerHTML='<div class="loading_request"><div class="FaceCircularProgress-root FaceCircularProgress-colorPrimary FaceCircularProgress-indeterminate" role="progressbar" style="width: 40px; height: 40px;"><svg class="FaceCircularProgress-svg" viewBox="22 22 44 44"><circle class="FaceCircularProgress-circle FaceCircularProgress-circleIndeterminate" cx="44" cy="44" r="20.2" fill="none" stroke-width="3.6"></circle></svg></div></div>',t.dom.elupload.appendChild(t.dom.eluploadLoad),t.dom.elupload.faceCropImg=t.dom.elupload.getElementsByClassName("face_crop_img")[0],t.dom.elupload.faceCropImg.image=document.createElement("img"),lt.setAttrs(t.dom.elupload.faceCropImg.image,{id:"face_image",src:this.fileUrl}),t.dom.elupload.faceCropImg.appendChild(t.dom.elupload.faceCropImg.image);var i=this;new vt(t.dom.elupload.faceCropImg.image,null,this.width,this.height,(function(e){return i.showCropMode(e)}),(function(){return i.loadingDetection()}),"image"),t.dom.elupload.handleImage=t.dom.elupload.getElementsByClassName("handle-submit")[0],t.dom.elupload.handleBack=t.dom.elupload.getElementsByClassName("handle-back")[0],t.dom.elupload.handleImage.addEventListener("click",(function(){i.handleSubmit(i.image);})),t.dom.elupload.handleBack.addEventListener("click",(function(){t.dom.elupload.innerHTML="",i.image=null,i.render();}));}},{key:"showCropMode",value:function(e){var t=this.gl,n=t.dom.elupload.faceCropImg.image.naturalWidth,i=t.dom.elupload.faceCropImg.image.naturalHeight,r=this,o=e[0],a=n*(100*o.width)/100,s=i*(100*o.height)/100,l=i*(100*o.yCenter)/100,c=n*(100*o.xCenter)/100,u=document.createElement("div");e.length<=0?u.innerHTML='<div style="background: rgb(255, 255, 255); border-radius: 10px; padding: 8px 15px; margin-bottom: 10px; position: absolute; top: 15px; left: 10px; right: 10px;">Please stand in front of the camera</div>':e.length>1&&(u.innerHTML='<div style="background: rgb(255, 255, 255); border-radius: 10px; padding: 8px 15px; margin-bottom: 10px; position: absolute; top: 15px; left: 10px; right: 10px;">There is more than one person in the picture, please select one person\'s picture.</div>'),t.dom.elupload.faceCropImg.appendChild(u);var h=new(jt())(t.dom.elupload.faceCropImg.image,{aspectRatio:15/18,guides:!1,zoomable:!1,data:{x:c/1.6,y:l/2.5,width:a+2*(c-c/1.6),height:s+2*(l-l/2.5)},crop:function(e){var t=h.getCroppedCanvas({maxWidth:4096,maxHeight:4096}).toDataURL("image/jpeg");r.image=t;}});}},{key:"loadingDetection",value:function(){this.gl.dom.eluploadLoad.style.display="none";}}])&&Pt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dt(e){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(e)}function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i);}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){Ht(e,t,n[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));}));}return e}function Nt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,zt(i.key),i);}}function Ht(e,t,n){return (t=zt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zt(e){var t=function(e,t){if("object"!==Dt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Dt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===Dt(t)?t:String(t)}var Gt="".concat("https://").concat("core.getfaceage.com").concat("/api/"),Wt={authorize:"v1/business/authorize",skinanalyze:"v1/skin-analyzer/analyze"},Ut={baseURL:Gt,responseType:"json"},Yt={Accept:"application/json","Content-Type":"application/json"},Xt=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ht(this,"session",void 0),Ht(this,"request",(function(e,n,i,r,o){var a=Ft(Ft({},Ut),{},{headers:Ft(Ft({},Yt),r)},o),s=n;n in Wt&&(s=Wt[n]);var l=e.toLowerCase();switch(l){case"get":case"options":case"head":case"delete":return t.session[l](s,a);case"post":case"patch":case"put":return t.session[l](s,i,a)}return null})),this.session=Fe.create(Ft({},Ut));}var t,n;return t=e,n=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&Nt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Ht(Xt,"instance",void 0);const qt=Xt.getInstance();function Vt(e){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(e)}function Jt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Kt(i.key),i);}}function $t(e,t,n){return (t=Kt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kt(e){var t=function(e,t){if("object"!==Vt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Vt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===Vt(t)?t:String(t)}var Qt=function(){function e(t,n,i,r,o,a,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$t(this,"dataReport",null),$t(this,"wrinklesPoint",null),$t(this,"eyeWrinklesPoint",null),$t(this,"darkCirclePoint",null),$t(this,"pigmentPoint",null),$t(this,"deepWrinklesPoint",null),$t(this,"eyeBagPoint",null),this.el=t,this.gl=n.globals,this.co=n.config,this.image=i,this.width=r,this.height=o,this.back=a,this.onSet=s,this.submitData=this.submitData.bind(this),this.getImagePoint=this.getImagePoint.bind(this),this.render();}var t,n;return t=e,(n=[{key:"render",value:function(){var e=this.gl;e.dom.elPreviewImage=document.createElement("div"),lt.setAttrs(e.dom.elPreviewImage,{class:"imageSubmit"}),e.dom.elPreviewImage.imageLoad=document.createElement("div"),lt.setAttrs(e.dom.elPreviewImage.imageLoad,{class:"imageLoad",style:"max-height: "+this.height+"px"}),e.dom.elPreviewImage.fix=document.createElement("div"),lt.setAttrs(e.dom.elPreviewImage.fix,{style:"display: flex; justify-content: center;"}),e.dom.elPreviewImage.boxrelative=document.createElement("div"),lt.setAttrs(e.dom.elPreviewImage.boxrelative,{style:"position: relative;"}),e.dom.elPreviewImage.fix.appendChild(e.dom.elPreviewImage.boxrelative),e.dom.elPreviewImage.imageLoad.appendChild(e.dom.elPreviewImage.fix),e.dom.elPreviewImage.appendChild(e.dom.elPreviewImage.imageLoad),this.el.appendChild(e.dom.elPreviewImage),this.showPreview(),this.submitSkinAnalyze(this.image);}},{key:"showPreview",value:function(){var e=this.gl,t='<div style="position: relative"><div class="loader_preview_image"><div class="face_loader_text"><ul class="content__container__list"><li class="content__container__list__item">Sending Facial Data...</li><li class="content__container__list__item">Scanning Face...</li><li class="content__container__list__item">Analyzing Facial Attributes...</li><li class="content__container__list__item">AI Crafting Report..</li></ul></div><div class="bounding_box" style="display: none"><div class="face_loader face_loader-2"><div class="loader-circles"></div><div class="loader-diamond"></div><div class="loader-groove"></div></div></div></div><img class="image_face_preview" src="'+this.image+'" style="width: auto; height: 480px; max-height: 480px; position: relative;"></div>';e.dom.elPreviewImage.preview=document.createElement("div"),e.dom.elPreviewImage.preview.innerHTML=t,e.dom.elPreviewImage.boxrelative.appendChild(e.dom.elPreviewImage.preview),e.dom.elPreviewImage.preview.image=e.dom.elPreviewImage.preview.getElementsByClassName("image_face_preview")[0],e.dom.elPreviewImage.preview.boundingBox=e.dom.elPreviewImage.preview.getElementsByClassName("bounding_box")[0];var n=this;new vt(e.dom.elPreviewImage.preview.image,null,this.width,this.height,(function(e){return n.showCropMode(e)}),(function(){return n.loadingDetection()}),"image");}},{key:"showCropMode",value:function(e){var t=this.gl,n=e[0];lt.setAttrs(t.dom.elPreviewImage.preview.boundingBox,{style:"position: absolute; top: "+100*n.yCenter+"%; left: "+100*n.xCenter+"%; width: "+100*n.width+"%; height: "+100*n.height+"%; z-index: 99999999; display: block"});}},{key:"loadingDetection",value:function(){this.gl;}},{key:"submitSkinAnalyze",value:function(e){var t=this,n=this.gl;return new Promise((function(i,r){var o=t;fetch(e).then((function(e){return e.blob()})).then((function(e){var t,i=new File([e],Math.random()+".jpeg",{type:"image/jpeg"}),r=new FormData;r.append("file",i),r.append("faceageId",n.faceageId),null===(t=qt.request("POST","skinanalyze",r,{"Content-Type":"multipart/form-data"}))||void 0===t||t.then((function(e){e.data.message?(o.onSet&&o.onSet(!1),console.error(e.data.message)):e.data.data.image?(n.skinAnalyzeData=e.data.data,o.onSet&&o.onSet(!0),o.submitData(e.data.data),n.onload&&n.onload(e.data.data)):(o.onSet&&o.onSet(!1),console.error("There is a problem processing your image from our service side."));})).catch((function(e){if(o.onSet&&o.onSet(!1),e.response&&e.response.data.message&&422===e.response.status)if(e.response.data.errors){var t=e.response.data.errors;Object.keys(t).forEach((function(e){t[e][0]?console.error(t[e][0]):console.error(t[e]);}));}else console.error(e.response.data.message);else console.error(e);}));}));}))}},{key:"submitData",value:function(e){var t=this.gl;t.dom.elPreviewImage.boxrelative.innerHTML="",t.dom.elPreviewImage.finalImage=document.createElement("img"),lt.setAttrs(t.dom.elPreviewImage.finalImage,{id:"face_age_analyzer_image_server",class:"face_age_analyzer_image_server",src:"data:image/jpeg;base64,"+e.image,style:"width: auto; height: "+this.height+"px; max-height: "+this.height+"px; position: relative;"}),t.dom.elPreviewImage.boxrelative.appendChild(t.dom.elPreviewImage.finalImage);var n=this;this.dataReport=e,t.showFacePoint&&t.dom.elPreviewImage.finalImage.addEventListener("load",n.getImagePoint),t.dom.elPreviewImage.backico=document.createElement("div"),t.dom.elPreviewImage.backico.innerHTML='<button class="FaceButtonBase-root FaceIconButton-root FaceChangeBackMode backRepetition" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"></path></svg></span><span class="FaceTouchRipple-root"></span></button>',t.dom.elPreviewImage.appendChild(t.dom.elPreviewImage.backico),t.dom.elPreviewImage.backico.querySelector(".FaceChangeBackMode").addEventListener("click",(function(){n.back();}));}},{key:"getImagePoint",value:function(e){var t=this.gl,n=this.co,i=e.target.naturalWidth,r=e.target.naturalHeight,o=e.target.getBoundingClientRect().width,a=e.target.getBoundingClientRect().height,s=i/o,l=r/a,c=this.el;if(c){var u=(o-c.getBoundingClientRect().width)/2;u=u<0?-1*u:u;var h=(a-c.getBoundingClientRect().height)/2;h=h<0?-1*h:h;var d=JSON.parse(this.dataReport.points.wrinkles)[0]/s-u,p=JSON.parse(this.dataReport.points.wrinkles)[1]/l-h,f=JSON.parse(this.dataReport.points.eye_wrinkles)[0]/s-u,g=JSON.parse(this.dataReport.points.eye_wrinkles)[1]/l-h,m=JSON.parse(this.dataReport.points.dark_circle)[0]/s-u,v=JSON.parse(this.dataReport.points.dark_circle)[1]/l-h,y=JSON.parse(this.dataReport.points.pigment)[0]/s-u,b=JSON.parse(this.dataReport.points.pigment)[1]/l-h,w=JSON.parse(this.dataReport.points.deep_wrinkles)[0]/s-u,x=JSON.parse(this.dataReport.points.deep_wrinkles)[1]/l-h,C=JSON.parse(this.dataReport.points.eye_bag)[0]/s-u,k=JSON.parse(this.dataReport.points.eye_bag)[1]/l-h,S=[];S.push(n.access.includes("wrinkles")?'<div id="point_wrinkles" style="left: '+d+"px; top: "+p+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),S.push(n.access.includes("dark_circle")?'<div id="point_darkCircle" style="left: '+m+"px; top: "+v+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),S.push(n.access.includes("pigment")?'<div id="point_pigment" style="left: '+y+"px; top: "+b+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),S.push(n.access.includes("deep_wrinkles")?'<div id="point_deepWrinkles" style="left: '+w+"px; top: "+x+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),S.push(n.access.includes("eye_bag")?'<div id="point_eyeBag" style="left: '+C+"px; top: "+k+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),S.push(n.access.includes("eye_wrinkles")?'<div id="point_eyeWrinkles" style="left: '+f+"px; top: "+g+'px; position: absolute; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgb(218, 0, 92);"></div>':null),t.dom.elPreviewImage.imageLoad.point=document.createElement("div"),lt.setAttrs(t.dom.elPreviewImage.imageLoad.point,{style:"position: absolute;z-index: 2;top: 0;left: 0;right: 0;bottom: 0;"}),t.dom.elPreviewImage.imageLoad.point.innerHTML=S.join(),t.dom.elPreviewImage.imageLoad.appendChild(t.dom.elPreviewImage.imageLoad.point);}}}])&&Jt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function en(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,tn(i.key),i);}}function tn(e){var t=function(e,t){if("object"!==Zt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Zt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===Zt(t)?t:String(t)}var nn=function(){function e(t,n){var i,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:360,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:480;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i=this,(r=tn(r="loading"))in i?Object.defineProperty(i,r,{value:false,enumerable:!0,configurable:!0,writable:!0}):i[r]=false,this.ctx=n,this.w=n.w,this.el=t,this.width=a,this.height=s,this.onSet=o,this.handleSubmit=this.handleSubmit.bind(this),this.restart=this.restart.bind(this),this.callBack=this.callBack.bind(this),this.render();}var t,n;return t=e,(n=[{key:"render",value:function(){var e=this.w.globals;e.dom.elFace=document.createElement("div"),lt.setAttrs(e.dom.elFace,{id:"analyzer_box",class:"face_age",style:"position: relative"}),e.dom.elFace.analyzer=document.createElement("div"),lt.setAttrs(e.dom.elFace.analyzer,{id:"face_age_analyzer",class:"talosFaceSkin",style:"width: "+this.width+"px; height: "+this.height+"px; max-width: "+this.width+"px; max-height: "+this.height+"px"}),e.showCamera?this.showWebCam(e.dom.elFace.analyzer,e):this.showUpload(e.dom.elFace.analyzer,e),e.dom.elFace.appendChild(e.dom.elFace.analyzer),this.el.appendChild(e.dom.elFace),this.showFaceAge();}},{key:"showWebCam",value:function(e,t){var n=this,i=new Ot(e,t,this.width,this.height,this.handleSubmit,this.loading);if(t.showUpload){var r=document.createElement("div");lt.setAttrs(r,{class:"faceAction"}),r.innerHTML='<button class="FaceButtonBase-root FaceChangeMode FaceIconButton-root" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"></path></svg></span><span class="FaceTouchRipple-root"></span></button>',e.appendChild(r);var o=e.querySelector(".FaceChangeMode"),a=this;o.addEventListener("click",(function(){e.innerHTML="",t.imageWebCam=null,i.stop(),a.showUpload(e,t,n.width,n.height);}));}}},{key:"showUpload",value:function(e,t){var n=this;if(new It(e,t,this.width,this.height,this.handleSubmit,this.loading),t.showCamera){var i=document.createElement("div");lt.setAttrs(i,{class:"faceAction"}),i.innerHTML='<button class="FaceButtonBase-root FaceChangeWebcamMode FaceIconButton-root" tabindex="0" type="button"><span class="FaceIconButton-label"><svg viewBox="0 0 24 24" fill="currentColor" style="width: 24px; height: 24px;"><path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h4.05l1.83-2h4.24l1.83 2H20v12zM12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"></path></svg></span><span class="FaceTouchRipple-root"></span></button>',e.appendChild(i);var r=e.querySelector(".FaceChangeWebcamMode"),o=this;r.addEventListener("click",(function(){e.innerHTML="",o.showWebCam(e,t,n.width,n.height);}));}}},{key:"handleSubmit",value:function(e){var t=this.w.globals;t.dom.elFace.analyzer.innerHTML="",new Qt(t.dom.elFace.analyzer,this.w,e,this.width,this.height,this.restart,this.callBack);}},{key:"restart",value:function(){var e=this.w.globals;e.imageWebCam=null,e.skinAnalyzeData=[],this.el.innerHTML="",this.onSet&&this.onSet(),this.render();}},{key:"showFaceAge",value:function(){var e=this.w.globals;e.showCopyRight&&(e.dom.elFace.copyRight=document.createElement("div"),lt.setAttrs(e.dom.elFace.copyRight,{style:"position: absolute; bottom: 5px; left: 0px; right: 0px; text-align: center; font-size: 10px; color: #ffffffa8; z-index: 3;text-shadow: 0px 1px 0px #00000075;"}),e.dom.elFace.copyRight.innerHTML='Powered by <a href="https://getfaceage.com/" target="_blank" style="color: #ffffffa8; text-decoration: none">Face Age</a>',this.el.appendChild(e.dom.elFace.copyRight));}},{key:"callBack",value:function(e){var t=this.w.globals;e&&t.skinAnalyzeData&&this.onSet&&this.onSet(t.skinAnalyzeData);}}])&&en(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rn(e){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rn(e)}function on(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,sn(i.key),i);}}function an(e,t,n){return (t=sn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e){var t=function(e,t){if("object"!==rn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==rn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===rn(t)?t:String(t)}var ln=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:360,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:480;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),an(this,"screenSize",{width:0,height:0}),an(this,"showMode",null),this.ctx=n,this.w=n.w,this.width=i,this.height=r,this.el=t,this.dataList=[{key:"darkCircle",keyServer:"dark_circle",title:"Dark Circle",rate:10,point:!0,showLeft:!0,showSmLeft:!0,showSm:!1},{key:"eyeBag",keyServer:"eye_bag",title:"Eye bag",rate:10,point:!0,showLeft:!0,showSmLeft:!0,showSm:!1},{key:"eyeWrinkles",keyServer:"eye_wrinkles",title:"Eye Wrinkles",rate:10,point:!0,showLeft:!0,showSmLeft:!1,showSm:!0},{key:"deepWrinkles",keyServer:"deep_wrinkles",title:"Deep Wrinkles",rate:10,point:!0,showLeft:!0,showSmLeft:!1,showSm:!1},{key:"wrinkles",keyServer:"wrinkles",title:"Wrinkles",rate:10,point:!0,showLeft:!1,showSmLeft:!0,showSm:!1},{key:"acnes",keyServer:"acnes",title:"Acnes",rate:1,point:!1,showLeft:!1,showSmLeft:!1,showSm:!1},{key:"pores",keyServer:"pores",title:"Pores",rate:10,point:!1,showLeft:!1,showSmLeft:!1,showSm:!1},{key:"pigment",keyServer:"pigment",title:"Pigment",rate:10,point:!0,showLeft:!1,showSmLeft:!1,showSm:!1}],this.mobileSort=["eyeBag","darkCircle","wrinkles","eyeWrinkles","deepWrinkles","pigment","acnes","pores"],this.updateDimension=this.updateDimension.bind(this),this.getCurrentDimension=this.getCurrentDimension.bind(this),this.convert_position_angel=this.convert_position_angel.bind(this),this.showItemBox=this.showItemBox.bind(this),this.showLine=this.showLine.bind(this),this.render();}var t,n;return t=e,n=[{key:"render",value:function(){var e=this.w.globals;e.dom.elFace=document.createElement("div"),lt.setAttrs(e.dom.elFace,{class:"face_age"}),e.dom.elFaceGridContainer=document.createElement("div"),lt.setAttrs(e.dom.elFaceGridContainer,{class:"FaceContainer-root FaceGrid-root FaceGrid-container FaceGrid-spacing-xs-3"}),e.dom.elFace.appendChild(e.dom.elFaceGridContainer),this.el.appendChild(e.dom.elFace),this.updateDimension(),"undefined"!=typeof window&&window.addEventListener("resize",this.updateDimension);}},{key:"getCurrentDimension",value:function(){return {width:"undefined"==typeof window?0:window.innerWidth,height:"undefined"==typeof window?0:window.innerHeight}}},{key:"updateDimension",value:function(){var e=this.w.globals;this.screenSize=this.getCurrentDimension(),this.screenSize.width>995?"md"!==this.showMode&&(this.showMode="md",e.dom.elIframe.style.height=this.w.config.iframeHeight||e.iframeHeight,e.dom.elFaceGridContainer.innerHTML="",e.imageWebCam=null,e.skinAnalyzeData=[],this.showMd()):"xs"!==this.showMode&&(this.showMode="xs",e.dom.elIframe.style.height="935px",e.dom.elFaceGridContainer.innerHTML="",e.imageWebCam=null,e.skinAnalyzeData=[],this.showSm());}},{key:"showMd",value:function(){var e=this.w.globals;e.dom.elGidLef=document.createElement("div"),lt.setAttrs(e.dom.elGidLef,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-12 FaceGrid-grid-md-4",style:"text-align: center;"}),e.dom.elFaceGridContainer.appendChild(e.dom.elGidLef),e.dom.elGidSkin=document.createElement("div"),lt.setAttrs(e.dom.elGidSkin,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-12 FaceGrid-grid-md-4",style:"padding-top: 26px;"}),e.dom.elFaceGridContainer.appendChild(e.dom.elGidSkin),e.dom.elGidRight=document.createElement("div"),lt.setAttrs(e.dom.elGidRight,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-12 FaceGrid-grid-md-4",style:"text-align: center;"}),e.dom.elFaceGridContainer.appendChild(e.dom.elGidRight),this.showItemBox(!1),this.showFaceSkin(e.dom.elGidSkin);}},{key:"showSm",value:function(){var e=this.w.globals;e.dom.elGidSkin=document.createElement("div"),lt.setAttrs(e.dom.elGidSkin,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-12 FaceGrid-grid-md-12",style:"padding-top: 26px;"}),e.dom.elFaceGridContainer.appendChild(e.dom.elGidSkin),e.dom.elGidmain=document.createElement("div"),lt.setAttrs(e.dom.elGidmain,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-12 FaceGrid-grid-md-12"}),e.dom.elGidmain.root=document.createElement("div"),lt.setAttrs(e.dom.elGidmain.root,{class:"FaceGrid-root FaceGrid-container FaceGrid-spacing-xs-2"}),e.dom.elGidmain.appendChild(e.dom.elGidmain.root),e.dom.elFaceGridContainer.appendChild(e.dom.elGidmain),this.showItemBox(!0),this.showFaceSkin(e.dom.elGidSkin);}},{key:"showFaceSkin",value:function(e){var t=this,n=this.w.globals;n.dom.elGidSkin.faceSkin=document.createElement("div"),lt.setAttrs(n.dom.elGidSkin.faceSkin,{id:"analyzer_main_box",style:"position: relative; margin: 0 auto; max-width: "+this.width+"px; max-height: "+this.height+"px"}),e.appendChild(n.dom.elGidSkin.faceSkin),new nn(n.dom.elGidSkin.faceSkin,this.ctx,(function(){return t.showLine(n.dom.elGidSkin.faceSkin)}));}},{key:"showLine",value:function(e){var t=this.w.globals;t.dom.elGidSkin&&t.dom.elGidSkin.main&&t.dom.elGidSkin.main.remove(),this.showItemBox("md"!==this.showMode),t.showFacePoint&&(t.dom.elGidSkin.main=document.createElement("div"),t.dom.elGidSkin.dashWrinkles=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashWrinkles,{id:"dash_wrinkles"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashWrinkles),t.dom.elGidSkin.dashEyeWrinkles=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashEyeWrinkles,{id:"dash_eyeWrinkles"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashEyeWrinkles),t.dom.elGidSkin.dashDarkCircle=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashDarkCircle,{id:"dash_darkCircle"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashDarkCircle),t.dom.elGidSkin.dashPigment=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashPigment,{id:"dash_pigment"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashPigment),t.dom.elGidSkin.dashDeepWrinkles=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashDeepWrinkles,{id:"dash_deepWrinkles"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashDeepWrinkles),t.dom.elGidSkin.dashEyeBag=document.createElement("div"),lt.setAttrs(t.dom.elGidSkin.dashEyeBag,{id:"dash_eyeBag"}),t.dom.elGidSkin.main.appendChild(t.dom.elGidSkin.dashEyeBag),e.appendChild(t.dom.elGidSkin.main),"md"===this.showMode?this.showMdLine():this.showXsLine());}},{key:"showItemBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.w.globals,n=this.w.config;t.dom.elGidLef&&(t.dom.elGidLef.innerHTML=""),t.dom.elGidRight&&(t.dom.elGidRight.innerHTML=""),t.dom.elGidmain&&(t.dom.elGidmain.root.innerHTML="");var i=this.dataList;if(e){var r=[];this.mobileSort.map((function(e){i.map((function(t,n){t.key===e&&r.push(t);}));})),i=r;}i.map((function(i,r){if(n.access.includes(i.keyServer)){var o=t.skinAnalyzeData[i.keyServer]?t.skinAnalyzeData[i.keyServer]:0,a='<div class="'+(e?Object.keys(t.skinAnalyzeData).length>0?"sm_itemReport":"sm_itemReport sm_itemReportDisable":Object.keys(t.skinAnalyzeData).length>0?"itemReport":"itemReport itemReportDisable")+'" style="color: '+lt.getLevelColor(o)+';"><div class="image_itemReport '+i.key+'"></div><h4>'+i.title+'</h4><span class="data_item_value">'+Math.round(o)+(i.rate>1?"%":"")+"</span></div>"+(!e&&t.showFacePoint&&i.point&&Object.keys(t.skinAnalyzeData).length>0?'<div class="'+(i.showLeft?"reportLineOrgLeft":"reportLineOrgRight")+'"><div id="start_point_'+i.key+'" class="pointSelect"></div>':"")+(e&&t.showFacePoint&&i.point&&Object.keys(t.skinAnalyzeData).length>0?'<div class="'+(i.showSmLeft?"sm_reportLineOrgLeft":"sm_reportLineOrgRight")+" "+(i.showSm?"sm_reportLineOrgRightSm":"")+'"><div id="start_point_'+i.key+'" class="pointSelect"></div>':"")+"</div>";e?(t.dom.elDataItem=document.createElement("div"),lt.setAttrs(t.dom.elDataItem,{class:"FaceGrid-root FaceGrid-item FaceGrid-grid-xs-4 FaceGrid-grid-md-12"}),t.dom.elDataItem.main=document.createElement("div"),lt.setAttrs(t.dom.elDataItem.main,{style:"position: relative;"}),t.dom.elDataItem.main.innerHTML=a,t.dom.elDataItem.appendChild(t.dom.elDataItem.main),t.dom.elGidmain.root.appendChild(t.dom.elDataItem)):(t.dom.elDataItem=document.createElement("div"),lt.setAttrs(t.dom.elDataItem,{style:"position: relative;"}),t.dom.elDataItem.innerHTML=a,i.showLeft?t.dom.elGidLef.appendChild(t.dom.elDataItem):t.dom.elGidRight.appendChild(t.dom.elDataItem));}}));}},{key:"showMdLine",value:function(){var e=this.w.globals,t=this;setTimeout((function(){var n=e.dom.elIframe.contentDocument,i=n.getElementById("analyzer_box"),r=n.getElementById("point_wrinkles"),o=n.getElementById("dash_wrinkles"),a=n.getElementById("start_point_wrinkles"),s=n.getElementById("point_eyeWrinkles"),l=n.getElementById("dash_eyeWrinkles"),c=n.getElementById("start_point_eyeWrinkles"),u=n.getElementById("point_darkCircle"),h=n.getElementById("dash_darkCircle"),d=n.getElementById("start_point_darkCircle"),p=n.getElementById("point_pigment"),f=n.getElementById("dash_pigment"),g=n.getElementById("start_point_pigment"),m=n.getElementById("point_deepWrinkles"),v=n.getElementById("dash_deepWrinkles"),y=n.getElementById("start_point_deepWrinkles"),b=n.getElementById("point_eyeBag"),w=n.getElementById("dash_eyeBag"),x=n.getElementById("start_point_eyeBag");if(r&&o){var C=a.getBoundingClientRect().top-i.getBoundingClientRect().top,k=a.getBoundingClientRect().left-i.getBoundingClientRect().left,S=i.getBoundingClientRect().width-r.offsetLeft-(i.getBoundingClientRect().width-k)-5;S<0&&(S*=-1);var E=r.offsetTop-C+2;E<0&&(E*=-1);var B={x:k,y:C+E},R={x:k+S,y:C},O=t.convert_position_angel(B,R);if(r.getBoundingClientRect().top<a.getBoundingClientRect().top)var _=90-O;else _=90+O;o.style.position="absolute",o.style.top=C+"px",o.style.left=k+"px",o.style.width=S+"px",o.style.height=E+"px",r.getBoundingClientRect().top<a.getBoundingClientRect().top?o.style.transform="translateX(-100%) translateY(-100%)":o.style.transform="translateX(-100%)",o.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",o.style.border="none";}if(p&&f){var j=g.getBoundingClientRect().top-i.getBoundingClientRect().top,T=g.getBoundingClientRect().left-i.getBoundingClientRect().left,P=i.getBoundingClientRect().width-p.offsetLeft-(i.getBoundingClientRect().width-T)-5;P<0&&(P*=-1);var L=p.offsetTop-j+2;L<0&&(L*=-1),B={x:T,y:j+L},R={x:T+P,y:j},O=t.convert_position_angel(B,R),_=p.getBoundingClientRect().top<g.getBoundingClientRect().top?90-O:90+O,f.style.position="absolute",f.style.top=j+"px",f.style.left=T+"px",f.style.width=P+"px",f.style.height=L+"px",p.getBoundingClientRect().top<g.getBoundingClientRect().top?f.style.transform="translateX(-100%) translateY(-100%)":f.style.transform="translateX(-100%)",f.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",f.style.border="none";}if(s&&l){var A=c.getBoundingClientRect().top-i.getBoundingClientRect().top,I=c.getBoundingClientRect().left-i.getBoundingClientRect().left,D=i.getBoundingClientRect().width-s.offsetLeft-(i.getBoundingClientRect().width-I)-5;D<0&&(D*=-1);var M=s.offsetTop-A+2;M<0&&(M*=-1),B={x:I,y:A+M},R={x:I+D,y:A},O=t.convert_position_angel(B,R),_=s.getBoundingClientRect().top<c.getBoundingClientRect().top?90+O:90-O,l.style.position="absolute",l.style.top=A+"px",l.style.left=I+"px",l.style.width=D+"px",l.style.height=M+"px",s.getBoundingClientRect().top<c.getBoundingClientRect().top&&(l.style.transform="translateY(-100%)"),l.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",l.style.border="none";}if(u&&h){var F=d.getBoundingClientRect().top-i.getBoundingClientRect().top,N=d.getBoundingClientRect().left-i.getBoundingClientRect().left,H=i.getBoundingClientRect().width-u.offsetLeft-(i.getBoundingClientRect().width-N)-5;H<0&&(H*=-1);var z=u.offsetTop-F+2;z<0&&(z*=-1),B={x:N,y:F+z},R={x:N+H,y:F},O=t.convert_position_angel(B,R),_=u.getBoundingClientRect().top<d.getBoundingClientRect().top?90+O:90-O,h.style.position="absolute",h.style.top=F+"px",h.style.left=N+"px",h.style.width=H+"px",h.style.height=z+"px",u.getBoundingClientRect().top<d.getBoundingClientRect().top&&(l.style.transform="translateY(-100%)"),h.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",h.style.border="none";}if(b&&w){var G=x.getBoundingClientRect().top-i.getBoundingClientRect().top,W=x.getBoundingClientRect().left-i.getBoundingClientRect().left,U=i.getBoundingClientRect().width-b.offsetLeft-(i.getBoundingClientRect().width-W)-5;U<0&&(U*=-1);var Y=b.offsetTop-G+2;Y<0&&(Y*=-1),B={x:W,y:G+Y},R={x:W+U,y:G},O=t.convert_position_angel(B,R),_=b.getBoundingClientRect().top<x.getBoundingClientRect().top?90+O:90-O,w.style.position="absolute",w.style.top=G+"px",w.style.left=W+"px",w.style.width=U+"px",w.style.height=Y+"px",b.getBoundingClientRect().top<x.getBoundingClientRect().top&&(w.style.transform="translateY(-100%)"),w.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",w.style.border="none";}if(m&&v){var X=y.getBoundingClientRect().top-i.getBoundingClientRect().top,q=y.getBoundingClientRect().left-i.getBoundingClientRect().left,V=i.getBoundingClientRect().width-m.offsetLeft-(i.getBoundingClientRect().width-q)-5;V<0&&(V*=-1);var J=m.offsetTop-X+2;J<0&&(J*=-1),B={x:q,y:X+J},R={x:q+V,y:X},O=t.convert_position_angel(B,R),_=m.getBoundingClientRect().top<y.getBoundingClientRect().top?90+O:90-O,v.style.position="absolute",v.style.top=X+"px",v.style.left=q+"px",v.style.width=V+"px",v.style.height=J+"px",m.getBoundingClientRect().top<y.getBoundingClientRect().top&&(v.style.transform="translateY(-100%)"),v.style.background="linear-gradient("+_+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",v.style.border="none";}}),200);}},{key:"showXsLine",value:function(){var e=this.w.globals,t=this;setTimeout((function(){var n=e.dom.elIframe.contentDocument,i=n.getElementById("analyzer_box"),r=n.getElementById("point_wrinkles"),o=n.getElementById("dash_wrinkles"),a=n.getElementById("start_point_wrinkles"),s=n.getElementById("point_eyeWrinkles"),l=n.getElementById("dash_eyeWrinkles"),c=n.getElementById("start_point_eyeWrinkles"),u=n.getElementById("point_darkCircle"),h=n.getElementById("dash_darkCircle"),d=n.getElementById("start_point_darkCircle"),p=n.getElementById("point_pigment"),f=n.getElementById("dash_pigment"),g=n.getElementById("start_point_pigment"),m=n.getElementById("point_deepWrinkles"),v=n.getElementById("dash_deepWrinkles"),y=n.getElementById("start_point_deepWrinkles"),b=n.getElementById("point_eyeBag"),w=n.getElementById("dash_eyeBag"),x=n.getElementById("start_point_eyeBag");if(r&&o){var C=a.getBoundingClientRect().top-i.getBoundingClientRect().top,k=a.getBoundingClientRect().left-i.getBoundingClientRect().left,S=r.getBoundingClientRect().top-i.getBoundingClientRect().top,E=r.getBoundingClientRect().left-i.getBoundingClientRect().left,B=i.getBoundingClientRect().width-E-(i.getBoundingClientRect().width-k)-5;B<0&&(B*=-1);var R=S-C+2;R<0&&(R*=-1);var O={x:k,y:C+R},_={x:k+B,y:C},j=t.convert_position_angel(O,_);if(r.getBoundingClientRect().top<a.getBoundingClientRect().top)var T=90-j;else T=90+j;o.style.position="absolute",o.style.top=C+"px",o.style.left=k+"px",o.style.width=B+"px",o.style.height=R+"px",r.getBoundingClientRect().top<a.getBoundingClientRect().top?o.style.transform="translateX(-100%) translateY(-100%)":o.style.transform="translateX(-100%)",o.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",o.style.border="none";}if(p&&f){var P=g.getBoundingClientRect().top-i.getBoundingClientRect().top,L=g.getBoundingClientRect().left-i.getBoundingClientRect().left,A=p.getBoundingClientRect().top-i.getBoundingClientRect().top,I=p.getBoundingClientRect().left-i.getBoundingClientRect().left,D=i.getBoundingClientRect().width-I-(i.getBoundingClientRect().width-L)-5;D<0&&(D*=-1);var M=A-P+2;M<0&&(M*=-1),O={x:L,y:P+M},_={x:L+D,y:P},j=t.convert_position_angel(O,_),T=p.getBoundingClientRect().top<g.getBoundingClientRect().top?90-j:90+j,f.style.position="absolute",f.style.top=P+"px",f.style.left=L+"px",f.style.width=D+"px",f.style.height=M+"px",p.getBoundingClientRect().top<g.getBoundingClientRect().top?f.style.transform="translateX(-100%) translateY(-100%)":f.style.transform="translateX(-100%)",f.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",f.style.border="none";}if(s&&l){var F=c.getBoundingClientRect().top-i.getBoundingClientRect().top,N=c.getBoundingClientRect().left-i.getBoundingClientRect().left,H=s.getBoundingClientRect().top-i.getBoundingClientRect().top,z=s.getBoundingClientRect().left-i.getBoundingClientRect().left,G=i.getBoundingClientRect().width-z-(i.getBoundingClientRect().width-N)-5;G<0&&(G*=-1);var W=H-F+2;W<0&&(W*=-1),O={x:N,y:F+W},_={x:N+G,y:F},j=t.convert_position_angel(O,_),T=s.getBoundingClientRect().top<c.getBoundingClientRect().top?90+j:90-j,l.style.position="absolute",l.style.top=F+"px",l.style.left=N+"px",l.style.width=G+"px",l.style.height=W+"px",s.getBoundingClientRect().top<c.getBoundingClientRect().top&&(l.style.transform="translateY(-100%)"),l.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",l.style.border="none";}if(u&&h){var U=d.getBoundingClientRect().top-i.getBoundingClientRect().top,Y=d.getBoundingClientRect().left-i.getBoundingClientRect().left,X=u.getBoundingClientRect().top-i.getBoundingClientRect().top,q=u.getBoundingClientRect().left-i.getBoundingClientRect().left,V=i.getBoundingClientRect().width-q-(i.getBoundingClientRect().width-Y)-5;V<0&&(V*=-1);var J=X-U+2;J<0&&(J*=-1),O={x:Y,y:U+J},_={x:Y+V,y:U},j=t.convert_position_angel(O,_),T=u.getBoundingClientRect().top<d.getBoundingClientRect().top?90-j:90+j,h.style.position="absolute",h.style.top=U+"px",h.style.left=Y+"px",h.style.width=V+"px",h.style.height=J+"px",u.getBoundingClientRect().left<d.getBoundingClientRect().left?h.style.transform="translateX(-100%) translateY(-100%)":h.style.transform="translateY(-100%)",h.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",h.style.border="none";}if(b&&w){var $=x.getBoundingClientRect().top-i.getBoundingClientRect().top,K=x.getBoundingClientRect().left-i.getBoundingClientRect().left,Q=b.getBoundingClientRect().top-i.getBoundingClientRect().top,Z=b.getBoundingClientRect().left-i.getBoundingClientRect().left,ee=i.getBoundingClientRect().width-Z-(i.getBoundingClientRect().width-K)-5;ee<0&&(ee*=-1);var te=Q-$+2;te<0&&(te*=-1),O={x:K,y:$+te},_={x:K+ee,y:$},j=t.convert_position_angel(O,_),T=b.getBoundingClientRect().top<x.getBoundingClientRect().top?90+j:90-j,w.style.position="absolute",w.style.top=$+"px",w.style.left=K+"px",w.style.width=ee+"px",w.style.height=te+"px",b.getBoundingClientRect().top<x.getBoundingClientRect().top&&(w.style.transform="translateY(-100%)"),w.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",w.style.border="none";}if(m&&v){var ne=y.getBoundingClientRect().top-i.getBoundingClientRect().top,ie=y.getBoundingClientRect().left-i.getBoundingClientRect().left,re=m.getBoundingClientRect().top-i.getBoundingClientRect().top,oe=m.getBoundingClientRect().left-i.getBoundingClientRect().left,ae=i.getBoundingClientRect().width-oe-(i.getBoundingClientRect().width-ie)-5;ae<0&&(ae*=-1);var se=re-ne+2;se<0&&(se*=-1),O={x:ie,y:ne+se},_={x:ie+ae,y:ne},j=t.convert_position_angel(O,_),T=m.getBoundingClientRect().top<y.getBoundingClientRect().top?90-j:90+j,v.style.position="absolute",v.style.top=ne+"px",v.style.left=ie+"px",v.style.width=ae+"px",v.style.height=se+"px",m.getBoundingClientRect().left<y.getBoundingClientRect().left?v.style.transform="translateX(-100%) translateY(-100%)":v.style.transform="translateY(-100%)",v.style.background="linear-gradient("+T+"deg, transparent 49.5%, rgb(218 0 92 / 66%) 49.5%, rgb(218 0 92 / 66%) 50%, transparent 50.5%)",v.style.border="none";}}),200);}},{key:"convert_position_angel",value:function(e,t){var n=Math.atan2(t.y-e.y,t.x-e.x)/Math.PI*180;return n+(n>=0&&n<=180||n<0&&n>=-90?90:450)}}],n&&on(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function cn(e){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(e)}function un(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==cn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==cn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===cn(r)?r:String(r)),i);}var r;}var hn=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.ctx=n,this.w=n.w,this.el=t;}var t,n;return t=e,(n=[{key:"setupElements",value:function(){var e=this.w.globals,t=this.w.config;t.type,t.arrTypes,e.showFacePoint=t.showFacePoint,e.showCamera=t.showCamera,e.showUpload=t.showUpload,e.faceClass=".faceAge-"+e.faceID,e.dom.elWrap=document.createElement("div"),lt.setAttrs(e.dom.elWrap,{id:e.faceClass.substring(1),class:"faceAge-main-module "+e.faceClass.substring(1)}),this.el.appendChild(e.dom.elWrap),this.setIframe(),this.authorize();}},{key:"setIframe",value:function(){var e=this.w.globals,t=this.w.config,n=t.iframeWidth||e.iframeWidth,i=t.iframeHeight||e.iframeHeight;e.dom.elIframe=document.createElement("iframe"),lt.setAttrs(e.dom.elIframe,{id:"FaceAge-module-iframe",style:"border: 0px; margin: 0px; padding: 0px; width: "+n+"; height: "+i+"; overflow: hidden; position: relative; z-index: 1; opacity: 0"}),e.dom.elWrap.appendChild(e.dom.elIframe),e.dom.docIframe=e.dom.elIframe.contentDocument.body,e.dom.headIframe=e.dom.elIframe.contentDocument.head,lt.setAttrs(e.dom.docIframe,{id:"faceAge-module-body",style:"margin:0;padding:0;overflow:hidden;"});var r=document.createElement("meta");r.name="viewport",r.content="width=device-width, initial-scale=1.0",e.dom.headIframe.appendChild(r);var o=document.createElement("link");o.id="inter-font",o.rel="stylesheet",o.type="text/css",o.media="all",o.href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap",e.dom.headIframe.appendChild(o);var a=document.createElement("link");a.id="roboto-mono-font",a.rel="stylesheet",a.type="text/css",a.media="all",a.href="https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto+Slab|Roboto:300,400,500,700&display=optional",e.dom.headIframe.appendChild(a);var s=document.createElement("link");s.id="face-age-css",s.rel="stylesheet",s.type="text/css",s.media="all",s.href="https://getfaceage.com/static/assets/faceage.css",e.dom.headIframe.appendChild(s),e.dom.elIframe.contentDocument.getElementById("face-age-css").addEventListener("load",(function(){e.dom.elIframe.style.opacity=1;})),e.dom.docIframe.loader=document.createElement("div"),e.dom.docIframe.loader.innerHTML='<div class="face_age"><div class="loading_request" style="background: transparent"><div class="FaceCircularProgress-root FaceCircularProgress-colorPrimary FaceCircularProgress-indeterminate" role="progressbar" style="width: 40px; height: 40px; color: #ef3b88"><svg class="FaceCircularProgress-svg" viewBox="22 22 44 44"><circle class="FaceCircularProgress-circle FaceCircularProgress-circleIndeterminate" cx="44" cy="44" r="20.2" fill="none" stroke-width="3.6"></circle></svg></div></div></div>',e.dom.docIframe.appendChild(e.dom.docIframe.loader);}},{key:"setElements",value:function(){var e=this.w.globals,t=this.w.config.type;"skincare"===t?new nn(e.dom.docIframe,this.ctx):"skincare-analyzer"===t&&new ln(e.dom.docIframe,this.ctx);}},{key:"authorize",value:function(){var e,t=this,n=this.w.config.faceageId,i=this.w.globals;null===(e=$e.request("post","authorize",{faceageId:n}))||void 0===e||e.then((function(e){i.faceageId=n,i.authorize=e.data,i.dom.docIframe.loader.remove(),t.setElements();})).catch((function(e){if(e.response&&e.response.data.message&&422===e.response.status)if(e.response.data.errors){var t=e.response.data.errors;Object.keys(t).forEach((function(e){if(t[e][0]){var n='<div class="face_age"><div class="loading_request" style="background: transparent">'+t[e][0]+"</div></div>";i.dom.docIframe.loader.innerHTML=n,console.error(t[e][0]);}else{var r='<div class="face_age"><div class="loading_request" style="background: transparent">'+t[e]+"</div></div>";i.dom.docIframe.loader.innerHTML=r,console.error(t[e]);}}));}else{var n='<div class="face_age"><div class="loading_request" style="background: transparent">'+e.response.data.message+"</div></div>";i.dom.docIframe.loader.innerHTML=n,console.error(e.response.data.message);}else i.dom.docIframe.loader.innerHTML='<div class="face_age"><div class="loading_request" style="background: transparent">error server</div></div>';}));}}])&&un(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function dn(e){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dn(e)}function pn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==dn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==dn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===dn(r)?r:String(r)),i);}var r;}"undefined"!=typeof window&&void 0===window.FaceAge&&(window.FaceAge={});var fn=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.ctx=t,this.w=t.w;}var t,n;return t=e,(n=[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.core=new hn(this.ctx.el,this.ctx);}}])&&pn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function gn(e){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gn(e)}function mn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,vn(i.key),i);}}function vn(e){var t=function(e,t){if("object"!==gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==gn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return "symbol"===gn(t)?t:String(t)}const yn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);}var t,n,i;return t=e,i=[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&"object"===gn(e)&&!Array.isArray(e)&&null!=e}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"listToArray",value:function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n}},{key:"extend",value:function(e,t){var n=this;"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r]);}return t});var i=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach((function(r){n.isObject(t[r])&&r in e?i[r]=n.extend(e[r],t[r]):Object.assign(i,function(e,t,n){return (t=vn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},r,t[r]));})),i}},{key:"extendArray",value:function(t,n){var i=[];return t.map((function(t){i.push(e.extend(n,t));})),i}},{key:"monthMod",value:function(e){return e%12}},{key:"clone",value:function(t){if(e.is("Array",t)){for(var n=[],i=0;i<t.length;i++)n[i]=this.clone(t[i]);return n}if(e.is("Null",t))return null;if(e.is("Date",t))return t;if("object"===gn(t)){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=this.clone(t[o]));return r}return t}},{key:"log10",value:function(e){return Math.log(e)/Math.LN10}},{key:"roundToBase10",value:function(e){return Math.pow(10,Math.floor(Math.log10(e)))}},{key:"roundToBase",value:function(e,t){return Math.pow(t,Math.floor(Math.log(e)/Math.log(t)))}},{key:"parseNumber",value:function(e){return null===e?e:parseFloat(e)}},{key:"stripNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:"randomId",value:function(){return (Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(e){var t=String(e).split(/[eE]/);if(1===t.length)return t[0];var n="",i=e<0?"-":"",r=t[0].replace(".",""),o=Number(t[1])+1;if(o<0){for(n=i+"0.";o++;)n+="0";return n+r.replace(/^-/,"")}for(o-=r.length;o--;)n+="0";return r+n}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),n=e.clientHeight,i=e.clientWidth;return n-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[i-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),n]}},{key:"getBoundingClientRect",value:function(e){var t=e.getBoundingClientRect();return {top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:"getLargestStringFromArr",value:function(e){return e.reduce((function(e,t){return Array.isArray(t)&&(t=t.reduce((function(e,t){return e.length>t.length?e:t}))),e.length>t.length?e:t}),0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#999999",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.6;"#"!==e.substring(0,1)&&(e="#999999");var n=e.replace("#","");n=n.match(new RegExp("(.{"+n.length/3+"})","g"));for(var i=0;i<n.length;i++)n[i]=parseInt(1===n[i].length?n[i]+n[i]:n[i],16);return void 0!==t&&n.push(t),"rgba("+n.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(e){return (e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(e){return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:"getPolygonPos",value:function(e,t){for(var n=[],i=2*Math.PI/t,r=0;r<t;r++){var o={};o.x=e*Math.sin(r*i),o.y=-e*Math.cos(r*i),n.push(o);}return n}},{key:"polarToCartesian",value:function(e,t,n,i){var r=(i-90)*Math.PI/180;return {x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}},{key:"escapeString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",n=e.toString().slice();return n.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,n){if(n>=e.length)for(var i=n-e.length+1;i--;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e}},{key:"extractNumber",value:function(e){return parseFloat(e.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:"setELstyles",value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style.key=t[n]);}},{key:"isNumber",value:function(e){return !isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:"isFloat",value:function(e){return Number(e)===e&&e%1!=0}},{key:"isSafari",value:function(){return /^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}},{key:"isIE11",value:function(){if(-1!==window.navigator.userAgent.indexOf("MSIE")||window.navigator.appVersion.indexOf("Trident/")>-1)return !0}},{key:"isIE",value:function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)}}],(n=[{key:"shadeRGBColor",value:function(e,t){var n=t.split(","),i=e<0?0:255,r=e<0?-1*e:e,o=parseInt(n[0].slice(4),10),a=parseInt(n[1],10),s=parseInt(n[2],10);return "rgb("+(Math.round((i-o)*r)+o)+","+(Math.round((i-a)*r)+a)+","+(Math.round((i-s)*r)+s)+")"}},{key:"shadeHexColor",value:function(e,t){var n=parseInt(t.slice(1),16),i=e<0?0:255,r=e<0?-1*e:e,o=n>>16,a=n>>8&255,s=255&n;return "#"+(16777216+65536*(Math.round((i-o)*r)+o)+256*(Math.round((i-a)*r)+a)+(Math.round((i-s)*r)+s)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,n){return e.isColorHex(n)?this.shadeHexColor(t,n):this.shadeRGBColor(t,n)}}])&&mn(t.prototype,n),i&&mn(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function bn(e){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(e)}function wn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==bn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==bn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===bn(r)?r:String(r)),i);}var r;}var xn=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.opts=n,this.w=new ot(n).init(),this.el=t,new fn(this).initModules();}var t,n;return t=e,(n=[{key:"render",value:function(){var e=this;return new Promise((function(t,n){null!==e.el?(e.w.globals.faceID=yn.randomId(),e.core.setupElements()):n(new Error("Element not found"));}))}},{key:"onload",value:function(e){var t=this;return new Promise((function(n,i){"function"==typeof e?t.w.globals.onload=function(t){try{e(t);}catch(e){i(new Error("Error calling:",e.message));}}:i(new Error("function not valid"));}))}},{key:"getSkins",value:function(){return this.w.globals.skinAnalyzeData}}])&&wn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();})(),i.default})()));
});
var FaceAge = unwrapExports(faceage);
var faceage_1 = faceage.FaceAge;
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : String(i);
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var FaceAgeComponent = {
props: {
options: {
type: Object
},
onLoad: Function
},
data: function data() {
return {
analyzer: null
};
},
beforeMount: function beforeMount() {
window.FaceAge = FaceAge;
},
mounted: function mounted() {
this.init();
},
beforeUnmount: function beforeUnmount() {
if (!this.analyzer) {
return;
}
this.destroy();
},
render: function render(createElement) {
return createElement("div");
},
methods: {
init: function init() {
this.analyzer = new FaceAge(this.$el, this.options);
var render = this.analyzer.render();
if (this.onLoad) {
this.analyzer.onload(this.onLoad);
}
return render;
},
isObject: function isObject(item) {
return item && _typeof(item) === "object" && !Array.isArray(item) && item != null;
},
extend: function extend(target, source) {
var _this = this;
if (typeof Object.assign !== "function") {
(function () {
Object.assign = function (target) {
// We must check against these specific cases.
if (target === undefined || target === null) {
throw new TypeError("Cannot convert undefined or null to object");
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var _source = arguments[index];
if (_source !== undefined && _source !== null) {
for (var nextKey in _source) {
if (_source.hasOwnProperty(nextKey)) {
output[nextKey] = _source[nextKey];
}
}
}
}
return output;
};
})();
}
var output = Object.assign({}, target);
if (this.isObject(target) && this.isObject(source)) {
Object.keys(source).forEach(function (key) {
if (_this.isObject(source[key])) {
if (!(key in target)) {
Object.assign(output, _defineProperty({}, key, source[key]));
} else {
output[key] = _this.extend(target[key], source[key]);
}
} else {
Object.assign(output, _defineProperty({}, key, source[key]));
}
});
}
return output;
},
refresh: function refresh() {
//this.destroy();
return this.init();
},
destroy: function destroy() {
//this.analyzer.destroy();
}
}
};
var VueFaceAge = FaceAgeComponent;
window.FaceAge = FaceAge;
VueFaceAge.install = function (Vue) {
//adding a global method or property
Vue.FaceAge = FaceAge;
window.FaceAge = FaceAge;
// add the instance method
Object.defineProperty(Vue.prototype, '$apexcharts', {
get: function get() {
return FaceAge;
}
});
};
return VueFaceAge;
})));