securityos/node_modules/emulators-ui/dist/emulators-ui.js

18 lines
209 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!function t(e,n,o){function i(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};e[s][0].call(l.exports,(function(t){return i(e[s][1][t]||t)}),l,l.exports,t,e,n,o)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(t,e,n){"use strict";var o=t("./utils");function i(){var t={},e=0,n=0,o=0;return{add:function(i,r){r||(r=i,i=0),i>n?n=i:i<o&&(o=i),t[i]||(t[i]=[]),t[i].push(r),e++},process:function(){for(var e=o;e<=n;e++)for(var i=t[e],r=0;r<i.length;r++){(0,i[r])()}},size:function(){return e}}}e.exports=function(t){var e=(t=t||{}).reporter,n=o.getOption(t,"async",!0),r=o.getOption(t,"auto",!0);r&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var s,a=i(),c=!1;function u(){for(c=!0;a.size();){var t=a;a=i(),t.process()}c=!1}function l(){var t;t=u,s=setTimeout(t,0)}return{add:function(t,e){!c&&r&&n&&0===a.size()&&l(),a.add(t,e)},force:function(t){c||(void 0===t&&(t=n),s&&(clearTimeout(s),s=null),t?l():u())}}}},{"./utils":2}],2:[function(t,e,n){"use strict";(e.exports={}).getOption=function(t,e,n){var o=t[e];if(null==o&&void 0!==n)return n;return o}},{}],3:[function(t,e,n){"use strict";var o=e.exports={};o.isIE=function(t){return(-1!==(e=navigator.userAgent.toLowerCase()).indexOf("msie")||-1!==e.indexOf("trident")||-1!==e.indexOf(" edge/"))&&(!t||t===function(){var t=3,e=document.createElement("div"),n=e.getElementsByTagName("i");do{e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e"}while(n[0]);return t>4?t:undefined}());var e},o.isLegacyOpera=function(){return!!window.opera}},{}],4:[function(t,e,n){"use strict";(e.exports={}).forEach=function(t,e){for(var n=0;n<t.length;n++){var o=e(t[n]);if(o)return o}}},{}],5:[function(t,e,n){"use strict";var o=t("../browser-detector");e.exports=function(t){var e=(t=t||{}).reporter,n=t.batchProcessor,i=t.stateHandler.getState;if(!e)throw new Error("Missing required dependency: reporter.");function r(e){var n=t.important?" !important; ":"; ";return(e.join(n)+n).trim()}function s(t){return i(t).object}return{makeDetectable:function(t,s,a){a||(a=s,s=t,t=null),(t=t||{}).debug,o.isIE(8)?a(s):function(s,a){var c=r(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),u=!1,l=window.getComputedStyle(s),d=s.offsetWidth,h=s.offsetHeight;function p(){function n(){if("static"===l.position){s.style.setProperty("position","relative",t.important?"important":"");var n=function(e,n,o,i){var r=o[i];"auto"!==r&&"0"!==function(t){return t.replace(/[^-\d\.]/g,"")}(r)&&(e.warn("An element that is positioned static has style."+i+"="+r+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",n),n.style.setProperty(i,"0",t.important?"important":""))};n(e,s,l,"top"),n(e,s,l,"right"),n(e,s,l,"bottom"),n(e,s,l,"left")}}""!==l.position&&(n(),u=!0);var r=document.createElement("object");r.style.cssText=c,r.tabIndex=-1,r.type="text/html",r.setAttribute("aria-hidden","true"),r.onload=function(){u||n(),function t(e,n){if(!e.contentDocument){var o=i(e);return o.checkForObjectDocumentTimeoutId&&window.clearTimeout(o.checkForObjectDocumentTimeoutId),void(o.checkForObjectDocumentTimeoutId=setTimeout((function(){o.checkForObjectDocumentTimeoutId=0,t(e,n)}),100))}n(e.contentDocument)}(this,(function(t){a(s)}))},o.isIE()||(r.data="about:blank"),i(s)&&(s.appendChild(r),i(s).object=r,o.isIE()&&(r.data="about:blank"))}i(s).startSize={width:d,height:h},n?n.add(p):p()}(s,a)},addListener:function(t,e){function n(){e(t)}if(o.isIE(8))i(t).object={proxy:n},t.attachEvent("onresize",n);else{var r=s(t);if(!r)throw new Error("Element is not detectable by this strategy.");r.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(t){if(i(t)){var e=s(t);e&&(o.isIE(8)?t.detachEvent("onresize",e.proxy):t.removeChild(e),i(t).checkForObjectDocumentTimeoutId&&window.clearTimeout(i(t).checkForObjectDocumentTimeoutId),delete i(t).object)}}}}},{"../browser-detector":3}],6:[function(t,e,n){"use strict";var o=t("../collection-utils").forEach;e.exports=function(t){var e=(t=t||{}).reporter,n=t.batchProcessor,i=t.stateHandler.getState,r=(t.stateHandler.hasState,t.idHandler);if(!n)throw new Error("Missing required dependency: batchProcessor");if(!e)throw new Error("Missing required dependency: reporter.");var s=function(){var t=500,e=500,n=document.createElement("div");n.style.cssText=u(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var o=document.createElement("div");o.style.cssText=u(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),o.appendChild(n),document.body.insertBefore(o,document.body.firstChild);var i=t-o.clientWidth,r=e-o.clientHeight;return document.body.removeChild(o),{width:i,height:r}}(),a="erd_scroll_detection_container";function c(t){!function(t,e,n){function o(n,o){o=o||function(e){t.head.appendChild(e)};var i=t.createElement("style");return i.innerHTML=n,i.id=e,o(i),i}if(!t.getElementById(e)){var i=n+"_animation",r=n+"_animation_active",s="/* Created by the element-resize-detector library. */\n";s+="."+n+" > div::-webkit-scrollbar { "+u(["display: none"])+" }\n\n",s+="."+r+" { "+u(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+i,"animation-name: "+i])+" }\n",s+="@-webkit-keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",o(s+="@keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(t,"erd_scroll_detection_scrollbar_style",a)}function u(e){var n=t.important?" !important; ":"; ";return(e.join(n)+n).trim()}function l(t,n,o){if(t.addEventListener)t.addEventListener(n,o);else{if(!t.attachEvent)return e.error("[scroll] Don't know how to add event listeners.");t.attachEvent("on"+n,o)}}function d(t,n,o){if(t.removeEventListener)t.removeEventListener(n,o);else{if(!t.detachEvent)return e.error("[scroll] Don't know how to remove event listeners.");t.detachEvent("on"+n,o)}}function h(t){return i(t).container.childNodes[0].childNodes[0].childNodes[0]}function p(t){return i(t).container.childNodes[0].childNodes[0].childNodes[1]}return c(window.document),{makeDetectable:function(t,c,d){function f(){if(t.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(r.get(c),"Scroll: "),e.log.apply)e.log.apply(null,n);else for(var o=0;o<n.length;o++)e.log(n[o])}}function v(t){var e=i(t).container.childNodes[0],n=window.getComputedStyle(e);return!n.width||-1===n.width.indexOf("px")}function g(){var t=window.getComputedStyle(c),e={};return e.position=t.position,e.width=c.offsetWidth,e.height=c.offsetHeight,e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left,e.widthCSS=t.width,e.heightCSS=t.height,e}function m(){if(f("storeStyle invoked."),i(c)){var t=g();i(c).style=t}else f("Aborting because element has been uninstalled")}function y(t,e,n){i(t).lastWidth=e,i(t).lastHeight=n}function b(){return 2*s.width+1}function _(){return 2*s.height+1}function w(t){return t+10+b()}function D(t){return t+10+_()}function x(t,e,n){var o=h(t),i=p(t),r=w(e),s=D(n),a=function(t){return 2*t+b()}(e),c=function(t){return 2*t+_()}(n);o.scrollLeft=r,o.scrollTop=s,i.scrollLeft=a,i.scrollTop=c}function B(){var t=i(c).container;if(!t){(t=document.createElement("div")).className=a,t.style.cssText=u(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),i(c).container=t,function(t){t.className+=" "+a+"_animation_active"}(t),c.appendChild(t);var e=function(){i(c).onRendered&&i(c).onRendered()};l(t,"animationstart",e),i(c).onAnimationStart=e}return t}function E(){if(f("Injecting elements"),i(c)){!function(){var n=i(c).style;if("static"===n.position){c.style.setProperty("position","relative",t.important?"important":"");var o=function(t,e,n,o){var i=n[o];"auto"!==i&&"0"!==function(t){return t.replace(/[^-\d\.]/g,"")}(i)&&(t.warn("An element that is positioned static has style."+o+"="+i+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",e),e.style[o]=0)};o(e,c,n,"top"),o(e,c,n,"right"),o(e,c,n,"bottom"),o(e,c,n,"left")}}();var n=i(c).container;n||(n=B());var o,r,d,h,p=s.width,v=s.height,g=u(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),m=u(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(o=(o=-(1+p))?o+"px":"0"),"top: "+(r=(r=-(1+v))?r+"px":"0"),"right: "+(h=(h=-p)?h+"px":"0"),"bottom: "+(d=(d=-v)?d+"px":"0")])),y=u(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),b=u(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),_=u(["position: absolute","left: 0","top: 0"]),w=u(["position: absolute","width: 200%","height: 200%"]),D=document.createElement("div"),x=document.createElement("div"),E=document.createElement("div"),k=document.createElement("div"),K=document.createElement("div"),C=document.createElement("div");D.dir="ltr",D.style.cssText=g,D.className=a,x.className=a,x.style.cssText=m,E.style.cssText=y,k.style.cssText=_,K.style.cssText=b,C.style.cssText=w,E.appendChild(k),K.appendChild(C),x.appendChild(E),x.appendChild(K),D.appendChild(x),n.appendChild(D),l(E,"scroll",O),l(K,"scroll",S),i(c).onExpandScroll=O,i(c).onShrinkScroll=S}else f("Aborting because element has been uninstalled");function O(){var t=i(c);t&&t.onExpand?t.onExpand():f("Aborting expand scroll handler: element has been uninstalled")}function S(){var t=i(c);t&&t.onShrink?t.onShrink():f("Aborting shrink scroll handler: element has been uninstalled")}}function k(){function s(e,n,o){var i=function(t){return h(t).childNodes[0]}(e),r=w(n),s=D(o);i.style.setProperty("width",r+"px",t.important?"important":""),i.style.setProperty("height",s+"px",t.important?"important":"")}function a(o){var a=c.offsetWidth,l=c.offsetHeight,d=a!==i(c).lastWidth||l!==i(c).lastHeight;f("Storing current size",a,l),y(c,a,l),n.add(0,(function(){if(d)if(i(c))if(u()){if(t.debug){var n=c.offsetWidth,o=c.offsetHeight;n===a&&o===l||e.warn(r.get(c),"Scroll: Size changed before updating detector elements.")}s(c,a,l)}else f("Aborting because element container has not been initialized");else f("Aborting because element has been uninstalled")})),n.add(1,(function(){i(c)?u()?x(c,a,l):f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")})),d&&o&&n.add(2,(function(){i(c)?u()?o():f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")}))}function u(){return!!i(c).container}function l(){f("notifyListenersIfNeeded invoked");var t=i(c);return void 0===i(c).lastNotifiedWidth&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?f("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?f("Not notifying: Size already notified"):(f("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void o(i(c).listeners,(function(t){t(c)})))}function d(){f("Scroll detected."),v(c)?f("Scroll event fired while unrendered. Ignoring..."):a(l)}if(f("registerListenersAndPositionElements invoked."),i(c)){i(c).onRendered=function(){if(f("startanimation triggered."),v(c))f("Ignoring since element is still unrendered...");else{f("Element rendered.");var t=h(c),e=p(c);0!==t.scrollLeft&&0!==t.scrollTop&&0!==e.scrollLeft&&0!==e.scrollTop||(f("Scrollbars out of sync. Updating detector elements..."),a(l))}},i(c).onExpand=d,i(c).onShrink=d;var g=i(c).style;s(c,g.width,g.height)}else f("Aborting because element has been uninstalled")}function K(){if(f("finalizeDomMutation invoked."),i(c)){var t=i(c).style;y(c,t.width,t.height),x(c,t.width,t.height)}else f("Aborting because element has been uninstalled")}function C(){d(c)}function O(){var t;f("Installing..."),i(c).listeners=[],t=g(),i(c).startSize={width:t.width,height:t.height},f("Element start size",i(c).startSize),n.add(0,m),n.add(1,E),n.add(2,k),n.add(3,K),n.add(4,C)}d||(d=c,c=t,t=null),t=t||{},f("Making detectable..."),!function(t){return!function(t){var e=t.getRootNode&&t.getRootNode().contains(t);return t===t.ownerDocument.body||t.ownerDocument.body.contains(t)||e}(t)||null===window.getComputedStyle(t)}(c)?O():(f("Element is detached"),B(),f("Waiting until element is attached..."),i(c).onRendered=function(){f("Element is now attached"),O()})},addListener:function(t,e){if(!i(t).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");i(t).listeners.push(e)},uninstall:function(t){var e=i(t);e&&(e.onExpandScroll&&d(h(t),"scroll",e.onExpandScroll),e.onShrinkScroll&&d(p(t),"scroll",e.onShrinkScroll),e.onAnimationStart&&d(e.container,"animationstart",e.onAnimationStart),e.container&&t.removeChild(e.container))},initDocument:c}}},{"../collection-utils":4}],7:[function(t,e,n){"use strict";var o=t("./collection-utils").forEach,i=t("./element-utils"),r=t("./listener-handler"),s=t("./id-generator"),a=t("./id-handler"),c=t("./reporter"),u=t("./browser-detector"),l=t("batch-processor"),d=t("./state-handler"),h=t("./detection-strategy/object.js"),p=t("./detection-strategy/scroll.js");function f(t){return Array.isArray(t)||void 0!==t.length}function v(t){if(Array.isArray(t))return t;var e=[];return o(t,(function(t){e.push(t)})),e}function g(t){return t&&1===t.nodeType}function m(t,e,n){var o=t[e];return null==o&&void 0!==n?n:o}e.exports=function(t){var e;if((t=t||{}).idHandler)e={get:function(e){return t.idHandler.get(e,!0)},set:t.idHandler.set};else{var n=s(),y=a({idGenerator:n,stateHandler:d});e=y}var b=t.reporter;b||(b=c(!1===b));var _=m(t,"batchProcessor",l({reporter:b})),w={};w.callOnAdd=!!m(t,"callOnAdd",!0),w.debug=!!m(t,"debug",!1);var D,x=r(e),B=i({stateHandler:d}),E=m(t,"strategy","object"),k=m(t,"important",!1),K={reporter:b,batchProcessor:_,stateHandler:d,idHandler:e,important:k};if("scroll"===E&&(u.isLegacyOpera()?(b.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),E="object"):u.isIE(9)&&(b.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),E="object")),"scroll"===E)D=p(K);else{if("object"!==E)throw new Error("Invalid strategy name: "+E);D=h(K)}var C={};return{listenTo:function(t,n,i){function r(t){var e=x.get(t);o(e,(function(e){e(t)}))}function s(t,e,n){x.add(e,n),t&&n(e)}if(i||(i=n,n=t,t={}),!n)throw new Error("At least one element required.");if(!i)throw new Error("Listener required.");if(g(n))n=[n];else{if(!f(n))return b.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=v(n)}var a=0,c=m(t,"callOnAdd",w.callOnAdd),u=m(t,"onReady",(function(){})),l=m(t,"debug",w.debug);o(n,(function(t){d.getState(t)||(d.initState(t),e.set(t));var h=e.get(t);if(l&&b.log("Attaching listener to element",h,t),!B.isDetectable(t))return l&&b.log(h,"Not detectable."),B.isBusy(t)?(l&&b.log(h,"System busy making it detectable"),s(c,t,i),C[h]=C[h]||[],void C[h].push((function(){++a===n.length&&u()}))):(l&&b.log(h,"Making detectable..."),B.markBusy(t,!0),D.makeDetectable({debug:l,important:k},t,(function(t){if(l&&b.log(h,"onElementDetectable"),d.getState(t)){B.markAsDetectable(t),B.markBusy(t,!1),D.addListener(t,r),s(c,t,i);var e=d.getState(t);if(e&&e.startSize){var p=t.offsetWidth,f=t.offsetHeight;e.startSize.width===p&&e.startSize.height===f||r(t)}C[h]&&o(C[h],(function(t){t()}))}else l&&b.log(h,"Element uninstalled before being detectable.");delete C[h],++a===n.length&&u()})));l&&b.log(h,"Already detecable, adding listener."),s(c,t,i),a++})),a===n.length&&u()},removeListener:x.removeListener,removeAllListeners:x.removeAllListeners,uninstall:function(t){if(!t)return b.error("At least one element is required.");if(g(t))t=[t];else{if(!f(t))return b.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");t=v(t)}o(t,(function(t){x.removeAllListeners(t),D.uninstall(t),d.cleanState(t)}))},initDocument:function(t){D.initDocument&&D.initDocument(t)}}}},{"./browser-detector":3,"./collection-utils":4,"./detection-strategy/object.js":5,"./detection-strategy/scroll.js":6,"./element-utils":8,"./id-generator":9,"./id-handler":10,"./listener-handler":11,"./reporter":12,"./state-handler":13,"batch-processor":1}],8:[function(t,e,n){"use strict";e.exports=function(t){var e=t.stateHandler.getState;return{isDetectable:function(t){var n=e(t);return n&&!!n.isDetectable},markAsDetectable:function(t){e(t).isDetectable=!0},isBusy:function(t){return!!e(t).busy},markBusy:function(t,n){e(t).busy=!!n}}}},{}],9:[function(t,e,n){"use strict";e.exports=function(){var t=1;return{generate:function(){return t++}}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){var e=t.idGenerator,n=t.stateHandler.getState;return{get:function(t){var e=n(t);return e&&void 0!==e.id?e.id:null},set:function(t){var o=n(t);if(!o)throw new Error("setId required the element to have a resize detection state.");var i=e.generate();return o.id=i,i}}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){var e={};function n(n){var o=t.get(n);return void 0===o?[]:e[o]||[]}return{get:n,add:function(n,o){var i=t.get(n);e[i]||(e[i]=[]),e[i].push(o)},removeListener:function(t,e){for(var o=n(t),i=0,r=o.length;i<r;++i)if(o[i]===e){o.splice(i,1);break}},removeAllListeners:function(t){var e=n(t);e&&(e.length=0)}}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){function e(){}var n={log:e,warn:e,error:e};if(!t&&window.console){var o=function(t,e){t[e]=function(){var t=console[e];if(t.apply)t.apply(console,arguments);else for(var n=0;n<arguments.length;n++)t(arguments[n])}};o(n,"log"),o(n,"warn"),o(n,"error")}return n}},{}],13:[function(t,e,n){"use strict";function o(t){return t._erd}e.exports={initState:function(t){return t._erd={},o(t)},getState:o,cleanState:function(t){delete t._erd}}},{}],14:[function(t,e,n){var o,i;o=window,i=function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var o,i=function(t,e){var n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)},r=function(t){return t*(Math.PI/180)},s=new Map,a=function(t){s.has(t)&&clearTimeout(s.get(t)),s.set(t,setTimeout(t,100))},c=function(t,e,n){for(var o,i=e.split(/[ ,]+/g),r=0;r<i.length;r+=1)o=i[r],t.addEventListener?t.addEventListener(o,n,!1):t.attachEvent&&t.attachEvent(o,n)},u=function(t,e,n){for(var o,i=e.split(/[ ,]+/g),r=0;r<i.length;r+=1)o=i[r],t.removeEventListener?t.removeEventListener(o,n):t.detachEvent&&t.detachEvent(o,n)},l=function(t){return t.preventDefault(),t.type.match(/^touch/)?t.changedTouches:t},d=function(){return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},h=function(t,e){e.top||e.right||e.bottom||e.left?(t.style.top=e.top,t.style.right=e.right,t.style.bottom=e.bottom,t.style.left=e.left):(t.style.left=e.x+"px",t.style.top=e.y+"px")},p=function(t,e,n){var o=f(t);for(var i in o)if(o.hasOwnProperty(i))if("string"==typeof e)o[i]=e+" "+n;else{for(var r="",s=0,a=e.length;s<a;s+=1)r+=e[s]+" "+n+", ";o[i]=r.slice(0,-2)}return o},f=function(t){var e={};return e[t]="",["webkit","Moz","o"].forEach((function(n){e[n+t.charAt(0).toUpperCase()+t.slice(1)]=""})),e},v=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},g=function(t,e){if(t.length)for(var n=0,o=t.length;n<o;n+=1)e(t[n]);else e(t)},m=!!("ontouchstart"in window),y=!!window.PointerEvent,b=!!window.MSPointerEvent,_={start:"mousedown",move:"mousemove",end:"mouseup"},w={};function D(){}y?o={start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"}:b?o={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:m?(o={start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},w=_):o=_,D.prototype.on=function(t,e){var n,o=t.split(/[ ,]+/g);this._handlers_=this._handlers_||{};for(var i=0;i<o.length;i+=1)n=o[i],this._handlers_[n]=this._handlers_[n]||[],this._handlers_[n].push(e);return this},D.prototype.off=function(t,e){return this._handlers_=this._handlers_||{},void 0===t?this._handlers_={}:void 0===e?this._handlers_[t]=null:this._handlers_[t]&&this._handlers_[t].indexOf(e)>=0&&this._handlers_[t].splice(this._handlers_[t].indexOf(e),1),this},D.prototype.trigger=function(t,e){var n,o=this,i=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var r=0;r<i.length;r+=1)n=i[r],o._handlers_[n]&&o._handlers_[n].length&&o._handlers_[n].forEach((function(t){t.call(o,{type:n,target:o},e)}))},D.prototype.config=function(t){this.options=this.defaults||{},t&&(this.options=function(t,e){var n={};for(var o in t)t.hasOwnProperty(o)&&e.hasOwnProperty(o)?n[o]=e[o]:t.hasOwnProperty(o)&&(n[o]=t[o]);return n}(this.options,t))},D.prototype.bindEvt=function(t,e){var n=this;return n._domHandlers_=n._domHandlers_||{},n._domHandlers_[e]=function(){"function"==typeof n["on"+e]?n["on"+e].apply(n,arguments):console.warn('[WARNING] : Missing "on'+e+'" handler.')},c(t,o[e],n._domHandlers_[e]),w[e]&&c(t,w[e],n._domHandlers_[e]),n},D.prototype.unbindEvt=function(t,e){return this._domHandlers_=this._domHandlers_||{},u(t,o[e],this._domHandlers_[e]),w[e]&&u(t,w[e],this._domHandlers_[e]),delete this._domHandlers_[e],this};var x=D;function B(t,e){return this.identifier=e.identifier,this.position=e.position,this.frontPosition=e.frontPosition,this.collection=t,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1,shape:"circle"},this.config(e),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=B.id,B.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}B.prototype=new x,B.constructor=B,B.id=0,B.prototype.buildEl=function(t){return this.ui={},this.options.dataOnly||(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front)),this},B.prototype.stylize=function(){if(this.options.dataOnly)return this;var t=this.options.fadeTime+"ms",e=function(t,e){var n=f("borderRadius");for(var o in n)n.hasOwnProperty(o)&&(n[o]="50%");return n}(),n=p("transition","opacity",t),o={};return o.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},o.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:this.options.color,opacity:".5"},o.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:this.options.color,opacity:".5"},v(o.el,n),"circle"===this.options.shape&&v(o.back,e),v(o.front,e),this.applyStyles(o),this},B.prototype.applyStyles=function(t){for(var e in this.ui)if(this.ui.hasOwnProperty(e))for(var n in t[e])this.ui[e].style[n]=t[e][n];return this},B.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},B.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},B.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off()},B.prototype.show=function(t){var e=this;return e.options.dataOnly||(clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.addToDom(),e.restCallback(),setTimeout((function(){e.ui.el.style.opacity=1}),0),e.showTimeout=setTimeout((function(){e.trigger("shown",e.instance),"function"==typeof t&&t.call(this)}),e.options.fadeTime)),e},B.prototype.hide=function(t){var e=this;if(e.options.dataOnly)return e;if(e.ui.el.style.opacity=e.options.restOpacity,clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.removeTimeout=setTimeout((function(){var n="dynamic"===e.options.mode?"none":"block";e.ui.el.style.display=n,"function"==typeof t&&t.call(e),e.trigger("hidden",e.instance)}),e.options.fadeTime),e.options.restJoystick){var n=e.options.restJoystick,o={};o.x=!0===n||!1!==n.x?0:e.instance.frontPosition.x,o.y=!0===n||!1!==n.y?0:e.instance.frontPosition.y,e.setPosition(t,o)}return e},B.prototype.setPosition=function(t,e){var n=this;n.frontPosition={x:e.x,y:e.y};var o=n.options.fadeTime+"ms",i={};i.front=p("transition",["top","left"],o);var r={front:{}};r.front={left:n.frontPosition.x+"px",top:n.frontPosition.y+"px"},n.applyStyles(i),n.applyStyles(r),n.restTimeout=setTimeout((function(){"function"==typeof t&&t.call(n),n.restCallback()}),n.options.fadeTime)},B.prototype.restCallback=function(){var t={};t.front=p("transition","none",""),this.applyStyles(t),this.trigger("rested",this.instance)},B.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},B.prototype.computeDirection=function(t){var e,n,o,i=t.angle.radian,r=Math.PI/4,s=Math.PI/2;if(i>r&&i<3*r&&!t.lockX?e="up":i>-r&&i<=r&&!t.lockY?e="left":i>3*-r&&i<=-r&&!t.lockX?e="down":t.lockY||(e="right"),t.lockY||(n=i>-s&&i<s?"left":"right"),t.lockX||(o=i>0?"up":"down"),t.force>this.options.threshold){var a,c={};for(a in this.direction)this.direction.hasOwnProperty(a)&&(c[a]=this.direction[a]);var u={};for(a in this.direction={x:n,y:o,angle:e},t.direction=this.direction,c)c[a]===this.direction[a]&&(u[a]=!0);if(u.x&&u.y&&u.angle)return t;u.x&&u.y||this.trigger("plain",t),u.x||this.trigger("plain:"+n,t),u.y||this.trigger("plain:"+o,t),u.angle||this.trigger("dir dir:"+e,t)}else this.resetDirection();return t};var E=B;function k(t,e){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=t,this.id=k.id,k.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},this.config(e),"static"!==this.options.mode&&"semi"!==this.options.mode||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);var n=getComputedStyle(this.options.zone.parentElement);return n&&"flex"===n.display&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}k.prototype=new x,k.constructor=k,k.id=0,k.prototype.prepareNipples=function(){var t=this.nipples;t.on=this.on.bind(this),t.off=this.off.bind(this),t.options=this.options,t.destroy=this.destroy.bind(this),t.ids=this.ids,t.id=this.id,t.processOnMove=this.processOnMove.bind(this),t.processOnEnd=this.processOnEnd.bind(this),t.get=function(e){if(void 0===e)return t[0];for(var n=0,o=t.length;n<o;n+=1)if(t[n].identifier===e)return t[n];return!1}},k.prototype.bindings=function(){this.bindEvt(this.options.zone,"start"),this.options.zone.style.touchAction="none",this.options.zone.style.msTouchAction="none"},k.prototype.begin=function(){var t=this.options;if("static"===t.mode){var e=this.createNipple(t.position,this.manager.getIdentifier());e.add(),this.idles.push(e)}},k.prototype.createNipple=function(t,e){var n=this.manager.scroll,o={},i=this.options,r=this.parentIsFlex?n.x:n.x+this.box.left,s=this.parentIsFlex?n.y:n.y+this.box.top;if(t.x&&t.y)o={x:t.x-r,y:t.y-s};else if(t.top||t.right||t.bottom||t.left){var a=document.createElement("DIV");a.style.display="hidden",a.style.top=t.top,a.style.right=t.right,a.style.bottom=t.bottom,a.style.left=t.left,a.style.position="absolute",i.zone.appendChild(a);var c=a.getBoundingClientRect();i.zone.removeChild(a),o=t,t={x:c.left+n.x,y:c.top+n.y}}var u=new E(this,{color:i.color,size:i.size,threshold:i.threshold,fadeTime:i.fadeTime,dataOnly:i.dataOnly,restJoystick:i.restJoystick,restOpacity:i.restOpacity,mode:i.mode,identifier:e,position:t,zone:i.zone,frontPosition:{x:0,y:0},shape:i.shape});return i.dataOnly||(h(u.ui.el,o),h(u.ui.front,u.frontPosition)),this.nipples.push(u),this.trigger("added "+u.identifier+":added",u),this.manager.trigger("added "+u.identifier+":added",u),this.bindNipple(u),u},k.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},k.prototype.bindNipple=function(t){var e,n=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,n.trigger(e,o)};t.on("destroyed",n.onDestroyed.bind(n)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},k.prototype.pressureFn=function(t,e,n){var o=this,i=0;clearInterval(o.pressureIntervals[n]),o.pressureIntervals[n]=setInterval(function(){var n=t.force||t.pressure||t.webkitForce||0;n!==i&&(e.trigger("pressure",n),o.trigger("pressure "+e.identifier+":pressure",n),i=n)}.bind(o),100)},k.prototype.onstart=function(t){var e=this,n=e.options,o=t;return t=l(t),e.updateBox(),g(t,(function(i){e.actives.length<n.maxNumberOfNipples?e.processOnStart(i):o.type.match(/^touch/)&&(Object.keys(e.manager.ids).forEach((function(n){if(Object.values(o.touches).findIndex((function(t){return t.identifier===n}))<0){var i=[t[0]];i.identifier=n,e.processOnEnd(i)}})),e.actives.length<n.maxNumberOfNipples&&e.processOnStart(i))})),e.manager.bindDocument(),!1},k.prototype.processOnStart=function(t){var e,n=this,o=n.options,r=n.manager.getIdentifier(t),s=t.force||t.pressure||t.webkitForce||0,a={x:t.pageX,y:t.pageY},c=n.getOrCreate(r,a);c.identifier!==r&&n.manager.removeIdentifier(c.identifier),c.identifier=r;var u=function(e){e.trigger("start",e),n.trigger("start "+e.id+":start",e),e.show(),s>0&&n.pressureFn(t,e,e.identifier),n.processOnMove(t)};if((e=n.idles.indexOf(c))>=0&&n.idles.splice(e,1),n.actives.push(c),n.ids.push(c.identifier),"semi"!==o.mode)u(c);else{if(!(i(a,c.position)<=o.catchDistance))return c.destroy(),void n.processOnStart(t);u(c)}return c},k.prototype.getOrCreate=function(t,e){var n,o=this.options;return/(semi|static)/.test(o.mode)?(n=this.idles[0])?(this.idles.splice(0,1),n):"semi"===o.mode?this.createNipple(e,t):(console.warn("Coudln't find the needed nipple."),!1):n=this.createNipple(e,t)},k.prototype.processOnMove=function(t){var e=this.options,n=this.manager.getIdentifier(t),o=this.nipples.get(n),s=this.manager.scroll;if(function(t){return isNaN(t.buttons)?0!==t.pressure:0!==t.buttons}(t)){if(!o)return console.error("Found zombie joystick with ID "+n),void this.manager.removeIdentifier(n);if(e.dynamicPage){var a=o.el.getBoundingClientRect();o.position={x:s.x+a.left,y:s.y+a.top}}o.identifier=n;var c=o.options.size/2,u={x:t.pageX,y:t.pageY};e.lockX&&(u.y=o.position.y),e.lockY&&(u.x=o.position.x);var l,d,p,f,v,g,m,y,b,_,w=i(u,o.position),D=(l=u,p=(d=o.position).x-l.x,f=d.y-l.y,function(t){return t*(180/Math.PI)}(Math.atan2(f,p))),x=r(D),B=w/c,E={distance:w,position:u};if("circle"===o.options.shape?(v=Math.min(w,c),m=o.position,y=v,_={x:0,y:0},b=r(b=D),_.x=m.x-y*Math.cos(b),_.y=m.y-y*Math.sin(b),g=_):(g=function(t,e,n){return{x:Math.min(Math.max(t.x,e.x-n),e.x+n),y:Math.min(Math.max(t.y,e.y-n),e.y+n)}}(u,o.position,c),v=i(g,o.position)),e.follow){if(w>c){var k=u.x-g.x,K=u.y-g.y;o.position.x+=k,o.position.y+=K,o.el.style.top=o.position.y-(this.box.top+s.y)+"px",o.el.style.left=o.position.x-(this.box.left+s.x)+"px",w=i(u,o.position)}}else u=g,w=v;var C=u.x-o.position.x,O=u.y-o.position.y;o.frontPosition={x:C,y:O},e.dataOnly||h(o.ui.front,o.frontPosition);var S={identifier:o.identifier,position:u,force:B,pressure:t.force||t.pressure||t.webkitForce||0,distance:w,angle:{radian:x,degree:D},vector:{x:C/c,y:-O/c},raw:E,instance:o,lockX:e.lockX,lockY:e.lockY};(S=o.computeDirection(S)).angle={radian:r(180-D),degree:180-D},o.trigger("move",S),this.trigger("move "+o.id+":move",S)}else this.processOnEnd(t)},k.prototype.processOnEnd=function(t){var e=this,n=e.options,o=e.manager.getIdentifier(t),i=e.nipples.get(o),r=e.manager.removeIdentifier(i.identifier);i&&(n.dataOnly||i.hide((function(){"dynamic"===n.mode&&(i.trigger("removed",i),e.trigger("removed "+i.id+":removed",i),e.manager.trigger("removed "+i.id+":removed",i),i.destroy())})),clearInterval(e.pressureIntervals[i.identifier]),i.resetDirection(),i.trigger("end",i),e.trigger("end "+i.id+":end",i),e.ids.indexOf(i.identifier)>=0&&e.ids.splice(e.ids.indexOf(i.identifier),1),e.actives.indexOf(i)>=0&&e.actives.splice(e.actives.indexOf(i),1),/(semi|static)/.test(n.mode)?e.idles.push(i):e.nipples.indexOf(i)>=0&&e.nipples.splice(e.nipples.indexOf(i),1),e.manager.unbindDocument(),/(semi|static)/.test(n.mode)&&(e.manager.ids[r.id]=r.identifier))},k.prototype.onDestroyed=function(t,e){this.nipples.indexOf(e)>=0&&this.nipples.splice(this.nipples.indexOf(e),1),this.actives.indexOf(e)>=0&&this.actives.splice(this.actives.indexOf(e),1),this.idles.indexOf(e)>=0&&this.idles.splice(this.idles.indexOf(e),1),this.ids.indexOf(e.identifier)>=0&&this.ids.splice(this.ids.indexOf(e.identifier),1),this.manager.removeIdentifier(e.identifier),this.manager.unbindDocument()},k.prototype.destroy=function(){for(var t in this.unbindEvt(this.options.zone,"start"),this.nipples.forEach((function(t){t.destroy()})),this.pressureIntervals)this.pressureIntervals.hasOwnProperty(t)&&clearInterval(this.pressureIntervals[t]);this.trigger("destroyed",this.nipples),this.manager.unbindDocument(),this.off()};var K=k;function C(t){var e=this;e.ids={},e.index=0,e.collections=[],e.scroll=d(),e.config(t),e.prepareCollections();var n=function(){var t;e.collections.forEach((function(n){n.forEach((function(n){t=n.el.getBoundingClientRect(),n.position={x:e.scroll.x+t.left,y:e.scroll.y+t.top}}))}))};c(window,"resize",(function(){a(n)}));var o=function(){e.scroll=d()};return c(window,"scroll",(function(){a(o)})),e.collections}C.prototype=new x,C.constructor=C,C.prototype.prepareCollections=function(){var t=this;t.collections.create=t.create.bind(t),t.collections.on=t.on.bind(t),t.collections.off=t.off.bind(t),t.collections.destroy=t.destroy.bind(t),t.collections.get=function(e){var n;return t.collections.every((function(t){return!(n=t.get(e))})),n}},C.prototype.create=function(t){return this.createCollection(t)},C.prototype.createCollection=function(t){var e=new K(this,t);return this.bindCollection(e),this.collections.push(e),e},C.prototype.bindCollection=function(t){var e,n=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,n.trigger(e,o)};t.on("destroyed",n.onDestroyed.bind(n)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},C.prototype.bindDocument=function(){this.binded||(this.bindEvt(document,"move").bindEvt(document,"end"),this.binded=!0)},C.prototype.unbindDocument=function(t){Object.keys(this.ids).length&&!0!==t||(this.unbindEvt(document,"move").unbindEvt(document,"end"),this.binded=!1)},C.prototype.getIdentifier=function(t){var e;return t?void 0===(e=void 0===t.identifier?t.pointerId:t.identifier)&&(e=this.latest||0):e=this.index,void 0===this.ids[e]&&(this.ids[e]=this.index,this.index+=1),this.latest=e,this.ids[e]},C.prototype.removeIdentifier=function(t){var e={};for(var n in this.ids)if(this.ids[n]===t){e.id=n,e.identifier=this.ids[n],delete this.ids[n];break}return e},C.prototype.onmove=function(t){return this.onAny("move",t),!1},C.prototype.onend=function(t){return this.onAny("end",t),!1},C.prototype.oncancel=function(t){return this.onAny("end",t),!1},C.prototype.onAny=function(t,e){var n,o=this,i="processOn"+t.charAt(0).toUpperCase()+t.slice(1);return e=l(e),g(e,(function(t){n=o.getIdentifier(t),g(o.collections,function(t,e,n){n.ids.indexOf(e)>=0&&(n[i](t),t._found_=!0)}.bind(null,t,n)),t._found_||o.removeIdentifier(n)})),!1},C.prototype.destroy=function(){this.unbindDocument(!0),this.ids={},this.index=0,this.collections.forEach((function(t){t.destroy()})),this.off()},C.prototype.onDestroyed=function(t,e){if(this.collections.indexOf(e)<0)return!1;this.collections.splice(this.collections.indexOf(e),1)};var O=new C;e.default={create:function(t){return O.create(t)},factory:O}}]).default},"object"==typeof n&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define("nipplejs",[],i):"object"==typeof n?n.nipplejs=i():o.nipplejs=i()},{}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var o,i=function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)},r=function(){function t(t){this.options=t,this.listeners={}}return t.prototype.on=function(t,e){var n=this.listeners[t]||[];this.listeners[t]=n.concat([e])},t.prototype.triggerEvent=function(t,e){var n=this;(this.listeners[t]||[]).forEach((function(t){return t({target:n,event:e})}))},t}();(o=n.NotyfArrayEvent||(n.NotyfArrayEvent={}))[o.Add=0]="Add",o[o.Remove=1]="Remove";var s,a=function(){function t(){this.notifications=[]}return t.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,n.NotyfArrayEvent.Add,this.notifications)},t.prototype.splice=function(t,e){var o=this.notifications.splice(t,e)[0];return this.updateFn(o,n.NotyfArrayEvent.Remove,this.notifications),o},t.prototype.indexOf=function(t){return this.notifications.indexOf(t)},t.prototype.onUpdate=function(t){this.updateFn=t},t}();(s=n.NotyfEvent||(n.NotyfEvent={})).Dismiss="dismiss",s.Click="click";var c={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},u=function(){function t(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),e=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(e),document.body.appendChild(t),this.container=e,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return t.prototype.on=function(t,e){var n;this.events=i(i({},this.events),((n={})[t]=e,n))},t.prototype.update=function(t,e){e===n.NotyfArrayEvent.Add?this.addNotification(t):e===n.NotyfArrayEvent.Remove&&this.removeNotification(t)},t.prototype.removeNotification=function(t){var e,n,o=this,i=this._popRenderedNotification(t);i&&((e=i.node).classList.add("notyf__toast--disappear"),e.addEventListener(this.animationEndEventName,n=function(t){t.target===e&&(e.removeEventListener(o.animationEndEventName,n),o.container.removeChild(e))}))},t.prototype.addNotification=function(t){var e=this._renderNotification(t);this.notifications.push({notification:t,node:e}),this._announce(t.options.message||"Notification")},t.prototype._renderNotification=function(t){var e,n=this._buildNotificationCard(t),o=t.options.className;return o&&(e=n.classList).add.apply(e,o.split(" ")),this.container.appendChild(n),n},t.prototype._popRenderedNotification=function(t){for(var e=-1,n=0;n<this.notifications.length&&e<0;n++)this.notifications[n].notification===t&&(e=n);if(-1!==e)return this.notifications.splice(e,1)[0]},t.prototype.getXPosition=function(t){var e;return(null===(e=null==t?void 0:t.position)||void 0===e?void 0:e.x)||"right"},t.prototype.getYPosition=function(t){var e;return(null===(e=null==t?void 0:t.position)||void 0===e?void 0:e.y)||"bottom"},t.prototype.adjustContainerAlignment=function(t){var e=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],n=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],o=this.container.style;o.setProperty("justify-content",n),o.setProperty("align-items",e)},t.prototype._buildNotificationCard=function(t){var e=this,o=t.options,i=o.icon;this.adjustContainerAlignment(o);var r=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),s=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),a=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),c=this._createHTMLElement({tagName:"div",className:"notyf__message"});c.innerHTML=o.message||"";var u=o.background||o.backgroundColor;if(i){var l=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if(("string"==typeof i||i instanceof String)&&(l.innerHTML=new String(i).valueOf()),"object"==typeof i){var d=i.tagName,h=void 0===d?"i":d,p=i.className,f=i.text,v=i.color,g=void 0===v?u:v,m=this._createHTMLElement({tagName:h,className:p,text:f});g&&(m.style.color=g),l.appendChild(m)}a.appendChild(l)}if(a.appendChild(c),r.appendChild(a),u&&(o.ripple?(s.style.background=u,r.appendChild(s)):r.style.background=u),o.dismissible){var y=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),b=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});y.appendChild(b),a.appendChild(y),r.classList.add("notyf__toast--dismissible"),b.addEventListener("click",(function(o){var i,r;null===(r=(i=e.events)[n.NotyfEvent.Dismiss])||void 0===r||r.call(i,{target:t,event:o}),o.stopPropagation()}))}r.addEventListener("click",(function(o){var i,r;return null===(r=(i=e.events)[n.NotyfEvent.Click])||void 0===r?void 0:r.call(i,{target:t,event:o})}));var _="top"===this.getYPosition(o)?"upper":"lower";return r.classList.add("notyf__toast--"+_),r},t.prototype._createHTMLElement=function(t){var e=t.tagName,n=t.className,o=t.text,i=document.createElement(e);return n&&(i.className=n),i.textContent=o||null,i},t.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},t.prototype._announce=function(t){var e=this;this.a11yContainer.textContent="",setTimeout((function(){e.a11yContainer.textContent=t}),100)},t.prototype._getAnimationEndEventName=function(){var t,e=document.createElement("_fake"),n={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in n)if(void 0!==e.style[t])return n[t];return"animationend"},t}(),l=function(){function t(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new a,this.view=new u;var o=this.registerTypes(t);this.options=i(i({},c),t),this.options.types=o,this.notifications.onUpdate((function(t,n){return e.view.update(t,n)})),this.view.on(n.NotyfEvent.Dismiss,(function(t){var o=t.target,i=t.event;e._removeNotification(o),o.triggerEvent(n.NotyfEvent.Dismiss,i)})),this.view.on(n.NotyfEvent.Click,(function(t){var e=t.target,o=t.event;return e.triggerEvent(n.NotyfEvent.Click,o)}))}return t.prototype.error=function(t){var e=this.normalizeOptions("error",t);return this.open(e)},t.prototype.success=function(t){var e=this.normalizeOptions("success",t);return this.open(e)},t.prototype.open=function(t){var e=this.options.types.find((function(e){return e.type===t.type}))||{},n=i(i({},e),t);this.assignProps(["ripple","position","dismissible"],n);var o=new r(n);return this._pushNotification(o),o},t.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},t.prototype.assignProps=function(t,e){var n=this;t.forEach((function(t){e[t]=null==e[t]?n.options[t]:e[t]}))},t.prototype._pushNotification=function(t){var e=this;this.notifications.push(t);var n=void 0!==t.options.duration?t.options.duration:this.options.duration;n&&setTimeout((function(){return e._removeNotification(t)}),n)},t.prototype._removeNotification=function(t){var e=this.notifications.indexOf(t);-1!==e&&this.notifications.splice(e,1)},t.prototype.normalizeOptions=function(t,e){var n={type:t};return"string"==typeof e?n.message=e:"object"==typeof e&&(n=i(i({},n),e)),n},t.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice();return c.types.map((function(t){var n=-1;e.forEach((function(e,o){e.type===t.type&&(n=o)}));var o=-1!==n?e.splice(n,1)[0]:{};return i(i({},t),o)})).concat(e)},t}();n.DEFAULT_OPTIONS=c,n.Notyf=l,n.NotyfArray=a,n.NotyfNotification=r,n.NotyfView=u},{}],16:[function(t,e,n){var o,i;o=this,i=function(){return function(){var t={9662:function(t,e,n){var o=n(614),i=n(6330),r=TypeError;t.exports=function(t){if(o(t))return t;throw r(i(t)+" is not a function")}},9483:function(t,e,n){var o=n(4411),i=n(6330),r=TypeError;t.exports=function(t){if(o(t))return t;throw r(i(t)+" is not a constructor")}},6077:function(t,e,n){var o=n(614),i=String,r=TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw r("Can't set "+i(t)+" as a prototype")}},1223:function(t,e,n){var o=n(5112),i=n(30),r=n(3070).f,s=o("unscopables"),a=Array.prototype;null==a[s]&&r(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1530:function(t,e,n){"use strict";var o=n(8710).charAt;t.exports=function(t,e,n){return e+(n?o(t,e).length:1)}},9670:function(t,e,n){var o=n(111),i=String,r=TypeError;t.exports=function(t){if(o(t))return t;throw r(i(t)+" is not an object")}},8533:function(t,e,n){"use strict";var o=n(2092).forEach,i=n(9341)("forEach");t.exports=i?[].forEach:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,n){"use strict";var o=n(9974),i=n(6916),r=n(7908),s=n(3411),a=n(7659),c=n(4411),u=n(6244),l=n(6135),d=n(8554),h=n(1246),p=Array;t.exports=function(t){var e=r(t),n=c(this),f=arguments.length,v=f>1?arguments[1]:void 0,g=void 0!==v;g&&(v=o(v,f>2?arguments[2]:void 0));var m,y,b,_,w,D,x=h(e),B=0;if(!x||this===p&&a(x))for(m=u(e),y=n?new this(m):p(m);m>B;B++)D=g?v(e[B],B):e[B],l(y,B,D);else for(w=(_=d(e,x)).next,y=n?new this:[];!(b=i(w,_)).done;B++)D=g?s(_,v,[b.value,B],!0):b.value,l(y,B,D);return y.length=B,y}},1318:function(t,e,n){var o=n(5656),i=n(1400),r=n(6244),s=function(t){return function(e,n,s){var a,c=o(e),u=r(c),l=i(s,u);if(t&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},2092:function(t,e,n){var o=n(9974),i=n(1702),r=n(8361),s=n(7908),a=n(6244),c=n(5417),u=i([].push),l=function(t){var e=1==t,n=2==t,i=3==t,l=4==t,d=6==t,h=7==t,p=5==t||d;return function(f,v,g,m){for(var y,b,_=s(f),w=r(_),D=o(v,g),x=a(w),B=0,E=m||c,k=e?E(f,x):n||h?E(f,0):void 0;x>B;B++)if((p||B in w)&&(b=D(y=w[B],B,_),t))if(e)k[B]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return B;case 2:u(k,y)}else switch(t){case 4:return!1;case 7:u(k,y)}return d?-1:i||l?l:k}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},1194:function(t,e,n){var o=n(7293),i=n(5112),r=n(7392),s=i("species");t.exports=function(t){return r>=51||!o((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:function(t,e,n){"use strict";var o=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){return 1},1)}))}},3671:function(t,e,n){var o=n(9662),i=n(7908),r=n(8361),s=n(6244),a=TypeError,c=function(t){return function(e,n,c,u){o(n);var l=i(e),d=r(l),h=s(l),p=t?h-1:0,f=t?-1:1;if(c<2)for(;;){if(p in d){u=d[p],p+=f;break}if(p+=f,t?p<0:h<=p)throw a("Reduce of empty array with no initial value")}for(;t?p>=0:h>p;p+=f)p in d&&(u=n(u,d[p],p,l));return u}};t.exports={left:c(!1),right:c(!0)}},1589:function(t,e,n){var o=n(1400),i=n(6244),r=n(6135),s=Array,a=Math.max;t.exports=function(t,e,n){for(var c=i(t),u=o(e,c),l=o(void 0===n?c:n,c),d=s(a(l-u,0)),h=0;u<l;u++,h++)r(d,h,t[u]);return d.length=h,d}},206:function(t,e,n){var o=n(1702);t.exports=o([].slice)},4362:function(t,e,n){var o=n(1589),i=Math.floor,r=function(t,e){var n=t.length,c=i(n/2);return n<8?s(t,e):a(t,r(o(t,0,c),e),r(o(t,c),e),e)},s=function(t,e){for(var n,o,i=t.length,r=1;r<i;){for(o=r,n=t[r];o&&e(t[o-1],n)>0;)t[o]=t[--o];o!==r++&&(t[o]=n)}return t},a=function(t,e,n,o){for(var i=e.length,r=n.length,s=0,a=0;s<i||a<r;)t[s+a]=s<i&&a<r?o(e[s],n[a])<=0?e[s++]:n[a++]:s<i?e[s++]:n[a++];return t};t.exports=r},7475:function(t,e,n){var o=n(3157),i=n(4411),r=n(111),s=n(5112)("species"),a=Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===a||o(e.prototype))||r(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},5417:function(t,e,n){var o=n(7475);t.exports=function(t,e){return new(o(t))(0===e?0:e)}},3411:function(t,e,n){var o=n(9670),i=n(9212);t.exports=function(t,e,n,r){try{return r?e(o(n)[0],n[1]):e(n)}catch(e){i(t,"throw",e)}}},7072:function(t,e,n){var o=n(5112)("iterator"),i=!1;try{var r=0,s={next:function(){return{done:!!r++}},return:function(){i=!0}};s[o]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}},4326:function(t,e,n){var o=n(1702),i=o({}.toString),r=o("".slice);t.exports=function(t){return r(i(t),8,-1)}},648:function(t,e,n){var o=n(1694),i=n(614),r=n(4326),s=n(5112)("toStringTag"),a=Object,c="Arguments"==r(function(){return arguments}());t.exports=o?r:function(t){var e,n,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:c?r(e):"Object"==(o=r(e))&&i(e.callee)?"Arguments":o}},9920:function(t,e,n){var o=n(2597),i=n(3887),r=n(1236),s=n(3070);t.exports=function(t,e,n){for(var a=i(e),c=s.f,u=r.f,l=0;l<a.length;l++){var d=a[l];o(t,d)||n&&o(n,d)||c(t,d,u(e,d))}}},4964:function(t,e,n){var o=n(5112)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[o]=!1,"/./"[t](e)}catch(t){}}return!1}},8544:function(t,e,n){var o=n(7293);t.exports=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:function(t,e,n){"use strict";var o=n(3383).IteratorPrototype,i=n(30),r=n(9114),s=n(8003),a=n(7497),c=function(){return this};t.exports=function(t,e,n,u){var l=e+" Iterator";return t.prototype=i(o,{next:r(+!u,n)}),s(t,l,!1,!0),a[l]=c,t}},8880:function(t,e,n){var o=n(9781),i=n(3070),r=n(9114);t.exports=o?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},9114:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:function(t,e,n){"use strict";var o=n(4948),i=n(3070),r=n(9114);t.exports=function(t,e,n){var s=o(e);s in t?i.f(t,s,r(0,n)):t[s]=n}},8052:function(t,e,n){var o=n(614),i=n(3070),r=n(6339),s=n(3072);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,u=void 0!==a.name?a.name:e;if(o(n)&&r(n,u,a),a.global)c?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},3072:function(t,e,n){var o=n(7854),i=Object.defineProperty;t.exports=function(t,e){try{i(o,t,{value:e,configurable:!0,writable:!0})}catch(n){o[t]=e}return e}},654:function(t,e,n){"use strict";var o=n(2109),i=n(6916),r=n(1913),s=n(6530),a=n(614),c=n(4994),u=n(9518),l=n(7674),d=n(8003),h=n(8880),p=n(8052),f=n(5112),v=n(7497),g=n(3383),m=s.PROPER,y=s.CONFIGURABLE,b=g.IteratorPrototype,_=g.BUGGY_SAFARI_ITERATORS,w=f("iterator"),D="keys",x="values",B="entries",E=function(){return this};t.exports=function(t,e,n,s,f,g,k){c(n,e,s);var K,C,O,S=function(t){if(t===f&&L)return L;if(!_&&t in M)return M[t];switch(t){case D:case x:case B:return function(){return new n(this,t)}}return function(){return new n(this)}},P=e+" Iterator",T=!1,M=t.prototype,I=M[w]||M["@@iterator"]||f&&M[f],L=!_&&I||S(f),N="Array"==e&&M.entries||I;if(N&&(K=u(N.call(new t)))!==Object.prototype&&K.next&&(r||u(K)===b||(l?l(K,b):a(K[w])||p(K,w,E)),d(K,P,!0,!0),r&&(v[P]=E)),m&&f==x&&I&&I.name!==x&&(!r&&y?h(M,"name",x):(T=!0,L=function(){return i(I,this)})),f)if(C={values:S(x),keys:g?L:S(D),entries:S(B)},k)for(O in C)(_||T||!(O in M))&&p(M,O,C[O]);else o({target:e,proto:!0,forced:_||T},C);return r&&!k||M[w]===L||p(M,w,L,{name:f}),v[e]=L,C}},7235:function(t,e,n){var o=n(857),i=n(2597),r=n(6061),s=n(3070).f;t.exports=function(t){var e=o.Symbol||(o.Symbol={});i(e,t)||s(e,t,{value:r.f(t)})}},5117:function(t,e,n){"use strict";var o=n(6330),i=TypeError;t.exports=function(t,e){if(!delete t[e])throw i("Cannot delete property "+o(e)+" of "+o(t))}},9781:function(t,e,n){var o=n(7293);t.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(t,e,n){var o=n(7854),i=n(111),r=o.document,s=i(r)&&i(r.createElement);t.exports=function(t){return s?r.createElement(t):{}}},7207:function(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},8324:function(t){t.exports={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}},8509:function(t,e,n){var o=n(317)("span").classList,i=o&&o.constructor&&o.constructor.prototype;t.exports=i===Object.prototype?void 0:i},8886:function(t,e,n){var o=n(8113).match(/firefox\/(\d+)/i);t.exports=!!o&&+o[1]},256:function(t,e,n){var o=n(8113);t.exports=/MSIE|Trident/.test(o)},5268:function(t,e,n){var o=n(4326),i=n(7854);t.exports="process"==o(i.process)},8113:function(t,e,n){var o=n(5005);t.exports=o("navigator","userAgent")||""},7392:function(t,e,n){var o,i,r=n(7854),s=n(8113),a=r.process,c=r.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;l&&(i=(o=l.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!i&&s&&(!(o=s.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=s.match(/Chrome\/(\d+)/))&&(i=+o[1]),t.exports=i},8008:function(t,e,n){var o=n(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!o&&+o[1]},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var o=n(7854),i=n(1236).f,r=n(8880),s=n(8052),a=n(3072),c=n(9920),u=n(4705);t.exports=function(t,e){var n,l,d,h,p,f=t.target,v=t.global,g=t.stat;if(n=v?o:g?o[f]||a(f,{}):(o[f]||{}).prototype)for(l in e){if(h=e[l],d=t.dontCallGetSet?(p=i(n,l))&&p.value:n[l],!u(v?l:f+(g?".":"#")+l,t.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(t.sham||d&&d.sham)&&r(h,"sham",!0),s(n,l,h,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,n){"use strict";n(4916);var o=n(1702),i=n(8052),r=n(2261),s=n(7293),a=n(5112),c=n(8880),u=a("species"),l=RegExp.prototype;t.exports=function(t,e,n,d){var h=a(t),p=!s((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),f=p&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return e=!0,null},n[h](""),!e}));if(!p||!f||n){var v=o(/./[h]),g=e(h,""[t],(function(t,e,n,i,s){var a=o(t),c=e.exec;return c===r||c===l.exec?p&&!s?{done:!0,value:v(e,n,i)}:{done:!0,value:a(n,e,i)}:{done:!1}}));i(String.prototype,t,g[0]),i(l,h,g[1])}d&&c(l[h],"sham",!0)}},2104:function(t,e,n){var o=n(4374),i=Function.prototype,r=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?s.bind(r):function(){return s.apply(r,arguments)})},9974:function(t,e,n){var o=n(1702),i=n(9662),r=n(4374),s=o(o.bind);t.exports=function(t,e){return i(t),void 0===e?t:r?s(t,e):function(){return t.apply(e,arguments)}}},4374:function(t,e,n){var o=n(7293);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,e,n){var o=n(4374),i=Function.prototype.call;t.exports=o?i.bind(i):function(){return i.apply(i,arguments)}},6530:function(t,e,n){var o=n(9781),i=n(2597),r=Function.prototype,s=o&&Object.getOwnPropertyDescriptor,a=i(r,"name"),c=a&&"something"===function(){}.name,u=a&&(!o||o&&s(r,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},1702:function(t,e,n){var o=n(4374),i=Function.prototype,r=i.bind,s=i.call,a=o&&r.bind(s,s);t.exports=o?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},5005:function(t,e,n){var o=n(7854),i=n(614),r=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?r(o[t]):o[t]&&o[t][e]}},1246:function(t,e,n){var o=n(648),i=n(8173),r=n(7497),s=n(5112)("iterator");t.exports=function(t){if(null!=t)return i(t,s)||i(t,"@@iterator")||r[o(t)]}},8554:function(t,e,n){var o=n(6916),i=n(9662),r=n(9670),s=n(6330),a=n(1246),c=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(i(n))return r(o(n,t));throw c(s(t)+" is not iterable")}},8173:function(t,e,n){var o=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:o(n)}},647:function(t,e,n){var o=n(1702),i=n(7908),r=Math.floor,s=o("".charAt),a=o("".replace),c=o("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,o,d,h){var p=n+t.length,f=o.length,v=l;return void 0!==d&&(d=i(d),v=u),a(h,v,(function(i,a){var u;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return c(e,0,n);case"'":return c(e,p);case"<":u=d[c(a,1,-1)];break;default:var l=+a;if(0===l)return i;if(l>f){var h=r(l/10);return 0===h?i:h<=f?void 0===o[h-1]?s(a,1):o[h-1]+s(a,1):i}u=o[l-1]}return void 0===u?"":u}))}},7854:function(t,e,n){var o=function(t){return t&&t.Math==Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,e,n){var o=n(1702),i=n(7908),r=o({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return r(i(t),e)}},3501:function(t){t.exports={}},490:function(t,e,n){var o=n(5005);t.exports=o("document","documentElement")},4664:function(t,e,n){var o=n(9781),i=n(7293),r=n(317);t.exports=!o&&!i((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,e,n){var o=n(1702),i=n(7293),r=n(4326),s=Object,a=o("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?a(t,""):s(t)}:s},9587:function(t,e,n){var o=n(614),i=n(111),r=n(7674);t.exports=function(t,e,n){var s,a;return r&&o(s=e.constructor)&&s!==n&&i(a=s.prototype)&&a!==n.prototype&&r(t,a),t}},2788:function(t,e,n){var o=n(1702),i=n(614),r=n(5465),s=o(Function.toString);i(r.inspectSource)||(r.inspectSource=function(t){return s(t)}),t.exports=r.inspectSource},9909:function(t,e,n){var o,i,r,s=n(8536),a=n(7854),c=n(1702),u=n(111),l=n(8880),d=n(2597),h=n(5465),p=n(6200),f=n(3501),v="Object already initialized",g=a.TypeError,m=a.WeakMap;if(s||h.state){var y=h.state||(h.state=new m),b=c(y.get),_=c(y.has),w=c(y.set);o=function(t,e){if(_(y,t))throw new g(v);return e.facade=t,w(y,t,e),e},i=function(t){return b(y,t)||{}},r=function(t){return _(y,t)}}else{var D=p("state");f[D]=!0,o=function(t,e){if(d(t,D))throw new g(v);return e.facade=t,l(t,D,e),e},i=function(t){return d(t,D)?t[D]:{}},r=function(t){return d(t,D)}}t.exports={set:o,get:i,has:r,enforce:function(t){return r(t)?i(t):o(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}}}},7659:function(t,e,n){var o=n(5112),i=n(7497),r=o("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[r]===t)}},3157:function(t,e,n){var o=n(4326);t.exports=Array.isArray||function(t){return"Array"==o(t)}},614:function(t){t.exports=function(t){return"function"==typeof t}},4411:function(t,e,n){var o=n(1702),i=n(7293),r=n(614),s=n(648),a=n(5005),c=n(2788),u=function(){},l=[],d=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=o(h.exec),f=!h.exec(u),v=function(t){if(!r(t))return!1;try{return d(u,l,t),!0}catch(t){return!1}},g=function(t){if(!r(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(h,c(t))}catch(t){return!0}};g.sham=!0,t.exports=!d||i((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?g:v},4705:function(t,e,n){var o=n(7293),i=n(614),r=/#|\.prototype\./,s=function(t,e){var n=c[a(t)];return n==l||n!=u&&(i(e)?o(e):!!e)},a=s.normalize=function(t){return String(t).replace(r,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},5988:function(t,e,n){var o=n(111),i=Math.floor;t.exports=Number.isInteger||function(t){return!o(t)&&isFinite(t)&&i(t)===t}},111:function(t,e,n){var o=n(614);t.exports=function(t){return"object"==typeof t?null!==t:o(t)}},1913:function(t){t.exports=!1},7850:function(t,e,n){var o=n(111),i=n(4326),r=n(5112)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==i(t))}},2190:function(t,e,n){var o=n(5005),i=n(614),r=n(7976),s=n(3307),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&r(e.prototype,a(t))}},9212:function(t,e,n){var o=n(6916),i=n(9670),r=n(8173);t.exports=function(t,e,n){var s,a;i(t);try{if(!(s=r(t,"return"))){if("throw"===e)throw n;return n}s=o(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return i(s),n}},3383:function(t,e,n){"use strict";var o,i,r,s=n(7293),a=n(614),c=n(30),u=n(9518),l=n(8052),d=n(5112),h=n(1913),p=d("iterator"),f=!1;[].keys&&("next"in(r=[].keys())?(i=u(u(r)))!==Object.prototype&&(o=i):f=!0),null==o||s((function(){var t={};return o[p].call(t)!==t}))?o={}:h&&(o=c(o)),a(o[p])||l(o,p,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:f}},7497:function(t){t.exports={}},6244:function(t,e,n){var o=n(7466);t.exports=function(t){return o(t.length)}},6339:function(t,e,n){var o=n(7293),i=n(614),r=n(2597),s=n(9781),a=n(6530).CONFIGURABLE,c=n(2788),u=n(9909),l=u.enforce,d=u.get,h=Object.defineProperty,p=s&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),f=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||a&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),p&&n&&r(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var o=l(t);return r(o,"source")||(o.source=f.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return i(this)&&d(this).source||c(this)}),"toString")},4758:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var o=+t;return(o>0?n:e)(o)}},735:function(t,e,n){var o=n(133);t.exports=o&&!!Symbol.for&&!!Symbol.keyFor},133:function(t,e,n){var o=n(7392),i=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},8536:function(t,e,n){var o=n(7854),i=n(614),r=n(2788),s=o.WeakMap;t.exports=i(s)&&/native code/.test(r(s))},3929:function(t,e,n){var o=n(7850),i=TypeError;t.exports=function(t){if(o(t))throw i("The method doesn't accept regular expressions");return t}},1574:function(t,e,n){"use strict";var o=n(9781),i=n(1702),r=n(6916),s=n(7293),a=n(1956),c=n(5181),u=n(5296),l=n(7908),d=n(8361),h=Object.assign,p=Object.defineProperty,f=i([].concat);t.exports=!h||s((function(){if(o&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=h({},t)[n]||a(h({},e)).join("")!=i}))?function(t,e){for(var n=l(t),i=arguments.length,s=1,h=c.f,p=u.f;i>s;)for(var v,g=d(arguments[s++]),m=h?f(a(g),h(g)):a(g),y=m.length,b=0;y>b;)v=m[b++],o&&!r(p,g,v)||(n[v]=g[v]);return n}:h},30:function(t,e,n){var o,i=n(9670),r=n(6048),s=n(748),a=n(3501),c=n(490),u=n(317),l=n(6200)("IE_PROTO"),d=function(){},h=function(t){return"<script>"+t+"<\/script>"},p=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},f=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}var t,e;f="undefined"!=typeof document?document.domain&&o?p(o):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):p(o);for(var n=s.length;n--;)delete f.prototype[s[n]];return f()};a[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=i(t),n=new d,d.prototype=null,n[l]=t):n=f(),void 0===e?n:r.f(n,e)}},6048:function(t,e,n){var o=n(9781),i=n(3353),r=n(3070),s=n(9670),a=n(5656),c=n(1956);e.f=o&&!i?Object.defineProperties:function(t,e){s(t);for(var n,o=a(e),i=c(e),u=i.length,l=0;u>l;)r.f(t,n=i[l++],o[n]);return t}},3070:function(t,e,n){var o=n(9781),i=n(4664),r=n(3353),s=n(9670),a=n(4948),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor;e.f=o?r?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var o=l(t,e);o&&o.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:o.configurable,enumerable:"enumerable"in n?n.enumerable:o.enumerable,writable:!1})}return u(t,e,n)}:u:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:function(t,e,n){var o=n(9781),i=n(6916),r=n(5296),s=n(9114),a=n(5656),c=n(4948),u=n(2597),l=n(4664),d=Object.getOwnPropertyDescriptor;e.f=o?d:function(t,e){if(t=a(t),e=c(e),l)try{return d(t,e)}catch(t){}if(u(t,e))return s(!i(r.f,t,e),t[e])}},1156:function(t,e,n){var o=n(4326),i=n(5656),r=n(8006).f,s=n(1589),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"==o(t)?function(t){try{return r(t)}catch(t){return s(a)}}(t):r(i(t))}},8006:function(t,e,n){var o=n(6324),i=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,i)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,n){var o=n(2597),i=n(614),r=n(7908),s=n(6200),a=n(8544),c=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=a?u.getPrototypeOf:function(t){var e=r(t);if(o(e,c))return e[c];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof u?l:null}},7976:function(t,e,n){var o=n(1702);t.exports=o({}.isPrototypeOf)},6324:function(t,e,n){var o=n(1702),i=n(2597),r=n(5656),s=n(1318).indexOf,a=n(3501),c=o([].push);t.exports=function(t,e){var n,o=r(t),u=0,l=[];for(n in o)!i(a,n)&&i(o,n)&&c(l,n);for(;e.length>u;)i(o,n=e[u++])&&(~s(l,n)||c(l,n));return l}},1956:function(t,e,n){var o=n(6324),i=n(748);t.exports=Object.keys||function(t){return o(t,i)}},5296:function(t,e){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},9026:function(t,e,n){"use strict";var o=n(1913),i=n(7854),r=n(7293),s=n(8008);t.exports=o||!r((function(){if(!(s&&s<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i[t]}}))},7674:function(t,e,n){var o=n(1702),i=n(9670),r=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=o(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return i(n),r(o),e?t(n,o):n.__proto__=o,n}}():void 0)},288:function(t,e,n){"use strict";var o=n(1694),i=n(648);t.exports=o?{}.toString:function(){return"[object "+i(this)+"]"}},2140:function(t,e,n){var o=n(6916),i=n(614),r=n(111),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!r(a=o(n,t)))return a;if(i(n=t.valueOf)&&!r(a=o(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!r(a=o(n,t)))return a;throw s("Can't convert object to primitive value")}},3887:function(t,e,n){var o=n(5005),i=n(1702),r=n(8006),s=n(5181),a=n(9670),c=i([].concat);t.exports=o("Reflect","ownKeys")||function(t){var e=r.f(a(t)),n=s.f;return n?c(e,n(t)):e}},857:function(t,e,n){var o=n(7854);t.exports=o},2626:function(t,e,n){var o=n(3070).f;t.exports=function(t,e,n){n in t||o(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},7651:function(t,e,n){var o=n(6916),i=n(9670),r=n(614),s=n(4326),a=n(2261),c=TypeError;t.exports=function(t,e){var n=t.exec;if(r(n)){var u=o(n,t,e);return null!==u&&i(u),u}if("RegExp"===s(t))return o(a,t,e);throw c("RegExp#exec called on incompatible receiver")}},2261:function(t,e,n){"use strict";var o,i,r=n(6916),s=n(1702),a=n(1340),c=n(7066),u=n(2999),l=n(2309),d=n(30),h=n(9909).get,p=n(9441),f=n(7168),v=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,m=g,y=s("".charAt),b=s("".indexOf),_=s("".replace),w=s("".slice),D=(i=/b*/g,r(g,o=/a/,"a"),r(g,i,"a"),0!==o.lastIndex||0!==i.lastIndex),x=u.BROKEN_CARET,B=void 0!==/()??/.exec("")[1];(D||B||x||p||f)&&(m=function(t){var e,n,o,i,s,u,l,p=this,f=h(p),E=a(t),k=f.raw;if(k)return k.lastIndex=p.lastIndex,e=r(m,k,E),p.lastIndex=k.lastIndex,e;var K=f.groups,C=x&&p.sticky,O=r(c,p),S=p.source,P=0,T=E;if(C&&(O=_(O,"y",""),-1===b(O,"g")&&(O+="g"),T=w(E,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(E,p.lastIndex-1))&&(S="(?: "+S+")",T=" "+T,P++),n=new RegExp("^(?:"+S+")",O)),B&&(n=new RegExp("^"+S+"$(?!\\s)",O)),D&&(o=p.lastIndex),i=r(g,C?n:p,T),C?i?(i.input=w(i.input,P),i[0]=w(i[0],P),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:D&&i&&(p.lastIndex=p.global?i.index+i[0].length:o),B&&i&&i.length>1&&r(v,i[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&K)for(i.groups=u=d(null),s=0;s<K.length;s++)u[(l=K[s])[0]]=i[l[1]];return i}),t.exports=m},7066:function(t,e,n){"use strict";var o=n(9670);t.exports=function(){var t=o(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},4706:function(t,e,n){var o=n(6916),i=n(2597),r=n(7976),s=n(7066),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||i(t,"flags")||!r(a,t)?e:o(s,t)}},2999:function(t,e,n){var o=n(7293),i=n(7854).RegExp,r=o((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=r||o((function(){return!i("a","y").sticky})),a=r||o((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:r}},9441:function(t,e,n){var o=n(7293),i=n(7854).RegExp;t.exports=o((function(){var t=i(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},7168:function(t,e,n){var o=n(7293),i=n(7854).RegExp;t.exports=o((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},6340:function(t,e,n){"use strict";var o=n(5005),i=n(3070),r=n(5112),s=n(9781),a=r("species");t.exports=function(t){var e=o(t),n=i.f;s&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},8003:function(t,e,n){var o=n(3070).f,i=n(2597),r=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,r)&&o(t,r,{configurable:!0,value:e})}},6200:function(t,e,n){var o=n(2309),i=n(9711),r=o("keys");t.exports=function(t){return r[t]||(r[t]=i(t))}},5465:function(t,e,n){var o=n(7854),i=n(3072),r="__core-js_shared__",s=o[r]||i(r,{});t.exports=s},2309:function(t,e,n){var o=n(1913),i=n(5465);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.5",mode:o?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(t,e,n){var o=n(9670),i=n(9483),r=n(5112)("species");t.exports=function(t,e){var n,s=o(t).constructor;return void 0===s||null==(n=o(s)[r])?e:i(n)}},8710:function(t,e,n){var o=n(1702),i=n(9303),r=n(1340),s=n(4488),a=o("".charAt),c=o("".charCodeAt),u=o("".slice),l=function(t){return function(e,n){var o,l,d=r(s(e)),h=i(n),p=d.length;return h<0||h>=p?t?"":void 0:(o=c(d,h))<55296||o>56319||h+1===p||(l=c(d,h+1))<56320||l>57343?t?a(d,h):o:t?u(d,h,h+2):l-56320+(o-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},6091:function(t,e,n){var o=n(6530).PROPER,i=n(7293),r=n(1361);t.exports=function(t){return i((function(){return!!r[t]()||"…"!=="…"[t]()||o&&r[t].name!==t}))}},3111:function(t,e,n){var o=n(1702),i=n(4488),r=n(1340),s=n(1361),a=o("".replace),c="["+s+"]",u=RegExp("^"+c+c+"*"),l=RegExp(c+c+"*$"),d=function(t){return function(e){var n=r(i(e));return 1&t&&(n=a(n,u,"")),2&t&&(n=a(n,l,"")),n}};t.exports={start:d(1),end:d(2),trim:d(3)}},6532:function(t,e,n){var o=n(6916),i=n(5005),r=n(5112),s=n(8052);t.exports=function(){var t=i("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,a=r("toPrimitive");e&&!e[a]&&s(e,a,(function(t){return o(n,this)}),{arity:1})}},863:function(t,e,n){var o=n(1702);t.exports=o(1..valueOf)},1400:function(t,e,n){var o=n(9303),i=Math.max,r=Math.min;t.exports=function(t,e){var n=o(t);return n<0?i(n+e,0):r(n,e)}},5656:function(t,e,n){var o=n(8361),i=n(4488);t.exports=function(t){return o(i(t))}},9303:function(t,e,n){var o=n(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:o(e)}},7466:function(t,e,n){var o=n(9303),i=Math.min;t.exports=function(t){return t>0?i(o(t),9007199254740991):0}},7908:function(t,e,n){var o=n(4488),i=Object;t.exports=function(t){return i(o(t))}},7593:function(t,e,n){var o=n(6916),i=n(111),r=n(2190),s=n(8173),a=n(2140),c=n(5112),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!i(t)||r(t))return t;var n,c=s(t,l);if(c){if(void 0===e&&(e="default"),n=o(c,t,e),!i(n)||r(n))return n;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},4948:function(t,e,n){var o=n(7593),i=n(2190);t.exports=function(t){var e=o(t,"string");return i(e)?e:e+""}},1694:function(t,e,n){var o={};o[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(o)},1340:function(t,e,n){var o=n(648),i=String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},6330:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:function(t,e,n){var o=n(1702),i=0,r=Math.random(),s=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+r,36)}},3307:function(t,e,n){var o=n(133);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,e,n){var o=n(9781),i=n(7293);t.exports=o&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},6061:function(t,e,n){var o=n(5112);e.f=o},5112:function(t,e,n){var o=n(7854),i=n(2309),r=n(2597),s=n(9711),a=n(133),c=n(3307),u=i("wks"),l=o.Symbol,d=l&&l.for,h=c?l:l&&l.withoutSetter||s;t.exports=function(t){if(!r(u,t)||!a&&"string"!=typeof u[t]){var e="Symbol."+t;a&&r(l,t)?u[t]=l[t]:u[t]=c&&d?d(e):h(e)}return u[t]}},1361:function(t){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},2222:function(t,e,n){"use strict";var o=n(2109),i=n(7293),r=n(3157),s=n(111),a=n(7908),c=n(6244),u=n(7207),l=n(6135),d=n(5417),h=n(1194),p=n(5112),f=n(7392),v=p("isConcatSpreadable"),g=f>=51||!i((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),m=h("concat"),y=function(t){if(!s(t))return!1;var e=t[v];return void 0!==e?!!e:r(t)};o({target:"Array",proto:!0,arity:1,forced:!g||!m},{concat:function(t){var e,n,o,i,r,s=a(this),h=d(s,0),p=0;for(e=-1,o=arguments.length;e<o;e++)if(y(r=-1===e?s:arguments[e]))for(i=c(r),u(p+i),n=0;n<i;n++,p++)n in r&&l(h,p,r[n]);else u(p+1),l(h,p++,r);return h.length=p,h}})},7327:function(t,e,n){"use strict";var o=n(2109),i=n(2092).filter;o({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},1038:function(t,e,n){var o=n(2109),i=n(8457);o({target:"Array",stat:!0,forced:!n(7072)((function(t){Array.from(t)}))},{from:i})},6699:function(t,e,n){"use strict";var o=n(2109),i=n(1318).includes,r=n(7293),s=n(1223);o({target:"Array",proto:!0,forced:r((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},2772:function(t,e,n){"use strict";var o=n(2109),i=n(1702),r=n(1318).indexOf,s=n(9341),a=i([].indexOf),c=!!a&&1/a([1],1,-0)<0,u=s("indexOf");o({target:"Array",proto:!0,forced:c||!u},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return c?a(this,t,e)||0:r(this,t,e)}})},6992:function(t,e,n){"use strict";var o=n(5656),i=n(1223),r=n(7497),s=n(9909),a=n(3070).f,c=n(654),u=n(1913),l=n(9781),d="Array Iterator",h=s.set,p=s.getterFor(d);t.exports=c(Array,"Array",(function(t,e){h(this,{type:d,target:o(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,o=t.index++;return!e||o>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:o,done:!1}:"values"==n?{value:e[o],done:!1}:{value:[o,e[o]],done:!1}}),"values");var f=r.Arguments=r.Array;if(i("keys"),i("values"),i("entries"),!u&&l&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(t){}},9600:function(t,e,n){"use strict";var o=n(2109),i=n(1702),r=n(8361),s=n(5656),a=n(9341),c=i([].join),u=r!=Object,l=a("join",",");o({target:"Array",proto:!0,forced:u||!l},{join:function(t){return c(s(this),void 0===t?",":t)}})},1249:function(t,e,n){"use strict";var o=n(2109),i=n(2092).map;o({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},5827:function(t,e,n){"use strict";var o=n(2109),i=n(3671).left,r=n(9341),s=n(7392),a=n(5268);o({target:"Array",proto:!0,forced:!r("reduce")||!a&&s>79&&s<83},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},7042:function(t,e,n){"use strict";var o=n(2109),i=n(3157),r=n(4411),s=n(111),a=n(1400),c=n(6244),u=n(5656),l=n(6135),d=n(5112),h=n(1194),p=n(206),f=h("slice"),v=d("species"),g=Array,m=Math.max;o({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var n,o,d,h=u(this),f=c(h),y=a(t,f),b=a(void 0===e?f:e,f);if(i(h)&&(n=h.constructor,(r(n)&&(n===g||i(n.prototype))||s(n)&&null===(n=n[v]))&&(n=void 0),n===g||void 0===n))return p(h,y,b);for(o=new(void 0===n?g:n)(m(b-y,0)),d=0;y<b;y++,d++)y in h&&l(o,d,h[y]);return o.length=d,o}})},2707:function(t,e,n){"use strict";var o=n(2109),i=n(1702),r=n(9662),s=n(7908),a=n(6244),c=n(5117),u=n(1340),l=n(7293),d=n(4362),h=n(9341),p=n(8886),f=n(256),v=n(7392),g=n(8008),m=[],y=i(m.sort),b=i(m.push),_=l((function(){m.sort(void 0)})),w=l((function(){m.sort(null)})),D=h("sort"),x=!l((function(){if(v)return v<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var t,e,n,o,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)m.push({k:e+o,v:n})}for(m.sort((function(t,e){return e.v-t.v})),o=0;o<m.length;o++)e=m[o].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));o({target:"Array",proto:!0,forced:_||!w||!D||!x},{sort:function(t){void 0!==t&&r(t);var e=s(this);if(x)return void 0===t?y(e):y(e,t);var n,o,i=[],l=a(e);for(o=0;o<l;o++)o in e&&b(i,e[o]);for(d(i,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:u(e)>u(n)?1:-1}}(t)),n=i.length,o=0;o<n;)e[o]=i[o++];for(;o<l;)c(e,o++);return e}})},561:function(t,e,n){"use strict";var o=n(2109),i=n(7908),r=n(1400),s=n(9303),a=n(6244),c=n(7207),u=n(5417),l=n(6135),d=n(5117),h=n(1194)("splice"),p=Math.max,f=Math.min;o({target:"Array",proto:!0,forced:!h},{splice:function(t,e){var n,o,h,v,g,m,y=i(this),b=a(y),_=r(t,b),w=arguments.length;for(0===w?n=o=0:1===w?(n=0,o=b-_):(n=w-2,o=f(p(s(e),0),b-_)),c(b+n-o),h=u(y,o),v=0;v<o;v++)(g=_+v)in y&&l(h,v,y[g]);if(h.length=o,n<o){for(v=_;v<b-o;v++)m=v+n,(g=v+o)in y?y[m]=y[g]:d(y,m);for(v=b;v>b-o+n;v--)d(y,v-1)}else if(n>o)for(v=b-o;v>_;v--)m=v+n-1,(g=v+o-1)in y?y[m]=y[g]:d(y,m);for(v=0;v<n;v++)y[v+_]=arguments[v+2];return y.length=b-o+n,h}})},8309:function(t,e,n){var o=n(9781),i=n(6530).EXISTS,r=n(1702),s=n(3070).f,a=Function.prototype,c=r(a.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=r(u.exec);o&&!i&&s(a,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(t){return""}}})},8862:function(t,e,n){var o=n(2109),i=n(5005),r=n(2104),s=n(6916),a=n(1702),c=n(7293),u=n(3157),l=n(614),d=n(111),h=n(2190),p=n(206),f=n(133),v=i("JSON","stringify"),g=a(/./.exec),m=a("".charAt),y=a("".charCodeAt),b=a("".replace),_=a(1..toString),w=/[\uD800-\uDFFF]/g,D=/^[\uD800-\uDBFF]$/,x=/^[\uDC00-\uDFFF]$/,B=!f||c((function(){var t=i("Symbol")();return"[null]"!=v([t])||"{}"!=v({a:t})||"{}"!=v(Object(t))})),E=c((function(){return'"\\udf06\\ud834"'!==v("\udf06\ud834")||'"\\udead"'!==v("\udead")})),k=function(t,e){var n=p(arguments),o=e;if((d(e)||void 0!==t)&&!h(t))return u(e)||(e=function(t,e){if(l(o)&&(e=s(o,this,t,e)),!h(e))return e}),n[1]=e,r(v,null,n)},K=function(t,e,n){var o=m(n,e-1),i=m(n,e+1);return g(D,t)&&!g(x,i)||g(x,t)&&!g(D,o)?"\\u"+_(y(t,0),16):t};v&&o({target:"JSON",stat:!0,arity:3,forced:B||E},{stringify:function(t,e,n){var o=p(arguments),i=r(B?k:v,null,o);return E&&"string"==typeof i?b(i,w,K):i}})},9653:function(t,e,n){"use strict";var o=n(9781),i=n(7854),r=n(1702),s=n(4705),a=n(8052),c=n(2597),u=n(9587),l=n(7976),d=n(2190),h=n(7593),p=n(7293),f=n(8006).f,v=n(1236).f,g=n(3070).f,m=n(863),y=n(3111).trim,b="Number",_=i.Number,w=_.prototype,D=i.TypeError,x=r("".slice),B=r("".charCodeAt),E=function(t){var e=h(t,"number");return"bigint"==typeof e?e:k(e)},k=function(t){var e,n,o,i,r,s,a,c,u=h(t,"number");if(d(u))throw D("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=y(u),43===(e=B(u,0))||45===e){if(88===(n=B(u,2))||120===n)return NaN}else if(48===e){switch(B(u,1)){case 66:case 98:o=2,i=49;break;case 79:case 111:o=8,i=55;break;default:return+u}for(s=(r=x(u,2)).length,a=0;a<s;a++)if((c=B(r,a))<48||c>i)return NaN;return parseInt(r,o)}return+u};if(s(b,!_(" 0o1")||!_("0b1")||_("+0x1"))){for(var K,C=function(t){var e=arguments.length<1?0:_(E(t)),n=this;return l(w,n)&&p((function(){m(n)}))?u(Object(e),n,C):e},O=o?f(_):"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(","),S=0;O.length>S;S++)c(_,K=O[S])&&!c(C,K)&&g(C,K,v(_,K));C.prototype=w,w.constructor=C,a(i,b,C,{constructor:!0})}},3161:function(t,e,n){n(2109)({target:"Number",stat:!0},{isInteger:n(5988)})},9601:function(t,e,n){var o=n(2109),i=n(1574);o({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},9595:function(t,e,n){"use strict";var o=n(2109),i=n(9781),r=n(9026),s=n(9662),a=n(7908),c=n(3070);i&&o({target:"Object",proto:!0,forced:r},{__defineGetter__:function(t,e){c.f(a(this),t,{get:s(e),enumerable:!0,configurable:!0})}})},5003:function(t,e,n){var o=n(2109),i=n(7293),r=n(5656),s=n(1236).f,a=n(9781),c=i((function(){s(1)}));o({target:"Object",stat:!0,forced:!a||c,sham:!a},{getOwnPropertyDescriptor:function(t,e){return s(r(t),e)}})},9337:function(t,e,n){var o=n(2109),i=n(9781),r=n(3887),s=n(5656),a=n(1236),c=n(6135);o({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(t){for(var e,n,o=s(t),i=a.f,u=r(o),l={},d=0;u.length>d;)void 0!==(n=i(o,e=u[d++]))&&c(l,e,n);return l}})},6210:function(t,e,n){var o=n(2109),i=n(7293),r=n(1156).f;o({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:r})},9660:function(t,e,n){var o=n(2109),i=n(133),r=n(7293),s=n(5181),a=n(7908);o({target:"Object",stat:!0,forced:!i||r((function(){s.f(1)}))},{getOwnPropertySymbols:function(t){var e=s.f;return e?e(a(t)):[]}})},7941:function(t,e,n){var o=n(2109),i=n(7908),r=n(1956);o({target:"Object",stat:!0,forced:n(7293)((function(){r(1)}))},{keys:function(t){return r(i(t))}})},1539:function(t,e,n){var o=n(1694),i=n(8052),r=n(288);o||i(Object.prototype,"toString",r,{unsafe:!0})},4603:function(t,e,n){var o=n(9781),i=n(7854),r=n(1702),s=n(4705),a=n(9587),c=n(8880),u=n(8006).f,l=n(7976),d=n(7850),h=n(1340),p=n(4706),f=n(2999),v=n(2626),g=n(8052),m=n(7293),y=n(2597),b=n(9909).enforce,_=n(6340),w=n(5112),D=n(9441),x=n(7168),B=w("match"),E=i.RegExp,k=E.prototype,K=i.SyntaxError,C=r(k.exec),O=r("".charAt),S=r("".replace),P=r("".indexOf),T=r("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,L=/a/g,N=new E(I)!==I,A=f.MISSED_STICKY,j=f.UNSUPPORTED_Y;if(s("RegExp",o&&(!N||A||D||x||m((function(){return L[B]=!1,E(I)!=I||E(L)==L||"/a/i"!=E(I,"i")}))))){for(var F=function(t,e){var n,o,i,r,s,u,f=l(k,this),v=d(t),g=void 0===e,m=[],_=t;if(!f&&v&&g&&t.constructor===F)return t;if((v||l(k,t))&&(t=t.source,g&&(e=p(_))),t=void 0===t?"":h(t),e=void 0===e?"":h(e),_=t,D&&"dotAll"in I&&(o=!!e&&P(e,"s")>-1)&&(e=S(e,/s/g,"")),n=e,A&&"sticky"in I&&(i=!!e&&P(e,"y")>-1)&&j&&(e=S(e,/y/g,"")),x&&(t=(r=function(t){for(var e,n=t.length,o=0,i="",r=[],s={},a=!1,c=!1,u=0,l="";o<=n;o++){if("\\"===(e=O(t,o)))e+=O(t,++o);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:C(M,T(t,o+1))&&(o+=2,c=!0),i+=e,u++;continue;case">"===e&&c:if(""===l||y(s,l))throw new K("Invalid capture group name");s[l]=!0,r[r.length]=[l,u],c=!1,l="";continue}c?l+=e:i+=e}return[i,r]}(t))[0],m=r[1]),s=a(E(t,e),f?this:k,F),(o||i||m.length)&&(u=b(s),o&&(u.dotAll=!0,u.raw=F(function(t){for(var e,n=t.length,o=0,i="",r=!1;o<=n;o++)"\\"!==(e=O(t,o))?r||"."!==e?("["===e?r=!0:"]"===e&&(r=!1),i+=e):i+="[\\s\\S]":i+=e+O(t,++o);return i}(t),n)),i&&(u.sticky=!0),m.length&&(u.groups=m)),t!==_)try{c(s,"source",""===_?"(?:)":_)}catch(t){}return s},R=u(E),z=0;R.length>z;)v(F,E,R[z++]);k.constructor=F,F.prototype=k,g(i,"RegExp",F,{constructor:!0})}_("RegExp")},4916:function(t,e,n){"use strict";var o=n(2109),i=n(2261);o({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:function(t,e,n){"use strict";var o=n(6530).PROPER,i=n(8052),r=n(9670),s=n(1340),a=n(7293),c=n(4706),u="toString",l=RegExp.prototype.toString,d=a((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),h=o&&l.name!=u;(d||h)&&i(RegExp.prototype,u,(function(){var t=r(this);return"/"+s(t.source)+"/"+s(c(t))}),{unsafe:!0})},2023:function(t,e,n){"use strict";var o=n(2109),i=n(1702),r=n(3929),s=n(4488),a=n(1340),c=n(4964),u=i("".indexOf);o({target:"String",proto:!0,forced:!c("includes")},{includes:function(t){return!!~u(a(s(this)),a(r(t)),arguments.length>1?arguments[1]:void 0)}})},8783:function(t,e,n){"use strict";var o=n(8710).charAt,i=n(1340),r=n(9909),s=n(654),a="String Iterator",c=r.set,u=r.getterFor(a);s(String,"String",(function(t){c(this,{type:a,string:i(t),index:0})}),(function(){var t,e=u(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=o(n,i),e.index+=t.length,{value:t,done:!1})}))},6373:function(t,e,n){"use strict";var o=n(2109),i=n(6916),r=n(1702),s=n(4994),a=n(4488),c=n(7466),u=n(1340),l=n(9670),d=n(4326),h=n(7850),p=n(4706),f=n(8173),v=n(8052),g=n(7293),m=n(5112),y=n(6707),b=n(1530),_=n(7651),w=n(9909),D=n(1913),x=m("matchAll"),B="RegExp String Iterator",E=w.set,k=w.getterFor(B),K=RegExp.prototype,C=TypeError,O=r("".indexOf),S=r("".matchAll),P=!!S&&!g((function(){S("a",/./)})),T=s((function(t,e,n,o){E(this,{type:B,regexp:t,string:e,global:n,unicode:o,done:!1})}),"RegExp String",(function(){var t=k(this);if(t.done)return{value:void 0,done:!0};var e=t.regexp,n=t.string,o=_(e,n);return null===o?{value:void 0,done:t.done=!0}:t.global?(""===u(o[0])&&(e.lastIndex=b(n,c(e.lastIndex),t.unicode)),{value:o,done:!1}):(t.done=!0,{value:o,done:!1})})),M=function(t){var e,n,o,i=l(this),r=u(t),s=y(i,RegExp),a=u(p(i));return e=new s(s===RegExp?i.source:i,a),n=!!~O(a,"g"),o=!!~O(a,"u"),e.lastIndex=c(i.lastIndex),new T(e,r,n,o)};o({target:"String",proto:!0,forced:P},{matchAll:function(t){var e,n,o,r,s=a(this);if(null!=t){if(h(t)&&(e=u(a(p(t))),!~O(e,"g")))throw C("`.matchAll` does not allow non-global regexes");if(P)return S(s,t);if(void 0===(o=f(t,x))&&D&&"RegExp"==d(t)&&(o=M),o)return i(o,t,s)}else if(P)return S(s,t);return n=u(s),r=new RegExp(t,"g"),D?i(M,r,n):r[x](n)}}),D||x in K||v(K,x,M)},4723:function(t,e,n){"use strict";var o=n(6916),i=n(7007),r=n(9670),s=n(7466),a=n(1340),c=n(4488),u=n(8173),l=n(1530),d=n(7651);i("match",(function(t,e,n){return[function(e){var n=c(this),i=null==e?void 0:u(e,t);return i?o(i,e,n):new RegExp(e)[t](a(n))},function(t){var o=r(this),i=a(t),c=n(e,o,i);if(c.done)return c.value;if(!o.global)return d(o,i);var u=o.unicode;o.lastIndex=0;for(var h,p=[],f=0;null!==(h=d(o,i));){var v=a(h[0]);p[f]=v,""===v&&(o.lastIndex=l(i,s(o.lastIndex),u)),f++}return 0===f?null:p}]}))},5306:function(t,e,n){"use strict";var o=n(2104),i=n(6916),r=n(1702),s=n(7007),a=n(7293),c=n(9670),u=n(614),l=n(9303),d=n(7466),h=n(1340),p=n(4488),f=n(1530),v=n(8173),g=n(647),m=n(7651),y=n(5112)("replace"),b=Math.max,_=Math.min,w=r([].concat),D=r([].push),x=r("".indexOf),B=r("".slice),E="$0"==="a".replace(/./,"$0"),k=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var r=k?"$":"$0";return[function(t,n){var o=p(this),r=null==t?void 0:v(t,y);return r?i(r,t,o,n):i(e,h(o),t,n)},function(t,i){var s=c(this),a=h(t);if("string"==typeof i&&-1===x(i,r)&&-1===x(i,"$<")){var p=n(e,s,a,i);if(p.done)return p.value}var v=u(i);v||(i=h(i));var y=s.global;if(y){var E=s.unicode;s.lastIndex=0}for(var k=[];;){var K=m(s,a);if(null===K)break;if(D(k,K),!y)break;""===h(K[0])&&(s.lastIndex=f(a,d(s.lastIndex),E))}for(var C,O="",S=0,P=0;P<k.length;P++){for(var T=h((K=k[P])[0]),M=b(_(l(K.index),a.length),0),I=[],L=1;L<K.length;L++)D(I,void 0===(C=K[L])?C:String(C));var N=K.groups;if(v){var A=w([T],I,M,a);void 0!==N&&D(A,N);var j=h(o(i,void 0,A))}else j=g(T,a,M,I,N,i);M>=S&&(O+=B(a,S,M)+j,S=M+T.length)}return O+B(a,S)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!E||k)},3123:function(t,e,n){"use strict";var o=n(2104),i=n(6916),r=n(1702),s=n(7007),a=n(7850),c=n(9670),u=n(4488),l=n(6707),d=n(1530),h=n(7466),p=n(1340),f=n(8173),v=n(1589),g=n(7651),m=n(2261),y=n(2999),b=n(7293),_=y.UNSUPPORTED_Y,w=4294967295,D=Math.min,x=[].push,B=r(/./.exec),E=r(x),k=r("".slice);s("split",(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=p(u(this)),s=void 0===n?w:n>>>0;if(0===s)return[];if(void 0===t)return[r];if(!a(t))return i(e,r,t,s);for(var c,l,d,h=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,y=new RegExp(t.source,f+"g");(c=i(m,y,r))&&!((l=y.lastIndex)>g&&(E(h,k(r,g,c.index)),c.length>1&&c.index<r.length&&o(x,h,v(c,1)),d=c[0].length,g=l,h.length>=s));)y.lastIndex===c.index&&y.lastIndex++;return g===r.length?!d&&B(y,"")||E(h,""):E(h,k(r,g)),h.length>s?v(h,0,s):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:i(e,this,t,n)}:e,[function(e,n){var o=u(this),s=null==e?void 0:f(e,t);return s?i(s,e,o,n):i(r,p(o),e,n)},function(t,o){var i=c(this),s=p(t),a=n(r,i,s,o,r!==e);if(a.done)return a.value;var u=l(i,RegExp),f=i.unicode,v=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),m=new u(_?"^(?:"+i.source+")":i,v),y=void 0===o?w:o>>>0;if(0===y)return[];if(0===s.length)return null===g(m,s)?[s]:[];for(var b=0,x=0,B=[];x<s.length;){m.lastIndex=_?0:x;var K,C=g(m,_?k(s,x):s);if(null===C||(K=D(h(m.lastIndex+(_?x:0)),s.length))===b)x=d(s,x,f);else{if(E(B,k(s,b,x)),B.length===y)return B;for(var O=1;O<=C.length-1;O++)if(E(B,C[O]),B.length===y)return B;x=b=K}}return E(B,k(s,b)),B}]}),!!b((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),_)},3210:function(t,e,n){"use strict";var o=n(2109),i=n(3111).trim;o({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return i(this)}})},4032:function(t,e,n){"use strict";var o=n(2109),i=n(7854),r=n(6916),s=n(1702),a=n(1913),c=n(9781),u=n(133),l=n(7293),d=n(2597),h=n(7976),p=n(9670),f=n(5656),v=n(4948),g=n(1340),m=n(9114),y=n(30),b=n(1956),_=n(8006),w=n(1156),D=n(5181),x=n(1236),B=n(3070),E=n(6048),k=n(5296),K=n(8052),C=n(2309),O=n(6200),S=n(3501),P=n(9711),T=n(5112),M=n(6061),I=n(7235),L=n(6532),N=n(8003),A=n(9909),j=n(2092).forEach,F=O("hidden"),R="Symbol",z=A.set,H=A.getterFor(R),U=Object.prototype,V=i.Symbol,G=V&&V.prototype,Y=i.TypeError,X=i.QObject,q=x.f,W=B.f,$=w.f,J=k.f,Q=s([].push),Z=C("symbols"),tt=C("op-symbols"),et=C("wks"),nt=!X||!X.prototype||!X.prototype.findChild,ot=c&&l((function(){return 7!=y(W({},"a",{get:function(){return W(this,"a",{value:7}).a}})).a}))?function(t,e,n){var o=q(U,e);o&&delete U[e],W(t,e,n),o&&t!==U&&W(U,e,o)}:W,it=function(t,e){var n=Z[t]=y(G);return z(n,{type:R,tag:t,description:e}),c||(n.description=e),n},rt=function(t,e,n){t===U&&rt(tt,e,n),p(t);var o=v(e);return p(n),d(Z,o)?(n.enumerable?(d(t,F)&&t[F][o]&&(t[F][o]=!1),n=y(n,{enumerable:m(0,!1)})):(d(t,F)||W(t,F,m(1,{})),t[F][o]=!0),ot(t,o,n)):W(t,o,n)},st=function(t,e){p(t);var n=f(e),o=b(n).concat(lt(n));return j(o,(function(e){c&&!r(at,n,e)||rt(t,e,n[e])})),t},at=function(t){var e=v(t),n=r(J,this,e);return!(this===U&&d(Z,e)&&!d(tt,e))&&(!(n||!d(this,e)||!d(Z,e)||d(this,F)&&this[F][e])||n)},ct=function(t,e){var n=f(t),o=v(e);if(n!==U||!d(Z,o)||d(tt,o)){var i=q(n,o);return!i||!d(Z,o)||d(n,F)&&n[F][o]||(i.enumerable=!0),i}},ut=function(t){var e=$(f(t)),n=[];return j(e,(function(t){d(Z,t)||d(S,t)||Q(n,t)})),n},lt=function(t){var e=t===U,n=$(e?tt:f(t)),o=[];return j(n,(function(t){!d(Z,t)||e&&!d(U,t)||Q(o,Z[t])})),o};u||(K(G=(V=function(){if(h(G,this))throw Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=P(t),n=function(t){this===U&&r(n,tt,t),d(this,F)&&d(this[F],e)&&(this[F][e]=!1),ot(this,e,m(1,t))};return c&&nt&&ot(U,e,{configurable:!0,set:n}),it(e,t)}).prototype,"toString",(function(){return H(this).tag})),K(V,"withoutSetter",(function(t){return it(P(t),t)})),k.f=at,B.f=rt,E.f=st,x.f=ct,_.f=w.f=ut,D.f=lt,M.f=function(t){return it(T(t),t)},c&&(W(G,"description",{configurable:!0,get:function(){return H(this).description}}),a||K(U,"propertyIsEnumerable",at,{unsafe:!0}))),o({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:V}),j(b(et),(function(t){I(t)})),o({target:R,stat:!0,forced:!u},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),o({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(t,e){return void 0===e?y(t):st(y(t),e)},defineProperty:rt,defineProperties:st,getOwnPropertyDescriptor:ct}),o({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:ut}),L(),N(V,R),S[F]=!0},1817:function(t,e,n){"use strict";var o=n(2109),i=n(9781),r=n(7854),s=n(1702),a=n(2597),c=n(614),u=n(7976),l=n(1340),d=n(3070).f,h=n(9920),p=r.Symbol,f=p&&p.prototype;if(i&&c(p)&&(!("description"in f)||void 0!==p().description)){var v={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),e=u(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(v[e]=!0),e};h(g,p),g.prototype=f,f.constructor=g;var m="Symbol(test)"==String(p("test")),y=s(f.toString),b=s(f.valueOf),_=/^Symbol\((.*)\)[^)]+$/,w=s("".replace),D=s("".slice);d(f,"description",{configurable:!0,get:function(){var t=b(this),e=y(t);if(a(v,t))return"";var n=m?D(e,7,-1):w(e,_,"$1");return""===n?void 0:n}}),o({global:!0,constructor:!0,forced:!0},{Symbol:g})}},763:function(t,e,n){var o=n(2109),i=n(5005),r=n(2597),s=n(1340),a=n(2309),c=n(735),u=a("string-to-symbol-registry"),l=a("symbol-to-string-registry");o({target:"Symbol",stat:!0,forced:!c},{for:function(t){var e=s(t);if(r(u,e))return u[e];var n=i("Symbol")(e);return u[e]=n,l[n]=e,n}})},2165:function(t,e,n){n(7235)("iterator")},2526:function(t,e,n){n(4032),n(763),n(6620),n(8862),n(9660)},6620:function(t,e,n){var o=n(2109),i=n(2597),r=n(2190),s=n(6330),a=n(2309),c=n(735),u=a("symbol-to-string-registry");o({target:"Symbol",stat:!0,forced:!c},{keyFor:function(t){if(!r(t))throw TypeError(s(t)+" is not a symbol");if(i(u,t))return u[t]}})},3728:function(t,e,n){n(6373)},4747:function(t,e,n){var o=n(7854),i=n(8324),r=n(8509),s=n(8533),a=n(8880),c=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var u in i)i[u]&&c(o[u]&&o[u].prototype);c(r)},3948:function(t,e,n){var o=n(7854),i=n(8324),r=n(8509),s=n(6992),a=n(8880),c=n(5112),u=c("iterator"),l=c("toStringTag"),d=s.values,h=function(t,e){if(t){if(t[u]!==d)try{a(t,u,d)}catch(e){t[u]=d}if(t[l]||a(t,l,e),i[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var p in i)h(o[p]&&o[p].prototype,p);h(r,"DOMTokenList")}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o](r,r.exports,n),r.exports}n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){"use strict";function t(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||e(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 e(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{default:function(){return _}}),n(3210),n(4916),n(5306),n(2772),n(8309),n(3123),n(1539),n(9714),n(561),n(9600),n(9595),n(7042),"undefined"==typeof Element||"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),"undefined"!=typeof self&&"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(t){if("Element"in t){var e="classList",n=t.Element.prototype,o=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},s=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},a=function(t,e){if(""===e)throw new s("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new s("INVALID_CHARACTER_ERR","The token must not contain space characters.");return r.call(t,e)},c=function(t){for(var e=i.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=c.prototype=[],l=function(){return new c(this)};if(s.prototype=Error.prototype,u.item=function(t){return this[t]||null},u.contains=function(t){return~a(this,t+"")},u.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do{t=e[n]+"",~a(this,t)||(this.push(t),i=!0)}while(++n<o);i&&this._updateClassName()},u.remove=function(){var t,e,n=arguments,o=0,i=n.length,r=!1;do{for(t=n[o]+"",e=a(this,t);~e;)this.splice(e,1),r=!0,e=a(this,t)}while(++o<i);r&&this._updateClassName()},u.toggle=function(t,e){var n=this.contains(t),o=n?!0!==e&&"remove":!1!==e&&"add";return o&&this[o](t),!0===e||!1===e?e:!n},u.replace=function(t,e){var n=a(t+"");~n&&(this.splice(n,1,e),this._updateClassName())},u.toString=function(){return this.join(" ")},o.defineProperty){var d={get:l,enumerable:!0,configurable:!0};try{o.defineProperty(n,e,d)}catch(t){void 0!==t.number&&-2146823252!==t.number||(d.enumerable=!1,o.defineProperty(n,e,d))}}else o.prototype.__defineGetter__&&n.__defineGetter__(e,l)}}(self),function(){var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;n<o;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var n=this.toString().split(" "),o=n.indexOf(t+"");~o&&(n=n.slice(o),this.remove.apply(this,n),this.add(e),this.add.apply(this,n.slice(1)))}),t=null}()),n(7327),n(2222),n(7941),n(4603),n(3728),n(2707),n(6699),n(2023),n(4747),n(9601),n(1249),n(1038),n(8783),n(2526),n(5003),n(9337),n(1817),n(2165),n(6992),n(3948),n(3161),n(9653),n(4723),n(5827),n(6210);var c=function(){function n(t){var e=t.getOptions,o=t.getCaretPosition,i=t.getCaretPositionEnd,r=t.dispatch;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),a(this,"isStandardButton",(function(t){return t&&!("{"===t[0]&&"}"===t[t.length-1])})),this.getOptions=e,this.getCaretPosition=o,this.getCaretPositionEnd=i,this.dispatch=r,n.bindMethods(n,this)}var o,i,c;return o=n,c=[{key:"bindMethods",value:function(t,n){var o,i=function(t,n){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=e(t))){o&&(t=o);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==o.return||o.return()}finally{if(c)throw s}}}}(Object.getOwnPropertyNames(t.prototype));try{for(i.s();!(o=i.n()).done;){var r=o.value;"constructor"===r||"bindMethods"===r||(n[r]=n[r].bind(n))}}catch(t){i.e(t)}finally{i.f()}}}],(i=[{key:"getButtonType",value:function(t){return t.includes("{")&&t.includes("}")&&"{//}"!==t?"functionBtn":"standardBtn"}},{key:"getButtonClass",value:function(t){var e=this.getButtonType(t),n=t.replace("{","").replace("}",""),o="";return"standardBtn"!==e&&(o=" hg-button-".concat(n)),"hg-".concat(e).concat(o)}},{key:"getDefaultDiplay",value:function(){return{"{bksp}":"backspace","{backspace}":"backspace","{enter}":"< enter","{shift}":"shift","{shiftleft}":"shift","{shiftright}":"shift","{alt}":"alt","{s}":"shift","{tab}":"tab","{lock}":"caps","{capslock}":"caps","{accept}":"Submit","{space}":" ","{//}":" ","{esc}":"esc","{escape}":"esc","{f1}":"f1","{f2}":"f2","{f3}":"f3","{f4}":"f4","{f5}":"f5","{f6}":"f6","{f7}":"f7","{f8}":"f8","{f9}":"f9","{f10}":"f10","{f11}":"f11","{f12}":"f12","{numpaddivide}":"/","{numlock}":"lock","{arrowup}":"↑","{arrowleft}":"←","{arrowdown}":"↓","{arrowright}":"→","{prtscr}":"print","{scrolllock}":"scroll","{pause}":"pause","{insert}":"ins","{home}":"home","{pageup}":"up","{delete}":"del","{forwarddelete}":"del","{end}":"end","{pagedown}":"down","{numpadmultiply}":"*","{numpadsubtract}":"-","{numpadadd}":"+","{numpadenter}":"enter","{period}":".","{numpaddecimal}":".","{numpad0}":"0","{numpad1}":"1","{numpad2}":"2","{numpad3}":"3","{numpad4}":"4","{numpad5}":"5","{numpad6}":"6","{numpad7}":"7","{numpad8}":"8","{numpad9}":"9"}}},{key:"getButtonDisplayName",value:function(t,e,n){return(e=n?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=this.getOptions(),s=[n,o,i],a=e;return("{bksp}"===t||"{backspace}"===t)&&a.length>0?a=this.removeAt.apply(this,[a].concat(s)):("{delete}"===t||"{forwarddelete}"===t)&&a.length>0?a=this.removeForwardsAt.apply(this,[a].concat(s)):"{space}"===t?a=this.addStringAt.apply(this,[a," "].concat(s)):"{tab}"!==t||"boolean"==typeof r.tabCharOnTab&&!1===r.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!r.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?a=this.addStringAt.apply(this,[a,t[t.length-2]].concat(s)):"{numpaddivide}"===t?a=this.addStringAt.apply(this,[a,"/"].concat(s)):"{numpadmultiply}"===t?a=this.addStringAt.apply(this,[a,"*"].concat(s)):"{numpadsubtract}"===t?a=this.addStringAt.apply(this,[a,"-"].concat(s)):"{numpadadd}"===t?a=this.addStringAt.apply(this,[a,"+"].concat(s)):"{numpaddecimal}"===t?a=this.addStringAt.apply(this,[a,"."].concat(s)):"{"===t||"}"===t?a=this.addStringAt.apply(this,[a,t].concat(s)):t.includes("{")||t.includes("}")||(a=this.addStringAt.apply(this,[a,t].concat(s))):a=this.addStringAt.apply(this,[a,"\n"].concat(s)):a=this.addStringAt.apply(this,[a,"\t"].concat(s)),a}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.setCaretPosition(n)}))}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),o=this.getCaretPosition();return null!=o&&(e?o>0&&(o-=t):o+=t),n.debug&&console.log("Caret at:",o),o}},{key:"addStringAt",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o||0===o?(n=[t.slice(0,o),e,t.slice(i)].join(""),this.isMaxLengthReached()||r&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===o)return t;if(n===o){var r=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(r)?(e=t.substr(0,n-2)+t.substr(n),i&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),i&&this.updateCaretPos(1,!0)):t.slice(-2).match(r)?(e=t.slice(0,-2),i&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),i&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(o),i&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null==t||!t.length||null===n)return t;if(n===o){var r=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g,s=t.substring(n,n+2),a=s.match(r);e=a?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1)}else e=t.slice(0,n)+t.slice(o),i&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,i=t[n.inputName||"default"],s=e.length-1>=o;if(e.length<=i.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===r(o)){var a=e.length-1>=o[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t})):""}},{key:"chunkArray",value:function(e,n){return t(Array(Math.ceil(e.length/n))).map((function(t,o){return e.slice(n*o,n+n*o)}))}}])&&s(o.prototype,i),c&&s(o,c),Object.defineProperty(o,"prototype",{writable:!1}),n}();a(c,"noop",(function(){}));var u=c;function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var d=function(){function t(e){var n=e.dispatch,o=e.getOptions;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dispatch=n,this.getOptions=o,u.bindMethods(t,this)}var e,n;return e=t,(n=[{key:"handleHighlightKeyDown",value:function(t){var e=this.getOptions(),n=this.getSimpleKeyboardLayoutKey(t);this.dispatch((function(o){var i,r,s=o.getButtonElement(n),a=o.getButtonElement("{".concat(n,"}"));if(s)i=s,r=n;else{if(!a)return;i=a,r="{".concat(n,"}")}i&&(i.style.backgroundColor=e.physicalKeyboardHighlightBgColor||"#dadce4",i.style.color=e.physicalKeyboardHighlightTextColor||"black",e.physicalKeyboardHighlightPress&&(e.physicalKeyboardHighlightPressUsePointerEvents?i.onpointerdown():e.physicalKeyboardHighlightPressUseClick?i.click():o.handleButtonClicked(r,t)))}))}},{key:"handleHighlightKeyUp",value:function(t){var e=this.getOptions(),n=this.getSimpleKeyboardLayoutKey(t);this.dispatch((function(t){var o=t.getButtonElement(n)||t.getButtonElement("{".concat(n,"}"));o&&o.removeAttribute&&(o.removeAttribute("style"),e.physicalKeyboardHighlightPressUsePointerEvents&&o.onpointerup())}))}},{key:"getSimpleKeyboardLayoutKey",value:function(t){var e,n,o=t.code||t.key||this.keyCodeToKey(null==t?void 0:t.keyCode);return(n=null!=o&&o.includes("Numpad")||null!=o&&o.includes("Shift")||null!=o&&o.includes("Space")||null!=o&&o.includes("Backspace")||null!=o&&o.includes("Control")||null!=o&&o.includes("Alt")||null!=o&&o.includes("Meta")?t.code||"":t.key||this.keyCodeToKey(null==t?void 0:t.keyCode)||"").length>1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]}}])&&l(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function h(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var p=function(){function t(e){var n,o=e.utilities;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n="pageIndex")in this?Object.defineProperty(this,n,{value:0,enumerable:!0,configurable:!0,writable:!0}):this[n]=0,this.utilities=o,u.bindMethods(t,this),this.pageSize=this.utilities.getOptions().layoutCandidatesPageSize||5}var e,n;return e=t,(n=[{key:"destroy",value:function(){this.candidateBoxElement&&(this.candidateBoxElement.remove(),this.pageIndex=0)}},{key:"show",value:function(t){var e=this,n=t.candidateValue,o=t.targetElement,i=t.onSelect;if(n&&n.length){var r=this.utilities.chunkArray(n.split(" "),this.pageSize);this.renderPage({candidateListPages:r,targetElement:o,pageIndex:this.pageIndex,nbPages:r.length,onItemSelected:function(t,n){i(t,n),e.destroy()}})}}},{key:"renderPage",value:function(t){var e,n=this,o=t.candidateListPages,i=t.targetElement,r=t.pageIndex,s=t.nbPages,a=t.onItemSelected;null===(e=this.candidateBoxElement)||void 0===e||e.remove(),this.candidateBoxElement=document.createElement("div"),this.candidateBoxElement.className="hg-candidate-box";var c=document.createElement("ul");c.className="hg-candidate-box-list",o[r].forEach((function(t){var e=document.createElement("li"),n=function(){var t=new MouseEvent("click");return Object.defineProperty(t,"target",{value:e}),t};e.className="hg-candidate-box-list-item",e.textContent=t,e.onclick=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n();return a(t,e)},c.appendChild(e)}));var u=r>0,l=document.createElement("div");l.classList.add("hg-candidate-box-prev"),u&&l.classList.add("hg-candidate-box-btn-active"),l.onclick=function(){u&&n.renderPage({candidateListPages:o,targetElement:i,pageIndex:r-1,nbPages:s,onItemSelected:a})},this.candidateBoxElement.appendChild(l),this.candidateBoxElement.appendChild(c);var d=r<s-1,h=document.createElement("div");h.classList.add("hg-candidate-box-next"),d&&h.classList.add("hg-candidate-box-btn-active"),h.onclick=function(){d&&n.renderPage({candidateListPages:o,targetElement:i,pageIndex:r+1,nbPages:s,onItemSelected:a})},this.candidateBoxElement.appendChild(h),i.prepend(this.candidateBoxElement)}}])&&h(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function f(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}(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 v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function y(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _=function(){function t(e,n){var o=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),b(this,"defaultName","default"),b(this,"activeInputElement",null),b(this,"handleParams",(function(t,e){var n,o,i;if("string"==typeof t)n=t.split(".").join(""),o=document.querySelector(".".concat(n)),i=e;else if(t instanceof HTMLDivElement){if(!t.className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");n=t.className.split(" ")[0],o=t,i=e}else n="simple-keyboard",o=document.querySelector(".".concat(n)),i=t;return{keyboardDOMClass:n,keyboardDOM:o,options:i}})),b(this,"getOptions",(function(){return o.options})),b(this,"getCaretPosition",(function(){return o.caretPosition})),b(this,"getCaretPositionEnd",(function(){return o.caretPositionEnd})),b(this,"registerModule",(function(t,e){o.modules[t]||(o.modules[t]={}),e(o.modules[t])})),b(this,"getKeyboardClassString",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=[o.keyboardDOMClass].concat(e).filter((function(t){return!!t}));return i.join(" ")})),"undefined"!=typeof window){var i=this.handleParams(e,n),r=i.keyboardDOMClass,s=i.keyboardDOM,a=i.options,c=void 0===a?{}:a;this.utilities=new u({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=s,this.options=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},c),this.keyboardPluginClasses="",u.bindMethods(t,this);var l=this.options.inputName,h=void 0===l?this.defaultName:l;if(this.input={},this.input[h]="",this.keyboardDOMClass=r,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new d({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new p({utilities:this.utilities}):null,!this.keyboardDOM)throw console.warn('".'.concat(r,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}}var e,n;return e=t,(n=[{key:"setCaretPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this,n=this.options,o=n.layoutCandidates,i=n.layoutCandidatesCaseSensitiveMatch;if(!o||"object"!==g(o))return{};var r=Object.keys(o).filter((function(n){var o=t.substring(0,e.getCaretPositionEnd()||0)||t,r=new RegExp("".concat(n,"$"),i?"g":"gi");return!!f(o.matchAll(r)).length}));if(r.length>1){var s=r.sort((function(t,e){return e.length-t.length}))[0];return{candidateKey:s,candidateValue:o[s]}}if(r.length){var a=r[0];return{candidateKey:a,candidateValue:o[a]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var o=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e,n){var i=o.options.layoutCandidatesCaseSensitiveMatch,r=e.normalize("NFD"),s=o.getInput(o.options.inputName,!0),a=o.getCaretPositionEnd()||0,c=s.substring(0,a||0)||s,u=new RegExp("".concat(t,"$"),i?"g":"gi"),l=c.replace(u,r),d=s.replace(c,l),h=l.length-c.length,p=(a||s.length)+h;p<0&&(p=0),o.setInput(d,o.options.inputName,!0),o.setCaretPosition(p),"function"==typeof o.options.onChange&&o.options.onChange(o.getInput(o.options.inputName,!0),n),"function"==typeof o.options.onChangeAll&&o.options.onChangeAll(o.getAllInputs(),n)}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,o=n.inputName,i=void 0===o?this.defaultName:o,r=n.debug;if("{//}"!==t){this.input[i]||(this.input[i]="");var s=this.utilities.getUpdatedInput(t,this.input[i],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[i]&&this.input[i]===s&&0===this.caretPosition&&this.caretPositionEnd===s.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t,e),this.input[i]!==s&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(s))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,s))return;var a=this.utilities.getUpdatedInput(t,this.input[i],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(a,this.options.inputName,!0),r&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")")),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0),e),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs(),e),null!=e&&e.target&&this.options.enableLayoutCandidates){var c,u=this.getInputCandidates(s),l=u.candidateKey,d=u.candidateValue;l&&d?this.showCandidatesBox(l,d,this.keyboardDOM):null===(c=this.candidateBox)||void 0===c||c.destroy()}}r&&console.log("Key pressed:",t)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(t){this.options.syncInstanceInputs?this.dispatch((function(e){e.isMouseHold=t})):this.isMouseHold=t}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(t){t.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){e.getMouseHold()?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)}))}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl){var n=this.input[t].replace("","").replace("","");return""+n+""}return this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach((function(n){e[n]=t.getInput(n,!0)})),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter((function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])}))}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new p({utilities:this.utilities}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach((function(o){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var i=!1;n.options.buttonTheme.map((function(t){if(null!=t&&t.class.split(" ").includes(e)){i=!0;var n=t.buttons.split(" ");n.includes(o)||(i=!0,n.push(o),t.buttons=n.join(" "))}return t})),i||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t){var o,i;null===(o=n.options)||void 0===o||null===(i=o.buttonTheme)||void 0===i||i.map((function(o,i){if(o&&e&&e.includes(o.class)||!e){var r,s,a=null===(r=o)||void 0===r?void 0:r.buttons.split(" ").filter((function(e){return e!==t}));o&&null!=a&&a.length?o.buttons=a.join(" "):(null===(s=n.options.buttonTheme)||void 0===s||s.splice(i,1),o=null)}return o}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){!this.isFirstKeyboardInstance&&this.allKeyboardInstances||(this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")")),document.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("select",this.handleSelect),document.addEventListener("selectionchange",this.handleSelectionChange))}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"handleSelectionChange",value:function(t){this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(o){var i=t.target===o.keyboardDOM||t.target&&o.keyboardDOM.contains(t.target);n.options.syncInstanceInputs&&Array.isArray(t.path)&&(i=t.path.some((function(t){var e;return null==t||null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-skInstance")}))),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!o.options.disableCaretPositioning?(o.setCaretPosition(t.target.selectionStart,t.target.selectionEnd),n.activeInputElement=t.target,o.options.debug&&console.log("Caret at: ",o.getCaretPosition(),o.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(o.keyboardDOMClass,")"))):!o.options.disableCaretPositioning&&i||"selectionchange"===(null==t?void 0:t.type)||(o.setCaretPosition(null),n.activeInputElement=null,o.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))}))}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName)),document.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(f(n),f(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e(t);n.init&&n.init(t)})),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var i=this,r=Array.from(t.children),s=0;return r.length&&n.forEach((function(n,a){var c=o[a];if(!(c&&c>n))return!1;var u=n-s,l=c-s,d=document.createElement("div");d.className+="hg-button-container";var h="".concat(i.options.layoutName,"-r").concat(e,"c").concat(a);d.setAttribute("data-skUID",h);var p=r.splice(u,l-u+1);s=l-u,p.forEach((function(t){return d.appendChild(t)})),r.splice(u,0,d),t.innerHTML="",r.forEach((function(e){return t.appendChild(e)})),i.options.debug&&console.log("rowDOMContainer",p,u,l,s+1)})),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},o=this.options.useTouchEvents||!1,i=o?"hg-touch-events":"",r=this.options.useMouseEvents||!1,s=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,i),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach((function(e,n){var i=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(i=i.filter((function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)})));var a=document.createElement("div");a.className+="hg-row";var c=[],u=[];i.forEach((function(e,i){var l,d=!s&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),h=!s&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;d&&(c.push(i),e=e.replace(/\[/g,"")),h&&(u.push(i),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),v=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),g=t.options.useButtonTag?"button":"div",m=document.createElement(g);m.className+="hg-button ".concat(p),(l=m.classList).add.apply(l,f(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){m.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||r?o?(m.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},m.ontouchend=function(n){t.handleButtonMouseUp(e,n)},m.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(m.onclick=function(n){t.setMouseHold(!1),"function"!=typeof t.options.onKeyReleased&&t.handleButtonClicked(e,n)},m.onmousedown=function(n){"function"!=typeof t.options.onKeyReleased||t.isMouseHold||t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},m.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(m.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},m.onpointerup=function(n){t.handleButtonMouseUp(e,n)},m.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),m.setAttribute("data-skBtn",e);var y="".concat(t.options.layoutName,"-r").concat(n,"b").concat(i);m.setAttribute("data-skBtnUID",y);var b=document.createElement("span");b.innerHTML=v,m.appendChild(b),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(m),a.appendChild(m)})),a=t.parseRowDOMContainers(a,n,c,u),t.keyboardRowsDOM.appendChild(a)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||r?o?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}])&&y(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()}(),o}()},"object"==typeof n&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof n?n.SimpleKeyboard=i():o.SimpleKeyboard=i()},{}],17:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Build=void 0,n.Build={short:"0.73.9",version:"0.73.9 (2b193a42bb8728577711b215f2ee7fa1)",buildSeed:1673510059952}},{}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.deprecatedButton=n.createButton=void 0;const o=t("../dom/keys"),i=t("../dom/pointer"),r=function(){const t={};for(const e of Object.keys(o.namedKeyCodes))t[o.namedKeyCodes[e]]=e.substr(4,2);return t}();function s(t,e,n){const o=Math.round(.6*n),r=Math.round(.5*n),s=Math.max(1,Math.round(n/20)),c=f[t.toLowerCase()],u=void 0===c?t:"",l=a("emulator-button-touch-zone"),d=a("emulator-button"),h=a("emulator-button-text",void 0===c?void 0===u||0===u.length?"□":u.substr(0,1).toUpperCase():"");void 0!==c&&(d.style.backgroundImage='url("'+c+'")'),d.style.width=o+"px",d.style.height=o+"px",h.style.fontSize=r+"px",l.widthPx=n-2*s,l.heightPx=n-2*s,l.style.width=l.widthPx+"px",l.style.height=l.heightPx+"px",l.style.borderWidth=s+"px",l.appendChild(d),l.appendChild(h);const p=t=>{void 0!==e.onDown&&e.onDown(),void 0!==e.onClick&&e.onClick(),t.stopPropagation(),t.preventDefault()},v=t=>{void 0!==e.onUp&&e.onUp(),t.stopPropagation(),t.preventDefault()},g=t=>{t.stopPropagation(),t.preventDefault()},m={capture:!0};for(const t of i.pointer.starters)l.addEventListener(t,p,m);for(const t of i.pointer.enders)l.addEventListener(t,v,m);for(const t of i.pointer.changers)l.addEventListener(t,g,m);for(const t of i.pointer.leavers)l.addEventListener(t,g,m);for(const t of i.pointer.prevents)l.addEventListener(t,g,m);return l}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.innerHTML=e),n}function c(t){return"number"==typeof t?r[t]:t}function u(t,e){return"click"===t.action?{onClick:()=>e.fireKeyPress(t.mapTo)}:{onDown:()=>e.fireKeyDown(t.mapTo),onUp:()=>e.fireKeyUp(t.mapTo)}}n.createButton=s,n.deprecatedButton=function(t,e,n,i){const r=Math.round(i/4),a=[];for(const e of n){if(e.mapTo===o.KBD_NONE)continue;const n=s((e.symbol||c(e.mapTo)).toUpperCase(),u(e,t),i);n.style.position="absolute";const l=e.style;if(l)for(const t of Object.keys(l))n.style[t]=l[t];if(void 0!==e.position){const t=e.position.left,o=e.position.top,s=e.position.bottom,a=e.position.right;void 0!==t&&(n.style.left=r*t+i*(t-1)+"px"),void 0!==a&&(n.style.right=r*a+i*(a-1)+"px"),void 0!==o&&(n.style.top=r*o+i*(o-1)+"px"),void 0!==s&&(n.style.bottom=r*s+i*(s-1)+"px")}t.mouseOverlay.appendChild(n),a.push(n)}return()=>{for(const e of a)e.parentElement===t.mouseOverlay&&t.mouseOverlay.removeChild(e)}};const l="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns:sketch='http://www.bohemiancoding.com/sketch/ns' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 20 20' fill='%23FFF' enable-background='new 0 0 20 20' xml:space='preserve'%3E%3Ctitle%3EShape%3C/title%3E%3Cdesc%3ECreated with Sketch.%3C/desc%3E%3Cg id='Page-1' sketch:type='MSPage'%3E%3Cg id='Artboard-1' transform='translate(-3.000000, -1.000000)' sketch:type='MSArtboardGroup'%3E%3Cpath id='Shape' sketch:type='MSShapeGroup' d='M19,12c-0.3,0-0.5,0.1-0.7,0.3L14,16.6V3c0-0.5-0.4-1-1-1s-1,0.5-1,1v13.6 l-4.3-4.3C7.5,12.1,7.3,12,7,12c-0.5,0-1,0.4-1,1c0,0.3,0.1,0.5,0.3,0.7l6,6c0.2,0.2,0.4,0.3,0.7,0.3s0.5-0.1,0.7-0.3l6-6 c0.2-0.2,0.3-0.4,0.3-0.7C20,12.4,19.5,12,19,12L19,12z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",d="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 20 20' enable-background='new 0 0 20 20' fill='%23FFF' xml:space='preserve'%3E%3Cg id='left_arrow_1_'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18,9H4.41l4.29-4.29C8.89,4.53,9,4.28,9,4c0-0.55-0.45-1-1-1 C7.72,3,7.47,3.11,7.29,3.29l-6,6C1.11,9.47,1,9.72,1,10c0,0.28,0.11,0.53,0.29,0.71l6,6C7.47,16.89,7.72,17,8,17 c0.55,0,1-0.45,1-1c0-0.28-0.11-0.53-0.29-0.71L4.41,11H18c0.55,0,1-0.45,1-1C19,9.45,18.55,9,18,9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",h="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' fill='%23fff' viewBox='0 0 20 20' enable-background='new 0 0 20 20' xml:space='preserve'%3E%3Cg id='right_arrow_1_'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.71,9.29l-6-6C12.53,3.11,12.28,3,12,3c-0.55,0-1,0.45-1,1 c0,0.28,0.11,0.53,0.29,0.71L15.59,9H2c-0.55,0-1,0.45-1,1c0,0.55,0.45,1,1,1h13.59l-4.29,4.29C11.11,15.47,11,15.72,11,16 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l6-6C18.89,10.53,19,10.28,19,10C19,9.72,18.89,9.47,18.71,9.29z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",p="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' fill='%23fff' viewBox='0 0 20 20' enable-background='new 0 0 20 20' xml:space='preserve'%3E%3Cg id='key_enter_1_'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18,2c-0.55,0-1,0.45-1,1v5c0,2.21-1.79,4-4,4H4.41l2.29-2.29 C6.89,9.53,7,9.28,7,9c0-0.55-0.45-1-1-1C5.72,8,5.47,8.11,5.29,8.29l-4,4C1.11,12.47,1,12.72,1,13c0,0.28,0.11,0.53,0.29,0.71 l4,4C5.47,17.89,5.72,18,6,18c0.55,0,1-0.45,1-1c0-0.28-0.11-0.53-0.29-0.71L4.41,14H13c3.31,0,6-2.69,6-6V3C19,2.45,18.55,2,18,2 z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",f={fullscreen:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'%3E%3Cg id='maximize_1_' fill='%23FFFFFF'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5.99,8.99c-0.28,0-0.53,0.11-0.71,0.29l-3.29,3.29v-1.59c0-0.55-0.45-1-1-1 s-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1s-0.45-1-1-1H3.41L6.7,10.7c0.18-0.18,0.29-0.43,0.29-0.71 C6.99,9.44,6.54,8.99,5.99,8.99z M14.99-0.01h-4c-0.55,0-1,0.45-1,1s0.45,1,1,1h1.59L9.28,5.29C9.1,5.47,8.99,5.72,8.99,5.99 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l3.29-3.29v1.59c0,0.55,0.45,1,1,1s1-0.45,1-1v-4C15.99,0.44,15.54-0.01,14.99-0.01 z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",save:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 18.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' fill='%23FFFFFF' xml:space='preserve'%3E%3Cg id='floppy_disk'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15.71,2.29l-2-2C13.53,0.11,13.28,0,13,0h-1v6H4V0H1C0.45,0,0,0.45,0,1v14 c0,0.55,0.45,1,1,1h14c0.55,0,1-0.45,1-1V3C16,2.72,15.89,2.47,15.71,2.29z M14,15H2V9c0-0.55,0.45-1,1-1h10c0.55,0,1,0.45,1,1V15 z M11,1H9v4h2V1z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",options:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 20 20' enable-background='new 0 0 20 20' fill='%23FFF' xml:space='preserve'%3E%3Cg id='cog_2_'%3E%3Cg%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19,8h-2.31c-0.14-0.46-0.33-0.89-0.56-1.3l1.7-1.7c0.39-0.39,0.39-1.02,0-1.41 l-1.41-1.41c-0.39-0.39-1.02-0.39-1.41,0l-1.7,1.7c-0.41-0.22-0.84-0.41-1.3-0.55V1c0-0.55-0.45-1-1-1H9C8.45,0,8,0.45,8,1v2.33 C7.52,3.47,7.06,3.67,6.63,3.91L5,2.28c-0.37-0.37-0.98-0.37-1.36,0L2.28,3.64C1.91,4.02,1.91,4.63,2.28,5l1.62,1.62 C3.66,7.06,3.46,7.51,3.31,8H1C0.45,8,0,8.45,0,9v2c0,0.55,0.45,1,1,1h2.31c0.14,0.46,0.33,0.89,0.56,1.3L2.17,15 c-0.39,0.39-0.39,1.02,0,1.41l1.41,1.41c0.39,0.39,1.02,0.39,1.41,0l1.7-1.7c0.41,0.22,0.84,0.41,1.3,0.55V19c0,0.55,0.45,1,1,1h2 c0.55,0,1-0.45,1-1v-2.33c0.48-0.14,0.94-0.35,1.37-0.59L15,17.72c0.37,0.37,0.98,0.37,1.36,0l1.36-1.36 c0.37-0.37,0.37-0.98,0-1.36l-1.62-1.62c0.24-0.43,0.45-0.89,0.6-1.38H19c0.55,0,1-0.45,1-1V9C20,8.45,19.55,8,19,8z M10,14 c-2.21,0-4-1.79-4-4c0-2.21,1.79-4,4-4s4,1.79,4,4C14,12.21,12.21,14,10,14z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",keyboard:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'%3E%3Cg id='manually_entered_data_2_'%3E%3Cg%3E%3Cpath fill='%23FFFFFF' fill-rule='evenodd' clip-rule='evenodd' d='M1,8h3.76l2-2H1C0.45,6,0,6.45,0,7C0,7.55,0.45,8,1,8z M15.49,3.99 C15.8,3.67,16,3.23,16,2.75C16,1.78,15.22,1,14.25,1c-0.48,0-0.92,0.2-1.24,0.51l-1.44,1.44l2.47,2.47L15.49,3.99z M1,4h7.76l2-2 H1C0.45,2,0,2.45,0,3C0,3.55,0.45,4,1,4z M1,10c-0.55,0-1,0.45-1,1c0,0.48,0.35,0.86,0.8,0.96L2.76,10H1z M10.95,3.57l-6.69,6.69 l2.47,2.47l6.69-6.69L10.95,3.57z M15.2,6.04L13.24,8H15c0.55,0,1-0.45,1-1C16,6.52,15.65,6.14,15.2,6.04z M2,15l3.86-1.39 l-2.46-2.44L2,15z M15,10h-3.76l-2,2H15c0.55,0,1-0.45,1-1C16,10.45,15.55,10,15,10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",up:"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns:sketch='http://www.bohemiancoding.com/sketch/ns' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 20 20' fill='%23FFF' enable-background='new 0 0 20 20' xml:space='preserve'%3E%3Ctitle%3EShape%3C/title%3E%3Cdesc%3ECreated with Sketch.%3C/desc%3E%3Cg id='Page-1' sketch:type='MSPage'%3E%3Cg id='Artboard-1' transform='translate(-3.000000, -1.000000)' sketch:type='MSArtboardGroup'%3E%3Cpath id='Shape' sketch:type='MSShapeGroup' d='M19.7,8.3l-6-6C13.5,2.1,13.3,2,13,2s-0.5,0.1-0.7,0.3l-6,6C6.1,8.5,6,8.7,6,9 c0,0.6,0.5,1,1,1c0.3,0,0.5-0.1,0.7-0.3L12,5.4V19c0,0.5,0.4,1,1,1s1-0.5,1-1V5.4l4.3,4.3C18.5,9.9,18.7,10,19,10c0.5,0,1-0.4,1-1 C20,8.7,19.9,8.5,19.7,8.3L19.7,8.3z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E",down:l,do:l,dw:l,dwn:l,left:d,le:d,lft:d,right:h,ri:h,rght:h,rgh:h,enter:p,en:p,enr:p,ent:p,entr:p}},{"../dom/keys":32,"../dom/pointer":36}],19:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.getGrid=void 0,n.getGrid=function(t){switch(t){case"square":return function(){class t{constructor(){o(this,"aspect",.625)}getConfiguration(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const o=this.getCols(),i=this.getRows(),r=Math.floor(o/2),s=Math.floor(i/2),a=5*t/100/2,c=a,u=(t-2*a)/o*n,l=(e-2*c)/i*n,d=Math.min(u,l),h=[];for(let n=0;n<i;++n){const u=[];for(let l=0;l<o;++l)u.push({centerX:l<r?a+d*(l+.5):t-a-d*(o-l-1+.5),centerY:n<s?c+d*(n+.5):e-c-d*(i-n-1+.5)});h.push(u)}return{gridType:"square",cells:h,columnWidth:d,rowHeight:d,columnsPadding:a,rowsPadding:c,width:t,height:e}}getCols(){return 10}getRows(){return Math.floor(this.getCols()*this.aspect)+1}}return new t}();case"honeycomb":return function(){class t{constructor(){o(this,"aspect",.625)}getConfiguration(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const o=this.getCols(),i=this.getRows(),r=Math.floor(o/2),s=Math.floor(i/2),a=5*t/100/2,c=a,u=(t-2*a)/o*n,l=(e-2*c)/i*n,d=Math.min(u,l),h=[];for(let n=0;n<i;++n){const u=[],l=n%2==0?o:o-1,p=n%2==0?0:d/2;for(let h=0;h<l;++h)u.push({centerX:h<r?p+a+d*(h+.5):p+t-a-d*(o-h-1+.5),centerY:n<s?c+d*(n+.5):e-c-d*(i-n-1+.5)});h.push(u)}return{gridType:"honeycomb",cells:h,columnWidth:d,rowHeight:d,columnsPadding:a,rowsPadding:c,width:t,height:e}}getCols(){return 10}getRows(){return Math.floor(this.getCols()*this.aspect)+1}}return new t}()}throw new Error("Unknown grid type "+t)}},{}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.keyboard=void 0,n.keyboard=function(t,e,n){const o=n||{};function i(t){return void 0!==o[t]?o[t]:t}return t.setOnKeyDown((t=>{e.sendKeyEvent(i(t),!0)})),t.setOnKeyUp((t=>{e.sendKeyEvent(i(t),!1)})),t.setOnKeyPress((t=>{e.simulateKeyPress(i(t))})),t.setOnKeysPress((t=>{e.simulateKeyPress(...t)})),()=>{t.setOnKeyDown((t=>{})),t.setOnKeyUp((t=>{})),t.setOnKeyPress((t=>{})),t.setOnKeysPress((t=>{}))}}},{}],21:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.extractLayersConfig=void 0,n.extractLayersConfig=function(t){return void 0!==t.layersConfig?(1===t.layersConfig.version&&function(t){for(const e of t.layers)for(const t of e.controls)if("Key"===t.type){const e=t;"number"==typeof e.mapTo&&(e.mapTo=[e.mapTo])}}(t.layersConfig),t.layersConfig):void 0!==t.layers?t.layers:null}},{}],22:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initLayersControl=void 0;const o=t("./grid"),i=t("./button"),r=t("./keyboard"),s=t("./mouse/mouse-common"),a=t("./options"),c=t("../dom/pointer"),u=t("nipplejs");n.initLayersControl=function(t,e,n,i,a,c,u){let h=e.layers[0];if(void 0!==u)for(const t of e.layers)if(t.title===u){h=t;break}return function(t,e,n,i,a,c){const u=(0,r.keyboard)(e,n),h=(0,s.mouse)(i.autolock,i.sensitivity,e,n),p=[];function v(r,s){var u;for(const t of p)t();p.splice(0,p.length);const h=(0,o.getGrid)(t.grid).getConfiguration(r,s,c),v=new l;for(const e of t.controls){const{row:t,column:n,type:o}=e;"NippleActivator"===o&&f(h,t,n)}let g=-1;if(0===(null===(u=e.options.optionControls)||void 0===u?void 0:u.length))for(const e of t.controls){const{row:t,type:n}=e;if("Options"===n){g=t;break}}const m={};if(a)for(const e of t.controls){const{row:t}=e;let n=e.column;const o=h.cells[t].length,i=o/2;t===g&&n>=i&&(n=Math.min(n+1,o-1)),void 0===m[t]&&(m[t]={leftStart:i,leftEnd:0,rightStart:o-1,rightEnd:i}),n<i?(m[t].leftStart=Math.min(m[t].leftStart,n),m[t].leftEnd=Math.max(m[t].leftEnd,n)):(m[t].rightStart=Math.min(m[t].rightStart,n),m[t].rightEnd=Math.max(m[t].rightEnd,n))}for(const o of t.controls){const t=d[o.type];if(void 0===t){console.error("Factory for control '"+o.type+"' is not defined");continue}const r={...o},s=h.cells[o.row].length,c=s/2;if(g===o.row&&o.column>=c&&(r.column=Math.min(r.column+1,s-1)),a){const{leftStart:t,leftEnd:e,rightStart:n,rightEnd:o}=m[r.row],i=r.column<c;i?r.column+=c+(c-e)-t-1:r.column-=c+(n-c)-(s-o)+1,r.column>=s?(console.error("Column",r.column,"is out of bound",s,i?"[leftSide]":"[rightSide]",m),r.column=s-1):r.column<0&&(console.error("Column",r.column,"is out of bound",0,i?"[leftSide]":"[rightSide]",m),r.column=0)}const u=t(r,e,n,h,v,i);p.push(u)}}return e.addOnResize(v),v(e.width,e.height),()=>{e.removeOnResize(v),u(),h();for(const t of p)t()}}(h,t,n,i,a,c)};class l{constructor(){var t,e,n;n={},(e="sensors")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}activate(t,e){const n=this.sensors[e+"_"+t];void 0!==n&&n.activate()}deactivate(t,e){const n=this.sensors[e+"_"+t];void 0!==n&&n.deactivate()}register(t,e,n){this.sensors[e+"_"+t]=n}}const d={Key:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l],f={onDown:()=>{for(const e of t.mapTo)n.sendKeyEvent(e,!0)},onUp:()=>{for(const e of t.mapTo)n.sendKeyEvent(e,!1)}};if(r.register(u,l,{activate:f.onDown,deactivate:f.onUp}),p(o,u,l))return()=>{};const v=(0,i.createButton)(t.symbol,f,c);return v.style.position="absolute",v.style.left=d-v.widthPx/2+"px",v.style.top=h-v.heightPx/2+"px",e.mouseOverlay.appendChild(v),()=>e.mouseOverlay.removeChild(v)},Options:function(t,e,n,o,i,r){var s;if(0===(null===(s=e.options.optionControls)||void 0===s?void 0:s.length))return()=>{};if(void 0!==e.options.optionControls&&1===e.options.optionControls.length&&"keyboard"===e.options.optionControls[0])return h(t,e,n,o,i,r);const{cells:c,columnWidth:u,rowHeight:l}=o,{row:d,column:p}=t,{centerX:f,centerY:v}=c[d][p],g=v-l/2,m=f-u/2,y=o.width-m-u;return(0,a.options)(e,["default"],(()=>{}),u,g,y)},Keyboard:h,Switch:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l],p=(0,i.createButton)(t.symbol,{onUp:()=>s.setLayersConfig(s.getLayersConfig(),t.layerName)},c);return p.style.position="absolute",p.style.left=d-p.widthPx/2+"px",p.style.top=h-p.heightPx/2+"px",e.mouseOverlay.appendChild(p),()=>{e.mouseOverlay.removeChild(p)}},ScreenMove:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l];let f=.5,v=.5;t.direction.indexOf("up")>=0&&(v=0);t.direction.indexOf("down")>=0&&(v=1);t.direction.indexOf("left")>=0&&(f=0);t.direction.indexOf("right")>=0&&(f=1);const g={onDown:()=>{n.sendMouseMotion(f,v)},onUp:()=>{n.sendMouseMotion(.5,.5)}};if(r.register(u,l,{activate:g.onDown,deactivate:g.onUp}),p(o,u,l))return()=>{};const m=(0,i.createButton)(t.symbol,g,c);return m.style.position="absolute",m.style.left=d-m.widthPx/2+"px",m.style.top=h-m.heightPx/2+"px",e.mouseOverlay.appendChild(m),()=>e.mouseOverlay.removeChild(m)},PointerButton:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l,click:d}=t,{centerX:h,centerY:f}=a[u][l],v={onDown:()=>{d?n.sendMouseButton(t.button,!0):e.pointerButton=t.button},onUp:()=>{d?n.sendMouseButton(t.button,!1):e.pointerButton=0}};if(r.register(u,l,{activate:v.onDown,deactivate:v.onUp}),p(o,u,l))return()=>{};const g=(0,i.createButton)(t.symbol,v,c);return g.style.position="absolute",g.style.left=h-g.widthPx/2+"px",g.style.top=f-g.heightPx/2+"px",e.mouseOverlay.appendChild(g),()=>e.mouseOverlay.removeChild(g)},PointerMove:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l,x:d,y:h}=t,{centerX:f,centerY:v}=a[u][l],g={onDown:()=>{n.sendMouseMotion(d,h)},onUp:()=>{n.sendMouseMotion(d,h)}};if(r.register(u,l,{activate:g.onDown,deactivate:g.onUp}),p(o,u,l))return()=>{};const m=(0,i.createButton)(t.symbol,g,c);return m.style.position="absolute",m.style.left=f-m.widthPx/2+"px",m.style.top=v-m.heightPx/2+"px",e.mouseOverlay.appendChild(m),()=>e.mouseOverlay.removeChild(m)},PointerReset:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l],f={onDown:()=>{n.sendMouseSync()}};if(r.register(u,l,{activate:f.onDown,deactivate:()=>{}}),p(o,u,l))return()=>{};const v=(0,i.createButton)(t.symbol,f,c);return v.style.position="absolute",v.style.left=d-v.widthPx/2+"px",v.style.top=h-v.heightPx/2+"px",e.mouseOverlay.appendChild(v),()=>e.mouseOverlay.removeChild(v)},PointerToggle:function(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l],f={onDown:()=>{e.pointerDisabled=!e.pointerDisabled,e.pointerDisabled?v.classList.contains("emulator-button-highlight")||v.classList.add("emulator-button-highlight"):v.classList.remove("emulator-button-highlight")}};if(r.register(u,l,{activate:f.onDown,deactivate:()=>{}}),p(o,u,l))return()=>{};const v=(0,i.createButton)(t.symbol,f,c);return v.style.position="absolute",v.style.left=d-v.widthPx/2+"px",v.style.top=h-v.heightPx/2+"px",e.mouseOverlay.appendChild(v),()=>e.mouseOverlay.removeChild(v)},NippleActivator:function(t,e,n,o,i,r){const{cells:s,columnWidth:a,rowHeight:l,width:d,height:h}=o,{row:p,column:f}=t,{centerX:v,centerY:g}=s[p][f],m=document.createElement("div"),y=1.5,b=Math.max(0,v-a*y),_=Math.max(0,g-l*y),w=Math.max(0,d-v-a*y),D=Math.max(0,h-g-l*y);m.style.position="absolute",m.style.zIndex="999",m.style.left=b+"px",m.style.top=_+"px",m.style.right=w+"px",m.style.bottom=D+"px",e.mouseOverlay.appendChild(m);const x=u.create({zone:m,multitouch:!1,maxNumberOfNipples:1,mode:"static",follow:!1,dynamicPage:!0,size:1.5*Math.max(a,l),position:{left:(d-w-b)/2+"px",top:(h-D-_)/2+"px"}});let B=-1,E=-1;x.on("move",((t,e)=>{if(e.distance<10)return i.deactivate(E,B),B=-1,void(E=-1);let n=-1,o=-1;const r=22.5,s=e.angle.degree;s>r&&s<=67.5?(n=f+1,o=p-1):s>67.5&&s<=112.5?(n=f,o=p-1):s>112.5&&s<=157.5?(n=f-1,o=p-1):s>157.5&&s<=202.5?(n=f-1,o=p):s>202.5&&s<=247.5?(n=f-1,o=p+1):s>247.5&&s<=292.5?(n=f,o=p+1):s>292.5&&s<=337.5?(n=f+1,o=p+1):(n=f+1,o=p),B===n&&E===o||(i.deactivate(E,B),i.activate(o,n),B=n,E=o)}));let k=!1;x.on("start",(()=>{k=!0})),x.on("end",(()=>{k=!1,i.deactivate(E,B),E=-1,B=-1}));const K={capture:!0};function C(t){k&&x.processOnEnd(t)}for(const t of c.pointer.enders)e.mouseOverlay.addEventListener(t,C,K);return()=>{x.destroy(),e.mouseOverlay.removeChild(m);for(const t of c.pointer.enders)e.mouseOverlay.removeEventListener(t,C,K)}}};function h(t,e,n,o,r,s){const{cells:a,columnWidth:c}=o,{row:u,column:l}=t,{centerX:d,centerY:h}=a[u][l],p=(0,i.createButton)("keyboard",{onUp:()=>e.toggleKeyboard()},c),f=t=>{t?p.children[0].classList.add("emulator-control-close-icon"):p.children[0].classList.remove("emulator-control-close-icon")};return e.setOnKeyboardVisibility(f),p.style.position="absolute",p.style.left=d-p.widthPx/2+"px",p.style.top=h-p.heightPx/2+"px",e.mouseOverlay.appendChild(p),()=>{e.mouseOverlay.removeChild(p),e.removeOnKeyboardVisibility(f)}}function p(t,e,n){return!0===t.cells[e][n].hidden}function f(t,e,n){function o(o,i){if((o!==e||i!==n)&&o>=0&&o<t.cells.length){const e=t.cells[o];i>=0&&i<e.length&&(e[i].hidden=!0)}}for(let t=e-1;t<=e+1;++t)for(let e=n-1;e<=n+1;++e)o(t,e)}},{"../dom/pointer":36,"./button":18,"./grid":19,"./keyboard":20,"./mouse/mouse-common":24,"./options":30,nipplejs:14}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initLegacyLayersControl=void 0;const o=t("./button"),i=t("./mouse/mouse-common"),r=t("./nipple"),s=t("./options"),a=t("./keyboard");n.initLegacyLayersControl=function(t,e,n,c){var u;const l=Object.keys(n),d={keyboard:()=>{},mouse:()=>{},gestures:()=>{},buttons:()=>{}},h=s=>{d.keyboard(),d.mouse(),d.gestures(),d.buttons(),d.keyboard=()=>{},d.mouse=()=>{},d.gestures=()=>{},d.buttons=()=>{};const u=n[s];void 0!==u&&(d.keyboard=(0,a.keyboard)(e,c,u.mapper),void 0!==u.gestures&&u.gestures.length>0?d.gestures=(0,r.nipple)(e,c,u.gestures):d.mouse=(0,i.mouse)(t.autolock,t.sensitivity,e,c),void 0!==u.buttons&&u.buttons.length&&(d.buttons=(0,o.deprecatedButton)(e,c,u.buttons,54)))},p=0===(null===(u=e.options.optionControls)||void 0===u?void 0:u.length)?()=>{}:(0,s.options)(e,l,h,54,13.5,0);return h("default"),()=>{d.gestures(),d.buttons(),d.mouse(),d.keyboard(),p()}}},{"./button":18,"./keyboard":20,"./mouse/mouse-common":24,"./nipple":28,"./options":30}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.mouse=n.mount=n.mapXY=void 0;const o=t("../../dom/pointer"),i=t("./mouse-swipe"),r=t("./mouse-not-locked"),s=t("./mouse-locked"),a=.01;n.mapXY=function(t,e,n,o){const i=n.width(),r=n.height(),s=o.width,c=o.height,u=i/r;let l=s,d=s/u;d>c&&(d=c,l=c*u);const h=(c-d)/2,p=(s-l)/2;let f=Math.max(0,Math.min(1,(t-p)/l)),v=Math.max(0,Math.min(1,(e-h)/d));return f<=a&&(f=0),f>=.99&&(f=1),v<=a&&(v=0),v>=.99&&(v=1),{x:f,y:v}},n.mount=function(t,e,n,i,r,s){let a=0;const c=i=>{if(i.target!==t)return;if(e.pointerDisabled)return void i.stopPropagation();const r=(0,o.getPointerState)(i,t);a=r.button||e.pointerButton,n(r.x,r.y,a),i.stopPropagation()},u=n=>{if(n.target!==t)return;if(e.pointerDisabled)return void n.stopPropagation();const r=(0,o.getPointerState)(n,t);i(r.x,r.y,r.mX,r.mY),n.stopPropagation()},l=n=>{if(e.pointerDisabled)return void n.stopPropagation();const i=(0,o.getPointerState)(n,t);r(i.x,i.y,a),n.stopPropagation()},d=n=>{if(n.target!==t)return;if(e.pointerDisabled)return void n.stopPropagation();const i=(0,o.getPointerState)(n,t);s(i.x,i.y),n.stopPropagation()},h=t=>{t.stopPropagation()},p={capture:!1};for(const e of o.pointer.starters)t.addEventListener(e,c,p);for(const e of o.pointer.changers)t.addEventListener(e,u,p);for(const e of o.pointer.enders)t.addEventListener(e,l,p);for(const e of o.pointer.prevents)t.addEventListener(e,h,p);for(const e of o.pointer.leavers)t.addEventListener(e,d,p);return()=>{for(const e of o.pointer.starters)t.removeEventListener(e,c,p);for(const e of o.pointer.changers)t.removeEventListener(e,u,p);for(const e of o.pointer.enders)t.removeEventListener(e,l,p);for(const e of o.pointer.prevents)t.removeEventListener(e,h,p);for(const e of o.pointer.leavers)t.removeEventListener(e,d,p)}},n.mouse=function(t,e,n,a){return t&&!o.pointer.canLock?(0,i.mouseSwipe)(e,n,a):t?(0,s.mouseLocked)(e,n,a):(0,r.mouseNotLocked)(n,a)}},{"../../dom/pointer":36,"./mouse-locked":25,"./mouse-not-locked":26,"./mouse-swipe":27}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.mouseLocked=void 0;const o=t("./mouse-common");n.mouseLocked=function(t,e,n){const i=e.mouseOverlay;function r(){return document.pointerLockElement!==i}return(0,o.mount)(i,e,(function(t,e,o){if(r()){(i.requestPointerLock||i.mozRequestPointerLock||i.webkitRequestPointerLock).call(i)}else n.sendMouseButton(o,!0)}),(function(e,o,i,s){r()||0===i&&0===s||n.sendMouseRelativeMotion(i*t,s*t)}),(function(t,e,o){r()||n.sendMouseButton(o,!1)}),(function(t,e){}))}},{"./mouse-common":24}],26:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.mouseNotLocked=void 0;const o=t("./mouse-common");n.mouseNotLocked=function(t,e){const n=t.mouseOverlay,i=(n,i)=>(0,o.mapXY)(n,i,e,t);return document.pointerLockElement===n&&document.exitPointerLock(),(0,o.mount)(n,t,(function(t,n,o){const r=i(t,n);e.sendMouseMotion(r.x,r.y),e.sendMouseButton(o,!0)}),(function(t,n,o,r){const s=i(t,n);e.sendMouseMotion(s.x,s.y)}),(function(t,n,o){const r=i(t,n);e.sendMouseMotion(r.x,r.y),e.sendMouseButton(o,!1)}),(function(t,n){const o=i(t,n);e.sendMouseMotion(o.x,o.y)}))}},{"./mouse-common":24}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.mouseSwipe=void 0;const o=t("./mouse-common");n.mouseSwipe=function(t,e,n){const i=e.mouseOverlay;let r=-1,s=0,a=0,c=0;return(0,o.mount)(i,e,((t,e)=>{r=Date.now(),s=0,a=t,c=e}),(function(e,o,i,r){void 0===i&&(i=e-a),void 0===r&&(r=o-c),a=e,c=o,0===i&&0===r||(s+=Math.abs(i)+Math.abs(r),n.sendMouseRelativeMotion(i*t*2,r*t*2))}),((t,o)=>{if(Date.now()-r<500&&s<50){const t=e.pointerButton||0;n.sendMouseButton(t,!0),setTimeout((()=>n.sendMouseButton(t,!1)),60)}}),(()=>{}))}},{"./mouse-common":24}],28:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.nipple=void 0;const o=t("nipplejs"),i=t("../dom/keys");n.nipple=function(t,e,n){const r=o.create({zone:t.mouseOverlay,multitouch:!0,maxNumberOfNipples:2});let s=-1;const a=()=>{-1!==s&&(t.fireKeyUp(s),s=-1)},c={},u={},l={};for(const e of n)"end:release"===e.event?c[e.joystickId]=!0:e.mapTo!==i.KBD_NONE&&("tap"===e.event?u[e.joystickId]=e.mapTo:r.on(e.event,(()=>{var n;l[e.joystickId]=Date.now(),a(),n=e.mapTo,t.fireKeyDown(n),s=n})));const d={};return r.on("start",(()=>{const t=r.ids.length-1;d[t]=Date.now()})),r.on("end",(()=>{const e=r.ids.length-1,n=Date.now()-d[e];!0===c[e]&&a(),u[e]&&n<500&&l[e]<d[e]&&t.fireKeyPress(u[e])})),()=>r.destroy()}},{"../dom/keys":32,nipplejs:14}],29:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initNullLayersControl=void 0;const o=t("./keyboard"),i=t("./mouse/mouse-common"),r=t("./options");n.initNullLayersControl=function(t,e,n){var s;const a=(0,o.keyboard)(e,n),c=(0,i.mouse)(t.autolock,t.sensitivity,e,n),u=0===(null===(s=e.options.optionControls)||void 0===s?void 0:s.length)?()=>{}:(0,r.options)(e,["default"],(()=>{}),54,13.5,0);return()=>{a(),c(),u()}}},{"./keyboard":20,"./mouse/mouse-common":24,"./options":30}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.options=void 0;const o=t("./button"),i=t("../dom/helpers");function r(t,e){if(t.length<=1)return document.createElement("div");const n=document.createElement("select");n.classList.add("emulator-control-select");for(const e of t){const t=document.createElement("option");t.value=e,t.innerHTML=e,n.appendChild(t)}return n.onchange=t=>{const n=t.target.value;e(n)},(0,i.stopPropagation)(n,!1),n}n.options=function(t,e,n,s,a,c){const u=Math.round(s/4);let l=!1,d=!1;const h=()=>{const t=l?"flex":"none";for(const e of f)e!=v&&(e.style.display=t)},p=()=>{l=!l,!l&&d&&t.toggleKeyboard(),h()},f=[r(e,n),(0,o.createButton)("keyboard",{onClick:()=>{t.toggleKeyboard(),l&&!d&&(l=!1,h())}},s),(0,o.createButton)("save",{onClick:()=>{t.save(),l&&p()}},s),(0,o.createButton)("fullscreen",{onClick:()=>{t.toggleFullscreen(),l&&p()}},s),(0,o.createButton)("options",{onClick:p},s)],v=f[f.length-1],g=f[f.length-2].children[0],m=f[f.length-4].children[0],y=t=>{d=t,t?m.classList.add("emulator-control-close-icon"):m.classList.remove("emulator-control-close-icon")};t.setOnKeyboardVisibility(y),y(t.keyboardVisible),t.setOnFullscreen((t=>{t?g.classList.contains("emulator-control-exit-fullscreen-icon")||g.classList.add("emulator-control-exit-fullscreen-icon"):g.classList.remove("emulator-control-exit-fullscreen-icon")})),t.fullscreen&&g.classList.add("emulator-control-exit-fullscreen-icon");const b=(0,i.createDiv)("emulator-options"),_=d?"flex":"none";for(const t of f)t!==v&&t.classList.add("emulator-button-control"),t.style.marginRight=u+"px",t.style.marginBottom=u+"px",t!==v&&(t.style.display=_),b.appendChild(t);return b.style.position="absolute",b.style.right=c+"px",b.style.top=a+"px",t.mouseOverlay.appendChild(b),()=>{t.mouseOverlay.removeChild(b),t.setOnFullscreen((()=>{})),t.removeOnKeyboardVisibility(y)}}},{"../dom/helpers":31,"./button":18}],31:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.stopPropagation=n.createDiv=void 0;const o=t("./pointer");n.createDiv=function(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.innerHTML=e),n},n.stopPropagation=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t=>{t.stopPropagation()},i=t=>{t.stopPropagation(),e&&t.preventDefault()},r={capture:!1};for(const e of o.pointer.starters)t.addEventListener(e,n,r);for(const e of o.pointer.enders)t.addEventListener(e,n,r);for(const e of o.pointer.prevents)t.addEventListener(e,i,r)}},{"./pointer":36}],32:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.KBD_kp0=n.KBD_f12=n.KBD_f11=n.KBD_f10=n.KBD_f9=n.KBD_f8=n.KBD_f7=n.KBD_f6=n.KBD_f5=n.KBD_f4=n.KBD_f3=n.KBD_f2=n.KBD_f1=n.KBD_z=n.KBD_y=n.KBD_x=n.KBD_w=n.KBD_v=n.KBD_u=n.KBD_t=n.KBD_s=n.KBD_r=n.KBD_q=n.KBD_p=n.KBD_o=n.KBD_n=n.KBD_m=n.KBD_l=n.KBD_k=n.KBD_j=n.KBD_i=n.KBD_h=n.KBD_g=n.KBD_f=n.KBD_e=n.KBD_d=n.KBD_c=n.KBD_b=n.KBD_a=n.KBD_9=n.KBD_8=n.KBD_7=n.KBD_6=n.KBD_5=n.KBD_4=n.KBD_3=n.KBD_2=n.KBD_1=n.KBD_0=n.KBD_NONE=void 0,n.KBD_up=n.KBD_left=n.KBD_pagedown=n.KBD_end=n.KBD_delete=n.KBD_pageup=n.KBD_home=n.KBD_insert=n.KBD_pause=n.KBD_printscreen=n.KBD_slash=n.KBD_comma=n.KBD_period=n.KBD_quote=n.KBD_semicolon=n.KBD_rightbracket=n.KBD_leftbracket=n.KBD_backslash=n.KBD_equals=n.KBD_minus=n.KBD_grave=n.KBD_numlock=n.KBD_scrolllock=n.KBD_capslock=n.KBD_rightshift=n.KBD_leftshift=n.KBD_rightctrl=n.KBD_leftctrl=n.KBD_rightalt=n.KBD_leftalt=n.KBD_space=n.KBD_enter=n.KBD_backspace=n.KBD_tab=n.KBD_esc=n.KBD_kpenter=n.KBD_kpplus=n.KBD_kpminus=n.KBD_kpmultiply=n.KBD_kpdivide=n.KBD_kpperiod=n.KBD_kp9=n.KBD_kp8=n.KBD_kp7=n.KBD_kp6=n.KBD_kp5=n.KBD_kp4=n.KBD_kp3=n.KBD_kp2=n.KBD_kp1=void 0,n.domToKeyCode=n.keyCodesToDom=n.namedKeyCodes=n.domToKeyCodes=n.KBD_extra_lt_gt=n.KBD_right=n.KBD_down=void 0,n.KBD_NONE=0,n.KBD_0=48,n.KBD_1=49,n.KBD_2=50,n.KBD_3=51,n.KBD_4=52,n.KBD_5=53,n.KBD_6=54,n.KBD_7=55,n.KBD_8=56,n.KBD_9=57,n.KBD_a=65,n.KBD_b=66,n.KBD_c=67,n.KBD_d=68,n.KBD_e=69,n.KBD_f=70,n.KBD_g=71,n.KBD_h=72,n.KBD_i=73,n.KBD_j=74,n.KBD_k=75,n.KBD_l=76,n.KBD_m=77,n.KBD_n=78,n.KBD_o=79,n.KBD_p=80,n.KBD_q=81,n.KBD_r=82,n.KBD_s=83,n.KBD_t=84,n.KBD_u=85,n.KBD_v=86,n.KBD_w=87,n.KBD_x=88,n.KBD_y=89,n.KBD_z=90,n.KBD_f1=290,n.KBD_f2=291,n.KBD_f3=292,n.KBD_f4=293,n.KBD_f5=294,n.KBD_f6=295,n.KBD_f7=296,n.KBD_f8=297,n.KBD_f9=298,n.KBD_f10=299,n.KBD_f11=300,n.KBD_f12=301,n.KBD_kp0=320,n.KBD_kp1=321,n.KBD_kp2=322,n.KBD_kp3=323,n.KBD_kp4=324,n.KBD_kp5=325,n.KBD_kp6=326,n.KBD_kp7=327,n.KBD_kp8=328,n.KBD_kp9=329,n.KBD_kpperiod=330,n.KBD_kpdivide=331,n.KBD_kpmultiply=332,n.KBD_kpminus=333,n.KBD_kpplus=334,n.KBD_kpenter=335,n.KBD_esc=256,n.KBD_tab=258,n.KBD_backspace=259,n.KBD_enter=257,n.KBD_space=32,n.KBD_leftalt=342,n.KBD_rightalt=346,n.KBD_leftctrl=341,n.KBD_rightctrl=345,n.KBD_leftshift=340,n.KBD_rightshift=344,n.KBD_capslock=280,n.KBD_scrolllock=281,n.KBD_numlock=282,n.KBD_grave=96,n.KBD_minus=45,n.KBD_equals=61,n.KBD_backslash=92,n.KBD_leftbracket=91,n.KBD_rightbracket=93,n.KBD_semicolon=59,n.KBD_quote=39,n.KBD_period=46,n.KBD_comma=44,n.KBD_slash=47,n.KBD_printscreen=283,n.KBD_pause=284,n.KBD_insert=260,n.KBD_home=268,n.KBD_pageup=266,n.KBD_delete=261,n.KBD_end=269,n.KBD_pagedown=267,n.KBD_left=263,n.KBD_up=265,n.KBD_down=264,n.KBD_right=262,n.KBD_extra_lt_gt=348,n.domToKeyCodes={8:n.KBD_backspace,9:n.KBD_tab,13:n.KBD_enter,16:n.KBD_leftshift,17:n.KBD_leftctrl,18:n.KBD_leftalt,19:n.KBD_pause,27:n.KBD_esc,32:n.KBD_space,33:n.KBD_pageup,34:n.KBD_pagedown,35:n.KBD_end,36:n.KBD_home,37:n.KBD_left,38:n.KBD_up,39:n.KBD_right,40:n.KBD_down,45:n.KBD_insert,46:n.KBD_delete,48:n.KBD_0,49:n.KBD_1,50:n.KBD_2,51:n.KBD_3,52:n.KBD_4,53:n.KBD_5,54:n.KBD_6,55:n.KBD_7,56:n.KBD_8,57:n.KBD_9,59:n.KBD_semicolon,64:n.KBD_equals,65:n.KBD_a,66:n.KBD_b,67:n.KBD_c,68:n.KBD_d,69:n.KBD_e,70:n.KBD_f,71:n.KBD_g,72:n.KBD_h,73:n.KBD_i,74:n.KBD_j,75:n.KBD_k,76:n.KBD_l,77:n.KBD_m,78:n.KBD_n,79:n.KBD_o,80:n.KBD_p,81:n.KBD_q,82:n.KBD_r,83:n.KBD_s,84:n.KBD_t,85:n.KBD_u,86:n.KBD_v,87:n.KBD_w,88:n.KBD_x,89:n.KBD_y,90:n.KBD_z,91:n.KBD_leftbracket,93:n.KBD_rightbracket,96:n.KBD_kp0,97:n.KBD_kp1,98:n.KBD_kp2,99:n.KBD_kp3,100:n.KBD_kp4,101:n.KBD_kp5,102:n.KBD_kp6,103:n.KBD_kp7,104:n.KBD_kp8,105:n.KBD_kp9,111:n.KBD_kpdivide,112:n.KBD_f1,113:n.KBD_f2,114:n.KBD_f3,115:n.KBD_f4,116:n.KBD_f5,117:n.KBD_f6,118:n.KBD_f7,119:n.KBD_f8,120:n.KBD_f9,121:n.KBD_f10,122:n.KBD_f11,123:n.KBD_f12,144:n.KBD_numlock,145:n.KBD_scrolllock,173:n.KBD_minus,186:n.KBD_semicolon,187:n.KBD_equals,188:n.KBD_comma,189:n.KBD_minus,190:n.KBD_period,191:n.KBD_slash,219:n.KBD_leftbracket,220:n.KBD_backslash,221:n.KBD_rightbracket},n.namedKeyCodes={KBD_NONE:n.KBD_NONE,KBD_0:n.KBD_0,KBD_1:n.KBD_1,KBD_2:n.KBD_2,KBD_3:n.KBD_3,KBD_4:n.KBD_4,KBD_5:n.KBD_5,KBD_6:n.KBD_6,KBD_7:n.KBD_7,KBD_8:n.KBD_8,KBD_9:n.KBD_9,KBD_a:n.KBD_a,KBD_b:n.KBD_b,KBD_c:n.KBD_c,KBD_d:n.KBD_d,KBD_e:n.KBD_e,KBD_f:n.KBD_f,KBD_g:n.KBD_g,KBD_h:n.KBD_h,KBD_i:n.KBD_i,KBD_j:n.KBD_j,KBD_k:n.KBD_k,KBD_l:n.KBD_l,KBD_m:n.KBD_m,KBD_n:n.KBD_n,KBD_o:n.KBD_o,KBD_p:n.KBD_p,KBD_q:n.KBD_q,KBD_r:n.KBD_r,KBD_s:n.KBD_s,KBD_t:n.KBD_t,KBD_u:n.KBD_u,KBD_v:n.KBD_v,KBD_w:n.KBD_w,KBD_x:n.KBD_x,KBD_y:n.KBD_y,KBD_z:n.KBD_z,KBD_f1:n.KBD_f1,KBD_f2:n.KBD_f2,KBD_f3:n.KBD_f3,KBD_f4:n.KBD_f4,KBD_f5:n.KBD_f5,KBD_f6:n.KBD_f6,KBD_f7:n.KBD_f7,KBD_f8:n.KBD_f8,KBD_f9:n.KBD_f9,KBD_f10:n.KBD_f10,KBD_f11:n.KBD_f11,KBD_f12:n.KBD_f12,KBD_kp0:n.KBD_kp0,KBD_kp1:n.KBD_kp1,KBD_kp2:n.KBD_kp2,KBD_kp3:n.KBD_kp3,KBD_kp4:n.KBD_kp4,KBD_kp5:n.KBD_kp5,KBD_kp6:n.KBD_kp6,KBD_kp7:n.KBD_kp7,KBD_kp8:n.KBD_kp8,KBD_kp9:n.KBD_kp9,KBD_kpperiod:n.KBD_kpperiod,KBD_kpdivide:n.KBD_kpdivide,KBD_kpmultiply:n.KBD_kpmultiply,KBD_kpminus:n.KBD_kpminus,KBD_kpplus:n.KBD_kpplus,KBD_kpenter:n.KBD_kpenter,KBD_esc:n.KBD_esc,KBD_tab:n.KBD_tab,KBD_backspace:n.KBD_backspace,KBD_enter:n.KBD_enter,KBD_space:n.KBD_space,KBD_leftalt:n.KBD_leftalt,KBD_rightalt:n.KBD_rightalt,KBD_leftctrl:n.KBD_leftctrl,KBD_rightctrl:n.KBD_rightctrl,KBD_leftshift:n.KBD_leftshift,KBD_rightshift:n.KBD_rightshift,KBD_capslock:n.KBD_capslock,KBD_scrolllock:n.KBD_scrolllock,KBD_numlock:n.KBD_numlock,KBD_grave:n.KBD_grave,KBD_minus:n.KBD_minus,KBD_equals:n.KBD_equals,KBD_backslash:n.KBD_backslash,KBD_leftbracket:n.KBD_leftbracket,KBD_rightbracket:n.KBD_rightbracket,KBD_semicolon:n.KBD_semicolon,KBD_quote:n.KBD_quote,KBD_period:n.KBD_period,KBD_comma:n.KBD_comma,KBD_slash:n.KBD_slash,KBD_printscreen:n.KBD_printscreen,KBD_pause:n.KBD_pause,KBD_insert:n.KBD_insert,KBD_home:n.KBD_home,KBD_pageup:n.KBD_pageup,KBD_delete:n.KBD_delete,KBD_end:n.KBD_end,KBD_pagedown:n.KBD_pagedown,KBD_left:n.KBD_left,KBD_up:n.KBD_up,KBD_down:n.KBD_down,KBD_right:n.KBD_right,KBD_extra_lt_gt:n.KBD_extra_lt_gt},n.keyCodesToDom={};for(const t of Object.keys(n.domToKeyCodes)){const e=Number.parseInt(t,10);n.keyCodesToDom[n.domToKeyCodes[e]]=e}n.domToKeyCode=function(t){return n.domToKeyCodes[t]||0}},{}],33:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.Layers=n.layers=void 0;const r=t("notyf"),s=i(t("simple-keyboard")),a=t("./helpers"),c=t("./keys"),u=t("element-resize-detector")({});n.layers=function(t,e){return new l(t,e||{})};class l{constructor(t,e){o(this,"options",void 0),o(this,"root",void 0),o(this,"loading",void 0),o(this,"canvas",void 0),o(this,"video",void 0),o(this,"mouseOverlay",void 0),o(this,"width",void 0),o(this,"height",void 0),o(this,"fullscreen",!1),o(this,"keyboardVisible",!1),o(this,"pointerLock",!1),o(this,"pointerDisabled",!1),o(this,"pointerButton",0),o(this,"notyf",new r.Notyf),o(this,"toggleKeyboard",(()=>!1)),o(this,"fullscreenElement",void 0),o(this,"clickToStart",void 0),o(this,"loaderText",void 0),o(this,"onResize",void 0),o(this,"onKeyDown",void 0),o(this,"onKeyUp",void 0),o(this,"onKeyPress",void 0),o(this,"onKeysPress",void 0),o(this,"onSave",void 0),o(this,"onSaveStarted",void 0),o(this,"onSaveEnded",void 0),o(this,"onFullscreenChanged",[]),o(this,"onKeyboardChanged",[]),this.options=e,this.root=t,this.root.classList.add("emulator-root"),this.fullscreenElement=e.fullscreenElement||this.root,this.canvas=document.createElement("canvas"),this.canvas.className="emulator-canvas",this.video=document.createElement("video"),this.video.setAttribute("autoplay",""),this.video.setAttribute("playsinline",""),this.video.className="emulator-video",this.loading=(0,a.createDiv)("emulator-loading","\n<div class='emulator-loading-inner'>\n<pre class='emulator-loading-pre-1'>\n _ __\n (_)____ ____/ /___ _____ _________ ____ ___\n / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\n / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\n __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\n /___/\n</pre>\n<pre class='emulator-loading-pre-2'>\n</pre>\n<div class='emulator-loader'>\n</div>\n</div>\n"),this.loaderText=this.loading.querySelector(".emulator-loading-pre-2"),this.mouseOverlay=(0,a.createDiv)("emulator-mouse-overlay",""),this.clickToStart=(0,a.createDiv)("emulator-click-to-start-overlay",'\n<div class="emulator-click-to-start-text">Press to start</div>\n<div class="emulator-click-to-start-icon"></div>\n'),this.clickToStart.onclick=()=>{this.clickToStart.style.display="none",this.video.play()},this.root.appendChild(this.canvas),this.root.appendChild(this.video),this.root.appendChild(this.mouseOverlay),this.root.appendChild(this.clickToStart),this.root.appendChild(this.loading),this.width=t.offsetWidth,this.height=t.offsetHeight,this.onResize=[],this.onKeyDown=()=>{},this.onKeyUp=()=>{},this.onKeyPress=()=>{},this.onKeysPress=()=>{},this.onSave=()=>Promise.reject(new Error("Not implemented")),this.onSaveStarted=()=>{},this.onSaveEnded=()=>{},u.listenTo(this.root,(e=>{if(e===t){this.width=e.offsetWidth,this.height=e.offsetHeight;for(const t of this.onResize)t(this.width,this.height)}})),this.initKeyEvents(),this.initKeyboard(),this.preventContextMenu(),this.fullscreenElement.onfullscreenchange=()=>{if(document.fullscreenElement!==this.fullscreenElement){this.fullscreen=!1;for(const t of this.onFullscreenChanged)t(this.fullscreen)}}}initKeyEvents(){const t=this.options.keyboardInputDiv??this.root;t.style.outline="none",t.tabIndex&&-1!==t.tabIndex||(t.tabIndex=0),t.addEventListener("keydown",(t=>{const e=(0,c.domToKeyCode)(t.keyCode);this.onKeyDown(e),t.stopPropagation(),t.preventDefault()})),t.addEventListener("keyup",(t=>{const e=(0,c.domToKeyCode)(t.keyCode);this.onKeyUp(e),t.stopPropagation(),t.preventDefault()}))}preventContextMenu(){this.root.addEventListener("contextmenu",(t=>(t.stopPropagation(),t.preventDefault(),!1)))}addOnResize(t){this.onResize.push(t)}removeOnResize(t){this.onResize=this.onResize.filter((e=>e!==t))}setOnKeyDown(t){this.onKeyDown=t}fireKeyDown(t){this.onKeyDown(t)}setOnKeyUp(t){this.onKeyUp=t}fireKeyUp(t){this.onKeyUp(t)}setOnKeyPress(t){this.onKeyPress=t}fireKeyPress(t){this.onKeyPress(t)}setOnKeysPress(t){this.onKeysPress=t}fireKeysPress(t){this.onKeysPress(t)}toggleFullscreen(){if(this.fullscreen){this.fullscreen=!1,this.fullscreenElement.classList.contains("emulator-fullscreen-workaround")?this.fullscreenElement.classList.remove("emulator-fullscreen-workaround"):document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen();for(const t of this.onFullscreenChanged)t(!1)}else{this.fullscreen=!0;const t=this.fullscreenElement;t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():this.fullscreenElement.classList.add("emulator-fullscreen-workaround");for(const t of this.onFullscreenChanged)t(!0)}}setOnFullscreen(t){this.onFullscreenChanged.push(t)}removeOnFullscreen(t){this.onFullscreenChanged=this.onFullscreenChanged.filter((e=>e!==t))}setOnKeyboardVisibility(t){this.onKeyboardChanged.push(t)}removeOnKeyboardVisibility(t){this.onKeyboardChanged=this.onKeyboardChanged.filter((e=>e!==t))}save(){return this.onSaveStarted(),this.onSave().then((()=>{this.notyf.success("Saved"),this.onSaveEnded()})).catch((t=>{this.notyf.error(t.message),this.onSaveEnded()}))}setOnSave(t){this.onSave=t}getOnSave(){return this.onSave}setOnSaveStarted(t){this.onSaveStarted=t}setOnSaveEnded(t){this.onSaveEnded=t}hideLoadingLayer(){this.loading.style.visibility="hidden"}showLoadingLayer(){this.loading.style.visibility="visible"}setLoadingMessage(t){this.loaderText.innerHTML=t}switchToVideo(){this.video.style.display="block",this.canvas.style.display="none"}showClickToStart(){this.clickToStart.style.display="flex"}initKeyboard(){let t=!1;const e=[{"{esc}":"␛","{bksp}":"⌫","{enter}":"↵","{space}":"Space","{up}":"↑","{down}":"↓","{left}":"←","{right}":"→","{shift}":"⇑","{ctrl}":"Ctrl","{alt}":"Alt","{tab}":"Tab"},{"{esc}":"␛","{bksp}":"⌫","{enter}":"↵","{space}":"Space","{up}":"↑","{down}":"↓","{left}":"←","{right}":"→","{shift}":"⇑","{alt}":"Alt","{ctrl}":"Ctrl","{tab}":"Tab",q:"й",w:"ц",e:"у",r:"к",t:"е",y:"н",u:"г",i:"ш",o:"щ",p:"з","{":"х","}":"ъ",a:"ф",s:"ы",d:"в",f:"а",g:"п",h:"р",j:"о",k:"л",l:"д",";":"ж","'":"э",z:"я",x:"ч",c:"с",v:"м",b:"и",n:"т",m:"ь",",":"б",".":"ю"}];let n=0;const o=this.options.keyboardDiv||(0,a.createDiv)("");o.classList.add("emulator-keyboard"),o.style.display="none",(0,a.stopPropagation)(o);const i=new s.default(o,{layout:{en:["{esc} ` 1 2 3 4 5 6 7 8 9 0 () - = {bksp} {enter}","{tab} q w e r t y u i o p { } \\ {up}","{shift} {left} {right} a s d f g h j k l ; ' [ {down}","⎘ {alt} {ctrl} z x c v b n m , . / ] {space}"]},layoutName:"en",display:e[n],onKeyPress:t=>{if("⎘"===t)return;const e=d(t);for(const t of e)this.fireKeyDown(t)},onKeyReleased:t=>{if("⎘"===t)return n=(n+1)%e.length,void i.setOptions({display:e[n]});const o=d(t);for(const t of o)this.fireKeyUp(t)},preventMouseDownDefault:!0,preventMouseUpDefault:!0,stopMouseDownPropagation:!0,stopMouseUpPropagation:!0,physicalKeyboardHighlight:!1,physicalKeyboardHighlightPress:!1,physicalKeyboardHighlightPressUseClick:!1,physicalKeyboardHighlightPressUsePointerEvents:!1});this.toggleKeyboard=()=>{t=!t;const e=t?"block":"none";o.style.display=e;for(const e of this.onKeyboardChanged)e(t);return this.keyboardVisible=t,t},this.options.keyboardDiv||this.mouseOverlay.appendChild(o)}}function d(t){if(t.length>1)return"{enter}"===t?[c.KBD_enter]:"{shift}"===t?[c.KBD_leftshift]:"{bksp}"===t?[c.KBD_backspace]:"{lock}"===t?[c.KBD_capslock]:"{tab}"===t?[c.KBD_tab]:"{space}"===t?[c.KBD_space]:"{esc}"===t?[c.KBD_esc]:"{ctrl}"===t?[c.KBD_leftctrl]:"{alt}"===t?[c.KBD_leftalt]:"{up}"===t?[c.KBD_up]:"{down}"===t?[c.KBD_down]:"{left}"===t?[c.KBD_left]:"{right}"===t?[c.KBD_right]:(console.warn("Unknown button",t),[]);if(","===t)return[c.KBD_comma];if("."===t)return[c.KBD_period];if("'"===t)return[c.KBD_quote];if(":"===t)return[c.KBD_semicolon];if("{"===t)return[c.KBD_leftshift,c.KBD_leftbracket];if("}"===t)return[c.KBD_leftshift,c.KBD_rightbracket];const e=(0,c.domToKeyCode)(t.toUpperCase().charCodeAt(0));return 0===e?[]:[e]}n.Layers=l},{"./helpers":31,"./keys":32,"element-resize-detector":7,notyf:15,"simple-keyboard":16}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.lifecycle=void 0,n.lifecycle=function(t){let e="",n="";function o(){document[e]?t.pause():t.resume()}void 0!==document.hidden?(e="hidden",n="visibilitychange"):void 0!==document.mozHidden?(e="mozHidden",n="mozvisibilitychange"):void 0!==document.msHidden?(e="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(e="webkitHidden",n="webkitvisibilitychange"),document.addEventListener(n,o),t.events().onExit((()=>{document.removeEventListener(n,o)}))}},{}],35:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.MemStorage=void 0;n.MemStorage=class{constructor(){o(this,"length",0),o(this,"storage",{})}setItem(t,e){this.storage[t]=e,this.length=Object.keys(this.storage).length}getItem(t){const e=this.storage[t];return void 0===e?null:e}removeItem(t){delete this.storage[t],this.length=Object.keys(this.storage).length}key(t){const e=Object.keys(this.storage);return void 0===e[t]?null:e[t]}clear(){this.length=0,this.storage={}}}},{}],36:[function(t,e,n){"use strict";function o(t,e){if(t.type.match(/^touch/)){const n=t,o=e.getBoundingClientRect();return{x:n.targetTouches[0].clientX-o.x,y:n.targetTouches[0].clientY-o.y,mX:0,mY:0}}if(t.type.match(/^pointer/)){const e=t;return{x:e.offsetX,y:e.offsetY,mX:e.movementX,mY:e.movementY}}{const e=t;return{x:e.offsetX,y:e.offsetY,mX:e.movementX,mY:e.movementY,button:0===e.button?0:1}}}Object.defineProperty(n,"__esModule",{value:!0}),n.pointers=n.getPointerState=n.pointer=void 0,n.pointer=function(){const t=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),e=t&&!!("ontouchstart"in window),n=t&&!!window.PointerEvent,o=t&&!!window.MSPointerEvent;let i=!t;const r=[],s=[],a=[],c=[],u=[];n?(r.push("pointerdown"),a.push("pointerup","pointercancel"),s.push("pointermove"),u.push("touchstart","touchmove","touchend")):o?(r.push("MSPointerDown"),s.push("MSPointerMove"),a.push("MSPointerUp")):e?(i=!1,r.push("touchstart","mousedown"),s.push("touchmove"),a.push("touchend","touchcancel","mouseup")):(r.push("mousedown"),s.push("mousemove"),a.push("mouseup"),c.push("mouseleave"));return{mobile:t,canLock:i,starters:r,changers:s,enders:a,prevents:u,leavers:c}}(),n.getPointerState=o,n.pointers={bind:n.pointer,getPointerState:o}},{}],37:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.LStorage=void 0;const i=t("./mem-storage");n.LStorage=class{constructor(t,e){o(this,"backend",void 0),o(this,"length",void 0),o(this,"prefix",void 0),this.prefix=e;try{this.backend=t||localStorage,this.testBackend()}catch(t){this.backend=new i.MemStorage}this.length=this.backend.length,"function"==typeof this.backend.sync&&(this.sync=t=>{this.backend.sync(t)})}testBackend(){const t=this.prefix+".test.record";this.backend.setItem(t,"123");const e=this.backend.getItem(t);this.backend.removeItem(t);if(!("123"===e&&null===this.backend.getItem(t)))throw new Error("Storage backend is not working properly")}setLocalStoragePrefix(t){this.prefix=t}clear(){if(!this.backend.length)return;const t=[];for(let e=0;e<this.backend.length;++e){const n=this.backend.key(e);n&&n.startsWith(this.prefix)&&t.push(n)}for(const e of t)this.backend.removeItem(e);this.length=this.backend.length}key(t){return this.backend.key(t)}setItem(t,e){if(!e||void 0===e.length||0===e.length)return void this.writeStringToKey(t,"");let n=0;for(;n<e.length;){let o=e.substr(n,1024);n+=o.length,n<e.length&&(o+="@"),this.writeStringToKey(t,o),t+="."}}getItem(t){let e=this.readStringFromKey(t);if(null===e)return null;if(0===e.length)return e;for(;"@"===e[e.length-1];){e=e.substr(0,e.length-1),t+=".";const n=this.readStringFromKey(t);e+=null===n?"":n}return e}removeItem(t){this.backend.removeItem(this.prefix+t),this.length=this.backend.length}writeStringToKey(t,e){this.backend.setItem(this.prefix+t,e),this.length=this.backend.length}readStringFromKey(t){return this.backend.getItem(this.prefix+t)}}},{"./mem-storage":35}],38:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.EmulatorsUi=void 0;const i=t("./build"),r=t("./dom/layers"),s=t("./dom/lifecycle"),a=t("./network/xhr"),c=t("./graphics/_2d"),u=t("./graphics/webgl"),l=t("./graphics/video"),d=t("./controls/keyboard"),h=t("./controls/mouse/mouse-common"),p=t("./controls/nipple"),f=t("./controls/options"),v=t("./dom/keys"),g=t("./sound/audio-node"),m=t("./notification/notyf"),y=t("./persist/save-load"),b=t("./controls/grid"),_=t("./dom/pointer"),w=t("./dom/storage"),D=t("./js-dos");class x{constructor(){o(this,"build",i.Build),o(this,"dom",{layers:r.layers,lifecycle:s.lifecycle,pointers:_.pointers,storage:new w.LStorage(void 0,"emulators.ui.")}),o(this,"network",{resolveBundle:a.resolveBundle}),o(this,"graphics",{webGl:u.webGl,_2d:c._2d,video:l.video}),o(this,"sound",{audioNode:g.audioNode}),o(this,"persist",{save:y.save,load:y.load}),o(this,"controls",{getGrid:b.getGrid,namedKeyCodes:v.namedKeyCodes,domToKeyCodes:v.domToKeyCodes,domToKeyCode:v.domToKeyCode,keyCodesToDom:v.keyCodesToDom,keyboard:d.keyboard,mouse:h.mouse,nipple:p.nipple,options:f.options}),o(this,"notifications",{notyf:m.notyf}),o(this,"dos",((t,e)=>new D.DosInstance(t,B,e||{})))}}n.EmulatorsUi=x;const B=new x;window.emulatorsUi=B,window.Dos=B.dos},{"./build":17,"./controls/grid":19,"./controls/keyboard":20,"./controls/mouse/mouse-common":24,"./controls/nipple":28,"./controls/options":30,"./dom/keys":32,"./dom/layers":33,"./dom/lifecycle":34,"./dom/pointer":36,"./dom/storage":37,"./graphics/_2d":39,"./graphics/video":40,"./graphics/webgl":41,"./js-dos":42,"./network/xhr":43,"./notification/notyf":44,"./persist/save-load":46,"./sound/audio-node":47}],39:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._2d=void 0,n._2d=function(t,e,n){const o=t.canvas,i=o.getContext("2d");if(null===i)throw new Error("Unable to create 2d context on given canvas");let r=t.width,s=t.height,a=0,c=0;const u=()=>{const t=n??a/c;let e=r,i=r/t;i>s&&(i=s,e=s*t),o.style.position="relative",o.style.top=(s-i)/2+"px",o.style.left=(r-e)/2+"px",o.style.width=e+"px",o.style.height=i+"px"},l=(t,e)=>{r=t,s=e,u()};t.addOnResize(l);let d=new Uint8ClampedArray(0);const h=(t,e)=>{a=t,c=e,o.width=a,o.height=c,d=new Uint8ClampedArray(t*e*4),u()};e.events().onFrameSize(h),e.events().onFrame(((t,e)=>{if(null===t&&null===e)return;const n=null!==t?t:e;let o=0,r=0;for(;r<d.length;)d[r++]=n[o++],d[r++]=n[o++],d[r++]=n[o++],d[r++]=255,n.length===d.length&&o++;i.putImageData(new ImageData(d,a,c),0,0)})),h(e.width(),e.height()),e.events().onExit((()=>{t.removeOnResize(l)}))}},{}],40:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.video=void 0,n.video=function(t,e){t.switchToVideo(),e.events().onMessage(((e,n)=>{"onremotestream"===e&&window.Janus.attachMediaStream(t.video,n)}))}},{}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.webGl=void 0;function o(t,e,n){const o=t.createShader(e);if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error("An error occurred compiling the shaders: "+e)}return o}n.webGl=function(t,e,n){const i=t.canvas,r=i.getContext("webgl");if(null===r)throw new Error("Unable to create webgl context on given canvas");const s=function(t,e,n){const i=o(t,t.VERTEX_SHADER,e),r=o(t,t.FRAGMENT_SHADER,n),s=t.createProgram();if(t.attachShader(s,i),t.attachShader(s,r),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error("Unable to initialize the shader program: "+t.getProgramInfoLog(s));return s}(r,"\nattribute vec4 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying highp vec2 vTextureCoord;\n\nvoid main(void) {\n gl_Position = aVertexPosition;\n vTextureCoord = aTextureCoord;\n}\n","\nvarying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\n\nvoid main(void) {\n highp vec4 color = texture2D(uSampler, vTextureCoord);\n gl_FragColor = vec4(color.r, color.g, color.b, 1.0);\n}\n"),a=r.getAttribLocation(s,"aVertexPosition"),c=r.getAttribLocation(s,"aTextureCoord"),u=r.getUniformLocation(s,"uSampler");!function(t,e,n){const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o);const i=[-1,-1,0,1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,1,0];t.bufferData(t.ARRAY_BUFFER,new Float32Array(i),t.STATIC_DRAW),t.vertexAttribPointer(e,3,t.FLOAT,!1,0,0),t.enableVertexAttribArray(e);const r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r);const s=[0,1,1,1,1,0,0,1,1,0,0,0];t.bufferData(t.ARRAY_BUFFER,new Float32Array(s),t.STATIC_DRAW),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n)}(r,a,c);const l=r.createTexture();r.bindTexture(r.TEXTURE_2D,l),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);const d=new Uint8Array([0,0,0]);r.texImage2D(r.TEXTURE_2D,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,d),r.useProgram(s),r.activeTexture(r.TEXTURE0),r.uniform1i(u,0);let h=t.width,p=t.height,f=0,v=0;const g=()=>{const t=n??f/v;let e=h,o=h/t;o>p&&(o=p,e=p*t),i.style.position="relative",i.style.top=(p-o)/2+"px",i.style.left=(h-e)/2+"px",i.style.width=e+"px",i.style.height=o+"px"},m=(t,e)=>{h=t,p=e,g()};t.addOnResize(m);const y=(t,e)=>{f=t,v=e,i.width=f,i.height=v,r.viewport(0,0,f,v),g()};e.events().onFrameSize(y),y(e.width(),e.height());let b=null,_=null,w=0;e.events().onFrame(((t,e)=>{_=null!=t?t:e,w=null!=t?r.RGB:r.RGBA,null===b&&(b=requestAnimationFrame(D))}));const D=()=>{r.texImage2D(r.TEXTURE_2D,0,w,f,v,0,w,r.UNSIGNED_BYTE,_),r.drawArrays(r.TRIANGLES,0,6),b=null,_=null};e.events().onExit((()=>{t.removeOnResize(m)}))}},{}],42:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.DosInstance=void 0;const i=t("./controls/layers-config"),r=t("./controls/legacy-layers-control"),s=t("./controls/null-layers-control"),a=t("./controls/layers-control"),c=t("./dom/pointer");n.DosInstance=class{constructor(t,e,n){o(this,"emulatorsUi",void 0),o(this,"emulatorFunction",void 0),o(this,"createTransportLayer",void 0),o(this,"layers",void 0),o(this,"layersConfig",null),o(this,"ciPromise",void 0),o(this,"options",void 0),o(this,"mobileControls",void 0),o(this,"mirroredControls",void 0),o(this,"scaleControls",void 0),o(this,"autolock",void 0),o(this,"sensitivity",void 0),o(this,"storage",void 0),o(this,"volume",void 0),o(this,"clickToStart",void 0),o(this,"unbindControls",(()=>{})),o(this,"storedLayersConfig",null),o(this,"onMobileControlsChanged",void 0),o(this,"onSensitivityChanged",[]),o(this,"onScaleChanged",[]),o(this,"onVolumeChanged",[]),o(this,"setVolumeImplFn",(()=>{})),o(this,"registerOnSensitivityChanged",(t=>{this.onSensitivityChanged.push(t)})),o(this,"removeOnSensitivityChanged",(t=>{this.onSensitivityChanged=this.onSensitivityChanged.filter((e=>e!==t))})),o(this,"registerOnScaleChanged",(t=>{this.onScaleChanged.push(t)})),o(this,"removeOnScaleChanged",(t=>{this.onScaleChanged=this.onScaleChanged.filter((e=>e!==t))})),o(this,"registerOnVolumeChanged",(t=>{this.onVolumeChanged.push(t)})),o(this,"removeOnVolumeChanged",(t=>{this.onVolumeChanged=this.onVolumeChanged.filter((e=>e!==t))})),this.options=n,this.emulatorsUi=e,this.storage=e.dom.storage,this.emulatorFunction=n.emulatorFunction||"dosboxWorker",this.clickToStart=n.clickToStart||!1,this.layers=this.emulatorsUi.dom.layers(t,n.layersOptions),this.layers.showLoadingLayer(),this.createTransportLayer=n.createTransportLayer,this.mobileControls=c.pointers.bind.mobile,this.autolock=!1,this.mirroredControls=!0===this.options.mirroredControls||"true"===this.storage.getItem("mirroredControls");const i=this.options.scaleControls??Number.parseFloat(this.storage.getItem("scaleControls")??"1.0");this.scaleControls=Number.isNaN(i)?1:i;const r=this.options.sensitivityValue??Number.parseFloat(this.storage.getItem("sensitivity")??"1.0");this.sensitivity=Number.isNaN(r)?1:r;const s=Number.parseFloat(this.storage.getItem("volume")??"1.0");if(this.volume=Number.isNaN(s)?1:s,this.onMobileControlsChanged=()=>{},"backend"===this.emulatorFunction&&void 0===this.createTransportLayer)throw new Error("Emulator function set to 'backend' but 'createTransportLayer' is not a function")}async run(t,e,n){var o,r,s;await this.stop(),this.layers.setLoadingMessage("Starting...");const a=null!=n&&n.length>0?n:t+".changes";let c;try{c=await this.runBundle(t,e,a)}catch(t){throw this.layers.setLoadingMessage("Unexpected error occured..."),this.layers.notyf.error({message:"Can't start emulator look browser logs for more info"}),console.error(t),t}const u=this.emulatorsUi;if("janus"===this.emulatorFunction)u.graphics.video(this.layers,c);else{u.persist.save(a,this.layers,c,emulators);try{if(!0===this.options.noWebGL)throw new Error("WebGL is disabled by options");u.graphics.webGl(this.layers,c,this.options.aspect)}catch(t){console.error("Unable to create webgl canvas, fallback to 2d rendering"),u.graphics._2d(this.layers,c,this.options.aspect)}this.setVolumeImplFn=u.sound.audioNode(c),this.setVolumeImplFn(this.volume)}u.dom.lifecycle(c);const l=await c.config();return this.autolock=!0===(null===(o=l.output)||void 0===o||null===(r=o.options)||void 0===r||null===(s=r.autolock)||void 0===s?void 0:s.value),await this.setLayersConfig((0,i.extractLayersConfig)(l)),this.mobileControls||(this.mobileControls=!0,this.disableMobileControls()),this.layers.setLoadingMessage("Ready"),this.layers.hideLoadingLayer(),this.clickToStart&&this.layers.showClickToStart(),c}async stop(){if(this.layers.showLoadingLayer(),void 0===this.ciPromise)return;const t=await this.ciPromise;delete this.ciPromise,await t.exit()}async setLayersConfig(t,e){if(void 0===this.ciPromise)return;const n=await this.ciPromise;this.layersConfig=t,this.unbindControls(),null===t?this.unbindControls=(0,s.initNullLayersControl)(this,this.layers,n):void 0===t.version?this.unbindControls=(0,r.initLegacyLayersControl)(this,this.layers,t,n):this.unbindControls=(0,a.initLayersControl)(this.layers,t,n,this,this.mirroredControls,this.scaleControls,e)}getLayersConfig(){return this.layersConfig}async enableMobileControls(){this.mobileControls||(this.mobileControls=!0,await this.setLayersConfig(this.storedLayersConfig),this.storedLayersConfig=null,this.onMobileControlsChanged(!0))}async disableMobileControls(){this.mobileControls&&(this.mobileControls=!1,this.storedLayersConfig=this.layersConfig,await this.setLayersConfig(null),this.onMobileControlsChanged(!1))}async setMirroredControls(t){this.mirroredControls!==t&&(this.mirroredControls=t,this.storage.setItem("mirroredControls",t+""),t?this.mobileControls?await this.setLayersConfig(this.layersConfig):await this.enableMobileControls():this.mobileControls&&await this.setLayersConfig(this.layersConfig))}async setScaleControls(t){if(t!==this.scaleControls){this.scaleControls=t,this.storage.setItem("scaleControls",t+""),this.mobileControls&&await this.setLayersConfig(this.layersConfig);for(const t of this.onScaleChanged)t(this.scaleControls)}}async setSensitivity(t){if(t!==this.sensitivity){this.sensitivity=t,this.storage.setItem("sensitivity",t+""),await this.setLayersConfig(this.layersConfig);for(const t of this.onSensitivityChanged)t(this.sensitivity)}}async setVolume(t){this.volume=t,this.storage.setItem("volume",t+""),this.setVolumeImplFn(t);for(const t of this.onVolumeChanged)t(this.volume)}async setAutolock(t){t!==this.autolock&&(this.autolock=t,await this.setLayersConfig(this.layersConfig))}setOnMobileControlsChanged(t){this.onMobileControlsChanged=t}async runBundle(t,e,n){const o=this.emulatorsUi;if("janus"===this.emulatorFunction)this.layers.setLoadingMessage("Connecting..."),this.ciPromise=emulators.janus(t);else{this.layers.setLoadingMessage("Downloading bundle ...");const i=o.network.resolveBundle(t,{onprogress:t=>this.layers.setLoadingMessage("Downloading bundle "+t+"%")}),r={onExtractProgress:(t,e,n,o)=>{if(0!==t)return;const i=Math.round(n/o*100),r=e.lastIndexOf("/"),s=e.substring(r+1);this.layers.setLoadingMessage("Extracting "+i+"% ("+s+")")}};try{let t;t=null!=e&&e.length>0?await o.network.resolveBundle(e,{httpCache:!1}):await o.persist.load(n,emulators);const s=await i;"backend"===this.emulatorFunction?this.ciPromise=emulators.backend([s,t],this.createTransportLayer(),r):this.ciPromise=emulators[this.emulatorFunction]([s,t],r)}catch{const t=await i;"backend"===this.emulatorFunction?this.ciPromise=emulators.backend([t],this.createTransportLayer(),r):this.ciPromise=emulators[this.emulatorFunction]([t],r)}}return this.ciPromise}}},{"./controls/layers-config":21,"./controls/layers-control":22,"./controls/legacy-layers-control":23,"./controls/null-layers-control":29,"./dom/pointer":36}],43:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.resolveBundle=void 0,n.resolveBundle=async function(t,e){const n=null==e?void 0:e.onprogress,o=!(!1===(null==e?void 0:e.httpCache));return new Promise(((e,i)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.overrideMimeType("text/plain; charset=x-user-defined"),r.addEventListener("error",(()=>{i(new Error("Network error, can't download "+t))})),r.addEventListener("abort",(()=>{i(new Error("Request canceled for url "+t))}),!1),r.responseType="arraybuffer",r.onreadystatechange=()=>{4===r.readyState&&(200===r.status?(void 0!==n&&n(100),e(new Uint8Array(r.response))):i(new Error("Network error, can't download "+t)))},void 0!==n&&(r.onprogress=t=>{if(t.total&&t.total>0){const e=Math.round(1e4*t.loaded/t.total)/100;n(e)}}),!1===o&&(r.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),r.setRequestHeader("Expires","Tue, 01 Jan 1980 1:00:00 GMT"),r.setRequestHeader("Pragma","no-cache")),r.send()}))}},{}],44:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.notyf=void 0,n.notyf=function(t,e){const n=t.notyf;e.events().onMessage((function(t){if("error"===t){for(var e=arguments.length,o=new Array(e>1?e-1:0),i=1;i<e;i++)o[i-1]=arguments[i];n.error({message:JSON.stringify(o)})}}))}},{}],45:[function(t,e,n){"use strict";function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(n,"__esModule",{value:!0}),n.makeCache=void 0;class i{close(){}put(t,e){return Promise.resolve()}get(t,e){return void 0!==e?Promise.resolve(e):Promise.reject(new Error("Cache is not supported on this host"))}forEach(t,e){e()}}n.makeCache=function(t,e){return new Promise((n=>{new r(t,n,(t=>{e.onErr(t),n(new i)}))}))};class r{constructor(t,e,n){if(o(this,"version",void 0),o(this,"storeName","files"),o(this,"indexedDB",void 0),o(this,"db",null),this.version=t,this.indexedDB="undefined"==typeof window?void 0:window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.indexedDB)try{const o=this.indexedDB.open("js-dos-cache ("+t+")",1);o.onerror=t=>{var e;n("Can't open cache database: "+(null===(e=o.error)||void 0===e?void 0:e.message))},o.onsuccess=t=>{this.db=o.result,e(this)},o.onupgradeneeded=t=>{try{this.db=o.result,this.db.onerror=t=>{n("Can't upgrade cache database")},this.db.createObjectStore(this.storeName)}catch(t){n("Can't upgrade cache database")}}}catch(t){n("Can't open cache database: "+t.message)}else n("Indexed db is not supported on this host")}close(){null!==this.db&&(this.db.close(),this.db=null)}put(t,e){return new Promise((n=>{if(null===this.db)return void n();const o=this.db.transaction(this.storeName,"readwrite");o.oncomplete=()=>n(),o.objectStore(this.storeName).put(e,t)}))}get(t,e){return new Promise(((n,o)=>{function i(t){void 0===e?o(new Error(t)):n(e)}if(null===this.db)return void i("db is not initalized");const r=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).get(t);r.onerror=()=>o(new Error("Can't read value for key '"+t+"'")),r.onsuccess=()=>{r.result?n(r.result):i("Result is empty for key '"+t+"', result: "+r.result)}}))}forEach(t,e){if(null===this.db)return void e();const n=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).openCursor();n.onerror=()=>e(),n.onsuccess=n=>{const o=n.target.result;o?(t(o.key.toString(),o.value),o.continue()):e()}}}},{}],46:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.load=n.save=void 0;const o=(0,t("./cache").makeCache)("emulators-ui-saves",{onErr:console.error});n.save=function(t,e,n,i){e.setOnSave((async()=>{const e=await o,i=await n.persist();return e.put(t,i.buffer)}))},n.load=async function(t,e){return(await o).get(t).then((t=>new Uint8Array(t)))}},{"./cache":45}],47:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.audioNode=void 0;class o{constructor(){var t,e,n;n=[],(e="samplesQueue")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}push(t){this.samplesQueue.push(t)}length(){let t=0;for(const e of this.samplesQueue)t+=e.length;return t}writeTo(t,e){let n=0;for(;this.samplesQueue.length>0;){const o=this.samplesQueue[0],i=Math.min(e-n,o.length);if(i===o.length?(t.set(o,n),this.samplesQueue.shift()):(t.set(o.slice(0,i),n),this.samplesQueue[0]=o.slice(i)),n+=i,n===e)break}n<e&&t.fill(0,n)}}n.audioNode=function(t){const e=t.soundFrequency();if(0===e)return console.warn("Can't create audio node with sampleRate === 0, ingnoring"),()=>{};let n=null;if("undefined"!=typeof AudioContext?n=new AudioContext({sampleRate:e,latencyHint:"interactive"}):void 0!==window.webkitAudioContext&&(n=new window.webkitAudioContext({sampleRate:e,latencyHint:"interactive"})),null==n)return()=>{};const i=new o;t.events().onSoundPush((t=>{i.length()<6144&&i.push(t)}));const r=n.createScriptProcessor(2048,0,1);let s=!1,a=0;const c=t.directSound;r.onaudioprocess=void 0!==t.directSound?t=>{if(!s){const t=c.buffer[0];s=Math.ceil(t[t.length-1])>0}if(!s)return;let e=0,n=t.outputBuffer.length;const o=t.outputBuffer.numberOfChannels;let i,r=c.buffer[a];for(;n>0&&(i=Math.ceil(r[r.length-1]))>0;)if(n>=i){const s=r.subarray(0,i);for(let n=0;n<o;++n){t.outputBuffer.getChannelData(n).set(s,e)}e+=i,n-=i,r[r.length-1]=0,a=(a+1)%c.ringSize,r=c.buffer[a]}else{const s=r.subarray(0,n);for(let n=0;n<o;++n){t.outputBuffer.getChannelData(n).set(s,e)}r[r.length-1]=i-n,r.set(r.subarray(n,n+r[r.length-1])),n=0}}:t=>{const e=t.outputBuffer.length,n=t.outputBuffer.numberOfChannels,o=i.length();if(s||(s=o>=2048),s)for(let o=0;o<n;o++){const n=t.outputBuffer.getChannelData(o);i.writeTo(n,e)}};const u=n.createGain();u.connect(n.destination),r.connect(u),u.gain.value=1;const l=()=>{null!==n&&"suspended"===n.state&&n.resume()};return document.addEventListener("click",l,{once:!0}),document.addEventListener("touchstart",l,{once:!0}),document.addEventListener("keydown",l,{once:!0}),t.events().onExit((()=>{null!==n&&(r.disconnect(),u.disconnect(),n.close()),document.removeEventListener("click",l),document.removeEventListener("touchstart",l),document.removeEventListener("keydown",l)})),t=>{u.gain.value=t}}},{}]},{},[38]);
//# sourceMappingURL=emulators-ui.js.map