-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathwallpanel.js
More file actions
3 lines (3 loc) · 246 KB
/
wallpanel.js
File metadata and controls
3 lines (3 loc) · 246 KB
1
2
3
!function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,"next",e)}function c(e){t(o,i,a,s,c,"throw",e)}s(void 0)})}}function r(e,t,n){return t=u(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t,n){return(t=A(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,u=Object.create(c.prototype);return v(u,"_invoke",function(n,r,i){var a,s,c,u=0,l=i||[],f=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return a=t,s=0,c=e,h.n=n,o}};function d(n,r){for(s=n,c=r,t=0;!f&&u&&!i&&t<l.length;t++){var i,a=l[t],d=h.p,p=a[2];n>3?(i=p===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=n<2&&d<a[1])?(s=0,h.v=r,h.n=a[1]):d<p&&(i=n<3||a[0]>r||r>p)&&(a[4]=n,a[5]=r,h.n=p,s=0))}if(i||n>1)return o;throw f=!0,r}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,p),s=l,c=p;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(h.n=-1),d(s,c)):h.n=c:h.v=c);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(f=h.n<0)?c:n.call(r,h))!==o)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(n,i,a),!0),u}var o={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(v(t={},r,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,v(e,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,v(f,"constructor",u),v(u,"constructor",c),c.displayName="GeneratorFunction",v(u,i,"GeneratorFunction"),v(f),v(f,i,"Generator"),v(f,r,function(){return this}),v(f,"toString",function(){return"[object Generator]"}),(p=function(){return{w:a,m:h}})()}function v(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}v=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function a(t,n){v(e,t,function(e){return this._invoke(t,n,e)})}a("next",0),a("throw",1),a("return",2)}},v(e,t,n,r)}function m(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||_(t)||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 A(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function w(e){return w="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},w(e)}function _(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var x,E,S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k={};function C(){if(E)return x;E=1;var e=function(e){return e&&e.Math===Math&&e};return x=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof S&&S)||e("object"==typeof x&&x)||function(){return this}()||Function("return this")()}var I,T,O,R,P,M,L,B,U={};function F(){return T?I:(T=1,I=function(e){try{return!!e()}catch(e){return!0}})}function D(){if(R)return O;R=1;var e=F();return O=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function N(){if(M)return P;M=1;var e=F();return P=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function j(){if(B)return L;B=1;var e=N(),t=Function.prototype.call;return L=e?t.bind(t):function(){return t.apply(t,arguments)},L}var W,z,G,H,Y,V,q,X,$,J,Q,Z,K,ee,te,ne,re,ie,ae,oe,se,ce,ue,le,fe,he,de,pe,ve,me,ge,ye,be,Ae,we,_e,xe,Ee,Se,ke,Ce,Ie={};function Te(){if(W)return Ie;W=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return Ie.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,Ie}function Oe(){return G?z:(G=1,z=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function Re(){if(Y)return H;Y=1;var e=N(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return H=e?r:function(e){return function(){return n.apply(e,arguments)}},H}function Pe(){if(q)return V;q=1;var e=Re(),t=e({}.toString),n=e("".slice);return V=function(e){return n(t(e),8,-1)}}function Me(){if($)return X;$=1;var e=Re(),t=F(),n=Pe(),r=Object,i=e("".split);return X=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?i(e,""):r(e)}:r}function Le(){return Q?J:(Q=1,J=function(e){return null==e})}function Be(){if(K)return Z;K=1;var e=Le(),t=TypeError;return Z=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function Ue(){if(te)return ee;te=1;var e=Me(),t=Be();return ee=function(n){return e(t(n))}}function Fe(){if(re)return ne;re=1;var e="object"==typeof document&&document.all;return ne=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function De(){if(ae)return ie;ae=1;var e=Fe();return ie=function(t){return"object"==typeof t?null!==t:e(t)}}function Ne(){if(se)return oe;se=1;var e=C(),t=Fe();return oe=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},oe}function je(){if(ue)return ce;ue=1;var e=Re();return ce=e({}.isPrototypeOf)}function We(){if(fe)return le;fe=1;var e=C().navigator,t=e&&e.userAgent;return le=t?String(t):""}function ze(){if(de)return he;de=1;var e,t,n=C(),r=We(),i=n.process,a=n.Deno,o=i&&i.versions||a&&a.version,s=o&&o.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),he=t}function Ge(){if(ve)return pe;ve=1;var e=ze(),t=F(),n=C().String;return pe=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function He(){if(ge)return me;ge=1;var e=Ge();return me=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Ye(){if(be)return ye;be=1;var e=Ne(),t=Fe(),n=je(),r=He(),i=Object;return ye=r?function(e){return"symbol"==typeof e}:function(r){var a=e("Symbol");return t(a)&&n(a.prototype,i(r))}}function Ve(){if(we)return Ae;we=1;var e=String;return Ae=function(t){try{return e(t)}catch(e){return"Object"}}}function qe(){if(xe)return _e;xe=1;var e=Fe(),t=Ve(),n=TypeError;return _e=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Xe(){if(Se)return Ee;Se=1;var e=qe(),t=Le();return Ee=function(n,r){var i=n[r];return t(i)?void 0:e(i)}}function $e(){if(Ce)return ke;Ce=1;var e=j(),t=Fe(),n=De(),r=TypeError;return ke=function(i,a){var o,s;if("string"===a&&t(o=i.toString)&&!n(s=e(o,i)))return s;if(t(o=i.valueOf)&&!n(s=e(o,i)))return s;if("string"!==a&&t(o=i.toString)&&!n(s=e(o,i)))return s;throw new r("Can't convert object to primitive value")}}var Je,Qe,Ze,Ke,et,tt,nt,rt,it,at,ot,st,ct,ut,lt,ft,ht,dt,pt,vt,mt,gt,yt,bt,At={exports:{}};function wt(){return Qe?Je:(Qe=1,Je=!1)}function _t(){if(Ke)return Ze;Ke=1;var e=C(),t=Object.defineProperty;return Ze=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function xt(){if(et)return At.exports;et=1;var e=wt(),t=C(),n=_t(),r="__core-js_shared__",i=At.exports=t[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.43.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"}),At.exports}function Et(){if(nt)return tt;nt=1;var e=xt();return tt=function(t,n){return e[t]||(e[t]=n||{})}}function St(){if(it)return rt;it=1;var e=Be(),t=Object;return rt=function(n){return t(e(n))}}function kt(){if(ot)return at;ot=1;var e=Re(),t=St(),n=e({}.hasOwnProperty);return at=Object.hasOwn||function(e,r){return n(t(e),r)}}function Ct(){if(ct)return st;ct=1;var e=Re(),t=0,n=Math.random(),r=e(1.1.toString);return st=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function It(){if(lt)return ut;lt=1;var e=C(),t=Et(),n=kt(),r=Ct(),i=Ge(),a=He(),o=e.Symbol,s=t("wks"),c=a?o.for||o:o&&o.withoutSetter||r;return ut=function(e){return n(s,e)||(s[e]=i&&n(o,e)?o[e]:c("Symbol."+e)),s[e]}}function Tt(){if(ht)return ft;ht=1;var e=j(),t=De(),n=Ye(),r=Xe(),i=$e(),a=It(),o=TypeError,s=a("toPrimitive");return ft=function(a,c){if(!t(a)||n(a))return a;var u,l=r(a,s);if(l){if(void 0===c&&(c="default"),u=e(l,a,c),!t(u)||n(u))return u;throw new o("Can't convert object to primitive value")}return void 0===c&&(c="number"),i(a,c)}}function Ot(){if(pt)return dt;pt=1;var e=Tt(),t=Ye();return dt=function(n){var r=e(n,"string");return t(r)?r:r+""}}function Rt(){if(mt)return vt;mt=1;var e=C(),t=De(),n=e.document,r=t(n)&&t(n.createElement);return vt=function(e){return r?n.createElement(e):{}}}function Pt(){if(yt)return gt;yt=1;var e=D(),t=F(),n=Rt();return gt=!e&&!t(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function Mt(){if(bt)return U;bt=1;var e=D(),t=j(),n=Te(),r=Oe(),i=Ue(),a=Ot(),o=kt(),s=Pt(),c=Object.getOwnPropertyDescriptor;return U.f=e?c:function(e,u){if(e=i(e),u=a(u),s)try{return c(e,u)}catch(e){}if(o(e,u))return r(!t(n.f,e,u),e[u])},U}var Lt,Bt,Ut,Ft,Dt,Nt,jt,Wt={};function zt(){if(Bt)return Lt;Bt=1;var e=D(),t=F();return Lt=e&&t(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Gt(){if(Ft)return Ut;Ft=1;var e=De(),t=String,n=TypeError;return Ut=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function Ht(){if(Dt)return Wt;Dt=1;var e=D(),t=Pt(),n=zt(),r=Gt(),i=Ot(),a=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",l="writable";return Wt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&l in n&&!n[l]){var a=s(e,t);a&&a[l]&&(e[t]=n.value,n={configurable:u in n?n[u]:a[u],enumerable:c in n?n[c]:a[c],writable:!1})}return o(e,t,n)}:o:function(e,n,s){if(r(e),n=i(n),r(s),t)try{return o(e,n,s)}catch(e){}if("get"in s||"set"in s)throw new a("Accessors not supported");return"value"in s&&(e[n]=s.value),e},Wt}function Yt(){if(jt)return Nt;jt=1;var e=D(),t=Ht(),n=Oe();return Nt=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}var Vt,qt,Xt,$t,Jt,Qt,Zt,Kt,en,tn,nn,rn,an,on,sn,cn={exports:{}};function un(){if(qt)return Vt;qt=1;var e=D(),t=kt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,"name"),a=i&&"something"===function(){}.name,o=i&&(!e||e&&r(n,"name").configurable);return Vt={EXISTS:i,PROPER:a,CONFIGURABLE:o}}function ln(){if($t)return Xt;$t=1;var e=Re(),t=Fe(),n=xt(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Xt=n.inspectSource}function fn(){if(Kt)return Zt;Kt=1;var e=Et(),t=Ct(),n=e("keys");return Zt=function(e){return n[e]||(n[e]=t(e))}}function hn(){return tn?en:(tn=1,en={})}function dn(){if(rn)return nn;rn=1;var e,t,n,r=function(){if(Qt)return Jt;Qt=1;var e=C(),t=Fe(),n=e.WeakMap;return Jt=t(n)&&/native code/.test(String(n))}(),i=C(),a=De(),o=Yt(),s=kt(),c=xt(),u=fn(),l=hn(),f="Object already initialized",h=i.TypeError,d=i.WeakMap;if(r||c.state){var p=c.state||(c.state=new d);p.get=p.get,p.has=p.has,p.set=p.set,e=function(e,t){if(p.has(e))throw new h(f);return t.facade=e,p.set(e,t),t},t=function(e){return p.get(e)||{}},n=function(e){return p.has(e)}}else{var v=u("state");l[v]=!0,e=function(e,t){if(s(e,v))throw new h(f);return t.facade=e,o(e,v,t),t},t=function(e){return s(e,v)?e[v]:{}},n=function(e){return s(e,v)}}return nn={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!a(n)||(r=t(n)).type!==e)throw new h("Incompatible receiver, "+e+" required");return r}}}}function pn(){if(an)return cn.exports;an=1;var e=Re(),t=F(),n=Fe(),r=kt(),i=D(),a=un().CONFIGURABLE,o=ln(),s=dn(),c=s.enforce,u=s.get,l=String,f=Object.defineProperty,h=e("".slice),d=e("".replace),p=e([].join),v=i&&!t(function(){return 8!==f(function(){},"length",{value:8}).length}),m=String(String).split("String"),g=cn.exports=function(e,t,n){"Symbol("===h(l(t),0,7)&&(t="["+d(l(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||a&&e.name!==t)&&(i?f(e,"name",{value:t,configurable:!0}):e.name=t),v&&n&&r(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=c(e);return r(o,"source")||(o.source=p(m,"string"==typeof t?t:"")),e};return Function.prototype.toString=g(function(){return n(this)&&u(this).source||o(this)},"toString"),cn.exports}function vn(){if(sn)return on;sn=1;var e=Fe(),t=Ht(),n=pn(),r=_t();return on=function(i,a,o,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:a;if(e(o)&&n(o,u,s),s.global)c?i[a]=o:r(a,o);else{try{s.unsafe?i[a]&&(c=!0):delete i[a]}catch(e){}c?i[a]=o:t.f(i,a,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}var mn,gn,yn,bn,An,wn,_n,xn,En,Sn,kn,Cn,In,Tn,On,Rn,Pn,Mn={};function Ln(){if(bn)return yn;bn=1;var e=function(){if(gn)return mn;gn=1;var e=Math.ceil,t=Math.floor;return mn=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)}}();return yn=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function Bn(){if(wn)return An;wn=1;var e=Ln(),t=Math.max,n=Math.min;return An=function(r,i){var a=e(r);return a<0?t(a+i,0):n(a,i)}}function Un(){if(xn)return _n;xn=1;var e=Ln(),t=Math.min;return _n=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function Fn(){if(Sn)return En;Sn=1;var e=Un();return En=function(t){return e(t.length)}}function Dn(){if(Cn)return kn;Cn=1;var e=Ue(),t=Bn(),n=Fn(),r=function(r){return function(i,a,o){var s=e(i),c=n(s);if(0===c)return!r&&-1;var u,l=t(o,c);if(r&&a!=a){for(;c>l;)if((u=s[l++])!=u)return!0}else for(;c>l;l++)if((r||l in s)&&s[l]===a)return r||l||0;return!r&&-1}};return kn={includes:r(!0),indexOf:r(!1)}}function Nn(){if(Tn)return In;Tn=1;var e=Re(),t=kt(),n=Ue(),r=Dn().indexOf,i=hn(),a=e([].push);return In=function(e,o){var s,c=n(e),u=0,l=[];for(s in c)!t(i,s)&&t(c,s)&&a(l,s);for(;o.length>u;)t(c,s=o[u++])&&(~r(l,s)||a(l,s));return l}}function jn(){return Rn?On:(Rn=1,On=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Wn(){if(Pn)return Mn;Pn=1;var e=Nn(),t=jn().concat("length","prototype");return Mn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},Mn}var zn,Gn,Hn,Yn,Vn,qn,Xn,$n,Jn,Qn,Zn,Kn,er,tr,nr,rr,ir,ar,or,sr,cr,ur,lr,fr,hr,dr,pr,vr,mr,gr,yr,br,Ar,wr,_r,xr,Er,Sr,kr,Cr,Ir,Tr,Or={};function Rr(){return zn||(zn=1,Or.f=Object.getOwnPropertySymbols),Or}function Pr(){if(Hn)return Gn;Hn=1;var e=Ne(),t=Re(),n=Wn(),r=Rr(),i=Gt(),a=t([].concat);return Gn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),o=r.f;return o?a(t,o(e)):t}}function Mr(){if(Vn)return Yn;Vn=1;var e=kt(),t=Pr(),n=Mt(),r=Ht();return Yn=function(i,a,o){for(var s=t(a),c=r.f,u=n.f,l=0;l<s.length;l++){var f=s[l];e(i,f)||o&&e(o,f)||c(i,f,u(a,f))}}}function Lr(){if(Xn)return qn;Xn=1;var e=F(),t=Fe(),n=/#|\.prototype\./,r=function(n,r){var c=a[i(n)];return c===s||c!==o&&(t(r)?e(r):!!r)},i=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},a=r.data={},o=r.NATIVE="N",s=r.POLYFILL="P";return qn=r}function Br(){if(Jn)return $n;Jn=1;var e=C(),t=Mt().f,n=Yt(),r=vn(),i=_t(),a=Mr(),o=Lr();return $n=function(s,c){var u,l,f,h,d,p=s.target,v=s.global,m=s.stat;if(u=v?e:m?e[p]||i(p,{}):e[p]&&e[p].prototype)for(l in c){if(h=c[l],f=s.dontCallGetSet?(d=t(u,l))&&d.value:u[l],!o(v?l:p+(m?".":"#")+l,s.forced)&&void 0!==f){if(typeof h==typeof f)continue;a(h,f)}(s.sham||f&&f.sham)&&n(h,"sham",!0),r(u,l,h,s)}}}function Ur(){if(Zn)return Qn;Zn=1;var e=N(),t=Function.prototype,n=t.apply,r=t.call;return Qn="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),Qn}function Fr(){if(er)return Kn;er=1;var e=Re(),t=qe();return Kn=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}function Dr(){if(nr)return tr;nr=1;var e=De();return tr=function(t){return e(t)||null===t}}function Nr(){if(ir)return rr;ir=1;var e=Dr(),t=String,n=TypeError;return rr=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function jr(){if(or)return ar;or=1;var e=Fr(),t=De(),n=Be(),r=Nr();return ar=Object.setPrototypeOf||("__proto__"in{}?function(){var i,a=!1,o={};try{(i=e(Object.prototype,"__proto__","set"))(o,[]),a=o instanceof Array}catch(e){}return function(e,o){return n(e),r(o),t(e)?(a?i(e,o):e.__proto__=o,e):e}}():void 0)}function Wr(){if(cr)return sr;cr=1;var e=Ht().f;return sr=function(t,n,r){r in t||e(t,r,{configurable:!0,get:function(){return n[r]},set:function(e){n[r]=e}})}}function zr(){if(lr)return ur;lr=1;var e=Fe(),t=De(),n=jr();return ur=function(r,i,a){var o,s;return n&&e(o=i.constructor)&&o!==a&&t(s=o.prototype)&&s!==a.prototype&&n(r,s),r}}function Gr(){if(hr)return fr;hr=1;var e={};return e[It()("toStringTag")]="z",fr="[object z]"===String(e)}function Hr(){if(pr)return dr;pr=1;var e=Gr(),t=Fe(),n=Pe(),r=It()("toStringTag"),i=Object,a="Arguments"===n(function(){return arguments}());return dr=e?n:function(e){var o,s,c;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(o=i(e),r))?s:a?n(o):"Object"===(c=n(o))&&t(o.callee)?"Arguments":c}}function Yr(){if(mr)return vr;mr=1;var e=Hr(),t=String;return vr=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function Vr(){if(yr)return gr;yr=1;var e=Yr();return gr=function(t,n){return void 0===t?arguments.length<2?"":n:e(t)},gr}function qr(){if(Ar)return br;Ar=1;var e=De(),t=Yt();return br=function(n,r){e(r)&&"cause"in r&&t(n,"cause",r.cause)}}function Xr(){if(_r)return wr;_r=1;var e=Re(),t=Error,n=e("".replace),r=String(new t("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,a=i.test(r);return wr=function(e,r){if(a&&"string"==typeof e&&!t.prepareStackTrace)for(;r--;)e=n(e,i,"");return e}}function $r(){if(kr)return Sr;kr=1;var e=Yt(),t=Xr(),n=function(){if(Er)return xr;Er=1;var e=F(),t=Oe();return xr=!e(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",t(1,7)),7!==e.stack)})}(),r=Error.captureStackTrace;return Sr=function(i,a,o,s){n&&(r?r(i,a):e(i,"stack",t(o,s)))}}function Jr(){if(Ir)return Cr;Ir=1;var e=Ne(),t=kt(),n=Yt(),r=je(),i=jr(),a=Mr(),o=Wr(),s=zr(),c=Vr(),u=qr(),l=$r(),f=D(),h=wt();return Cr=function(d,p,v,m){var g="stackTraceLimit",y=m?2:1,b=d.split("."),A=b[b.length-1],w=e.apply(null,b);if(w){var _=w.prototype;if(!h&&t(_,"cause")&&delete _.cause,!v)return w;var x=e("Error"),E=p(function(e,t){var i=c(m?t:e,void 0),a=m?new w(e):new w;return void 0!==i&&n(a,"message",i),l(a,E,a.stack,2),this&&r(_,this)&&s(a,this,E),arguments.length>y&&u(a,arguments[y]),a});if(E.prototype=_,"Error"!==A?i?i(E,x):a(E,x,{name:!0}):f&&g in w&&(o(E,w,g),o(E,w,"prepareStackTrace")),a(E,w),!h)try{_.name!==A&&n(_,"name",A),_.constructor=E}catch(e){}return E}},Cr}!function(){if(Tr)return k;Tr=1;var e=Br(),t=C(),n=Ur(),r=Jr(),i="WebAssembly",a=t[i],o=7!==new Error("e",{cause:7}).cause,s=function(t,n){var i={};i[t]=r(t,n,o),e({global:!0,constructor:!0,arity:1,forced:o},i)},c=function(t,n){if(a&&a[t]){var s={};s[t]=r(i+"."+t,n,o),e({target:i,stat:!0,constructor:!0,arity:1,forced:o},s)}};s("Error",function(e){return function(t){return n(e,this,arguments)}}),s("EvalError",function(e){return function(t){return n(e,this,arguments)}}),s("RangeError",function(e){return function(t){return n(e,this,arguments)}}),s("ReferenceError",function(e){return function(t){return n(e,this,arguments)}}),s("SyntaxError",function(e){return function(t){return n(e,this,arguments)}}),s("TypeError",function(e){return function(t){return n(e,this,arguments)}}),s("URIError",function(e){return function(t){return n(e,this,arguments)}}),c("CompileError",function(e){return function(t){return n(e,this,arguments)}}),c("LinkError",function(e){return function(t){return n(e,this,arguments)}}),c("RuntimeError",function(e){return function(t){return n(e,this,arguments)}})}();var Qr,Zr,Kr,ei,ti,ni,ri,ii,ai,oi,si,ci,ui,li,fi,hi={};function di(){if(Zr)return Qr;Zr=1;var e=Pe();return Qr=Array.isArray||function(t){return"Array"===e(t)}}function pi(){if(ei)return Kr;ei=1;var e=TypeError;return Kr=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}}function vi(){if(ni)return ti;ni=1;var e=D(),t=Ht(),n=Oe();return ti=function(r,i,a){e?t.f(r,i,n(0,a)):r[i]=a}}function mi(){if(ii)return ri;ii=1;var e=Re(),t=F(),n=Fe(),r=Hr(),i=Ne(),a=ln(),o=function(){},s=i("Reflect","construct"),c=/^\s*(?:class|function)\b/,u=e(c.exec),l=!c.test(o),f=function(e){if(!n(e))return!1;try{return s(o,[],e),!0}catch(e){return!1}},h=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!u(c,a(e))}catch(e){return!0}};return h.sham=!0,ri=!s||t(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?h:f}function gi(){if(oi)return ai;oi=1;var e=di(),t=mi(),n=De(),r=It()("species"),i=Array;return ai=function(a){var o;return e(a)&&(o=a.constructor,(t(o)&&(o===i||e(o.prototype))||n(o)&&null===(o=o[r]))&&(o=void 0)),void 0===o?i:o}}function yi(){if(ci)return si;ci=1;var e=gi();return si=function(t,n){return new(e(t))(0===n?0:n)}}function bi(){if(li)return ui;li=1;var e=F(),t=It(),n=ze(),r=t("species");return ui=function(t){return n>=51||!e(function(){var e=[];return(e.constructor={})[r]=function(){return{foo:1}},1!==e[t](Boolean).foo})}}!function(){if(fi)return hi;fi=1;var e=Br(),t=F(),n=di(),r=De(),i=St(),a=Fn(),o=pi(),s=vi(),c=yi(),u=bi(),l=It(),f=ze(),h=l("isConcatSpreadable"),d=f>=51||!t(function(){var e=[];return e[h]=!1,e.concat()[0]!==e}),p=function(e){if(!r(e))return!1;var t=e[h];return void 0!==t?!!t:n(e)};e({target:"Array",proto:!0,arity:1,forced:!d||!u("concat")},{concat:function(e){var t,n,r,u,l,f=i(this),h=c(f,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(p(l=-1===t?f:arguments[t]))for(u=a(l),o(d+u),n=0;n<u;n++,d++)n in l&&s(h,d,l[n]);else o(d+1),s(h,d++,l);return h.length=d,h}})}();var Ai,wi,_i,xi,Ei,Si,ki,Ci={};function Ii(){if(wi)return Ai;wi=1;var e=Pe(),t=Re();return Ai=function(n){if("Function"===e(n))return t(n)}}function Ti(){if(xi)return _i;xi=1;var e=Ii(),t=qe(),n=N(),r=e(e.bind);return _i=function(e,i){return t(e),void 0===i?e:n?r(e,i):function(){return e.apply(i,arguments)}},_i}function Oi(){if(Si)return Ei;Si=1;var e=Ti(),t=Re(),n=Me(),r=St(),i=Fn(),a=yi(),o=t([].push),s=function(t){var s=1===t,c=2===t,u=3===t,l=4===t,f=6===t,h=7===t,d=5===t||f;return function(p,v,m,g){for(var y,b,A=r(p),w=n(A),_=i(w),x=e(v,m),E=0,S=g||a,k=s?S(p,_):c||h?S(p,0):void 0;_>E;E++)if((d||E in w)&&(b=x(y=w[E],E,A),t))if(s)k[E]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:o(k,y)}else switch(t){case 4:return!1;case 7:o(k,y)}return f?-1:u||l?l:k}};return Ei={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}}!function(){if(ki)return Ci;ki=1;var e=Br(),t=Oi().filter;e({target:"Array",proto:!0,forced:!bi()("filter")},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}();var Ri,Pi,Mi,Li={};!function(){if(Mi)return Li;Mi=1;var e=Br(),t=function(){if(Pi)return Ri;Pi=1;var e=di(),t=Fn(),n=pi(),r=Ti(),i=function(a,o,s,c,u,l,f,h){for(var d,p,v=u,m=0,g=!!f&&r(f,h);m<c;)m in s&&(d=g?g(s[m],m,o):s[m],l>0&&e(d)?(p=t(d),v=i(a,o,d,p,v,l-1)-1):(n(v+1),a[v]=d),v++),m++;return v};return Ri=i}(),n=St(),r=Fn(),i=Ln(),a=yi();e({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,o=n(this),s=r(o),c=a(o,0);return c.length=t(c,o,o,s,0,void 0===e?1:i(e)),c}})}();var Bi,Ui,Fi,Di,Ni,ji,Wi,zi,Gi,Hi,Yi,Vi,qi,Xi,$i,Ji,Qi,Zi,Ki,ea,ta,na,ra,ia,aa,oa,sa,ca,ua={},la={};function fa(){if(Ui)return Bi;Ui=1;var e=Nn(),t=jn();return Bi=Object.keys||function(n){return e(n,t)}}function ha(){if(Ni)return Di;Ni=1;var e=Ne();return Di=e("document","documentElement")}function da(){if(Wi)return ji;Wi=1;var e,t=Gt(),n=function(){if(Fi)return la;Fi=1;var e=D(),t=zt(),n=Ht(),r=Gt(),i=Ue(),a=fa();return la.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var o,s=i(t),c=a(t),u=c.length,l=0;u>l;)n.f(e,o=c[l++],s[o]);return e},la}(),r=jn(),i=hn(),a=ha(),o=Rt(),s=fn(),c="prototype",u="script",l=s("IE_PROTO"),f=function(){},h=function(e){return"<"+u+">"+e+"</"+u+">"},d=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;p="undefined"!=typeof document?document.domain&&e?d(e):(n=o("iframe"),i="java"+u+":",n.style.display="none",a.appendChild(n),n.src=String(i),(t=n.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):d(e);for(var s=r.length;s--;)delete p[c][r[s]];return p()};return i[l]=!0,ji=Object.create||function(e,r){var i;return null!==e?(f[c]=t(e),i=new f,f[c]=null,i[l]=e):i=p(),void 0===r?i:n.f(i,r)}}function pa(){if(Gi)return zi;Gi=1;var e=It(),t=da(),n=Ht().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),zi=function(e){i[r][e]=!0}}function va(){return Vi?Yi:(Vi=1,Yi={})}function ma(){if(Ji)return $i;Ji=1;var e=kt(),t=Fe(),n=St(),r=fn(),i=function(){if(Xi)return qi;Xi=1;var e=F();return qi=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}(),a=r("IE_PROTO"),o=Object,s=o.prototype;return $i=i?o.getPrototypeOf:function(r){var i=n(r);if(e(i,a))return i[a];var c=i.constructor;return t(c)&&i instanceof c?c.prototype:i instanceof o?s:null}}function ga(){if(Zi)return Qi;Zi=1;var e,t,n,r=F(),i=Fe(),a=De(),o=da(),s=ma(),c=vn(),u=It(),l=wt(),f=u("iterator"),h=!1;return[].keys&&("next"in(n=[].keys())?(t=s(s(n)))!==Object.prototype&&(e=t):h=!0),!a(e)||r(function(){var t={};return e[f].call(t)!==t})?e={}:l&&(e=o(e)),i(e[f])||c(e,f,function(){return this}),Qi={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:h}}function ya(){if(ea)return Ki;ea=1;var e=Ht().f,t=kt(),n=It()("toStringTag");return Ki=function(r,i,a){r&&!a&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function ba(){if(na)return ta;na=1;var e=ga().IteratorPrototype,t=da(),n=Oe(),r=ya(),i=va(),a=function(){return this};return ta=function(o,s,c,u){var l=s+" Iterator";return o.prototype=t(e,{next:n(+!u,c)}),r(o,l,!1,!0),i[l]=a,o}}function Aa(){if(ia)return ra;ia=1;var e=Br(),t=j(),n=wt(),r=un(),i=Fe(),a=ba(),o=ma(),s=jr(),c=ya(),u=Yt(),l=vn(),f=It(),h=va(),d=ga(),p=r.PROPER,v=r.CONFIGURABLE,m=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",A="values",w="entries",_=function(){return this};return ra=function(r,f,d,x,E,S,k){a(d,f,x);var C,I,T,O=function(e){if(e===E&&B)return B;if(!g&&e&&e in M)return M[e];switch(e){case b:case A:case w:return function(){return new d(this,e)}}return function(){return new d(this)}},R=f+" Iterator",P=!1,M=r.prototype,L=M[y]||M["@@iterator"]||E&&M[E],B=!g&&L||O(E),U="Array"===f&&M.entries||L;if(U&&(C=o(U.call(new r)))!==Object.prototype&&C.next&&(n||o(C)===m||(s?s(C,m):i(C[y])||l(C,y,_)),c(C,R,!0,!0),n&&(h[R]=_)),p&&E===A&&L&&L.name!==A&&(!n&&v?u(M,"name",A):(P=!0,B=function(){return t(L,this)})),E)if(I={values:O(A),keys:S?B:O(b),entries:O(w)},k)for(T in I)(g||P||!(T in M))&&l(M,T,I[T]);else e({target:f,proto:!0,forced:g||P},I);return n&&!k||M[y]===B||l(M,y,B,{name:E}),h[f]=B,I}}function wa(){return oa?aa:(oa=1,aa=function(e,t){return{value:e,done:t}})}function _a(){if(ca)return sa;ca=1;var e=Ue(),t=pa(),n=va(),r=dn(),i=Ht().f,a=Aa(),o=wa(),s=wt(),c=D(),u="Array Iterator",l=r.set,f=r.getterFor(u);sa=a(Array,"Array",function(t,n){l(this,{type:u,target:e(t),index:0,kind:n})},function(){var e=f(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,o(void 0,!0);switch(e.kind){case"keys":return o(n,!1);case"values":return o(t[n],!1)}return o([n,t[n]],!1)},"values");var h=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!s&&c&&"values"!==h.name)try{i(h,"name",{value:"values"})}catch(e){}return sa}!function(){if(Hi)return ua;Hi=1;var e=Br(),t=Dn().includes,n=F(),r=pa();e({target:"Array",proto:!0,forced:n(function(){return!Array(1).includes()})},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r("includes")}(),_a();var xa,Ea,Sa,ka={};function Ca(){if(Ea)return xa;Ea=1;var e=F();return xa=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})}}!function(){if(Sa)return ka;Sa=1;var e=Br(),t=Re(),n=Me(),r=Ue(),i=Ca(),a=t([].join);e({target:"Array",proto:!0,forced:n!==Object||!i("join",",")},{join:function(e){return a(r(this),void 0===e?",":e)}})}();var Ia,Ta={};!function(){if(Ia)return Ta;Ia=1;var e=Br(),t=Oi().map;e({target:"Array",proto:!0,forced:!bi()("map")},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}();var Oa,Ra,Pa,Ma={};!function(){if(Pa)return Ma;Pa=1;var e=Br(),t=St(),n=Fn(),r=function(){if(Ra)return Oa;Ra=1;var e=D(),t=di(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();return Oa=i?function(e,i){if(t(e)&&!r(e,"length").writable)throw new n("Cannot set read only .length");return e.length=i}:function(e,t){return e.length=t}}(),i=pi();e({target:"Array",proto:!0,arity:1,forced:F()(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var a=t(this),o=n(a),s=arguments.length;i(o+s);for(var c=0;c<s;c++)a[o]=arguments[c],o++;return r(a,o),o}})}();var La,Ba,Ua,Fa={};function Da(){if(Ba)return La;Ba=1;var e=Re();return La=e([].slice)}!function(){if(Ua)return Fa;Ua=1;var e=Br(),t=di(),n=mi(),r=De(),i=Bn(),a=Fn(),o=Ue(),s=vi(),c=It(),u=bi(),l=Da(),f=u("slice"),h=c("species"),d=Array,p=Math.max;e({target:"Array",proto:!0,forced:!f},{slice:function(e,c){var u,f,v,m=o(this),g=a(m),y=i(e,g),b=i(void 0===c?g:c,g);if(t(m)&&(u=m.constructor,(n(u)&&(u===d||t(u.prototype))||r(u)&&null===(u=u[h]))&&(u=void 0),u===d||void 0===u))return l(m,y,b);for(f=new(void 0===u?d:u)(p(b-y,0)),v=0;y<b;y++,v++)y in m&&s(f,v,m[y]);return f.length=v,f}})}();var Na,ja,Wa,za,Ga,Ha,Ya,Va,qa,Xa,$a,Ja={};function Qa(){if(ja)return Na;ja=1;var e=Ve(),t=TypeError;return Na=function(n,r){if(!delete n[r])throw new t("Cannot delete property "+e(r)+" of "+e(n))}}function Za(){if(za)return Wa;za=1;var e=Da(),t=Math.floor,n=function(r,i){var a=r.length;if(a<8)for(var o,s,c=1;c<a;){for(s=c,o=r[c];s&&i(r[s-1],o)>0;)r[s]=r[--s];s!==c++&&(r[s]=o)}else for(var u=t(a/2),l=n(e(r,0,u),i),f=n(e(r,u),i),h=l.length,d=f.length,p=0,v=0;p<h||v<d;)r[p+v]=p<h&&v<d?i(l[p],f[v])<=0?l[p++]:f[v++]:p<h?l[p++]:f[v++];return r};return Wa=n}function Ka(){if(Ha)return Ga;Ha=1;var e=We().match(/firefox\/(\d+)/i);return Ga=!!e&&+e[1]}function eo(){if(Va)return Ya;Va=1;var e=We();return Ya=/MSIE|Trident/.test(e)}function to(){if(Xa)return qa;Xa=1;var e=We().match(/AppleWebKit\/(\d+)\./);return qa=!!e&&+e[1]}!function(){if($a)return Ja;$a=1;var e=Br(),t=Re(),n=qe(),r=St(),i=Fn(),a=Qa(),o=Yr(),s=F(),c=Za(),u=Ca(),l=Ka(),f=eo(),h=ze(),d=to(),p=[],v=t(p.sort),m=t(p.push),g=s(function(){p.sort(void 0)}),y=s(function(){p.sort(null)}),b=u("sort"),A=!s(function(){if(h)return h<70;if(!(l&&l>3)){if(f)return!0;if(d)return d<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)p.push({k:t+r,v:n})}for(p.sort(function(e,t){return t.v-e.v}),r=0;r<p.length;r++)t=p[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}});e({target:"Array",proto:!0,forced:g||!y||!b||!A},{sort:function(e){void 0!==e&&n(e);var t=r(this);if(A)return void 0===e?v(t):v(t,e);var s,u,l=[],f=i(t);for(u=0;u<f;u++)u in t&&m(l,t[u]);for(c(l,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:o(t)>o(n)?1:-1}}(e)),s=i(l),u=0;u<s;)t[u]=l[u++];for(;u<f;)a(t,u++);return t}})}();var no;no||(no=1,pa()("flat"));var ro,io,ao,oo,so,co,uo,lo,fo,ho,po,vo,mo,go,yo,bo,Ao,wo,_o,xo,Eo,So,ko,Co,Io,To,Oo,Ro={};function Po(){return io?ro:(io=1,ro="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView)}function Mo(){if(oo)return ao;oo=1;var e=pn(),t=Ht();return ao=function(n,r,i){return i.get&&e(i.get,r,{getter:!0}),i.set&&e(i.set,r,{setter:!0}),t.f(n,r,i)}}function Lo(){if(co)return so;co=1;var e=vn();return so=function(t,n,r){for(var i in n)e(t,i,n[i],r);return t}}function Bo(){if(lo)return uo;lo=1;var e=je(),t=TypeError;return uo=function(n,r){if(e(r,n))return n;throw new t("Incorrect invocation")}}function Uo(){if(ho)return fo;ho=1;var e=Ln(),t=Un(),n=RangeError;return fo=function(r){if(void 0===r)return 0;var i=e(r),a=t(i);if(i!==a)throw new n("Wrong length or index");return a}}function Fo(){if(bo)return yo;bo=1;var e=vo?po:(vo=1,po=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}),t=function(){if(go)return mo;go=1;var e=4503599627370496;return mo=function(t){return t+e-e}}(),n=Math.abs;return yo=function(r,i,a,o){var s=+r,c=n(s),u=e(s);if(c<o)return u*t(c/o/i)*o*i;var l=(1+i/2220446049250313e-31)*c,f=l-(l-c);return f>a||f!=f?u*(1/0):u*f}}function Do(){if(xo)return _o;xo=1;var e=Array,t=Math.abs,n=Math.pow,r=Math.floor,i=Math.log,a=Math.LN2;return _o={pack:function(o,s,c){var u,l,f,h=e(c),d=8*c-s-1,p=(1<<d)-1,v=p>>1,m=23===s?n(2,-24)-n(2,-77):0,g=o<0||0===o&&1/o<0?1:0,y=0;for((o=t(o))!=o||o===1/0?(l=o!=o?1:0,u=p):(u=r(i(o)/a),o*(f=n(2,-u))<1&&(u--,f*=2),(o+=u+v>=1?m/f:m*n(2,1-v))*f>=2&&(u++,f/=2),u+v>=p?(l=0,u=p):u+v>=1?(l=(o*f-1)*n(2,s),u+=v):(l=o*n(2,v-1)*n(2,s),u=0));s>=8;)h[y++]=255&l,l/=256,s-=8;for(u=u<<s|l,d+=s;d>0;)h[y++]=255&u,u/=256,d-=8;return h[y-1]|=128*g,h},unpack:function(e,t){var r,i=e.length,a=8*i-t-1,o=(1<<a)-1,s=o>>1,c=a-7,u=i-1,l=e[u--],f=127&l;for(l>>=7;c>0;)f=256*f+e[u--],c-=8;for(r=f&(1<<-c)-1,f>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===f)f=1-s;else{if(f===o)return r?NaN:l?-1/0:1/0;r+=n(2,t),f-=s}return(l?-1:1)*r*n(2,f-t)}}}function No(){if(So)return Eo;So=1;var e=St(),t=Bn(),n=Fn();return Eo=function(r){for(var i=e(this),a=n(i),o=arguments.length,s=t(o>1?arguments[1]:void 0,a),c=o>2?arguments[2]:void 0,u=void 0===c?a:t(c,a);u>s;)i[s++]=r;return i},Eo}function jo(){if(Co)return ko;Co=1;var e=C(),t=Re(),n=D(),r=Po(),i=un(),a=Yt(),o=Mo(),s=Lo(),c=F(),u=Bo(),l=Ln(),f=Un(),h=Uo(),d=function(){if(wo)return Ao;wo=1;var e=Fo();return Ao=Math.fround||function(t){return e(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}}(),p=Do(),v=ma(),m=jr(),g=No(),y=Da(),b=zr(),A=Mr(),w=ya(),_=dn(),x=i.PROPER,E=i.CONFIGURABLE,S="ArrayBuffer",k="DataView",I="prototype",T="Wrong index",O=_.getterFor(S),R=_.getterFor(k),P=_.set,M=e[S],L=M,B=L&&L[I],U=e[k],N=U&&U[I],j=Object.prototype,W=e.Array,z=e.RangeError,G=t(g),H=t([].reverse),Y=p.pack,V=p.unpack,q=function(e){return[255&e]},X=function(e){return[255&e,e>>8&255]},$=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},J=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Q=function(e){return Y(d(e),23,4)},Z=function(e){return Y(e,52,8)},K=function(e,t,n){o(e[I],t,{configurable:!0,get:function(){return n(this)[t]}})},ee=function(e,t,n,r){var i=R(e),a=h(n),o=!!r;if(a+t>i.byteLength)throw new z(T);var s=i.bytes,c=a+i.byteOffset,u=y(s,c,c+t);return o?u:H(u)},te=function(e,t,n,r,i,a){var o=R(e),s=h(n),c=r(+i),u=!!a;if(s+t>o.byteLength)throw new z(T);for(var l=o.bytes,f=s+o.byteOffset,d=0;d<t;d++)l[f+d]=c[u?d:t-d-1]};if(r){var ne=x&&M.name!==S;c(function(){M(1)})&&c(function(){new M(-1)})&&!c(function(){return new M,new M(1.5),new M(NaN),1!==M.length||ne&&!E})?ne&&E&&a(M,"name",S):((L=function(e){return u(this,B),b(new M(h(e)),this,L)})[I]=B,B.constructor=L,A(L,M)),m&&v(N)!==j&&m(N,j);var re=new U(new L(2)),ie=t(N.setInt8);re.setInt8(0,2147483648),re.setInt8(1,2147483649),!re.getInt8(0)&&re.getInt8(1)||s(N,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else B=(L=function(e){u(this,B);var t=h(e);P(this,{type:S,bytes:G(W(t),0),byteLength:t}),n||(this.byteLength=t,this.detached=!1)})[I],N=(U=function(e,t,r){u(this,N),u(e,B);var i=O(e),a=i.byteLength,o=l(t);if(o<0||o>a)throw new z("Wrong offset");if(o+(r=void 0===r?a-o:f(r))>a)throw new z("Wrong length");P(this,{type:k,buffer:e,byteLength:r,byteOffset:o,bytes:i.bytes}),n||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[I],n&&(K(L,"byteLength",O),K(U,"buffer",R),K(U,"byteLength",R),K(U,"byteOffset",R)),s(N,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return J(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return J(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return V(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return V(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,q,t)},setUint8:function(e,t){te(this,1,e,q,t)},setInt16:function(e,t){te(this,2,e,X,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,X,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,$,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,$,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,Q,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,Z,t,arguments.length>2&&arguments[2])}});return w(L,S),w(U,k),ko={ArrayBuffer:L,DataView:U}}function Wo(){if(To)return Io;To=1;var e=Ne(),t=Mo(),n=It(),r=D(),i=n("species");return Io=function(n){var a=e(n);r&&a&&!a[i]&&t(a,i,{configurable:!0,get:function(){return this}})}}!function(){if(Oo)return Ro;Oo=1;var e=Br(),t=C(),n=jo(),r=Wo(),i="ArrayBuffer",a=n[i];e({global:!0,constructor:!0,forced:t[i]!==a},{ArrayBuffer:a}),r(i)}();var zo,Go,Ho,Yo,Vo,qo={};function Xo(){if(Go)return zo;Go=1;var e=C(),t=Fr(),n=Pe(),r=e.ArrayBuffer,i=e.TypeError;return zo=r&&t(r.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==n(e))throw new i("ArrayBuffer expected");return e.byteLength}}function $o(){if(Yo)return Ho;Yo=1;var e=C(),t=Po(),n=Xo(),r=e.DataView;return Ho=function(e){if(!t||0!==n(e))return!1;try{return new r(e),!1}catch(e){return!0}}}!function(){if(Vo)return qo;Vo=1;var e=D(),t=Mo(),n=$o(),r=ArrayBuffer.prototype;e&&!("detached"in r)&&t(r,"detached",{configurable:!0,get:function(){return n(this)}})}();var Jo,Qo,Zo,Ko,es,ts,ns,rs,is,as,os,ss,cs,us,ls,fs={};function hs(){if(Ko)return Zo;Ko=1;var e=C(),t=We(),n=Pe(),r=function(e){return t.slice(0,e.length)===e};return Zo=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":e.Bun&&"string"==typeof Bun.version?"BUN":e.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(e.process)?"NODE":e.window&&e.document?"BROWSER":"REST"}function ds(){if(ts)return es;ts=1;var e=hs();return es="NODE"===e}function ps(){if(rs)return ns;rs=1;var e=C(),t=ds();return ns=function(n){if(t){try{return e.process.getBuiltinModule(n)}catch(e){}try{return Function('return require("'+n+'")')()}catch(e){}}}}function vs(){if(as)return is;as=1;var e=C(),t=F(),n=ze(),r=hs(),i=e.structuredClone;return is=!!i&&!t(function(){if("DENO"===r&&n>92||"NODE"===r&&n>94||"BROWSER"===r&&n>97)return!1;var e=new ArrayBuffer(8),t=i(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})}function ms(){if(ss)return os;ss=1;var e,t,n,r,i=C(),a=ps(),o=vs(),s=i.structuredClone,c=i.ArrayBuffer,u=i.MessageChannel,l=!1;if(o)l=function(e){s(e,{transfer:[e]})};else if(c)try{u||(e=a("worker_threads"))&&(u=e.MessageChannel),u&&(t=new u,n=new c(2),r=function(e){t.port1.postMessage(null,[e])},2===n.byteLength&&(r(n),0===n.byteLength&&(l=r)))}catch(e){}return os=l}function gs(){if(us)return cs;us=1;var e=C(),t=Re(),n=Fr(),r=Uo(),i=function(){if(Qo)return Jo;Qo=1;var e=$o(),t=TypeError;return Jo=function(n){if(e(n))throw new t("ArrayBuffer is detached");return n}}(),a=Xo(),o=ms(),s=vs(),c=e.structuredClone,u=e.ArrayBuffer,l=e.DataView,f=Math.min,h=u.prototype,d=l.prototype,p=t(h.slice),v=n(h,"resizable","get"),m=n(h,"maxByteLength","get"),g=t(d.getInt8),y=t(d.setInt8);return cs=(s||o)&&function(e,t,n){var h,d=a(e),b=void 0===t?d:r(t),A=!v||!v(e);if(i(e),s&&(e=c(e,{transfer:[e]}),d===b&&(n||A)))return e;if(d>=b&&(!n||A))h=p(e,0,b);else{var w=n&&!A&&m?{maxByteLength:m(e)}:void 0;h=new u(b,w);for(var _=new l(e),x=new l(h),E=f(b,d),S=0;S<E;S++)y(x,S,g(_,S))}return s||o(e),h},cs}!function(){if(ls)return fs;ls=1;var e=Br(),t=gs();t&&e({target:"ArrayBuffer",proto:!0},{transfer:function(){return t(this,arguments.length?arguments[0]:void 0,!0)}})}();var ys,bs={};!function(){if(ys)return bs;ys=1;var e=Br(),t=gs();t&&e({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return t(this,arguments.length?arguments[0]:void 0,!1)}})}();var As,ws={};!function(){if(As)return ws;As=1;var e=D(),t=un().EXISTS,n=Re(),r=Mo(),i=Function.prototype,a=n(i.toString),o=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=n(o.exec);e&&!t&&r(i,"name",{configurable:!0,get:function(){try{return s(o,a(this))[1]}catch(e){return""}}})}();var _s,xs={};!function(){if(_s)return xs;_s=1;var e=Br(),t=C(),n=Bo(),r=Gt(),i=Fe(),a=ma(),o=Mo(),s=vi(),c=F(),u=kt(),l=It(),f=ga().IteratorPrototype,h=D(),d=wt(),p="constructor",v="Iterator",m=l("toStringTag"),g=TypeError,y=t[v],b=d||!i(y)||y.prototype!==f||!c(function(){y({})}),A=function(){if(n(this,f),a(this)===f)throw new g("Abstract class Iterator not directly constructable")},w=function(e,t){h?o(f,e,{configurable:!0,get:function(){return t},set:function(t){if(r(this),this===f)throw new g("You can't redefine this property");u(this,e)?this[e]=t:s(this,e,t)}}):f[e]=t};u(f,m)||w(m,v),!b&&u(f,p)&&f[p]!==Object||w(p,A),A.prototype=f,e({global:!0,constructor:!0,forced:b},{Iterator:A})}();var Es,Ss,ks,Cs,Is,Ts,Os,Rs,Ps,Ms,Ls,Bs,Us,Fs,Ds,Ns={};function js(){return Ss?Es:(Ss=1,Es=function(e){return{iterator:e,next:e.next,done:!1}})}function Ws(){if(Cs)return ks;Cs=1;var e=j(),t=Gt(),n=Xe();return ks=function(r,i,a){var o,s;t(r);try{if(!(o=n(r,"return"))){if("throw"===i)throw a;return a}o=e(o,r)}catch(e){s=!0,o=e}if("throw"===i)throw a;if(s)throw o;return t(o),a}}function zs(){if(Ts)return Is;Ts=1;var e=Ws();return Is=function(t,n,r){for(var i=t.length-1;i>=0;i--)if(void 0!==t[i])try{r=e(t[i].iterator,n,r)}catch(e){n="throw",r=e}if("throw"===n)throw r;return r}}function Gs(){if(Rs)return Os;Rs=1;var e=j(),t=da(),n=Yt(),r=Lo(),i=It(),a=dn(),o=Xe(),s=ga().IteratorPrototype,c=wa(),u=Ws(),l=zs(),f=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",p="normal",v="throw",m=a.set,g=function(n){var i=a.getterFor(n?d:h);return r(t(s),{next:function(){var e=i(this);if(n)return e.nextHandler();if(e.done)return c(void 0,!0);try{var t=e.nextHandler();return e.returnHandlerResult?t:c(t,e.done)}catch(t){throw e.done=!0,t}},return:function(){var t=i(this),r=t.iterator;if(t.done=!0,n){var a=o(r,"return");return a?e(a,r):c(void 0,!0)}if(t.inner)try{u(t.inner.iterator,p)}catch(e){return u(r,v,e)}if(t.openIters)try{l(t.openIters,p)}catch(e){return u(r,v,e)}return r&&u(r,p),c(void 0,!0)}})},y=g(!0),b=g(!1);return n(b,f,"Iterator Helper"),Os=function(e,t,n){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=t?d:h,i.returnHandlerResult=!!n,i.nextHandler=e,i.counter=0,i.done=!1,m(this,i)};return r.prototype=t?y:b,r}}function Hs(){if(Ms)return Ps;Ms=1;var e=Gt(),t=Ws();return Ps=function(n,r,i,a){try{return a?r(e(i)[0],i[1]):r(i)}catch(e){t(n,"throw",e)}}}function Ys(){return Bs?Ls:(Bs=1,Ls=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}})}function Vs(){if(Fs)return Us;Fs=1;var e=C();return Us=function(t,n){var r=e.Iterator,i=r&&r.prototype,a=i&&i[t],o=!1;if(a)try{a.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(e){e instanceof n||(o=!1)}if(!o)return a}}!function(){if(Ds)return Ns;Ds=1;var e=Br(),t=j(),n=qe(),r=Gt(),i=js(),a=Gs(),o=Hs(),s=wt(),c=Ws(),u=Ys(),l=Vs(),f=!s&&!u("filter",function(){}),h=!s&&!f&&l("filter",TypeError),d=s||f||h,p=a(function(){for(var e,n,i=this.iterator,a=this.predicate,s=this.next;;){if(e=r(t(s,i)),this.done=!!e.done)return;if(n=e.value,o(i,a,[n,this.counter++],!0))return n}});e({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(e){r(this);try{n(e)}catch(e){c(this,"throw",e)}return h?t(h,this,e):new p(i(this),{predicate:e})}})}();var qs,Xs,$s,Js,Qs,Zs,Ks,ec,tc,nc={};function rc(){if(Xs)return qs;Xs=1;var e=It(),t=va(),n=e("iterator"),r=Array.prototype;return qs=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function ic(){if(Js)return $s;Js=1;var e=Hr(),t=Xe(),n=Le(),r=va(),i=It()("iterator");return $s=function(a){if(!n(a))return t(a,i)||t(a,"@@iterator")||r[e(a)]}}function ac(){if(Zs)return Qs;Zs=1;var e=j(),t=qe(),n=Gt(),r=Ve(),i=ic(),a=TypeError;return Qs=function(o,s){var c=arguments.length<2?i(o):s;if(t(c))return n(e(c,o));throw new a(r(o)+" is not iterable")},Qs}function oc(){if(ec)return Ks;ec=1;var e=Ti(),t=j(),n=Gt(),r=Ve(),i=rc(),a=Fn(),o=je(),s=ac(),c=ic(),u=Ws(),l=TypeError,f=function(e,t){this.stopped=e,this.result=t},h=f.prototype;return Ks=function(d,p,v){var m,g,y,b,A,w,_,x=v&&v.that,E=!(!v||!v.AS_ENTRIES),S=!(!v||!v.IS_RECORD),k=!(!v||!v.IS_ITERATOR),C=!(!v||!v.INTERRUPTED),I=e(p,x),T=function(e){return m&&u(m,"normal"),new f(!0,e)},O=function(e){return E?(n(e),C?I(e[0],e[1],T):I(e[0],e[1])):C?I(e,T):I(e)};if(S)m=d.iterator;else if(k)m=d;else{if(!(g=c(d)))throw new l(r(d)+" is not iterable");if(i(g)){for(y=0,b=a(d);b>y;y++)if((A=O(d[y]))&&o(h,A))return A;return new f(!1)}m=s(d,g)}for(w=S?d.next:m.next;!(_=t(w,m)).done;){try{A=O(_.value)}catch(e){u(m,"throw",e)}if("object"==typeof A&&A&&o(h,A))return A}return new f(!1)}}!function(){if(tc)return nc;tc=1;var e=Br(),t=j(),n=oc(),r=qe(),i=Gt(),a=js(),o=Ws(),s=Vs()("forEach",TypeError);e({target:"Iterator",proto:!0,real:!0,forced:s},{forEach:function(e){i(this);try{r(e)}catch(e){o(this,"throw",e)}if(s)return t(s,this,e);var c=a(this),u=0;n(c,function(t){e(t,u++)},{IS_RECORD:!0})}})}();var sc,cc={};!function(){if(sc)return cc;sc=1;var e=Br(),t=j(),n=qe(),r=Gt(),i=js(),a=Gs(),o=Hs(),s=Ws(),c=Ys(),u=Vs(),l=wt(),f=!l&&!c("map",function(){}),h=!l&&!f&&u("map",TypeError),d=l||f||h,p=a(function(){var e=this.iterator,n=r(t(this.next,e));if(!(this.done=!!n.done))return o(e,this.mapper,[n.value,this.counter++],!0)});e({target:"Iterator",proto:!0,real:!0,forced:d},{map:function(e){r(this);try{n(e)}catch(e){s(this,"throw",e)}return h?t(h,this,e):new p(i(this),{mapper:e})}})}();var uc,lc,fc,hc={};!function(){if(fc)return hc;fc=1;var e=Br(),t=Ne(),n=Ur(),r=j(),i=Re(),a=F(),o=Fe(),s=Ye(),c=Da(),u=function(){if(lc)return uc;lc=1;var e=Re(),t=di(),n=Fe(),r=Pe(),i=Yr(),a=e([].push);return uc=function(e){if(n(e))return e;if(t(e)){for(var o=e.length,s=[],c=0;c<o;c++){var u=e[c];"string"==typeof u?a(s,u):"number"!=typeof u&&"Number"!==r(u)&&"String"!==r(u)||a(s,i(u))}var l=s.length,f=!0;return function(e,n){if(f)return f=!1,n;if(t(this))return n;for(var r=0;r<l;r++)if(s[r]===e)return n}}}}(),l=Ge(),f=String,h=t("JSON","stringify"),d=i(/./.exec),p=i("".charAt),v=i("".charCodeAt),m=i("".replace),g=i(1.1.toString),y=/[\uD800-\uDFFF]/g,b=/^[\uD800-\uDBFF]$/,A=/^[\uDC00-\uDFFF]$/,w=!l||a(function(){var e=t("Symbol")("stringify detection");return"[null]"!==h([e])||"{}"!==h({a:e})||"{}"!==h(Object(e))}),_=a(function(){return'"\\udf06\\ud834"'!==h("\udf06\ud834")||'"\\udead"'!==h("\udead")}),x=function(e,t){var i=c(arguments),a=u(t);if(o(a)||void 0!==e&&!s(e))return i[1]=function(e,t){if(o(a)&&(t=r(a,this,f(e),t)),!s(t))return t},n(h,null,i)},E=function(e,t,n){var r=p(n,t-1),i=p(n,t+1);return d(b,e)&&!d(A,i)||d(A,e)&&!d(b,r)?"\\u"+g(v(e,0),16):e};h&&e({target:"JSON",stat:!0,arity:3,forced:w||_},{stringify:function(e,t,r){var i=c(arguments),a=n(w?x:h,null,i);return _&&"string"==typeof a?m(a,y,E):a}})}();var dc,pc,vc,mc,gc,yc,bc,Ac,wc,_c,xc,Ec,Sc,kc,Cc,Ic,Tc={exports:{}},Oc={};function Rc(){if(dc)return Oc;dc=1;var e=Pe(),t=Ue(),n=Wn().f,r=Da(),i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return Oc.f=function(a){return i&&"Window"===e(a)?function(e){try{return n(e)}catch(e){return r(i)}}(a):n(t(a))},Oc}function Pc(){if(gc)return mc;gc=1;var e=F(),t=De(),n=Pe(),r=function(){if(vc)return pc;vc=1;var e=F();return pc=e(function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})}(),i=Object.isExtensible,a=e(function(){});return mc=a||r?function(e){return!!t(e)&&((!r||"ArrayBuffer"!==n(e))&&(!i||i(e)))}:i}function Mc(){if(Ac)return Tc.exports;Ac=1;var e=Br(),t=Re(),n=hn(),r=De(),i=kt(),a=Ht().f,o=Wn(),s=Rc(),c=Pc(),u=Ct(),l=function(){if(bc)return yc;bc=1;var e=F();return yc=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})}(),f=!1,h=u("meta"),d=0,p=function(e){a(e,h,{value:{objectID:"O"+d++,weakData:{}}})},v=Tc.exports={enable:function(){v.enable=function(){},f=!0;var n=o.f,r=t([].splice),i={};i[h]=1,n(i).length&&(o.f=function(e){for(var t=n(e),i=0,a=t.length;i<a;i++)if(t[i]===h){r(t,i,1);break}return t},e({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,h)){if(!c(e))return"F";if(!t)return"E";p(e)}return e[h].objectID},getWeakData:function(e,t){if(!i(e,h)){if(!c(e))return!0;if(!t)return!1;p(e)}return e[h].weakData},onFreeze:function(e){return l&&f&&c(e)&&!i(e,h)&&p(e),e}};return n[h]=!0,Tc.exports}function Lc(){if(_c)return wc;_c=1;var e=It()("iterator"),t=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){t=!0}};r[e]=function(){return this},Array.from(r,function(){throw 2})}catch(e){}return wc=function(n,r){try{if(!r&&!t)return!1}catch(e){return!1}var i=!1;try{var a={};a[e]=function(){return{next:function(){return{done:i=!0}}}},n(a)}catch(e){}return i}}Ic||(Ic=1,Cc||(Cc=1,function(){if(Ec)return xc;Ec=1;var e=Br(),t=C(),n=Re(),r=Lr(),i=vn(),a=Mc(),o=oc(),s=Bo(),c=Fe(),u=Le(),l=De(),f=F(),h=Lc(),d=ya(),p=zr();return xc=function(v,m,g){var y=-1!==v.indexOf("Map"),b=-1!==v.indexOf("Weak"),A=y?"set":"add",w=t[v],_=w&&w.prototype,x=w,E={},S=function(e){var t=n(_[e]);i(_,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(b&&!l(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return b&&!l(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(b&&!l(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(r(v,!c(w)||!(b||_.forEach&&!f(function(){(new w).entries().next()}))))x=g.getConstructor(m,v,y,A),a.enable();else if(r(v,!0)){var k=new x,C=k[A](b?{}:-0,1)!==k,I=f(function(){k.has(1)}),T=h(function(e){new w(e)}),O=!b&&f(function(){for(var e=new w,t=5;t--;)e[A](t,t);return!e.has(-0)});T||((x=m(function(e,t){s(e,_);var n=p(new w,e,x);return u(t)||o(t,n[A],{that:n,AS_ENTRIES:y}),n})).prototype=_,_.constructor=x),(I||O)&&(S("delete"),S("has"),y&&S("get")),(O||C)&&S(A),b&&_.clear&&delete _.clear}return E[v]=x,e({global:!0,constructor:!0,forced:x!==w},E),d(x,v),b||g.setStrong(x,v,y),x}}()("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},function(){if(kc)return Sc;kc=1;var e=da(),t=Mo(),n=Lo(),r=Ti(),i=Bo(),a=Le(),o=oc(),s=Aa(),c=wa(),u=Wo(),l=D(),f=Mc().fastKey,h=dn(),d=h.set,p=h.getterFor;return Sc={getConstructor:function(s,c,u,h){var v=s(function(t,n){i(t,m),d(t,{type:c,index:e(null),first:null,last:null,size:0}),l||(t.size=0),a(n)||o(n,t[h],{that:t,AS_ENTRIES:u})}),m=v.prototype,g=p(c),y=function(e,t,n){var r,i,a=g(e),o=b(e,t);return o?o.value=n:(a.last=o={index:i=f(t,!0),key:t,value:n,previous:r=a.last,next:null,removed:!1},a.first||(a.first=o),r&&(r.next=o),l?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},b=function(e,t){var n,r=g(e),i=f(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return n(m,{clear:function(){for(var t=g(this),n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=null),n=n.next;t.first=t.last=null,t.index=e(null),l?t.size=0:this.size=0},delete:function(e){var t=this,n=g(t),r=b(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),l?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=g(this),i=r(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!b(this,e)}}),n(m,u?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),l&&t(m,"size",{configurable:!0,get:function(){return g(this).size}}),v},setStrong:function(e,t,n){var r=t+" Iterator",i=p(t),a=p(r);s(e,t,function(e,t){d(this,{type:r,target:e,state:i(e),kind:t,last:null})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?c("keys"===t?n.key:"values"===t?n.value:[n.key,n.value],!1):(e.target=null,c(void 0,!0))},n?"entries":"values",!n,!0),u(t)}},Sc}())));var Bc,Uc,Fc,Dc,Nc,jc,Wc,zc,Gc,Hc={};function Yc(){if(Uc)return Bc;Uc=1;var e=C();return Bc=e}function Vc(){if(Dc)return Fc;Dc=1;var e=Re();return Fc=e(1.1.valueOf)}function qc(){return jc?Nc:(jc=1,Nc="\t\n\v\f\r \u2028\u2029\ufeff")}function Xc(){if(zc)return Wc;zc=1;var e=Re(),t=Be(),n=Yr(),r=qc(),i=e("".replace),a=RegExp("^["+r+"]+"),o=RegExp("(^|[^"+r+"])["+r+"]+$"),s=function(e){return function(r){var s=n(t(r));return 1&e&&(s=i(s,a,"")),2&e&&(s=i(s,o,"$1")),s}};return Wc={start:s(1),end:s(2),trim:s(3)}}!function(){if(Gc)return Hc;Gc=1;var e=Br(),t=wt(),n=D(),r=C(),i=Yc(),a=Re(),o=Lr(),s=kt(),c=zr(),u=je(),l=Ye(),f=Tt(),h=F(),d=Wn().f,p=Mt().f,v=Ht().f,m=Vc(),g=Xc().trim,y="Number",b=r[y],A=i[y],w=b.prototype,_=r.TypeError,x=a("".slice),E=a("".charCodeAt),S=function(e){var t,n,r,i,a,o,s,c,u=f(e,"number");if(l(u))throw new _("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=g(u),43===(t=E(u,0))||45===t){if(88===(n=E(u,2))||120===n)return NaN}else if(48===t){switch(E(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(o=(a=x(u,2)).length,s=0;s<o;s++)if((c=E(a,s))<48||c>i)return NaN;return parseInt(a,r)}return+u},k=o(y,!b(" 0o1")||!b("0b1")||b("+0x1")),I=function(e){var t,n=arguments.length<1?0:b(function(e){var t=f(e,"number");return"bigint"==typeof t?t:S(t)}(e));return u(w,t=this)&&h(function(){m(t)})?c(Object(n),this,I):n};I.prototype=w,k&&!t&&(w.constructor=I),e({global:!0,constructor:!0,wrap:!0,forced:k},{Number:I});var T=function(e,t){for(var r,i=n?d(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),a=0;i.length>a;a++)s(t,r=i[a])&&!s(e,r)&&v(e,r,p(t,r))};t&&A&&T(i[y],A),(k||t)&&T(i[y],b)}();var $c,Jc,Qc;function Zc(){if(Jc)return $c;Jc=1;var e=C().isFinite;return $c=Number.isFinite||function(t){return"number"==typeof t&&e(t)}}Qc||(Qc=1,Br()({target:"Number",stat:!0},{isFinite:Zc()}));var Kc,eu,tu,nu={};function ru(){if(eu)return Kc;eu=1;var e=D(),t=Re(),n=j(),r=F(),i=fa(),a=Rr(),o=Te(),s=St(),c=Me(),u=Object.assign,l=Object.defineProperty,f=t([].concat);return Kc=!u||r(function(){if(e&&1!==u({b:1},u(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},n={},r=Symbol("assign detection"),a="abcdefghijklmnopqrst";return t[r]=7,a.split("").forEach(function(e){n[e]=e}),7!==u({},t)[r]||i(u({},n)).join("")!==a})?function(t,r){for(var u=s(t),l=arguments.length,h=1,d=a.f,p=o.f;l>h;)for(var v,m=c(arguments[h++]),g=d?f(i(m),d(m)):i(m),y=g.length,b=0;y>b;)v=g[b++],e&&!n(p,m,v)||(u[v]=m[v]);return u}:u,Kc}!function(){if(tu)return nu;tu=1;var e=Br(),t=ru();e({target:"Object",stat:!0,arity:2,forced:Object.assign!==t},{assign:t})}();var iu,au,ou,su={};!function(){if(ou)return su;ou=1;var e=Br(),t=function(){if(au)return iu;au=1;var e=D(),t=F(),n=Re(),r=ma(),i=fa(),a=Ue(),o=n(Te().f),s=n([].push),c=e&&t(function(){var e=Object.create(null);return e[2]=2,!o(e,2)}),u=function(t){return function(n){for(var u,l=a(n),f=i(l),h=c&&null===r(l),d=f.length,p=0,v=[];d>p;)u=f[p++],e&&!(h?u in l:o(l,u))||s(v,t?[u,l[u]]:l[u]);return v}};return iu={entries:u(!0),values:u(!1)}}().entries;e({target:"Object",stat:!0},{entries:function(e){return t(e)}})}();var cu,uu={};!function(){if(cu)return uu;cu=1;var e=Br(),t=St(),n=fa();e({target:"Object",stat:!0,forced:F()(function(){n(1)})},{keys:function(e){return n(t(e))}})}();var lu,fu,hu,du={};!function(){if(hu)return du;hu=1;var e=Gr(),t=vn(),n=function(){if(fu)return lu;fu=1;var e=Gr(),t=Hr();return lu=e?{}.toString:function(){return"[object "+t(this)+"]"}}();e||t(Object.prototype,"toString",n,{unsafe:!0})}();var pu,vu,mu,gu,yu,bu,Au,wu,_u,xu,Eu,Su,ku,Cu,Iu,Tu,Ou,Ru,Pu,Mu,Lu,Bu,Uu,Fu,Du,Nu,ju,Wu,zu={};function Gu(){if(vu)return pu;vu=1;var e=mi(),t=Ve(),n=TypeError;return pu=function(r){if(e(r))return r;throw new n(t(r)+" is not a constructor")}}function Hu(){if(gu)return mu;gu=1;var e=Gt(),t=Gu(),n=Le(),r=It()("species");return mu=function(i,a){var o,s=e(i).constructor;return void 0===s||n(o=e(s)[r])?a:t(o)}}function Yu(){if(bu)return yu;bu=1;var e=TypeError;return yu=function(t,n){if(t<n)throw new e("Not enough arguments");return t}}function Vu(){if(wu)return Au;wu=1;var e=We();return Au=/(?:ipad|iphone|ipod).*applewebkit/i.test(e)}function qu(){if(xu)return _u;xu=1;var e,t,n,r,i=C(),a=Ur(),o=Ti(),s=Fe(),c=kt(),u=F(),l=ha(),f=Da(),h=Rt(),d=Yu(),p=Vu(),v=ds(),m=i.setImmediate,g=i.clearImmediate,y=i.process,b=i.Dispatch,A=i.Function,w=i.MessageChannel,_=i.String,x=0,E={},S="onreadystatechange";u(function(){e=i.location});var k=function(e){if(c(E,e)){var t=E[e];delete E[e],t()}},I=function(e){return function(){k(e)}},T=function(e){k(e.data)},O=function(t){i.postMessage(_(t),e.protocol+"//"+e.host)};return m&&g||(m=function(e){d(arguments.length,1);var n=s(e)?e:A(e),r=f(arguments,1);return E[++x]=function(){a(n,void 0,r)},t(x),x},g=function(e){delete E[e]},v?t=function(e){y.nextTick(I(e))}:b&&b.now?t=function(e){b.now(I(e))}:w&&!p?(r=(n=new w).port2,n.port1.onmessage=T,t=o(r.postMessage,r)):i.addEventListener&&s(i.postMessage)&&!i.importScripts&&e&&"file:"!==e.protocol&&!u(O)?(t=O,i.addEventListener("message",T,!1)):t=S in h("script")?function(e){l.appendChild(h("script"))[S]=function(){l.removeChild(this),k(e)}}:function(e){setTimeout(I(e),0)}),_u={set:m,clear:g}}function Xu(){if(Su)return Eu;Su=1;var e=C(),t=D(),n=Object.getOwnPropertyDescriptor;return Eu=function(r){if(!t)return e[r];var i=n(e,r);return i&&i.value}}function $u(){if(Cu)return ku;Cu=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},ku=e}function Ju(){if(Mu)return Pu;Mu=1;var e,t,n,r,i,a=C(),o=Xu(),s=Ti(),c=qu().set,u=$u(),l=Vu(),f=function(){if(Tu)return Iu;Tu=1;var e=We();return Iu=/ipad|iphone|ipod/i.test(e)&&"undefined"!=typeof Pebble}(),h=function(){if(Ru)return Ou;Ru=1;var e=We();return Ou=/web0s(?!.*chrome)/i.test(e)}(),d=ds(),p=a.MutationObserver||a.WebKitMutationObserver,v=a.document,m=a.process,g=a.Promise,y=o("queueMicrotask");if(!y){var b=new u,A=function(){var t,n;for(d&&(t=m.domain)&&t.exit();n=b.get();)try{n()}catch(t){throw b.head&&e(),t}t&&t.enter()};l||d||h||!p||!v?!f&&g&&g.resolve?((r=g.resolve(void 0)).constructor=g,i=s(r.then,r),e=function(){i(A)}):d?e=function(){m.nextTick(A)}:(c=s(c,a),e=function(){c(A)}):(t=!0,n=v.createTextNode(""),new p(A).observe(n,{characterData:!0}),e=function(){n.data=t=!t}),y=function(t){b.head||e(),b.add(t)}}return Pu=y}function Qu(){return Bu||(Bu=1,Lu=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}),Lu}function Zu(){return Fu?Uu:(Fu=1,Uu=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}})}function Ku(){if(Nu)return Du;Nu=1;var e=C();return Du=e.Promise}function el(){if(Wu)return ju;Wu=1;var e=C(),t=Ku(),n=Fe(),r=Lr(),i=ln(),a=It(),o=hs(),s=wt(),c=ze(),u=t&&t.prototype,l=a("species"),f=!1,h=n(e.PromiseRejectionEvent),d=r("Promise",function(){var e=i(t),n=e!==String(t);if(!n&&66===c)return!0;if(s&&(!u.catch||!u.finally))return!0;if(!c||c<51||!/native code/.test(e)){var r=new t(function(e){e(1)}),a=function(e){e(function(){},function(){})};if((r.constructor={})[l]=a,!(f=r.then(function(){})instanceof a))return!0}return!(n||"BROWSER"!==o&&"DENO"!==o||h)});return ju={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f}}var tl,nl,rl={};function il(){if(tl)return rl;tl=1;var e=qe(),t=TypeError,n=function(n){var r,i;this.promise=new n(function(e,n){if(void 0!==r||void 0!==i)throw new t("Bad Promise constructor");r=e,i=n}),this.resolve=e(r),this.reject=e(i)};return rl.f=function(e){return new n(e)},rl}var al,ol,sl,cl={};function ul(){if(ol)return al;ol=1;var e=Ku(),t=Lc(),n=el().CONSTRUCTOR;return al=n||!t(function(t){e.all(t).then(void 0,function(){})})}var ll,fl={};var hl,dl={};var pl,vl={};var ml,gl,yl,bl,Al={};function wl(){if(gl)return ml;gl=1;var e=Gt(),t=De(),n=il();return ml=function(r,i){if(e(r),t(i)&&i.constructor===r)return i;var a=n.f(r);return(0,a.resolve)(i),a.promise}}bl||(bl=1,function(){if(nl)return zu;nl=1;var e,t,n,r,i=Br(),a=wt(),o=ds(),s=C(),c=Yc(),u=j(),l=vn(),f=jr(),h=ya(),d=Wo(),p=qe(),v=Fe(),m=De(),g=Bo(),y=Hu(),b=qu().set,A=Ju(),w=Qu(),_=Zu(),x=$u(),E=dn(),S=Ku(),k=el(),I=il(),T="Promise",O=k.CONSTRUCTOR,R=k.REJECTION_EVENT,P=k.SUBCLASSING,M=E.getterFor(T),L=E.set,B=S&&S.prototype,U=S,F=B,D=s.TypeError,N=s.document,W=s.process,z=I.f,G=z,H=!!(N&&N.createEvent&&s.dispatchEvent),Y="unhandledrejection",V=function(e){var t;return!(!m(e)||!v(t=e.then))&&t},q=function(e,t){var n,r,i,a=t.value,o=1===t.state,s=o?e.ok:e.fail,c=e.resolve,l=e.reject,f=e.domain;try{s?(o||(2===t.rejection&&Z(t),t.rejection=1),!0===s?n=a:(f&&f.enter(),n=s(a),f&&(f.exit(),i=!0)),n===e.promise?l(new D("Promise-chain cycle")):(r=V(n))?u(r,n,c,l):c(n)):l(a)}catch(e){f&&!i&&f.exit(),l(e)}},X=function(e,t){e.notified||(e.notified=!0,A(function(){for(var n,r=e.reactions;n=r.get();)q(n,e);e.notified=!1,t&&!e.rejection&&J(e)}))},$=function(e,t,n){var r,i;H?((r=N.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!R&&(i=s["on"+e])?i(r):e===Y&&w("Unhandled promise rejection",n)},J=function(e){u(b,s,function(){var t,n=e.facade,r=e.value;if(Q(e)&&(t=_(function(){o?W.emit("unhandledRejection",r,n):$(Y,n,r)}),e.rejection=o||Q(e)?2:1,t.error))throw t.value})},Q=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){u(b,s,function(){var t=e.facade;o?W.emit("rejectionHandled",t):$("rejectionhandled",t,e.value)})},K=function(e,t,n){return function(r){e(t,r,n)}},ee=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,X(e,!0))},te=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new D("Promise can't be resolved itself");var r=V(t);r?A(function(){var n={done:!1};try{u(r,t,K(te,n,e),K(ee,n,e))}catch(t){ee(n,t,e)}}):(e.value=t,e.state=1,X(e,!1))}catch(t){ee({done:!1},t,e)}}};if(O&&(F=(U=function(t){g(this,F),p(t),u(e,this);var n=M(this);try{t(K(te,n),K(ee,n))}catch(e){ee(n,e)}}).prototype,(e=function(e){L(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:null})}).prototype=l(F,"then",function(e,t){var n=M(this),r=z(y(this,U));return n.parent=!0,r.ok=!v(e)||e,r.fail=v(t)&&t,r.domain=o?W.domain:void 0,0===n.state?n.reactions.add(r):A(function(){q(r,n)}),r.promise}),t=function(){var t=new e,n=M(t);this.promise=t,this.resolve=K(te,n),this.reject=K(ee,n)},I.f=z=function(e){return e===U||e===n?new t(e):G(e)},!a&&v(S)&&B!==Object.prototype)){r=B.then,P||l(B,"then",function(e,t){var n=this;return new U(function(e,t){u(r,n,e,t)}).then(e,t)},{unsafe:!0});try{delete B.constructor}catch(e){}f&&f(B,F)}i({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:U}),n=c.Promise,h(U,T,!1,!0),d(T)}(),function(){if(sl)return cl;sl=1;var e=Br(),t=j(),n=qe(),r=il(),i=Zu(),a=oc();e({target:"Promise",stat:!0,forced:ul()},{all:function(e){var o=this,s=r.f(o),c=s.resolve,u=s.reject,l=i(function(){var r=n(o.resolve),i=[],s=0,l=1;a(e,function(e){var n=s++,a=!1;l++,t(r,o,e).then(function(e){a||(a=!0,i[n]=e,--l||c(i))},u)}),--l||c(i)});return l.error&&u(l.value),s.promise}})}(),function(){if(ll)return fl;ll=1;var e=Br(),t=wt(),n=el().CONSTRUCTOR,r=Ku(),i=Ne(),a=Fe(),o=vn(),s=r&&r.prototype;if(e({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(e){return this.then(void 0,e)}}),!t&&a(r)){var c=i("Promise").prototype.catch;s.catch!==c&&o(s,"catch",c,{unsafe:!0})}}(),function(){if(hl)return dl;hl=1;var e=Br(),t=j(),n=qe(),r=il(),i=Zu(),a=oc();e({target:"Promise",stat:!0,forced:ul()},{race:function(e){var o=this,s=r.f(o),c=s.reject,u=i(function(){var r=n(o.resolve);a(e,function(e){t(r,o,e).then(s.resolve,c)})});return u.error&&c(u.value),s.promise}})}(),function(){if(pl)return vl;pl=1;var e=Br(),t=il();e({target:"Promise",stat:!0,forced:el().CONSTRUCTOR},{reject:function(e){var n=t.f(this);return(0,n.reject)(e),n.promise}})}(),function(){if(yl)return Al;yl=1;var e=Br(),t=Ne(),n=wt(),r=Ku(),i=el().CONSTRUCTOR,a=wl(),o=t("Promise"),s=n&&!i;e({target:"Promise",stat:!0,forced:n||i},{resolve:function(e){return a(s&&this===o?r:this,e)}})}());var _l,xl,El,Sl,kl,Cl,Il,Tl,Ol,Rl,Pl,Ml,Ll,Bl,Ul,Fl={};function Dl(){if(xl)return _l;xl=1;var e=De(),t=Pe(),n=It()("match");return _l=function(r){var i;return e(r)&&(void 0!==(i=r[n])?!!i:"RegExp"===t(r))}}function Nl(){if(Cl)return kl;Cl=1;var e=Gt();return kl=function(){var t=e(this),n="";return t.hasIndices&&(n+="d"),t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.unicodeSets&&(n+="v"),t.sticky&&(n+="y"),n}}function jl(){if(Tl)return Il;Tl=1;var e=j(),t=kt(),n=je(),r=function(){if(Sl)return El;Sl=1;var e=C(),t=F(),n=e.RegExp,r=!t(function(){var e=!0;try{n(".","d")}catch(t){e=!1}var t={},r="",i=e?"dgimsy":"gimsy",a=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(o.hasIndices="d"),o)a(s,o[s]);return Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(t)!==i||r!==i});return El={correct:r}}(),i=Nl(),a=RegExp.prototype;return Il=r.correct?function(e){return e.flags}:function(o){return r.correct||!n(a,o)||t(o,"flags")?o.flags:e(i,o)}}function Wl(){if(Rl)return Ol;Rl=1;var e=F(),t=C().RegExp,n=e(function(){var e=t("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),r=n||e(function(){return!t("a","y").sticky}),i=n||e(function(){var e=t("^r","gy");return e.lastIndex=2,null!==e.exec("str")});return Ol={BROKEN_CARET:i,MISSED_STICKY:r,UNSUPPORTED_Y:n}}function zl(){if(Ml)return Pl;Ml=1;var e=F(),t=C().RegExp;return Pl=e(function(){var e=t(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})}function Gl(){if(Bl)return Ll;Bl=1;var e=F(),t=C().RegExp;return Ll=e(function(){var e=t("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})}!function(){if(Ul)return Fl;Ul=1;var e=D(),t=C(),n=Re(),r=Lr(),i=zr(),a=Yt(),o=da(),s=Wn().f,c=je(),u=Dl(),l=Yr(),f=jl(),h=Wl(),d=Wr(),p=vn(),v=F(),m=kt(),g=dn().enforce,y=Wo(),b=It(),A=zl(),w=Gl(),_=b("match"),x=t.RegExp,E=x.prototype,S=t.SyntaxError,k=n(E.exec),I=n("".charAt),T=n("".replace),O=n("".indexOf),R=n("".slice),P=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,L=/a/g,B=new x(M)!==M,U=h.MISSED_STICKY,N=h.UNSUPPORTED_Y,j=e&&(!B||U||A||w||v(function(){return L[_]=!1,x(M)!==M||x(L)===L||"/a/i"!==String(x(M,"i"))}));if(r("RegExp",j)){for(var W=function(e,t){var n,r,s,h,d,p,v=c(E,this),y=u(e),b=void 0===t,_=[],C=e;if(!v&&y&&b&&e.constructor===W)return e;if((y||c(E,e))&&(e=e.source,b&&(t=f(C))),e=void 0===e?"":l(e),t=void 0===t?"":l(t),C=e,A&&"dotAll"in M&&(r=!!t&&O(t,"s")>-1)&&(t=T(t,/s/g,"")),n=t,U&&"sticky"in M&&(s=!!t&&O(t,"y")>-1)&&N&&(t=T(t,/y/g,"")),w&&(h=function(e){for(var t,n=e.length,r=0,i="",a=[],s=o(null),c=!1,u=!1,l=0,f="";r<=n;r++){if("\\"===(t=I(e,r)))t+=I(e,++r);else if("]"===t)c=!1;else if(!c)switch(!0){case"["===t:c=!0;break;case"("===t:if(i+=t,"?:"===R(e,r+1,r+3))continue;k(P,R(e,r+1))&&(r+=2,u=!0),l++;continue;case">"===t&&u:if(""===f||m(s,f))throw new S("Invalid capture group name");s[f]=!0,a[a.length]=[f,l],u=!1,f="";continue}u?f+=t:i+=t}return[i,a]}(e),e=h[0],_=h[1]),d=i(x(e,t),v?this:E,W),(r||s||_.length)&&(p=g(d),r&&(p.dotAll=!0,p.raw=W(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=I(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+I(e,++r);return i}(e),n)),s&&(p.sticky=!0),_.length&&(p.groups=_)),e!==C)try{a(d,"source",""===C?"(?:)":C)}catch(e){}return d},z=s(x),G=0;z.length>G;)d(W,x,z[G++]);E.constructor=W,W.prototype=E,p(t,"RegExp",W,{constructor:!0})}y("RegExp")}();var Hl,Yl={};!function(){if(Hl)return Yl;Hl=1;var e=D(),t=zl(),n=Pe(),r=Mo(),i=dn().get,a=RegExp.prototype,o=TypeError;e&&t&&r(a,"dotAll",{configurable:!0,get:function(){if(this!==a){if("RegExp"===n(this))return!!i(this).dotAll;throw new o("Incompatible receiver, RegExp required")}}})}();var Vl,ql,Xl,$l={};function Jl(){if(ql)return Vl;ql=1;var e,t,n=j(),r=Re(),i=Yr(),a=Nl(),o=Wl(),s=Et(),c=da(),u=dn().get,l=zl(),f=Gl(),h=s("native-string-replace",String.prototype.replace),d=RegExp.prototype.exec,p=d,v=r("".charAt),m=r("".indexOf),g=r("".replace),y=r("".slice),b=(t=/b*/g,n(d,e=/a/,"a"),n(d,t,"a"),0!==e.lastIndex||0!==t.lastIndex),A=o.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];return(b||w||A||l||f)&&(p=function(e){var t,r,o,s,l,f,_,x=this,E=u(x),S=i(e),k=E.raw;if(k)return k.lastIndex=x.lastIndex,t=n(p,k,S),x.lastIndex=k.lastIndex,t;var C=E.groups,I=A&&x.sticky,T=n(a,x),O=x.source,R=0,P=S;if(I&&(T=g(T,"y",""),-1===m(T,"g")&&(T+="g"),P=y(S,x.lastIndex),x.lastIndex>0&&(!x.multiline||x.multiline&&"\n"!==v(S,x.lastIndex-1))&&(O="(?: "+O+")",P=" "+P,R++),r=new RegExp("^(?:"+O+")",T)),w&&(r=new RegExp("^"+O+"$(?!\\s)",T)),b&&(o=x.lastIndex),s=n(d,I?r:x,P),I?s?(s.input=y(s.input,R),s[0]=y(s[0],R),s.index=x.lastIndex,x.lastIndex+=s[0].length):x.lastIndex=0:b&&s&&(x.lastIndex=x.global?s.index+s[0].length:o),w&&s&&s.length>1&&n(h,s[0],r,function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(s[l]=void 0)}),s&&C)for(s.groups=f=c(null),l=0;l<C.length;l++)f[(_=C[l])[0]]=s[_[1]];return s}),Vl=p}function Ql(){if(Xl)return $l;Xl=1;var e=Br(),t=Jl();return e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t}),$l}Ql();var Zl,Kl={};!function(){if(Zl)return Kl;Zl=1;var e=D(),t=Wl().MISSED_STICKY,n=Pe(),r=Mo(),i=dn().get,a=RegExp.prototype,o=TypeError;e&&t&&r(a,"sticky",{configurable:!0,get:function(){if(this!==a){if("RegExp"===n(this))return!!i(this).sticky;throw new o("Incompatible receiver, RegExp required")}}})}();var ef,tf={};!function(){if(ef)return tf;ef=1,Ql();var e,t,n=Br(),r=j(),i=Fe(),a=Gt(),o=Yr(),s=(e=!1,(t=/[ac]/).exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e),c=/./.test;n({target:"RegExp",proto:!0,forced:!s},{test:function(e){var t=a(this),n=o(e),s=t.exec;if(!i(s))return r(c,t,n);var u=r(s,t,n);return null!==u&&(a(u),!0)}})}();var nf,rf={};!function(){if(nf)return rf;nf=1;var e=un().PROPER,t=vn(),n=Gt(),r=Yr(),i=F(),a=jl(),o="toString",s=RegExp.prototype,c=s[o],u=i(function(){return"/a/b"!==c.call({source:"a",flags:"b"})}),l=e&&c.name!==o;(u||l)&&t(s,o,function(){var e=n(this);return"/"+r(e.source)+"/"+r(a(e))},{unsafe:!0})}();var af,of,sf,cf,uf,lf={};function ff(){if(of)return af;of=1;var e=Dl(),t=TypeError;return af=function(n){if(e(n))throw new t("The method doesn't accept regular expressions");return n}}function hf(){if(cf)return sf;cf=1;var e=It()("match");return sf=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,"/./"[t](n)}catch(e){}}return!1}}!function(){if(uf)return lf;uf=1;var e=Br(),t=Re(),n=ff(),r=Be(),i=Yr(),a=hf(),o=t("".indexOf);e({target:"String",proto:!0,forced:!a("includes")},{includes:function(e){return!!~o(i(r(this)),i(n(e)),arguments.length>1?arguments[1]:void 0)}})}();var df,pf,vf,mf={};function gf(){if(pf)return df;pf=1;var e=Re(),t=Ln(),n=Yr(),r=Be(),i=e("".charAt),a=e("".charCodeAt),o=e("".slice),s=function(e){return function(s,c){var u,l,f=n(r(s)),h=t(c),d=f.length;return h<0||h>=d?e?"":void 0:(u=a(f,h))<55296||u>56319||h+1===d||(l=a(f,h+1))<56320||l>57343?e?i(f,h):u:e?o(f,h,h+2):l-56320+(u-55296<<10)+65536}};return df={codeAt:s(!1),charAt:s(!0)}}function yf(){if(vf)return mf;vf=1;var e=gf().charAt,t=Yr(),n=dn(),r=Aa(),i=wa(),a="String Iterator",o=n.set,s=n.getterFor(a);return r(String,"String",function(e){o(this,{type:a,string:t(e),index:0})},function(){var t,n=s(this),r=n.string,a=n.index;return a>=r.length?i(void 0,!0):(t=e(r,a),n.index+=t.length,i(t,!1))}),mf}yf();var bf,Af,wf,_f,xf,Ef,Sf,kf={};function Cf(){if(Af)return bf;Af=1,Ql();var e=j(),t=vn(),n=Jl(),r=F(),i=It(),a=Yt(),o=i("species"),s=RegExp.prototype;return bf=function(c,u,l,f){var h=i(c),d=!r(function(){var e={};return e[h]=function(){return 7},7!==""[c](e)}),p=d&&!r(function(){var e=!1,t=/a/;return"split"===c&&((t={}).constructor={},t.constructor[o]=function(){return t},t.flags="",t[h]=/./[h]),t.exec=function(){return e=!0,null},t[h](""),!e});if(!d||!p||l){var v=/./[h],m=u(h,""[c],function(t,r,i,a,o){var c=r.exec;return c===n||c===s.exec?d&&!o?{done:!0,value:e(v,r,i,a)}:{done:!0,value:e(t,i,r,a)}:{done:!1}});t(String.prototype,c,m[0]),t(s,h,m[1])}f&&a(s[h],"sham",!0)}}function If(){if(_f)return wf;_f=1;var e=gf().charAt;return wf=function(t,n,r){return n+(r?e(t,n).length:1)}}function Tf(){if(Ef)return xf;Ef=1;var e=j(),t=Gt(),n=Fe(),r=Pe(),i=Jl(),a=TypeError;return xf=function(o,s){var c=o.exec;if(n(c)){var u=e(c,o,s);return null!==u&&t(u),u}if("RegExp"===r(o))return e(i,o,s);throw new a("RegExp#exec called on incompatible receiver")}}!function(){if(Sf)return kf;Sf=1;var e=j(),t=Re(),n=Cf(),r=Gt(),i=De(),a=Un(),o=Yr(),s=Be(),c=Xe(),u=If(),l=jl(),f=Tf(),h=t("".indexOf);n("match",function(t,n,d){return[function(n){var r=s(this),a=i(n)?c(n,t):void 0;return a?e(a,n,r):new RegExp(n)[t](o(r))},function(e){var t=r(this),i=o(e),s=d(n,t,i);if(s.done)return s.value;var c=o(l(t));if(-1===h(c,"g"))return f(t,i);var p=-1!==h(c,"u");t.lastIndex=0;for(var v,m=[],g=0;null!==(v=f(t,i));){var y=o(v[0]);m[g]=y,""===y&&(t.lastIndex=u(i,a(t.lastIndex),p)),g++}return 0===g?null:m}]})}();var Of,Rf,Pf,Mf={};function Lf(){if(Rf)return Of;Rf=1;var e=Re(),t=St(),n=Math.floor,r=e("".charAt),i=e("".replace),a=e("".slice),o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;return Of=function(e,c,u,l,f,h){var d=u+e.length,p=l.length,v=s;return void 0!==f&&(f=t(f),v=o),i(h,v,function(t,i){var o;switch(r(i,0)){case"$":return"$";case"&":return e;case"`":return a(c,0,u);case"'":return a(c,d);case"<":o=f[a(i,1,-1)];break;default:var s=+i;if(0===s)return t;if(s>p){var h=n(s/10);return 0===h?t:h<=p?void 0===l[h-1]?r(i,1):l[h-1]+r(i,1):t}o=l[s-1]}return void 0===o?"":o})}}!function(){if(Pf)return Mf;Pf=1;var e=Ur(),t=j(),n=Re(),r=Cf(),i=F(),a=Gt(),o=Fe(),s=De(),c=Ln(),u=Un(),l=Yr(),f=Be(),h=If(),d=Xe(),p=Lf(),v=jl(),m=Tf(),g=It()("replace"),y=Math.max,b=Math.min,A=n([].concat),w=n([].push),_=n("".indexOf),x=n("".slice),E=function(e){return void 0===e?e:String(e)},S="$0"==="a".replace(/./,"$0"),k=!!/./[g]&&""===/./[g]("a","$0");r("replace",function(n,r,i){var S=k?"$":"$0";return[function(e,n){var i=f(this),a=s(e)?d(e,g):void 0;return a?t(a,e,i,n):t(r,l(i),e,n)},function(t,n){var s=a(this),f=l(t);if("string"==typeof n&&-1===_(n,S)&&-1===_(n,"$<")){var d=i(r,s,f,n);if(d.done)return d.value}var g=o(n);g||(n=l(n));var k,C=l(v(s)),I=-1!==_(C,"g");I&&(k=-1!==_(C,"u"),s.lastIndex=0);for(var T,O=[];null!==(T=m(s,f))&&(w(O,T),I);){""===l(T[0])&&(s.lastIndex=h(f,u(s.lastIndex),k))}for(var R="",P=0,M=0;M<O.length;M++){for(var L,B=l((T=O[M])[0]),U=y(b(c(T.index),f.length),0),F=[],D=1;D<T.length;D++)w(F,E(T[D]));var N=T.groups;if(g){var j=A([B],F,U,f);void 0!==N&&w(j,N),L=l(e(n,void 0,j))}else L=p(B,f,U,F,N,n);U>=P&&(R+=x(f,P,U)+L,P=U+B.length)}return R+x(f,P)}]},!!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!S||k)}();var Bf,Uf,Ff,Df={};function Nf(){return Uf?Bf:(Uf=1,Bf=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t})}!function(){if(Ff)return Df;Ff=1;var e=j(),t=Cf(),n=Gt(),r=De(),i=Be(),a=Nf(),o=Yr(),s=Xe(),c=Tf();t("search",function(t,u,l){return[function(n){var a=i(this),c=r(n)?s(n,t):void 0;return c?e(c,n,a):new RegExp(n)[t](o(a))},function(e){var t=n(this),r=o(e),i=l(u,t,r);if(i.done)return i.value;var s=t.lastIndex;a(s,0)||(t.lastIndex=0);var f=c(t,r);return a(t.lastIndex,s)||(t.lastIndex=s),null===f?-1:f.index}]})}();var jf,Wf={};!function(){if(jf)return Wf;jf=1;var e,t=Br(),n=Ii(),r=Mt().f,i=Un(),a=Yr(),o=ff(),s=Be(),c=hf(),u=wt(),l=n("".slice),f=Math.min,h=c("startsWith");t({target:"String",proto:!0,forced:!!(u||h||(e=r(String.prototype,"startsWith"),!e||e.writable))&&!h},{startsWith:function(e){var t=a(s(this));o(e);var n=i(f(arguments.length>1?arguments[1]:void 0,t.length)),r=a(e);return l(t,n,n+r.length)===r}})}();var zf,Gf,Hf,Yf={};!function(){if(Hf)return Yf;Hf=1;var e=Br(),t=Xc().trim,n=function(){if(Gf)return zf;Gf=1;var e=un().PROPER,t=F(),n=qc();return zf=function(r){return t(function(){return!!n[r]()||"
"!=="
"[r]()||e&&n[r].name!==r})}}();e({target:"String",proto:!0,forced:n("trim")},{trim:function(){return t(this)}})}();var Vf,qf,Xf,$f,Jf,Qf,Zf,Kf,eh,th,nh,rh,ih,ah,oh,sh,ch,uh,lh,fh,hh,dh,ph={exports:{}};function vh(){if(qf)return Vf;qf=1;var e,t,n,r=Po(),i=D(),a=C(),o=Fe(),s=De(),c=kt(),u=Hr(),l=Ve(),f=Yt(),h=vn(),d=Mo(),p=je(),v=ma(),m=jr(),g=It(),y=Ct(),b=dn(),A=b.enforce,w=b.get,_=a.Int8Array,x=_&&_.prototype,E=a.Uint8ClampedArray,S=E&&E.prototype,k=_&&v(_),I=x&&v(x),T=Object.prototype,O=a.TypeError,R=g("toStringTag"),P=y("TYPED_ARRAY_TAG"),M="TypedArrayConstructor",L=r&&!!m&&"Opera"!==u(a.opera),B=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},N=function(e){var t=v(e);if(s(t)){var n=w(t);return n&&c(n,M)?n[M]:N(t)}},j=function(e){if(!s(e))return!1;var t=u(e);return c(U,t)||c(F,t)};for(e in U)(n=(t=a[e])&&t.prototype)?A(n)[M]=t:L=!1;for(e in F)(n=(t=a[e])&&t.prototype)&&(A(n)[M]=t);if((!L||!o(k)||k===Function.prototype)&&(k=function(){throw new O("Incorrect invocation")},L))for(e in U)a[e]&&m(a[e],k);if((!L||!I||I===T)&&(I=k.prototype,L))for(e in U)a[e]&&m(a[e].prototype,I);if(L&&v(S)!==I&&m(S,I),i&&!c(I,R))for(e in B=!0,d(I,R,{configurable:!0,get:function(){return s(this)?this[P]:void 0}}),U)a[e]&&f(a[e],P,e);return Vf={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:B&&P,aTypedArray:function(e){if(j(e))return e;throw new O("Target is not a typed array")},aTypedArrayConstructor:function(e){if(o(e)&&(!m||p(k,e)))return e;throw new O(l(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(i){if(n)for(var o in U){var s=a[o];if(s&&c(s.prototype,e))try{delete s.prototype[e]}catch(n){try{s.prototype[e]=t}catch(e){}}}I[e]&&!n||h(I,e,n?t:L&&x[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(i){if(m){if(n)for(r in U)if((o=a[r])&&c(o,e))try{delete o[e]}catch(e){}if(k[e]&&!n)return;try{return h(k,e,n?t:L&&k[e]||t)}catch(e){}}for(r in U)!(o=a[r])||o[e]&&!n||h(o,e,t)}},getTypedArrayConstructor:N,isView:function(e){if(!s(e))return!1;var t=u(e);return"DataView"===t||c(U,t)||c(F,t)},isTypedArray:j,TypedArray:k,TypedArrayPrototype:I}}function mh(){if(Qf)return Jf;Qf=1;var e=De(),t=Math.floor;return Jf=Number.isInteger||function(n){return!e(n)&&isFinite(n)&&t(n)===n}}function gh(){if(Kf)return Zf;Kf=1;var e=Ln(),t=RangeError;return Zf=function(n){var r=e(n);if(r<0)throw new t("The argument can't be less than 0");return r}}function yh(){if(th)return eh;th=1;var e=gh(),t=RangeError;return eh=function(n,r){var i=e(n);if(i%r)throw new t("Wrong offset");return i}}function bh(){if(rh)return nh;rh=1;var e=Math.round;return nh=function(t){var n=e(t);return n<0?0:n>255?255:255&n}}function Ah(){if(ah)return ih;ah=1;var e=Hr();return ih=function(t){var n=e(t);return"BigInt64Array"===n||"BigUint64Array"===n}}function wh(){if(sh)return oh;sh=1;var e=Tt(),t=TypeError;return oh=function(n){var r=e(n,"number");if("number"==typeof r)throw new t("Can't convert number to bigint");return BigInt(r)}}function _h(){if(uh)return ch;uh=1;var e=Ti(),t=j(),n=Gu(),r=St(),i=Fn(),a=ac(),o=ic(),s=rc(),c=Ah(),u=vh().aTypedArrayConstructor,l=wh();return ch=function(f){var h,d,p,v,m,g,y,b,A=n(this),w=r(f),_=arguments.length,x=_>1?arguments[1]:void 0,E=void 0!==x,S=o(w);if(S&&!s(S))for(b=(y=a(w,S)).next,w=[];!(g=t(b,y)).done;)w.push(g.value);for(E&&_>2&&(x=e(x,arguments[2])),d=i(w),p=new(u(A))(d),v=c(p),h=0;d>h;h++)m=E?x(w[h],h):w[h],p[h]=v?l(m):+m;return p},ch}function xh(){if(fh)return lh;fh=1;var e=Fn();return lh=function(t,n,r){for(var i=0,a=arguments.length>2?r:e(n),o=new t(a);a>i;)o[i]=n[i++];return o},lh}function Eh(){if(hh)return ph.exports;hh=1;var e=Br(),t=C(),n=j(),r=D(),i=function(){if($f)return Xf;$f=1;var e=C(),t=F(),n=Lc(),r=vh().NATIVE_ARRAY_BUFFER_VIEWS,i=e.ArrayBuffer,a=e.Int8Array;return Xf=!r||!t(function(){a(1)})||!t(function(){new a(-1)})||!n(function(e){new a,new a(null),new a(1.5),new a(e)},!0)||t(function(){return 1!==new a(new i(2),1,void 0).length})}(),a=vh(),o=jo(),s=Bo(),c=Oe(),u=Yt(),l=mh(),f=Un(),h=Uo(),d=yh(),p=bh(),v=Ot(),m=kt(),g=Hr(),y=De(),b=Ye(),A=da(),w=je(),_=jr(),x=Wn().f,E=_h(),S=Oi().forEach,k=Wo(),I=Mo(),T=Ht(),O=Mt(),R=xh(),P=dn(),M=zr(),L=P.get,B=P.set,U=P.enforce,N=T.f,W=O.f,z=t.RangeError,G=o.ArrayBuffer,H=G.prototype,Y=o.DataView,V=a.NATIVE_ARRAY_BUFFER_VIEWS,q=a.TYPED_ARRAY_TAG,X=a.TypedArray,$=a.TypedArrayPrototype,J=a.isTypedArray,Q="BYTES_PER_ELEMENT",Z="Wrong length",K=function(e,t){I(e,t,{configurable:!0,get:function(){return L(this)[t]}})},ee=function(e){var t;return w(H,e)||"ArrayBuffer"===(t=g(e))||"SharedArrayBuffer"===t},te=function(e,t){return J(e)&&!b(t)&&t in e&&l(+t)&&t>=0},ne=function(e,t){return t=v(t),te(e,t)?c(2,e[t]):W(e,t)},re=function(e,t,n){return t=v(t),!(te(e,t)&&y(n)&&m(n,"value"))||m(n,"get")||m(n,"set")||n.configurable||m(n,"writable")&&!n.writable||m(n,"enumerable")&&!n.enumerable?N(e,t,n):(e[t]=n.value,e)};return r?(V||(O.f=ne,T.f=re,K($,"buffer"),K($,"byteOffset"),K($,"byteLength"),K($,"length")),e({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:ne,defineProperty:re}),ph.exports=function(r,a,o){var c=r.match(/\d+/)[0]/8,l=r+(o?"Clamped":"")+"Array",v="get"+r,m="set"+r,g=t[l],b=g,w=b&&b.prototype,C={},I=function(e,t){N(e,t,{get:function(){return function(e,t){var n=L(e);return n.view[v](t*c+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var r=L(e);r.view[m](t*c+r.byteOffset,o?p(n):n,!0)}(this,t,e)},enumerable:!0})};V?i&&(b=a(function(e,t,r,i){return s(e,w),M(y(t)?ee(t)?void 0!==i?new g(t,d(r,c),i):void 0!==r?new g(t,d(r,c)):new g(t):J(t)?R(b,t):n(E,b,t):new g(h(t)),e,b)}),_&&_(b,X),S(x(g),function(e){e in b||u(b,e,g[e])}),b.prototype=w):(b=a(function(e,t,r,i){s(e,w);var a,o,u,l=0,p=0;if(y(t)){if(!ee(t))return J(t)?R(b,t):n(E,b,t);a=t,p=d(r,c);var v=t.byteLength;if(void 0===i){if(v%c)throw new z(Z);if((o=v-p)<0)throw new z(Z)}else if((o=f(i)*c)+p>v)throw new z(Z);u=o/c}else u=h(t),a=new G(o=u*c);for(B(e,{buffer:a,byteOffset:p,byteLength:o,length:u,view:new Y(a)});l<u;)I(e,l++)}),_&&_(b,X),w=b.prototype=A($)),w.constructor!==b&&u(w,"constructor",b),U(w).TypedArrayConstructor=b,q&&u(w,q,l);var T=b!==g;C[l]=b,e({global:!0,constructor:!0,forced:T,sham:!V},C),Q in b||u(b,Q,c),Q in w||u(w,Q,c),k(l)}):ph.exports=function(){},ph.exports}dh||(dh=1,Eh()("Uint8",function(e){return function(t,n,r){return e(this,t,n,r)}}));var Sh,kh={};!function(){if(Sh)return kh;Sh=1;var e=vh(),t=Fn(),n=Ln(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("at",function(e){var i=r(this),a=t(i),o=n(e),s=o>=0?o:a+o;return s<0||s>=a?void 0:i[s]})}();var Ch,Ih,Th,Oh={};!function(){if(Th)return Oh;Th=1;var e=Re(),t=vh(),n=function(){if(Ih)return Ch;Ih=1;var e=St(),t=Bn(),n=Fn(),r=Qa(),i=Math.min;return Ch=[].copyWithin||function(a,o){var s=e(this),c=n(s),u=t(a,c),l=t(o,c),f=arguments.length>2?arguments[2]:void 0,h=i((void 0===f?c:t(f,c))-l,c-u),d=1;for(l<u&&u<l+h&&(d=-1,l+=h-1,u+=h-1);h-- >0;)l in s?s[u]=s[l]:r(s,u),u+=d,l+=d;return s},Ch}(),r=e(n),i=t.aTypedArray;(0,t.exportTypedArrayMethod)("copyWithin",function(e,t){return r(i(this),e,t,arguments.length>2?arguments[2]:void 0)})}();var Rh,Ph={};!function(){if(Rh)return Ph;Rh=1;var e=vh(),t=Oi().every,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("every",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Mh,Lh={};!function(){if(Mh)return Lh;Mh=1;var e=vh(),t=No(),n=wh(),r=Hr(),i=j(),a=Re(),o=F(),s=e.aTypedArray,c=e.exportTypedArrayMethod,u=a("".slice);c("fill",function(e){var a=arguments.length;s(this);var o="Big"===u(r(this),0,3)?n(e):+e;return i(t,this,o,a>1?arguments[1]:void 0,a>2?arguments[2]:void 0)},o(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e}))}();var Bh,Uh,Fh,Dh={};!function(){if(Fh)return Dh;Fh=1;var e=vh(),t=Oi().filter,n=function(){if(Uh)return Bh;Uh=1;var e=xh(),t=vh().getTypedArrayConstructor;return Bh=function(n,r){return e(t(n),r)}}(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("filter",function(e){var i=t(r(this),e,arguments.length>1?arguments[1]:void 0);return n(this,i)})}();var Nh,jh={};!function(){if(Nh)return jh;Nh=1;var e=vh(),t=Oi().find,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("find",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Wh,zh={};!function(){if(Wh)return zh;Wh=1;var e=vh(),t=Oi().findIndex,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("findIndex",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Gh,Hh,Yh,Vh={};function qh(){if(Hh)return Gh;Hh=1;var e=Ti(),t=Me(),n=St(),r=Fn(),i=function(i){var a=1===i;return function(o,s,c){for(var u,l=n(o),f=t(l),h=r(f),d=e(s,c);h-- >0;)if(d(u=f[h],h,l))switch(i){case 0:return u;case 1:return h}return a?-1:void 0}};return Gh={findLast:i(0),findLastIndex:i(1)}}!function(){if(Yh)return Vh;Yh=1;var e=vh(),t=qh().findLast,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLast",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Xh,$h={};!function(){if(Xh)return $h;Xh=1;var e=vh(),t=qh().findLastIndex,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLastIndex",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Jh,Qh={};!function(){if(Jh)return Qh;Jh=1;var e=vh(),t=Oi().forEach,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("forEach",function(e){t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Zh,Kh={};!function(){if(Zh)return Kh;Zh=1;var e=vh(),t=Dn().includes,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("includes",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var ed,td={};!function(){if(ed)return td;ed=1;var e=vh(),t=Dn().indexOf,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("indexOf",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var nd,rd={};!function(){if(nd)return rd;nd=1;var e=C(),t=F(),n=Re(),r=vh(),i=_a(),a=It()("iterator"),o=e.Uint8Array,s=n(i.values),c=n(i.keys),u=n(i.entries),l=r.aTypedArray,f=r.exportTypedArrayMethod,h=o&&o.prototype,d=!t(function(){h[a].call([1])}),p=!!h&&h.values&&h[a]===h.values&&"values"===h.values.name,v=function(){return s(l(this))};f("entries",function(){return u(l(this))},d),f("keys",function(){return c(l(this))},d),f("values",v,d||!p,{name:"values"}),f(a,v,d||!p,{name:"values"})}();var id,ad={};!function(){if(id)return ad;id=1;var e=vh(),t=Re(),n=e.aTypedArray,r=e.exportTypedArrayMethod,i=t([].join);r("join",function(e){return i(n(this),e)})}();var od,sd,cd,ud={};!function(){if(cd)return ud;cd=1;var e=vh(),t=Ur(),n=function(){if(sd)return od;sd=1;var e=Ur(),t=Ue(),n=Ln(),r=Fn(),i=Ca(),a=Math.min,o=[].lastIndexOf,s=!!o&&1/[1].lastIndexOf(1,-0)<0,c=i("lastIndexOf");return od=s||!c?function(i){if(s)return e(o,this,arguments)||0;var c=t(this),u=r(c);if(0===u)return-1;var l=u-1;for(arguments.length>1&&(l=a(l,n(arguments[1]))),l<0&&(l=u+l);l>=0;l--)if(l in c&&c[l]===i)return l||0;return-1}:o,od}(),r=e.aTypedArray;(0,e.exportTypedArrayMethod)("lastIndexOf",function(e){var i=arguments.length;return t(n,r(this),i>1?[e,arguments[1]]:[e])})}();var ld,fd={};!function(){if(ld)return fd;ld=1;var e=vh(),t=Oi().map,n=e.aTypedArray,r=e.getTypedArrayConstructor;(0,e.exportTypedArrayMethod)("map",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0,function(e,t){return new(r(e))(t)})})}();var hd,dd,pd,vd={};function md(){if(dd)return hd;dd=1;var e=qe(),t=St(),n=Me(),r=Fn(),i=TypeError,a="Reduce of empty array with no initial value",o=function(o){return function(s,c,u,l){var f=t(s),h=n(f),d=r(f);if(e(c),0===d&&u<2)throw new i(a);var p=o?d-1:0,v=o?-1:1;if(u<2)for(;;){if(p in h){l=h[p],p+=v;break}if(p+=v,o?p<0:d<=p)throw new i(a)}for(;o?p>=0:d>p;p+=v)p in h&&(l=c(l,h[p],p,f));return l}};return hd={left:o(!1),right:o(!0)}}!function(){if(pd)return vd;pd=1;var e=vh(),t=md().left,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduce",function(e){var r=arguments.length;return t(n(this),e,r,r>1?arguments[1]:void 0)})}();var gd,yd={};!function(){if(gd)return yd;gd=1;var e=vh(),t=md().right,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduceRight",function(e){var r=arguments.length;return t(n(this),e,r,r>1?arguments[1]:void 0)})}();var bd,Ad={};!function(){if(bd)return Ad;bd=1;var e=vh(),t=e.aTypedArray,n=e.exportTypedArrayMethod,r=Math.floor;n("reverse",function(){for(var e,n=this,i=t(n).length,a=r(i/2),o=0;o<a;)e=n[o],n[o++]=n[--i],n[i]=e;return n})}();var wd,_d={};!function(){if(wd)return _d;wd=1;var e=C(),t=j(),n=vh(),r=Fn(),i=yh(),a=St(),o=F(),s=e.RangeError,c=e.Int8Array,u=c&&c.prototype,l=u&&u.set,f=n.aTypedArray,h=n.exportTypedArrayMethod,d=!o(function(){var e=new Uint8ClampedArray(2);return t(l,e,{length:1,0:3},1),3!==e[1]}),p=d&&n.NATIVE_ARRAY_BUFFER_VIEWS&&o(function(){var e=new c(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});h("set",function(e){f(this);var n=i(arguments.length>1?arguments[1]:void 0,1),o=a(e);if(d)return t(l,this,o,n);var c=this.length,u=r(o),h=0;if(u+n>c)throw new s("Wrong length");for(;h<u;)this[n+h]=o[h++]},!d||p)}();var xd,Ed={};!function(){if(xd)return Ed;xd=1;var e=vh(),t=F(),n=Da(),r=e.aTypedArray,i=e.getTypedArrayConstructor;(0,e.exportTypedArrayMethod)("slice",function(e,t){for(var a=n(r(this),e,t),o=i(this),s=0,c=a.length,u=new o(c);c>s;)u[s]=a[s++];return u},t(function(){new Int8Array(1).slice()}))}();var Sd,kd={};!function(){if(Sd)return kd;Sd=1;var e=vh(),t=Oi().some,n=e.aTypedArray;(0,e.exportTypedArrayMethod)("some",function(e){return t(n(this),e,arguments.length>1?arguments[1]:void 0)})}();var Cd,Id={};!function(){if(Cd)return Id;Cd=1;var e=C(),t=Ii(),n=F(),r=qe(),i=Za(),a=vh(),o=Ka(),s=eo(),c=ze(),u=to(),l=a.aTypedArray,f=a.exportTypedArrayMethod,h=e.Uint16Array,d=h&&t(h.prototype.sort),p=!(!d||n(function(){d(new h(2),null)})&&n(function(){d(new h(2),{})})),v=!!d&&!n(function(){if(c)return c<74;if(o)return o<67;if(s)return!0;if(u)return u<602;var e,t,n=new h(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(d(n,function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0});f("sort",function(e){return void 0!==e&&r(e),v?d(this,e):i(l(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))},!v||p)}();var Td,Od={};!function(){if(Td)return Od;Td=1;var e=vh(),t=Un(),n=Bn(),r=e.aTypedArray,i=e.getTypedArrayConstructor;(0,e.exportTypedArrayMethod)("subarray",function(e,a){var o=r(this),s=o.length,c=n(e,s);return new(i(o))(o.buffer,o.byteOffset+c*o.BYTES_PER_ELEMENT,t((void 0===a?s:n(a,s))-c))})}();var Rd,Pd={};!function(){if(Rd)return Pd;Rd=1;var e=C(),t=Ur(),n=vh(),r=F(),i=Da(),a=e.Int8Array,o=n.aTypedArray,s=n.exportTypedArrayMethod,c=[].toLocaleString,u=!!a&&r(function(){c.call(new a(1))});s("toLocaleString",function(){return t(c,u?i(o(this)):o(this),i(arguments))},r(function(){return[1,2].toLocaleString()!==new a([1,2]).toLocaleString()})||!r(function(){a.prototype.toLocaleString.call([1,2])}))}();var Md,Ld,Bd,Ud={};function Fd(){if(Ld)return Md;Ld=1;var e=Fn();return Md=function(t,n){for(var r=e(t),i=new n(r),a=0;a<r;a++)i[a]=t[r-a-1];return i}}!function(){if(Bd)return Ud;Bd=1;var e=Fd(),t=vh(),n=t.aTypedArray,r=t.exportTypedArrayMethod,i=t.getTypedArrayConstructor;r("toReversed",function(){return e(n(this),i(this))})}();var Dd,Nd={};!function(){if(Dd)return Nd;Dd=1;var e=vh(),t=Re(),n=qe(),r=xh(),i=e.aTypedArray,a=e.getTypedArrayConstructor,o=e.exportTypedArrayMethod,s=t(e.TypedArrayPrototype.sort);o("toSorted",function(e){void 0!==e&&n(e);var t=i(this),o=r(a(t),t);return s(o,e)})}();var jd,Wd={};!function(){if(jd)return Wd;jd=1;var e=vh().exportTypedArrayMethod,t=F(),n=C(),r=Re(),i=n.Uint8Array,a=i&&i.prototype||{},o=[].toString,s=r([].join);t(function(){o.call({})})&&(o=function(){return s(this)});var c=a.toString!==o;e("toString",o,c)}();var zd,Gd,Hd,Yd={};function Vd(){if(Gd)return zd;Gd=1;var e=Fn(),t=Ln(),n=RangeError;return zd=function(r,i,a,o){var s=e(r),c=t(a),u=c<0?s+c:c;if(u>=s||u<0)throw new n("Incorrect index");for(var l=new i(s),f=0;f<s;f++)l[f]=f===u?o:r[f];return l}}!function(){if(Hd)return Yd;Hd=1;var e=Vd(),t=vh(),n=Ah(),r=Ln(),i=wh(),a=t.aTypedArray,o=t.getTypedArrayConstructor,s=t.exportTypedArrayMethod,c=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}(),u=c&&function(){try{new Int8Array(1).with(-.5,1)}catch(e){return!0}}();s("with",{with:function(t,s){var c=a(this),u=r(t),l=n(c)?i(s):+s;return e(c,o(c),u,l)}}.with,!c||u)}();var qd,Xd,$d,Jd={};!function(){if($d)return Jd;$d=1;var e=Br(),t=C(),n=Ne(),r=Re(),i=j(),a=F(),o=Yr(),s=Yu(),c=function(){if(Xd)return qd;Xd=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=e+"+/",n=e+"-_",r=function(e){for(var t={},n=0;n<64;n++)t[e.charAt(n)]=n;return t};return qd={i2c:t,c2i:r(t),i2cUrl:n,c2iUrl:r(n)}}().c2i,u=/[^\d+/a-z]/i,l=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,h=n("atob"),d=String.fromCharCode,p=r("".charAt),v=r("".replace),m=r(u.exec),g=!!h&&!a(function(){return"hi"!==h("aGk=")}),y=g&&a(function(){return""!==h(" ")}),b=g&&!a(function(){h("a")}),A=g&&!a(function(){h()}),w=g&&1!==h.length;e({global:!0,bind:!0,enumerable:!0,forced:!g||y||b||A||w},{atob:function(e){if(s(arguments.length,1),g&&!y&&!b)return i(h,t,e);var r,a,A,w=v(o(e),l,""),_="",x=0,E=0;if(w.length%4==0&&(w=v(w,f,"")),(r=w.length)%4==1||m(u,w))throw new(n("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;x<r;)a=p(w,x++),A=E%4?64*A+c[a]:c[a],E++%4&&(_+=d(255&A>>(-2*E&6)));return _}})}();var Qd,Zd,Kd,ep,tp,np,rp,ip={};function ap(){return Zd?Qd:(Zd=1,Qd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0})}function op(){if(ep)return Kd;ep=1;var e=Rt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return Kd=t===Object.prototype?void 0:t}!function(){if(rp)return ip;rp=1;var e=C(),t=ap(),n=op(),r=function(){if(np)return tp;np=1;var e=Oi().forEach,t=Ca()("forEach");return tp=t?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)},tp}(),i=Yt(),a=function(e){if(e&&e.forEach!==r)try{i(e,"forEach",r)}catch(t){e.forEach=r}};for(var o in t)t[o]&&a(e[o]&&e[o].prototype);a(n)}();var sp,cp={};!function(){if(sp)return cp;sp=1;var e=C(),t=ap(),n=op(),r=_a(),i=Yt(),a=ya(),o=It()("iterator"),s=r.values,c=function(e,n){if(e){if(e[o]!==s)try{i(e,o,s)}catch(t){e[o]=s}if(a(e,n,!0),t[n])for(var c in r)if(e[c]!==r[c])try{i(e,c,r[c])}catch(t){e[c]=r[c]}}};for(var u in t)c(e[u]&&e[u].prototype,u);c(n,"DOMTokenList")}();var up,lp,fp,hp,dp,pp={};function vp(){if(lp)return up;lp=1;var e=D(),t=F(),n=Gt(),r=Vr(),i=Error.prototype.toString,a=t(function(){if(e){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==i.call(t))return!0}return"2: 1"!==i.call({message:1,name:2})||"Error"!==i.call({})});return up=a?function(){var e=n(this),t=r(e.name,"Error"),i=r(e.message);return t?i?t+": "+i:t:i}:i}function mp(){return hp?fp:(hp=1,fp={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}})}!function(){if(dp)return pp;dp=1;var e=Br(),t=Ne(),n=ps(),r=F(),i=da(),a=Oe(),o=Ht().f,s=vn(),c=Mo(),u=kt(),l=Bo(),f=Gt(),h=vp(),d=Vr(),p=mp(),v=Xr(),m=dn(),g=D(),y=wt(),b="DOMException",A="DATA_CLONE_ERR",w=t("Error"),_=t(b)||function(){try{(new(t("MessageChannel")||n("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===A&&25===e.code)return e.constructor}}(),x=_&&_.prototype,E=w.prototype,S=m.set,k=m.getterFor(b),C="stack"in new w(b),I=function(e){return u(p,e)&&p[e].m?p[e].c:0},T=function(){l(this,O);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=I(n);if(S(this,{type:b,name:n,message:t,code:r}),g||(this.name=n,this.message=t,this.code=r),C){var i=new w(t);i.name=b,o(this,"stack",a(1,v(i.stack,1)))}},O=T.prototype=i(E),R=function(e){return{enumerable:!0,configurable:!0,get:e}},P=function(e){return R(function(){return k(this)[e]})};g&&(c(O,"code",P("code")),c(O,"message",P("message")),c(O,"name",P("name"))),o(O,"constructor",a(1,T));var M=r(function(){return!(new _ instanceof w)}),L=M||r(function(){return E.toString!==h||"2: 1"!==String(new _(1,2))}),B=M||r(function(){return 25!==new _(1,"DataCloneError").code}),U=M||25!==_[A]||25!==x[A],N=y?L||B||U:M;e({global:!0,constructor:!0,forced:N},{DOMException:N?T:_});var j=t(b),W=j.prototype;for(var z in L&&(y||_===j)&&s(W,"toString",h),B&&g&&_===j&&c(W,"code",R(function(){return I(f(this).name)})),p)if(u(p,z)){var G=p[z],H=G.s,Y=a(6,G.c);u(j,H)||o(j,H,Y),u(W,H)||o(W,H,Y)}}();var gp,yp={};!function(){if(gp)return yp;gp=1;var e=Br(),t=C(),n=Ne(),r=Oe(),i=Ht().f,a=kt(),o=Bo(),s=zr(),c=Vr(),u=mp(),l=Xr(),f=D(),h=wt(),d="DOMException",p=n("Error"),v=n(d),m=function(){o(this,g);var e=arguments.length,t=c(e<1?void 0:arguments[0]),n=c(e<2?void 0:arguments[1],"Error"),a=new v(t,n),u=new p(t);return u.name=d,i(a,"stack",r(1,l(u.stack,1))),s(a,this,m),a},g=m.prototype=v.prototype,y="stack"in new p(d),b="stack"in new v(1,2),A=v&&f&&Object.getOwnPropertyDescriptor(t,d),w=!(!A||A.writable&&A.configurable),_=y&&!w&&!b;e({global:!0,constructor:!0,forced:h||_},{DOMException:_?m:v});var x=n(d),E=x.prototype;if(E.constructor!==x)for(var S in h||i(E,"constructor",r(1,x)),u)if(a(u,S)){var k=u[S],I=k.s;a(x,I)||i(x,I,r(6,k.c))}}();var bp,Ap={};!function(){if(bp)return Ap;bp=1;var e=Ne(),t="DOMException";ya()(e(t),t)}();var wp,_p={};!function(){if(wp)return _p;wp=1;var e=Br(),t=C(),n=Mo(),r=D(),i=TypeError,a=Object.defineProperty,o=t.self!==t;try{if(r){var s=Object.getOwnPropertyDescriptor(t,"self");!o&&s&&s.get&&s.enumerable||n(t,"self",{get:function(){return t},set:function(e){if(this!==t)throw new i("Illegal invocation");a(t,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else e({global:!0,simple:!0,forced:o},{self:t})}catch(e){}}();var xp,Ep,Sp,kp,Cp,Ip,Tp={};function Op(){if(Ep)return xp;Ep=1;var e=F(),t=It(),n=D(),r=wt(),i=t("iterator");return xp=!e(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,a=new URLSearchParams("a=1&a=2&b=3"),o="";return e.pathname="c%20d",t.forEach(function(e,n){t.delete("b"),o+=n+e}),a.delete("a",2),a.delete("b",void 0),r&&(!e.toJSON||!a.has("a",1)||a.has("a",2)||!a.has("a",void 0)||a.has("b"))||!t.size&&(r||!n)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",void 0).host})}function Rp(){if(kp)return Sp;kp=1;var e=Ti(),t=j(),n=St(),r=Hs(),i=rc(),a=mi(),o=Fn(),s=vi(),c=ac(),u=ic(),l=Array;return Sp=function(f){var h=n(f),d=a(this),p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v;m&&(v=e(v,p>2?arguments[2]:void 0));var g,y,b,A,w,_,x=u(h),E=0;if(!x||this===l&&i(x))for(g=o(h),y=d?new this(g):l(g);g>E;E++)_=m?v(h[E],E):h[E],s(y,E,_);else for(y=d?new this:[],w=(A=c(h,x)).next;!(b=t(w,A)).done;E++)_=m?r(A,v,[b.value,E],!0):b.value,s(y,E,_);return y.length=E,y},Sp}function Pp(){if(Ip)return Cp;Ip=1;var e=Re(),t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",a=RangeError,o=e(r.exec),s=Math.floor,c=String.fromCharCode,u=e("".charCodeAt),l=e([].join),f=e([].push),h=e("".replace),d=e("".split),p=e("".toLowerCase),v=function(e){return e+22+75*(e<26)},m=function(e,t,n){var r=0;for(e=n?s(e/700):e>>1,e+=s(e/t);e>455;)e=s(e/35),r+=36;return s(r+36*e/(e+38))},g=function(e){var n=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=u(e,n++);if(i>=55296&&i<=56319&&n<r){var a=u(e,n++);56320==(64512&a)?f(t,((1023&i)<<10)+(1023&a)+65536):(f(t,i),n--)}else f(t,i)}return t}(e);var r,o,h=e.length,d=128,p=0,g=72;for(r=0;r<e.length;r++)(o=e[r])<128&&f(n,c(o));var y=n.length,b=y;for(y&&f(n,"-");b<h;){var A=t;for(r=0;r<e.length;r++)(o=e[r])>=d&&o<A&&(A=o);var w=b+1;if(A-d>s((t-p)/w))throw new a(i);for(p+=(A-d)*w,d=A,r=0;r<e.length;r++){if((o=e[r])<d&&++p>t)throw new a(i);if(o===d){for(var _=p,x=36;;){var E=x<=g?1:x>=g+26?26:x-g;if(_<E)break;var S=_-E,k=36-E;f(n,c(v(E+S%k))),_=s(S/k),x+=36}f(n,c(v(_))),g=m(p,w,b===y),p=0,b++}}p++,d++}return l(n,"")};return Cp=function(e){var t,i,a=[],s=d(h(p(e),r,"."),".");for(t=0;t<s.length;t++)i=s[t],f(a,o(n,i)?"xn--"+g(i):i);return l(a,".")}}var Mp,Lp,Bp,Up,Fp,Dp={};function Np(){if(Bp)return Lp;Bp=1,_a(),function(){if(Mp)return Dp;Mp=1;var e=Br(),t=Re(),n=Bn(),r=RangeError,i=String.fromCharCode,a=String.fromCodePoint,o=t([].join);e({target:"String",stat:!0,arity:1,forced:!!a&&1!==a.length},{fromCodePoint:function(e){for(var t,a=[],s=arguments.length,c=0;s>c;){if(t=+arguments[c++],n(t,1114111)!==t)throw new r(t+" is not a valid code point");a[c]=t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320)}return o(a,"")}})}();var e=Br(),t=C(),n=Xu(),r=Ne(),i=j(),a=Re(),o=D(),s=Op(),c=vn(),u=Mo(),l=Lo(),f=ya(),h=ba(),d=dn(),p=Bo(),v=Fe(),m=kt(),g=Ti(),y=Hr(),b=Gt(),A=De(),w=Yr(),_=da(),x=Oe(),E=ac(),S=ic(),k=wa(),I=Yu(),T=It(),O=Za(),R=T("iterator"),P="URLSearchParams",M=P+"Iterator",L=d.set,B=d.getterFor(P),U=d.getterFor(M),F=n("fetch"),N=n("Request"),W=n("Headers"),z=N&&N.prototype,G=W&&W.prototype,H=t.TypeError,Y=t.encodeURIComponent,V=String.fromCharCode,q=r("String","fromCodePoint"),X=parseInt,$=a("".charAt),J=a([].join),Q=a([].push),Z=a("".replace),K=a([].shift),ee=a([].splice),te=a("".split),ne=a("".slice),re=a(/./.exec),ie=/\+/g,ae=/^[0-9a-f]+$/i,oe=function(e,t){var n=ne(e,t,t+2);return re(ae,n)?X(n,16):NaN},se=function(e){for(var t=0,n=128;n>0&&0!==(e&n);n>>=1)t++;return t},ce=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ue=function(e){for(var t=(e=Z(e,ie," ")).length,n="",r=0;r<t;){var i=$(e,r);if("%"===i){if("%"===$(e,r+1)||r+3>t){n+="%",r++;continue}var a=oe(e,r+1);if(a!=a){n+=i,r++;continue}r+=2;var o=se(a);if(0===o)i=V(a);else{if(1===o||o>4){n+="�",r++;continue}for(var s=[a],c=1;c<o&&!(++r+3>t||"%"!==$(e,r));){var u=oe(e,r+1);if(u!=u){r+=3;break}if(u>191||u<128)break;Q(s,u),r+=2,c++}if(s.length!==o){n+="�";continue}var l=ce(s);null===l?n+="�":i=q(l)}}n+=i,r++}return n},le=/[!'()~]|%20/g,fe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return fe[e]},de=function(e){return Z(Y(e),le,he)},pe=h(function(e,t){L(this,{type:M,target:B(e).entries,index:0,kind:t})},P,function(){var e=U(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,k(void 0,!0);var r=t[n];switch(e.kind){case"keys":return k(r.key,!1);case"values":return k(r.value,!1)}return k([r.key,r.value],!1)},!0),ve=function(e){this.entries=[],this.url=null,void 0!==e&&(A(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===$(e,0)?ne(e,1):e:w(e)))};ve.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,a,o,s,c,u=this.entries,l=S(e);if(l)for(n=(t=E(e,l)).next;!(r=i(n,t)).done;){if(o=(a=E(b(r.value))).next,(s=i(o,a)).done||(c=i(o,a)).done||!i(o,a).done)throw new H("Expected sequence with length 2");Q(u,{key:w(s.value),value:w(c.value)})}else for(var f in e)m(e,f)&&Q(u,{key:f,value:w(e[f])})},parseQuery:function(e){if(e)for(var t,n,r=this.entries,i=te(e,"&"),a=0;a<i.length;)(t=i[a++]).length&&(n=te(t,"="),Q(r,{key:ue(K(n)),value:ue(J(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],Q(n,de(e.key)+"="+de(e.value));return J(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var me=function(){p(this,ge);var e=L(this,new ve(arguments.length>0?arguments[0]:void 0));o||(this.size=e.entries.length)},ge=me.prototype;if(l(ge,{append:function(e,t){var n=B(this);I(arguments.length,2),Q(n.entries,{key:w(e),value:w(t)}),o||this.length++,n.updateURL()},delete:function(e){for(var t=B(this),n=I(arguments.length,1),r=t.entries,i=w(e),a=n<2?void 0:arguments[1],s=void 0===a?a:w(a),c=0;c<r.length;){var u=r[c];if(u.key!==i||void 0!==s&&u.value!==s)c++;else if(ee(r,c,1),void 0!==s)break}o||(this.size=r.length),t.updateURL()},get:function(e){var t=B(this).entries;I(arguments.length,1);for(var n=w(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){var t=B(this).entries;I(arguments.length,1);for(var n=w(e),r=[],i=0;i<t.length;i++)t[i].key===n&&Q(r,t[i].value);return r},has:function(e){for(var t=B(this).entries,n=I(arguments.length,1),r=w(e),i=n<2?void 0:arguments[1],a=void 0===i?i:w(i),o=0;o<t.length;){var s=t[o++];if(s.key===r&&(void 0===a||s.value===a))return!0}return!1},set:function(e,t){var n=B(this);I(arguments.length,1);for(var r,i=n.entries,a=!1,s=w(e),c=w(t),u=0;u<i.length;u++)(r=i[u]).key===s&&(a?ee(i,u--,1):(a=!0,r.value=c));a||Q(i,{key:s,value:c}),o||(this.size=i.length),n.updateURL()},sort:function(){var e=B(this);O(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,n=B(this).entries,r=g(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),c(ge,R,ge.entries,{name:"entries"}),c(ge,"toString",function(){return B(this).serialize()},{enumerable:!0}),o&&u(ge,"size",{get:function(){return B(this).entries.length},configurable:!0,enumerable:!0}),f(me,P),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:me}),!s&&v(W)){var ye=a(G.has),be=a(G.set),Ae=function(e){if(A(e)){var t,n=e.body;if(y(n)===P)return t=e.headers?new W(e.headers):new W,ye(t,"content-type")||be(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),_(e,{body:x(0,w(n)),headers:x(0,t)})}return e};if(v(F)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?Ae(arguments[1]):{})}}),v(N)){var we=function(e){return p(this,z),new N(e,arguments.length>1?Ae(arguments[1]):{})};z.constructor=we,we.prototype=z,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:we})}}return Lp={URLSearchParams:me,getState:B}}function jp(){if(Up)return Tp;Up=1,yf();var e,t=Br(),n=D(),r=Op(),i=C(),a=Ti(),o=Re(),s=vn(),c=Mo(),u=Bo(),l=kt(),f=ru(),h=Rp(),d=Da(),p=gf().codeAt,v=Pp(),m=Yr(),g=ya(),y=Yu(),b=Np(),A=dn(),w=A.set,_=A.getterFor("URL"),x=b.URLSearchParams,E=b.getState,S=i.URL,k=i.TypeError,I=i.parseInt,T=Math.floor,O=Math.pow,R=o("".charAt),P=o(/./.exec),M=o([].join),L=o(1.1.toString),B=o([].pop),U=o([].push),F=o("".replace),N=o([].shift),j=o("".split),W=o("".slice),z=o("".toLowerCase),G=o([].unshift),H="Invalid scheme",Y="Invalid host",V="Invalid port",q=/[a-z]/i,X=/[\d+-.a-z]/i,$=/\d/,J=/^0x/i,Q=/^[0-7]+$/,Z=/^\d+$/,K=/^[\da-f]+$/i,ee=/[\0\t\n\r #%/:<>?@[\\\]^|]/,te=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,re=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)G(t,e%256),e=T(e/256);return M(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n?r:t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=L(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},oe={},se=f({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=f({},se,{"#":1,"?":1,"{":1,"}":1}),ue=f({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),le=function(e,t){var n=p(e,0);return n>32&&n<127&&!l(t,e)?e:encodeURIComponent(e)},fe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var n;return 2===e.length&&P(q,R(e,0))&&(":"===(n=R(e,1))||!t&&"|"===n)},de=function(e){var t;return e.length>1&&he(W(e,0,2))&&(2===e.length||"/"===(t=R(e,2))||"\\"===t||"?"===t||"#"===t)},pe=function(e){return"."===e||"%2e"===z(e)},ve=function(e){return".."===(e=z(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},me={},ge={},ye={},be={},Ae={},we={},_e={},xe={},Ee={},Se={},ke={},Ce={},Ie={},Te={},Oe={},Pe={},Me={},Le={},Be={},Ue={},Fe={},De=function(e,t,n){var r,i,a,o=m(e);if(t){if(i=this.parse(o))throw new k(i);this.searchParams=null}else{if(void 0!==n&&(r=new De(n,!0)),i=this.parse(o,null,r))throw new k(i);(a=E(new x)).bindURL(this),this.searchParams=a}};De.prototype={type:"URL",parse:function(t,n,r){var i,a,o,s,c=this,u=n||me,f=0,p="",v=!1,g=!1,y=!1;for(t=m(t),n||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,ne,""),t=F(t,re,"$1")),t=F(t,ie,""),i=h(t);f<=i.length;){switch(a=i[f],u){case me:if(!a||!P(q,a)){if(n)return H;u=ye;continue}p+=z(a),u=ge;break;case ge:if(a&&(P(X,a)||"+"===a||"-"===a||"."===a))p+=z(a);else{if(":"!==a){if(n)return H;p="",u=ye,f=0;continue}if(n&&(c.isSpecial()!==l(fe,p)||"file"===p&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=p,n)return void(c.isSpecial()&&fe[c.scheme]===c.port&&(c.port=null));p="","file"===c.scheme?u=Te:c.isSpecial()&&r&&r.scheme===c.scheme?u=be:c.isSpecial()?u=xe:"/"===i[f+1]?(u=Ae,f++):(c.cannotBeABaseURL=!0,U(c.path,""),u=Be)}break;case ye:if(!r||r.cannotBeABaseURL&&"#"!==a)return H;if(r.cannotBeABaseURL&&"#"===a){c.scheme=r.scheme,c.path=d(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Fe;break}u="file"===r.scheme?Te:we;continue;case be:if("/"!==a||"/"!==i[f+1]){u=we;continue}u=Ee,f++;break;case Ae:if("/"===a){u=Se;break}u=Le;continue;case we:if(c.scheme=r.scheme,a===e)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=d(r.path),c.query=r.query;else if("/"===a||"\\"===a&&c.isSpecial())u=_e;else if("?"===a)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=d(r.path),c.query="",u=Ue;else{if("#"!==a){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=d(r.path),c.path.length--,u=Le;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=d(r.path),c.query=r.query,c.fragment="",u=Fe}break;case _e:if(!c.isSpecial()||"/"!==a&&"\\"!==a){if("/"!==a){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Le;continue}u=Se}else u=Ee;break;case xe:if(u=Ee,"/"!==a||"/"!==R(p,f+1))continue;f++;break;case Ee:if("/"!==a&&"\\"!==a){u=Se;continue}break;case Se:if("@"===a){v&&(p="%40"+p),v=!0,o=h(p);for(var b=0;b<o.length;b++){var A=o[b];if(":"!==A||y){var w=le(A,ue);y?c.password+=w:c.username+=w}else y=!0}p=""}else if(a===e||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(v&&""===p)return"Invalid authority";f-=h(p).length+1,p="",u=ke}else p+=a;break;case ke:case Ce:if(n&&"file"===c.scheme){u=Pe;continue}if(":"!==a||g){if(a===e||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(c.isSpecial()&&""===p)return Y;if(n&&""===p&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(p))return s;if(p="",u=Me,n)return;continue}"["===a?g=!0:"]"===a&&(g=!1),p+=a}else{if(""===p)return Y;if(s=c.parseHost(p))return s;if(p="",u=Ie,n===Ce)return}break;case Ie:if(!P($,a)){if(a===e||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()||n){if(""!==p){var _=I(p,10);if(_>65535)return V;c.port=c.isSpecial()&&_===fe[c.scheme]?null:_,p=""}if(n)return;u=Me;continue}return V}p+=a;break;case Te:if(c.scheme="file","/"===a||"\\"===a)u=Oe;else{if(!r||"file"!==r.scheme){u=Le;continue}switch(a){case e:c.host=r.host,c.path=d(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=d(r.path),c.query="",u=Ue;break;case"#":c.host=r.host,c.path=d(r.path),c.query=r.query,c.fragment="",u=Fe;break;default:de(M(d(i,f),""))||(c.host=r.host,c.path=d(r.path),c.shortenPath()),u=Le;continue}}break;case Oe:if("/"===a||"\\"===a){u=Pe;break}r&&"file"===r.scheme&&!de(M(d(i,f),""))&&(he(r.path[0],!0)?U(c.path,r.path[0]):c.host=r.host),u=Le;continue;case Pe:if(a===e||"/"===a||"\\"===a||"?"===a||"#"===a){if(!n&&he(p))u=Le;else if(""===p){if(c.host="",n)return;u=Me}else{if(s=c.parseHost(p))return s;if("localhost"===c.host&&(c.host=""),n)return;p="",u=Me}continue}p+=a;break;case Me:if(c.isSpecial()){if(u=Le,"/"!==a&&"\\"!==a)continue}else if(n||"?"!==a)if(n||"#"!==a){if(a!==e&&(u=Le,"/"!==a))continue}else c.fragment="",u=Fe;else c.query="",u=Ue;break;case Le:if(a===e||"/"===a||"\\"===a&&c.isSpecial()||!n&&("?"===a||"#"===a)){if(ve(p)?(c.shortenPath(),"/"===a||"\\"===a&&c.isSpecial()||U(c.path,"")):pe(p)?"/"===a||"\\"===a&&c.isSpecial()||U(c.path,""):("file"===c.scheme&&!c.path.length&&he(p)&&(c.host&&(c.host=""),p=R(p,0)+":"),U(c.path,p)),p="","file"===c.scheme&&(a===e||"?"===a||"#"===a))for(;c.path.length>1&&""===c.path[0];)N(c.path);"?"===a?(c.query="",u=Ue):"#"===a&&(c.fragment="",u=Fe)}else p+=le(a,ce);break;case Be:"?"===a?(c.query="",u=Ue):"#"===a?(c.fragment="",u=Fe):a!==e&&(c.path[0]+=le(a,oe));break;case Ue:n||"#"!==a?a!==e&&("'"===a&&c.isSpecial()?c.query+="%27":c.query+="#"===a?"%23":le(a,oe)):(c.fragment="",u=Fe);break;case Fe:a!==e&&(c.fragment+=le(a,se))}f++}},parseHost:function(e){var t,n,r;if("["===R(e,0)){if("]"!==R(e,e.length-1))return Y;if(t=function(e){var t,n,r,i,a,o,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return R(e,f)};if(":"===h()){if(":"!==R(e,1))return;f+=2,l=++u}for(;h();){if(8===u)return;if(":"!==h()){for(t=n=0;n<4&&P(K,h());)t=16*t+I(h(),16),f++,n++;if("."===h()){if(0===n)return;if(f-=n,u>6)return;for(r=0;h();){if(i=null,r>0){if(!("."===h()&&r<4))return;f++}if(!P($,h()))return;for(;P($,h());){if(a=I(h(),10),null===i)i=a;else{if(0===i)return;i=10*i+a}if(i>255)return;f++}c[u]=256*c[u]+i,2!==++r&&4!==r||u++}if(4!==r)return;break}if(":"===h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(o=u-l,u=7;0!==u&&o>0;)s=c[u],c[u--]=c[l+o-1],c[l+--o]=s;else if(8!==u)return;return c}(W(e,1,-1)),!t)return Y;this.host=t}else if(this.isSpecial()){if(e=v(e),P(ee,e))return Y;if(t=function(e){var t,n,r,i,a,o,s,c=j(e,".");if(c.length&&""===c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],r=0;r<t;r++){if(""===(i=c[r]))return e;if(a=10,i.length>1&&"0"===R(i,0)&&(a=P(J,i)?16:8,i=W(i,8===a?1:2)),""===i)o=0;else{if(!P(10===a?Z:8===a?Q:K,i))return e;o=I(i,a)}U(n,o)}for(r=0;r<t;r++)if(o=n[r],r===t-1){if(o>=O(256,5-t))return null}else if(o>255)return null;for(s=B(n),r=0;r<n.length;r++)s+=n[r]*O(256,3-r);return s}(e),null===t)return Y;this.host=t}else{if(P(te,e))return Y;for(t="",n=h(e),r=0;r<n.length;r++)t+=le(n[r],oe);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return l(fe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=n+(r?":"+r:"")+"@"),u+=ae(i),null!==a&&(u+=":"+a)):"file"===t&&(u+="//"),u+=e.cannotBeABaseURL?o[0]:o.length?"/"+M(o,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw new k(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Ne(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(m(e)+":",me)},getUsername:function(){return this.username},setUsername:function(e){var t=h(m(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=le(t[n],ue)}},getPassword:function(){return this.password},setPassword:function(e){var t=h(m(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=le(t[n],ue)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,ke)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ce)},getPort:function(){var e=this.port;return null===e?"":m(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=m(e))?this.port=null:this.parse(e,Ie))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Me))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=m(e))?this.query=null:("?"===R(e,0)&&(e=W(e,1)),this.query="",this.parse(e,Ue)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=m(e))?("#"===R(e,0)&&(e=W(e,1)),this.fragment="",this.parse(e,Fe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ne=function(e){var t=u(this,je),r=y(arguments.length,1)>1?arguments[1]:void 0,i=w(t,new De(e,!1,r));n||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},je=Ne.prototype,We=function(e,t){return{get:function(){return _(this)[e]()},set:t&&function(e){return _(this)[t](e)},configurable:!0,enumerable:!0}};if(n&&(c(je,"href",We("serialize","setHref")),c(je,"origin",We("getOrigin")),c(je,"protocol",We("getProtocol","setProtocol")),c(je,"username",We("getUsername","setUsername")),c(je,"password",We("getPassword","setPassword")),c(je,"host",We("getHost","setHost")),c(je,"hostname",We("getHostname","setHostname")),c(je,"port",We("getPort","setPort")),c(je,"pathname",We("getPathname","setPathname")),c(je,"search",We("getSearch","setSearch")),c(je,"searchParams",We("getSearchParams")),c(je,"hash",We("getHash","setHash"))),s(je,"toJSON",function(){return _(this).serialize()},{enumerable:!0}),s(je,"toString",function(){return _(this).serialize()},{enumerable:!0}),S){var ze=S.createObjectURL,Ge=S.revokeObjectURL;ze&&s(Ne,"createObjectURL",a(ze,S)),Ge&&s(Ne,"revokeObjectURL",a(Ge,S))}return g(Ne,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!n},{URL:Ne}),Tp}Fp||(Fp=1,jp());var Wp,zp={};!function(){if(Wp)return zp;Wp=1;var e=Br(),t=j();e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return t(URL.prototype.toString,this)}})}();var Gp;Gp||(Gp=1,Np());var Hp,Yp={};!function(){if(Hp)return Yp;Hp=1;var e=vn(),t=Re(),n=Yr(),r=Yu(),i=URLSearchParams,a=i.prototype,o=t(a.append),s=t(a.delete),c=t(a.forEach),u=t([].push),l=new i("a=1&a=2&b=3");l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(a,"delete",function(e){var t=arguments.length,i=t<2?void 0:arguments[1];if(t&&void 0===i)return s(this,e);var a=[];c(this,function(e,t){u(a,{key:t,value:e})}),r(t,1);for(var l,f=n(e),h=n(i),d=0,p=0,v=!1,m=a.length;d<m;)l=a[d++],v||l.key===f?(v=!0,s(this,l.key)):p++;for(;p<m;)(l=a[p++]).key===f&&l.value===h||o(this,l.key,l.value)},{enumerable:!0,unsafe:!0})}();var Vp,qp={};!function(){if(Vp)return qp;Vp=1;var e=vn(),t=Re(),n=Yr(),r=Yu(),i=URLSearchParams,a=i.prototype,o=t(a.getAll),s=t(a.has),c=new i("a=1");!c.has("a",2)&&c.has("a",void 0)||e(a,"has",function(e){var t=arguments.length,i=t<2?void 0:arguments[1];if(t&&void 0===i)return s(this,e);var a=o(this,e);r(t,1);for(var c=n(i),u=0;u<a.length;)if(a[u++]===c)return!0;return!1},{enumerable:!0,unsafe:!0})}();var Xp,$p={};!function(){if(Xp)return $p;Xp=1;var e=D(),t=Re(),n=Mo(),r=URLSearchParams.prototype,i=t(r.forEach);e&&!("size"in r)&&n(r,"size",{get:function(){var e=0;return i(this,function(){e++}),e},configurable:!0,enumerable:!0})}();var Jp="4.62.3",Qp={enabled:!1,enabled_on_views:[],debug:!1,wait_for_browser_mod_time:.25,log_level_console:"info",log_level_system:"warning",system_target_log_level:"",alert_errors:!0,hide_toolbar:!1,keep_toolbar_space:!1,hide_toolbar_action_icons:!1,hide_toolbar_on_subviews:!1,hide_sidebar:!1,close_more_info_dialog_time:0,fullscreen:!1,keep_fullscreen:!0,z_index:1e3,idle_time:15,fade_in_time:3,fade_out_time_motion_detected:1,fade_out_time_screensaver_entity:3,fade_out_time_browser_mod_popup:1,fade_out_time_interaction:.3,crossfade_time:3,display_time:15,keep_screen_on_time:0,black_screen_after_time:0,control_reactivation_time:1,disable_context_menu:!1,screensaver_start_navigation_path:"",screensaver_stop_close_browser_mod_popup:!1,screensaver_entity:"",stop_screensaver_on_mouse_move:!0,stop_screensaver_on_mouse_click:!0,stop_screensaver_on_key_down:!0,stop_screensaver_on_location_change:!0,disable_screensaver_on_browser_mod_popup:!1,disable_screensaver_on_browser_mod_popup_func:"",disable_screensaver_when_assist_active:!0,show_images:!0,image_url:"https://picsum.photos/${width}/${height}?random=${timestamp}",image_url_entity:"",force_load_media_with_fetch:!1,stream_load_media:!1,media_entity_load_unchanged:!0,iframe_load_unchanged:!1,iframe_interaction:!1,immich_api_keys:[],immich_album_names:[],immich_shared_albums:!0,immich_tag_names:[],immich_exclude_tag_names:[],immich_persons:[],immich_memories:!1,immich_favorites:!1,immich_resolution:"preview",image_fit_landscape:"cover",image_fit_portrait:"contain",calculate_media_size:!0,media_horizontal_align:"center",media_vertical_align:"middle",media_list_update_interval:3600,media_list_max_size:500,media_order:"random",exclude_filenames:[],exclude_media_types:[],exclude_media_orientation:"",image_background:"color",video_loop:!1,video_volume:0,touch_zone_size_next_image:15,touch_zone_size_previous_image:15,show_progress_bar:!1,show_image_info:!1,fetch_address_data:!1,image_info_template:"${DateTimeOriginal}",info_animation_duration_x:0,info_animation_duration_y:0,info_animation_timing_function_x:"ease",info_animation_timing_function_y:"ease",info_move_pattern:"random",info_move_interval:0,info_move_fade_duration:2,image_animation_ken_burns:!1,image_animation_ken_burns_zoom:1.3,image_animation_ken_burns_delay:0,image_animation_ken_burns_duration:0,image_animation_ken_burns_animations:["simple"],camera_motion_detection_enabled:!1,camera_motion_detection_stop_screensaver:!0,camera_motion_detection_set_entity:"",camera_motion_detection_facing_mode:"user",camera_motion_detection_threshold:5,camera_motion_detection_capture_width:64,camera_motion_detection_capture_height:48,camera_motion_detection_capture_interval:.3,camera_motion_detection_capture_visible:!1,camera_motion_detection_motion_stop_delay:2,theme:"",custom_css:"",style:{},badges:[],cards:[],views:[],content_interaction:!1,profile:"",profile_entity:"",profiles:{}},Zp={image_excludes:"exclude_filenames",image_fit:"image_fit_landscape",image_order:"media_order",enabled_on_tabs:"enabled_on_views",image_list_update_interval:"media_list_update_interval",screensaver_stop_navigation_path:"screensaver_start_navigation_path",card_interaction:"content_interaction",immich_api_key:"immich_api_keys",caclulate_media_size:"calculate_media_size"},Kp={},ev={},tv=null,nv=null,rv=null,iv=null,av=null,ov=!1,sv={"wallpanel-screensaver-image-background":{filter:"blur(15px)",background:"#00000000","background-position":"center","background-size":"cover"},"wallpanel-screensaver-image-info-container":{},"wallpanel-screensaver-image-info":{position:"absolute",bottom:"0.5em",right:"0.5em","max-width":"calc(100% - 2em)","max-height":"calc(100% - 5em)",padding:"0.1em 0.5em 0.1em 0.5em","font-size":"2em",background:"#00000055","backdrop-filter":"blur(2px)","border-radius":"0.5rem"},"wallpanel-progress":{position:"absolute",bottom:"0",height:"2px",width:"100%"},"wallpanel-progress-inner":{height:"100%","background-color":"white"},"wallpanel-message":{width:"30em","max-width":"100%","box-sizing":"border-box",padding:"1em","border-radius":"0.5rem",border:"1px solid black","box-shadow":"0 4px 12px rgba(0, 0, 0, 0.3)","font-size":"1.5em",color:"white",cursor:"pointer",opacity:"0",transform:"translateX(100%)",transition:"all 0.4s ease"},"wallpanel-message.show":{opacity:1,transform:"translateX(0)"},"wallpanel-message.error":{"background-color":"#f8d7da",color:"#721c24","border-color":"#721c24"},"wallpanel-message.warning":{"background-color":"#fff3cd",color:"#856404","border-color":"#856404"},"wallpanel-message.info":{"background-color":"#d1ecf1",color:"#0c5460","border-color":"#0c5460"},"wallpanel-message.success":{"background-color":"#d4edda",color:"#155724","border-color":"#155724"},"wallpanel-message-title":{"font-weight":"bold","margin-bottom":"0.25rem"}},cv=new Map;function uv(e,t){var n=Number(ev.media_list_max_size);if(Number.isFinite(n)&&!(n<=0)){for(;cv.size>=n;){var r=cv.keys().next().value;cv.delete(r)}cv.set(e,t)}}var lv={},fv=null,hv=null,dv=null,pv=null,vv=null,mv=null,gv=null;function yv(e){return e&&"object"===w(e)&&!Array.isArray(e)}function bv(e){var t=[];return JSON.stringify(e,function(e,n){if("object"===w(n)&&null!==n){if(-1!==t.indexOf(n))return;t.push(n)}return n})}var Av={messages:[],logLevelConsole:"warning",logLevelSystem:"error",systemTargetLogLevel:"",addMessage:function(e,t){if(ev.debug){var n={level:e,date:(new Date).toISOString(),text:"",objs:[],stack:""},r=new Error;r.stack&&(n.stack=r.stack.toString().replace(/^Error\r?\n/,""));for(var i=0;i<t.length;i++)0==i&&("string"==typeof t[0]||t[0]instanceof String)?n.text=t[i]:n.objs.push(t[i]);Av.messages.push(n),Av.messages.length>1e3&&Av.messages.shift()}},systemLog:function(e,t){hv&&hv.hass&&hv.hass.callService("system_log","write",{logger:"frontend.wallpanel".concat(pv?"."+pv:""),message:t,level:Av.systemTargetLogLevel||e},void 0,!1).catch(function(){})},downloadMessages:function(){var e=new Blob([bv(Av.messages)],{type:"text/plain"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.target="_blank",n.download="wallpanel_log.txt",document.body.appendChild(n),n.click(),n.remove(),setTimeout(function(){return URL.revokeObjectURL(t)},0)},purgeMessages:function(){Av.messages=[]},debug:function(){["debug"].includes(Av.logLevelConsole)&&console.debug.apply(this,arguments),["debug"].includes(Av.logLevelSystem)&&Av.systemLog("debug",bv(arguments)),Av.addMessage("debug",arguments)},info:function(){["debug","info"].includes(Av.logLevelConsole)&&console.info.apply(this,arguments),["debug","info"].includes(Av.logLevelSystem)&&Av.systemLog("info",bv(arguments)),Av.addMessage("info",arguments)},log:function(){Av.info.apply(this,arguments)},warning:function(){["debug","info","warning"].includes(Av.logLevelConsole)&&console.warn.apply(this,arguments),["debug","info","warning"].includes(Av.logLevelSystem)&&Av.systemLog("warning",bv(arguments)),Av.addMessage("warning",arguments)},warn:function(){Av.warning.apply(this,arguments)},error:function(){if(["debug","info","warning","error"].includes(Av.logLevelConsole)&&console.error.apply(this,arguments),["debug","info","warning","error"].includes(Av.logLevelSystem)&&Av.systemLog("error",bv(arguments)),Av.addMessage("error",arguments),ev.alert_errors){var e="Wallpanel error: ".concat(bv(arguments));av?av.showMessage("error","Error",e,1e4):alert(e)}},err:function(){Av.error.apply(this,arguments)}},wv=function(){return o(function e(){var t=this;i(this,e),this.enabled=!1,this.error=null,this.nativeWakeLockSupported="wakeLock"in navigator,this._lock=null,this._player=null,this._isPlaying=!1,this._onWakeLockRelease=null;var n=function(){Av.debug("handleVisibilityChange"),t.enabled&&!document.hidden&&t.enable()};if(document.addEventListener("visibilitychange",n),document.addEventListener("fullscreenchange",n),!this.nativeWakeLockSupported){this._player=document.createElement("video"),this._player.setAttribute("id","ScreenWakeLockVideo"),this._player.setAttribute("src","data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAA1NtZGF0AAACrwYF//+r3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzA5NSBiYWVlNDAwIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMiAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOi0zOi0zIGFuYWx5c2U9MHgzOjB4MTEzIG1lPWhleCBzdWJtZT03IHBzeT0xIHBzeV9yZD0yLjAwOjAuNzAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0xIDh4OGRjdD0xIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS00IHRocmVhZHM9MSBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MiBrZXlpbnQ9MjUwIGtleWludF9taW49MSBzY2VuZWN1dD00MCBpbnRyYV9yZWZyZXNoPTAgcmNfbG9va2FoZWFkPTQwIHJjPWNyZiBtYnRyZWU9MSBjcmY9MjMuMCBxY29tcD0wLjYwIHFwbWluPTAgcXBtYXg9NjkgcXBzdGVwPTQgaXBfcmF0aW89MS40MCBhcT0xOjEuMjAAgAAAABFliIQAF85//vfUt8yy7VNwgQAAAAlBmiRsQXzn/vAAAAAJQZ5CeIL5z4aBAAAACQGeYXRBfOeGgAAAAAkBnmNqQXznhoEAAAAPQZpoSahBaJlMCC+c//7xAAAAC0GehkURLBfOf4aBAAAACQGepXRBfOeGgQAAAAkBnqdqQXznhoAAAAAPQZqpSahBbJlMCC+c//7wAAADs21vb3YAAABsbXZoZAAAAAAAAAAAAAAAAAAAA+gAACcQAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAALddHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAACcQAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAnEAAAgAAAAQAAAAACVW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAQAAAAoAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAgBtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAHAc3RibAAAAMBzdHNkAAAAAAAAAAEAAACwYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAARVMYXZjNTkuMzcuMTAwIGxpYngyNjQAAAAAAAAAAAAAABj//wAAADZhdmNDAWQACv/hABlnZAAKrNlfllwEQAAAAwBAAAADAIPEiWWAAQAGaOvjxMhM/fj4AAAAABBwYXNwAAAAAQAAAAEAAAAUYnRydAAAAAAAAAKiAAACogAAABhzdHRzAAAAAAAAAAEAAAAKAABAAAAAABRzdHNzAAAAAAAAAAEAAAABAAAAYGN0dHMAAAAAAAAACgAAAAEAAIAAAAAAAQABQAAAAAABAACAAAAAAAEAAAAAAAAAAQAAQAAAAAABAAFAAAAAAAEAAIAAAAAAAQAAAAAAAAABAABAAAAAAAEAAIAAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAAKAAAAAQAAADxzdHN6AAAAAAAAAAAAAAAKAAACyAAAAA0AAAANAAAADQAAAA0AAAATAAAADwAAAA0AAAANAAAAEwAAABRzdGNvAAAAAAAAAAEAAAAwAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1OS4yNy4xMDA="),this._player.setAttribute("playsinline",""),this._player.setAttribute("muted",""),this._player.style.display="none",document.getElementById("ScreenWakeLockVideo")||document.body.appendChild(this._player),this._player.addEventListener("ended",function(){Av.debug("Video ended"),t.enabled&&t.enable()}),this._player.addEventListener("playing",function(){Av.debug("Video playing"),t._isPlaying=!0}),this._player.addEventListener("pause",function(){Av.debug("Video pause"),t._isPlaying=!1})}},[{key:"enable",value:function(){var e=this;if(this.nativeWakeLockSupported){if(Av.debug("Requesting native screen wakelock"),this._lock)return void Av.debug("Screen wakelock already active");navigator.wakeLock.request("screen").then(function(t){Av.debug("Request screen wakelock successful"),e._lock=t,e._onWakeLockRelease=function(){Av.debug("Screen wakelock released"),e.enabled=!1,e._lock=null},t.addEventListener("release",e._onWakeLockRelease),e.enabled=!0,e.error=null}).catch(function(t){e.enabled=!1,e.error=t,Av.warning("Failed to request screen wakeLock: ".concat(t))})}else{Av.debug("Starting video player"),!this._player.paused&&this._isPlaying&&this._player.pause();var t=this._player.play();t&&t.then(function(){e.enabled=!0,e.error=null,Av.debug("Video play successful")}).catch(function(t){e.enabled=!1,e.error=t,Av.warning("Failed to play video: ".concat(t))})}}},{key:"disable",value:function(){this.nativeWakeLockSupported?(Av.debug("Releasing native screen wakelock"),this._lock&&(this._onWakeLockRelease&&(this._lock.removeEventListener("release",this._onWakeLockRelease),this._onWakeLockRelease=null),this._lock.release()),this._lock=null):(Av.debug("Stopping video player"),!this._player.paused&&this._isPlaying&&this._player.pause()),this.enabled=!1}}])}(),_v=function(){return o(function e(){i(this,e),this.enabled=!1,this.error=!1,this.width=64,this.height=48,this.threshold=this.width*this.height*.05,this.captureInterval=300,this.motionActive=!1,this.motionStopDelay=2e3,this.motionStopTimeout=null,this.captureTimer=null,this.videoElement=document.createElement("video"),this.videoElement.setAttribute("id","wallpanelMotionDetectionVideo"),this.videoElement.style.display="none",document.body.appendChild(this.videoElement),this.canvasElement=document.createElement("canvas"),this.canvasElement.setAttribute("id","wallpanelMotionDetectionCanvas"),this.canvasElement.style.display="none",document.body.appendChild(this.canvasElement),this.context=this.canvasElement.getContext("2d",{willReadFrequently:!0}),this._elementsAppended=!0},[{key:"capture",value:function(){var e=this,t=0;this.context.globalCompositeOperation="difference",this.context.drawImage(this.videoElement,0,0,this.width,this.height);for(var n=this.context.getImageData(0,0,this.width,this.height).data,r=0;r<n.length;r+=4){if(n[r]+n[r+1]+n[r+2]>=256&&++t>=this.threshold)break}t>=this.threshold?(this.motionActive||(Av.debug("Motion started"),this.motionActive=!0,av.motionDetected()),this.motionStopTimeout&&(clearTimeout(this.motionStopTimeout),this.motionStopTimeout=null)):this.motionActive&&!this.motionStopTimeout&&(this.motionStopTimeout=setTimeout(function(){Av.debug("Motion stopped"),e.motionActive=!1,e.motionStopTimeout=null,av.motionStopped()},this.motionStopDelay)),this.context.globalCompositeOperation="source-over",this.context.drawImage(this.videoElement,0,0,this.width,this.height)}},{key:"start",value:function(){var e=this;if(!this.enabled&&!this.error){if(!navigator.mediaDevices)return this.error=!0,void Av.error("No media devices found");this._elementsAppended||(document.body.appendChild(this.videoElement),document.body.appendChild(this.canvasElement),this._elementsAppended=!0),this.enabled=!0,this.width=ev.camera_motion_detection_capture_width,this.height=ev.camera_motion_detection_capture_height,this.threshold=this.width*this.height*ev.camera_motion_detection_threshold*.01,this.captureInterval=1e3*ev.camera_motion_detection_capture_interval,this.motionStopDelay=1e3*ev.camera_motion_detection_motion_stop_delay,this.videoElement.width=this.width,this.videoElement.height=this.height,this.canvasElement.width=this.width,this.canvasElement.height=this.height,ev.camera_motion_detection_capture_visible?(this.canvasElement.style.position="fixed",this.canvasElement.style.top=0,this.canvasElement.style.left=0,this.canvasElement.style.zIndex=1e4,this.canvasElement.style.border="1px solid black",this.canvasElement.style.display="block"):this.canvasElement.style.display="none",navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:ev.camera_motion_detection_facing_mode},width:this.width,height:this.height}}).then(function(t){e.videoElement.srcObject=t;var n=e.videoElement.play();n&&n.catch(function(e){Av.warning("Camera motion detection video play failed: ".concat(e))}),e.enabled&&(e.captureTimer=setInterval(e.capture.bind(e),e.captureInterval))}).catch(function(t){e.enabled=!1,Av.error("Camera motion detection error:",t),e._elementsAppended&&(e.videoElement.remove(),e.canvasElement.remove(),e._elementsAppended=!1)})}}},{key:"stop",value:function(){if(this.enabled){this.enabled=!1,this.captureTimer&&(clearInterval(this.captureTimer),this.captureTimer=null),this.videoElement.pause();var e=this.videoElement.srcObject;e&&"function"==typeof e.getTracks&&e.getTracks().forEach(function(e){e.stop()}),this.videoElement.srcObject=null,this._elementsAppended&&(this.videoElement.remove(),this.canvasElement.remove(),this._elementsAppended=!1)}}}])}();function xv(e){for(var t=e.slice(),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=[t[r],t[n]];t[n]=i[0],t[r]=i[1]}return t}function Ev(e){if(!e.shadowRoot)return[null,null];var t=e.shadowRoot.querySelector("ha-web-rtc-player")||e.shadowRoot.querySelector("ha-hls-player");if(!t||!t.shadowRoot)return[t,null];var n=t.shadowRoot.querySelector("video");return[t,n]}function Sv(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!n.length)return e;var i=n.shift();if(yv(e)&&yv(i)){var a=function(t){var n=i[t];if(Zp[t]&&(Av.warn("The configuration option '".concat(t,"' has been renamed to '").concat(Zp[t],"'. Please update your wallpanel configuration accordingly.")),t=Zp[t]),"immich_api_keys"!=t||Array.isArray(n)||(n=[n]),yv(n))e[t]||Object.assign(e,c({},t,{})),Sv(e[t],n);else{function r(e,t){if(!(t in lv)){lv[t]="";var n=(hv.hass||hv.__hass).states[t];n?lv[t]=n.state:Av.error("Entity used in placeholder not found: ".concat(t," (").concat(e,")"))}var r=lv[t];return Av.debug("Replace ".concat(e," with ").concat(r)),r}function a(n){return("string"==typeof n||n instanceof String)&&(n=(n=n.replace(/\$\{browser_id\}/g,pv||"browser-id-unset")).replace(/\$\{entity:\s*([^}]+\.[^}]+)\}/g,r)),"boolean"==typeof e[t]&&(n=null!=n&&["true","on","yes","1"].includes(String(n).toLowerCase())),n}n=Array.isArray(n)?n.map(function(e){return a(e)}):a(n),Array.isArray(e[t])&&"string"==typeof n&&(n=n.split(",").map(function(e){return e.trim()})),Object.assign(e,c({},t,n))}};for(var o in i)a(o)}return Sv.apply(void 0,[e].concat(n))}function kv(){var e=new URLSearchParams(window.location.search),t=ev;Sv(ev={},Qp),0===Object.keys(Kp).length&&(Kp=Pv(),0===Object.keys(Kp).length&&Av.debug("No wallpanel config found in dashboard config")),Sv(ev,Kp);var n,r={},i=s(e);try{for(i.s();!(n=i.n()).done;){var a=y(n.value,2),o=a[0],c=a[1];if(o.startsWith("wp_")&&(o=o.substring(3),Zp[o]&&(Av.warn("The configuration option '".concat(o,"' has been renamed to '").concat(Zp[o],"'. Please update your wallpanel configuration accordingly.")),o=Zp[o]),o in Qp&&c)){try{c=JSON.parse(c)}catch(e){}var u=Qp[o];if(Array.isArray(u))Array.isArray(c)?r[o]=c:r[o]="string"==typeof c?c.split(",").map(function(e){return e.trim()}):[c];else if("boolean"==typeof u)r[o]=["true","on","yes","1"].includes(String(c));else if("number"==typeof u){var l=Number(c);Number.isFinite(l)?r[o]=l:Av.warn("Invalid numeric wp_ param '".concat(o,"': ").concat(c))}else r[o]=c}}}catch(e){i.e(e)}finally{i.f()}var f=(ev=Sv(ev,r)).profile;if(ev.profiles&&f&&ev.profiles[f]&&(ev=Sv(ev,ev.profiles[f]),Av.debug("Profile set from config: ".concat(f))),ev.profiles&&pv&&ev.profiles["device.".concat(pv)]){var h="device.".concat(pv);ev=Sv(ev,ev.profiles[h]),Av.debug("Profile set from device: ".concat(h))}if(ev.profiles)for(var d=[vv,mv,gv],p=0;p<d.length;p++){var v=d[p];if(v&&(v=v.toLowerCase().replace(/\s/g,"_"),ev.profiles["user.".concat(v)])){var m="user.".concat(v);ev=Sv(ev,ev.profiles[m]),Av.debug("Profile set from user: ".concat(m));break}}var g=(ev=Sv(ev,r)).profile_entity;if(ev.profiles&&g&&(hv.hass||hv.__hass).states[g]&&ev.profiles[(hv.hass||hv.__hass).states[g].state]){var b=(hv.hass||hv.__hass).states[g].state;ev=Sv(ev,ev.profiles[b]),Av.debug("Profile set from entity state: ".concat(b))}ev.content_interaction&&(ev.stop_screensaver_on_mouse_move=!1),ev.image_url?(ev.image_url=ev.image_url.replace(/^media-entity:\/\//,"media-entity-image://"),ev.image_url.startsWith("/")&&(ev.image_url="media-source://media_source".concat(ev.image_url)),"media-source"==Ov()&&(ev.image_url=ev.image_url.replace(/\/+$/,"")),"unsplash-api"==Ov()&&ev.media_list_update_interval<90&&(ev.media_list_update_interval=90)):ev.show_images=!1,ev.enabled||(ev.debug=!1,ev.hide_toolbar=!1,ev.hide_sidebar=!1,ev.hide_toolbar_action_icons=!1,ev.fullscreen=!1,ev.show_images=!1),"err"==ev.log_level_console?ev.log_level_console="error":"warn"==ev.log_level_console&&(ev.log_level_console="warning"),t&&Object.keys(t).length||(Av.logLevelConsole=ev.log_level_console,Av.logLevelConsole),"err"==ev.log_level_system?ev.log_level_system="error":"warn"==ev.log_level_system&&(ev.log_level_system="warning"),Av.logLevelSystem=ev.log_level_system,Av.systemTargetLogLevel=ev.system_target_log_level,Av.debug("Wallpanel config is now:",ev),av&&(Tv()?av.reconfigure(t):av.screensaverRunning&&av.screensaverRunning()&&av.stopScreensaver())}function Cv(){var e=[];return pv&&hv&&hv.shadowRoot?(hv.shadowRoot.querySelectorAll("*").forEach(function(t){t.tagName.toLowerCase().startsWith("browser-mod-popup")&&t.shadowRoot&&t.shadowRoot.querySelector("ha-dialog")&&e.push(t)}),e):e}function Iv(){var e=Cv();return e&&0!=e.length?e[0]:null}function Tv(){if("1"==new URLSearchParams(window.location.search).get("edit"))return Av.debug("Edit mode active"),!1;if(!ev.enabled)return Av.debug("Wallpanel not enabled in config"),!1;if(ev.enabled_on_views&&ev.enabled_on_views.length>0&&rv&&!ev.enabled_on_views.includes(rv))return Av.debug("Wallpanel not enabled on current tab ".concat(rv)),!1;if(ev.disable_screensaver_when_assist_active){var e=hv.shadowRoot.querySelector("ha-voice-command-dialog");if(e&&e.shadowRoot&&e.shadowRoot.querySelector("ha-dialog"))return Av.debug("Assist is active, wallpanel disabled"),!1}return av&&av.disable_screensaver_on_browser_mod_popup_function&&Iv()&&av.disable_screensaver_on_browser_mod_popup_function(Iv())?(Av.debug("Browser mod popup function returned true, wallpanel disabled"),!1):!ev.disable_screensaver_on_browser_mod_popup||!Iv()||(Av.debug("Browser mod popup active, wallpanel disabled"),!1)}function Ov(){return ev.show_images&&ev.image_url?ev.image_url.startsWith("media-entity-video://")?"media-entity-video":ev.image_url.startsWith("media-entity-image://")?"media-entity-image":ev.image_url.startsWith("media-source://")?"media-source":ev.image_url.startsWith("https://api.unsplash")?"unsplash-api":ev.image_url.startsWith("immich+")?"immich-api":ev.image_url.startsWith("iframe+")?"iframe":ev.image_url.startsWith("embed+")?"embed":"url":""}function Rv(){try{return dv.shadowRoot.querySelector("ha-panel-lovelace")}catch(e){Av.error("Failed to get ha-panel-lovelace:",e)}}function Pv(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=Rv(),r={};n&&n.lovelace&&(n.lovelace.config&&n.lovelace.config.wallpanel?e=n.lovelace.config.wallpanel:n.lovelace.rawConfig&&n.lovelace.rawConfig.wallpanel&&(e=n.lovelace.rawConfig.wallpanel),e&&(0===t.length&&(t=Object.keys(e)),t.forEach(function(t){(t in Qp||t in Zp)&&(r[t]=e[t])})));return r}function Mv(e){Av.debug("setSidebarVisibility: hidden=".concat(e));try{var t=dv.shadowRoot.querySelector("ha-panel-lovelace");if(t){var n=t.shadowRoot.querySelector("hui-root");if(n){var r=n.shadowRoot.querySelector("ha-menu-button");r&&(e?r.style.display="none":r.style.removeProperty("display"))}}}catch(e){Av.warn(e)}try{var i=dv.shadowRoot.querySelector("ha-drawer");if(i){var a=i.shadowRoot.querySelector("aside");a&&(e?(a.style.opacity=0,a.style.maxWidth="0px",dv.style.setProperty("--mdc-drawer-width","env(safe-area-inset-left)")):(a.style.opacity=1,a.style.maxWidth="",dv.style.removeProperty("--mdc-drawer-width")),window.dispatchEvent(new Event("resize")))}}catch(e){Av.warn(e)}}function Lv(e,t){Av.debug("setToolbarVisibility: hideToolbar=".concat(e,", hideActionItems=").concat(t));try{var n=dv.shadowRoot.querySelector("ha-panel-lovelace");if(!n)return;var r=n.shadowRoot.querySelector("hui-root");if(!r)return;var i=(r=r.shadowRoot).querySelector("#view"),a=r.querySelector("app-toolbar");if(a||(a=r.querySelector("div.toolbar")),e)a.style.setProperty("display","none"),ev.keep_toolbar_space||(i.style.minHeight="100vh",i.style.marginTop="0",i.style.paddingTop="0");else{a.style.removeProperty("display"),i.style.removeProperty("min-height"),i.style.removeProperty("margin-top"),i.style.removeProperty("padding-top");var o=a.querySelector("div.action-items");t?o.style.setProperty("display","none"):o.style.setProperty("display","flex")}window.dispatchEvent(new Event("resize"))}catch(e){Av.warn(e)}}function Bv(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&!e.includes("?")&&(e+=window.location.search),history.pushState(null,"",e),hv.dispatchEvent(new Event("location-changed",{bubbles:!0,cancelable:!1,composed:!0}))}function Uv(){return void 0!==document.fullscreenElement?Boolean(document.fullscreenElement):void 0!==document.webkitCurrentFullScreenElement&&Boolean(document.webkitCurrentFullScreenElement)}function Fv(){Av.debug("Enter fullscreen");var e=document.documentElement;e.requestFullscreen?e.requestFullscreen().then(function(){Av.debug("Successfully requested fullscreen")},function(e){Av.debug("Failed to enter fullscreen:",e)}):e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function Dv(){Av.debug("activateWallpanel");var e=ev.hide_toolbar,t=ev.hide_toolbar_action_icons;if(e&&!ev.hide_toolbar_on_subviews&&rv){var n=Rv();if(n&&n.lovelace&&n.lovelace.rawConfig&&n.lovelace.rawConfig.views)for(var r=0;r<n.lovelace.rawConfig.views.length;r++)if(n.lovelace.rawConfig.views[r].path==rv){n.lovelace.rawConfig.views[r].subview&&(Av.debug("Current tab '".concat(rv,"' is a subview, not hiding toolbar")),e=!1,t=!1);break}}Lv(e,t),Mv(ev.hide_sidebar),ev.fullscreen&&!Uv()&&Fv()}function Nv(){Av.debug("deactivateWallpanel"),av.screensaverRunning()&&av.stopScreensaver(),Lv(!1,!1),Mv(!1),!ev.keep_fullscreen&&Uv()&&(Av.debug("Exit fullscreen"),document.exitFullscreen?document.exitFullscreen().then(function(){Av.debug("Successfully exited fullscreen")},function(e){Av.debug("Failed to exit fullscreen:",e)}):document.mozCancelFullScreen?document.mozCancelFullScreen():document.msRequestFullscreen?document.msRequestFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}function jv(){nv&&rv?(kv(),Tv()?Dv():Nv()):Nv()}function Wv(){if(Av.debug("Location changed from '".concat(tv,"' to '").concat(window.location.href,"'")),window.location.href!=tv){tv=window.location.href,av&&av.screensaverRunning&&av.screensaverRunning()&&ev.stop_screensaver_on_location_change&&(ov?(ov=!1,av.screensaverStopNavigationPathTimeout&&clearTimeout(av.screensaverStopNavigationPathTimeout)):av.stopScreensaver());var e=null,t=null,n=window.location.pathname.split("/");n.length>1&&(e=n[1],n.length>2&&(t=n[2]));var r=nv&&e!=nv;nv=e,rv=t,r?(Av.debug("Reset dashboard config"),Kp={},zv(jv)):jv()}}function zv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Date.now();null===t&&(t=n);var r=(n-t)/1e3;if((hv=document.querySelector("body > home-assistant"))&&hv.shadowRoot&&(dv=hv.shadowRoot.querySelector("home-assistant-main")),!hv||!hv.shadowRoot||!dv)return r>=5?void Av.error("Wallpanel startup failed after ".concat(r," seconds, element home-assistant / home-assistant-main not found.")):void setTimeout(zv,100,e,t);var i=Rv();if(!(i&&i.lovelace&&i.lovelace.config&&i.lovelace.config))return r>=5?void Av.info("No lovelace config found after ".concat(r," seconds")):void setTimeout(zv,100,e,t);if(!customElements.get("hui-view"))return r>=5?void Av.error("Wallpanel startup failed after ".concat(r," seconds, hui-view not found.")):void setTimeout(zv,100,e,t);if(!window.browser_mod){var a=Pv(["wait_for_browser_mod_time"]).wait_for_browser_mod_time;if(void 0===a&&(a=Qp.wait_for_browser_mod_time),r<a)return void setTimeout(zv,100,e,t)}window.browser_mod&&(window.browser_mod.entity_id?pv=window.browser_mod.entity_id:window.browser_mod.browserID&&(pv=window.browser_mod.browserID.replace("-","_"))),e()}console.info("%c🖼️ Wallpanel version ".concat(Jp),"color: #34b6f9; font-weight: bold;");try{zv(function(){var e=(hv.hass||hv.__hass).user;vv=e.id,mv=e.username||null,gv=e.name,Av.debug("userId: ".concat(vv,", userName: ").concat(mv,", userDisplayname: ").concat(gv)),kv(),function(){var e=customElements.get("hui-view-container"),t=customElements.get("hui-view");if(!e||!t)throw new Error("Failed to get hui-view-container / hui-view from customElements");var a=function(e){function t(){return i(this,t),r(this,t,arguments)}return l(t,e),o(t)}(e),c=function(e){function t(){var e;return i(this,t),(e=r(this,t)).mediaList=[],e.mediaIndex=-1,e.mediaListDirection="forwards",e.lastMediaListUpdate,e.updatingMediaList=!1,e.updatingMedia=!1,e.lastMediaUpdate=0,e.blockEventsUntil=0,e.screensaverStartedAt,e.screensaverStoppedAt=new Date,e.infoBoxContentCreatedDate,e.idleSince=Date.now(),e.lastProfileSet=ev.profile,e.lastMove=null,e.lastCorner=0,e.translateTimeout=null,e.lastClickTime=0,e.clickCount=0,e.touchStartX=-1,e.currentWidth=0,e.currentHeight=0,e.energyCollectionUpdateEnabled=!1,e.energyCollectionUpdateInterval=60,e.lastEnergyCollectionUpdate=0,e.screensaverStopNavigationPathTimeout=null,e.disable_screensaver_on_browser_mod_popup_function=null,e.moreInfoDialogOpenedAt=0,e.timerInterval=null,e.windowEventHandlers=[],e.infoBoxResizeObserver=null,e.screenWakeLock=new wv,e.cameraMotionDetection=new _v,e.lovelace=null,e.__hass=hv.hass||hv.__hass,e.__cards=[],e.__badges=[],e.__views=[],hv.provideHass(e),e.timerInterval=setInterval(e.timer.bind(e),1e3),iv.hass=e.__hass,e}return l(t,e),o(t,[{key:"hass",get:function(){return this.__hass},set:function(e){var t=this;Av.debug("Update hass"),this.__hass=e;var n=!1;for(var r in lv){var i=this.__hass.states[r];i&&i.state!=lv[r]&&(lv[r]=i.state,n=!0)}if(!this.updateProfile()&&n&&kv(),Tv()){var a=ev.screensaver_entity;if(a&&this.__hass.states[a]){var o=new Date(this.__hass.states[a].last_changed),s=this.__hass.states[a].state;"off"==s&&this.screensaverStartedAt&&o.getTime()-this.screensaverStartedAt>0?this.stopScreensaver(ev.fade_out_time_screensaver_entity):"on"==s&&this.screensaverStoppedAt&&o.getTime()-this.screensaverStoppedAt>0&&this.startScreensaver()}this.screensaverRunning()&&(this.__cards.forEach(function(e){e.hass=t.hass}),this.__badges.forEach(function(e){e.hass=t.hass}),this.__views.forEach(function(e){e.hass=t.hass}),"media-entity-image"==Ov()&&this.switchActiveMedia("entity_update"))}}},{key:"setScreensaverEntityState",value:function(){var e=ev.screensaver_entity;if(e&&this.__hass.states[e]&&(!this.screensaverRunning()||"on"!=this.__hass.states[e].state)&&(this.screensaverRunning()||"off"!=this.__hass.states[e].state)){var t=this.screensaverRunning()?"turn_on":"turn_off";Av.debug("Updating screensaver_entity",e,t),this.__hass.callService("input_boolean",t,{entity_id:e}).then(function(e){Av.debug(e)},function(e){Av.error("Failed to set screensaver entity state:",e)})}}},{key:"setImageURLEntityState",value:function(){var e=ev.image_url_entity;if(e&&this.__hass.states[e]){var t=this.getActiveMediaElement();if(t&&t.mediaUrl){var n=t.mediaUrl.substring(0,255);t._lastImageURLEntityValue!==n&&(Av.debug("Updating image_url_entity",e,n),this.__hass.callService("input_text","set_value",{entity_id:e,value:n}).then(function(e){Av.debug(e),t._lastImageURLEntityValue=n},function(e){Av.error("Failed to set image url entity state:",e)}))}}}},{key:"updateProfile",value:function(){var e=ev.profile_entity;if(e&&this.__hass.states[e]){var t=this.__hass.states[e].state;if(t&&t!=this.lastProfileSet||!t&&this.lastProfileSet)return Av.debug("Set profile to ".concat(t)),this.lastProfileSet=t,kv(),!0}return!1}},{key:"timer",value:function(){ev.enabled&&nv&&(this.screensaverRunning()?ev.disable_screensaver_on_browser_mod_popup&&Iv()?this.stopScreensaver(ev.fade_out_time_browser_mod_popup):this.updateScreensaver():Tv()&&ev.idle_time>0&&Date.now()-this.idleSince>=1e3*ev.idle_time&&this.startScreensaver())}},{key:"setDefaultStyle",value:function(){this.messageContainer.removeAttribute("style"),this.messageContainer.style.position="fixed",this.messageContainer.style.top="1rem",this.messageContainer.style.left="1rem",this.messageContainer.style.bottom="1rem",this.messageContainer.style.right="1rem",this.messageContainer.style.alignItems="flex-end",this.messageContainer.style.display="flex",this.messageContainer.style.flexDirection="column",this.messageContainer.style.gap="0.5rem",this.messageContainer.style.zIndex=this.style.zIndex+1,this.messageContainer.style.pointerEvents="none",this.messageContainer.style.visibility="hidden",this.debugBox.removeAttribute("style"),this.debugBox.style.position="fixed",this.debugBox.style.pointerEvents="none",this.debugBox.style.top="0%",this.debugBox.style.left="0%",this.debugBox.style.width="100%",this.debugBox.style.height="100%",this.debugBox.style.background="#00000099",this.debugBox.style.color="#ffffff",this.debugBox.style.zIndex=this.style.zIndex+2,this.debugBox.style.fontFamily="monospace",this.debugBox.style.fontSize="12px",this.debugBox.style.overflowWrap="break-word",this.debugBox.style.overflowY="auto",this.debugBox.style.visibility="hidden",this.screensaverContainer.removeAttribute("style"),this.screensaverContainer.style.position="fixed",this.screensaverContainer.style.pointerEvents="auto",this.screensaverContainer.style.top=0,this.screensaverContainer.style.left=0,this.screensaverContainer.style.width="100vw",this.screensaverContainer.style.height="100vh",this.screensaverContainer.style.background="#000000",this.screensaverContainer.style.overflow="hidden",this.imageOneContainer.removeAttribute("style"),this.imageOneContainer.style.opacity=0,this.imageOneContainer.style.position="absolute",this.imageOneContainer.style.pointerEvents="none",this.imageOneContainer.style.top=0,this.imageOneContainer.style.left=0,this.imageOneContainer.style.width="100%",this.imageOneContainer.style.height="100%",this.imageOneContainer.style.border="none",this.imageOneBackground.style.position="absolute",this.imageOneBackground.style.pointerEvents="none",this.imageOneBackground.style.top=0,this.imageOneBackground.style.left=0,this.imageOneBackground.style.width="100%",this.imageOneBackground.style.height="100%",this.imageOneBackground.style.border="none",this.imageOne.removeAttribute("style"),this.imageOne.style.position="relative",this.imageOne.style.pointerEvents="none",this.imageOne.style.width="100%",this.imageOne.style.height="100%",this.imageOne.style.border="none",this.imageOneInfoContainer.removeAttribute("style"),this.imageOneInfoContainer.style.position="absolute",this.imageOneInfoContainer.style.pointerEvents="none",this.imageOneInfoContainer.style.top=0,this.imageOneInfoContainer.style.left=0,this.imageOneInfoContainer.style.width="100%",this.imageOneInfoContainer.style.height="100%",this.imageOneInfoContainer.style.border="none",this.imageOneInfo.style.overflowY="auto",this.imageTwoContainer.removeAttribute("style"),this.imageTwoContainer.style.opacity=0,this.imageTwoContainer.style.position="absolute",this.imageTwoContainer.style.pointerEvents="none",this.imageTwoContainer.style.top=0,this.imageTwoContainer.style.left=0,this.imageTwoContainer.style.width="100%",this.imageTwoContainer.style.height="100%",this.imageTwoContainer.style.border="none",this.imageTwoBackground.style.position="absolute",this.imageTwoBackground.style.pointerEvents="none",this.imageTwoBackground.style.top=0,this.imageTwoBackground.style.left=0,this.imageTwoBackground.style.width="100%",this.imageTwoBackground.style.height="100%",this.imageTwoBackground.style.border="none",this.imageTwo.removeAttribute("style"),this.imageTwo.style.position="relative",this.imageTwo.style.pointerEvents="none",this.imageTwo.style.width="100%",this.imageTwo.style.height="100%",this.imageTwo.style.border="none",this.imageTwoInfoContainer.removeAttribute("style"),this.imageTwoInfoContainer.style.position="absolute",this.imageTwoInfoContainer.style.pointerEvents="none",this.imageTwoInfoContainer.style.top=0,this.imageTwoInfoContainer.style.left=0,this.imageTwoInfoContainer.style.width="100%",this.imageTwoInfoContainer.style.height="100%",this.imageTwoInfoContainer.style.border="none",this.imageTwoInfo.style.overflowY="auto",this.screensaverImageOverlay.removeAttribute("style"),this.screensaverImageOverlay.style.position="absolute",this.screensaverImageOverlay.style.top=0,this.screensaverImageOverlay.style.left=0,this.screensaverImageOverlay.style.width="100%",this.screensaverImageOverlay.style.height="100%",this.screensaverImageOverlay.style.background="#00000000",this.infoContainer.removeAttribute("style"),this.infoContainer.style.position="absolute",this.infoContainer.style.pointerEvents="none",this.infoContainer.style.top=0,this.infoContainer.style.left=0,this.infoContainer.style.width="100%",this.infoContainer.style.height="100%",this.infoContainer.style.transition="opacity 2000ms ease-in-out",this.infoContainer.style.padding="25px",this.infoContainer.style.boxSizing="border-box",this.infoBox.removeAttribute("style"),this.infoBox.style.pointerEvents="none",this.infoBox.style.width="fit-content",this.infoBox.style.maxHeight="100%",this.infoBox.style.borderRadius="10px",this.infoBox.style.overflowY="auto",this.infoBox.style.scrollbarWidth="none",this.infoBox.style.setProperty("--wp-card-width","500px"),this.infoBox.style.setProperty("--wp-card-padding","0"),this.infoBox.style.setProperty("--wp-card-margin","5px"),this.infoBox.style.setProperty("--wp-card-backdrop-filter","none"),this.infoBox.style.setProperty("--wp-badges-minwidth","200px"),this.infoBoxPosX.style.pointerEvents="none",this.infoBoxPosX.style.height="100%",this.infoBoxPosX.style.width="100%",this.infoBoxPosY.style.pointerEvents="none",this.infoBoxPosY.style.height="100%",this.infoBoxPosY.style.width="100%",this.infoBoxContent.style.pointerEvents="none",this.infoBoxContent.style.width="fit-content",this.infoBoxContent.style.height="100%",this.infoBoxContent.style.display="grid",this.fixedInfoContainer.removeAttribute("style"),this.fixedInfoContainer.style.position="fixed",this.fixedInfoContainer.style.pointerEvents="none",this.fixedInfoContainer.style.top=0,this.fixedInfoContainer.style.left=0,this.fixedInfoContainer.style.width="100%",this.fixedInfoContainer.style.height="100%",this.fixedInfoBox.style.pointerEvents="none",this.fixedInfoBox.style.cssText=this.infoBox.style.cssText,this.screensaverOverlay.removeAttribute("style"),this.screensaverOverlay.style.position="absolute",this.screensaverOverlay.style.pointerEvents="none",this.screensaverOverlay.style.top=0,this.screensaverOverlay.style.left=0,this.screensaverOverlay.style.width="100%",this.screensaverOverlay.style.height="100%",this.screensaverOverlay.style.background="#00000000"}},{key:"updateStyle",value:function(){this.screensaverOverlay.style.background="#00000000",this.debugBox.style.visibility=ev.debug?"visible":"hidden",this.debugBox.style.pointerEvents=ev.debug?"auto":"none",this.style.transition=ev.fade_in_time>0?"opacity ".concat(Math.round(1e3*ev.fade_in_time),"ms ease-in-out"):"",this.imageOneContainer.style.transition=ev.crossfade_time>0?"opacity ".concat(Math.round(1e3*ev.crossfade_time),"ms ease-in-out"):"",this.imageTwoContainer.style.transition=ev.crossfade_time>0?"opacity ".concat(Math.round(1e3*ev.crossfade_time),"ms ease-in-out"):"",this.messageContainer.style.visibility=this.screensaverRunning()?"visible":"hidden",this.screensaverImageOverlay.style.pointerEvents=ev.content_interaction?"none":"auto";var e=ev.show_image_info&&Boolean(ev.image_info_template);if(this.imageOneInfoContainer.style.display=e?"block":"none",this.imageTwoInfoContainer.style.display=e?"block":"none",ev.info_animation_duration_x?this.infoBoxPosX.style.animation="moveX ".concat(ev.info_animation_duration_x,"s ").concat(ev.info_animation_timing_function_x," infinite alternate"):this.infoBoxPosX.style.animation="",ev.info_animation_duration_y?this.infoBoxPosY.style.animation="moveY ".concat(ev.info_animation_duration_y,"s ").concat(ev.info_animation_timing_function_y," infinite alternate"):this.infoBoxPosY.style.animation="",ev.style)for(var t in ev.style)if(t.startsWith("wallpanel-")&&"wallpanel-shadow-host"!=t&&"wallpanel-screensaver-info-box-badges"!=t&&"wallpanel-screensaver-info-box-views"!=t&&!sv[t]){var n=this.shadowRoot.getElementById(t);if(n){for(var r in Av.debug("Setting style attributes for element #".concat(t)),ev.style[t])Av.debug("Setting style attribute ".concat(r," to ").concat(ev.style[t][r])),n.style.setProperty(r,ev.style[t][r]);n==this.infoBox?this.fixedInfoBox.style.cssText=this.infoBox.style.cssText:n==this.infoBoxContent&&(this.fixedInfoBoxContent.style.cssText=this.infoBoxContent.style.cssText)}else Av.error("Element #".concat(t," not found"))}}},{key:"updateShadowStyle",value:function(){var e=getComputedStyle(this.infoContainer),t=this.infoContainer.offsetWidth-parseInt(e.paddingLeft)-parseInt(e.paddingRight)-this.infoBox.offsetWidth,n=this.infoContainer.offsetHeight-parseInt(e.paddingTop)-parseInt(e.paddingBottom)-this.infoBox.offsetHeight,r="";if(ev.style){if(ev.style["wallpanel-shadow-host"])for(var i in ev.style["wallpanel-shadow-host"])r+="".concat(i,": ").concat(ev.style["wallpanel-shadow-host"][i],";\n");for(var a in sv)ev.style[a]&&Sv(sv[a],ev.style[a])}var o="";for(var s in sv){for(var c in o+=".".concat(s," {\n"),sv[s])o+="".concat(c,": ").concat(sv[s][c],";\n");o+="}\n"}this.shadowStyle.innerHTML="\n\t\t\t\t:host {\n\t\t\t\t\t".concat(r,"\n\t\t\t\t}\n\t\t\t\t@keyframes moveX {\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: translate3d(").concat(t,"px, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes moveY {\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: translate3d(0, ").concat(n,"px, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes horizontalProgress {\n\t\t\t\t\t0% {\n\t\t\t\t\t\twidth: 0%;\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes kenBurnsEffect-experimental {\n\t\t\t\t\t0% {\n\t\t\t\t\t\ttransform: scale(1.0) translateX(calc(var(--hidden-width) / -2 * 1px)) translateY(calc(var(--hidden-height) / -2 * 1px));\n\t\t\t\t\t}\n\t\t\t\t\t50% {\n\t\t\t\t\t\ttransform: scale(var(--ken-burns-zoom));\n\t\t\t\t\t}\n\t\t\t\t\t90% {\n\t\t\t\t\t\ttransform: scale(calc(1.0 + ((var(--ken-burns-zoom) - 1.0)/2))) translateX(calc(var(--hidden-width) / 2 * 1px)) translateY(calc(var(--hidden-height) / 2 * 1px));\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: scale(1.0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes kenBurnsEffect-experimental2 {\n\t\t\t\t\t0% {\n\t\t\t\t\t\ttransform: scale(1.0);\n\t\t\t\t\t}\n\t\t\t\t\t25% {\n\t\t\t\t\t\ttransform: scale(calc(1.0 + ((var(--ken-burns-zoom) - 1.0)/2))) translateX(calc(var(--hidden-width) / 2 * 1px)) translateY(calc(var(--hidden-height) / 2 * 1px));\n\t\t\t\t\t}\n\t\t\t\t\t50% {\n\t\t\t\t\t\ttransform: scale(var(--ken-burns-zoom));\n\t\t\t\t\t}\n\t\t\t\t\t75% {\n\t\t\t\t\t\ttransform: scale(calc(1.0 + ((var(--ken-burns-zoom) - 1.0)/2))) translateX(calc(var(--hidden-width) / -2 * 1px)) translateY(calc(var(--hidden-height) / -2 * 1px));\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: scale(1.0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes kenBurnsEffect-simple {\n\t\t\t\t\t0% {\n\t\t\t\t\t\ttransform-origin: bottom left;\n\t\t\t\t\t\ttransform: scale(1.0);\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: scale(var(--ken-burns-zoom));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t").concat(o,"\n\t\t\t\t").concat(ev.custom_css,"\n\t\t\t")}},{key:"randomMove",value:function(){var e=getComputedStyle(this.infoContainer),t=this.infoContainer.offsetWidth-parseInt(e.paddingLeft)-parseInt(e.paddingRight)-this.infoBox.offsetWidth,n=this.infoContainer.offsetHeight-parseInt(e.paddingTop)-parseInt(e.paddingBottom)-this.infoBox.offsetHeight,r=Math.floor(Math.random()*t),i=Math.floor(Math.random()*n);this.moveInfoBox(r,i)}},{key:"moveAroundCorners",value:function(){var e=null;arguments.length>0&&void 0!==arguments[0]&&arguments[0]?e=0:this.lastCorner=(this.lastCorner+1)%4;var t=getComputedStyle(this.infoContainer),n=[2,3].includes(this.lastCorner)?this.infoContainer.offsetWidth-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-this.infoBox.offsetWidth:0,r=[1,2].includes(this.lastCorner)?this.infoContainer.offsetHeight-parseInt(t.paddingTop)-parseInt(t.paddingBottom)-this.infoBox.offsetHeight:0;this.moveInfoBox(n,r,e)}},{key:"moveInfoBox",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.lastMove=Date.now(),null===n&&(n=ev.info_move_fade_duration),n>0&&(this.infoBox.animate?this.infoBox.animate([{opacity:1},{opacity:0,offset:.5},{opacity:1}],{duration:Math.round(1e3*n),iterations:1}):Av.warn("This browser does not support the animate() method, please set info_move_fade_duration to 0"));var r=this,i=Math.round(500*n);i<0&&(i=0),r.translateTimeout&&clearTimeout(r.translateTimeout),r.translateTimeout=setTimeout(function(){r.infoBoxPosX.style.transform="translate3d(".concat(e,"px, 0, 0)"),r.infoBoxPosY.style.transform="translate3d(0, ".concat(t,"px, 0)")},i)}},{key:"createInfoBoxContent",value:function(){var e=this;Av.debug("Creating info box content");var t=Rv();if(t){if(this.lovelace=t.lovelace||t.__lovelace,this.infoBoxContentCreatedDate=new Date,this.infoBoxContent.innerHTML="",this.__badges=[],this.__cards=[],this.__views=[],this.energyCollectionUpdateEnabled=!1,this.shadowRoot.querySelectorAll(".wp-card").forEach(function(e){e.parentElement.removeChild(e)}),ev.badges&&ev.badges.length>0){var n=document.createElement("div");if(n.id="wallpanel-screensaver-info-box-badges",n.classList.add("wp-badges"),n.style.padding="var(--wp-card-padding)",n.style.margin="var(--wp-card-margin)",n.style.textAlign="center",n.style.display="flex",n.style.alignItems="flex-start",n.style.flexWrap="wrap",n.style.justifyContent="center",n.style.gap="8px",n.style.margin="0px",n.style.minWidth="var(--wp-badges-minwidth)",ev.style[n.id])for(var r in ev.style[n.id])Av.debug("Setting style attribute ".concat(r," to ").concat(ev.style[n.id][r])),n.style.setProperty(r,ev.style[n.id][r]);ev.badges.forEach(function(t){var r=JSON.parse(JSON.stringify(t));Av.debug("Creating badge:",r);var i={};r.wp_style&&(i=r.wp_style,delete r.wp_style);var a=(e._createBadgeElement?e._createBadgeElement:e.createBadgeElement).bind(e)(r);for(var o in a.hass=e.hass,i)a.style.setProperty(o,i[o]);e.__badges.push(a),n.append(a)}),this.infoBoxContent.appendChild(n)}if(ev.views&&ev.views.length>0){var i=document.createElement("div");if(i.id="wallpanel-screensaver-info-box-views",i.classList.add("wp-views"),ev.style[i.id])for(var a in ev.style[i.id])Av.debug("Setting style attribute ".concat(a," to ").concat(ev.style[i.id][a])),i.style.setProperty(a,ev.style[i.id][a]);var o=this.lovelace.config.views;ev.views.forEach(function(t){for(var n=-1,r=JSON.parse(JSON.stringify(t)),a=0;a<o.length;a++)if(o[a].path&&t.path&&o[a].path.toLowerCase()==t.path.toLowerCase()||o[a].title&&t.title&&o[a].title.toLowerCase()==t.title.toLowerCase()){n=a,r.title=o[a].title,r.path=o[a].path;break}-1==n&&(Av.error("View with path '".concat(r.path,"' / tile '").concat(r.title,"' not found")),n=0);var s=document.createElement("hui-view");s.route={prefix:"/"+nv,path:"/"+t.path},s.lovelace=e.lovelace,s.panel=e.hass.panels[nv],s.hass=e.hass,s.index=n,"boolean"==typeof r.narrow&&(s.narrow=r.narrow),e.__views.push(s);var c=document.createElement("div");if(ev.content_interaction?s.style.pointerEvents="auto":s.style.pointerEvents="none",r.wp_style)for(var u in r.wp_style)c.style.setProperty(u,r.wp_style[u]);c.append(s),i.append(c)}),this.infoBoxContent.appendChild(i)}ev.cards&&ev.cards.length>0&&ev.cards.forEach(function(t){var n=JSON.parse(JSON.stringify(t));Av.debug("Creating card:",n);var r={};n.wp_style&&(r=n.wp_style,delete n.wp_style),n.type&&n.type.includes("energy")&&(n.collection_key="energy_wallpanel",e.energyCollectionUpdateEnabled=!0);var i=(e._createCardElement?e._createCardElement:e.createCardElement).bind(e)(n);i.hass=e.hass,e.__cards.push(i);var a=e.infoBoxContent,o=document.createElement("div");for(var s in o.classList.add("wp-card"),o.style.width="var(--wp-card-width)",o.style.padding="var(--wp-card-padding)",o.style.margin="var(--wp-card-margin)",o.style.backdropFilter="var(--wp-card-backdrop-filter)",ev.content_interaction?o.style.pointerEvents="auto":o.style.pointerEvents="none",r)if("parent"==s){var c=e.shadowRoot.getElementById(r[s]);c&&(a=c)}else o.style.setProperty(s,r[s]);o.append(i),a.appendChild(o)}),setTimeout(this.updateShadowStyle.bind(this),500)}}},{key:"restartProgressBarAnimation",value:function(){if(this.progressBarContainer&&(this.progressBar.style.animation="none",ev.show_progress_bar)){var e=this;setTimeout(function(){e.progressBar.style.animation="horizontalProgress ".concat(ev.display_time,"s linear")},25)}}},{key:"restartKenBurnsEffect",value:function(){if(ev.image_animation_ken_burns&&ev.image_animation_ken_burns_animations.length){var e=this.getActiveMediaElement();e.style.animation="none",e.style.setProperty("--ken-burns-zoom",ev.image_animation_ken_burns_zoom);var t=Math.floor(1e3*ev.image_animation_ken_burns_delay);t<50&&(t=50);var n=Math.ceil(ev.image_animation_ken_burns_duration||1.2*(ev.display_time+2*ev.crossfade_time)),r=ev.image_animation_ken_burns_animations[Math.floor(Math.random()*ev.image_animation_ken_burns_animations.length)];this.kenburnsDelayStartTimer&&clearTimeout(this.kenburnsDelayStartTimer),e.animationIterationCount=1,this.kenburnsDelayStartTimer=setTimeout(function(){e.style.animation="kenBurnsEffect-".concat(r," ").concat(n,"s linear forwards")},t)}}},{key:"getMediaElement",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.imageOneContainer.style.opacity==(e?1:0)?this.imageOne:this.imageTwo;if(t&&"ha-camera-stream"==n.tagName.toLowerCase()){var r=Ev(n)[1];r&&(n=r)}return n}},{key:"getActiveMediaElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getMediaElement(!0,e)}},{key:"getInactiveMediaElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getMediaElement(!1,e)}},{key:"replaceMediaElement",value:function(e,t){if("string"==typeof e.src&&e.src.startsWith("blob:")&&URL.revokeObjectURL(e.src),"function"==typeof e.pause&&e.pause(),"ha-camera-stream"==e.tagName.toLowerCase()){var n=y(Ev(e),2),r=n[0],i=n[1];i&&i.pause(),r&&"function"==typeof r.stop&&r.stop()}t=t.toLowerCase();var a=document.createElement(t);return b(e.attributes).filter(function(e){return"src"!=e.name}).forEach(function(e){return a.setAttribute(e.name,e.value)}),a.mediaUrl=e.mediaUrl,a.infoCacheUrl=e.infoCacheUrl,"video"===t&&Object.assign(a,{preload:"auto",muted:!1,volume:ev.video_volume}),e.replaceWith(a),e===this.imageOne?this.imageOne=a:this.imageTwo=a,e.remove(),a}},{key:"loadBackgroundImage",value:function(e){var t=e.src,n=e.tagName.toLowerCase();if("ha-camera-stream"===n){var r=Ev(e)[1];if(!r||!r.poster)return;t=r.poster}else if("video"===n){var i=document.createElement("canvas");i.width=e.videoWidth,i.height=e.videoHeight,i.getContext("2d").drawImage(e,0,0,i.width,i.height);try{t=i.toDataURL("image/png")}catch(e){t=null,Av.error("Error extracting canvas image:",e)}}var a=this.imageOneBackground;e==this.imageTwo&&(a=this.imageTwoBackground),a.style.backgroundImage=t?'url("'.concat(encodeURI(t),'")'):""}},{key:"connectedCallback",value:function(){var e=this;this.style.zIndex=ev.z_index,this.style.visibility="hidden",this.style.opacity=0,this.style.position="fixed",this.timerInterval||(this.timerInterval=setInterval(this.timer.bind(this),1e3)),this.messageContainer=document.createElement("div"),this.messageContainer.id="wallpanel-message-container",this.debugBox=document.createElement("div"),this.debugBox.id="wallpanel-debug-box",this.screensaverContainer=document.createElement("div"),this.screensaverContainer.id="wallpanel-screensaver-container",this.imageOneContainer=document.createElement("div"),this.imageOneContainer.id="wallpanel-screensaver-image-one-container",this.imageOneBackground=document.createElement("div"),this.imageOneBackground.className="wallpanel-screensaver-image-background",this.imageOneBackground.id="wallpanel-screensaver-image-one-background",this.imageOne=document.createElement("img"),this.imageOne.id="wallpanel-screensaver-image-one",this.imageOneInfoContainer=document.createElement("div"),this.imageOneInfoContainer.className="wallpanel-screensaver-image-info-container",this.imageOneInfoContainer.id="wallpanel-screensaver-image-one-info-container",this.imageOneInfo=document.createElement("div"),this.imageOneInfo.className="wallpanel-screensaver-image-info",this.imageOneInfo.id="wallpanel-screensaver-image-one-info",this.imageOneInfoContainer.appendChild(this.imageOneInfo),this.imageOneContainer.appendChild(this.imageOneBackground),this.imageOneContainer.appendChild(this.imageOne),this.imageOneContainer.appendChild(this.imageOneInfoContainer),this.screensaverContainer.appendChild(this.imageOneContainer),this.imageTwoContainer=document.createElement("div"),this.imageTwoContainer.id="wallpanel-screensaver-image-two-container",this.imageTwoBackground=document.createElement("div"),this.imageTwoBackground.className="wallpanel-screensaver-image-background",this.imageTwoBackground.id="wallpanel-screensaver-image-two-background",this.imageTwo=document.createElement("img"),this.imageTwo.id="wallpanel-screensaver-image-two",this.imageTwoInfoContainer=document.createElement("div"),this.imageTwoInfoContainer.className="wallpanel-screensaver-image-info-container",this.imageTwoInfoContainer.id="wallpanel-screensaver-image-two-info-container",this.imageTwoInfo=document.createElement("div"),this.imageTwoInfo.className="wallpanel-screensaver-image-info",this.imageTwoInfo.id="wallpanel-screensaver-image-two-info",this.imageTwoInfoContainer.appendChild(this.imageTwoInfo),this.imageTwoContainer.appendChild(this.imageTwoBackground),this.imageTwoContainer.appendChild(this.imageTwo),this.imageTwoContainer.appendChild(this.imageTwoInfoContainer),this.screensaverContainer.appendChild(this.imageTwoContainer),this.screensaverImageOverlay=document.createElement("div"),this.screensaverImageOverlay.id="wallpanel-screensaver-image-overlay",this.screensaverContainer.appendChild(this.screensaverImageOverlay),this.progressBarContainer=document.createElement("div"),this.progressBarContainer.className="wallpanel-progress",this.progressBar=document.createElement("div"),this.progressBar.className="wallpanel-progress-inner",this.progressBar.id="wallpanel-progress-inner",this.progressBarContainer.appendChild(this.progressBar),ev.show_progress_bar&&this.screensaverContainer.appendChild(this.progressBarContainer),this.infoContainer=document.createElement("div"),this.infoContainer.id="wallpanel-screensaver-info-container",this.fixedInfoContainer=document.createElement("div"),this.fixedInfoContainer.id="wallpanel-screensaver-fixed-info-container",this.fixedInfoBox=document.createElement("div"),this.fixedInfoBox.id="wallpanel-screensaver-fixed-info-box",this.fixedInfoBoxContent=document.createElement("div"),this.fixedInfoBoxContent.id="wallpanel-screensaver-fixed-info-box-content",this.screensaverContainer.appendChild(this.infoContainer),this.infoBoxPosX=document.createElement("div"),this.infoBoxPosX.id="wallpanel-screensaver-info-box-pos-x",this.infoBoxPosX.x="0",this.infoBoxPosY=document.createElement("div"),this.infoBoxPosY.id="wallpanel-screensaver-info-box-pos-y",this.infoBoxPosY.y="0",this.infoBox=document.createElement("div"),this.infoBox.id="wallpanel-screensaver-info-box",this.infoBoxContent=document.createElement("div"),this.infoBoxContent.id="wallpanel-screensaver-info-box-content",this.infoBoxContent.style.display="grid",this.infoBox.appendChild(this.infoBoxContent),this.infoBoxPosX.appendChild(this.infoBox),this.infoBoxPosY.appendChild(this.infoBoxPosX),this.infoContainer.appendChild(this.infoBoxPosY),this.fixedInfoBox.appendChild(this.fixedInfoBoxContent),this.fixedInfoContainer.appendChild(this.fixedInfoBox),this.infoContainer.appendChild(this.fixedInfoContainer),this.screensaverOverlay=document.createElement("div"),this.screensaverOverlay.id="wallpanel-screensaver-overlay",this.screensaverContainer.appendChild(this.screensaverOverlay),this.shadowStyle=document.createElement("style");var t=this.attachShadow({mode:"open"});t.appendChild(this.shadowStyle),t.appendChild(this.screensaverContainer),t.appendChild(this.messageContainer),t.appendChild(this.debugBox);var n=this,r=["click","touchstart","touchend","wheel"];ev.stop_screensaver_on_key_down&&r.push("keydown"),ev.stop_screensaver_on_mouse_move&&r.push("mousemove");var i=function(e){try{n.handleInteractionEvent(e)}catch(e){Av.error(e.stack)}};r.forEach(function(e){window.addEventListener(e,i,!0),n.windowEventHandlers.push({eventName:e,handler:i,options:!0})});var a=function(e){ev.disable_context_menu&&n.screensaverRunning()&&e.preventDefault()};window.addEventListener("contextmenu",a),this.windowEventHandlers.push({eventName:"contextmenu",handler:a});var o=function(){try{var t=e.screensaverContainer.clientWidth,r=e.screensaverContainer.clientHeight;!n.screensaverRunning()||n.currentWidth==t&&n.currentHeight==r||(Av.debug("Size changed from ".concat(n.currentWidth,"x").concat(n.currentHeight," to ").concat(t,"x").concat(r)),n.currentWidth=t,n.currentHeight=r,n.updateShadowStyle(),n.setMediaDimensions())}catch(e){Av.error(e.stack)}};window.addEventListener("resize",o),this.windowEventHandlers.push({eventName:"resize",handler:o});var s=function(){try{n.screensaverRunning()&&n.moreInfoDialogToForeground()}catch(e){Av.error(e.stack)}};window.addEventListener("hass-more-info",s),this.windowEventHandlers.push({eventName:"hass-more-info",handler:s}),this.infoBoxResizeObserver=new ResizeObserver(function(){"corners"===ev.info_move_pattern&&e.moveAroundCorners(!0)}),this.infoBoxResizeObserver.observe(this.infoBoxContent),this.setScreensaverEntityState()}},{key:"disconnectedCallback",value:function(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null),this.translateTimeout&&(clearTimeout(this.translateTimeout),this.translateTimeout=null),this.windowEventHandlers.length&&(this.windowEventHandlers.forEach(function(e){var t=e.eventName,n=e.handler,r=e.options;window.removeEventListener(t,n,r)}),this.windowEventHandlers=[]),this.infoBoxResizeObserver&&(this.infoBoxResizeObserver.disconnect(),this.infoBoxResizeObserver=null)}},{key:"reconfigure",value:function(e){var t=e&&Object.keys(e).length>0;!t||e.hide_toolbar==ev.hide_toolbar&&e.hide_toolbar_action_icons==ev.hide_toolbar_action_icons&&e.hide_toolbar_on_subviews==ev.hide_toolbar_on_subviews&&e.hide_sidebar==ev.hide_sidebar&&e.fullscreen==ev.fullscreen||Dv(),ev.theme&&(Av.info("Apply theme",ev.theme),iv.theme=ev.theme,iv._applyTheme()),this.updateStyle(),this.screensaverRunning()&&this.createInfoBoxContent(),!ev.info_move_interval&&t&&e.info_move_interval&&av.moveInfoBox(0,0);var n=e.image_url!=ev.image_url||"immich-api"==Ov()&&(ev.immich_shared_albums!=e.immich_shared_albums||ev.immich_memories!=e.immich_memories||ev.immich_favorites!=e.immich_favorites||JSON.stringify(ev.immich_album_names)!=JSON.stringify(e.immich_album_names)||JSON.stringify(ev.immich_tag_names)!=JSON.stringify(e.immich_tag_names)||JSON.stringify(ev.immich_persons)!=JSON.stringify(e.immich_persons));if(ev.show_images&&(!this.mediaList||!this.mediaList.length||!t||!e.show_images||n)){var r=this,i=this.screensaverRunning()&&t;n&&(this.mediaList=[],this.mediaIndex=-1),this.updateMediaList(function(){i&&r.switchActiveMedia("reconfigure")},n)}if(ev.disable_screensaver_on_browser_mod_popup_func)try{this.disable_screensaver_on_browser_mod_popup_function=new Function("bmp",ev.disable_screensaver_on_browser_mod_popup_func)}catch(e){this.disable_screensaver_on_browser_mod_popup_function=null,Av.error("Invalid disable_screensaver_on_browser_mod_popup_func:",e)}Tv()&&ev.camera_motion_detection_enabled?this.cameraMotionDetection.start():this.cameraMotionDetection.stop()}},{key:"getMoreInfoDialog",value:function(){var e=hv.shadowRoot.querySelector("ha-more-info-dialog");if(e)return e.shadowRoot.querySelector("ha-dialog")||void 0}},{key:"moreInfoDialogToForeground",value:function(){var e=this;!function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=e.getMoreInfoDialog();if(r)return r.style.position="absolute",void(r.style.zIndex=e.style.zIndex+1);n<10&&setTimeout(t,50,n+1)}()}},{key:"fetchEXIFInfo",value:function(e){var t=this;if(!cv.get(e.infoCacheUrl)){var n=document.createElement("img");n.src=e.src,n.mediaUrl=e.mediaUrl,n.infoCacheUrl=e.infoCacheUrl,Qv(n,function(){Av.debug("EXIF data:",n.exifdata),uv(n.infoCacheUrl,n.exifdata),t.setMediaDataInfo(n);var e=n.exifdata.GPSLongitude,r=n.exifdata.GPSLatitude;if(ev.fetch_address_data&&e&&!isNaN(e[0])&&r&&!isNaN(r[0])){var i="S"==n.exifdata.GPSLatitudeRef?-1:1,a=r[0]*i+(r[1]*i*60+r[2]*i)/3600;i="W"==n.exifdata.GPSLongitudeRef?-1:1;var o=e[0]*i+(e[1]*i*60+e[2]*i)/3600;Av.debug("Fetching nominatim data for lat=".concat(a," lon=").concat(o));var s=new XMLHttpRequest;s.onload=function(){if(200==this.status||0===this.status){var e=JSON.parse(s.responseText);if(Av.debug("nominatim data:",e),e&&e.address){var r=cv.get(n.infoCacheUrl);r?(r.address=e.address,t.setMediaDataInfo(n)):Av.warn("URL not in cache:",n.infoCacheUrl)}}else Av.error("nominatim error:",this.status,s.status,s.responseText)},s.onerror=function(e){Av.error("nominatim error:",e)},s.ontimeout=function(e){Av.error("nominatim timeout:",e)},s.open("GET","https://nominatim.openstreetmap.org/reverse?lat=".concat(a,"&lon=").concat(o,"&format=json")),s.timeout=15e3,s.send()}})}}},{key:"setMediaDataInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=ev.show_image_info&&Boolean(ev.image_info_template);if(this.imageOneInfoContainer.style.display=t?"block":"none",this.imageTwoInfoContainer.style.display=t?"block":"none",!t)return this.imageOneInfo.innerHTML="",void(this.imageTwoInfo.innerHTML="");e||(e=this.getActiveMediaElement());var n=e.infoCacheUrl,r=e.mediaUrl;if(n)if(r){r=decodeURI(r);var i=[];if(this.imageOne.infoCacheUrl==n&&i.push(this.imageOneInfo),this.imageTwo.infoCacheUrl==n&&i.push(this.imageTwoInfo),0!=i.length){var a=cv.get(n);a||(a={}),a.image||(a.image={}),void 0===a.image.url&&(a.image.url=r);var o=r.replace(/\?[^?]*$/,"").replace(/\/+$/,"");if(void 0===a.image.path&&(a.image.path=o.replace(/^[^:]+:\/\/[^/]+/,"")),void 0===a.image.relativePath&&(a.image.relativePath=o.replace(ev.image_url,"").replace(/^\/+/,"")),void 0===a.image.filename&&(a.image.filename=o.replace(/^.*[\\/]/,"")),void 0===a.image.folderName){a.image.folderName="";var s=o.split("/");s.length>=2&&(a.image.folderName=s[s.length-2])}a.mediaPosition=this.mediaIndex+1,a.mediaCount=this.mediaList.length,Av.debug("Media info:",a);var c=ev.image_info_template||"";if("analyze"==c){function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object.keys(e);n.sort(),n.forEach(function(n){var r=e[n];"object"===w(r)&&null!==r?u(r,n+"."):c+="".concat(t).concat(n,": ").concat(bv(r),"<br>")})}c="",u(a),this.imageOneInfo.style.pointerEvents="none",this.imageTwoInfo.style.pointerEvents="none",i.forEach(function(e){e.style.pointerEvents="auto"})}else c=c.replace(/\${([^}]+)}/g,function(e,t){var n="",r="",i=null;if(t.includes("!")){var o=t.split("!");t=o[0];for(var s=1;s<o.length;s++){var c=o[s].substring(0,o[s].indexOf("=")),u=o[s].substring(o[s].indexOf("=")+1);"prefix"==c?n=u:"suffix"==c?r=u:"options"==c&&(i={},u.split(",").forEach(function(e){var t=e.split(":",2);t[0]&&t[1]&&(i[t[0].replace(/\s/g,"")]=t[1].replace(/\s/g,""))}))}}for(var l="",f=t.split("|"),h="",d=0;d<f.length;d++){var p=(h=f[d]).replace(/\s/g,"").split(".");if(l=a,p.forEach(function(e){l&&(l=l[e])}),l)break}if(!l)return"";if(/DateTime/i.test(h)){var v=new Date(l.replace(/(\d\d\d\d):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)/,"$1-$2-$3T$4:$5:$6"));if(isNaN(v))return"";i||(i={year:"numeric",month:"2-digit",day:"2-digit"}),l=v.toLocaleDateString((hv.hass||hv.__hass).locale.language,i)}return"object"===w(l)&&(l=JSON.stringify(l)),n+l+r});i.forEach(function(e){e.innerHTML=c,e.style.display="block"})}}else Av.debug("mediaUrl missing:",e);else Av.debug("infoCacheUrl missing:",e)}},{key:"updateMediaList",value:(O=n(p().m(function e(){var t,n,r,i,a,o,s,c,u,l=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:if(t=l.length>0&&void 0!==l[0]?l[0]:null,n=l.length>1&&void 0!==l[1]&&l[1],r=l.length>2&&void 0!==l[2]?l[2]:0,ev.image_url){e.n=1;break}return e.a(2);case 1:if(!this.updatingMediaList){e.n=2;break}return e.a(2);case 2:if(n){e.n=3;break}if(!((new Date).getTime()-this.lastMediaListUpdate<1e3*ev.media_list_update_interval)){e.n=3;break}return e.a(2);case 3:if(i=this,a=null,"unsplash-api"!=(o=Ov())){e.n=4;break}a=i.updateMediaListFromUnsplashAPI,e.n=7;break;case 4:if("immich-api"!=o){e.n=5;break}a=i.updateMediaListFromImmichAPI,e.n=7;break;case 5:if("media-source"!=o){e.n=6;break}a=i.updateMediaListFromMediaSource,e.n=7;break;case 6:return s=ev.image_url,"iframe"==o?s=s.replace(/^iframe\+/,""):"embed"==o&&(s=s.replace(/^embed\+/,"")),this.mediaList=[s],t&&t(),e.a(2);case 7:return this.updatingMediaList=!0,this.lastMediaListUpdate=Date.now(),e.p=8,e.n=9,a.bind(i)();case 9:Av.debug("Media list from ".concat(o," is now:"),i.mediaList),t&&t(),e.n=11;break;case 10:e.p=10,u=e.v,Av.warn("Failed to update media list from ".concat(o,":"),u),r<3?(Av.warn("Retrying media list update in ".concat(3," seconds (attempt ").concat(r+1,"/").concat(3,")...")),setTimeout(function(){return i.updateMediaList(t,!0,r+1)},3e3)):(c="Failed to update media list from ".concat(ev.image_url," after ").concat(3," retries: ").concat(u.message||bv(u)),Av.error(c));case 11:this.updatingMediaList=!1;case 12:return e.a(2)}},e,this,[[8,10]])})),function(){return O.apply(this,arguments)})},{key:"findMedias",value:(T=n(p().m(function e(t){var r,i,a,o,c,u,l,f,h;return p().w(function(e){for(;;)switch(e.n){case 0:if(r=this,Av.debug("findMedias: ".concat(t)),i=[],ev.exclude_filenames){a=s(ev.exclude_filenames);try{for(a.s();!(o=a.n()).done;)c=o.value,i.push(new RegExp(c))}catch(e){a.e(e)}finally{a.f()}}return e.p=1,e.n=2,r.hass.callWS({type:"media_source/browse_media",media_content_id:t});case 2:return u=e.v,Av.debug("Found media entry",u),l=u.children.map(function(){var e=n(p().m(function e(t){var n,a,o;return p().w(function(e){for(;;)switch(e.n){case 0:n=t.media_content_id.replace(/^media-source:\/\/[^/]+/,""),a=0,o=i;case 1:if(!(a<o.length)){e.n=3;break}if(!o[a].test(n)){e.n=2;break}return e.a(2,null);case 2:a++,e.n=1;break;case 3:if(!["image","video"].includes(t.media_class)){e.n=5;break}if(!ev.exclude_media_types||!ev.exclude_media_types.includes(t.media_class)){e.n=4;break}return e.a(2,null);case 4:return e.a(2,t.media_content_id);case 5:if("directory"!=t.media_class){e.n=7;break}return e.n=6,r.findMedias(t.media_content_id);case 6:return e.a(2,e.v);case 7:return e.a(2,null)}},e)}));return function(t){return e.apply(this,arguments)}}()),e.n=3,Promise.all(l);case 3:return f=e.v,e.a(2,f.flat().filter(function(e){return null!==e}));case 4:throw e.p=4,h=e.v,Av.warn("Error browsing media ".concat(t,":"),h),h;case 5:return e.a(2)}},e,this,[[1,4]])})),function(e){return T.apply(this,arguments)})},{key:"updateMediaListFromMediaSource",value:(I=n(p().m(function e(){var t,n,r,i;return p().w(function(e){for(;;)switch(e.n){case 0:return t=ev.image_url,n=this,e.p=1,e.n=2,n.findMedias(t);case 2:r=e.v,(r="random"==ev.media_order?xv(r):r.sort()).length>ev.media_list_max_size&&(Av.info("Using only ".concat(ev.media_list_max_size," of ").concat(r.length," media items")),r=r.slice(0,ev.media_list_max_size)),n.mediaList=r,e.n=4;break;case 3:throw e.p=3,i=e.v,new Error("Failed to update image list from ".concat(ev.image_url,": ").concat(i.message||bv(i)));case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return I.apply(this,arguments)})},{key:"updateMediaListFromUnsplashAPI",value:(C=n(p().m(function e(){var t,n,r,i,a,o,s;return p().w(function(e){for(;;)switch(e.n){case 0:return t=[],n="".concat(ev.image_url,"&count=30"),Av.debug("Unsplash API request: ".concat(n)),e.p=1,r={method:"GET",headers:{Accept:"application/json"}},"undefined"!=typeof AbortSignal&&void 0!==AbortSignal.timeout&&(Av.debug("Using AbortSignal"),r.signal=AbortSignal.timeout(1e4)),e.n=2,fetch(n,r);case 2:if((i=e.v).ok){e.n=4;break}return e.n=3,i.text();case 3:throw a=e.v,new Error("Unsplash API request failed: ".concat(i.status," ").concat(i.statusText," - ").concat(a));case 4:return e.n=5,i.json();case 5:o=e.v,Av.debug("Got Unsplash API response"),o.forEach(function(e){Av.debug(e);var n="".concat(e.urls.raw,"&w=${width}&h=${height}&auto=format");t.push(n),uv(n,e)}),this.mediaList=t,e.n=8;break;case 6:if(e.p=6,"AbortError"!==(s=e.v).name){e.n=7;break}throw new Error("Unsplash API request timed out: ".concat(n));case 7:throw s;case 8:return e.a(2)}},e,this,[[1,6]])})),function(){return C.apply(this,arguments)})},{key:"_immichFetch",value:(k=n(p().m(function e(t,n){var r,i,a,o,s,c,u=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>2&&void 0!==u[2]?u[2]:{},(a=d(d({},i={headers:{"x-api-key":n,"Content-Type":"application/json",Accept:"application/json"}}),r)).headers=d(d({},i.headers),r.headers),"undefined"!=typeof AbortSignal&&void 0!==AbortSignal.timeout&&(Av.debug("Using AbortSignal"),a.signal=AbortSignal.timeout(1e4)),Av.debug("Immich API request: ".concat(t)),e.p=1,e.n=2,fetch(t,a);case 2:if((o=e.v).ok){e.n=4;break}return e.n=3,o.text();case 3:throw s=e.v,new Error("Immich API request failed: ".concat(o.status," ").concat(o.statusText," - ").concat(s));case 4:return e.n=5,o.json();case 5:return e.a(2,e.v);case 6:if(e.p=6,"AbortError"!==(c=e.v).name){e.n=7;break}throw new Error("Immich API request timed out: ".concat(t));case 7:throw c;case 8:return e.a(2)}},e,null,[[1,6]])})),function(e,t){return k.apply(this,arguments)})},{key:"updateMediaListFromImmichAPI",value:(S=n(p().m(function e(){var t,r,i,a,o,c,u,l,f,h,d,v,g,y,b,A,w,_,x,E;return p().w(function(e){for(;;)switch(e.n){case 0:if(b=function(){0==a.length&&Av.error("No matching media assets found"),(a="random"==ev.media_order?xv(a):a.sort()).length>ev.media_list_max_size&&(Av.info("Using only ".concat(ev.media_list_max_size," of ").concat(a.length," media items")),a=a.slice(0,ev.media_list_max_size)),a.forEach(function(e){uv(e,o[e])}),t.mediaList=a},y=function(){return y=n(p().m(function e(t,n){var r,l,f,h,v,m,g,y,b,A,w,_,x,E,S,k=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:return r=k.length>2&&void 0!==k[2]?k[2]:null,e.n=1,d(t,n);case 1:l=s(t),e.p=2,l.s();case 3:if((f=l.n()).done){e.n=11;break}if(h=f.value,Av.debug("Processing immich asset",h),v=h.type.toLowerCase(),["image","video"].includes(v)){e.n=4;break}return Av.debug("Neither image nor video, skipping"),e.a(3,10);case 4:if(!ev.exclude_media_types||!ev.exclude_media_types.includes(v)){e.n=5;break}return Av.debug('Media type "'.concat(v,'" excluded')),e.a(3,10);case 5:m=!1,g=s(u);try{for(g.s();!(y=g.n()).done;)(b=y.value).test(h.originalFileName)&&(Av.debug('Media item excluded by regex "'.concat(b,'"')),m=!0)}catch(e){g.e(e)}finally{g.f()}if(!m){e.n=6;break}return e.a(3,10);case 6:if(!ev.immich_exclude_tag_names||!ev.immich_exclude_tag_names.length){e.n=7;break}if(!((A=h.tags.filter(function(e){return ev.immich_exclude_tag_names.includes(e)})).length>0)){e.n=7;break}return Av.debug("Media item excluded due to tag(s): ".concat(A.join(", "))),e.a(3,10);case 7:if(!(i&&h.exifInfo&&h.exifInfo.exifImageWidth&&h.exifInfo.exifImageHeight)){e.n=8;break}if(w=h.exifInfo.exifImageWidth>=h.exifInfo.exifImageHeight?"landscape":"portrait",h.exifInfo.orientation&&[5,6,7,8].includes(parseInt(h.exifInfo.orientation))&&(w="landscape"==w?"portrait":"landscape"),w!==i){e.n=8;break}return Av.debug('Media item with orientation "'.concat(w,'" excluded')),e.a(3,10);case 8:if(_="original","preview"==ev.immich_resolution&&(_="video"==v?"video/playback":"thumbnail?size=preview"),x="".concat(c,"/assets/").concat(h.id,"/").concat(_),!(a.indexOf(x)>=0)){e.n=9;break}return e.a(3,10);case 9:a.push(x),(E=h.exifInfo||{}).immichApiKey=n,E.mediaType=v,E.image={filename:h.originalFileName,folderName:r},o[x]=E;case 10:e.n=3;break;case 11:e.n=13;break;case 12:e.p=12,S=e.v,l.e(S);case 13:return e.p=13,l.f(),e.f(13);case 14:return e.a(2)}},e,null,[[2,12,13,14]])})),y.apply(this,arguments)},g=function(e,t){return y.apply(this,arguments)},v=function(){return v=n(p().m(function e(r,i){var a;return p().w(function(e){for(;;)switch(e.n){case 0:return a=ev.immich_exclude_tag_names&&ev.immich_exclude_tag_names.length,e.n=1,Promise.all(r.map(function(){var e=n(p().m(function e(n){var r;return p().w(function(e){for(;;)switch(e.n){case 0:if(n.exifInfo&&(!a||n.tags)){e.n=2;break}return Av.debug("Fetching asset info for ".concat(n.id)),e.n=1,t._immichFetch("".concat(c,"/assets/").concat(n.id),i);case 1:r=e.v,n.exifInfo=r.exifInfo,n.tags=r.tags.map(function(e){return e.value});case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()));case 1:return e.a(2)}},e)})),v.apply(this,arguments)},d=function(e,t){return v.apply(this,arguments)},ev.immich_api_keys&&ev.immich_api_keys.length){e.n=1;break}throw new Error("No immich_api_key configured");case 1:if(t=this,r=this.screensaverContainer.clientWidth>=this.screensaverContainer.clientHeight?"landscape":"portrait","auto"==(i=ev.exclude_media_orientation)&&(i="landscape"==r?"portrait":"landscape"),Av.debug("config.exclude_media_orientation=".concat(ev.exclude_media_orientation,", screenOrientation=").concat(r,", exclude_media_orientation=").concat(i)),a=[],o={},c=ev.image_url.replace(/^immich\+/,""),u=[],ev.exclude_filenames){l=s(ev.exclude_filenames);try{for(l.s();!(f=l.n()).done;)h=f.value,u.push(new RegExp(h))}catch(e){l.e(e)}finally{l.f()}}e.p=2,A=s(ev.immich_api_keys),e.p=3,_=p().m(function e(){var r,i,a,o,u,l,f,h,d,v,m,y,b,A,_,x,E,S,k,C,I,T,O,R,P,M,L,B,U,F,D,N,j,W,z;return p().w(function(e){for(;;)switch(e.n){case 0:if(r=w.value,Av.debug("Using immich API key ".concat(r)),!ev.immich_persons||!ev.immich_persons.length){e.n=16;break}Av.debug("Searching for assets based on persons"),i=ev.immich_persons.map(function(e){return(Array.isArray(e)?e:[e]).map(function(e){return e.toLowerCase()})}),a={},o=[],u=1,l=!0;case 1:if(!l){e.n=3;break}return e.n=2,t._immichFetch("".concat(c,"/people?size=1000&page=").concat(u),r);case 2:f=e.v,o=o.concat(f.people),l=f.hasNextPage,u++,e.n=1;break;case 3:o.forEach(function(e){a[e.name.toLowerCase()]=e.id}),h=s(i),e.p=4,h.s();case 5:if((d=h.n()).done){e.n=12;break}if(v=d.value,!((m=v.map(function(e){return a[e]}).filter(function(e){return e||Av.error("Person not found in immich: ".concat(name)),!!e})).length>0)){e.n=11;break}Av.debug("Searching asset metadata for persons: ",m),y=1;case 6:return Av.debug("Fetching asset metadata page ".concat(y)),e.n=7,t._immichFetch("".concat(c,"/search/metadata"),r,{method:"POST",body:JSON.stringify({personIds:m,withExif:!0,page:y,size:1e3})});case 7:if(b=e.v,Av.debug("Got immich API response",b),b.assets.count){e.n=8;break}return 1==y&&(A="No media items found in immich that contain all these people: ".concat(v),Av.error(A)),e.a(3,11);case 8:return e.n=9,g(b.assets.items,r);case 9:if(b.assets.nextPage){e.n=10;break}return e.a(3,11);case 10:y=b.assets.nextPage,e.n=6;break;case 11:e.n=5;break;case 12:e.n=14;break;case 13:e.p=13,W=e.v,h.e(W);case 14:return e.p=14,h.f(),e.f(14);case 15:e.n=47;break;case 16:if(!ev.immich_memories){e.n=19;break}return Av.debug("Fetching immich memories (on_this_day)"),e.n=17,t._immichFetch("".concat(c,"/memories?type=on_this_day"),r);case 17:return _=e.v,Av.debug("Got immich API response",_),x=new Date,E=_.filter(function(e){var t=new Date(e.showAt),n=new Date(e.hideAt);return x>=t&&x<=n}),Av.debug("Found ".concat(E.length," visible memories")),e.n=18,Promise.all(E.map(function(){var e=n(p().m(function e(t){return p().w(function(e){for(;;)switch(e.n){case 0:return Av.debug("Processing memory:",t),e.n=1,g(t.assets,r);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()));case 18:e.n=47;break;case 19:if(!ev.immich_favorites){e.n=26;break}Av.debug("Search for favorites in asset metadata"),S=1;case 20:return Av.debug("Fetching asset metadata page ".concat(S)),e.n=21,t._immichFetch("".concat(c,"/search/metadata"),r,{method:"POST",body:JSON.stringify({isFavorite:!0,withExif:!0,page:S,size:1e3})});case 21:if(k=e.v,Av.debug("Got immich API response",k),k.assets.count){e.n=22;break}return 1==S&&Av.error("No favorite media items found in immich"),e.a(3,25);case 22:return e.n=23,g(k.assets.items,r);case 23:if(k.assets.nextPage){e.n=24;break}return e.a(3,25);case 24:S=k.assets.nextPage,e.n=20;break;case 25:e.n=47;break;case 26:if(!ev.immich_tag_names||!ev.immich_tag_names.length){e.n=36;break}return Av.debug("Searching for assets based on tag names"),C=ev.immich_tag_names.map(function(e){return e.toLowerCase()}),Av.debug("Fetching immich tags"),e.n=27,t._immichFetch("".concat(c,"/tags"),r);case 27:if(I=e.v,Av.debug("Got immich API response",I),!((T=I.filter(function(e){var t=C.includes(e.name.toLowerCase());return Av.debug("".concat(t?"Adding":"Skipping"," tag: ").concat(e.name)),t}).map(function(e){return e.id})).length>0)){e.n=34;break}Av.debug("Searching asset metadata for tags: ",T),O=1;case 28:return Av.debug("Fetching asset metadata page ".concat(O)),e.n=29,t._immichFetch("".concat(c,"/search/metadata"),r,{method:"POST",body:JSON.stringify({tagIds:T,withExif:!0,page:O,size:1e3})});case 29:if(R=e.v,Av.debug("Got immich API response",R),R.assets.count){e.n=30;break}return 1==O&&(P="No media items found in immich that contain these tags: ".concat(C),Av.error(P)),e.a(3,33);case 30:return e.n=31,g(R.assets.items,r);case 31:if(R.assets.nextPage){e.n=32;break}return e.a(3,33);case 32:O=R.assets.nextPage,e.n=28;break;case 33:e.n=35;break;case 34:Av.error("No matching immich tags found or selected.");case 35:e.n=47;break;case 36:return Av.debug("Searching for assets based on albums"),M=(ev.immich_album_names||[]).map(function(e){return e.toLowerCase()}),Av.debug("Fetching immich albums (shared=".concat(ev.immich_shared_albums,")")),e.n=37,t._immichFetch("".concat(c,"/albums?shared=").concat(ev.immich_shared_albums),r);case 37:if(L=e.v,Av.debug("Got immich API response",L),!((B=L.filter(function(e){var t=!M.length||M.includes(e.albumName.toLowerCase());return Av.debug("".concat(t?"Adding":"Skipping"," album: ").concat(e.albumName)),t}).map(function(e){return e.id})).length>0)){e.n=46;break}return U=B.map(function(e){return Av.debug("Fetching album metadata: ",e),t._immichFetch("".concat(c,"/albums/").concat(e),r)}),e.n=38,Promise.all(U);case 38:F=e.v,D=s(F),e.p=39,D.s();case 40:if((N=D.n()).done){e.n=42;break}return j=N.value,Av.debug("Got immich album details",j),e.n=41,g(j.assets,r,j.albumName);case 41:e.n=40;break;case 42:e.n=44;break;case 43:e.p=43,z=e.v,D.e(z);case 44:return e.p=44,D.f(),e.f(44);case 45:e.n=47;break;case 46:Av.debug("No matching immich albums found or selected.");case 47:return e.a(2)}},e,null,[[39,43,44,45],[4,13,14,15]])}),A.s();case 4:if((w=A.n()).done){e.n=6;break}return e.d(m(_()),5);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,x=e.v,A.e(x);case 8:return e.p=8,A.f(),e.f(8);case 9:b(),e.n=11;break;case 10:throw e.p=10,E=e.v,Av.error("Immich API processing failed:",E),E;case 11:return e.a(2)}},e,this,[[3,7,8,9],[2,10]])})),function(){return S.apply(this,arguments)})},{key:"fillPlaceholders",value:function(e){var t=this.screensaverContainer.clientWidth,n=this.screensaverContainer.clientHeight,r=Date.now(),i=Math.floor(r/1e3);return(e=(e=(e=e.replace(/\${width}/g,t)).replace(/\${height}/g,n)).replace(/\${timestamp_ms}/g,r)).replace(/\${timestamp}/g,i)}},{key:"updateMediaFromUrl",value:(E=n(p().m(function e(t,r){var i,a,o,s,c,u,l=this,f=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:if(i=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3&&void 0!==f[3]?f[3]:null,o=f.length>4&&void 0!==f[4]&&f[4],ev.force_load_media_with_fetch&&(o=!0),s=function(){var e=n(p().m(function e(t){var n,i,s,c,u;return p().w(function(e){for(;;)switch(e.n){case 0:if(n=t.tagName.toLowerCase(),i={img:"load",video:"loadeddata",iframe:"load",embed:"load"}[n]){e.n=1;break}throw new Error('Unsupported element tag "'.concat(t.tagName,'"'));case 1:if(s=new Promise(function(e,n){var a=function(){t.onerror=null,t.removeEventListener(i,o)},o=function(){a(),e()};t.addEventListener(i,o),t.onerror=function(){a(),n(new Error("Failed to load ".concat(t.tagName,' "').concat(r,'"')))}}),!o){e.n=7;break}if(!ev.stream_load_media){e.n=2;break}fetch(r,{headers:a}).then(function(e){if(!e.ok)throw new Error("Failed to load ".concat(t.tagName,' "').concat(r,'": ').concat(e));if(!e.body)throw new Error("Failed to load ".concat(t.tagName,' "').concat(r,'": empty body'));var n=e.body.getReader();return new ReadableStream({start:function(e){return function t(){return n.read().then(function(n){var r=n.done,i=n.value;if(!r)return e.enqueue(i),t();e.close()})}()}})}).then(function(e){return new Response(e)}).then(function(e){return e.blob()}).then(function(e){"string"==typeof t.src&&t.src.startsWith("blob:")&&URL.revokeObjectURL(t.src),t.src=URL.createObjectURL(e)}),e.n=6;break;case 2:return a=a||{},e.n=3,fetch(r,{headers:a});case 3:if(c=e.v,Av.debug("Got respone",c),c.ok){e.n=4;break}throw new Error("Failed to load ".concat(t.tagName,' "').concat(r,'": ').concat(c));case 4:return"string"==typeof t.src&&t.src.startsWith("blob:")&&URL.revokeObjectURL(t.src),e.n=5,c.blob();case 5:u=e.v,t.src=URL.createObjectURL(u);case 6:e.n=8;break;case 7:t.src=r;case 8:return e.a(2,s)}},e)}));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=n(p().m(function e(t){var n,r,i,a,o=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:null,(n=o.length>1&&void 0!==o[1]?o[1]:null)||(n="img"===t.tagName.toLowerCase()?"video":"img"),i=l.replaceMediaElement(t,n),e.p=1,e.n=2,s(i);case 2:return e.a(2,i);case 3:throw e.p=3,a=e.v,r||a;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),u=function(){var e=n(p().m(function e(t,n){var r;return p().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,s(t);case 1:return e.a(2,t);case 2:if(e.p=2,r=e.v,!n){e.n=4;break}return e.n=3,c(t,null,r);case 3:return e.a(2,e.v);case 4:throw r;case 5:return e.a(2)}},e,null,[[0,2]])}));return function(t,n){return e.apply(this,arguments)}}(),i){e.n=2;break}return e.n=1,u(t,!0);case 1:case 3:case 5:return e.a(2,e.v);case 2:if(i!==t.tagName.toLowerCase()){e.n=4;break}return e.n=3,u(t,!1);case 4:return e.n=5,c(t,i);case 6:return e.a(2)}},e)})),function(e,t){return E.apply(this,arguments)})},{key:"getNextMediaURL",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mediaList.length)return null;var t=this.mediaIndex;return"forwards"==this.mediaListDirection?t++:t--,t>=this.mediaList.length?t=0:t<0&&(t=this.mediaList.length-1),e&&(this.mediaIndex=t),this.mediaList[t]}},{key:"updateMediaFromMediaSource",value:(x=n(p().m(function e(t){var n,r,i,a,o;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hass.callWS({type:"media_source/resolve_media",media_content_id:t.mediaUrl});case 1:return r=e.v,i=null===(n=r.mime_type)||void 0===n?void 0:n.match(/^(image|video)\//),a={image:"img",video:"video"}[null==i?void 0:i[1]]||null,(o=r.url).startsWith("http://")||o.startsWith("https://")||(o="".concat(document.location.origin).concat(o)),Av.debug("Setting image src: ".concat(o)),t.mediaUrl=o,e.n=2,this.updateMediaFromUrl(t,t.mediaUrl,a);case 2:return e.a(2,e.v)}},e,this)})),function(e){return x.apply(this,arguments)})},{key:"updateMediaFromImmichAPI",value:(_=n(p().m(function e(t){var n,r;return p().w(function(e){for(;;)switch(e.n){case 0:return n=cv.get(t.mediaUrl)||{},r="video"==n.mediaType?"video":"img",e.n=1,this.updateMediaFromUrl(t,t.mediaUrl,r,{"x-api-key":n.immichApiKey},!0);case 1:return e.a(2,e.v)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"updateMediaFromMediaEntity",value:(A=n(p().m(function e(t){var r,i,a,o,s,c,u;return p().w(function(e){for(;;)switch(e.n){case 0:if(s=function(){"media_exif"in o.attributes?uv(t.infoCacheUrl,o.attributes.media_exif):uv(t.infoCacheUrl,o.attributes)},r=t.mediaUrl.match(/^media-entity-(image|video):\/\/(.*)/)){e.n=1;break}throw new Error('Invalid URL "'.concat(t.mediaUrl,'"'));case 1:if(i=r[1],a=r[2],o=this.hass.states[a]){e.n=2;break}throw new Error('Entity "'.concat(a,'" not available'));case 2:if(fv=o.state,"video"!=i){e.n=3;break}return t.infoCacheUrl=t.mediaUrl,s(),(t=this.replaceMediaElement(t,"ha-camera-stream")).style.visibility="hidden",Object.assign(t,{hass:this.__hass,stateObj:this.__hass.states[a],"allow-exoplayer":!1,controls:!1}),e.a(2,new Promise(function(e,r){var i=0;function a(e){return o.apply(this,arguments)}function o(){return(o=n(p().m(function t(n){var o,s,c,u,l,f;return p().w(function(t){for(;;)switch(t.n){case 0:return(o=n.currentTarget).removeEventListener("load",a),t.n=1,o.updateComplete;case 1:if(s=Ev(o),c=y(s,2),u=c[0],l=c[1],u&&l){t.n=3;break}if(!(++i<=20)){t.n=2;break}return setTimeout(function(){return a(n)},100),t.a(2);case 2:return r(new Error("Failed to initialize camera stream player")),t.a(2);case 3:u.style.height="100%",l.autoplay=!1,l.muted=!1,l.volume=ev.video_volume,l.style.maxHeight="100%",l.style.height="100%",l.readyState>=l.HAVE_ENOUGH_DATA?e(o):(f=function(){l.removeEventListener("canplay",f),e(o)},l.addEventListener("canplay",f));case 4:return t.a(2)}},t)}))).apply(this,arguments)}t.addEventListener("load",a)}));case 3:if(o.attributes&&o.attributes.entity_picture){e.n=4;break}throw new Error('Entity "'.concat(a,'" has no entity_picture attribute'));case 4:return c=o.attributes.entity_picture,u=c.indexOf("?")>0?"&":"?",u+=this.fillPlaceholders("width=${width}&height=${height}&ts=${timestamp_ms}"),t.mediaUrl=c+u,t.infoCacheUrl=t.mediaUrl,s(),e.n=5,this.updateMediaFromUrl(t,t.mediaUrl,"img",null,!0);case 5:return e.a(2,e.v);case 6:return e.a(2)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"updateMediaFromUnsplashAPI",value:(g=n(p().m(function e(t){var n;return p().w(function(e){for(;;)switch(e.n){case 0:return n=cv.get(t.mediaUrl),t.mediaUrl=this.fillPlaceholders(t.mediaUrl),n&&uv(t.mediaUrl,n),e.n=1,this.updateMediaFromUrl(t,t.mediaUrl,"img");case 1:return e.a(2,e.v)}},e,this)})),function(e){return g.apply(this,arguments)})},{key:"updateMediaFromMediaIframe",value:(v=n(p().m(function e(t){return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.updateMediaFromUrl(t,t.mediaUrl,"iframe");case 1:return e.a(2,e.v)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"updateMediaFromMediaEmbed",value:(h=n(p().m(function e(t){return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.updateMediaFromUrl(t,t.mediaUrl,"embed");case 1:return e.a(2,e.v)}},e,this)})),function(e){return h.apply(this,arguments)})},{key:"updateMediaFromOtherSrc",value:(f=n(p().m(function e(t){return p().w(function(e){for(;;)switch(e.n){case 0:return t.mediaUrl=this.fillPlaceholders(t.mediaUrl),e.n=1,this.updateMediaFromUrl(t,t.mediaUrl);case 1:return e.a(2,e.v)}},e,this)})),function(e){return f.apply(this,arguments)})},{key:"updateMedia",value:(u=n(p().m(function e(t){var n,r,i,a,o,s,c;return p().w(function(e){for(;;)switch(e.n){case 0:if(ev.show_images){e.n=1;break}return e.a(2);case 1:if(this.updatingMedia=!0,e.p=2,t==this.getActiveMediaElement())if("video"===(n=this.getInactiveMediaElement()).tagName.toLowerCase())try{n.pause()}catch(e){Av.debug(e)}else if("ha-camera-stream"===n.tagName.toLowerCase())try{r=Ev(n),i=y(r,2),a=i[0],(o=i[1])&&o.pause(),a&&"function"==typeof a.stop&&a.stop()}catch(e){Av.debug(e)}if(t.mediaUrl=this.getNextMediaURL(),t.mediaUrl){e.n=3;break}return e.a(2);case 3:if(t.infoCacheUrl=t.mediaUrl,"media-source"!=Ov()){e.n=5;break}return e.n=4,this.updateMediaFromMediaSource(t);case 4:t=e.v,e.n=17;break;case 5:if("unsplash-api"!=Ov()){e.n=7;break}return e.n=6,this.updateMediaFromUnsplashAPI(t);case 6:t=e.v,e.n=17;break;case 7:if("immich-api"!=Ov()){e.n=9;break}return e.n=8,this.updateMediaFromImmichAPI(t);case 8:t=e.v,e.n=17;break;case 9:if(!Ov().startsWith("media-entity")){e.n=11;break}return e.n=10,this.updateMediaFromMediaEntity(t);case 10:t=e.v,e.n=17;break;case 11:if("iframe"!=Ov()){e.n=13;break}return e.n=12,this.updateMediaFromMediaIframe(t);case 12:t=e.v,e.n=17;break;case 13:if("embed"!=Ov()){e.n=15;break}return e.n=14,this.updateMediaFromMediaEmbed(t);case 14:t=e.v,e.n=17;break;case 15:return e.n=16,this.updateMediaFromOtherSrc(t);case 16:t=e.v;case 17:if(!t){e.n=19;break}if(t.style.visibility="visible",!(s="video"===t.tagName.toLowerCase())){e.n=18;break}return e.n=18,new Promise(function(e,n){if(t.readyState>=t.HAVE_ENOUGH_DATA)e();else{var r=function(){t.removeEventListener("canplay",r),t.removeEventListener("error",i),e()},i=function(){t.removeEventListener("canplay",r),t.removeEventListener("error",i),n(new Error("Video failed to load"))};t.addEventListener("canplay",r),t.addEventListener("error",i)}});case 18:"image"===ev.image_background&&this.loadBackgroundImage(t),!s&&ev.show_image_info&&/.*\.jpe?g$/i.test(t.mediaUrl.split("?")[0].replace(/\/*$/,""))&&this.fetchEXIFInfo(t);case 19:e.n=21;break;case 20:e.p=20,c=e.v,Av.error("Failed to update media from ".concat(t.mediaUrl,":"),c);case 21:return e.p=21,this.updatingMedia=!1,e.f(21);case 22:return e.a(2,t)}},e,this,[[2,20,21,22]])})),function(e){return u.apply(this,arguments)})},{key:"setMediaDimensions",value:function(){if(ev.calculate_media_size){var e=this.getActiveMediaElement(),t=this.getActiveMediaElement(!0);if(Av.debug("Setting dimensions for media element",e),e.mediaUrl){var n=t.tagName.toLowerCase(),r=0,i=0;"video"===n?(r=t.videoWidth,i=t.videoHeight):"img"===n&&(r=t.naturalWidth,i=t.naturalHeight);var a=!r||!i||r>=i?ev.image_fit_landscape:ev.image_fit_portrait;e.style.position="absolute",e.style.left="0px",e.style.top="0px",e.style.objectFit=a;var o=this.screensaverContainer.clientWidth,s=this.screensaverContainer.clientHeight,c=s,u=o,l=0,f=0,h=0,d=0;if(Av.debug("Available size is ".concat(o,"x").concat(s,", media size is ").concat(r,"x").concat(i)),r&&i){var p=o/r,v=s/i,m=o-r*v,g=s-i*p;Av.debug("Diff is ".concat(m,"x").concat(g)),"contain"==a&&m<g||"cover"==a&&m>=g?(Av.debug("Using available width"),u=o,c=Math.floor(i*p),h="top"==ev.media_vertical_align?0:"bottom"==ev.media_vertical_align?s-c:Math.floor((c-s)/-2),l=Math.max(c-s,0)):(Av.debug("Using available height"),c=s,u=Math.floor(r*v),d="left"==ev.media_horizontal_align?0:"right"==ev.media_horizontal_align?o-u:Math.floor((u-o)/-2),f=Math.max(u-o,0))}else"iframe"!==n&&"embed"!==n&&Av.warn("Size not available for media element",t);Av.debug("Setting dimensions: size=".concat(u,"x").concat(c," - position=").concat(d,"x").concat(h," - hidden=").concat(f,"x").concat(l)),e.style.width="".concat(u,"px"),e.style.height="".concat(c,"px"),e.style.top="".concat(h,"px"),e.style.left="".concat(d,"px"),e.style.setProperty("--hidden-width",f),e.style.setProperty("--hidden-height",l)}}}},{key:"startPlayingActiveMedia",value:function(){var e=this,t=this.getActiveMediaElement(),n=this.getActiveMediaElement(!0);if("function"==typeof n.play){var r=function(){n._wp_video_playback_listeners&&(Object.entries(n._wp_video_playback_listeners).forEach(function(e){var t=y(e,2),r=t[0],i=t[1];n.removeEventListener(r,i)}),n._wp_video_playback_listeners=null)};n.loop=ev.video_loop,ev.video_loop||n._wp_video_playback_listeners||(n._wp_video_playback_listeners={timeupdate:function(){e.getActiveMediaElement()===n?n.currentTime>ev.crossfade_time&&n.duration-n.currentTime<=ev.crossfade_time&&(e.switchActiveMedia("display_time_elapsed"),r()):r()},ended:function(){e.getActiveMediaElement()===n&&e.switchActiveMedia("media_end"),r()},pause:function(){r()}},Object.entries(n._wp_video_playback_listeners).forEach(function(e){var t=y(e,2),r=t[0],i=t[1];n.addEventListener(r,i)})),n.play().catch(function(i){r(),t===e.getActiveMediaElement()&&Av.error('Failed to play media "'.concat(t.mediaUrl,'" (src=').concat(n.src,"):"),i)})}}},{key:"switchActiveMedia",value:(c=n(p().m(function e(t){var n,r,i,a,o,s,c;return p().w(function(e){for(;;)switch(e.n){case 0:if(this.afterFadeoutTimer&&clearTimeout(this.afterFadeoutTimer),!(n=Ov()).startsWith("media-entity")){e.n=7;break}if(r=ev.image_url.replace(/^media-entity-(image|video):\/\//,""),i=this.hass.states[r]){e.n=1;break}return Av.error('Media entity "'.concat(r,'" not available')),e.a(2);case 1:if(fv==i.state){e.n=2;break}Av.debug("Media entity ".concat(r," state has changed")),e.n=6;break;case 2:if("entity_update"!=t){e.n=3;break}return e.a(2);case 3:if("start"!=t&&"user_action"!=t){e.n=4;break}Av.debug("Media entity ".concat(r," state unchanged, but eventType = ").concat(t)),e.n=6;break;case 4:if(!ev.media_entity_load_unchanged){e.n=5;break}Av.debug("Media entity ".concat(r," state unchanged, but media_entity_load_unchanged = true")),e.n=6;break;case 5:return this.lastMediaUpdate=Date.now(),this.restartProgressBarAnimation(),e.a(2);case 6:fv=i.state;case 7:if(this.lastMediaUpdate=Date.now(),a=this.getActiveMediaElement(),"iframe"!==n&&"embed"!==n||ev.iframe_load_unchanged||this.getNextMediaURL(!1)!=a.mediaUrl){e.n=8;break}return e.a(2);case 8:return o=0,"start"!=t&&(ev.crossfade_time>0&&(o=Math.round(1e3*ev.crossfade_time)),"user_action"==t&&o>250&&(o=250)),s=this.getInactiveMediaElement(),e.n=9,this.updateMedia(s);case 9:if(c=e.v){e.n=10;break}return e.a(2);case 10:this._switchActiveMedia(c,o);case 11:return e.a(2)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"_switchActiveMedia",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.lastMediaUpdate=Date.now(),this.imageOneContainer.style.transition="opacity ".concat(t,"ms ease-in-out"),this.imageTwoContainer.style.transition="opacity ".concat(t,"ms ease-in-out");var n=this.imageOneContainer,r=this.imageTwoContainer,i=this.imageOne,a=this.imageTwo;e==this.imageOne&&(n=this.imageTwoContainer,r=this.imageOneContainer,i=this.imageTwo,a=this.imageOne),Av.debug("Switching active media to '".concat(r.id,"'")),1!=r.style.opacity&&(r.style.opacity=1),0!=n.style.opacity&&(n.style.opacity=0),"iframe"==a.tagName.toLowerCase()&&ev.iframe_interaction?a.style.pointerEvents="auto":a.style.pointerEvents="none",this.setMediaDataInfo(),this.setMediaDimensions(),this.setImageURLEntityState(),this.startPlayingActiveMedia(),this.restartProgressBarAnimation(),this.restartKenBurnsEffect(),"video"===i.tagName.toLowerCase()&&(this.afterFadeoutTimer=setTimeout(function(){if("video"===i.tagName.toLowerCase())try{i.pause()}catch(e){Av.debug(e)}},t))}},{key:"showMessage",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;if(this.messageContainer){var i=document.createElement("div");i.className="wallpanel-message ".concat(e);var a=document.createElement("div");a.className="wallpanel-message-title",a.textContent=t,i.appendChild(a);var o=document.createElement("div");o.className="wallpanel-message-text",o.textContent=n,i.appendChild(o),this.messageContainer.appendChild(i),requestAnimationFrame(function(){return i.classList.add("show")});var s=this;setTimeout(function(){return s.hideMessage(i)},r)}}},{key:"hideMessage",value:function(e){e.classList.remove("show"),e.addEventListener("transitionend",function(){return e.remove()})}},{key:"hideAllMessages",value:function(){var e=this.messageContainer.querySelectorAll(".wallpanel-message");if(!e.length)return!1;var t=this;return e.forEach(function(e){return t.hideMessage(e)}),!0}},{key:"setupScreensaver",value:function(){Av.debug("Setup screensaver"),ev.keep_screen_on_time>0&&!this.screenWakeLock.enabled&&this.screenWakeLock.enable(),ev.fullscreen&&!Uv()&&Fv()}},{key:"startScreensaver",value:(a=n(p().m(function e(){var t;return p().w(function(e){for(;;)switch(e.n){case 0:if(Av.debug("Start screensaver"),this.screensaverStartedAt=Date.now(),this.screensaverStoppedAt=null,this.currentWidth=this.screensaverContainer.clientWidth,this.currentHeight=this.screensaverContainer.clientHeight,this.setDefaultStyle(),kv(),Tv()){e.n=1;break}return Av.debug("Wallpanel not active, not starting screensaver"),this.screensaverStartedAt=null,this.screensaverStoppedAt=Date.now(),e.a(2);case 1:return this.getActiveMediaElement()==this.imageOne?(this.imageOneContainer.style.opacity=1,this.imageTwoContainer.style.opacity=0):(this.imageOneContainer.style.opacity=0,this.imageTwoContainer.style.opacity=1),e.n=2,this.switchActiveMedia("start");case 2:this.setupScreensaver(),ev.keep_screen_on_time>0&&(t=this,setTimeout(function(){t.screensaverRunning()&&!t.screenWakeLock.enabled&&(Av.warning("Keep screen on will not work because the user didn't interact with the document first. https://goo.gl/xX8pDD"),t.showMessage("info","Keep screen on","Please tap the screen for a moment to keep it awake and prevent it from turning off.",15e3))},2e3)),this.lastMove=Date.now(),this.lastMediaUpdate=Date.now(),document.documentElement.style.overflow="hidden",this.createInfoBoxContent(),this.style.visibility="visible",this.style.opacity=1,this.style.pointerEvents="auto",this.setScreensaverEntityState(),(ev.screensaver_start_navigation_path||ev.screensaver_stop_close_browser_mod_popup)&&(this.screensaverStopNavigationPathTimeout=setTimeout(function(){ev.screensaver_start_navigation_path&&(ov=!0,Bv(ev.screensaver_start_navigation_path),setTimeout(function(){ov=!1},5e3)),ev.screensaver_stop_close_browser_mod_popup&&Cv().forEach(function(e){e.closeDialog()})},1e3*(ev.fade_in_time+1)));case 3:return e.a(2)}},e,this)})),function(){return a.apply(this,arguments)})},{key:"screensaverRunning",value:function(){return Boolean(this.screensaverStartedAt)&&this.screensaverStartedAt>0}},{key:"stopScreensaver",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Av.debug("Stop screensaver"),this.screensaverStartedAt=null,this.screensaverStoppedAt=Date.now(),document.documentElement.style.removeProperty("overflow"),this.screensaverStopNavigationPathTimeout&&clearTimeout(this.screensaverStopNavigationPathTimeout),this.hideAllMessages(),this.debugBox.style.pointerEvents="none",this.style.transition=e>0?"opacity ".concat(Math.round(1e3*e),"ms ease-in-out"):"",this.style.opacity=0,this.style.visibility="hidden",this.style.pointerEvents="none",this.imageOneInfo.style.pointerEvents="none",this.imageTwoInfo.style.pointerEvents="none",this.infoBoxPosX.style.animation="",this.infoBoxPosY.style.animation="",this.idleSince=Date.now(),this.screenWakeLock.enabled&&this.screenWakeLock.disable(),setTimeout(this.setScreensaverEntityState.bind(this),25)}},{key:"updateScreensaver",value:function(){var e=new Date,t=e.getTime();if(this.energyCollectionUpdateEnabled&&t-this.lastEnergyCollectionUpdate>=1e3*this.energyCollectionUpdateInterval&&(this.hass.connection._energy_wallpanel&&this.hass.connection._energy_wallpanel.refresh(),this.lastEnergyCollectionUpdate=t),this.infoBoxContentCreatedDate&&this.infoBoxContentCreatedDate.getDate()!=e.getDate()&&this.createInfoBoxContent(),ev.info_move_interval>0&&t-this.lastMove>=1e3*ev.info_move_interval&&("random"===ev.info_move_pattern?this.randomMove():"corners"===ev.info_move_pattern?this.moveAroundCorners():Av.error("Unknown info move type ".concat(ev.info_move_pattern))),ev.black_screen_after_time>0&&t-this.screensaverStartedAt>=1e3*ev.black_screen_after_time?(Av.debug("Setting screen to black"),this.screensaverOverlay.style.background="#000000"):ev.show_images?(t-this.lastMediaUpdate>=1e3*ev.display_time&&this.switchActiveMedia("display_time_elapsed"),t-this.lastMediaListUpdate>=1e3*ev.media_list_update_interval&&this.updateMediaList(null,!0),"visible"!=this.imageOneContainer.style.visibility&&(this.imageOneContainer.style.visibility="visible"),"visible"!=this.imageOne.style.visibility&&(this.imageOne.style.visibility="visible"),"visible"!=this.imageTwoContainer.style.visibility&&(this.imageTwoContainer.style.visibility="visible"),"visible"!=this.imageTwo.style.visibility&&(this.imageTwo.style.visibility="visible")):("hidden"!=this.imageOneContainer.style.visibility&&(this.imageOneContainer.style.visibility="hidden"),"hidden"!=this.imageOne.style.visibility&&(this.imageOne.style.visibility="hidden"),"hidden"!=this.imageTwoContainer.style.visibility&&(this.imageTwoContainer.style.visibility="hidden"),"hidden"!=this.imageTwo.style.visibility&&(this.imageTwo.style.visibility="hidden")),ev.close_more_info_dialog_time>0){var n=this.getMoreInfoDialog();if(n){var r=new Date;this.moreInfoDialogOpenedAt?r-this.moreInfoDialogOpenedAt>=1e3*ev.close_more_info_dialog_time&&n.close():this.moreInfoDialogOpenedAt=r}else this.moreInfoDialogOpenedAt=0}if(ev.debug){var i="",a={};for(var o in ev)["profiles"].includes(o)?a[o]="...":a[o]=ev[o];if(i+='<a id="download_log" href="">Download log</a><br />',i+="<b>Version:</b> ".concat(Jp,"<br/>"),i+="<b>User-Agent:</b> ".concat(navigator.userAgent,"<br/>"),i+="<b>Config:</b> ".concat(JSON.stringify(a),"<br/>"),i+="<b>Fullscreen:</b> ".concat(Uv(),"<br/>"),i+="<b>Screensaver started at:</b> ".concat(av.screensaverStartedAt,"<br/>"),i+="<b>Screen wake lock:</b> enabled=".concat(this.screenWakeLock.enabled," native=").concat(this.screenWakeLock.nativeWakeLockSupported," lock=").concat(this.screenWakeLock._lock," player=").concat(this.screenWakeLock._player," error=").concat(this.screenWakeLock.error,"<br/>"),this.screenWakeLock._player){var s=this.screenWakeLock._player;i+="<b>Screen wake lock video</b>: readyState=".concat(s.readyState," currentTime=").concat(s.currentTime," paused=").concat(s.paused," ended=").concat(s.ended,"<br/>")}i+="<b>Media list size:</b> ".concat(this.mediaList.length,"<br/>");var c=this.getActiveMediaElement();if(c){i+="<b>Current media:</b> ".concat(c.mediaUrl,"<br/>");var u=cv.get(c.infoCacheUrl);u&&(i+="<b>Media info:</b> ".concat(JSON.stringify(u),"<br/>"))}this.debugBox.innerHTML!==i&&(this.debugBox.innerHTML=i,this.debugBox.querySelector("#download_log").addEventListener("click",function(e){Av.downloadMessages(),e.preventDefault()})),this.debugBox.scrollTop=this.debugBox.scrollHeight}this.screenWakeLock.enabled&&ev.keep_screen_on_time>0&&t-this.screensaverStartedAt>=1e3*ev.keep_screen_on_time&&(Av.info("Disable wake lock after ".concat(ev.keep_screen_on_time," seconds")),this.screenWakeLock.disable())}},{key:"switchMediaDirection",value:function(e){this.mediaListDirection=e,this.switchActiveMedia("user_action")}},{key:"setCameraMotionDetectionEntityState",value:function(e){var t=ev.camera_motion_detection_set_entity;t&&this.__hass.states[t]&&(Av.debug("Updating camera motion detection entity",t,e),this.__hass.callService("input_boolean",e?"turn_on":"turn_off",{entity_id:t}).then(function(e){Av.debug(e)},function(e){Av.error("Failed to set camera motion detection entity state:",e)}))}},{key:"motionDetected",value:function(){ev.camera_motion_detection_stop_screensaver&&this.stopScreensaver(ev.fade_out_time_motion_detected),this.setCameraMotionDetectionEntityState(!0)}},{key:"motionStopped",value:function(){this.setCameraMotionDetectionEntityState(!1)}},{key:"handleInteractionEvent",value:function(e){var t=["click","touchend"].includes(e.type),n=Date.now();this.idleSince=n;var r="";if("touchstart"!=e.type){if("touchend"==e.type&&this.touchStartX>=0&&e.changedTouches&&e.changedTouches[0]){var i=e.changedTouches[0].clientX-this.touchStartX;i>=5?r="right":i<=-5&&(r="left"),this.touchStartX=-1}if(!this.screensaverRunning())return this.blockEventsUntil>n&&(t&&e.preventDefault(),e.stopImmediatePropagation()),void(t&&this.setupScreensaver());if(t&&this.hideAllMessages())this.blockEventsUntil=n+1e3;else{var a=e.clientX,o=e.clientY;if(!a&&e.changedTouches&&e.changedTouches[0]&&(a=e.changedTouches[0].clientX),!o&&e.changedTouches&&e.changedTouches[0]&&(o=e.changedTouches[0].clientY),!(ev.debug&&a&&a<100&&o&&o<100)){var s=Iv();if(s)for(var c=[s.shadowRoot.querySelector(".content"),s.shadowRoot.querySelector("ha-dialog-header")],u=0;u<c.length;u++)if(c[u]){var l=c[u].getBoundingClientRect();if(Av.debug("Event position:",c[u],a,o,l.left,l.right,l.top,l.bottom),a>=l.left&&a<=l.right&&o>=l.top&&o<=l.bottom)return void Av.debug("Event on browser mod popup:",c[u])}if(!ev.iframe_interaction||"iframe"!=Ov()){if(ev.content_interaction){if(this.getMoreInfoDialog())return;var f=[];(f=(f=(f=f.concat(this.__cards||[])).concat(this.__badges||[])).concat(this.__views||[])).push(this.shadowRoot.getElementById("wallpanel-screensaver-info-box-content")),f.push(this.shadowRoot.getElementById("wallpanel-screensaver-fixed-info-box-content")),"analyze"==ev.image_info_template&&(f.push(this.imageOneInfo),f.push(this.imageTwoInfo));for(var h=0;h<f.length;h++){var d=f[h].getBoundingClientRect();if(Av.debug("Event position:",f[h],a,o,d.left,d.right,d.top,d.bottom),a>=d.left&&a<=d.right&&o>=d.top&&o<=d.bottom)return void Av.debug("Event on:",f[h])}}var p="";if(r)p="left"==r?"forwards":"backwards",e.stopImmediatePropagation();else if(e instanceof MouseEvent||"TouchEvent"in window&&e instanceof TouchEvent){var v=0,m=0,g=this.screensaverContainer.getBoundingClientRect();if(a&&(v=(g.right-a)/this.screensaverContainer.clientWidth),o&&(m=(g.bottom-o)/this.screensaverContainer.clientHeight),Av.debug("Event position screensaver:",a,o,g.left,g.right,g.top,g.bottom),m>1||m<0||v>1||v<0)return;if(t&&e.preventDefault(),e.stopImmediatePropagation(),ev.touch_zone_size_next_image>0&&v<=ev.touch_zone_size_next_image/100){if(!t)return;p="forwards"}else if(ev.touch_zone_size_previous_image>0&&v>=(100-ev.touch_zone_size_previous_image)/100){if(!t)return;p="backwards"}else if(v>=.4&&v<=.6&&m<=.1){var y=new Date;return t&&y-this.lastClickTime<500?(this.clickCount+=1,3==this.clickCount&&(Av.purgeMessages(),ev.debug=!ev.debug,this.debugBox.style.visibility=ev.debug?"visible":"hidden",this.debugBox.style.pointerEvents=ev.debug?"auto":"none")):this.clickCount=1,void(this.lastClickTime=y)}}p?this.updatingMedia?Av.debug("Already switching media"):(Av.debug("Switching media, direction ".concat(p)),this.mediaListDirection!=p?this.switchMediaDirection(p):this.switchActiveMedia("user_action")):t&&!ev.stop_screensaver_on_mouse_click||(this.blockEventsUntil=n+1e3*ev.control_reactivation_time,this.stopScreensaver(ev.fade_out_time_interaction))}}}}else e.touches&&e.touches[0]&&(this.touchStartX=e.touches[0].clientX)}}]);var a,c,u,f,h,v,g,A,_,x,E,S,k,C,I,T,O}(t);customElements.get("wallpanel-view-container")||customElements.define("wallpanel-view-container",a),customElements.get("wallpanel-view")||customElements.define("wallpanel-view",c),iv=document.createElement("wallpanel-view-container"),av=document.createElement("wallpanel-view"),iv.appendChild(av),dv.shadowRoot.appendChild(iv)}(),window.addEventListener("location-changed",function(e){var t=null;try{t=e.target.location.href}catch(e){Av.debug(e)}Av.debug("location-changed",t,e),setTimeout(Wv,20)}),window.navigation&&window.navigation.addEventListener("navigate",function(e){var t=null;try{t=e.destination.url}catch(e){Av.debug(e)}Av.debug("navigate",t,e),setTimeout(Wv,30)}),(hv.hass||hv.__hass).connection.subscribeEvents(function(e){Av.debug("lovelace_updated",e),(e.data.url_path?e.data.url_path:"lovelace")==nv&&(hv.hass||hv.__hass).connection.sendMessagePromise({type:"lovelace/config",url_path:e.data.url_path}).then(function(e){if(Kp={},e.wallpanel)for(var t in e.wallpanel)(t in Qp||t in Zp)&&(Kp[t]=e.wallpanel[t]);jv()})},"lovelace_updated"),setTimeout(Wv,0)})}catch(e){Av.error(e.stack)}var Gv=!1,Hv=function(e){return e instanceof Hv?e:this instanceof Hv?void(this.EXIFwrapped=e):new Hv(e)},Yv=Hv.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},Vv=Hv.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},qv=Hv.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},Xv=Hv.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},$v=Hv.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};function Jv(e){return!!e.exifdata}function Qv(e,t){function n(n){var r=Zv(n);e.exifdata=r||{};var i=function(e){var t=new DataView(e);if(255!=t.getUint8(0)||216!=t.getUint8(1))return!1;var n=2,r=e.byteLength,i=function(e,t){return 56===e.getUint8(t)&&66===e.getUint8(t+1)&&73===e.getUint8(t+2)&&77===e.getUint8(t+3)&&4===e.getUint8(t+4)&&4===e.getUint8(t+5)};for(;n<r;){if(i(t,n)){var a=t.getUint8(n+7);return a%2!=0&&(a+=1),0===a&&(a=4),em(e,n+8+a,t.getUint16(n+6+a))}n++}}(n);if(e.iptcdata=i||{},Hv.isXmpEnabled){var a=function(e){if(!("DOMParser"in self))return;var t=new DataView(e);if(255!=t.getUint8(0)||216!=t.getUint8(1))return!1;var n=2,r=e.byteLength,i=new DOMParser;for(;n<r-4;){if("http"==rm(t,n,4)){var a=n-1,o=t.getUint16(n-2)-1,s=rm(t,a,o),c=s.indexOf("xmpmeta>")+8,u=(s=s.substring(s.indexOf("<x:xmpmeta"),c)).indexOf("x:xmpmeta")+10;return s=s.slice(0,u)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+s.slice(u),om(i.parseFromString(s,"text/xml"))}n++}}(n);e.xmpdata=a||{}}t&&t.call(e)}if(e.src)if(/^data:/i.test(e.src))n(function(e){e=e.replace(/^data:([^;]+);base64,/gim,"");for(var t=atob(e),n=t.length,r=new ArrayBuffer(n),i=new Uint8Array(r),a=0;a<n;a++)i[a]=t.charCodeAt(a);return r}(e.src));else if(/^blob:/i.test(e.src)){var r=new FileReader;r.onload=function(e){n(e.target.result)},function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(){200!=this.status&&0!==this.status||t(this.response)},n.send()}(e.src,function(e){r.readAsArrayBuffer(e)})}else{var i=new XMLHttpRequest;i.onload=function(){200==this.status||0===this.status?(n(i.response),i=null):Av.error("Could not load image")},i.open("GET",e.src,!0),i.responseType="arraybuffer",i.send(null)}else if(self.FileReader&&(e instanceof self.Blob||e instanceof self.File)){var a=new FileReader;a.onload=function(e){n(e.target.result)},a.readAsArrayBuffer(e)}}function Zv(e){var t=new DataView(e);if(255!=t.getUint8(0)||216!=t.getUint8(1))return!1;for(var n=2,r=e.byteLength;n<r;){if(255!=t.getUint8(n))return!1;if(225==t.getUint8(n+1))return im(t,n+4,t.getUint16(n+2));n+=2+t.getUint16(n+2)}}var Kv={25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",90:"city",92:"sublocation",94:"state",100:"countryCode",101:"countryName",103:"OriginalTransmissionReference",105:"headline",109:"credit",110:"credit",116:"copyright",118:"contact",120:"caption",122:"captionWriter",125:"rasterizedCaption",130:"imageType",131:"imageOrientation",135:"languageID",150:"audioType",151:"audioSamplingRate",152:"audioSamplingRes",153:"audioDuration",154:"audioOutcue",200:"previewFileFormat",201:"previewFileFormatVer",202:"previewData",15:"category"};function em(e,t,n){for(var r,i,a,o,s=new DataView(e),c={},u=t;u<t+n;)28===s.getUint8(u)&&2===s.getUint8(u+1)&&(o=s.getUint8(u+2))in Kv&&(a=s.getInt16(u+3),i=Kv[o],r=rm(s,u+5,a),Object.prototype.hasOwnProperty.call(c,i)?c[i]instanceof Array?c[i].push(r):c[i]=[c[i],r]:c[i]=r),u++;return c}function tm(e,t,n,r,i){var a,o,s,c=e.getUint16(n,!i),u={};for(s=0;s<c;s++)a=n+12*s+2,!(o=r[e.getUint16(a,!i)])&&Gv&&Av.log("Unknown tag: "+e.getUint16(a,!i)),u[o]=nm(e,a,t,n,i);return u}function nm(e,t,n,r,i){var a,o,s,c,u,l,f=e.getUint16(t+2,!i),h=e.getUint32(t+4,!i),d=e.getUint32(t+8,!i)+n;switch(f){case 1:case 7:if(1==h)return e.getUint8(t+8,!i);for(a=h>4?d:t+8,o=[],c=0;c<h;c++)o[c]=e.getUint8(a+c);return o;case 2:return rm(e,a=h>4?d:t+8,h-1);case 3:if(1==h)return e.getUint16(t+8,!i);for(a=h>2?d:t+8,o=[],c=0;c<h;c++)o[c]=e.getUint16(a+2*c,!i);return o;case 4:if(1==h)return e.getUint32(t+8,!i);for(o=[],c=0;c<h;c++)o[c]=e.getUint32(d+4*c,!i);return o;case 5:if(1==h)return u=e.getUint32(d,!i),l=e.getUint32(d+4,!i),(s=new Number(u/l)).numerator=u,s.denominator=l,s;for(o=[],c=0;c<h;c++)u=e.getUint32(d+8*c,!i),l=e.getUint32(d+4+8*c,!i),o[c]=new Number(u/l),o[c].numerator=u,o[c].denominator=l;return o;case 9:if(1==h)return e.getInt32(t+8,!i);for(o=[],c=0;c<h;c++)o[c]=e.getInt32(d+4*c,!i);return o;case 10:if(1==h)return e.getInt32(d,!i)/e.getInt32(d+4,!i);for(o=[],c=0;c<h;c++)o[c]=e.getInt32(d+8*c,!i)/e.getInt32(d+4+8*c,!i);return o}}function rm(e,t,n){for(var r=[],i=0,a=t;a<t+n;a++)r[i]="0x"+e.getUint8(a).toString(16),i++;return function(e){var t,n,r,i,a,o;t="",r=e.length,n=0;for(;n<r;)switch((i=e[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(i);break;case 12:case 13:a=e[n++],t+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[n++],o=e[n++],t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&o)}return t}(r)}function im(e,t){if("Exif"!=rm(e,t,4))return!1;var n,r,i,a,o,s=t+6;if(18761==e.getUint16(s))n=!1;else{if(19789!=e.getUint16(s))return!1;n=!0}if(42!=e.getUint16(s+2,!n))return!1;var c=e.getUint32(s+4,!n);if(c<8)return!1;if((r=tm(e,s,s+c,Vv,n)).ExifIFDPointer)for(i in a=tm(e,s,s+r.ExifIFDPointer,Yv,n)){switch(i){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":a[i]=$v[i][a[i]];break;case"ExifVersion":case"FlashpixVersion":a[i]=String.fromCharCode(a[i][0],a[i][1],a[i][2],a[i][3]);break;case"ComponentsConfiguration":a[i]=$v.Components[a[i][0]]+$v.Components[a[i][1]]+$v.Components[a[i][2]]+$v.Components[a[i][3]]}r[i]=a[i]}if(r.GPSInfoIFDPointer)for(i in o=tm(e,s,s+r.GPSInfoIFDPointer,qv,n)){if("GPSVersionID"==i)try{o[i]=o[i][0]+"."+o[i][1]+"."+o[i][2]+"."+o[i][3]}catch(e){}r[i]=o[i]}return r.thumbnail=function(e,t,n,r){var i=function(e,t,n){var r=e.getUint16(t,!n);return e.getUint32(t+2+12*r,!n)}(e,t+n,r);if(!i)return{};if(i>e.byteLength)return{};var a=tm(e,t,t+i,Xv,r);if(a.Compression)switch(a.Compression){case 6:if(a.JpegIFOffset&&a.JpegIFByteCount){var o=t+a.JpegIFOffset,s=a.JpegIFByteCount;a.blob=new Blob([new Uint8Array(e.buffer,o,s)],{type:"image/jpeg"})}break;case 1:Av.log("Thumbnail image format is TIFF, which is not implemented.");break;default:Av.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&Av.log("Thumbnail image format is RGB, which is not implemented.");return a}(e,s,c,n),r}function am(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);t["@attributes"][r.nodeName]=r.nodeValue}}}else if(3==e.nodeType)return e.nodeValue;if(e.hasChildNodes())for(var i=0;i<e.childNodes.length;i++){var a=e.childNodes.item(i),o=a.nodeName;if(null==t[o])t[o]=am(a);else{if(null==t[o].push){var s=t[o];t[o]=[],t[o].push(s)}t[o].push(am(a))}}return t}function om(e){try{var t={};if(e.children.length>0)for(var n=0;n<e.children.length;n++){var r=e.children.item(n),i=r.attributes;for(var a in i){var o=i[a],s=o.nodeName,c=o.nodeValue;void 0!==s&&(t[s]=c)}var u=r.nodeName;if(void 0===t[u])t[u]=am(r);else{if(void 0===t[u].push){var l=t[u];t[u]=[],t[u].push(l)}t[u].push(am(r))}}else t=e.textContent;return t}catch(e){Av.log(e.message)}}Hv.enableXmp=function(){Hv.isXmpEnabled=!0},Hv.disableXmp=function(){Hv.isXmpEnabled=!1},Hv.getData=function(e,t){return!((self.Image&&e instanceof self.Image||self.HTMLImageElement&&e instanceof self.HTMLImageElement)&&!e.complete)&&(Jv(e)?t&&t.call(e):Qv(e,t),!0)},Hv.getTag=function(e,t){if(Jv(e))return e.exifdata[t]},Hv.getIptcTag=function(e,t){if(Jv(e))return e.iptcdata[t]},Hv.getAllTags=function(e){if(!Jv(e))return{};var t,n=e.exifdata,r={};for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t]);return r},Hv.getAllIptcTags=function(e){if(!Jv(e))return{};var t,n=e.iptcdata,r={};for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t]);return r},Hv.ConvertDMSToDD=function(e,t,n,r){var i=e+t/60+n/3600;return"S"!=r&&"W"!=r||(i*=-1),i},Hv.pretty=function(e){if(!Jv(e))return"";var t,n=e.exifdata,r="";for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&("object"==w(n[t])?n[t]instanceof Number?r+=t+" : "+n[t]+" ["+n[t].numerator+"/"+n[t].denominator+"]\r\n":r+=t+" : ["+n[t].length+" values]\r\n":r+=t+" : "+n[t]+"\r\n");return r},Hv.readFromBinaryFile=function(e){return Zv(e)}}();